@altertable/data-app 0.69.0 → 0.70.0

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 (107) hide show
  1. package/AGENTS.md +4 -0
  2. package/dist/chunks/{index-m0gbxtgp.js → index-2ajhmsc4.js} +3 -3
  3. package/dist/chunks/{index-m0gbxtgp.js.map → index-2ajhmsc4.js.map} +1 -1
  4. package/dist/chunks/{index-2sbp9h2b.js → index-58kks6a8.js} +1 -1
  5. package/dist/chunks/{index-2sbp9h2b.js.map → index-58kks6a8.js.map} +2 -2
  6. package/dist/chunks/{index-ap60vggk.js → index-7q99hf1z.js} +18 -11
  7. package/dist/chunks/index-7q99hf1z.js.map +10 -0
  8. package/dist/chunks/{index-kwnqycjt.js → index-9zqbrv2z.js} +7 -3
  9. package/dist/chunks/index-9zqbrv2z.js.map +10 -0
  10. package/dist/chunks/{index-k766wwwr.js → index-q1w84fv9.js} +167 -24
  11. package/dist/chunks/index-q1w84fv9.js.map +15 -0
  12. package/dist/chunks/{index-zcqxfwdq.js → index-rew95tbg.js} +85 -10
  13. package/dist/chunks/index-rew95tbg.js.map +13 -0
  14. package/dist/chunks/{index-qhzdzca2.js → index-vtpygsbq.js} +2392 -991
  15. package/dist/chunks/index-vtpygsbq.js.map +126 -0
  16. package/dist/chunks/{index-r7b1ftwy.js → index-wjt6cavj.js} +5 -3
  17. package/dist/chunks/index-wjt6cavj.js.map +10 -0
  18. package/dist/chunks/{index-sx488hvs.js → index-xzb7sx6g.js} +3 -3
  19. package/dist/client/index.js +5 -5
  20. package/dist/core/config.js +2 -2
  21. package/dist/core/contract.js +6 -6
  22. package/dist/core/contract.js.map +1 -1
  23. package/dist/embed/index.js +5 -5
  24. package/dist/index.js +2 -2
  25. package/dist/local.js +35 -2
  26. package/dist/local.js.map +8 -6
  27. package/dist/preview.js +15 -15
  28. package/dist/preview.js.map +6 -6
  29. package/dist/react/embed/index.js +1 -1
  30. package/dist/react/index.js +273 -331
  31. package/dist/react/index.js.map +5 -8
  32. package/dist/react/ui/index.js +874 -502
  33. package/dist/react/ui/index.js.map +24 -23
  34. package/dist/server.js +35 -2
  35. package/dist/server.js.map +8 -6
  36. package/dist/types/client/data-client.d.ts +21 -10
  37. package/dist/types/core/config.d.ts +20 -17
  38. package/dist/types/core/contract.d.ts +23 -13
  39. package/dist/types/core/dimension-source.d.ts +64 -0
  40. package/dist/types/core/dimension.d.ts +31 -23
  41. package/dist/types/core/facets.d.ts +13 -0
  42. package/dist/types/core/keys.d.ts +2 -0
  43. package/dist/types/core/operation-types.d.ts +6 -5
  44. package/dist/types/core/queries.d.ts +75 -7
  45. package/dist/types/core/variables.d.ts +38 -12
  46. package/dist/types/embed/sql.d.ts +1 -1
  47. package/dist/types/index.d.ts +1 -1
  48. package/dist/types/react/actions.d.ts +53 -0
  49. package/dist/types/react/bindings.d.ts +36 -0
  50. package/dist/types/react/details.d.ts +46 -0
  51. package/dist/types/react/exploration.d.ts +44 -0
  52. package/dist/types/react/hooks.d.ts +76 -38
  53. package/dist/types/react/index.d.ts +3 -0
  54. package/dist/types/react/style-contract.d.ts +1 -1
  55. package/dist/types/react/ui/AboutData.d.ts +9 -4
  56. package/dist/types/react/ui/AreaChart.d.ts +2 -2
  57. package/dist/types/react/ui/BarChart.d.ts +2 -2
  58. package/dist/types/react/ui/Button.d.ts +2 -1
  59. package/dist/types/react/ui/ComposedChartLegend.d.ts +2 -1
  60. package/dist/types/react/ui/DataApp.d.ts +3 -0
  61. package/dist/types/react/ui/DataWidget.d.ts +3 -0
  62. package/dist/types/react/ui/DimensionPicker.d.ts +2 -2
  63. package/dist/types/react/ui/ExplorationActionControl.d.ts +60 -0
  64. package/dist/types/react/ui/InspectionProvider.d.ts +2 -2
  65. package/dist/types/react/ui/LineChart.d.ts +2 -2
  66. package/dist/types/react/ui/Menu.d.ts +3 -2
  67. package/dist/types/react/ui/MetricWidget.d.ts +2 -0
  68. package/dist/types/react/ui/PickerField.d.ts +9 -1
  69. package/dist/types/react/ui/PieChart.d.ts +2 -2
  70. package/dist/types/react/ui/Select.d.ts +5 -1
  71. package/dist/types/react/ui/Sheet.d.ts +1 -1
  72. package/dist/types/react/ui/TrendChart.d.ts +3 -3
  73. package/dist/types/react/ui/VisualizationWidget.d.ts +1 -1
  74. package/dist/types/react/ui/chart-data.d.ts +8 -6
  75. package/dist/types/react/ui/chart-date-axis.d.ts +1 -1
  76. package/dist/types/react/ui/chart-interaction.d.ts +15 -9
  77. package/dist/types/react/ui/chart-time.d.ts +8 -5
  78. package/dist/types/react/ui/icons.d.ts +2 -0
  79. package/dist/types/react/ui/index.d.ts +2 -0
  80. package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +2 -0
  81. package/dist/types/react/view-control-bar.d.ts +6 -4
  82. package/dist/types/react/view-runtime.d.ts +5 -2
  83. package/dist/types/react/view.d.ts +15 -6
  84. package/dist/types/react/widgets.d.ts +22 -11
  85. package/dist/worker.js +1 -1
  86. package/docs/app-authoring.md +10 -3
  87. package/docs/client.md +5 -6
  88. package/docs/composition.md +84 -0
  89. package/docs/contract.md +41 -21
  90. package/docs/data-context.md +2 -0
  91. package/docs/server.md +1 -1
  92. package/docs/styling.md +4 -0
  93. package/docs/ui.md +12 -1
  94. package/docs/variables.md +83 -11
  95. package/docs/views.md +56 -2
  96. package/docs/widgets.md +93 -0
  97. package/examples/starter-data-app/index.tsx +10 -22
  98. package/examples/starter-local-data-app/app.ts +7 -1
  99. package/examples/starter-local-data-app/tsconfig.json +7 -1
  100. package/package.json +1 -1
  101. package/dist/chunks/index-ap60vggk.js.map +0 -10
  102. package/dist/chunks/index-k766wwwr.js.map +0 -13
  103. package/dist/chunks/index-kwnqycjt.js.map +0 -10
  104. package/dist/chunks/index-qhzdzca2.js.map +0 -118
  105. package/dist/chunks/index-r7b1ftwy.js.map +0 -10
  106. package/dist/chunks/index-zcqxfwdq.js.map +0 -13
  107. /package/dist/chunks/{index-sx488hvs.js.map → index-xzb7sx6g.js.map} +0 -0
