@ai-matrx/records-ui 0.116.44 → 0.116.45

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/dist/pickers.cjs CHANGED
@@ -521,6 +521,18 @@ var init_ArchivedOrganizationNotice = __esm({
521
521
  }
522
522
  });
523
523
 
524
+ // src/refusalSaid.ts
525
+ function refusalTimedOut(error) {
526
+ return (0, import_design_system3.isTimedOutError)(error);
527
+ }
528
+ var import_design_system3;
529
+ var init_refusalSaid = __esm({
530
+ "src/refusalSaid.ts"() {
531
+ "use strict";
532
+ import_design_system3 = require("@ai-matrx/design-system");
533
+ }
534
+ });
535
+
524
536
  // src/Refusal.tsx
525
537
  function RefusalNotice({
526
538
  error,
@@ -534,7 +546,8 @@ function RefusalNotice({
534
546
  if (archivedOrg) {
535
547
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ArchivedOrganizationNotice, { organizationId: archivedOrg, error, className });
536
548
  }
537
- const plain = refusalForAPerson(error);
549
+ const said2 = refusalForAPerson(error);
550
+ const plain = refusalTimedOut(error) ? { ...said2, sentence: import_design_system4.TIMED_OUT_SENTENCE, storeSaid: true } : said2;
538
551
  const doors = onKeepEditing || onDiscard || onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-wrap items-center gap-1 pt-0.5", "data-refusal-doors": "", children: [
539
552
  onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
540
553
  "button",
@@ -568,18 +581,18 @@ function RefusalNotice({
568
581
  ) : null
569
582
  ] }) : null;
570
583
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
571
- import_design_system3.Alert,
584
+ import_design_system4.Alert,
572
585
  {
573
586
  variant: "destructive",
574
587
  role: "alert",
575
588
  "data-refusal-notice": "",
576
- className: (0, import_design_system3.cn)("text-xs", className),
589
+ className: (0, import_design_system4.cn)("text-xs", className),
577
590
  errorFacts: { message: plain.sentence, title: plain.title, error, origin: "records-ui/RefusalNotice" },
578
591
  ...plain.forEngineers ? { "data-for-engineers": plain.forEngineers } : {},
579
592
  ...error.sqlstate ? { "data-sqlstate": error.sqlstate } : {},
580
593
  children: [
581
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.AlertTitle, { className: "text-xs font-medium", children: plain.storeSaid ? plain.sentence : plain.title }),
582
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system3.AlertDescription, { className: "space-y-1 text-xs", children: [
594
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system4.AlertTitle, { className: "text-xs font-medium", children: plain.storeSaid ? plain.sentence : plain.title }),
595
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system4.AlertDescription, { className: "space-y-1 text-xs", children: [
583
596
  plain.storeSaid || plain.sentence.replace(/\.$/, "") === plain.title ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: plain.sentence }),
584
597
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "opacity-80", children: plain.remedy }),
585
598
  actions,
@@ -589,29 +602,39 @@ function RefusalNotice({
589
602
  }
590
603
  );
591
604
  }
592
- function RefusalLine({ error, className }) {
605
+ function RefusalLine({
606
+ error,
607
+ className,
608
+ onRetry
609
+ }) {
593
610
  const plain = refusalForAPerson(error);
594
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
595
- import_design_system3.ErrorBox,
596
- {
597
- "data-refusal-line": "",
598
- className: (0, import_design_system3.cn)("whitespace-normal break-words text-xs text-destructive [overflow-wrap:anywhere]", className),
599
- message: (0, import_core.archivedOrganizationId)(error) ? "This organization is archived. An owner can restore it." : refusalLineForAPerson(error),
600
- error,
601
- origin: "records-ui/RefusalLine",
602
- ...plain.forEngineers ? { "data-for-engineers": plain.forEngineers } : {}
603
- }
604
- );
611
+ const timedOut = refusalTimedOut(error);
612
+ const line = timedOut ? import_design_system4.TIMED_OUT_SENTENCE : refusalLineForAPerson(error);
613
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
614
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
615
+ import_design_system4.ErrorBox,
616
+ {
617
+ "data-refusal-line": "",
618
+ className: (0, import_design_system4.cn)("whitespace-normal break-words text-xs text-destructive [overflow-wrap:anywhere]", className),
619
+ message: (0, import_core.archivedOrganizationId)(error) ? "This organization is archived. An owner can restore it." : line,
620
+ error,
621
+ origin: "records-ui/RefusalLine",
622
+ ...plain.forEngineers ? { "data-for-engineers": plain.forEngineers } : {}
623
+ }
624
+ ),
625
+ timedOut && onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "data-refusal-retry": "", className: "rounded border px-2 py-0.5 text-xs hover:bg-muted", onClick: onRetry, children: "Try again" }) : null
626
+ ] });
605
627
  }
606
- var import_core, import_design_system3, import_jsx_runtime4;
628
+ var import_core, import_design_system4, import_jsx_runtime4;
607
629
  var init_Refusal = __esm({
608
630
  "src/Refusal.tsx"() {
609
631
  "use strict";
610
632
  "use client";
611
633
  import_core = require("@ai-matrx/records/core");
612
- import_design_system3 = require("@ai-matrx/design-system");
634
+ import_design_system4 = require("@ai-matrx/design-system");
613
635
  init_ArchivedOrganizationNotice();
614
636
  init_plainWords();
637
+ init_refusalSaid();
615
638
  import_jsx_runtime4 = require("react/jsx-runtime");
616
639
  }
617
640
  });
@@ -885,7 +908,7 @@ function PersonAvatar({ name, size = "sm" }) {
885
908
  {
886
909
  "aria-hidden": "true",
887
910
  "data-records-person-avatar": "",
888
- className: (0, import_design_system6.cn)(
911
+ className: (0, import_design_system7.cn)(
889
912
  "inline-flex shrink-0 items-center justify-center rounded-full bg-foreground/10 font-medium text-foreground/80",
890
913
  size === "md" ? "size-5 text-[10px]" : "size-4 text-[9px]"
891
914
  ),
@@ -899,7 +922,7 @@ function PersonChip({ name, onRemove, onOpen, className }) {
899
922
  {
900
923
  "data-records-person-chip": "",
901
924
  title: name,
902
- className: (0, import_design_system6.cn)("inline-flex min-w-0 max-w-full items-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-foreground", className),
925
+ className: (0, import_design_system7.cn)("inline-flex min-w-0 max-w-full items-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-foreground", className),
903
926
  children: [
904
927
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PersonAvatar, { name }),
905
928
  onOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: onOpen, "data-records-person-open": "", className: "min-w-0 truncate hover:underline", children: name }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-w-0 truncate", children: name }),
@@ -908,12 +931,12 @@ function PersonChip({ name, onRemove, onOpen, className }) {
908
931
  }
909
932
  );
910
933
  }
911
- var import_design_system6, import_format, import_jsx_runtime7, PERSON_INITIALS;
934
+ var import_design_system7, import_format, import_jsx_runtime7, PERSON_INITIALS;
912
935
  var init_personChip = __esm({
913
936
  "src/personChip.tsx"() {
914
937
  "use strict";
915
938
  "use client";
916
- import_design_system6 = require("@ai-matrx/design-system");
939
+ import_design_system7 = require("@ai-matrx/design-system");
917
940
  import_format = require("@ai-matrx/kit/format");
918
941
  import_jsx_runtime7 = require("react/jsx-runtime");
919
942
  PERSON_INITIALS = { splitHandles: true, dropHonorifics: true };
@@ -990,7 +1013,7 @@ function PickRow({
990
1013
  title: title ?? label,
991
1014
  ...attrs ?? {},
992
1015
  "data-pick-highlighted": highlighted ? "" : void 0,
993
- className: (0, import_design_system7.cn)(
1016
+ className: (0, import_design_system8.cn)(
994
1017
  "flex w-full min-w-0 items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none disabled:opacity-50",
995
1018
  highlighted ? "bg-accent text-accent-foreground" : ""
996
1019
  ),
@@ -1001,7 +1024,7 @@ function PickRow({
1001
1024
  ] }),
1002
1025
  person ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PersonAvatar, { name: label, size: "md" }) : null,
1003
1026
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "min-w-0 flex-1", children: [
1004
- chip ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0, import_design_system7.cn)("inline-flex max-w-full truncate rounded-md border px-1.5 py-0.5 text-xs font-medium", chip), "data-records-choice-chip": "", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block truncate", children: label }),
1027
+ chip ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0, import_design_system8.cn)("inline-flex max-w-full truncate rounded-md border px-1.5 py-0.5 text-xs font-medium", chip), "data-records-choice-chip": "", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block truncate", children: label }),
1005
1028
  detail ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block truncate text-xs text-muted-foreground", "data-tell-apart": "", children: detail }) : null
1006
1029
  ] })
1007
1030
  ]
@@ -1016,7 +1039,7 @@ function PickChips({ chips }) {
1016
1039
  {
1017
1040
  "data-pick-chip": "",
1018
1041
  title: c.label,
1019
- className: (0, import_design_system7.cn)(
1042
+ className: (0, import_design_system8.cn)(
1020
1043
  "inline-flex max-w-full items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-medium",
1021
1044
  c.chip ?? "bg-secondary text-secondary-foreground"
1022
1045
  ),
@@ -1097,10 +1120,10 @@ function PickOrAdd({
1097
1120
  onPoint: () => keys.setHighlight(addAt)
1098
1121
  }
1099
1122
  ) : null;
1100
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system7.Popover, { open, onOpenChange, children: [
1101
- anchored ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system7.PopoverAnchor, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-pick-anchor": "", className: "flex min-h-6 w-full min-w-0 flex-wrap items-center gap-1", "aria-label": triggerLabel, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system7.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system7.Button, { id: triggerId, type: "button", size: "sm", variant: "outline", className: triggerSize === "field" ? "h-9" : void 0, "aria-label": triggerLabel, children: triggerText }) }),
1123
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system8.Popover, { open, onOpenChange, children: [
1124
+ anchored ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.PopoverAnchor, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-pick-anchor": "", className: "flex min-h-6 w-full min-w-0 flex-wrap items-center gap-1", "aria-label": triggerLabel, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.Button, { id: triggerId, type: "button", size: "sm", variant: "outline", className: triggerSize === "field" ? "h-9" : void 0, "aria-label": triggerLabel, children: triggerText }) }),
1102
1125
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1103
- import_design_system7.PopoverContent,
1126
+ import_design_system8.PopoverContent,
1104
1127
  {
1105
1128
  sizing: "content",
1106
1129
  padding: "xs",
@@ -1123,7 +1146,7 @@ function PickOrAdd({
1123
1146
  children: [
1124
1147
  chips ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PickChips, { chips }) : null,
1125
1148
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1126
- import_design_system7.BasicInput,
1149
+ import_design_system8.BasicInput,
1127
1150
  {
1128
1151
  value: search,
1129
1152
  onChange: (e) => onSearch(e.target.value),
@@ -1136,7 +1159,7 @@ function PickOrAdd({
1136
1159
  }
1137
1160
  ),
1138
1161
  notice,
1139
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system7.ScrollArea, { className: "max-h-64", children: [
1162
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system8.ScrollArea, { className: "max-h-64", children: [
1140
1163
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "listbox", "aria-label": triggerLabel, "aria-multiselectable": multi ? true : void 0, children: [
1141
1164
  items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1142
1165
  PickRow,
@@ -1168,14 +1191,14 @@ function PickOrAdd({
1168
1191
  )
1169
1192
  ] });
1170
1193
  }
1171
- var import_react9, import_design_system7, import_jsx_runtime8, TICK, CROSS, PLUS;
1194
+ var import_react9, import_design_system8, import_jsx_runtime8, TICK, CROSS, PLUS;
1172
1195
  var init_PickOrAdd = __esm({
1173
1196
  "src/PickOrAdd.tsx"() {
1174
1197
  "use strict";
1175
1198
  "use client";
1176
1199
  import_react9 = require("react");
1177
1200
  init_personChip();
1178
- import_design_system7 = require("@ai-matrx/design-system");
1201
+ import_design_system8 = require("@ai-matrx/design-system");
1179
1202
  import_jsx_runtime8 = require("react/jsx-runtime");
1180
1203
  TICK = "m5 12 4 4L19 6";
1181
1204
  CROSS = "M18 6 6 18M6 6l12 12";
@@ -1285,14 +1308,14 @@ function ShowListsToggle({
1285
1308
  className
1286
1309
  }) {
1287
1310
  if (count === 0) return null;
1288
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: (0, import_design_system10.cn)("flex items-center gap-1.5 text-[11px] text-muted-foreground", className), children: [
1289
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system10.Checkbox, { checked: on, onCheckedChange: (next) => onChange(next === true), "aria-label": "Show lists" }),
1311
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: (0, import_design_system11.cn)("flex items-center gap-1.5 text-[11px] text-muted-foreground", className), children: [
1312
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system11.Checkbox, { checked: on, onCheckedChange: (next) => onChange(next === true), "aria-label": "Show lists" }),
1290
1313
  "Show lists (",
1291
1314
  count,
1292
1315
  ")"
1293
1316
  ] });
1294
1317
  }
1295
- var import_react13, import_records4, import_react14, import_design_system10, import_jsx_runtime12;
1318
+ var import_react13, import_records4, import_react14, import_design_system11, import_jsx_runtime12;
1296
1319
  var init_tablePicking = __esm({
1297
1320
  "src/tablePicking.tsx"() {
1298
1321
  "use strict";
@@ -1300,7 +1323,7 @@ var init_tablePicking = __esm({
1300
1323
  import_react13 = require("react");
1301
1324
  import_records4 = require("@ai-matrx/records");
1302
1325
  import_react14 = require("@ai-matrx/records/react");
1303
- import_design_system10 = require("@ai-matrx/design-system");
1326
+ import_design_system11 = require("@ai-matrx/design-system");
1304
1327
  init_tablePickerEntries();
1305
1328
  import_jsx_runtime12 = require("react/jsx-runtime");
1306
1329
  }
@@ -1430,7 +1453,7 @@ function PickOne({
1430
1453
  if (options.length > PICK_ONE_SEARCH_AFTER) {
1431
1454
  const q = search.trim().toLowerCase();
1432
1455
  const shown2 = q === "" ? options : options.filter((o) => o.label.toLowerCase().includes(q));
1433
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_design_system17.cn)("inline-flex min-w-0", className), "data-records-pick-one": "search", "data-pick-value": value, ...attrs ?? {}, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1456
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_design_system18.cn)("inline-flex min-w-0", className), "data-records-pick-one": "search", "data-pick-value": value, ...attrs ?? {}, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1434
1457
  PickOrAdd,
1435
1458
  {
1436
1459
  triggerSize: "compact",
@@ -1460,25 +1483,25 @@ function PickOne({
1460
1483
  }
1461
1484
  ) });
1462
1485
  }
1463
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system17.Select, { value: current ? inner(current.value) : "", onValueChange: (v) => onChange(outer(v)), disabled: disabled ?? false, children: [
1486
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system18.Select, { value: current ? inner(current.value) : "", onValueChange: (v) => onChange(outer(v)), disabled: disabled ?? false, children: [
1464
1487
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1465
- import_design_system17.SelectTrigger,
1488
+ import_design_system18.SelectTrigger,
1466
1489
  {
1467
1490
  id,
1468
1491
  size: "sm",
1469
1492
  "aria-label": label,
1470
- className: (0, import_design_system17.cn)("h-7 w-auto min-w-[7rem] text-xs", className),
1493
+ className: (0, import_design_system18.cn)("h-7 w-auto min-w-[7rem] text-xs", className),
1471
1494
  "data-records-pick-one": "list",
1472
1495
  "data-pick-value": value,
1473
1496
  ...attrs ?? {},
1474
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system17.SelectValue, { placeholder })
1497
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectValue, { placeholder })
1475
1498
  }
1476
1499
  ),
1477
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system17.SelectContent, { children: groupsOf(options).map(
1478
- ([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system17.SelectGroup, { children: [
1479
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system17.SelectLabel, { children: group }),
1480
- items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system17.SelectItem, { value: inner(o.value), "data-pick-value": o.value, "data-pick-group": group, children: o.label }, inner(o.value)))
1481
- ] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system17.SelectItem, { value: inner(o.value), "data-pick-value": o.value, children: o.label }, inner(o.value)))
1500
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectContent, { children: groupsOf(options).map(
1501
+ ([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system18.SelectGroup, { children: [
1502
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectLabel, { children: group }),
1503
+ items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectItem, { value: inner(o.value), "data-pick-value": o.value, "data-pick-group": group, children: o.label }, inner(o.value)))
1504
+ ] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectItem, { value: inner(o.value), "data-pick-value": o.value, children: o.label }, inner(o.value)))
1482
1505
  ) })
1483
1506
  ] });
1484
1507
  }
@@ -1491,13 +1514,13 @@ function groupsOf(options) {
1491
1514
  }
1492
1515
  return out;
1493
1516
  }
1494
- var import_react29, import_design_system17, import_jsx_runtime22, PICK_ONE_SEARCH_AFTER, EMPTY, inner, outer;
1517
+ var import_react29, import_design_system18, import_jsx_runtime22, PICK_ONE_SEARCH_AFTER, EMPTY, inner, outer;
1495
1518
  var init_PickOne = __esm({
1496
1519
  "src/PickOne.tsx"() {
1497
1520
  "use strict";
1498
1521
  "use client";
1499
1522
  import_react29 = require("react");
1500
- import_design_system17 = require("@ai-matrx/design-system");
1523
+ import_design_system18 = require("@ai-matrx/design-system");
1501
1524
  init_PickOrAdd();
1502
1525
  import_jsx_runtime22 = require("react/jsx-runtime");
1503
1526
  PICK_ONE_SEARCH_AFTER = 7;
@@ -1541,7 +1564,7 @@ function FilePicker({
1541
1564
  "div",
1542
1565
  {
1543
1566
  "data-matrx-file-picker": true,
1544
- className: (0, import_design_system22.cn)("flex min-w-0 flex-col gap-1", className),
1567
+ className: (0, import_design_system23.cn)("flex min-w-0 flex-col gap-1", className),
1545
1568
  onDragOver: (e) => {
1546
1569
  if (disabled) return;
1547
1570
  e.preventDefault();
@@ -1553,7 +1576,7 @@ function FilePicker({
1553
1576
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
1554
1577
  "div",
1555
1578
  {
1556
- className: (0, import_design_system22.cn)(
1579
+ className: (0, import_design_system23.cn)(
1557
1580
  "flex min-w-0 flex-wrap items-center gap-2 rounded-md border border-dashed px-2 py-1.5",
1558
1581
  over ? "border-primary bg-primary/5" : "border-border",
1559
1582
  disabled && "opacity-60"
@@ -1577,7 +1600,7 @@ function FilePicker({
1577
1600
  }
1578
1601
  ),
1579
1602
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1580
- import_design_system22.Button,
1603
+ import_design_system23.Button,
1581
1604
  {
1582
1605
  type: "button",
1583
1606
  size: "sm",
@@ -1588,7 +1611,7 @@ function FilePicker({
1588
1611
  }
1589
1612
  ),
1590
1613
  chosenName ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs", title: chosenName, children: chosenName }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: "or drop it here" }),
1591
- chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_design_system22.Button, { type: "button", size: "sm", variant: "ghost", disabled, onClick: onClear, children: "Cancel" }) : null
1614
+ chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_design_system23.Button, { type: "button", size: "sm", variant: "ghost", disabled, onClick: onClear, children: "Cancel" }) : null
1592
1615
  ]
1593
1616
  }
1594
1617
  ),
@@ -1597,13 +1620,13 @@ function FilePicker({
1597
1620
  }
1598
1621
  );
1599
1622
  }
1600
- var import_react35, import_design_system22, import_jsx_runtime27;
1623
+ var import_react35, import_design_system23, import_jsx_runtime27;
1601
1624
  var init_FilePicker = __esm({
1602
1625
  "src/FilePicker.tsx"() {
1603
1626
  "use strict";
1604
1627
  "use client";
1605
1628
  import_react35 = require("react");
1606
- import_design_system22 = require("@ai-matrx/design-system");
1629
+ import_design_system23 = require("@ai-matrx/design-system");
1607
1630
  import_jsx_runtime27 = require("react/jsx-runtime");
1608
1631
  }
1609
1632
  });
@@ -3305,7 +3328,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3305
3328
  void run();
3306
3329
  }, [autoRun, autoRan, source, phase, plan, busy, rights.write, rows.length, titleMissing, ruleVerdicts, run]);
3307
3330
  const afterWrite = !busy && (phase === "done" || alreadyRan !== null || ledger !== null && ledger.seen > 0);
3308
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_design_system26.cn)("flex min-w-0 flex-col gap-2 text-xs", className), children: [
3331
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_design_system27.cn)("flex min-w-0 flex-col gap-2 text-xs", className), children: [
3309
3332
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
3310
3333
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-medium", children: "Import" }),
3311
3334
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: table.data?.name }),
@@ -3352,7 +3375,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3352
3375
  titleKey && titleTakesWords ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2 rounded border bg-muted/40 px-2 py-1.5", children: [
3353
3376
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-medium", children: "What each record is called" }),
3354
3377
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3355
- import_design_system26.Select,
3378
+ import_design_system27.Select,
3356
3379
  {
3357
3380
  value: titleMappedTo ?? "",
3358
3381
  disabled: busy,
@@ -3373,15 +3396,15 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3373
3396
  },
3374
3397
  children: [
3375
3398
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3376
- import_design_system26.SelectTrigger,
3399
+ import_design_system27.SelectTrigger,
3377
3400
  {
3378
3401
  size: "sm",
3379
3402
  "aria-label": "Which column each record is named by",
3380
3403
  className: "min-w-[14rem]",
3381
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectValue, { placeholder: "\u2014 choose the column \u2014" })
3404
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectValue, { placeholder: "\u2014 choose the column \u2014" })
3382
3405
  }
3383
3406
  ),
3384
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectContent, { children: plan.columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectItem, { value: c.header, children: c.header }, c.header)) })
3407
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectContent, { children: plan.columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: c.header, children: c.header }, c.header)) })
3385
3408
  ]
3386
3409
  }
3387
3410
  ),
@@ -3404,7 +3427,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3404
3427
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "min-w-[8rem] flex-1 break-words font-medium", children: column.header }),
3405
3428
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "goes to" }),
3406
3429
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3407
- import_design_system26.Select,
3430
+ import_design_system27.Select,
3408
3431
  {
3409
3432
  value: leftOut.has(column.header) ? LEAVE : to || ABSENT,
3410
3433
  disabled: busy,
@@ -3424,19 +3447,19 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3424
3447
  },
