@ai-matrx/records-ui 0.116.24 → 0.116.26

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/README.md +3 -3
  3. package/dist/SaveToTable-P3MPRSCW.js +20 -0
  4. package/dist/{chunk-WQGFKNE2.js → chunk-4NJUW3VM.js} +26 -26
  5. package/dist/chunk-4NJUW3VM.js.map +1 -0
  6. package/dist/{chunk-MUK63ANA.js → chunk-4ZS4WEEE.js} +3 -3
  7. package/dist/chunk-4ZS4WEEE.js.map +1 -0
  8. package/dist/{chunk-SYHUPGCU.js → chunk-6Z537SLG.js} +1 -1
  9. package/dist/{chunk-SYHUPGCU.js.map → chunk-6Z537SLG.js.map} +1 -1
  10. package/dist/{chunk-ODABFEHG.js → chunk-7RSMA3NK.js} +3 -3
  11. package/dist/chunk-7RSMA3NK.js.map +1 -0
  12. package/dist/{chunk-VHZKLE63.js → chunk-FLIERNH7.js} +9 -9
  13. package/dist/chunk-FLIERNH7.js.map +1 -0
  14. package/dist/{chunk-MCDA6L7E.js → chunk-HAWACXPU.js} +2 -2
  15. package/dist/chunk-HAWACXPU.js.map +1 -0
  16. package/dist/{chunk-ZNIXJ5RY.js → chunk-KQR2RA4V.js} +3 -3
  17. package/dist/{chunk-5IX4BL72.js → chunk-MBUW42SM.js} +2 -2
  18. package/dist/{chunk-5IX4BL72.js.map → chunk-MBUW42SM.js.map} +1 -1
  19. package/dist/{chunk-PPWNFIJ5.js → chunk-OV6QBL5R.js} +2 -2
  20. package/dist/{chunk-PPWNFIJ5.js.map → chunk-OV6QBL5R.js.map} +1 -1
  21. package/dist/{chunk-FECWKOWW.js → chunk-W7GR64CB.js} +1 -1
  22. package/dist/chunk-W7GR64CB.js.map +1 -0
  23. package/dist/{chunk-FHL4GG6R.js → chunk-WCQSJPLS.js} +2 -2
  24. package/dist/chunk-WCQSJPLS.js.map +1 -0
  25. package/dist/data-source.cjs.map +1 -1
  26. package/dist/data-source.d.cts +1 -1
  27. package/dist/data-source.d.ts +1 -1
  28. package/dist/data-source.js.map +1 -1
  29. package/dist/first-page.cjs.map +1 -1
  30. package/dist/first-page.d.cts +1 -1
  31. package/dist/first-page.d.ts +1 -1
  32. package/dist/first-page.js.map +1 -1
  33. package/dist/helpers.cjs +4 -4
  34. package/dist/helpers.cjs.map +1 -1
  35. package/dist/helpers.d.cts +9 -9
  36. package/dist/helpers.d.ts +9 -9
  37. package/dist/helpers.js +4 -4
  38. package/dist/helpers.js.map +1 -1
  39. package/dist/html-frame.cjs.map +1 -1
  40. package/dist/html-frame.d.cts +1 -1
  41. package/dist/html-frame.d.ts +1 -1
  42. package/dist/html-frame.js +1 -1
  43. package/dist/index.cjs +147 -116
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts +46 -46
  46. package/dist/index.d.ts +46 -46
  47. package/dist/index.js +133 -102
  48. package/dist/index.js.map +1 -1
  49. package/dist/object-actions.cjs +2 -2
  50. package/dist/object-actions.cjs.map +1 -1
  51. package/dist/object-actions.js +3 -3
  52. package/dist/pickers.cjs +23 -23
  53. package/dist/pickers.cjs.map +1 -1
  54. package/dist/pickers.js +8 -8
  55. package/dist/skeleton.cjs.map +1 -1
  56. package/dist/skeleton.js +4 -4
  57. package/dist/table-shape.cjs.map +1 -1
  58. package/dist/table-shape.js +1 -1
  59. package/package.json +3 -3
  60. package/dist/SaveToTable-PGOQVYVS.js +0 -20
  61. package/dist/chunk-FECWKOWW.js.map +0 -1
  62. package/dist/chunk-FHL4GG6R.js.map +0 -1
  63. package/dist/chunk-MCDA6L7E.js.map +0 -1
  64. package/dist/chunk-MUK63ANA.js.map +0 -1
  65. package/dist/chunk-ODABFEHG.js.map +0 -1
  66. package/dist/chunk-VHZKLE63.js.map +0 -1
  67. package/dist/chunk-WQGFKNE2.js.map +0 -1
  68. /package/dist/{SaveToTable-PGOQVYVS.js.map → SaveToTable-P3MPRSCW.js.map} +0 -0
  69. /package/dist/{chunk-ZNIXJ5RY.js.map → chunk-KQR2RA4V.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -49,7 +49,7 @@ function sentenceFor(what, level) {
49
49
  read: "open this",
50
50
  comment: "leave a comment",
51
51
  write: "change anything here",
52
- organise: "organise this",
52
+ organise: "organize this",
53
53
  remove: "delete this",
54
54
  share: "pass this on to somebody else",
55
55
  structure: "change the columns of this table"
@@ -402,7 +402,7 @@ function refusalForAPerson(error) {
402
402
  const said2 = (messageIsForEngineers ? "" : message.kept ?? "").trim();
403
403
  const forEngineers = [
404
404
  error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
405
- // The client's own note about a class it did not recognise, or a call that
405
+ // The client's own note about a class it did not recognize, or a call that
406
406
  // never reached the store. It is rendered out of sight, never as a sentence.
407
407
  error.diagnostic ? error.diagnostic : null,
408
408
  messageIsForEngineers ? `Message: ${error.message}` : null,
@@ -686,7 +686,7 @@ var init_fieldTypes = __esm({
686
686
  { id: "phone", group: "Words", label: "Phone number", explanation: "A phone number, checked as you type." },
687
687
  { id: "url", group: "Words", label: "Link", explanation: "A web address that opens in a new tab when you click it." },
688
688
  { id: "address", group: "Words", label: "Address", explanation: "A street address in parts, opened in maps." },
689
- { id: "color_pair", group: "Words", label: "Colour", explanation: "A colour for light and dark, with a readability check." },
689
+ { id: "color_pair", group: "Words", label: "Color", explanation: "A color for light and dark, with a readability check." },
690
690
  { id: "type_style", group: "Words", label: "Type style", explanation: "A font, weight and size, shown as a sample." },
691
691
  { id: "shadow", group: "Words", label: "Shadow", explanation: "A shadow, shown on a card." },
692
692
  { id: "json", group: "Words", label: "JSON", explanation: "Structured data \u2014 a list or a set of named values \u2014 shown folded." },
@@ -765,7 +765,7 @@ function fieldTypeLabel(field2) {
765
765
  const known = fieldTypeChoice(kind2)?.label;
766
766
  if (known) return field2.multi && kind2 !== "multi_select" ? `${known} (many)` : known;
767
767
  const plain2 = {
768
- // `boolean` is the BEHAVIOUR word; `checkbox` is the type a person picks. Both are
768
+ // `boolean` is the BEHAVIOR word; `checkbox` is the type a person picks. Both are
769
769
  // written the way a person writes them, never as a raw token.
770
770
  boolean: "Yes / no",
771
771
  date: "Date",
@@ -4359,7 +4359,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
4359
4359
  ),
4360
4360
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: (0, import_design_system31.cn)("text-muted-foreground", titleMissing && "text-destructive"), children: [
4361
4361
  titleMissing ? `Nothing goes into ${titleFieldLabel} yet, so these records would have no name. Choose the column above, then this will run.` : columnsSentence(mappedCount, plan.columns.length - leftOut.size, unmapped) + (leftOut.size > 0 ? ` \xB7 ${leftOut.size} left out` : ""),
4362
- fileHash || titleMissing ? "" : " \xB7 this browser cannot recognise the file again, so importing it twice would write it twice"
4362
+ fileHash || titleMissing ? "" : " \xB7 this browser cannot recognize the file again, so importing it twice would write it twice"
4363
4363
  ] })
4364
4364
  ] })
4365
4365
  ] }) : null,
