@ai-matrx/design-system 0.18.12 → 0.18.14

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.
@@ -1899,6 +1899,7 @@ import {
1899
1899
 
1900
1900
  // src/content-transfer/index.tsx
1901
1901
  import * as React13 from "react";
1902
+ import { createPortal } from "react-dom";
1902
1903
  import {
1903
1904
  applySectionSelection,
1904
1905
  applyTransferLimits,
@@ -2484,7 +2485,10 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2484
2485
  }, children: /* @__PURE__ */ jsx21(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
2485
2486
  ] })
2486
2487
  ] }),
2487
- notice ? /* @__PURE__ */ jsx21("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
2488
+ notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-feedback", children: [
2489
+ /* @__PURE__ */ jsx21("span", { role: "status", children: notice }),
2490
+ /* @__PURE__ */ jsx21("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
2491
+ ] }), triggerRef.current.ownerDocument.body) : null,
2488
2492
  Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx21(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key))
2489
2493
  ] });
2490
2494
  }
@@ -2801,15 +2805,36 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
2801
2805
  /* @__PURE__ */ jsx21("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
2802
2806
  ] }, key))
2803
2807
  ] }) : null,
2804
- rows ? /* @__PURE__ */ jsx21(RowControls, { rows, controls, change: changeControls }) : null,
2805
- state.snapshot.sections.length ? /* @__PURE__ */ jsxs13("fieldset", { className: "matrx-alchemy-options", children: [
2806
- /* @__PURE__ */ jsx21("legend", { children: "Sections" }),
2807
- state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs13("label", { children: [
2808
+ rows ? /* @__PURE__ */ jsxs13("details", { className: "matrx-alchemy-options matrx-alchemy-data-controls", children: [
2809
+ /* @__PURE__ */ jsxs13("summary", { children: [
2810
+ "Data selection \xB7 ",
2811
+ controls.visibleColumns.length,
2812
+ " columns",
2813
+ controls.search || controls.sort || controls.top != null || controls.selectedOnly || Object.values(controls.filters).some(Boolean) ? " \xB7 customized" : " \xB7 all rows"
2814
+ ] }),
2815
+ /* @__PURE__ */ jsx21("div", { className: "matrx-alchemy-data-controls-body", children: /* @__PURE__ */ jsx21(RowControls, { rows, controls, change: changeControls }) })
2816
+ ] }) : null,
2817
+ state.snapshot.sections.length ? /* @__PURE__ */ jsxs13("details", { className: "matrx-alchemy-options", children: [
2818
+ /* @__PURE__ */ jsxs13("summary", { children: [
2819
+ "Sections \xB7 ",
2820
+ controls.sections.length,
2821
+ " included"
2822
+ ] }),
2823
+ /* @__PURE__ */ jsx21("fieldset", { "aria-label": "Included sections", children: state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs13("label", { children: [
2808
2824
  /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
2809
2825
  " ",
2810
2826
  section.label
2811
- ] }, section.id))
2827
+ ] }, section.id)) })
2812
2828
  ] }) : null,
2829
+ /* @__PURE__ */ jsxs13("label", { className: "matrx-alchemy-preview-label", children: [
2830
+ "Output format",
2831
+ /* @__PURE__ */ jsxs13("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
2832
+ formats.map((f) => /* @__PURE__ */ jsx21("option", { value: f, children: LABEL[f] }, f)),
2833
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx21("option", { value: "xlsx", children: "Excel workbook" }) : null,
2834
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx21("option", { value: adapter.id, children: adapter.label }, adapter.id))
2835
+ ] })
2836
+ ] }),
2837
+ /* @__PURE__ */ jsx21("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
2813
2838
  /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-coverage", children: [
2814
2839
  /* @__PURE__ */ jsxs13("span", { children: [
2815
2840
  state.snapshot.coverage.included.toLocaleString(),
@@ -2836,15 +2861,6 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
2836
2861
  ] }, `${o.path}-${o.reason}-${i}`)) })
