@astra-spec/ui 0.0.5 → 0.0.7

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 (172) hide show
  1. package/README.md +47 -4
  2. package/blocks.css +1 -0
  3. package/components.css +6 -0
  4. package/dist/blocks/analysis-tree.d.ts.map +1 -1
  5. package/dist/blocks/analysis-tree.js +4 -7
  6. package/dist/blocks/analysis-tree.js.map +1 -1
  7. package/dist/blocks/decisions-list.d.ts.map +1 -1
  8. package/dist/blocks/decisions-list.js +1 -1
  9. package/dist/blocks/decisions-list.js.map +1 -1
  10. package/dist/blocks/findings-list.d.ts.map +1 -1
  11. package/dist/blocks/findings-list.js +2 -4
  12. package/dist/blocks/findings-list.js.map +1 -1
  13. package/dist/blocks/index.d.ts +2 -4
  14. package/dist/blocks/index.d.ts.map +1 -1
  15. package/dist/blocks/index.js +1 -2
  16. package/dist/blocks/index.js.map +1 -1
  17. package/dist/blocks/outputs-list.d.ts +2 -7
  18. package/dist/blocks/outputs-list.d.ts.map +1 -1
  19. package/dist/blocks/outputs-list.js +11 -21
  20. package/dist/blocks/outputs-list.js.map +1 -1
  21. package/dist/blocks/papers-list.d.ts.map +1 -1
  22. package/dist/blocks/papers-list.js +3 -3
  23. package/dist/blocks/papers-list.js.map +1 -1
  24. package/dist/components/figure-zoom.d.ts +6 -0
  25. package/dist/components/figure-zoom.d.ts.map +1 -0
  26. package/dist/components/figure-zoom.js +28 -0
  27. package/dist/components/figure-zoom.js.map +1 -0
  28. package/dist/components/finding-detail.d.ts +4 -2
  29. package/dist/components/finding-detail.d.ts.map +1 -1
  30. package/dist/components/finding-detail.js +41 -25
  31. package/dist/components/finding-detail.js.map +1 -1
  32. package/dist/components/index.d.ts +9 -0
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/components/index.js +5 -0
  35. package/dist/components/index.js.map +1 -1
  36. package/dist/components/insight-trigger.js +2 -2
  37. package/dist/components/insight-trigger.js.map +1 -1
  38. package/dist/components/output-card.d.ts +13 -0
  39. package/dist/components/output-card.d.ts.map +1 -0
  40. package/dist/components/output-card.js +12 -0
  41. package/dist/components/output-card.js.map +1 -0
  42. package/dist/components/output-detail.d.ts +6 -2
  43. package/dist/components/output-detail.d.ts.map +1 -1
  44. package/dist/components/output-detail.js +49 -13
  45. package/dist/components/output-detail.js.map +1 -1
  46. package/dist/components/output-dialog.d.ts +6 -1
  47. package/dist/components/output-dialog.d.ts.map +1 -1
  48. package/dist/components/output-dialog.js +2 -2
  49. package/dist/components/output-dialog.js.map +1 -1
  50. package/dist/components/output-entry.d.ts +17 -0
  51. package/dist/components/output-entry.d.ts.map +1 -0
  52. package/dist/components/output-entry.js +21 -0
  53. package/dist/components/output-entry.js.map +1 -0
  54. package/dist/components/output-provenance.d.ts +6 -0
  55. package/dist/components/output-provenance.d.ts.map +1 -0
  56. package/dist/components/output-provenance.js +16 -0
  57. package/dist/components/output-provenance.js.map +1 -0
  58. package/dist/components/output-status.d.ts +8 -0
  59. package/dist/components/output-status.d.ts.map +1 -0
  60. package/dist/components/output-status.js +17 -0
  61. package/dist/components/output-status.js.map +1 -0
  62. package/dist/components/paper-detail.d.ts.map +1 -1
  63. package/dist/components/paper-detail.js +11 -15
  64. package/dist/components/paper-detail.js.map +1 -1
  65. package/dist/components/paper-row.d.ts +9 -0
  66. package/dist/components/paper-row.d.ts.map +1 -0
  67. package/dist/components/paper-row.js +11 -0
  68. package/dist/components/paper-row.js.map +1 -0
  69. package/dist/components/record-dialog.d.ts +5 -1
  70. package/dist/components/record-dialog.d.ts.map +1 -1
  71. package/dist/components/record-dialog.js +7 -4
  72. package/dist/components/record-dialog.js.map +1 -1
  73. package/dist/lib/labels.d.ts +34 -2
  74. package/dist/lib/labels.d.ts.map +1 -1
  75. package/dist/lib/labels.js +35 -4
  76. package/dist/lib/labels.js.map +1 -1
  77. package/dist/model/index.d.ts +4 -2
  78. package/dist/model/index.d.ts.map +1 -1
  79. package/dist/model/index.js +1 -1
  80. package/dist/model/index.js.map +1 -1
  81. package/dist/model/kind.d.ts +1 -1
  82. package/dist/model/kind.d.ts.map +1 -1
  83. package/dist/model/kind.js +0 -1
  84. package/dist/model/kind.js.map +1 -1
  85. package/dist/model/output-provenance.d.ts +17 -0
  86. package/dist/model/output-provenance.d.ts.map +1 -0
  87. package/dist/model/output-provenance.js +2 -0
  88. package/dist/model/output-provenance.js.map +1 -0
  89. package/dist/model/output-status.d.ts +17 -0
  90. package/dist/model/output-status.d.ts.map +1 -0
  91. package/dist/model/output-status.js +2 -0
  92. package/dist/model/output-status.js.map +1 -0
  93. package/dist/model/relations.d.ts +37 -12
  94. package/dist/model/relations.d.ts.map +1 -1
  95. package/dist/model/relations.js +76 -23
  96. package/dist/model/relations.js.map +1 -1
  97. package/dist/primitives/dialog.d.ts.map +1 -1
  98. package/dist/primitives/dialog.js +9 -1
  99. package/dist/primitives/dialog.js.map +1 -1
  100. package/dist/primitives/index.d.ts +2 -0
  101. package/dist/primitives/index.d.ts.map +1 -1
  102. package/dist/primitives/index.js +1 -0
  103. package/dist/primitives/index.js.map +1 -1
  104. package/dist/primitives/output-status-glyph.d.ts +8 -0
  105. package/dist/primitives/output-status-glyph.d.ts.map +1 -0
  106. package/dist/primitives/output-status-glyph.js +13 -0
  107. package/dist/primitives/output-status-glyph.js.map +1 -0
  108. package/dist/primitives/tooltip.d.ts +7 -0
  109. package/dist/primitives/tooltip.d.ts.map +1 -0
  110. package/dist/primitives/tooltip.js +31 -0
  111. package/dist/primitives/tooltip.js.map +1 -0
  112. package/dist/views/inventory.d.ts +12 -1
  113. package/dist/views/inventory.d.ts.map +1 -1
  114. package/dist/views/inventory.js +23 -17
  115. package/dist/views/inventory.js.map +1 -1
  116. package/package.json +3 -2
  117. package/primitives.css +1 -0
  118. package/src/blocks/analysis-tree.tsx +4 -30
  119. package/src/blocks/decisions-list.tsx +5 -3
  120. package/src/blocks/findings-list.tsx +8 -7
  121. package/src/blocks/index.ts +2 -4
  122. package/src/blocks/outputs-list.tsx +43 -106
  123. package/src/blocks/papers-list.tsx +2 -18
  124. package/src/components/figure-zoom.tsx +72 -0
  125. package/src/components/finding-detail.tsx +106 -30
  126. package/src/components/index.ts +13 -0
  127. package/src/components/insight-trigger.tsx +2 -2
  128. package/src/components/output-card.tsx +51 -0
  129. package/src/components/output-detail.tsx +69 -21
  130. package/src/components/output-dialog.tsx +9 -0
  131. package/src/components/output-entry.tsx +61 -0
  132. package/src/components/output-provenance.tsx +86 -0
  133. package/src/components/output-status.tsx +38 -0
  134. package/src/components/paper-detail.tsx +52 -54
  135. package/src/components/paper-row.tsx +41 -0
  136. package/src/components/record-dialog.tsx +13 -1
  137. package/src/lib/labels.tsx +69 -6
  138. package/src/model/index.ts +6 -2
  139. package/src/model/kind.ts +1 -2
  140. package/src/model/output-provenance.ts +18 -0
  141. package/src/model/output-status.ts +18 -0
  142. package/src/model/relations.ts +92 -26
  143. package/src/primitives/dialog.tsx +7 -1
  144. package/src/primitives/index.ts +2 -0
  145. package/src/primitives/output-status-glyph.tsx +37 -0
  146. package/src/primitives/tooltip.tsx +51 -0
  147. package/src/views/inventory.tsx +54 -22
  148. package/styles/base.css +2 -1
  149. package/styles/blocks/analysis-tree.css +22 -25
  150. package/styles/blocks/findings-list.css +50 -0
  151. package/styles/blocks/outputs-list.css +0 -421
  152. package/styles/blocks/papers-list.css +4 -70
  153. package/styles/components/evidence.css +1 -18
  154. package/styles/components/figure-zoom.css +62 -0
  155. package/styles/components/finding-detail.css +62 -0
  156. package/styles/components/insight-list.css +0 -4
  157. package/styles/components/insight-trigger.css +8 -6
  158. package/styles/components/output-card.css +290 -0
  159. package/styles/components/output-detail.css +91 -3
  160. package/styles/components/output-entry.css +141 -0
  161. package/styles/components/output-provenance.css +94 -0
  162. package/styles/components/output-status.css +31 -0
  163. package/styles/components/paper-detail.css +112 -59
  164. package/styles/components/paper-row.css +72 -0
  165. package/styles/primitives/dialog.css +4 -22
  166. package/styles/primitives/tooltip.css +22 -0
  167. package/styles/views/inventory.css +35 -2
  168. package/dist/blocks/prior-insights-list.d.ts +0 -9
  169. package/dist/blocks/prior-insights-list.d.ts.map +0 -1
  170. package/dist/blocks/prior-insights-list.js +0 -29
  171. package/dist/blocks/prior-insights-list.js.map +0 -1
  172. package/src/blocks/prior-insights-list.tsx +0 -52