@@ -5841,7 +5841,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
5841
5841
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "Nobody booking is asked who they are, so you would not know who booked or how to reach them." }),
5842
5842
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system35.Button, { size: "sm", variant: "outline", disabled: addingWho, onClick: () => void addWho(), children: addingWho ? "Adding\u2026" : "Ask their name and email" })
5843
5843
  ] }) : null,
5844
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "The time, whether it is booked or cancelled, and who it is with are filled in for you \u2014 a booking page cannot ask a visitor for any of the three." }),
5844
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "The time, whether it is booked or canceled, and who it is with are filled in for you \u2014 a booking page cannot ask a visitor for any of the three." }),
5845
5845
  leftOut ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: leftOut }) : null,
5846
5846
  unfillable ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5847
5847
  import_design_system34.ErrorBox,
@@ -6775,7 +6775,7 @@ function BookingSlots({ tableId, activeBookingId, className }) {
6775
6775
  page.cancelled > 0 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
6776
6776
  " \xB7 ",
6777
6777
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: page.cancelled }),
6778
- " cancelled"
6778
+ " canceled"
6779
6779
  ] }) : null,
6780
6780
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "text-muted-foreground", children: [
6781
6781
  " \xB7 ",
@@ -9347,7 +9347,7 @@ function ColorWell({
9347
9347
  import_design_system2.BasicInput,
9348
9348
  {
9349
9349
  type: "color",
9350
- "aria-label": `${label}: pick a colour`,
9350
+ "aria-label": `${label}: pick a color`,
9351
9351
  className: "h-7 w-8 shrink-0 p-0.5",
9352
9352
  value: value && HEX_6.test(value) ? value : "#000000",
9353
9353
  disabled,
@@ -9433,7 +9433,7 @@ function colorPairChecks(value, format, context) {
9433
9433
  message: `hard to read on ${ground}`,
9434
9434
  fix: {
9435
9435
  label: "Fix with AI",
9436
- ask: `The ${part} colour ${color} reads at ${ratio}:1 on ${ground}. Suggest the nearest colour that reaches 4.5:1 and keeps its hue.`
9436
+ ask: `The ${part} color ${color} reads at ${ratio}:1 on ${ground}. Suggest the nearest color that reaches 4.5:1 and keeps its hue.`
9437
9437
  }
9438
9438
  });
9439
9439
  }
@@ -9663,7 +9663,7 @@ function ShadowLayersEditor({
9663
9663
  },
9664
9664
  k
9665
9665
  )),
9666
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "col-span-3", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ColorWell, { id: i === 0 ? id : `${id}-${i}`, label: `${label} layer ${i + 1} colour`, value: layer.color, disabled, onChange: (c) => c && set(i, { color: c }) }) }),
9666
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "col-span-3", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ColorWell, { id: i === 0 ? id : `${id}-${i}`, label: `${label} layer ${i + 1} color`, value: layer.color, disabled, onChange: (c) => c && set(i, { color: c }) }) }),
9667
9667
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex items-center justify-end", children: layers.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled, className: "text-xs text-muted-foreground hover:text-foreground", onClick: () => onChange(layers.filter((_, j) => j !== i)), children: "Remove" }) : null })
9668
9668
  ] }, i)),
9669
9669
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled, className: "self-start text-xs text-muted-foreground hover:text-foreground", onClick: () => onChange([...layers, NEW_LAYER]), children: "+ Layer" })
@@ -10044,10 +10044,10 @@ function htmlSampleChecks(value, _format) {
10044
10044
  const outsideFallbacks = styles.replace(/var\([^()]*(\([^()]*\))?[^()]*\)/g, "");
10045
10045
  if (FIXED_COLOUR.test(outsideFallbacks)) {
10046
10046
  out.push({
10047
- message: "fixed colours, not the theme's",
10047
+ message: "fixed colors, not the theme's",
10048
10048
  fix: {
10049
10049
  label: "Use tokens",
10050
- ask: "Rewrite this HTML sample so every colour is one of the design system's CSS variables (var(--background), var(--foreground), var(--primary), var(--border)\u2026), keeping the markup and the look the same, so it follows light and dark."
10050
+ ask: "Rewrite this HTML sample so every color is one of the design system's CSS variables (var(--background), var(--foreground), var(--primary), var(--border)\u2026), keeping the markup and the look the same, so it follows light and dark."
10051
10051
  }
10052
10052
  });
10053
10053
  }
@@ -13292,8 +13292,8 @@ function ChoiceSwatch({ words: words2, color, onColor }) {
13292
13292
  "button",
13293
13293
  {
13294
13294
  type: "button",
13295
- "aria-label": `Colour for ${words2}: ${color ? import_data_table2.STYLE_COLOR_LABELS[color] : "none"}`,
13296
- title: color ? import_data_table2.STYLE_COLOR_LABELS[color] : "No colour",
13295
+ "aria-label": `Color for ${words2}: ${color ? import_data_table2.STYLE_COLOR_LABELS[color] : "none"}`,
13296
+ title: color ? import_data_table2.STYLE_COLOR_LABELS[color] : "No color",
13297
13297
  "data-records-choice-swatch": color ?? "none",
13298
13298
  className: (0, import_design_system16.cn)(
13299
13299
  "h-4 w-4 shrink-0 rounded-full",
@@ -13301,15 +13301,15 @@ function ChoiceSwatch({ words: words2, color, onColor }) {
13301
13301
  )
13302
13302
  }
13303
13303
  ) }),
