@ai-matrx/records-ui 0.115.73 → 0.115.75

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/index.js CHANGED
@@ -25448,6 +25448,7 @@ function GridBody({
25448
25448
  onOpenRecord,
25449
25449
  openRecordId = null,
25450
25450
  onCloseRecord,
25451
+ onRowsShown,
25451
25452
  onAddField,
25452
25453
  onNewRecordForm,
25453
25454
  toolbarActions,
@@ -25728,6 +25729,11 @@ function GridBody({
25728
25729
  const rows = added.rows;
25729
25730
  const lockedRows = records.data?.locked ?? 0;
25730
25731
  const rowIds = useMemo39(() => rows.map((row) => row.id), [rows]);
25732
+ const rowsShownRef = useRef37(onRowsShown);
25733
+ rowsShownRef.current = onRowsShown;
25734
+ useEffect55(() => {
25735
+ rowsShownRef.current?.(rowIds);
25736
+ }, [rowIds]);
25731
25737
  const countedButNotReturned = !records.error && !records.loading && rows.length === 0 && typeof records.data?.total === "number" && records.data.total > 0 && (storePaged ? query.page <= 1 : page <= 0);
25732
25738
  const reReads = useRef37(0);
25733
25739
  const reloadRecords = useRef37(records.reload);
@@ -28409,7 +28415,7 @@ import {
28409
28415
  Checkbox as Checkbox11,
28410
28416
  ConfirmDialog as ConfirmDialog6,
28411
28417
  Input as Input4,
28412
- Select as Select11,
28418
+ Select as Select12,
28413
28419
  SelectContent as SelectContent11,
28414
28420
  SelectItem as SelectItem11,
28415
28421
  SelectTrigger as SelectTrigger11,
@@ -29171,6 +29177,7 @@ import {
29171
29177
  bookingPath
29172
29178
  } from "@ai-matrx/records";
29173
29179
  import { BasicInput as BasicInput17, BasicTextarea as BasicTextarea7, Button as Button54, Checkbox as Checkbox10, Label as Label18, Skeleton as Skeleton8, cn as cn44 } from "@ai-matrx/design-system";
29180
+ import { Select as Select11 } from "@ai-matrx/design-system/controls";
29174
29181
 
29175
29182
  // src/publicQuestions.ts
29176
29183
  var CANNOT_ASK = {
@@ -29473,39 +29480,39 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
29473
29480
  /* @__PURE__ */ jsxs83("label", { className: "flex flex-col gap-1", children: [
29474
29481
  /* @__PURE__ */ jsx94(Label18, { className: "text-xs font-medium", children: "How long one appointment is" }),
29475
29482
  /* @__PURE__ */ jsx94(
29476
- "select",
29483
+ Select11,
29477
29484
  {
29478
- className: "h-9 rounded border bg-background px-2 text-sm",
29479
- value: minutes,
29480
- onChange: (e) => setMinutes(Number(e.target.value)),
29481
- children: LENGTHS.map((n) => /* @__PURE__ */ jsxs83("option", { value: n, children: [
29482
- n,
29483
- " minutes"
29484
- ] }, n))
29485
+ "aria-label": "How long one appointment is",
29486
+ value: String(minutes),
29487
+ onValueChange: (v) => setMinutes(Number(v)),
29488
+ options: LENGTHS.map((n) => ({ value: String(n), label: `${n} minutes` }))
29485
29489
  }
29486
29490
  )
29487
29491
  ] }),
29488
29492
  /* @__PURE__ */ jsxs83("label", { className: "flex flex-col gap-1", children: [
29489
29493
  /* @__PURE__ */ jsx94(Label18, { className: "text-xs font-medium", children: "Gap kept after each one" }),
29490
29494
  /* @__PURE__ */ jsx94(
29491
- "select",
29495
+ Select11,
29492
29496
  {
29493
- className: "h-9 rounded border bg-background px-2 text-sm",
29494
- value: buffer,
29495
- onChange: (e) => setBuffer(Number(e.target.value)),
29496
- children: [0, 5, 10, 15, 30].map((n) => /* @__PURE__ */ jsx94("option", { value: n, children: n === 0 ? "No gap \u2014 back to back" : `${n} minutes` }, n))
29497
+ "aria-label": "Gap kept after each one",
29498
+ value: String(buffer),
29499
+ onValueChange: (v) => setBuffer(Number(v)),
29500
+ options: [0, 5, 10, 15, 30].map((n) => ({ value: String(n), label: n === 0 ? "No gap \u2014 back to back" : `${n} minutes` }))
29497
29501
  }
29498
29502
  )
29499
29503
  ] }),
29500
29504
  /* @__PURE__ */ jsxs83("label", { className: "flex flex-col gap-1", children: [
29501
29505
  /* @__PURE__ */ jsx94(Label18, { className: "text-xs font-medium", children: "Earliest somebody may book" }),
29502
29506
  /* @__PURE__ */ jsx94(
29503
- "select",
29507
+ Select11,
29504
29508
  {
29505
- className: "h-9 rounded border bg-background px-2 text-sm",
29506
- value: lead,
29507
- onChange: (e) => setLead(Number(e.target.value)),
29508
- children: [0, 60, 120, 240, 1440].map((n) => /* @__PURE__ */ jsx94("option", { value: n, children: n === 0 ? "Right away" : n === 1440 ? "A day from now" : `${formatDurationMinutes(n, { style: "long" })} from now` }, n))
29509
+ "aria-label": "Earliest somebody may book",
29510
+ value: String(lead),
29511
+ onValueChange: (v) => setLead(Number(v)),
29512
+ options: [0, 60, 120, 240, 1440].map((n) => ({
29513
+ value: String(n),
29514
+ label: n === 0 ? "Right away" : n === 1440 ? "A day from now" : `${formatDurationMinutes(n, { style: "long" })} from now`
29515
+ }))
29509
29516
  }
29510
29517
  )
29511
29518
  ] }),
@@ -29524,15 +29531,12 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
29524
29531
  /* @__PURE__ */ jsxs83("label", { className: "flex flex-col gap-1", children: [
29525
29532
  /* @__PURE__ */ jsx94(Label18, { className: "text-xs font-medium", children: "How far ahead the page offers" }),
29526
29533
  /* @__PURE__ */ jsx94(
29527
- "select",
29534
+ Select11,
29528
29535
  {
29529
- className: "h-9 rounded border bg-background px-2 text-sm",
29530
- value: days,
29531
- onChange: (e) => setDays(Number(e.target.value)),
29532
- children: [7, 14, 30, 60, 90].map((n) => /* @__PURE__ */ jsxs83("option", { value: n, children: [
29533
- n,
29534
- " days"
29535
- ] }, n))
29536
+ "aria-label": "How far ahead the page offers",
29537
+ value: String(days),
29538
+ onValueChange: (v) => setDays(Number(v)),
29539
+ options: [7, 14, 30, 60, 90].map((n) => ({ value: String(n), label: `${n} days` }))
29536
29540
  }
29537
29541
  )
29538
29542
  ] }),
@@ -30777,7 +30781,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30777
30781
  const busy = phase === "making" || phase === "writing";
30778
30782
  return /* @__PURE__ */ jsxs89("div", { className: cn48("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
30779
30783
  /* @__PURE__ */ jsxs89("div", { className: "flex flex-wrap items-center gap-2", children: [
30780
- shapes.length > 1 ? /* @__PURE__ */ jsxs89(Select11, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
30784
+ shapes.length > 1 ? /* @__PURE__ */ jsxs89(Select12, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
30781
30785
  /* @__PURE__ */ jsx100(SelectTrigger11, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ jsx100(SelectValue11, {}) }),
30782
30786
  /* @__PURE__ */ jsx100(SelectContent11, { children: shapes.map((s, i) => /* @__PURE__ */ jsxs89(SelectItem11, { value: String(i), children: [
30783
30787
  s.name ? `${s.name} \u2014 ` : "",
@@ -30788,7 +30792,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30788
30792
  shape.said
30789
30793
  ] }),
30790
30794
  shape.splits.length > 0 ? /* @__PURE__ */ jsxs89(
30791
- Select11,
30795
+ Select12,
30792
30796
  {
30793
30797
  value: split || "__one__",
30794
30798
  onValueChange: (v) => {
@@ -30902,7 +30906,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30902
30906
  }
30903
30907
  ),
30904
30908
  /* @__PURE__ */ jsxs89(
30905
- Select11,
30909
+ Select12,
30906
30910
  {
30907
30911
  value: c.guess.type,
30908
30912
  disabled: busy || !c.use,
@@ -30942,7 +30946,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30942
30946
  /* @__PURE__ */ jsx100("span", { className: "text-xs text-muted-foreground", children: "Nothing is made until you press it." })
30943
30947
  ] })
30944
30948
  ] }) : /* @__PURE__ */ jsxs89("div", { className: "flex flex-col gap-2", "data-save-to-table-existing": "", children: [
30945
- tables.loading || levels.loading ? /* @__PURE__ */ jsx100("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ jsx100(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ jsx100("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ jsxs89(Select11, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
30949
+ tables.loading || levels.loading ? /* @__PURE__ */ jsx100("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ jsx100(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ jsx100("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ jsxs89(Select12, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
30946
30950
  /* @__PURE__ */ jsx100(SelectTrigger11, { size: "sm", "aria-label": "Which table to add the rows to", className: "min-w-[16rem]", children: /* @__PURE__ */ jsx100(SelectValue11, { placeholder: "Choose a table" }) }),
30947
30951
  /* @__PURE__ */ jsx100(SelectContent11, { children: writable.map((t) => /* @__PURE__ */ jsx100(SelectItem11, { value: t.id, children: t.name }, t.id)) })
30948
30952
  ] }),
@@ -31023,6 +31027,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
31023
31027
  import { useCallback as useCallback34, useEffect as useEffect64, useMemo as useMemo46, useState as useState81 } from "react";
31024
31028
  import { useFields as useFields16, useRecordsClient as useRecordsClient54, useTable as useTable14 } from "@ai-matrx/records/react";
31025
31029
  import { BasicInput as BasicInput18, BasicTextarea as BasicTextarea8, Button as Button61, Separator as Separator7, Skeleton as Skeleton11, cn as cn49 } from "@ai-matrx/design-system";
31030
+ import { Select as Select13 } from "@ai-matrx/design-system/controls";
31026
31031
  import { jsx as jsx101, jsxs as jsxs90 } from "react/jsx-runtime";
31027
31032
  var NO_RULES_YET = "Nothing has to be true to get here yet.";
31028
31033
  var NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
@@ -31153,16 +31158,15 @@ function StageRulesSection({ tableId, stage, className }) {
31153
31158
  /* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-2", children: [
31154
31159
  /* @__PURE__ */ jsx101("span", { className: "font-medium", children: "Rules for entering" }),
31155
31160
  /* @__PURE__ */ jsx101(
31156
- "select",
31161
+ Select13,
31157
31162
  {
31158
31163
  "aria-label": "Stage",
31159
- className: "h-7 rounded border bg-background px-1 text-xs",
31160
31164
  value: stageKey ?? "",
31161
- onChange: (e) => {
31162
- setChosen(e.target.value);
31165
+ onValueChange: (v) => {
31166
+ setChosen(v);
31163
31167
  setDraft(null);
31164
31168
  },
31165
- children: stages.filter((s) => !s.retired).map((s) => /* @__PURE__ */ jsx101("option", { value: s.key, children: s.label }, s.key))
31169
+ options: stages.filter((s) => !s.retired).map((s) => ({ value: s.key, label: s.label }))
31166
31170
  }
31167
31171
  ),
31168
31172
  /* @__PURE__ */ jsx101("span", { className: "text-muted-foreground", children: gates.length }),
@@ -31230,13 +31234,12 @@ function StageRulesSection({ tableId, stage, className }) {
31230
31234
  /* @__PURE__ */ jsxs90("div", { className: "flex flex-wrap items-center gap-1", children: [
31231
31235
  /* @__PURE__ */ jsx101("span", { className: "text-muted-foreground", children: "and when it does not" }),
31232
31236
  /* @__PURE__ */ jsx101(
31233
- "select",
31237
+ Select13,
31234
31238
  {
31235
31239
  "aria-label": "What happens",
31236
- className: "h-8 rounded border bg-background px-1 text-xs",
31237
31240
  value: draft.on_fail ?? "refuse",
31238
- onChange: (e) => setDraft({ ...draft, on_fail: e.target.value }),
31239
- children: ON_FAIL.map((o) => /* @__PURE__ */ jsx101("option", { value: o.value, children: o.label }, o.value))
31241
+ onValueChange: (on_fail) => setDraft({ ...draft, on_fail }),
31242
+ options: ON_FAIL.map((o) => ({ value: o.value, label: o.label }))
31240
31243
  }
31241
31244
  ),
31242
31245
  /* @__PURE__ */ jsx101("span", { className: "text-muted-foreground", children: ON_FAIL.find((o) => o.value === (draft.on_fail ?? "refuse"))?.note })
@@ -31756,7 +31759,7 @@ import {
31756
31759
  import { useRecordsClient as useRecordsClient59, useTable as useTable15 } from "@ai-matrx/records/react";
31757
31760
  import {
31758
31761
  Button as Button65,
31759
- Select as Select12,
31762
+ Select as Select14,
31760
31763
  SelectContent as SelectContent12,
31761
31764
  SelectItem as SelectItem12,
31762
31765
  SelectTrigger as SelectTrigger12,
@@ -31788,7 +31791,7 @@ function ShownToSelect({
31788
31791
  onChange,
31789
31792
  testId
31790
31793
  }) {
31791
- return /* @__PURE__ */ jsxs95(Select12, { value, onValueChange: (next) => isShownTo(next) ? onChange(next) : void 0, children: [
31794
+ return /* @__PURE__ */ jsxs95(Select14, { value, onValueChange: (next) => isShownTo(next) ? onChange(next) : void 0, children: [
31792
31795
  /* @__PURE__ */ jsx106(SelectTrigger12, { size: "sm", "aria-label": label, className: "h-7 min-w-[8rem] text-xs", "data-testid": testId, children: /* @__PURE__ */ jsx106(SelectValue12, {}) }),
31793
31796
  /* @__PURE__ */ jsx106(SelectContent12, { children: allowed.map((word) => /* @__PURE__ */ jsx106(SelectItem12, { value: word, children: SHOWN_TO_LABEL[word] }, word)) })
31794
31797
  ] });
@@ -33223,7 +33226,7 @@ function lookAfterReset(look) {
33223
33226
  import { useEffect as useEffect87, useMemo as useMemo62, useState as useState106 } from "react";
33224
33227
  import { mayDrag as mayDrag4, useFields as useFields21, useRecordPage as useRecordPage2, useRecordsClient as useRecordsClient71, useTable as useTable21 } from "@ai-matrx/records/react";
33225
33228
  import { isButtonField as isButtonField5, newerKindOf as newerKindOf7, stableFilterKey as stableFilterKey4 } from "@ai-matrx/records";
33226
- import { Button as Button77, Select as Select17, SelectContent as SelectContent17, SelectItem as SelectItem17, SelectTrigger as SelectTrigger17, SelectValue as SelectValue17, cn as cn62 } from "@ai-matrx/design-system";
33229
+ import { Button as Button77, Select as Select19, SelectContent as SelectContent17, SelectItem as SelectItem17, SelectTrigger as SelectTrigger17, SelectValue as SelectValue17, cn as cn62 } from "@ai-matrx/design-system";
33227
33230
  import {
33228
33231
  CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS5,
33229
33232
  EMPTY_TABLE_STYLE as EMPTY_TABLE_STYLE2,
@@ -34234,7 +34237,7 @@ function CardFieldsInline({ row, fields }) {
34234
34237
  // src/CalendarView.tsx
34235
34238
  import { useEffect as useEffect79, useMemo as useMemo56, useRef as useRef47, useState as useState98 } from "react";
34236
34239
  import { mayDrag as mayDrag2 } from "@ai-matrx/records/react";
34237
- import { Button as Button74, Select as Select13, SelectContent as SelectContent13, SelectItem as SelectItem13, SelectTrigger as SelectTrigger13, SelectValue as SelectValue13, cn as cn57 } from "@ai-matrx/design-system";
34240
+ import { Button as Button74, Select as Select15, SelectContent as SelectContent13, SelectItem as SelectItem13, SelectTrigger as SelectTrigger13, SelectValue as SelectValue13, cn as cn57 } from "@ai-matrx/design-system";
34238
34241
  import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS3 } from "@ai-matrx/design-system/data-table";
34239
34242
 
34240
34243
  // src/weekStart.ts
@@ -34916,7 +34919,7 @@ function CalendarView({
34916
34919
  };
34917
34920
  const picker = (label, value, candidates, onPick, kept, unusual) => /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-1.5 whitespace-nowrap text-xs", "data-calendar-setting": label, children: [
34918
34921
  /* @__PURE__ */ jsx119("span", { className: "text-muted-foreground", children: label }),
34919
- /* @__PURE__ */ jsxs108(Select13, { value: value ?? NONE, onValueChange: (v) => onPick(v === NONE ? null : v), children: [
34922
+ /* @__PURE__ */ jsxs108(Select15, { value: value ?? NONE, onValueChange: (v) => onPick(v === NONE ? null : v), children: [
34920
34923
  /* @__PURE__ */ jsx119(SelectTrigger13, { size: "sm", className: "h-7 min-w-24 text-xs", "aria-label": `${label} column`, ...kept ? {} : { title: "Kept for this visit only" }, children: /* @__PURE__ */ jsx119(SelectValue13, { placeholder: "Choose" }) }),
34921
34924
  /* @__PURE__ */ jsxs108(SelectContent13, { children: [
34922
34925
  /* @__PURE__ */ jsx119(SelectItem13, { value: NONE, children: "None" }),
@@ -35296,7 +35299,7 @@ function weekHeading(first) {
35296
35299
  // src/TimelineView.tsx
35297
35300
  import { useEffect as useEffect80, useMemo as useMemo57, useRef as useRef48, useState as useState99 } from "react";
35298
35301
  import { mayDrag as mayDrag3 } from "@ai-matrx/records/react";
35299
- import { DropdownMenu as DropdownMenu8, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem2, DropdownMenuContent as DropdownMenuContent8, DropdownMenuItem as DropdownMenuItem7, DropdownMenuRadioGroup as DropdownMenuRadioGroup2, DropdownMenuRadioItem as DropdownMenuRadioItem2, DropdownMenuSeparator as DropdownMenuSeparator4, DropdownMenuSub as DropdownMenuSub2, DropdownMenuSubContent as DropdownMenuSubContent2, DropdownMenuSubTrigger as DropdownMenuSubTrigger2, DropdownMenuTrigger as DropdownMenuTrigger8, Button as Button75, Select as Select14, SelectContent as SelectContent14, SelectItem as SelectItem14, SelectTrigger as SelectTrigger14, SelectValue as SelectValue14, cn as cn58 } from "@ai-matrx/design-system";
35302
+ import { DropdownMenu as DropdownMenu8, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem2, DropdownMenuContent as DropdownMenuContent8, DropdownMenuItem as DropdownMenuItem7, DropdownMenuRadioGroup as DropdownMenuRadioGroup2, DropdownMenuRadioItem as DropdownMenuRadioItem2, DropdownMenuSeparator as DropdownMenuSeparator4, DropdownMenuSub as DropdownMenuSub2, DropdownMenuSubContent as DropdownMenuSubContent2, DropdownMenuSubTrigger as DropdownMenuSubTrigger2, DropdownMenuTrigger as DropdownMenuTrigger8, Button as Button75, Select as Select16, SelectContent as SelectContent14, SelectItem as SelectItem14, SelectTrigger as SelectTrigger14, SelectValue as SelectValue14, cn as cn58 } from "@ai-matrx/design-system";
35300
35303
  import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS4 } from "@ai-matrx/design-system/data-table";
35301
35304
  import { useOptionalRecordsClient as useOptionalRecordsClient15 } from "@ai-matrx/records/react";
35302
35305
 
@@ -36135,7 +36138,7 @@ function TimelineView({
36135
36138
  };
36136
36139
  const picker = (label, value, options, onPick, opts) => /* @__PURE__ */ jsxs109("div", { className: "flex items-center gap-1.5 whitespace-nowrap text-xs", "data-timeline-setting": label, children: [
36137
36140
  /* @__PURE__ */ jsx120("span", { className: "text-muted-foreground", children: label }),
36138
- /* @__PURE__ */ jsxs109(Select14, { value: value ?? NONE2, onValueChange: (v) => onPick(v === NONE2 ? null : v), children: [
36141
+ /* @__PURE__ */ jsxs109(Select16, { value: value ?? NONE2, onValueChange: (v) => onPick(v === NONE2 ? null : v), children: [
36139
36142
  /* @__PURE__ */ jsx120(SelectTrigger14, { size: "sm", className: "h-7 min-w-24 text-xs", "aria-label": `${label} column`, ...opts?.kept === false ? { title: "Kept for this visit only" } : {}, children: /* @__PURE__ */ jsx120(SelectValue14, { placeholder: "Choose" }) }),
36140
36143
  /* @__PURE__ */ jsxs109(SelectContent14, { children: [
36141
36144
  opts?.none !== false ? /* @__PURE__ */ jsx120(SelectItem14, { value: NONE2, children: "None" }) : null,
@@ -36797,7 +36800,7 @@ function BoardOptions({
36797
36800
 
36798
36801
  // src/ListView.tsx
36799
36802
  import { useMemo as useMemo58 } from "react";
36800
- import { Select as Select15, SelectContent as SelectContent15, SelectItem as SelectItem15, SelectTrigger as SelectTrigger15, SelectValue as SelectValue15, cn as cn59 } from "@ai-matrx/design-system";
36803
+ import { Select as Select17, SelectContent as SelectContent15, SelectItem as SelectItem15, SelectTrigger as SelectTrigger15, SelectValue as SelectValue15, cn as cn59 } from "@ai-matrx/design-system";
36801
36804
  import { resolveRowColor as resolveRowColor3, ROW_TINT_CLASS as ROW_TINT_CLASS2 } from "@ai-matrx/design-system/data-table";
36802
36805
  import { jsx as jsx124, jsxs as jsxs112 } from "react/jsx-runtime";
36803
36806
  var LIST_DEFAULT_FIELDS = 4;
@@ -36856,7 +36859,7 @@ function ListView({
36856
36859
  onGroupingChange ? /* @__PURE__ */ jsxs112("div", { className: "ml-auto flex items-center gap-1.5", "data-records-list-group": "", children: [
36857
36860
  /* @__PURE__ */ jsx124("span", { className: "text-muted-foreground", children: "Group by" }),
36858
36861
  /* @__PURE__ */ jsxs112(
36859
- Select15,
36862
+ Select17,
36860
36863
  {
36861
36864
  value: groupKey ?? NO_GROUP,
36862
36865
  onValueChange: (next) => onGroupingChange(next === NO_GROUP ? void 0 : { ...grouping ?? {}, field: next, collapsed: [] }),
@@ -36980,7 +36983,7 @@ function ListRow({
36980
36983
  import { useEffect as useEffect86, useMemo as useMemo61, useState as useState105 } from "react";
36981
36984
  import { useRecordsClient as useRecordsClient70 } from "@ai-matrx/records/react";
36982
36985
  import { fieldKindFor as fieldKindFor2, measureKey as measureKey4 } from "@ai-matrx/records";
36983
- import { Select as Select16, SelectContent as SelectContent16, SelectItem as SelectItem16, SelectTrigger as SelectTrigger16, SelectValue as SelectValue16 } from "@ai-matrx/design-system";
36986
+ import { Select as Select18, SelectContent as SelectContent16, SelectItem as SelectItem16, SelectTrigger as SelectTrigger16, SelectValue as SelectValue16 } from "@ai-matrx/design-system";
36984
36987
 
36985
36988
  // src/ChartBlock.tsx
36986
36989
  import { useMemo as useMemo60 } from "react";
@@ -37990,22 +37993,22 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
37990
37993
  return /* @__PURE__ */ jsxs115("div", { className: "flex min-h-0 flex-col gap-2", "data-records-chart-layout": "", "data-records-chart-measure": pickMeasure, children: [
37991
37994
  /* @__PURE__ */ jsxs115("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: [
37992
37995
  /* @__PURE__ */ jsx127("span", { className: "text-muted-foreground", children: "Group by" }),
37993
- /* @__PURE__ */ jsxs115(Select16, { value: (view.groupField === void 0 ? defaultChartGroup(fields) : view.groupField) ?? "__none", onValueChange: (next) => onChange({ groupField: next === "__none" ? null : next }), children: [
37996
+ /* @__PURE__ */ jsxs115(Select18, { value: (view.groupField === void 0 ? defaultChartGroup(fields) : view.groupField) ?? "__none", onValueChange: (next) => onChange({ groupField: next === "__none" ? null : next }), children: [
37994
37997
  /* @__PURE__ */ jsx127(SelectTrigger16, { size: "sm", className: "h-7 w-auto min-w-[8rem] text-xs", "aria-label": "Chart group by", children: /* @__PURE__ */ jsx127(SelectValue16, {}) }),
37995
37998
  /* @__PURE__ */ jsxs115(SelectContent16, { children: [
37996
37999
  /* @__PURE__ */ jsx127(SelectItem16, { value: "__none", children: "Everything together" }),
37997
38000
  groupable.map((f) => /* @__PURE__ */ jsx127(SelectItem16, { value: f.key, children: fieldName(f) }, f.key))
37998
38001
  ] })
37999
38002
  ] }),
38000
- /* @__PURE__ */ jsxs115(Select16, { value: q.kind, onValueChange: (next) => onChange({ chartKind: next }), children: [
38003
+ /* @__PURE__ */ jsxs115(Select18, { value: q.kind, onValueChange: (next) => onChange({ chartKind: next }), children: [
38001
38004
  /* @__PURE__ */ jsx127(SelectTrigger16, { size: "sm", className: "h-7 w-auto min-w-[6rem] text-xs", "aria-label": "Chart shape", children: /* @__PURE__ */ jsx127(SelectValue16, {}) }),
38002
38005
  /* @__PURE__ */ jsx127(SelectContent16, { children: Object.keys(KIND_LABEL).map((k) => /* @__PURE__ */ jsx127(SelectItem16, { value: k, children: KIND_LABEL[k] }, k)) })
38003
38006
  ] }),
38004
- /* @__PURE__ */ jsxs115(Select16, { value: isChartMeasure(view.chartMeasure) ? view.chartMeasure : "count", onValueChange: (next) => onChange({ chartMeasure: next }), children: [
38007
+ /* @__PURE__ */ jsxs115(Select18, { value: isChartMeasure(view.chartMeasure) ? view.chartMeasure : "count", onValueChange: (next) => onChange({ chartMeasure: next }), children: [
38005
38008
  /* @__PURE__ */ jsx127(SelectTrigger16, { size: "sm", className: "h-7 w-auto min-w-[6rem] text-xs", "aria-label": "Chart measure", children: /* @__PURE__ */ jsx127(SelectValue16, {}) }),
38006
38009
  /* @__PURE__ */ jsx127(SelectContent16, { children: Object.keys(MEASURE_LABEL2).map((m) => /* @__PURE__ */ jsx127(SelectItem16, { value: m, children: MEASURE_LABEL2[m] }, m)) })
38007
38010
  ] }),
38008
- view.chartMeasure === "sum" || view.chartMeasure === "avg" ? /* @__PURE__ */ jsxs115(Select16, { value: view.measure ?? "", onValueChange: (next) => onChange({ measure: next === "" ? null : next }), children: [
38011
+ view.chartMeasure === "sum" || view.chartMeasure === "avg" ? /* @__PURE__ */ jsxs115(Select18, { value: view.measure ?? "", onValueChange: (next) => onChange({ measure: next === "" ? null : next }), children: [
38009
38012
  /* @__PURE__ */ jsx127(SelectTrigger16, { size: "sm", className: "h-7 w-auto min-w-[8rem] text-xs", "aria-label": "Chart measured field", children: /* @__PURE__ */ jsx127(SelectValue16, { placeholder: "Of which field" }) }),
38010
38013
  /* @__PURE__ */ jsx127(SelectContent16, { children: numeric.map((f) => /* @__PURE__ */ jsx127(SelectItem16, { value: f.key, children: fieldName(f) }, f.key)) })
38011
38014
  ] }) : null,
@@ -38137,6 +38140,7 @@ function ViewSwitcher({
38137
38140
  onOpenRecord,
38138
38141
  openRecordId,
38139
38142
  onCloseRecord,
38143
+ onRowsShown,
38140
38144
  onMoved,
38141
38145
  onNewRecordForm,
38142
38146
  onAskWhoChanged,
@@ -38214,6 +38218,7 @@ function ViewSwitcher({
38214
38218
  ...onOpenRecord ? { onOpenRecord } : {},
38215
38219
  ...openRecordId ? { openRecordId } : {},
38216
38220
  ...onCloseRecord ? { onCloseRecord } : {},
38221
+ ...onRowsShown ? { onRowsShown } : {},
38217
38222
  ...onNewRecordForm ? { onNewRecordForm } : {},
38218
38223
  ...onAskWhoChanged ? { onAskWhoChanged } : {},
38219
38224
  ...viewId ? {
@@ -38703,7 +38708,7 @@ function FieldPicker({
38703
38708
  const options = unusual ? [...offerable, unusual] : offerable;
38704
38709
  return /* @__PURE__ */ jsxs116("div", { className: "flex items-center gap-1.5 text-xs", "data-records-view-field": layout, children: [
38705
38710
  /* @__PURE__ */ jsx128("span", { className: "text-muted-foreground", id: `view-field-${layout}-label`, children: label }),
38706
- options.length === 1 && chosen === options[0].key ? /* @__PURE__ */ jsx128("span", { className: "font-medium", "data-records-view-field-only": "", children: fieldName(options[0]) }) : /* @__PURE__ */ jsxs116(Select17, { value: chosen ?? "", onValueChange: (next) => onPick(next === "" ? null : next), children: [
38711
+ options.length === 1 && chosen === options[0].key ? /* @__PURE__ */ jsx128("span", { className: "font-medium", "data-records-view-field-only": "", children: fieldName(options[0]) }) : /* @__PURE__ */ jsxs116(Select19, { value: chosen ?? "", onValueChange: (next) => onPick(next === "" ? null : next), children: [
38707
38712
  /* @__PURE__ */ jsx128(
38708
38713
  SelectTrigger17,
38709
38714
  {
@@ -40261,6 +40266,7 @@ import { formatAbsoluteDate, formatDurationMs } from "@ai-matrx/kit/format";
40261
40266
  import { useCallback as useCallback44, useEffect as useEffect92, useMemo as useMemo63, useState as useState111 } from "react";
40262
40267
  import { useRecordsClient as useRecordsClient76, useTable as useTable24 } from "@ai-matrx/records/react";
40263
40268
  import { Badge as Badge17, BasicInput as BasicInput22, BasicTextarea as BasicTextarea9, Button as Button82, Skeleton as Skeleton19, cn as cn67 } from "@ai-matrx/design-system";
40269
+ import { Select as Select20 } from "@ai-matrx/design-system/controls";
40264
40270
  import { humanizeIdentifier as humanizeIdentifier15 } from "@ai-matrx/kit/text-case";
40265
40271
  import { Fragment as Fragment50, jsx as jsx133, jsxs as jsxs121 } from "react/jsx-runtime";
40266
40272
  var DUE_WORD = DUE_STATE_LABEL;
@@ -40412,16 +40418,13 @@ function ChecklistRunner({
40412
40418
  active.overdue > 0 ? ` \xB7 ${active.overdue} overdue` : ""
40413
40419
  ] }) : null,
40414
40420
  runs && runs.length > 1 ? /* @__PURE__ */ jsx133(
40415
- "select",
40421
+ Select20,
40416
40422
  {
40417
40423
  "aria-label": "Checklist run",
40418
- className: "ml-auto h-7 rounded border bg-background px-1 text-xs",
40424
+ className: "ml-auto",
40419
40425
  value: activeId ?? "",
40420
- onChange: (e) => setActiveId(e.target.value),
40421
- children: runs.map((r) => /* @__PURE__ */ jsxs121("option", { value: r.run_id, children: [
40422
- r.name,
40423
- r.about ? ` \u2014 ${r.about}` : ""
40424
- ] }, r.run_id))
40426
+ onValueChange: (v) => setActiveId(v),
40427
+ options: runs.map((r) => ({ value: r.run_id, label: `${r.name}${r.about ? ` \u2014 ${r.about}` : ""}` }))
40425
40428
  }
40426
40429
  ) : null
40427
40430
  ] }),
@@ -40504,19 +40507,18 @@ function StepRow({
40504
40507
  ] }),
40505
40508
  unassigned && onAssign && members && members.length > 0 ? /* @__PURE__ */ jsxs121("label", { className: "mt-1 flex items-center gap-1.5 pl-7 text-[11px] text-muted-foreground", children: [
40506
40509
  "Give it to",
40507
- /* @__PURE__ */ jsxs121(
40508
- "select",
40510
+ /* @__PURE__ */ jsx133(
40511
+ Select20,
40509
40512
  {
40510
- className: "h-7 rounded border bg-background px-1 text-xs text-foreground",
40511
40513
  "aria-label": `Give ${step2.title} to`,
40512
40514
  value: "",
40513
40515
  disabled: busy,
40514
- onChange: (e) => {
40515
- if (e.target.value) onAssign(e.target.value);
40516
+ onValueChange: (v) => {
40517
+ if (v) onAssign(v);
40516
40518
  },
40517
- children: [
40518
- /* @__PURE__ */ jsx133("option", { value: "", children: "Choose a person" }),
40519
- members.map((m) => /* @__PURE__ */ jsx133("option", { value: m.userId, children: m.name || m.email || "A member" }, m.userId))
40519
+ options: [
40520
+ { value: "", label: "Choose a person" },
40521
+ ...members.map((m) => ({ value: m.userId, label: m.name || m.email || "A member" }))
40520
40522
  ]
40521
40523
  }
40522
40524
  )
@@ -40994,13 +40996,12 @@ function ChecklistTemplateEditor({
40994
40996
  }
40995
40997
  ),
40996
40998
  /* @__PURE__ */ jsx133(
40997
- "select",
40999
+ Select20,
40998
41000
  {
40999
41001
  "aria-label": `Step ${index + 1} asks for`,
41000
- className: "h-7 rounded border bg-background px-1 text-xs",
41001
41002
  value: row.requires,
41002
- onChange: (e) => change(index, { requires: e.target.value }),
41003
- children: REQUIRES_KINDS.map((kind) => /* @__PURE__ */ jsx133("option", { value: kind, children: kind === "none" ? "just a tick" : REQUIRES_WORD[kind] ?? kind }, kind))
41003
+ onValueChange: (v) => change(index, { requires: v }),
41004
+ options: REQUIRES_KINDS.map((kind) => ({ value: kind, label: kind === "none" ? "just a tick" : REQUIRES_WORD[kind] ?? kind }))
41004
41005
  }
41005
41006
  ),
41006
41007
  row.requires === "answer" || row.requires === "record_field" ? /* @__PURE__ */ jsx133(
@@ -43199,6 +43200,7 @@ function FormResultsPanel({ form, className }) {
43199
43200
  import { useCallback as useCallback50, useEffect as useEffect100, useMemo as useMemo68, useRef as useRef57, useState as useState119 } from "react";
43200
43201
  import { useRecordsClient as useRecordsClient83, useTables as useTables4 } from "@ai-matrx/records/react";
43201
43202
  import { BasicInput as BasicInput23, Button as Button90, Checkbox as Checkbox14, Label as Label20, Separator as Separator10, Skeleton as Skeleton26, cn as cn75 } from "@ai-matrx/design-system";
43203
+ import { Select as Select21 } from "@ai-matrx/design-system/controls";
43202
43204
  import { Fragment as Fragment55, jsx as jsx141, jsxs as jsxs129 } from "react/jsx-runtime";
43203
43205
  var RESTATING_REPLACES = "Saving replaces what this portal shows: a table you untick stops being visible to every client the moment you save. Who is invited is not touched.";
43204
43206
  function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
@@ -43405,15 +43407,15 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
43405
43407
  ] }),
43406
43408
  /* @__PURE__ */ jsxs129("label", { className: "flex flex-col gap-1", children: [
43407
43409
  /* @__PURE__ */ jsx141(Label20, { className: "text-xs font-medium", children: "Which table holds your clients" }),
43408
- /* @__PURE__ */ jsxs129(
43409
- "select",
43410
+ /* @__PURE__ */ jsx141(
43411
+ Select21,
43410
43412
  {
43411
- className: "h-9 rounded border bg-background px-2 text-sm",
43413
+ "aria-label": "Which table holds your clients",
43412
43414
  value: clientTableId ?? "",
43413
- onChange: (e) => setClientTableId(e.target.value || null),
43414
- children: [
43415
- /* @__PURE__ */ jsx141("option", { value: "", children: "Pick the table whose records are the people signing in" }),
43416
- all.map((t) => /* @__PURE__ */ jsx141("option", { value: t.id, children: t.name }, t.id))
43415
+ onValueChange: (v) => setClientTableId(v || null),
43416
+ options: [
43417
+ { value: "", label: "Pick the table whose records are the people signing in" },
43418
+ ...all.map((t) => ({ value: t.id, label: t.name }))
43417
43419
  ]
43418
43420
  }
43419
43421
  ),
@@ -43458,15 +43460,15 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
43458
43460
  ) : /* @__PURE__ */ jsxs129("div", { className: "mt-2 flex flex-col gap-2", children: [
43459
43461
  /* @__PURE__ */ jsxs129("label", { className: "flex flex-col gap-1", children: [
43460
43462
  /* @__PURE__ */ jsx141(Label20, { className: "text-xs font-medium", children: "Which field says whose row it is" }),
43461
- /* @__PURE__ */ jsxs129(
43462
- "select",
43463
+ /* @__PURE__ */ jsx141(
43464
+ Select21,
43463
43465
  {
43464
- className: "h-8 rounded border bg-background px-2 text-sm",
43466
+ "aria-label": "Which field says whose row it is",
43465
43467
  value: exposure?.namesVia ?? "",
43466
- onChange: (e) => patch(t.id, { namesVia: e.target.value }),
43467
- children: [
43468
- /* @__PURE__ */ jsx141("option", { value: "", children: "Pick the field that names the client" }),
43469
- ties.map((f) => /* @__PURE__ */ jsx141("option", { value: f.key, children: fieldName(f) }, f.key))
43468
+ onValueChange: (v) => patch(t.id, { namesVia: v }),
43469
+ options: [
43470
+ { value: "", label: "Pick the field that names the client" },
43471
+ ...ties.map((f) => ({ value: f.key, label: fieldName(f) }))
43470
43472
  ]
43471
43473
  }
43472
43474
  )
@@ -44699,6 +44701,7 @@ import { useCallback as useCallback52, useEffect as useEffect103, useMemo as use
44699
44701
  import { useRecordsClient as useRecordsClient86, useTable as useTable28 } from "@ai-matrx/records/react";
44700
44702
  import { hasQuietHours } from "@ai-matrx/records";
44701
44703
  import { BasicInput as BasicInput26, Button as Button93, Checkbox as Checkbox15, Label as Label21, Separator as Separator12, Skeleton as Skeleton28, cn as cn80 } from "@ai-matrx/design-system";
44704
+ import { Select as Select22 } from "@ai-matrx/design-system/controls";
44702
44705
 
44703
44706
  // src/scheduleWords.ts
44704
44707
  var DAYS3 = {
@@ -44902,15 +44905,15 @@ function DigestScheduler({
44902
44905
  ] }),
44903
44906
  savedViewId ? null : /* @__PURE__ */ jsxs134("label", { className: "flex flex-col gap-1", children: [
44904
44907
  /* @__PURE__ */ jsx146(Label21, { className: "text-xs font-medium", children: "What it summarises" }),
44905
- /* @__PURE__ */ jsxs134(
44906
- "select",
44908
+ /* @__PURE__ */ jsx146(
44909
+ Select22,
44907
44910
  {
44908
- className: "h-9 rounded border bg-background px-2 text-sm",
44911
+ "aria-label": "What it summarises",
44909
44912
  value: viewId,
44910
- onChange: (e) => setViewId(e.target.value),
44911
- children: [
44912
- /* @__PURE__ */ jsx146("option", { value: "new", children: subjectName?.trim() ? `What I am looking at now (${subjectName.trim()})` : "What I am looking at now" }),
44913
- (views ?? []).map((v) => /* @__PURE__ */ jsx146("option", { value: v.view_id, children: v.name }, v.view_id))
44913
+ onValueChange: setViewId,
44914
+ options: [
44915
+ { value: "new", label: subjectName?.trim() ? `What I am looking at now (${subjectName.trim()})` : "What I am looking at now" },
44916
+ ...(views ?? []).map((v) => ({ value: v.view_id, label: v.name }))
44914
44917
  ]
44915
44918
  }
44916
44919
  ),
@@ -44920,24 +44923,27 @@ function DigestScheduler({
44920
44923
  /* @__PURE__ */ jsxs134("label", { className: "flex flex-col gap-1", children: [
44921
44924
  /* @__PURE__ */ jsx146(Label21, { className: "text-xs font-medium", children: "How often" }),
44922
44925
  /* @__PURE__ */ jsx146(
44923
- "select",
44926
+ Select22,
44924
44927
  {
44925
- className: "h-9 rounded border bg-background px-2 text-sm",
44928
+ "aria-label": "How often",
44926
44929
  value: cadence,
44927
- onChange: (e) => setCadence(e.target.value),
44928
- children: (cadences.length > 0 ? cadences : ["hourly", "daily", "weekly"]).map((c) => /* @__PURE__ */ jsx146("option", { value: c, children: CADENCE_WORDS[c] ?? c }, c))
44930
+ onValueChange: (c) => setCadence(c),
44931
+ options: (cadences.length > 0 ? cadences : ["hourly", "daily", "weekly"]).map((c) => ({
44932
+ value: c,
44933
+ label: CADENCE_WORDS[c] ?? c
44934
+ }))
44929
44935
  }
44930
44936
  )
44931
44937
  ] }),
44932
44938
  cadence === "weekly" ? /* @__PURE__ */ jsxs134("label", { className: "flex flex-col gap-1", children: [
44933
44939
  /* @__PURE__ */ jsx146(Label21, { className: "text-xs font-medium", children: "Which day" }),
44934
44940
  /* @__PURE__ */ jsx146(
44935
- "select",
44941
+ Select22,
44936
44942
  {
44937
- className: "h-9 rounded border bg-background px-2 text-sm",
44943
+ "aria-label": "Which day",
44938
44944
  value: weekday,
44939
- onChange: (e) => setWeekday(e.target.value),
44940
- children: WEEKDAYS.map((d) => /* @__PURE__ */ jsx146("option", { value: d, children: d[0].toUpperCase() + d.slice(1) }, d))
44945
+ onValueChange: setWeekday,
44946
+ options: WEEKDAYS.map((d) => ({ value: d, label: d[0].toUpperCase() + d.slice(1) }))
44941
44947
  }
44942
44948
  )
44943
44949
  ] }) : null,
@@ -44961,12 +44967,12 @@ function DigestScheduler({
44961
44967
  /* @__PURE__ */ jsxs134("label", { className: "flex flex-col gap-1", children: [
44962
44968
  /* @__PURE__ */ jsx146(Label21, { className: "text-xs font-medium", children: "Where it arrives" }),
44963
44969
  /* @__PURE__ */ jsx146(
44964
- "select",
44970
+ Select22,
44965
44971
  {
44966
- className: "h-9 rounded border bg-background px-2 text-sm",
44972
+ "aria-label": "Where it arrives",
44967
44973
  value: channel,
44968
- onChange: (e) => setChannel(e.target.value),
44969
- children: Object.entries(CHANNEL_WORDS).map(([key, words2]) => /* @__PURE__ */ jsx146("option", { value: key, children: words2 }, key))
44974
+ onValueChange: setChannel,
44975
+ options: Object.entries(CHANNEL_WORDS).map(([key, words2]) => ({ value: key, label: words2 }))
44970
44976
  }
44971
44977
  )
44972
44978
  ] })
@@ -45498,6 +45504,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
45498
45504
  // src/FormBuilder.tsx
45499
45505
  import { copyText as copyText8 } from "@ai-matrx/kit/clipboard";
45500
45506
  import { ErrorBox as ErrorBox7 } from "@ai-matrx/design-system";
45507
+ import { Select as Select23 } from "@ai-matrx/design-system/controls";
45501
45508
  import { useCallback as useCallback56, useEffect as useEffect107, useMemo as useMemo73, useRef as useRef59, useState as useState127 } from "react";
45502
45509
  import { DndContext as DndContext2, KeyboardSensor, PointerSensor as PointerSensor2, closestCenter as closestCenter2, useSensor as useSensor2, useSensors as useSensors2 } from "@dnd-kit/core";
45503
45510
  import { SortableContext as SortableContext2, arrayMove, sortableKeyboardCoordinates, useSortable as useSortable2, verticalListSortingStrategy as verticalListSortingStrategy2 } from "@dnd-kit/sortable";
@@ -46970,12 +46977,15 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
46970
46977
  /* @__PURE__ */ jsxs139("label", { className: "flex flex-col gap-1", children: [
46971
46978
  /* @__PURE__ */ jsx151(Label25, { className: "text-xs font-medium", children: "Flow" }),
46972
46979
  /* @__PURE__ */ jsx151(
46973
- "select",
46980
+ Select23,
46974
46981
  {
46975
- className: "h-9 rounded border bg-background px-2 text-sm",
46982
+ "aria-label": "Flow",
46976
46983
  value: draft.flow ?? "one-at-a-time",
46977
- onChange: (e) => patch({ flow: e.target.value }),
46978
- children: FORM_FLOWS.map((flow) => /* @__PURE__ */ jsx151("option", { value: flow, children: flow === "one-at-a-time" ? "One question at a time" : "All on one page" }, flow))
46984
+ onValueChange: (flow) => patch({ flow }),
46985
+ options: FORM_FLOWS.map((flow) => ({
46986
+ value: flow,
46987
+ label: flow === "one-at-a-time" ? "One question at a time" : "All on one page"
46988
+ }))
46979
46989
  }
46980
46990
  )
46981
46991
  ] }),
@@ -47921,6 +47931,7 @@ import { useCallback as useCallback60, useEffect as useEffect111, useState as us
47921
47931
  import { useRecordsClient as useRecordsClient93, useTable as useTable33 } from "@ai-matrx/records/react";
47922
47932
  import { hasQuietHours as hasQuietHours3 } from "@ai-matrx/records";
47923
47933
  import { Button as Button102, Skeleton as Skeleton36, cn as cn88 } from "@ai-matrx/design-system";
47934
+ import { Select as Select24 } from "@ai-matrx/design-system/controls";
47924
47935
  import { jsx as jsx155, jsxs as jsxs143 } from "react/jsx-runtime";
47925
47936
  var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
47926
47937
  var CHANNEL_WORDS3 = SUBSCRIPTION_CHANNEL_LABEL;
@@ -47934,6 +47945,9 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
47934
47945
  const [views, setViews] = useState131(null);
47935
47946
  const [error, setError] = useState131(null);
47936
47947
  const [busy, setBusy] = useState131(false);
47948
+ const [pickView, setPickView] = useState131("");
47949
+ const [pickCadence, setPickCadence] = useState131("");
47950
+ const [pickChannel, setPickChannel] = useState131("in_app");
47937
47951
  const [stopping, setStopping] = useState131(null);
47938
47952
  const load = useCallback60(async () => {
47939
47953
  const [held, offered] = await Promise.all([
@@ -48131,9 +48145,36 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
48131
48145
  if (view) void subscribe(view, name, cadence, channel, schedule, quiet2);
48132
48146
  },
48133
48147
  children: [
48134
- /* @__PURE__ */ jsx155("select", { name: "view", "aria-label": "View to be told about", className: "h-7 rounded border bg-background px-1 text-xs", children: views.map((view) => /* @__PURE__ */ jsx155("option", { value: view.id, children: view.name }, view.id)) }),
48135
- /* @__PURE__ */ jsx155("select", { name: "cadence", "aria-label": "How often", className: "h-7 rounded border bg-background px-1 text-xs", children: (cadences.length > 0 ? cadences : ["instant"]).map((cadence) => /* @__PURE__ */ jsx155("option", { value: cadence, children: CADENCE_WORDS2[cadence] ?? cadence }, cadence)) }),
48136
- /* @__PURE__ */ jsx155("select", { name: "channel", "aria-label": "Where it arrives", className: "h-7 rounded border bg-background px-1 text-xs", children: ["in_app", "email", "sms"].map((channel) => /* @__PURE__ */ jsx155("option", { value: channel, children: CHANNEL_WORDS3[channel] }, channel)) }),
48148
+ /* @__PURE__ */ jsx155("input", { type: "hidden", name: "view", value: pickView || (views[0]?.id ?? "") }),
48149
+ /* @__PURE__ */ jsx155(
48150
+ Select24,
48151
+ {
48152
+ "aria-label": "View to be told about",
48153
+ value: pickView || (views[0]?.id ?? ""),
48154
+ onValueChange: setPickView,
48155
+ options: views.map((view) => ({ value: view.id, label: view.name }))
48156
+ }
48157
+ ),
48158
+ /* @__PURE__ */ jsx155("input", { type: "hidden", name: "cadence", value: pickCadence || (cadences.length > 0 ? cadences : ["instant"])[0] }),
48159
+ /* @__PURE__ */ jsx155(
48160
+ Select24,
48161
+ {
48162
+ "aria-label": "How often",
48163
+ value: pickCadence || (cadences.length > 0 ? cadences : ["instant"])[0],
48164
+ onValueChange: setPickCadence,
48165
+ options: (cadences.length > 0 ? cadences : ["instant"]).map((cadence) => ({ value: cadence, label: CADENCE_WORDS2[cadence] ?? cadence }))
48166
+ }
48167
+ ),
48168
+ /* @__PURE__ */ jsx155("input", { type: "hidden", name: "channel", value: pickChannel }),
48169
+ /* @__PURE__ */ jsx155(
48170
+ Select24,
48171
+ {
48172
+ "aria-label": "Where it arrives",
48173
+ value: pickChannel,
48174
+ onValueChange: setPickChannel,
48175
+ options: ["in_app", "email", "sms"].map((channel) => ({ value: channel, label: CHANNEL_WORDS3[channel] ?? channel }))
48176
+ }
48177
+ ),
48137
48178
  /* @__PURE__ */ jsx155(
48138
48179
  "input",
48139
48180
  {
@@ -48180,7 +48221,7 @@ import {
48180
48221
  Popover as Popover17,
48181
48222
  PopoverContent as PopoverContent17,
48182
48223
  PopoverTrigger as PopoverTrigger17,
48183
- Select as Select19,
48224
+ Select as Select27,
48184
48225
  SelectContent as SelectContent19,
48185
48226
  SelectItem as SelectItem19,
48186
48227
  SelectTrigger as SelectTrigger19,
@@ -48206,6 +48247,7 @@ import {
48206
48247
  } from "@dnd-kit/sortable";
48207
48248
  import { CSS as CSS4 } from "@dnd-kit/utilities";
48208
48249
  import { cn as cn89 } from "@ai-matrx/design-system";
48250
+ import { Select as Select25 } from "@ai-matrx/design-system/controls";
48209
48251
 
48210
48252
  // src/dashboardLayout.ts
48211
48253
  var SPAN_CHOICES = [
@@ -48323,13 +48365,13 @@ function GridCell2({
48323
48365
  }
48324
48366
  ),
48325
48367
  /* @__PURE__ */ jsx156(
48326
- "select",
48368
+ Select25,
48327
48369
  {
48328
48370
  "aria-label": `Width of ${item.title}`,
48329
- className: "ml-auto h-7 rounded border bg-background px-1 text-xs",
48330
- value: snapSpan(item.span),
48331
- onChange: (e) => onSpan(index, Number(e.target.value)),
48332
- children: SPAN_CHOICES.map((choice) => /* @__PURE__ */ jsx156("option", { value: choice.span, children: choice.label }, choice.span))
48371
+ className: "ml-auto",
48372
+ value: String(snapSpan(item.span)),
48373
+ onValueChange: (v) => onSpan(index, Number(v)),
48374
+ options: SPAN_CHOICES.map((choice) => ({ value: String(choice.span), label: choice.label }))
48333
48375
  }
48334
48376
  )
48335
48377
  ] }) : null,
@@ -48344,7 +48386,7 @@ import { useMemo as useMemo74, useState as useState132 } from "react";
48344
48386
  import { useFields as useFields31, useRecordsClient as useRecordsClient94 } from "@ai-matrx/records/react";
48345
48387
  import {
48346
48388
  Button as Button103,
48347
- Select as Select18,
48389
+ Select as Select26,
48348
48390
  SelectContent as SelectContent18,
48349
48391
  SelectItem as SelectItem18,
48350
48392
  SelectTrigger as SelectTrigger18,
@@ -48424,7 +48466,7 @@ function AddChart({ subject, onAdd, onClose }) {
48424
48466
  return /* @__PURE__ */ jsxs145("div", { className: "flex flex-col gap-2 rounded border p-2 text-xs", role: "group", "aria-label": "Add chart", children: [
48425
48467
  /* @__PURE__ */ jsxs145("div", { className: "flex flex-wrap items-center gap-1", children: [
48426
48468
  /* @__PURE__ */ jsx157("div", { className: "min-w-[12rem]", children: /* @__PURE__ */ jsx157(TablePicker, { dataSource: client.config.dataSource, value: tableId, onChange: pickTable }) }),
48427
- /* @__PURE__ */ jsxs145(Select18, { value: measureKey5, onValueChange: setMeasureKey, children: [
48469
+ /* @__PURE__ */ jsxs145(Select26, { value: measureKey5, onValueChange: setMeasureKey, children: [
48428
48470
  /* @__PURE__ */ jsx157(SelectTrigger18, { size: "sm", "aria-label": "What the chart counts", className: "h-7 min-w-[8rem] text-xs", children: /* @__PURE__ */ jsx157(SelectValue18, {}) }),
48429
48471
  /* @__PURE__ */ jsxs145(SelectContent18, { children: [
48430
48472
  /* @__PURE__ */ jsx157(SelectItem18, { value: "count", children: "How many" }),
@@ -48438,7 +48480,7 @@ function AddChart({ subject, onAdd, onClose }) {
48438
48480
  ] }, `avg:${f.key}`))
48439
48481
  ] })
48440
48482
  ] }),
48441
- /* @__PURE__ */ jsxs145(Select18, { value: splitKey, onValueChange: setSplitKey, children: [
48483
+ /* @__PURE__ */ jsxs145(Select26, { value: splitKey, onValueChange: setSplitKey, children: [
48442
48484
  /* @__PURE__ */ jsx157(SelectTrigger18, { size: "sm", "aria-label": "How the chart splits", className: "h-7 min-w-[8rem] text-xs", children: /* @__PURE__ */ jsx157(SelectValue18, {}) }),
48443
48485
  /* @__PURE__ */ jsxs145(SelectContent18, { children: [
48444
48486
  /* @__PURE__ */ jsx157(SelectItem18, { value: "none", children: "No split" }),
@@ -48455,7 +48497,7 @@ function AddChart({ subject, onAdd, onClose }) {
48455
48497
  )
48456
48498
  ] })
48457
48499
  ] }),
48458
- /* @__PURE__ */ jsxs145(Select18, { value: kind, onValueChange: (v) => setKind(v), children: [
48500
+ /* @__PURE__ */ jsxs145(Select26, { value: kind, onValueChange: (v) => setKind(v), children: [
48459
48501
  /* @__PURE__ */ jsx157(SelectTrigger18, { size: "sm", "aria-label": "Chart shape", className: "h-7 min-w-[7rem] text-xs", children: /* @__PURE__ */ jsx157(SelectValue18, {}) }),
48460
48502
  /* @__PURE__ */ jsxs145(SelectContent18, { children: [
48461
48503
  /* @__PURE__ */ jsx157(SelectItem18, { value: "auto", children: CHART_KIND_LABEL[shape] }),
@@ -48471,6 +48513,9 @@ function AddChart({ subject, onAdd, onClose }) {
48471
48513
  ] });
48472
48514
  }
48473
48515
 
48516
+ // src/DashboardCanvas.tsx
48517
+ import { Select as ControlSelect } from "@ai-matrx/design-system/controls";
48518
+
48474
48519
  // src/pages.ts
48475
48520
  import { isRuleFilter as isRuleFilter3 } from "@ai-matrx/records";
48476
48521
  var PAGE_BLOCK_KINDS = ["list", "record", "button", "form", "filter", "chart", "heading", "text", "applet"];
@@ -48749,7 +48794,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
48749
48794
  ) : null,
48750
48795
  board ? /* @__PURE__ */ jsxs146("span", { className: "ml-auto flex items-center gap-1", children: [
48751
48796
  (board.blocks ?? []).some((b) => !!b.bucket) ? /* @__PURE__ */ jsxs146(
48752
- Select19,
48797
+ Select27,
48753
48798
  {
48754
48799
  value: grain ?? "saved",
48755
48800
  onValueChange: (v) => setGrain(v === "saved" ? null : v),
@@ -48913,13 +48958,12 @@ function BlockSettings({
48913
48958
  const fields = own3.data ?? [];
48914
48959
  return /* @__PURE__ */ jsxs146("div", { className: "flex flex-col items-stretch gap-1.5 text-xs", children: [
48915
48960
  /* @__PURE__ */ jsx158(
48916
- "select",
48961
+ ControlSelect,
48917
48962
  {
48918
48963
  "aria-label": `Shape of ${title}`,
48919
- className: "h-7 rounded border bg-background px-1 text-xs",
48920
48964
  value: spec.kind,
48921
- onChange: (e) => onChange({ ...spec, kind: e.target.value }),
48922
- children: CHART_KINDS.map((kind) => /* @__PURE__ */ jsx158("option", { value: kind, children: CHART_KIND_LABEL[kind] }, kind))
48965
+ onValueChange: (kind) => onChange({ ...spec, kind }),
48966
+ options: CHART_KINDS.map((kind) => ({ value: kind, label: CHART_KIND_LABEL[kind] }))
48923
48967
  }
48924
48968
  ),
48925
48969
  (spec.groupBy ?? []).length > 0 ? /* @__PURE__ */ jsx158(
@@ -48966,7 +49010,7 @@ function GroupingPicker({
48966
49010
  const known = choices.some((c) => c.field.key === current);
48967
49011
  return /* @__PURE__ */ jsxs146(Fragment61, { children: [
48968
49012
  /* @__PURE__ */ jsx158("label", { className: "text-muted-foreground", htmlFor: `block-group-${block.title}`, children: "Group by" }),
48969
- /* @__PURE__ */ jsxs146(Select19, { value: known ? current : "", onValueChange: onPick, children: [
49013
+ /* @__PURE__ */ jsxs146(Select27, { value: known ? current : "", onValueChange: onPick, children: [
48970
49014
  /* @__PURE__ */ jsx158(
48971
49015
  SelectTrigger19,
48972
49016
  {
@@ -49063,7 +49107,7 @@ function CompareControl({
49063
49107
  );
49064
49108
  return /* @__PURE__ */ jsxs146(Fragment61, { children: [
49065
49109
  /* @__PURE__ */ jsxs146(
49066
- Select19,
49110
+ Select27,
49067
49111
  {
49068
49112
  value: current ?? "none",
49069
49113
  onValueChange: (v) => {
@@ -49086,7 +49130,7 @@ function CompareControl({
49086
49130
  }
49087
49131
  ),
49088
49132
  current && !explicitWindow ? /* @__PURE__ */ jsxs146(
49089
- Select19,
49133
+ Select27,
49090
49134
  {
49091
49135
  value: period,
49092
49136
  onValueChange: (v) => onChange({ ...block.compare ?? { against: current, key }, period: v }),
@@ -49125,7 +49169,7 @@ function TargetControl({
49125
49169
  }
49126
49170
  return /* @__PURE__ */ jsxs146(Fragment61, { children: [
49127
49171
  /* @__PURE__ */ jsxs146(
49128
- Select19,
49172
+ Select27,
49129
49173
  {
49130
49174
  value: mode,
49131
49175
  onValueChange: (v) => {
@@ -49159,7 +49203,7 @@ function TargetControl({
49159
49203
  }
49160
49204
  ) : null,
49161
49205
  mode === "field" ? /* @__PURE__ */ jsxs146(
49162
- Select19,
49206
+ Select27,
49163
49207
  {
49164
49208
  value: block.target && "field" in block.target && block.target.field ? block.target.field : "",
49165
49209
  onValueChange: (key) => {
@@ -52105,7 +52149,7 @@ import { tableShapeChanged as tableShapeChanged15, useFields as useFields39, use
52105
52149
  import {
52106
52150
  Badge as Badge26,
52107
52151
  BottomSheet,
52108
- Button as Button119,
52152
+ Button as Button120,
52109
52153
  DropdownMenu as DropdownMenu10,
52110
52154
  DropdownMenuContent as DropdownMenuContent10,
52111
52155
  DropdownMenuItem as DropdownMenuItem8,
@@ -52363,42 +52407,143 @@ async function runTablePageAction(kind, args) {
52363
52407
  }
52364
52408
  }
52365
52409
 
52366
- // src/RecordPanel.tsx
52367
- import { Fragment as Fragment68, useState as useState144 } from "react";
52368
- import { Button as Button114, Separator as Separator13 } from "@ai-matrx/design-system";
52369
- import { useFields as useFields37, useRecord as useRecord5 } from "@ai-matrx/records/react";
52370
- import { Fragment as Fragment69, jsx as jsx169, jsxs as jsxs157 } from "react/jsx-runtime";
52371
- function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = false }) {
52372
- const host = useRecordsUi();
52373
- const [asking, setAsking] = useState144(null);
52374
- return /* @__PURE__ */ jsxs157("div", { className: "space-y-3", "data-record-panel": recordId, children: [
52375
- /* @__PURE__ */ jsx169(Peek, { tableId, recordId, onPage, ...onClose ? { onClose } : {} }),
52376
- onPage ? /* @__PURE__ */ jsxs157(Fragment69, { children: [
52377
- /* @__PURE__ */ jsx169(RecordBody, { tableId, recordId }),
52378
- /* @__PURE__ */ jsx169(LinkedLists, { tableId, recordId }),
52379
- /* @__PURE__ */ jsx169(ReverseLinksSections, { tableId, recordId }),
52380
- /* @__PURE__ */ jsx169(RecordAsk, { tableId, recordId })
52381
- ] }) : null,
52382
- /* @__PURE__ */ jsx169(Separator13, {}),
52410
+ // src/RecordStepper.tsx
52411
+ import { Button as Button114 } from "@ai-matrx/design-system";
52412
+ import { jsx as jsx169, jsxs as jsxs157 } from "react/jsx-runtime";
52413
+ function neighborsOf(ids, id) {
52414
+ const index = ids.indexOf(id);
52415
+ if (index < 0) return null;
52416
+ return {
52417
+ index,
52418
+ total: ids.length,
52419
+ previous: index > 0 ? ids[index - 1] : null,
52420
+ next: index < ids.length - 1 ? ids[index + 1] : null
52421
+ };
52422
+ }
52423
+ var TEXT_TAGS = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]);
52424
+ function stepKeyOf(event) {
52425
+ if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return null;
52426
+ if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return null;
52427
+ const target = event.target;
52428
+ if (target) {
52429
+ if (TEXT_TAGS.has(target.tagName) || target.isContentEditable) return null;
52430
+ const role = target.getAttribute?.("role");
52431
+ if (role === "combobox" || role === "listbox" || role === "option" || role === "slider" || role === "spinbutton") return null;
52432
+ }
52433
+ return event.key === "ArrowUp" ? -1 : 1;
52434
+ }
52435
+ function RecordStepper({ neighbors, onStep, expanded, onToggleExpand }) {
52436
+ return /* @__PURE__ */ jsxs157("div", { className: "flex items-center gap-1", "data-record-stepper": "", children: [
52383
52437
  /* @__PURE__ */ jsx169(
52384
- HistoryPanel,
52438
+ Button114,
52385
52439
  {
52386
- tableId,
52387
- recordId,
52388
- onAskAboutField: (fieldKey) => onAskAboutField ? onAskAboutField(fieldKey) : setAsking(fieldKey)
52440
+ size: "sm",
52441
+ variant: "ghost",
52442
+ className: "h-7 w-7 p-0",
52443
+ "aria-label": "Previous record",
52444
+ title: "Previous record (\u2191)",
52445
+ disabled: neighbors.previous === null,
52446
+ onClick: () => neighbors.previous && onStep(neighbors.previous),
52447
+ "data-record-previous": "",
52448
+ children: "\u2191"
52389
52449
  }
52390
52450
  ),
52391
- !onAskAboutField && asking ? /* @__PURE__ */ jsx169(FieldHistoryPanel, { tableId, fieldKey: asking, recordId, onClose: () => setAsking(null) }) : null,
52392
- host.recordSections ? /* @__PURE__ */ jsxs157(Fragment68, { children: [
52393
- /* @__PURE__ */ jsx169(Separator13, {}),
52394
- host.recordSections({ tableId, recordId })
52395
- ] }) : null,
52396
- /* @__PURE__ */ jsx169(Separator13, {}),
52397
- /* @__PURE__ */ jsx169(ChecklistRunner, { tableId, recordId }),
52398
- /* @__PURE__ */ jsx169(Separator13, {}),
52399
- /* @__PURE__ */ jsx169(CommentThread, { tableId, recordId })
52451
+ /* @__PURE__ */ jsx169(
52452
+ Button114,
52453
+ {
52454
+ size: "sm",
52455
+ variant: "ghost",
52456
+ className: "h-7 w-7 p-0",
52457
+ "aria-label": "Next record",
52458
+ title: "Next record (\u2193)",
52459
+ disabled: neighbors.next === null,
52460
+ onClick: () => neighbors.next && onStep(neighbors.next),
52461
+ "data-record-next": "",
52462
+ children: "\u2193"
52463
+ }
52464
+ ),
52465
+ /* @__PURE__ */ jsxs157("span", { className: "text-[11px] tabular-nums text-muted-foreground", "data-record-position": "", children: [
52466
+ neighbors.index + 1,
52467
+ " of ",
52468
+ neighbors.total
52469
+ ] }),
52470
+ onToggleExpand ? /* @__PURE__ */ jsx169(
52471
+ Button114,
52472
+ {
52473
+ size: "sm",
52474
+ variant: "ghost",
52475
+ className: "ml-auto h-7 px-2 text-xs",
52476
+ "aria-pressed": Boolean(expanded),
52477
+ onClick: onToggleExpand,
52478
+ "data-record-expand": "",
52479
+ children: expanded ? "Shrink" : "Expand"
52480
+ }
52481
+ ) : null
52400
52482
  ] });
52401
52483
  }
52484
+
52485
+ // src/RecordPanel.tsx
52486
+ import { Fragment as Fragment68, useState as useState144 } from "react";
52487
+ import { Button as Button115, Separator as Separator13 } from "@ai-matrx/design-system";
52488
+ import { useFields as useFields37, useRecord as useRecord5 } from "@ai-matrx/records/react";
52489
+ import { Fragment as Fragment69, jsx as jsx170, jsxs as jsxs158 } from "react/jsx-runtime";
52490
+ function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = false, neighbors, onStep, expanded, onToggleExpand }) {
52491
+ const host = useRecordsUi();
52492
+ const [asking, setAsking] = useState144(null);
52493
+ return /* @__PURE__ */ jsxs158(
52494
+ "div",
52495
+ {
52496
+ className: "space-y-3 outline-none",
52497
+ tabIndex: -1,
52498
+ "data-record-panel": recordId,
52499
+ onKeyDown: (event) => {
52500
+ if (event.key === "Escape" && !event.defaultPrevented && onClose && !onPage) {
52501
+ const tag = event.target?.tagName;
52502
+ if (tag !== "INPUT" && tag !== "TEXTAREA" && tag !== "SELECT") {
52503
+ event.preventDefault();
52504
+ onClose();
52505
+ }
52506
+ return;
52507
+ }
52508
+ if (!neighbors || !onStep) return;
52509
+ const way = stepKeyOf(event);
52510
+ const to = way === null ? null : way < 0 ? neighbors.previous : neighbors.next;
52511
+ if (to) {
52512
+ event.preventDefault();
52513
+ onStep(to);
52514
+ }
52515
+ },
52516
+ children: [
52517
+ neighbors && onStep ? /* @__PURE__ */ jsx170(RecordStepper, { neighbors, onStep: (to) => onStep(to), expanded, onToggleExpand }) : null,
52518
+ /* @__PURE__ */ jsx170(Peek, { tableId, recordId, onPage, ...onClose ? { onClose } : {} }),
52519
+ onPage ? /* @__PURE__ */ jsxs158(Fragment69, { children: [
52520
+ /* @__PURE__ */ jsx170(RecordBody, { tableId, recordId }),
52521
+ /* @__PURE__ */ jsx170(LinkedLists, { tableId, recordId }),
52522
+ /* @__PURE__ */ jsx170(ReverseLinksSections, { tableId, recordId }),
52523
+ /* @__PURE__ */ jsx170(RecordAsk, { tableId, recordId })
52524
+ ] }) : null,
52525
+ /* @__PURE__ */ jsx170(Separator13, {}),
52526
+ /* @__PURE__ */ jsx170(
52527
+ HistoryPanel,
52528
+ {
52529
+ tableId,
52530
+ recordId,
52531
+ onAskAboutField: (fieldKey) => onAskAboutField ? onAskAboutField(fieldKey) : setAsking(fieldKey)
52532
+ }
52533
+ ),
52534
+ !onAskAboutField && asking ? /* @__PURE__ */ jsx170(FieldHistoryPanel, { tableId, fieldKey: asking, recordId, onClose: () => setAsking(null) }) : null,
52535
+ host.recordSections ? /* @__PURE__ */ jsxs158(Fragment68, { children: [
52536
+ /* @__PURE__ */ jsx170(Separator13, {}),
52537
+ host.recordSections({ tableId, recordId })
52538
+ ] }) : null,
52539
+ /* @__PURE__ */ jsx170(Separator13, {}),
52540
+ /* @__PURE__ */ jsx170(ChecklistRunner, { tableId, recordId }),
52541
+ /* @__PURE__ */ jsx170(Separator13, {}),
52542
+ /* @__PURE__ */ jsx170(CommentThread, { tableId, recordId })
52543
+ ]
52544
+ }
52545
+ );
52546
+ }
52402
52547
  function LinkedLists({ tableId, recordId }) {
52403
52548
  const fields = useFields37(tableId);
52404
52549
  const record = useRecord5(recordId, true, { tableId });
@@ -52408,9 +52553,9 @@ function LinkedLists({ tableId, recordId }) {
52408
52553
  const may = useRecordRights(recordId);
52409
52554
  if (links.length === 0 || !document2) return null;
52410
52555
  if (may.write) {
52411
- return /* @__PURE__ */ jsxs157("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
52412
- /* @__PURE__ */ jsx169(Separator13, {}),
52413
- /* @__PURE__ */ jsx169(
52556
+ return /* @__PURE__ */ jsxs158("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
52557
+ /* @__PURE__ */ jsx170(Separator13, {}),
52558
+ /* @__PURE__ */ jsx170(
52414
52559
  RecordFieldsInPlace,
52415
52560
  {
52416
52561
  tableId,
@@ -52423,25 +52568,25 @@ function LinkedLists({ tableId, recordId }) {
52423
52568
  className: "flex min-w-0 flex-col gap-1",
52424
52569
  renderLabel: (field2) => {
52425
52570
  const count = referencesOf(field2, document2[field2.key], "relation", labels).length;
52426
- return /* @__PURE__ */ jsxs157("span", { className: "flex items-center gap-2 pt-2 text-foreground", "data-record-linked-list": field2.key, children: [
52427
- /* @__PURE__ */ jsx169("span", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
52428
- count > 0 ? /* @__PURE__ */ jsx169("span", { className: "text-[11px] text-muted-foreground", children: count }) : null
52571
+ return /* @__PURE__ */ jsxs158("span", { className: "flex items-center gap-2 pt-2 text-foreground", "data-record-linked-list": field2.key, children: [
52572
+ /* @__PURE__ */ jsx170("span", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
52573
+ count > 0 ? /* @__PURE__ */ jsx170("span", { className: "text-[11px] text-muted-foreground", children: count }) : null
52429
52574
  ] });
52430
52575
  }
52431
52576
  }
52432
52577
  )
52433
52578
  ] });
52434
52579
  }
52435
- return /* @__PURE__ */ jsxs157("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
52436
- /* @__PURE__ */ jsx169(Separator13, {}),
52580
+ return /* @__PURE__ */ jsxs158("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
52581
+ /* @__PURE__ */ jsx170(Separator13, {}),
52437
52582
  links.map((field2) => {
52438
52583
  const refs = referencesOf(field2, document2[field2.key], "relation", labels);
52439
- return /* @__PURE__ */ jsxs157("section", { className: "flex min-w-0 flex-col gap-1", "data-record-linked-list": field2.key, children: [
52440
- /* @__PURE__ */ jsxs157("div", { className: "flex items-center gap-2", children: [
52441
- /* @__PURE__ */ jsx169("h4", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
52442
- refs.length > 0 ? /* @__PURE__ */ jsx169("span", { className: "text-[11px] text-muted-foreground", children: refs.length }) : null
52584
+ return /* @__PURE__ */ jsxs158("section", { className: "flex min-w-0 flex-col gap-1", "data-record-linked-list": field2.key, children: [
52585
+ /* @__PURE__ */ jsxs158("div", { className: "flex items-center gap-2", children: [
52586
+ /* @__PURE__ */ jsx170("h4", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
52587
+ refs.length > 0 ? /* @__PURE__ */ jsx170("span", { className: "text-[11px] text-muted-foreground", children: refs.length }) : null
52443
52588
  ] }),
52444
- refs.length === 0 ? /* @__PURE__ */ jsx169("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : /* @__PURE__ */ jsx169("ul", { className: "flex min-w-0 flex-col gap-1", children: refs.map((ref) => /* @__PURE__ */ jsx169("li", { className: "min-w-0", children: /* @__PURE__ */ jsx169(ReferenceChip, { reference: ref }) }, ref.id)) })
52589
+ refs.length === 0 ? /* @__PURE__ */ jsx170("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : /* @__PURE__ */ jsx170("ul", { className: "flex min-w-0 flex-col gap-1", children: refs.map((ref) => /* @__PURE__ */ jsx170("li", { className: "min-w-0", children: /* @__PURE__ */ jsx170(ReferenceChip, { reference: ref }) }, ref.id)) })
52445
52590
  ] }, field2.id);
52446
52591
  })
52447
52592
  ] });
@@ -52450,27 +52595,27 @@ function RecordAsk({ tableId, recordId }) {
52450
52595
  const host = useRecordsUi();
52451
52596
  const [open, setOpen] = useState144(false);
52452
52597
  if (!host.chat) return null;
52453
- return /* @__PURE__ */ jsxs157("section", { className: "flex min-w-0 flex-col gap-1.5", "data-record-ask": open ? "open" : "", children: [
52454
- /* @__PURE__ */ jsx169(Separator13, {}),
52455
- open ? /* @__PURE__ */ jsx169(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }) : /* @__PURE__ */ jsx169(Button114, { size: "sm", variant: "outline", className: "self-start", onClick: () => setOpen(true), "data-record-ask-open": "", children: "Ask about this record" })
52598
+ return /* @__PURE__ */ jsxs158("section", { className: "flex min-w-0 flex-col gap-1.5", "data-record-ask": open ? "open" : "", children: [
52599
+ /* @__PURE__ */ jsx170(Separator13, {}),
52600
+ open ? /* @__PURE__ */ jsx170(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }) : /* @__PURE__ */ jsx170(Button115, { size: "sm", variant: "outline", className: "self-start", onClick: () => setOpen(true), "data-record-ask-open": "", children: "Ask about this record" })
52456
52601
  ] });
52457
52602
  }
52458
52603
 
52459
52604
  // src/breakDown.tsx
52460
52605
  import { useMemo as useMemo79, useState as useState145 } from "react";
52461
52606
  import {
52462
- Button as Button115,
52607
+ Button as Button116,
52463
52608
  Dialog as Dialog18,
52464
52609
  DialogContent as DialogContent18,
52465
52610
  DialogHeader as DialogHeader18,
52466
52611
  DialogTitle as DialogTitle18,
52467
- Select as Select20,
52612
+ Select as Select28,
52468
52613
  SelectContent as SelectContent20,
52469
52614
  SelectItem as SelectItem20,
52470
52615
  SelectTrigger as SelectTrigger20,
52471
52616
  SelectValue as SelectValue20
52472
52617
  } from "@ai-matrx/design-system";
52473
- import { jsx as jsx170, jsxs as jsxs158 } from "react/jsx-runtime";
52618
+ import { jsx as jsx171, jsxs as jsxs159 } from "react/jsx-runtime";
52474
52619
  var BREAK_DOWN_ACTION_ID = "break-down";
52475
52620
  var NO_DIMENSION_REASON = "No column to break down by";
52476
52621
  function breakDownAction(args) {
@@ -52499,14 +52644,14 @@ function BreakDownDialog({
52499
52644
  const dimensions = useMemo79(() => drillDimensionsOf(def, NO_LABELS), [def]);
52500
52645
  const [picked, setPicked] = useState145(null);
52501
52646
  const key = picked ?? held?.field ?? dimensions[0]?.key ?? "";
52502
- return /* @__PURE__ */ jsx170(Dialog18, { open, onOpenChange, children: /* @__PURE__ */ jsxs158(DialogContent18, { "data-break-down": "", className: "max-w-sm", children: [
52503
- /* @__PURE__ */ jsx170(DialogHeader18, { children: /* @__PURE__ */ jsx170(DialogTitle18, { children: "Break down by" }) }),
52504
- /* @__PURE__ */ jsxs158(Select20, { value: key, onValueChange: setPicked, children: [
52505
- /* @__PURE__ */ jsx170(SelectTrigger20, { "aria-label": "Column to break down by", "data-break-down-select": "", children: /* @__PURE__ */ jsx170(SelectValue20, { placeholder: def ? NO_DIMENSION_REASON : "Reading this table\u2026" }) }),
52506
- /* @__PURE__ */ jsx170(SelectContent20, { children: dimensions.map((d) => /* @__PURE__ */ jsx170(SelectItem20, { value: d.key, children: d.label }, d.key)) })
52647
+ return /* @__PURE__ */ jsx171(Dialog18, { open, onOpenChange, children: /* @__PURE__ */ jsxs159(DialogContent18, { "data-break-down": "", className: "max-w-sm", children: [
52648
+ /* @__PURE__ */ jsx171(DialogHeader18, { children: /* @__PURE__ */ jsx171(DialogTitle18, { children: "Break down by" }) }),
52649
+ /* @__PURE__ */ jsxs159(Select28, { value: key, onValueChange: setPicked, children: [
52650
+ /* @__PURE__ */ jsx171(SelectTrigger20, { "aria-label": "Column to break down by", "data-break-down-select": "", children: /* @__PURE__ */ jsx171(SelectValue20, { placeholder: def ? NO_DIMENSION_REASON : "Reading this table\u2026" }) }),
52651
+ /* @__PURE__ */ jsx171(SelectContent20, { children: dimensions.map((d) => /* @__PURE__ */ jsx171(SelectItem20, { value: d.key, children: d.label }, d.key)) })
52507
52652
  ] }),
52508
- /* @__PURE__ */ jsx170(
52509
- Button115,
52653
+ /* @__PURE__ */ jsx171(
52654
+ Button116,
52510
52655
  {
52511
52656
  type: "button",
52512
52657
  "data-break-down-apply": "",
@@ -52526,8 +52671,8 @@ function BreakDownDialog({
52526
52671
  import { copyText as copyText14 } from "@ai-matrx/kit/clipboard";
52527
52672
  import { useCallback as useCallback69, useMemo as useMemo80, useState as useState146 } from "react";
52528
52673
  import { useContentTransferCapabilities as useContentTransferCapabilities2 } from "@ai-matrx/alchemy/react/workspace";
52529
- import { Button as Button116, Dialog as Dialog19, DialogContent as DialogContent19, DialogHeader as DialogHeader19, DialogTitle as DialogTitle19 } from "@ai-matrx/design-system";
52530
- import { jsx as jsx171, jsxs as jsxs159 } from "react/jsx-runtime";
52674
+ import { Button as Button117, Dialog as Dialog19, DialogContent as DialogContent19, DialogHeader as DialogHeader19, DialogTitle as DialogTitle19 } from "@ai-matrx/design-system";
52675
+ import { jsx as jsx172, jsxs as jsxs160 } from "react/jsx-runtime";
52531
52676
  function tableReferenceChoices(tableId, name) {
52532
52677
  return [
52533
52678
  {
@@ -52570,11 +52715,11 @@ function TableReferenceDialog({
52570
52715
  },
52571
52716
  [port, notify]
52572
52717
  );
52573
- return /* @__PURE__ */ jsx171(Dialog19, { open, onOpenChange, children: /* @__PURE__ */ jsxs159(DialogContent19, { className: "sm:max-w-sm", "data-table-reference": "", children: [
52574
- /* @__PURE__ */ jsx171(DialogHeader19, { children: /* @__PURE__ */ jsx171(DialogTitle19, { children: "Get reference" }) }),
52575
- /* @__PURE__ */ jsx171("div", { className: "flex flex-col gap-2", children: choices.map((choice) => /* @__PURE__ */ jsxs159("div", { className: "flex items-center justify-between gap-3 rounded-md border px-3 py-2", children: [
52576
- /* @__PURE__ */ jsx171("span", { className: "text-sm", children: choice.label }),
52577
- /* @__PURE__ */ jsx171(Button116, { size: "sm", variant: "outline", onClick: () => void copy(choice), "data-table-reference-copy": choice.id, children: copied === choice.id ? "Copied" : "Copy" })
52718
+ return /* @__PURE__ */ jsx172(Dialog19, { open, onOpenChange, children: /* @__PURE__ */ jsxs160(DialogContent19, { className: "sm:max-w-sm", "data-table-reference": "", children: [
52719
+ /* @__PURE__ */ jsx172(DialogHeader19, { children: /* @__PURE__ */ jsx172(DialogTitle19, { children: "Get reference" }) }),
52720
+ /* @__PURE__ */ jsx172("div", { className: "flex flex-col gap-2", children: choices.map((choice) => /* @__PURE__ */ jsxs160("div", { className: "flex items-center justify-between gap-3 rounded-md border px-3 py-2", children: [
52721
+ /* @__PURE__ */ jsx172("span", { className: "text-sm", children: choice.label }),
52722
+ /* @__PURE__ */ jsx172(Button117, { size: "sm", variant: "outline", onClick: () => void copy(choice), "data-table-reference-copy": choice.id, children: copied === choice.id ? "Copied" : "Copy" })
52578
52723
  ] }, choice.id)) })
52579
52724
  ] }) });
52580
52725
  }
@@ -52583,8 +52728,8 @@ function TableReferenceDialog({
52583
52728
  import { formatCount as formatCount7 } from "@ai-matrx/kit/format";
52584
52729
  import { useState as useState147 } from "react";
52585
52730
  import { tableShapeChanged as tableShapeChanged14, useRecordsClient as useRecordsClient105 } from "@ai-matrx/records/react";
52586
- import { Button as Button117, Dialog as Dialog20, DialogContent as DialogContent20, DialogFooter as DialogFooter13, DialogHeader as DialogHeader20, DialogTitle as DialogTitle20, ErrorBox as ErrorBox8, Input as Input11, Switch as Switch7 } from "@ai-matrx/design-system";
52587
- import { Fragment as Fragment70, jsx as jsx172, jsxs as jsxs160 } from "react/jsx-runtime";
52731
+ import { Button as Button118, Dialog as Dialog20, DialogContent as DialogContent20, DialogFooter as DialogFooter13, DialogHeader as DialogHeader20, DialogTitle as DialogTitle20, ErrorBox as ErrorBox8, Input as Input11, Switch as Switch7 } from "@ai-matrx/design-system";
52732
+ import { Fragment as Fragment70, jsx as jsx173, jsxs as jsxs161 } from "react/jsx-runtime";
52588
52733
  function copyNameFor(name) {
52589
52734
  return `${name.trim() || "Table"} (copy)`;
52590
52735
  }
@@ -52632,13 +52777,13 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
52632
52777
  if (onDuplicated) onDuplicated(copy);
52633
52778
  else if (typeof window !== "undefined") window.location.assign(copy.path);
52634
52779
  };
52635
- return /* @__PURE__ */ jsx172(Dialog20, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs160(DialogContent20, { className: "sm:max-w-md", "data-table-duplicate": tableId, children: [
52636
- /* @__PURE__ */ jsx172(DialogHeader20, { children: /* @__PURE__ */ jsxs160(DialogTitle20, { children: [
52780
+ return /* @__PURE__ */ jsx173(Dialog20, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs161(DialogContent20, { className: "sm:max-w-md", "data-table-duplicate": tableId, children: [
52781
+ /* @__PURE__ */ jsx173(DialogHeader20, { children: /* @__PURE__ */ jsxs161(DialogTitle20, { children: [
52637
52782
  "Duplicate ",
52638
52783
  name || "table"
52639
52784
  ] }) }),
52640
- phase.kind === "done" ? /* @__PURE__ */ jsxs160("div", { className: "flex flex-col gap-1.5 text-sm", "data-table-duplicate-done": "", children: [
52641
- /* @__PURE__ */ jsxs160("p", { children: [
52785
+ phase.kind === "done" ? /* @__PURE__ */ jsxs161("div", { className: "flex flex-col gap-1.5 text-sm", "data-table-duplicate-done": "", children: [
52786
+ /* @__PURE__ */ jsxs161("p", { children: [
52642
52787
  phase.copy.table.name,
52643
52788
  ": ",
52644
52789
  phase.copy.copied.fields,
@@ -52648,13 +52793,13 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
52648
52793
  phase.copy.copied.withRecords ? `, ${formatCount7(phase.copy.copied.records)} records` : "",
52649
52794
  "."
52650
52795
  ] }),
52651
- phase.copy.notCopied.length > 0 ? /* @__PURE__ */ jsxs160("p", { className: "text-xs text-muted-foreground", children: [
52796
+ phase.copy.notCopied.length > 0 ? /* @__PURE__ */ jsxs161("p", { className: "text-xs text-muted-foreground", children: [
52652
52797
  "Not copied: ",
52653
52798
  phase.copy.notCopied.join(", "),
52654
52799
  "."
52655
52800
  ] }) : null
52656
- ] }) : /* @__PURE__ */ jsxs160("div", { className: "flex flex-col gap-3 text-sm", children: [
52657
- /* @__PURE__ */ jsx172(
52801
+ ] }) : /* @__PURE__ */ jsxs161("div", { className: "flex flex-col gap-3 text-sm", children: [
52802
+ /* @__PURE__ */ jsx173(
52658
52803
  Input11,
52659
52804
  {
52660
52805
  autoFocus: true,
@@ -52667,26 +52812,26 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
52667
52812
  }
52668
52813
  }
52669
52814
  ),
52670
- /* @__PURE__ */ jsxs160("label", { className: "flex items-center justify-between gap-2", children: [
52671
- /* @__PURE__ */ jsx172("span", { children: "Copy its records" }),
52672
- /* @__PURE__ */ jsx172(Switch7, { checked: withRecords, disabled: copying, onCheckedChange: setWithRecords, "aria-label": "Copy its records" })
52815
+ /* @__PURE__ */ jsxs161("label", { className: "flex items-center justify-between gap-2", children: [
52816
+ /* @__PURE__ */ jsx173("span", { children: "Copy its records" }),
52817
+ /* @__PURE__ */ jsx173(Switch7, { checked: withRecords, disabled: copying, onCheckedChange: setWithRecords, "aria-label": "Copy its records" })
52673
52818
  ] }),
52674
- phase.kind === "copying" ? /* @__PURE__ */ jsx172("p", { className: "text-xs text-muted-foreground", "data-table-duplicate-progress": "", children: phase.progress ? duplicateProgressWords(phase.progress) : "Starting the copy\u2026" }) : null,
52675
- phase.kind === "refused" ? /* @__PURE__ */ jsx172(ErrorBox8, { children: phase.sentence }) : null,
52676
- problem && typed2 !== "" ? /* @__PURE__ */ jsx172("p", { className: "text-xs text-muted-foreground", children: problem }) : null
52819
+ phase.kind === "copying" ? /* @__PURE__ */ jsx173("p", { className: "text-xs text-muted-foreground", "data-table-duplicate-progress": "", children: phase.progress ? duplicateProgressWords(phase.progress) : "Starting the copy\u2026" }) : null,
52820
+ phase.kind === "refused" ? /* @__PURE__ */ jsx173(ErrorBox8, { children: phase.sentence }) : null,
52821
+ problem && typed2 !== "" ? /* @__PURE__ */ jsx173("p", { className: "text-xs text-muted-foreground", children: problem }) : null
52677
52822
  ] }),
52678
- /* @__PURE__ */ jsx172(DialogFooter13, { children: phase.kind === "done" ? /* @__PURE__ */ jsx172(Button117, { onClick: () => openCopy(phase.copy), "data-table-duplicate-open": "", children: "Open the copy" }) : /* @__PURE__ */ jsxs160(Fragment70, { children: [
52679
- /* @__PURE__ */ jsx172(Button117, { variant: "ghost", disabled: copying, onClick: () => close(false), children: "Cancel" }),
52680
- /* @__PURE__ */ jsx172(Button117, { disabled: copying || problem !== null, onClick: () => void go(), children: copying ? "Duplicating\u2026" : "Duplicate" })
52823
+ /* @__PURE__ */ jsx173(DialogFooter13, { children: phase.kind === "done" ? /* @__PURE__ */ jsx173(Button118, { onClick: () => openCopy(phase.copy), "data-table-duplicate-open": "", children: "Open the copy" }) : /* @__PURE__ */ jsxs161(Fragment70, { children: [
52824
+ /* @__PURE__ */ jsx173(Button118, { variant: "ghost", disabled: copying, onClick: () => close(false), children: "Cancel" }),
52825
+ /* @__PURE__ */ jsx173(Button118, { disabled: copying || problem !== null, onClick: () => void go(), children: copying ? "Duplicating\u2026" : "Duplicate" })
52681
52826
  ] }) })
52682
52827
  ] }) });
52683
52828
  }
52684
52829
 
52685
52830
  // src/ViewFilter.tsx
52686
52831
  import { useEffect as useEffect122, useMemo as useMemo81, useState as useState148 } from "react";
52687
- import { Button as Button118, Popover as Popover19, PopoverContent as PopoverContent19, PopoverTrigger as PopoverTrigger19 } from "@ai-matrx/design-system";
52832
+ import { Button as Button119, Popover as Popover19, PopoverContent as PopoverContent19, PopoverTrigger as PopoverTrigger19 } from "@ai-matrx/design-system";
52688
52833
  import { useFields as useFields38 } from "@ai-matrx/records/react";
52689
- import { jsx as jsx173, jsxs as jsxs161 } from "react/jsx-runtime";
52834
+ import { jsx as jsx174, jsxs as jsxs162 } from "react/jsx-runtime";
52690
52835
  function conditionCount(expr) {
52691
52836
  if (!expr || typeof expr !== "object" || Array.isArray(expr)) return 0;
52692
52837
  const node = expr;
@@ -52714,7 +52859,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
52714
52859
  return (
52715
52860
  // THE BUILDER FLOATS OVER THE TABLE (STABLE-TABLES; Notion's filter popover): drawn inside the
52716
52861
  // toolbar row it grew the row and pushed the whole table down (0.13 + 0.13 layout shift).
52717
- /* @__PURE__ */ jsxs161(
52862
+ /* @__PURE__ */ jsxs162(
52718
52863
  Popover19,
52719
52864
  {
52720
52865
  open,
@@ -52723,8 +52868,8 @@ function ViewFilter({ tableId, view, onApply, className }) {
52723
52868
  setOpen(next);
52724
52869
  },
52725
52870
  children: [
52726
- /* @__PURE__ */ jsx173(PopoverTrigger19, { asChild: true, children: /* @__PURE__ */ jsx173(
52727
- Button118,
52871
+ /* @__PURE__ */ jsx174(PopoverTrigger19, { asChild: true, children: /* @__PURE__ */ jsx174(
52872
+ Button119,
52728
52873
  {
52729
52874
  size: "sm",
52730
52875
  variant: open || count > 0 ? "secondary" : "ghost",
@@ -52735,17 +52880,17 @@ function ViewFilter({ tableId, view, onApply, className }) {
52735
52880
  children: count > 0 ? `Filter \xB7 ${count}` : "Filter"
52736
52881
  }
52737
52882
  ) }),
52738
- /* @__PURE__ */ jsx173(PopoverContent19, { sizing: "content", align: "start", className: "w-auto max-w-[min(42rem,calc(100vw-2rem))] p-2", children: /* @__PURE__ */ jsxs161(
52883
+ /* @__PURE__ */ jsx174(PopoverContent19, { sizing: "content", align: "start", className: "w-auto max-w-[min(42rem,calc(100vw-2rem))] p-2", children: /* @__PURE__ */ jsxs162(
52739
52884
  "div",
52740
52885
  {
52741
52886
  className: "flex flex-col gap-2 text-xs",
52742
52887
  "data-testid": "view-filter-panel",
52743
52888
  children: [
52744
- view.ruleId ? /* @__PURE__ */ jsx173("p", { className: "text-muted-foreground", children: "This view's records are chosen by a membership Rule, and the store answers it. Change the Rule to change who is in this view." }) : !conditionIsDrawable(saved) ? /* @__PURE__ */ jsxs161("p", { className: "text-muted-foreground", children: [
52889
+ view.ruleId ? /* @__PURE__ */ jsx174("p", { className: "text-muted-foreground", children: "This view's records are chosen by a membership Rule, and the store answers it. Change the Rule to change who is in this view." }) : !conditionIsDrawable(saved) ? /* @__PURE__ */ jsxs162("p", { className: "text-muted-foreground", children: [
52745
52890
  "This view asks: ",
52746
52891
  conditionInWords(saved, conditionFields),
52747
52892
  ". It cannot be drawn here; clear it to start a new filter."
52748
- ] }) : /* @__PURE__ */ jsx173(FilterTermsContext.Provider, { value: true, children: /* @__PURE__ */ jsx173(
52893
+ ] }) : /* @__PURE__ */ jsx174(FilterTermsContext.Provider, { value: true, children: /* @__PURE__ */ jsx174(
52749
52894
  ConditionGroup,
52750
52895
  {
52751
52896
  lead: "Show records where",
@@ -52755,9 +52900,9 @@ function ViewFilter({ tableId, view, onApply, className }) {
52755
52900
  onChange: setDraft
52756
52901
  }
52757
52902
  ) }),
52758
- view.ruleId ? null : /* @__PURE__ */ jsxs161("div", { className: "flex items-center gap-1", children: [
52759
- changed2 ? /* @__PURE__ */ jsx173(
52760
- Button118,
52903
+ view.ruleId ? null : /* @__PURE__ */ jsxs162("div", { className: "flex items-center gap-1", children: [
52904
+ changed2 ? /* @__PURE__ */ jsx174(
52905
+ Button119,
52761
52906
  {
52762
52907
  size: "sm",
52763
52908
  "data-testid": "view-filter-apply",
@@ -52768,8 +52913,8 @@ function ViewFilter({ tableId, view, onApply, className }) {
52768
52913
  children: "Apply"
52769
52914
  }
52770
52915
  ) : null,
52771
- count > 0 || draft ? /* @__PURE__ */ jsx173(
52772
- Button118,
52916
+ count > 0 || draft ? /* @__PURE__ */ jsx174(
52917
+ Button119,
52773
52918
  {
52774
52919
  size: "sm",
52775
52920
  variant: "ghost",
@@ -52782,7 +52927,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
52782
52927
  children: "Clear filter"
52783
52928
  }
52784
52929
  ) : null,
52785
- /* @__PURE__ */ jsx173(Button118, { size: "sm", variant: "ghost", onClick: () => {
52930
+ /* @__PURE__ */ jsx174(Button119, { size: "sm", variant: "ghost", onClick: () => {
52786
52931
  setDraft(saved);
52787
52932
  setOpen(false);
52788
52933
  }, children: "Cancel" })
@@ -52798,10 +52943,10 @@ function ViewFilter({ tableId, view, onApply, className }) {
52798
52943
 
52799
52944
  // src/PhoneTableActions.tsx
52800
52945
  import { DropdownMenu as DropdownMenu9, DropdownMenuContent as DropdownMenuContent9, DropdownMenuTrigger as DropdownMenuTrigger9, cn as cn99 } from "@ai-matrx/design-system";
52801
- import { jsx as jsx174, jsxs as jsxs162 } from "react/jsx-runtime";
52946
+ import { jsx as jsx175, jsxs as jsxs163 } from "react/jsx-runtime";
52802
52947
  function PhoneActionRow({ action: action3, groupStart }) {
52803
52948
  const disabled = action3.disabledReason !== void 0;
52804
- return /* @__PURE__ */ jsxs162(
52949
+ return /* @__PURE__ */ jsxs163(
52805
52950
  "button",
52806
52951
  {
52807
52952
  type: "button",
@@ -52817,10 +52962,10 @@ function PhoneActionRow({ action: action3, groupStart }) {
52817
52962
  action3.destructive && "text-destructive"
52818
52963
  ),
52819
52964
  children: [
52820
- /* @__PURE__ */ jsx174(ObjectActionGlyph, { name: action3.icon, className: "h-5 w-5 shrink-0" }),
52821
- /* @__PURE__ */ jsxs162("span", { className: "flex min-w-0 flex-col", children: [
52822
- /* @__PURE__ */ jsx174("span", { className: "truncate", children: action3.label }),
52823
- disabled ? /* @__PURE__ */ jsx174("span", { className: "truncate text-xs text-muted-foreground", "data-object-action-reason": "", children: action3.disabledReason }) : null
52965
+ /* @__PURE__ */ jsx175(ObjectActionGlyph, { name: action3.icon, className: "h-5 w-5 shrink-0" }),
52966
+ /* @__PURE__ */ jsxs163("span", { className: "flex min-w-0 flex-col", children: [
52967
+ /* @__PURE__ */ jsx175("span", { className: "truncate", children: action3.label }),
52968
+ disabled ? /* @__PURE__ */ jsx175("span", { className: "truncate text-xs text-muted-foreground", "data-object-action-reason": "", children: action3.disabledReason }) : null
52824
52969
  ] })
52825
52970
  ]
52826
52971
  }
@@ -52828,20 +52973,20 @@ function PhoneActionRow({ action: action3, groupStart }) {
52828
52973
  }
52829
52974
  PhoneActionRow.routeHeaderMenu = true;
52830
52975
  function PhoneSubmenu({ label, icon, actions }) {
52831
- return /* @__PURE__ */ jsxs162(DropdownMenu9, { children: [
52832
- /* @__PURE__ */ jsx174(DropdownMenuTrigger9, { asChild: true, children: /* @__PURE__ */ jsxs162(
52976
+ return /* @__PURE__ */ jsxs163(DropdownMenu9, { children: [
52977
+ /* @__PURE__ */ jsx175(DropdownMenuTrigger9, { asChild: true, children: /* @__PURE__ */ jsxs163(
52833
52978
  "button",
52834
52979
  {
52835
52980
  type: "button",
52836
52981
  "data-object-action-group": "built-on",
52837
52982
  className: "flex min-h-11 w-full items-center gap-3 border-t border-border px-1 pt-1 text-left text-base",
52838
52983
  children: [
52839
- icon ? /* @__PURE__ */ jsx174(ObjectActionGlyph, { name: icon, className: "h-5 w-5 shrink-0" }) : null,
52840
- /* @__PURE__ */ jsx174("span", { className: "truncate", children: label })
52984
+ icon ? /* @__PURE__ */ jsx175(ObjectActionGlyph, { name: icon, className: "h-5 w-5 shrink-0" }) : null,
52985
+ /* @__PURE__ */ jsx175("span", { className: "truncate", children: label })
52841
52986
  ]
52842
52987
  }
52843
52988
  ) }),
52844
- /* @__PURE__ */ jsx174(DropdownMenuContent9, { align: "end", className: "w-64", children: /* @__PURE__ */ jsx174(ObjectActionMenuItems, { actions: actions.map((a) => ({ ...a, group: "manage" })) }) })
52989
+ /* @__PURE__ */ jsx175(DropdownMenuContent9, { align: "end", className: "w-64", children: /* @__PURE__ */ jsx175(ObjectActionMenuItems, { actions: actions.map((a) => ({ ...a, group: "manage" })) }) })
52845
52990
  ] });
52846
52991
  }
52847
52992
  PhoneSubmenu.routeHeaderMenu = true;
@@ -52854,13 +52999,13 @@ function phoneTableActions(actions) {
52854
52999
  continue;
52855
53000
  }
52856
53001
  if (entry.kind === "submenu") {
52857
- out.push(/* @__PURE__ */ jsx174(PhoneSubmenu, { label: entry.label, icon: entry.icon, actions: entry.actions }, `phone-group-${entry.id}`));
53002
+ out.push(/* @__PURE__ */ jsx175(PhoneSubmenu, { label: entry.label, icon: entry.icon, actions: entry.actions }, `phone-group-${entry.id}`));
52858
53003
  groupStart = false;
52859
53004
  continue;
52860
53005
  }
52861
53006
  const a = entry.action;
52862
53007
  out.push(
52863
- /* @__PURE__ */ jsx174(
53008
+ /* @__PURE__ */ jsx175(
52864
53009
  PhoneActionRow,
52865
53010
  {
52866
53011
  action: a,
@@ -53086,7 +53231,7 @@ function useSlotScroll(slot) {
53086
53231
  // src/TablePage.tsx
53087
53232
  import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
53088
53233
  import { openOutbound as openOutbound4 } from "@ai-matrx/kit/outbound";
53089
- import { Fragment as Fragment71, jsx as jsx175, jsxs as jsxs163 } from "react/jsx-runtime";
53234
+ import { Fragment as Fragment71, jsx as jsx176, jsxs as jsxs164 } from "react/jsx-runtime";
53090
53235
  var RAIL_TITLE = {
53091
53236
  settings: "Table settings",
53092
53237
  inbox: "Inbox",
@@ -53103,20 +53248,21 @@ var RAIL_TITLE = {
53103
53248
  export: "Export"
53104
53249
  };
53105
53250
  function LookGlyph() {
53106
- return /* @__PURE__ */ jsxs163("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
53107
- /* @__PURE__ */ jsx175("path", { d: "M4 7h10M18 7h2M4 17h2M10 17h10" }),
53108
- /* @__PURE__ */ jsx175("circle", { cx: "16", cy: "7", r: "2" }),
53109
- /* @__PURE__ */ jsx175("circle", { cx: "8", cy: "17", r: "2" })
53251
+ return /* @__PURE__ */ jsxs164("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
53252
+ /* @__PURE__ */ jsx176("path", { d: "M4 7h10M18 7h2M4 17h2M10 17h10" }),
53253
+ /* @__PURE__ */ jsx176("circle", { cx: "16", cy: "7", r: "2" }),
53254
+ /* @__PURE__ */ jsx176("circle", { cx: "8", cy: "17", r: "2" })
53110
53255
  ] });
53111
53256
  }
53112
53257
  function RailFrame({
53113
53258
  phone,
53114
53259
  title,
53115
53260
  onClose,
53261
+ over = false,
53116
53262
  children
53117
53263
  }) {
53118
53264
  if (phone) {
53119
- return /* @__PURE__ */ jsx175(
53265
+ return /* @__PURE__ */ jsx176(
53120
53266
  BottomSheet,
53121
53267
  {
53122
53268
  open: true,
@@ -53126,11 +53272,19 @@ function RailFrame({
53126
53272
  title,
53127
53273
  size: "full",
53128
53274
  surface: "solid",
53129
- children: /* @__PURE__ */ jsx175("div", { "data-rail-sheet": "", className: "min-h-0 flex-1 overflow-y-auto px-3 pb-6", children })
53275
+ children: /* @__PURE__ */ jsx176("div", { "data-rail-sheet": "", className: "min-h-0 flex-1 overflow-y-auto px-3 pb-6", children })
53130
53276
  }
53131
53277
  );
53132
53278
  }
53133
- return /* @__PURE__ */ jsx175("aside", { "data-rail-column": "", className: "w-[26rem] shrink-0 overflow-y-auto rounded-md border p-3", children });
53279
+ return /* @__PURE__ */ jsx176(
53280
+ "aside",
53281
+ {
53282
+ "data-rail-column": "",
53283
+ "data-rail-over": over ? "" : void 0,
53284
+ className: over ? "w-[26rem] shrink-0" : "w-[26rem] shrink-0 overflow-y-auto rounded-md border p-3",
53285
+ children: over ? /* @__PURE__ */ jsx176("div", { className: "fixed inset-y-0 right-0 z-40 w-[min(48rem,100vw)] overflow-y-auto border-l bg-background p-4 shadow-xl", children }) : children
53286
+ }
53287
+ );
53134
53288
  }
53135
53289
  function filterInWords(filter, fields) {
53136
53290
  const nameOf2 = (key) => {
@@ -53183,17 +53337,17 @@ function TableNotHere({
53183
53337
  alive = false;
53184
53338
  };
53185
53339
  }, [client, tableId]);
53186
- if (archived.phase === "asking") return /* @__PURE__ */ jsx175(Skeleton47, { className: "h-40 w-full" });
53340
+ if (archived.phase === "asking") return /* @__PURE__ */ jsx176(Skeleton47, { className: "h-40 w-full" });
53187
53341
  const row = archived.phase === "answered" ? archived.row : null;
53188
53342
  if (row) {
53189
- return /* @__PURE__ */ jsxs163("div", { className: cn100("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
53190
- /* @__PURE__ */ jsx175("p", { className: "text-sm font-medium", children: "This table is archived" }),
53191
- /* @__PURE__ */ jsx175("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
53192
- /* @__PURE__ */ jsx175("p", { className: "text-xs text-muted-foreground", children: archivedByLine2(row) }),
53193
- refusal3 ? /* @__PURE__ */ jsx175(RefusalNotice, { error: refusal3 }) : null,
53194
- /* @__PURE__ */ jsxs163("div", { className: "flex gap-2", children: [
53195
- /* @__PURE__ */ jsx175(
53196
- Button119,
53343
+ return /* @__PURE__ */ jsxs164("div", { className: cn100("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
53344
+ /* @__PURE__ */ jsx176("p", { className: "text-sm font-medium", children: "This table is archived" }),
53345
+ /* @__PURE__ */ jsx176("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
53346
+ /* @__PURE__ */ jsx176("p", { className: "text-xs text-muted-foreground", children: archivedByLine2(row) }),
53347
+ refusal3 ? /* @__PURE__ */ jsx176(RefusalNotice, { error: refusal3 }) : null,
53348
+ /* @__PURE__ */ jsxs164("div", { className: "flex gap-2", children: [
53349
+ /* @__PURE__ */ jsx176(
53350
+ Button120,
53197
53351
  {
53198
53352
  size: "sm",
53199
53353
  disabled: restoring,
@@ -53211,14 +53365,14 @@ function TableNotHere({
53211
53365
  children: restoring ? "Bringing it back\u2026" : "Bring it back"
53212
53366
  }
53213
53367
  ),
53214
- onLeave ? /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
53368
+ onLeave ? /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
53215
53369
  ] })
53216
53370
  ] });
53217
53371
  }
53218
- return /* @__PURE__ */ jsxs163("div", { className: cn100("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
53219
- /* @__PURE__ */ jsx175("p", { className: "text-sm font-medium", children: "This table is not here" }),
53220
- /* @__PURE__ */ jsx175("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
53221
- onLeave ? /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
53372
+ return /* @__PURE__ */ jsxs164("div", { className: cn100("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
53373
+ /* @__PURE__ */ jsx176("p", { className: "text-sm font-medium", children: "This table is not here" }),
53374
+ /* @__PURE__ */ jsx176("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
53375
+ onLeave ? /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
53222
53376
  ] });
53223
53377
  }
53224
53378
  var TABLE_NOT_REACHABLE = (
@@ -53352,6 +53506,7 @@ function TablePage({
53352
53506
  leaveLabel = "Back to your tables",
53353
53507
  activeDashboardId,
53354
53508
  activeRecordId,
53509
+ onRecordChange,
53355
53510
  activeView,
53356
53511
  onViewChanged,
53357
53512
  activeGroupField,
@@ -53536,11 +53691,30 @@ function TablePage({
53536
53691
  onViewChanged?.(addressForView(view, next));
53537
53692
  void patchView({ layout: next });
53538
53693
  };
53694
+ const reportedRecords = useRef64(/* @__PURE__ */ new Set());
53695
+ const lastActiveRecord = useRef64(activeRecordId ?? null);
53539
53696
  useEffect124(() => {
53540
- if (!activeRecordId) return;
53697
+ const before = lastActiveRecord.current;
53698
+ lastActiveRecord.current = activeRecordId ?? null;
53699
+ if (!activeRecordId) {
53700
+ if (before) setSurface((now) => now.rail === "record" ? { ...now, rail: "none" } : now);
53701
+ return;
53702
+ }
53703
+ if (reportedRecords.current.delete(activeRecordId)) return;
53541
53704
  setOpenRecord(activeRecordId);
53542
53705
  setSurface((now) => ({ ...now, rail: "record" }));
53543
53706
  }, [activeRecordId]);
53707
+ const [shownIds, setShownIds] = useState150([]);
53708
+ const [recordExpanded, setRecordExpanded] = useState150(false);
53709
+ const shownRecord = rail === "record" ? openRecord : null;
53710
+ const reportedRecord = useRef64(activeRecordId ?? null);
53711
+ useEffect124(() => {
53712
+ if (shownRecord === reportedRecord.current) return;
53713
+ const how = shownRecord === null ? "close" : reportedRecord.current === null ? "open" : "step";
53714
+ reportedRecord.current = shownRecord;
53715
+ if (shownRecord) reportedRecords.current.add(shownRecord);
53716
+ onRecordChange?.(shownRecord, how);
53717
+ }, [shownRecord, onRecordChange]);
53544
53718
  useEffect124(() => {
53545
53719
  if (activeRecordId) return;
53546
53720
  const named = railFromParam(activeRail);
@@ -53727,20 +53901,20 @@ function TablePage({
53727
53901
  };
53728
53902
  const footer = footerOf(shown5?.presentation);
53729
53903
  const setFooter = (next) => void patchView({ presentation: { ...shown5?.presentation ?? {}, footer: next } });
53730
- const layoutRadio = /* @__PURE__ */ jsx175(
53904
+ const layoutRadio = /* @__PURE__ */ jsx176(
53731
53905
  DropdownMenuRadioGroup3,
53732
53906
  {
53733
53907
  value: layoutShowing ?? "",
53734
53908
  onValueChange: (value) => {
53735
53909
  if (VIEW_LAYOUTS.includes(value)) pickLayout(value);
53736
53910
  },
53737
- children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx175(DropdownMenuRadioItem3, { value: option, children: LAYOUT_LABEL[option] }, option))
53911
+ children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx176(DropdownMenuRadioItem3, { value: option, children: LAYOUT_LABEL[option] }, option))
53738
53912
  }
53739
53913
  );
53740
- const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs163(Fragment71, { children: [
53741
- /* @__PURE__ */ jsx175("div", { className: "flex items-center gap-2 text-xs", "data-table-sheet-filter": "", "data-matrx-table-tools-keep-open": "", children: /* @__PURE__ */ jsx175(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) }),
53742
- /* @__PURE__ */ jsx175("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx175(
53743
- Button119,
53914
+ const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs164(Fragment71, { children: [
53915
+ /* @__PURE__ */ jsx176("div", { className: "flex items-center gap-2 text-xs", "data-table-sheet-filter": "", "data-matrx-table-tools-keep-open": "", children: /* @__PURE__ */ jsx176(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) }),
53916
+ /* @__PURE__ */ jsx176("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx176(
53917
+ Button120,
53744
53918
  {
53745
53919
  size: "sm",
53746
53920
  variant: layoutShowing === option ? "secondary" : "ghost",
@@ -53751,7 +53925,7 @@ function TablePage({
53751
53925
  },
53752
53926
  option
53753
53927
  )) }),
53754
- rights.share && canShare ? /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
53928
+ rights.share && canShare ? /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
53755
53929
  ] }) : void 0;
53756
53930
  const go = (pressed) => {
53757
53931
  if (!surfaceChosen(surface, pressed)) press(pressed);
@@ -53957,9 +54131,9 @@ function TablePage({
53957
54131
  return () => window.removeEventListener("keydown", onKey);
53958
54132
  }, [recordsUi]);
53959
54133
  const openedFromMenu = openedEntry ? { ...openedEntry, label: actions.find((a) => a.id === openedEntry.id)?.label ?? openedEntry.key } : null;
53960
- const pageActions = /* @__PURE__ */ jsxs163(Fragment71, { children: [
53961
- publicReadOnly ? /* @__PURE__ */ jsx175(Badge26, { variant: "neutral", className: "shrink-0", "data-public-read-only": "", children: PUBLIC_READ_ONLY }, "public-read-only") : null,
53962
- !phone && rights.read && table.data ? /* @__PURE__ */ jsx175(
54134
+ const pageActions = /* @__PURE__ */ jsxs164(Fragment71, { children: [
54135
+ publicReadOnly ? /* @__PURE__ */ jsx176(Badge26, { variant: "neutral", className: "shrink-0", "data-public-read-only": "", children: PUBLIC_READ_ONLY }, "public-read-only") : null,
54136
+ !phone && rights.read && table.data ? /* @__PURE__ */ jsx176(
53963
54137
  TableAsk,
53964
54138
  {
53965
54139
  tableId,
@@ -53971,7 +54145,7 @@ function TablePage({
53971
54145
  },
53972
54146
  "ask"
53973
54147
  ) : null,
53974
- organizationId ? /* @__PURE__ */ jsx175("span", { className: shareInMenu ? "hidden" : "flex shrink-0 items-center", "data-toolbar-fit": "share", children: /* @__PURE__ */ jsx175(
54148
+ organizationId ? /* @__PURE__ */ jsx176("span", { className: shareInMenu ? "hidden" : "flex shrink-0 items-center", "data-toolbar-fit": "share", children: /* @__PURE__ */ jsx176(
53975
54149
  ShareControl,
53976
54150
  {
53977
54151
  kind: "table",
@@ -53985,28 +54159,28 @@ function TablePage({
53985
54159
  },
53986
54160
  `share-${shareAsked}`
53987
54161
  ) }, "share") : null,
53988
- phone ? /* @__PURE__ */ jsxs163(Fragment71, { children: [
53989
- !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs163(DropdownMenu10, { children: [
53990
- /* @__PURE__ */ jsx175(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "ghost", "aria-label": "Layout", title: "Layout", "data-table-layout-menu": "", children: "Layout" }) }),
53991
- /* @__PURE__ */ jsx175(DropdownMenuContent10, { align: "end", className: "w-56", children: layoutRadio })
54162
+ phone ? /* @__PURE__ */ jsxs164(Fragment71, { children: [
54163
+ !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs164(DropdownMenu10, { children: [
54164
+ /* @__PURE__ */ jsx176(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", "aria-label": "Layout", title: "Layout", "data-table-layout-menu": "", children: "Layout" }) }),
54165
+ /* @__PURE__ */ jsx176(DropdownMenuContent10, { align: "end", className: "w-56", children: layoutRadio })
53992
54166
  ] }, "phone-layout") : null,
53993
54167
  phoneTableActions(actions)
53994
- ] }) : /* @__PURE__ */ jsxs163(DropdownMenu10, { children: [
53995
- /* @__PURE__ */ jsx175(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ jsxs163("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
53996
- /* @__PURE__ */ jsx175("circle", { cx: "5", cy: "12", r: "1.75" }),
53997
- /* @__PURE__ */ jsx175("circle", { cx: "12", cy: "12", r: "1.75" }),
53998
- /* @__PURE__ */ jsx175("circle", { cx: "19", cy: "12", r: "1.75" })
54168
+ ] }) : /* @__PURE__ */ jsxs164(DropdownMenu10, { children: [
54169
+ /* @__PURE__ */ jsx176(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ jsxs164("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
54170
+ /* @__PURE__ */ jsx176("circle", { cx: "5", cy: "12", r: "1.75" }),
54171
+ /* @__PURE__ */ jsx176("circle", { cx: "12", cy: "12", r: "1.75" }),
54172
+ /* @__PURE__ */ jsx176("circle", { cx: "19", cy: "12", r: "1.75" })
53999
54173
  ] }) }) }),
54000
- /* @__PURE__ */ jsxs163(DropdownMenuContent10, { align: "end", className: "w-64", "data-table-menu-content": "", ...renameMenuProps, children: [
54001
- !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs163(Fragment71, { children: [
54002
- /* @__PURE__ */ jsx175(DropdownMenuLabel3, { className: "text-xs text-muted-foreground", children: "Layout" }),
54174
+ /* @__PURE__ */ jsxs164(DropdownMenuContent10, { align: "end", className: "w-64", "data-table-menu-content": "", ...renameMenuProps, children: [
54175
+ !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs164(Fragment71, { children: [
54176
+ /* @__PURE__ */ jsx176(DropdownMenuLabel3, { className: "text-xs text-muted-foreground", children: "Layout" }),
54003
54177
  layoutRadio,
54004
- /* @__PURE__ */ jsx175(DropdownMenuSeparator5, {})
54178
+ /* @__PURE__ */ jsx176(DropdownMenuSeparator5, {})
54005
54179
  ] }) : null,
54006
- /* @__PURE__ */ jsx175(ObjectActionMenuItems, { actions })
54180
+ /* @__PURE__ */ jsx176(ObjectActionMenuItems, { actions })
54007
54181
  ] })
54008
54182
  ] }, "menu"),
54009
- moveAsked > 0 && !actionHost?.move ? /* @__PURE__ */ jsx175(
54183
+ moveAsked > 0 && !actionHost?.move ? /* @__PURE__ */ jsx176(
54010
54184
  WhereItLives,
54011
54185
  {
54012
54186
  tableId,
@@ -54019,7 +54193,7 @@ function TablePage({
54019
54193
  },
54020
54194
  "move"
54021
54195
  ) : null,
54022
- breakDownOpen ? /* @__PURE__ */ jsx175(
54196
+ breakDownOpen ? /* @__PURE__ */ jsx176(
54023
54197
  BreakDownDialog,
54024
54198
  {
54025
54199
  tableId,
@@ -54030,7 +54204,7 @@ function TablePage({
54030
54204
  },
54031
54205
  "break-down"
54032
54206
  ) : null,
54033
- subscribeOpen && recordsUi.calendarFeed && organizationId && view ? /* @__PURE__ */ jsx175(
54207
+ subscribeOpen && recordsUi.calendarFeed && organizationId && view ? /* @__PURE__ */ jsx176(
54034
54208
  CalendarSubscribeDialog,
54035
54209
  {
54036
54210
  port: recordsUi.calendarFeed,
@@ -54043,8 +54217,8 @@ function TablePage({
54043
54217
  },
54044
54218
  "subscribe"
54045
54219
  ) : null,
54046
- referenceOpen && table.data ? /* @__PURE__ */ jsx175(TableReferenceDialog, { table: table.data, open: referenceOpen, onOpenChange: setReferenceOpen }, "reference") : null,
54047
- duplicateOpen && table.data ? /* @__PURE__ */ jsx175(
54220
+ referenceOpen && table.data ? /* @__PURE__ */ jsx176(TableReferenceDialog, { table: table.data, open: referenceOpen, onOpenChange: setReferenceOpen }, "reference") : null,
54221
+ duplicateOpen && table.data ? /* @__PURE__ */ jsx176(
54048
54222
  TableDuplicateDialog,
54049
54223
  {
54050
54224
  tableId,
@@ -54055,39 +54229,39 @@ function TablePage({
54055
54229
  },
54056
54230
  "duplicate"
54057
54231
  ) : null,
54058
- rights.structure && table.data ? /* @__PURE__ */ jsx175(TableRenameDialog, { tableId, name: table.data.name, open: renameOpen, onOpenChange: setRenameOpen }, "rename") : null
54232
+ rights.structure && table.data ? /* @__PURE__ */ jsx176(TableRenameDialog, { tableId, name: table.data.name, open: renameOpen, onOpenChange: setRenameOpen }, "rename") : null
54059
54233
  ] });
54060
54234
  const headerNode = header && !embedded ? header({ actions: table.data ? pageActions : null, tableName: table.data?.name ?? null }) : null;
54061
- if (table.error) return /* @__PURE__ */ jsxs163(Fragment71, { children: [
54235
+ if (table.error) return /* @__PURE__ */ jsxs164(Fragment71, { children: [
54062
54236
  headerNode,
54063
- /* @__PURE__ */ jsx175(RefusalNotice, { error: table.error })
54237
+ /* @__PURE__ */ jsx176(RefusalNotice, { error: table.error })
54064
54238
  ] });
54065
54239
  if (table.loading && !table.data) {
54066
- return /* @__PURE__ */ jsxs163(Fragment71, { children: [
54240
+ return /* @__PURE__ */ jsxs164(Fragment71, { children: [
54067
54241
  headerNode,
54068
- /* @__PURE__ */ jsx175(TablePageSkeleton, { layout: skeletonFace, embedded, tableId, ...className ? { className } : {} })
54242
+ /* @__PURE__ */ jsx176(TablePageSkeleton, { layout: skeletonFace, embedded, tableId, ...className ? { className } : {} })
54069
54243
  ] });
54070
54244
  }
54071
54245
  if (!table.data) {
54072
- return /* @__PURE__ */ jsxs163(Fragment71, { children: [
54246
+ return /* @__PURE__ */ jsxs164(Fragment71, { children: [
54073
54247
  headerNode,
54074
- /* @__PURE__ */ jsx175(TableNotHere, { tableId, onLeave, leaveLabel, className })
54248
+ /* @__PURE__ */ jsx176(TableNotHere, { tableId, onLeave, leaveLabel, className })
54075
54249
  ] });
54076
54250
  }
54077
54251
  const lookSavable = Boolean(
54078
54252
  rights.write && view && Object.keys(viewPatchDocument(saveToViewPlan(view, look ?? {}).patch)).length > 0
54079
54253
  );
54080
- return /* @__PURE__ */ jsx175(ViewAddressContext.Provider, { value: addressPort, children: /* @__PURE__ */ jsxs163("div", { className: cn100("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
54254
+ return /* @__PURE__ */ jsx176(ViewAddressContext.Provider, { value: addressPort, children: /* @__PURE__ */ jsxs164("div", { className: cn100("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
54081
54255
  headerNode,
54082
- /* @__PURE__ */ jsx175("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
54256
+ /* @__PURE__ */ jsx176("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
54083
54257
  /* THE TOOLBAR ROW'S HEIGHT IS KEPT (min-h-8), so the sentence lands exactly where the bar was. */
54084
- /* @__PURE__ */ jsxs163(Fragment71, { children: [
54085
- /* @__PURE__ */ jsx175("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "aria-hidden": "true" }),
54086
- structure.hidden ? /* @__PURE__ */ jsx175(StructureLocked, {}) : /* @__PURE__ */ jsx175(RecordsSkeleton, { layout: skeletonFace, embedded })
54258
+ /* @__PURE__ */ jsxs164(Fragment71, { children: [
54259
+ /* @__PURE__ */ jsx176("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "aria-hidden": "true" }),
54260
+ structure.hidden ? /* @__PURE__ */ jsx176(StructureLocked, {}) : /* @__PURE__ */ jsx176(RecordsSkeleton, { layout: skeletonFace, embedded })
54087
54261
  ] })
54088
- ) : /* @__PURE__ */ jsxs163(Fragment71, { children: [
54089
- /* @__PURE__ */ jsx175(ImportNotice, { tableId, epoch: importEpoch, onOpenImport: () => setRail("import") }),
54090
- /* @__PURE__ */ jsxs163(
54262
+ ) : /* @__PURE__ */ jsxs164(Fragment71, { children: [
54263
+ /* @__PURE__ */ jsx176(ImportNotice, { tableId, epoch: importEpoch, onOpenImport: () => setRail("import") }),
54264
+ /* @__PURE__ */ jsxs164(
54091
54265
  "div",
54092
54266
  {
54093
54267
  ref: setToolbarRow,
@@ -54095,7 +54269,7 @@ function TablePage({
54095
54269
  "data-table-toolbar": "",
54096
54270
  "data-table-toolbar-fold": toolbarFold2,
54097
54271
  children: [
54098
- /* @__PURE__ */ jsx175(
54272
+ /* @__PURE__ */ jsx176(
54099
54273
  ViewBar,
54100
54274
  {
54101
54275
  tableId,
@@ -54114,9 +54288,9 @@ function TablePage({
54114
54288
  onViews: setViews,
54115
54289
  ...seededViews && viewsEpoch === 0 ? { initialViews: seededViews } : {},
54116
54290
  seed: seedViews ?? [defaultView(tableId)],
54117
- settings: view && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs163("div", { className: "flex flex-col gap-0.5 px-1 py-1", role: "radiogroup", "aria-label": FOOTER_WORDS.label, children: [
54118
- /* @__PURE__ */ jsx175("span", { className: "px-1 pb-0.5 text-[11px] font-medium text-muted-foreground", children: FOOTER_WORDS.label }),
54119
- ["sticky", "inline"].map((option) => /* @__PURE__ */ jsxs163(
54291
+ settings: view && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs164("div", { className: "flex flex-col gap-0.5 px-1 py-1", role: "radiogroup", "aria-label": FOOTER_WORDS.label, children: [
54292
+ /* @__PURE__ */ jsx176("span", { className: "px-1 pb-0.5 text-[11px] font-medium text-muted-foreground", children: FOOTER_WORDS.label }),
54293
+ ["sticky", "inline"].map((option) => /* @__PURE__ */ jsxs164(
54120
54294
  "button",
54121
54295
  {
54122
54296
  type: "button",
@@ -54129,7 +54303,7 @@ function TablePage({
54129
54303
  ),
54130
54304
  onClick: () => setFooter(option),
54131
54305
  children: [
54132
- /* @__PURE__ */ jsx175(
54306
+ /* @__PURE__ */ jsx176(
54133
54307
  "span",
54134
54308
  {
54135
54309
  "aria-hidden": "true",
@@ -54145,8 +54319,8 @@ function TablePage({
54145
54319
  },
54146
54320
  viewsEpoch
54147
54321
  ),
54148
- chooserInline ? /* @__PURE__ */ jsx175("div", { className: "flex shrink-0 items-center gap-0.5", role: "group", "aria-label": "Layout", "data-toolbar-fit": "chooser", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx175(
54149
- Button119,
54322
+ chooserInline ? /* @__PURE__ */ jsx176("div", { className: "flex shrink-0 items-center gap-0.5", role: "group", "aria-label": "Layout", "data-toolbar-fit": "chooser", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx176(
54323
+ Button120,
54150
54324
  {
54151
54325
  size: "sm",
54152
54326
  variant: layoutShowing === option ? "secondary" : "ghost",
@@ -54160,21 +54334,21 @@ function TablePage({
54160
54334
  /* THE ROW HAD NO ROOM (lane C, review 2026-09-26 D6: the switcher vanished at 1280 px and
54161
54335
  with the record panel open): the chooser folds to ONE button naming the layout that is
54162
54336
  showing — it never leaves the row. */
54163
- /* @__PURE__ */ jsx175("span", { className: "flex shrink-0 items-center", "data-toolbar-fit": "chooser", "data-layout-chooser-compact": "", children: /* @__PURE__ */ jsxs163(DropdownMenu10, { children: [
54164
- /* @__PURE__ */ jsx175(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs163(Button119, { size: "sm", variant: "outline", className: "h-8 gap-1 px-2 text-xs", "aria-label": `Layout: ${layoutShowingLabel ?? "none"}`, children: [
54337
+ /* @__PURE__ */ jsx176("span", { className: "flex shrink-0 items-center", "data-toolbar-fit": "chooser", "data-layout-chooser-compact": "", children: /* @__PURE__ */ jsxs164(DropdownMenu10, { children: [
54338
+ /* @__PURE__ */ jsx176(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs164(Button120, { size: "sm", variant: "outline", className: "h-8 gap-1 px-2 text-xs", "aria-label": `Layout: ${layoutShowingLabel ?? "none"}`, children: [
54165
54339
  layoutShowingLabel ?? "Layout",
54166
- /* @__PURE__ */ jsx175("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5 opacity-70", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ jsx175("path", { d: "m6 9 6 6 6-6" }) })
54340
+ /* @__PURE__ */ jsx176("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5 opacity-70", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ jsx176("path", { d: "m6 9 6 6 6-6" }) })
54167
54341
  ] }) }),
54168
- /* @__PURE__ */ jsxs163(DropdownMenuContent10, { align: "start", className: "w-44", "data-layout-chooser-menu": "", children: [
54169
- /* @__PURE__ */ jsx175(DropdownMenuLabel3, { className: "text-xs text-muted-foreground", children: "Layout" }),
54342
+ /* @__PURE__ */ jsxs164(DropdownMenuContent10, { align: "start", className: "w-44", "data-layout-chooser-menu": "", children: [
54343
+ /* @__PURE__ */ jsx176(DropdownMenuLabel3, { className: "text-xs text-muted-foreground", children: "Layout" }),
54170
54344
  layoutRadio
54171
54345
  ] })
54172
54346
  ] }) })
54173
54347
  ) : null,
54174
- main === "records" && !(controlsInSheet && shownLayout === "grid") ? /* @__PURE__ */ jsx175(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) : null,
54175
- lookShowing && main === "records" && !namingLook ? /* @__PURE__ */ jsxs163("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-view-look-folded": "", "data-toolbar-fit": "look", children: [
54176
- /* @__PURE__ */ jsx175(
54177
- Button119,
54348
+ main === "records" && !(controlsInSheet && shownLayout === "grid") ? /* @__PURE__ */ jsx176(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) : null,
54349
+ lookShowing && main === "records" && !namingLook ? /* @__PURE__ */ jsxs164("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-view-look-folded": "", "data-toolbar-fit": "look", children: [
54350
+ /* @__PURE__ */ jsx176(
54351
+ Button120,
54178
54352
  {
54179
54353
  size: "sm",
54180
54354
  variant: "outline",
@@ -54183,36 +54357,36 @@ function TablePage({
54183
54357
  "aria-label": "Reset view",
54184
54358
  onClick: () => void resetLook(),
54185
54359
  "data-view-look-reset-button": "",
54186
- children: /* @__PURE__ */ jsxs163("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
54187
- /* @__PURE__ */ jsx175("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
54188
- /* @__PURE__ */ jsx175("path", { d: "M3 3v5h5" })
54360
+ children: /* @__PURE__ */ jsxs164("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
54361
+ /* @__PURE__ */ jsx176("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
54362
+ /* @__PURE__ */ jsx176("path", { d: "M3 3v5h5" })
54189
54363
  ] })
54190
54364
  }
54191
54365
  ),
54192
- /* @__PURE__ */ jsxs163(DropdownMenu10, { children: [
54193
- /* @__PURE__ */ jsx175(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs163(Button119, { size: "sm", variant: "outline", className: "relative h-8 w-8 shrink-0 px-0", title: LOOK_WORDS.folded, "aria-label": LOOK_WORDS.folded, "data-view-look-menu": "", children: [
54194
- /* @__PURE__ */ jsx175(LookGlyph, {}),
54195
- /* @__PURE__ */ jsx175("span", { "aria-hidden": "true", className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-primary" })
54366
+ /* @__PURE__ */ jsxs164(DropdownMenu10, { children: [
54367
+ /* @__PURE__ */ jsx176(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs164(Button120, { size: "sm", variant: "outline", className: "relative h-8 w-8 shrink-0 px-0", title: LOOK_WORDS.folded, "aria-label": LOOK_WORDS.folded, "data-view-look-menu": "", children: [
54368
+ /* @__PURE__ */ jsx176(LookGlyph, {}),
54369
+ /* @__PURE__ */ jsx176("span", { "aria-hidden": "true", className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-primary" })
54196
54370
  ] }) }),
54197
- /* @__PURE__ */ jsxs163(DropdownMenuContent10, { align: "start", className: "w-60", "data-view-look-menu-content": "", children: [
54198
- lookSavable ? /* @__PURE__ */ jsx175(DropdownMenuItem8, { onSelect: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
54199
- rights.write ? /* @__PURE__ */ jsx175(DropdownMenuItem8, { onSelect: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
54200
- /* @__PURE__ */ jsx175(DropdownMenuItem8, { onSelect: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
54371
+ /* @__PURE__ */ jsxs164(DropdownMenuContent10, { align: "start", className: "w-60", "data-view-look-menu-content": "", children: [
54372
+ lookSavable ? /* @__PURE__ */ jsx176(DropdownMenuItem8, { onSelect: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
54373
+ rights.write ? /* @__PURE__ */ jsx176(DropdownMenuItem8, { onSelect: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
54374
+ /* @__PURE__ */ jsx176(DropdownMenuItem8, { onSelect: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
54201
54375
  ] })
54202
54376
  ] })
54203
54377
  ] }) : !lookShowing && main === "records" && view && !phone && !controlsInSheet ? (
54204
54378
  /* The reserved place keeps its full width at every row width (STABLE-TABLES): when it
54205
54379
  shrank on a narrow row, the look arriving on a sort pushed every control after it.
54206
54380
  A row too narrow for it scrolls sideways, as the row already does. */
54207
- /* @__PURE__ */ jsxs163("span", { "aria-hidden": "true", className: "invisible flex shrink-0 items-center gap-1 overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: [
54208
- /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1, children: /* @__PURE__ */ jsx175(LookGlyph, {}) }),
54209
- /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1 })
54381
+ /* @__PURE__ */ jsxs164("span", { "aria-hidden": "true", className: "invisible flex shrink-0 items-center gap-1 overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: [
54382
+ /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1, children: /* @__PURE__ */ jsx176(LookGlyph, {}) }),
54383
+ /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1 })
54210
54384
  ] })
54211
- ) : lookShowing && main === "records" ? /* @__PURE__ */ jsxs163("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-toolbar-fit": "look", title: LOOK_WORDS.yours, children: [
54212
- /* @__PURE__ */ jsx175("span", { className: "sr-only", children: LOOK_WORDS.yours }),
54213
- /* @__PURE__ */ jsx175("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary" }),
54214
- lookSavable ? /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", className: "h-8 px-2 text-xs", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
54215
- rights.write ? namingLook ? /* @__PURE__ */ jsxs163(
54385
+ ) : lookShowing && main === "records" ? /* @__PURE__ */ jsxs164("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-toolbar-fit": "look", title: LOOK_WORDS.yours, children: [
54386
+ /* @__PURE__ */ jsx176("span", { className: "sr-only", children: LOOK_WORDS.yours }),
54387
+ /* @__PURE__ */ jsx176("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary" }),
54388
+ lookSavable ? /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", className: "h-8 px-2 text-xs", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
54389
+ rights.write ? namingLook ? /* @__PURE__ */ jsxs164(
54216
54390
  "form",
54217
54391
  {
54218
54392
  className: "flex items-center gap-1",
@@ -54221,7 +54395,7 @@ function TablePage({
54221
54395
  void saveLookAsNewView(lookName);
54222
54396
  },
54223
54397
  children: [
54224
- /* @__PURE__ */ jsx175(
54398
+ /* @__PURE__ */ jsx176(
54225
54399
  Input12,
54226
54400
  {
54227
54401
  autoFocus: true,
@@ -54232,13 +54406,13 @@ function TablePage({
54232
54406
  placeholder: "View name"
54233
54407
  }
54234
54408
  ),
54235
- /* @__PURE__ */ jsx175(Button119, { size: "sm", type: "submit", className: "h-8 px-2 text-xs", disabled: lookName.trim() === "", children: "Save" })
54409
+ /* @__PURE__ */ jsx176(Button120, { size: "sm", type: "submit", className: "h-8 px-2 text-xs", disabled: lookName.trim() === "", children: "Save" })
54236
54410
  ]
54237
54411
  }
54238
- ) : /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
54239
- /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
54412
+ ) : /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
54413
+ /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
54240
54414
  ] }) : null,
54241
- /* @__PURE__ */ jsx175(
54415
+ /* @__PURE__ */ jsx176(
54242
54416
  "div",
54243
54417
  {
54244
54418
  ref: setToolbarSlot,
@@ -54260,9 +54434,9 @@ function TablePage({
54260
54434
  "data-clipped": slotClipped
54261
54435
  }
54262
54436
  ),
54263
- rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ jsx175(Button119, { size: "sm", className: "shrink-0", onClick: () => show("new-record"), children: "New record" }) : null,
54264
- openedFromMenu ? /* @__PURE__ */ jsx175(
54265
- Button119,
54437
+ rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ jsx176(Button120, { size: "sm", className: "shrink-0", onClick: () => show("new-record"), children: "New record" }) : null,
54438
+ openedFromMenu ? /* @__PURE__ */ jsx176(
54439
+ Button120,
54266
54440
  {
54267
54441
  size: "sm",
54268
54442
  variant: "secondary",
@@ -54274,19 +54448,19 @@ function TablePage({
54274
54448
  children: openedFromMenu.label
54275
54449
  }
54276
54450
  ) : null,
54277
- header ? null : /* @__PURE__ */ jsx175("span", { className: "flex shrink-0 items-center gap-1", "data-table-page-actions": "", children: pageActions })
54451
+ header ? null : /* @__PURE__ */ jsx176("span", { className: "flex shrink-0 items-center gap-1", "data-table-page-actions": "", children: pageActions })
54278
54452
  ]
54279
54453
  }
54280
54454
  ),
54281
- designateRefused ? /* @__PURE__ */ jsx175(RefusalNotice, { error: designateRefused }) : null,
54282
- viewSaveRefused ? /* @__PURE__ */ jsx175(
54455
+ designateRefused ? /* @__PURE__ */ jsx176(RefusalNotice, { error: designateRefused }) : null,
54456
+ viewSaveRefused ? /* @__PURE__ */ jsx176(
54283
54457
  RefusalNotice,
54284
54458
  {
54285
54459
  error: viewSaveRefused.error,
54286
- actions: /* @__PURE__ */ jsxs163("span", { className: "flex flex-wrap gap-1 pt-0.5", "data-view-save-refused": "", children: [
54287
- /* @__PURE__ */ jsx175(Button119, { size: "sm", variant: "outline", onClick: () => void patchView(viewSaveRefused.patch), children: "Try again" }),
54288
- /* @__PURE__ */ jsx175(
54289
- Button119,
54460
+ actions: /* @__PURE__ */ jsxs164("span", { className: "flex flex-wrap gap-1 pt-0.5", "data-view-save-refused": "", children: [
54461
+ /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "outline", onClick: () => void patchView(viewSaveRefused.patch), children: "Try again" }),
54462
+ /* @__PURE__ */ jsx176(
54463
+ Button120,
54290
54464
  {
54291
54465
  size: "sm",
54292
54466
  variant: "ghost",
@@ -54306,8 +54480,8 @@ function TablePage({
54306
54480
  ] })
54307
54481
  }
54308
54482
  ) : null,
54309
- lookRefused ? /* @__PURE__ */ jsx175(RefusalNotice, { error: lookRefused }) : null,
54310
- main === "dashboards" ? /* @__PURE__ */ jsx175(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "questions" ? /* @__PURE__ */ jsx175(
54483
+ lookRefused ? /* @__PURE__ */ jsx176(RefusalNotice, { error: lookRefused }) : null,
54484
+ main === "dashboards" ? /* @__PURE__ */ jsx176(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "questions" ? /* @__PURE__ */ jsx176(
54311
54485
  QuestionPanel,
54312
54486
  {
54313
54487
  tableId,
@@ -54319,7 +54493,7 @@ function TablePage({
54319
54493
  page returns to the records rather than leaving the person looking
54320
54494
  at a list the record is no longer in — and opens it, because the
54321
54495
  thing they just rescued is the thing they came for. */
54322
- /* @__PURE__ */ jsx175(
54496
+ /* @__PURE__ */ jsx176(
54323
54497
  ArchivedView,
54324
54498
  {
54325
54499
  tableId,
@@ -54331,7 +54505,7 @@ function TablePage({
54331
54505
  }
54332
54506
  }
54333
54507
  )
54334
- ) : /* @__PURE__ */ jsx175(TableToolbarSlotContext.Provider, { value: toolbarSlot, children: /* @__PURE__ */ jsx175(TableToolbarFoldContext.Provider, { value: toolbarFold2, children: /* @__PURE__ */ jsx175(TableToolbarSheetExtrasContext.Provider, { value: sheetExtras, children: /* @__PURE__ */ jsxs163(
54508
+ ) : /* @__PURE__ */ jsx176(TableToolbarSlotContext.Provider, { value: toolbarSlot, children: /* @__PURE__ */ jsx176(TableToolbarFoldContext.Provider, { value: toolbarFold2, children: /* @__PURE__ */ jsx176(TableToolbarSheetExtrasContext.Provider, { value: sheetExtras, children: /* @__PURE__ */ jsxs164(
54335
54509
  "div",
54336
54510
  {
54337
54511
  className: cn100(
@@ -54342,10 +54516,10 @@ function TablePage({
54342
54516
  ),
54343
54517
  "data-table-records": "",
54344
54518
  children: [
54345
- railUnknown ? /* @__PURE__ */ jsx175("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: unknownRailLine(railUnknown) }) : null,
54346
- shareFromLink && rights.known && (!rights.share || !canShare) ? /* @__PURE__ */ jsx175("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: canShare ? SHARE_NOT_YOURS_LINE : shareUnavailableReason() }) : null,
54347
- opened.unknown ? /* @__PURE__ */ jsx175("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: unknownViewLine(opened.unknown) }) : null,
54348
- viewLinkMissed ? /* @__PURE__ */ jsx175(
54519
+ railUnknown ? /* @__PURE__ */ jsx176("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: unknownRailLine(railUnknown) }) : null,
54520
+ shareFromLink && rights.known && (!rights.share || !canShare) ? /* @__PURE__ */ jsx176("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: canShare ? SHARE_NOT_YOURS_LINE : shareUnavailableReason() }) : null,
54521
+ opened.unknown ? /* @__PURE__ */ jsx176("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: unknownViewLine(opened.unknown) }) : null,
54522
+ viewLinkMissed ? /* @__PURE__ */ jsx176(
54349
54523
  "p",
54350
54524
  {
54351
54525
  "data-records-view-link-missed": "",
@@ -54353,7 +54527,7 @@ function TablePage({
54353
54527
  children: unknownSavedViewLine(view?.name ?? null)
54354
54528
  }
54355
54529
  ) : null,
54356
- cameFrom ? /* @__PURE__ */ jsx175(
54530
+ cameFrom ? /* @__PURE__ */ jsx176(
54357
54531
  "p",
54358
54532
  {
54359
54533
  "data-testid": "came-from-a-number",
@@ -54363,7 +54537,7 @@ function TablePage({
54363
54537
  ) : null,
54364
54538
  faceUnknown ? (
54365
54539
  /* REVIEW-FIX 10: a full page paints the rows this table showed last time (else fills). */
54366
- /* @__PURE__ */ jsx175(
54540
+ /* @__PURE__ */ jsx176(
54367
54541
  RecordsSkeleton,
54368
54542
  {
54369
54543
  layout: skeletonFace,
@@ -54371,7 +54545,7 @@ function TablePage({
54371
54545
  ...embedded ? {} : { rows: rememberedRowCount(`${tableId}:page:last`, 100, "fill") }
54372
54546
  }
54373
54547
  )
54374
- ) : /* @__PURE__ */ jsx175(
54548
+ ) : /* @__PURE__ */ jsx176(
54375
54549
  ViewSwitcher,
54376
54550
  {
54377
54551
  chooser: false,
@@ -54413,19 +54587,20 @@ function TablePage({
54413
54587
  },
54414
54588
  openRecordId: rail === "record" ? openRecord : null,
54415
54589
  onCloseRecord: () => setRail("none"),
54590
+ onRowsShown: setShownIds,
54416
54591
  onAskWhoChanged: (fieldKey, recordId) => {
54417
54592
  setAsking({ fieldKey, recordId });
54418
54593
  setRail("who-changed");
54419
54594
  }
54420
54595
  }
54421
54596
  ),
54422
- view || faceUnknown || views === void 0 || views !== null && views.length > 0 ? null : /* @__PURE__ */ jsx175("p", { className: "text-xs text-muted-foreground", children: VIEW_NOT_SAVED_YET })
54597
+ view || faceUnknown || views === void 0 || views !== null && views.length > 0 ? null : /* @__PURE__ */ jsx176("p", { className: "text-xs text-muted-foreground", children: VIEW_NOT_SAVED_YET })
54423
54598
  ]
54424
54599
  }
54425
54600
  ) }) }) })
54426
54601
  ] }) }),
54427
- rail === "none" ? null : /* @__PURE__ */ jsxs163(RailFrame, { phone, title: RAIL_TITLE[rail], onClose: () => setRail("none"), children: [
54428
- rail === "settings" ? /* @__PURE__ */ jsx175(
54602
+ rail === "none" ? null : /* @__PURE__ */ jsxs164(RailFrame, { phone, title: RAIL_TITLE[rail], onClose: () => setRail("none"), over: rail === "record" && recordExpanded, children: [
54603
+ rail === "settings" ? /* @__PURE__ */ jsx176(
54429
54604
  TableSettings,
54430
54605
  {
54431
54606
  tableId,
@@ -54442,7 +54617,7 @@ function TablePage({
54442
54617
  } : void 0
54443
54618
  }
54444
54619
  ) : null,
54445
- rail === "inbox" ? /* @__PURE__ */ jsx175(
54620
+ rail === "inbox" ? /* @__PURE__ */ jsx176(
54446
54621
  ActionInbox,
54447
54622
  {
54448
54623
  tableId,
@@ -54452,9 +54627,9 @@ function TablePage({
54452
54627
  }
54453
54628
  }
54454
54629
  ) : null,
54455
- rail === "forms" ? /* @__PURE__ */ jsx175(FormsPanel, { tableId, activeFormId: itemFor("forms") }) : null,
54456
- rail === "bookings" ? /* @__PURE__ */ jsx175(BookingSlots, { tableId, activeBookingId: itemFor("bookings") }) : null,
54457
- rail === "checklists" ? /* @__PURE__ */ jsx175(
54630
+ rail === "forms" ? /* @__PURE__ */ jsx176(FormsPanel, { tableId, activeFormId: itemFor("forms") }) : null,
54631
+ rail === "bookings" ? /* @__PURE__ */ jsx176(BookingSlots, { tableId, activeBookingId: itemFor("bookings") }) : null,
54632
+ rail === "checklists" ? /* @__PURE__ */ jsx176(
54458
54633
  ChecklistsPanel,
54459
54634
  {
54460
54635
  tableId,
@@ -54464,12 +54639,12 @@ function TablePage({
54464
54639
  }
54465
54640
  }
54466
54641
  ) : null,
54467
- rail === "notifications" ? /* @__PURE__ */ jsx175(SubscriptionsPanel, { tableId, activeRuleId: itemFor("notifications") }) : null,
54468
- rail === "portals" ? /* @__PURE__ */ jsx175(PortalsPanel, { tableId, activePortalId: itemFor("portals") }) : null,
54469
- rail === "export" ? /* @__PURE__ */ jsx175(ExportMenu, { tableId, view: viewReading }) : null,
54470
- rail === "import" ? /* @__PURE__ */ jsx175(ImportWizard, { tableId, onWrote: () => setImportEpoch((n) => n + 1), onDone: () => setRail("none") }) : null,
54471
- rail === "field" ? /* @__PURE__ */ jsx175(FieldEditor, { tableId, onSaved: () => setRail("none"), onCancel: () => setRail("none") }) : null,
54472
- rail === "new-record" ? /* @__PURE__ */ jsx175(
54642
+ rail === "notifications" ? /* @__PURE__ */ jsx176(SubscriptionsPanel, { tableId, activeRuleId: itemFor("notifications") }) : null,
54643
+ rail === "portals" ? /* @__PURE__ */ jsx176(PortalsPanel, { tableId, activePortalId: itemFor("portals") }) : null,
54644
+ rail === "export" ? /* @__PURE__ */ jsx176(ExportMenu, { tableId, view: viewReading }) : null,
54645
+ rail === "import" ? /* @__PURE__ */ jsx176(ImportWizard, { tableId, onWrote: () => setImportEpoch((n) => n + 1), onDone: () => setRail("none") }) : null,
54646
+ rail === "field" ? /* @__PURE__ */ jsx176(FieldEditor, { tableId, onSaved: () => setRail("none"), onCancel: () => setRail("none") }) : null,
54647
+ rail === "new-record" ? /* @__PURE__ */ jsx176(
54473
54648
  RecordForm,
54474
54649
  {
54475
54650
  tableId,
@@ -54480,7 +54655,7 @@ function TablePage({
54480
54655
  onCancel: () => setRail("none")
54481
54656
  }
54482
54657
  ) : null,
54483
- rail === "who-changed" && asking ? /* @__PURE__ */ jsx175(
54658
+ rail === "who-changed" && asking ? /* @__PURE__ */ jsx176(
54484
54659
  FieldHistoryPanel,
54485
54660
  {
54486
54661
  tableId,
@@ -54493,12 +54668,16 @@ function TablePage({
54493
54668
  }
54494
54669
  }
54495
54670
  ) : null,
54496
- rail === "record" && openRecord ? /* @__PURE__ */ jsx175(
54671
+ rail === "record" && openRecord ? /* @__PURE__ */ jsx176(
54497
54672
  RecordPanel,
54498
54673
  {
54499
54674
  tableId,
54500
54675
  recordId: openRecord,
54501
54676
  onClose: () => setRail("none"),
54677
+ neighbors: neighborsOf(shownIds, openRecord),
54678
+ onStep: (to) => setOpenRecord(to),
54679
+ expanded: recordExpanded,
54680
+ onToggleExpand: () => setRecordExpanded((now) => !now),
54502
54681
  onAskAboutField: (fieldKey) => {
54503
54682
  setAsking({ fieldKey, recordId: openRecord });
54504
54683
  setRail("who-changed");
@@ -54540,9 +54719,9 @@ import { formatCount as formatCount8 } from "@ai-matrx/kit/format";
54540
54719
  import { TapTargetSearchGroup as TapTargetSearchGroup2, TooltipProvider } from "@ai-matrx/design-system";
54541
54720
  import { MatrxTableCardShowMore as MatrxTableCardShowMore3 } from "@ai-matrx/design-system/data-table";
54542
54721
  import { useEffect as useEffect125, useMemo as useMemo83, useRef as useRef65, useState as useState151 } from "react";
54543
- import { Button as Button120, ErrorBox as ErrorBox9, Input as Input13, cn as cn101 } from "@ai-matrx/design-system";
54722
+ import { Button as Button121, ErrorBox as ErrorBox9, Input as Input13, cn as cn101 } from "@ai-matrx/design-system";
54544
54723
  import { SEED_FRESH_MS, useRecordsClient as useRecordsClient107, useSeededAnswerAt } from "@ai-matrx/records/react";
54545
- import { Fragment as Fragment72, jsx as jsx176, jsxs as jsxs164 } from "react/jsx-runtime";
54724
+ import { Fragment as Fragment72, jsx as jsx177, jsxs as jsxs165 } from "react/jsx-runtime";
54546
54725
  var entityTitleColumn = entityNameColumn;
54547
54726
  function shown4(v) {
54548
54727
  if (v === null || v === void 0 || v === "") return "";
@@ -54558,9 +54737,9 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
54558
54737
  );
54559
54738
  const [refused, setRefused] = useState151(null);
54560
54739
  const [over, setOver] = useState151(null);
54561
- if (entity.error) return /* @__PURE__ */ jsx176("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This board could not be read: ${entity.error}` });
54740
+ if (entity.error) return /* @__PURE__ */ jsx177("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This board could not be read: ${entity.error}` });
54562
54741
  if (!entity.loading && !column) {
54563
- return /* @__PURE__ */ jsx176("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `${entity.label ?? "This table"} has no choice column to make a board of.` });
54742
+ return /* @__PURE__ */ jsx177("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `${entity.label ?? "This table"} has no choice column to make a board of.` });
54564
54743
  }
54565
54744
  if (!column) return null;
54566
54745
  const words2 = column.choices ?? [];
@@ -54578,10 +54757,10 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
54578
54757
  const says = await entity.update(id, column, to);
54579
54758
  if (says) setRefused({ to, says });
54580
54759
  };
54581
- return /* @__PURE__ */ jsx176("div", { className: cn101("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.key, children: lanes.map((lane) => {
54760
+ return /* @__PURE__ */ jsx177("div", { className: cn101("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.key, children: lanes.map((lane) => {
54582
54761
  const cards = rowsOf2(lane.key);
54583
54762
  if (lane.key === "" && cards.length === 0) return null;
54584
- return /* @__PURE__ */ jsxs164(
54763
+ return /* @__PURE__ */ jsxs165(
54585
54764
  "section",
54586
54765
  {
54587
54766
  "aria-label": lane.label,
@@ -54593,12 +54772,12 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
54593
54772
  onDragLeave: writable && lane.key ? () => setOver((o) => o === lane.key ? null : o) : void 0,
54594
54773
  onDrop: writable && lane.key ? (e) => void drop(e, lane.key) : void 0,
54595
54774
  children: [
54596
- /* @__PURE__ */ jsxs164("header", { className: "flex items-baseline gap-1.5 px-1 text-xs", children: [
54597
- /* @__PURE__ */ jsx176("span", { className: "truncate font-medium", children: lane.label }),
54598
- /* @__PURE__ */ jsx176("span", { className: "tabular-nums text-muted-foreground", children: cards.length })
54775
+ /* @__PURE__ */ jsxs165("header", { className: "flex items-baseline gap-1.5 px-1 text-xs", children: [
54776
+ /* @__PURE__ */ jsx177("span", { className: "truncate font-medium", children: lane.label }),
54777
+ /* @__PURE__ */ jsx177("span", { className: "tabular-nums text-muted-foreground", children: cards.length })
54599
54778
  ] }),
54600
- refused && refused.to === lane.key ? /* @__PURE__ */ jsx176(ErrorBox9, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: refused.says, operation: "Move a card", origin: "records-ui/entityViews" }) : null,
54601
- cards.map((row) => /* @__PURE__ */ jsxs164(
54779
+ refused && refused.to === lane.key ? /* @__PURE__ */ jsx177(ErrorBox9, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: refused.says, operation: "Move a card", origin: "records-ui/entityViews" }) : null,
54780
+ cards.map((row) => /* @__PURE__ */ jsxs165(
54602
54781
  "article",
54603
54782
  {
54604
54783
  draggable: writable,
@@ -54609,8 +54788,8 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
54609
54788
  className: cn101("flex flex-col gap-0.5 rounded border bg-card px-2 py-1.5 text-xs shadow-sm", writable && "cursor-grab"),
54610
54789
  "data-records-entity-card": row._id,
54611
54790
  children: [
54612
- onOpenRecord ? /* @__PURE__ */ jsx176("button", { type: "button", className: "truncate text-left font-medium hover:underline", onClick: () => onOpenRecord(row._id), children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }) : /* @__PURE__ */ jsx176("span", { className: "truncate font-medium", children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }),
54613
- extra.map((c) => entityValueText(c, entityCellValue(row, c)) ? /* @__PURE__ */ jsx176("span", { className: "truncate text-muted-foreground", children: entityValueText(c, entityCellValue(row, c)) }, c.key) : null)
54791
+ onOpenRecord ? /* @__PURE__ */ jsx177("button", { type: "button", className: "truncate text-left font-medium hover:underline", onClick: () => onOpenRecord(row._id), children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }) : /* @__PURE__ */ jsx177("span", { className: "truncate font-medium", children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }),
54792
+ extra.map((c) => entityValueText(c, entityCellValue(row, c)) ? /* @__PURE__ */ jsx177("span", { className: "truncate text-muted-foreground", children: entityValueText(c, entityCellValue(row, c)) }, c.key) : null)
54614
54793
  ]
54615
54794
  },
54616
54795
  row._id
@@ -54661,9 +54840,9 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
54661
54840
  };
54662
54841
  }, [client, ask2, kind, title]);
54663
54842
  if (!block) {
54664
- return /* @__PURE__ */ jsx176(RecordsSkeleton, { layout: "chart", embedded: variant === "bare", ...className ? { className } : {} });
54843
+ return /* @__PURE__ */ jsx177(RecordsSkeleton, { layout: "chart", embedded: variant === "bare", ...className ? { className } : {} });
54665
54844
  }
54666
- return /* @__PURE__ */ jsx176(
54845
+ return /* @__PURE__ */ jsx177(
54667
54846
  ChartBlock,
54668
54847
  {
54669
54848
  block,
@@ -54676,7 +54855,7 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
54676
54855
  );
54677
54856
  }
54678
54857
  function EntityTablePage(props) {
54679
- return /* @__PURE__ */ jsx176(EntityDataScope, { children: /* @__PURE__ */ jsx176(EntityTablePageBody, { ...props }) });
54858
+ return /* @__PURE__ */ jsx177(EntityDataScope, { children: /* @__PURE__ */ jsx177(EntityTablePageBody, { ...props }) });
54680
54859
  }
54681
54860
  function EntityTablePageBody({
54682
54861
  source,
@@ -54726,20 +54905,20 @@ function EntityTablePageBody({
54726
54905
  rowNoun: (entity.label ?? "record").toLowerCase(),
54727
54906
  enabled: layout === "grid"
54728
54907
  });
54729
- return /* @__PURE__ */ jsxs164("div", { className: cn101("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
54730
- presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ jsxs164("div", { className: "flex min-w-0 items-center gap-2", children: [
54731
- presentation === "page" ? /* @__PURE__ */ jsx176("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
54732
- presentation === "page" ? /* @__PURE__ */ jsx176("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : formatCount8(entity.total) }) : null,
54733
- /* @__PURE__ */ jsxs164("span", { className: "ml-auto flex items-center gap-1", children: [
54734
- boardable ? /* @__PURE__ */ jsxs164(Fragment72, { children: [
54735
- /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
54736
- /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
54908
+ return /* @__PURE__ */ jsxs165("div", { className: cn101("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
54909
+ presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ jsxs165("div", { className: "flex min-w-0 items-center gap-2", children: [
54910
+ presentation === "page" ? /* @__PURE__ */ jsx177("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
54911
+ presentation === "page" ? /* @__PURE__ */ jsx177("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : formatCount8(entity.total) }) : null,
54912
+ /* @__PURE__ */ jsxs165("span", { className: "ml-auto flex items-center gap-1", children: [
54913
+ boardable ? /* @__PURE__ */ jsxs165(Fragment72, { children: [
54914
+ /* @__PURE__ */ jsx177(Button121, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
54915
+ /* @__PURE__ */ jsx177(Button121, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
54737
54916
  ] }) : null,
54738
- entity.creatable && naming === null ? /* @__PURE__ */ jsx176(Button120, { size: "sm", variant: "ghost", onClick: () => {
54917
+ entity.creatable && naming === null ? /* @__PURE__ */ jsx177(Button121, { size: "sm", variant: "ghost", onClick: () => {
54739
54918
  setAddRefused(null);
54740
54919
  setNaming("");
54741
54920
  }, children: "New page" }) : null,
54742
- entity.creatable && naming !== null ? /* @__PURE__ */ jsx176(
54921
+ entity.creatable && naming !== null ? /* @__PURE__ */ jsx177(
54743
54922
  Input13,
54744
54923
  {
54745
54924
  autoFocus: true,
@@ -54769,9 +54948,9 @@ function EntityTablePageBody({
54769
54948
  actions
54770
54949
  ] })
54771
54950
  ] }) : null,
54772
- addRefused ? /* @__PURE__ */ jsx176(ErrorBox9, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: addRefused, operation: "Add a row", origin: "records-ui/entityViews" }) : null,
54773
- entity.error ? /* @__PURE__ */ jsx176("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ jsx176(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ jsxs164(Fragment72, { children: [
54774
- presentation === "embedded" && searchBox ? /* @__PURE__ */ jsx176("div", { className: "flex min-w-0 items-center justify-end", "data-records-entity-search": "", children: /* @__PURE__ */ jsx176(TooltipProvider, { children: /* @__PURE__ */ jsx176(
54951
+ addRefused ? /* @__PURE__ */ jsx177(ErrorBox9, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: addRefused, operation: "Add a row", origin: "records-ui/entityViews" }) : null,
54952
+ entity.error ? /* @__PURE__ */ jsx177("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ jsx177(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ jsxs165(Fragment72, { children: [
54953
+ presentation === "embedded" && searchBox ? /* @__PURE__ */ jsx177("div", { className: "flex min-w-0 items-center justify-end", "data-records-entity-search": "", children: /* @__PURE__ */ jsx177(TooltipProvider, { children: /* @__PURE__ */ jsx177(
54775
54954
  TapTargetSearchGroup2,
54776
54955
  {
54777
54956
  surface: "solid",
@@ -54783,8 +54962,8 @@ function EntityTablePageBody({
54783
54962
  }
54784
54963
  }
54785
54964
  ) }) }) : null,
54786
- /* @__PURE__ */ jsx176(EntityGrid, { entity, pageSize, embedded: presentation === "embedded", ...drill ? { drill } : {} }),
54787
- entity.hasMore ? /* @__PURE__ */ jsx176(
54965
+ /* @__PURE__ */ jsx177(EntityGrid, { entity, pageSize, embedded: presentation === "embedded", ...drill ? { drill } : {} }),
54966
+ entity.hasMore ? /* @__PURE__ */ jsx177(
54788
54967
  MatrxTableCardShowMore3,
54789
54968
  {
54790
54969
  shown: entity.rows.length,
@@ -54798,12 +54977,12 @@ function EntityTablePageBody({
54798
54977
  }
54799
54978
 
54800
54979
  // src/TablePageSource.tsx
54801
- import { jsx as jsx177 } from "react/jsx-runtime";
54980
+ import { jsx as jsx178 } from "react/jsx-runtime";
54802
54981
  function TablePage2(props) {
54803
- if (props.source === void 0) return /* @__PURE__ */ jsx177(TablePage, { ...props });
54982
+ if (props.source === void 0) return /* @__PURE__ */ jsx178(TablePage, { ...props });
54804
54983
  const { source, layout, onLayoutChange, groupBy, onOpenRecord, ...rest } = props;
54805
- if (source.kind === "table") return /* @__PURE__ */ jsx177(TablePage, { ...rest, tableId: source.id });
54806
- return /* @__PURE__ */ jsx177(
54984
+ if (source.kind === "table") return /* @__PURE__ */ jsx178(TablePage, { ...rest, tableId: source.id });
54985
+ return /* @__PURE__ */ jsx178(
54807
54986
  EntityTablePage,
54808
54987
  {
54809
54988
  source,
@@ -54825,8 +55004,8 @@ function TablePage2(props) {
54825
55004
  import { useEffect as useEffect126, useMemo as useMemo84 } from "react";
54826
55005
  import { isEntityReferenceConfig } from "@ai-matrx/records";
54827
55006
  import { useFields as useFields40, useTable as useTable41 } from "@ai-matrx/records/react";
54828
- import { BasicInput as BasicInput36, Button as Button121, CreatablePicker as CreatablePicker3, cn as cn102 } from "@ai-matrx/design-system";
54829
- import { jsx as jsx178, jsxs as jsxs165 } from "react/jsx-runtime";
55007
+ import { BasicInput as BasicInput36, Button as Button122, CreatablePicker as CreatablePicker3, cn as cn102 } from "@ai-matrx/design-system";
55008
+ import { jsx as jsx179, jsxs as jsxs166 } from "react/jsx-runtime";
54830
55009
  var DATA_BINDING_SHAPES = [
54831
55010
  { value: "collection", label: "The whole table" },
54832
55011
  { value: "reference", label: "One record" },
@@ -54893,9 +55072,9 @@ function DataBindingPicker({ dataSource, userId, binding, onChange, disabled, de
54893
55072
  ...binding.semantic_type === "collection" && defaultRowLimit ? { limit: defaultRowLimit } : {}
54894
55073
  });
54895
55074
  };
54896
- return /* @__PURE__ */ jsxs165("div", { className: "flex flex-col gap-2", children: [
54897
- /* @__PURE__ */ jsx178(TablePicker, { dataSource, value: tableId, onChange: selectTable, disabled: Boolean(disabled), tables }),
54898
- /* @__PURE__ */ jsx178(TableScope, { dataSource, userId, tableId, tables, children: tableId && /* @__PURE__ */ jsx178(
55075
+ return /* @__PURE__ */ jsxs166("div", { className: "flex flex-col gap-2", children: [
55076
+ /* @__PURE__ */ jsx179(TablePicker, { dataSource, value: tableId, onChange: selectTable, disabled: Boolean(disabled), tables }),
55077
+ /* @__PURE__ */ jsx179(TableScope, { dataSource, userId, tableId, tables, children: tableId && /* @__PURE__ */ jsx179(
54899
55078
  BindingDetails,
54900
55079
  {
54901
55080
  tableId,
@@ -54959,9 +55138,9 @@ function BindingDetails({
54959
55138
  const fieldOptions = fieldList.map((f) => ({ value: f.key, label: fieldName(f) }));
54960
55139
  const template = binding.transform?.template ?? "";
54961
55140
  const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
54962
- return /* @__PURE__ */ jsxs165("div", { className: "flex flex-col gap-2", children: [
54963
- /* @__PURE__ */ jsx178("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ jsx178(
54964
- Button121,
55141
+ return /* @__PURE__ */ jsxs166("div", { className: "flex flex-col gap-2", children: [
55142
+ /* @__PURE__ */ jsx179("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ jsx179(
55143
+ Button122,
54965
55144
  {
54966
55145
  type: "button",
54967
55146
  size: "sm",
@@ -54974,7 +55153,7 @@ function BindingDetails({
54974
55153
  },
54975
55154
  s.value
54976
55155
  )) }),
54977
- shape !== "collection" && /* @__PURE__ */ jsx178(
55156
+ shape !== "collection" && /* @__PURE__ */ jsx179(
54978
55157
  RecordPicker,
54979
55158
  {
54980
55159
  tableId,
@@ -54983,7 +55162,7 @@ function BindingDetails({
54983
55162
  disabled: Boolean(disabled)
54984
55163
  }
54985
55164
  ),
54986
- shape === "value" && /* @__PURE__ */ jsx178(
55165
+ shape === "value" && /* @__PURE__ */ jsx179(
54987
55166
  CreatablePicker3,
54988
55167
  {
54989
55168
  value: binding.field_key ?? null,
@@ -54997,8 +55176,8 @@ function BindingDetails({
54997
55176
  ariaLabel: "Column"
54998
55177
  }
54999
55178
  ),
55000
- shape !== "value" && /* @__PURE__ */ jsxs165("div", { className: "flex flex-col gap-1", children: [
55001
- /* @__PURE__ */ jsx178(
55179
+ shape !== "value" && /* @__PURE__ */ jsxs166("div", { className: "flex flex-col gap-1", children: [
55180
+ /* @__PURE__ */ jsx179(
55002
55181
  "textarea",
55003
55182
  {
55004
55183
  className: cn102(
@@ -55010,8 +55189,8 @@ function BindingDetails({
55010
55189
  onChange: (e) => setTemplate(e.target.value)
55011
55190
  }
55012
55191
  ),
55013
- !disabled && /* @__PURE__ */ jsx178("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ jsx178(
55014
- Button121,
55192
+ !disabled && /* @__PURE__ */ jsx179("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ jsx179(
55193
+ Button122,
55015
55194
  {
55016
55195
  type: "button",
55017
55196
  size: "sm",
@@ -55023,9 +55202,9 @@ function BindingDetails({
55023
55202
  p.token
55024
55203
  )) })
55025
55204
  ] }),
55026
- shape === "collection" && /* @__PURE__ */ jsxs165("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
55205
+ shape === "collection" && /* @__PURE__ */ jsxs166("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
55027
55206
  "Up to",
55028
- /* @__PURE__ */ jsx178(
55207
+ /* @__PURE__ */ jsx179(
55029
55208
  BasicInput36,
55030
55209
  {
55031
55210
  type: "number",
@@ -55042,10 +55221,10 @@ function BindingDetails({
55042
55221
  ),
55043
55222
  "rows"
55044
55223
  ] }),
55045
- /* @__PURE__ */ jsxs165("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
55046
- /* @__PURE__ */ jsx178("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
55047
- DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ jsx178(
55048
- Button121,
55224
+ /* @__PURE__ */ jsxs166("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
55225
+ /* @__PURE__ */ jsx179("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
55226
+ DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ jsx179(
55227
+ Button122,
55049
55228
  {
55050
55229
  type: "button",
55051
55230
  size: "sm",
@@ -55064,13 +55243,13 @@ function BindingDetails({
55064
55243
 
55065
55244
  // src/PickedSummaries.tsx
55066
55245
  import { useFields as useFields41, useRecord as useRecord6, useTable as useTable42 } from "@ai-matrx/records/react";
55067
- import { Fragment as Fragment73, jsx as jsx179, jsxs as jsxs166 } from "react/jsx-runtime";
55246
+ import { Fragment as Fragment73, jsx as jsx180, jsxs as jsxs167 } from "react/jsx-runtime";
55068
55247
  function TableNameText({ dataSource, tableId }) {
55069
55248
  const tables = useTablesAnywhere(dataSource);
55070
- if (!tableId) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2014" });
55071
- if (tables.loading) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2026" });
55072
- if (tables.error) return /* @__PURE__ */ jsx179(Fragment73, { children: "Couldn't load the table's name" });
55073
- return /* @__PURE__ */ jsx179(Fragment73, { children: tables.rows.find((t) => t.table_id === tableId)?.table_name ?? "\u2014" });
55249
+ if (!tableId) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2014" });
55250
+ if (tables.loading) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2026" });
55251
+ if (tables.error) return /* @__PURE__ */ jsx180(Fragment73, { children: "Couldn't load the table's name" });
55252
+ return /* @__PURE__ */ jsx180(Fragment73, { children: tables.rows.find((t) => t.table_id === tableId)?.table_name ?? "\u2014" });
55074
55253
  }
55075
55254
  function ColumnValuesText({
55076
55255
  dataSource,
@@ -55078,38 +55257,38 @@ function ColumnValuesText({
55078
55257
  tableId,
55079
55258
  value
55080
55259
  }) {
55081
- if (!tableId) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2014" });
55082
- return /* @__PURE__ */ jsx179(
55260
+ if (!tableId) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2014" });
55261
+ return /* @__PURE__ */ jsx180(
55083
55262
  TableScope,
55084
55263
  {
55085
55264
  dataSource,
55086
55265
  userId,
55087
55266
  tableId,
55088
- fallback: /* @__PURE__ */ jsx179(Fragment73, { children: "\u2026" }),
55089
- unavailable: /* @__PURE__ */ jsx179(Fragment73, { children: "Couldn't load this table's columns" }),
55090
- children: /* @__PURE__ */ jsx179(RecordLabelProvider, { children: /* @__PURE__ */ jsx179(ColumnValuesWords, { tableId, value }) })
55267
+ fallback: /* @__PURE__ */ jsx180(Fragment73, { children: "\u2026" }),
55268
+ unavailable: /* @__PURE__ */ jsx180(Fragment73, { children: "Couldn't load this table's columns" }),
55269
+ children: /* @__PURE__ */ jsx180(RecordLabelProvider, { children: /* @__PURE__ */ jsx180(ColumnValuesWords, { tableId, value }) })
55091
55270
  }
55092
55271
  );
55093
55272
  }
55094
55273
  function ColumnValuesWords({ tableId, value }) {
55095
55274
  const fields = useFields41(tableId);
55096
55275
  const labels = useRecordLabels(fields.data ?? void 0);
55097
- if (fields.loading) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2026" });
55098
- if (fields.error) return /* @__PURE__ */ jsx179(Fragment73, { children: "Couldn't load this table's columns" });
55276
+ if (fields.loading) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2026" });
55277
+ if (fields.error) return /* @__PURE__ */ jsx180(Fragment73, { children: "Couldn't load this table's columns" });
55099
55278
  const parts = [];
55100
55279
  for (const [key, stored] of Object.entries(value)) {
55101
55280
  if (key.startsWith("_")) continue;
55102
55281
  const field2 = (fields.data ?? []).find((f) => f.key === key);
55103
- if (parts.length) parts.push(/* @__PURE__ */ jsx179("span", { children: ", " }, `${key}-sep`));
55282
+ if (parts.length) parts.push(/* @__PURE__ */ jsx180("span", { children: ", " }, `${key}-sep`));
55104
55283
  parts.push(
55105
- /* @__PURE__ */ jsxs166("span", { children: [
55284
+ /* @__PURE__ */ jsxs167("span", { children: [
55106
55285
  field2 ? fieldName(field2) : "A removed column",
55107
55286
  " is ",
55108
55287
  field2 ? renderValue(field2, stored, void 0, labels) : "\u2014"
55109
55288
  ] }, key)
55110
55289
  );
55111
55290
  }
55112
- return parts.length ? /* @__PURE__ */ jsx179(Fragment73, { children: parts }) : /* @__PURE__ */ jsx179(Fragment73, { children: "\u2014" });
55291
+ return parts.length ? /* @__PURE__ */ jsx180(Fragment73, { children: parts }) : /* @__PURE__ */ jsx180(Fragment73, { children: "\u2014" });
55113
55292
  }
55114
55293
  function RecordNameText({
55115
55294
  dataSource,
@@ -55117,35 +55296,35 @@ function RecordNameText({
55117
55296
  tableId,
55118
55297
  recordId
55119
55298
  }) {
55120
- if (!tableId || !recordId) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2014" });
55121
- return /* @__PURE__ */ jsx179(
55299
+ if (!tableId || !recordId) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2014" });
55300
+ return /* @__PURE__ */ jsx180(
55122
55301
  TableScope,
55123
55302
  {
55124
55303
  dataSource,
55125
55304
  userId,
55126
55305
  tableId,
55127
- fallback: /* @__PURE__ */ jsx179(Fragment73, { children: "\u2026" }),
55128
- unavailable: /* @__PURE__ */ jsx179(Fragment73, { children: "Couldn't load this record" }),
55129
- children: /* @__PURE__ */ jsx179(RecordNameWords, { tableId, recordId })
55306
+ fallback: /* @__PURE__ */ jsx180(Fragment73, { children: "\u2026" }),
55307
+ unavailable: /* @__PURE__ */ jsx180(Fragment73, { children: "Couldn't load this record" }),
55308
+ children: /* @__PURE__ */ jsx180(RecordNameWords, { tableId, recordId })
55130
55309
  }
55131
55310
  );
55132
55311
  }
55133
55312
  function RecordNameWords({ tableId, recordId }) {
55134
55313
  const table = useTable42(tableId);
55135
55314
  const record = useRecord6(recordId);
55136
- if (record.loading || table.loading) return /* @__PURE__ */ jsx179(Fragment73, { children: "\u2026" });
55137
- if (record.error) return /* @__PURE__ */ jsx179(Fragment73, { children: "Couldn't load this record" });
55138
- if (!record.data) return /* @__PURE__ */ jsx179(Fragment73, { children: "A record you cannot open" });
55139
- return /* @__PURE__ */ jsx179(Fragment73, { children: recordName(record.data.document, table.data?.title_field ?? null) });
55315
+ if (record.loading || table.loading) return /* @__PURE__ */ jsx180(Fragment73, { children: "\u2026" });
55316
+ if (record.error) return /* @__PURE__ */ jsx180(Fragment73, { children: "Couldn't load this record" });
55317
+ if (!record.data) return /* @__PURE__ */ jsx180(Fragment73, { children: "A record you cannot open" });
55318
+ return /* @__PURE__ */ jsx180(Fragment73, { children: recordName(record.data.document, table.data?.title_field ?? null) });
55140
55319
  }
55141
55320
 
55142
55321
  // src/HeldChangeDecision.tsx
55143
55322
  import { useEffect as useEffect127, useState as useState152 } from "react";
55144
55323
  import { RecordsProvider as RecordsProvider3, useRecordsClient as useRecordsClient108 } from "@ai-matrx/records/react";
55145
- import { Button as Button122 } from "@ai-matrx/design-system";
55146
- import { jsx as jsx180, jsxs as jsxs167 } from "react/jsx-runtime";
55324
+ import { Button as Button123 } from "@ai-matrx/design-system";
55325
+ import { jsx as jsx181, jsxs as jsxs168 } from "react/jsx-runtime";
55147
55326
  function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
55148
- return /* @__PURE__ */ jsx180(RecordsProvider3, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ jsx180(Decision, { approvalId, onDecided, approveLabel: approveLabel ?? "Approve" }) });
55327
+ return /* @__PURE__ */ jsx181(RecordsProvider3, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ jsx181(Decision, { approvalId, onDecided, approveLabel: approveLabel ?? "Approve" }) });
55149
55328
  }
55150
55329
  function Decision({
55151
55330
  approvalId,
@@ -55178,20 +55357,20 @@ function Decision({
55178
55357
  if (res.ok) onDecided(approve);
55179
55358
  else setError(res.error);
55180
55359
  };
55181
- if (may === null) return /* @__PURE__ */ jsx180("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
55182
- return /* @__PURE__ */ jsxs167("div", { className: "flex flex-col gap-1.5", children: [
55183
- may ? /* @__PURE__ */ jsxs167("div", { className: "flex gap-2", children: [
55184
- /* @__PURE__ */ jsx180(Button122, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
55185
- /* @__PURE__ */ jsx180(Button122, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
55186
- ] }) : !error && /* @__PURE__ */ jsx180("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
55187
- error ? /* @__PURE__ */ jsx180(RefusalLine, { error }) : null
55360
+ if (may === null) return /* @__PURE__ */ jsx181("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
55361
+ return /* @__PURE__ */ jsxs168("div", { className: "flex flex-col gap-1.5", children: [
55362
+ may ? /* @__PURE__ */ jsxs168("div", { className: "flex gap-2", children: [
55363
+ /* @__PURE__ */ jsx181(Button123, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
55364
+ /* @__PURE__ */ jsx181(Button123, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
55365
+ ] }) : !error && /* @__PURE__ */ jsx181("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
55366
+ error ? /* @__PURE__ */ jsx181(RefusalLine, { error }) : null
55188
55367
  ] });
55189
55368
  }
55190
55369
 
55191
55370
  // src/CalendarLinks.tsx
55192
55371
  import { useCallback as useCallback71, useEffect as useEffect128, useState as useState153 } from "react";
55193
- import { Button as Button123 } from "@ai-matrx/design-system";
55194
- import { jsx as jsx181, jsxs as jsxs168 } from "react/jsx-runtime";
55372
+ import { Button as Button124 } from "@ai-matrx/design-system";
55373
+ import { jsx as jsx182, jsxs as jsxs169 } from "react/jsx-runtime";
55195
55374
  var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }) : null;
55196
55375
  function CalendarLinks({ port }) {
55197
55376
  const [rows, setRows] = useState153(null);
@@ -55216,15 +55395,15 @@ function CalendarLinks({ port }) {
55216
55395
  setError(asRefusal3(e, "That didn\u2019t work"));
55217
55396
  }
55218
55397
  };
55219
- if (rows === null && !error) return /* @__PURE__ */ jsx181("p", { className: "text-sm text-muted-foreground", "data-calendar-links-loading": "", children: "Reading your links\u2026" });
55220
- return /* @__PURE__ */ jsxs168("div", { className: "flex flex-col gap-2", "data-calendar-links": "", children: [
55221
- error ? /* @__PURE__ */ jsx181(RefusalNotice, { error }) : null,
55222
- rows && rows.length === 0 ? /* @__PURE__ */ jsx181("p", { className: "text-sm text-muted-foreground", children: "No calendar links yet." }) : null,
55223
- rows?.map((row) => /* @__PURE__ */ jsxs168("div", { className: "flex flex-col gap-2 rounded-md border px-3 py-2", "data-calendar-link-row": row.id, children: [
55224
- /* @__PURE__ */ jsxs168("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
55225
- /* @__PURE__ */ jsxs168("div", { className: "min-w-0", children: [
55226
- /* @__PURE__ */ jsx181("div", { className: "truncate text-sm font-medium", children: row.title }),
55227
- /* @__PURE__ */ jsxs168("div", { className: "text-xs text-muted-foreground", children: [
55398
+ if (rows === null && !error) return /* @__PURE__ */ jsx182("p", { className: "text-sm text-muted-foreground", "data-calendar-links-loading": "", children: "Reading your links\u2026" });
55399
+ return /* @__PURE__ */ jsxs169("div", { className: "flex flex-col gap-2", "data-calendar-links": "", children: [
55400
+ error ? /* @__PURE__ */ jsx182(RefusalNotice, { error }) : null,
55401
+ rows && rows.length === 0 ? /* @__PURE__ */ jsx182("p", { className: "text-sm text-muted-foreground", children: "No calendar links yet." }) : null,
55402
+ rows?.map((row) => /* @__PURE__ */ jsxs169("div", { className: "flex flex-col gap-2 rounded-md border px-3 py-2", "data-calendar-link-row": row.id, children: [
55403
+ /* @__PURE__ */ jsxs169("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
55404
+ /* @__PURE__ */ jsxs169("div", { className: "min-w-0", children: [
55405
+ /* @__PURE__ */ jsx182("div", { className: "truncate text-sm font-medium", children: row.title }),
55406
+ /* @__PURE__ */ jsxs169("div", { className: "text-xs text-muted-foreground", children: [
55228
55407
  "Made ",
55229
55408
  day(row.created_at),
55230
55409
  " \xB7 ",
@@ -55233,9 +55412,9 @@ function CalendarLinks({ port }) {
55233
55412
  row.expired ? "Expired" : row.expires_at ? `Expires ${day(row.expires_at)}` : "Never expires"
55234
55413
  ] })
55235
55414
  ] }),
55236
- /* @__PURE__ */ jsxs168("div", { className: "flex shrink-0 gap-2", children: [
55237
- /* @__PURE__ */ jsx181(
55238
- Button123,
55415
+ /* @__PURE__ */ jsxs169("div", { className: "flex shrink-0 gap-2", children: [
55416
+ /* @__PURE__ */ jsx182(
55417
+ Button124,
55239
55418
  {
55240
55419
  size: "sm",
55241
55420
  variant: "outline",
@@ -55248,8 +55427,8 @@ function CalendarLinks({ port }) {
55248
55427
  children: "Rotate"
55249
55428
  }
55250
55429
  ),
55251
- /* @__PURE__ */ jsx181(
55252
- Button123,
55430
+ /* @__PURE__ */ jsx182(
55431
+ Button124,
55253
55432
  {
55254
55433
  size: "sm",
55255
55434
  variant: "outline",
@@ -55264,7 +55443,7 @@ function CalendarLinks({ port }) {
55264
55443
  )
55265
55444
  ] })
55266
55445
  ] }),
55267
- fresh?.id === row.id ? /* @__PURE__ */ jsx181(CalendarLinkOnce, { url: fresh.url }) : null
55446
+ fresh?.id === row.id ? /* @__PURE__ */ jsx182(CalendarLinkOnce, { url: fresh.url }) : null
55268
55447
  ] }, row.id))
55269
55448
  ] });
55270
55449
  }
@@ -55274,7 +55453,7 @@ import { useEffect as useEffect129, useMemo as useMemo85, useState as useState15
55274
55453
  import { templatePreview } from "@ai-matrx/records/memory";
55275
55454
  import { useRecordsClient as useRecordsClient109 } from "@ai-matrx/records/react";
55276
55455
  import { formFromSummary as formFromSummary3 } from "@ai-matrx/records/forms";
55277
- import { jsx as jsx182, jsxs as jsxs169 } from "react/jsx-runtime";
55456
+ import { jsx as jsx183, jsxs as jsxs170 } from "react/jsx-runtime";
55278
55457
  function useTemplatePreview(spec, today) {
55279
55458
  return useMemo85(() => templatePreview(spec, today ? { today } : {}), [spec, today]);
55280
55459
  }
@@ -55285,9 +55464,9 @@ function TemplatePreview({ spec, today, initialTable, host, aside, booking, clas
55285
55464
  const [active, setActive] = useState154(first?.id ?? null);
55286
55465
  const table = preview.tables.find((t) => t.id === active) ?? first;
55287
55466
  if (!table) return null;
55288
- return /* @__PURE__ */ jsxs169("div", { className: ["flex min-w-0 flex-col gap-3", className].filter(Boolean).join(" "), "data-template-preview": preview.tables.length, children: [
55289
- preview.tables.length > 1 || aside ? /* @__PURE__ */ jsxs169("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", role: "tablist", "aria-label": "Tables", children: [
55290
- preview.tables.map((t) => /* @__PURE__ */ jsxs169(
55467
+ return /* @__PURE__ */ jsxs170("div", { className: ["flex min-w-0 flex-col gap-3", className].filter(Boolean).join(" "), "data-template-preview": preview.tables.length, children: [
55468
+ preview.tables.length > 1 || aside ? /* @__PURE__ */ jsxs170("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", role: "tablist", "aria-label": "Tables", children: [
55469
+ preview.tables.map((t) => /* @__PURE__ */ jsxs170(
55291
55470
  "button",
55292
55471
  {
55293
55472
  type: "button",
@@ -55301,19 +55480,19 @@ function TemplatePreview({ spec, today, initialTable, host, aside, booking, clas
55301
55480
  ].join(" "),
55302
55481
  children: [
55303
55482
  t.name,
55304
- /* @__PURE__ */ jsx182("span", { className: "text-xs tabular-nums text-muted-foreground", children: t.rows })
55483
+ /* @__PURE__ */ jsx183("span", { className: "text-xs tabular-nums text-muted-foreground", children: t.rows })
55305
55484
  ]
55306
55485
  },
55307
55486
  t.id
55308
55487
  )),
55309
- aside ? /* @__PURE__ */ jsx182("div", { className: "ml-auto", children: aside }) : null
55488
+ aside ? /* @__PURE__ */ jsx183("div", { className: "ml-auto", children: aside }) : null
55310
55489
  ] }) : null,
55311
- /* @__PURE__ */ jsxs169(RecordsMount, { config: preview.config, host: bound2, children: [
55312
- /* @__PURE__ */ jsx182("div", { className: "min-h-[32rem] min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: /* @__PURE__ */ jsx182(TablePage, { tableId: table.id }, table.id) }),
55313
- /* @__PURE__ */ jsx182(PreviewForms, { preview, booking }),
55314
- preview.dashboards.length ? /* @__PURE__ */ jsxs169("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Dashboards", "data-template-preview-dashboards": preview.dashboards.length, children: [
55315
- /* @__PURE__ */ jsx182("h2", { className: "text-lg font-semibold tracking-tight", children: "Dashboards" }),
55316
- preview.dashboards.map((d) => /* @__PURE__ */ jsx182("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card p-3", "data-template-preview-dashboard": d.token, children: /* @__PURE__ */ jsx182(DashboardCanvas, { tableId: d.tableId, activeDashboardId: d.id }) }, d.id))
55490
+ /* @__PURE__ */ jsxs170(RecordsMount, { config: preview.config, host: bound2, children: [
55491
+ /* @__PURE__ */ jsx183("div", { className: "min-h-[32rem] min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: /* @__PURE__ */ jsx183(TablePage, { tableId: table.id }, table.id) }),
55492
+ /* @__PURE__ */ jsx183(PreviewForms, { preview, booking }),
55493
+ preview.dashboards.length ? /* @__PURE__ */ jsxs170("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Dashboards", "data-template-preview-dashboards": preview.dashboards.length, children: [
55494
+ /* @__PURE__ */ jsx183("h2", { className: "text-lg font-semibold tracking-tight", children: "Dashboards" }),
55495
+ preview.dashboards.map((d) => /* @__PURE__ */ jsx183("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card p-3", "data-template-preview-dashboard": d.token, children: /* @__PURE__ */ jsx183(DashboardCanvas, { tableId: d.tableId, activeDashboardId: d.id }) }, d.id))
55317
55496
  ] }) : null
55318
55497
  ] })
55319
55498
  ] });
@@ -55341,14 +55520,14 @@ function PreviewForms({ preview, booking }) {
55341
55520
  };
55342
55521
  }, [client, preview, booking]);
55343
55522
  if (!forms?.length && !pages.length) return null;
55344
- return /* @__PURE__ */ jsxs169("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Forms and booking", "data-template-preview-forms": forms?.length ?? 0, children: [
55345
- /* @__PURE__ */ jsx182("h2", { className: "text-lg font-semibold tracking-tight", children: "Forms and booking" }),
55346
- /* @__PURE__ */ jsx182("div", { className: "grid min-w-0 gap-4 md:grid-cols-2", children: (forms ?? []).map((f) => /* @__PURE__ */ jsxs169("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-form": f.slug ?? f.id, children: [
55347
- /* @__PURE__ */ jsx182("h3", { className: "mb-3 text-sm font-semibold", children: f.name }),
55348
- /* @__PURE__ */ jsx182(FormRunner, { form: f, preview: true })
55523
+ return /* @__PURE__ */ jsxs170("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Forms and booking", "data-template-preview-forms": forms?.length ?? 0, children: [
55524
+ /* @__PURE__ */ jsx183("h2", { className: "text-lg font-semibold tracking-tight", children: "Forms and booking" }),
55525
+ /* @__PURE__ */ jsx183("div", { className: "grid min-w-0 gap-4 md:grid-cols-2", children: (forms ?? []).map((f) => /* @__PURE__ */ jsxs170("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-form": f.slug ?? f.id, children: [
55526
+ /* @__PURE__ */ jsx183("h3", { className: "mb-3 text-sm font-semibold", children: f.name }),
55527
+ /* @__PURE__ */ jsx183(FormRunner, { form: f, preview: true })
55349
55528
  ] }, f.id)) }),
55350
- booking ? pages.map((p) => /* @__PURE__ */ jsxs169("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-booking": p.id, children: [
55351
- /* @__PURE__ */ jsx182("h3", { className: "mb-3 text-sm font-semibold", children: String(p.page["title"] ?? "") }),
55529
+ booking ? pages.map((p) => /* @__PURE__ */ jsxs170("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-booking": p.id, children: [
55530
+ /* @__PURE__ */ jsx183("h3", { className: "mb-3 text-sm font-semibold", children: String(p.page["title"] ?? "") }),
55352
55531
  booking(p.page)
55353
55532
  ] }, p.id)) : null
55354
55533
  ] });