3425
3448
  children: [
3426
3449
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3427
- import_design_system26.SelectTrigger,
3450
+ import_design_system27.SelectTrigger,
3428
3451
  {
3429
3452
  size: "sm",
3430
3453
  "aria-label": `Where ${column.header} goes`,
3431
3454
  "data-goes-to": column.header,
3432
3455
  className: "min-w-[14rem] flex-1",
3433
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectValue, {})
3456
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectValue, {})
3434
3457
  }
3435
3458
  ),
3436
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system26.SelectContent, { children: [
3437
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectItem, { value: ABSENT, children: absent }),
3438
- unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectItem, { value: LEAVE, children: "\u2014 leave it out \u2014" }) : null,
3439
- plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.SelectItem, { value: f.key, children: f.label || f.key }, f.field_id))
3459
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system27.SelectContent, { children: [
3460
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: ABSENT, children: absent }),
3461
+ unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: LEAVE, children: "\u2014 leave it out \u2014" }) : null,
3462
+ plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: f.key, children: f.label || f.key }, f.field_id))
3440
3463
  ] })
3441
3464
  ]
3442
3465
  }
@@ -3466,7 +3489,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3466
3489
  ]
3467
3490
  }
3468
3491
  ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3469
- import_design_system26.Badge,
3492
+ import_design_system27.Badge,
3470
3493
  {
3471
3494
  variant: column.matched ? "secondary" : "outline",
3472
3495
  className: "text-[11px] font-normal",
@@ -3515,7 +3538,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3515
3538
  column.header
3516
3539
  );
3517
3540
  }) }),
3518
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.Separator, {}),
3541
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
3519
3542
  titleRepeating && titleHeader && titleStats ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3520
3543
  "div",
3521
3544
  {
@@ -3640,7 +3663,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3640
3663
  nudge === "always_add" && rights.admin ? `Your organization adds new choices without asking, so ${ask.words.length === 1 ? "it is" : "they are"} added when you import.` : canAdd ? `Add ${ask.words.length === 1 ? "it" : "them"}, or the rows that use ${ask.words.length === 1 ? "it" : "them"} are refused.` : `The rows that use ${ask.words.length === 1 ? "it" : "them"} are refused${rights.admin ? " (your organization does not add new choices from an import)" : " \u2014 only someone who manages this table can add choices"}.`
3641
3664
  ] }),
3642
3665
  canAdd && nudge !== "always_add" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3643
- import_design_system26.Button,
3666
+ import_design_system27.Button,
3644
3667
  {
3645
3668
  size: "sm",
3646
3669
  variant: "outline",
@@ -3665,7 +3688,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3665
3688
  "div",
3666
3689
  {
3667
3690
  "data-import-relation": ask.field.key,
3668
- className: (0, import_design_system26.cn)(
3691
+ className: (0, import_design_system27.cn)(
3669
3692
  "flex flex-col gap-1 rounded border px-2 py-1.5",
3670
3693
  clean ? "bg-muted/40" : "border-amber-500/40 bg-amber-500/5"
3671
3694
  ),
@@ -3806,12 +3829,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3806
3829
  RefusalNotice,
3807
3830
  {
3808
3831
  error: problem,
3809
- actions: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.Button, { size: "sm", variant: "outline", className: "mt-1", disabled: busy, onClick: () => void run(), children: "Try again" })
3832
+ actions: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Button, { size: "sm", variant: "outline", className: "mt-1", disabled: busy, onClick: () => void run(), children: "Try again" })
3810
3833
  }
3811
3834
  ) }) : null,
3812
3835
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
3813
3836
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3814
- import_design_system26.Button,
3837
+ import_design_system27.Button,
3815
3838
  {
3816
3839
  size: "sm",
3817
3840
  disabled: busy || !rights.write || rows.length === 0 || titleMissing || ruleVerdicts.length > 0 && !goAheadAnyway,
@@ -3819,7 +3842,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3819
3842
  children: phase === "linking" ? "Linking the names\u2026" : phase === "declaring" ? "Adding the columns\u2026" : phase === "writing" ? `Writing\u2026 ${progress} of ${effectiveRows.length}` : combining ? `Import ${effectiveRows.length} records from ${rows.length} rows` : `Import ${rows.length} row${rows.length === 1 ? "" : "s"}`
3820
3843
  }
3821
3844
  ),
3822
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: (0, import_design_system26.cn)("text-muted-foreground", titleMissing && "text-destructive"), children: [
3845
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: (0, import_design_system27.cn)("text-muted-foreground", titleMissing && "text-destructive"), children: [
3823
3846
  titleMissing ? `Nothing goes into ${titleFieldLabel} yet, so these records would have no name. Choose the column above, then this will run.` : columnsSentence(mappedCount, plan.columns.length - leftOut.size, unmapped) + (leftOut.size > 0 ? ` \xB7 ${leftOut.size} left out` : ""),
3824
3847
  fileHash || titleMissing ? "" : " \xB7 this browser cannot recognize the file again, so importing it twice would write it twice"
3825
3848
  ] })
@@ -3840,14 +3863,14 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3840
3863
  ] }) : null,
3841
3864
  alreadyRan ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: alreadyRan }) : null,
3842
3865
  outcomes.length > 0 || summary || ledger ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3843
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.Separator, {}),
3866
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
3844
3867
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3845
3868
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: ledger ? `${ledger.written} landed \xB7 ${ledger.duplicate} already here \xB7 ${ledger.refused} refused, of ${ledger.seen} row${ledger.seen === 1 ? "" : "s"} offered` : `${counts.landed} landed \xB7 ${counts.duplicate} already here \xB7 ${counts.refused} refused` }),
3846
3869
  ledger && !ledger.final && phase !== "writing" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-destructive", children: "The run stopped here, so the rest of the file was never offered \u2014 these are the rows that were dealt with before it stopped, not the whole file." }) : null,
3847
3870
  (ledger ? ledger.refused + ledger.duplicate : counts.refused + counts.duplicate) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3848
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system26.cn)("underline underline-offset-2", show === "all" && "font-medium"), onClick: () => setShow("all"), children: "everything that did not land" }),
3849
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system26.cn)("underline underline-offset-2", show === "refused" && "font-medium"), onClick: () => setShow("refused"), children: "refused" }),
3850
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system26.cn)("underline underline-offset-2", show === "duplicate" && "font-medium"), onClick: () => setShow("duplicate"), children: "already here" })
3871
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "all" && "font-medium"), onClick: () => setShow("all"), children: "everything that did not land" }),
3872
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "refused" && "font-medium"), onClick: () => setShow("refused"), children: "refused" }),
3873
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "duplicate" && "font-medium"), onClick: () => setShow("duplicate"), children: "already here" })
3851
3874
  ] }) : null
3852
3875
  ] }),
3853
3876
  summary ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: summary }) : null,
@@ -3868,7 +3891,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3868
3891
  g.example
3869
3892
  ] }, g.reason)) }),
3870
3893
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3871
- import_design_system26.Button,
3894
+ import_design_system27.Button,
3872
3895
  {
3873
3896
  size: "sm",
3874
3897
  variant: "outline",
@@ -3943,7 +3966,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3943
3966
  p.state === "waiting" ? " is waiting in the approvals inbox." : p.state === "accepted" ? " was added as a column." : p.state === "ignored" ? " was left out." : p.state === "refused" ? ` could not be added: ${p.reason ?? ""}` : ` \u2014 ${p.state}`
3944
3967
  ] }, p.column)) }) : null,
3945
3968
  phase === "done" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3946
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.Button, { size: "sm", onClick: () => onDone?.(ledger?.written ?? 0), children: "Done" }),
3969
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Button, { size: "sm", onClick: () => onDone?.(ledger?.written ?? 0), children: "Done" }),
3947
3970
  (ledger?.refused ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "text-muted-foreground", children: [
3948
3971
  "The ",
3949
3972
  ledger?.refused,
@@ -3961,7 +3984,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
3961
3984
  ] }) : null,
3962
3985
  runsProblem ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RefusalNotice, { error: runsProblem }) : null,
3963
3986
  runs && runs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3964
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system26.Separator, {}),
3987
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
3965
3988
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "font-medium", children: "Imports into this table" }),
3966
3989
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { className: "flex flex-col gap-1", children: runs.map((r) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("li", { className: "flex flex-col gap-1", children: [
3967
3990
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
@@ -4024,7 +4047,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
4024
4047
  table.error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RefusalNotice, { error: table.error, onRetry: table.reload }) : null
4025
4048
  ] });
4026
4049
  }
4027
- var import_react45, import_react46, import_core6, import_design_system26, import_records15, import_text_case5, import_jsx_runtime31, BATCH, SAMPLES, COLUMNS_PER_CALL, ABSENT, LEAVE, TITLE_COPY, TYPED_VALUES;
4050
+ var import_react45, import_react46, import_core6, import_design_system27, import_records15, import_text_case5, import_jsx_runtime31, BATCH, SAMPLES, COLUMNS_PER_CALL, ABSENT, LEAVE, TITLE_COPY, TYPED_VALUES;
4028
4051
  var init_ImportWizard = __esm({
4029
4052
  "src/ImportWizard.tsx"() {
4030
4053
  "use strict";
@@ -4032,7 +4055,7 @@ var init_ImportWizard = __esm({
4032
4055
  import_react45 = require("react");
4033
4056
  import_react46 = require("@ai-matrx/records/react");
4034
4057
  import_core6 = require("@ai-matrx/records/core");
4035
- import_design_system26 = require("@ai-matrx/design-system");
4058
+ import_design_system27 = require("@ai-matrx/design-system");
4036
4059
  import_records15 = require("@ai-matrx/records");
4037
4060
  init_Refusal();
4038
4061
  init_refusals();
@@ -4090,7 +4113,7 @@ var init_tableLanes = __esm({
4090
4113
  });
4091
4114
 
4092
4115
  // src/TablesHome.tsx
4093
- var import_react47, import_react48, import_core7, import_records16, import_design_system27, import_jsx_runtime32;
4116
+ var import_react47, import_react48, import_core7, import_records16, import_design_system28, import_jsx_runtime32;
4094
4117
  var init_TablesHome = __esm({
4095
4118
  "src/TablesHome.tsx"() {
4096
4119
  "use strict";
@@ -4099,7 +4122,7 @@ var init_TablesHome = __esm({
4099
4122
  import_react48 = require("@ai-matrx/records/react");
4100
4123
  import_core7 = require("@ai-matrx/records/core");
4101
4124
  import_records16 = require("@ai-matrx/records");
4102
- import_design_system27 = require("@ai-matrx/design-system");
4125
+ import_design_system28 = require("@ai-matrx/design-system");
4103
4126
  init_tableLanes();
4104
4127
  import_jsx_runtime32 = require("react/jsx-runtime");
4105
4128
  }
@@ -4209,7 +4232,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4209
4232
  [sourceName, headers, rows, sourceText]
4210
4233
  );
4211
4234
  if (!shape) {
4212
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: (0, import_design_system28.cn)("flex flex-col gap-2 text-sm", className), "data-save-to-table": "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Nothing here reads as rows \u2014 a table, a list, lines of \u201CName: value\u201D, CSV or pasted spreadsheet cells can be saved as a table." }) });
4235
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: (0, import_design_system29.cn)("flex flex-col gap-2 text-sm", className), "data-save-to-table": "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Nothing here reads as rows \u2014 a table, a list, lines of \u201CName: value\u201D, CSV or pasted spreadsheet cells can be saved as a table." }) });
4213
4236
  }
4214
4237
  const chooseShape = (i) => {
4215
4238
  setWhich(i);
@@ -4340,11 +4363,11 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4340
4363
  };
4341
4364
  makeRef.current = make;
4342
4365
  const busy = phase === "making" || phase === "writing";
4343
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: (0, import_design_system28.cn)("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
4366
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: (0, import_design_system29.cn)("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
4344
4367
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
4345
- shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system28.Select, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
4346
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectTrigger, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectValue, {}) }),
4347
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectContent, { children: shapes.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system28.SelectItem, { value: String(i), children: [
4368
+ shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.Select, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
4369
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
4370
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: shapes.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.SelectItem, { value: String(i), children: [
4348
4371
  s.name ? `${s.name} \u2014 ` : "",
4349
4372
  s.said
4350
4373
  ] }, i)) })
@@ -4353,7 +4376,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4353
4376
  shape.said
4354
4377
  ] }),
4355
4378
  shape.splits.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4356
- import_design_system28.Select,
4379
+ import_design_system29.Select,
4357
4380
  {
4358
4381
  value: split || "__one__",
4359
4382
  onValueChange: (v) => {
@@ -4362,10 +4385,10 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4362
4385
  },
4363
4386
  disabled: busy || phase === "done",
4364
4387
  children: [
4365
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectTrigger, { size: "sm", "aria-label": "How to read the list", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectValue, {}) }),
4366
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system28.SelectContent, { children: [
4367
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectItem, { value: "__one__", children: "One column" }),
4368
- shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectItem, { value: s.delimiter, children: s.label }, s.delimiter))
4388
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "How to read the list", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
4389
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.SelectContent, { children: [
4390
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: "__one__", children: "One column" }),
4391
+ shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: s.delimiter, children: s.label }, s.delimiter))
4369
4392
  ] })
4370
4393
  ]
4371
4394
  }
@@ -4384,13 +4407,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4384
4407
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: made.sentence }),
4385
4408
  problem ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: problem }) : null,
4386
4409
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-2", children: [
4387
- onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.Button, { size: "sm", onClick: () => onOpenTable(made.tableId), children: "Open the table" }) : null,
4388
- onClose ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.Button, { size: "sm", variant: "outline", onClick: onClose, children: "Done" }) : null
4410
+ onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", onClick: () => onOpenTable(made.tableId), children: "Open the table" }) : null,
4411
+ onClose ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", variant: "outline", onClick: onClose, children: "Done" }) : null
4389
4412
  ] })
4390
4413
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4391
4414
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap gap-2", role: "radiogroup", "aria-label": "Where to save these rows", children: [
4392
4415
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4393
- import_design_system28.Button,
4416
+ import_design_system29.Button,
4394
4417
  {
4395
4418
  size: "sm",
4396
4419
  variant: target === "new" ? "default" : "outline",
@@ -4402,7 +4425,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4402
4425
  }
4403
4426
  ),
4404
4427
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4405
- import_design_system28.Button,
4428
+ import_design_system29.Button,
4406
4429
  {
4407
4430
  size: "sm",
4408
4431
  variant: target === "existing" ? "default" : "outline",
@@ -4418,7 +4441,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4418
4441
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex flex-col gap-1", children: [
4419
4442
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: "Table name" }),
4420
4443
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4421
- import_design_system28.Input,
4444
+ import_design_system29.Input,
4422
4445
  {
4423
4446
  value: name ?? proposedName,
4424
4447
  onChange: (e) => setName(e.target.value),
@@ -4430,7 +4453,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4430
4453
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex flex-col gap-1", children: [
4431
4454
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: "Description (optional)" }),
4432
4455
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4433
- import_design_system28.Input,
4456
+ import_design_system29.Input,
4434
4457
  {
4435
4458
  value: description,
4436
4459
  onChange: (e) => setDescription(e.target.value),
@@ -4449,7 +4472,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4449
4472
  "data-save-to-table-column": c.header,
4450
4473
  children: [
4451
4474
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4452
- import_design_system28.Checkbox,
4475
+ import_design_system29.Checkbox,
4453
4476
  {
4454
4477
  checked: c.use,
4455
4478
  disabled: busy,
@@ -4458,7 +4481,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4458
4481
  }
4459
4482
  ),
4460
4483
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4461
- import_design_system28.Input,
4484
+ import_design_system29.Input,
4462
4485
  {
4463
4486
  value: c.label,
4464
4487
  "aria-label": `Name of the column ${c.header}`,
@@ -4467,7 +4490,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4467
4490
  }
4468
4491
  ),
4469
4492
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4470
- import_design_system28.Select,
4493
+ import_design_system29.Select,
4471
4494
  {
4472
4495
  value: c.guess.type,
4473
4496
  disabled: busy || !c.use,
@@ -4481,13 +4504,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4481
4504
  })
4482
4505
  ),
4483
4506
  children: [
4484
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectTrigger, { size: "sm", "aria-label": `What the column ${c.label || c.header} holds`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectValue, {}) }),
4485
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectContent, { children: SAVE_TO_TABLE_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectItem, { value: t, children: typeWord2(t) }, t)) })
4507
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": `What the column ${c.label || c.header} holds`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
4508
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: SAVE_TO_TABLE_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: t, children: typeWord2(t) }, t)) })
4486
4509
  ]
4487
4510
  }
4488
4511
  ),
4489
4512
  c.guess.type === "select" && c.use ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4490
- import_design_system28.Input,
4513
+ import_design_system29.Input,
4491
4514
  {
4492
4515
  className: "col-span-2 col-start-2",
4493
4516
  value: c.options,
@@ -4503,17 +4526,17 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4503
4526
  ] }),
4504
4527
  problem ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: problem }) : null,
4505
4528
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", children: [
4506
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.Button, { size: "sm", disabled: busy, onClick: () => void make(), children: phase === "making" ? "Making the table\u2026" : phase === "writing" ? "Writing the rows\u2026" : rows.length === 0 ? "Make the table with these columns" : `Make the table with ${rows.length} row${rows.length === 1 ? "" : "s"}` }),
4529
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", disabled: busy, onClick: () => void make(), children: phase === "making" ? "Making the table\u2026" : phase === "writing" ? "Writing the rows\u2026" : rows.length === 0 ? "Make the table with these columns" : `Make the table with ${rows.length} row${rows.length === 1 ? "" : "s"}` }),
4507
4530
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs text-muted-foreground", children: "Nothing is made until you press it." })
4508
4531
  ] })
4509
4532
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-2", "data-save-to-table-existing": "", children: [
4510
- tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system28.Select, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
4511
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectTrigger, { size: "sm", "aria-label": "Which table to add the rows to", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectValue, { placeholder: "Choose a table" }) }),
4512
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectContent, { children: writable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system28.SelectItem, { value: t.id, children: t.name }, t.id)) })
4533
+ tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.Select, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
4534
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "Which table to add the rows to", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, { placeholder: "Choose a table" }) }),
4535
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: writable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: t.id, children: t.name }, t.id)) })
4513
4536
  ] }),
4514
4537
  tableId ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col gap-1", "data-save-to-table-replace": "", children: replaced?.tableId === tableId ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-muted-foreground", children: replaced.count === 0 ? "The table held no rows, so nothing was archived." : `${replaced.count} row${replaced.count === 1 ? "" : "s"} it held moved to the archive, where ${replaced.count === 1 ? "it" : "they"} can be restored. The rows below go in their place.` }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-2 text-xs", children: [
4515
4538
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4516
- import_design_system28.Checkbox,
4539
+ import_design_system29.Checkbox,
4517
4540
  {
4518
4541
  checked: replaceAsked,
4519
4542
  disabled: busy || replacing,
@@ -4524,7 +4547,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4524
4547
  "Replace what this table holds (its current rows move to the archive first)"
4525
4548
  ] }) }) : null,
4526
4549
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4527
- import_design_system28.ConfirmDialog,
4550
+ import_design_system29.ConfirmDialog,
4528
4551
  {
4529
4552
  open: replaceAsked && Boolean(tableId) && replaced?.tableId !== tableId,
4530
4553
  onOpenChange: (open) => {
@@ -4583,14 +4606,14 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4583
4606
  ] })
4584
4607
  ] });
4585
4608
  }
4586
- var import_react49, import_react50, import_design_system28, import_jsx_runtime33, SAVE_TO_TABLE_TYPES;
4609
+ var import_react49, import_react50, import_design_system29, import_jsx_runtime33, SAVE_TO_TABLE_TYPES;
4587
4610
  var init_SaveToTable = __esm({
4588
4611
  "src/SaveToTable.tsx"() {
4589
4612
  "use strict";
4590
4613
  "use client";
4591
4614
  import_react49 = require("react");
4592
4615
  import_react50 = require("@ai-matrx/records/react");
4593
- import_design_system28 = require("@ai-matrx/design-system");
4616
+ import_design_system29 = require("@ai-matrx/design-system");
4594
4617
  init_createTable();
4595
4618
  init_unfinishedTable();
4596
4619
  init_ImportWizard();
@@ -4645,7 +4668,7 @@ module.exports = __toCommonJS(pickers_exports);
4645
4668
  // src/TablePickers.tsx
4646
4669
  var import_react77 = require("react");
4647
4670
  var import_react78 = require("@ai-matrx/records/react");
4648
- var import_design_system44 = require("@ai-matrx/design-system");
4671
+ var import_design_system45 = require("@ai-matrx/design-system");
4649
4672
 
4650
4673
  // src/askOnce.ts
4651
4674
  var askOnce_exports = {};
@@ -4654,7 +4677,7 @@ __reExport(askOnce_exports, require("@ai-matrx/records/versions"));
4654
4677
  // src/AddChoicesInline.tsx
4655
4678
  var import_react6 = require("react");
4656
4679
  var import_react7 = require("@ai-matrx/records/react");
4657
- var import_design_system4 = require("@ai-matrx/design-system");
4680
+ var import_design_system5 = require("@ai-matrx/design-system");
4658
4681
 
4659
4682
  // src/ChoiceListEditor.tsx
4660
4683
  var import_react = require("react");
@@ -4946,13 +4969,13 @@ function AddChoicesInline({ field, onAdded, disabled = false }) {
4946
4969
  setRows([newChoiceRow([])]);
4947
4970
  onAdded();
4948
4971
  };
4949
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system4.Popover, { open, onOpenChange: setOpen, children: [
4950
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.Button, { type: "button", size: "sm", variant: "outline", className: "h-7 self-start text-xs", disabled, "data-records-add-choices": "", children: "Add choices" }) }),
4951
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system4.PopoverContent, { className: "w-72 space-y-2 p-3", align: "start", children: [
4972
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system5.Popover, { open, onOpenChange: setOpen, children: [
4973
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Button, { type: "button", size: "sm", variant: "outline", className: "h-7 self-start text-xs", disabled, "data-records-add-choices": "", children: "Add choices" }) }),
4974
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system5.PopoverContent, { className: "w-72 space-y-2 p-3", align: "start", children: [
4952
4975
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChoiceListEditor, { isNew: true, rows, onRows: setRows }),
4953
4976
  missing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-[11px] text-muted-foreground", children: missing }) : null,
4954
4977
  refused ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RefusalLine, { error: refused }) : null,
4955
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.Button, { type: "button", size: "sm", className: "h-7 text-xs", disabled: saving || words.length === 0 || missing !== null, onClick: () => void save(), children: "Save choices" })
4978
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Button, { type: "button", size: "sm", className: "h-7 text-xs", disabled: saving || words.length === 0 || missing !== null, onClick: () => void save(), children: "Save choices" })
4956
4979
  ] })
