@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.
Files changed (227) hide show
  1. package/README.md +47 -4
  2. package/TOKENS.md +14 -8
  3. package/blocks.css +1 -0
  4. package/components.css +6 -0
  5. package/dist/blocks/analysis-tree.d.ts.map +1 -1
  6. package/dist/blocks/analysis-tree.js +4 -7
  7. package/dist/blocks/analysis-tree.js.map +1 -1
  8. package/dist/blocks/decisions-list.d.ts.map +1 -1
  9. package/dist/blocks/decisions-list.js +1 -1
  10. package/dist/blocks/decisions-list.js.map +1 -1
  11. package/dist/blocks/findings-list.d.ts.map +1 -1
  12. package/dist/blocks/findings-list.js +3 -4
  13. package/dist/blocks/findings-list.js.map +1 -1
  14. package/dist/blocks/index.d.ts +2 -4
  15. package/dist/blocks/index.d.ts.map +1 -1
  16. package/dist/blocks/index.js +1 -2
  17. package/dist/blocks/index.js.map +1 -1
  18. package/dist/blocks/outputs-list.d.ts +2 -7
  19. package/dist/blocks/outputs-list.d.ts.map +1 -1
  20. package/dist/blocks/outputs-list.js +11 -21
  21. package/dist/blocks/outputs-list.js.map +1 -1
  22. package/dist/blocks/papers-list.d.ts.map +1 -1
  23. package/dist/blocks/papers-list.js +3 -3
  24. package/dist/blocks/papers-list.js.map +1 -1
  25. package/dist/blocks/section.d.ts.map +1 -1
  26. package/dist/blocks/section.js +3 -2
  27. package/dist/blocks/section.js.map +1 -1
  28. package/dist/components/figure-zoom.d.ts +6 -0
  29. package/dist/components/figure-zoom.d.ts.map +1 -0
  30. package/dist/components/figure-zoom.js +28 -0
  31. package/dist/components/figure-zoom.js.map +1 -0
  32. package/dist/components/finding-detail.d.ts +4 -2
  33. package/dist/components/finding-detail.d.ts.map +1 -1
  34. package/dist/components/finding-detail.js +41 -25
  35. package/dist/components/finding-detail.js.map +1 -1
  36. package/dist/components/index.d.ts +9 -0
  37. package/dist/components/index.d.ts.map +1 -1
  38. package/dist/components/index.js +5 -0
  39. package/dist/components/index.js.map +1 -1
  40. package/dist/components/insight-trigger.d.ts.map +1 -1
  41. package/dist/components/insight-trigger.js +3 -2
  42. package/dist/components/insight-trigger.js.map +1 -1
  43. package/dist/components/output-card.d.ts +13 -0
  44. package/dist/components/output-card.d.ts.map +1 -0
  45. package/dist/components/output-card.js +12 -0
  46. package/dist/components/output-card.js.map +1 -0
  47. package/dist/components/output-detail.d.ts +6 -2
  48. package/dist/components/output-detail.d.ts.map +1 -1
  49. package/dist/components/output-detail.js +49 -13
  50. package/dist/components/output-detail.js.map +1 -1
  51. package/dist/components/output-dialog.d.ts +6 -1
  52. package/dist/components/output-dialog.d.ts.map +1 -1
  53. package/dist/components/output-dialog.js +2 -2
  54. package/dist/components/output-dialog.js.map +1 -1
  55. package/dist/components/output-entry.d.ts +17 -0
  56. package/dist/components/output-entry.d.ts.map +1 -0
  57. package/dist/components/output-entry.js +21 -0
  58. package/dist/components/output-entry.js.map +1 -0
  59. package/dist/components/output-provenance.d.ts +6 -0
  60. package/dist/components/output-provenance.d.ts.map +1 -0
  61. package/dist/components/output-provenance.js +16 -0
  62. package/dist/components/output-provenance.js.map +1 -0
  63. package/dist/components/output-status.d.ts +8 -0
  64. package/dist/components/output-status.d.ts.map +1 -0
  65. package/dist/components/output-status.js +17 -0
  66. package/dist/components/output-status.js.map +1 -0
  67. package/dist/components/paper-detail.d.ts.map +1 -1
  68. package/dist/components/paper-detail.js +2 -2
  69. package/dist/components/paper-detail.js.map +1 -1
  70. package/dist/components/paper-row.d.ts +9 -0
  71. package/dist/components/paper-row.d.ts.map +1 -0
  72. package/dist/components/paper-row.js +11 -0
  73. package/dist/components/paper-row.js.map +1 -0
  74. package/dist/components/record-dialog.d.ts +5 -1
  75. package/dist/components/record-dialog.d.ts.map +1 -1
  76. package/dist/components/record-dialog.js +7 -4
  77. package/dist/components/record-dialog.js.map +1 -1
  78. package/dist/components/record-preview.d.ts.map +1 -1
  79. package/dist/components/record-preview.js +8 -7
  80. package/dist/components/record-preview.js.map +1 -1
  81. package/dist/lib/labels.d.ts +34 -2
  82. package/dist/lib/labels.d.ts.map +1 -1
  83. package/dist/lib/labels.js +35 -4
  84. package/dist/lib/labels.js.map +1 -1
  85. package/dist/model/index.d.ts +4 -2
  86. package/dist/model/index.d.ts.map +1 -1
  87. package/dist/model/index.js +1 -1
  88. package/dist/model/index.js.map +1 -1
  89. package/dist/model/kind.d.ts +2 -2
  90. package/dist/model/kind.d.ts.map +1 -1
  91. package/dist/model/kind.js +3 -4
  92. package/dist/model/kind.js.map +1 -1
  93. package/dist/model/output-provenance.d.ts +17 -0
  94. package/dist/model/output-provenance.d.ts.map +1 -0
  95. package/dist/model/output-provenance.js +2 -0
  96. package/dist/model/output-provenance.js.map +1 -0
  97. package/dist/model/output-status.d.ts +17 -0
  98. package/dist/model/output-status.d.ts.map +1 -0
  99. package/dist/model/output-status.js +2 -0
  100. package/dist/model/output-status.js.map +1 -0
  101. package/dist/model/relations.d.ts +37 -12
  102. package/dist/model/relations.d.ts.map +1 -1
  103. package/dist/model/relations.js +76 -23
  104. package/dist/model/relations.js.map +1 -1
  105. package/dist/primitives/dialog.d.ts.map +1 -1
  106. package/dist/primitives/dialog.js +9 -1
  107. package/dist/primitives/dialog.js.map +1 -1
  108. package/dist/primitives/index.d.ts +6 -0
  109. package/dist/primitives/index.d.ts.map +1 -1
  110. package/dist/primitives/index.js +3 -0
  111. package/dist/primitives/index.js.map +1 -1
  112. package/dist/primitives/inline-reference.d.ts +9 -0
  113. package/dist/primitives/inline-reference.d.ts.map +1 -0
  114. package/dist/primitives/inline-reference.js +14 -0
  115. package/dist/primitives/inline-reference.js.map +1 -0
  116. package/dist/primitives/kind-glyph.d.ts +8 -0
  117. package/dist/primitives/kind-glyph.d.ts.map +1 -0
  118. package/dist/primitives/kind-glyph.js +9 -0
  119. package/dist/primitives/kind-glyph.js.map +1 -0
  120. package/dist/primitives/output-status-glyph.d.ts +8 -0
  121. package/dist/primitives/output-status-glyph.d.ts.map +1 -0
  122. package/dist/primitives/output-status-glyph.js +13 -0
  123. package/dist/primitives/output-status-glyph.js.map +1 -0
  124. package/dist/primitives/preview-popover.d.ts +1 -1
  125. package/dist/primitives/preview-popover.d.ts.map +1 -1
  126. package/dist/primitives/record-list.d.ts.map +1 -1
  127. package/dist/primitives/record-list.js +3 -2
  128. package/dist/primitives/record-list.js.map +1 -1
  129. package/dist/primitives/relation-list.d.ts.map +1 -1
  130. package/dist/primitives/relation-list.js +3 -2
  131. package/dist/primitives/relation-list.js.map +1 -1
  132. package/dist/primitives/tooltip.d.ts +7 -0
  133. package/dist/primitives/tooltip.d.ts.map +1 -0
  134. package/dist/primitives/tooltip.js +31 -0
  135. package/dist/primitives/tooltip.js.map +1 -0
  136. package/dist/views/inventory.d.ts +12 -1
  137. package/dist/views/inventory.d.ts.map +1 -1
  138. package/dist/views/inventory.js +23 -17
  139. package/dist/views/inventory.js.map +1 -1
  140. package/isolate.css +7 -0
  141. package/package.json +7 -4
  142. package/primitives.css +3 -0
  143. package/src/blocks/analysis-tree.tsx +4 -30
  144. package/src/blocks/decisions-list.tsx +5 -3
  145. package/src/blocks/findings-list.tsx +10 -8
  146. package/src/blocks/index.ts +2 -4
  147. package/src/blocks/outputs-list.tsx +43 -106
  148. package/src/blocks/papers-list.tsx +2 -18
  149. package/src/blocks/section.tsx +3 -2
  150. package/src/components/figure-zoom.tsx +72 -0
  151. package/src/components/finding-detail.tsx +106 -30
  152. package/src/components/index.ts +13 -0
  153. package/src/components/insight-trigger.tsx +3 -2
  154. package/src/components/output-card.tsx +51 -0
  155. package/src/components/output-detail.tsx +69 -21
  156. package/src/components/output-dialog.tsx +9 -0
  157. package/src/components/output-entry.tsx +61 -0
  158. package/src/components/output-provenance.tsx +86 -0
  159. package/src/components/output-status.tsx +38 -0
  160. package/src/components/paper-detail.tsx +2 -2
  161. package/src/components/paper-row.tsx +41 -0
  162. package/src/components/record-dialog.tsx +13 -1
  163. package/src/components/record-preview.tsx +8 -14
  164. package/src/lib/labels.tsx +69 -6
  165. package/src/model/index.ts +6 -2
  166. package/src/model/kind.ts +4 -5
  167. package/src/model/output-provenance.ts +18 -0
  168. package/src/model/output-status.ts +18 -0
  169. package/src/model/relations.ts +92 -26
  170. package/src/primitives/dialog.tsx +7 -1
  171. package/src/primitives/index.ts +6 -0
  172. package/src/primitives/inline-reference.tsx +25 -0
  173. package/src/primitives/kind-glyph.tsx +24 -0
  174. package/src/primitives/output-status-glyph.tsx +37 -0
  175. package/src/primitives/preview-popover.tsx +1 -1
  176. package/src/primitives/record-list.tsx +3 -4
  177. package/src/primitives/relation-list.tsx +4 -7
  178. package/src/primitives/tooltip.tsx +51 -0
  179. package/src/views/inventory.tsx +54 -22
  180. package/styles/base.css +2 -1
  181. package/styles/blocks/analysis-tree.css +23 -26
  182. package/styles/blocks/decisions-list.css +6 -6
  183. package/styles/blocks/findings-list.css +50 -0
  184. package/styles/blocks/outputs-list.css +13 -434
  185. package/styles/blocks/papers-list.css +8 -74
  186. package/styles/blocks/records.css +13 -13
  187. package/styles/components/artifact-preview.css +15 -15
  188. package/styles/components/decision-detail.css +23 -23
  189. package/styles/components/evidence.css +2 -7
  190. package/styles/components/figure-zoom.css +62 -0
  191. package/styles/components/finding-detail.css +73 -11
  192. package/styles/components/input-detail.css +7 -7
  193. package/styles/components/insight-detail.css +17 -17
  194. package/styles/components/insight-list.css +6 -6
  195. package/styles/components/insight-trigger.css +5 -5
  196. package/styles/components/output-card.css +290 -0
  197. package/styles/components/output-detail.css +139 -51
  198. package/styles/components/output-entry.css +141 -0
  199. package/styles/components/output-provenance.css +94 -0
  200. package/styles/components/output-status.css +31 -0
  201. package/styles/components/paper-detail.css +22 -22
  202. package/styles/components/paper-doi.css +2 -2
  203. package/styles/components/paper-pdf-viewer.css +6 -6
  204. package/styles/components/paper-row.css +72 -0
  205. package/styles/components/record-preview.css +444 -268
  206. package/styles/primitives/badge.css +1 -1
  207. package/styles/primitives/button.css +25 -25
  208. package/styles/primitives/count-heading.css +3 -3
  209. package/styles/primitives/detail-layout.css +20 -20
  210. package/styles/primitives/dialog.css +75 -93
  211. package/styles/primitives/empty-state.css +1 -1
  212. package/styles/primitives/inline-reference.css +37 -0
  213. package/styles/primitives/kind-glyph.css +31 -0
  214. package/styles/primitives/kind.css +6 -0
  215. package/styles/primitives/preview-popover.css +6 -11
  216. package/styles/primitives/prose.css +1 -1
  217. package/styles/primitives/record-list.css +32 -48
  218. package/styles/primitives/relation-list.css +14 -36
  219. package/styles/primitives/surface-header.css +15 -11
  220. package/styles/primitives/tooltip.css +22 -0
  221. package/styles/tokens.css +19 -9
  222. package/styles/views/inventory.css +58 -27
  223. package/dist/blocks/prior-insights-list.d.ts +0 -9
  224. package/dist/blocks/prior-insights-list.d.ts.map +0 -1
  225. package/dist/blocks/prior-insights-list.js +0 -29
  226. package/dist/blocks/prior-insights-list.js.map +0 -1
  227. package/src/blocks/prior-insights-list.tsx +0 -52