@@ -16,13 +16,22 @@ import {
16
16
  InspectionContext,
17
17
  useInspectionDefaults,
18
18
  mountDataApp2,
19
+ breakdownState,
19
20
  useDeclaredResult,
20
21
  PrimaryViewContext,
21
22
  ownedSource,
23
+ DataSectionBoundary,
24
+ DetailView2,
25
+ DetailContent2,
26
+ useDetailNavigation2,
27
+ DetailRoutes,
28
+ resolveActions,
22
29
  DateTimeTooltip2,
23
30
  DateDisplay2,
31
+ RegisteredBinding,
24
32
  registeredEvidence,
25
33
  datasetTable,
34
+ MetricRecords,
26
35
  exportDatasets,
27
36
  searchVariable2,
28
37
  choiceVariable2,
@@ -30,6 +39,7 @@ import {
30
39
  dateRangeVariable2,
31
40
  sectionContent,
32
41
  SearchSuggestionsContext,
42
+ Select2,
33
43
  Skeleton2,
34
44
  createDataHooks2,
35
45
  useDataAppAnnotations2,
@@ -38,6 +48,7 @@ import {
38
48
  TextContent2,
39
49
  Stack2,
40
50
  DataAppFrame,
51
+ ExplorationActionControl2,
41
52
  getAnnotationProps,
42
53
  ContentSkeleton,
43
54
  VisualizationWidget2,
@@ -50,7 +61,7 @@ import {
50
61
  chartColor2,
51
62
  createDataContext2,
52
63
  SectionHeading2
53
- } from "../chunks/index-qhzdzca2.js";
64
+ } from "../chunks/index-vtpygsbq.js";
54
65
  import {
55
66
  parseDateTime2,
56
67
  formatDateTime2,
@@ -60,17 +71,15 @@ import {
60
71
  formatPercent2
61
72
  } from "../chunks/index-22d576sn.js";
62
73
  import {
74
+ KEY_SEPARATOR,
63
75
  parseDataAppAnnotationDraft2
64
- } from "../chunks/index-k766wwwr.js";
65
- import"../chunks/index-kwnqycjt.js";
76
+ } from "../chunks/index-q1w84fv9.js";
77
+ import"../chunks/index-9zqbrv2z.js";
66
78
  import"../chunks/index-cv36cyna.js";
67
- import"../chunks/index-sx488hvs.js";
68
- import {
69
- DataAppError2
70
- } from "../chunks/index-2sbp9h2b.js";
79
+ import"../chunks/index-xzb7sx6g.js";
71
80
  import {
72
81
  invariant
73
- } from "../chunks/index-zcqxfwdq.js";
82
+ } from "../chunks/index-rew95tbg.js";
74
83
  // src/react/ui/DataApp.tsx
75
84
  import { jsx } from "react/jsx-runtime";
76
85
  function DataApp(props) {
@@ -79,6 +88,8 @@ function DataApp(props) {
79
88
  datasets,
80
89
  story,
81
90
  showSearchSuggestions = true,
91
+ details = [],
92
+ children,
82
93
  ...frame
83
94
  } = props;
84
95
  const app = useDataApp();
@@ -91,7 +102,7 @@ function DataApp(props) {
91
102
  return [
92
103
  reading.loading ? [] : reading.value.map((item) => ({
93
104
  ...item,
94
- id: `${index}:${item.id}`
105
+ id: [index, item.id].join(KEY_SEPARATOR)
95
106
  }))
96
107
  ];
97
108
  }) : [];
@@ -104,15 +115,19 @@ function DataApp(props) {
104
115
  } : null,
105
116
  children: /* @__PURE__ */ jsx(PrimaryViewContext, {
106
117
  value: { declaration: view, result },
107
- children: /* @__PURE__ */ jsx(DataAppFrame, {
108
- ...frame,
109
- request: result,
110
- dataContext: result.dataContext,
111
- story: (snapshot) => story(ownedSource(view, snapshot)).map((finding) => ({
112
- ...finding,
113
- evidence: registeredEvidence(finding.evidence, view)
114
- })),
115
- csvExport: (snapshot) => exportDatasets(datasets, ownedSource(view, snapshot), view.scope(snapshot), app.title)
118
+ children: /* @__PURE__ */ jsx(DetailRoutes, {
119
+ details,
120
+ children: /* @__PURE__ */ jsx(DataAppFrame, {
121
+ ...frame,
122
+ request: result,
123
+ dataContext: result.dataContext,
124
+ story: (snapshot) => story(ownedSource(view, snapshot)).map((finding) => ({
125
+ ...finding,
126
+ evidence: registeredEvidence(finding.evidence, view)
127
+ })),
128
+ csvExport: (snapshot) => exportDatasets(datasets, ownedSource(view, snapshot), view.scope(snapshot), app.title),
129
+ children
130
+ })
116
131
  })
117
132
  })
118
133
  })
@@ -155,45 +170,138 @@ function GridItem({
155
170
  });
156
171
  }
157
172
  // src/react/widgets.tsx
158
- import { jsx as jsx4 } from "react/jsx-runtime";
173
+ import { useEffect, useRef, useState } from "react";
174
+ import { jsx as jsx4, jsxs, Fragment } from "react/jsx-runtime";
159
175
  function MetricWidget({
160
176
  metric,
161
177
  source,
178
+ records,
179
+ actions,
180
+ action,
162
181
  ...presentation
163
182
  }) {
183
+ const navigation = useDetailNavigation2();
184
+ const itemActions = resolveActions(actions, metric, RegisteredBinding.owner(metric), source, (target, input, trigger) => navigation.open(target, input, trigger));
185
+ const [widgetElement, setWidgetElement] = useState(null);
186
+ const availableActions = itemActions(undefined);
164
187
  return /* @__PURE__ */ jsx4(MetricWidget2, {
165
188
  ...presentation,
189
+ ref: setWidgetElement,
166
190
  metric: metric.definition,
167
- reading: metric.read(source)
191
+ reading: metric.read(source),
192
+ action: action || availableActions.length ? /* @__PURE__ */ jsxs(Fragment, {
193
+ children: [
194
+ action,
195
+ /* @__PURE__ */ jsx4(ExplorationActionControl2, {
196
+ actions: availableActions,
197
+ ariaLabel: metric.definition.label
198
+ })
199
+ ]
200
+ }) : undefined,
201
+ records: records ? MetricRecords.render(records, metric, source, {
202
+ open(target, input) {
203
+ navigation.open(target, input, widgetElement?.querySelector("header button"));
204
+ }
205
+ }) : undefined
168
206
  });
169
207
  }
170
208
  function TableWidget({
171
209
  dataset,
172
210
  source,
173
211
  title,
212
+ actions,
174
213
  ...presentation
175
214
  }) {
176
215
  const data = datasetTable(dataset, source);
216
+ const navigation = useDetailNavigation2();
217
+ const itemActions = resolveActions(actions, dataset, RegisteredBinding.owner(dataset), source, (target, input, trigger) => navigation.open(target, input, trigger));
218
+ const hasRowActions = actions && (data.reading.loading || data.reading.value.some((row) => itemActions(row).length > 0));
177
219
  return /* @__PURE__ */ jsx4(TableWidget2, {
178
220
  ...presentation,
179
221
  ...data,
180
- title: title ?? data.title
222
+ title: title ?? data.title,
223
+ columns: hasRowActions ? [
224
+ ...data.columns,
225
+ {
226
+ id: "$exploration-actions",
227
+ header: "Actions",
228
+ cell: (row) => /* @__PURE__ */ jsx4(ExplorationActionControl2, {
229
+ actions: itemActions(row),
230
+ ariaLabel: `${data.title}: ${data.rowKey(row)}`
231
+ })
232
+ }
233
+ ] : data.columns
181
234
  });
182
235
  }