13304
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system16.PopoverContent, { sizing: "content", align: "start", className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1", role: "radiogroup", "aria-label": `Colour for ${words2}`, children: [
13304
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system16.PopoverContent, { sizing: "content", align: "start", className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1", role: "radiogroup", "aria-label": `Color for ${words2}`, children: [
13305
13305
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
13306
13306
  "button",
13307
13307
  {
13308
13308
  type: "button",
13309
13309
  role: "radio",
13310
13310
  "aria-checked": color === null,
13311
- "aria-label": "No colour",
13312
- title: "No colour",
13311
+ "aria-label": "No color",
13312
+ title: "No color",
13313
13313
  onClick: () => pick(null),
13314
13314
  className: (0, import_design_system16.cn)("h-5 w-5 rounded-full border border-border bg-background", color === null && "ring-2 ring-ring ring-offset-1")
13315
13315
  }
@@ -17710,8 +17710,8 @@ var import_records30 = require("@ai-matrx/records");
17710
17710
  var import_design_system49 = require("@ai-matrx/design-system");
17711
17711
  var import_data_table5 = require("@ai-matrx/design-system/data-table");
17712
17712
  var import_jsx_runtime58 = require("react/jsx-runtime");
17713
- function AccentSwatches({ value, onChange, options = import_records30.PORTAL_ACCENTS, noneLabel = "App colour" }) {
17714
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Colour", children: [
17713
+ function AccentSwatches({ value, onChange, options = import_records30.PORTAL_ACCENTS, noneLabel = "App color" }) {
17714
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Color", children: [
17715
17715
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
17716
17716
  "button",
17717
17717
  {
@@ -17892,7 +17892,7 @@ function ButtonSettingsEditor({
17892
17892
  ] })
17893
17893
  ] }),
17894
17894
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-1", children: [
17895
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_design_system51.Label, { className: "text-xs", children: "Colour" }),
17895
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_design_system51.Label, { className: "text-xs", children: "Color" }),
17896
17896
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
17897
17897
  AccentSwatches,