4957
4980
  ] });
4958
4981
  }
@@ -4961,14 +4984,14 @@ function AddChoicesInline({ field, onAdded, disabled = false }) {
4961
4984
  var import_react73 = require("react");
4962
4985
  var import_records28 = require("@ai-matrx/records");
4963
4986
  var import_react74 = require("@ai-matrx/records/react");
4964
- var import_design_system43 = require("@ai-matrx/design-system");
4987
+ var import_design_system44 = require("@ai-matrx/design-system");
4965
4988
  init_dates();
4966
4989
 
4967
4990
  // src/newerKindValues.tsx
4968
4991
  var import_react8 = require("react");
4969
4992
  var import_source = require("@ai-matrx/content-ir/source");
4970
4993
  var import_records2 = require("@ai-matrx/records");
4971
- var import_design_system5 = require("@ai-matrx/design-system");
4994
+ var import_design_system6 = require("@ai-matrx/design-system");
4972
4995
  var import_outbound_react = require("@ai-matrx/kit/outbound-react");
4973
4996
  var import_jsx_runtime6 = require("react/jsx-runtime");
4974
4997
  var own = (event) => event.stopPropagation();
@@ -5010,7 +5033,7 @@ function PersonStampChip({ stamp }) {
5010
5033
  children: initial
5011
5034
  }
5012
5035
  ),
5013
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_design_system5.cn)("truncate", tier === "user" && !name ? "italic text-muted-foreground" : ""), children: words })
5036
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_design_system6.cn)("truncate", tier === "user" && !name ? "italic text-muted-foreground" : ""), children: words })
5014
5037
  ] });
5015
5038
  }
5016
5039
  function AddressLink({ value }) {
@@ -5124,7 +5147,7 @@ function SafeMarkdown({ text, clipped }) {
5124
5147
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5125
5148
  "span",
5126
5149
  {
5127
- className: (0, import_design_system5.cn)("block min-w-0 space-y-1 whitespace-normal text-sm", clipped ? "max-h-[4.5em] overflow-hidden" : ""),
5150
+ className: (0, import_design_system6.cn)("block min-w-0 space-y-1 whitespace-normal text-sm", clipped ? "max-h-[4.5em] overflow-hidden" : ""),
5128
5151
  "data-records-rich-text": "",
5129
5152
  children: blocks
5130
5153
  }
@@ -5154,7 +5177,7 @@ function DurationControl({ value, onChange, disabled, id }) {
5154
5177
  }, [value]);
5155
5178
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col gap-1", children: [
5156
5179
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5157
- import_design_system5.BasicInput,
5180
+ import_design_system6.BasicInput,
5158
5181
  {
5159
5182
  id,
5160
5183
  value: text,
@@ -5204,7 +5227,7 @@ function AddressControl({ value, onChange, disabled, id }) {
5204
5227
  onChange(Object.keys(kept).length === 0 ? null : kept);
5205
5228
  };
5206
5229
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { id, className: "grid grid-cols-2 gap-1.5", "data-records-address-control": "", children: import_records2.ADDRESS_PARTS.map((part) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5207
- import_design_system5.BasicInput,
5230
+ import_design_system6.BasicInput,
5208
5231
  {
5209
5232
  "aria-label": ADDRESS_LABELS[part],
5210
5233
  placeholder: ADDRESS_EXAMPLES[part],
@@ -5228,7 +5251,7 @@ function BarcodeControl({ value, onChange, disabled, id }) {
5228
5251
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col gap-1", children: [
5229
5252
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex items-center gap-1.5", children: [
5230
5253
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5231
- import_design_system5.BasicInput,
5254
+ import_design_system6.BasicInput,
5232
5255
  {
5233
5256
  id,
5234
5257
  className: "font-mono",
@@ -5286,7 +5309,7 @@ init_names();
5286
5309
  var import_react10 = require("react");
5287
5310
  var import_records3 = require("@ai-matrx/records");
5288
5311
  var import_react11 = require("@ai-matrx/records/react");
5289
- var import_design_system8 = require("@ai-matrx/design-system");
5312
+ var import_design_system9 = require("@ai-matrx/design-system");
5290
5313
  init_PickOrAdd();
5291
5314
  init_names();
5292
5315
  init_Refusal();
@@ -5420,7 +5443,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
5420
5443
  };
5421
5444
  }, [client, open, allowCreate, target, targetRefusal, field.relation_target]);
5422
5445
  if (!client) {
5423
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0, import_design_system8.cn)("text-xs text-muted-foreground", className), children: NO_STORE_ON_THIS_SCREEN_REASON });
5446
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0, import_design_system9.cn)("text-xs text-muted-foreground", className), children: NO_STORE_ON_THIS_SCREEN_REASON });
5424
5447
  }
5425
5448
  if (!field.relation_target) {
5426
5449
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
@@ -5493,7 +5516,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
5493
5516
  ));
5494
5517
  return (
5495
5518
  // Never wider than where it is drawn (a grid cell beside a sticky column: B3-07) — chips truncate, the button wraps.
5496
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_design_system8.cn)("flex min-w-0 max-w-full flex-wrap items-center gap-1", className), children: [
5519
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_design_system9.cn)("flex min-w-0 max-w-full flex-wrap items-center gap-1", className), children: [
5497
5520
  anchored && !disabled ? null : cellChips,
5498
5521
  disabled ? null : (
5499
5522
  // THE ONE "PICK OR ADD" BUILDER (PickOrAdd.tsx) — the choice editor draws the same one.
@@ -5548,7 +5571,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
5548
5571
  } : null,
5549
5572
  foot: !allowCreate || full ? void 0 : targetRefusal ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RefusalLine, { error: targetRefusal, className: "p-2" }) : !target ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "p-2 text-xs text-muted-foreground", children: "Reading that table\u2026" }) : creating ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1 p-1", children: [
5550
5573
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5551
- import_design_system8.BasicInput,
5574
+ import_design_system9.BasicInput,
5552
5575
  {
5553
5576
  autoFocus: true,
5554
5577
  value: newTitle,
@@ -5565,7 +5588,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
5565
5588
  }
5566
5589
  ),
5567
5590
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5568
- import_design_system8.Button,
5591
+ import_design_system9.Button,
5569
5592
  {
5570
5593
  type: "button",
5571
5594
  size: "sm",
@@ -5611,7 +5634,7 @@ function readableLink(raw) {
5611
5634
 
5612
5635
  // src/buttonCell.tsx
5613
5636
  var import_react68 = require("react");
5614
- var import_design_system40 = require("@ai-matrx/design-system");
5637
+ var import_design_system41 = require("@ai-matrx/design-system");
5615
5638
  var import_data_table6 = require("@ai-matrx/design-system/data-table");
5616
5639
  var import_records26 = require("@ai-matrx/records");
5617
5640
  var import_react69 = require("@ai-matrx/records/react");
@@ -5666,10 +5689,10 @@ function columnNameProblemLine(name, noun = "column") {
5666
5689
  var import_react66 = require("react");
5667
5690
  var import_react67 = require("@ai-matrx/records/react");
5668
5691
  var import_core9 = require("@ai-matrx/records/core");
5669
- var import_design_system39 = require("@ai-matrx/design-system");
5692
+ var import_design_system40 = require("@ai-matrx/design-system");
5670
5693
 
5671
5694
  // src/WatchFieldsPicker.tsx
5672
- var import_design_system9 = require("@ai-matrx/design-system");
5695
+ var import_design_system10 = require("@ai-matrx/design-system");
5673
5696
  var import_jsx_runtime11 = require("react/jsx-runtime");
5674
5697
  function watchedFieldsOf(field) {
5675
5698
  const list = field?.config?.["only_fields"];
@@ -5687,15 +5710,15 @@ function watchable(field) {
5687
5710
  function WatchFieldsPicker({ fields, value, onChange }) {
5688
5711
  const choices = fields.filter(watchable);
5689
5712
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { className: "flex flex-col gap-1", "data-records-watch-fields": "", children: [
5690
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system9.Label, { className: "text-xs", children: "Changes to" }),
5713
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system10.Label, { className: "text-xs", children: "Changes to" }),
5691
5714
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-wrap gap-x-3 gap-y-1", children: [
5692
5715
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
5693
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system9.Checkbox, { checked: value.length === 0, "aria-label": "Any field", onCheckedChange: (v) => v === true && onChange([]) }),
5716
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system10.Checkbox, { checked: value.length === 0, "aria-label": "Any field", onCheckedChange: (v) => v === true && onChange([]) }),
5694
5717
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "Any field" })
5695
5718
  ] }),
5696
5719
  choices.map((f) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
5697
5720
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5698
- import_design_system9.Checkbox,
5721
+ import_design_system10.Checkbox,
5699
5722
  {
5700
5723
  checked: value.includes(f.key),
5701
5724
  "aria-label": f.label,
@@ -5720,7 +5743,7 @@ var import_core2 = require("@ai-matrx/records/core");
5720
5743
  init_createTable();
5721
5744
  init_Refusal();
5722
5745
  init_tablePicking();
5723
- var import_design_system11 = require("@ai-matrx/design-system");
5746
+ var import_design_system12 = require("@ai-matrx/design-system");
5724
5747
  init_names();
5725
5748
  var import_jsx_runtime13 = require("react/jsx-runtime");
5726
5749
  var DEFAULT_SEPARATOR = " ";
@@ -5840,7 +5863,7 @@ function ReferenceBuilder({
5840
5863
  };
5841
5864
  const mayMakeTable = (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableFind) && (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableEnsure);
5842
5865
  const newTableButton = !mayMakeTable ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5843
- import_design_system11.Button,
5866
+ import_design_system12.Button,
5844
5867
  {
5845
5868
  type: "button",
5846
5869
  size: "sm",
@@ -5869,16 +5892,16 @@ function ReferenceBuilder({
5869
5892
  next.splice(to, 0, next.splice(at, 1)[0]);
5870
5893
  setDisplay({ columns: next, separator });
5871
5894
  };
5872
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_design_system11.cn)("flex max-w-[26rem] flex-col gap-3", className), children: [
5895
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_design_system12.cn)("flex max-w-[26rem] flex-col gap-3", className), children: [
5873
5896
  !lockTarget && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
5874
5897
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
5875
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.Label, { className: "text-xs", children: "The table it points at" }),
5898
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "The table it points at" }),
5876
5899
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ShowListsToggle, { count: picking.listCount, on: showLists, onChange: setShowLists })
5877
5900
  ] }),
5878
5901
  naming !== null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", "data-new-link-table": "", children: [
5879
5902
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1", children: [
5880
5903
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5881
- import_design_system11.BasicInput,
5904
+ import_design_system12.BasicInput,
5882
5905
  {
5883
5906
  autoFocus: true,
5884
5907
  value: naming,
@@ -5901,7 +5924,7 @@ function ReferenceBuilder({
5901
5924
  }
5902
5925
  ),
5903
5926
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5904
- import_design_system11.Button,
5927
+ import_design_system12.Button,
5905
5928
  {
5906
5929
  type: "button",
5907
5930
  size: "sm",
@@ -5911,7 +5934,7 @@ function ReferenceBuilder({
5911
5934
  }
5912
5935
  ),
5913
5936
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5914
- import_design_system11.Button,
5937
+ import_design_system12.Button,
5915
5938
  {
5916
5939
  type: "button",
5917
5940
  size: "sm",
@@ -5930,7 +5953,7 @@ function ReferenceBuilder({
5930
5953
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No tables yet." }),
5931
5954
  newTableButton
5932
5955
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5933
- import_design_system11.Select,
5956
+ import_design_system12.Select,
5934
5957
  {
5935
5958
  value: value.targetTableId,
5936
5959
  onValueChange: (next) => {
@@ -5942,13 +5965,13 @@ function ReferenceBuilder({
5942
5965
  onChange({ targetTableId: next, display: null });
5943
5966
  },
5944
5967
  children: [
5945
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.SelectTrigger, { size: "sm", "aria-label": "The table this column points at", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.SelectValue, { placeholder: "Choose a table" }) }),
5946
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system11.SelectContent, { children: [
5947
- offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system11.SelectItem, { value: t.id, children: [
5968
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectTrigger, { size: "sm", "aria-label": "The table this column points at", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectValue, { placeholder: "Choose a table" }) }),
5969
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system12.SelectContent, { children: [
5970
+ offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system12.SelectItem, { value: t.id, children: [
5948
5971
  t.label,
5949
5972
  t.id === tableId ? " \u2014 this table" : ""
5950
5973
  ] }, t.id)),
5951
- mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.SelectItem, { value: NEW_TABLE, children: "New table\u2026" }) : null
5974
+ mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectItem, { value: NEW_TABLE, children: "New table\u2026" }) : null
5952
5975
  ] })
5953
5976
  ]
5954
5977
  }
@@ -5956,12 +5979,12 @@ function ReferenceBuilder({
5956
5979
  ] }),
5957
5980
  target && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
5958
5981
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
5959
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.Label, { className: "text-xs", children: "Shown as" }),
5982
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "Shown as" }),
5960
5983
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px] text-muted-foreground", children: titleField ? `${titleField} \u2014 what ${targetTable ? tableName(targetTable) : "that table"} is titled by` : "whatever each record is named by" })
5961
5984
  ] }),
5962
5985
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
5963
5986
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5964
- import_design_system11.Checkbox,
5987
+ import_design_system12.Checkbox,
5965
5988
  {
5966
5989
  checked: overriding,
5967
5990
  onCheckedChange: (next) => {
@@ -5979,7 +6002,7 @@ function ReferenceBuilder({
5979
6002
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-wrap gap-1", children: columns.keys.map((key) => {
5980
6003
  const on = chosen.includes(key);
5981
6004
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5982
- import_design_system11.Button,
6005
+ import_design_system12.Button,
5983
6006
  {
5984
6007
  type: "button",
5985
6008
  size: "sm",
@@ -5999,7 +6022,7 @@ function ReferenceBuilder({
5999
6022
  chosen.map((key, at) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-0.5", children: [
6000
6023
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px]", children: key }),
6001
6024
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6002
- import_design_system11.Button,
6025
+ import_design_system12.Button,
6003
6026
  {
6004
6027
  type: "button",
6005
6028
  size: "sm",
@@ -6011,7 +6034,7 @@ function ReferenceBuilder({
6011
6034
  }
6012
6035
  ),
6013
6036
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6014
- import_design_system11.Button,
6037
+ import_design_system12.Button,
6015
6038
  {
6016
6039
  type: "button",
6017
6040
  size: "sm",
@@ -6025,9 +6048,9 @@ function ReferenceBuilder({
6025
6048
  ] }, key))
6026
6049
  ] }),
6027
6050
  chosen.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
6028
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.Label, { className: "text-xs whitespace-nowrap", children: "Joined by" }),
6051
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs whitespace-nowrap", children: "Joined by" }),
6029
6052
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6030
- import_design_system11.BasicInput,
6053
+ import_design_system12.BasicInput,
6031
6054
  {
6032
6055
  value: separator,
6033
6056
  onChange: (e) => setDisplay({ columns: chosen, separator: e.target.value }),
@@ -6039,7 +6062,7 @@ function ReferenceBuilder({
6039
6062
  ] })
6040
6063
  ] }) }),
6041
6064
  target && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
6042
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system11.Label, { className: "text-xs", children: "It will read" }),
6065
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "It will read" }),
6043
6066
  preview.loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading a few of its records\u2026" }) : (preview.data?.rows?.length ?? 0) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "That table has no records yet, so there is nothing to show here \u2014 this column will still work, and the first record added is the first thing it offers." }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-0.5", children: (preview.data?.rows ?? []).map((row) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { className: "truncate text-[11px] text-foreground", children: previewWords(
6044
6067
  row.document,
6045
6068
  display,
@@ -6053,7 +6076,7 @@ function ReferenceBuilder({
6053
6076
  var import_react17 = require("react");
6054
6077
  var import_react18 = require("@ai-matrx/records/react");
6055
6078
  var import_records5 = require("@ai-matrx/records");
6056
- var import_design_system12 = require("@ai-matrx/design-system");
6079
+ var import_design_system13 = require("@ai-matrx/design-system");
6057
6080
  init_host();
6058
6081
  init_Refusal();
6059
6082
  init_plainWords();
@@ -6166,9 +6189,9 @@ function FormulaTextEditor({
6166
6189
  const at = Math.max(0, Math.min(parsed.position ?? 0, parsed.text.length));
6167
6190
  return { before: parsed.text.slice(0, at), after: parsed.text.slice(at) };
6168
6191
  }, [parsed]);
6169
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-records-formula-editor": "", className: (0, import_design_system12.cn)("flex flex-col gap-1.5", className), children: [
6192
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-records-formula-editor": "", className: (0, import_design_system13.cn)("flex flex-col gap-1.5", className), children: [
6170
6193
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1", children: [
6171
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system12.Label, { className: "text-xs", children: "The formula" }),
6194
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Label, { className: "text-xs", children: "The formula" }),
6172
6195
  host.formulaHelp ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-records-formula-help": "", className: "ml-auto", children: host.formulaHelp({
6173
6196
  tableId,
6174
6197
  text,
@@ -6180,7 +6203,7 @@ function FormulaTextEditor({
6180
6203
  }) }) : null
6181
6204
  ] }),
6182
6205
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6183
- import_design_system12.BasicTextarea,
6206
+ import_design_system13.BasicTextarea,
6184
6207
  {
6185
6208
  ref: box,
6186
6209
  value: text,
@@ -6203,7 +6226,7 @@ function FormulaTextEditor({
6203
6226
  sampleRecordId ? "This record" : "First row",
6204
6227
  ": "
6205
6228
  ] }),
6206
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_design_system12.cn)("font-mono", parsed.error ? "text-muted-foreground" : "text-foreground"), children: sampleWords(parsed) })
6229
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_design_system13.cn)("font-mono", parsed.error ? "text-muted-foreground" : "text-foreground"), children: sampleWords(parsed) })
6207
6230
  ] }) : null,
6208
6231
  parsed && !parsed.ok ? (
6209
6232
  // NOT A REFUSAL, SO NOT RED: nothing was pressed. It is the store's reading of the
@@ -6220,7 +6243,7 @@ function FormulaTextEditor({
6220
6243
  error ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RefusalLine, { error }) : null,
6221
6244
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
6222
6245
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "Columns:" }),
6223
- columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system12.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-1.5 text-[11px]", onClick: () => insert(`{${fieldName(f)}}`), children: fieldName(f) }, f.id))
6246
+ columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-1.5 text-[11px]", onClick: () => insert(`{${fieldName(f)}}`), children: fieldName(f) }, f.id))
6224
6247
  ] }),
6225
6248
  STORE_FORMULA_FUNCTION_NAMES.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "text-[11px] text-muted-foreground", children: [
6226
6249
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { className: "cursor-pointer", children: [
@@ -6228,7 +6251,7 @@ function FormulaTextEditor({
6228
6251
  STORE_FORMULA_FUNCTION_NAMES.length,
6229
6252
  ")"
6230
6253
  ] }),
6231
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system12.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 font-mono text-[11px]", onClick: () => insert(`${name}()`), children: name }, name)) })
6254
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 font-mono text-[11px]", onClick: () => insert(`${name}()`), children: name }, name)) })
6232
6255
  ] }) : null
6233
6256
  ] });
6234
6257
  }
@@ -6236,7 +6259,7 @@ function FormulaTextEditor({
6236
6259
  // src/EntityReferenceKindPicker.tsx
6237
6260
  var import_react19 = require("react");
6238
6261
  var import_react20 = require("@ai-matrx/records/react");
6239
- var import_design_system13 = require("@ai-matrx/design-system");
6262
+ var import_design_system14 = require("@ai-matrx/design-system");
6240
6263
  init_Refusal();
6241
6264
  var import_jsx_runtime15 = require("react/jsx-runtime");
6242
6265
  var ENTITY_REFERENCE_KINDS_MISSING = "Choose at least one kind of thing this column points at.";
@@ -6272,9 +6295,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
6272
6295
  if (on) onChange(chosen.has(token) ? [...value] : [...value, token]);
6273
6296
  else onChange(value.filter((t) => t !== token));
6274
6297
  };
6275
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_design_system13.cn)("flex flex-col gap-2", className), children: [
6276
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system13.Label, { className: "text-xs", children: "What it points at" }),
6277
- value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system13.Badge, { variant: "secondary", className: "gap-1 text-[11px]", children: [
6298
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_design_system14.cn)("flex flex-col gap-2", className), children: [
6299
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system14.Label, { className: "text-xs", children: "What it points at" }),
6300
+ value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system14.Badge, { variant: "secondary", className: "gap-1 text-[11px]", children: [
6278
6301
  labelOf.get(token) ?? token,
6279
6302
  locked ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6280
6303
  "button",
@@ -6287,9 +6310,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
6287
6310
  }
6288
6311
  )
6289
6312
  ] }, token)) }) : null,
