@astra-spec/ui 0.0.1

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 (259) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +261 -0
  3. package/TOKENS.md +93 -0
  4. package/blocks.css +7 -0
  5. package/components.css +13 -0
  6. package/dist/blocks/analysis-tree.d.ts +13 -0
  7. package/dist/blocks/analysis-tree.d.ts.map +1 -0
  8. package/dist/blocks/analysis-tree.js +19 -0
  9. package/dist/blocks/analysis-tree.js.map +1 -0
  10. package/dist/blocks/decisions-list.d.ts +17 -0
  11. package/dist/blocks/decisions-list.d.ts.map +1 -0
  12. package/dist/blocks/decisions-list.js +56 -0
  13. package/dist/blocks/decisions-list.js.map +1 -0
  14. package/dist/blocks/findings-list.d.ts +9 -0
  15. package/dist/blocks/findings-list.d.ts.map +1 -0
  16. package/dist/blocks/findings-list.js +35 -0
  17. package/dist/blocks/findings-list.js.map +1 -0
  18. package/dist/blocks/index.d.ts +18 -0
  19. package/dist/blocks/index.d.ts.map +1 -0
  20. package/dist/blocks/index.js +10 -0
  21. package/dist/blocks/index.js.map +1 -0
  22. package/dist/blocks/inputs-list.d.ts +9 -0
  23. package/dist/blocks/inputs-list.d.ts.map +1 -0
  24. package/dist/blocks/inputs-list.js +32 -0
  25. package/dist/blocks/inputs-list.js.map +1 -0
  26. package/dist/blocks/outputs-list.d.ts +18 -0
  27. package/dist/blocks/outputs-list.d.ts.map +1 -0
  28. package/dist/blocks/outputs-list.js +47 -0
  29. package/dist/blocks/outputs-list.js.map +1 -0
  30. package/dist/blocks/papers-list.d.ts +16 -0
  31. package/dist/blocks/papers-list.d.ts.map +1 -0
  32. package/dist/blocks/papers-list.js +20 -0
  33. package/dist/blocks/papers-list.js.map +1 -0
  34. package/dist/blocks/prior-insights-list.d.ts +9 -0
  35. package/dist/blocks/prior-insights-list.d.ts.map +1 -0
  36. package/dist/blocks/prior-insights-list.js +29 -0
  37. package/dist/blocks/prior-insights-list.js.map +1 -0
  38. package/dist/blocks/section.d.ts +36 -0
  39. package/dist/blocks/section.d.ts.map +1 -0
  40. package/dist/blocks/section.js +30 -0
  41. package/dist/blocks/section.js.map +1 -0
  42. package/dist/components/artifact-preview.d.ts +71 -0
  43. package/dist/components/artifact-preview.d.ts.map +1 -0
  44. package/dist/components/artifact-preview.js +170 -0
  45. package/dist/components/artifact-preview.js.map +1 -0
  46. package/dist/components/decision-detail.d.ts +17 -0
  47. package/dist/components/decision-detail.d.ts.map +1 -0
  48. package/dist/components/decision-detail.js +21 -0
  49. package/dist/components/decision-detail.js.map +1 -0
  50. package/dist/components/detail-entry.d.ts +15 -0
  51. package/dist/components/detail-entry.d.ts.map +1 -0
  52. package/dist/components/detail-entry.js +14 -0
  53. package/dist/components/detail-entry.js.map +1 -0
  54. package/dist/components/finding-detail.d.ts +19 -0
  55. package/dist/components/finding-detail.d.ts.map +1 -0
  56. package/dist/components/finding-detail.js +39 -0
  57. package/dist/components/finding-detail.js.map +1 -0
  58. package/dist/components/index.d.ts +28 -0
  59. package/dist/components/index.d.ts.map +1 -0
  60. package/dist/components/index.js +15 -0
  61. package/dist/components/index.js.map +1 -0
  62. package/dist/components/input-detail.d.ts +15 -0
  63. package/dist/components/input-detail.d.ts.map +1 -0
  64. package/dist/components/input-detail.js +21 -0
  65. package/dist/components/input-detail.js.map +1 -0
  66. package/dist/components/insight-detail.d.ts +25 -0
  67. package/dist/components/insight-detail.d.ts.map +1 -0
  68. package/dist/components/insight-detail.js +30 -0
  69. package/dist/components/insight-detail.js.map +1 -0
  70. package/dist/components/insight-trigger.d.ts +20 -0
  71. package/dist/components/insight-trigger.d.ts.map +1 -0
  72. package/dist/components/insight-trigger.js +32 -0
  73. package/dist/components/insight-trigger.js.map +1 -0
  74. package/dist/components/output-detail.d.ts +39 -0
  75. package/dist/components/output-detail.d.ts.map +1 -0
  76. package/dist/components/output-detail.js +124 -0
  77. package/dist/components/output-detail.js.map +1 -0
  78. package/dist/components/output-dialog.d.ts +18 -0
  79. package/dist/components/output-dialog.d.ts.map +1 -0
  80. package/dist/components/output-dialog.js +11 -0
  81. package/dist/components/output-dialog.js.map +1 -0
  82. package/dist/components/paper-detail.d.ts +34 -0
  83. package/dist/components/paper-detail.d.ts.map +1 -0
  84. package/dist/components/paper-detail.js +60 -0
  85. package/dist/components/paper-detail.js.map +1 -0
  86. package/dist/components/record-dialog.d.ts +33 -0
  87. package/dist/components/record-dialog.d.ts.map +1 -0
  88. package/dist/components/record-dialog.js +114 -0
  89. package/dist/components/record-dialog.js.map +1 -0
  90. package/dist/components/relation-items.d.ts +9 -0
  91. package/dist/components/relation-items.d.ts.map +1 -0
  92. package/dist/components/relation-items.js +20 -0
  93. package/dist/components/relation-items.js.map +1 -0
  94. package/dist/components/use-detail-stack.d.ts +31 -0
  95. package/dist/components/use-detail-stack.d.ts.map +1 -0
  96. package/dist/components/use-detail-stack.js +49 -0
  97. package/dist/components/use-detail-stack.js.map +1 -0
  98. package/dist/lib/cn.d.ts +3 -0
  99. package/dist/lib/cn.d.ts.map +1 -0
  100. package/dist/lib/cn.js +6 -0
  101. package/dist/lib/cn.js.map +1 -0
  102. package/dist/lib/labels.d.ts +61 -0
  103. package/dist/lib/labels.d.ts.map +1 -0
  104. package/dist/lib/labels.js +79 -0
  105. package/dist/lib/labels.js.map +1 -0
  106. package/dist/lib/slot.d.ts +11 -0
  107. package/dist/lib/slot.d.ts.map +1 -0
  108. package/dist/lib/slot.js +83 -0
  109. package/dist/lib/slot.js.map +1 -0
  110. package/dist/model/doi.d.ts +2 -0
  111. package/dist/model/doi.d.ts.map +1 -0
  112. package/dist/model/doi.js +5 -0
  113. package/dist/model/doi.js.map +1 -0
  114. package/dist/model/index.d.ts +10 -0
  115. package/dist/model/index.d.ts.map +1 -0
  116. package/dist/model/index.js +7 -0
  117. package/dist/model/index.js.map +1 -0
  118. package/dist/model/locate-record.d.ts +8 -0
  119. package/dist/model/locate-record.d.ts.map +1 -0
  120. package/dist/model/locate-record.js +7 -0
  121. package/dist/model/locate-record.js.map +1 -0
  122. package/dist/model/papers.d.ts +38 -0
  123. package/dist/model/papers.d.ts.map +1 -0
  124. package/dist/model/papers.js +91 -0
  125. package/dist/model/papers.js.map +1 -0
  126. package/dist/model/records.d.ts +10 -0
  127. package/dist/model/records.d.ts.map +1 -0
  128. package/dist/model/records.js +32 -0
  129. package/dist/model/records.js.map +1 -0
  130. package/dist/model/relations.d.ts +45 -0
  131. package/dist/model/relations.d.ts.map +1 -0
  132. package/dist/model/relations.js +98 -0
  133. package/dist/model/relations.js.map +1 -0
  134. package/dist/primitives/badge.d.ts +11 -0
  135. package/dist/primitives/badge.d.ts.map +1 -0
  136. package/dist/primitives/badge.js +7 -0
  137. package/dist/primitives/badge.js.map +1 -0
  138. package/dist/primitives/button.d.ts +18 -0
  139. package/dist/primitives/button.d.ts.map +1 -0
  140. package/dist/primitives/button.js +12 -0
  141. package/dist/primitives/button.js.map +1 -0
  142. package/dist/primitives/detail-layout.d.ts +26 -0
  143. package/dist/primitives/detail-layout.d.ts.map +1 -0
  144. package/dist/primitives/detail-layout.js +21 -0
  145. package/dist/primitives/detail-layout.js.map +1 -0
  146. package/dist/primitives/dialog.d.ts +133 -0
  147. package/dist/primitives/dialog.d.ts.map +1 -0
  148. package/dist/primitives/dialog.js +266 -0
  149. package/dist/primitives/dialog.js.map +1 -0
  150. package/dist/primitives/index.d.ts +25 -0
  151. package/dist/primitives/index.d.ts.map +1 -0
  152. package/dist/primitives/index.js +14 -0
  153. package/dist/primitives/index.js.map +1 -0
  154. package/dist/primitives/kind.d.ts +6 -0
  155. package/dist/primitives/kind.d.ts.map +1 -0
  156. package/dist/primitives/kind.js +14 -0
  157. package/dist/primitives/kind.js.map +1 -0
  158. package/dist/primitives/prose.d.ts +36 -0
  159. package/dist/primitives/prose.d.ts.map +1 -0
  160. package/dist/primitives/prose.js +57 -0
  161. package/dist/primitives/prose.js.map +1 -0
  162. package/dist/primitives/record-list.d.ts +31 -0
  163. package/dist/primitives/record-list.d.ts.map +1 -0
  164. package/dist/primitives/record-list.js +17 -0
  165. package/dist/primitives/record-list.js.map +1 -0
  166. package/dist/primitives/relation-list.d.ts +22 -0
  167. package/dist/primitives/relation-list.d.ts.map +1 -0
  168. package/dist/primitives/relation-list.js +13 -0
  169. package/dist/primitives/relation-list.js.map +1 -0
  170. package/dist/primitives/surface-header.d.ts +31 -0
  171. package/dist/primitives/surface-header.d.ts.map +1 -0
  172. package/dist/primitives/surface-header.js +13 -0
  173. package/dist/primitives/surface-header.js.map +1 -0
  174. package/dist/views/index.d.ts +4 -0
  175. package/dist/views/index.d.ts.map +1 -0
  176. package/dist/views/index.js +3 -0
  177. package/dist/views/index.js.map +1 -0
  178. package/dist/views/inventory.d.ts +46 -0
  179. package/dist/views/inventory.d.ts.map +1 -0
  180. package/dist/views/inventory.js +101 -0
  181. package/dist/views/inventory.js.map +1 -0
  182. package/package.json +127 -0
  183. package/primitives.css +15 -0
  184. package/src/blocks/analysis-tree.tsx +109 -0
  185. package/src/blocks/decisions-list.tsx +113 -0
  186. package/src/blocks/findings-list.tsx +61 -0
  187. package/src/blocks/index.ts +23 -0
  188. package/src/blocks/inputs-list.tsx +51 -0
  189. package/src/blocks/outputs-list.tsx +143 -0
  190. package/src/blocks/papers-list.tsx +65 -0
  191. package/src/blocks/prior-insights-list.tsx +52 -0
  192. package/src/blocks/section.tsx +113 -0
  193. package/src/components/artifact-preview.tsx +314 -0
  194. package/src/components/decision-detail.tsx +93 -0
  195. package/src/components/detail-entry.ts +19 -0
  196. package/src/components/finding-detail.tsx +99 -0
  197. package/src/components/index.ts +44 -0
  198. package/src/components/input-detail.tsx +67 -0
  199. package/src/components/insight-detail.tsx +120 -0
  200. package/src/components/insight-trigger.tsx +102 -0
  201. package/src/components/output-detail.tsx +258 -0
  202. package/src/components/output-dialog.tsx +63 -0
  203. package/src/components/paper-detail.tsx +216 -0
  204. package/src/components/record-dialog.tsx +232 -0
  205. package/src/components/relation-items.ts +31 -0
  206. package/src/components/use-detail-stack.ts +78 -0
  207. package/src/lib/cn.ts +5 -0
  208. package/src/lib/labels.tsx +145 -0
  209. package/src/lib/slot.tsx +87 -0
  210. package/src/model/doi.ts +5 -0
  211. package/src/model/index.ts +32 -0
  212. package/src/model/locate-record.ts +13 -0
  213. package/src/model/papers.ts +146 -0
  214. package/src/model/records.ts +43 -0
  215. package/src/model/relations.ts +134 -0
  216. package/src/primitives/badge.tsx +32 -0
  217. package/src/primitives/button.tsx +58 -0
  218. package/src/primitives/detail-layout.tsx +84 -0
  219. package/src/primitives/dialog.tsx +555 -0
  220. package/src/primitives/index.ts +48 -0
  221. package/src/primitives/kind.ts +19 -0
  222. package/src/primitives/prose.tsx +74 -0
  223. package/src/primitives/record-list.tsx +103 -0
  224. package/src/primitives/relation-list.tsx +95 -0
  225. package/src/primitives/surface-header.tsx +87 -0
  226. package/src/views/index.ts +3 -0
  227. package/src/views/inventory.tsx +224 -0
  228. package/styles/base.css +49 -0
  229. package/styles/blocks/analysis-tree.css +64 -0
  230. package/styles/blocks/decisions-list.css +73 -0
  231. package/styles/blocks/outputs-list.css +349 -0
  232. package/styles/blocks/papers-list.css +98 -0
  233. package/styles/blocks/records.css +72 -0
  234. package/styles/components/artifact-preview.css +242 -0
  235. package/styles/components/decision-detail.css +159 -0
  236. package/styles/components/evidence.css +79 -0
  237. package/styles/components/finding-detail.css +63 -0
  238. package/styles/components/input-detail.css +95 -0
  239. package/styles/components/insight-detail.css +138 -0
  240. package/styles/components/insight-list.css +46 -0
  241. package/styles/components/insight-trigger.css +54 -0
  242. package/styles/components/output-detail.css +732 -0
  243. package/styles/components/paper-detail.css +249 -0
  244. package/styles/components/paper-doi.css +36 -0
  245. package/styles/primitives/badge.css +107 -0
  246. package/styles/primitives/button.css +116 -0
  247. package/styles/primitives/count-heading.css +27 -0
  248. package/styles/primitives/detail-layout.css +225 -0
  249. package/styles/primitives/dialog.css +634 -0
  250. package/styles/primitives/empty-state.css +10 -0
  251. package/styles/primitives/kind.css +41 -0
  252. package/styles/primitives/prose.css +15 -0
  253. package/styles/primitives/record-list.css +425 -0
  254. package/styles/primitives/relation-list.css +184 -0
  255. package/styles/primitives/surface-header.css +183 -0
  256. package/styles/tokens.css +119 -0
  257. package/styles/views/inventory.css +186 -0
  258. package/styles.css +2 -0
  259. package/views.css +3 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQjG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ResolvedAnalysisNode, ResolvedInput } from '@astra-spec/sdk';