@@ -0,0 +1,31 @@
1
+ /* output-status — emitted by src/components/output-status.tsx */
2
+ @layer astra.tokens, astra.base, astra.components, astra.views;
3
+ @layer astra.components {
4
+
5
+ :where(.astra-ui) .astra-output-status {
6
+ position: absolute;
7
+ top: -7px;
8
+ right: -7px;
9
+ z-index: 1;
10
+ display: grid;
11
+ width: 16px;
12
+ height: 16px;
13
+ place-items: center;
14
+ border-radius: 50%;
15
+ background: color-mix(in srgb, var(--astra-color-danger) 12%, var(--astra-color-surface-raised));
16
+ color: var(--astra-color-danger);
17
+ }
18
+
19
+ :where(.astra-ui) .astra-output-status:where([data-state="behind"]) {
20
+ background: color-mix(in srgb, var(--astra-color-kind-decision) 16%, var(--astra-color-surface-raised));
21
+ color: var(--astra-color-kind-decision-ink);
22
+ }
23
+
24
+ /* File rows share a divider, so keep their marker centered inside the row.
25
+ The space it needs is reserved by output-entry.css. */
26
+ :where(.astra-ui) .astra-output-entry:where([data-kind="file"]) > .astra-output-status {
27
+ top: 50%;
28
+ right: var(--astra-space-2);
29
+ transform: translateY(-50%);
30
+ }
31
+ }
@@ -47,11 +47,14 @@
47
47
  font-size: var(--astra-font-size-xs);