6290
- locked ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system13.Skeleton, { className: "h-24 w-full" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6313
+ locked ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system14.Skeleton, { className: "h-24 w-full" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6291
6314
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6292
- import_design_system13.BasicInput,
6315
+ import_design_system14.BasicInput,
6293
6316
  {
6294
6317
  "aria-label": "Find a kind of thing",
6295
6318
  placeholder: "Find a kind \u2014 note, web site, agent\u2026",
@@ -6306,7 +6329,7 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
6306
6329
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: category }),
6307
6330
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "grid grid-cols-1 gap-1 sm:grid-cols-2", children: kinds.map((k) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "flex items-center gap-1.5 text-xs", children: [
6308
6331
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6309
- import_design_system13.Checkbox,
6332
+ import_design_system14.Checkbox,
6310
6333
  {
6311
6334
  checked: chosen.has(k.token),
6312
6335
  "aria-label": k.label,
@@ -6326,7 +6349,7 @@ init_Refusal();
6326
6349
 
6327
6350
  // src/SourceArchivedNotice.tsx
6328
6351
  var import_react53 = require("react");
6329
- var import_design_system31 = require("@ai-matrx/design-system");
6352
+ var import_design_system32 = require("@ai-matrx/design-system");
6330
6353
  var import_react54 = require("@ai-matrx/records/react");
6331
6354
  init_Refusal();
6332
6355
 
@@ -6339,7 +6362,7 @@ function withoutLeadingBlank(text) {
6339
6362
  init_personChip();
6340
6363
  var import_data_table3 = require("@ai-matrx/design-system/data-table");
6341
6364
  var import_field_formats6 = require("@ai-matrx/design-system/field-formats");
6342
- var import_design_system30 = require("@ai-matrx/design-system");
6365
+ var import_design_system31 = require("@ai-matrx/design-system");
6343
6366
  init_parity();
6344
6367
  init_dates();
6345
6368
 
@@ -6450,7 +6473,7 @@ var import_uuid2 = require("@ai-matrx/kit/uuid");
6450
6473
 
6451
6474
  // src/signature.tsx
6452
6475
  var import_react22 = require("react");
6453
- var import_design_system14 = require("@ai-matrx/design-system");
6476
+ var import_design_system15 = require("@ai-matrx/design-system");
6454
6477
  var import_react23 = require("@ai-matrx/records/react");
6455
6478
  init_docs();
6456
6479
  init_host();
@@ -6517,7 +6540,7 @@ function DrawnImage({ src, inCell }) {
6517
6540
  src,
6518
6541
  alt: SIGNED_WORD,
6519
6542
  "data-records-signature": "",
6520
- className: (0, import_design_system14.cn)("max-w-[12rem] object-contain object-left dark:invert", inCell ? "h-7" : "h-12")
6543
+ className: (0, import_design_system15.cn)("max-w-[12rem] object-contain object-left dark:invert", inCell ? "h-7" : "h-12")
6521
6544
  }
6522
6545
  );
6523
6546
  }
@@ -6547,7 +6570,7 @@ function SignatureDrawing({
6547
6570
  }, [client, recordId, fieldKey, knownFile]);
6548
6571
  if (drawing?.src) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawnImage, { src: drawing.src, inCell });
6549
6572
  if (drawing?.hostFileId && host.fileImage) {
6550
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: (0, import_design_system14.cn)("inline-block max-w-[12rem] dark:invert", inCell ? "h-7" : "h-12"), "data-records-signature": "", children: host.fileImage({ fileId: drawing.hostFileId, alt: SIGNED_WORD }) });
6573
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: (0, import_design_system15.cn)("inline-block max-w-[12rem] dark:invert", inCell ? "h-7" : "h-12"), "data-records-signature": "", children: host.fileImage({ fileId: drawing.hostFileId, alt: SIGNED_WORD }) });
6551
6574
  }
6552
6575
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-serif italic", children: String(value) });
6553
6576
  }
@@ -6647,12 +6670,12 @@ function SignaturePad({
6647
6670
  onChange(null);
6648
6671
  };
6649
6672
  if (!showPad) {
6650
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: (0, import_design_system14.cn)("flex items-center justify-between gap-2 rounded-md border px-3 py-2", className), children: [
6673
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: (0, import_design_system15.cn)("flex items-center justify-between gap-2 rounded-md border px-3 py-2", className), children: [
6651
6674
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SignatureValue, { value }),
6652
- !disabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system14.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, children: "Sign again" }) : null
6675
+ !disabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system15.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, children: "Sign again" }) : null
6653
6676
  ] });
6654
6677
  }
6655
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_design_system14.cn)("flex w-full flex-col gap-1", className), children: [
6678
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_design_system15.cn)("flex w-full flex-col gap-1", className), children: [
6656
6679
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative", children: [
6657
6680
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6658
6681
  "canvas",
@@ -6667,7 +6690,7 @@ function SignaturePad({
6667
6690
  onPointerUp: end,
6668
6691
  onPointerLeave: end,
6669
6692
  onPointerCancel: end,
6670
- className: (0, import_design_system14.cn)(
6693
+ className: (0, import_design_system15.cn)(
6671
6694
  "block h-36 w-full touch-none rounded-md border border-border bg-white",
6672
6695
  disabled ? "cursor-not-allowed opacity-60" : "cursor-crosshair"
6673
6696
  )
@@ -6677,7 +6700,7 @@ function SignaturePad({
6677
6700
  ] }),
6678
6701
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
6679
6702
  tooBig ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6680
- import_design_system14.ErrorBox,
6703
+ import_design_system15.ErrorBox,
6681
6704
  {
6682
6705
  as: "span",
6683
6706
  className: "mr-auto text-xs text-destructive",
@@ -6686,7 +6709,7 @@ function SignaturePad({
6686
6709
  origin: "records-ui/signature"
6687
6710
  }
6688
6711
  ) : null,
6689
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system14.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, disabled: disabled || !dirty, children: "Clear" })
6712
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system15.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, disabled: disabled || !dirty, children: "Clear" })
6690
6713
  ] })
6691
6714
  ] });
6692
6715
  }
@@ -6723,7 +6746,7 @@ function encodeAt(canvas, type, maxWidth, quality) {
6723
6746
  // src/looks/designLooks.tsx
6724
6747
  var import_react24 = require("react");
6725
6748
  var import_icons = require("@ai-matrx/design-system/icons");
6726
- var import_design_system15 = require("@ai-matrx/design-system");
6749
+ var import_design_system16 = require("@ai-matrx/design-system");
6727
6750
  var import_field_formats3 = require("@ai-matrx/design-system/field-formats");
6728
6751
  var import_jsx_runtime17 = require("react/jsx-runtime");
6729
6752
  var TYPE_SAMPLE = "The quick brown fox jumps over the lazy dog";
@@ -6737,7 +6760,7 @@ function numberOf(value) {
6737
6760
  return null;
6738
6761
  }
6739
6762
  function Swatch({ color, className }) {
6740
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system15.cn)("inline-block h-4 w-4 shrink-0 rounded border border-border", className), style: { backgroundColor: color } });
6763
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("inline-block h-4 w-4 shrink-0 rounded border border-border", className), style: { backgroundColor: color } });
6741
6764
  }
6742
6765
  function colorPairGround(format, context) {
6743
6766
  const fixed = format.options?.contrastWith;
@@ -6768,7 +6791,7 @@ function ContrastMark({ ratio, min }) {
6768
6791
  {
6769
6792
  "data-records-contrast": level,
6770
6793
  title: level === "pass" ? `Readable: ${said2}` : level === "large-only" ? `Large text only: ${said2}` : `Hard to read: ${said2}`,
6771
- className: (0, import_design_system15.cn)("shrink-0 text-xs tabular-nums", level === "pass" ? "text-muted-foreground" : "text-warning-ink"),
6794
+ className: (0, import_design_system16.cn)("shrink-0 text-xs tabular-nums", level === "pass" ? "text-muted-foreground" : "text-warning-ink"),
6772
6795
  children: [
6773
6796
  level === "pass" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons.CheckIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons.AlertTriangleIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }),
6774
6797
  said2
@@ -6788,7 +6811,7 @@ function ColorPairView({ value, format }) {
6788
6811
  ] }),
6789
6812
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
6790
6813
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Swatch, { color: pair.dark ?? pair.light }),
6791
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: (0, import_design_system15.cn)("font-mono text-xs uppercase", !pair.dark && "text-muted-foreground"), children: pair.dark ?? "Inherits light" }),
6814
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: (0, import_design_system16.cn)("font-mono text-xs uppercase", !pair.dark && "text-muted-foreground"), children: pair.dark ?? "Inherits light" }),
6792
6815
  contrast.dark !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.dark, min: pair.min }) : null
6793
6816
  ] })
6794
6817
  ] });
@@ -6809,7 +6832,7 @@ function ColorWell({
6809
6832
  }
6810
6833
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
6811
6834
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6812
- import_design_system15.BasicInput,
6835
+ import_design_system16.BasicInput,
6813
6836
  {
6814
6837
  type: "color",
6815
6838
  "aria-label": `${label}: pick a color`,
@@ -6823,7 +6846,7 @@ function ColorWell({
6823
6846
  }
6824
6847
  ),
6825
6848
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6826
- import_design_system15.BasicInput,
6849
+ import_design_system16.BasicInput,
6827
6850
  {
6828
6851
  id,
6829
6852
  "aria-label": label,
@@ -6922,14 +6945,14 @@ function NumberBox({
6922
6945
  const typed = FINISHED_NUMBER.test(text.trim()) ? Number(text.trim()) : void 0;
6923
6946
  if (typed !== value) setText(value === null || value === void 0 ? "" : String(value));
6924
6947
  }
6925
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: (0, import_design_system15.cn)("relative flex items-center", className), children: [
6948
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: (0, import_design_system16.cn)("relative flex items-center", className), children: [
6926
6949
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6927
- import_design_system15.BasicInput,
6950
+ import_design_system16.BasicInput,
6928
6951
  {
6929
6952
  ...id ? { id } : {},
6930
6953
  "aria-label": label,
6931
6954
  inputMode: "decimal",
6932
- className: (0, import_design_system15.cn)("h-7 text-xs tabular-nums", unit ? "pr-9" : ""),
6955
+ className: (0, import_design_system16.cn)("h-7 text-xs tabular-nums", unit ? "pr-9" : ""),
6933
6956
  value: text,
6934
6957
  disabled,
6935
6958
  onChange: (e) => {
@@ -7046,7 +7069,7 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
7046
7069
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex w-full flex-col gap-1.5", children: [
7047
7070
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: FIELD, children: [
7048
7071
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground", children: "Font" }),
7049
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.BasicInput, { id, "aria-label": `${label} font`, value: font, placeholder: "Geist", disabled, onChange: (e) => {
7072
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.BasicInput, { id, "aria-label": `${label} font`, value: font, placeholder: "Geist", disabled, onChange: (e) => {
7050
7073
  setFont(e.target.value);
7051
7074
  write({ font: e.target.value });
7052
7075
  } })
@@ -7054,9 +7077,9 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
7054
7077
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: FIELD, children: [
7055
7078
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground", children: "Weight" }),
7056
7079
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "grid grid-cols-[1fr_6rem] gap-2", children: [
7057
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system15.Select, { value: String(clampWeight(style.weight)), disabled: disabled ?? false, onValueChange: (v) => write({ weight: clampWeight(Number(v)) }), children: [
7058
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectTrigger, { "aria-label": `${label} weight`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectValue, {}) }),
7059
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectContent, { children: import_field_formats3.TYPE_WEIGHTS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectItem, { value: String(w.value), children: w.label }, w.value)) })
7080
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system16.Select, { value: String(clampWeight(style.weight)), disabled: disabled ?? false, onValueChange: (v) => write({ weight: clampWeight(Number(v)) }), children: [
7081
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectTrigger, { "aria-label": `${label} weight`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectValue, {}) }),
7082
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectContent, { children: import_field_formats3.TYPE_WEIGHTS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectItem, { value: String(w.value), children: w.label }, w.value)) })
7060
7083
  ] }),
7061
7084
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(UnitInput, { label: `${label} size`, unit: "px", value: style.size, disabled, onChange: (n) => n !== null && write({ size: clampSize(n) }) })
7062
7085
  ] })
@@ -7091,9 +7114,9 @@ function ShadowSwatch({ layers, theme, size = "sm" }) {
7091
7114
  {
7092
7115
  "aria-hidden": true,
7093
7116
  "data-records-shadow-swatch": theme,
7094
- className: (0, import_design_system15.cn)("flex shrink-0 items-center justify-center rounded-md", size === "lg" ? "h-24 w-full" : "h-7 w-11"),
7117
+ className: (0, import_design_system16.cn)("flex shrink-0 items-center justify-center rounded-md", size === "lg" ? "h-24 w-full" : "h-7 w-11"),
7095
7118
  style: { backgroundColor: g.ground },
7096
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system15.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0, import_field_formats3.shadowCss)(layers) } })
7119
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system16.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0, import_field_formats3.shadowCss)(layers) } })
7097
7120
  }
7098
7121
  );
7099
7122
  }
@@ -7152,7 +7175,7 @@ function ShadowEditor({ value, onChange, disabled, id, label }) {
7152
7175
  type: "button",
7153
7176
  role: "tab",
7154
7177
  "aria-selected": theme === t,
7155
- className: (0, import_design_system15.cn)("rounded-md px-2 py-0.5 text-xs", theme === t ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"),
7178
+ className: (0, import_design_system16.cn)("rounded-md px-2 py-0.5 text-xs", theme === t ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"),
7156
7179
  onClick: () => setTheme(t),
7157
7180
  children: t === "light" ? "Light" : "Dark"
7158
7181
  },
@@ -7181,7 +7204,7 @@ function ShadowPreview({ value }) {
7181
7204
  }
7182
7205
  var CHECKER = "repeating-conic-gradient(#d4d4d8 0% 25%, #ffffff 0% 50%) 50% / 8px 8px";
7183
7206
  function OpacitySwatch({ opacity, size = "sm" }) {
7184
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system15.cn)("relative inline-block shrink-0 overflow-hidden rounded border border-border", size === "lg" ? "h-24 w-full" : "h-5 w-5"), style: { background: CHECKER }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "absolute inset-0 bg-foreground", style: { opacity } }) });
7207
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("relative inline-block shrink-0 overflow-hidden rounded border border-border", size === "lg" ? "h-24 w-full" : "h-5 w-5"), style: { background: CHECKER }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "absolute inset-0 bg-foreground", style: { opacity } }) });
7185
7208
  }
7186
7209
  function OpacityView({ value }) {
7187
7210
  const o = (0, import_field_formats3.readOpacity)(value);
@@ -7208,7 +7231,7 @@ function OpacityPreview({ value }) {
7208
7231
  }
7209
7232
  function MotionTrack({ motion, size = "sm" }) {
7210
7233
  const id = `m${Math.round(motion.duration)}-${motion.easing.replace(/[^a-z0-9]/gi, "")}`;
7211
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { "aria-hidden": true, className: (0, import_design_system15.cn)("relative inline-block shrink-0 rounded-full bg-muted", size === "lg" ? "h-3 w-full" : "h-2 w-12"), children: [
7234
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("relative inline-block shrink-0 rounded-full bg-muted", size === "lg" ? "h-3 w-full" : "h-2 w-12"), children: [
7212
7235
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { children: `@keyframes records-motion-${id}{0%{left:0}50%{left:calc(100% - var(--d))}100%{left:0}}@media (prefers-reduced-motion: reduce){[data-records-motion-dot]{animation:none!important}}` }),
7213
7236
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7214
7237
  "span",
@@ -7238,9 +7261,9 @@ function MotionEditor({ value, onChange, disabled, id, label }) {
7238
7261
  const write = (next) => onChange(JSON.stringify({ ...m, ...next }));
7239
7262
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex flex-wrap items-center gap-2", children: [
7240
7263
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NumberBox, { id, label: `${label} duration`, value: m.duration, unit: "ms", disabled, className: "w-24", onChange: (n) => n !== null && n >= 0 && write({ duration: n }) }),
7241
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system15.Select, { value: m.easing, disabled: disabled ?? false, onValueChange: (v) => write({ easing: v }), children: [
7242
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectTrigger, { "aria-label": `${label} easing`, className: "h-7 w-36 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectValue, {}) }),
7243
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectContent, { children: import_field_formats3.MOTION_EASINGS.map((e) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system15.SelectItem, { value: e.value, children: e.label }, e.value)) })
7264
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system16.Select, { value: m.easing, disabled: disabled ?? false, onValueChange: (v) => write({ easing: v }), children: [
7265
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectTrigger, { "aria-label": `${label} easing`, className: "h-7 w-36 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectValue, {}) }),
7266
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectContent, { children: import_field_formats3.MOTION_EASINGS.map((e) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectItem, { value: e.value, children: e.label }, e.value)) })
7244
7267
  ] }),
7245
7268
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MotionTrack, { motion: m })
7246
7269
  ] });
@@ -7274,7 +7297,7 @@ var DESIGN_LOOK_IDS = DESIGN_LOOKS.map((look) => look.id);
7274
7297
 
7275
7298
  // src/looks/htmlLook.tsx
7276
7299
  var import_react26 = require("react");
7277
- var import_design_system16 = require("@ai-matrx/design-system");
7300
+ var import_design_system17 = require("@ai-matrx/design-system");
7278
7301
 
7279
7302
  // src/looks/htmlFrame.tsx
7280
7303
  var import_react25 = require("react");
@@ -7492,7 +7515,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
7492
7515
  };
7493
7516
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", "data-records-look": "html_sample", "data-records-editing": "", children: [
7494
7517
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7495
- import_design_system16.BasicTextarea,
7518
+ import_design_system17.BasicTextarea,
7496
7519
  {
7497
7520
  ref: box,
7498
7521
  id,
@@ -7516,7 +7539,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
7516
7539
  }
7517
7540
  ),
7518
7541
  shown2.trim() ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HtmlSampleFrame, { html: shown2, title: `${label} preview` }) : null,
7519
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system16.Button, { type: "button", variant: "outline", onClick: done, children: "Done" }) })
7542
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system17.Button, { type: "button", variant: "outline", onClick: done, children: "Done" }) })
7520
7543
  ] });
7521
7544
  }
7522
7545
  var FIXED_COLOUR = /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsla?\(/i;
@@ -7790,7 +7813,7 @@ init_enumLabels();
7790
7813
  var import_react30 = require("react");
7791
7814
  var import_records8 = require("@ai-matrx/records");
7792
7815
  var import_react31 = require("@ai-matrx/records/react");
7793
- var import_design_system18 = require("@ai-matrx/design-system");
7816
+ var import_design_system19 = require("@ai-matrx/design-system");
7794
7817
  init_PickOrAdd();
7795
7818
  init_Refusal();
7796
7819
  init_PickOne();
@@ -7858,7 +7881,7 @@ function EntityReferencePicker({
7858
7881
  attrs: { "data-entity-reference-candidate": `${r.token}:${r.id}` }
7859
7882
  }));
7860
7883
  const kindChoice = allowed.length > 1 ? allowed.length <= 4 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mb-1 flex flex-wrap gap-1", role: "group", "aria-label": `Which kind \u2014 ${field.label}`, children: [null, ...allowed].map((token) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7861
