@arbidocs/blocks 0.4.144 → 0.4.146

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 (154) hide show
  1. package/dist/agents/index.cjs +264 -264
  2. package/dist/agents/index.js +7 -7
  3. package/dist/{chunk-ON3TKY5Y.js → chunk-5YHEHEJT.js} +242 -4
  4. package/dist/chunk-5YHEHEJT.js.map +1 -0
  5. package/dist/{chunk-7NGAWGA3.js → chunk-A6IU4GIW.js} +190 -7
  6. package/dist/chunk-A6IU4GIW.js.map +1 -0
  7. package/dist/{chunk-BUWBXJ2N.cjs → chunk-C3CGJK7A.cjs} +192 -6
  8. package/dist/chunk-C3CGJK7A.cjs.map +1 -0
  9. package/dist/{chunk-X3TGXEFS.js → chunk-C44TDH54.js} +6 -6
  10. package/dist/{chunk-X3TGXEFS.js.map → chunk-C44TDH54.js.map} +1 -1
  11. package/dist/{chunk-YFY3TQ6Q.cjs → chunk-COCGRJLA.cjs} +7 -7
  12. package/dist/{chunk-YFY3TQ6Q.cjs.map → chunk-COCGRJLA.cjs.map} +1 -1
  13. package/dist/{chunk-45LRMW54.js → chunk-DN2KI4BU.js} +8 -10
  14. package/dist/chunk-DN2KI4BU.js.map +1 -0
  15. package/dist/{chunk-R26BK7YL.cjs → chunk-DTROMMDX.cjs} +4 -4
  16. package/dist/{chunk-R26BK7YL.cjs.map → chunk-DTROMMDX.cjs.map} +1 -1
  17. package/dist/{chunk-65THHQVB.cjs → chunk-ECW2R2KF.cjs} +27 -27
  18. package/dist/{chunk-65THHQVB.cjs.map → chunk-ECW2R2KF.cjs.map} +1 -1
  19. package/dist/{chunk-RI6DZA5X.js → chunk-EF4ZLKRM.js} +3 -3
  20. package/dist/{chunk-RI6DZA5X.js.map → chunk-EF4ZLKRM.js.map} +1 -1
  21. package/dist/chunk-EV7W64B6.js +134 -0
  22. package/dist/chunk-EV7W64B6.js.map +1 -0
  23. package/dist/{chunk-WS5EX7DN.cjs → chunk-EYKISBDO.cjs} +5 -5
  24. package/dist/{chunk-WS5EX7DN.cjs.map → chunk-EYKISBDO.cjs.map} +1 -1
  25. package/dist/{chunk-JZNXRMLH.cjs → chunk-GAYMJWTC.cjs} +8 -10
  26. package/dist/chunk-GAYMJWTC.cjs.map +1 -0
  27. package/dist/{chunk-I7WG3JRD.js → chunk-H4D7WKDY.js} +3 -3
  28. package/dist/{chunk-I7WG3JRD.js.map → chunk-H4D7WKDY.js.map} +1 -1
  29. package/dist/{chunk-2FJMTZNJ.js → chunk-IJST4EBM.js} +8 -8
  30. package/dist/{chunk-2FJMTZNJ.js.map → chunk-IJST4EBM.js.map} +1 -1
  31. package/dist/{chunk-3RJN2VTL.js → chunk-IXWJGOM2.js} +3 -3
  32. package/dist/{chunk-3RJN2VTL.js.map → chunk-IXWJGOM2.js.map} +1 -1
  33. package/dist/{chunk-CYNF5PZI.js → chunk-J5CWKFSC.js} +3 -3
  34. package/dist/{chunk-CYNF5PZI.js.map → chunk-J5CWKFSC.js.map} +1 -1
  35. package/dist/{chunk-TP6PLDNM.cjs → chunk-KMZWKSKO.cjs} +8 -8
  36. package/dist/{chunk-TP6PLDNM.cjs.map → chunk-KMZWKSKO.cjs.map} +1 -1
  37. package/dist/{chunk-C4WSHRR6.cjs → chunk-KPZZ5FHE.cjs} +32 -12
  38. package/dist/chunk-KPZZ5FHE.cjs.map +1 -0
  39. package/dist/{chunk-O2ODDTMA.cjs → chunk-LPYEUD2D.cjs} +9 -9
  40. package/dist/{chunk-O2ODDTMA.cjs.map → chunk-LPYEUD2D.cjs.map} +1 -1
  41. package/dist/{chunk-RA3ZJ45L.cjs → chunk-MFMASSEO.cjs} +25 -44
  42. package/dist/chunk-MFMASSEO.cjs.map +1 -0
  43. package/dist/chunk-NHZK64TQ.js +75 -0
  44. package/dist/chunk-NHZK64TQ.js.map +1 -0
  45. package/dist/{chunk-BPBSSMRB.js → chunk-NRFAWUVD.js} +3 -3
  46. package/dist/{chunk-BPBSSMRB.js.map → chunk-NRFAWUVD.js.map} +1 -1
  47. package/dist/chunk-NWNVWO6L.cjs +80 -0
  48. package/dist/chunk-NWNVWO6L.cjs.map +1 -0
  49. package/dist/{chunk-XGZX22ET.cjs → chunk-O2GW5IY6.cjs} +38 -38
  50. package/dist/{chunk-XGZX22ET.cjs.map → chunk-O2GW5IY6.cjs.map} +1 -1
  51. package/dist/{chunk-33ZOUJXA.js → chunk-OBWYM25Y.js} +13 -32
  52. package/dist/chunk-OBWYM25Y.js.map +1 -0
  53. package/dist/{chunk-Y3KA6X7B.js → chunk-OVR3XMYL.js} +4 -4
  54. package/dist/{chunk-Y3KA6X7B.js.map → chunk-OVR3XMYL.js.map} +1 -1
  55. package/dist/{chunk-ABUO6PIQ.cjs → chunk-RB7GX2VT.cjs} +12 -12
  56. package/dist/{chunk-ABUO6PIQ.cjs.map → chunk-RB7GX2VT.cjs.map} +1 -1
  57. package/dist/chunk-RXK3XP62.cjs +144 -0
  58. package/dist/chunk-RXK3XP62.cjs.map +1 -0
  59. package/dist/{chunk-LYUO3E6V.js → chunk-SZOFGU7W.js} +3 -3
  60. package/dist/{chunk-LYUO3E6V.js.map → chunk-SZOFGU7W.js.map} +1 -1
  61. package/dist/{chunk-A6J2IBUG.js → chunk-T5B7FM7S.js} +4 -4
  62. package/dist/{chunk-A6J2IBUG.js.map → chunk-T5B7FM7S.js.map} +1 -1
  63. package/dist/{chunk-YNIBUKV5.js → chunk-TBEVGWY3.js} +32 -14
  64. package/dist/chunk-TBEVGWY3.js.map +1 -0
  65. package/dist/{chunk-MJCCBMM5.cjs → chunk-TC3RQNEX.cjs} +6 -80
  66. package/dist/chunk-TC3RQNEX.cjs.map +1 -0
  67. package/dist/{chunk-QIMVTGKS.cjs → chunk-U73KPFYH.cjs} +255 -2
  68. package/dist/chunk-U73KPFYH.cjs.map +1 -0
  69. package/dist/{chunk-HFGXA5CL.cjs → chunk-UTTTJSQU.cjs} +4 -4
  70. package/dist/{chunk-HFGXA5CL.cjs.map → chunk-UTTTJSQU.cjs.map} +1 -1
  71. package/dist/{chunk-DLBUFHLY.js → chunk-VTTZZ4FN.js} +4 -74
  72. package/dist/chunk-VTTZZ4FN.js.map +1 -0
  73. package/dist/{chunk-5FTIHRZH.cjs → chunk-XVUOMWMD.cjs} +4 -4
  74. package/dist/{chunk-5FTIHRZH.cjs.map → chunk-XVUOMWMD.cjs.map} +1 -1
  75. package/dist/{chunk-444XKG46.js → chunk-YKQ2DPIP.js} +3 -3
  76. package/dist/{chunk-444XKG46.js.map → chunk-YKQ2DPIP.js.map} +1 -1
  77. package/dist/{chunk-HEMU73OP.cjs → chunk-YSHIC4NJ.cjs} +4 -4
  78. package/dist/{chunk-HEMU73OP.cjs.map → chunk-YSHIC4NJ.cjs.map} +1 -1
  79. package/dist/citations/index.cjs +12 -12
  80. package/dist/citations/index.js +3 -3
  81. package/dist/connect/docx.cjs +11 -11
  82. package/dist/connect/docx.js +8 -8
  83. package/dist/connect/index.cjs +1079 -333
  84. package/dist/connect/index.cjs.map +1 -1
  85. package/dist/connect/index.d.ts +2 -0
  86. package/dist/connect/index.js +953 -222
  87. package/dist/connect/index.js.map +1 -1
  88. package/dist/connection/ConnectedNotificationRelevance.d.ts +4 -1
  89. package/dist/connection/ConnectedSettings.d.ts +3 -2
  90. package/dist/connection/ai.d.ts +27 -72
  91. package/dist/connection/settings-page/ConnectedAccountSettings.d.ts +35 -0
  92. package/dist/connection/settings-page/ConnectedMailSettings.d.ts +13 -0
  93. package/dist/connection/settings-page/ConnectedPremiumModels.d.ts +1 -0
  94. package/dist/connection/settings-page/ConnectedPrivacySettings.d.ts +12 -0
  95. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +29 -0
  96. package/dist/connection/settings-page/SessionStatusIcon.d.ts +7 -0
  97. package/dist/connection/settings-page/index.d.ts +6 -0
  98. package/dist/connection/workspace-settings/ConnectedWorkspaceSettings.d.ts +53 -0
  99. package/dist/connection/workspace-settings/index.d.ts +2 -0
  100. package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +85 -0
  101. package/dist/connection/workspaceData.d.ts +6 -6
  102. package/dist/facts/index.cjs +3 -3
  103. package/dist/facts/index.js +2 -2
  104. package/dist/files/index.cjs +3 -3
  105. package/dist/files/index.js +2 -2
  106. package/dist/home/index.cjs +20 -20
  107. package/dist/home/index.js +4 -4
  108. package/dist/index.cjs +468 -632
  109. package/dist/index.cjs.map +1 -1
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +23 -204
  112. package/dist/index.js.map +1 -1
  113. package/dist/provider/BlocksProvider.d.ts +5 -1
  114. package/dist/provider/settings-section.d.ts +9 -0
  115. package/dist/retrieval/index.cjs +4 -4
  116. package/dist/retrieval/index.js +2 -2
  117. package/dist/settings/AppearanceSettings.d.ts +18 -0
  118. package/dist/settings/ServerConnectionControls.d.ts +16 -0
  119. package/dist/settings/SettingsPage.d.ts +31 -0
  120. package/dist/settings/index.cjs +178 -241
  121. package/dist/settings/index.cjs.map +1 -1
  122. package/dist/settings/index.d.ts +3 -1
  123. package/dist/settings/index.js +86 -198
  124. package/dist/settings/index.js.map +1 -1
  125. package/dist/shell/index.cjs +44 -44
  126. package/dist/shell/index.js +3 -3
  127. package/dist/site/index.cjs +74 -73
  128. package/dist/site/index.js +3 -2
  129. package/dist/studio/index.cjs +78 -77
  130. package/dist/studio/index.cjs.map +1 -1
  131. package/dist/studio/index.js +10 -9
  132. package/dist/studio/index.js.map +1 -1
  133. package/dist/workflow-canvas/index.cjs +25 -25
  134. package/dist/workflow-canvas/index.js +8 -8
  135. package/dist/workspaces/CommonWorkspaceToggle.d.ts +15 -0
  136. package/dist/workspaces/index.cjs +41 -110
  137. package/dist/workspaces/index.cjs.map +1 -1
  138. package/dist/workspaces/index.d.ts +1 -0
  139. package/dist/workspaces/index.js +7 -104
  140. package/dist/workspaces/index.js.map +1 -1
  141. package/node_modules/@arbidocs/coedit/package.json +1 -1
  142. package/package.json +4 -4
  143. package/dist/chunk-33ZOUJXA.js.map +0 -1
  144. package/dist/chunk-45LRMW54.js.map +0 -1
  145. package/dist/chunk-7NGAWGA3.js.map +0 -1
  146. package/dist/chunk-BUWBXJ2N.cjs.map +0 -1
  147. package/dist/chunk-C4WSHRR6.cjs.map +0 -1
  148. package/dist/chunk-DLBUFHLY.js.map +0 -1
  149. package/dist/chunk-JZNXRMLH.cjs.map +0 -1
  150. package/dist/chunk-MJCCBMM5.cjs.map +0 -1
  151. package/dist/chunk-ON3TKY5Y.js.map +0 -1
  152. package/dist/chunk-QIMVTGKS.cjs.map +0 -1
  153. package/dist/chunk-RA3ZJ45L.cjs.map +0 -1
  154. package/dist/chunk-YNIBUKV5.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { ActionLink } from './chunk-444XKG46.js';