48
48
  }
49
49
 
50
+ /* Pushed right on its own, so the row needs no spacer element when the
51
+ insight has no name to open. */
50
52
  :where(.astra-ui) .astra-paper-insight__sources > div {
51
53
  display: flex;
52
54
  flex-wrap: wrap;
53
55
  gap: 4.48px;
54
56
  justify-content: flex-end;
57
+ margin-inline-start: auto;
55
58
  }
56
59
 
57
60
  :where(.astra-ui) .astra-paper-insight__locate {
@@ -102,7 +105,7 @@
102
105
  height: 100%;
103
106
  max-height: none;
104
107
  min-height: 0;
105
- grid-template-columns: minmax(0, 1fr) clamp(260px, 24%, 300px);
108
+ grid-template-columns: minmax(0, 1fr) clamp(320px, 29%, 380px);
106
109
  overflow: hidden;
107
110
  }
108
111
 
@@ -133,98 +136,148 @@
133
136
  border: 0;
134
137
  }
135
138
 
139
+ /* The mark leads the row, as it does wherever else a record is listed; the
140
+ claim and the actions under it share the column beside it. */
136
141
  :where(.astra-ui) .astra-paper-detail__insights > .astra-paper-insight {
142
+ display: grid;
143
+ grid-template-columns: 22px minmax(0, 1fr);
144
+ gap: 0 8.8px;
145
+ align-items: start;
137
146
  border: 0;
138
147
  border-radius: 0;
139
148
  background: transparent;
140
149
  padding: 12px 6px;
141
150
  }