@@ -0,0 +1,290 @@
1
+ /* output-card — emitted by src/components/output-card.tsx */
2
+ @layer astra.tokens, astra.base, astra.components, astra.views;
3
+ @layer astra.components {
4
+ @media (prefers-reduced-motion: reduce) {
5
+ :where(.astra-ui) .astra-output-card,
6
+ :where(.astra-ui) .astra-output-card__open {
7
+ transition: none;
8
+ }
9
+
10
+ }
11
+
12
+ :where(.astra-ui) .astra-output-card {
13
+ all: unset;
14
+ position: relative;
15
+ display: flex;
16
+ min-width: 0;
17
+ cursor: pointer;
18
+ flex-direction: column;
19
+ overflow: visible;
20
+ border: 1px solid var(--astra-color-border);
21
+ border-radius: 7.2px;
22
+ background: var(--astra-color-surface-raised);
23
+ color: var(--astra-color-text);
24
+ transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
25
+ }
26
+
27
+ :where(.astra-ui) .astra-output-card__preview {
28
+ position: relative;
29
+ display: flex;
30
+ aspect-ratio: 16 / 10;
31
+ align-items: center;
32
+ justify-content: center;
33
+ overflow: hidden;
34
+ border-bottom: 1px solid var(--astra-color-border);
35
+ background: var(--astra-color-surface);
36
+ }
37
+
38
+ :where(.astra-ui) .astra-output-card__open {
39
+ position: absolute;
40
+ top: 8.8px;
41
+ right: 8.8px;
42
+ border-radius: 99px;
43
+ background: color-mix(in srgb, var(--astra-color-surface) 88%, transparent);
44
+ color: var(--astra-color-text-muted);
45
+ padding: 4px 8px;
46
+ font-family: var(--astra-font-ui);
47
+ font-size: var(--astra-font-size-2xs);
48
+ font-weight: 700;
49
+ opacity: 0;
50
+ transition: opacity 140ms ease;
51
+ }
52
+
53
+ :where(.astra-ui) .astra-output-card:hover .astra-output-card__open,
54
+ :where(.astra-ui) .astra-output-card:focus-visible .astra-output-card__open {
55
+ opacity: 1;
56
+ }
57
+
58
+ :where(.astra-ui) .astra-output-card__kind {
59
+ color: var(--astra-color-accent);
60
+ font-family: var(--astra-font-ui);
61
+ font-size: var(--astra-font-size-2xs);
62
+ font-weight: 700;
63
+ letter-spacing: 0.09em;
64
+ text-transform: uppercase;
65
+ }
66
+
67
+ :where(.astra-ui) .astra-output-card__body strong {
68
+ overflow: hidden;
69
+ font-family: var(--astra-font-ui);
70
+ font-size: 14.72px;
71
+ line-height: 1.2;
72
+ text-overflow: ellipsis;
73
+ white-space: nowrap;
74
+ }
75
+
76
+ :where(.astra-ui) .astra-output-card__body code {
77
+ overflow: hidden;
78
+ color: var(--astra-color-text-subtle);
79
+ font-size: var(--astra-font-size-2xs);
80
+ text-overflow: ellipsis;
81
+ white-space: nowrap;
82
+ }
83
+
84
+ :where(.astra-ui) .astra-output-card {
85
+ --astra-kind: var(--astra-color-kind-output);
86
+ --astra-kind-ink: var(--astra-color-kind-output);
87
+ --astra-kind-soft: var(--astra-color-kind-output-soft);
88
+ }
89
+
90
+ :where(.astra-ui) .astra-output-card {
91
+ border-color: var(--astra-color-border-strong);
92
+ border-radius: 8px;
93
+ background: var(--astra-color-surface-raised);
94
+ box-shadow: none;
95
+ }
96
+
97
+ :where(.astra-ui) .astra-output-card:focus-visible {
98
+ outline: 2px solid var(--astra-color-accent);
99
+ outline-offset: 3px;
100
+ outline-color: var(--astra-color-focus);
101
+ }
102
+
103
+ :where(.astra-ui) .astra-output-card__preview {
104
+ border-color: var(--astra-color-border);
105
+ background: var(--astra-color-surface);
106
+ }
107
+
108
+ :where(.astra-ui) .astra-output-card__preview > img {
109
+ background: var(--astra-color-artifact-paper);
110
+ }
111
+
112
+ :where(.astra-ui) .astra-output-card__kind {
113
+ color: var(--astra-color-kind-output);
114
+ }
115
+
116
+ :where(.astra-ui) .astra-output-card__open {
117
+ border: 1px solid var(--astra-color-border);
118
+ border-radius: var(--astra-radius-control);
119
+ background: color-mix(in srgb, var(--astra-color-surface-raised) 92%, transparent);
120
+ }
121
+
122
+ :where(.astra-ui) .astra-output-card {
123
+ border-color: var(--astra-color-border);
124
+ border-radius: 0;
125
+ background: var(--astra-color-surface-raised);
126
+ box-shadow: none;
127
+ }
128
+
129
+ :where(.astra-ui) .astra-output-card:hover {
130
+ transform: none;
131
+ border-color: var(--astra-color-kind-output);
132
+ box-shadow: none;
133
+ }
134
+
135
+ :where(.astra-ui) .astra-output-card__preview {
136
+ aspect-ratio: 4 / 3;
137
+ border-color: var(--astra-color-border-subtle);
138
+ background: var(--astra-color-surface-raised);
139
+ }
140
+
141
+ :where(.astra-ui) .astra-output-card__preview > img,
142
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="image"]) > img {
143
+ width: 100%;
144
+ height: 100%;
145
+ box-sizing: border-box;
146
+ object-fit: contain;
147
+ max-height: none;
148
+ margin: 0;
149
+ padding: 7.2px;
150
+ }
151
+
152
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="image"]) {
153
+ display: block;
154
+ width: 100%;
155
+ height: 100%;
156
+ margin: 0;
157
+ border: 0;
158
+ }
159
+
160
+ /* A metric card stacks label over value so the number reads at a glance;
161
+ the host's compact preview supplies the same data as the dialog. */
162
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="metric"]) {
163
+ box-sizing: border-box;
164
+ display: flex;
165
+ width: 100%;
166
+ height: 100%;
167
+ flex-direction: column;
168
+ align-items: center;
169
+ justify-content: center;
170
+ gap: 5.6px;
171
+ padding: 9.6px;
172
+ text-align: center;
173
+ }
174
+
175
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="metric"]) > .astra-artifact__metric-label {
176
+ overflow: hidden;
177
+ max-width: 100%;
178
+ color: var(--astra-color-text-subtle);
179
+ font-size: var(--astra-font-size-2xs);
180
+ line-height: 1.3;
181
+ text-overflow: ellipsis;
182
+ white-space: nowrap;
183
+ }
184
+
185
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="metric"]) .astra-artifact__metric-value {
186
+ max-width: 100%;
187
+ font-size: clamp(var(--astra-font-size-title), 3cqw, 28px);
188
+ }
189
+
190
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="metric"]) .astra-artifact__metric-uncertainty,
191
+ :where(.astra-ui) .astra-output-card__preview > .astra-artifact:where([data-type="metric"]) .astra-artifact__metric-unit {
192
+ font-size: var(--astra-font-size-xs);
193
+ }
194
+
195
+ :where(.astra-ui) .astra-output-card__open {
196
+ top: 7.2px;
197
+ right: 7.2px;
198
+ border: 0;
199
+ background: color-mix(in srgb, var(--astra-color-surface-raised) 92%, transparent);
200
+ }
201
+
202
+ :where(.astra-ui) .astra-output-card__body {
203
+ display: grid;
204
+ gap: 2px;
205
+ padding: 8.8px 11px 10.4px;
206
+ }
207
+
208
+ :where(.astra-ui) .astra-output-card__kind {
209
+ color: var(--astra-color-kind-output);
210
+ font-size: var(--astra-font-size-2xs);
211
+ }
212
+
213
+ :where(.astra-ui) .astra-output-card__body strong {
214
+ font-size: var(--astra-font-size-sm);
215
+ font-weight: 600;
216
+ }
217
+
218
+ :where(.astra-ui) .astra-output-card__body code {
219
+ font-size: var(--astra-font-size-2xs);
220
+ }
221
+
222
+ :where(.astra-ui) .astra-output-card {
223
+ overflow: visible;
224
+ padding: 0;
225
+ border: 1px solid var(--astra-color-border);
226
+ border-radius: 0;
227
+ background: var(--astra-color-surface-raised);
228
+ color: var(--astra-color-text);
229
+ box-shadow: none;
230
+ }
231
+
232
+ :where(.astra-ui) .astra-output-card:hover,
233
+ :where(.astra-ui) .astra-output-card:focus-visible {
234
+ border-color: var(--astra-color-kind-output);
235
+ box-shadow: none;
236
+ }
237
+
238
+ :where(.astra-ui) .astra-output-card__preview {
239
+ display: grid;
240
+ aspect-ratio: 4 / 3;
241
+ border-bottom: 1px solid var(--astra-color-border-subtle);
242
+ background: var(--astra-color-surface-raised);
243
+ place-items: center;
244
+ }
245
+
246
+ :where(.astra-ui) .astra-output-card__preview > img {
247
+ box-sizing: border-box;
248
+ width: 100%;
249
+ height: 100%;
250
+ padding: 5.6px;
251
+ object-fit: contain;
252
+ }
253
+
254
+ :where(.astra-ui) .astra-output-card__open {
255
+ top: 7.2px;
256
+ right: 7.2px;
257
+ padding: 0;
258
+ border: 0;
259
+ background: color-mix(in srgb, var(--astra-color-surface-raised) 92%, transparent);
260
+ color: var(--astra-color-text-muted);
261
+ font: 600 var(--astra-font-size-2xs)/1.2 var(--astra-font-ui);
262
+ }
263
+
264
+ :where(.astra-ui) .astra-output-card__body {
265
+ display: block;
266
+ padding: 9px 11px;
267
+ }
268
+
269
+ :where(.astra-ui) .astra-output-card__kind {
270
+ display: block;
271
+ margin-bottom: 2px;
272
+ color: var(--astra-color-kind-output);
273
+ font: 700 var(--astra-font-size-2xs)/1.2 var(--astra-font-ui);
274
+ letter-spacing: 0.08em;
275
+ text-transform: uppercase;
276
+ }
277
+
278
+ :where(.astra-ui) .astra-output-card__body strong {
279
+ display: block;
280
+ overflow: hidden;
281
+ font: 600 var(--astra-font-size-sm)/1.25 var(--astra-font-ui);
282
+ text-overflow: ellipsis;
283
+ white-space: nowrap;
284
+ }
285
+
286
+ :where(.astra-ui) .astra-output-card__body code {
287
+ display: none;
288
+ }
289
+
290
+ }