2
+ import { ActionLink } from './chunk-YKQ2DPIP.js';
3
3
  import { observeResize } from './chunk-NPLYHR2E.js';
4
4
  import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
5
5
  import { formatCount } from './chunk-OXF2IFXG.js';
@@ -504,5 +504,5 @@ function StartTiles({ items, caption, captionTestId, className, testId }) {
504
504
  }
505
505
 
506
506
  export { AddFilesFirst, DEFAULT_ADD_FILES_FIRST_LABELS, DEFAULT_SCOPE_PICKER_LABELS, EmptyStrip, FoldSection, QuickActionDialogHeader, ScopePicker, SectionHeader, SectionLabel, StartTiles, useScopeSelection };
507
- //# sourceMappingURL=chunk-3RJN2VTL.js.map
508
- //# sourceMappingURL=chunk-3RJN2VTL.js.map
507
+ //# sourceMappingURL=chunk-IXWJGOM2.js.map
508
+ //# sourceMappingURL=chunk-IXWJGOM2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/home/FoldSection.tsx","../src/home/AddFilesFirst.tsx","../src/home/QuickActionDialogHeader.tsx","../src/lib/useScopeSelection.ts","../src/home/ScopePicker.tsx","../src/home/sections.tsx","../src/lib/balanced-columns.ts","../src/home/StartTiles.tsx"],"names":["jsxs","jsx","cn","useMemo","useState"],"mappings":";;;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,6CAAA,EAA+C,eAAK,KAAA,EAAM,CAAA;AAAA,sCAC1EA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,uDAAA,EACb,QAAA,EAAA,IAAA,CAAK,QAAA,IAAY,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,WAAA,EACrE;AAAA,qBAAA,EACF;AAAA;AAAA,iBAAA;AAAA,gBA3BK,IAAA,CAAK;AAAA,eA4BZ;AAAA,YAEJ,CAAC;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-3RJN2VTL.js","sourcesContent":["import type { ReactNode } from 'react'\nimport { ChevronDown } from 'lucide-react'\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from '@arbidocs/react/ui'\n\nexport interface FoldSectionProps {\n label: string\n /** Shown as plain muted text beside the name; omit or pass 0 to hide. */\n count?: number\n /** A word or two of state for sections a count cannot summarise (shown while shut). */\n hint?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Trigger test id; the caller owns the naming. */\n testId: string\n children: ReactNode\n}\n\n/**\n * One foldable block of a dialog. The chevron and the name are the whole hit\n * target (44px on touch), and the count keeps the selection readable while the\n * section is shut, so you need not re-open it to check.\n */\nexport function FoldSection({\n label,\n count = 0,\n hint,\n open,\n onOpenChange,\n testId,\n children,\n}: FoldSectionProps) {\n return (\n <Collapsible open={open} onOpenChange={onOpenChange} data-slot=\"fold-section\">\n <CollapsibleTrigger\n className=\"mb-1.5 flex w-full items-center gap-1.5 rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:text-muted-foreground pointer-coarse:min-h-11\"\n data-testid={testId}\n >\n <ChevronDown\n className={cn('size-4 shrink-0 transition-transform', !open && '-rotate-90')}\n />\n <span>{label}</span>\n {count > 0 && <span className=\"text-xs tabular-nums text-muted-foreground\">{count}</span>}\n {hint && !open && (\n <span className=\"min-w-0 truncate text-xs font-normal text-muted-foreground\">{hint}</span>\n )}\n </CollapsibleTrigger>\n <CollapsibleContent>{children}</CollapsibleContent>\n </Collapsible>\n )\n}\n","import type { ReactNode } from 'react'\nimport { FolderPlus } from 'lucide-react'\n\n/** Fixed strings of the empty-files state. */\nexport interface AddFilesFirstLabels {\n heading: string\n}\n\nexport const DEFAULT_ADD_FILES_FIRST_LABELS: AddFilesFirstLabels = {\n heading: 'Add files first',\n}\n\nexport interface AddFilesFirstProps {\n /** Why this action needs files, in the action's own words. */\n reason: string\n /** The host's own \"Add\" control. */\n action: ReactNode\n testId?: string\n labels?: Partial<AddFilesFirstLabels>\n}\n\n/**\n * What a quick-action dialog shows when the workspace has no files yet.\n *\n * Greying the action out says you cannot do it without saying how to get\n * there. Offering the same \"Add\" menu the Files view carries turns the dead\n * end into the first step: add files here, then run the action.\n */\nexport function AddFilesFirst({ reason, action, testId, labels }: AddFilesFirstProps) {\n const l = { ...DEFAULT_ADD_FILES_FIRST_LABELS, ...labels }\n return (\n <div\n className=\"flex flex-col items-center gap-3 rounded-lg border border-border bg-card shadow-xs px-4 py-8 text-center\"\n data-slot=\"add-files-first\"\n data-testid={testId}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n <FolderPlus className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm font-semibold text-foreground\">{l.heading}</p>\n <p className=\"text-xs leading-relaxed text-muted-foreground\">{reason}</p>\n </div>\n {action}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { DialogDescription, DialogHeader, DialogTitle } from '@arbidocs/react/ui'\n\nexport interface QuickActionDialogHeaderProps {\n /** The tile's glyph, sized by the caller at `size-5`. */\n icon: ReactNode\n title: string\n /** One sentence on what the dialog does. Keep it to a line or two. */\n description: ReactNode\n /** Test id for the description, where a test asserts on the copy. */\n descriptionTestId?: string\n}\n\n/**\n * The header every \"Start\" quick-action dialog wears: the tile's own mark in\n * its disc, the action's name, and one line saying what the dialog will do.\n *\n * - The disc centres on the TITLE row, so it reads as the title's mark.\n * - The description keeps the title's left edge (`pl-13` = disc + gap), so the\n * header is one text column beside the mark rather than an L.\n * - `max-w-prose` + `text-pretty` cap the measure and stop two-word orphans.\n * - `pr-8` keeps the copy clear of the close button.\n */\nexport function QuickActionDialogHeader({\n icon,\n title,\n description,\n descriptionTestId,\n}: QuickActionDialogHeaderProps) {\n return (\n <DialogHeader className=\"space-y-0 text-left\" data-slot=\"quick-action-dialog-header\">\n <div className=\"flex items-center gap-3 pr-8\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n {icon}\n </div>\n <DialogTitle className=\"text-xl font-semibold leading-tight\">{title}</DialogTitle>\n </div>\n <DialogDescription\n className=\"mt-2 max-w-prose pl-13 pr-8 text-sm leading-relaxed text-pretty\"\n data-testid={descriptionTestId}\n >\n {description}\n </DialogDescription>\n </DialogHeader>\n )\n}\n","import { useMemo } from 'react'\n\n/** Which folders and labels a run is limited to. Empty = everything. */\nexport interface DocumentScope {\n /** Folder paths; `''` is the \"unfiled\" bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n}\n\nexport interface UseScopeSelectionOptions {\n /** Every folder path in the tree (not including the unfiled bucket). */\n folderPaths: string[]\n /** Whether the unfiled bucket is shown as a row. */\n hasUnfiled: boolean\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n}\n\n/**\n * Headless selection logic for a folder + label scope picker.\n *\n * Folders use hierarchical selection: ticking \"contracts\" also ticks\n * \"contracts/2024\", and unticking removes the whole subtree. \"All\" ticks every\n * row, which is NOT the same as an empty scope: empty means \"the whole\n * workspace, whatever lands in it later\", all-ticked means \"these folders, as\n * they are now\".\n */\nexport function useScopeSelection({\n folderPaths,\n hasUnfiled,\n scope,\n onScopeChange,\n}: UseScopeSelectionOptions) {\n const selectedFolders = useMemo(() => new Set(scope.folders), [scope.folders])\n const selectedLabels = useMemo(() => new Set(scope.labels), [scope.labels])\n\n /** Every row the folder list shows, \"unfiled\" included. */\n const allRowPaths = useMemo(\n () => [...(hasUnfiled ? [''] : []), ...folderPaths],\n [folderPaths, hasUnfiled]\n )\n const allSelected = allRowPaths.length > 0 && allRowPaths.every((p) => selectedFolders.has(p))\n const someSelected = selectedFolders.size > 0 && !allSelected\n\n const descendants = (path: string) => folderPaths.filter((p) => p.startsWith(path + '/'))\n\n const toggleFolder = (path: string) => {\n const next = new Set(selectedFolders)\n const family = [path, ...descendants(path)]\n if (next.has(path)) for (const p of family) next.delete(p)\n else for (const p of family) next.add(p)\n onScopeChange({ folders: [...next], labels: scope.labels })\n }\n\n const toggleAllFolders = () => {\n onScopeChange({ folders: allSelected ? [] : allRowPaths, labels: scope.labels })\n }\n\n const toggleLabel = (labelId: string) => {\n const next = new Set(selectedLabels)\n if (next.has(labelId)) next.delete(labelId)\n else next.add(labelId)\n onScopeChange({ folders: scope.folders, labels: [...next] })\n }\n\n return {\n selectedFolders,\n selectedLabels,\n allSelected,\n someSelected,\n hasSelection: scope.folders.length > 0 || scope.labels.length > 0,\n toggleFolder,\n toggleAllFolders,\n toggleLabel,\n }\n}\n","import { useMemo, useState } from 'react'\nimport { Check, FileCheck2, Minus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useScopeSelection, type DocumentScope } from '../lib/useScopeSelection'\nimport { formatCount } from '../lib/format'\nimport { FoldSection } from './FoldSection'\n\n/**\n * Fixed strings of the picker. Passed as `uiLabels`: the `labels` prop is already the list of\n * document labels to scope by.\n */\nexport interface ScopePickerLabels {\n folders: string\n /** The Labels section heading. */\n labelsHeading: string\n all: string\n unfiled: string\n noFoldersYet: string\n noLabelsYet: string\n filesToInclude: string\n /** \"3 of 10 files\". */\n matchedOfTotal: (matched: number, total: number) => string\n selectedSuffix: string\n folderCount: (count: number) => string\n labelCount: (count: number) => string\n left: (count: number) => string\n /** \"All 10 files\". */\n allFiles: (total: number) => string\n includedSuffix: string\n}\n\nconst pluralize = (n: number, word: string) => `${n} ${word}${n !== 1 ? 's' : ''}`\n\nexport const DEFAULT_SCOPE_PICKER_LABELS: ScopePickerLabels = {\n folders: 'Folders',\n labelsHeading: 'Labels',\n all: 'All',\n unfiled: 'Unfiled',\n noFoldersYet: 'No folders yet',\n noLabelsYet: 'No labels yet — label files from the Files page to scope by them here.',\n filesToInclude: 'Files to include',\n matchedOfTotal: (matched, total) =>\n `${matched} of ${formatCount(total, { one: 'file', other: 'files' })}`,\n selectedSuffix: ' selected',\n folderCount: (count) => pluralize(count, 'folder'),\n labelCount: (count) => pluralize(count, 'label'),\n left: (count) => `${count} left`,\n allFiles: (total) => `All ${pluralize(total, 'file')}`,\n includedSuffix: ' in the workspace will be included',\n}\n\nexport interface ScopeFolder {\n /** Full path, e.g. `contracts/2024`. */\n path: string\n /** Last segment, shown. */\n label: string\n /** Documents under this folder. */\n count: number\n depth: number\n}\n\nexport interface ScopeLabel {\n id: string\n name: string\n /** Any CSS colour for the dot. */\n color: string\n /** Documents carrying this label. */\n count: number\n}\n\nexport interface ScopePickerProps {\n folders: ScopeFolder[]\n /** Documents with no folder; the \"Unfiled\" row is hidden at 0. */\n unfiledCount: number\n labels: ScopeLabel[]\n /** All documents the picker is scoping. */\n totalCount: number\n /** Documents the current scope matches (computed by the caller). */\n matchedCount: number\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n /** Reword the picker's fixed strings. */\n uiLabels?: Partial<ScopePickerLabels>\n /** Sub-element ids; defaults are the current ids. `labelChip` is a prefix (`<prefix>-<label id>`). */\n testIds?: Partial<\n Record<'foldersToggle' | 'labelsToggle' | 'noLabels' | 'labelChip' | 'summary', string>\n >\n}\n\ninterface FolderRowProps {\n label: string\n count: number\n depth: number\n isActive: boolean\n indeterminate?: boolean\n muted?: boolean\n onToggle: () => void\n}\n\n/** A checkbox row: the row is the checkbox (a nested real one would swallow the click). */\nfunction FolderRow({\n label,\n count,\n depth,\n isActive,\n indeterminate,\n muted,\n onToggle,\n}: FolderRowProps) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isActive}\n style={{ paddingLeft: `${4 + depth * 14}px` }}\n className={cn(\n 'flex w-full items-center gap-1 rounded-sm py-1 pr-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-accent pointer-coarse:min-h-11',\n isActive && 'bg-primary/10',\n muted && !isActive && 'text-muted-foreground'\n )}\n data-slot=\"scope-folder-row\"\n >\n <span className=\"flex w-4 shrink-0 items-center justify-center\">\n <span\n className={cn(\n 'flex size-3.5 items-center justify-center rounded-[3px] border transition-colors',\n isActive || indeterminate\n ? 'border-primary bg-primary text-primary-foreground'\n : 'border-muted-foreground/40'\n )}\n >\n {indeterminate ? (\n <Minus className=\"size-2.5\" />\n ) : (\n isActive && <Check className=\"size-2.5\" />\n )}\n </span>\n </span>\n {label !== '' && (\n <span className={cn('min-w-0 truncate', isActive && 'font-semibold text-primary')}>\n {label}\n </span>\n )}\n <span className=\"ml-auto pl-2 text-sm font-semibold text-muted-foreground\">{count}</span>\n </button>\n )\n}\n\n/**\n * Pick a folder + label scope for a run over documents. Controlled: the caller\n * owns the scope and computes `matchedCount`, so the submit button lives with\n * the caller. Both sections start shut: the default (every file) is what most\n * runs want, and the summary states it plainly.\n */\nexport function ScopePicker({\n folders,\n unfiledCount,\n labels,\n totalCount,\n matchedCount,\n scope,\n onScopeChange,\n uiLabels,\n testIds,\n}: ScopePickerProps) {\n const l = { ...DEFAULT_SCOPE_PICKER_LABELS, ...uiLabels }\n const [foldersOpen, setFoldersOpen] = useState(false)\n const [labelsOpen, setLabelsOpen] = useState(false)\n\n const folderPaths = useMemo(() => folders.map((f) => f.path), [folders])\n const selection = useScopeSelection({\n folderPaths,\n hasUnfiled: unfiledCount > 0,\n scope,\n onScopeChange,\n })\n const hasRows = folders.length > 0 || unfiledCount > 0\n\n return (\n <div className=\"flex flex-col gap-4\" data-slot=\"scope-picker\">\n <FoldSection\n label={l.folders}\n count={scope.folders.length}\n open={foldersOpen}\n onOpenChange={setFoldersOpen}\n testId={testIdOr(testIds?.foldersToggle, { testId: 'scope-picker-folders-toggle' })}\n >\n <div className=\"max-h-[180px] overflow-y-auto rounded-md border border-border p-1\">\n {hasRows && (\n <>\n <FolderRow\n label={l.all}\n count={totalCount}\n depth={0}\n isActive={selection.allSelected}\n indeterminate={selection.someSelected}\n onToggle={selection.toggleAllFolders}\n />\n <div className=\"my-1 border-t border-border\" />\n </>\n )}\n {unfiledCount > 0 && (\n <>\n <FolderRow\n label={l.unfiled}\n count={unfiledCount}\n depth={0}\n isActive={selection.selectedFolders.has('')}\n muted\n onToggle={() => selection.toggleFolder('')}\n />\n {folders.length > 0 && <div className=\"my-1 border-t border-border\" />}\n </>\n )}\n {folders.map((folder) => (\n <FolderRow\n key={folder.path}\n label={folder.label}\n count={folder.count}\n depth={folder.depth}\n isActive={selection.selectedFolders.has(folder.path)}\n onToggle={() => selection.toggleFolder(folder.path)}\n />\n ))}\n {!hasRows && <p className=\"px-2 py-1 text-sm text-muted-foreground\">{l.noFoldersYet}</p>}\n </div>\n </FoldSection>\n\n {/* Always present, like Folders: a workspace with no labels yet reads as\n \"you have not labelled anything\", not \"this cannot scope by label\". */}\n <FoldSection\n label={l.labelsHeading}\n count={scope.labels.length}\n open={labelsOpen}\n onOpenChange={setLabelsOpen}\n testId={testIdOr(testIds?.labelsToggle, { testId: 'scope-picker-labels-toggle' })}\n >\n {labels.length === 0 ? (\n <p\n className=\"px-2 py-1 text-sm text-muted-foreground\"\n data-testid={testIdOr(testIds?.noLabels, { testId: 'scope-picker-no-labels' })}\n >\n {l.noLabelsYet}\n </p>\n ) : (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => {\n const isActive = selection.selectedLabels.has(label.id)\n return (\n <button\n key={label.id}\n type=\"button\"\n onClick={() => selection.toggleLabel(label.id)}\n aria-pressed={isActive}\n data-testid={prefixedTestId(testIds?.labelChip, label.id, {\n testId: `scope-picker-label-chip-${label.id}`,\n })}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n isActive\n ? 'border-primary/40 bg-primary/10 text-primary'\n : 'border-border [&:hover]:bg-accent [&:hover]:text-accent-foreground'\n )}\n >\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n />\n <span className=\"truncate\">{label.name}</span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">({label.count})</span>\n {isActive && <Check className=\"size-3.5 shrink-0\" />}\n </button>\n )\n })}\n </div>\n )}\n </FoldSection>\n\n <div\n className=\"rounded-lg bg-muted p-3\"\n data-testid={testIdOr(testIds?.summary, { testId: 'scope-picker-summary' })}\n >\n <div className=\"mb-2 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <FileCheck2 className=\"size-4\" />\n {l.filesToInclude}\n </div>\n {selection.hasSelection ? (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.matchedOfTotal(matchedCount, totalCount)}\n </span>\n {l.selectedSuffix}\n {scope.folders.length > 0 && <span> — {l.folderCount(scope.folders.length)}</span>}\n {scope.folders.length > 0 && scope.labels.length > 0 && <span>, </span>}\n {scope.labels.length > 0 && <span>{l.labelCount(scope.labels.length)}</span>}\n <span className=\"text-xs\">\n {' · '}\n {l.left(totalCount - matchedCount)}\n </span>\n </div>\n ) : (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.allFiles(totalCount)}\n </span>\n {l.includedSuffix}\n </div>\n )}\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus, type LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\n\n/** The small label that names a band of a page (\"Start\", \"Recent\"). */\nexport function SectionLabel({\n children,\n className,\n testId,\n}: {\n children: ReactNode\n className?: string\n testId?: string\n}) {\n return (\n <p\n className={cn(\n 'flex items-center gap-3 text-sm font-semibold text-foreground after:h-px after:flex-1 after:bg-border',\n className\n )}\n data-slot=\"section-label\"\n data-testid={testId}\n >\n {children}\n </p>\n )\n}\n\nexport interface SectionHeaderProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Makes the title a button (open the full list). Omit for a static title. */\n onOpen?: () => void\n /** Real link target of the title; `onOpen` still fires on a plain click. */\n openHref?: string\n /** Test id of the title button. */\n openTestId?: string\n /** The section's one quiet action, rendered at the trailing edge. */\n action?: ReactNode\n className?: string\n}\n\n/** Title + count + one quiet action: the head of a list section. */\nexport function SectionHeader({\n icon: Icon,\n title,\n count,\n onOpen,\n openHref,\n openTestId,\n action,\n className,\n}: SectionHeaderProps) {\n return (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n data-slot=\"section-header\"\n >\n <ActionLink\n href={openHref}\n onSelect={onOpen}\n disabled={!onOpen && !openHref}\n className=\"flex min-w-0 cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:text-foreground pointer-coarse:min-h-11\"\n data-testid={openTestId}\n >\n {Icon && <Icon className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n <span className=\"whitespace-nowrap text-sm font-semibold text-foreground\">{title}</span>\n {count !== undefined && (\n <span className=\"text-sm tabular-nums text-muted-foreground\">{count}</span>\n )}\n </ActionLink>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n )\n}\n\nexport interface EmptyStripProps {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\n/** One tonal strip that stands in for an empty section: an invitation, not a void. */\nexport function EmptyStrip({\n icon: Icon = Plus,\n label,\n description,\n onSelect,\n testId,\n}: EmptyStripProps) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={!onSelect}\n className=\"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-card disabled:hover:border-border pointer-coarse:min-h-11\"\n data-slot=\"empty-strip\"\n data-testid={testId}\n >\n <Icon className=\"size-5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-semibold text-foreground\">{label}</span>\n {description && (\n <span className=\"block text-sm leading-snug text-muted-foreground\">{description}</span>\n )}\n </span>\n </button>\n )\n}\n","/**\n * The column count for a grid of `count` equal tiles in `width` pixels, chosen so the last row is\n * never left with a lone orphan: of the counts that fit (each column at least `minTile` wide),\n * take the one that leaves the fewest empty cells in the last row, preferring more columns on a\n * tie (never fewer than two columns when two fit). Four tiles resolve to 2x2 where three would fit\n * and 4 across when there is room for four; six resolve to 3x2.\n */\nexport function balancedColumns(count: number, width: number, minTile = 200, gap = 12): number {\n if (count <= 1) return 1\n const fit = Math.max(1, Math.min(count, Math.floor((width + gap) / (minTile + gap))))\n if (fit < 2) return 1\n let best = 2\n let bestEmpty = Number.POSITIVE_INFINITY\n for (let columns = 2; columns <= fit; columns++) {\n const empty = (columns - (count % columns)) % columns\n if (empty < bestEmpty || (empty === bestEmpty && columns > best)) {\n best = columns\n bestEmpty = empty\n }\n }\n return best\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { balancedColumns } from '../lib/balanced-columns'\nimport { observeResize } from '../lib/observe-resize'\nimport { SectionLabel } from './sections'\n\n/** One \"start something\" tile: an AI-driven action, one click from underway. */\nexport interface StartTile {\n id: string\n /** A Lucide glyph; `iconNode` wins when both are given. */\n icon?: LucideIcon\n /** A ready-made mark (host icon maps), wearing the same AI ink. */\n iconNode?: ReactNode\n title: string\n description: string\n onSelect: () => void\n /** Real link target (ctrl-click / new tab, in-SPA through `BlocksProvider`'s `linkComponent`). `onSelect` still fires on a plain click. */\n href?: string\n /** Rendered non-interactive and dimmed; `disabledReason` replaces the description. */\n disabled?: boolean\n disabledReason?: string\n testId?: string\n}\n\nexport interface StartTilesProps {\n items: StartTile[]\n /** Optional band label above the tiles (\"Start\"). */\n caption?: string\n captionTestId?: string\n className?: string\n testId?: string\n}\n\n/**\n * A band of tonal action tiles. The glyph wears the AI ink, because these are\n * the AI-driven starts. Nothing is hover-only: tiles are always rendered, hover\n * only nudges tone, and touch targets are at least 44px.\n */\nexport function StartTiles({ items, caption, captionTestId, className, testId }: StartTilesProps) {\n // The tiles reflow by their own container width (a docked tablet sidebar narrows it without\n // changing the viewport), choosing a column count that never leaves one tile alone on a row.\n const gridRef = useRef<HTMLDivElement>(null)\n const [columns, setColumns] = useState<number | null>(null)\n const count = items.length\n useEffect(() => {\n const grid = gridRef.current\n if (!grid || count === 0) return\n const measure = () => setColumns(balancedColumns(count, grid.clientWidth))\n measure()\n return observeResize(grid, measure)\n }, [count])\n\n if (count === 0) return null\n return (\n <section\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"start-tiles\"\n data-testid={testId}\n >\n {caption && <SectionLabel testId={captionTestId}>{caption}</SectionLabel>}\n <div\n ref={gridRef}\n data-slot=\"start-tiles-grid\"\n data-columns={columns ?? undefined}\n className=\"grid gap-3\"\n style={{\n gridTemplateColumns:\n columns === null\n ? 'repeat(auto-fit, minmax(200px, 1fr))'\n : `repeat(${columns}, minmax(0, 1fr))`,\n }}\n >\n {items.map((item) => {\n const Icon = item.icon\n return (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n title={item.disabled ? item.disabledReason : undefined}\n className={cn(\n 'flex h-full flex-col items-start gap-3 rounded-lg p-4 text-left',\n 'border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:cursor-default disabled:opacity-55 disabled:hover:bg-card disabled:hover:border-border',\n 'pointer-coarse:min-h-11'\n )}\n data-slot=\"start-tile\"\n data-testid={item.testId}\n >\n {item.iconNode ? (\n <span className=\"shrink-0 text-ai-ink [&>svg]:size-5\" aria-hidden=\"true\">\n {item.iconNode}\n </span>\n ) : (\n Icon && <Icon className=\"size-5 shrink-0 text-ai-ink\" aria-hidden=\"true\" />\n )}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span className=\"mt-1 block text-sm leading-snug text-muted-foreground\">\n {item.disabled && item.disabledReason ? item.disabledReason : item.description}\n </span>\n </span>\n </ActionLink>\n )\n })}\n </div>\n </section>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/home/FoldSection.tsx","../src/home/AddFilesFirst.tsx","../src/home/QuickActionDialogHeader.tsx","../src/lib/useScopeSelection.ts","../src/home/ScopePicker.tsx","../src/home/sections.tsx","../src/lib/balanced-columns.ts","../src/home/StartTiles.tsx"],"names":["jsxs","jsx","cn","useMemo","useState"],"mappings":";;;;;;;;;AAsBO,SAAS,WAAA,CAAY;AAAA,EAC1B,KAAA;AAAA,EACA,KAAA,GAAQ,CAAA;AAAA,EACR,IAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAqB;AACnB,EAAA,uBACE,IAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAY,YAAA,EAA4B,aAAU,cAAA,EAC7D,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,wMAAA;AAAA,QACV,aAAA,EAAa,MAAA;AAAA,QAEb,QAAA,EAAA;AAAA,0BAAA,GAAA;AA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{ Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from '@arbidocs/react/ui'\n\nexport interface FoldSectionProps {\n label: string\n /** Shown as plain muted text beside the name; omit or pass 0 to hide. */\n count?: number\n /** A word or two of state for sections a count cannot summarise (shown while shut). */\n hint?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Trigger test id; the caller owns the naming. */\n testId: string\n children: ReactNode\n}\n\n/**\n * One foldable block of a dialog. The chevron and the name are the whole hit\n * target (44px on touch), and the count keeps the selection readable while the\n * section is shut, so you need not re-open it to check.\n */\nexport function FoldSection({\n label,\n count = 0,\n hint,\n open,\n onOpenChange,\n testId,\n children,\n}: FoldSectionProps) {\n return (\n <Collapsible open={open} onOpenChange={onOpenChange} data-slot=\"fold-section\">\n <CollapsibleTrigger\n className=\"mb-1.5 flex w-full items-center gap-1.5 rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:text-muted-foreground pointer-coarse:min-h-11\"\n data-testid={testId}\n >\n <ChevronDown\n className={cn('size-4 shrink-0 transition-transform', !open && '-rotate-90')}\n />\n <span>{label}</span>\n {count > 0 && <span className=\"text-xs tabular-nums text-muted-foreground\">{count}</span>}\n {hint && !open && (\n <span className=\"min-w-0 truncate text-xs font-normal text-muted-foreground\">{hint}</span>\n )}\n </CollapsibleTrigger>\n <CollapsibleContent>{children}</CollapsibleContent>\n </Collapsible>\n )\n}\n","import type { ReactNode } from 'react'\nimport { FolderPlus } from 'lucide-react'\n\n/** Fixed strings of the empty-files state. */\nexport interface AddFilesFirstLabels {\n heading: string\n}\n\nexport const DEFAULT_ADD_FILES_FIRST_LABELS: AddFilesFirstLabels = {\n heading: 'Add files first',\n}\n\nexport interface AddFilesFirstProps {\n /** Why this action needs files, in the action's own words. */\n reason: string\n /** The host's own \"Add\" control. */\n action: ReactNode\n testId?: string\n labels?: Partial<AddFilesFirstLabels>\n}\n\n/**\n * What a quick-action dialog shows when the workspace has no files yet.\n *\n * Greying the action out says you cannot do it without saying how to get\n * there. Offering the same \"Add\" menu the Files view carries turns the dead\n * end into the first step: add files here, then run the action.\n */\nexport function AddFilesFirst({ reason, action, testId, labels }: AddFilesFirstProps) {\n const l = { ...DEFAULT_ADD_FILES_FIRST_LABELS, ...labels }\n return (\n <div\n className=\"flex flex-col items-center gap-3 rounded-lg border border-border bg-card shadow-xs px-4 py-8 text-center\"\n data-slot=\"add-files-first\"\n data-testid={testId}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n <FolderPlus className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm font-semibold text-foreground\">{l.heading}</p>\n <p className=\"text-xs leading-relaxed text-muted-foreground\">{reason}</p>\n </div>\n {action}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { DialogDescription, DialogHeader, DialogTitle } from '@arbidocs/react/ui'\n\nexport interface QuickActionDialogHeaderProps {\n /** The tile's glyph, sized by the caller at `size-5`. */\n icon: ReactNode\n title: string\n /** One sentence on what the dialog does. Keep it to a line or two. */\n description: ReactNode\n /** Test id for the description, where a test asserts on the copy. */\n descriptionTestId?: string\n}\n\n/**\n * The header every \"Start\" quick-action dialog wears: the tile's own mark in\n * its disc, the action's name, and one line saying what the dialog will do.\n *\n * - The disc centres on the TITLE row, so it reads as the title's mark.\n * - The description keeps the title's left edge (`pl-13` = disc + gap), so the\n * header is one text column beside the mark rather than an L.\n * - `max-w-prose` + `text-pretty` cap the measure and stop two-word orphans.\n * - `pr-8` keeps the copy clear of the close button.\n */\nexport function QuickActionDialogHeader({\n icon,\n title,\n description,\n descriptionTestId,\n}: QuickActionDialogHeaderProps) {\n return (\n <DialogHeader className=\"space-y-0 text-left\" data-slot=\"quick-action-dialog-header\">\n <div className=\"flex items-center gap-3 pr-8\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n {icon}\n </div>\n <DialogTitle className=\"text-xl font-semibold leading-tight\">{title}</DialogTitle>\n </div>\n <DialogDescription\n className=\"mt-2 max-w-prose pl-13 pr-8 text-sm leading-relaxed text-pretty\"\n data-testid={descriptionTestId}\n >\n {description}\n </DialogDescription>\n </DialogHeader>\n )\n}\n","import { useMemo } from 'react'\n\n/** Which folders and labels a run is limited to. Empty = everything. */\nexport interface DocumentScope {\n /** Folder paths; `''` is the \"unfiled\" bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n}\n\nexport interface UseScopeSelectionOptions {\n /** Every folder path in the tree (not including the unfiled bucket). */\n folderPaths: string[]\n /** Whether the unfiled bucket is shown as a row. */\n hasUnfiled: boolean\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n}\n\n/**\n * Headless selection logic for a folder + label scope picker.\n *\n * Folders use hierarchical selection: ticking \"contracts\" also ticks\n * \"contracts/2024\", and unticking removes the whole subtree. \"All\" ticks every\n * row, which is NOT the same as an empty scope: empty means \"the whole\n * workspace, whatever lands in it later\", all-ticked means \"these folders, as\n * they are now\".\n */\nexport function useScopeSelection({\n folderPaths,\n hasUnfiled,\n scope,\n onScopeChange,\n}: UseScopeSelectionOptions) {\n const selectedFolders = useMemo(() => new Set(scope.folders), [scope.folders])\n const selectedLabels = useMemo(() => new Set(scope.labels), [scope.labels])\n\n /** Every row the folder list shows, \"unfiled\" included. */\n const allRowPaths = useMemo(\n () => [...(hasUnfiled ? [''] : []), ...folderPaths],\n [folderPaths, hasUnfiled]\n )\n const allSelected = allRowPaths.length > 0 && allRowPaths.every((p) => selectedFolders.has(p))\n const someSelected = selectedFolders.size > 0 && !allSelected\n\n const descendants = (path: string) => folderPaths.filter((p) => p.startsWith(path + '/'))\n\n const toggleFolder = (path: string) => {\n const next = new Set(selectedFolders)\n const family = [path, ...descendants(path)]\n if (next.has(path)) for (const p of family) next.delete(p)\n else for (const p of family) next.add(p)\n onScopeChange({ folders: [...next], labels: scope.labels })\n }\n\n const toggleAllFolders = () => {\n onScopeChange({ folders: allSelected ? [] : allRowPaths, labels: scope.labels })\n }\n\n const toggleLabel = (labelId: string) => {\n const next = new Set(selectedLabels)\n if (next.has(labelId)) next.delete(labelId)\n else next.add(labelId)\n onScopeChange({ folders: scope.folders, labels: [...next] })\n }\n\n return {\n selectedFolders,\n selectedLabels,\n allSelected,\n someSelected,\n hasSelection: scope.folders.length > 0 || scope.labels.length > 0,\n toggleFolder,\n toggleAllFolders,\n toggleLabel,\n }\n}\n","import { useMemo, useState } from 'react'\nimport { Check, FileCheck2, Minus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useScopeSelection, type DocumentScope } from '../lib/useScopeSelection'\nimport { formatCount } from '../lib/format'\nimport { FoldSection } from './FoldSection'\n\n/**\n * Fixed strings of the picker. Passed as `uiLabels`: the `labels` prop is already the list of\n * document labels to scope by.\n */\nexport interface ScopePickerLabels {\n folders: string\n /** The Labels section heading. */\n labelsHeading: string\n all: string\n unfiled: string\n noFoldersYet: string\n noLabelsYet: string\n filesToInclude: string\n /** \"3 of 10 files\". */\n matchedOfTotal: (matched: number, total: number) => string\n selectedSuffix: string\n folderCount: (count: number) => string\n labelCount: (count: number) => string\n left: (count: number) => string\n /** \"All 10 files\". */\n allFiles: (total: number) => string\n includedSuffix: string\n}\n\nconst pluralize = (n: number, word: string) => `${n} ${word}${n !== 1 ? 's' : ''}`\n\nexport const DEFAULT_SCOPE_PICKER_LABELS: ScopePickerLabels = {\n folders: 'Folders',\n labelsHeading: 'Labels',\n all: 'All',\n unfiled: 'Unfiled',\n noFoldersYet: 'No folders yet',\n noLabelsYet: 'No labels yet — label files from the Files page to scope by them here.',\n filesToInclude: 'Files to include',\n matchedOfTotal: (matched, total) =>\n `${matched} of ${formatCount(total, { one: 'file', other: 'files' })}`,\n selectedSuffix: ' selected',\n folderCount: (count) => pluralize(count, 'folder'),\n labelCount: (count) => pluralize(count, 'label'),\n left: (count) => `${count} left`,\n allFiles: (total) => `All ${pluralize(total, 'file')}`,\n includedSuffix: ' in the workspace will be included',\n}\n\nexport interface ScopeFolder {\n /** Full path, e.g. `contracts/2024`. */\n path: string\n /** Last segment, shown. */\n label: string\n /** Documents under this folder. */\n count: number\n depth: number\n}\n\nexport interface ScopeLabel {\n id: string\n name: string\n /** Any CSS colour for the dot. */\n color: string\n /** Documents carrying this label. */\n count: number\n}\n\nexport interface ScopePickerProps {\n folders: ScopeFolder[]\n /** Documents with no folder; the \"Unfiled\" row is hidden at 0. */\n unfiledCount: number\n labels: ScopeLabel[]\n /** All documents the picker is scoping. */\n totalCount: number\n /** Documents the current scope matches (computed by the caller). */\n matchedCount: number\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n /** Reword the picker's fixed strings. */\n uiLabels?: Partial<ScopePickerLabels>\n /** Sub-element ids; defaults are the current ids. `labelChip` is a prefix (`<prefix>-<label id>`). */\n testIds?: Partial<\n Record<'foldersToggle' | 'labelsToggle' | 'noLabels' | 'labelChip' | 'summary', string>\n >\n}\n\ninterface FolderRowProps {\n label: string\n count: number\n depth: number\n isActive: boolean\n indeterminate?: boolean\n muted?: boolean\n onToggle: () => void\n}\n\n/** A checkbox row: the row is the checkbox (a nested real one would swallow the click). */\nfunction FolderRow({\n label,\n count,\n depth,\n isActive,\n indeterminate,\n muted,\n onToggle,\n}: FolderRowProps) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isActive}\n style={{ paddingLeft: `${4 + depth * 14}px` }}\n className={cn(\n 'flex w-full items-center gap-1 rounded-sm py-1 pr-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-accent pointer-coarse:min-h-11',\n isActive && 'bg-primary/10',\n muted && !isActive && 'text-muted-foreground'\n )}\n data-slot=\"scope-folder-row\"\n >\n <span className=\"flex w-4 shrink-0 items-center justify-center\">\n <span\n className={cn(\n 'flex size-3.5 items-center justify-center rounded-[3px] border transition-colors',\n isActive || indeterminate\n ? 'border-primary bg-primary text-primary-foreground'\n : 'border-muted-foreground/40'\n )}\n >\n {indeterminate ? (\n <Minus className=\"size-2.5\" />\n ) : (\n isActive && <Check className=\"size-2.5\" />\n )}\n </span>\n </span>\n {label !== '' && (\n <span className={cn('min-w-0 truncate', isActive && 'font-semibold text-primary')}>\n {label}\n </span>\n )}\n <span className=\"ml-auto pl-2 text-sm font-semibold text-muted-foreground\">{count}</span>\n </button>\n )\n}\n\n/**\n * Pick a folder + label scope for a run over documents. Controlled: the caller\n * owns the scope and computes `matchedCount`, so the submit button lives with\n * the caller. Both sections start shut: the default (every file) is what most\n * runs want, and the summary states it plainly.\n */\nexport function ScopePicker({\n folders,\n unfiledCount,\n labels,\n totalCount,\n matchedCount,\n scope,\n onScopeChange,\n uiLabels,\n testIds,\n}: ScopePickerProps) {\n const l = { ...DEFAULT_SCOPE_PICKER_LABELS, ...uiLabels }\n const [foldersOpen, setFoldersOpen] = useState(false)\n const [labelsOpen, setLabelsOpen] = useState(false)\n\n const folderPaths = useMemo(() => folders.map((f) => f.path), [folders])\n const selection = useScopeSelection({\n folderPaths,\n hasUnfiled: unfiledCount > 0,\n scope,\n onScopeChange,\n })\n const hasRows = folders.length > 0 || unfiledCount > 0\n\n return (\n <div className=\"flex flex-col gap-4\" data-slot=\"scope-picker\">\n <FoldSection\n label={l.folders}\n count={scope.folders.length}\n open={foldersOpen}\n onOpenChange={setFoldersOpen}\n testId={testIdOr(testIds?.foldersToggle, { testId: 'scope-picker-folders-toggle' })}\n >\n <div className=\"max-h-[180px] overflow-y-auto rounded-md border border-border p-1\">\n {hasRows && (\n <>\n <FolderRow\n label={l.all}\n count={totalCount}\n depth={0}\n isActive={selection.allSelected}\n indeterminate={selection.someSelected}\n onToggle={selection.toggleAllFolders}\n />\n <div className=\"my-1 border-t border-border\" />\n </>\n )}\n {unfiledCount > 0 && (\n <>\n <FolderRow\n label={l.unfiled}\n count={unfiledCount}\n depth={0}\n isActive={selection.selectedFolders.has('')}\n muted\n onToggle={() => selection.toggleFolder('')}\n />\n {folders.length > 0 && <div className=\"my-1 border-t border-border\" />}\n </>\n )}\n {folders.map((folder) => (\n <FolderRow\n key={folder.path}\n label={folder.label}\n count={folder.count}\n depth={folder.depth}\n isActive={selection.selectedFolders.has(folder.path)}\n onToggle={() => selection.toggleFolder(folder.path)}\n />\n ))}\n {!hasRows && <p className=\"px-2 py-1 text-sm text-muted-foreground\">{l.noFoldersYet}</p>}\n </div>\n </FoldSection>\n\n {/* Always present, like Folders: a workspace with no labels yet reads as\n \"you have not labelled anything\", not \"this cannot scope by label\". */}\n <FoldSection\n label={l.labelsHeading}\n count={scope.labels.length}\n open={labelsOpen}\n onOpenChange={setLabelsOpen}\n testId={testIdOr(testIds?.labelsToggle, { testId: 'scope-picker-labels-toggle' })}\n >\n {labels.length === 0 ? (\n <p\n className=\"px-2 py-1 text-sm text-muted-foreground\"\n data-testid={testIdOr(testIds?.noLabels, { testId: 'scope-picker-no-labels' })}\n >\n {l.noLabelsYet}\n </p>\n ) : (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => {\n const isActive = selection.selectedLabels.has(label.id)\n return (\n <button\n key={label.id}\n type=\"button\"\n onClick={() => selection.toggleLabel(label.id)}\n aria-pressed={isActive}\n data-testid={prefixedTestId(testIds?.labelChip, label.id, {\n testId: `scope-picker-label-chip-${label.id}`,\n })}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n isActive\n ? 'border-primary/40 bg-primary/10 text-primary'\n : 'border-border [&:hover]:bg-accent [&:hover]:text-accent-foreground'\n )}\n >\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n />\n <span className=\"truncate\">{label.name}</span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">({label.count})</span>\n {isActive && <Check className=\"size-3.5 shrink-0\" />}\n </button>\n )\n })}\n </div>\n )}\n </FoldSection>\n\n <div\n className=\"rounded-lg bg-muted p-3\"\n data-testid={testIdOr(testIds?.summary, { testId: 'scope-picker-summary' })}\n >\n <div className=\"mb-2 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <FileCheck2 className=\"size-4\" />\n {l.filesToInclude}\n </div>\n {selection.hasSelection ? (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.matchedOfTotal(matchedCount, totalCount)}\n </span>\n {l.selectedSuffix}\n {scope.folders.length > 0 && <span> — {l.folderCount(scope.folders.length)}</span>}\n {scope.folders.length > 0 && scope.labels.length > 0 && <span>, </span>}\n {scope.labels.length > 0 && <span>{l.labelCount(scope.labels.length)}</span>}\n <span className=\"text-xs\">\n {' · '}\n {l.left(totalCount - matchedCount)}\n </span>\n </div>\n ) : (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.allFiles(totalCount)}\n </span>\n {l.includedSuffix}\n </div>\n )}\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus, type LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\n\n/** The small label that names a band of a page (\"Start\", \"Recent\"). */\nexport function SectionLabel({\n children,\n className,\n testId,\n}: {\n children: ReactNode\n className?: string\n testId?: string\n}) {\n return (\n <p\n className={cn(\n 'flex items-center gap-3 text-sm font-semibold text-foreground after:h-px after:flex-1 after:bg-border',\n className\n )}\n data-slot=\"section-label\"\n data-testid={testId}\n >\n {children}\n </p>\n )\n}\n\nexport interface SectionHeaderProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Makes the title a button (open the full list). Omit for a static title. */\n onOpen?: () => void\n /** Real link target of the title; `onOpen` still fires on a plain click. */\n openHref?: string\n /** Test id of the title button. */\n openTestId?: string\n /** The section's one quiet action, rendered at the trailing edge. */\n action?: ReactNode\n className?: string\n}\n\n/** Title + count + one quiet action: the head of a list section. */\nexport function SectionHeader({\n icon: Icon,\n title,\n count,\n onOpen,\n openHref,\n openTestId,\n action,\n className,\n}: SectionHeaderProps) {\n return (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n data-slot=\"section-header\"\n >\n <ActionLink\n href={openHref}\n onSelect={onOpen}\n disabled={!onOpen && !openHref}\n className=\"flex min-w-0 cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:text-foreground pointer-coarse:min-h-11\"\n data-testid={openTestId}\n >\n {Icon && <Icon className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n <span className=\"whitespace-nowrap text-sm font-semibold text-foreground\">{title}</span>\n {count !== undefined && (\n <span className=\"text-sm tabular-nums text-muted-foreground\">{count}</span>\n )}\n </ActionLink>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n )\n}\n\nexport interface EmptyStripProps {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\n/** One tonal strip that stands in for an empty section: an invitation, not a void. */\nexport function EmptyStrip({\n icon: Icon = Plus,\n label,\n description,\n onSelect,\n testId,\n}: EmptyStripProps) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={!onSelect}\n className=\"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-card disabled:hover:border-border pointer-coarse:min-h-11\"\n data-slot=\"empty-strip\"\n data-testid={testId}\n >\n <Icon className=\"size-5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-semibold text-foreground\">{label}</span>\n {description && (\n <span className=\"block text-sm leading-snug text-muted-foreground\">{description}</span>\n )}\n </span>\n </button>\n )\n}\n","/**\n * The column count for a grid of `count` equal tiles in `width` pixels, chosen so the last row is\n * never left with a lone orphan: of the counts that fit (each column at least `minTile` wide),\n * take the one that leaves the fewest empty cells in the last row, preferring more columns on a\n * tie (never fewer than two columns when two fit). Four tiles resolve to 2x2 where three would fit\n * and 4 across when there is room for four; six resolve to 3x2.\n */\nexport function balancedColumns(count: number, width: number, minTile = 200, gap = 12): number {\n if (count <= 1) return 1\n const fit = Math.max(1, Math.min(count, Math.floor((width + gap) / (minTile + gap))))\n if (fit < 2) return 1\n let best = 2\n let bestEmpty = Number.POSITIVE_INFINITY\n for (let columns = 2; columns <= fit; columns++) {\n const empty = (columns - (count % columns)) % columns\n if (empty < bestEmpty || (empty === bestEmpty && columns > best)) {\n best = columns\n bestEmpty = empty\n }\n }\n return best\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { balancedColumns } from '../lib/balanced-columns'\nimport { observeResize } from '../lib/observe-resize'\nimport { SectionLabel } from './sections'\n\n/** One \"start something\" tile: an AI-driven action, one click from underway. */\nexport interface StartTile {\n id: string\n /** A Lucide glyph; `iconNode` wins when both are given. */\n icon?: LucideIcon\n /** A ready-made mark (host icon maps), wearing the same AI ink. */\n iconNode?: ReactNode\n title: string\n description: string\n onSelect: () => void\n /** Real link target (ctrl-click / new tab, in-SPA through `BlocksProvider`'s `linkComponent`). `onSelect` still fires on a plain click. */\n href?: string\n /** Rendered non-interactive and dimmed; `disabledReason` replaces the description. */\n disabled?: boolean\n disabledReason?: string\n testId?: string\n}\n\nexport interface StartTilesProps {\n items: StartTile[]\n /** Optional band label above the tiles (\"Start\"). */\n caption?: string\n captionTestId?: string\n className?: string\n testId?: string\n}\n\n/**\n * A band of tonal action tiles. The glyph wears the AI ink, because these are\n * the AI-driven starts. Nothing is hover-only: tiles are always rendered, hover\n * only nudges tone, and touch targets are at least 44px.\n */\nexport function StartTiles({ items, caption, captionTestId, className, testId }: StartTilesProps) {\n // The tiles reflow by their own container width (a docked tablet sidebar narrows it without\n // changing the viewport), choosing a column count that never leaves one tile alone on a row.\n const gridRef = useRef<HTMLDivElement>(null)\n const [columns, setColumns] = useState<number | null>(null)\n const count = items.length\n useEffect(() => {\n const grid = gridRef.current\n if (!grid || count === 0) return\n const measure = () => setColumns(balancedColumns(count, grid.clientWidth))\n measure()\n return observeResize(grid, measure)\n }, [count])\n\n if (count === 0) return null\n return (\n <section\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"start-tiles\"\n data-testid={testId}\n >\n {caption && <SectionLabel testId={captionTestId}>{caption}</SectionLabel>}\n <div\n ref={gridRef}\n data-slot=\"start-tiles-grid\"\n data-columns={columns ?? undefined}\n className=\"grid gap-3\"\n style={{\n gridTemplateColumns:\n columns === null\n ? 'repeat(auto-fit, minmax(200px, 1fr))'\n : `repeat(${columns}, minmax(0, 1fr))`,\n }}\n >\n {items.map((item) => {\n const Icon = item.icon\n return (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n title={item.disabled ? item.disabledReason : undefined}\n className={cn(\n 'flex h-full flex-col items-start gap-3 rounded-lg p-4 text-left',\n 'border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:cursor-default disabled:opacity-55 disabled:hover:bg-card disabled:hover:border-border',\n 'pointer-coarse:min-h-11'\n )}\n data-slot=\"start-tile\"\n data-testid={item.testId}\n >\n {item.iconNode ? (\n <span className=\"shrink-0 text-ai-ink [&>svg]:size-5\" aria-hidden=\"true\">\n {item.iconNode}\n </span>\n ) : (\n Icon && <Icon className=\"size-5 shrink-0 text-ai-ink\" aria-hidden=\"true\" />\n )}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span className=\"mt-1 block text-sm leading-snug text-muted-foreground\">\n {item.disabled && item.disabledReason ? item.disabledReason : item.description}\n </span>\n </span>\n </ActionLink>\n )\n })}\n </div>\n </section>\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useBlocksEnvironment } from './chunk-YNIBUKV5.js';
2
+ import { useBlocksEnvironment } from './chunk-TBEVGWY3.js';
3
3
  import { useCallback } from 'react';