- import_design_system18.Button,
7884
+ import_design_system19.Button,
7862
7885
  {
7863
7886
  type: "button",
7864
7887
  size: "sm",
@@ -7929,11 +7952,11 @@ function Chips({
7929
7952
  return WITHHELD_ENTITY_LABEL;
7930
7953
  };
7931
7954
  const multi = Boolean(field.multi);
7932
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { id, className: (0, import_design_system18.cn)("flex flex-wrap items-center gap-1", className), "aria-label": `What ${field.label} points at`, children: [
7955
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { id, className: (0, import_design_system19.cn)("flex flex-wrap items-center gap-1", className), "aria-label": `What ${field.label} points at`, children: [
7933
7956
  refs.length === 0 && !picker ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-[11px] text-muted-foreground", children: ENTITY_REFERENCE_EMPTY }) : null,
7934
7957
  refs.map((r) => {
7935
7958
  const label = labelOf(r.token, r.id, r.label);
7936
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system18.Badge, { variant: "secondary", className: "gap-1 text-[11px]", "data-entity-reference-chip": `${r.token}:${r.id}`, children: [
7959
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system19.Badge, { variant: "secondary", className: "gap-1 text-[11px]", "data-entity-reference-chip": `${r.token}:${r.id}`, children: [
7937
7960
  label,
7938
7961
  disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7939
7962
  "button",
@@ -7960,7 +7983,7 @@ var import_core8 = require("@ai-matrx/records/core");
7960
7983
  // src/WholeValue.tsx
7961
7984
  var import_react32 = require("react");
7962
7985
  var import_core3 = require("@ai-matrx/records/core");
7963
- var import_design_system19 = require("@ai-matrx/design-system");
7986
+ var import_design_system20 = require("@ai-matrx/design-system");
7964
7987
  init_host();
7965
7988
  var import_outbound_react2 = require("@ai-matrx/kit/outbound-react");
7966
7989
  var import_jsx_runtime24 = require("react/jsx-runtime");
@@ -7989,7 +8012,7 @@ var import_field_formats7 = require("@ai-matrx/design-system/field-formats");
7989
8012
  var import_react33 = require("react");
7990
8013
  var import_data_table2 = require("@ai-matrx/design-system/data-table");
7991
8014
  var import_field_formats5 = require("@ai-matrx/design-system/field-formats");
7992
- var import_design_system20 = require("@ai-matrx/design-system");
8015
+ var import_design_system21 = require("@ai-matrx/design-system");
7993
8016
  var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
7994
8017
  var import_jsx_runtime25 = require("react/jsx-runtime");
7995
8018
  var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
@@ -8025,7 +8048,7 @@ function RatingStars({
8025
8048
  children: Array.from({ length: max }, (_, i) => {
8026
8049
  const n = i + 1;
8027
8050
  const lit = n <= shown2;
8028
- const star = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { "aria-hidden": true, className: (0, import_design_system20.cn)("text-sm leading-none", lit ? "text-amber-400" : "text-muted-foreground/40"), children: "\u2605" });
8051
+ const star = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { "aria-hidden": true, className: (0, import_design_system21.cn)("text-sm leading-none", lit ? "text-amber-400" : "text-muted-foreground/40"), children: "\u2605" });
8029
8052
  return onRate ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
8030
8053
  "button",
8031
8054
  {
@@ -8089,7 +8112,7 @@ function rich(id, text, raw, format) {
8089
8112
  "aria-valuemax": 100,
8090
8113
  "aria-valuenow": Math.round(clamped),
8091
8114
  className: "h-1.5 min-w-8 flex-1 overflow-hidden rounded-full bg-muted",
8092
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_design_system20.cn)("block h-full rounded-full", pct >= 100 ? "bg-emerald-500" : "bg-primary"), style: { width: `${clamped}%` } })
8115
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_design_system21.cn)("block h-full rounded-full", pct >= 100 ? "bg-emerald-500" : "bg-primary"), style: { width: `${clamped}%` } })
8093
8116
  }
8094
8117
  ),
8095
8118
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: text })
@@ -8148,7 +8171,7 @@ init_host();
8148
8171
 
8149
8172
  // src/LinkPreviewCard.tsx
8150
8173
  var import_react34 = require("react");
8151
- var import_design_system21 = require("@ai-matrx/design-system");
8174
+ var import_design_system22 = require("@ai-matrx/design-system");
8152
8175
  init_host();
8153
8176
  var import_jsx_runtime26 = require("react/jsx-runtime");
8154
8177
  var answers = /* @__PURE__ */ new Map();
@@ -8178,15 +8201,15 @@ function LinkPreviewCard({ url, children }) {
8178
8201
  setOpen(false);
8179
8202
  };
8180
8203
  const shown2 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
8181
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system21.HoverCard, { open: open && shown2 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
8182
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system21.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
8183
- shown2 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system21.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
8204
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system22.HoverCard, { open: open && shown2 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
8205
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system22.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
8206
+ shown2 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system22.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
8184
8207
  shown2.imageUrl ? (
8185
8208
  // eslint-disable-next-line @next/next/no-img-element
8186
8209
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("img", { src: shown2.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
8187
8210
  ) : null,
8188
8211
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1.5", children: [
8189
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system21.SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
8212
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system22.SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
8190
8213
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-muted-foreground", children: shown2.siteName ?? "" })
8191
8214
  ] }),
8192
8215
  shown2.title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "line-clamp-2 font-medium", children: shown2.title }) : null,
@@ -8198,7 +8221,7 @@ function LinkPreviewCard({ url, children }) {
8198
8221
  // src/gridAttachments.tsx
8199
8222
  var import_react36 = require("react");
8200
8223
  var import_react37 = require("@ai-matrx/records/react");
8201
- var import_design_system23 = require("@ai-matrx/design-system");
8224
+ var import_design_system24 = require("@ai-matrx/design-system");
8202
8225
  init_host();
8203
8226
  init_names();
8204
8227
  init_FilePicker();
@@ -8273,7 +8296,7 @@ function AttachmentChip({ id, onRemove, onPreview }) {
8273
8296
  type: "button",
8274
8297
  title,
8275
8298
  "aria-label": onPreview ? `Preview ${words}` : words,
8276
- className: (0, import_design_system23.cn)(
8299
+ className: (0, import_design_system24.cn)(
8277
8300
  "relative block size-20 overflow-hidden rounded-md border bg-muted",
8278
8301
  "[[data-matrx-cell-lines]_&]:size-6 [[data-matrx-cell-lines=two]_&]:size-10 [[data-matrx-cell-lines=four]_&]:size-[4.5rem] [[data-matrx-cell-lines=six]_&]:size-24"
8279
8302
  ),
@@ -8303,10 +8326,10 @@ function AttachmentChip({ id, onRemove, onPreview }) {
8303
8326
  ] });
8304
8327
  }
8305
8328
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8306
- import_design_system23.Badge,
8329
+ import_design_system24.Badge,
8307
8330
  {
8308
8331
  variant: "secondary",
8309
- className: (0, import_design_system23.cn)("max-w-[14rem] gap-1 text-[11px]", onPreview && "cursor-pointer"),
8332
+ className: (0, import_design_system24.cn)("max-w-[14rem] gap-1 text-[11px]", onPreview && "cursor-pointer"),
8310
8333
  "data-records-file-chip": id,
8311
8334
  title,
8312
8335
  ...onPreview ? {
@@ -8394,8 +8417,8 @@ function AttachmentViewer({
8394
8417
  const name = read?.name ?? (read ? FILE_CHIP_UNREAD : "\u2026");
8395
8418
  const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
8396
8419
  const go = (way) => onIndex(stepAttachment(index, ids.length, way));
8397
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8398
- import_design_system23.DialogContent,
8420
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8421
+ import_design_system24.DialogContent,
8399
8422
  {
8400
8423
  className: "sm:max-w-3xl",
8401
8424
  "data-records-attachment-viewer": id,
@@ -8422,11 +8445,11 @@ function AttachmentViewer({
8422
8445
  },
8423
8446
  onClick: (event) => event.stopPropagation(),
8424
8447
  children: [
8425
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.DialogTitle, { className: "truncate text-sm", children: name }) }),
8448
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.DialogTitle, { className: "truncate text-sm", children: name }) }),
8426
8449
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "relative h-[60vh] w-full overflow-hidden rounded-md bg-muted", "data-records-attachment-stage": "", children: read?.fileId ? host.fileImage?.({ fileId: read.fileId, alt: name }) : null }),
8427
8450
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
8428
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.Button, { size: "sm", variant: "outline", "aria-label": "Previous file", disabled: index === 0, onClick: () => go(-1), "data-records-attachment-previous": "", children: "\u2190" }),
8429
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.Button, { size: "sm", variant: "outline", "aria-label": "Next file", disabled: index >= ids.length - 1, onClick: () => go(1), "data-records-attachment-next": "", children: "\u2192" }),
8451
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", "aria-label": "Previous file", disabled: index === 0, onClick: () => go(-1), "data-records-attachment-previous": "", children: "\u2190" }),
8452
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", "aria-label": "Next file", disabled: index >= ids.length - 1, onClick: () => go(1), "data-records-attachment-next": "", children: "\u2192" }),
8430
8453
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", "data-records-attachment-position": "", children: [
8431
8454
  index + 1,
8432
8455
  " of ",
@@ -8492,7 +8515,7 @@ function AttachmentControl({
8492
8515
  }
8493
8516
  ),
8494
8517
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
8495
- host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system23.Button, { size: "sm", variant: "outline", disabled: disabled || busy, onClick: () => void pick(), "data-records-attach-files": "", children: busy ? "Choosing\u2026" : attachmentIdsOf(value).length > 0 ? "Add files\u2026" : "Attach files\u2026" }) : null,
8518
+ host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", disabled: disabled || busy, onClick: () => void pick(), "data-records-attach-files": "", children: busy ? "Choosing\u2026" : attachmentIdsOf(value).length > 0 ? "Add files\u2026" : "Attach files\u2026" }) : null,
8496
8519
  host.upload ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8497
8520
  FilePicker,
8498
8521
  {
@@ -8519,7 +8542,7 @@ function AttachmentControl({
8519
8542
 
8520
8543
  // src/ReferenceChips.tsx
8521
8544
  var import_records9 = require("@ai-matrx/records");
8522
- var import_design_system24 = require("@ai-matrx/design-system");
8545
+ var import_design_system25 = require("@ai-matrx/design-system");
8523
8546
  init_host();
8524
8547
  init_kindValues();
8525
8548
  var import_jsx_runtime29 = require("react/jsx-runtime");
@@ -8566,14 +8589,14 @@ function ReferenceChip({ reference, waiting }) {
8566
8589
  const host = useRecordsUi();
8567
8590
  const look = useEmbeddedLook();
8568
8591
  const pending = reference.label == null && reference.token === "record" && !waiting && !host.renderReference;
8569
- const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system24.Skeleton, { "aria-label": "Loading", "data-records-reference-pending": "", className: "inline-block h-3 w-16 shrink-0 rounded-sm align-middle" });
8592
+ const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Skeleton, { "aria-label": "Loading", "data-records-reference-pending": "", className: "inline-block h-3 w-16 shrink-0 rounded-sm align-middle" });
8570
8593
  const words = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
8571
8594
  const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words }) : null;
8572
8595
  if (look?.plainRelation) {
8573
8596
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
8574
8597
  "span",
8575
8598
  {
8576
- className: (0, import_design_system24.cn)(
8599
+ className: (0, import_design_system25.cn)(
8577
8600
  "inline-flex max-w-full min-w-0 items-center gap-1.5 text-sm text-foreground hover:underline [&_a]:text-inherit [&_a]:no-underline [&_a:hover]:underline",
8578
8601
  reference.archived && "opacity-70"
8579
8602
  ),
@@ -8590,10 +8613,10 @@ function ReferenceChip({ reference, waiting }) {
8590
8613
  );
8591
8614
  }
8592
8615
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
8593
- import_design_system24.Badge,
8616
+ import_design_system25.Badge,
8594
8617
  {
8595
8618
  variant: "secondary",
8596
- className: (0, import_design_system24.cn)(
8619
+ className: (0, import_design_system25.cn)(
8597
8620
  "max-w-full min-w-0 gap-1 px-1.5 py-0 text-[11px] font-normal",
8598
8621
  reference.archived && "opacity-70"
8599
8622
  ),
@@ -8621,7 +8644,7 @@ function KindValueCell({
8621
8644
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex min-w-0 max-w-full items-center", "data-records-kind-value": kv.kind, children: host.renderKind({ value: kv.value, kind: kv.kind, where, title }) });
8622
8645
  }
8623
8646
  const named = kv.items.map(kindItemWords).filter((w) => w !== null);
8624
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: (0, import_design_system24.cn)("flex min-w-0 flex-wrap gap-1"), "data-records-kind-value": kv.kind, title: JSON.stringify(kv.value), children: named.length > 0 ? named.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system24.Badge, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system24.Badge, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
8647
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: (0, import_design_system25.cn)("flex min-w-0 flex-wrap gap-1"), "data-records-kind-value": kv.kind, title: JSON.stringify(kv.value), children: named.length > 0 ? named.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Badge, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Badge, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
8625
8648
  }
8626
8649
 
8627
8650
  // src/values.tsx
@@ -8738,7 +8761,7 @@ init_host();
8738
8761
  var import_react39 = require("react");
8739
8762
  var import_records11 = require("@ai-matrx/records");
8740
8763
  var import_react40 = require("@ai-matrx/records/react");
8741
- var import_design_system25 = require("@ai-matrx/design-system");
8764
+ var import_design_system26 = require("@ai-matrx/design-system");
8742
8765
  init_PickOrAdd();
8743
8766
  init_personChip();
8744
8767
  init_host();
@@ -8826,10 +8849,10 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
8826
8849
  }, [client, personTable, picked.length, people.length]);
8827
8850
  const listed = (0, import_records11.rankTypedMatches)(members ?? [], search, memberName);
8828
8851
  if (!membersPort || !client) {
8829
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: (0, import_design_system25.cn)("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
8852
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: (0, import_design_system26.cn)("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
8830
8853
  }
8831
8854
  if (!personTable) {
8832
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: (0, import_design_system25.cn)("text-xs text-muted-foreground", className), children: [
8855
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: (0, import_design_system26.cn)("text-xs text-muted-foreground", className), children: [
8833
8856
  fieldName(field),
8834
8857
  " is a person field, but it does not say which Table the people are records of yet, so there is nothing to pick from. A table admin sets its target in the field editor."
8835
8858
  ] });
@@ -8880,7 +8903,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
8880
8903
  );
8881
8904
  const anchored = autoOpen === true;
8882
8905
  const cellChips = picked.map((recordId) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PersonChip, { name: nameOfRecord(recordId), ...disabled || anchored ? {} : { onRemove: () => drop(recordId) } }, recordId));
8883
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_design_system25.cn)("flex flex-wrap items-center gap-1", className), children: [
8906
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_design_system26.cn)("flex flex-wrap items-center gap-1", className), children: [
8884
8907
  anchored && !disabled ? null : cellChips,
8885
8908
  disabled ? null : (
8886
8909
  // THE ONE "PICK OR ADD" BUILDER (lane CELL-EDITORS, 2026-10-06): the person list used to carry
@@ -8975,7 +8998,7 @@ var import_outbound_react6 = require("@ai-matrx/kit/outbound-react");
8975
8998
 
8976
8999
  // src/structuredValue.tsx
8977
9000
  var import_react51 = require("react");
8978
- var import_design_system29 = require("@ai-matrx/design-system");
9001
+ var import_design_system30 = require("@ai-matrx/design-system");
8979
9002
  var import_controls = require("@ai-matrx/design-system/controls");
8980
9003
  var import_react52 = require("@ai-matrx/alchemy/react");
8981
9004
  var import_outbound_react5 = require("@ai-matrx/kit/outbound-react");
@@ -9104,7 +9127,7 @@ function Thumb({ src, size }) {
9104
9127
  alt: "",
9105
9128
  loading: "lazy",
9106
9129
  referrerPolicy: "no-referrer",
9107
- className: (0, import_design_system29.cn)("rounded border border-border bg-muted object-cover", size === "sm" ? "size-6" : "size-12")
9130
+ className: (0, import_design_system30.cn)("rounded border border-border bg-muted object-cover", size === "sm" ? "size-6" : "size-12")
9108
9131
  }
9109
9132
  ) });
9110
9133
  }
@@ -9115,7 +9138,7 @@ function LinkChip({ href, dense }) {
9115
9138
  href,
9116
9139
  title: href,
9117
9140
  onClick: stop,
9118
- className: (0, import_design_system29.cn)(
9141
+ className: (0, import_design_system30.cn)(
9119
9142
  "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent",
9120
9143
  // A percentage max-width means nothing inside an auto-layout table cell, so a link column would hold
9121
9144
  // its full address; in a table the chip gets a real ceiling and shortens with an ellipsis.
@@ -9144,7 +9167,7 @@ function Scalar({ value, keyName, dense }) {
9144
9167
  const date = dateWords(text);
9145
9168
  if (date) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { title: text, children: date });
9146
9169
  if (!dense && ui.renderText && text.length > 40 && MARKDOWN.test(text)) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "min-w-0", children: ui.renderText(text, "cell") });
9147
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: (0, import_design_system29.cn)(dense ? "line-clamp-2 break-words" : "whitespace-pre-wrap [overflow-wrap:anywhere]"), children: text });
9170
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: (0, import_design_system30.cn)(dense ? "line-clamp-2 break-words" : "whitespace-pre-wrap [overflow-wrap:anywhere]"), children: text });
9148
9171
  }
9149
9172
  var TABLE_ROWS = 8;
9150
9173
  var TABLE_COLUMNS = 12;
@@ -9158,7 +9181,7 @@ function RecordsTable({ items }) {
9158
9181
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("th", { scope: "col", className: "px-2 py-1 font-medium text-muted-foreground [overflow-wrap:anywhere]", children: structuredKeyWords(k) }, k)) }) }),
9159
9182
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: "min-w-[2rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
9160
9183
  ] }) }),
9161
- items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.Button, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
9184
+ items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Button, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
9162
9185
  stop(e);
9163
9186
  setAll((a) => !a);
9164
9187
  }, children: all ? "Show fewer" : `Show all ${items.length}` }) : null
@@ -9184,7 +9207,7 @@ function Nested({ value, keyName, dense, depth = 0 }) {
9184
9207
  }
9185
9208
  function ScalarChips({ items, keyName }) {
9186
9209
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex min-w-0 flex-wrap gap-1", "data-records-structured": "chips", children: items.map(
9187
- (item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.Badge, { variant: "secondary", className: "max-w-full text-[11px] font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "truncate", children: scalarWords(item) }) }, i)
9210
+ (item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Badge, { variant: "secondary", className: "max-w-full text-[11px] font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "truncate", children: scalarWords(item) }) }, i)
9188
9211
  ) });
9189
9212
  }
9190
9213
  function Shape({ data, depth = 0 }) {
@@ -9226,12 +9249,12 @@ function StructuredValueView({ structured, label, className }) {
9226
9249
  const ui = useRecordsUi();
9227
9250
  const savable = shapeOfValue(structured.data) !== null;
9228
9251
  const text = rawTextOf(structured);
9229
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_design_system29.cn)("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
9252
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_design_system30.cn)("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
9230
9253
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 items-center gap-1", onClick: stop, children: [
9231
9254
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: recordsCount(structured.data) }),
9232
- savable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.Button, { type: "button", variant: "ghost", size: "sm", className: "h-6 px-2 text-xs", onClick: () => setSaving(true), "data-records-structured-save": "", children: "Save as table" }) : null,
9255
+ savable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Button, { type: "button", variant: "ghost", size: "sm", className: "h-6 px-2 text-xs", onClick: () => setSaving(true), "data-records-structured-save": "", children: "Save as table" }) : null,
9233
9256
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9234
- import_design_system29.Button,
9257
+ import_design_system30.Button,
9235
9258
  {
9236
9259
  type: "button",
9237
9260
  variant: raw ? "secondary" : "ghost",
@@ -9246,10 +9269,10 @@ function StructuredValueView({ structured, label, className }) {
9246
9269
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react52.AlchemyMenu, { label, sourceId: `records:value:${label}`, size: "xs", json: () => structured.data, human: () => text })
9247
9270
  ] }),
9248
9271
  raw ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 p-2 font-mono text-xs", "data-records-structured-raw": "", children: structured.raw !== null ? prettyJsonText(structured.raw) : text }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Shape, { data: structured.data }),
9249
- saving ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.Dialog, { open: true, onOpenChange: (open) => {
9272
+ saving ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Dialog, { open: true, onOpenChange: (open) => {
9250
9273
  if (!open) setSaving(false);
9251
- }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system29.DialogContent, { className: "max-h-[90vh] max-w-3xl overflow-y-auto", children: [
9252
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system29.DialogTitle, { children: [
9274
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.DialogContent, { className: "max-h-[90vh] max-w-3xl overflow-y-auto", children: [
9275
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.DialogTitle, { children: [
9253
9276
  "Save ",
9254
9277
  label,
9255
9278
  " as a table"
@@ -9276,8 +9299,8 @@ function StructuredCell({ structured, label }) {
9276
9299
  const summary = structuredSummary(structured.data);
9277
9300
  const first = Array.isArray(structured.data) ? structured.data.find(isPlainObject2) : structured.data;
9278
9301
  const picture = isPlainObject2(first) ? Object.entries(first).find(([k, v]) => isImageUrl(v, k))?.[1] : void 0;
9279
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system29.Popover, { children: [
9280
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system29.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
9302
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.Popover, { children: [
9303
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
9281
9304
  "button",
9282
9305
  {
9283
9306
  type: "button",
@@ -9293,7 +9316,7 @@ function StructuredCell({ structured, label }) {
9293
9316
  }
9294
9317
  ) }),
9295
9318
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9296
- import_design_system29.PopoverContent,
9319
+ import_design_system30.PopoverContent,
9297
9320
  {
9298
9321
  align: "start",
9299
9322
  collisionPadding: 8,
@@ -9419,14 +9442,14 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
9419
9442
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", "data-records-choice-chips": "", children: items.map((item, i) => {
9420
9443
  const chip = chipOf(item);
9421
9444
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
9422
- import_design_system30.Badge,
9445
+ import_design_system31.Badge,
9423
9446
  {
9424
9447
  variant: "outline",
9425
- className: (0, import_design_system30.cn)("text-[11px]", chip.className),
9448
+ className: (0, import_design_system31.cn)("text-[11px]", chip.className),
9426
9449
  "data-records-choice-chip": "",
9427
9450
  ...chip.tinted ? { "data-records-choice-tint": "" } : {},
9428
9451
  children: [
9429
- look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0, import_design_system30.cn)("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
9452
+ look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0, import_design_system31.cn)("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
9430
9453
  statusMark(field, item, Array.isArray(value) ? void 0 : document2),
9431
9454
  scalarText(field, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
9432
9455
  ]
@@ -9437,7 +9460,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
9437
9460
  }
9438
9461
  if (kind === "attachment") return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AttachmentChips, { value });
9439
9462
  if (Array.isArray(value)) {
9440
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system30.Badge, { variant: "secondary", className: "text-[11px]", children: scalarText(field, item, labels) }, `${String(item)}-${i}`)) });
9463
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system31.Badge, { variant: "secondary", className: "text-[11px]", children: scalarText(field, item, labels) }, `${String(item)}-${i}`)) });
9441
9464
  }
9442
9465
  const pictureAt = imageAddressOf(field, value);
9443
9466
  if (pictureAt) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ImageUrlValue, { url: pictureAt, alt: field.label || field.key, room });
@@ -9477,7 +9500,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
9477
9500
  if (typeof value === "boolean") {
9478
9501
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: kind === "checkbox" ? "text-sm" : "", title: value ? "Yes" : "No", children: value ? "\u2713" : "\u2014" });
9479
9502
  }
9480
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0, import_design_system30.cn)("truncate", kind === "number" || kind === "currency" || kind === "percent" ? "tabular-nums" : ""), children: scalarText(field, value, labels, stillWaitingFor) });
9503
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0, import_design_system31.cn)("truncate", kind === "number" || kind === "currency" || kind === "percent" ? "tabular-nums" : ""), children: scalarText(field, value, labels, stillWaitingFor) });
9481
9504
  }
9482
9505
  function isImageUrl2(value) {
9483
9506
  const text = value.trim();
@@ -9505,7 +9528,7 @@ function ImageUrlValue({ url, alt, room }) {
9505
9528
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9506
9529
  import_outbound_react6.OutboundLink,
9507
9530
  {
9508
- className: (0, import_design_system30.cn)("inline-flex shrink-0 overflow-hidden rounded-md border border-border bg-muted/40", host.fileImage ? box : "min-w-0 max-w-full items-center gap-1 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent"),
9531
+ className: (0, import_design_system31.cn)("inline-flex shrink-0 overflow-hidden rounded-md border border-border bg-muted/40", host.fileImage ? box : "min-w-0 max-w-full items-center gap-1 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent"),
9509
9532
  href: url,
9510
9533
  title: url,
9511
9534
  "data-records-image-url": "",
@@ -9616,7 +9639,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
9616
9639
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm", children: SOURCE_ARCHIVED_WORDS }),
9617
9640
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: sourceArchivedSentence(state2) })
9618
9641
  ] }),
9619
- state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system31.Button, { type: "button", size: "sm", variant: "secondary", disabled: busy, onClick: () => void restore(), children: bringBackLabel(state2) }) : null,
9642
+ state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system32.Button, { type: "button", size: "sm", variant: "secondary", disabled: busy, onClick: () => void restore(), children: bringBackLabel(state2) }) : null,
9620
9643
  refused ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RefusalNotice, { error: refused, className: "basis-full" }) : null
9621
9644
  ]
9622
9645
  }
@@ -9625,7 +9648,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
9625
9648
 
9626
9649
  // src/Condition.tsx
9627
9650
  var import_react56 = require("react");
9628
- var import_design_system32 = require("@ai-matrx/design-system");
9651
+ var import_design_system33 = require("@ai-matrx/design-system");
9629
9652
  var import_records18 = require("@ai-matrx/records");
9630
9653
  init_PickOrAdd();
9631
9654
  init_choiceLooks();
@@ -9802,7 +9825,7 @@ function ChoiceValues({ field, value, onChange }) {
9802
9825
  };
9803
9826
  if (!choices || choices.length === 0) {
9804
9827
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
9805
- import_design_system32.BasicInput,
9828
+ import_design_system33.BasicInput,
9806
9829
  {
9807
9830
  className: "h-8 w-40 text-xs",
9808
9831
  "aria-label": "Condition values, separated by commas",
@@ -9813,7 +9836,7 @@ function ChoiceValues({ field, value, onChange }) {
9813
9836
  }
9814
9837
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "inline-flex flex-wrap items-center gap-1", "data-records-condition-choices": "", "data-pick-values": value.join("|"), children: [
9815
9838
  choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
9816
- import_design_system32.Button,
9839
+ import_design_system33.Button,
9817
9840
  {
9818
9841
  type: "button",
9819
9842
  size: "sm",
@@ -9826,7 +9849,7 @@ function ChoiceValues({ field, value, onChange }) {
9826
9849
  },
9827
9850
  c.key
9828
9851
  )),
9829
- strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system32.Button, { type: "button", size: "sm", variant: "default", className: "h-7 px-2 text-xs", "aria-pressed": true, "aria-label": `${w} (not a choice of this column)`, onClick: () => onChange(value.filter((x) => x !== w)), children: w }, `stray-${w}`))
9852
+ strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system33.Button, { type: "button", size: "sm", variant: "default", className: "h-7 px-2 text-xs", "aria-pressed": true, "aria-label": `${w} (not a choice of this column)`, onClick: () => onChange(value.filter((x) => x !== w)), children: w }, `stray-${w}`))
9830
9853
  ] });