2837
2862
  ] }) : null
2838
2863
  ] }),
2839
- /* @__PURE__ */ jsxs13("label", { className: "matrx-alchemy-preview-label", children: [
2840
- "Output format",
2841
- /* @__PURE__ */ jsxs13("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
2842
- formats.map((f) => /* @__PURE__ */ jsx21("option", { value: f, children: LABEL[f] }, f)),
2843
- state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx21("option", { value: "xlsx", children: "Excel workbook" }) : null,
2844
- workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx21("option", { value: adapter.id, children: adapter.label }, adapter.id))
2845
- ] })
2846
- ] }),
2847
- /* @__PURE__ */ jsx21("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
2848
2864
  bufferError ? /* @__PURE__ */ jsx21("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
2849
2865
  formatError ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
2850
2866
  bufferError ? /* @__PURE__ */ jsx21(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
@@ -4048,24 +4064,26 @@ function CopySubsetDialog({ source, onClose }) {
4048
4064
  }
4049
4065
  return /* @__PURE__ */ jsx24(Dialog, { open: true, onOpenChange: (open) => {
4050
4066
  if (!open) onClose();
4051
- }, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
4067
+ }, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "matrx-alchemy-workspace matrx-alchemy-subset", children: [
4052
4068
  /* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Filter & sort before copying" }) }),
4053
- /* @__PURE__ */ jsxs15("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
4054
- /* @__PURE__ */ jsx24("legend", { children: "Visible columns" }),
4055
- source.columns.map((column) => /* @__PURE__ */ jsxs15("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4056
- /* @__PURE__ */ jsx24("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4057
- const next = new Set(current);
4058
- next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4059
- return next;
4060
- }) }),
4061
- column.header
4062
- ] }, column.id))
4069
+ /* @__PURE__ */ jsxs15("div", { className: "matrx-alchemy-workspace-body matrx-alchemy-subset-body", children: [
4070
+ /* @__PURE__ */ jsxs15("fieldset", { className: "matrx-alchemy-subset-columns", children: [
4071
+ /* @__PURE__ */ jsx24("legend", { children: "Visible columns" }),
4072
+ source.columns.map((column) => /* @__PURE__ */ jsxs15("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4073
+ /* @__PURE__ */ jsx24("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4074
+ const next = new Set(current);
4075
+ next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4076
+ return next;
4077
+ }) }),
4078
+ column.header
4079
+ ] }, column.id))
4080
+ ] }),
4081
+ columns.length ? /* @__PURE__ */ jsx24("div", { className: "matrx-alchemy-subset-table", children: /* @__PURE__ */ jsx24(MatrxDataTable, { copy: false, data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx24("p", { children: "Show at least one column to copy." }),
4082
+ buildError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4083
+ notice
4063
4084
  ] }),
4064
- columns.length ? /* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx24(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx24("p", { children: "Show at least one column to copy." }),
4065
- buildError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4066
- notice,
4067
4085
  /* @__PURE__ */ jsxs15(DialogFooter, { children: [
4068
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-sm", children: [
4086
+ /* @__PURE__ */ jsxs15("label", { className: "matrx-alchemy-subset-format", children: [
4069
4087
  "Format",
4070
4088
  /* @__PURE__ */ jsxs15("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
4071
4089
  /* @__PURE__ */ jsx24("option", { value: "ai", children: "For AI" }),
@@ -4084,8 +4102,8 @@ function CopySubsetDialog({ source, onClose }) {
4084
4102
  text.length.toLocaleString(),
4085
4103
  " characters"
4086
4104
  ] }),
4087
- /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
4088
- /* @__PURE__ */ jsx24(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4105
+ /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: onClose, children: "Close" }),
4106
+ /* @__PURE__ */ jsx24(Button, { type: "button", className: "matrx-alchemy-workspace-primary", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4089
4107
  ] })
4090
4108
  ] }) });
4091
4109
  }