@burdenoff/microfe-cosmicintersection 2026.1012.1 → 2026.1030.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,14 +12,15 @@ import { useFileDownloadUrl as de } from "../../components/FileUploadField.js";
12
12
  import s from "../../components/PageLayout.js";
13
13
  import c, { formatEnumLabel as l } from "../../components/StatusBadge.js";
14
14
  import "../../components/index.js";
15
- import fe, { buildDatasetLineage as pe } from "../../components/LineageGraph.js";
16
- import { useMemo as me, useState as u } from "react";
17
- import { Fragment as he, jsx as d, jsxs as f } from "react/jsx-runtime";
18
- import { useParams as ge } from "react-router";
19
- import { ArrowRight as _e, Boxes as ve, Columns3 as p, Database as ye, Download as be, GitBranch as xe, History as Se, MessagesSquare as Ce, Pencil as we, Plus as Te, Radar as Ee, Share2 as De, TriangleAlert as m } from "lucide-react";
20
- import { Badge as h, Button as g, Checkbox as Oe, Dialog as ke, DialogContent as Ae, DialogDescription as je, DialogFooter as Me, DialogHeader as Ne, DialogTitle as Pe, Input as _, Label as v, Select as Fe, SelectContent as Ie, SelectItem as Le, SelectTrigger as Re, SelectValue as ze, Table as Be, TableBody as Ve, TableCell as y, TableHead as b, TableHeader as He, TableRow as x, Textarea as Ue } from "@burdenoff/fe-libs/ui";
15
+ import { useSelectedRecord as fe } from "../../lib/useSelectedRecord.js";
16
+ import pe, { buildDatasetLineage as me } from "../../components/LineageGraph.js";
17
+ import { useMemo as he, useState as u } from "react";
18
+ import { Fragment as ge, jsx as d, jsxs as f } from "react/jsx-runtime";
19
+ import { useParams as _e } from "react-router";
20
+ import { ArrowRight as ve, Boxes as ye, Columns3 as p, Database as be, Download as xe, GitBranch as Se, History as Ce, MessagesSquare as we, Pencil as Te, Plus as Ee, Radar as De, Share2 as Oe, TriangleAlert as m } from "lucide-react";
21
+ import { Badge as h, Button as g, Checkbox as ke, Dialog as Ae, DialogContent as je, DialogDescription as Me, DialogFooter as Ne, DialogHeader as Pe, DialogTitle as Fe, Input as _, Label as v, Select as Ie, SelectContent as Le, SelectItem as Re, SelectTrigger as ze, SelectValue as Be, Table as Ve, TableBody as He, TableCell as y, TableHead as b, TableHeader as Ue, TableRow as x, Textarea as We } from "@burdenoff/fe-libs/ui";
21
22
  //#region src/cosmicintersection/pages/datasets/DatasetDetailPage.tsx