9831
9854
  }
9832
9855
  function ChoiceValue({ field, value, onChange }) {
@@ -9849,7 +9872,7 @@ function ChoiceValue({ field, value, onChange }) {
9849
9872
  }, [client, field.id]);
9850
9873
  if (!choices || choices.length === 0) {
9851
9874
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
9852
- import_design_system32.BasicInput,
9875
+ import_design_system33.BasicInput,
9853
9876
  {
9854
9877
  className: "h-8 w-28 text-xs",
9855
9878
  "aria-label": "Condition value",
@@ -10067,7 +10090,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
10067
10090
  }
10068
10091
  ),
10069
10092
  relative ? relativeTerm?.takesDays ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10070
- import_design_system32.BasicInput,
10093
+ import_design_system33.BasicInput,
10071
10094
  {
10072
10095
  className: "h-8 w-16 text-xs",
10073
10096
  type: "number",
@@ -10095,7 +10118,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
10095
10118
  }
10096
10119
  )
10097
10120
  ) : isChoiceColumn(chosen) && CHOICE_LIST_OPS.has(op) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChoiceValues, { field: chosen.field, value: wordsOfValue(value), onChange: (words) => write({ value: words }) }) : isChoiceColumn(chosen) && (op === "eq" || op === "ne" || op === "contains" || op === "not_contains") ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChoiceValue, { field: chosen.field, value: String(value ?? ""), onChange: (word) => write({ value: word }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10098
- import_design_system32.BasicInput,
10121
+ import_design_system33.BasicInput,
10099
10122
  {
10100
10123
  className: "h-8 w-28 text-xs",
10101
10124
  "aria-label": "Condition value",
@@ -10203,7 +10226,7 @@ function ConditionGroup({
10203
10226
  }
10204
10227
  ),
10205
10228
  nested && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10206
- import_design_system32.Button,
10229
+ import_design_system33.Button,
10207
10230
  {
10208
10231
  size: "sm",
10209
10232
  variant: "ghost",
@@ -10270,7 +10293,7 @@ function ConditionGroup({
10270
10293
  ) }) : null,
10271
10294
  args.length > 0 && !drafting ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-1", children: [
10272
10295
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10273
- import_design_system32.Button,
10296
+ import_design_system33.Button,
10274
10297
  {
10275
10298
  size: "sm",
10276
10299
  variant: "ghost",
@@ -10281,7 +10304,7 @@ function ConditionGroup({
10281
10304
  }
10282
10305
  ),
10283
10306
  allowNesting && (maxDepth === void 0 || depth < maxDepth) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10284
- import_design_system32.Button,
10307
+ import_design_system33.Button,
10285
10308
  {
10286
10309
  size: "sm",
10287
10310
  variant: "ghost",
@@ -10301,7 +10324,7 @@ function ConditionGroup({
10301
10324
  var import_react58 = require("react");
10302
10325
  var import_records19 = require("@ai-matrx/records");
10303
10326
  var import_react59 = require("@ai-matrx/records/react");
10304
- var import_design_system33 = require("@ai-matrx/design-system");
10327
+ var import_design_system34 = require("@ai-matrx/design-system");
10305
10328
  init_parity();
10306
10329
  init_names();
10307
10330
  init_Refusal();
@@ -10625,12 +10648,12 @@ function FieldRetype({ field, tableId, onRetyped }) {
10625
10648
  };
10626
10649
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-1.5", "data-records-retype": "", children: [
10627
10650
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
10628
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_design_system33.Select, { value: to?.id ?? "", onValueChange: (next) => setTo(targets.find((t) => t.id === next) ?? null), children: [
10629
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.SelectTrigger, { size: "sm", "aria-label": "Change what this column holds", className: "w-auto min-w-[12rem]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.SelectValue, { placeholder: "Change what this column holds" }) }),
10630
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.SelectContent, { children: targets.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.SelectItem, { value: t.id, children: t.label }, t.id)) })
10651
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_design_system34.Select, { value: to?.id ?? "", onValueChange: (next) => setTo(targets.find((t) => t.id === next) ?? null), children: [
10652
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectTrigger, { size: "sm", "aria-label": "Change what this column holds", className: "w-auto min-w-[12rem]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectValue, { placeholder: "Change what this column holds" }) }),
10653
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectContent, { children: targets.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectItem, { value: t.id, children: t.label }, t.id)) })
10631
10654
  ] }),
10632
- to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.Button, { size: "sm", disabled: busy || asking || preview === null, onClick: () => void change(), "data-records-retype-go": "", children: busy ? "Changing\u2026" : `Change to ${to.label}` }) : null,
10633
- to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system33.Button, { size: "sm", variant: "ghost", onClick: () => setTo(null), disabled: busy, children: "Cancel" }) : null
10655
+ to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.Button, { size: "sm", disabled: busy || asking || preview === null, onClick: () => void change(), "data-records-retype-go": "", children: busy ? "Changing\u2026" : `Change to ${to.label}` }) : null,
10656
+ to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.Button, { size: "sm", variant: "ghost", onClick: () => setTo(null), disabled: busy, children: "Cancel" }) : null
10634
10657
  ] }),
10635
10658
  to && asking ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "text-[11px] text-muted-foreground", children: [
10636
10659
  "Counting ",
@@ -10819,7 +10842,7 @@ function choiceLookForNewList(multi, rows) {
10819
10842
 
10820
10843
  // src/NewerKindQuestions.tsx
10821
10844
  var import_records21 = require("@ai-matrx/records");
10822
- var import_design_system34 = require("@ai-matrx/design-system");
10845
+ var import_design_system35 = require("@ai-matrx/design-system");
10823
10846
  var import_jsx_runtime40 = require("react/jsx-runtime");
10824
10847
  var STATUS_STARTING_CHOICES = [
10825
10848
  { words: "Not started", group: "todo" },
@@ -10850,12 +10873,12 @@ function StatusGroupsQuestion({
10850
10873
  }) {
10851
10874
  if (rows.length === 0) return null;
10852
10875
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-1", "data-records-status-groups": "", children: [
10853
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.Label, { className: "text-xs", children: "Groups" }),
10876
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Groups" }),
10854
10877
  rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
10855
10878
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: r.words }),
10856
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.Select, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
10857
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectTrigger, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectValue, {}) }),
10858
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectContent, { children: import_records21.STATUS_GROUPS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.SelectItem, { value: g, children: [
10879
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
10880
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
10881
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectContent, { children: import_records21.STATUS_GROUPS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectItem, { value: g, children: [
10859
10882
  STATUS_GROUP_MARK[g],
10860
10883
  " ",
10861
10884
  import_records21.STATUS_GROUP_WORDS[g]
@@ -10866,10 +10889,10 @@ function StatusGroupsQuestion({
10866
10889
  }
10867
10890
  function RatingMaxQuestion({ value, onChange }) {
10868
10891
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
10869
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.Label, { className: "text-xs", children: "Out of" }),
10870
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.Select, { value: String(value), onValueChange: (next) => onChange(Number(next)), children: [
10871
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectTrigger, { size: "sm", "aria-label": "Out of", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectValue, {}) }),
10872
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectContent, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.SelectItem, { value: String(n), children: [
10892
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Out of" }),
10893
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: String(value), onValueChange: (next) => onChange(Number(next)), children: [
10894
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", "aria-label": "Out of", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
10895
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectContent, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectItem, { value: String(n), children: [
10873
10896
  n,
10874
10897
  " ",
10875
10898
  n === 1 ? "star" : "stars"
@@ -10891,19 +10914,19 @@ var SYMBOLOGY_WORDS = {
10891
10914
  };
10892
10915
  function BarcodeSymbologyQuestion({ value, onChange }) {
10893
10916
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
10894
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.Label, { className: "text-xs", children: "Code type" }),
10895
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.Select, { value: value === "" ? "any" : value, onValueChange: (next) => onChange(next === "any" ? "" : next), children: [
10896
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectTrigger, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectValue, {}) }),
10897
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system34.SelectContent, { children: [
10898
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectItem, { value: "any", children: "Any code" }),
10899
- import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system34.SelectItem, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
10917
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Code type" }),
10918
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: value === "" ? "any" : value, onValueChange: (next) => onChange(next === "any" ? "" : next), children: [
10919
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
10920
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectContent, { children: [
10921
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectItem, { value: "any", children: "Any code" }),
10922
+ import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectItem, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
10900
10923
  ] })
10901
10924
  ] })
10902
10925
  ] });
10903
10926
  }
10904
10927
 
10905
10928
  // src/FieldFormatPicker.tsx
10906
- var import_design_system35 = require("@ai-matrx/design-system");
10929
+ var import_design_system36 = require("@ai-matrx/design-system");
10907
10930
  var import_field_formats8 = require("@ai-matrx/design-system/field-formats");
10908
10931
  init_PickOne();
10909
10932
  init_choiceLooks();
@@ -11036,7 +11059,7 @@ function FieldFormatPicker({
11036
11059
  control
11037
11060
  ] }, key) : null;
11038
11061
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1", "data-records-format-picker": "", children: [
11039
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system35.Label, { className: "text-xs", htmlFor: `records-shows-as-${field.id}`, children: "Shows as" }),
11062
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system36.Label, { className: "text-xs", htmlFor: `records-shows-as-${field.id}`, children: "Shows as" }),
11040
11063
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11041
11064
  PickOne,
11042
11065
  {
@@ -11225,14 +11248,14 @@ var import_records24 = require("@ai-matrx/records");
11225
11248
 
11226
11249
  // src/ButtonSettings.tsx
11227
11250
  var import_react64 = require("react");
11228
- var import_design_system38 = require("@ai-matrx/design-system");
11251
+ var import_design_system39 = require("@ai-matrx/design-system");
11229
11252
  var import_data_table5 = require("@ai-matrx/design-system/data-table");
11230
11253
  var import_records23 = require("@ai-matrx/records");
11231
11254
  var import_react65 = require("@ai-matrx/records/react");
11232
11255
 
11233
11256
  // src/AccentSwatches.tsx
11234
11257
  var import_records22 = require("@ai-matrx/records");
11235
- var import_design_system36 = require("@ai-matrx/design-system");
11258
+ var import_design_system37 = require("@ai-matrx/design-system");
11236
11259
  var import_data_table4 = require("@ai-matrx/design-system/data-table");
11237
11260
  var import_jsx_runtime42 = require("react/jsx-runtime");
11238
11261
  function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACCENTS, noneLabel = "App color" }) {
@@ -11244,7 +11267,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
11244
11267
  role: "radio",
11245
11268
  "aria-checked": value === "",
11246
11269
  onClick: () => onChange(""),
11247
- className: (0, import_design_system36.cn)(
11270
+ className: (0, import_design_system37.cn)(
11248
11271
  "h-7 rounded border px-2 text-xs",
11249
11272
  value === "" ? "border-foreground" : "border-border text-muted-foreground"
11250
11273
  ),
@@ -11260,7 +11283,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
11260
11283
  "aria-label": import_data_table4.STYLE_COLOR_LABELS[c],
11261
11284
  title: import_data_table4.STYLE_COLOR_LABELS[c],
11262
11285
  onClick: () => onChange(c),
11263
- className: (0, import_design_system36.cn)("h-7 w-7 rounded-full border-2", import_data_table4.SWATCH_CLASS[c], value === c ? "border-foreground" : "border-transparent")
11286
+ className: (0, import_design_system37.cn)("h-7 w-7 rounded-full border-2", import_data_table4.SWATCH_CLASS[c], value === c ? "border-foreground" : "border-transparent")
11264
11287
  },
11265
11288
  c
11266
11289
  ))
@@ -11271,7 +11294,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
11271
11294
  init_PickOne();
11272
11295
 
11273
11296
  // src/AddRowSettings.tsx
11274
- var import_design_system37 = require("@ai-matrx/design-system");
11297
+ var import_design_system38 = require("@ai-matrx/design-system");
11275
11298
  var import_react62 = require("@ai-matrx/records/react");
11276
11299
  var import_react63 = require("react");
11277
11300
  init_tablePicking();
@@ -11304,7 +11327,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
11304
11327
  }, [client, target]);
11305
11328
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-2", "data-records-button-add-row": "", children: [
11306
11329
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-1", children: [
11307
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system37.Label, { className: "text-xs", children: "Adds to" }),
11330
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system38.Label, { className: "text-xs", children: "Adds to" }),
11308
11331
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11309
11332
  PickOne,
11310
11333
  {
@@ -11317,7 +11340,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
11317
11340
  )
11318
11341
  ] }),
11319
11342
  templates.length || value.template_id ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-1", children: [
11320
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system37.Label, { className: "text-xs", children: "Starts from" }),
11343
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system38.Label, { className: "text-xs", children: "Starts from" }),
11321
11344
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11322
11345
  PickOne,
11323
11346
  {
@@ -11399,11 +11422,11 @@ function ButtonSettingsEditor({
11399
11422
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-2 rounded-md border p-2", "data-records-button-settings": "", children: [
11400
11423
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid gap-2 sm:grid-cols-2", children: [
11401
11424
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex flex-col gap-1", children: [
11402
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Label, { className: "text-xs", children: "Button label" }),
11403
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.BasicInput, { className: "h-8 text-xs", value: value.label, "data-records-button-label": "", onChange: (e) => set({ label: e.target.value }) })
11425
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Button label" }),
11426
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.BasicInput, { className: "h-8 text-xs", value: value.label, "data-records-button-label": "", onChange: (e) => set({ label: e.target.value }) })
11404
11427
  ] }),
11405
11428
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
11406
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Label, { className: "text-xs", children: "Does" }),
11429
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Does" }),
11407
11430
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11408
11431
  PickOne,
11409
11432
  {
@@ -11417,7 +11440,7 @@ function ButtonSettingsEditor({
11417
11440
  ] })
11418
11441
  ] }),
11419
11442
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
11420
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Label, { className: "text-xs", children: "Color" }),
11443
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Color" }),
11421
11444
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11422
11445
  AccentSwatches,
11423
11446
  {
@@ -11429,10 +11452,10 @@ function ButtonSettingsEditor({
11429
11452
  )
11430
11453
  ] }),
11431
11454
  value.do === "open_url" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
11432
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Label, { className: "text-xs", children: "Link" }),
11455
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Link" }),
11433
11456
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex gap-1", children: [
11434
11457
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11435
- import_design_system38.BasicInput,
11458
+ import_design_system39.BasicInput,
11436
11459
  {
11437
11460
  className: "h-8 flex-1 font-mono text-xs",
11438
11461
  placeholder: "https://",
@@ -11539,7 +11562,7 @@ function NewRowAction({
11539
11562
  onMade(made.id, all);
11540
11563
  };
11541
11564
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", "data-records-button-new-action": "", children: [
11542
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Label, { className: "text-xs", children: "New row action" }),
11565
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "New row action" }),
11543
11566
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
11544
11567
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11545
11568
  PickOne,
@@ -11553,8 +11576,8 @@ function NewRowAction({
11553
11576
  options: settable.map((f) => ({ value: f.id, label: fieldName(f) }))
11554
11577
  }
11555
11578
  ),
11556
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.BasicInput, { className: "h-8 w-32 text-xs", placeholder: "Value", "aria-label": "Value", "data-records-button-action-value": "", value: setTo, onChange: (e) => setSetTo(e.target.value) }),
11557
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system38.Button, { type: "button", size: "sm", variant: "outline", disabled: busy || fieldId === "", "data-records-button-action-make": "", onClick: () => void make(), children: busy ? "Making\u2026" : "Make" })
11579
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.BasicInput, { className: "h-8 w-32 text-xs", placeholder: "Value", "aria-label": "Value", "data-records-button-action-value": "", value: setTo, onChange: (e) => setSetTo(e.target.value) }),
11580
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Button, { type: "button", size: "sm", variant: "outline", disabled: busy || fieldId === "", "data-records-button-action-make": "", onClick: () => void make(), children: busy ? "Making\u2026" : "Make" })
11558
11581
  ] }),
11559
11582
  refused ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RefusalLine, { error: refused }) : null
11560
11583
  ] });
@@ -11847,7 +11870,7 @@ function FieldEditor(props) {
11847
11870
  const offersMany = multiApplies(type) && !isTitle;
11848
11871
  if (!mayShape) {
11849
11872
  if (onEntity && entityRights.loading) return null;
11850
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: (0, import_design_system39.cn)("text-xs text-muted-foreground", className), children: props.tableLabel && storeLabel && whyNot ? whyNot.split(storeLabel).join(props.tableLabel) : whyNot });
11873
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: (0, import_design_system40.cn)("text-xs text-muted-foreground", className), children: props.tableLabel && storeLabel && whyNot ? whyNot.split(storeLabel).join(props.tableLabel) : whyNot });
11851
11874
  }
11852
11875
  const options = newChoices.map((r) => r.words.trim()).filter((word) => word !== "");
11853
11876
  const shownStatusRows = type !== "status" ? [] : statusGroupRows(field, editing ? choiceList ?? [] : newChoices, statusKeys, statusGroups);
@@ -12065,16 +12088,16 @@ function FieldEditor(props) {
12065
12088
  if (gone) (onRemoved ?? onSaved)?.();
12066
12089
  else setAskingToRemove(false);
12067
12090
  };
12068
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system39.cn)("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
12091
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system40.cn)("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
12069
12092
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
12070
12093
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: field ? `Field \xB7 ${fieldName(field)}` : "New field" }),
12071
12094
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ml-auto text-muted-foreground", children: tableLabel })
12072
12095
  ] }),
12073
12096
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
12074
12097
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex flex-col gap-1", children: [
12075
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Name" }),
12098
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Name" }),
12076
12099
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12077
- import_design_system39.BasicInput,
12100
+ import_design_system40.BasicInput,
12078
12101
  {
12079
12102
  value: label,
12080
12103
  autoFocus: true,
@@ -12101,9 +12124,9 @@ function FieldEditor(props) {
12101
12124
  ) : null
12102
12125
  ] }),
12103
12126
  field ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex flex-col gap-1 sm:col-span-2", children: [
12104
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Help text" }),
12127
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Help text" }),
12105
12128
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12106
- import_design_system39.BasicInput,
12129
+ import_design_system40.BasicInput,
12107
12130
  {
12108
12131
  value: description,
12109
12132
  maxLength: 300,
@@ -12114,18 +12137,18 @@ function FieldEditor(props) {
12114
12137
  )
12115
12138
  ] }) : null,
12116
12139
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12117
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "What it holds" }),
12140
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What it holds" }),
12118
12141
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12119
- import_design_system39.Select,
12142
+ import_design_system40.Select,
12120
12143
  {
12121
12144
  value: type,
12122
12145
  disabled: editing,
12123
12146
  onValueChange: (next) => setType(next),
12124
12147
  children: [
12125
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12126
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.SelectGroup, { children: [
12127
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectLabel, { children: group }),
12128
- FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: c.id, children: c.label }, c.id))
12148
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12149
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectGroup, { children: [
12150
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectLabel, { children: group }),
12151
+ FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: c.id, children: c.label }, c.id))
12129
12152
  ] }, group)) })
12130
12153
  ]
12131
12154
  }
@@ -12136,7 +12159,7 @@ function FieldEditor(props) {
12136
12159
  type === "formula" && others.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
12137
12160
  editing ? startingFormulaText.trim() === "" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: EDITING_A_WORKED_OUT_COLUMN }) : null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1", role: "group", "aria-label": "How to make this column", children: [
12138
12161
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12139
- import_design_system39.Button,
12162
+ import_design_system40.Button,
12140
12163
  {
12141
12164
  type: "button",
12142
12165
  size: "sm",
@@ -12147,7 +12170,7 @@ function FieldEditor(props) {
12147
12170
  }
12148
12171
  ),
12149
12172
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12150
- import_design_system39.Button,
12173
+ import_design_system40.Button,
12151
12174
  {
12152
12175
  type: "button",
12153
12176
  size: "sm",
@@ -12228,16 +12251,16 @@ function FieldEditor(props) {
12228
12251
  type === "button" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ButtonSettingsEditor, { value: buttonSettings, onChange: setButtonSettings, tableId: onEntity ? null : tableId, fields: others }) : null,
12229
12252
  type === "modified_time" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WatchFieldsPicker, { fields: others, value: watchFields, onChange: setWatchFields }) : null,
12230
12253
  type === "autonumber" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
12231
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Prefix" }),
12232
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.BasicInput, { className: "h-8 text-xs", placeholder: "TASK-", maxLength: 16, "data-records-autonumber-prefix": "", value: numberPrefix, onChange: (e) => setNumberPrefix(e.target.value) })
12254
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Prefix" }),
12255
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.BasicInput, { className: "h-8 text-xs", placeholder: "TASK-", maxLength: 16, "data-records-autonumber-prefix": "", value: numberPrefix, onChange: (e) => setNumberPrefix(e.target.value) })
12233
12256
  ] }) : null,
12234
12257
  editing && field?.type === "relation" && field.relation_target && field.relation_target === field.entity_definition_id ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "A timeline draws a line to each record this one waits on", children: [
12235
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
12258
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
12236
12259
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Waits on the linked records" })
12237
12260
  ] }) : null,
12238
12261
  personColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "Each person added to this column gets a notice", children: [
12239
12262
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12240
- import_design_system39.Checkbox,
12263
+ import_design_system40.Checkbox,
12241
12264
  {
12242
12265
  checked: notify,
12243
12266
  disabled: notifyStart === null,
@@ -12263,7 +12286,7 @@ function FieldEditor(props) {
12263
12286
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-wrap items-center gap-4", children: [
12264
12287
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12265
12288
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12266
- import_design_system39.Checkbox,
12289
+ import_design_system40.Checkbox,
12267
12290
  {
12268
12291
  checked: required,
12269
12292
  "aria-label": "Required",
@@ -12274,7 +12297,7 @@ function FieldEditor(props) {
12274
12297
  ] }),
12275
12298
  offersMany ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12276
12299
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12277
- import_design_system39.Checkbox,
12300
+ import_design_system40.Checkbox,
12278
12301
  {
12279
12302
  checked: multi,
12280
12303
  "aria-label": "Can hold more than one",
@@ -12285,7 +12308,7 @@ function FieldEditor(props) {
12285
12308
  ] }) : null,
12286
12309
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12287
12310
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12288
- import_design_system39.Checkbox,
12311
+ import_design_system40.Checkbox,
12289
12312
  {
12290
12313
  checked: dated,
12291
12314
  "aria-label": "Each value has its own date",
@@ -12296,7 +12319,7 @@ function FieldEditor(props) {
12296
12319
  ] }),
