@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
|
@@ -96,9 +96,11 @@ export const DecisionsList = forwardRef<HTMLDivElement, DecisionsListProps>(func
|
|
|
96
96
|
cells: [
|
|
97
97
|
<RecordIdentity kind="decision" title={recordTitle(record)} />,
|
|
98
98
|
<span className="astra-record-list__selected">{selectedOptionLabel(record)}</span>,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
record.tags?.[0] ? (
|
|
100
|
+
<span className="astra-record-list__tag">
|
|
101
|
+
{decisionTagLabel(record.tags[0], tagLabels)}
|
|
102
|
+
</span>
|
|
103
|
+
) : null,
|
|
102
104
|
<span aria-hidden="true">→</span>,
|
|
103
105
|
],
|
|
104
106
|
}))}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KindGlyph } from '../primitives/kind-glyph.js';
|
|
1
2
|
import type { ResolvedAnalysisNode, ResolvedInsight } from '@astra-spec/sdk';
|
|
2
3
|
import { forwardRef, type HTMLAttributes } from 'react';
|
|
3
4
|
import { recordTitle } from '../model/records.js';
|
|
@@ -30,10 +31,9 @@ export const FindingsList = forwardRef<HTMLDivElement, FindingsListProps>(functi
|
|
|
30
31
|
<InventoryRecords {...props} ref={ref} kind="finding" className={className}>
|
|
31
32
|
<RecordList
|
|
32
33
|
label={labels.sections.findings}
|
|
33
|
-
columnTemplate="minmax(
|
|
34
|
+
columnTemplate="minmax(0, 1fr) 1.5rem"
|
|
34
35
|
columns={[
|
|
35
36
|
{ label: 'Finding', className: 'astra-record-list__primary' },
|
|
36
|
-
{ label: 'Evidence', className: 'astra-record-list__count astra-record-list__secondary' },
|
|
37
37
|
{ className: 'astra-record-list__arrow' },
|
|
38
38
|
]}
|
|
39
39
|
rows={records.map((record) => {
|
|
@@ -43,14 +43,16 @@ export const FindingsList = forwardRef<HTMLDivElement, FindingsListProps>(functi
|
|
|
43
43
|
accessibleLabel: `${recordTitle(record)}: ${record.claim} ${evidenceLabel(count)}`,
|
|
44
44
|
onOpen: () => { onOpenRecord(record, analysis); },
|
|
45
45
|
cells: [
|
|
46
|
-
<span className="astra-record-list__name
|
|
47
|
-
<
|
|
48
|
-
<span>
|
|
49
|
-
|
|
50
|
-
<
|
|
46
|
+
<span className="astra-record-list__name astra-findings-list__entry">
|
|
47
|
+
<KindGlyph className="astra-record-list__glyph" kind="finding" />
|
|
48
|
+
<span className="astra-findings-list__copy">
|
|
49
|
+
<span className="astra-findings-list__claim">{record.claim}</span>
|
|
50
|
+
<span className="astra-findings-list__meta">
|
|
51
|
+
<span className="astra-findings-list__name">{recordTitle(record)}</span>
|
|
52
|
+
<span className="astra-record-list__count">{evidenceLabel(count)}</span>
|
|
53
|
+
</span>
|
|
51
54
|
</span>
|
|
52
55
|
</span>,
|
|
53
|
-
<span>{evidenceLabel(count)}</span>,
|
|
54
56
|
<span aria-hidden="true">→</span>,
|
|
55
57
|
],
|
|
56
58
|
};
|
package/src/blocks/index.ts
CHANGED
|
@@ -8,15 +8,13 @@ export type {
|
|
|
8
8
|
InventoryRecordsProps,
|
|
9
9
|
InventorySectionProps,
|
|
10
10
|
} from './section.js';
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
11
|
+
export { OutputsList } from './outputs-list.js';
|
|
12
|
+
export type { OutputsListProps } from './outputs-list.js';
|
|
13
13
|
export { ALL_TAGS, DecisionsList } from './decisions-list.js';
|
|
14
14
|
export type { DecisionsListProps } from './decisions-list.js';
|
|
15
15
|
export { InputsList } from './inputs-list.js';
|
|
16
16
|
export type { InputsListProps } from './inputs-list.js';
|
|
17
17
|
export { FindingsList } from './findings-list.js';
|
|
18
18
|
export type { FindingsListProps } from './findings-list.js';
|
|
19
|
-
export { PriorInsightsList } from './prior-insights-list.js';
|
|
20
|
-
export type { PriorInsightsListProps } from './prior-insights-list.js';
|
|
21
19
|
export { PaperRows, PapersList } from './papers-list.js';
|
|
22
20
|
export type { PaperRowsProps, PapersListProps } from './papers-list.js';
|
|
@@ -1,98 +1,38 @@
|
|
|
1
1
|
import type { ResolvedAnalysisNode, ResolvedOutput } from '@astra-spec/sdk';
|
|
2
2
|
import { forwardRef, useId, type HTMLAttributes } from 'react';
|
|
3
|
-
import { recordTitle } from '../model/records.js';
|
|
4
3
|
import { cn } from '../lib/cn.js';
|
|
5
4
|
import { useLabels } from '../lib/labels.js';
|
|
5
|
+
import type { OutputStatusLookup } from '../model/output-status.js';
|
|
6
6
|
import type { ArtifactRenderer } from '../components/artifact-preview.js';
|
|
7
7
|
import { EmptyState } from '../primitives/record-list.js';
|
|
8
|
-
import {
|
|
8
|
+
import { OutputCard } from '../components/output-card.js';
|
|
9
|
+
import { OutputEntry } from '../components/output-entry.js';
|
|
9
10
|
|
|
10
11
|
export interface OutputsListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
11
12
|
analysis: ResolvedAnalysisNode;
|
|
12
13
|
renderArtifact?: ArtifactRenderer | undefined;
|
|
14
|
+
getOutputStatus?: OutputStatusLookup | undefined;
|
|
13
15
|
onOpenRecord: (output: ResolvedOutput, analysis: ResolvedAnalysisNode) => void;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** A gallery card: compact preview and title, with a type label for non-figures. */
|
|
23
|
-
export const OutputCard = forwardRef<HTMLButtonElement, OutputCardProps>(function OutputCard({
|
|
24
|
-
output,
|
|
25
|
-
renderArtifact,
|
|
26
|
-
onOpen,
|
|
27
|
-
className,
|
|
28
|
-
onClick,
|
|
29
|
-
'aria-label': hostLabel,
|
|
30
|
-
...props
|
|
31
|
-
}, ref) {
|
|
32
|
-
return (
|
|
33
|
-
<button
|
|
34
|
-
data-slot="output-card"
|
|
35
|
-
{...props}
|
|
36
|
-
ref={ref}
|
|
37
|
-
type="button"
|
|
38
|
-
aria-label={hostLabel ?? `Open ${output.type}: ${recordTitle(output)}`}
|
|
39
|
-
className={cn('astra-output-card', className)}
|
|
40
|
-
onClick={(event) => { onClick?.(event); onOpen(); }}
|
|
41
|
-
>
|
|
42
|
-
<span className="astra-output-card__preview">
|
|
43
|
-
<OutputPreview output={output} compact renderArtifact={renderArtifact} />
|
|
44
|
-
<span className="astra-output-card__open" aria-hidden="true">Open ↗</span>
|
|
45
|
-
</span>
|
|
46
|
-
<span className="astra-output-card__body">
|
|
47
|
-
{output.type !== 'figure' ? <span className="astra-output-card__kind">{output.type}</span> : null}
|
|
48
|
-
<strong>{recordTitle(output)}</strong>
|
|
49
|
-
{output.label ? <code>{output.id}</code> : null}
|
|
50
|
-
</span>
|
|
51
|
-
</button>
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
function OutputGallery({
|
|
56
|
-
title,
|
|
57
|
-
outputs,
|
|
58
|
-
renderArtifact,
|
|
59
|
-
onOpen,
|
|
60
|
-
}: {
|
|
61
|
-
title: string;
|
|
62
|
-
outputs: ResolvedOutput[];
|
|
63
|
-
renderArtifact?: ArtifactRenderer | undefined;
|
|
64
|
-
onOpen: (output: ResolvedOutput) => void;
|
|
65
|
-
}) {
|
|
66
|
-
const id = useId();
|
|
67
|
-
if (!outputs.length) return null;
|
|
68
|
-
return (
|
|
69
|
-
<section className="astra-inventory-outputs__group" aria-labelledby={id}>
|
|
70
|
-
<h3 id={id} className="astra-inventory-outputs__group-heading">
|
|
71
|
-
<span>{title}</span>
|
|
72
|
-
</h3>
|
|
73
|
-
<div className="astra-inventory-outputs__gallery">
|
|
74
|
-
{outputs.map((output) => (
|
|
75
|
-
<OutputCard
|
|
76
|
-
key={output.canonicalPath}
|
|
77
|
-
output={output}
|
|
78
|
-
renderArtifact={renderArtifact}
|
|
79
|
-
onOpen={() => { onOpen(output); }}
|
|
80
|
-
/>
|
|
81
|
-
))}
|
|
82
|
-
</div>
|
|
83
|
-
</section>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function CompactOutputs({
|
|
18
|
+
/**
|
|
19
|
+
* One titled run of outputs. A gallery frames each output as a card with its
|
|
20
|
+
* preview; the compact form lists them as entries, which is what a metric or a
|
|
21
|
+
* plain file is worth. Everything else about a group is the same either way.
|
|
22
|
+
*/
|
|
23
|
+
function OutputGroup({
|
|
88
24
|
title,
|
|
89
25
|
outputs,
|
|
26
|
+
variant,
|
|
90
27
|
renderArtifact,
|
|
28
|
+
getOutputStatus,
|
|
91
29
|
onOpen,
|
|
92
30
|
}: {
|
|
93
31
|
title: string;
|
|
94
32
|
outputs: ResolvedOutput[];
|
|
33
|
+
variant: 'gallery' | 'compact';
|
|
95
34
|
renderArtifact?: ArtifactRenderer | undefined;
|
|
35
|
+
getOutputStatus?: OutputStatusLookup | undefined;
|
|
96
36
|
onOpen: (output: ResolvedOutput) => void;
|
|
97
37
|
}) {
|
|
98
38
|
const id = useId();
|
|
@@ -102,36 +42,32 @@ function CompactOutputs({
|
|
|
102
42
|
<h3 id={id} className="astra-inventory-outputs__group-heading">
|
|
103
43
|
<span>{title}</span>
|
|
104
44
|
</h3>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
45
|
+
{variant === 'gallery' ? (
|
|
46
|
+
<div className="astra-inventory-outputs__gallery">
|
|
47
|
+
{outputs.map((output) => (
|
|
48
|
+
<OutputCard
|
|
49
|
+
key={output.canonicalPath}
|
|
50
|
+
output={output}
|
|
51
|
+
status={getOutputStatus?.(output)}
|
|
52
|
+
renderArtifact={renderArtifact}
|
|
53
|
+
onOpen={() => { onOpen(output); }}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
) : (
|
|
58
|
+
<ul className="astra-inventory-outputs__compact-grid" data-layout={outputs[0]?.type === 'metric' ? 'tiles' : 'grid'}>
|
|
59
|
+
{outputs.map((output) => (
|
|
110
60
|
<li key={output.canonicalPath}>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
>
|
|
118
|
-
<span className="astra-output-entry__name">
|
|
119
|
-
{recordTitle(output)}
|
|
120
|
-
{!metric && status ? <span className="astra-output-entry__status">{status}</span> : null}
|
|
121
|
-
</span>
|
|
122
|
-
{metric ? (
|
|
123
|
-
<span className="astra-output-entry__value">
|
|
124
|
-
{renderArtifact?.(output, { compact: true })
|
|
125
|
-
?? <span className="astra-output-entry__status">{status ?? 'Preview unavailable'}</span>}
|
|
126
|
-
</span>
|
|
127
|
-
) : (
|
|
128
|
-
<span className="astra-output-entry__format">{output.format ? output.format.replace(/^\./, '').toUpperCase() : 'FILE'}</span>
|
|
129
|
-
)}
|
|
130
|
-
</button>
|
|
61
|
+
<OutputEntry
|
|
62
|
+
output={output}
|
|
63
|
+
status={getOutputStatus?.(output)}
|
|
64
|
+
renderArtifact={renderArtifact}
|
|
65
|
+
onOpen={() => { onOpen(output); }}
|
|
66
|
+
/>
|
|
131
67
|
</li>
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
|
|
68
|
+
))}
|
|
69
|
+
</ul>
|
|
70
|
+
)}
|
|
135
71
|
</section>
|
|
136
72
|
);
|
|
137
73
|
}
|
|
@@ -142,6 +78,7 @@ const GROUPED_TYPES = new Set<ResolvedOutput['type']>(['figure', 'table', 'metri
|
|
|
142
78
|
export const OutputsList = forwardRef<HTMLDivElement, OutputsListProps>(function OutputsList({
|
|
143
79
|
analysis,
|
|
144
80
|
renderArtifact,
|
|
81
|
+
getOutputStatus,
|
|
145
82
|
onOpenRecord,
|
|
146
83
|
className,
|
|
147
84
|
...props
|
|
@@ -157,10 +94,10 @@ export const OutputsList = forwardRef<HTMLDivElement, OutputsListProps>(function
|
|
|
157
94
|
const open = (output: ResolvedOutput) => { onOpenRecord(output, analysis); };
|
|
158
95
|
return (
|
|
159
96
|
<div data-slot="outputs-list" {...props} ref={ref} className={cn('astra-inventory-outputs', className)}>
|
|
160
|
-
<
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
<
|
|
97
|
+
<OutputGroup variant="gallery" title="Figures" outputs={figures} renderArtifact={renderArtifact} getOutputStatus={getOutputStatus} onOpen={open} />
|
|
98
|
+
<OutputGroup variant="gallery" title="Tables" outputs={tables} renderArtifact={renderArtifact} getOutputStatus={getOutputStatus} onOpen={open} />
|
|
99
|
+
<OutputGroup variant="compact" title="Metrics" outputs={metrics} renderArtifact={renderArtifact} getOutputStatus={getOutputStatus} onOpen={open} />
|
|
100
|
+
<OutputGroup variant="compact" title="Output files" outputs={files} getOutputStatus={getOutputStatus} onOpen={open} />
|
|
164
101
|
</div>
|
|
165
102
|
);
|
|
166
103
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ResolvedAnalysisNode } from '@astra-spec/sdk';
|
|
2
2
|
import { forwardRef, type HTMLAttributes } from 'react';
|
|
3
3
|
import type { InventoryPaper } from '../model/papers.js';
|
|
4
|
-
import { countLabel } from '../model/records.js';
|
|
5
4
|
import { cn } from '../lib/cn.js';
|
|
6
5
|
import { useLabels } from '../lib/labels.js';
|
|
6
|
+
import { PaperRow } from '../components/paper-row.js';
|
|
7
7
|
import { EmptyState } from '../primitives/record-list.js';
|
|
8
8
|
import { InventoryRecords } from './section.js';
|
|
9
9
|
|
|
@@ -24,23 +24,7 @@ export const PaperRows = forwardRef<HTMLDivElement, PaperRowsProps>(function Pap
|
|
|
24
24
|
return (
|
|
25
25
|
<div data-slot="paper-list" {...props} ref={ref} className={cn('astra-paper-list', className)} role="group" aria-label={labels.sections.papers}>
|
|
26
26
|
{papers.map((paper) => (
|
|
27
|
-
<
|
|
28
|
-
key={paper.doi}
|
|
29
|
-
type="button"
|
|
30
|
-
aria-label={`${paper.title}, ${paper.doi}, ${countLabel(paper.insights.length, 'insight')}, ${countLabel(paper.decisions.length, 'decision')}`}
|
|
31
|
-
onClick={() => { onOpen(paper); }}
|
|
32
|
-
>
|
|
33
|
-
<span className="astra-paper-list__thumbnail" aria-hidden="true">p.1</span>
|
|
34
|
-
<span className="astra-paper-list__copy">
|
|
35
|
-
<strong>{paper.title}</strong>
|
|
36
|
-
<small>{[paper.authors, paper.doi].filter(Boolean).join(' · ')}</small>
|
|
37
|
-
</span>
|
|
38
|
-
<span className="astra-paper-list__meta">
|
|
39
|
-
{countLabel(paper.insights.length, 'insight')} ·{' '}
|
|
40
|
-
{countLabel(paper.decisions.length, 'decision')}
|
|
41
|
-
</span>
|
|
42
|
-
<span className="astra-paper-list__arrow" aria-hidden="true">→</span>
|
|
43
|
-
</button>
|
|
27
|
+
<PaperRow key={paper.doi} paper={paper} onOpen={() => { onOpen(paper); }} />
|
|
44
28
|
))}
|
|
45
29
|
</div>
|
|
46
30
|
);
|
package/src/blocks/section.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { KindGlyph } from '../primitives/kind-glyph.js';
|
|
1
2
|
import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
3
|
import { cn } from '../lib/cn.js';
|
|
3
|
-
import {
|
|
4
|
+
import { type InventorySectionId, type SurfaceKind } from '../model/kind.js';
|
|
4
5
|
import { useLabels } from '../lib/labels.js';
|
|
5
6
|
|
|
6
7
|
export interface InventorySectionProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
@@ -79,7 +80,7 @@ export const InventoryOutline = forwardRef<HTMLElement, InventoryOutlineProps>(f
|
|
|
79
80
|
{entries.map((entry) => (
|
|
80
81
|
<a key={entry.id} href={`#${entry.id}`}>
|
|
81
82
|
<span className="astra-inventory-outline__glyph" {...(entry.kind ? { 'data-kind': entry.kind } : {})} aria-hidden="true">
|
|
82
|
-
{entry.kind ?
|
|
83
|
+
{entry.kind ? <KindGlyph kind={entry.kind} /> : null}
|
|
83
84
|
</span>
|
|
84
85
|
<span>{entry.label}</span>
|
|
85
86
|
{entry.count !== undefined ? <span>{entry.count}</span> : null}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { TransformComponent, TransformWrapper, useControls, useTransformComponent } from 'react-zoom-pan-pinch';
|
|
3
|
+
import { useLabels } from '../lib/labels.js';
|
|
4
|
+
import { Button } from '../primitives/button.js';
|
|
5
|
+
|
|
6
|
+
const MIN_SCALE = 1;
|
|
7
|
+
const MAX_SCALE = 4;
|
|
8
|
+
const ZOOM_STEP = 0.25;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A step that reaches a bound disables its own button. A natively disabled
|
|
12
|
+
* button cannot hold focus, so the keyboard user who pressed it would be
|
|
13
|
+
* dropped to the document; `aria-disabled` keeps the button focusable and
|
|
14
|
+
* announced as unavailable while the handler ignores the press.
|
|
15
|
+
*/
|
|
16
|
+
function ZoomButton({ label, unavailable, onPress, children }: {
|
|
17
|
+
label: string;
|
|
18
|
+
unavailable: boolean;
|
|
19
|
+
onPress: () => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<Button
|
|
24
|
+
aria-label={label}
|
|
25
|
+
title={label}
|
|
26
|
+
aria-disabled={unavailable || undefined}
|
|
27
|
+
onClick={unavailable ? undefined : onPress}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Button>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function FigureControls() {
|
|
35
|
+
const { figure: labels } = useLabels();
|
|
36
|
+
const { zoomIn, zoomOut } = useControls();
|
|
37
|
+
const scale = useTransformComponent(({ state }) => state.scale);
|
|
38
|
+
return (
|
|
39
|
+
<div className="astra-figure-zoom__controls">
|
|
40
|
+
<ZoomButton label={labels.zoomIn} unavailable={scale >= MAX_SCALE} onPress={() => { void zoomIn(ZOOM_STEP, 0); }}>+</ZoomButton>
|
|
41
|
+
<ZoomButton label={labels.zoomOut} unavailable={scale <= MIN_SCALE} onPress={() => { void zoomOut(ZOOM_STEP, 0); }}>−</ZoomButton>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The gesture library magnifies the host's fitted figure; the host still owns its artifact. */
|
|
47
|
+
export function FigureZoom({ children }: { children: ReactNode }) {
|
|
48
|
+
const { figure: labels } = useLabels();
|
|
49
|
+
return (
|
|
50
|
+
<TransformWrapper
|
|
51
|
+
minScale={MIN_SCALE}
|
|
52
|
+
maxScale={MAX_SCALE}
|
|
53
|
+
disablePadding
|
|
54
|
+
keyboard={{ disabled: false, zoomStep: ZOOM_STEP, animationTime: 0 }}
|
|
55
|
+
panning={{ velocityDisabled: true, excluded: ['button', 'a', 'input', 'select', 'textarea'] }}
|
|
56
|
+
doubleClick={{ mode: 'toggle', step: 1, animationTime: 0 }}
|
|
57
|
+
>
|
|
58
|
+
<div className="astra-figure-zoom" role="group" aria-label={labels.controls}>
|
|
59
|
+
<TransformComponent
|
|
60
|
+
wrapperClass="astra-figure-zoom__viewport"
|
|
61
|
+
contentClass="astra-figure-zoom__canvas"
|
|
62
|
+
wrapperStyle={{ width: '100%', height: '100%' }}
|
|
63
|
+
contentStyle={{ width: '100%', height: '100%' }}
|
|
64
|
+
wrapperProps={{ role: 'region', 'aria-label': labels.viewport }}
|
|
65
|
+
>
|
|
66
|
+
<div className="astra-output-detail__preview">{children}</div>
|
|
67
|
+
</TransformComponent>
|
|
68
|
+
<FigureControls />
|
|
69
|
+
</div>
|
|
70
|
+
</TransformWrapper>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import type { ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
-
import { Fragment, forwardRef, type HTMLAttributes } from 'react';
|
|
3
|
-
import { recordTitle } from '../model/records.js';
|
|
1
|
+
import type { ResolvedAnalysisNode, ResolvedInsight, ResolvedOutput } from '@astra-spec/sdk';
|
|
2
|
+
import { Fragment, forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';
|
|
4
3
|
import { doiHref } from '../model/doi.js';
|
|
5
|
-
import {
|
|
4
|
+
import { recordTitle } from '../model/records.js';
|
|
5
|
+
import {
|
|
6
|
+
findingLiterature,
|
|
7
|
+
groupFindingEvidence,
|
|
8
|
+
type FindingEvidenceGroup,
|
|
9
|
+
type FindingEvidenceLink,
|
|
10
|
+
} from '../model/relations.js';
|
|
6
11
|
import { cn } from '../lib/cn.js';
|
|
7
12
|
import { useLabels } from '../lib/labels.js';
|
|
8
|
-
import { DetailLayout, DetailMain } from '../primitives/detail-layout.js';
|
|
13
|
+
import { CountHeading, DetailLayout, DetailMain, DetailSection } from '../primitives/detail-layout.js';
|
|
9
14
|
import { DetailDialog, type DetailDialogProps } from '../primitives/dialog.js';
|
|
10
15
|
import { Prose } from '../primitives/prose.js';
|
|
11
16
|
import type { TextRenderer } from '../lib/prose.js';
|
|
12
|
-
import {
|
|
17
|
+
import type { ArtifactRenderer } from './artifact-preview.js';
|
|
18
|
+
import { OutputCard } from './output-card.js';
|
|
19
|
+
import { OutputEntry } from './output-entry.js';
|
|
13
20
|
import type { OpenRecordHandler } from '../lib/detail-stack.js';
|
|
14
21
|
|
|
15
22
|
export interface FindingDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
@@ -17,48 +24,117 @@ export interface FindingDetailProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
17
24
|
/** Artifact-backed evidence resolved to outputs; see `findingEvidence()`. */
|
|
18
25
|
evidence: FindingEvidenceLink[];
|
|
19
26
|
renderText?: TextRenderer | undefined;
|
|
27
|
+
renderArtifact?: ArtifactRenderer | undefined;
|
|
20
28
|
onOpenRecord?: OpenRecordHandler | undefined;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
|
-
/**
|
|
31
|
+
/** A resolved group, narrowed to the ones a result renderer can draw. */
|
|
32
|
+
type ResolvedGroup = FindingEvidenceGroup & { output: ResolvedOutput; analysis: ResolvedAnalysisNode };
|
|
33
|
+
|
|
34
|
+
const isResolved = (group: FindingEvidenceGroup): group is ResolvedGroup =>
|
|
35
|
+
Boolean(group.output && group.analysis);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* One run of results of a kind. The label only earns its space when a finding
|
|
39
|
+
* rests on more than one kind: with a single run, what they are is evident.
|
|
40
|
+
*/
|
|
41
|
+
function ResultRun({ label, labelled, children }: { label: string; labelled: boolean; children: ReactNode }) {
|
|
42
|
+
const id = useId();
|
|
43
|
+
if (!labelled) return <>{children}</>;
|
|
44
|
+
return (
|
|
45
|
+
<section aria-labelledby={id}>
|
|
46
|
+
<h5 id={id} className="astra-finding-detail__group-heading">{label}</h5>
|
|
47
|
+
{children}
|
|
48
|
+
</section>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The claim, the results it rests on, and the literature it cites. */
|
|
24
53
|
export const FindingDetail = forwardRef<HTMLDivElement, FindingDetailProps>(function FindingDetail({
|
|
25
54
|
record,
|
|
26
55
|
evidence,
|
|
27
56
|
renderText,
|
|
57
|
+
renderArtifact,
|
|
28
58
|
onOpenRecord,
|
|
29
59
|
className,
|
|
30
60
|
...props
|
|
31
61
|
}, ref) {
|
|
32
62
|
const literature = findingLiterature(record);
|
|
63
|
+
const results = groupFindingEvidence(evidence);
|
|
64
|
+
// Grouped the way the inventory groups an analysis's outputs, so a result
|
|
65
|
+
// looks the same wherever it is met. Unresolved artifacts have no record to
|
|
66
|
+
// draw, so they keep their name and nothing more.
|
|
67
|
+
const resolved = results.filter(isResolved);
|
|
68
|
+
const ofType = (type: ResolvedOutput['type']) => resolved.filter(({ output }) => output.type === type);
|
|
69
|
+
const figures = ofType('figure');
|
|
70
|
+
const tables = ofType('table');
|
|
71
|
+
const metrics = ofType('metric');
|
|
72
|
+
const files = resolved.filter(({ output }) => !['figure', 'table', 'metric'].includes(output.type));
|
|
73
|
+
const unresolved = results.filter((group) => !isResolved(group));
|
|
74
|
+
// Labels only appear once a finding rests on more than one kind of result.
|
|
75
|
+
const runs = [figures.length, tables.length, metrics.length, files.length + unresolved.length];
|
|
76
|
+
const labelled = runs.filter(Boolean).length > 1;
|
|
77
|
+
const open = (group: ResolvedGroup) => () => { onOpenRecord?.(group.output, group.analysis); };
|
|
78
|
+
// Say what the result is to this finding; the card's own name would only
|
|
79
|
+
// say what kind of artifact it is.
|
|
80
|
+
const resultLabel = (group: ResolvedGroup) => `View supporting result: ${recordTitle(group.output)}`;
|
|
33
81
|
return (
|
|
34
82
|
<DetailLayout data-slot="finding-detail" {...props} ref={ref} layout="single" className={cn('astra-finding-detail', className)}>
|
|
35
83
|
<DetailMain>
|
|
84
|
+
<DetailSection label="Claim" heading="section">
|
|
85
|
+
<Prose text={record.claim} field="claim" renderText={renderText} />
|
|
86
|
+
</DetailSection>
|
|
36
87
|
{record.notes ? (
|
|
37
88
|
<section className="astra-finding-detail__notes">
|
|
38
89
|
<h4>Notes</h4>
|
|
39
90
|
<div><Prose text={record.notes} field="notes" renderText={renderText} /></div>
|
|
40
91
|
</section>
|
|
41
92
|
) : null}
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
93
|
+
<section className="astra-finding-detail__results">
|
|
94
|
+
<CountHeading title="Supporting results" count={results.length} />
|
|
95
|
+
{results.length ? (
|
|
96
|
+
<>
|
|
97
|
+
{([['Figures', figures], ['Tables', tables]] as const).map(([label, groups]) => (
|
|
98
|
+
groups.length ? (
|
|
99
|
+
<ResultRun key={label} label={label} labelled={labelled}>
|
|
100
|
+
<div className="astra-finding-detail__gallery">
|
|
101
|
+
{groups.map((group) => (
|
|
102
|
+
<OutputCard key={group.key} output={group.output} renderArtifact={renderArtifact} aria-label={resultLabel(group)} onOpen={open(group)} />
|
|
103
|
+
))}
|
|
104
|
+
</div>
|
|
105
|
+
</ResultRun>
|
|
106
|
+
) : null
|
|
107
|
+
))}
|
|
108
|
+
{metrics.length ? (
|
|
109
|
+
<ResultRun label="Metrics" labelled={labelled}>
|
|
110
|
+
<ul className="astra-finding-detail__tiles">
|
|
111
|
+
{metrics.map((group) => (
|
|
112
|
+
<li key={group.key}>
|
|
113
|
+
<OutputEntry output={group.output} renderArtifact={renderArtifact} aria-label={resultLabel(group)} onOpen={open(group)} />
|
|
114
|
+
</li>
|
|
115
|
+
))}
|
|
116
|
+
</ul>
|
|
117
|
+
</ResultRun>
|
|
118
|
+
) : null}
|
|
119
|
+
{files.length || unresolved.length ? (
|
|
120
|
+
<ResultRun label="Output files" labelled={labelled}>
|
|
121
|
+
<ul className="astra-finding-detail__files">
|
|
122
|
+
{files.map((group) => (
|
|
123
|
+
<li key={group.key}>
|
|
124
|
+
<OutputEntry output={group.output} aria-label={resultLabel(group)} onOpen={open(group)} />
|
|
125
|
+
</li>
|
|
126
|
+
))}
|
|
127
|
+
{unresolved.map((group) => (
|
|
128
|
+
<li key={group.key} className="astra-finding-detail__unresolved">
|
|
129
|
+
{group.artifact ?? group.key}
|
|
130
|
+
</li>
|
|
131
|
+
))}
|
|
132
|
+
</ul>
|
|
133
|
+
</ResultRun>
|
|
134
|
+
) : null}
|
|
135
|
+
</>
|
|
136
|
+
) : <p>No supporting results are linked to this finding.</p>}
|
|
137
|
+
</section>
|
|
62
138
|
{literature.map((source, index) => {
|
|
63
139
|
const doi = source.doi ?? '';
|
|
64
140
|
const location = source.location?.page ? ` · page ${source.location.page}` : '';
|
|
@@ -84,17 +160,17 @@ export const FindingDetail = forwardRef<HTMLDivElement, FindingDetailProps>(func
|
|
|
84
160
|
|
|
85
161
|
export interface FindingDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<FindingDetailProps, 'className'> {}
|
|
86
162
|
|
|
87
|
-
export function FindingDialog({ record, evidence, renderText, onOpenRecord, ...dialog }: FindingDialogProps) {
|
|
163
|
+
export function FindingDialog({ record, evidence, renderText, renderArtifact, onOpenRecord, ...dialog }: FindingDialogProps) {
|
|
88
164
|
const labels = useLabels();
|
|
89
165
|
return (
|
|
90
166
|
<DetailDialog
|
|
91
167
|
{...dialog}
|
|
92
168
|
kind="finding"
|
|
93
169
|
kindLabel={labels.kinds.finding}
|
|
94
|
-
title={record
|
|
170
|
+
title={recordTitle(record)}
|
|
95
171
|
closeLabel={labels.closeRecord(labels.kinds.finding)}
|
|
96
172
|
>
|
|
97
|
-
<FindingDetail record={record} evidence={evidence} renderText={renderText} onOpenRecord={onOpenRecord} />
|
|
173
|
+
<FindingDetail record={record} evidence={evidence} renderText={renderText} renderArtifact={renderArtifact} onOpenRecord={onOpenRecord} />
|
|
98
174
|
</DetailDialog>
|
|
99
175
|
);
|
|
100
176
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -32,3 +32,16 @@ export type { ArtifactPreviewProps, ArtifactRenderOptions, ArtifactRenderer } fr
|
|
|
32
32
|
|
|
33
33
|
export { PaperPdfViewer } from './paper-pdf-viewer.js';
|
|
34
34
|
export type { PaperPdfViewerProps, PdfLoadState, PdfPassage } from './paper-pdf-viewer.js';
|
|
35
|
+
|
|
36
|
+
export { OutputCard } from './output-card.js';
|
|
37
|
+
export type { OutputCardProps } from './output-card.js';
|
|
38
|
+
export { OutputEntry } from './output-entry.js';
|
|
39
|
+
export type { OutputEntryProps } from './output-entry.js';
|
|
40
|
+
|
|
41
|
+
export { PaperRow } from './paper-row.js';
|
|
42
|
+
export type { PaperRowProps } from './paper-row.js';
|
|
43
|
+
|
|
44
|
+
export { OutputStatusIndicator } from './output-status.js';
|
|
45
|
+
export type { OutputStatusIndicatorProps } from './output-status.js';
|
|
46
|
+
|
|
47
|
+
export { OutputProvenance, type OutputProvenanceProps } from './output-provenance.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KindGlyph } from '../primitives/kind-glyph.js';
|
|
1
2
|
import type { ResolvedInsight } from '@astra-spec/sdk';
|
|
2
3
|
import {
|
|
3
4
|
forwardRef,
|
|
@@ -20,7 +21,7 @@ export interface InsightEvidenceTitleProps {
|
|
|
20
21
|
export function InsightEvidenceTitle({ name, tag }: InsightEvidenceTitleProps) {
|
|
21
22
|
return (
|
|
22
23
|
<span className="astra-evidence__title">
|
|
23
|
-
<
|
|
24
|
+
<KindGlyph className="astra-evidence__glyph--insight" kind="prior_insight" />
|
|
24
25
|
<span className="astra-evidence__name">{name}</span>
|
|
25
26
|
{tag ? <span className="astra-evidence__tag">{tag}</span> : null}
|
|
26
27
|
</span>
|
|
@@ -78,7 +79,7 @@ export const InsightTrigger = forwardRef<HTMLElement, InsightTriggerProps>(funct
|
|
|
78
79
|
onClick={open}
|
|
79
80
|
onKeyDown={keyOpen}
|
|
80
81
|
>
|
|
81
|
-
<
|
|
82
|
+
<KindGlyph className="astra-evidence__glyph--insight" kind="prior_insight" />
|
|
82
83
|
<div className="astra-insight-trigger__claim">
|
|
83
84
|
<Prose text={insight.claim} field="claim" renderText={renderText} />
|
|
84
85
|
</div>
|