142
151
 
143
- :where(.astra-ui) .astra-paper-detail__insights > .astra-paper-insight + .astra-paper-insight {
144
- border-top: 1px solid var(--astra-color-border);
152
+ /* Spans the row so one mark covers the whole insight, and sits on the
153
+ claim's first line rather than the padding box. */
154
+ :where(.astra-ui) .astra-paper-insight__glyph {
155
+ grid-row: 1 / -1;
156
+ margin-top: 3.52px;
145
157
  }
146
158
 
147
- /* The rail is narrow: keep the claim trigger's glyph gutter tight so the
148
- claims read as a list, not an indented block. */
149
- :where(.astra-ui) .astra-paper-insight .astra-insight-trigger:where([data-variant="claim"]) {
150
- grid-template-columns: auto minmax(0, 1fr);
151
- gap: 6.4px;
152
- padding: 0;
159
+ :where(.astra-ui) .astra-paper-insight__claim,
160
+ :where(.astra-ui) .astra-paper-insight__sources {
161
+ grid-column: 2;
153
162
  }
154
163
 
155
- @media (max-width: 760px) {
156
- :where(.astra-ui) .astra-paper-detail__layout {
157
- display: block;
158
- height: auto;
159
- overflow-y: auto;
160
- }
164
+ :where(.astra-ui) .astra-paper-detail__insights > .astra-paper-insight + .astra-paper-insight {
165
+ border-top: 1px solid var(--astra-color-border);
166
+ }
161
167
 
162
- :where(.astra-ui) .astra-paper-detail__artifact {
163
- height: 58dvh;
164
- border-right: 0;
165
- border-bottom: 1px solid var(--astra-color-border);
166
- }
168
+ /* The insights are the first thing in the rail now, so the gap that
169
+ separated them from the decisions above is a gap above nothing. */
170
+ :where(.astra-ui) .astra-paper-detail__rail .astra-insight-list {
171
+ margin-top: 0;
172
+ }
167
173
 
168
- :where(.astra-ui) .astra-paper-detail__rail {
169
- overflow: visible;
170
- }
174
+ :where(.astra-ui) .astra-paper-detail__rail-head {
175
+ display: grid;
176
+ gap: 8px;
177
+ /* The same rule that divides one insight from the next, so the head reads
178
+ as the first band of the list rather than a separate block. */
179
+ padding-bottom: 12px;
180
+ border-bottom: 1px solid var(--astra-color-border);
181
+ }
171
182
 
183
+ :where(.astra-ui) .astra-paper-decisions__picker {
184
+ display: grid;
185
+ min-width: 0;
186
+ gap: 4px;
172
187
  }
173
188
 
174
- :where(.astra-ui) .astra-paper-decisions__filters {
189
+ :where(.astra-ui) .astra-paper-decisions__picker-row {
175
190
  display: flex;
176
- flex-wrap: wrap;
177
- gap: 5.12px;
178
- margin-top: 8px;
191
+ min-width: 0;
192
+ align-items: center;
193
+ gap: 8px;
179
194
  }
180
195
 
181
- :where(.astra-ui) .astra-paper-decisions__filter {
182
- display: inline-flex;
183
- gap: 4.8px;
184
- align-items: center;
196
+ :where(.astra-ui) .astra-paper-decisions__open {
197
+ padding: 0;
198
+ border: 0;
199
+ background: none;
200
+ color: var(--astra-color-kind-decision);
185
201
  cursor: pointer;
186
- border: 1px solid var(--astra-color-border);
187
- border-radius: 999px;
188
- background: transparent;
189
- color: var(--astra-color-text-muted);
190
- padding: 2.88px 9.6px;
191
- font-family: var(--astra-font-ui);
192
- font-size: var(--astra-font-size-xs);
193
- line-height: 1.3;
194
- text-align: left;
202
+ font: 500 var(--astra-font-size-xs)/1.3 var(--astra-font-ui);
203
+ white-space: nowrap;
204
+ }
205
+
206
+ :where(.astra-ui) .astra-paper-decisions__open:hover,
207
+ :where(.astra-ui) .astra-paper-decisions__open:focus-visible {
208
+ text-decoration: underline;
209
+ }
210
+
211
+ :where(.astra-ui) .astra-paper-decisions__picker-label {
212
+ color: var(--astra-color-text-subtle);
213
+ font: 500 var(--astra-font-size-xs)/1.3 var(--astra-font-ui);
214
+ white-space: nowrap;
195
215
  }
196
216
 
197
- :where(.astra-ui) .astra-paper-decisions__filter:hover {
198
- border-color: var(--astra-color-text-subtle);
217
+ :where(.astra-ui) .astra-paper-decisions__picker-row select {
218
+ max-width: 100%;
219
+ min-width: 0;
220
+ flex: 0 1 auto;
221
+ padding: 2px 4px;
222
+ border: 1px solid var(--astra-color-border);
223
+ border-radius: var(--astra-radius-control);
224
+ background: var(--astra-color-surface-raised);
199
225
  color: var(--astra-color-text);
226
+ font: 400 var(--astra-font-size-xs)/1.3 var(--astra-font-ui);
200
227
  }
201
228
 
202
- :where(.astra-ui) .astra-paper-decisions__filter:where([aria-pressed="true"]) {
203
- border-color: var(--astra-color-link);
204
- background: color-mix(in srgb, var(--astra-color-link) 12%, transparent);
229
+ /* The claim is prose here, not a control: the insight's name opens it, so a
230
+ reader is not asked to click a paragraph. */
231
+ :where(.astra-ui) .astra-paper-insight__claim {
205
232
  color: var(--astra-color-text);
233
+ font: 400 var(--astra-font-size-sm)/1.45 var(--astra-font-body);
206
234
  }
207
235
 
208
- :where(.astra-ui) .astra-paper-decisions__empty {
209
- margin: 8px 0 0;
210
- color: var(--astra-color-text-subtle);
211
- font-family: var(--astra-font-ui);
212
- font-size: var(--astra-font-size-xs);
236
+ :where(.astra-ui) .astra-paper-insight__claim > :first-child {
237
+ margin-top: 0;
213
238
  }
214
239
 
215
- :where(.astra-ui) .astra-paper-decisions__open {
216
- cursor: pointer;
217
- border: 0;
218
- background: transparent;
219
- color: var(--astra-color-link);
220
- margin-top: 7.2px;
240
+ :where(.astra-ui) .astra-paper-insight__claim > :last-child {
241
+ margin-bottom: 0;
242
+ }
243
+
244
+ :where(.astra-ui) .astra-paper-insight__open {
245
+ display: inline-flex;
246
+ min-width: 0;
247
+ align-items: baseline;
248
+ gap: 4px;
221
249
  padding: 0;
222
- font-family: var(--astra-font-ui);
223
- font-size: var(--astra-font-size-xs);
250
+ border: 0;
251
+ background: none;
252
+ color: var(--astra-color-kind-insight);
253
+ cursor: pointer;
254
+ font: 500 var(--astra-font-size-2xs)/1.3 var(--astra-font-mono);
255
+ text-align: start;
256
+ overflow-wrap: anywhere;
224
257
  }
225
258
 
226
- :where(.astra-ui) .astra-paper-decisions__open:hover {
259
+ :where(.astra-ui) .astra-paper-insight__open:hover,
260
+ :where(.astra-ui) .astra-paper-insight__open:focus-visible {
227
261
  text-decoration: underline;
228
262
  }
229
263
 
264
+ @media (max-width: 760px) {
265
+ :where(.astra-ui) .astra-paper-detail__layout {
266
+ display: block;
267
+ height: auto;
268
+ overflow-y: auto;
269
+ }
270
+
271
+ :where(.astra-ui) .astra-paper-detail__artifact {
272
+ height: 58dvh;
273
+ border-right: 0;
274
+ border-bottom: 1px solid var(--astra-color-border);
275
+ }
276
+
277
+ :where(.astra-ui) .astra-paper-detail__rail {
278
+ overflow: visible;
279
+ }
280
+
281
+ }
282
+
230
283
  }
@@ -0,0 +1,72 @@
1
+ /* paper-row — emitted by src/components/paper-row.tsx */
2
+ @layer astra.tokens, astra.base, astra.components, astra.views;
3
+ @layer astra.components {
4
+ :where(.astra-ui) .astra-paper-row {
5
+ display: grid;
6
+ grid-template-columns: 58px minmax(0, 1fr) auto 46px;
7
+ align-items: stretch;
8
+ width: 100%;
9
+ min-height: 68px;
10
+ padding: 0;
11
+ border: 1px solid var(--astra-color-border);
12
+ background: var(--astra-color-surface-raised);
13
+ color: var(--astra-color-text);
14
+ cursor: pointer;
15
+ text-align: left;
16
+ }
17
+
18
+ :where(.astra-ui) .astra-paper-row:hover,
19
+ :where(.astra-ui) .astra-paper-row:focus-visible {
20
+ border-color: var(--astra-color-kind-output);
21
+ }
22
+
23
+ :where(.astra-ui) .astra-paper-row__thumbnail {
24
+ display: grid;
25
+ border-right: 1px solid var(--astra-color-border-subtle);
26
+ color: var(--astra-color-text-subtle);
27
+ background: repeating-linear-gradient(
28
+ 0deg,
29
+ color-mix(in srgb, var(--astra-color-canvas) 72%, var(--astra-color-surface-raised)) 0 6px,
30
+ var(--astra-color-canvas) 6px 12px
31
+ );
32
+ font: 400 var(--astra-font-size-2xs)/1 var(--astra-font-mono);
33
+ place-items: center;
34
+ }
35
+
36
+ :where(.astra-ui) .astra-paper-row__copy {
37
+ display: grid;
38
+ min-width: 0;
39
+ align-content: center;
40
+ gap: 3px;
41
+ padding: 11px 14px;
42
+ }
43
+
44
+ :where(.astra-ui) .astra-paper-row__copy strong {
45
+ overflow: hidden;
46
+ font: 600 var(--astra-font-size)/1.25 var(--astra-font-ui);
47
+ text-overflow: ellipsis;
48
+ white-space: nowrap;
49
+ }
50
+
51
+ :where(.astra-ui) .astra-paper-row__copy small,
52
+ :where(.astra-ui) .astra-paper-row__meta {
53
+ overflow: hidden;
54
+ color: var(--astra-color-text-subtle);
55
+ font: 400 11.5px/1.25 var(--astra-font-ui);
56
+ text-overflow: ellipsis;
57
+ white-space: nowrap;
58
+ }
59
+
60
+ :where(.astra-ui) .astra-paper-row__meta {
61
+ display: grid;
62
+ align-items: center;
63
+ padding-inline: 12px;
64
+ }
65
+
66
+ :where(.astra-ui) .astra-paper-row__arrow {
67
+ display: grid;
68
+ color: var(--astra-color-text-faint);
69
+ place-items: center;
70
+ }
71
+
72
+ }
@@ -97,12 +97,6 @@
97
97
  line-height: 1.2;
98
98
  }
99
99
 
100
- :where(.astra-ui) .astra-dialog:where([data-kind="paper"]) > .astra-dialog__panel {
101
- width: min(1472px, 100%);
102
- height: 100%;
103
- max-height: 100%;
104
- }
105
-
106
100
  :where(.astra-ui) .astra-dialog:where([data-kind="paper"]) {
107
101
  align-items: stretch;
108
102
  }
@@ -134,16 +128,6 @@
134
128
  padding: clamp(12px, 2vw, 24px);
135
129
  }
136
130
 
137
- :where(.astra-ui) .astra-dialog > .astra-dialog__panel {
138
- width: min(1184px, 100%);
139
- max-height: calc(100dvh - 32px);
140
- border-color: var(--astra-color-border-strong);
141
- border-radius: 0;
142
- background: var(--astra-color-canvas);
143
- box-shadow: none;
144
- font-family: var(--astra-font-body);
145
- }
146
-
147
131
  :where(.astra-ui) .astra-dialog__header {
148
132
  min-height: 88px;
149
133
  align-items: flex-end;
@@ -315,7 +299,7 @@
315
299
 
316
300
  :where(.astra-ui) .astra-dialog > .astra-dialog__panel {
317
301
  display: flex;
318
- width: min(720px, 100%);
302
+ width: min(800px, 100%);
319
303
  height: min(620px, calc(100dvh - 32px));
320
304
  max-height: calc(100dvh - 32px);
321
305
  flex-direction: column;
@@ -328,13 +312,11 @@
328
312
  font-family: var(--astra-font-body);
329
313
  }
330
314
 
315
+ /* The reader layout is the one with a sidebar — a paper beside its outline,
316
+ an artifact beside its details — and both want the same room for it. */
331
317
  :where(.astra-ui) .astra-dialog:where([data-layout="reader"]) > .astra-dialog__panel {
332
- width: min(1120px, 100%);
333
- height: min(700px, calc(100dvh - 32px));
334
- }
335
-
336
- :where(.astra-ui) .astra-dialog:where([data-layout="reader"][data-kind="output"]) > .astra-dialog__panel {
337
318
  width: min(1248px, 100%);
319
+ height: min(700px, calc(100dvh - 32px));
338
320
  }
339
321
 
340
322
  :where(.astra-ui) .astra-dialog:where([data-kind="input"]) > .astra-dialog__panel,
@@ -0,0 +1,22 @@
1
+ /* tooltip — emitted by src/primitives/tooltip.tsx */
2
+ @layer astra.tokens, astra.base, astra.components, astra.views;
3
+ @layer astra.components {
4
+ :where(.astra-ui) .astra-tooltip {
5
+ z-index: var(--astra-z-preview);
6
+ width: max-content;
7
+ max-width: min(280px, calc(100vw - 16px));
8
+ padding: 6px 9px;
9
+ border: 1px solid var(--astra-color-border);
10
+ border-radius: 5px;
11
+ background: var(--astra-color-surface-raised);
12
+ box-shadow: var(--astra-shadow-preview);
13
+ color: var(--astra-color-text);
14
+ font-family: var(--astra-font-body);
15
+ font-size: 12px;
16
+ font-weight: 400;
17
+ line-height: 1.4;
18
+ text-align: left;
19
+ overflow-wrap: anywhere;
20
+ }
21
+
22
+ }
@@ -67,11 +67,15 @@
67
67
 
68
68
  :where(.astra-ui) .astra-inventory__layout {
69
69
  display: grid;
70
- grid-template-columns: minmax(0, 1fr) 180px;
70
+ grid-template-columns: minmax(0, 1fr) 220px;
71
71
  gap: 48px;
72
72
  align-items: start;
73
73
  }
74
74
 
75
+ :where(.astra-ui) .astra-inventory__layout:where(:not([data-sidebar])) {
76
+ grid-template-columns: minmax(0, 1fr);
77
+ }
78
+
75
79
  :where(.astra-ui) .astra-inventory__sections {
76
80
  display: flex;
77
81
  min-width: 0;
@@ -124,6 +128,20 @@
124
128
  min-width: 0;
125
129
  }
126
130
 
131
+ :where(.astra-ui) .astra-inventory__sidebar {
132
+ position: sticky;
133
+ top: 72px;
134
+ display: grid;
135
+ gap: 28px;
136
+ min-width: 0;
137
+ max-height: calc(100vh - 88px);
138
+ overflow-y: auto;
139
+ }
140
+
141
+ :where(.astra-ui) .astra-inventory__sidebar .astra-inventory-outline {
142
+ position: static;
143
+ }
144
+
127
145
  :where(.astra-ui) .astra-inventory-outline h3 {
128
146
  margin: 0 0 8px;
129
147
  color: var(--astra-color-text-subtle);
@@ -165,7 +183,12 @@
165
183
  color: var(--astra-color-text);
166
184
  }
167
185
 
168
- @container (max-width: 992px) {
186
+ /* The sidebar scrolls, so a ring drawn outside a full-width link would be clipped. */
187
+ :where(.astra-ui) .astra-inventory__sidebar :is(a, button):focus-visible {
188
+ outline-offset: -2px;
189
+ }
190
+
191
+ @container (max-width: 760px) {
169
192
  :where(.astra-ui) .astra-inventory__layout {
170
193
  grid-template-columns: minmax(0, 1fr);
171
194
  }
@@ -174,6 +197,16 @@
174
197
  display: none;
175
198
  }
176
199
 
200
+ :where(.astra-ui) .astra-inventory__sidebar {
201
+ position: static;
202
+ grid-row: 1;
203
+ max-height: none;
204
+ }
205
+
206
+ :where(.astra-ui) .astra-inventory__sidebar:where(:not([data-has-tree])) {
207
+ display: none;
208
+ }
209
+
177
210
  }
178
211
  @container (max-width: 544px) {
179
212
  :where(.astra-ui) .astra-inventory__heading {
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,29 +0,0 @@
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
@@ -1 +0,0 @@
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,MAAM,CAAC,KAAK,CAAC,cAAc,GAAc,CAAC;IAC3I,CAAC;IACD,OAAO,CACL,KAAC,gBAAgB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,eAAe,EAAC,SAAS,EAAE,SAAS,YAC9E,KAAC,UAAU,IACT,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,EACrC,cAAc,EAAC,gCAAgC,EAC/C,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,4BAA4B,EAAE;gBACnE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,uDAAuD,EAAE;gBACzF,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,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;gBAC1G,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACjD,KAAK,EAAE;oBACL,KAAC,cAAc,IACb,IAAI,EAAC,eAAe,EACpB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,GAC9C;oBACF,yBAAO,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAQ;oBAC3D,8BAAkB,MAAM,uBAAS;iBAClC;aACF,CAAC,CAAC,GACH,GACe,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,52 +0,0 @@
1
- import type { ResolvedAnalysisNode, ResolvedInsight } from '@astra-spec/sdk';
2
- import { forwardRef, type HTMLAttributes } 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
-
8
- export interface PriorInsightsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
9
- analysis: ResolvedAnalysisNode;
10
- onOpenRecord: (insight: ResolvedInsight, analysis: ResolvedAnalysisNode) => void;
11
- }
12
-
13
- /** Prior insights with their claim and source count. */
14
- export const PriorInsightsList = forwardRef<HTMLDivElement, PriorInsightsListProps>(function PriorInsightsList({
15
- analysis,
16
- onOpenRecord,
17
- className,
18
- ...props
19
- }, ref) {
20
- const labels = useLabels();
21
- const records = analysis.prior_insights;
22
- if (!records.length) {
23
- return <EmptyState data-slot="prior-insights-list" {...props} ref={ref} className={className}>{labels.empty.prior_insights}</EmptyState>;
24
- }
25
- return (
26
- <InventoryRecords {...props} ref={ref} kind="prior_insight" className={className}>
27
- <RecordList
28
- label={labels.sections.prior_insights}
29
- columnTemplate="minmax(18rem, 1fr) 7rem 1.5rem"
30
- columns={[
31
- { label: 'Prior insight', className: 'astra-record-list__primary' },
32
- { label: 'Evidence', className: 'astra-record-list__count astra-record-list__secondary' },
33
- { className: 'astra-record-list__arrow' },
34
- ]}
35
- rows={records.map((record) => ({
36
- key: record.canonicalPath,
37
- accessibleLabel: `${recordTitle(record)}: ${record.claim} ${countLabel(record.evidence.length, 'source')}`,
38
- onOpen: () => { onOpenRecord(record, analysis); },
39
- cells: [
40
- <RecordIdentity
41
- kind="prior_insight"
42
- title={record.claim}
43
- subtitle={record.label ? record.id : undefined}
44
- />,
45
- <span>{countLabel(record.evidence.length, 'source')}</span>,
46
- <span aria-hidden="true">→</span>,
47
- ],
48
- }))}
49
- />
50
- </InventoryRecords>
51
- );
52
- });