12297
12320
  !field && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12298
12321
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12299
- import_design_system39.Checkbox,
12322
+ import_design_system40.Checkbox,
12300
12323
  {
12301
12324
  checked: showOnOther,
12302
12325
  "aria-label": `Show on ${otherTable.data.name ?? "the other table"}`,
@@ -12308,12 +12331,12 @@ function FieldEditor(props) {
12308
12331
  otherTable.data.name ?? "the other table"
12309
12332
  ] }) : null,
12310
12333
  !field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", title: "A timeline draws a line to each record this one waits on", children: [
12311
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
12334
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
12312
12335
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Waits on the linked records" })
12313
12336
  ] }) : null,
12314
12337
  !field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12315
12338
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12316
- import_design_system39.Checkbox,
12339
+ import_design_system40.Checkbox,
12317
12340
  {
12318
12341
  checked: nestsSubItems,
12319
12342
  "aria-label": "Sub-items",
@@ -12328,7 +12351,7 @@ function FieldEditor(props) {
12328
12351
  ] }) : null,
12329
12352
  CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12330
12353
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12331
- import_design_system39.Checkbox,
12354
+ import_design_system40.Checkbox,
12332
12355
  {
12333
12356
  checked: allowOther,
12334
12357
  "aria-label": "A value that is not one of the choices is added to them",
@@ -12340,7 +12363,7 @@ function FieldEditor(props) {
12340
12363
  ] }),
12341
12364
  !editing && !onEntity && newColumnTakesADefault(type) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NewColumnDefault, { type, choices: options, value: startsWith, onChange: setStartsWith }) : null,
12342
12365
  editing && field && takesADefault(liveField ?? field) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", children: [
12343
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { htmlFor: "records-field-default", className: "text-xs", children: DEFAULT_LABEL }),
12366
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { htmlFor: "records-field-default", className: "text-xs", children: DEFAULT_LABEL }),
12344
12367
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12345
12368
  FieldControl,
12346
12369
  {
@@ -12351,29 +12374,29 @@ function FieldEditor(props) {
12351
12374
  }
12352
12375
  )
12353
12376
  ] }) : null,
12354
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Separator, {}),
12377
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Separator, {}),
12355
12378
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
12356
12379
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12357
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Who can see what is in it" }),
12358
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: sensitivity, onValueChange: setSensitivity, children: [
12359
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": "Who can see what is in it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12360
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: sensitivities.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: row.value, children: row.label }, row.value)) })
12380
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Who can see what is in it" }),
12381
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: sensitivity, onValueChange: setSensitivity, children: [
12382
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "Who can see what is in it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12383
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: sensitivities.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
12361
12384
  ] })
12362
12385
  ] }),
12363
12386
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12364
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Can an assistant read it" }),
12365
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: contextPolicy, onValueChange: setContextPolicy, children: [
12366
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": "Can an assistant read it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12367
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: AGENT_VISIBILITY.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: row.value, children: row.label }, row.value)) })
12387
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Can an assistant read it" }),
12388
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: contextPolicy, onValueChange: setContextPolicy, children: [
12389
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "Can an assistant read it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12390
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: AGENT_VISIBILITY.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
12368
12391
  ] })
12369
12392
  ] })
12370
12393
  ] }),
12371
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Separator, {}),
12394
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Separator, {}),
12372
12395
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
12373
12396
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
12374
12397
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: "What counts as a good value" }),
12375
12398
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12376
- import_design_system39.Button,
12399
+ import_design_system40.Button,
12377
12400
  {
12378
12401
  type: "button",
12379
12402
  size: "sm",
@@ -12386,7 +12409,7 @@ function FieldEditor(props) {
12386
12409
  ] }),
12387
12410
  canBeUnique(type, multi) || rules.some((r) => r.kind === "unique") ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", "data-records-field-unique": "", children: [
12388
12411
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12389
- import_design_system39.Checkbox,
12412
+ import_design_system40.Checkbox,
12390
12413
  {
12391
12414
  checked: rules.some((r) => r.kind === "unique"),
12392
12415
  "aria-label": UNIQUE_LABEL,
@@ -12398,18 +12421,18 @@ function FieldEditor(props) {
12398
12421
  rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-muted-foreground", children: "No checks." }) : null,
12399
12422
  rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1", children: [
12400
12423
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12401
- import_design_system39.Select,
12424
+ import_design_system40.Select,
12402
12425
  {
12403
12426
  value: rule.kind,
12404
12427
  onValueChange: (kind) => setRules(rules.map((r, i) => i === index ? { ...r, kind } : r)),
12405
12428
  children: [
12406
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", className: "w-52", "aria-label": `Check ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12407
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: RULE_KINDS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: row.kind, children: row.label }, row.kind)) })
12429
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", className: "w-52", "aria-label": `Check ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12430
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: RULE_KINDS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.kind, children: row.label }, row.kind)) })
12408
12431
  ]
12409
12432
  }
12410
12433
  ),
12411
12434
  rule.kind === "length" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12412
- import_design_system39.BasicInput,
12435
+ import_design_system40.BasicInput,
12413
12436
  {
12414
12437
  className: "h-8 w-24",
12415
12438
  inputMode: "numeric",
@@ -12420,7 +12443,7 @@ function FieldEditor(props) {
12420
12443
  }
12421
12444
  ) : null,
12422
12445
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12423
- import_design_system39.BasicInput,
12446
+ import_design_system40.BasicInput,
12424
12447
  {
12425
12448
  className: "h-8",
12426
12449
  ...rule.kind === "length" ? { inputMode: "numeric", placeholder: "most" } : {},
@@ -12430,7 +12453,7 @@ function FieldEditor(props) {
12430
12453
  }
12431
12454
  ),
12432
12455
  rule.kind === "pattern" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12433
- import_design_system39.BasicInput,
12456
+ import_design_system40.BasicInput,
12434
12457
  {
12435
12458
  className: "h-8",
12436
12459
  placeholder: "for example 949-555-0142",
@@ -12440,7 +12463,7 @@ function FieldEditor(props) {
12440
12463
  }
12441
12464
  ) : null,
12442
12465
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12443
- import_design_system39.Button,
12466
+ import_design_system40.Button,
12444
12467
  {
12445
12468
  type: "button",
12446
12469
  size: "sm",
@@ -12468,7 +12491,7 @@ function FieldEditor(props) {
12468
12491
  rehomed ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { "data-records-choice-rehomed": "", className: "flex flex-wrap items-center gap-2 text-[11px]", children: [
12469
12492
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: rehomed.said }),
12470
12493
  rehomed.undo ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12471
- import_design_system39.Button,
12494
+ import_design_system40.Button,
12472
12495
  {
12473
12496
  type: "button",
12474
12497
  size: "sm",
@@ -12492,7 +12515,7 @@ function FieldEditor(props) {
12492
12515
  children: "Undo"
12493
12516
  }
12494
12517
  ) : null,
12495
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
12518
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
12496
12519
  ] }) : null,
12497
12520
  reverseRefused ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { "data-records-reverse-field-refused": "", className: "flex flex-col gap-1", children: [
12498
12521
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px]", children: "The link is made. Its column on the other table was not:" }),
@@ -12504,7 +12527,7 @@ function FieldEditor(props) {
12504
12527
  ] }) : null,
12505
12528
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 flex-nowrap items-center gap-2", "data-field-editor-footer": "", children: [
12506
12529
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12507
- import_design_system39.Button,
12530
+ import_design_system40.Button,
12508
12531
  {
12509
12532
  size: "sm",
12510
12533
  disabled: mutation.saving || Boolean(formulaMissing) || Boolean(nameLine) && label.trim() !== (field?.label ?? "").trim(),
@@ -12519,7 +12542,7 @@ function FieldEditor(props) {
12519
12542
  children: mutation.saving ? "Saving\u2026" : field ? EDIT_FIELD_SAVE_LABEL : onEntity ? ADD_STANDARD_FIELD_SAVE_LABEL : ADD_FIELD_SAVE_LABEL
12520
12543
  }
12521
12544
  ),
12522
- onCancel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Button, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
12545
+ onCancel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
12523
12546
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12524
12547
  "span",
12525
12548
  {
@@ -12537,11 +12560,11 @@ function FieldEditor(props) {
12537
12560
  the dialog card 0.2278 and closing it 0.1303. The consequence is the tooltip of
12538
12561
  "Remove it" (interface-text: the slot holds a label, never a paragraph). */
12539
12562
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "ml-auto grid shrink-0 items-center", "data-field-editor-remove": askingToRemove ? "asking" : "idle", children: [
12540
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: (0, import_design_system39.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", askingToRemove && "invisible"), "aria-hidden": askingToRemove || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Button, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
12541
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system39.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
12563
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: (0, import_design_system40.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", askingToRemove && "invisible"), "aria-hidden": askingToRemove || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
12564
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system40.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
12542
12565
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "whitespace-nowrap text-destructive", "data-field-editor-remove-ask": "", children: "Archive this field?" }),
12543
12566
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12544
- import_design_system39.Button,
12567
+ import_design_system40.Button,
12545
12568
  {
12546
12569
  size: "sm",
12547
12570
  variant: "destructive",
@@ -12553,7 +12576,7 @@ function FieldEditor(props) {
12553
12576
  children: "Remove it"
12554
12577
  }
12555
12578
  ),
12556
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Button, { size: "sm", variant: "ghost", tabIndex: askingToRemove ? void 0 : -1, onClick: () => setAskingToRemove(false), children: "Keep it" })
12579
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "ghost", tabIndex: askingToRemove ? void 0 : -1, onClick: () => setAskingToRemove(false), children: "Keep it" })
12557
12580
  ] })
12558
12581
  ] })
12559
12582
  ) : null
@@ -12672,9 +12695,9 @@ function TypeQuestions(props) {
12672
12695
  }
12673
12696
  if (type === "currency") {
12674
12697
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
12675
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "The currency" }),
12698
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "The currency" }),
12676
12699
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12677
- import_design_system39.BasicInput,
12700
+ import_design_system40.BasicInput,
12678
12701
  {
12679
12702
  value: props.unit,
12680
12703
  "aria-label": "The currency",
@@ -12687,7 +12710,7 @@ function TypeQuestions(props) {
12687
12710
  if (type === "datetime") {
12688
12711
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
12689
12712
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12690
- import_design_system39.Checkbox,
12713
+ import_design_system40.Checkbox,
12691
12714
  {
12692
12715
  checked: props.withTime,
12693
12716
  "aria-label": "Include a time of day",
@@ -12704,10 +12727,10 @@ function TypeQuestions(props) {
12704
12727
  }
12705
12728
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
12706
12729
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12707
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: type !== "lookup" ? "Across the records in" : "Read it from" }),
12708
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: props.via, onValueChange: props.setVia, children: [
12709
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": type !== "lookup" ? "Across the records in" : "Read it from", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, { placeholder: "Choose a column" }) }),
12710
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: usable.map((f) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.SelectItem, { value: f.key, children: [
12730
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: type !== "lookup" ? "Across the records in" : "Read it from" }),
12731
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.via, onValueChange: props.setVia, children: [
12732
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": type !== "lookup" ? "Across the records in" : "Read it from", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, { placeholder: "Choose a column" }) }),
12733
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: usable.map((f) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectItem, { value: f.key, children: [
12711
12734
  fieldName(f),
12712
12735
  isBackLinkSource(f) ? BACK_LINK_SOURCE_SUFFIX : "",
12713
12736
  sourceKindOf(f) === "person" ? " \u2014 a person" : sourceKindOf(f) === "file" ? " \u2014 a file" : "",
@@ -12725,10 +12748,10 @@ function TypeQuestions(props) {
12725
12748
  onChange: props.setPick
12726
12749
  }
12727
12750
  ) : type === "count" ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12728
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "What to work out" }),
12729
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: props.agg, onValueChange: (v) => props.setAgg(v), children: [
12730
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": "What to work out", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12731
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: ROLLUP_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: row.value, children: row.label }, row.value)) })
12751
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What to work out" }),
12752
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.agg, onValueChange: (v) => props.setAgg(v), children: [
12753
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "What to work out", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12754
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: ROLLUP_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
12732
12755
  ] }),
12733
12756
  props.agg !== "count" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12734
12757
  ValueOnTheOtherSide,
@@ -12750,18 +12773,18 @@ function TypeQuestions(props) {
12750
12773
  }
12751
12774
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
12752
12775
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12753
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "What to do" }),
12754
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: props.formulaOp, onValueChange: props.setFormulaOp, children: [
12755
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", className: "max-w-[18rem]", "aria-label": "What to do", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12756
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: FORMULA_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: row.value, children: row.label }, row.value)) })
12776
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What to do" }),
12777
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.formulaOp, onValueChange: props.setFormulaOp, children: [
12778
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", className: "max-w-[18rem]", "aria-label": "What to do", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12779
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: FORMULA_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
12757
12780
  ] })
12758
12781
  ] }),
12759
12782
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12760
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: "Which columns" }),
12783
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Which columns" }),
12761
12784
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex flex-wrap gap-1", children: props.others.map((f) => {
12762
12785
  const picked = props.formulaFields.includes(f.id);
12763
12786
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12764
- import_design_system39.Button,
12787
+ import_design_system40.Button,
12765
12788
  {
12766
12789
  type: "button",
12767
12790
  size: "sm",
@@ -12776,9 +12799,9 @@ function TypeQuestions(props) {
12776
12799
  }) })
12777
12800
  ] }),
12778
12801
  props.formulaOp === "concat" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12779
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
12802
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
12780
12803
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12781
- import_design_system39.BasicInput,
12804
+ import_design_system40.BasicInput,
12782
12805
  {
12783
12806
  value: props.formulaSeparator,
12784
12807
  "aria-label": FORMULA_SEPARATOR_LABEL,
@@ -12845,7 +12868,7 @@ function RollupFilterQuestion({
12845
12868
  conditionInWords(value, conditionFields),
12846
12869
  "."
12847
12870
  ] }),
12848
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onChange(null), children: "Clear" })
12871
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onChange(null), children: "Clear" })
12849
12872
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ChoiceListTermsContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12850
12873
  ConditionGroup,
12851
12874
  {
@@ -12872,13 +12895,13 @@ function ValueOnTheOtherSide({
12872
12895
  const carried = sample.data?.rows[0]?.document ?? null;
12873
12896
  const offered = declared.length > 0 ? declared.map((f) => ({ key: f.key, name: fieldName(f) })) : Object.keys(carried ?? {}).map((key) => ({ key, name: (0, import_text_case7.humanizeIdentifier)(key) }));
12874
12897
  const stillAsking = columns.loading || declared.length === 0 && sample.loading;
12875
- const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value, onValueChange: onChange, children: [
12876
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { size: "sm", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, { placeholder: "Choose a column" }) }),
12877
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectContent, { children: offered.map((column) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: column.key, children: column.name }, column.key)) })
12898
+ const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value, onValueChange: onChange, children: [
12899
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, { placeholder: "Choose a column" }) }),
12900
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: offered.map((column) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: column.key, children: column.name }, column.key)) })
12878
12901
  ] });
12879
12902
  if (compact) return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mt-1 flex flex-col gap-1", children: body });
12880
12903
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
12881
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { className: "text-xs", title: help, children: label }),
12904
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", title: help, children: label }),
12882
12905
  body
12883
12906
  ] });
12884
12907
  }
@@ -12905,18 +12928,18 @@ function NewColumnDefault({
12905
12928
  }) {
12906
12929
  const none = "__none__";
12907
12930
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", "data-records-new-field-default": "", children: [
12908
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Label, { htmlFor: "records-new-field-default", className: "text-xs", children: DEFAULT_LABEL }),
12931
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { htmlFor: "records-new-field-default", className: "text-xs", children: DEFAULT_LABEL }),
12909
12932
  type === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-2", children: [
12910
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.Checkbox, { id: "records-new-field-default", "aria-label": DEFAULT_LABEL, checked: value === true, onCheckedChange: (on) => onChange(on === true ? true : null) }),
12933
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { id: "records-new-field-default", "aria-label": DEFAULT_LABEL, checked: value === true, onCheckedChange: (on) => onChange(on === true ? true : null) }),
12911
12934
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Ticked" })
12912
- ] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.Select, { value: typeof value === "string" && choices.includes(value) ? value : none, onValueChange: (v) => onChange(v === none ? null : v), children: [
12913
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectTrigger, { id: "records-new-field-default", size: "sm", "aria-label": DEFAULT_LABEL, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectValue, {}) }),
12914
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system39.SelectContent, { children: [
12915
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: none, children: "Nothing" }),
12916
- choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system39.SelectItem, { value: c, children: c }, c))
12935
+ ] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: typeof value === "string" && choices.includes(value) ? value : none, onValueChange: (v) => onChange(v === none ? null : v), children: [
12936
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { id: "records-new-field-default", size: "sm", "aria-label": DEFAULT_LABEL, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
12937
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectContent, { children: [
12938
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: none, children: "Nothing" }),
12939
+ choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: c, children: c }, c))
12917
12940
  ] })