183
236
  function VisualizationWidget({
184
237
  dataset,
185
238
  source,
186
239
  title,
240
+ actions,
241
+ breakdown,
242
+ children,
243
+ views,
244
+ viewLabel,
245
+ initialView,
187
246
  ...presentation
188
247
  }) {
189
248
  const data = datasetTable(dataset, source);
190
- return /* @__PURE__ */ jsx4(VisualizationWidget2, {
249
+ const navigation = useDetailNavigation2();
250
+ const itemActions = resolveActions(actions, dataset, RegisteredBinding.owner(dataset), source, (target, input, trigger) => navigation.open(target, input, trigger));
251
+ const state = breakdown && breakdownState(breakdown, RegisteredBinding.owner(dataset));
252
+ const controlRef = useRef(null);
253
+ const recoverFocus = useRef(false);
254
+ useEffect(() => {
255
+ if (recoverFocus.current) {
256
+ recoverFocus.current = false;
257
+ controlRef.current?.querySelector("button")?.focus();
258
+ }
259
+ }, [state?.value]);
260
+ function resolvedActions(row) {
261
+ return itemActions(row).map((action) => ({
262
+ ...action,
263
+ onSelect(trigger) {
264
+ recoverFocus.current = true;
265
+ action.onSelect(trigger);
266
+ }
267
+ }));
268
+ }
269
+ const action = state ? /* @__PURE__ */ jsx4("div", {
270
+ ref: controlRef,
271
+ children: /* @__PURE__ */ jsx4(Select2, {
272
+ label: state.variable.label ?? "Break down by",
273
+ labelPlacement: "inline",
274
+ icon: "breakdown",
275
+ size: "compact",
276
+ align: "end",
277
+ options: state.options.map((level) => ({
278
+ id: level.id,
279
+ label: level.label
280
+ })),
281
+ value: state.value,
282
+ onChange: (id) => state.set(id)
283
+ })
284
+ }) : presentation.action;
285
+ const common = {
191
286
  ...presentation,
287
+ action,
192
288
  title: title ?? data.title,
193
289
  reading: data.reading,
194
290
  evidence: data.evidence,
195
291
  emptyFallback: data.emptyFallback,
196
292
  isEmpty: (rows) => rows.length === 0
293
+ };
294
+ return children ? /* @__PURE__ */ jsx4(VisualizationWidget2, {
295
+ ...common,
296
+ children: (rows) => children(rows, resolvedActions)
297
+ }) : /* @__PURE__ */ jsx4(VisualizationWidget2, {
298
+ ...common,
299
+ views: views.map((view) => ({
300
+ ...view,
301
+ render: (rows) => view.render(rows, resolvedActions)
302
+ })),
303
+ viewLabel,
304
+ initialView
197
305
  });
198
306
  }
199
307
  function TextWidget(props) {
@@ -267,7 +375,7 @@ function DataValue(props) {
267
375
  });
268
376
  }
269
377
  // src/react/ui/Breakdown.tsx
270
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
378
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
271
379
  function Breakdown({
272
380
  total,
273
381
  items,
@@ -277,18 +385,18 @@ function Breakdown({
277
385
  }) {
278
386
  invariant(Number.isFinite(total) && total >= 0 && items.every((item) => Number.isFinite(item.value) && item.value >= 0) && items.reduce((sum, item) => sum + item.value, 0) <= total, "Breakdown items must be nonnegative parts of the observed total.");
279
387
  const dominant = total > 0 && items.some((item) => item.value / total >= 0.85);
280
- return /* @__PURE__ */ jsxs("div", {
388
+ return /* @__PURE__ */ jsxs2("div", {
281
389
  ...props,
282
390
  className: classNames("altertable-breakdown", className),
283
391
  "data-dominant": dominant || undefined,
284
392
  children: [
285
- /* @__PURE__ */ jsxs("div", {
393
+ /* @__PURE__ */ jsxs2("div", {
286
394
  className: "altertable-breakdown-summary",
287
395
  children: [
288
396
  /* @__PURE__ */ jsx5("span", {
289
397
  children: "Share of total"
290
398
  }),
291
- /* @__PURE__ */ jsxs("strong", {
399
+ /* @__PURE__ */ jsxs2("strong", {
292
400
  children: [
293
401
  formatValue(total),
294
402
  " total"
@@ -313,12 +421,12 @@ function Breakdown({
313
421
  const color = {
314
422
  "--altertable-breakdown-color": chartColor2(item.id)
315
423
  };
316
- return /* @__PURE__ */ jsxs("div", {
424
+ return /* @__PURE__ */ jsxs2("div", {
317
425
  className: "altertable-breakdown-row",
318
426
  "data-empty": item.value === 0 || undefined,
319
427
  style: color,
320
428
  children: [
321
- /* @__PURE__ */ jsxs("dt", {
429
+ /* @__PURE__ */ jsxs2("dt", {
322
430
  children: [
323
431
  /* @__PURE__ */ jsx5("span", {
324
432
  className: "altertable-breakdown-swatch",
@@ -343,7 +451,7 @@ function Breakdown({
343
451
  });
344
452
  }
345
453
  // src/react/ui/Ranking.tsx
346
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
454
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
347
455
  function Ranking({
348
456
  items,
349
457
  formatValue = formatCount2,
@@ -355,9 +463,9 @@ function Ranking({
355
463
  return /* @__PURE__ */ jsx6("ol", {
356
464
  ...props,
357
465
  className: classNames("altertable-ranking", className),
358
- children: items.map((item) => /* @__PURE__ */ jsxs2("li", {
466
+ children: items.map((item) => /* @__PURE__ */ jsxs3("li", {
359
467
  children: [
360
- /* @__PURE__ */ jsxs2("div", {
468
+ /* @__PURE__ */ jsxs3("div", {
361
469
  className: "altertable-ranking-reading",
362
470
  children: [
363
471
  /* @__PURE__ */ jsx6("span", {
@@ -384,7 +492,7 @@ function Ranking({
384
492
  });
385
493
  }
386
494
  // src/react/ui/Comparison.tsx
387
- import { jsx as jsx7, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
495
+ import { jsx as jsx7, jsxs as jsxs4, Fragment as Fragment2 } from "react/jsx-runtime";
388
496
  function Comparison(props) {
389
497
  const dateFormatting = useDateFormatting2();
390
498
  if ("metric" in props) {
@@ -418,7 +526,7 @@ function ComparisonContent({
418
526
  previous,
419
527
  favorableDirection
420
528
  });
421
- return /* @__PURE__ */ jsxs3("figure", {
529
+ return /* @__PURE__ */ jsxs4("figure", {
422
530
  className: "altertable-comparison-visual",
423
531
  "data-emphasis": emphasis,
424
532
  "aria-label": `${label} comparison`,
@@ -426,11 +534,11 @@ function ComparisonContent({
426
534
  /* @__PURE__ */ jsx7("figcaption", {
427
535
  children: label
428
536
  }),
429
- /* @__PURE__ */ jsxs3("div", {
537
+ /* @__PURE__ */ jsxs4("div", {
430
538
  className: "altertable-comparison-row",
431
539
  "data-period": "current",
432
540
  children: [
433
- /* @__PURE__ */ jsxs3("div", {
541
+ /* @__PURE__ */ jsxs4("div", {
434
542
  children: [
435
543
  /* @__PURE__ */ jsx7("span", {
436
544
  children: current.periodLabel ?? "Current period"
@@ -448,11 +556,11 @@ function ComparisonContent({
448
556
  })
449
557
  ]
450
558
  }),
451
- previous && /* @__PURE__ */ jsxs3("div", {
559
+ previous && /* @__PURE__ */ jsxs4("div", {
452
560
  className: "altertable-comparison-row",
453
561
  "data-period": "previous",
454
562
  children: [
455
- /* @__PURE__ */ jsxs3("div", {
563
+ /* @__PURE__ */ jsxs4("div", {
456
564
  children: [
457
565
  /* @__PURE__ */ jsx7("span", {
458
566
  children: previous.periodLabel ?? "Previous period"
@@ -473,7 +581,7 @@ function ComparisonContent({
473
581
  /* @__PURE__ */ jsx7("p", {
474
582
  className: "altertable-comparison-change",
475
583
  "data-tone": tone,
476
- children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs3(Fragment, {
584
+ children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs4(Fragment2, {
477
585
  children: [
478
586
  /* @__PURE__ */ jsx7(AppIcon2, {
479
587
  name: icon,
@@ -491,206 +599,7 @@ function ComparisonContent({
491
599
  }
492
600
  // src/react/ui/DataSection.tsx
493
601
  import { useContext } from "react";
494
-
495
- // src/react/ui/DataBoundary.tsx
496
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
497
- function DataBoundary({
498
- view,
499
- loadingFallback,
500
- emptyFallback,
501
- error,
502
- staleError,
503
- notice = "none",
504
- children,
505
- className,
506
- ...props
507
- }) {
508
- if (view.kind === "loading" || view.kind === "empty" || view.kind === "error")
509
- return /* @__PURE__ */ jsx8("div", {
510
- ...props,
511
- className: classNames("altertable-data-boundary", className),
512
- children: view.kind === "loading" ? loadingFallback : view.kind === "empty" ? emptyFallback : error(view.error)
513
- });
514
- const updating = view.kind === "updating";
515
- const hasStaleError = view.kind === "stale-error";
516
- return /* @__PURE__ */ jsxs4("div", {
517
- ...props,
518
- className: classNames("altertable-data-boundary", className),
519
- children: [
520
- notice === "inline" && (updating || hasStaleError) && /* @__PURE__ */ jsxs4("div", {
521
- className: "altertable-data-boundary-notice",
522
- "data-state": view.kind,
523
- role: hasStaleError ? "alert" : "status",
524
- children: [
525
- updating ? /* @__PURE__ */ jsx8(AppIcon2, {
526
- name: "loading",
527
- size: 16,
528
- className: "altertable-data-boundary-spinner"
529
- }) : /* @__PURE__ */ jsx8(AppIcon2, {
530
- name: "error",
531
- size: 16
532
- }),
533
- /* @__PURE__ */ jsx8("span", {
534
- className: "altertable-data-boundary-message",
535
- children: view.message
536
- }),
537
- staleError && view.kind === "stale-error" && /* @__PURE__ */ jsx8("span", {
538
- className: "altertable-data-boundary-action",
539
- children: staleError(view.error)
540
- })
541
- ]
542
- }),
543
- /* @__PURE__ */ jsx8("div", {
544
- className: "altertable-data-boundary-content",
545
- "aria-busy": updating,
546
- children: children(view.data, view.kind === "ready" ? view.input : view.displayedInput)
547
- })
548
- ]
549
- });
550
- }
551
-
552
- // src/react/ui/StatusPanel.tsx
553
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
554
- function StatusPanel({
555
- status,
556
- title,
557
- description,
558
- details,
559
- action,
560
- children,
561
- className,
562
- role,
563
- ...props
564
- }) {
565
- return /* @__PURE__ */ jsxs5("div", {
566
- ...props,
567
- className: classNames("altertable-status-panel", className),
568
- "data-status": status,
569
- role: role ?? (status === "error" ? "alert" : "status"),
570
- children: [
571
- status === "error" && /* @__PURE__ */ jsx9(AppIcon2, {
572
- name: "error",
573
- size: 18
574
- }),
575
- /* @__PURE__ */ jsxs5("div", {
576
- className: "altertable-status-copy",
577
- children: [
578
- /* @__PURE__ */ jsx9("strong", {
579
- children: title
580
- }),
581
- description && /* @__PURE__ */ jsx9("p", {
582
- children: description
583
- }),
584
- details && /* @__PURE__ */ jsx9("small", {
585
- children: details
586
- }),
587
- children
588
- ]
589
- }),
590
- action && /* @__PURE__ */ jsx9("div", {
591
- className: "altertable-status-action",
592
- children: action
593
- })
594
- ]
595
- });
596
- }
597
-
598
- // src/react/ui/DataSectionBoundary.tsx
599
- import { jsx as jsx10 } from "react/jsx-runtime";
600
- function errorPresentation(cause) {
601
- const code = cause instanceof DataAppError2 ? cause.code : "request_failed";
602
- switch (code) {
603
- case "source_unauthorized":
604
- return {
605
- title: "Connection needs attention",
606
- description: "Ask the app owner to reconnect the lakehouse.",
607
- retryable: false
608
- };
609
- case "source_forbidden":
610
- return {
611
- title: "Data access denied",
612
- description: "The selected profile cannot read this data. Ask the app owner for access.",
613
- retryable: false
614
- };
615
- case "source_query_rejected":
616
- return {
617
- title: "Couldn’t load results",
618
- description: "This data app’s query was rejected. Ask the app owner to fix it.",
619
- retryable: false
620
- };
621
- case "source_rate_limited":
622
- return {
623
- title: "Data source is busy",
624
- description: "The lakehouse is handling too many requests.",
625
- retryable: true
626
- };
627
- case "timeout":
628
- return {
629
- title: "Request timed out",
630
- description: "The lakehouse took too long to respond.",
631
- retryable: true
632
- };
633
- case "source_unavailable":
634
- return {
635
- title: "Couldn’t load results",
636
- description: "The lakehouse isn’t responding.",
637
- retryable: true
638
- };
639
- default:
640
- return {
641
- title: "Couldn’t load results",
642
- description: "The data request failed.",
643
- retryable: true
644
- };
645
- }
646
- }
647
- function DataSectionBoundary({
648
- result,
649
- children,
650
- emptyFallback,
651
- loadingFallback,
652
- error,
653
- label,
654
- notice: feedback,
655
- ...props
656
- }) {
657
- const fallback = emptyFallback ?? ("emptyFallback" in result ? result.emptyFallback : undefined);
658
- invariant(fallback, "A section needs an empty fallback from its result or props.");
659
- const defaults = useInspectionDefaults();
660
- const notice = feedback ?? (defaults?.primaryView === result.view ? "none" : "inline");
661
- return /* @__PURE__ */ jsx10(DataBoundary, {
662
- ...props,
663
- view: result.view,
664
- role: label ? "region" : undefined,
665
- "aria-label": label,
666
- notice,
667
- loadingFallback,
668
- emptyFallback: /* @__PURE__ */ jsx10(EmptyState2, {
669
- ...fallback
670
- }),
671
- error: (cause) => {
672
- const presentation = errorPresentation(cause);
673
- const retryAction = error?.onRetry ?? (presentation.retryable ? () => void result.refetch() : undefined);
674
- return /* @__PURE__ */ jsx10(StatusPanel, {
675
- status: "error",
676
- title: error?.title ?? presentation.title,
677
- description: error?.description ?? presentation.description,
678
- action: retryAction && /* @__PURE__ */ jsx10(Button2, {
679
- onClick: retryAction,
680
- children: "Retry"
681
- })
682
- });
683
- },
684
- staleError: () => /* @__PURE__ */ jsx10(Button2, {
685
- onClick: error?.onRetry ?? (() => void result.refetch()),
686
- children: "Retry"
687
- }),
688
- children
689
- });
690
- }
691
-
692
- // src/react/ui/DataSection.tsx
693
- import { jsx as jsx11 } from "react/jsx-runtime";
602
+ import { jsx as jsx8 } from "react/jsx-runtime";
694
603
  function DataSection({
695
604
  content,
696
605
  ...presentation
@@ -699,14 +608,14 @@ function DataSection({
699
608
  const { view, ...section } = sectionContent(content);
700
609
  if (primary?.declaration === view) {
701
610
  const result = primary.result;
702
- return /* @__PURE__ */ jsx11(DataSectionBoundary, {
611
+ return /* @__PURE__ */ jsx8(DataSectionBoundary, {
703
612
  ...section,
704
613
  ...presentation,
705
614
  result,
706
615
  notice: "none"
707
616
  });
708
617
  }
709
- return /* @__PURE__ */ jsx11(IndependentSection, {
618
+ return /* @__PURE__ */ jsx8(IndependentSection, {
710
619
  view,
711
620
  ...section,
712
621
  ...presentation
@@ -718,14 +627,14 @@ function IndependentSection({
718
627
  }) {
719
628
  const result = useDeclaredResult(view);
720
629
  const defaults = useInspectionDefaults();
721
- const section = /* @__PURE__ */ jsx11(DataSectionBoundary, {
630
+ const section = /* @__PURE__ */ jsx8(DataSectionBoundary, {
722
631
  ...props,
723
632
  result,
724
633
  notice: "inline"
725
634
  });
726
- return /* @__PURE__ */ jsx11(DateFormattingContext, {
635
+ return /* @__PURE__ */ jsx8(DateFormattingContext, {
727
636
  value: { timeZone: result.timeZone },
728
- children: /* @__PURE__ */ jsx11(InspectionContext, {
637
+ children: /* @__PURE__ */ jsx8(InspectionContext, {
729
638
  value: {
730
639
  ...defaults,
731
640
  dataContext: result.dataContext,
@@ -736,8 +645,8 @@ function IndependentSection({
736
645
  });
737
646
  }
738
647
  // src/react/ui/UpdatedAt.tsx
739
- import { useEffect, useState } from "react";
740
- import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
648
+ import { useEffect as useEffect2, useState as useState2 } from "react";
649
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
741
650
  function UpdatedAt({
742
651
  timestamp,
743
652
  locale,
@@ -747,8 +656,8 @@ function UpdatedAt({
747
656
  ...props
748
657
  }) {
749
658
  const defaults = useDateFormatting2({ locale, timeZone: props.timeZone });
750
- const [now, setNow] = useState(Date.now);
751
- useEffect(() => {
659
+ const [now, setNow] = useState2(Date.now);
660
+ useEffect2(() => {
752
661
  const interval = window.setInterval(() => setNow(Date.now()), 30000);
753
662
  return () => window.clearInterval(interval);
754
663
  }, []);
@@ -765,10 +674,10 @@ function UpdatedAt({
765
674
  age = relative.format(-elapsedMinutes, "minute");
766
675
  const date = parseDateTime2(timestamp);
767
676
  if (!date)
768
- return /* @__PURE__ */ jsx12("span", {
677
+ return /* @__PURE__ */ jsx9("span", {
769
678
  children: children ?? `${label} —`
770
679
  });
771
- return /* @__PURE__ */ jsx12(DateTimeTooltip2, {
680
+ return /* @__PURE__ */ jsx9(DateTimeTooltip2, {
772
681
  ...props,
773
682
  ...defaults,
774
683
  date,
@@ -776,7 +685,7 @@ function UpdatedAt({
776
685
  ...triggerProps,
777
686
  className: ["altertable-updated-at", triggerProps?.className].filter(Boolean).join(" ")
778
687
  },
779
- children: children ?? /* @__PURE__ */ jsxs6("time", {
688
+ children: children ?? /* @__PURE__ */ jsxs5("time", {
780
689
  dateTime: date.toISOString(),
781
690
  children: [
782
691
  label,
@@ -787,7 +696,7 @@ function UpdatedAt({
787
696
  });
788
697
  }
789
698
  // src/react/ui/PeriodSummary.tsx
790
- import { jsx as jsx13, jsxs as jsxs7, Fragment as Fragment2 } from "react/jsx-runtime";
699
+ import { jsx as jsx10, jsxs as jsxs6, Fragment as Fragment3 } from "react/jsx-runtime";
791
700
  function duration(period) {
792
701
  return `${period.amount} ${period.unit}${period.amount === 1 ? "" : "s"}`;
793
702
  }
@@ -821,33 +730,33 @@ function PeriodSummary({
821
730
  const options = useDateFormatting2();
822
731
  const comparisonText = comparison ? comparisonLabel(period, comparison, options) : null;
823
732
  const comparisonDetail = comparison?.kind === "period" ? reportingPeriodText(comparison.period, options) : comparisonText;
824
- return /* @__PURE__ */ jsxs7("p", {
733
+ return /* @__PURE__ */ jsxs6("p", {
825
734
  className: classNames("altertable-period-summary", className),
826
735
  children: [
827
- /* @__PURE__ */ jsx13("span", {
736
+ /* @__PURE__ */ jsx10("span", {
828
737
  className: "altertable-sr-only",
829
738
  children: `Reporting period: ${reportingPeriodText(period, options)}${comparisonDetail ? `, compared with ${comparisonDetail}` : ""}`
830
739
  }),
831
- /* @__PURE__ */ jsxs7("span", {
740
+ /* @__PURE__ */ jsxs6("span", {
832
741
  "aria-hidden": "true",
833
742
  className: "altertable-period-summary-visible",
834
743
  children: [
835
- /* @__PURE__ */ jsx13(AppIcon2, {
744
+ /* @__PURE__ */ jsx10(AppIcon2, {
836
745
  name: period.kind === "rolling" ? "clock" : "calendar",
837
746
  size: 16
838
747
  }),
839
- /* @__PURE__ */ jsx13("span", {
748
+ /* @__PURE__ */ jsx10("span", {
840
749
  className: "altertable-period-summary-current",
841
750
  children: label(period, options)
842
751
  }),
843
- comparisonText && /* @__PURE__ */ jsxs7(Fragment2, {
752
+ comparisonText && /* @__PURE__ */ jsxs6(Fragment3, {
844
753
  children: [
845
- /* @__PURE__ */ jsx13("span", {
754
+ /* @__PURE__ */ jsx10("span", {
846
755
  className: "altertable-period-summary-vs",
847
756
  "aria-hidden": "true",
848
757
  children: "vs"
849
758
  }),
850
- /* @__PURE__ */ jsx13("span", {
759
+ /* @__PURE__ */ jsx10("span", {
851
760
  children: comparisonText
852
761
  })
853
762
  ]
@@ -858,7 +767,7 @@ function PeriodSummary({
858
767
  });
859
768
  }
860
769
  // src/react/ui/data-identifiers.tsx
861
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
770
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
862
771
  function qualifiedName(definition) {
863
772
  const table = definition.kind === "table" ? definition : definition.table;
864
773
  const path = [table.catalog, table.schema, table.name].join(".");
@@ -894,23 +803,23 @@ function defineDataIdentifiers({ tables, columns }) {
894
803
  const shown = display ?? (definition.kind === "table" ? "qualified" : "short");
895
804
  const table = definition.kind === "table" ? definition : definition.table;
896
805
  const prefix = definition.kind === "table" ? [table.catalog, table.schema] : [table.catalog, table.schema, table.name];
897
- return /* @__PURE__ */ jsxs8("code", {
806
+ return /* @__PURE__ */ jsxs7("code", {
898
807
  className: "altertable-data-identifier",
899
808
  "data-kind": definition.kind,
900
809
  title: qualified,
901
810
  "data-identifier-id": id,
902
811
  children: [
903
- shown === "qualified" && /* @__PURE__ */ jsx14("span", {
812
+ shown === "qualified" && /* @__PURE__ */ jsx11("span", {
904
813
  className: "altertable-data-identifier-path",
905
- children: prefix.map((segment, index) => /* @__PURE__ */ jsxs8("span", {
814
+ children: prefix.map((segment, index) => /* @__PURE__ */ jsxs7("span", {
906
815
  children: [
907
816
  segment,
908
817
  ".",
909
- /* @__PURE__ */ jsx14("wbr", {})
818
+ /* @__PURE__ */ jsx11("wbr", {})
910
819
  ]
911
820
  }, index))
912
821
  }),
913
- /* @__PURE__ */ jsx14("span", {
822
+ /* @__PURE__ */ jsx11("span", {
914
823
  className: "altertable-data-identifier-name",
915
824
  children: definition.name
916
825
  })
@@ -923,14 +832,14 @@ function defineDataIdentifiers({ tables, columns }) {
923
832
  };
924
833
  }
925
834
  // src/react/annotations/AnnotationTarget.tsx
926
- import { jsx as jsx15 } from "react/jsx-runtime";
835
+ import { jsx as jsx12 } from "react/jsx-runtime";
927
836
  function AnnotationTarget({
928
837
  annotationId,
929
838
  label,
930
839
  evidence,
931
840
  ...props
932
841
  }) {
933
- return /* @__PURE__ */ jsx15("div", {
842
+ return /* @__PURE__ */ jsx12("div", {
934
843
  ...props,
935
844
  ...getAnnotationProps({
936
845
  id: annotationId,
@@ -942,9 +851,9 @@ function AnnotationTarget({
942
851
  }
943
852
  // src/react/annotations/AnnotationBar.tsx
944
853
  import {
945
- useEffect as useEffect2,
854
+ useEffect as useEffect3,
946
855
  useEffectEvent,
947
- useRef,
856
+ useRef as useRef2,
948
857
  useReducer,
949
858
  useImperativeHandle
950
859
  } from "react";
@@ -966,7 +875,7 @@ import {
966
875
  Minus,
967
876
  LoaderCircle
968
877
  } from "lucide-react";
969
- import { jsx as jsx16, jsxs as jsxs9, Fragment as Fragment3 } from "react/jsx-runtime";
878
+ import { jsx as jsx13, jsxs as jsxs8, Fragment as Fragment4 } from "react/jsx-runtime";
970
879
  function annotationBarReducer(state, action) {
971
880
  switch (action.type) {
972
881
  case "positionMoved":
@@ -1018,12 +927,12 @@ function AnnotationBar({
1018
927
  onSend,
1019
928
  onClose
1020
929
  }) {
1021
- const reviewElement = useRef(null);
1022
- const reviewTrigger = useRef(null);
1023
- const cancelDiscard = useRef(null);
1024
- const barRef = useRef(null);
1025
- const drag = useRef(undefined);
1026
- const submitting = useRef(false);
930
+ const reviewElement = useRef2(null);
931
+ const reviewTrigger = useRef2(null);
932
+ const cancelDiscard = useRef2(null);
933
+ const barRef = useRef2(null);
934
+ const drag = useRef2(undefined);
935
+ const submitting = useRef2(false);
1027
936
  const [state, dispatch] = useReducer(annotationBarReducer, {
1028
937
  reviewOpen: false,
1029
938
  pending: false,
@@ -1059,11 +968,11 @@ function AnnotationBar({
1059
968
  if (position)
1060
969
  move(position.left, position.top);
1061
970
  });
1062
- useEffect2(() => {
971
+ useEffect3(() => {
1063
972
  window.addEventListener("resize", keepInViewport);
1064
973
  return () => window.removeEventListener("resize", keepInViewport);
1065
974
  }, []);
1066
- useEffect2(() => {
975
+ useEffect3(() => {
1067
976
  if (reviewOpen)
1068
977
  reviewElement.current?.querySelector("button")?.focus();
1069
978
  }, [reviewOpen]);
@@ -1090,7 +999,7 @@ function AnnotationBar({
1090
999
  }
1091
1000
  }
1092
1001
  useImperativeHandle(ref, () => ({ send }));
1093
- useEffect2(() => {
1002
+ useEffect3(() => {
1094
1003
  if (discardOpen)
1095
1004
  cancelDiscard.current?.focus();
1096
1005
  }, [discardOpen]);
@@ -1099,26 +1008,26 @@ function AnnotationBar({
1099
1008
  onClear();
1100
1009
  onClose();
1101
1010
  }
1102
- const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs9("div", {
1011
+ const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs8("div", {
1103
1012
  className: "altertable-annotation-undo",
1104
1013
  "data-theme": theme,
1105
1014
  "data-inline": active && reviewOpen && annotations.length > 0 || undefined,
1106
1015
  "data-bar-visible": active && annotations.length > 0 || undefined,
1107
1016
  children: [
1108
- /* @__PURE__ */ jsx16("output", {
1017
+ /* @__PURE__ */ jsx13("output", {
1109
1018
  children: "Annotation deleted"
1110
1019
  }),
1111
- /* @__PURE__ */ jsx16(Button2, {
1020
+ /* @__PURE__ */ jsx13(Button2, {
1112
1021
  variant: "ghost",
1113
1022
  onClick: () => onUndoDelete(deletedAnnotationId),
1114
1023
  children: "Undo"
1115
1024
  }),
1116
- onDismissUndo && /* @__PURE__ */ jsx16(Button2, {
1025
+ onDismissUndo && /* @__PURE__ */ jsx13(Button2, {
1117
1026
  variant: "ghost",
1118
1027
  size: "icon-compact",
1119
1028
  "aria-label": "Dismiss deleted annotation",
1120
1029
  onClick: onDismissUndo,
1121
- children: /* @__PURE__ */ jsx16(X, {
1030
+ children: /* @__PURE__ */ jsx13(X, {
1122
1031
  size: 14,
1123
1032
  "aria-hidden": true
1124
1033
  })
@@ -1133,9 +1042,9 @@ function AnnotationBar({
1133
1042
  bottom: "auto",
1134
1043
  transform: "none"
1135
1044
  } : {};
1136
- return /* @__PURE__ */ jsxs9(TooltipProvider2, {
1045
+ return /* @__PURE__ */ jsxs8(TooltipProvider2, {
1137
1046
  children: [
1138
- active && annotations.length > 0 && /* @__PURE__ */ jsxs9("div", {
1047
+ active && annotations.length > 0 && /* @__PURE__ */ jsxs8("div", {
1139
1048
  ref: barElementRef,
1140
1049
  className: "altertable-annotation-bar",
1141
1050
  "data-theme": theme,
@@ -1153,7 +1062,7 @@ function AnnotationBar({
1153
1062
  onClose();
1154
1063
  },
1155
1064
  children: [
1156
- /* @__PURE__ */ jsx16(Button2, {
1065
+ /* @__PURE__ */ jsx13(Button2, {
1157
1066
  variant: "ghost",
1158
1067
  size: "icon-compact",
1159
1068
  "aria-label": "Move annotation bar",
@@ -1195,12 +1104,12 @@ function AnnotationBar({
1195
1104
  event.preventDefault();
1196
1105
  move(rect.left + delta[0], rect.top + delta[1]);
1197
1106
  },
1198
- children: /* @__PURE__ */ jsx16(GripVertical, {
1107
+ children: /* @__PURE__ */ jsx13(GripVertical, {
1199
1108
  size: 16,
1200
1109
  "aria-hidden": true
1201
1110
  })
1202
1111
  }),
1203
- /* @__PURE__ */ jsxs9(Button2, {
1112
+ /* @__PURE__ */ jsxs8(Button2, {
1204
1113
  ref: reviewTrigger,
1205
1114
  className: "altertable-annotation-bar-count",
1206
1115
  variant: "ghost",
@@ -1215,51 +1124,51 @@ function AnnotationBar({
1215
1124
  annotations.length
1216
1125
  ]
1217
1126
  }),
1218
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1127
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1219
1128
  content: pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1220
1129
  theme,
1221
- children: /* @__PURE__ */ jsx16(Button2, {
1130
+ children: /* @__PURE__ */ jsx13(Button2, {
1222
1131
  variant: "ghost",
1223
1132
  size: "icon-compact",
1224
1133
  "aria-label": pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1225
1134
  "aria-pressed": !pinsVisible,
1226
1135
  disabled: locked,
1227
1136
  onClick: () => onPinsVisibleChange(!pinsVisible),
1228
- children: pinsVisible ? /* @__PURE__ */ jsx16(EyeOff, {
1137
+ children: pinsVisible ? /* @__PURE__ */ jsx13(EyeOff, {
1229
1138
  size: 16,
1230
1139
  "aria-hidden": true
1231
- }) : /* @__PURE__ */ jsx16(Eye, {
1140
+ }) : /* @__PURE__ */ jsx13(Eye, {
1232
1141
  size: 16,
1233
1142
  "aria-hidden": true
1234
1143
  })
1235
1144
  })
1236
1145
  }),
1237
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1146
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1238
1147
  content: "Discard all annotations",
1239
1148
  theme,
1240
- children: /* @__PURE__ */ jsx16(Button2, {
1149
+ children: /* @__PURE__ */ jsx13(Button2, {
1241
1150
  variant: "ghost",
1242
1151
  size: "icon-compact",
1243
1152
  "aria-label": "Discard all annotations",
1244
1153
  disabled: locked,
1245
1154
  onClick: () => requestDiscard ? requestDiscard(discardAnnotations) : dispatch({ type: "discardDialogChanged", open: true }),
1246
- children: /* @__PURE__ */ jsx16(Trash2, {
1155
+ children: /* @__PURE__ */ jsx13(Trash2, {
1247
1156
  size: 16,
1248
1157
  "aria-hidden": true
1249
1158
  })
1250
1159
  })
1251
1160
  }),
1252
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1253
- content: hasUnsavedChanges ? "Save the open annotation before sending" : /* @__PURE__ */ jsxs9(Fragment3, {
1161
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1162
+ content: hasUnsavedChanges ? "Save the open annotation before sending" : /* @__PURE__ */ jsxs8(Fragment4, {
1254
1163
  children: [
1255
1164
  "Send annotations ",
1256
- /* @__PURE__ */ jsx16(Kbd, {
1165
+ /* @__PURE__ */ jsx13(Kbd, {
1257
1166
  shortcut: shortcuts.sendAnnotations
1258
1167
  })
1259
1168
  ]
1260
1169
  }),
1261
1170
  theme,
1262
- children: /* @__PURE__ */ jsxs9(Button2, {
1171
+ children: /* @__PURE__ */ jsxs8(Button2, {
1263
1172
  className: "altertable-annotation-bar-send",
1264
1173
  "data-pending": pending || undefined,
1265
1174
  "aria-busy": pending,
@@ -1268,11 +1177,11 @@ function AnnotationBar({
1268
1177
  disabled: !canSend,
1269
1178
  onClick: () => void send(),
1270
1179
  children: [
1271
- /* @__PURE__ */ jsx16("span", {
1180
+ /* @__PURE__ */ jsx13("span", {
1272
1181
  className: "altertable-annotation-bar-send-label",
1273
1182
  children: "Send"
1274
1183
  }),
1275
- pending && /* @__PURE__ */ jsx16(LoaderCircle, {
1184
+ pending && /* @__PURE__ */ jsx13(LoaderCircle, {
1276
1185
  className: "altertable-annotation-bar-spinner",
1277
1186
  size: 16,
1278
1187
  "aria-hidden": true
@@ -1280,30 +1189,30 @@ function AnnotationBar({
1280
1189
  ]
1281
1190
  })
1282
1191
  }),
1283
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1284
- content: /* @__PURE__ */ jsxs9(Fragment3, {
1192
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1193
+ content: /* @__PURE__ */ jsxs8(Fragment4, {
1285
1194
  children: [
1286
1195
  hasUnsavedChanges ? "Save or discard the open annotation first" : "Exit annotation mode",
1287
1196
  " ",
1288
- /* @__PURE__ */ jsx16(Kbd, {
1197
+ /* @__PURE__ */ jsx13(Kbd, {
1289
1198
  children: "Esc"
1290
1199
  })
1291
1200
  ]
1292
1201
  }),
1293
1202
  theme,
1294
- children: /* @__PURE__ */ jsx16(Button2, {
1203
+ children: /* @__PURE__ */ jsx13(Button2, {
1295
1204
  variant: "ghost",
1296
1205
  size: "icon-compact",
1297
1206
  "aria-label": "Exit annotation mode",
1298
1207
  disabled: locked || hasUnsavedChanges,
1299
1208
  onClick: onClose,
1300
- children: /* @__PURE__ */ jsx16(X, {
1209
+ children: /* @__PURE__ */ jsx13(X, {
1301
1210
  size: 16,
1302
1211
  "aria-hidden": true
1303
1212
  })
1304
1213
  })
1305
1214
  }),
1306
- error && /* @__PURE__ */ jsx16("output", {
1215
+ error && /* @__PURE__ */ jsx13("output", {
1307
1216
  className: "altertable-annotation-bar-error",
1308
1217
  role: "alert",
1309
1218
  children: error
@@ -1311,7 +1220,7 @@ function AnnotationBar({
1311
1220
  ]
1312
1221
  }),
1313
1222
  (!active || !reviewOpen || annotations.length === 0) && undo && createPortal(undo, document.body),
1314
- active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs9("dialog", {
1223
+ active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs8("dialog", {
1315
1224
  open: true,
1316
1225
  ref: reviewRef,
1317
1226
  className: "altertable-annotation-bar-panel",
@@ -1325,41 +1234,41 @@ function AnnotationBar({
1325
1234
  }
1326
1235
  },
1327
1236
  children: [
1328
- /* @__PURE__ */ jsxs9("header", {
1237
+ /* @__PURE__ */ jsxs8("header", {
1329
1238
  children: [
1330
- /* @__PURE__ */ jsx16("strong", {
1239
+ /* @__PURE__ */ jsx13("strong", {
1331
1240
  children: "Annotations"
1332
1241
  }),
1333
- /* @__PURE__ */ jsx16(Button2, {
1242
+ /* @__PURE__ */ jsx13(Button2, {
1334
1243
  variant: "ghost",
1335
1244
  size: "icon-compact",
1336
1245
  "aria-label": "Minimize annotation review",
1337
1246
  onClick: closeReview,
1338
- children: /* @__PURE__ */ jsx16(Minus, {
1247
+ children: /* @__PURE__ */ jsx13(Minus, {
1339
1248
  size: 16,
1340
1249
  "aria-hidden": true
1341
1250
  })
1342
1251
  })
1343
1252
  ]
1344
1253
  }),
1345
- /* @__PURE__ */ jsx16("div", {
1254
+ /* @__PURE__ */ jsx13("div", {
1346
1255
  "aria-label": "Annotation drafts",
1347
- children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs9("div", {
1256
+ children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs8("div", {
1348
1257
  className: "altertable-annotation-bar-row",
1349
1258
  children: [
1350
- annotation.context.screenshot && /* @__PURE__ */ jsx16("button", {
1259
+ annotation.context.screenshot && /* @__PURE__ */ jsx13("button", {
1351
1260
  "data-atbl-focus": "ring",
1352
1261
  "data-atbl-control": "action",
1353
1262
  type: "button",
1354
1263
  className: "altertable-annotation-thumbnail",
1355
1264
  "aria-label": `View screenshot of ${annotation.target.label}`,
1356
1265
  onClick: () => dispatch({ type: "previewOpened", id: annotation.id }),
1357
- children: /* @__PURE__ */ jsx16("img", {
1266
+ children: /* @__PURE__ */ jsx13("img", {
1358
1267
  src: annotation.context.screenshot.dataUrl,
1359
1268
  alt: ""
1360
1269
  })
1361
1270
  }),
1362
- /* @__PURE__ */ jsxs9(Button2, {
1271
+ /* @__PURE__ */ jsxs8(Button2, {
1363
1272
  variant: "ghost",
1364
1273
  className: "altertable-annotation-bar-open",
1365
1274
  "aria-label": `Open annotation ${index + 1}`,
@@ -1370,21 +1279,21 @@ function AnnotationBar({
1370
1279
  dispatch({ type: "reviewClosed" });
1371
1280
  },
1372
1281
  children: [
1373
- /* @__PURE__ */ jsx16("strong", {
1282
+ /* @__PURE__ */ jsx13("strong", {
1374
1283
  children: annotation.target.label
1375
1284
  }),
1376
- /* @__PURE__ */ jsx16("span", {
1285
+ /* @__PURE__ */ jsx13("span", {
1377
1286
  children: annotation.comment
1378
1287
  })
1379
1288
  ]
1380
1289
  }),
1381
- /* @__PURE__ */ jsx16(Button2, {
1290
+ /* @__PURE__ */ jsx13(Button2, {
1382
1291
  variant: "ghost",
1383
1292
  size: "icon-compact",
1384
1293
  "aria-label": `Delete annotation ${index + 1}`,
1385
1294
  disabled: locked,
1386
1295
  onClick: () => onDelete(annotation.id),
1387
- children: /* @__PURE__ */ jsx16(Trash2, {
1296
+ children: /* @__PURE__ */ jsx13(Trash2, {
1388
1297
  size: 16,
1389
1298
  "aria-hidden": true
1390
1299
  })
@@ -1395,7 +1304,7 @@ function AnnotationBar({
1395
1304
  undo
1396
1305
  ]
1397
1306
  }), document.body),
1398
- /* @__PURE__ */ jsx16(Sheet2, {
1307
+ /* @__PURE__ */ jsx13(Sheet2, {
1399
1308
  open: Boolean(preview),
1400
1309
  onOpenChange: (open) => {
1401
1310
  if (!open)
@@ -1406,27 +1315,27 @@ function AnnotationBar({
1406
1315
  title: preview?.target.label ?? "Screenshot",
1407
1316
  description: preview?.comment,
1408
1317
  returnFocus: reviewTrigger,
1409
- children: preview?.context.screenshot && /* @__PURE__ */ jsx16("img", {
1318
+ children: preview?.context.screenshot && /* @__PURE__ */ jsx13("img", {
1410
1319
  className: "altertable-annotation-preview",
1411
1320
  src: preview.context.screenshot.dataUrl,
1412
1321
  alt: `Captured area for ${preview.target.label}`
1413
1322
  })
1414
1323
  }),
1415
- !requestDiscard && /* @__PURE__ */ jsx16(Sheet2, {
1324
+ !requestDiscard && /* @__PURE__ */ jsx13(Sheet2, {
1416
1325
  open: discardOpen,
1417
1326
  onOpenChange: (open) => dispatch({ type: "discardDialogChanged", open }),
1418
1327
  placement: "center",
1419
1328
  title: "Discard all pending annotations?",
1420
1329
  returnFocus: barRef,
1421
- footer: /* @__PURE__ */ jsxs9(Fragment3, {
1330
+ footer: /* @__PURE__ */ jsxs8(Fragment4, {
1422
1331
  children: [
1423
- /* @__PURE__ */ jsx16(Button2, {
1332
+ /* @__PURE__ */ jsx13(Button2, {
1424
1333
  ref: cancelDiscard,
1425
1334
  variant: "ghost",
1426
1335
  onClick: () => dispatch({ type: "discardDialogChanged", open: false }),
1427
1336
  children: "Cancel"
1428
1337
  }),
1429
- /* @__PURE__ */ jsx16(Button2, {
1338
+ /* @__PURE__ */ jsx13(Button2, {
1430
1339
  className: "altertable-annotation-discard-confirm",
1431
1340
  disabled: locked,
1432
1341
  onClick: discardAnnotations,
@@ -1434,7 +1343,7 @@ function AnnotationBar({
1434
1343
  })
1435
1344
  ]
1436
1345
  }),
1437
- children: /* @__PURE__ */ jsx16("p", {
1346
+ children: /* @__PURE__ */ jsx13("p", {
1438
1347
  className: "altertable-annotation-discard-description",
1439
1348
  children: "These annotations will be removed and won’t be sent to the agent."
1440
1349
  })
@@ -1480,6 +1389,10 @@ function injectDataAppAnnotationStyles(options = {}) {
1480
1389
  --atbl-control-padding-block: .375rem;
1481
1390
  --atbl-control-gap: .5rem;
1482
1391
  --atbl-control-disabled-opacity: .5;
1392
+ --atbl-dropdown-padding: calc(var(--atbl-control-padding-block) * 2 / 3);
1393
+ --atbl-dropdown-item-padding-block: var(--atbl-control-padding-block);
1394
+ --atbl-dropdown-item-padding-inline: calc(var(--atbl-control-padding-inline) * 3 / 4);
1395
+ --atbl-dropdown-item-gap: 2px;
1483
1396
  --atbl-radius-control: 7px;
1484
1397
  --atbl-radius-surface: 12px;
1485
1398
  --atbl-radius-overlay: 16px;
@@ -1827,6 +1740,32 @@ function injectDataAppAnnotationStyles(options = {}) {
1827
1740
  inline-size: var(--atbl-control-icon-size);
1828
1741
  block-size: var(--atbl-control-icon-size);
1829
1742
  }
1743
+
1744
+ .altertable-button[data-variant="inline"] {
1745
+ --atbl-control-hover-surface: transparent;
1746
+ --atbl-control-pressed-surface: transparent;
1747
+ --atbl-control-open-surface: transparent;
1748
+ box-shadow: none;
1749
+ font: inherit;
1750
+ text-underline-offset: .2em;
1751
+ background: none;
1752
+ border: 0;
1753
+ border-radius: 0;
1754
+ min-height: 0;
1755
+ padding: 0;
1756
+ }
1757
+
1758
+ .altertable-button[data-variant="inline"]:-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, [data-disabled])) {
1759
+ text-decoration: underline;
1760
+ }
1761
+
1762
+ .altertable-button[data-variant="inline"]:-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, [data-disabled])) {
1763
+ text-decoration: underline;
1764
+ }
1765
+
1766
+ .altertable-button[data-variant="inline"]:is(:hover, [data-hovered]):not(:is(:disabled, [data-disabled])) {
1767
+ text-decoration: underline;
1768
+ }
1830
1769
  }
1831
1770
 
1832
1771
  /* src/react/ui/Tooltip.css */
@@ -2913,6 +2852,8 @@ export {
2913
2852
  DataValue,
2914
2853
  DateDisplay2 as DateDisplay,
2915
2854
  DateTimeTooltip2 as DateTimeTooltip,
2855
+ DetailContent2 as DetailContent,
2856
+ DetailView2 as DetailView,
2916
2857
  EmptyState2 as EmptyState,
2917
2858
  Grid,
2918
2859
  GridItem,
@@ -2942,7 +2883,8 @@ export {
2942
2883
  multiChoiceVariable2 as multiChoiceVariable,
2943
2884
  searchVariable2 as searchVariable,
2944
2885
  useDataAppAnnotations2 as useDataAppAnnotations,
2945
- useDateFormatting2 as useDateFormatting
2886
+ useDateFormatting2 as useDateFormatting,
2887
+ useDetailNavigation2 as useDetailNavigation
2946
2888
  };
2947
2889
 
2948
- //# debugId=1E1121DA24A2E4B464756E2164756E21
2890
+ //# debugId=004515EB2CD3758264756E2164756E21