@astra-spec/ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/TOKENS.md +14 -8
- package/blocks.css +1 -0
- package/components.css +6 -0
- package/dist/blocks/analysis-tree.d.ts.map +1 -1
- package/dist/blocks/analysis-tree.js +4 -7
- package/dist/blocks/analysis-tree.js.map +1 -1
- package/dist/blocks/decisions-list.d.ts.map +1 -1
- package/dist/blocks/decisions-list.js +1 -1
- package/dist/blocks/decisions-list.js.map +1 -1
- package/dist/blocks/findings-list.d.ts.map +1 -1
- package/dist/blocks/findings-list.js +3 -4
- package/dist/blocks/findings-list.js.map +1 -1
- package/dist/blocks/index.d.ts +2 -4
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +1 -2
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/outputs-list.d.ts +2 -7
- package/dist/blocks/outputs-list.d.ts.map +1 -1
- package/dist/blocks/outputs-list.js +11 -21
- package/dist/blocks/outputs-list.js.map +1 -1
- package/dist/blocks/papers-list.d.ts.map +1 -1
- package/dist/blocks/papers-list.js +3 -3
- package/dist/blocks/papers-list.js.map +1 -1
- package/dist/blocks/section.d.ts.map +1 -1
- package/dist/blocks/section.js +3 -2
- package/dist/blocks/section.js.map +1 -1
- package/dist/components/figure-zoom.d.ts +6 -0
- package/dist/components/figure-zoom.d.ts.map +1 -0
- package/dist/components/figure-zoom.js +28 -0
- package/dist/components/figure-zoom.js.map +1 -0
- package/dist/components/finding-detail.d.ts +4 -2
- package/dist/components/finding-detail.d.ts.map +1 -1
- package/dist/components/finding-detail.js +41 -25
- package/dist/components/finding-detail.js.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/insight-trigger.d.ts.map +1 -1
- package/dist/components/insight-trigger.js +3 -2
- package/dist/components/insight-trigger.js.map +1 -1
- package/dist/components/output-card.d.ts +13 -0
- package/dist/components/output-card.d.ts.map +1 -0
- package/dist/components/output-card.js +12 -0
- package/dist/components/output-card.js.map +1 -0
- package/dist/components/output-detail.d.ts +6 -2
- package/dist/components/output-detail.d.ts.map +1 -1
- package/dist/components/output-detail.js +49 -13
- package/dist/components/output-detail.js.map +1 -1
- package/dist/components/output-dialog.d.ts +6 -1
- package/dist/components/output-dialog.d.ts.map +1 -1
- package/dist/components/output-dialog.js +2 -2
- package/dist/components/output-dialog.js.map +1 -1
- package/dist/components/output-entry.d.ts +17 -0
- package/dist/components/output-entry.d.ts.map +1 -0
- package/dist/components/output-entry.js +21 -0
- package/dist/components/output-entry.js.map +1 -0
- package/dist/components/output-provenance.d.ts +6 -0
- package/dist/components/output-provenance.d.ts.map +1 -0
- package/dist/components/output-provenance.js +16 -0
- package/dist/components/output-provenance.js.map +1 -0
- package/dist/components/output-status.d.ts +8 -0
- package/dist/components/output-status.d.ts.map +1 -0
- package/dist/components/output-status.js +17 -0
- package/dist/components/output-status.js.map +1 -0
- package/dist/components/paper-detail.d.ts.map +1 -1
- package/dist/components/paper-detail.js +2 -2
- package/dist/components/paper-detail.js.map +1 -1
- package/dist/components/paper-row.d.ts +9 -0
- package/dist/components/paper-row.d.ts.map +1 -0
- package/dist/components/paper-row.js +11 -0
- package/dist/components/paper-row.js.map +1 -0
- package/dist/components/record-dialog.d.ts +5 -1
- package/dist/components/record-dialog.d.ts.map +1 -1
- package/dist/components/record-dialog.js +7 -4
- package/dist/components/record-dialog.js.map +1 -1
- package/dist/components/record-preview.d.ts.map +1 -1
- package/dist/components/record-preview.js +8 -7
- package/dist/components/record-preview.js.map +1 -1
- package/dist/lib/labels.d.ts +34 -2
- package/dist/lib/labels.d.ts.map +1 -1
- package/dist/lib/labels.js +35 -4
- package/dist/lib/labels.js.map +1 -1
- package/dist/model/index.d.ts +4 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/kind.d.ts +2 -2
- package/dist/model/kind.d.ts.map +1 -1
- package/dist/model/kind.js +3 -4
- package/dist/model/kind.js.map +1 -1
- package/dist/model/output-provenance.d.ts +17 -0
- package/dist/model/output-provenance.d.ts.map +1 -0
- package/dist/model/output-provenance.js +2 -0
- package/dist/model/output-provenance.js.map +1 -0
- package/dist/model/output-status.d.ts +17 -0
- package/dist/model/output-status.d.ts.map +1 -0
- package/dist/model/output-status.js +2 -0
- package/dist/model/output-status.js.map +1 -0
- package/dist/model/relations.d.ts +37 -12
- package/dist/model/relations.d.ts.map +1 -1
- package/dist/model/relations.js +76 -23
- package/dist/model/relations.js.map +1 -1
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +9 -1
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/index.d.ts +6 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +3 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/inline-reference.d.ts +9 -0
- package/dist/primitives/inline-reference.d.ts.map +1 -0
- package/dist/primitives/inline-reference.js +14 -0
- package/dist/primitives/inline-reference.js.map +1 -0
- package/dist/primitives/kind-glyph.d.ts +8 -0
- package/dist/primitives/kind-glyph.d.ts.map +1 -0
- package/dist/primitives/kind-glyph.js +9 -0
- package/dist/primitives/kind-glyph.js.map +1 -0
- package/dist/primitives/output-status-glyph.d.ts +8 -0
- package/dist/primitives/output-status-glyph.d.ts.map +1 -0
- package/dist/primitives/output-status-glyph.js +13 -0
- package/dist/primitives/output-status-glyph.js.map +1 -0
- package/dist/primitives/preview-popover.d.ts +1 -1
- package/dist/primitives/preview-popover.d.ts.map +1 -1
- package/dist/primitives/record-list.d.ts.map +1 -1
- package/dist/primitives/record-list.js +3 -2
- package/dist/primitives/record-list.js.map +1 -1
- package/dist/primitives/relation-list.d.ts.map +1 -1
- package/dist/primitives/relation-list.js +3 -2
- package/dist/primitives/relation-list.js.map +1 -1
- package/dist/primitives/tooltip.d.ts +7 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip.js +31 -0
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/views/inventory.d.ts +12 -1
- package/dist/views/inventory.d.ts.map +1 -1
- package/dist/views/inventory.js +23 -17
- package/dist/views/inventory.js.map +1 -1
- package/isolate.css +7 -0
- package/package.json +7 -4
- package/primitives.css +3 -0
- package/src/blocks/analysis-tree.tsx +4 -30
- package/src/blocks/decisions-list.tsx +5 -3
- package/src/blocks/findings-list.tsx +10 -8
- package/src/blocks/index.ts +2 -4
- package/src/blocks/outputs-list.tsx +43 -106
- package/src/blocks/papers-list.tsx +2 -18
- package/src/blocks/section.tsx +3 -2
- package/src/components/figure-zoom.tsx +72 -0
- package/src/components/finding-detail.tsx +106 -30
- package/src/components/index.ts +13 -0
- package/src/components/insight-trigger.tsx +3 -2
- package/src/components/output-card.tsx +51 -0
- package/src/components/output-detail.tsx +69 -21
- package/src/components/output-dialog.tsx +9 -0
- package/src/components/output-entry.tsx +61 -0
- package/src/components/output-provenance.tsx +86 -0
- package/src/components/output-status.tsx +38 -0
- package/src/components/paper-detail.tsx +2 -2
- package/src/components/paper-row.tsx +41 -0
- package/src/components/record-dialog.tsx +13 -1
- package/src/components/record-preview.tsx +8 -14
- package/src/lib/labels.tsx +69 -6
- package/src/model/index.ts +6 -2
- package/src/model/kind.ts +4 -5
- package/src/model/output-provenance.ts +18 -0
- package/src/model/output-status.ts +18 -0
- package/src/model/relations.ts +92 -26
- package/src/primitives/dialog.tsx +7 -1
- package/src/primitives/index.ts +6 -0
- package/src/primitives/inline-reference.tsx +25 -0
- package/src/primitives/kind-glyph.tsx +24 -0
- package/src/primitives/output-status-glyph.tsx +37 -0
- package/src/primitives/preview-popover.tsx +1 -1
- package/src/primitives/record-list.tsx +3 -4
- package/src/primitives/relation-list.tsx +4 -7
- package/src/primitives/tooltip.tsx +51 -0
- package/src/views/inventory.tsx +54 -22
- package/styles/base.css +2 -1
- package/styles/blocks/analysis-tree.css +23 -26
- package/styles/blocks/decisions-list.css +6 -6
- package/styles/blocks/findings-list.css +50 -0
- package/styles/blocks/outputs-list.css +13 -434
- package/styles/blocks/papers-list.css +8 -74
- package/styles/blocks/records.css +13 -13
- package/styles/components/artifact-preview.css +15 -15
- package/styles/components/decision-detail.css +23 -23
- package/styles/components/evidence.css +2 -7
- package/styles/components/figure-zoom.css +62 -0
- package/styles/components/finding-detail.css +73 -11
- package/styles/components/input-detail.css +7 -7
- package/styles/components/insight-detail.css +17 -17
- package/styles/components/insight-list.css +6 -6
- package/styles/components/insight-trigger.css +5 -5
- package/styles/components/output-card.css +290 -0
- package/styles/components/output-detail.css +139 -51
- package/styles/components/output-entry.css +141 -0
- package/styles/components/output-provenance.css +94 -0
- package/styles/components/output-status.css +31 -0
- package/styles/components/paper-detail.css +22 -22
- package/styles/components/paper-doi.css +2 -2
- package/styles/components/paper-pdf-viewer.css +6 -6
- package/styles/components/paper-row.css +72 -0
- package/styles/components/record-preview.css +444 -268
- package/styles/primitives/badge.css +1 -1
- package/styles/primitives/button.css +25 -25
- package/styles/primitives/count-heading.css +3 -3
- package/styles/primitives/detail-layout.css +20 -20
- package/styles/primitives/dialog.css +75 -93
- package/styles/primitives/empty-state.css +1 -1
- package/styles/primitives/inline-reference.css +37 -0
- package/styles/primitives/kind-glyph.css +31 -0
- package/styles/primitives/kind.css +6 -0
- package/styles/primitives/preview-popover.css +6 -11
- package/styles/primitives/prose.css +1 -1
- package/styles/primitives/record-list.css +32 -48
- package/styles/primitives/relation-list.css +14 -36
- package/styles/primitives/surface-header.css +15 -11
- package/styles/primitives/tooltip.css +22 -0
- package/styles/tokens.css +19 -9
- package/styles/views/inventory.css +58 -27
- package/dist/blocks/prior-insights-list.d.ts +0 -9
- package/dist/blocks/prior-insights-list.d.ts.map +0 -1
- package/dist/blocks/prior-insights-list.js +0 -29
- package/dist/blocks/prior-insights-list.js.map +0 -1
- package/src/blocks/prior-insights-list.tsx +0 -52
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
:where(.astra-ui) .astra-inventory__sections {
|
|
10
|
-
gap:
|
|
10
|
+
gap: 48px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
}
|
|
14
14
|
:where(.astra-ui) .astra-inventory__section h2 {
|
|
15
|
-
scroll-margin-top:
|
|
15
|
+
scroll-margin-top: 32px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
:where(.astra-ui) .astra-inventory__section:first-child > h2 {
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
:where(.astra-ui) .astra-inventory__sections {
|
|
32
|
-
gap:
|
|
32
|
+
gap: 44px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:where(.astra-ui) .astra-inventory {
|
|
36
36
|
container-type: inline-size;
|
|
37
37
|
min-height: 0;
|
|
38
|
-
padding-bottom:
|
|
38
|
+
padding-bottom: 64px;
|
|
39
39
|
background: var(--astra-color-canvas);
|
|
40
40
|
color: var(--astra-color-text);
|
|
41
41
|
font-family: var(--astra-font-body);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
:where(.astra-ui) .astra-inventory__sections {
|
|
45
|
-
gap:
|
|
45
|
+
gap: 44px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
:where(.astra-ui) .astra-inventory__section {
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
:where(.astra-ui) .astra-inventory__section > h2 {
|
|
53
|
-
margin-bottom:
|
|
54
|
-
margin: 0 0
|
|
55
|
-
padding: 0 0
|
|
53
|
+
margin-bottom: 10.4px;
|
|
54
|
+
margin: 0 0 16px;
|
|
55
|
+
padding: 0 0 8px;
|
|
56
56
|
border-block-end: 1px solid var(--astra-color-border-strong);
|
|
57
57
|
color: var(--astra-color-text);
|
|
58
58
|
font-family: var(--astra-font-heading);
|
|
59
|
-
font-size:
|
|
59
|
+
font-size: var(--astra-font-size-claim);
|
|
60
60
|
font-weight: 700;
|
|
61
61
|
line-height: 1.2;
|
|
62
62
|
}
|
|
@@ -67,16 +67,20 @@
|
|
|
67
67
|
|
|
68
68
|
:where(.astra-ui) .astra-inventory__layout {
|
|
69
69
|
display: grid;
|
|
70
|
-
grid-template-columns: minmax(0, 1fr)
|
|
71
|
-
gap:
|
|
70
|
+
grid-template-columns: minmax(0, 1fr) 220px;
|
|
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;
|
|
78
82
|
flex-direction: column;
|
|
79
|
-
gap:
|
|
83
|
+
gap: 44px;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
/* Sections are block-flow, and the per-kind blocks inside them keep their
|
|
@@ -91,9 +95,9 @@
|
|
|
91
95
|
display: flex;
|
|
92
96
|
align-items: baseline;
|
|
93
97
|
justify-content: space-between;
|
|
94
|
-
gap:
|
|
95
|
-
margin-bottom:
|
|
96
|
-
padding-bottom:
|
|
98
|
+
gap: 18px;
|
|
99
|
+
margin-bottom: 16px;
|
|
100
|
+
padding-bottom: 8px;
|
|
97
101
|
border-bottom: 1px solid var(--astra-color-border-strong);
|
|
98
102
|
}
|
|
99
103
|
|
|
@@ -105,27 +109,41 @@
|
|
|
105
109
|
color: var(--astra-color-text);
|
|
106
110
|
background: transparent;
|
|
107
111
|
font-family: var(--astra-font-heading);
|
|
108
|
-
font-size:
|
|
112
|
+
font-size: var(--astra-font-size-claim);
|
|
109
113
|
font-weight: 700;
|
|
110
114
|
line-height: 1.2;
|
|
111
|
-
scroll-margin-top:
|
|
115
|
+
scroll-margin-top: 72px;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
:where(.astra-ui) .astra-inventory__heading > span {
|
|
115
119
|
flex: 0 0 auto;
|
|
116
120
|
color: var(--astra-color-text-subtle);
|
|
117
121
|
font-family: var(--astra-font-ui);
|
|
118
|
-
font-size:
|
|
122
|
+
font-size: 12.5px;
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
:where(.astra-ui) .astra-inventory-outline {
|
|
122
126
|
position: sticky;
|
|
123
|
-
top:
|
|
127
|
+
top: 72px;
|
|
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
|
-
margin: 0 0
|
|
146
|
+
margin: 0 0 8px;
|
|
129
147
|
color: var(--astra-color-text-subtle);
|
|
130
148
|
font-family: var(--astra-font-ui);
|
|
131
149
|
font-size: var(--astra-font-size-2xs);
|
|
@@ -141,10 +159,10 @@
|
|
|
141
159
|
|
|
142
160
|
:where(.astra-ui) .astra-inventory-outline a {
|
|
143
161
|
display: grid;
|
|
144
|
-
grid-template-columns:
|
|
145
|
-
gap:
|
|
162
|
+
grid-template-columns: 12px minmax(0, 1fr) auto;
|
|
163
|
+
gap: 9px;
|
|
146
164
|
align-items: baseline;
|
|
147
|
-
padding:
|
|
165
|
+
padding: 7px 0;
|
|
148
166
|
border-bottom: 1px solid var(--astra-color-border-subtle);
|
|
149
167
|
color: var(--astra-color-text-subtle);
|
|
150
168
|
font-family: var(--astra-font-ui);
|
|
@@ -157,8 +175,6 @@
|
|
|
157
175
|
}
|
|
158
176
|
|
|
159
177
|
:where(.astra-ui) .astra-inventory-outline__glyph {
|
|
160
|
-
color: var(--astra-kind, var(--astra-color-text-subtle));
|
|
161
|
-
font-size: var(--astra-font-size-2xs);
|
|
162
178
|
text-align: center;
|
|
163
179
|
}
|
|
164
180
|
|
|
@@ -167,7 +183,12 @@
|
|
|
167
183
|
color: var(--astra-color-text);
|
|
168
184
|
}
|
|
169
185
|
|
|
170
|
-
|
|
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) {
|
|
171
192
|
:where(.astra-ui) .astra-inventory__layout {
|
|
172
193
|
grid-template-columns: minmax(0, 1fr);
|
|
173
194
|
}
|
|
@@ -176,8 +197,18 @@
|
|
|
176
197
|
display: none;
|
|
177
198
|
}
|
|
178
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
|
+
|
|
179
210
|
}
|
|
180
|
-
@container (max-width:
|
|
211
|
+
@container (max-width: 544px) {
|
|
181
212
|
:where(.astra-ui) .astra-inventory__heading {
|
|
182
213
|
align-items: flex-start;
|
|
183
214
|
}
|
|
@@ -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
|
-
});
|