12918
12941
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12919
- import_design_system39.BasicInput,
12942
+ import_design_system40.BasicInput,
12920
12943
  {
12921
12944
  id: "records-new-field-default",
12922
12945
  value: typeof value === "string" ? value : value === null || value === void 0 ? "" : String(value),
@@ -13008,7 +13031,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13008
13031
  const color = (0, import_data_table6.isStyleColor)(b.color) ? import_data_table6.CHOICE_CHIP_CLASS[b.color] : import_data_table6.NEUTRAL_CHIP_CLASS;
13009
13032
  if (beforeSave) {
13010
13033
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-2", "data-records-button-before-save": field.key, children: [
13011
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.Button, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field.key}-before-save`, "data-records-button": field.key, className: (0, import_design_system40.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: b.label }) }),
13034
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.Button, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field.key}-before-save`, "data-records-button": field.key, className: (0, import_design_system41.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: b.label }) }),
13012
13035
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { id: `${field.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
13013
13036
  ] });
13014
13037
  }
@@ -13107,7 +13130,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13107
13130
  };
13108
13131
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
13109
13132
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13110
- import_design_system40.Popover,
13133
+ import_design_system41.Popover,
13111
13134
  {
13112
13135
  open: said2 !== null,
13113
13136
  onOpenChange: (open) => {
@@ -13117,8 +13140,8 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13117
13140
  setSaid(null);
13118
13141
  },
13119
13142
  children: [
13120
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13121
- import_design_system40.Button,
13143
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13144
+ import_design_system41.Button,
13122
13145
  {
13123
13146
  type: "button",
13124
13147
  size: "xs",
@@ -13128,7 +13151,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13128
13151
  "aria-busy": busy || opening || void 0,
13129
13152
  "data-records-button-pending": busy || opening ? "" : void 0,
13130
13153
  disabled: busy || opening,
13131
- className: (0, import_design_system40.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color, needs && "border-dashed opacity-80"),
13154
+ className: (0, import_design_system41.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color, needs && "border-dashed opacity-80"),
13132
13155
  onPointerDown: stop2,
13133
13156
  onDoubleClick: stop2,
13134
13157
  onClick: (event) => {
@@ -13136,13 +13159,13 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13136
13159
  event.preventDefault();
13137
13160
  void press();
13138
13161
  },
13139
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: (0, import_design_system40.cn)("truncate", (busy || opening) && "matrx-shimmer"), children: b.label })
13162
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: (0, import_design_system41.cn)("truncate", (busy || opening) && "matrx-shimmer"), children: b.label })
13140
13163
  }
13141
13164
  ) }),
13142
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system40.PopoverContent, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
13165
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.PopoverContent, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
13143
13166
  said2?.kind === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RefusalLine, { error: said2.error }) : null,
13144
13167
  said2?.kind === "waiting" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
13145
- said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.ErrorBox, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
13168
+ said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.ErrorBox, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
13146
13169
  said2?.kind === "public" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "Buttons run for signed-in people." }) : null,
13147
13170
  said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "break-words", children: [
13148
13171
  said2.value ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StructuredValueView, { structured: said2.value, label: b.label }) : null,
@@ -13153,7 +13176,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13153
13176
  said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
13154
13177
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: said2.says }),
13155
13178
  tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13156
- import_design_system40.Button,
13179
+ import_design_system41.Button,
13157
13180
  {
13158
13181
  type: "button",
13159
13182
  size: "sm",
@@ -13173,10 +13196,10 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
13173
13196
  ]
13174
13197
  }
13175
13198
  ),
13176
- settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.Dialog, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system40.DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl", onClick: stop2, onPointerDown: stop2, children: [
13177
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system40.DialogHeader, { children: [
13178
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.DialogTitle, { children: `Column settings \xB7 ${fieldName(field)}` }),
13179
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system40.DialogDescription, { className: "sr-only", children: "What the button does" })
13199
+ settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.Dialog, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl", onClick: stop2, onPointerDown: stop2, children: [
13200
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.DialogHeader, { children: [
13201
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.DialogTitle, { children: `Column settings \xB7 ${fieldName(field)}` }),
13202
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.DialogDescription, { className: "sr-only", children: "What the button does" })
13180
13203
  ] }),
13181
13204
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FieldEditor, { tableId, field, onSaved: () => setSettingUp(false), onCancel: () => setSettingUp(false) })
13182
13205
  ] }) }) : null
@@ -13257,7 +13280,7 @@ init_refusals();
13257
13280
 
13258
13281
  // src/formatControls.tsx
13259
13282
  var import_react71 = require("react");
13260
- var import_design_system41 = require("@ai-matrx/design-system");
13283
+ var import_design_system42 = require("@ai-matrx/design-system");
13261
13284
  var import_field_formats9 = require("@ai-matrx/design-system/field-formats");
13262
13285
  var import_jsx_runtime48 = require("react/jsx-runtime");
13263
13286
  var TYPED_NUMBERS = /* @__PURE__ */ new Set(["currency", "percent", "progress", "decimal", "duration", "file_size", "integer"]);
@@ -13283,7 +13306,7 @@ function NumberInFormat({ format, value, onChange, disabled, id }) {
13283
13306
  setText(typedText(format, value));
13284
13307
  }, [value, format]);
13285
13308
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13286
- import_design_system41.BasicInput,
13309
+ import_design_system42.BasicInput,
13287
13310
  {
13288
13311
  id,
13289
13312
  inputMode: "decimal",
@@ -13322,7 +13345,7 @@ function formatControl(args) {
13322
13345
  case "url":
13323
13346
  case "tel":
13324
13347
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13325
- import_design_system41.BasicInput,
13348
+ import_design_system42.BasicInput,
13326
13349
  {
13327
13350
  id,
13328
13351
  type: def.editor,
@@ -13336,7 +13359,7 @@ function formatControl(args) {
13336
13359
  case "color":
13337
13360
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "flex items-center gap-2", children: [
13338
13361
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13339
- import_design_system41.BasicInput,
13362
+ import_design_system42.BasicInput,
13340
13363
  {
13341
13364
  id: `${id}-swatch`,
13342
13365
  type: "color",
@@ -13347,10 +13370,10 @@ function formatControl(args) {
13347
13370
  onChange: (e) => commit(e.target.value)
13348
13371
  }
13349
13372
  ),
13350
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system41.BasicInput, { id, value: text, placeholder: "#3b82f6", disabled, onChange: (e) => commit(e.target.value) })
13373
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system42.BasicInput, { id, value: text, placeholder: "#3b82f6", disabled, onChange: (e) => commit(e.target.value) })
13351
13374
  ] });
13352
13375
  case "textarea":
13353
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system41.BasicTextarea, { id, rows: 4, value: text, disabled, onChange: (e) => commit(e.target.value) });
13376
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system42.BasicTextarea, { id, rows: 4, value: text, disabled, onChange: (e) => commit(e.target.value) });
13354
13377
  default:
13355
13378
  return null;
13356
13379
  }
@@ -13358,7 +13381,7 @@ function formatControl(args) {
13358
13381
 
13359
13382
  // src/typedDateHelper.tsx
13360
13383
  var import_react72 = require("react");
13361
- var import_design_system42 = require("@ai-matrx/design-system");
13384
+ var import_design_system43 = require("@ai-matrx/design-system");
13362
13385
  var import_records27 = require("@ai-matrx/records");
13363
13386
  var import_jsx_runtime49 = require("react/jsx-runtime");
13364
13387
  var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
@@ -13438,8 +13461,8 @@ function TypedDateHelper({
13438
13461
  const at = new Date(shown2.y, shown2.m + by, 1);
13439
13462
  setMonth({ y: at.getFullYear(), m: at.getMonth() });
13440
13463
  };
13441
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system42.Popover, { open, onOpenChange: setOpen, children: [
13442
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system42.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13464
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system43.Popover, { open, onOpenChange: setOpen, children: [
13465
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system43.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13443
13466
  "button",
13444
13467
  {
13445
13468
  type: "button",
@@ -13452,7 +13475,7 @@ function TypedDateHelper({
13452
13475
  }
13453
13476
  ) }),
13454
13477
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13455
- import_design_system42.PopoverContent,
13478
+ import_design_system43.PopoverContent,
13456
13479
  {
13457
13480
  sizing: "content",
13458
13481
  align: "start",
@@ -13483,7 +13506,7 @@ function TypedDateHelper({
13483
13506
  type: "button",
13484
13507
  ...keepFocus,
13485
13508
  "data-records-date-helper-day": key,
13486
- className: (0, import_design_system42.cn)(
13509
+ className: (0, import_design_system43.cn)(
13487
13510
  "h-6 w-6 rounded tabular-nums hover:bg-muted",
13488
13511
  key === held.day ? "bg-primary text-primary-foreground hover:bg-primary" : "",
13489
13512
  key === todayKey && key !== held.day ? "ring-1 ring-ring" : ""
@@ -13502,7 +13525,7 @@ function TypedDateHelper({
13502
13525
  type: "button",
13503
13526
  ...keepFocus,
13504
13527
  "data-records-date-helper-time": `${pad(t.h)}:${pad(t.m)}`,
13505
- className: (0, import_design_system42.cn)(
13528
+ className: (0, import_design_system43.cn)(
13506
13529
  "whitespace-nowrap rounded px-2 py-0.5 text-left tabular-nums hover:bg-muted",
13507
13530
  held.time && held.time.h === t.h && held.time.m === t.m ? "bg-primary text-primary-foreground" : ""
13508
13531
  ),
@@ -13553,9 +13576,9 @@ function ChoiceAskButtons({
13553
13576
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { "data-records-choice-ask": "", "data-records-cell-note": "", role: "group", "aria-label": choiceAskSentence(field, words), className: "flex flex-col gap-1", children: [
13554
13577
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-[11px] leading-snug", children: choiceAskSentence(field, words) }),
13555
13578
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
13556
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onAdd, children: "Add" }),
13557
- keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onKeep, children: "Keep as typed" }) : null,
13558
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onCancel, children: "Cancel" })
13579
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onAdd, children: "Add" }),
13580
+ keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onKeep, children: "Keep as typed" }) : null,
13581
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onCancel, children: "Cancel" })
13559
13582
  ] })
13560
13583
  ] });
13561
13584
  }
@@ -13695,7 +13718,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
13695
13718
  ...value.openedAs !== void 0 ? { openedAs: value.openedAs } : {}
13696
13719
  });
13697
13720
  const box = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13698
- import_design_system43.BasicInput,
13721
+ import_design_system44.BasicInput,
13699
13722
  {
13700
13723
  id,
13701
13724
  value: value.text,
@@ -13733,7 +13756,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
13733
13756
  }
13734
13757
  ) : "refusal" in judged ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
13735
13758
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FloatingRefusal, { text: judged.refusal, why: "why" in judged ? judged.why : void 0 }),
13736
- judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onCancel(), children: "Cancel" }) }) : null
13759
+ judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onCancel(), children: "Cancel" }) }) : null
13737
13760
  ] }) : judged.value === null || judged.value === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ReadsAsNote, { typed: value.text, always: isChoiceAddition(judged.value), children: [
13738
13761
  isChoiceAddition(judged.value) ? `Adds ${quoted(judged.value.add)} to the choices for ${fieldName(field)}. ` : null,
13739
13762
  "Reads as",
@@ -13799,7 +13822,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
13799
13822
  });
13800
13823
  }
13801
13824
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13802
- import_design_system43.BasicTextarea,
13825
+ import_design_system44.BasicTextarea,
13803
13826
  {
13804
13827
  id: inputId,
13805
13828
  rows: 3,
@@ -13812,7 +13835,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
13812
13835
  case "currency":
13813
13836
  case "percent":
13814
13837
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13815
- import_design_system43.BasicInput,
13838
+ import_design_system44.BasicInput,
13816
13839
  {
13817
13840
  id: inputId,
13818
13841
  type: "number",
@@ -13829,7 +13852,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
13829
13852
  case "phone":
13830
13853
  case "url":
13831
13854
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13832
- import_design_system43.BasicInput,
13855
+ import_design_system44.BasicInput,
13833
13856
  {
13834
13857
  id: inputId,
13835
13858
  type: kind === "email" ? "email" : kind === "phone" ? "tel" : "url",
@@ -13859,7 +13882,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
13859
13882
  default:
13860
13883
  if (typeof value === "boolean" || field.config?.["kind"] === "boolean") {
13861
13884
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13862
- import_design_system43.Checkbox,
13885
+ import_design_system44.Checkbox,
13863
13886
  {
13864
13887
  id: inputId,
13865
13888
  checked: value === true,
@@ -13869,7 +13892,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
13869
13892
  );
13870
13893
  }
13871
13894
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13872
- import_design_system43.BasicInput,
13895
+ import_design_system44.BasicInput,
13873
13896
  {
13874
13897
  id: inputId,
13875
13898
  ...ownDetails && isPersonsName(field) ? { autoComplete: "name" } : {},
@@ -13907,7 +13930,7 @@ function TypedWordsControl({ field, value, onChange, disabled, id }) {
13907
13930
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex flex-col gap-0.5", children: [
13908
13931
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex min-w-0 items-center gap-0.5", children: [
13909
13932
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13910
- import_design_system43.BasicInput,
13933
+ import_design_system44.BasicInput,
13911
13934
  {
13912
13935
  id,
13913
13936
  value: text,
@@ -13938,7 +13961,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
13938
13961
  const unanswered = value === null || value === void 0;
13939
13962
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
13940
13963
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13941
- import_design_system43.Checkbox,
13964
+ import_design_system44.Checkbox,
13942
13965
  {
13943
13966
  id,
13944
13967
  checked: value === true,
@@ -13950,7 +13973,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
13950
13973
  unanswered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs italic text-muted-foreground", children: "not answered yet" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
13951
13974
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs text-muted-foreground", children: value === true ? "Yes" : "No" }),
13952
13975
  field.required ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13953
- import_design_system43.Button,
13976
+ import_design_system44.Button,
13954
13977
  {
13955
13978
  size: "sm",
13956
13979
  variant: "ghost",
@@ -13968,7 +13991,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
13968
13991
  const reads = structuredOf(text) !== null;
13969
13992
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", "data-records-structured-editor": "", children: [
13970
13993
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13971
- import_design_system43.BasicTextarea,
13994
+ import_design_system44.BasicTextarea,
13972
13995
  {
13973
13996
  id,
13974
13997
  rows,
@@ -13980,7 +14003,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
13980
14003
  }
13981
14004
  ),
13982
14005
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-6 items-center gap-2 text-xs", children: reads ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13983
- import_design_system43.Button,
14006
+ import_design_system44.Button,
13984
14007
  {
13985
14008
  type: "button",
13986
14009
  variant: "ghost",
@@ -14000,7 +14023,7 @@ function JsonControl({ field, value, onChange, disabled, id }) {
14000
14023
  const [broken, setBroken] = (0, import_react73.useState)(null);
14001
14024
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", children: [
14002
14025
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14003
- import_design_system43.BasicTextarea,
14026
+ import_design_system44.BasicTextarea,
14004
14027
  {
14005
14028
  id,
14006
14029
  rows: 4,
@@ -14081,7 +14104,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
14081
14104
  if (!client) {
14082
14105
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", children: [
14083
14106
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14084
- import_design_system43.BasicInput,
14107
+ import_design_system44.BasicInput,
14085
14108
  {
14086
14109
  id,
14087
14110
  value: value === null || value === void 0 ? "" : String(value),
@@ -14159,7 +14182,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
14159
14182
  const chosen = options.filter((option) => (0, import_records28.choiceValuesOf)(value).some((v) => (0, import_records28.isTheChosen)(option, v)));
14160
14183
  const picked = new Set(chosen.map((option) => (0, import_records28.optionKey)(option)));
14161
14184
  const toggles = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: autoOpen ? void 0 : id, className: "flex flex-wrap gap-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14162
- import_design_system43.Button,
14185
+ import_design_system44.Button,
14163
14186
  {
14164
14187
  type: "button",
14165
14188
  size: "sm",
@@ -14177,22 +14200,22 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
14177
14200
  )) });
14178
14201
  if (!autoOpen) return toggles;
14179
14202
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14180
- import_design_system43.Popover,
14203
+ import_design_system44.Popover,
14181
14204
  {
14182
14205
  defaultOpen: true,
14183
14206
  onOpenChange: (open) => {
14184
14207
  if (!open) onClose?.();
14185
14208
  },
14186
14209
  children: [
14187
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { id, type: "button", size: "sm", variant: "outline", className: "h-6 max-w-full truncate", children: chosen.length === 0 ? "Choose" : chosen.map(titleOf).join(", ") }) }),
14188
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.PopoverContent, { sizing: "content", className: "max-w-[20rem] p-2", align: "start", children: toggles })
14210
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { id, type: "button", size: "sm", variant: "outline", className: "h-6 max-w-full truncate", children: chosen.length === 0 ? "Choose" : chosen.map(titleOf).join(", ") }) }),
14211
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.PopoverContent, { sizing: "content", className: "max-w-[20rem] p-2", align: "start", children: toggles })
14189
14212
  ]
14190
14213
  }
14191
14214
  );
14192
14215
  }
14193
14216
  const current = options.find((option) => (0, import_records28.isTheChosen)(option, value));
14194
14217
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14195
- import_design_system43.Select,
14218
+ import_design_system44.Select,
14196
14219
  {
14197
14220
  value: current ? (0, import_records28.optionKey)(current) : "",
14198
14221
  disabled: disabled ?? false,
@@ -14205,8 +14228,8 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
14205
14228
  }
14206
14229
  } : {},
14207
14230
  children: [
14208
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.SelectTrigger, { id, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.SelectValue, { placeholder: "Choose" }) }),
14209
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.SelectItem, { value: (0, import_records28.optionKey)(option), children: titleOf(option) }, option.id)) })
14231
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectTrigger, { id, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectValue, { placeholder: "Choose" }) }),
14232
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectItem, { value: (0, import_records28.optionKey)(option), children: titleOf(option) }, option.id)) })
14210
14233
  ]
14211
14234
  }
14212
14235
  );
@@ -14295,7 +14318,7 @@ function OpenChoicePicker({
14295
14318
  const pickedOptions = current.map((v) => options.find((o) => (0, import_records28.isTheChosen)(o, v)));
14296
14319
  const cellChips = pickedWords.map((word, i) => {
14297
14320
  const chip = chipOf(pickedOptions[i], word);
14298
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Badge, { variant: "outline", className: (0, import_design_system43.cn)("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
14321
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Badge, { variant: "outline", className: (0, import_design_system44.cn)("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
14299
14322
  });
14300
14323
  const headChips = pickedWords.map((word, i) => {
14301
14324
  const option = pickedOptions[i];
@@ -14348,7 +14371,7 @@ function OpenChoicePicker({
14348
14371
  // never_add on a column that takes only its choices: said, never a silent nothing.
14349
14372
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
14350
14373
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { "data-records-typed-refusal": "", className: "p-2 text-xs text-muted-foreground", children: notAChoiceSentence(field, [q]) }),
14351
- autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system43.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => setOpen(false), children: "Cancel" }) }) : null
14374
+ autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => setOpen(false), children: "Cancel" }) }) : null
14352
14375
  ] })
14353
14376
  ) : null,
14354
14377
  children: anchored ? cellChips : null
@@ -14368,7 +14391,7 @@ function RecordChip({
14368
14391
  // name. So it caps at its container and ends in an ellipsis with the whole name in
14369
14392
  // its tooltip, rather than being cut mid-word by whatever box it landed in
14370
14393
  // (lane FIX-14, 2026-09-22).
14371
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system43.Badge, { variant: "secondary", className: (0, import_design_system43.cn)("max-w-full gap-1 text-[11px]", className), title, children: [
14394
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system44.Badge, { variant: "secondary", className: (0, import_design_system44.cn)("max-w-full gap-1 text-[11px]", className), title, children: [
14372
14395
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: title }),
14373
14396
  onRemove ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${title}`, className: "shrink-0 opacity-60 hover:opacity-100", children: "\xD7" }) : null
14374
14397
  ] })
@@ -14423,7 +14446,7 @@ function ChoiceAnswer({
14423
14446
  tabIndex: field.multi || choice.key === tabStop ? 0 : -1,
14424
14447
  onClick: () => press(choice),
14425
14448
  "data-records-choice-answer": choice.key,
14426
- className: (0, import_design_system43.cn)(
14449
+ className: (0, import_design_system44.cn)(
14427
14450
  "flex min-h-11 w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-base font-medium text-foreground transition-colors sm:min-h-10 sm:text-sm",
14428
14451
  chosen ? "border-primary bg-primary/10" : "border-primary/30 bg-primary/[0.03] hover:bg-primary/10"
14429
14452
  ),
@@ -14432,7 +14455,7 @@ function ChoiceAnswer({
14432
14455
  "kbd",
14433
14456
  {
14434
14457
  "aria-hidden": "true",
14435
- className: (0, import_design_system43.cn)(
14458
+ className: (0, import_design_system44.cn)(
14436
14459
  "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border font-sans text-xs font-semibold",
14437
14460
  chosen ? "border-primary bg-primary text-primary-foreground" : "border-primary/40 text-primary"
14438
14461
  ),
@@ -14479,7 +14502,7 @@ function ChoiceAnswer({
14479
14502
  const shown2 = q === "" ? choices : choices.filter((c) => c.label.toLowerCase().includes(q));
14480
14503
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { id, className: "flex w-full flex-col gap-2", onKeyDown, children: [
14481
14504
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14482
- import_design_system43.BasicInput,
14505
+ import_design_system44.BasicInput,
14483
14506
  {
14484
14507
  value: search,
14485
14508
  onChange: (e) => setSearch(e.target.value),
@@ -14598,7 +14621,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
14598
14621
  const missing = Boolean(value) && !list.loading && !list.error && !list.rows.some((t) => t.table_id === value);
14599
14622
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1", children: [
14600
14623
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14601
- import_design_system44.CreatablePicker,
14624
+ import_design_system45.CreatablePicker,
14602
14625
  {
14603
14626
  value: value || null,
14604
14627
  options: pickerOptions,
@@ -14678,7 +14701,7 @@ function ColumnValuesEditor({ tableId, value, onChange, disabled, addLabel }) {
14678
14701
  onRemove: () => setAdding(false)
14679
14702
  }
14680
14703
  ),
14681
- !disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system44.Button, { type: "button", variant: "outline", size: "sm", className: "self-start", onClick: () => setAdding(true), children: addLabel })
14704
+ !disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system45.Button, { type: "button", variant: "outline", size: "sm", className: "self-start", onClick: () => setAdding(true), children: addLabel })
14682
14705
  ] });
14683
14706
  }
14684
14707
  function ColumnValueRow({
@@ -14697,7 +14720,7 @@ function ColumnValueRow({
14697
14720
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1 rounded-md border border-border/60 p-2", children: [
14698
14721
  /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-2", children: [
14699
14722
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14700
- import_design_system44.CreatablePicker,
14723
+ import_design_system45.CreatablePicker,
14701
14724
  {
14702
14725
  value: columnKey,
14703
14726
  options: shown2,
@@ -14710,7 +14733,7 @@ function ColumnValueRow({
14710
14733
  ariaLabel: "Column"
14711
14734
  }
14712
14735
  ) }),
14713
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system44.Button, { type: "button", variant: "ghost", size: "sm", "aria-label": "Remove", onClick: onRemove, children: "\u2715" })
14736
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system45.Button, { type: "button", variant: "ghost", size: "sm", "aria-label": "Remove", onClick: onRemove, children: "\u2715" })
14714
14737
  ] }),
14715
14738
  field ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldControl, { field, value, onChange: onValue, disabled }) : orphan ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-[11px] text-muted-foreground", children: value === null || value === void 0 ? "\u2014" : String(value) }) : null
14716
14739
  ] });
@@ -14726,7 +14749,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
14726
14749
  const missing = Boolean(value) && !records.loading && !records.error && !rows.some((r) => r.id === value);
14727
14750
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1", children: [
14728
14751
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14729
- import_design_system44.CreatablePicker,
14752
+ import_design_system45.CreatablePicker,
14730
14753
  {
14731
14754
  value: value || null,
14732
14755
  options,
@@ -14747,7 +14770,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
14747
14770
  var import_react79 = require("react");
14748
14771
  var import_records29 = require("@ai-matrx/records");
14749
14772
  var import_react80 = require("@ai-matrx/records/react");
14750
- var import_design_system45 = require("@ai-matrx/design-system");
14773
+ var import_design_system46 = require("@ai-matrx/design-system");
14751
14774
  init_names();
14752
14775
  var import_jsx_runtime53 = require("react/jsx-runtime");
14753
14776
  var DATA_BINDING_SHAPES = [
@@ -14884,7 +14907,7 @@ function BindingDetails({
14884
14907
  const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
14885
14908
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-2", children: [
14886
14909
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14887
- import_design_system45.Button,
14910
+ import_design_system46.Button,
14888
14911
  {
14889
14912
  type: "button",
14890
14913
  size: "sm",
@@ -14907,7 +14930,7 @@ function BindingDetails({
14907
14930
  }
14908
14931
  ),
14909
14932
  shape === "value" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14910
- import_design_system45.CreatablePicker,
14933
+ import_design_system46.CreatablePicker,
14911
14934
  {
14912
14935
  value: binding.field_key ?? null,
14913
14936
  options: fieldOptions,
@@ -14924,7 +14947,7 @@ function BindingDetails({
14924
14947
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14925
14948
  "textarea",
14926
14949
  {
14927
- className: (0, import_design_system45.cn)(
14950
+ className: (0, import_design_system46.cn)(
14928
14951
  "min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
14929
14952
  ),
14930
14953
  "aria-label": "Each row reads as",
@@ -14934,7 +14957,7 @@ function BindingDetails({
14934
14957
  }
14935
14958
  ),
14936
14959
  !disabled && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14937
- import_design_system45.Button,
14960
+ import_design_system46.Button,
14938
14961
  {
14939
14962
  type: "button",
14940
14963
  size: "sm",
@@ -14949,7 +14972,7 @@ function BindingDetails({
14949
14972
  shape === "collection" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
14950
14973
  "Up to",
14951
14974
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14952
- import_design_system45.BasicInput,
14975
+ import_design_system46.BasicInput,
14953
14976
  {
14954
14977
  type: "number",
14955
14978
  min: 1,
@@ -14968,7 +14991,7 @@ function BindingDetails({
14968
14991
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
14969
14992
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
14970
14993
  DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14971
- import_design_system45.Button,
14994
+ import_design_system46.Button,
14972
14995
  {
14973
14996
  type: "button",
14974
14997
  size: "sm",
@@ -15066,7 +15089,7 @@ function RecordNameWords({ tableId, recordId }) {
15066
15089
  // src/HeldChangeDecision.tsx
15067
15090
  var import_react82 = require("react");
15068
15091
  var import_react83 = require("@ai-matrx/records/react");
15069
- var import_design_system46 = require("@ai-matrx/design-system");
15092
+ var import_design_system47 = require("@ai-matrx/design-system");
15070
15093
  init_Refusal();
15071
15094
  var import_jsx_runtime55 = require("react/jsx-runtime");
15072
15095
  function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
@@ -15106,8 +15129,8 @@ function Decision({
15106
15129
  if (may === null) return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
15107
15130
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
15108
15131
  may ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex gap-2", children: [
15109
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system46.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
15110
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system46.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
15132
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system47.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
15133
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system47.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
15111
15134
  ] }) : !error && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
15112
15135
  error ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RefusalLine, { error }) : null
15113
15136
  ] });