4
4
  import { MarkMenu, cn } from '@arbidocs/react/ui';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -166,5 +166,5 @@ function NoteMark({
166
166
  }
167
167
 
168
168
  export { DEFAULT_QUIET_MARK_LABELS, LabelMark, NoteMark, PassageMark, QuietLink, useCopyText };
169
- //# sourceMappingURL=chunk-CYNF5PZI.js.map
170
- //# sourceMappingURL=chunk-CYNF5PZI.js.map
169
+ //# sourceMappingURL=chunk-J5CWKFSC.js.map
170
+ //# sourceMappingURL=chunk-J5CWKFSC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/citations/QuietMarks.tsx"],"names":[],"mappings":";;;;;AAyBO,IAAM,yBAAA,GAA6C;AAAA,EACxD,QAAA,EAAU,WAAA;AAAA,EACV,QAAA,EAAU,WAAA;AAAA,EACV,UAAA,EAAY,aAAA;AAAA,EACZ,UAAA,EAAY,gBAAA;AAAA,EACZ,QAAA,EAAU,cAAA;AAAA,EACV,aAAA,EAAe,yBAAA;AAAA,EACf,YAAA,EAAc,eAAA;AAAA,EACd,QAAA,EAAU,cAAA;AAAA,EACV,YAAA,EAAc;AAChB;AAMO,SAAS,YAAY,MAAA,EAAsE;AAChG,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,oBAAA,EAAqB;AACxC,EAAA,MAAM,IAAA,GAAO,MAAA,EAAQ,UAAA,IAAc,yBAAA,CAA0B,UAAA;AAC7D,EAAA,MAAM,MAAA,GAAS,MAAA,EAAQ,UAAA,IAAc,yBAAA,CAA0B,UAAA;AAC/D,EAAA,O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,SAAA,GAAY,cAAA;AAAA,EACZ,QAAQ,EAAC;AAAA,EACT,SAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,SACE,KAAA,mBAAQ,GAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAuC,iBAAM,CAAA,GAAU,MAAA;AAAA,MAEjF,SAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,gBAAA,EAAe,MAAA;AAAA,MACf,SAAA,EAAW,EAAA;AAAA,QACT,4OAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-CYNF5PZI.js","sourcesContent":["import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkM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AAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAA,EAAY,IAAA;AAAA,MACZ,gBAAA,EAAe,OAAA;AAAA,MACf,SAAA,EAAW,EAAA;AAAA,QACT,iKAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA,MAAA,CAAO,MAAM,CAAA,EAAG,CAAC,EAAE,GAAA,CAAI,CAAC,GAAG,CAAA,qBAC1B,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UAEC,aAAA,EAAY,MAAA;AAAA,UACZ,SAAA,EAAU,wBAAA;AAAA,UACV,KAAA,EAAO,EAAE,eAAA,EAAiB,CAAA;AAAE,SAAA;AAAA,QAHvB;AAAA,OAKR;AAAA;AAAA,GACH;AAEJ;AAkBO,SAAS,QAAA,CAAS;AAAA,EACvB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY,cAAA;AAAA,EACZ,QAAQ,EAAC;AAAA,EACT,SAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,SACE,KAAA,mBAAQ,GAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAuC,iBAAM,CAAA,GAAU,MAAA;AAAA,MAEjF,SAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,gBAAA,EAAe,MAAA;AAAA,MACf,SAAA,EAAW,EAAA;AAAA,QACT,4OAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-J5CWKFSC.js","sourcesContent":["import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkMJCCBMM5_cjs = require('./chunk-MJCCBMM5.cjs');
4
+ var chunkTC3RQNEX_cjs = require('./chunk-TC3RQNEX.cjs');
5
5
  var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
6
- var chunkR26BK7YL_cjs = require('./chunk-R26BK7YL.cjs');
6
+ var chunkDTROMMDX_cjs = require('./chunk-DTROMMDX.cjs');
7
7
  var lucideReact = require('lucide-react');
8
8
  var ui = require('@arbidocs/react/ui');
9
9
  var jsxRuntime = require('react/jsx-runtime');
@@ -27,9 +27,9 @@ function DataTable({
27
27
  className
28
28
  }) {
29
29
  const ids = {
30
- table: testIds?.table ?? chunkMJCCBMM5_cjs.tid(area, "table"),
31
- empty: testIds?.empty ?? chunkMJCCBMM5_cjs.tid(area, "empty"),
32
- row: testIds?.row ?? ((id) => chunkMJCCBMM5_cjs.tid(area, "row", id))
30
+ table: testIds?.table ?? chunkTC3RQNEX_cjs.tid(area, "table"),
31
+ empty: testIds?.empty ?? chunkTC3RQNEX_cjs.tid(area, "empty"),
32
+ row: testIds?.row ?? ((id) => chunkTC3RQNEX_cjs.tid(area, "row", id))
33
33
  };
34
34
  const labels = { ...DEFAULT_SELECTION_LABELS, ...selectionLabels };
35
35
  if (rows.length === 0) {
@@ -236,7 +236,7 @@ function MetricCard({
236
236
  );
237
237
  if (!isInteractive) return card;
238
238
  return /* @__PURE__ */ jsxRuntime.jsx(
239
- chunkR26BK7YL_cjs.ActionLink,
239
+ chunkDTROMMDX_cjs.ActionLink,
240
240
  {
241
241
  href,
242
242
  onSelect,
@@ -268,5 +268,5 @@ exports.DataTableBlock = DataTableBlock;
268
268
  exports.MetricCard = MetricCard;
269
269
  exports.PageHeader = PageHeader;
270
270
  exports.StatGroup = StatGroup;
271
- //# sourceMappingURL=chunk-TP6PLDNM.cjs.map
272
- //# sourceMappingURL=chunk-TP6PLDNM.cjs.map
271
+ //# sourceMappingURL=chunk-KMZWKSKO.cjs.map
272
+ //# sourceMappingURL=chunk-KMZWKSKO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DataTable.tsx","../src/components/DataTableBlock.tsx","../src/components/PageHeader.tsx","../src/components/MetricCard.tsx","../src/components/StatGroup.tsx"],"names":["tid","jsx","EmptyState","cn","jsxs","Table","TableHeader","TableRow","TableHead","ArrowUp","ArrowDown","ChevronsUpDown","TableBody","TableCell","Card","ArrowUpRight","ArrowDownRight","ActionLink"],"mappings":";;;;;;;;;AAoDA,IAAM,aAAa,EAAE,IAAA,EAAM,aAAa,KAAA,EAAO,YAAA,EAAc,QAAQ,aAAA,EAAc;AAEnF,IAAM,wBAAA,GAA2B,EAAE,SAAA,EAAW,iBAAA,EAAmB,WAAW,YAAA,EAAa;AAGlF,SAAS,SAAA,CAAa;AAAA,EAC3B,OAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA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MAAA,EACjD,QAAA,EAAA,IAAA,CAAK,GAAA,CAAI,CAAC,MAAM,CAAA,qBACfC,eAAAA,CAAC,KAAA,EAAA,EAAY,SAAA,EAAU,qBAAA,EAAsB,aAAA,EAAa,MAAA,IAAU,CAAA,EAAG,MAAM,CAAA,MAAA,EAAS,CAAC,CAAA,CAAA,EACrF,QAAA,EAAA;AAAA,oBAAAH,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,SAAA,EAAW,eAAK,KAAA,EAAM,CAAA;AAAA,oBACpCA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,4EAAA,EACX,eAAK,KAAA,EACR,CAAA;AAAA,oBACAA,cAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oCAAA,EAAsC,eAAK,KAAA,EAAM,CAAA;AAAA,IAC7D,IAAA,CAAK,uBAAOA,cAAAA,CAAC,OAAE,SAAA,EAAU,uCAAA,EAAyC,eAAK,GAAA,EAAI;AAAA,GAAA,EAAA,EANpE,CAOV,CACD,CAAA,EACH,CAAA;AAEJ","file":"chunk-TP6PLDNM.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@arbidocs/react/ui'\nimport { tid } from '../lib/testid'\nimport { EmptyState } from './EmptyState'\n\nexport interface Column<T> {\n key: string\n header: ReactNode\n render: (row: T) => ReactNode\n align?: 'left' | 'right' | 'center'\n /** Header becomes a sort button (needs `sort` and `onSortChange` on the table). */\n isSortable?: boolean\n className?: string\n headClassName?: string\n}\n\nexport interface DataTableSort {\n key: string\n direction: 'asc' | 'desc'\n}\n\nexport interface DataTableTestIds {\n table: string\n empty: string\n /** Test id of a row. */\n row: (id: string) => string\n}\n\nexport interface DataTableProps<T> {\n columns: Column<T>[]\n rows: T[]\n getRowId: (row: T) => string\n onRowClick?: (row: T) => void\n /** Test id area prefix, e.g. \"orders\" gives rows \"orders-row-{id}\". Default \"data\". */\n area?: string\n /** Replaces the ids derived from `area`. */\n testIds?: Partial<DataTableTestIds>\n emptyTitle?: string\n emptyDescription?: string\n /** Controlled sort state. The host sorts `rows`; the table only renders headers. */\n sort?: DataTableSort | null\n onSortChange?: (sort: DataTableSort) => void\n /** Controlled row selection: adds a leading checkbox column when `onSelectedIdsChange` is set. */\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Accessible names of the selection checkboxes. */\n selectionLabels?: { selectAll: string; selectRow: string }\n className?: string\n}\n\nconst alignClass = { left: 'text-left', right: 'text-right', center: 'text-center' } as const\n\nconst DEFAULT_SELECTION_LABELS = { selectAll: 'Select all rows', selectRow: 'Select row' }\n\n/** The one true table. Column-config driven, fully test-id'd, optional navigation, sort, selection. */\nexport function DataTable<T>({\n columns,\n rows,\n getRowId,\n onRowClick,\n area = 'data',\n testIds,\n emptyTitle = 'Nothing to show',\n emptyDescription,\n sort,\n onSortChange,\n selectedIds,\n onSelectedIdsChange,\n selectionLabels,\n className,\n}: DataTableProps<T>) {\n const ids = {\n table: testIds?.table ?? tid(area, 'table'),\n empty: testIds?.empty ?? tid(area, 'empty'),\n row: testIds?.row ?? ((id: string) => tid(area, 'row', id)),\n }\n const labels = { ...DEFAULT_SELECTION_LABELS, ...selectionLabels }\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} testId={ids.empty} />\n }\n\n const isSelectable = Boolean(onSelectedIdsChange)\n const selected = new Set(selectedIds ?? [])\n const rowIds = rows.map(getRowId)\n const allSelected = rowIds.length > 0 && rowIds.every((id) => selected.has(id))\n const toggleRow = (id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }\n\n return (\n <div className={cn('rounded-lg border border-border bg-card', className)}>\n <Table data-testid={ids.table}>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {isSelectable && (\n <TableHead className=\"w-10\">\n <input\n type=\"checkbox\"\n aria-label={labels.selectAll}\n checked={allSelected}\n onChange={() => onSelectedIdsChange?.(allSelected ? [] : rowIds)}\n />\n </TableHead>\n )}\n {columns.map((c) => {\n const active = sort?.key === c.key ? sort : null\n const isSortable = c.isSortable && onSortChange\n return (\n <TableHead\n key={c.key}\n aria-sort={\n active ? (active.direction === 'asc' ? 'ascending' : 'descending') : undefined\n }\n className={cn(c.align && alignClass[c.align], c.headClassName)}\n >\n {isSortable ? (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n onClick={() =>\n onSortChange({\n key: c.key,\n direction: active?.direction === 'asc' ? 'desc' : 'asc',\n })\n }\n >\n {c.header}\n {active ? (\n active.direction === 'asc' ? (\n <ArrowUp className=\"size-3\" />\n ) : (\n <ArrowDown className=\"size-3\" />\n )\n ) : (\n <ChevronsUpDown className=\"size-3 opacity-50\" />\n )}\n </button>\n ) : (\n c.header\n )}\n </TableHead>\n )\n })}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row) => {\n const id = getRowId(row)\n return (\n <TableRow\n key={id}\n data-testid={ids.row(id)}\n data-state={selected.has(id) ? 'selected' : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={cn(onRowClick && 'cursor-pointer')}\n >\n {isSelectable && (\n <TableCell className=\"w-10\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"checkbox\"\n aria-label={labels.selectRow}\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n />\n </TableCell>\n )}\n {columns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align && alignClass[c.align], c.className)}\n >\n {c.render(row)}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </TableBody>\n </Table>\n </div>\n )\n}\n","/**\n * A **serializable** data table for the Puck builder.\n *\n * The library's developer-facing {@link DataTable} is driven by `Column<T>` whose\n * `header`/`render` are React nodes and functions — powerful, but non-serializable,\n * so it can never be a Puck block. `DataTableBlock` closes that gap with a flat,\n * JSON-safe schema (string headers, string field keys, string cells) and rebuilds\n * the non-serializable `Column<Row>[]` internally, rendering through the very same\n * {@link DataTable} so it inherits the library's markup and tokens verbatim.\n */\nimport { DataTable, type Column } from './DataTable'\n\nexport interface DataTableBlockColumn {\n /** Column heading text. */\n header: string\n /** Key used to look a cell up in each row record. */\n field: string\n /** Cell/heading alignment. */\n align?: 'left' | 'right' | 'center'\n}\n\nexport interface DataTableBlockProps {\n /** Serializable column schema. */\n columns: DataTableBlockColumn[]\n /** One record per row; cells are looked up by each column's `field`. */\n rows: Array<Record<string, string>>\n /** Optional caption rendered above the table. */\n caption?: string\n /** Empty-state title shown when there are no rows. */\n emptyText?: string\n /** testid area prefix; also set on the wrapper element. */\n testId?: string\n}\n\n/** A row wrapper so {@link DataTable} gets a stable id without polluting the record. */\ninterface TableRowData {\n __id: string\n cells: Record<string, string>\n}\n\n/**\n * Renders a {@link DataTable} from a flat, serializable schema. Columns are mapped\n * to `Column<TableRowData>[]` (header string, positional-stable key, alignment) and\n * each cell is resolved by `field`; rows carry a synthetic id for React keys/testids.\n */\nexport function DataTableBlock({ columns, rows, caption, emptyText, testId }: DataTableBlockProps) {\n const area = testId ?? 'data-table-block'\n\n const tableColumns: Column<TableRowData>[] = columns.map((col, index) => ({\n key: col.field || `col-${index}`,\n header: col.header,\n align: col.align,\n render: (row) => row.cells[col.field] ?? '',\n }))\n\n const tableRows: TableRowData[] = rows.map((cells, index) => ({ __id: String(index), cells }))\n\n return (\n <div data-testid={testId}>\n {caption ? (\n <p\n className=\"mb-2 text-sm text-muted-foreground\"\n data-testid={testId ? `${testId}-caption` : undefined}\n >\n {caption}\n </p>\n ) : null}\n <DataTable\n columns={tableColumns}\n rows={tableRows}\n getRowId={(row) => row.__id}\n area={area}\n emptyTitle={emptyText}\n />\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface PageHeaderProps {\n title: ReactNode\n eyebrow?: ReactNode\n description?: ReactNode\n /** Before the title block: a back button, an avatar or an icon. */\n leading?: ReactNode\n actions?: ReactNode\n /** Under the whole header: a tab strip or segmented control. */\n tabs?: ReactNode\n className?: string\n testId?: string\n}\n\n/** Standard page title block: leading + eyebrow + title + description + actions, then tabs. */\nexport function PageHeader({\n title,\n eyebrow,\n description,\n leading,\n actions,\n tabs,\n className,\n testId,\n}: PageHeaderProps) {\n return (\n <div className={cn('flex flex-col gap-3', className)} data-testid={testId}>\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-3\">\n {leading && (\n <div className=\"shrink-0\" data-slot=\"page-header-leading\">\n {leading}\n </div>\n )}\n <div className=\"min-w-0\">\n {eyebrow && (\n <p className=\"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {eyebrow}\n </p>\n )}\n <h1 className=\"font-display text-2xl font-semibold tracking-tight text-foreground\">\n {title}\n </h1>\n {description && (\n <p className=\"mt-1 max-w-2xl text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {tabs && <div data-slot=\"page-header-tabs\">{tabs}</div>}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { ArrowDownRight, ArrowUpRight } from 'lucide-react'\nimport { Card, cn } from '@arbidocs/react/ui'\nimport { ActionLink } from './ActionLink'\n\nexport interface MetricCardProps {\n label: ReactNode\n value: ReactNode\n icon?: LucideIcon\n hint?: ReactNode\n delta?: { value: string; direction: 'up' | 'down'; good?: boolean }\n /**\n * Icon accent as a theme colour-token key (e.g. `primary`, `success`, or the host's own brand\n * token). Resolved to `var(--color-<accent>)` at render. `'default'` inherits `foreground`.\n */\n accent?: string\n /** Show a placeholder instead of the value (the figure is still being fetched). */\n isLoading?: boolean\n /** Makes the tile a real link (ctrl/cmd-click works). */\n href?: string\n /** Click handler; with `href`, a plain click calls it instead of navigating. */\n onSelect?: () => void\n className?: string\n testId?: string\n}\n\n/** The one true KPI tile. Used across every dashboard and module header. */\nexport function MetricCard({\n label,\n value,\n icon: Icon,\n hint,\n delta,\n accent = 'default',\n isLoading = false,\n href,\n onSelect,\n className,\n testId,\n}: MetricCardProps) {\n const accentStyle =\n accent && accent !== 'default' ? { color: `var(--color-${accent})` } : undefined\n const deltaGood = delta?.good ?? delta?.direction === 'up'\n const isInteractive = Boolean(href || onSelect)\n const card = (\n <Card\n variant=\"elevated\"\n className={cn('card-hover min-w-0 rounded-xl p-5', className)}\n data-testid={isInteractive ? undefined : testId}\n aria-busy={isLoading || undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"min-w-0 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {label}\n </p>\n {Icon && <Icon className=\"size-4 shrink-0\" style={accentStyle} />}\n </div>\n {isLoading ? (\n <div\n className=\"mt-2 h-8 w-20 animate-pulse rounded bg-muted\"\n data-slot=\"metric-card-skeleton\"\n />\n ) : (\n <p\n className=\"mt-2 font-display text-2xl font-semibold tracking-tight [overflow-wrap:anywhere]\"\n data-testid={testId && `${testId}-value`}\n >\n {value}\n </p>\n )}\n <div className=\"mt-1 flex items-center gap-2\">\n {delta && !isLoading && (\n <span\n className={cn(\n 'inline-flex items-center gap-0.5 text-xs font-medium',\n deltaGood ? 'text-success' : 'text-destructive'\n )}\n >\n {delta.direction === 'up' ? (\n <ArrowUpRight className=\"size-3\" />\n ) : (\n <ArrowDownRight className=\"size-3\" />\n )}\n {delta.value}\n </span>\n )}\n {hint && <span className=\"text-xs text-muted-foreground\">{hint}</span>}\n </div>\n </Card>\n )\n if (!isInteractive) return card\n return (\n <ActionLink\n href={href}\n onSelect={onSelect}\n className=\"block rounded-xl text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n data-testid={testId}\n >\n {card}\n </ActionLink>\n )\n}\n","import { cn } from '@arbidocs/react/ui'\n\nexport interface StatItem {\n value: string\n label: string\n /** Optional caption under the label (e.g. a qualifier or unit). */\n sub?: string\n}\n\nexport interface StatGroupProps {\n items: StatItem[]\n testId?: string\n}\n\nconst GRID: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 lg:grid-cols-4',\n}\n\n/** Big-number stat group — headline metrics with captions. */\nexport function StatGroup({ items, testId }: StatGroupProps) {\n const list = items ?? []\n const cols = GRID[Math.min(list.length, 4)] ?? GRID[4]\n return (\n <dl className={cn('grid gap-8', cols)} data-testid={testId}>\n {list.map((item, i) => (\n <div key={i} className=\"min-w-0 text-center\" data-testid={testId && `${testId}-item-${i}`}>\n <dt className=\"sr-only\">{item.label}</dt>\n <dd className=\"text-4xl font-semibold tracking-tight [overflow-wrap:anywhere] sm:text-5xl\">\n {item.value}\n </dd>\n <p className=\"mt-2 text-sm text-muted-foreground\">{item.label}</p>\n {item.sub && <p className=\"mt-1 text-xs text-muted-foreground/80\">{item.sub}</p>}\n </div>\n ))}\n </dl>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/DataTable.tsx","../src/components/DataTableBlock.tsx","../src/components/PageHeader.tsx","../src/components/MetricCard.tsx","../src/components/StatGroup.tsx"],"names":["tid","jsx","EmptyState","cn","jsxs","Table","TableHeader","TableRow","TableHead","ArrowUp","ArrowDown","ChevronsUpDown","TableBody","TableCell","Card","ArrowUpRight","ArrowDownRight","ActionLink"],"mappings":";;;;;;;;;AAoDA,IAAM,aAAa,EAAE,IAAA,EAAM,aAAa,KAAA,EAAO,YAAA,EAAc,QAAQ,aAAA,EAAc;AAEnF,IAAM,wBAAA,GAA2B,EAAE,SAAA,EAAW,iBAAA,EAAmB,WAAW,YAAA,EAAa;AAGlF,SAAS,SAAA,CAAa;AAAA,EAC3B,OAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA,GAAO,MAA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AA,CAAI,CAAC,MAAM,CAAA,qBACfC,eAAAA,CAAC,KAAA,EAAA,EAAY,SAAA,EAAU,qBAAA,EAAsB,aAAA,EAAa,MAAA,IAAU,CAAA,EAAG,MAAM,CAAA,MAAA,EAAS,CAAC,CAAA,CAAA,EACrF,QAAA,EAAA;AAAA,oBAAAH,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,SAAA,EAAW,eAAK,KAAA,EAAM,CAAA;AAAA,oBACpCA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,4EAAA,EACX,eAAK,KAAA,EACR,CAAA;AAAA,oBACAA,cAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oCAAA,EAAsC,eAAK,KAAA,EAAM,CAAA;AAAA,IAC7D,IAAA,CAAK,uBAAOA,cAAAA,CAAC,OAAE,SAAA,EAAU,uCAAA,EAAyC,eAAK,GAAA,EAAI;AAAA,GAAA,EAAA,EANpE,CAOV,CACD,CAAA,EACH,CAAA;AAEJ","file":"chunk-KMZWKSKO.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@arbidocs/react/ui'\nimport { tid } from '../lib/testid'\nimport { EmptyState } from './EmptyState'\n\nexport interface Column<T> {\n key: string\n header: ReactNode\n render: (row: T) => ReactNode\n align?: 'left' | 'right' | 'center'\n /** Header becomes a sort button (needs `sort` and `onSortChange` on the table). */\n isSortable?: boolean\n className?: string\n headClassName?: string\n}\n\nexport interface DataTableSort {\n key: string\n direction: 'asc' | 'desc'\n}\n\nexport interface DataTableTestIds {\n table: string\n empty: string\n /** Test id of a row. */\n row: (id: string) => string\n}\n\nexport interface DataTableProps<T> {\n columns: Column<T>[]\n rows: T[]\n getRowId: (row: T) => string\n onRowClick?: (row: T) => void\n /** Test id area prefix, e.g. \"orders\" gives rows \"orders-row-{id}\". Default \"data\". */\n area?: string\n /** Replaces the ids derived from `area`. */\n testIds?: Partial<DataTableTestIds>\n emptyTitle?: string\n emptyDescription?: string\n /** Controlled sort state. The host sorts `rows`; the table only renders headers. */\n sort?: DataTableSort | null\n onSortChange?: (sort: DataTableSort) => void\n /** Controlled row selection: adds a leading checkbox column when `onSelectedIdsChange` is set. */\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Accessible names of the selection checkboxes. */\n selectionLabels?: { selectAll: string; selectRow: string }\n className?: string\n}\n\nconst alignClass = { left: 'text-left', right: 'text-right', center: 'text-center' } as const\n\nconst DEFAULT_SELECTION_LABELS = { selectAll: 'Select all rows', selectRow: 'Select row' }\n\n/** The one true table. Column-config driven, fully test-id'd, optional navigation, sort, selection. */\nexport function DataTable<T>({\n columns,\n rows,\n getRowId,\n onRowClick,\n area = 'data',\n testIds,\n emptyTitle = 'Nothing to show',\n emptyDescription,\n sort,\n onSortChange,\n selectedIds,\n onSelectedIdsChange,\n selectionLabels,\n className,\n}: DataTableProps<T>) {\n const ids = {\n table: testIds?.table ?? tid(area, 'table'),\n empty: testIds?.empty ?? tid(area, 'empty'),\n row: testIds?.row ?? ((id: string) => tid(area, 'row', id)),\n }\n const labels = { ...DEFAULT_SELECTION_LABELS, ...selectionLabels }\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} testId={ids.empty} />\n }\n\n const isSelectable = Boolean(onSelectedIdsChange)\n const selected = new Set(selectedIds ?? [])\n const rowIds = rows.map(getRowId)\n const allSelected = rowIds.length > 0 && rowIds.every((id) => selected.has(id))\n const toggleRow = (id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }\n\n return (\n <div className={cn('rounded-lg border border-border bg-card', className)}>\n <Table data-testid={ids.table}>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {isSelectable && (\n <TableHead className=\"w-10\">\n <input\n type=\"checkbox\"\n aria-label={labels.selectAll}\n checked={allSelected}\n onChange={() => onSelectedIdsChange?.(allSelected ? [] : rowIds)}\n />\n </TableHead>\n )}\n {columns.map((c) => {\n const active = sort?.key === c.key ? sort : null\n const isSortable = c.isSortable && onSortChange\n return (\n <TableHead\n key={c.key}\n aria-sort={\n active ? (active.direction === 'asc' ? 'ascending' : 'descending') : undefined\n }\n className={cn(c.align && alignClass[c.align], c.headClassName)}\n >\n {isSortable ? (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n onClick={() =>\n onSortChange({\n key: c.key,\n direction: active?.direction === 'asc' ? 'desc' : 'asc',\n })\n }\n >\n {c.header}\n {active ? (\n active.direction === 'asc' ? (\n <ArrowUp className=\"size-3\" />\n ) : (\n <ArrowDown className=\"size-3\" />\n )\n ) : (\n <ChevronsUpDown className=\"size-3 opacity-50\" />\n )}\n </button>\n ) : (\n c.header\n )}\n </TableHead>\n )\n })}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row) => {\n const id = getRowId(row)\n return (\n <TableRow\n key={id}\n data-testid={ids.row(id)}\n data-state={selected.has(id) ? 'selected' : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={cn(onRowClick && 'cursor-pointer')}\n >\n {isSelectable && (\n <TableCell className=\"w-10\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"checkbox\"\n aria-label={labels.selectRow}\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n />\n </TableCell>\n )}\n {columns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align && alignClass[c.align], c.className)}\n >\n {c.render(row)}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </TableBody>\n </Table>\n </div>\n )\n}\n","/**\n * A **serializable** data table for the Puck builder.\n *\n * The library's developer-facing {@link DataTable} is driven by `Column<T>` whose\n * `header`/`render` are React nodes and functions — powerful, but non-serializable,\n * so it can never be a Puck block. `DataTableBlock` closes that gap with a flat,\n * JSON-safe schema (string headers, string field keys, string cells) and rebuilds\n * the non-serializable `Column<Row>[]` internally, rendering through the very same\n * {@link DataTable} so it inherits the library's markup and tokens verbatim.\n */\nimport { DataTable, type Column } from './DataTable'\n\nexport interface DataTableBlockColumn {\n /** Column heading text. */\n header: string\n /** Key used to look a cell up in each row record. */\n field: string\n /** Cell/heading alignment. */\n align?: 'left' | 'right' | 'center'\n}\n\nexport interface DataTableBlockProps {\n /** Serializable column schema. */\n columns: DataTableBlockColumn[]\n /** One record per row; cells are looked up by each column's `field`. */\n rows: Array<Record<string, string>>\n /** Optional caption rendered above the table. */\n caption?: string\n /** Empty-state title shown when there are no rows. */\n emptyText?: string\n /** testid area prefix; also set on the wrapper element. */\n testId?: string\n}\n\n/** A row wrapper so {@link DataTable} gets a stable id without polluting the record. */\ninterface TableRowData {\n __id: string\n cells: Record<string, string>\n}\n\n/**\n * Renders a {@link DataTable} from a flat, serializable schema. Columns are mapped\n * to `Column<TableRowData>[]` (header string, positional-stable key, alignment) and\n * each cell is resolved by `field`; rows carry a synthetic id for React keys/testids.\n */\nexport function DataTableBlock({ columns, rows, caption, emptyText, testId }: DataTableBlockProps) {\n const area = testId ?? 'data-table-block'\n\n const tableColumns: Column<TableRowData>[] = columns.map((col, index) => ({\n key: col.field || `col-${index}`,\n header: col.header,\n align: col.align,\n render: (row) => row.cells[col.field] ?? '',\n }))\n\n const tableRows: TableRowData[] = rows.map((cells, index) => ({ __id: String(index), cells }))\n\n return (\n <div data-testid={testId}>\n {caption ? (\n <p\n className=\"mb-2 text-sm text-muted-foreground\"\n data-testid={testId ? `${testId}-caption` : undefined}\n >\n {caption}\n </p>\n ) : null}\n <DataTable\n columns={tableColumns}\n rows={tableRows}\n getRowId={(row) => row.__id}\n area={area}\n emptyTitle={emptyText}\n />\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface PageHeaderProps {\n title: ReactNode\n eyebrow?: ReactNode\n description?: ReactNode\n /** Before the title block: a back button, an avatar or an icon. */\n leading?: ReactNode\n actions?: ReactNode\n /** Under the whole header: a tab strip or segmented control. */\n tabs?: ReactNode\n className?: string\n testId?: string\n}\n\n/** Standard page title block: leading + eyebrow + title + description + actions, then tabs. */\nexport function PageHeader({\n title,\n eyebrow,\n description,\n leading,\n actions,\n tabs,\n className,\n testId,\n}: PageHeaderProps) {\n return (\n <div className={cn('flex flex-col gap-3', className)} data-testid={testId}>\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-3\">\n {leading && (\n <div className=\"shrink-0\" data-slot=\"page-header-leading\">\n {leading}\n </div>\n )}\n <div className=\"min-w-0\">\n {eyebrow && (\n <p className=\"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {eyebrow}\n </p>\n )}\n <h1 className=\"font-display text-2xl font-semibold tracking-tight text-foreground\">\n {title}\n </h1>\n {description && (\n <p className=\"mt-1 max-w-2xl text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {tabs && <div data-slot=\"page-header-tabs\">{tabs}</div>}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { ArrowDownRight, ArrowUpRight } from 'lucide-react'\nimport { Card, cn } from '@arbidocs/react/ui'\nimport { ActionLink } from './ActionLink'\n\nexport interface MetricCardProps {\n label: ReactNode\n value: ReactNode\n icon?: LucideIcon\n hint?: ReactNode\n delta?: { value: string; direction: 'up' | 'down'; good?: boolean }\n /**\n * Icon accent as a theme colour-token key (e.g. `primary`, `success`, or the host's own brand\n * token). Resolved to `var(--color-<accent>)` at render. `'default'` inherits `foreground`.\n */\n accent?: string\n /** Show a placeholder instead of the value (the figure is still being fetched). */\n isLoading?: boolean\n /** Makes the tile a real link (ctrl/cmd-click works). */\n href?: string\n /** Click handler; with `href`, a plain click calls it instead of navigating. */\n onSelect?: () => void\n className?: string\n testId?: string\n}\n\n/** The one true KPI tile. Used across every dashboard and module header. */\nexport function MetricCard({\n label,\n value,\n icon: Icon,\n hint,\n delta,\n accent = 'default',\n isLoading = false,\n href,\n onSelect,\n className,\n testId,\n}: MetricCardProps) {\n const accentStyle =\n accent && accent !== 'default' ? { color: `var(--color-${accent})` } : undefined\n const deltaGood = delta?.good ?? delta?.direction === 'up'\n const isInteractive = Boolean(href || onSelect)\n const card = (\n <Card\n variant=\"elevated\"\n className={cn('card-hover min-w-0 rounded-xl p-5', className)}\n data-testid={isInteractive ? undefined : testId}\n aria-busy={isLoading || undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"min-w-0 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {label}\n </p>\n {Icon && <Icon className=\"size-4 shrink-0\" style={accentStyle} />}\n </div>\n {isLoading ? (\n <div\n className=\"mt-2 h-8 w-20 animate-pulse rounded bg-muted\"\n data-slot=\"metric-card-skeleton\"\n />\n ) : (\n <p\n className=\"mt-2 font-display text-2xl font-semibold tracking-tight [overflow-wrap:anywhere]\"\n data-testid={testId && `${testId}-value`}\n >\n {value}\n </p>\n )}\n <div className=\"mt-1 flex items-center gap-2\">\n {delta && !isLoading && (\n <span\n className={cn(\n 'inline-flex items-center gap-0.5 text-xs font-medium',\n deltaGood ? 'text-success' : 'text-destructive'\n )}\n >\n {delta.direction === 'up' ? (\n <ArrowUpRight className=\"size-3\" />\n ) : (\n <ArrowDownRight className=\"size-3\" />\n )}\n {delta.value}\n </span>\n )}\n {hint && <span className=\"text-xs text-muted-foreground\">{hint}</span>}\n </div>\n </Card>\n )\n if (!isInteractive) return card\n return (\n <ActionLink\n href={href}\n onSelect={onSelect}\n className=\"block rounded-xl text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n data-testid={testId}\n >\n {card}\n </ActionLink>\n )\n}\n","import { cn } from '@arbidocs/react/ui'\n\nexport interface StatItem {\n value: string\n label: string\n /** Optional caption under the label (e.g. a qualifier or unit). */\n sub?: string\n}\n\nexport interface StatGroupProps {\n items: StatItem[]\n testId?: string\n}\n\nconst GRID: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 lg:grid-cols-4',\n}\n\n/** Big-number stat group — headline metrics with captions. */\nexport function StatGroup({ items, testId }: StatGroupProps) {\n const list = items ?? []\n const cols = GRID[Math.min(list.length, 4)] ?? GRID[4]\n return (\n <dl className={cn('grid gap-8', cols)} data-testid={testId}>\n {list.map((item, i) => (\n <div key={i} className=\"min-w-0 text-center\" data-testid={testId && `${testId}-item-${i}`}>\n <dt className=\"sr-only\">{item.label}</dt>\n <dd className=\"text-4xl font-semibold tracking-tight [overflow-wrap:anywhere] sm:text-5xl\">\n {item.value}\n </dd>\n <p className=\"mt-2 text-sm text-muted-foreground\">{item.label}</p>\n {item.sub && <p className=\"mt-1 text-xs text-muted-foreground/80\">{item.sub}</p>}\n </div>\n ))}\n </dl>\n )\n}\n"]}
@@ -10,11 +10,11 @@ var shell = require('@arbidocs/react/shell');
10
10
 
11
11
  var UNMOUNT_DELAY_MS = 300;
12
12
  function PromptDialog({
13
- request,
13
+ request: request2,
14
14
  onSettle
15
15
  }) {
16
16
  const [open, setOpen] = react.useState(true);
17
- const { message, title = "Confirm", choices, icon = "alert", testId = "choice-modal" } = request;
17
+ const { message, title = "Confirm", choices, icon = "alert", testId = "choice-modal" } = request2;
18
18
  const settle = (value) => {
19
19
  setOpen(false);
20
20
  onSettle(value);
@@ -44,7 +44,7 @@ function PromptDialog({
44
44
  }
45
45
  );
46
46
  }
47
- function choiceDialog(request) {
47
+ function choiceDialog(request2) {
48
48
  if (typeof document === "undefined") return Promise.resolve(null);
49
49
  return new Promise((resolve) => {
50
50
  const container = document.createElement("div");
@@ -61,7 +61,7 @@ function choiceDialog(request) {
61
61
  container.remove();
62
62
  }, UNMOUNT_DELAY_MS);
63
63
  };
64
- root.render(/* @__PURE__ */ jsxRuntime.jsx(PromptDialog, { request, onSettle }));
64
+ root.render(/* @__PURE__ */ jsxRuntime.jsx(PromptDialog, { request: request2, onSettle }));
65
65
  });
66
66
  });
67
67
  }
@@ -81,17 +81,32 @@ var CONFIRM_TEST_ID = {
81
81
  yesno: "yes-no-modal",
82
82
  alert: "alert-modal"
83
83
  };
84
- async function confirmDialog(request) {
85
- const kind = request.kind ?? "confirm";
84
+ async function confirmDialog(request2) {
85
+ const kind = request2.kind ?? "confirm";
86
86
  const choice = await choiceDialog({
87
- message: request.message,
88
- title: request.title ?? (kind === "alert" ? "Alert" : "Confirm"),
87
+ message: request2.message,
88
+ title: request2.title ?? (kind === "alert" ? "Alert" : "Confirm"),
89
89
  choices: CONFIRM_CHOICES[kind],
90
90
  icon: kind === "alert" ? "info" : "alert",
91
91
  testId: CONFIRM_TEST_ID[kind]
92
92
  });
93
93
  return choice === "confirm" || choice === "yes" || choice === "ok";
94
94
  }
95
+ var request;
96
+ var listeners = /* @__PURE__ */ new Set();
97
+ function requestSettingsSection(section) {
98
+ if (!section) return;
99
+ request = { section, seq: (request?.seq ?? 0) + 1 };
100
+ listeners.forEach((listener) => listener());
101
+ }
102
+ function subscribe(listener) {
103
+ listeners.add(listener);
104
+ return () => listeners.delete(listener);
105
+ }
106
+ var snapshot = () => request;
107
+ function useRequestedSettingsSection() {
108
+ return react.useSyncExternalStore(subscribe, snapshot, snapshot);
109
+ }
95
110
  var noop = () => {
96
111
  };
97
112
  var defaultEnvironment = {
@@ -109,7 +124,7 @@ var defaultEnvironment = {
109
124
  },
110
125
  openDocument: noop,
111
126
  openConversation: noop,
112
- openSettings: noop,
127
+ openSettings: requestSettingsSection,
113
128
  openProject: noop
114
129
  };
115
130
  var BlocksContext = react.createContext(defaultEnvironment);
@@ -137,7 +152,10 @@ function BlocksProvider({
137
152
  runtimeConfig: runtimeConfig ?? parent.runtimeConfig,
138
153
  openDocument: openDocument ?? parent.openDocument,
139
154
  openConversation: openConversation ?? parent.openConversation,
140
- openSettings: openSettings ?? parent.openSettings,
155
+ openSettings: openSettings ? (section) => {
156
+ requestSettingsSection(section);
157
+ openSettings(section);
158
+ } : parent.openSettings,
141
159
  openProject: openProject ?? parent.openProject
142
160
  }),
143
161
  [
@@ -161,6 +179,8 @@ function useBlocksEnvironment() {
161
179
  }
162
180
 
163
181
  exports.BlocksProvider = BlocksProvider;
182
+ exports.requestSettingsSection = requestSettingsSection;
164
183
  exports.useBlocksEnvironment = useBlocksEnvironment;
165
- //# sourceMappingURL=chunk-C4WSHRR6.cjs.map
166
- //# sourceMappingURL=chunk-C4WSHRR6.cjs.map
184
+ exports.useRequestedSettingsSection = useRequestedSettingsSection;
185
+ //# sourceMappingURL=chunk-KPZZ5FHE.cjs.map
186
+ //# sourceMappingURL=chunk-KPZZ5FHE.cjs.map