17898
17898
  {
@@ -18370,9 +18370,9 @@ function FieldEditor(props) {
18370
18370
  // patch never carried it, so the tick beside "Can hold more than one"
18371
18371
  // was decoration on an existing column — and the store's own roll-up
18372
18372
  // refusal tells a person to use exactly that tick. It is sent ALONE:
18373
- // `custom.field_update` honours a `multi`-only patch since FIX-7B-FIELD's
18374
- // migration (before it, the door read `multi` only inside its behaviour
18375
- // arm, answered "saved" and changed nothing), so there is no behaviour
18373
+ // `custom.field_update` honors a `multi`-only patch since FIX-7B-FIELD's
18374
+ // migration (before it, the door read `multi` only inside its behavior
18375
+ // arm, answered "saved" and changed nothing), so there is no behavior
18376
18376
  // word to send beside it and sending one would retype a column nobody
18377
18377
  // asked to retype.
18378
18378
  ...multiApplies(type) ? { multi: isTitle ? false : multi } : {},
@@ -18474,7 +18474,7 @@ function FieldEditor(props) {
18474
18474
  ...type === "modified_time" && watchFields.length ? { config: { only_fields: watchFields } } : {},
18475
18475
  ...type === "autonumber" && numberPrefix.trim() !== "" ? { display_format: { id: "autonumber", options: { prefix: numberPrefix.trim() } } } : {},
18476
18476
  ...type === "count" ? { via } : {},
18477
- // THE COLOURS ITS CHOICES WERE GIVEN (W1-B), on the Field's look in the same declaration:
18477
+ // THE COLORS ITS CHOICES WERE GIVEN (W1-B), on the Field's look in the same declaration:
18478
18478
  // both declare doors build the Field through `custom._field_document_for`, which keeps a
18479
18479
  // `display_format` it is handed — so the grid paints them from its first draw.
18480
18480
  ...(() => {
@@ -19820,7 +19820,7 @@ function formatControl(args) {
19820
19820
  {
19821
19821
  id: `${id}-swatch`,
19822
19822
  type: "color",
19823
- "aria-label": `${label} \u2014 pick a colour`,
19823
+ "aria-label": `${label} \u2014 pick a color`,
19824
19824
  className: "h-8 w-12 p-1",
19825
19825
  value: /^#[0-9a-fA-F]{6}$/.test(text) ? text : "#000000",
19826
19826
  disabled,
@@ -22405,9 +22405,9 @@ function OpenCell({
22405
22405
  className: (0, import_design_system57.cn)(
22406
22406
  // OVER the cell's ghost (see `data-records-open-cell`), never in the table's measuring.
22407
22407
  "absolute inset-x-0 z-[25] flex w-full min-w-0 max-w-full flex-col gap-1 outline-none",
22408
- // A one-line control sits centred on the row; a multi-line box hangs from the cell's top and
22408
+ // A one-line control sits centered on the row; a multi-line box hangs from the cell's top and
22409
22409
  // grows downward over the rows below (Airtable's expanded long-text cell), never up over the
22410
- // header (D10: centred, its first lines sat 58px above the cell, outside it).
22410
+ // header (D10: centered, its first lines sat 58px above the cell, outside it).
22411
22411
  // …and its words wrap: the one-line frame sets `white-space: nowrap` on every descendant, so the
22412
22412
  // textarea scrolled sideways on one line (live, after the clip was lifted).
22413
22413
  multiline ? "top-0 rounded-md bg-card shadow-md [&_textarea]:![white-space:pre-wrap] [&_textarea]:![overflow-wrap:anywhere]" : "top-1/2 -translate-y-1/2",
@@ -24430,9 +24430,9 @@ function paintByOption(style, _fields, index, lookup) {
24430
24430
  }
24431
24431
  return out ?? doc;
24432
24432
  },
24433
- // A CHOICE PAINTS IN ITS OWN COLOUR (DATA-V2-BASICS-2 C1b): an option kept in its own Table
24434
- // carries the colour its owner gave it; coloured by Status, a "Verified" (green) row was tinted
24435
- // pink by the hash. The option's colour first, then the column's stored colours, then the hash.
24433
+ // A CHOICE PAINTS IN ITS OWN COLOR (DATA-V2-BASICS-2 C1b): an option kept in its own Table
24434
+ // carries the color its owner gave it; colored by Status, a "Verified" (green) row was tinted
24435
+ // pink by the hash. The option's color first, then the column's stored colors, then the hash.
24436
24436
  choiceColorFor: (fieldKey, value) => {
24437
24437
  const option = optionFor(index.get(fieldKey), value);
24438
24438
  if (!option) return lookup(fieldKey, value);
@@ -24511,7 +24511,7 @@ function useGridColours(args) {
24511
24511
  async (path, value, said2) => {
24512
24512
  const answer = await client.tableDecorate({ table_id: tableId, path, value });
24513
24513
  if (!answer.ok) {
24514
- notify?.error(`The colour was not kept: ${refusalSentence(answer.error)}`);
24514
+ notify?.error(`The color was not kept: ${refusalSentence(answer.error)}`);
24515
24515
  return false;
24516
24516
  }
24517
24517
  decorations.apply(answer.data);
@@ -24530,34 +24530,34 @@ function useGridColours(args) {
24530
24530
  const name = fieldName(field2);
24531
24531
  const by = decorations.data?.color_by;
24532
24532
  const byThis = by?.field === field2.id;
24533
- const byWhy = colourableBy(field2) ? void 0 : `${name} holds free values; rows are coloured by a column of choices or ticks. Use a colour rule instead.`;
24533
+ const byWhy = colourableBy(field2) ? void 0 : `${name} holds free values; rows are colored by a column of choices or ticks. Use a color rule instead.`;
24534
24534
  const column = decorations.data?.columns?.[field2.id];
24535
24535
  return {
24536
24536
  id: "col-colour",
24537
- label: "Colour by\u2026",
24537
+ label: "Color by\u2026",
24538
24538
  icon: "palette",
24539
24539
  disabledReason: refusal3,
24540
24540
  submenu: [
24541
24541
  byThis ? {
24542
24542
  id: "col-colour-off",
24543
- label: `Stop colouring by ${name}`,
24544
- onSelect: () => void write(["color_by"], null, `Rows are no longer coloured by ${name}.`)
24543
+ label: `Stop coloring by ${name}`,
24544
+ onSelect: () => void write(["color_by"], null, `Rows are no longer colored by ${name}.`)
24545
24545
  } : {
24546
24546
  id: "col-colour-rows",
24547
- label: "Colour rows by this column",
24547
+ label: "Color rows by this column",
24548
24548
  disabledReason: byWhy,
24549
- onSelect: () => void write(["color_by"], { field: field2.id, target: "row" }, `Each row wears the colour of its ${name}.`)
24549
+ onSelect: () => void write(["color_by"], { field: field2.id, target: "row" }, `Each row wears the color of its ${name}.`)
24550
24550
  },
24551
24551
  ...byThis && by?.target === "row" ? [
24552
24552
  {
24553
24553
  id: "col-colour-cells",
24554
- label: "Colour only this column's cells",
24555
- onSelect: () => void write(["color_by"], { field: field2.id, target: "cell" }, `Only ${name}'s cells wear their colour now.`)
24554
+ label: "Color only this column's cells",
24555
+ onSelect: () => void write(["color_by"], { field: field2.id, target: "cell" }, `Only ${name}'s cells wear their color now.`)
24556
24556
  }
24557
24557
  ] : [],
24558
24558
  {
24559
24559
  id: "col-colour-rules",
24560
- label: "Colour rules\u2026",
24560
+ label: "Color rules\u2026",
24561
24561
  onSelect: () => setRulesOpen(columnKey)
24562
24562
  },
24563
24563
  {
@@ -24611,7 +24611,7 @@ function useGridColours(args) {
24611
24611
  if (!field2) continue;
24612
24612
  const answer = await client.tableDecorate({ table_id: tableId, path: ["cells", cell2.rowId, field2.id], value: color });
24613
24613
  if (!answer.ok) {
24614
- notify?.error(`The colour was not kept: ${refusalSentence(answer.error)}`);
24614
+ notify?.error(`The color was not kept: ${refusalSentence(answer.error)}`);
24615
24615
  return;
24616
24616
  }
24617
24617
  decorations.apply(answer.data);
@@ -24656,13 +24656,13 @@ function useGridColours(args) {
24656
24656
  drafts: draftsFromView(view.rules, fields),
24657
24657
  onSave: async (drafts) => {
24658
24658
  view.save(viewRulesFrom(drafts));
24659
- notify?.success(drafts.length === 0 ? "This view's colour rules are cleared." : "This view's colour rules are kept.");
24659
+ notify?.success(drafts.length === 0 ? "This view's color rules are cleared." : "This view's color rules are kept.");
24660
24660
  setRulesOpen(null);
24661
24661
  }
24662
24662
  }
24663
24663
  } : {},
24664
24664
  onSave: async (drafts) => {
24665
- const kept = await write(["rules"], rulesLeaf(drafts, fields), drafts.length === 0 ? "The colour rules are cleared." : "The colour rules are kept.");
24665
+ const kept = await write(["rules"], rulesLeaf(drafts, fields), drafts.length === 0 ? "The color rules are cleared." : "The color rules are kept.");
24666
24666
  if (kept) setRulesOpen(null);
24667
24667
  }
24668
24668
  }
@@ -24670,25 +24670,25 @@ function useGridColours(args) {
24670
24670
  const colourable = fields.filter(colourableBy);
24671
24671
  const byId = decorations.data?.color_by?.field ?? null;
24672
24672
  const sheet = enabled ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex flex-col gap-1.5", "data-records-grid-sheet-colours": "", children: [
24673
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Colours" }),
24673
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Colors" }),
24674
24674
  mayColour ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-center gap-2", children: [
24675
24675
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("label", { className: "flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground", children: [
24676
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "shrink-0", children: "Colour rows by" }),
24676
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "shrink-0", children: "Color rows by" }),
24677
24677
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
24678
24678
  PickOne,
24679
24679
  {
24680
- label: "Colour rows by",
24680
+ label: "Color rows by",
24681
24681
  className: "h-10 min-w-0 flex-1 text-base",
24682
24682
  value: byId ?? "",
24683
24683
  onChange: (id) => {
24684
24684
  const field2 = fields.find((f) => f.id === id);
24685
- void (field2 ? write(["color_by"], { field: field2.id, target: "row" }, `Each row wears the colour of its ${fieldName(field2)}.`) : write(["color_by"], null, "Rows are no longer coloured by a column."));
24685
+ void (field2 ? write(["color_by"], { field: field2.id, target: "row" }, `Each row wears the color of its ${fieldName(field2)}.`) : write(["color_by"], null, "Rows are no longer colored by a column."));
24686
24686
  },
24687
- options: [{ value: "", label: "No colour" }, ...colourable.map((field2) => ({ value: field2.id, label: fieldName(field2) }))]
24687
+ options: [{ value: "", label: "No color" }, ...colourable.map((field2) => ({ value: field2.id, label: fieldName(field2) }))]
24688
24688
  }
24689
24689
  )
24690
24690
  ] }),
24691
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.Button, { type: "button", size: "sm", variant: "outline", className: "h-10 shrink-0", onClick: () => setRulesOpen(colourable[0]?.key ?? fields[0]?.key ?? ""), children: "Colour rules\u2026" })
24691
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.Button, { type: "button", size: "sm", variant: "outline", className: "h-10 shrink-0", onClick: () => setRulesOpen(colourable[0]?.key ?? fields[0]?.key ?? ""), children: "Color rules\u2026" })
24692
24692
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-xs text-muted-foreground", children: whyNot })
24693
24693
  ] }) : null;
24694
24694
  return { headerItem, cellItem, cellsItem, rowItem, dialogs, sheet };
@@ -24739,7 +24739,7 @@ function ColourRulesDialog({
24739
24739
  const first = startField ?? fields[0]?.key ?? "";
24740
24740
  return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.Dialog, { open, onOpenChange: (next) => !next ? close() : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system66.DialogContent, { className: "sm:max-w-2xl", "data-records-colour-rules": "", children: [
24741
24741
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system66.DialogHeader, { children: [
24742
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.DialogTitle, { children: "Colour rules" }),
24742
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.DialogTitle, { children: "Color rules" }),
24743
24743
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system66.DialogDescription, { children: scope === "view" ? "The first rule a row matches wins. These rules belong to this view alone, and a date can be tested against today." : "The first rule a row matches wins. A rule tints the whole row, or only the cell it reads. Everyone who opens this table sees them." })
24744
24744
  ] }),
24745
24745
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex flex-col gap-2", children: [
@@ -24827,7 +24827,7 @@ function ColourRulesDialog({
24827
24827
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
24828
24828
  PickOne,
24829
24829
  {
24830
- label: "Colour",
24830
+ label: "Color",
24831
24831
  attrs: { "data-records-colour-rule-color": "" },
24832
24832
  className: SELECT2,
24833
24833
  value: rule.color,
@@ -29880,8 +29880,8 @@ function columnForField(field2, editing, mayWriteRow, whyNotRow, look, onAskWhoC
29880
29880
  // A column that holds numbers filters as numbers (=, <, >, between) — the record number too,
29881
29881
  // which is worked out but kept (review 2: the autonumber header offered "Contains").
29882
29882
  filter: filterRefusal(field2) !== null ? false : editorKindFor(field2) === "select" || editorKindFor(field2) === "multi_select" ? "select" : (0, import_first_page2.holdsNumbers)(field2) ? "number" : "auto",
29883
- // THE MENU'S VALUE LIST WEARS THE CHOICES' COLOURS (lane CELL-EDITORS, night walk 2026-10-06): the
29884
- // same chip the cell draws, never bare words beside a coloured column.
29883
+ // THE MENU'S VALUE LIST WEARS THE CHOICES' COLORS (lane CELL-EDITORS, night walk 2026-10-06): the
29884
+ // same chip the cell draws, never bare words beside a colored column.
29885
29885
  ...editorKindFor(field2) === "select" || editorKindFor(field2) === "multi_select" ? { filterValueClass: (value, label) => choiceChipLookOf(field2, value, label).className } : {},
29886
29886
  cell: (row) => (
29887
29887
  /*
@@ -29930,7 +29930,7 @@ function columnForField(field2, editing, mayWriteRow, whyNotRow, look, onAskWhoC
29930
29930
  // The type is in the header's tooltip rather than a second header row: one
29931
29931
  // row of headers, always — and it is the parity type's own WORD, not a
29932
29932
  // token (`Long text`, never `long_text`).
29933
- // CENTRED, EVERY WIDTH (Arman 2026-10-08: tick boxes sat on the cell's top edge). A grid row is
29933
+ // CENTERED, EVERY WIDTH (Arman 2026-10-08: tick boxes sat on the cell's top edge). A grid row is
29934
29934
  // ONE line (`cellLines` "one", the table's default), so nothing here wraps and top-aligning only
29935
29935
  // lifted every value — text ~4 px, a 16 px tick box ~8 px — above the row's middle, out of line
29936
29936
  // with the row's own controls. The table's cell is `align-middle`; this column no longer overrides it.
@@ -34014,9 +34014,9 @@ function GridBody({
34014
34014
  () => (0, import_data_table14.tableStyleIsEmpty)(paint.style) ? null : {
34015
34015
  style: paint.style,
34016
34016
  // A choice is read as its OPTION (`paintByOption`): the rule, the value and the
34017
- // colour a column keeps for it all name the same option, however it is stored.
34017
+ // color a column keeps for it all name the same option, however it is stored.
34018
34018
  documentOf: (row) => paint.documentOf(row.document ?? {}),
34019
- // A value its column keeps a colour for wears THAT colour (`choiceLooks.ts`);
34019
+ // A value its column keeps a color for wears THAT color (`choiceLooks.ts`);
34020
34020
  // any other value still paints from its word.
34021
34021
  choiceColorFor: paint.choiceColorFor
34022
34022
  },
@@ -36730,7 +36730,7 @@ function VersionRow({
36730
36730
  children: mine ? "Working out what would change\u2026" : "Put the record back to this version"
36731
36731
  }
36732
36732
  ) }) : (
36733
- // Absent AND explained: never a greyed button, never silence.
36733
+ // Absent AND explained: never a grayed button, never silence.
36734
36734
  /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-[11px] text-muted-foreground", children: whyNotRestore })
36735
36735
  )
36736
36736
  ] }) : null
@@ -41895,7 +41895,7 @@ function CalendarView({
41895
41895
  type: "button",
41896
41896
  className: (0, import_design_system119.cn)(
41897
41897
  "@container flex w-full min-w-0 items-center gap-1 truncate rounded border px-1.5 py-0.5 text-left text-xs hover:brightness-95",
41898
- // The chip palette, not the faint row tint: a calendar is read by its colours at a glance.
41898
+ // The chip palette, not the faint row tint: a calendar is read by its colors at a glance.
41899
41899
  color ? import_data_table19.CHOICE_CHIP_CLASS[color] : "bg-background",
41900
41900
  may ? "cursor-grab active:cursor-grabbing" : "cursor-default",
41901
41901
  compact ? "min-h-3 px-0" : "",
@@ -41948,7 +41948,7 @@ function CalendarView({
41948
41948
  setEndPick(key);
41949
41949
  onEndFieldChange?.(key);
41950
41950
  }, endKept ?? Boolean(onEndFieldChange), endUnusual) : null,
41951
- choiceFields.length > 0 ? picker("Colour by", colorKey, choiceFields, (key) => {
41951
+ choiceFields.length > 0 ? picker("Color by", colorKey, choiceFields, (key) => {
41952
41952
  setColorPick(key);
41953
41953
  onColorFieldChange?.(key);
41954
41954
  }, true) : null
@@ -43200,7 +43200,7 @@ function TimelineView({
43200
43200
  dates.length > 1 || !startField || !dates.some((f) => f.key === startChosen) ? picker("Start", startChosen, dates, (key) => setting({ startKey: key }), { none: false }) : null,
43201
43201
  endCandidates.length > 0 || endField && !endCandidates.includes(endField) ? picker("End", endChosen, endCandidates, (key) => setting({ endKey: key }), { kept: layoutKept }) : null,
43202
43202
  groupCandidates.length > 0 ? picker("Group by", groupChosen, groupCandidates, (key) => setting({ groupKey: key })) : null,
43203
- choiceFields.length > 0 ? picker("Colour by", colorChosen, choiceFields, (key) => setting({ colorKey: key })) : null
43203
+ choiceFields.length > 0 ? picker("Color by", colorChosen, choiceFields, (key) => setting({ colorKey: key })) : null
43204
43204
  ] });
43205
43205
  const heading = zoom === "quarter" ? `Q${Math.floor(dayAt(anchor).getMonth() / 3) + 1} ${dayAt(anchor).getFullYear()}` : dayAt(anchor).toLocaleDateString(void 0, { month: "long", year: "numeric" });
43206
43206
  const toolbar = /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
@@ -43855,7 +43855,7 @@ function BoardOptions({
43855
43855
  )
43856
43856
  ] }) : null,
43857
43857
  toggle("Count per column", "boardCounts", look.boardCounts !== false),
43858
- toggle("Colour the columns", "boardColorColumns", look.boardColorColumns !== false),
43858
+ toggle("Color the columns", "boardColorColumns", look.boardColorColumns !== false),
43859
43859
  toggle("Hide empty groups", "boardHideEmpty", look.boardHideEmpty === true),
43860
43860
  remembered ? null : /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "text-muted-foreground", children: "Kept for this visit only." })
43861
43861
  ] })
@@ -44123,7 +44123,7 @@ var CHART_KIND_LABEL = {
44123
44123
  // (FIX-10C F12, 2026-09-22). The kind key stays `stuck` — it is the store's
44124
44124
  // closed set and renaming it would be a second idea of the same shape — but
44125
44125
  // the WORD in the picker read "Stuck", which is our jargon for a record that
44126
- // has sat on one value too long, not a shape anybody recognises beside
44126
+ // has sat on one value too long, not a shape anybody recognizes beside
44127
44127
  // Number, Bars, Columns, Line, Donut and Table. This block lists the records
44128
44128
  // that have not moved, so that is what it is called.
44129
44129
  stuck: "Not moving"
@@ -44245,7 +44245,7 @@ var SERIES_COLORS = [
44245
44245
  "hsl(var(--warning))",
44246
44246
  "hsl(var(--destructive))",
44247
44247
  "hsl(var(--accent-foreground))",
44248
- // Slices 7-12: the theme's own chart tokens, so a donut of 8-12 slices never repeats a colour.
44248
+ // Slices 7-12: the theme's own chart tokens, so a donut of 8-12 slices never repeats a color.
44249
44249
  "hsl(var(--chart-1))",
44250
44250
  "hsl(var(--chart-2))",
44251
44251
  "hsl(var(--chart-3))",
@@ -49213,7 +49213,7 @@ function ActionInbox({
49213
49213
  item.summary ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "text-xs text-muted-foreground", children: item.summary }) : null,
49214
49214
  snoozing === item.item_id ? (
49215
49215
  // SUPERHUMAN'S CHOICES, then any moment the person names. The picked time's own Snooze is
49216
- // absent until a time is picked — never a greyed button that does nothing.
49216
+ // absent until a time is picked — never a grayed button that does nothing.
49217
49217
  /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
49218
49218
  "div",
49219
49219
  {
@@ -50251,7 +50251,7 @@ function PortalLookEditor({ card, onSaved, className }) {
50251
50251
  )
50252
50252
  ] }),
50253
50253
  /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)("div", { className: "flex flex-col gap-1 text-xs", children: [
50254
- /* @__PURE__ */ (0, import_jsx_runtime164.jsx)("span", { children: "Colour" }),
50254
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)("span", { children: "Color" }),
50255
50255
  /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(AccentSwatches, { value: accent, onChange: setAccent, options: card.accents })
50256
50256
  ] }),
50257
50257
  /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)("div", { className: "flex flex-col gap-1 text-xs", children: [
@@ -51254,7 +51254,7 @@ function DigestScheduler({
51254
51254
  // Tables this person can already open — never a grant on the table behind it.
51255
51255
  client.views({ table_id: tableId }),
51256
51256
  // The cadences are ASKED, never typed into this file, so a picker can
51257
- // never offer a cadence the digest runner does not honour.
51257
+ // never offer a cadence the digest runner does not honor.
51258
51258
  client.subscriptionCadences()
51259
51259
  ]);
51260
51260
  if (!saved.ok) setError(saved.error);
@@ -51356,11 +51356,11 @@ function DigestScheduler({
51356
51356
  )
51357
51357
  ] }),
51358
51358
  savedViewId ? null : /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("label", { className: "flex flex-col gap-1", children: [
51359
- /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_design_system143.Label, { className: "text-xs font-medium", children: "What it summarises" }),
51359
+ /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_design_system143.Label, { className: "text-xs font-medium", children: "What it summarizes" }),
51360
51360
  /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(
51361
51361
  import_controls9.Select,
51362
51362
  {
51363
- "aria-label": "What it summarises",
51363
+ "aria-label": "What it summarizes",
51364
51364
  value: viewId,
51365
51365
  onValueChange: setViewId,
51366
51366
  options: [
@@ -52662,7 +52662,7 @@ function FormStage({
52662
52662
  {
52663
52663
  className: (0, import_design_system147.cn)(
52664
52664
  "mx-auto flex w-full max-w-2xl flex-col gap-4 py-4",
52665
- // TYPEFORM'S SIZE (TYPEFORM-2): one question at a time fills the screen, centred in it.
52665
+ // TYPEFORM'S SIZE (TYPEFORM-2): one question at a time fills the screen, centered in it.
52666
52666
  oneAtATime && "min-h-[min(70dvh,640px)]",
52667
52667
  theme.surface,
52668
52668
  theme.background !== "plain" && "rounded-lg px-5 sm:px-8",
@@ -52891,7 +52891,7 @@ function Question({
52891
52891
  ),
52892
52892
  uploadError ? /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(RefusalLine, { error: uploadError }) : null
52893
52893
  ] }) : (
52894
- // A choice is laid out as lettered rows in the form's colour (`ChoiceAnswer`).
52894
+ // A choice is laid out as lettered rows in the form's color (`ChoiceAnswer`).
52895
52895
  /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(FieldControl, { field: field2, value, onChange, id, asForm: true, onChosen })
52896
52896
  ),
52897
52897
  /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("p", { id: sayId, role: "alert", "aria-live": "assertive", className: "min-h-0 empty:hidden", "data-records-form-refused": "", children: refused ? /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("span", { className: "inline-flex items-center gap-1.5 rounded bg-destructive px-2 py-1 text-sm font-medium text-destructive-foreground", children: [
@@ -53453,7 +53453,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
53453
53453
  AccentSwatches,
53454
53454
  {
53455
53455
  value: draft.look?.accent ?? "",
53456
- noneLabel: "Organization colour",
53456
+ noneLabel: "Organization color",
53457
53457
  onChange: (accent) => patchLook({ accent: accent || null })
53458
53458
  }
53459
53459
  ),
@@ -58222,7 +58222,7 @@ function InterfaceScreen({
58222
58222
  /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
58223
58223
  PickOne,
58224
58224
  {
58225
- label: "Colour",
58225
+ label: "Color",
58226
58226
  value: shape.color,
58227
58227
  options: INTERFACE_COLORS.map((c) => ({ value: c, label: c[0].toUpperCase() + c.slice(1) })),
58228
58228
  onChange: (color) => void save({ ...shape, color }),
@@ -63538,7 +63538,7 @@ var READS_ON_PROBLEM_WORDS = {
63538
63538
  missing: "no row by that name",
63539
63539
  self: "reads on itself",
63540
63540
  duplicate: "two rows share that name",
63541
- "no-colour": "that row has no colour"
63541
+ "no-colour": "that row has no color"
63542
63542
  };
63543
63543
  function resolveReadsOn(row, rows, keys) {
63544
63544
  if (!keys.readsOn || !keys.name) return { on: null, problem: null, target: null };
@@ -63724,6 +63724,21 @@ function SectionCard(props) {
63724
63724
  if (props.source.kind === "entity") return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(EntitySectionCard, { ...props, source: props.source });
63725
63725
  return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(TableSectionCard, { ...props, tableId: props.source.id });
63726
63726
  }
63727
+ var SECTION_NARROW_PX = 576;
63728
+ function useNarrow2(ref) {
63729
+ const [narrow, setNarrow] = (0, import_react360.useState)(false);
63730
+ (0, import_react360.useEffect)(() => {
63731
+ const el = ref.current;
63732
+ if (!el || typeof ResizeObserver === "undefined") return;
63733
+ const ro = new ResizeObserver(() => {
63734
+ const w = el.getBoundingClientRect().width;
63735
+ if (w > 0) setNarrow(w < SECTION_NARROW_PX);
63736
+ });
63737
+ ro.observe(el);
63738
+ return () => ro.disconnect();
63739
+ }, [ref]);
63740
+ return narrow;
63741
+ }
63727
63742
  function TableSectionCard(props) {
63728
63743
  const { tableId, readOnly, noun = "entry", onFix, className } = props;
63729
63744
  const table = (0, import_react361.useTable)(tableId);
@@ -63771,7 +63786,10 @@ function TableSectionCard(props) {
63771
63786
  const rowNames = nameField ? rows.map((r) => String((r.document ?? {})[nameField.key] ?? "")).filter((n) => n !== "") : [];
63772
63787
  const refused = table.error ?? fieldsRead.error ?? page.error;
63773
63788
  const gridStyle = { gridTemplateColumns: `minmax(8rem, 12rem) repeat(${Math.max(columns.length, 1)}, minmax(0, 1fr)) 4.5rem` };
63774
- return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("section", { "data-records-section-card": "", className: (0, import_design_system181.cn)("rounded-2xl border border-border bg-card text-card-foreground", className), children: [
63789
+ const sectionRef = (0, import_react360.useRef)(null);
63790
+ const narrow = useNarrow2(sectionRef);
63791
+ const cellLabel = (c) => c.part ? columns.filter((x) => x.field.key === c.field.key).map((x) => x.header).join(" \xB7 ") : c.header;
63792
+ return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("section", { ref: sectionRef, "data-records-section-card": "", "data-narrow": narrow ? "" : void 0, className: (0, import_design_system181.cn)("rounded-2xl border border-border bg-card text-card-foreground", className), children: [
63775
63793
  /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("header", { className: "flex items-start justify-between gap-4 px-5 pt-5 pb-3 sm:px-6", children: [
63776
63794
  /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { className: "min-w-0", children: [
63777
63795
  /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("h2", { className: "truncate font-serif text-2xl tracking-tight text-foreground", children: title || "\xA0" }),
@@ -63782,7 +63800,7 @@ function TableSectionCard(props) {
63782
63800
  "Add"
63783
63801
  ] }) : null
63784
63802
  ] }),
63785
- refused ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: "Nothing here yet." }) : /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: "-mb-px overflow-x-auto", children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { "data-records-section-group": group.key, className: "", children: [
63803
+ refused ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: "Nothing here yet." }) : /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: (0, import_design_system181.cn)("-mb-px", !narrow && "overflow-x-auto"), children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { "data-records-section-group": group.key, className: "", children: [
63786
63804
  cols.group ? /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { className: "flex items-center justify-between border-y border-border px-5 py-1 sm:px-6", children: [
63787
63805
  /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { className: "text-xs font-semibold text-foreground", children: group.key || "No group" }),
63788
63806
  mayWrite ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
@@ -63796,8 +63814,8 @@ function TableSectionCard(props) {
63796
63814
  }
63797
63815
  ) : null
63798
63816
  ] }) : null,
63799
- /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { role: "table", "aria-label": group.key || title, className: "min-w-[36rem]", children: [
63800
- /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { role: "row", style: gridStyle, className: "grid border-b border-border text-xs text-muted-foreground", children: [
63817
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { role: "table", "aria-label": group.key || title, className: narrow ? "" : "min-w-[36rem]", children: [
63818
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { role: "row", style: gridStyle, className: (0, import_design_system181.cn)("grid border-b border-border text-xs text-muted-foreground", narrow && "hidden"), children: [
63801
63819
  /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { role: "columnheader", className: "border-r border-border px-5 py-1.5 sm:px-6", children: nameField ? fieldName(nameField) : "Name" }),
63802
63820
  columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { role: "columnheader", className: "truncate px-3 py-1.5", children: c.header }, `${c.field.key}-${c.part ?? ""}`)),
63803
63821
  /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", {})
@@ -63805,46 +63823,59 @@ function TableSectionCard(props) {
63805
63823
  group.rows.map((row) => {
63806
63824
  const editable = mayWrite && (0, import_field_kinds9.atLeast)(row.level, "edit_content");
63807
63825
  const rowSave = save(row);
63808
- return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { role: "row", "data-records-section-row": row.id, style: gridStyle, className: "grid items-center border-b border-border", children: [
63809
- /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("span", { role: "cell", className: "min-w-0 self-stretch border-r border-border px-5 py-1.5 sm:px-6", children: [
63810
- /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { className: "block truncate font-mono text-sm text-foreground", children: nameField ? String((row.document ?? {})[nameField.key] ?? "") : row.id }),
63811
- readsOnField ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
63812
- ReadsOnPicker,
63813
- {
63814
- row,
63815
- field: readsOnField,
63816
- names: [...new Set(rowNames)].filter((n) => !sameName(n, String((row.document ?? {})[nameField?.key ?? ""] ?? ""))),
63817
- editable,
63818
- save: rowSave,
63819
- problem: resolveReadsOn(row, rows, { name: cols.name, readsOn: cols.readsOn, color: readsOnColorKey }).problem
63820
- }
63821
- ) : null
63822
- ] }),
63823
- cells.map((c) => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
63824
- "div",
63825
- {
63826
- role: "cell",
63827
- style: c.part ? { gridColumn: "span 2" } : void 0,
63828
- className: (0, import_design_system181.cn)("min-w-0 py-1", c.part ? "" : "px-3"),
63829
- children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
63830
- ValueCell,
63826
+ return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
63827
+ "div",
63828
+ {
63829
+ role: "row",
63830
+ "data-records-section-row": row.id,
63831
+ style: narrow ? void 0 : gridStyle,
63832
+ className: narrow ? "relative flex flex-col gap-1.5 border-b border-border px-4 py-2.5" : "grid items-center border-b border-border",
63833
+ children: [
63834
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("span", { role: "cell", className: narrow ? "min-w-0 pr-16" : "min-w-0 self-stretch border-r border-border px-5 py-1.5 sm:px-6", children: [
63835
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { className: "block truncate font-mono text-sm text-foreground", children: nameField ? String((row.document ?? {})[nameField.key] ?? "") : row.id }),
63836
+ readsOnField ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
63837
+ ReadsOnPicker,
63838
+ {
63839
+ row,
63840
+ field: readsOnField,
63841
+ names: [...new Set(rowNames)].filter((n) => !sameName(n, String((row.document ?? {})[nameField?.key ?? ""] ?? ""))),
63842
+ editable,
63843
+ save: rowSave,
63844
+ problem: resolveReadsOn(row, rows, { name: cols.name, readsOn: cols.readsOn, color: readsOnColorKey }).problem
63845
+ }
63846
+ ) : null
63847
+ ] }),
63848
+ cells.map((c) => /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
63849
+ "div",
63831
63850
  {
63832
- row,
63833
- column: c,
63834
- editable,
63835
- save: rowSave,
63836
- onFix,
63837
- context: c.field.key === readsOnColorKey ? groundOf(row, rows, { name: cols.name, readsOn: cols.readsOn, color: c.field.key }) : void 0
63838
- }
63839
- )
63840
- },
63841
- c.field.key
63842
- )),
63843
- /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("span", { role: "cell", className: "flex items-center justify-end gap-0.5 pr-2", children: [
63844
- /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(RowComments, { tableId, row, count: counts[row.id] ?? 0, onClosed: () => setCountsAsked((n) => n + 1) }),
63845
- noteField ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(NoteButton, { row, noteField, editable, save: rowSave }) : null
63846
- ] })
63847
- ] }, row.id);
63851
+ role: "cell",
63852
+ style: c.part ? { gridColumn: "span 2" } : void 0,
63853
+ className: narrow ? "min-w-0" : (0, import_design_system181.cn)("min-w-0 py-1", c.part ? "" : "px-3"),
63854
+ children: [
63855
+ narrow ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("span", { className: "mb-0.5 block text-xs text-muted-foreground", children: cellLabel(c) }) : null,
63856
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
63857
+ ValueCell,
63858
+ {
63859
+ row,
63860
+ column: c,
63861
+ editable,
63862
+ save: rowSave,
63863
+ onFix,
63864
+ context: c.field.key === readsOnColorKey ? groundOf(row, rows, { name: cols.name, readsOn: cols.readsOn, color: c.field.key }) : void 0
63865
+ }
63866
+ )
63867
+ ]
63868
+ },
63869
+ c.field.key
63870
+ )),
63871
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("span", { role: "cell", className: narrow ? "absolute right-2 top-2 flex items-center gap-0.5" : "flex items-center justify-end gap-0.5 pr-2", children: [
63872
+ /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(RowComments, { tableId, row, count: counts[row.id] ?? 0, onClosed: () => setCountsAsked((n) => n + 1) }),
63873
+ noteField ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(NoteButton, { row, noteField, editable, save: rowSave }) : null
63874
+ ] })
63875
+ ]
63876
+ },
63877
+ row.id
63878
+ );
63848
63879
  })
63849
63880
  ] })
63850
63881
  ] }, group.key || "__ungrouped")) }),