22
- var We = [
23
+ var Ge = [
23
24
  "STRING",
24
25
  "INTEGER",
25
26
  "FLOAT",
@@ -38,7 +39,7 @@ var We = [
38
39
  function C(e) {
39
40
  return S.has(e.fieldType) && !e.unit;
40
41
  }
41
- function Ge(e) {
42
+ function Ke(e) {
42
43
  if (!e) return "—";
43
44
  let t = Number(e);
44
45
  if (!Number.isFinite(t) || t <= 0) return "—";
@@ -71,65 +72,65 @@ function T({ label: e, value: t }) {
71
72
  });
72
73
  }
73
74
  function E() {
74
- let { id: S = "" } = ge(), { navigate: E } = e(), { data: D, loading: Ke, error: qe, refetch: O } = ee(S), k = D?.cosDataset ?? null, A = de(k?.file?.id).data?.getFileDownloadUrl ?? null, [Je, { loading: j }] = ne(), [Ye] = i(), [Xe, { loading: M }] = ae(), [Ze, { loading: N }] = n(), P = r({ datasetId: S }), F = ie({ pagination: {
75
+ let { id: S = "" } = _e(), { navigate: E } = e(), { selectedId: D, select: qe } = fe("field"), O = (e) => qe(D === e ? null : e), { data: k, loading: Je, error: Ye, refetch: A } = ee(S), j = k?.cosDataset ?? null, M = de(j?.file?.id).data?.getFileDownloadUrl ?? null, [Xe, { loading: N }] = ne(), [Ze] = i(), [Qe, { loading: P }] = ae(), [$e, { loading: F }] = n(), I = r({ datasetId: S }), L = ie({ pagination: {
75
76
  limit: 100,
76
77
  offset: 0
77
- } }), I = te({ pagination: {
78
+ } }), R = te({ pagination: {
78
79
  limit: 100,
79
80
  offset: 0
80
- } }), L = re({ pagination: {
81
+ } }), z = re({ pagination: {
81
82
  limit: 100,
82
83
  offset: 0
83
- } }), R = D?.cosDataset ?? null, z = me(() => {
84
- if (!R) return {
84
+ } }), B = k?.cosDataset ?? null, V = he(() => {
85
+ if (!B) return {
85
86
  nodes: [],
86
87
  edges: []
87
88
  };
88
89
  let e = /* @__PURE__ */ new Map();
89
- R.source && e.set(R.source.id, R.source);
90
+ B.source && e.set(B.source.id, B.source);
90
91
  let t = /* @__PURE__ */ new Map();
91
- R.collection && t.set(R.collection.id, R.collection);
92
+ B.collection && t.set(B.collection.id, B.collection);
92
93
  let n = {
93
- datasetsById: new Map([[R.id, R]]),
94
+ datasetsById: new Map([[B.id, B]]),
94
95
  sourcesById: e,
95
96
  collectionsById: t,
96
- runs: (F.data?.cosListRuns?.items ?? []).filter((e) => e.datasetId === R.id),
97
- notebooks: (I.data?.cosListNotebooks?.items ?? []).filter((e) => e.datasetIds.includes(R.id)),
98
- analyses: P.data?.cosListAnalyses ?? [],
99
- releases: (L.data?.cosListReleases?.items ?? []).filter((e) => e.datasetIds.includes(R.id))
97
+ runs: (L.data?.cosListRuns?.items ?? []).filter((e) => e.datasetId === B.id),
98
+ notebooks: (R.data?.cosListNotebooks?.items ?? []).filter((e) => e.datasetIds.includes(B.id)),
99
+ analyses: I.data?.cosListAnalyses ?? [],
100
+ releases: (z.data?.cosListReleases?.items ?? []).filter((e) => e.datasetIds.includes(B.id))
100
101
  };
101
- return pe(R.id, n);
102
+ return me(B.id, n);
102
103
  }, [
103
- R,
104
- F.data,
104
+ B,
105
+ L.data,
106
+ R.data,
105
107
  I.data,
106
- P.data,
107
- L.data
108
- ]), Qe = F.loading || I.loading || P.loading || L.loading, [B, V] = u([]), [$e, et] = u(null), H = k ? `${k.id}:${k.updatedAt}` : null;
109
- H && H !== $e && (et(H), V(k?.tags ?? []));
110
- let tt = k != null && (B.length !== k.tags.length || B.some((e, t) => e !== k.tags[t])), [nt, rt] = u(!1), [U, W] = u(""), [G, K] = u("STRING"), [q, J] = u(""), [Y, it] = u(""), [X, at] = u(""), [ot, st] = u(!0), ct = () => {
111
- W(""), K("STRING"), J(""), it(""), at(""), st(!0);
108
+ z.data
109
+ ]), et = L.loading || R.loading || I.loading || z.loading, [H, U] = u([]), [tt, nt] = u(null), W = j ? `${j.id}:${j.updatedAt}` : null;
110
+ W && W !== tt && (nt(W), U(j?.tags ?? []));
111
+ let rt = j != null && (H.length !== j.tags.length || H.some((e, t) => e !== j.tags[t])), [it, at] = u(!1), [G, K] = u(""), [q, J] = u("STRING"), [Y, ot] = u(""), [st, X] = u(""), [ct, lt] = u(""), [ut, dt] = u(!0), ft = () => {
112
+ K(""), J("STRING"), ot(""), X(""), lt(""), dt(!0);
112
113
  }, Z = (e) => {
113
- rt(e), e || ct();
114
+ at(e), e || ft();
114
115
  };
115
- if (Ke) return /* @__PURE__ */ d(s, {
116
+ if (Je) return /* @__PURE__ */ d(s, {
116
117
  title: "Dataset",
117
118
  backPath: "datasets",
118
119
  children: /* @__PURE__ */ d(o, { label: "Loading dataset…" })
119
120
  });
120
- if (qe) return /* @__PURE__ */ d(s, {
121
+ if (Ye) return /* @__PURE__ */ d(s, {
121
122
  title: "Dataset",
122
123
  backPath: "datasets",
123
124
  children: /* @__PURE__ */ d(se, {
124
125
  message: "We could not load this dataset.",
125
- onRetry: () => void O()
126
+ onRetry: () => void A()
126
127
  })
127
128
  });
128
- if (!k) return /* @__PURE__ */ d(s, {
129
+ if (!j) return /* @__PURE__ */ d(s, {
129
130
  title: "Dataset",
130
131
  backPath: "datasets",
131
132
  children: /* @__PURE__ */ d(a, {
132
- icon: ye,
133
+ icon: be,
133
134
  title: "Dataset not found.",
134
135
  description: "This dataset may have been removed or is outside your current scope.",
135
136
  action: /* @__PURE__ */ d(g, {
@@ -139,36 +140,36 @@ function E() {
139
140
  })
140
141
  })
141
142
  });
142
- let Q = [...k.schemaFields ?? []].sort((e, t) => e.position - t.position), $ = Q.filter(C).length, lt = k.status !== "AVAILABLE" && k.status !== "ARCHIVED", ut = async () => {
143
- (await Je({ variables: { id: k.id } })).data?.cosPublishDataset && (t.success("Dataset published", `“${k.name}” is now available.`), await O());
144
- }, dt = async () => {
145
- let e = await Ye({ variables: { id: k.id } });
143
+ let Q = [...j.schemaFields ?? []].sort((e, t) => e.position - t.position), $ = Q.filter(C).length, pt = j.status !== "AVAILABLE" && j.status !== "ARCHIVED", mt = async () => {
144
+ (await Xe({ variables: { id: j.id } })).data?.cosPublishDataset && (t.success("Dataset published", `“${j.name}” is now available.`), await A());
145
+ }, ht = async () => {
146
+ let e = await Ze({ variables: { id: j.id } });
146
147
  if (e.error) throw Error(e.error.message);
147
148
  if (!e.data?.cosArchiveDataset) throw t.error("Could not archive dataset", "The server did not confirm the change."), Error("Archive not confirmed");
148
149
  t.success("Dataset archived"), E("datasets");
149
- }, ft = async () => {
150
- (await Xe({ variables: {
151
- id: k.id,
152
- input: { tags: B }
153
- } })).data?.cosUpdateDataset && (t.success("Tags updated"), await O());
154
- }, pt = async () => {
155
- if (!U.trim()) {
150
+ }, gt = async () => {
151
+ (await Qe({ variables: {
152
+ id: j.id,
153
+ input: { tags: H }
154
+ } })).data?.cosUpdateDataset && (t.success("Tags updated"), await A());
155
+ }, _t = async () => {
156
+ if (!G.trim()) {
156
157
  t.error("Field name is required");
157
158
  return;
158
159
  }
159
- (await Ze({ variables: { input: {
160
- datasetId: k.id,
161
- name: U.trim(),
162
- fieldType: G,
163
- unit: q.trim() || void 0,
164
- description: Y.trim() || void 0,
165
- provenance: X.trim() || void 0,
166
- nullable: ot
167
- } } })).data?.cosAddSchemaField && (t.success("Schema field added"), Z(!1), await O());
160
+ (await $e({ variables: { input: {
161
+ datasetId: j.id,
162
+ name: G.trim(),
163
+ fieldType: q,
164
+ unit: Y.trim() || void 0,
165
+ description: st.trim() || void 0,
166
+ provenance: ct.trim() || void 0,
167
+ nullable: ut
168
+ } } })).data?.cosAddSchemaField && (t.success("Schema field added"), Z(!1), await A());
168
169
  };
169
170
  return /* @__PURE__ */ f(s, {
170
- title: k.name,
171
- description: k.description ?? void 0,
171
+ title: j.name,
172
+ description: j.description ?? void 0,
172
173
  backPath: "datasets",
173
174
  actions: /* @__PURE__ */ f("div", {
174
175
  className: "flex flex-wrap items-center justify-end gap-2",
@@ -176,19 +177,19 @@ function E() {
176
177
  /* @__PURE__ */ f(g, {
177
178
  type: "button",
178
179
  variant: "outline",
179
- onClick: () => E(`datasets/${k.id}/edit`),
180
- children: [/* @__PURE__ */ d(we, { className: "size-4" }), "Edit"]
180
+ onClick: () => E(`datasets/${j.id}/edit`),
181
+ children: [/* @__PURE__ */ d(Te, { className: "size-4" }), "Edit"]
181
182
  }),
182
- lt ? /* @__PURE__ */ d(g, {
183
+ pt ? /* @__PURE__ */ d(g, {
183
184
  type: "button",
184
- onClick: () => void ut(),
185
- disabled: j,
186
- children: j ? "Publishing…" : "Publish"
185
+ onClick: () => void mt(),
186
+ disabled: N,
187
+ children: N ? "Publishing…" : "Publish"
187
188
  }) : null,
188
189
  /* @__PURE__ */ d(oe, {
189
- ariaLabel: `Actions for ${k.name}`,
190
- entityName: k.name,
191
- onDelete: () => dt(),
190
+ ariaLabel: `Actions for ${j.name}`,
191
+ entityName: j.name,
192
+ onDelete: () => ht(),
192
193
  deleteLabel: "Archive dataset"
193
194
  })
194
195
  ]
@@ -199,22 +200,22 @@ function E() {
199
200
  /* @__PURE__ */ f("div", {
200
201
  className: "flex flex-wrap items-center gap-2",
201
202
  children: [
202
- /* @__PURE__ */ d(c, { status: k.status }),
203
+ /* @__PURE__ */ d(c, { status: j.status }),
203
204
  /* @__PURE__ */ d(c, {
204
- status: k.accessLevel,
205
- label: l(k.accessLevel)
205
+ status: j.accessLevel,
206
+ label: l(j.accessLevel)
206
207
  }),
207
208
  /* @__PURE__ */ f("span", {
208
209
  className: "inline-flex items-center gap-1.5 rounded-full border border-border-default bg-bg-elevated px-2.5 py-0.5 text-xs font-medium",
209
210
  title: "Current dataset version",
210
211
  children: [
211
- /* @__PURE__ */ d(xe, {
212
+ /* @__PURE__ */ d(Se, {
212
213
  className: "size-3.5 text-text-tertiary",
213
214
  "aria-hidden": "true"
214
215
  }),
215
216
  /* @__PURE__ */ f("span", {
216
217
  className: "text-text-primary",
217
- children: ["v", k.version]
218
+ children: ["v", j.version]
218
219
  }),
219
220
  /* @__PURE__ */ d("span", {
220
221
  className: "text-text-tertiary",
@@ -229,14 +230,14 @@ function E() {
229
230
  children: [
230
231
  /* @__PURE__ */ d(T, {
231
232
  label: "Source",
232
- value: k.source ? /* @__PURE__ */ f("button", {
233
+ value: j.source ? /* @__PURE__ */ f("button", {
233
234
  type: "button",
234
- onClick: () => E(`sources/${k.source?.id}`),
235
+ onClick: () => E(`sources/${j.source?.id}`),
235
236
  className: "inline-flex items-center gap-1.5 text-text-primary underline-offset-2 hover:underline",
236
- children: [/* @__PURE__ */ d(Ee, {
237
+ children: [/* @__PURE__ */ d(De, {
237
238
  className: "size-4 text-text-secondary",
238
239
  "aria-hidden": "true"
239
- }), k.source.name]
240
+ }), j.source.name]
240
241
  }) : /* @__PURE__ */ d("span", {
241
242
  className: "text-text-secondary",
242
243
  children: "Not linked"
@@ -244,14 +245,14 @@ function E() {
244
245
  }),
245
246
  /* @__PURE__ */ d(T, {
246
247
  label: "Collection",
247
- value: k.collection ? /* @__PURE__ */ f("button", {
248
+ value: j.collection ? /* @__PURE__ */ f("button", {
248
249
  type: "button",
249
- onClick: () => E(`collections/${k.collection?.id}`),
250
+ onClick: () => E(`collections/${j.collection?.id}`),
250
251
  className: "inline-flex items-center gap-1.5 text-text-primary underline-offset-2 hover:underline",
251
- children: [/* @__PURE__ */ d(ve, {
252
+ children: [/* @__PURE__ */ d(ye, {
252
253
  className: "size-4 text-text-secondary",
253
254
  "aria-hidden": "true"
254
- }), k.collection.name]
255
+ }), j.collection.name]
255
256
  }) : /* @__PURE__ */ d("span", {
256
257
  className: "text-text-secondary",
257
258
  children: "Not in a collection"
@@ -259,18 +260,18 @@ function E() {
259
260
  }),
260
261
  /* @__PURE__ */ d(T, {
261
262
  label: "Format",
262
- value: /* @__PURE__ */ d("span", { children: k.format || "Not specified" })
263
+ value: /* @__PURE__ */ d("span", { children: j.format || "Not specified" })
263
264
  }),
264
265
  /* @__PURE__ */ d(T, {
265
266
  label: "Size",
266
267
  value: /* @__PURE__ */ f("span", {
267
268
  className: "tabular-nums",
268
- children: [Ge(k.sizeBytes), Number(k.rowCount) > 0 ? /* @__PURE__ */ f("span", {
269
+ children: [Ke(j.sizeBytes), Number(j.rowCount) > 0 ? /* @__PURE__ */ f("span", {
269
270
  className: "text-text-secondary",
270
271
  children: [
271
272
  " ",
272
273
  "· ",
273
- Number(k.rowCount).toLocaleString(),
274
+ Number(j.rowCount).toLocaleString(),
274
275
  " rows"
275
276
  ]
276
277
  }) : null]
@@ -278,24 +279,24 @@ function E() {
278
279
  }),
279
280
  /* @__PURE__ */ d(T, {
280
281
  label: "Ingested",
281
- value: /* @__PURE__ */ d("span", { children: w(k.ingestedAt) })
282
+ value: /* @__PURE__ */ d("span", { children: w(j.ingestedAt) })
282
283
  }),
283
284
  /* @__PURE__ */ d(T, {
284
285
  label: "Created",
285
- value: /* @__PURE__ */ d("span", { children: w(k.createdAt) })
286
+ value: /* @__PURE__ */ d("span", { children: w(j.createdAt) })
286
287
  }),
287
288
  /* @__PURE__ */ d(T, {
288
289
  label: "Updated",
289
- value: /* @__PURE__ */ d("span", { children: w(k.updatedAt) })
290
+ value: /* @__PURE__ */ d("span", { children: w(j.updatedAt) })
290
291
  }),
291
292
  /* @__PURE__ */ d(T, {
292
293
  label: "Artifact",
293
- value: k.file ? A ? /* @__PURE__ */ f("a", {
294
- href: A,
294
+ value: j.file ? M ? /* @__PURE__ */ f("a", {
295
+ href: M,
295
296
  target: "_blank",
296
297
  rel: "noopener noreferrer",
297
298
  className: "inline-flex items-center gap-1.5 text-text-primary underline-offset-2 hover:underline",
298
- children: [/* @__PURE__ */ d(be, {
299
+ children: [/* @__PURE__ */ d(xe, {
299
300
  className: "size-4",
300
301
  "aria-hidden": "true"
301
302
  }), "Download file"]
@@ -315,7 +316,7 @@ function E() {
315
316
  className: "flex items-center justify-between gap-3",
316
317
  children: [/* @__PURE__ */ f("div", {
317
318
  className: "flex items-center gap-2",
318
- children: [/* @__PURE__ */ d(De, {
319
+ children: [/* @__PURE__ */ d(Oe, {
319
320
  className: "size-5 text-text-secondary",
320
321
  "aria-hidden": "true"
321
322
  }), /* @__PURE__ */ d("h2", {
@@ -324,18 +325,18 @@ function E() {
324
325
  })]
325
326
  }), /* @__PURE__ */ f("button", {
326
327
  type: "button",
327
- onClick: () => E(`lineage/${k.id}`),
328
+ onClick: () => E(`lineage/${j.id}`),
328
329
  className: "inline-flex items-center gap-1 rounded-button text-sm font-medium text-text-link underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus",
329
- children: ["View full lineage", /* @__PURE__ */ d(_e, {
330
+ children: ["View full lineage", /* @__PURE__ */ d(ve, {
330
331
  className: "size-4",
331
332
  "aria-hidden": "true"
332
333
  })]
333
334
  })]
334
- }), Qe && z.nodes.length <= 1 ? /* @__PURE__ */ d(o, { label: "Building lineage…" }) : z.nodes.length <= 1 ? /* @__PURE__ */ d("div", {
335
+ }), et && V.nodes.length <= 1 ? /* @__PURE__ */ d(o, { label: "Building lineage…" }) : V.nodes.length <= 1 ? /* @__PURE__ */ d("div", {
335
336
  className: "rounded-card border border-dashed border-border-default bg-bg-sunken p-6 text-sm text-text-secondary",
336
337
  children: "No upstream or downstream provenance is linked to this dataset yet. Connect a source, run a pipeline, attach a notebook, or publish a release to build its lineage."
337
- }) : /* @__PURE__ */ d(fe, {
338
- model: z,
338
+ }) : /* @__PURE__ */ d(pe, {
339
+ model: V,
339
340
  mode: "compact",
340
341
  onNavigate: E
341
342
  })]
@@ -378,15 +379,15 @@ function E() {
378
379
  variant: "outline",
379
380
  size: "sm",
380
381
  onClick: () => Z(!0),
381
- children: [/* @__PURE__ */ d(Te, { className: "size-4" }), "Add field"]
382
+ children: [/* @__PURE__ */ d(Ee, { className: "size-4" }), "Add field"]
382
383
  })]
383
384
  }), Q.length === 0 ? /* @__PURE__ */ d(a, {
384
385
  icon: p,
385
386
  title: "No schema fields yet.",
386
387
  description: "Describe the columns in this dataset so consumers know what each field means."
387
- }) : /* @__PURE__ */ f(he, { children: [/* @__PURE__ */ d("div", {
388
+ }) : /* @__PURE__ */ f(ge, { children: [/* @__PURE__ */ d("div", {
388
389
  className: "hidden rounded-card border border-border-default bg-bg-elevated md:block",
389
- children: /* @__PURE__ */ f(Be, { children: [/* @__PURE__ */ d(He, { children: /* @__PURE__ */ f(x, { children: [
390
+ children: /* @__PURE__ */ f(Ve, { children: [/* @__PURE__ */ d(Ue, { children: /* @__PURE__ */ f(x, { children: [
390
391
  /* @__PURE__ */ d(b, {
391
392
  className: "w-10 text-right",
392
393
  children: "#"
@@ -396,51 +397,63 @@ function E() {
396
397
  /* @__PURE__ */ d(b, { children: "Unit" }),
397
398
  /* @__PURE__ */ d(b, { children: "Nullable" }),
398
399
  /* @__PURE__ */ d(b, { children: "Provenance" })
399
- ] }) }), /* @__PURE__ */ d(Ve, { children: Q.map((e, t) => /* @__PURE__ */ f(x, { children: [
400
- /* @__PURE__ */ d(y, {
401
- className: "text-right text-xs tabular-nums text-text-tertiary",
402
- children: t + 1
403
- }),
404
- /* @__PURE__ */ f(y, { children: [/* @__PURE__ */ d("span", {
405
- className: "font-medium text-text-primary",
406
- children: e.name
407
- }), e.description ? /* @__PURE__ */ d("p", {
408
- className: "mt-0.5 line-clamp-1 max-w-xs text-xs text-text-secondary",
409
- children: e.description
410
- }) : null] }),
411
- /* @__PURE__ */ d(y, { children: /* @__PURE__ */ d(h, {
412
- variant: "secondary",
413
- children: l(e.fieldType)
414
- }) }),
415
- /* @__PURE__ */ d(y, {
416
- className: "text-sm text-text-secondary",
417
- children: e.unit ? e.unit : C(e) ? /* @__PURE__ */ f("span", {
418
- className: "inline-flex items-center gap-1 text-status-warning-text",
419
- title: `${l(e.fieldType)} fields carry a measured quantity — record the unit so consumers can interpret the values.`,
420
- children: [/* @__PURE__ */ d(m, {
421
- className: "size-3.5",
422
- "aria-hidden": "true"
423
- }), "Not set"]
424
- }) : "—"
425
- }),
426
- /* @__PURE__ */ d(y, {
427
- className: "text-sm text-text-secondary",
428
- children: e.nullable ? "Yes" : "No"
429
- }),
430
- /* @__PURE__ */ d(y, {
431
- className: "text-sm text-text-secondary",
432
- children: e.provenance || "—"
433
- })
434
- ] }, e.id)) })] })
400
+ ] }) }), /* @__PURE__ */ d(He, { children: Q.map((e, t) => /* @__PURE__ */ f(x, {
401
+ "aria-selected": D === e.id,
402
+ "data-state": D === e.id ? "selected" : void 0,
403
+ className: D === e.id ? "bg-bg-sunken" : void 0,
404
+ children: [
405
+ /* @__PURE__ */ d(y, {
406
+ className: "text-right text-xs tabular-nums text-text-tertiary",
407
+ children: t + 1
408
+ }),
409
+ /* @__PURE__ */ f(y, { children: [/* @__PURE__ */ d("button", {
410
+ type: "button",
411
+ onClick: () => O(e.id),
412
+ "aria-pressed": D === e.id,
413
+ className: "text-left font-medium text-text-primary underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus",
414
+ children: e.name
415
+ }), e.description ? /* @__PURE__ */ d("p", {
416
+ className: "mt-0.5 line-clamp-1 max-w-xs text-xs text-text-secondary",
417
+ children: e.description
418
+ }) : null] }),
419
+ /* @__PURE__ */ d(y, { children: /* @__PURE__ */ d(h, {
420
+ variant: "secondary",
421
+ children: l(e.fieldType)
422
+ }) }),
423
+ /* @__PURE__ */ d(y, {
424
+ className: "text-sm text-text-secondary",
425
+ children: e.unit ? e.unit : C(e) ? /* @__PURE__ */ f("span", {
426
+ className: "inline-flex items-center gap-1 text-status-warning-text",
427
+ title: `${l(e.fieldType)} fields carry a measured quantity — record the unit so consumers can interpret the values.`,
428
+ children: [/* @__PURE__ */ d(m, {
429
+ className: "size-3.5",
430
+ "aria-hidden": "true"
431
+ }), "Not set"]
432
+ }) : "—"
433
+ }),
434
+ /* @__PURE__ */ d(y, {
435
+ className: "text-sm text-text-secondary",
436
+ children: e.nullable ? "Yes" : "No"
437
+ }),
438
+ /* @__PURE__ */ d(y, {
439
+ className: "text-sm text-text-secondary",
440
+ children: e.provenance || "—"
441
+ })
442
+ ]
443
+ }, e.id)) })] })
435
444
  }), /* @__PURE__ */ d("div", {
436
445
  className: "space-y-2 md:hidden",
437
446
  children: Q.map((e) => /* @__PURE__ */ f("div", {
438
- className: "rounded-card border border-border-default bg-bg-elevated p-3",
447
+ "aria-current": D === e.id ? "true" : void 0,
448
+ className: D === e.id ? "rounded-card border border-border-focus bg-bg-sunken p-3" : "rounded-card border border-border-default bg-bg-elevated p-3",
439
449
  children: [
440
450
  /* @__PURE__ */ f("div", {
441
451
  className: "flex items-start justify-between gap-2",
442
- children: [/* @__PURE__ */ d("span", {
443
- className: "font-medium text-text-primary",
452
+ children: [/* @__PURE__ */ d("button", {
453
+ type: "button",
454
+ onClick: () => O(e.id),
455
+ "aria-pressed": D === e.id,
456
+ className: "text-left font-medium text-text-primary underline-offset-2 hover:underline",
444
457
  children: e.name
445
458
  }), /* @__PURE__ */ d(h, {
446
459
  variant: "secondary",
@@ -493,17 +506,17 @@ function E() {
493
506
  /* @__PURE__ */ f("section", {
494
507
  className: "space-y-3 rounded-card border border-border-default bg-bg-elevated p-5",
495
508
  children: [/* @__PURE__ */ d(ue, {
496
- value: B,
497
- onChange: V,
509
+ value: H,
510
+ onChange: U,
498
511
  label: "Dataset tags"
499
- }), tt ? /* @__PURE__ */ d("div", {
512
+ }), rt ? /* @__PURE__ */ d("div", {
500
513
  className: "flex justify-end",
501
514
  children: /* @__PURE__ */ d(g, {
502
515
  type: "button",
503
516
  size: "sm",
504
- onClick: () => void ft(),
505
- disabled: M,
506
- children: M ? "Saving…" : "Save tags"
517
+ onClick: () => void gt(),
518
+ disabled: P,
519
+ children: P ? "Saving…" : "Save tags"
507
520
  })
508
521
  }) : null]
509
522
  }),
@@ -511,7 +524,7 @@ function E() {
511
524
  className: "space-y-3",
512
525
  children: [/* @__PURE__ */ f("div", {
513
526
  className: "flex items-center gap-2",
514
- children: [/* @__PURE__ */ d(Se, {
527
+ children: [/* @__PURE__ */ d(Ce, {
515
528
  className: "size-5 text-text-secondary",
516
529
  "aria-hidden": "true"
517
530
  }), /* @__PURE__ */ d("h2", {
@@ -519,7 +532,7 @@ function E() {
519
532
  children: "Activity"
520
533
  })]
521
534
  }), /* @__PURE__ */ d(ce, {
522
- resourceId: k.id,
535
+ resourceId: j.id,
523
536
  resourceType: "cosmicintersection-dataset"
524
537
  })]
525
538
  }),
@@ -527,7 +540,7 @@ function E() {
527
540
  className: "space-y-3",
528
541
  children: [/* @__PURE__ */ f("div", {
529
542
  className: "flex items-center gap-2",
530
- children: [/* @__PURE__ */ d(Ce, {
543
+ children: [/* @__PURE__ */ d(we, {
531
544
  className: "size-5 text-text-secondary",
532
545
  "aria-hidden": "true"
533
546
  }), /* @__PURE__ */ d("h2", {
@@ -536,19 +549,19 @@ function E() {
536
549
  })]
537
550
  }), /* @__PURE__ */ d(le, {
538
551
  entityType: "cosmicintersection-dataset",
539
- entityId: k.id,
540
- title: k.name,
552
+ entityId: j.id,
553
+ title: j.name,
541
554
  widgetKey: "dataset-discussion"
542
555
  })]
543
556
  })
544
557
  ]
545
- }), /* @__PURE__ */ d(ke, {
546
- open: nt,
558
+ }), /* @__PURE__ */ d(Ae, {
559
+ open: it,
547
560
  onOpenChange: Z,
548
- children: /* @__PURE__ */ f(Ae, { children: [
549
- /* @__PURE__ */ f(Ne, { children: [/* @__PURE__ */ d(Pe, { children: "Add schema field" }), /* @__PURE__ */ f(je, { children: [
561
+ children: /* @__PURE__ */ f(je, { children: [
562
+ /* @__PURE__ */ f(Pe, { children: [/* @__PURE__ */ d(Fe, { children: "Add schema field" }), /* @__PURE__ */ f(Me, { children: [
550
563
  "Document a column in “",
551
- k.name,
564
+ j.name,
552
565
  "” — its type, unit and provenance."
553
566
  ] })] }),
554
567
  /* @__PURE__ */ f("div", {
@@ -561,8 +574,8 @@ function E() {
561
574
  children: "Name"
562
575
  }), /* @__PURE__ */ d(_, {
563
576
  id: "cos-field-name",
564
- value: U,
565
- onChange: (e) => W(e.target.value),
577
+ value: G,
578
+ onChange: (e) => K(e.target.value),
566
579
  placeholder: "e.g. right_ascension",
567
580
  required: !0
568
581
  })]
@@ -574,14 +587,14 @@ function E() {
574
587
  children: [/* @__PURE__ */ d(v, {
575
588
  htmlFor: "cos-field-type",
576
589
  children: "Type"
577
- }), /* @__PURE__ */ f(Fe, {
578
- value: G,
579
- onValueChange: (e) => K(e),
580
- children: [/* @__PURE__ */ d(Re, {
590
+ }), /* @__PURE__ */ f(Ie, {
591
+ value: q,
592
+ onValueChange: (e) => J(e),
593
+ children: [/* @__PURE__ */ d(ze, {
581
594
  id: "cos-field-type",
582
595
  "aria-label": "Field type",
583
- children: /* @__PURE__ */ d(ze, {})
584
- }), /* @__PURE__ */ d(Ie, { children: We.map((e) => /* @__PURE__ */ d(Le, {
596
+ children: /* @__PURE__ */ d(Be, {})
597
+ }), /* @__PURE__ */ d(Le, { children: Ge.map((e) => /* @__PURE__ */ d(Re, {
585
598
  value: e,
586
599
  children: l(e)
587
600
  }, e)) })]
@@ -593,8 +606,8 @@ function E() {
593
606
  children: "Unit"
594
607
  }), /* @__PURE__ */ d(_, {
595
608
  id: "cos-field-unit",
596
- value: q,
597
- onChange: (e) => J(e.target.value),
609
+ value: Y,
610
+ onChange: (e) => ot(e.target.value),
598
611
  placeholder: "e.g. deg, mag, Jy"
599
612
  })]
600
613
  })]
@@ -604,10 +617,10 @@ function E() {
604
617
  children: [/* @__PURE__ */ d(v, {
605
618
  htmlFor: "cos-field-desc",
606
619
  children: "Description"
607
- }), /* @__PURE__ */ d(Ue, {
620
+ }), /* @__PURE__ */ d(We, {
608
621
  id: "cos-field-desc",
609
- value: Y,
610
- onChange: (e) => it(e.target.value),
622
+ value: st,
623
+ onChange: (e) => X(e.target.value),
611
624
  rows: 2
612
625
  })]
613
626
  }),
@@ -618,31 +631,31 @@ function E() {
618
631
  children: "Provenance"
619
632
  }), /* @__PURE__ */ d(_, {
620
633
  id: "cos-field-prov",
621
- value: X,
622
- onChange: (e) => at(e.target.value),
634
+ value: ct,
635
+ onChange: (e) => lt(e.target.value),
623
636
  placeholder: "Where this field comes from"
624
637
  })]
625
638
  }),
626
639
  /* @__PURE__ */ f("label", {
627
640
  className: "flex items-center gap-2 text-sm text-text-primary",
628
- children: [/* @__PURE__ */ d(Oe, {
629
- checked: ot,
630
- onCheckedChange: (e) => st(e === !0)
641
+ children: [/* @__PURE__ */ d(ke, {
642
+ checked: ut,
643
+ onCheckedChange: (e) => dt(e === !0)
631
644
  }), "Nullable (may contain empty values)"]
632
645
  })
633
646
  ]
634
647
  }),
635
- /* @__PURE__ */ f(Me, { children: [/* @__PURE__ */ d(g, {
648
+ /* @__PURE__ */ f(Ne, { children: [/* @__PURE__ */ d(g, {
636
649
  type: "button",
637
650
  variant: "outline",
638
651
  onClick: () => Z(!1),
639
- disabled: N,
652
+ disabled: F,
640
653
  children: "Cancel"
641
654
  }), /* @__PURE__ */ d(g, {
642
655
  type: "button",
643
- onClick: () => void pt(),
644
- disabled: N,
645
- children: N ? "Adding…" : "Add field"
656
+ onClick: () => void _t(),
657
+ disabled: F,
658
+ children: F ? "Adding…" : "Add field"
646
659
  })] })
647
660
  ] })
648
661
  })]