2
+ import { type HTMLAttributes } from 'react';
3
+ export interface InputsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
+ analysis: ResolvedAnalysisNode;
5
+ onOpenRecord: (input: ResolvedInput, analysis: ResolvedAnalysisNode) => void;
6
+ }
7
+ /** Inputs with their declared source and type. */
8
+ export declare const InputsList: import("react").ForwardRefExoticComponent<InputsListProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=inputs-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs-list.d.ts","sourceRoot":"","sources":["../../src/blocks/inputs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAOxD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACvF,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC9E;AAED,kDAAkD;AAClD,eAAO,MAAM,UAAU,4GAoCrB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { recordTitle } from '../model/records.js';
4
+ import { useLabels } from '../lib/labels.js';
5
+ import { inputSourceLabel } from '../components/input-detail.js';
6
+ import { EmptyState, RecordIdentity, RecordList } from '../primitives/record-list.js';
7
+ import { InventoryRecords } from './section.js';
8
+ /** Inputs with their declared source and type. */
9
+ export const InputsList = forwardRef(function InputsList({ analysis, onOpenRecord, className, ...props }, ref) {
10
+ const labels = useLabels();
11
+ const records = analysis.inputs;
12
+ if (!records.length) {
13
+ return _jsx(EmptyState, { "data-slot": "inputs-list", ...props, ref: ref, className: className, children: labels.empty.inputs });
14
+ }
15
+ return (_jsx(InventoryRecords, { ...props, ref: ref, kind: "input", className: className, children: _jsx(RecordList, { label: labels.sections.inputs, columnTemplate: "minmax(14rem, 1.1fr) minmax(12rem, 1fr) 6.875rem 1.5rem", columns: [
16
+ { label: 'Input', className: 'astra-record-list__primary' },
17
+ { label: 'Source', className: 'astra-record-list__source' },
18
+ { label: 'Type', className: 'astra-record-list__secondary' },
19
+ { className: 'astra-record-list__arrow' },
20
+ ], rows: records.map((record) => ({
21
+ key: record.canonicalPath,
22
+ accessibleLabel: recordTitle(record),
23
+ onOpen: () => { onOpenRecord(record, analysis); },
24
+ cells: [
25
+ _jsx(RecordIdentity, { kind: "input", title: recordTitle(record) }),
26
+ _jsx("code", { title: inputSourceLabel(record), children: inputSourceLabel(record) }),
27
+ _jsx("span", { className: "astra-record-list__tag", children: record.type }),
28
+ _jsx("span", { "aria-hidden": "true", children: "\u2192" }),
29
+ ],
30
+ })) }) }));
31
+ });
32
+ //# sourceMappingURL=inputs-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs-list.js","sourceRoot":"","sources":["../../src/blocks/inputs-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,kDAAkD;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAkC,SAAS,UAAU,CAAC,EACxF,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,KAAC,UAAU,iBAAW,aAAa,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,YAAG,MAAM,CAAC,KAAK,CAAC,MAAM,GAAc,CAAC;IAC3H,CAAC;IACD,OAAO,CACL,KAAC,gBAAgB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,YACtE,KAAC,UAAU,IACT,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAC7B,cAAc,EAAC,yDAAyD,EACxE,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE;gBAC3D,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,2BAA2B,EAAE;gBAC3D,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,8BAA8B,EAAE;gBAC5D,EAAE,SAAS,EAAE,0BAA0B,EAAE;aAC1C,EACD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAC7B,GAAG,EAAE,MAAM,CAAC,aAAa;gBACzB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC;gBACpC,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACjD,KAAK,EAAE;oBACL,KAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAI;oBAC3D,eAAM,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,YAAG,gBAAgB,CAAC,MAAM,CAAC,GAAQ;oBACxE,eAAM,SAAS,EAAC,wBAAwB,YAAE,MAAM,CAAC,IAAI,GAAQ;oBAC7D,8BAAkB,MAAM,uBAAS;iBAClC;aACF,CAAC,CAAC,GACH,GACe,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { ResolvedAnalysisNode, ResolvedOutput } from '@astra-spec/sdk';
2
+ import { type HTMLAttributes } from 'react';
3
+ import type { ArtifactRenderer } from '../components/artifact-preview.js';
4
+ export interface OutputsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
5
+ analysis: ResolvedAnalysisNode;
6
+ renderArtifact?: ArtifactRenderer | undefined;
7
+ onOpenRecord: (output: ResolvedOutput, analysis: ResolvedAnalysisNode) => void;
8
+ }
9
+ export interface OutputCardProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
10
+ output: ResolvedOutput;
11
+ renderArtifact?: ArtifactRenderer | undefined;
12
+ onOpen: () => void;
13
+ }
14
+ /** A gallery card: compact preview, type, and title. */
15
+ export declare const OutputCard: import("react").ForwardRefExoticComponent<OutputCardProps & import("react").RefAttributes<HTMLButtonElement>>;
16
+ /** Figures and tables as galleries, everything else as a list. */
17
+ export declare const OutputsList: import("react").ForwardRefExoticComponent<OutputsListProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ //# sourceMappingURL=outputs-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputs-list.d.ts","sourceRoot":"","sources":["../../src/blocks/outputs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAI1E,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxF,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAChF;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC1F,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wDAAwD;AACxD,eAAO,MAAM,UAAU,+GA8BrB,CAAC;AAmEH,kEAAkE;AAClE,eAAO,MAAM,WAAW,6GAsBtB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId } from 'react';
3
+ import { recordTitle } from '../model/records.js';
4
+ import { cn } from '../lib/cn.js';
5
+ import { useLabels } from '../lib/labels.js';
6
+ import { EmptyState, RecordIdentity, RecordList } from '../primitives/record-list.js';
7
+ import { OutputPreview } from '../components/output-detail.js';
8
+ /** A gallery card: compact preview, type, and title. */
9
+ export const OutputCard = forwardRef(function OutputCard({ output, renderArtifact, onOpen, className, onClick, 'aria-label': hostLabel, ...props }, ref) {
10
+ return (_jsxs("button", { "data-slot": "output-card", ...props, ref: ref, type: "button", "aria-label": hostLabel ?? `Open ${output.type}: ${recordTitle(output)}`, className: cn('astra-output-card', className), onClick: (event) => { onClick?.(event); onOpen(); }, children: [_jsxs("span", { className: "astra-output-card__preview", children: [_jsx(OutputPreview, { output: output, compact: true, renderArtifact: renderArtifact }), _jsx("span", { className: "astra-output-card__open", "aria-hidden": "true", children: "Open \u2197" })] }), _jsxs("span", { className: "astra-output-card__body", children: [_jsx("span", { className: "astra-output-card__kind", children: output.type }), _jsx("strong", { children: recordTitle(output) }), output.label ? _jsx("code", { children: output.id }) : null] })] }));
11
+ });
12
+ function OutputGallery({ title, outputs, renderArtifact, onOpen, }) {
13
+ const id = useId();
14
+ if (!outputs.length)
15
+ return null;
16
+ return (_jsxs("section", { className: "astra-inventory-outputs__group", "aria-labelledby": id, children: [_jsx("h3", { id: id, className: "astra-inventory-outputs__group-heading", children: _jsx("span", { children: title }) }), _jsx("div", { className: "astra-inventory-outputs__gallery", children: outputs.map((output) => (_jsx(OutputCard, { output: output, renderArtifact: renderArtifact, onOpen: () => { onOpen(output); } }, output.canonicalPath))) })] }));
17
+ }
18
+ function OutputFiles({ outputs, onOpen }) {
19
+ const id = useId();
20
+ if (!outputs.length)
21
+ return null;
22
+ return (_jsxs("section", { className: "astra-inventory-outputs__group astra-inventory-outputs__files", "aria-labelledby": id, children: [_jsx("h3", { id: id, className: "astra-inventory-outputs__group-heading", children: _jsx("span", { children: "Other outputs" }) }), _jsx(RecordList, { label: "Other outputs", columnTemplate: "minmax(14rem, 1fr) 1.5rem", columns: [
23
+ { label: 'Output', className: 'astra-record-list__primary' },
24
+ { className: 'astra-record-list__arrow' },
25
+ ], rows: outputs.map((output) => ({
26
+ key: output.canonicalPath,
27
+ accessibleLabel: recordTitle(output),
28
+ onOpen: () => { onOpen(output); },
29
+ cells: [
30
+ _jsx(RecordIdentity, { kind: "output", title: recordTitle(output), subtitle: output.label ? output.id : output.format?.toUpperCase() }),
31
+ _jsx("span", { "aria-hidden": "true", children: "\u2192" }),
32
+ ],
33
+ })) })] }));
34
+ }
35
+ /** Figures and tables as galleries, everything else as a list. */
36
+ export const OutputsList = forwardRef(function OutputsList({ analysis, renderArtifact, onOpenRecord, className, ...props }, ref) {
37
+ const labels = useLabels();
38
+ const figures = analysis.outputs.filter(({ type }) => type === 'figure');
39
+ const tables = analysis.outputs.filter(({ type }) => type === 'table');
40
+ const files = analysis.outputs.filter(({ type }) => type !== 'figure' && type !== 'table');
41
+ if (!analysis.outputs.length) {
42
+ return _jsx(EmptyState, { "data-slot": "outputs-list", ...props, ref: ref, className: className, children: labels.empty.outputs });
43
+ }
44
+ const open = (output) => { onOpenRecord(output, analysis); };
45
+ return (_jsxs("div", { "data-slot": "outputs-list", ...props, ref: ref, className: cn('astra-inventory-outputs', className), children: [_jsx(OutputGallery, { title: "Figures", outputs: figures, renderArtifact: renderArtifact, onOpen: open }), _jsx(OutputGallery, { title: "Tables", outputs: tables, renderArtifact: renderArtifact, onOpen: open }), _jsx(OutputFiles, { outputs: files, onOpen: open })] }));
46
+ });
47
+ //# sourceMappingURL=outputs-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputs-list.js","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KAAK,OAAO,CAAC,CAAC;IAC3F,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAC7B,OAAO,KAAC,UAAU,iBAAW,cAAc,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,YAAG,MAAM,CAAC,KAAK,CAAC,OAAO,GAAc,CAAC;IAC7H,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAsB,EAAE,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,CACL,4BAAe,cAAc,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,aACpG,KAAC,aAAa,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,GAAI,EACjG,KAAC,aAAa,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,GAAI,EAC/F,KAAC,WAAW,IAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAI,IACzC,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ResolvedAnalysisNode } from '@astra-spec/sdk';
2
+ import { type HTMLAttributes } from 'react';
3
+ import type { InventoryPaper } from '../model/papers.js';
4
+ export interface PapersListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
5
+ papers: readonly InventoryPaper[];
6
+ analysis: ResolvedAnalysisNode;
7
+ onOpenPaper: (paper: InventoryPaper, analysis: ResolvedAnalysisNode) => void;
8
+ }
9
+ export interface PaperRowsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
10
+ papers: readonly InventoryPaper[];
11
+ onOpen: (paper: InventoryPaper) => void;
12
+ }
13
+ /** Cited papers with their insight and decision counts. */
14
+ export declare const PaperRows: import("react").ForwardRefExoticComponent<PaperRowsProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const PapersList: import("react").ForwardRefExoticComponent<PapersListProps & import("react").RefAttributes<HTMLDivElement>>;
16
+ //# sourceMappingURL=papers-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"papers-list.d.ts","sourceRoot":"","sources":["../../src/blocks/papers-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACvF,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAClC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC9E;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACtF,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACzC;AAED,2DAA2D;AAC3D,eAAO,MAAM,SAAS,2GAyBpB,CAAC;AAEH,eAAO,MAAM,UAAU,4GAgBrB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { countLabel } from '../model/records.js';
4
+ import { cn } from '../lib/cn.js';
5
+ import { useLabels } from '../lib/labels.js';
6
+ import { EmptyState } from '../primitives/record-list.js';
7
+ import { InventoryRecords } from './section.js';
8
+ /** Cited papers with their insight and decision counts. */
9
+ export const PaperRows = forwardRef(function PaperRows({ papers, onOpen, className, ...props }, ref) {
10
+ const labels = useLabels();
11
+ return (_jsx("div", { "data-slot": "paper-list", ...props, ref: ref, className: cn('astra-paper-list', className), role: "group", "aria-label": labels.sections.papers, children: papers.map((paper) => (_jsxs("button", { type: "button", "aria-label": `${paper.title}, ${paper.doi}, ${countLabel(paper.insights.length, 'insight')}, ${countLabel(paper.decisions.length, 'decision')}`, onClick: () => { onOpen(paper); }, children: [_jsx("span", { className: "astra-paper-list__thumbnail", "aria-hidden": "true", children: "p.1" }), _jsxs("span", { className: "astra-paper-list__copy", children: [_jsx("strong", { children: paper.title }), _jsx("small", { children: [paper.authors, paper.doi].filter(Boolean).join(' · ') })] }), _jsxs("span", { className: "astra-paper-list__meta", children: [countLabel(paper.insights.length, 'insight'), " \u00B7", ' ', countLabel(paper.decisions.length, 'decision')] }), _jsx("span", { className: "astra-paper-list__arrow", "aria-hidden": "true", children: "\u2192" })] }, paper.doi))) }));
12
+ });
13
+ export const PapersList = forwardRef(function PapersList({ papers, analysis, onOpenPaper, className, ...props }, ref) {
14
+ const labels = useLabels();
15
+ if (!papers.length) {
16
+ return _jsx(EmptyState, { "data-slot": "papers-list", ...props, ref: ref, className: className, children: labels.empty.papers });
17
+ }
18
+ return (_jsx(InventoryRecords, { ...props, ref: ref, kind: "paper", className: className, children: _jsx(PaperRows, { papers: papers, onOpen: (paper) => { onOpenPaper(paper, analysis); } }) }));
19
+ });
20
+ //# sourceMappingURL=papers-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"papers-list.js","sourceRoot":"","sources":["../../src/blocks/papers-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;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AC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,aAAI,GAAG,EACnD,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAC1C,EACP,eAAM,SAAS,EAAC,yBAAyB,iBAAa,MAAM,uBAAS,KAdhE,KAAK,CAAC,GAAG,CAeP,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAkC,SAAS,UAAU,CAAC,EACxF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,KAAC,UAAU,iBAAW,aAAa,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,YAAG,MAAM,CAAC,KAAK,CAAC,MAAM,GAAc,CAAC;IAC3H,CAAC;IACD,OAAO,CACL,KAAC,gBAAgB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,YACtE,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAI,GAClE,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ResolvedAnalysisNode, ResolvedInsight } from '@astra-spec/sdk';
2
+ import { type HTMLAttributes } from 'react';
3
+ export interface PriorInsightsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
+ analysis: ResolvedAnalysisNode;
5
+ onOpenRecord: (insight: ResolvedInsight, analysis: ResolvedAnalysisNode) => void;
6
+ }
7
+ /** Prior insights with their claim and source count. */
8
+ export declare const PriorInsightsList: import("react").ForwardRefExoticComponent<PriorInsightsListProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=prior-insights-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prior-insights-list.d.ts","sourceRoot":"","sources":["../../src/blocks/prior-insights-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAMxD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9F,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,YAAY,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAClF;AAED,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,mHAsC5B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { countLabel, recordTitle } from '../model/records.js';
4
+ import { useLabels } from '../lib/labels.js';
5
+ import { EmptyState, RecordIdentity, RecordList } from '../primitives/record-list.js';
6
+ import { InventoryRecords } from './section.js';
7
+ /** Prior insights with their claim and source count. */
8
+ export const PriorInsightsList = forwardRef(function PriorInsightsList({ analysis, onOpenRecord, className, ...props }, ref) {
9
+ const labels = useLabels();
10
+ const records = analysis.prior_insights;
11
+ if (!records.length) {
12
+ return _jsx(EmptyState, { "data-slot": "prior-insights-list", ...props, ref: ref, className: className, children: labels.empty.prior_insights });
13
+ }
14
+ return (_jsx(InventoryRecords, { ...props, ref: ref, kind: "prior_insight", className: className, children: _jsx(RecordList, { label: labels.sections.prior_insights, columnTemplate: "minmax(18rem, 1fr) 7rem 1.5rem", columns: [
15
+ { label: 'Prior insight', className: 'astra-record-list__primary' },
16
+ { label: 'Evidence', className: 'astra-record-list__count astra-record-list__secondary' },
17
+ { className: 'astra-record-list__arrow' },
18
+ ], rows: records.map((record) => ({
19
+ key: record.canonicalPath,
20
+ accessibleLabel: `${recordTitle(record)}: ${record.claim} ${countLabel(record.evidence.length, 'source')}`,
21
+ onOpen: () => { onOpenRecord(record, analysis); },
22
+ cells: [
23
+ _jsx(RecordIdentity, { kind: "prior_insight", title: record.claim, subtitle: record.label ? record.id : undefined }),
24
+ _jsx("span", { children: countLabel(record.evidence.length, 'source') }),
25
+ _jsx("span", { "aria-hidden": "true", children: "\u2192" }),
26
+ ],
27
+ })) }) }));
28
+ });
29
+ //# sourceMappingURL=prior-insights-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prior-insights-list.js","sourceRoot":"","sources":["../../src/blocks/prior-insights-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,wDAAwD;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAyC,SAAS,iBAAiB,CAAC,EAC7G,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,KAAC,UAAU,iBAAW,qBAAqB,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,YAAG,MAA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es, type ReactNode } from 'react';
2
+ import { type SurfaceKind } from '../primitives/kind.js';
3
+ export type InventorySectionId = 'outputs' | 'decisions' | 'inputs' | 'findings' | 'prior_insights' | 'papers';
4
+ export interface InventorySectionProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
5
+ /** Anchor id for the heading; also the outline link target. */
6
+ id: string;
7
+ /** Which built-in section this is, for the section-specific layout hooks. */
8
+ section?: InventorySectionId | undefined;
9
+ title: ReactNode;
10
+ count?: number | undefined;
11
+ /** Text shown for the count, e.g. "65 outputs"; defaults to the bare number. */
12
+ countLabel?: ReactNode | undefined;
13
+ }
14
+ /** A titled, counted block of the inventory page. */
15
+ export declare const InventorySection: import("react").ForwardRefExoticComponent<InventorySectionProps & import("react").RefAttributes<HTMLElement>>;
16
+ /** The record kind each inventory section lists; drives the outline glyph and colour. */
17
+ export declare function sectionKind(section: InventorySectionId): SurfaceKind;
18
+ export interface InventoryOutlineEntry {
19
+ id: string;
20
+ label: ReactNode;
21
+ count?: number | undefined;
22
+ /** Shows the kind's glyph in the kind's colour before the label. */
23
+ kind?: SurfaceKind | undefined;
24
+ }
25
+ export interface InventoryOutlineProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
26
+ entries: InventoryOutlineEntry[];
27
+ title?: ReactNode | undefined;
28
+ }
29
+ /** The sticky "on this page" list of section anchors. */
30
+ export declare const InventoryOutline: import("react").ForwardRefExoticComponent<InventoryOutlineProps & import("react").RefAttributes<HTMLElement>>;
31
+ export interface InventoryRecordsProps extends HTMLAttributes<HTMLDivElement> {
32
+ kind: 'output' | 'decision' | 'input' | 'finding' | 'prior_insight' | 'paper';
33
+ }
34
+ /** Wrapper that gives a per-kind list its layout hooks. */
35
+ export declare const InventoryRecords: import("react").ForwardRefExoticComponent<InventoryRecordsProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ //# sourceMappingURL=section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/blocks/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c,CAAC;IAC3E,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,eAAe,GAAG,OAAO,CAAC;CAC/E;AAED,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,kHAE3B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { cn } from '../lib/cn.js';
4
+ import { surfaceGlyph } from '../primitives/kind.js';
5
+ import { useLabels } from '../lib/labels.js';
6
+ /** A titled, counted block of the inventory page. */
7
+ export const InventorySection = forwardRef(function InventorySection({ id, section, title, count, countLabel, className, children, ...props }, ref) {
8
+ return (_jsxs("section", { "data-slot": "inventory-section", ...props, ref: ref, className: cn('astra-inventory__section', className), ...(section ? { 'data-section': section } : {}), children: [_jsxs("div", { className: "astra-inventory__heading", children: [_jsx("h2", { id: id, tabIndex: -1, children: _jsx("span", { children: title }) }), count !== undefined ? _jsx("span", { children: countLabel ?? count }) : null] }), children] }));
9
+ });
10
+ /** The record kind each inventory section lists; drives the outline glyph and colour. */
11
+ export function sectionKind(section) {
12
+ switch (section) {
13
+ case 'outputs': return 'output';
14
+ case 'decisions': return 'decision';
15
+ case 'inputs': return 'input';
16
+ case 'findings': return 'finding';
17
+ case 'prior_insights': return 'prior_insight';
18
+ case 'papers': return 'paper';
19
+ }
20
+ }
21
+ /** The sticky "on this page" list of section anchors. */
22
+ export const InventoryOutline = forwardRef(function InventoryOutline({ entries, title, className, ...props }, ref) {
23
+ const labels = useLabels();
24
+ return (_jsxs("aside", { "data-slot": "inventory-outline", ...props, ref: ref, className: cn('astra-inventory-outline', className), "aria-label": labels.outline, children: [_jsx("h3", { children: title ?? labels.outline }), _jsx("nav", { children: entries.map((entry) => (_jsxs("a", { href: `#${entry.id}`, children: [_jsx("span", { className: "astra-inventory-outline__glyph", ...(entry.kind ? { 'data-kind': entry.kind } : {}), "aria-hidden": "true", children: entry.kind ? surfaceGlyph(entry.kind) : null }), _jsx("span", { children: entry.label }), entry.count !== undefined ? _jsx("span", { children: entry.count }) : null] }, entry.id))) })] }));
25
+ });
26
+ /** Wrapper that gives a per-kind list its layout hooks. */
27
+ export const InventoryRecords = forwardRef(function InventoryRecords({ kind, className, ...props }, ref) {
28
+ return _jsx("div", { "data-slot": "inventory-records", ...props, ref: ref, className: cn('astra-inventory-records', className), "data-kind": kind });
29
+ });
30
+ //# sourceMappingURL=section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section.js","sourceRoot":"","sources":["../../src/blocks/section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAe7C,qDAAqD;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAqC,SAAS,gBAAgB,CAAC,EACvG,EAAE,EACF,OAAO,EACP,KAAK,EACL,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,OAAO,CACL,gCACY,mBAAmB,KACzB,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAEhD,eAAK,SAAS,EAAC,0BAA0B,aACvC,aAAI,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,YACtB,yBAAO,KAAK,GAAQ,GACjB,EACJ,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAO,UAAU,IAAI,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC5D,EACL,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I,GACxC,EACP,yBAAO,KAAK,CAAC,KAAK,GAAQ,EACzB,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAO,KAAK,CAAC,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,KALxD,KAAK,CAAC,EAAE,CAMZ,CACL,CAAC,GACE,IACA,CACT,CAAC;AACJ,CAAC,CAAC,CAAC;AAMH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAwC,SAAS,gBAAgB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC5I,OAAO,2BAAe,mBAAmB,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,eAAa,IAAI,GAAI,CAAC;AAC1I,CAAC,CAAC,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { ResolvedOutput } from '@astra-spec/sdk';
2
+ import { type HTMLAttributes, type ReactNode } from 'react';
3
+ export interface TablePreviewData {
4
+ kind: 'table';
5
+ headers: string[];
6
+ rows: (string | number | boolean | null)[][];
7
+ /** Exact number of rows in the source. Leave unset when the source was sampled and the total is unknown. */
8
+ totalRows?: number | undefined;
9
+ totalColumns?: number | undefined;
10
+ /** The preview does not show everything: rows or columns were cut, or the source itself was a sample. */
11
+ truncated?: boolean | undefined;
12
+ }
13
+ export interface ImagePreviewData {
14
+ kind: 'image';
15
+ url: string;
16
+ alt?: string | undefined;
17
+ width?: number | undefined;
18
+ height?: number | undefined;
19
+ }
20
+ export interface MetricPreviewData {
21
+ kind: 'metric';
22
+ value: number | string;
23
+ uncertainty?: number | string | undefined;
24
+ unit?: string | undefined;
25
+ label?: string | undefined;
26
+ }
27
+ export interface TextPreviewData {
28
+ kind: 'text';
29
+ text: string;
30
+ language?: string | undefined;
31
+ truncated?: boolean | undefined;
32
+ }
33
+ export interface LoadingPreviewData {
34
+ kind: 'loading';
35
+ message?: string | undefined;
36
+ }
37
+ export interface UnavailablePreviewData {
38
+ kind: 'unavailable';
39
+ reason?: string | undefined;
40
+ }
41
+ /** Host-safe data that a portable component can render without reading a file. */
42
+ export type ArtifactPreviewData = TablePreviewData | ImagePreviewData | MetricPreviewData | TextPreviewData | LoadingPreviewData | UnavailablePreviewData;
43
+ export interface ArtifactRenderOptions {
44
+ compact: boolean;
45
+ }
46
+ /** Controlled host slot. Reading, decoding, URLs, and caching remain outside astra-ui. */
47
+ export type ArtifactRenderer = (output: ResolvedOutput, options: ArtifactRenderOptions) => ReactNode;
48
+ export interface ArtifactPreviewProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
49
+ output: ResolvedOutput;
50
+ preview?: ArtifactPreviewData | undefined;
51
+ compact?: boolean | undefined;
52
+ caption?: ReactNode | undefined;
53
+ /** Pure helpers exported below build the default preview data. */
54
+ locale?: string | undefined;
55
+ }
56
+ /** Pure renderer for a resolved output and optional host-supplied preview data. */
57
+ export declare const ArtifactPreview: import("react").ForwardRefExoticComponent<ArtifactPreviewProps & import("react").RefAttributes<HTMLElement>>;
58
+ export interface DelimitedPreviewOptions {
59
+ delimiter?: string | undefined;
60
+ maxRows?: number | undefined;
61
+ maxColumns?: number | undefined;
62
+ /** Set when the source text was itself cut short by the host. */
63
+ sourceTruncated?: boolean | undefined;
64
+ }
65
+ /** Turns delimited text (CSV, TSV) into table preview data. */
66
+ export declare function tablePreviewFromDelimited(text: string, options?: DelimitedPreviewOptions): TablePreviewData;
67
+ /** Turns an array of flat objects (e.g. parsed JSON records) into table preview data. */
68
+ export declare function tablePreviewFromRows(records: readonly Record<string, unknown>[], options?: Pick<DelimitedPreviewOptions, 'maxRows' | 'maxColumns' | 'sourceTruncated'>): TablePreviewData;
69
+ /** Reads a metric from a scalar or a `{ value, uncertainty?, unit?, label? }` object; `undefined` when the shape is not a metric. */
70
+ export declare function metricPreviewFromJson(value: unknown): MetricPreviewData | undefined;
71
+ //# sourceMappingURL=art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;AA8BD,+DAA+D;AAC/D,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAqB/G;AAED,yFAAyF;AACzF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC3C,OAAO,GAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,GAAG,YAAY,GAAG,iBAAiB,CAAM,GACxF,gBAAgB,CAmBlB;AAED,qIAAqI;AACrI,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAanF"}
@@ -0,0 +1,170 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useState } from 'react';
3
+ import { cn } from '../lib/cn.js';
4
+ function compactValue(value, locale) {
5
+ if (value == null || value === '')
6
+ return 'Value unavailable';
7
+ return typeof value === 'number'
8
+ ? value.toLocaleString(locale, { maximumSignificantDigits: 5 })
9
+ : value;
10
+ }
11
+ function unavailableReason(output) {
12
+ if (!output.active)
13
+ return 'This output is not active in the selected universe.';
14
+ if (!output.artifact)
15
+ return 'This output has not been materialized.';
16
+ return 'This host has not supplied an artifact preview.';
17
+ }
18
+ /** Pure renderer for a resolved output and optional host-supplied preview data. */
19
+ export const ArtifactPreview = forwardRef(function ArtifactPreview({ output, preview, compact = false, caption = output.label ?? output.id, locale, className, ...props }, ref) {
20
+ const [imageFailed, setImageFailed] = useState(false);
21
+ const imageUrl = preview?.kind === 'image' ? preview.url : undefined;
22
+ useEffect(() => { setImageFailed(false); }, [imageUrl, output.canonicalPath]);
23
+ const type = preview?.kind ?? output.type;
24
+ const shared = {
25
+ ...props,
26
+ 'data-slot': 'artifact-preview',
27
+ 'data-type': type,
28
+ ...(compact ? { 'data-compact': '' } : {}),
29
+ };
30
+ const rootClass = cn('astra-artifact', className);
31
+ if (preview?.kind === 'loading') {
32
+ return (_jsxs("div", { ...shared, ref: ref, className: cn(rootClass, 'astra-artifact__placeholder'), role: "status", "aria-busy": "true", children: [_jsx("span", { "aria-hidden": "true", children: "\u2026" }), _jsx("span", { children: preview.message ?? 'Loading preview…' })] }));
33
+ }
34
+ if (!preview || preview.kind === 'unavailable') {
35
+ return (_jsxs("div", { ...shared, ref: ref, className: cn(rootClass, 'astra-artifact__placeholder'), role: "status", children: [_jsx("span", { "aria-hidden": "true", children: output.active ? '↳' : '○' }), _jsx("span", { children: preview?.reason ?? unavailableReason(output) })] }));
36
+ }
37
+ if (preview.kind === 'image') {
38
+ if (imageFailed) {
39
+ return (_jsxs("div", { ...shared, ref: ref, className: cn(rootClass, 'astra-artifact__placeholder'), role: "status", children: [_jsx("span", { "aria-hidden": "true", children: "\u25A6" }), _jsx("span", { children: "Figure preview unavailable" })] }));
40
+ }
41
+ return (_jsxs("figure", { ...shared, ref: ref, className: rootClass, children: [_jsx("img", { src: preview.url, alt: preview.alt ?? `Preview of ${output.label ?? output.id}`, width: preview.width, height: preview.height, onError: () => { setImageFailed(true); } }), !compact && caption != null ? _jsx("figcaption", { children: caption }) : null] }));
42
+ }
43
+ if (preview.kind === 'table') {
44
+ const columnLimit = compact ? 5 : 30;
45
+ const rowLimit = compact ? 4 : 30;
46
+ const headers = preview.headers.slice(0, columnLimit);
47
+ const rows = preview.rows.slice(0, rowLimit);
48
+ const totalRows = preview.totalRows;
49
+ const totalColumns = preview.totalColumns ?? preview.headers.length;
50
+ const moreRows = totalRows === undefined ? Boolean(preview.truncated) : totalRows > rows.length;
51
+ const moreColumns = totalColumns > headers.length;
52
+ const rowsNote = totalRows === undefined
53
+ ? `the first ${rows.length} rows (total unknown)`
54
+ : `${rows.length} of ${totalRows} rows`;
55
+ return (
56
+ // The full-size table scrolls and must be keyboard-reachable; the compact one sits inside a card button.
57
+ _jsxs("div", { ...shared, ref: ref, className: cn(rootClass, 'astra-artifact__table'), ...(compact ? {} : { tabIndex: 0 }), children: [_jsxs("table", { children: [_jsx("thead", { children: _jsx("tr", { children: headers.map((header, index) => _jsx("th", { children: header }, `${header}-${index}`)) }) }), _jsx("tbody", { children: rows.map((row, rowIndex) => (_jsx("tr", { children: row.slice(0, columnLimit).map((cell, columnIndex) => (_jsx("td", { children: cell === null ? '—' : String(cell) }, columnIndex))) }, rowIndex))) })] }), !compact && (preview.truncated || moreRows || moreColumns) ? (_jsxs("p", { children: ["Showing ", rowsNote, " and ", headers.length, " of ", totalColumns, " columns."] })) : null] }));
58
+ }
59
+ if (preview.kind === 'metric') {
60
+ return (_jsxs("div", { ...shared, ref: ref, className: cn(rootClass, 'astra-artifact__metric'), children: [preview.label ? _jsx("span", { children: preview.label }) : null, _jsx("strong", { className: "astra-artifact__metric-value", children: compactValue(preview.value, locale) }), preview.uncertainty !== undefined ? (_jsxs("span", { className: "astra-artifact__metric-uncertainty", children: ["\u00B1 ", preview.uncertainty] })) : null, preview.unit ? _jsx("span", { className: "astra-artifact__metric-unit", children: preview.unit }) : null] }));
61
+ }
62
+ return (_jsxs("div", { ...shared, ref: ref, className: rootClass, children: [_jsx("pre", { children: _jsx("code", { children: preview.text }) }), preview.truncated ? _jsx("p", { children: "Preview truncated." }) : null] }));
63
+ });
64
+ /** RFC 4180-style rows: quoted cells may hold delimiters, doubled quotes, and line breaks. Blank rows are dropped. */
65
+ function parseDelimited(text, delimiter) {
66
+ const rows = [];
67
+ let row = [];
68
+ let cell = '';
69
+ let quoted = false;
70
+ const endCell = () => { row.push(cell.trim()); cell = ''; };
71
+ const endRow = () => {
72
+ endCell();
73
+ if (row.some((value) => value.length > 0))
74
+ rows.push(row);
75
+ row = [];
76
+ };
77
+ for (let index = 0; index < text.length; index += 1) {
78
+ const character = text.charAt(index);
79
+ if (quoted) {
80
+ if (character !== '"')
81
+ cell += character;
82
+ else if (text.charAt(index + 1) === '"') {
83
+ cell += '"';
84
+ index += 1;
85
+ }
86
+ else
87
+ quoted = false;
88
+ }
89
+ else if (character === '"')
90
+ quoted = true;
91
+ else if (character === delimiter)
92
+ endCell();
93
+ else if (character === '\n' || character === '\r') {
94
+ if (character === '\r' && text.charAt(index + 1) === '\n')
95
+ index += 1;
96
+ endRow();
97
+ }
98
+ else
99
+ cell += character;
100
+ }
101
+ endRow();
102
+ return { rows, unterminated: quoted };
103
+ }
104
+ /** Turns delimited text (CSV, TSV) into table preview data. */
105
+ export function tablePreviewFromDelimited(text, options = {}) {
106
+ const delimiter = options.delimiter ?? ',';
107
+ const maxRows = options.maxRows ?? 30;
108
+ const maxColumns = options.maxColumns ?? 30;
109
+ const parsed = parseDelimited(text, delimiter);
110
+ const [allHeaders = [], ...records] = parsed.rows;
111
+ // A byte-limited sample may end inside a record (or inside a quoted cell);
112
+ // that record is dropped, and the total row count is unknown.
113
+ const sampled = Boolean(options.sourceTruncated);
114
+ const lastComplete = /\r?\n$/.test(text) && !parsed.unterminated;
115
+ const body = sampled && !lastComplete ? records.slice(0, -1) : records;
116
+ const headers = allHeaders.slice(0, maxColumns);
117
+ const rows = body.slice(0, maxRows).map((cells) => cells.slice(0, maxColumns));
118
+ return {
119
+ kind: 'table',
120
+ headers,
121
+ rows,
122
+ ...(sampled ? {} : { totalRows: body.length }),
123
+ totalColumns: allHeaders.length,
124
+ truncated: sampled || body.length > maxRows || allHeaders.length > maxColumns,
125
+ };
126
+ }
127
+ /** Turns an array of flat objects (e.g. parsed JSON records) into table preview data. */
128
+ export function tablePreviewFromRows(records, options = {}) {
129
+ const maxRows = options.maxRows ?? 30;
130
+ const maxColumns = options.maxColumns ?? 30;
131
+ const allHeaders = [...new Set(records.flatMap((record) => Object.keys(record)))];
132
+ const headers = allHeaders.slice(0, maxColumns);
133
+ const rows = records.slice(0, maxRows).map((record) => headers.map((header) => {
134
+ const value = record[header];
135
+ if (value == null)
136
+ return null;
137
+ if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'string')
138
+ return value;
139
+ return JSON.stringify(value);
140
+ }));
141
+ return {
142
+ kind: 'table',
143
+ headers,
144
+ rows,
145
+ totalRows: records.length,
146
+ totalColumns: allHeaders.length,
147
+ truncated: Boolean(options.sourceTruncated) || records.length > maxRows || allHeaders.length > maxColumns,
148
+ };
149
+ }
150
+ /** Reads a metric from a scalar or a `{ value, uncertainty?, unit?, label? }` object; `undefined` when the shape is not a metric. */
151
+ export function metricPreviewFromJson(value) {
152
+ if (typeof value === 'number' || typeof value === 'string')
153
+ return { kind: 'metric', value };
154
+ if (value && typeof value === 'object' && 'value' in value) {
155
+ const record = value;
156
+ const metric = record.value;
157
+ if (typeof metric !== 'number' && typeof metric !== 'string')
158
+ return undefined;
159
+ const result = { kind: 'metric', value: metric };
160
+ if (typeof record.uncertainty === 'number' || typeof record.uncertainty === 'string')
161
+ result.uncertainty = record.uncertainty;
162
+ if (typeof record.unit === 'string')
163
+ result.unit = record.unit;
164
+ if (typeof record.label === 'string')
165
+ result.label = record.label;
166
+ return result;
167
+ }
168
+ return undefined;
169
+ }
170
+ //# sourceMappingURL=artifact-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-preview.js","sourceRoot":"","sources":["../../src/components/artifact-preview.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAC;AAC7F,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AA0ElC,SAAS,YAAY,CAAC,KAAkC,EAAE,MAA0B;IAClF,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,mBAAmB,CAAC;IAC9D,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC;QAC/D,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAsB;IAC/C,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,qDAAqD,CAAC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