@altertable/data-app 0.68.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 (203) hide show
  1. package/AGENTS.md +10 -0
  2. package/CONTRIBUTING.md +27 -1
  3. package/README.md +18 -21
  4. package/THIRD_PARTY_NOTICES +18 -0
  5. package/dist/chunks/index-22d576sn.js +153 -0
  6. package/dist/chunks/index-22d576sn.js.map +11 -0
  7. package/dist/chunks/index-2ajhmsc4.js +355 -0
  8. package/dist/chunks/index-2ajhmsc4.js.map +13 -0
  9. package/dist/chunks/{index-ktmvs916.js → index-58kks6a8.js} +37 -21
  10. package/dist/chunks/index-58kks6a8.js.map +13 -0
  11. package/dist/chunks/{index-23dktynd.js → index-7q99hf1z.js} +19 -12
  12. package/dist/chunks/index-7q99hf1z.js.map +10 -0
  13. package/dist/chunks/{index-mt93ff2b.js → index-9zqbrv2z.js} +7 -3
  14. package/dist/chunks/index-9zqbrv2z.js.map +10 -0
  15. package/dist/chunks/{index-m6n8ctfc.js → index-cv36cyna.js} +4 -4
  16. package/dist/chunks/index-cv36cyna.js.map +10 -0
  17. package/dist/chunks/{index-ag0cgnvq.js → index-q1w84fv9.js} +178 -31
  18. package/dist/chunks/index-q1w84fv9.js.map +15 -0
  19. package/dist/chunks/{index-qd5xgx6y.js → index-rew95tbg.js} +89 -21
  20. package/dist/chunks/index-rew95tbg.js.map +13 -0
  21. package/dist/chunks/{index-gvers8jw.js → index-vtpygsbq.js} +5651 -2711
  22. package/dist/chunks/index-vtpygsbq.js.map +126 -0
  23. package/dist/chunks/{index-x69p7cv7.js → index-wjt6cavj.js} +6 -4
  24. package/dist/chunks/index-wjt6cavj.js.map +10 -0
  25. package/dist/chunks/{index-f5cnbrjz.js → index-wss3gd3h.js} +39 -9
  26. package/dist/chunks/index-wss3gd3h.js.map +13 -0
  27. package/dist/chunks/{index-ev2b5aaf.js → index-xzb7sx6g.js} +4 -4
  28. package/dist/client/index.js +6 -6
  29. package/dist/core/appearance.js +1 -1
  30. package/dist/core/config.js +3 -3
  31. package/dist/core/contract.js +7 -7
  32. package/dist/core/contract.js.map +1 -1
  33. package/dist/core/format.js +10 -2
  34. package/dist/core/format.js.map +1 -1
  35. package/dist/embed/index.js +26 -25
  36. package/dist/embed/index.js.map +4 -4
  37. package/dist/index.js +3 -3
  38. package/dist/local.js +200 -145
  39. package/dist/local.js.map +10 -7
  40. package/dist/preview.js +1456 -0
  41. package/dist/preview.js.map +17 -0
  42. package/dist/react/embed/index.js +1 -1
  43. package/dist/react/index.js +500 -401
  44. package/dist/react/index.js.map +10 -13
  45. package/dist/react/ui/index.js +1851 -1476
  46. package/dist/react/ui/index.js.map +24 -21
  47. package/dist/server.js +102 -58
  48. package/dist/server.js.map +9 -6
  49. package/dist/types/client/data-client.d.ts +21 -10
  50. package/dist/types/client/download.d.ts +5 -0
  51. package/dist/types/client/iframe.d.ts +4 -2
  52. package/dist/types/client/logger.d.ts +10 -2
  53. package/dist/types/core/annotations.d.ts +5 -0
  54. package/dist/types/core/appearance.d.ts +2 -0
  55. package/dist/types/core/bridge-endpoint.d.ts +2 -2
  56. package/dist/types/core/bridge.d.ts +22 -0
  57. package/dist/types/core/config.d.ts +25 -17
  58. package/dist/types/core/contract.d.ts +26 -14
  59. package/dist/types/core/date-format.d.ts +24 -0
  60. package/dist/types/core/dimension-source.d.ts +64 -0
  61. package/dist/types/core/dimension.d.ts +33 -24
  62. package/dist/types/core/facets.d.ts +13 -0
  63. package/dist/types/core/filters.d.ts +4 -3
  64. package/dist/types/core/format.d.ts +5 -3
  65. package/dist/types/core/keys.d.ts +2 -0
  66. package/dist/types/core/messages.d.ts +3 -1
  67. package/dist/types/core/operation-types.d.ts +12 -11
  68. package/dist/types/core/queries.d.ts +75 -7
  69. package/dist/types/core/time-interval.d.ts +96 -0
  70. package/dist/types/core/variables.d.ts +49 -14
  71. package/dist/types/embed/host.d.ts +4 -4
  72. package/dist/types/embed/sql.d.ts +1 -1
  73. package/dist/types/index.d.ts +1 -1
  74. package/dist/types/react/actions.d.ts +53 -0
  75. package/dist/types/react/annotations/annotation-editor-state.d.ts +2 -0
  76. package/dist/types/react/annotations/annotation-targets.d.ts +1 -0
  77. package/dist/types/react/annotations/getAnnotationProps.d.ts +5 -3
  78. package/dist/types/react/annotations/useAnnotationGeometry.d.ts +2 -2
  79. package/dist/types/react/bindings.d.ts +62 -3
  80. package/dist/types/react/date-formatting.d.ts +12 -0
  81. package/dist/types/react/details.d.ts +46 -0
  82. package/dist/types/react/exploration.d.ts +44 -0
  83. package/dist/types/react/hooks.d.ts +82 -43
  84. package/dist/types/react/index.d.ts +10 -2
  85. package/dist/types/react/search-suggestions.d.ts +8 -0
  86. package/dist/types/react/style-contract.d.ts +1 -5
  87. package/dist/types/react/ui/AboutData.d.ts +9 -4
  88. package/dist/types/react/ui/AreaChart.d.ts +2 -2
  89. package/dist/types/react/ui/BarChart.d.ts +2 -2
  90. package/dist/types/react/ui/Button.d.ts +2 -1
  91. package/dist/types/react/ui/ChartLegend.d.ts +3 -2
  92. package/dist/types/react/ui/ChoicePicker.d.ts +2 -0
  93. package/dist/types/react/ui/ComposedChartLegend.d.ts +2 -1
  94. package/dist/types/react/ui/DataApp.d.ts +8 -4
  95. package/dist/types/react/ui/DataAppFrame.d.ts +14 -3
  96. package/dist/types/react/ui/DataTable.d.ts +6 -4
  97. package/dist/types/react/ui/DataWidget.d.ts +7 -0
  98. package/dist/types/react/ui/DateDisplay.d.ts +9 -0
  99. package/dist/types/react/ui/DateRangePicker.d.ts +3 -1
  100. package/dist/types/react/ui/DateTimeTooltip.d.ts +3 -2
  101. package/dist/types/react/ui/DimensionPicker.d.ts +5 -3
  102. package/dist/types/react/ui/EmptyState.d.ts +1 -1
  103. package/dist/types/react/ui/ExplorationActionControl.d.ts +60 -0
  104. package/dist/types/react/ui/GradientScroll.d.ts +8 -0
  105. package/dist/types/react/ui/Grid.d.ts +1 -1
  106. package/dist/types/react/ui/InspectionProvider.d.ts +2 -2
  107. package/dist/types/react/ui/LineChart.d.ts +2 -2
  108. package/dist/types/react/ui/Menu.d.ts +3 -2
  109. package/dist/types/react/ui/MetricWidget.d.ts +4 -0
  110. package/dist/types/react/ui/NumberFilterPicker.d.ts +3 -1
  111. package/dist/types/react/ui/PeriodSummary.d.ts +2 -1
  112. package/dist/types/react/ui/PickerField.d.ts +23 -0
  113. package/dist/types/react/ui/PieChart.d.ts +2 -2
  114. package/dist/types/react/ui/PopoverSurface.d.ts +5 -0
  115. package/dist/types/react/ui/RequestHint.d.ts +2 -2
  116. package/dist/types/react/ui/SearchField.d.ts +3 -1
  117. package/dist/types/react/ui/SearchTypeahead.d.ts +15 -0
  118. package/dist/types/react/ui/SectionHeading.d.ts +8 -0
  119. package/dist/types/react/ui/Select.d.ts +9 -1
  120. package/dist/types/react/ui/Sheet.d.ts +4 -2
  121. package/dist/types/react/ui/TableWidget.d.ts +8 -0
  122. package/dist/types/react/ui/Tabs.d.ts +4 -3
  123. package/dist/types/react/ui/TrendChart.d.ts +3 -3
  124. package/dist/types/react/ui/VariableBar.d.ts +1 -1
  125. package/dist/types/react/ui/VisualizationWidget.d.ts +1 -1
  126. package/dist/types/react/ui/chart-data.d.ts +8 -6
  127. package/dist/types/react/ui/chart-date-axis.d.ts +15 -0
  128. package/dist/types/react/ui/chart-interaction.d.ts +27 -0
  129. package/dist/types/react/ui/chart-primitives.d.ts +4 -4
  130. package/dist/types/react/ui/chart-time.d.ts +19 -0
  131. package/dist/types/react/ui/chartColor.d.ts +1 -1
  132. package/dist/types/react/ui/icons.d.ts +5 -1
  133. package/dist/types/react/ui/index.d.ts +10 -4
  134. package/dist/types/react/ui/metric-comparison.d.ts +2 -2
  135. package/dist/types/react/ui/metric.d.ts +2 -2
  136. package/dist/types/react/ui/presentation.d.ts +2 -0
  137. package/dist/types/react/ui/searchItems.d.ts +2 -0
  138. package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +2 -0
  139. package/dist/types/react/ui/variables.d.ts +1 -1
  140. package/dist/types/react/view-control-bar.d.ts +18 -0
  141. package/dist/types/react/view-controls.d.ts +3 -2
  142. package/dist/types/react/view-runtime.d.ts +8 -3
  143. package/dist/types/react/view.d.ts +28 -7
  144. package/dist/types/react/widgets.d.ts +22 -11
  145. package/dist/types/server/local.d.ts +3 -1
  146. package/dist/types/server/preview/host.d.ts +1 -0
  147. package/dist/types/server/preview/index.d.ts +16 -0
  148. package/dist/types/server/reload-channel.d.ts +6 -0
  149. package/dist/types/server/request-body.d.ts +4 -0
  150. package/dist/worker.js +1 -1
  151. package/docs/app-authoring.md +27 -12
  152. package/docs/client.md +6 -7
  153. package/docs/composition.md +84 -0
  154. package/docs/contract.md +45 -26
  155. package/docs/data-context.md +2 -0
  156. package/docs/embed.md +11 -3
  157. package/docs/formatting-and-appearance.md +36 -5
  158. package/docs/layout.md +31 -8
  159. package/docs/react-embed.md +4 -4
  160. package/docs/react.md +1 -1
  161. package/docs/server-bun.md +25 -0
  162. package/docs/server.md +2 -2
  163. package/docs/styling.md +10 -27
  164. package/docs/ui.md +32 -18
  165. package/docs/variables.md +174 -25
  166. package/docs/views.md +60 -29
  167. package/docs/widgets.md +131 -26
  168. package/examples/starter-data-app/index.tsx +10 -23
  169. package/examples/starter-local-data-app/.bun-version +1 -0
  170. package/examples/starter-local-data-app/.node-version +1 -0
  171. package/examples/starter-local-data-app/.oxfmtrc.json +4 -0
  172. package/examples/starter-local-data-app/.oxlintrc.json +33 -0
  173. package/examples/starter-local-data-app/AGENTS.md +22 -0
  174. package/examples/starter-local-data-app/README.md +54 -0
  175. package/examples/starter-local-data-app/app.ts +28 -0
  176. package/examples/starter-local-data-app/bunfig.toml +2 -0
  177. package/examples/starter-local-data-app/package.json +33 -0
  178. package/examples/starter-local-data-app/src/App.tsx +8 -0
  179. package/examples/starter-local-data-app/src/assets.d.ts +1 -0
  180. package/examples/starter-local-data-app/src/data-context.ts +21 -0
  181. package/examples/starter-local-data-app/src/favicon.svg +13 -0
  182. package/examples/starter-local-data-app/src/index.html +14 -0
  183. package/examples/starter-local-data-app/src/main.tsx +7 -0
  184. package/examples/starter-local-data-app/src/operations.ts +6 -0
  185. package/examples/starter-local-data-app/src/server.ts +6 -0
  186. package/examples/starter-local-data-app/tsconfig.json +21 -0
  187. package/package.json +13 -3
  188. package/dist/chunks/index-23dktynd.js.map +0 -10
  189. package/dist/chunks/index-ag0cgnvq.js.map +0 -13
  190. package/dist/chunks/index-dq7b35fn.js +0 -307
  191. package/dist/chunks/index-dq7b35fn.js.map +0 -13
  192. package/dist/chunks/index-f5cnbrjz.js.map +0 -13
  193. package/dist/chunks/index-gvers8jw.js.map +0 -109
  194. package/dist/chunks/index-ktmvs916.js.map +0 -13
  195. package/dist/chunks/index-m6n8ctfc.js.map +0 -10
  196. package/dist/chunks/index-mev09s5v.js +0 -77
  197. package/dist/chunks/index-mev09s5v.js.map +0 -10
  198. package/dist/chunks/index-mt93ff2b.js.map +0 -10
  199. package/dist/chunks/index-qd5xgx6y.js.map +0 -13
  200. package/dist/chunks/index-x69p7cv7.js.map +0 -10
  201. package/dist/types/react/shellStyles.d.ts +0 -3
  202. package/dist/types/react/ui/DataAppSkeleton.d.ts +0 -7
  203. /package/dist/chunks/{index-ev2b5aaf.js.map → index-xzb7sx6g.js.map} +0 -0
@@ -2,6 +2,8 @@ import {
2
2
  injectStyles,
3
3
  injectDataAppStyles2,
4
4
  useDataApp,
5
+ DateFormattingContext,
6
+ useDateFormatting2,
5
7
  AppIcon2,
6
8
  classNames,
7
9
  Button2,
@@ -14,88 +16,141 @@ import {
14
16
  InspectionContext,
15
17
  useInspectionDefaults,
16
18
  mountDataApp2,
19
+ breakdownState,
17
20
  useDeclaredResult,
18
21
  PrimaryViewContext,
19
22
  ownedSource,
23
+ DataSectionBoundary,
24
+ DetailView2,
25
+ DetailContent2,
26
+ useDetailNavigation2,
27
+ DetailRoutes,
28
+ resolveActions,
29
+ DateTimeTooltip2,
30
+ DateDisplay2,
31
+ RegisteredBinding,
20
32
  registeredEvidence,
21
33
  datasetTable,
34
+ MetricRecords,
22
35
  exportDatasets,
23
36
  searchVariable2,
24
37
  choiceVariable2,
25
38
  multiChoiceVariable2,
26
39
  dateRangeVariable2,
27
40
  sectionContent,
28
- IconButton2,
41
+ SearchSuggestionsContext,
42
+ Select2,
29
43
  Skeleton2,
30
44
  createDataHooks2,
31
45
  useDataAppAnnotations2,
32
46
  AnnotationTooltip,
33
- DataAppFrame,
34
- Grid2,
47
+ IconButton2,
35
48
  TextContent2,
49
+ Stack2,
50
+ DataAppFrame,
51
+ ExplorationActionControl2,
36
52
  getAnnotationProps,
37
53
  ContentSkeleton,
38
54
  VisualizationWidget2,
39
55
  comparisonChange,
40
56
  metricComparison,
41
57
  MetricWidget2,
42
- DateTimeTooltip2,
43
58
  TableWidget2,
44
59
  TextWidget2,
45
60
  DataValue2,
46
61
  chartColor2,
47
- createDataContext2
48
- } from "../chunks/index-gvers8jw.js";
62
+ createDataContext2,
63
+ SectionHeading2
64
+ } from "../chunks/index-vtpygsbq.js";
49
65
  import {
66
+ parseDateTime2,
67
+ formatDateTime2,
50
68
  formatDateRange2,
51
69
  formatMetric2,
52
70
  formatCount2,
53
71
  formatPercent2
54
- } from "../chunks/index-mev09s5v.js";
72
+ } from "../chunks/index-22d576sn.js";
55
73
  import {
74
+ KEY_SEPARATOR,
56
75
  parseDataAppAnnotationDraft2
57
- } from "../chunks/index-ag0cgnvq.js";
58
- import"../chunks/index-mt93ff2b.js";
59
- import"../chunks/index-m6n8ctfc.js";
60
- import"../chunks/index-ev2b5aaf.js";
61
- import {
62
- DataAppError2
63
- } from "../chunks/index-ktmvs916.js";
76
+ } from "../chunks/index-q1w84fv9.js";
77
+ import"../chunks/index-9zqbrv2z.js";
78
+ import"../chunks/index-cv36cyna.js";
79
+ import"../chunks/index-xzb7sx6g.js";
64
80
  import {
65
81
  invariant
66
- } from "../chunks/index-qd5xgx6y.js";
82
+ } from "../chunks/index-rew95tbg.js";
67
83
  // src/react/ui/DataApp.tsx
68
84
  import { jsx } from "react/jsx-runtime";
69
85
  function DataApp(props) {
70
- const { view, datasets, story, ...frame } = props;
86
+ const {
87
+ view,
88
+ datasets,
89
+ story,
90
+ showSearchSuggestions = true,
91
+ details = [],
92
+ children,
93
+ ...frame
94
+ } = props;
71
95
  const app = useDataApp();
72
96
  const result = useDeclaredResult(view);
73
- return /* @__PURE__ */ jsx(PrimaryViewContext, {
74
- value: { declaration: view, result },
75
- children: /* @__PURE__ */ jsx(DataAppFrame, {
76
- ...frame,
77
- request: result,
78
- dataContext: result.dataContext,
79
- story: (snapshot) => story(ownedSource(view, snapshot)).map((finding) => ({
80
- ...finding,
81
- evidence: registeredEvidence(finding.evidence, view)
82
- })),
83
- csvExport: (snapshot) => exportDatasets(datasets, ownedSource(view, snapshot), view.scope(snapshot), app.title)
97
+ const source = ownedSource(view, result.snapshot ?? { loading: true });
98
+ const suggestionGroups = showSearchSuggestions && frame.showSearch !== false && result.searchControls ? datasets.flatMap((dataset, index) => {
99
+ const reading = dataset.readSearchSuggestions(source);
100
+ if (!reading)
101
+ return [];
102
+ return [
103
+ reading.loading ? [] : reading.value.map((item) => ({
104
+ ...item,
105
+ id: [index, item.id].join(KEY_SEPARATOR)
106
+ }))
107
+ ];
108
+ }) : [];
109
+ return /* @__PURE__ */ jsx(DateFormattingContext, {
110
+ value: { timeZone: result.timeZone },
111
+ children: /* @__PURE__ */ jsx(SearchSuggestionsContext, {
112
+ value: suggestionGroups.length ? {
113
+ groups: suggestionGroups,
114
+ busy: result.refreshing
115
+ } : null,
116
+ children: /* @__PURE__ */ jsx(PrimaryViewContext, {
117
+ value: { declaration: view, result },
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
+ })
131
+ })
132
+ })
84
133
  })
85
134
  });
86
135
  }
87
- // src/react/ui/Stack.tsx
136
+ // src/react/ui/Grid.tsx
88
137
  import { jsx as jsx2 } from "react/jsx-runtime";
89
- function Stack({
138
+ function Grid({
90
139
  children,
140
+ columns = 1,
141
+ minItemWidth = "regular",
91
142
  gap = "lg",
143
+ align = "start",
92
144
  className,
93
145
  ...props
94
146
  }) {
95
147
  return /* @__PURE__ */ jsx2("div", {
96
148
  ...props,
97
- className: classNames("altertable-stack", className),
149
+ className: classNames("altertable-grid", className),
150
+ "data-columns": columns,
151
+ "data-min-item-width": minItemWidth,
98
152
  "data-gap": gap,
153
+ "data-align": align,
99
154
  children
100
155
  });
101
156
  }
@@ -115,45 +170,138 @@ function GridItem({
115
170
  });
116
171
  }
117
172
  // src/react/widgets.tsx
118
- 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";
119
175
  function MetricWidget({
120
176
  metric,
121
177
  source,
178
+ records,
179
+ actions,
180
+ action,
122
181
  ...presentation
123
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);
124
187
  return /* @__PURE__ */ jsx4(MetricWidget2, {
125
188
  ...presentation,
189
+ ref: setWidgetElement,
126
190
  metric: metric.definition,
127
- 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
128
206
  });
129
207
  }
130
208
  function TableWidget({
131
209
  dataset,
132
210
  source,
133
211
  title,
212
+ actions,
134
213
  ...presentation
135
214
  }) {
136
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));
137
219
  return /* @__PURE__ */ jsx4(TableWidget2, {
138
220
  ...presentation,
139
221
  ...data,
140
- 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
141
234
  });
142
235
  }
143
236
  function VisualizationWidget({
144
237
  dataset,
145
238
  source,
146
239
  title,
240
+ actions,
241
+ breakdown,
242
+ children,
243
+ views,
244
+ viewLabel,
245
+ initialView,
147
246
  ...presentation
148
247
  }) {
149
248
  const data = datasetTable(dataset, source);
150
- 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 = {
151
286
  ...presentation,
287
+ action,
152
288
  title: title ?? data.title,
153
289
  reading: data.reading,
154
290
  evidence: data.evidence,
155
291
  emptyFallback: data.emptyFallback,
156
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
157
305
  });
158
306
  }
159
307
  function TextWidget(props) {
@@ -227,7 +375,7 @@ function DataValue(props) {
227
375
  });
228
376
  }
229
377
  // src/react/ui/Breakdown.tsx
230
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
378
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
231
379
  function Breakdown({
232
380
  total,
233
381
  items,
@@ -237,18 +385,18 @@ function Breakdown({
237
385
  }) {
238
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.");
239
387
  const dominant = total > 0 && items.some((item) => item.value / total >= 0.85);
240
- return /* @__PURE__ */ jsxs("div", {
388
+ return /* @__PURE__ */ jsxs2("div", {
241
389
  ...props,
242
390
  className: classNames("altertable-breakdown", className),
243
391
  "data-dominant": dominant || undefined,
244
392
  children: [
245
- /* @__PURE__ */ jsxs("div", {
393
+ /* @__PURE__ */ jsxs2("div", {
246
394
  className: "altertable-breakdown-summary",
247
395
  children: [
248
396
  /* @__PURE__ */ jsx5("span", {
249
397
  children: "Share of total"
250
398
  }),
251
- /* @__PURE__ */ jsxs("strong", {
399
+ /* @__PURE__ */ jsxs2("strong", {
252
400
  children: [
253
401
  formatValue(total),
254
402
  " total"
@@ -273,12 +421,12 @@ function Breakdown({
273
421
  const color = {
274
422
  "--altertable-breakdown-color": chartColor2(item.id)
275
423
  };
276
- return /* @__PURE__ */ jsxs("div", {
424
+ return /* @__PURE__ */ jsxs2("div", {
277
425
  className: "altertable-breakdown-row",
278
426
  "data-empty": item.value === 0 || undefined,
279
427
  style: color,
280
428
  children: [
281
- /* @__PURE__ */ jsxs("dt", {
429
+ /* @__PURE__ */ jsxs2("dt", {
282
430
  children: [
283
431
  /* @__PURE__ */ jsx5("span", {
284
432
  className: "altertable-breakdown-swatch",
@@ -303,7 +451,7 @@ function Breakdown({
303
451
  });
304
452
  }
305
453
  // src/react/ui/Ranking.tsx
306
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
454
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
307
455
  function Ranking({
308
456
  items,
309
457
  formatValue = formatCount2,
@@ -315,9 +463,9 @@ function Ranking({
315
463
  return /* @__PURE__ */ jsx6("ol", {
316
464
  ...props,
317
465
  className: classNames("altertable-ranking", className),
318
- children: items.map((item) => /* @__PURE__ */ jsxs2("li", {
466
+ children: items.map((item) => /* @__PURE__ */ jsxs3("li", {
319
467
  children: [
320
- /* @__PURE__ */ jsxs2("div", {
468
+ /* @__PURE__ */ jsxs3("div", {
321
469
  className: "altertable-ranking-reading",
322
470
  children: [
323
471
  /* @__PURE__ */ jsx6("span", {
@@ -344,14 +492,15 @@ function Ranking({
344
492
  });
345
493
  }
346
494
  // src/react/ui/Comparison.tsx
347
- 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";
348
496
  function Comparison(props) {
497
+ const dateFormatting = useDateFormatting2();
349
498
  if ("metric" in props) {
350
499
  if (props.reading.loading)
351
500
  return /* @__PURE__ */ jsx7(ContentSkeleton, {
352
501
  variant: "panel"
353
502
  });
354
- const comparison = metricComparison(props.metric, props.reading);
503
+ const comparison = metricComparison(props.metric, props.reading, dateFormatting);
355
504
  if (!comparison)
356
505
  return null;
357
506
  return /* @__PURE__ */ jsx7(ComparisonContent, {
@@ -377,7 +526,7 @@ function ComparisonContent({
377
526
  previous,
378
527
  favorableDirection
379
528
  });
380
- return /* @__PURE__ */ jsxs3("figure", {
529
+ return /* @__PURE__ */ jsxs4("figure", {
381
530
  className: "altertable-comparison-visual",
382
531
  "data-emphasis": emphasis,
383
532
  "aria-label": `${label} comparison`,
@@ -385,11 +534,11 @@ function ComparisonContent({
385
534
  /* @__PURE__ */ jsx7("figcaption", {
386
535
  children: label
387
536
  }),
388
- /* @__PURE__ */ jsxs3("div", {
537
+ /* @__PURE__ */ jsxs4("div", {
389
538
  className: "altertable-comparison-row",
390
539
  "data-period": "current",
391
540
  children: [
392
- /* @__PURE__ */ jsxs3("div", {
541
+ /* @__PURE__ */ jsxs4("div", {
393
542
  children: [
394
543
  /* @__PURE__ */ jsx7("span", {
395
544
  children: current.periodLabel ?? "Current period"
@@ -407,11 +556,11 @@ function ComparisonContent({
407
556
  })
408
557
  ]
409
558
  }),
410
- previous && /* @__PURE__ */ jsxs3("div", {
559
+ previous && /* @__PURE__ */ jsxs4("div", {
411
560
  className: "altertable-comparison-row",
412
561
  "data-period": "previous",
413
562
  children: [
414
- /* @__PURE__ */ jsxs3("div", {
563
+ /* @__PURE__ */ jsxs4("div", {
415
564
  children: [
416
565
  /* @__PURE__ */ jsx7("span", {
417
566
  children: previous.periodLabel ?? "Previous period"
@@ -432,7 +581,7 @@ function ComparisonContent({
432
581
  /* @__PURE__ */ jsx7("p", {
433
582
  className: "altertable-comparison-change",
434
583
  "data-tone": tone,
435
- children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs3(Fragment, {
584
+ children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs4(Fragment2, {
436
585
  children: [
437
586
  /* @__PURE__ */ jsx7(AppIcon2, {
438
587
  name: icon,
@@ -450,206 +599,7 @@ function ComparisonContent({
450
599
  }
451
600
  // src/react/ui/DataSection.tsx
452
601
  import { useContext } from "react";
453
-
454
- // src/react/ui/DataBoundary.tsx
455
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
456
- function DataBoundary({
457
- view,
458
- loadingFallback,
459
- emptyFallback,
460
- error,
461
- staleError,
462
- notice = "none",
463
- children,
464
- className,
465
- ...props
466
- }) {
467
- if (view.kind === "loading" || view.kind === "empty" || view.kind === "error")
468
- return /* @__PURE__ */ jsx8("div", {
469
- ...props,
470
- className: classNames("altertable-data-boundary", className),
471
- children: view.kind === "loading" ? loadingFallback : view.kind === "empty" ? emptyFallback : error(view.error)
472
- });
473
- const updating = view.kind === "updating";
474
- const hasStaleError = view.kind === "stale-error";
475
- return /* @__PURE__ */ jsxs4("div", {
476
- ...props,
477
- className: classNames("altertable-data-boundary", className),
478
- children: [
479
- notice === "inline" && (updating || hasStaleError) && /* @__PURE__ */ jsxs4("div", {
480
- className: "altertable-data-boundary-notice",
481
- "data-state": view.kind,
482
- role: hasStaleError ? "alert" : "status",
483
- children: [
484
- updating ? /* @__PURE__ */ jsx8(AppIcon2, {
485
- name: "loading",
486
- size: 16,
487
- className: "altertable-data-boundary-spinner"
488
- }) : /* @__PURE__ */ jsx8(AppIcon2, {
489
- name: "error",
490
- size: 16
491
- }),
492
- /* @__PURE__ */ jsx8("span", {
493
- className: "altertable-data-boundary-message",
494
- children: view.message
495
- }),
496
- staleError && view.kind === "stale-error" && /* @__PURE__ */ jsx8("span", {
497
- className: "altertable-data-boundary-action",
498
- children: staleError(view.error)
499
- })
500
- ]
501
- }),
502
- /* @__PURE__ */ jsx8("div", {
503
- className: "altertable-data-boundary-content",
504
- "aria-busy": updating,
505
- children: children(view.data, view.kind === "ready" ? view.input : view.displayedInput)
506
- })
507
- ]
508
- });
509
- }
510
-
511
- // src/react/ui/StatusPanel.tsx
512
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
513
- function StatusPanel({
514
- status,
515
- title,
516
- description,
517
- details,
518
- action,
519
- children,
520
- className,
521
- role,
522
- ...props
523
- }) {
524
- return /* @__PURE__ */ jsxs5("div", {
525
- ...props,
526
- className: classNames("altertable-status-panel", className),
527
- "data-status": status,
528
- role: role ?? (status === "error" ? "alert" : "status"),
529
- children: [
530
- status === "error" && /* @__PURE__ */ jsx9(AppIcon2, {
531
- name: "error",
532
- size: 18
533
- }),
534
- /* @__PURE__ */ jsxs5("div", {
535
- className: "altertable-status-copy",
536
- children: [
537
- /* @__PURE__ */ jsx9("strong", {
538
- children: title
539
- }),
540
- description && /* @__PURE__ */ jsx9("p", {
541
- children: description
542
- }),
543
- details && /* @__PURE__ */ jsx9("small", {
544
- children: details
545
- }),
546
- children
547
- ]
548
- }),
549
- action && /* @__PURE__ */ jsx9("div", {
550
- className: "altertable-status-action",
551
- children: action
552
- })
553
- ]
554
- });
555
- }
556
-
557
- // src/react/ui/DataSectionBoundary.tsx
558
- import { jsx as jsx10 } from "react/jsx-runtime";
559
- function errorPresentation(cause) {
560
- const code = cause instanceof DataAppError2 ? cause.code : "request_failed";
561
- switch (code) {
562
- case "source_unauthorized":
563
- return {
564
- title: "Connection needs attention",
565
- description: "Ask the app owner to reconnect the lakehouse.",
566
- retryable: false
567
- };
568
- case "source_forbidden":
569
- return {
570
- title: "Data access denied",
571
- description: "The selected profile cannot read this data. Ask the app owner for access.",
572
- retryable: false
573
- };
574
- case "source_query_rejected":
575
- return {
576
- title: "This view cannot run its query",
577
- description: "Ask the app owner to check the data operation.",
578
- retryable: false
579
- };
580
- case "source_rate_limited":
581
- return {
582
- title: "Data source is busy",
583
- description: "The lakehouse is handling too many requests.",
584
- retryable: true
585
- };
586
- case "timeout":
587
- return {
588
- title: "Request timed out",
589
- description: "The lakehouse took too long to respond.",
590
- retryable: true
591
- };
592
- case "source_unavailable":
593
- return {
594
- title: "Couldn’t load results",
595
- description: "The lakehouse isn’t responding.",
596
- retryable: true
597
- };
598
- default:
599
- return {
600
- title: "Couldn’t load results",
601
- description: "The data request failed.",
602
- retryable: true
603
- };
604
- }
605
- }
606
- function DataSectionBoundary({
607
- result,
608
- children,
609
- emptyFallback,
610
- loadingFallback,
611
- error,
612
- label,
613
- notice: feedback,
614
- ...props
615
- }) {
616
- const fallback = emptyFallback ?? ("emptyFallback" in result ? result.emptyFallback : undefined);
617
- invariant(fallback, "A section needs an empty fallback from its result or props.");
618
- const defaults = useInspectionDefaults();
619
- const notice = feedback ?? (defaults?.primaryView === result.view ? "none" : "inline");
620
- return /* @__PURE__ */ jsx10(DataBoundary, {
621
- ...props,
622
- view: result.view,
623
- role: label ? "region" : undefined,
624
- "aria-label": label,
625
- notice,
626
- loadingFallback,
627
- emptyFallback: /* @__PURE__ */ jsx10(EmptyState2, {
628
- ...fallback
629
- }),
630
- error: (cause) => {
631
- const presentation = errorPresentation(cause);
632
- const retryAction = error?.onRetry ?? (presentation.retryable ? () => void result.refetch() : undefined);
633
- return /* @__PURE__ */ jsx10(StatusPanel, {
634
- status: "error",
635
- title: error?.title ?? presentation.title,
636
- description: error?.description ?? presentation.description,
637
- action: retryAction && /* @__PURE__ */ jsx10(Button2, {
638
- onClick: retryAction,
639
- children: "Retry"
640
- })
641
- });
642
- },
643
- staleError: () => /* @__PURE__ */ jsx10(Button2, {
644
- onClick: error?.onRetry ?? (() => void result.refetch()),
645
- children: "Retry"
646
- }),
647
- children
648
- });
649
- }
650
-
651
- // src/react/ui/DataSection.tsx
652
- import { jsx as jsx11 } from "react/jsx-runtime";
602
+ import { jsx as jsx8 } from "react/jsx-runtime";
653
603
  function DataSection({
654
604
  content,
655
605
  ...presentation
@@ -658,14 +608,14 @@ function DataSection({
658
608
  const { view, ...section } = sectionContent(content);
659
609
  if (primary?.declaration === view) {
660
610
  const result = primary.result;
661
- return /* @__PURE__ */ jsx11(DataSectionBoundary, {
611
+ return /* @__PURE__ */ jsx8(DataSectionBoundary, {
662
612
  ...section,
663
613
  ...presentation,
664
614
  result,
665
615
  notice: "none"
666
616
  });
667
617
  }
668
- return /* @__PURE__ */ jsx11(IndependentSection, {
618
+ return /* @__PURE__ */ jsx8(IndependentSection, {
669
619
  view,
670
620
  ...section,
671
621
  ...presentation
@@ -677,23 +627,26 @@ function IndependentSection({
677
627
  }) {
678
628
  const result = useDeclaredResult(view);
679
629
  const defaults = useInspectionDefaults();
680
- const section = /* @__PURE__ */ jsx11(DataSectionBoundary, {
630
+ const section = /* @__PURE__ */ jsx8(DataSectionBoundary, {
681
631
  ...props,
682
632
  result,
683
633
  notice: "inline"
684
634
  });
685
- return /* @__PURE__ */ jsx11(InspectionContext, {
686
- value: {
687
- ...defaults,
688
- dataContext: result.dataContext,
689
- queries: result.queries
690
- },
691
- children: section
635
+ return /* @__PURE__ */ jsx8(DateFormattingContext, {
636
+ value: { timeZone: result.timeZone },
637
+ children: /* @__PURE__ */ jsx8(InspectionContext, {
638
+ value: {
639
+ ...defaults,
640
+ dataContext: result.dataContext,
641
+ queries: result.queries
642
+ },
643
+ children: section
644
+ })
692
645
  });
693
646
  }
694
647
  // src/react/ui/UpdatedAt.tsx
695
- import { useEffect, useState } from "react";
696
- 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";
697
650
  function UpdatedAt({
698
651
  timestamp,
699
652
  locale,
@@ -702,13 +655,16 @@ function UpdatedAt({
702
655
  triggerProps,
703
656
  ...props
704
657
  }) {
705
- const [now, setNow] = useState(Date.now);
706
- useEffect(() => {
658
+ const defaults = useDateFormatting2({ locale, timeZone: props.timeZone });
659
+ const [now, setNow] = useState2(Date.now);
660
+ useEffect2(() => {
707
661
  const interval = window.setInterval(() => setNow(Date.now()), 30000);
708
662
  return () => window.clearInterval(interval);
709
663
  }, []);
710
664
  const elapsedMinutes = Math.floor(Math.max(0, now - timestamp) / 60000);
711
- const relative = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
665
+ const relative = new Intl.RelativeTimeFormat(defaults.locale, {
666
+ numeric: "auto"
667
+ });
712
668
  let age = "just now";
713
669
  if (elapsedMinutes >= 1440)
714
670
  age = relative.format(-Math.floor(elapsedMinutes / 1440), "day");
@@ -716,15 +672,20 @@ function UpdatedAt({
716
672
  age = relative.format(-Math.floor(elapsedMinutes / 60), "hour");
717
673
  else if (elapsedMinutes >= 1)
718
674
  age = relative.format(-elapsedMinutes, "minute");
719
- const date = new Date(timestamp);
720
- return /* @__PURE__ */ jsx12(DateTimeTooltip2, {
675
+ const date = parseDateTime2(timestamp);
676
+ if (!date)
677
+ return /* @__PURE__ */ jsx9("span", {
678
+ children: children ?? `${label} —`
679
+ });
680
+ return /* @__PURE__ */ jsx9(DateTimeTooltip2, {
721
681
  ...props,
682
+ ...defaults,
722
683
  date,
723
684
  triggerProps: {
724
685
  ...triggerProps,
725
686
  className: ["altertable-updated-at", triggerProps?.className].filter(Boolean).join(" ")
726
687
  },
727
- children: children ?? /* @__PURE__ */ jsxs6("time", {
688
+ children: children ?? /* @__PURE__ */ jsxs5("time", {
728
689
  dateTime: date.toISOString(),
729
690
  children: [
730
691
  label,
@@ -735,66 +696,67 @@ function UpdatedAt({
735
696
  });
736
697
  }
737
698
  // src/react/ui/PeriodSummary.tsx
738
- 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";
739
700
  function duration(period) {
740
701
  return `${period.amount} ${period.unit}${period.amount === 1 ? "" : "s"}`;
741
702
  }
742
- function label(period) {
703
+ function label(period, options = {}) {
743
704
  if (period.kind === "rolling")
744
705
  return `Last ${duration(period)}`;
745
- return formatDateRange2(period);
706
+ return formatDateRange2(period, options);
746
707
  }
747
- function comparisonLabel(period, comparison) {
708
+ function comparisonLabel(period, comparison, options) {
748
709
  if (comparison.kind === "period") {
749
710
  if (comparison.period.kind === "calendar")
750
- return label(comparison.period);
751
- return `${duration(comparison.period)} ending ${new Date(comparison.period.end).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" })}`;
711
+ return label(comparison.period, options);
712
+ return `${duration(comparison.period)} ending ${formatDateTime2(comparison.period.end, options)}`;
752
713
  }
753
714
  return period.kind === "rolling" ? `Previous ${duration(period)}` : "Previous period";
754
715
  }
755
- function reportingPeriodText(period) {
716
+ function reportingPeriodText(period, options = {}) {
756
717
  if (period.kind === "calendar")
757
- return `${label(period)} in ${period.timeZone}`;
758
- const end = new Date(period.end);
759
- if (Number.isNaN(end.getTime()))
760
- return label(period);
718
+ return `${label(period, options)} in ${period.timeZone}`;
719
+ const end = parseDateTime2(period.end);
720
+ if (!end)
721
+ return label(period, options);
761
722
  const start = new Date(end.getTime() - period.amount * (period.unit === "hour" ? 3600000 : 86400000));
762
- return `${label(period)}, ${start.toISOString()} to ${end.toISOString()}`;
723
+ return `${label(period, options)}, ${formatDateTime2(start, options)} to ${formatDateTime2(end, options)} in ${options.timeZone ?? "UTC"}`;
763
724
  }
764
725
  function PeriodSummary({
765
726
  period,
766
727
  comparison,
767
728
  className
768
729
  }) {
769
- const comparisonText = comparison ? comparisonLabel(period, comparison) : null;
770
- const comparisonDetail = comparison?.kind === "period" ? reportingPeriodText(comparison.period) : comparisonText;
771
- return /* @__PURE__ */ jsxs7("p", {
730
+ const options = useDateFormatting2();
731
+ const comparisonText = comparison ? comparisonLabel(period, comparison, options) : null;
732
+ const comparisonDetail = comparison?.kind === "period" ? reportingPeriodText(comparison.period, options) : comparisonText;
733
+ return /* @__PURE__ */ jsxs6("p", {
772
734
  className: classNames("altertable-period-summary", className),
773
735
  children: [
774
- /* @__PURE__ */ jsx13("span", {
736
+ /* @__PURE__ */ jsx10("span", {
775
737
  className: "altertable-sr-only",
776
- children: `Reporting period: ${reportingPeriodText(period)}${comparisonDetail ? `, compared with ${comparisonDetail}` : ""}`
738
+ children: `Reporting period: ${reportingPeriodText(period, options)}${comparisonDetail ? `, compared with ${comparisonDetail}` : ""}`
777
739
  }),
778
- /* @__PURE__ */ jsxs7("span", {
740
+ /* @__PURE__ */ jsxs6("span", {
779
741
  "aria-hidden": "true",
780
742
  className: "altertable-period-summary-visible",
781
743
  children: [
782
- /* @__PURE__ */ jsx13(AppIcon2, {
744
+ /* @__PURE__ */ jsx10(AppIcon2, {
783
745
  name: period.kind === "rolling" ? "clock" : "calendar",
784
746
  size: 16
785
747
  }),
786
- /* @__PURE__ */ jsx13("span", {
748
+ /* @__PURE__ */ jsx10("span", {
787
749
  className: "altertable-period-summary-current",
788
- children: label(period)
750
+ children: label(period, options)
789
751
  }),
790
- comparisonText && /* @__PURE__ */ jsxs7(Fragment2, {
752
+ comparisonText && /* @__PURE__ */ jsxs6(Fragment3, {
791
753
  children: [
792
- /* @__PURE__ */ jsx13("span", {
754
+ /* @__PURE__ */ jsx10("span", {
793
755
  className: "altertable-period-summary-vs",
794
756
  "aria-hidden": "true",
795
757
  children: "vs"
796
758
  }),
797
- /* @__PURE__ */ jsx13("span", {
759
+ /* @__PURE__ */ jsx10("span", {
798
760
  children: comparisonText
799
761
  })
800
762
  ]
@@ -805,7 +767,7 @@ function PeriodSummary({
805
767
  });
806
768
  }
807
769
  // src/react/ui/data-identifiers.tsx
808
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
770
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
809
771
  function qualifiedName(definition) {
810
772
  const table = definition.kind === "table" ? definition : definition.table;
811
773
  const path = [table.catalog, table.schema, table.name].join(".");
@@ -841,23 +803,23 @@ function defineDataIdentifiers({ tables, columns }) {
841
803
  const shown = display ?? (definition.kind === "table" ? "qualified" : "short");
842
804
  const table = definition.kind === "table" ? definition : definition.table;
843
805
  const prefix = definition.kind === "table" ? [table.catalog, table.schema] : [table.catalog, table.schema, table.name];
844
- return /* @__PURE__ */ jsxs8("code", {
806
+ return /* @__PURE__ */ jsxs7("code", {
845
807
  className: "altertable-data-identifier",
846
808
  "data-kind": definition.kind,
847
809
  title: qualified,
848
810
  "data-identifier-id": id,
849
811
  children: [
850
- shown === "qualified" && /* @__PURE__ */ jsx14("span", {
812
+ shown === "qualified" && /* @__PURE__ */ jsx11("span", {
851
813
  className: "altertable-data-identifier-path",
852
- children: prefix.map((segment, index) => /* @__PURE__ */ jsxs8("span", {
814
+ children: prefix.map((segment, index) => /* @__PURE__ */ jsxs7("span", {
853
815
  children: [
854
816
  segment,
855
817
  ".",
856
- /* @__PURE__ */ jsx14("wbr", {})
818
+ /* @__PURE__ */ jsx11("wbr", {})
857
819
  ]
858
820
  }, index))
859
821
  }),
860
- /* @__PURE__ */ jsx14("span", {
822
+ /* @__PURE__ */ jsx11("span", {
861
823
  className: "altertable-data-identifier-name",
862
824
  children: definition.name
863
825
  })
@@ -870,14 +832,14 @@ function defineDataIdentifiers({ tables, columns }) {
870
832
  };
871
833
  }
872
834
  // src/react/annotations/AnnotationTarget.tsx
873
- import { jsx as jsx15 } from "react/jsx-runtime";
835
+ import { jsx as jsx12 } from "react/jsx-runtime";
874
836
  function AnnotationTarget({
875
837
  annotationId,
876
838
  label,
877
839
  evidence,
878
840
  ...props
879
841
  }) {
880
- return /* @__PURE__ */ jsx15("div", {
842
+ return /* @__PURE__ */ jsx12("div", {
881
843
  ...props,
882
844
  ...getAnnotationProps({
883
845
  id: annotationId,
@@ -889,9 +851,9 @@ function AnnotationTarget({
889
851
  }
890
852
  // src/react/annotations/AnnotationBar.tsx
891
853
  import {
892
- useEffect as useEffect2,
854
+ useEffect as useEffect3,
893
855
  useEffectEvent,
894
- useRef,
856
+ useRef as useRef2,
895
857
  useReducer,
896
858
  useImperativeHandle
897
859
  } from "react";
@@ -913,7 +875,7 @@ import {
913
875
  Minus,
914
876
  LoaderCircle
915
877
  } from "lucide-react";
916
- 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";
917
879
  function annotationBarReducer(state, action) {
918
880
  switch (action.type) {
919
881
  case "positionMoved":
@@ -965,12 +927,12 @@ function AnnotationBar({
965
927
  onSend,
966
928
  onClose
967
929
  }) {
968
- const reviewElement = useRef(null);
969
- const reviewTrigger = useRef(null);
970
- const cancelDiscard = useRef(null);
971
- const barRef = useRef(null);
972
- const drag = useRef(undefined);
973
- 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);
974
936
  const [state, dispatch] = useReducer(annotationBarReducer, {
975
937
  reviewOpen: false,
976
938
  pending: false,
@@ -1006,11 +968,11 @@ function AnnotationBar({
1006
968
  if (position)
1007
969
  move(position.left, position.top);
1008
970
  });
1009
- useEffect2(() => {
971
+ useEffect3(() => {
1010
972
  window.addEventListener("resize", keepInViewport);
1011
973
  return () => window.removeEventListener("resize", keepInViewport);
1012
974
  }, []);
1013
- useEffect2(() => {
975
+ useEffect3(() => {
1014
976
  if (reviewOpen)
1015
977
  reviewElement.current?.querySelector("button")?.focus();
1016
978
  }, [reviewOpen]);
@@ -1037,7 +999,7 @@ function AnnotationBar({
1037
999
  }
1038
1000
  }
1039
1001
  useImperativeHandle(ref, () => ({ send }));
1040
- useEffect2(() => {
1002
+ useEffect3(() => {
1041
1003
  if (discardOpen)
1042
1004
  cancelDiscard.current?.focus();
1043
1005
  }, [discardOpen]);
@@ -1046,26 +1008,26 @@ function AnnotationBar({
1046
1008
  onClear();
1047
1009
  onClose();
1048
1010
  }
1049
- const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs9("div", {
1011
+ const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs8("div", {
1050
1012
  className: "altertable-annotation-undo",
1051
1013
  "data-theme": theme,
1052
1014
  "data-inline": active && reviewOpen && annotations.length > 0 || undefined,
1053
1015
  "data-bar-visible": active && annotations.length > 0 || undefined,
1054
1016
  children: [
1055
- /* @__PURE__ */ jsx16("output", {
1017
+ /* @__PURE__ */ jsx13("output", {
1056
1018
  children: "Annotation deleted"
1057
1019
  }),
1058
- /* @__PURE__ */ jsx16(Button2, {
1020
+ /* @__PURE__ */ jsx13(Button2, {
1059
1021
  variant: "ghost",
1060
1022
  onClick: () => onUndoDelete(deletedAnnotationId),
1061
1023
  children: "Undo"
1062
1024
  }),
1063
- onDismissUndo && /* @__PURE__ */ jsx16(Button2, {
1025
+ onDismissUndo && /* @__PURE__ */ jsx13(Button2, {
1064
1026
  variant: "ghost",
1065
1027
  size: "icon-compact",
1066
1028
  "aria-label": "Dismiss deleted annotation",
1067
1029
  onClick: onDismissUndo,
1068
- children: /* @__PURE__ */ jsx16(X, {
1030
+ children: /* @__PURE__ */ jsx13(X, {
1069
1031
  size: 14,
1070
1032
  "aria-hidden": true
1071
1033
  })
@@ -1080,9 +1042,9 @@ function AnnotationBar({
1080
1042
  bottom: "auto",
1081
1043
  transform: "none"
1082
1044
  } : {};
1083
- return /* @__PURE__ */ jsxs9(TooltipProvider2, {
1045
+ return /* @__PURE__ */ jsxs8(TooltipProvider2, {
1084
1046
  children: [
1085
- active && annotations.length > 0 && /* @__PURE__ */ jsxs9("div", {
1047
+ active && annotations.length > 0 && /* @__PURE__ */ jsxs8("div", {
1086
1048
  ref: barElementRef,
1087
1049
  className: "altertable-annotation-bar",
1088
1050
  "data-theme": theme,
@@ -1100,7 +1062,7 @@ function AnnotationBar({
1100
1062
  onClose();
1101
1063
  },
1102
1064
  children: [
1103
- /* @__PURE__ */ jsx16(Button2, {
1065
+ /* @__PURE__ */ jsx13(Button2, {
1104
1066
  variant: "ghost",
1105
1067
  size: "icon-compact",
1106
1068
  "aria-label": "Move annotation bar",
@@ -1142,12 +1104,12 @@ function AnnotationBar({
1142
1104
  event.preventDefault();
1143
1105
  move(rect.left + delta[0], rect.top + delta[1]);
1144
1106
  },
1145
- children: /* @__PURE__ */ jsx16(GripVertical, {
1107
+ children: /* @__PURE__ */ jsx13(GripVertical, {
1146
1108
  size: 16,
1147
1109
  "aria-hidden": true
1148
1110
  })
1149
1111
  }),
1150
- /* @__PURE__ */ jsxs9(Button2, {
1112
+ /* @__PURE__ */ jsxs8(Button2, {
1151
1113
  ref: reviewTrigger,
1152
1114
  className: "altertable-annotation-bar-count",
1153
1115
  variant: "ghost",
@@ -1162,51 +1124,51 @@ function AnnotationBar({
1162
1124
  annotations.length
1163
1125
  ]
1164
1126
  }),
1165
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1127
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1166
1128
  content: pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1167
1129
  theme,
1168
- children: /* @__PURE__ */ jsx16(Button2, {
1130
+ children: /* @__PURE__ */ jsx13(Button2, {
1169
1131
  variant: "ghost",
1170
1132
  size: "icon-compact",
1171
1133
  "aria-label": pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1172
1134
  "aria-pressed": !pinsVisible,
1173
1135
  disabled: locked,
1174
1136
  onClick: () => onPinsVisibleChange(!pinsVisible),
1175
- children: pinsVisible ? /* @__PURE__ */ jsx16(EyeOff, {
1137
+ children: pinsVisible ? /* @__PURE__ */ jsx13(EyeOff, {
1176
1138
  size: 16,
1177
1139
  "aria-hidden": true
1178
- }) : /* @__PURE__ */ jsx16(Eye, {
1140
+ }) : /* @__PURE__ */ jsx13(Eye, {
1179
1141
  size: 16,
1180
1142
  "aria-hidden": true
1181
1143
  })
1182
1144
  })
1183
1145
  }),
1184
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1146
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1185
1147
  content: "Discard all annotations",
1186
1148
  theme,
1187
- children: /* @__PURE__ */ jsx16(Button2, {
1149
+ children: /* @__PURE__ */ jsx13(Button2, {
1188
1150
  variant: "ghost",
1189
1151
  size: "icon-compact",
1190
1152
  "aria-label": "Discard all annotations",
1191
1153
  disabled: locked,
1192
1154
  onClick: () => requestDiscard ? requestDiscard(discardAnnotations) : dispatch({ type: "discardDialogChanged", open: true }),
1193
- children: /* @__PURE__ */ jsx16(Trash2, {
1155
+ children: /* @__PURE__ */ jsx13(Trash2, {
1194
1156
  size: 16,
1195
1157
  "aria-hidden": true
1196
1158
  })
1197
1159
  })
1198
1160
  }),
1199
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1200
- 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, {
1201
1163
  children: [
1202
1164
  "Send annotations ",
1203
- /* @__PURE__ */ jsx16(Kbd, {
1165
+ /* @__PURE__ */ jsx13(Kbd, {
1204
1166
  shortcut: shortcuts.sendAnnotations
1205
1167
  })
1206
1168
  ]
1207
1169
  }),
1208
1170
  theme,
1209
- children: /* @__PURE__ */ jsxs9(Button2, {
1171
+ children: /* @__PURE__ */ jsxs8(Button2, {
1210
1172
  className: "altertable-annotation-bar-send",
1211
1173
  "data-pending": pending || undefined,
1212
1174
  "aria-busy": pending,
@@ -1215,11 +1177,11 @@ function AnnotationBar({
1215
1177
  disabled: !canSend,
1216
1178
  onClick: () => void send(),
1217
1179
  children: [
1218
- /* @__PURE__ */ jsx16("span", {
1180
+ /* @__PURE__ */ jsx13("span", {
1219
1181
  className: "altertable-annotation-bar-send-label",
1220
1182
  children: "Send"
1221
1183
  }),
1222
- pending && /* @__PURE__ */ jsx16(LoaderCircle, {
1184
+ pending && /* @__PURE__ */ jsx13(LoaderCircle, {
1223
1185
  className: "altertable-annotation-bar-spinner",
1224
1186
  size: 16,
1225
1187
  "aria-hidden": true
@@ -1227,30 +1189,30 @@ function AnnotationBar({
1227
1189
  ]
1228
1190
  })
1229
1191
  }),
1230
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1231
- content: /* @__PURE__ */ jsxs9(Fragment3, {
1192
+ /* @__PURE__ */ jsx13(AnnotationTooltip, {
1193
+ content: /* @__PURE__ */ jsxs8(Fragment4, {
1232
1194
  children: [
1233
1195
  hasUnsavedChanges ? "Save or discard the open annotation first" : "Exit annotation mode",
1234
1196
  " ",
1235
- /* @__PURE__ */ jsx16(Kbd, {
1197
+ /* @__PURE__ */ jsx13(Kbd, {
1236
1198
  children: "Esc"
1237
1199
  })
1238
1200
  ]
1239
1201
  }),
1240
1202
  theme,
1241
- children: /* @__PURE__ */ jsx16(Button2, {
1203
+ children: /* @__PURE__ */ jsx13(Button2, {
1242
1204
  variant: "ghost",
1243
1205
  size: "icon-compact",
1244
1206
  "aria-label": "Exit annotation mode",
1245
1207
  disabled: locked || hasUnsavedChanges,
1246
1208
  onClick: onClose,
1247
- children: /* @__PURE__ */ jsx16(X, {
1209
+ children: /* @__PURE__ */ jsx13(X, {
1248
1210
  size: 16,
1249
1211
  "aria-hidden": true
1250
1212
  })
1251
1213
  })
1252
1214
  }),
1253
- error && /* @__PURE__ */ jsx16("output", {
1215
+ error && /* @__PURE__ */ jsx13("output", {
1254
1216
  className: "altertable-annotation-bar-error",
1255
1217
  role: "alert",
1256
1218
  children: error
@@ -1258,7 +1220,7 @@ function AnnotationBar({
1258
1220
  ]
1259
1221
  }),
1260
1222
  (!active || !reviewOpen || annotations.length === 0) && undo && createPortal(undo, document.body),
1261
- active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs9("dialog", {
1223
+ active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs8("dialog", {
1262
1224
  open: true,
1263
1225
  ref: reviewRef,
1264
1226
  className: "altertable-annotation-bar-panel",
@@ -1272,41 +1234,41 @@ function AnnotationBar({
1272
1234
  }
1273
1235
  },
1274
1236
  children: [
1275
- /* @__PURE__ */ jsxs9("header", {
1237
+ /* @__PURE__ */ jsxs8("header", {
1276
1238
  children: [
1277
- /* @__PURE__ */ jsx16("strong", {
1239
+ /* @__PURE__ */ jsx13("strong", {
1278
1240
  children: "Annotations"
1279
1241
  }),
1280
- /* @__PURE__ */ jsx16(Button2, {
1242
+ /* @__PURE__ */ jsx13(Button2, {
1281
1243
  variant: "ghost",
1282
1244
  size: "icon-compact",
1283
1245
  "aria-label": "Minimize annotation review",
1284
1246
  onClick: closeReview,
1285
- children: /* @__PURE__ */ jsx16(Minus, {
1247
+ children: /* @__PURE__ */ jsx13(Minus, {
1286
1248
  size: 16,
1287
1249
  "aria-hidden": true
1288
1250
  })
1289
1251
  })
1290
1252
  ]
1291
1253
  }),
1292
- /* @__PURE__ */ jsx16("div", {
1254
+ /* @__PURE__ */ jsx13("div", {
1293
1255
  "aria-label": "Annotation drafts",
1294
- children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs9("div", {
1256
+ children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs8("div", {
1295
1257
  className: "altertable-annotation-bar-row",
1296
1258
  children: [
1297
- annotation.context.screenshot && /* @__PURE__ */ jsx16("button", {
1259
+ annotation.context.screenshot && /* @__PURE__ */ jsx13("button", {
1298
1260
  "data-atbl-focus": "ring",
1299
1261
  "data-atbl-control": "action",
1300
1262
  type: "button",
1301
1263
  className: "altertable-annotation-thumbnail",
1302
1264
  "aria-label": `View screenshot of ${annotation.target.label}`,
1303
1265
  onClick: () => dispatch({ type: "previewOpened", id: annotation.id }),
1304
- children: /* @__PURE__ */ jsx16("img", {
1266
+ children: /* @__PURE__ */ jsx13("img", {
1305
1267
  src: annotation.context.screenshot.dataUrl,
1306
1268
  alt: ""
1307
1269
  })
1308
1270
  }),
1309
- /* @__PURE__ */ jsxs9(Button2, {
1271
+ /* @__PURE__ */ jsxs8(Button2, {
1310
1272
  variant: "ghost",
1311
1273
  className: "altertable-annotation-bar-open",
1312
1274
  "aria-label": `Open annotation ${index + 1}`,
@@ -1317,21 +1279,21 @@ function AnnotationBar({
1317
1279
  dispatch({ type: "reviewClosed" });
1318
1280
  },
1319
1281
  children: [
1320
- /* @__PURE__ */ jsx16("strong", {
1282
+ /* @__PURE__ */ jsx13("strong", {
1321
1283
  children: annotation.target.label
1322
1284
  }),
1323
- /* @__PURE__ */ jsx16("span", {
1285
+ /* @__PURE__ */ jsx13("span", {
1324
1286
  children: annotation.comment
1325
1287
  })
1326
1288
  ]
1327
1289
  }),
1328
- /* @__PURE__ */ jsx16(Button2, {
1290
+ /* @__PURE__ */ jsx13(Button2, {
1329
1291
  variant: "ghost",
1330
1292
  size: "icon-compact",
1331
1293
  "aria-label": `Delete annotation ${index + 1}`,
1332
1294
  disabled: locked,
1333
1295
  onClick: () => onDelete(annotation.id),
1334
- children: /* @__PURE__ */ jsx16(Trash2, {
1296
+ children: /* @__PURE__ */ jsx13(Trash2, {
1335
1297
  size: 16,
1336
1298
  "aria-hidden": true
1337
1299
  })
@@ -1342,7 +1304,7 @@ function AnnotationBar({
1342
1304
  undo
1343
1305
  ]
1344
1306
  }), document.body),
1345
- /* @__PURE__ */ jsx16(Sheet2, {
1307
+ /* @__PURE__ */ jsx13(Sheet2, {
1346
1308
  open: Boolean(preview),
1347
1309
  onOpenChange: (open) => {
1348
1310
  if (!open)
@@ -1353,27 +1315,27 @@ function AnnotationBar({
1353
1315
  title: preview?.target.label ?? "Screenshot",
1354
1316
  description: preview?.comment,
1355
1317
  returnFocus: reviewTrigger,
1356
- children: preview?.context.screenshot && /* @__PURE__ */ jsx16("img", {
1318
+ children: preview?.context.screenshot && /* @__PURE__ */ jsx13("img", {
1357
1319
  className: "altertable-annotation-preview",
1358
1320
  src: preview.context.screenshot.dataUrl,
1359
1321
  alt: `Captured area for ${preview.target.label}`
1360
1322
  })
1361
1323
  }),
1362
- !requestDiscard && /* @__PURE__ */ jsx16(Sheet2, {
1324
+ !requestDiscard && /* @__PURE__ */ jsx13(Sheet2, {
1363
1325
  open: discardOpen,
1364
1326
  onOpenChange: (open) => dispatch({ type: "discardDialogChanged", open }),
1365
1327
  placement: "center",
1366
1328
  title: "Discard all pending annotations?",
1367
1329
  returnFocus: barRef,
1368
- footer: /* @__PURE__ */ jsxs9(Fragment3, {
1330
+ footer: /* @__PURE__ */ jsxs8(Fragment4, {
1369
1331
  children: [
1370
- /* @__PURE__ */ jsx16(Button2, {
1332
+ /* @__PURE__ */ jsx13(Button2, {
1371
1333
  ref: cancelDiscard,
1372
1334
  variant: "ghost",
1373
1335
  onClick: () => dispatch({ type: "discardDialogChanged", open: false }),
1374
1336
  children: "Cancel"
1375
1337
  }),
1376
- /* @__PURE__ */ jsx16(Button2, {
1338
+ /* @__PURE__ */ jsx13(Button2, {
1377
1339
  className: "altertable-annotation-discard-confirm",
1378
1340
  disabled: locked,
1379
1341
  onClick: discardAnnotations,
@@ -1381,7 +1343,7 @@ function AnnotationBar({
1381
1343
  })
1382
1344
  ]
1383
1345
  }),
1384
- children: /* @__PURE__ */ jsx16("p", {
1346
+ children: /* @__PURE__ */ jsx13("p", {
1385
1347
  className: "altertable-annotation-discard-description",
1386
1348
  children: "These annotations will be removed and won’t be sent to the agent."
1387
1349
  })
@@ -1397,7 +1359,6 @@ function injectDataAppAnnotationStyles(options = {}) {
1397
1359
  css: `/* src/react/tokens.css */
1398
1360
  @layer atbl.tokens {
1399
1361
  :root {
1400
- --atbl-control-text-size: var(--atbl-type-body-size);
1401
1362
  --atbl-background: var(--atbl-palette-background);
1402
1363
  --atbl-surface: var(--atbl-palette-surface);
1403
1364
  --atbl-subtle: var(--atbl-palette-subtle);
@@ -1405,10 +1366,10 @@ function injectDataAppAnnotationStyles(options = {}) {
1405
1366
  --atbl-text: var(--atbl-palette-text);
1406
1367
  --atbl-muted: var(--atbl-palette-muted);
1407
1368
  --atbl-border: var(--atbl-palette-border);
1408
- --atbl-accent: var(--atbl-input-accent, #405d47);
1409
- --atbl-on-accent: var(--atbl-input-on-accent, #fff);
1410
- --atbl-danger: #b42318;
1411
- --atbl-danger-subtle: color-mix(in srgb, var(--atbl-danger) 9%, var(--atbl-surface));
1369
+ --atbl-accent: var(--atbl-palette-accent);
1370
+ --atbl-on-accent: var(--atbl-palette-on-accent);
1371
+ --atbl-positive: var(--atbl-palette-positive);
1372
+ --atbl-danger: var(--atbl-palette-danger);
1412
1373
  --atbl-code-surface: #f4f6f9;
1413
1374
  --atbl-code-text: #273242;
1414
1375
  --atbl-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
@@ -1420,7 +1381,7 @@ function injectDataAppAnnotationStyles(options = {}) {
1420
1381
  --atbl-space-md: 16px;
1421
1382
  --atbl-space-lg: 24px;
1422
1383
  --atbl-space-xl: 32px;
1423
- --atbl-content-width: 960px;
1384
+ --atbl-content-width: 1920px;
1424
1385
  --atbl-control-height: 2.375rem;
1425
1386
  --atbl-control-compact-height: 1.875rem;
1426
1387
  --atbl-control-icon-size: 1rem;
@@ -1428,6 +1389,10 @@ function injectDataAppAnnotationStyles(options = {}) {
1428
1389
  --atbl-control-padding-block: .375rem;
1429
1390
  --atbl-control-gap: .5rem;
1430
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;
1431
1396
  --atbl-radius-control: 7px;
1432
1397
  --atbl-radius-surface: 12px;
1433
1398
  --atbl-radius-overlay: 16px;
@@ -1455,7 +1420,7 @@ function injectDataAppAnnotationStyles(options = {}) {
1455
1420
  --atbl-type-meta-weight: 500;
1456
1421
  --atbl-type-page-size: clamp(1.375rem, 2.4vw, 1.75rem);
1457
1422
  --atbl-type-section-size: 1.25rem;
1458
- --atbl-type-widget-size: 1.0625rem;
1423
+ --atbl-type-widget-size: var(--atbl-type-label-size);
1459
1424
  --atbl-type-body-size: .875rem;
1460
1425
  --atbl-type-label-size: .8125rem;
1461
1426
  --atbl-type-meta-size: .75rem;
@@ -1479,6 +1444,10 @@ function injectDataAppAnnotationStyles(options = {}) {
1479
1444
  --atbl-palette-text: #202124;
1480
1445
  --atbl-palette-muted: #687078;
1481
1446
  --atbl-palette-border: #e3e6e8;
1447
+ --atbl-palette-accent: var(--atbl-input-accent, var(--atbl-text));
1448
+ --atbl-palette-on-accent: var(--atbl-input-on-accent, #fff);
1449
+ --atbl-palette-positive: #147862;
1450
+ --atbl-palette-danger: #b42318;
1482
1451
  --atbl-chart-strength: 100%;
1483
1452
  --atbl-accent-subtle-strength: 12%;
1484
1453
  }
@@ -1529,10 +1498,11 @@ function injectDataAppAnnotationStyles(options = {}) {
1529
1498
  }
1530
1499
 
1531
1500
  :root[data-atbl-theme="dark"] {
1532
- --atbl-accent: var(--atbl-input-dark-accent, color-mix(in srgb, var(--atbl-input-accent, #405d47) 50%, white));
1501
+ --atbl-palette-accent: var(--atbl-input-dark-accent, var(--atbl-text));
1533
1502
  --atbl-accent-subtle-strength: 22%;
1534
- --atbl-on-accent: var(--atbl-input-on-accent, var(--atbl-background));
1535
- --atbl-danger: #f97066;
1503
+ --atbl-palette-on-accent: var(--atbl-input-on-accent, var(--atbl-background));
1504
+ --atbl-palette-positive: #6bc39a;
1505
+ --atbl-palette-danger: #f97066;
1536
1506
  --atbl-backdrop: #0000008c;
1537
1507
  --atbl-code-surface: #242a31;
1538
1508
  --atbl-code-text: #e5e9ef;
@@ -1541,6 +1511,8 @@ function injectDataAppAnnotationStyles(options = {}) {
1541
1511
 
1542
1512
  :root[data-atbl-density="compact"] {
1543
1513
  --atbl-control-height: 2.125rem;
1514
+ --atbl-control-compact-height: 1.625rem;
1515
+ --atbl-control-gap: .375rem;
1544
1516
  --atbl-control-padding-inline: .625rem;
1545
1517
  --atbl-control-padding-block: .25rem;
1546
1518
  --atbl-space-xs: 4px;
@@ -1552,6 +1524,8 @@ function injectDataAppAnnotationStyles(options = {}) {
1552
1524
 
1553
1525
  :root[data-atbl-density="spacious"] {
1554
1526
  --atbl-control-height: 2.625rem;
1527
+ --atbl-control-compact-height: 2.125rem;
1528
+ --atbl-control-gap: .625rem;
1555
1529
  --atbl-control-padding-inline: 1rem;
1556
1530
  --atbl-control-padding-block: .5rem;
1557
1531
  --atbl-space-xs: 6px;
@@ -1588,6 +1562,7 @@ function injectDataAppAnnotationStyles(options = {}) {
1588
1562
  :root[data-atbl-elevation="raised"] {
1589
1563
  --atbl-shadow-surface: 0 8px 28px #141c281a;
1590
1564
  --atbl-shadow-overlay: 0 24px 72px #0000003d;
1565
+ --atbl-shadow-control: 0 2px 6px #00000029;
1591
1566
  }
1592
1567
 
1593
1568
  @media (forced-colors: active) {
@@ -1748,8 +1723,8 @@ function injectDataAppAnnotationStyles(options = {}) {
1748
1723
 
1749
1724
  .altertable-button[data-size="compact"] {
1750
1725
  min-height: var(--atbl-control-compact-height);
1726
+ padding: calc(var(--atbl-control-padding-block) * 2 / 3) calc(var(--atbl-control-padding-inline) * 2 / 3);
1751
1727
  font-size: var(--atbl-type-meta-size);
1752
- padding: .25rem .5rem;
1753
1728
  }
1754
1729
 
1755
1730
  .altertable-button[data-size="icon-compact"] {
@@ -1765,6 +1740,32 @@ function injectDataAppAnnotationStyles(options = {}) {
1765
1740
  inline-size: var(--atbl-control-icon-size);
1766
1741
  block-size: var(--atbl-control-icon-size);
1767
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
+ }
1768
1769
  }
1769
1770
 
1770
1771
  /* src/react/ui/Tooltip.css */
@@ -1858,6 +1859,12 @@ function injectDataAppAnnotationStyles(options = {}) {
1858
1859
  min-width: 1.6em;
1859
1860
  padding: 2px 5px;
1860
1861
  }
1862
+
1863
+ .altertable-button[data-variant="primary"] .altertable-kbd {
1864
+ color: inherit;
1865
+ border-color: color-mix(in srgb, currentColor 30%, transparent);
1866
+ background: none;
1867
+ }
1861
1868
  }
1862
1869
 
1863
1870
  /* src/react/annotations/AnnotationBar.css */
@@ -2214,7 +2221,7 @@ function injectDataAppAnnotationStyles(options = {}) {
2214
2221
 
2215
2222
  .altertable-sheet {
2216
2223
  position: fixed;
2217
- overflow: hidden;
2224
+ overflow: visible;
2218
2225
  border: 0;
2219
2226
  border-left: 1px solid var(--atbl-border);
2220
2227
  background: var(--atbl-surface);
@@ -2284,20 +2291,20 @@ function injectDataAppAnnotationStyles(options = {}) {
2284
2291
 
2285
2292
  .altertable-sheet-header {
2286
2293
  display: flex;
2287
- border-bottom: 1px solid var(--atbl-border);
2288
2294
  justify-content: space-between;
2289
2295
  align-items: flex-start;
2290
- gap: 16px;
2291
- padding: 24px 28px 20px;
2296
+ gap: var(--atbl-space-md);
2297
+ padding: var(--atbl-space-lg) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2) calc((var(--atbl-space-md) + var(--atbl-space-lg)) / 2);
2298
+ border-bottom: 1px solid var(--atbl-border);
2292
2299
  }
2293
2300
 
2294
2301
  .altertable-sheet-header h2 {
2302
+ font-size: var(--atbl-type-section-size);
2303
+ font-weight: var(--atbl-type-heading-weight);
2304
+ line-height: var(--atbl-type-heading-leading);
2295
2305
  letter-spacing: -.02em;
2296
2306
  overflow-wrap: anywhere;
2297
2307
  margin: 0;
2298
- font-size: 18px;
2299
- font-weight: 650;
2300
- line-height: 1.25;
2301
2308
  }
2302
2309
 
2303
2310
  .altertable-sheet-header p {
@@ -2321,13 +2328,36 @@ function injectDataAppAnnotationStyles(options = {}) {
2321
2328
  .altertable-sheet-body {
2322
2329
  overflow-y: auto;
2323
2330
  overscroll-behavior: contain;
2331
+ padding: var(--atbl-space-lg) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2) calc(var(--atbl-space-xl) + var(--atbl-space-md) / 2);
2324
2332
  min-height: 0;
2325
- padding: 24px 28px 40px;
2326
2333
  }
2327
2334
 
2328
2335
  .altertable-sheet-footer {
2336
+ padding: var(--atbl-space-md) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2);
2329
2337
  border-top: 1px solid var(--atbl-border);
2330
- padding: 16px 28px;
2338
+ }
2339
+
2340
+ @media (min-width: 601px) {
2341
+ .altertable-sheet:where([data-placement="side"][data-side="left"]) {
2342
+ border-left: 0;
2343
+ border-right: 1px solid var(--atbl-border);
2344
+ inset: 0 auto 0 0;
2345
+ translate: -100%;
2346
+ }
2347
+
2348
+ .altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
2349
+ translate: 0;
2350
+ }
2351
+
2352
+ .altertable-sheet:where([data-placement="side"][data-side="left"])[open][data-closing] {
2353
+ translate: -100%;
2354
+ }
2355
+
2356
+ @starting-style {
2357
+ .altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
2358
+ translate: -100%;
2359
+ }
2360
+ }
2331
2361
  }
2332
2362
 
2333
2363
  @media (max-width: 960px) {
@@ -2593,12 +2623,12 @@ function injectDataAppAnnotationStyles(options = {}) {
2593
2623
 
2594
2624
  [data-atbl-control="text"] {
2595
2625
  cursor: text;
2596
- font-size: var(--atbl-control-text-size);
2626
+ font-size: var(--atbl-control-text-size, var(--atbl-type-body-size));
2597
2627
  }
2598
2628
 
2599
2629
  @media (max-width: 560px), (any-pointer: coarse) {
2600
2630
  [data-atbl-control="text"] {
2601
- font-size: max(16px, var(--atbl-control-text-size));
2631
+ font-size: max(16px, var(--atbl-control-text-size, var(--atbl-type-body-size)));
2602
2632
  }
2603
2633
  }
2604
2634
 
@@ -2682,30 +2712,93 @@ function injectDataAppAnnotationStyles(options = {}) {
2682
2712
  background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
2683
2713
  }
2684
2714
 
2685
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-webkit-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2686
- background: var(--atbl-control-selected-surface, var(--atbl-accent-subtle, color-mix(in srgb, var(--atbl-accent) var(--atbl-accent-subtle-strength), var(--atbl-surface))));
2687
- color: var(--atbl-control-selected-text, var(--atbl-accent));
2715
+ :where([data-atbl-internal-surface="control"]):-webkit-any([aria-expanded="true"], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2716
+ background: var(--atbl-control-open-surface, var(--atbl-surface));
2717
+ }
2718
+
2719
+ :where([data-atbl-internal-surface="control"]):-moz-any([aria-expanded="true"], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2720
+ background: var(--atbl-control-open-surface, var(--atbl-surface));
2721
+ }
2722
+
2723
+ :where([data-atbl-internal-surface="control"]):is([aria-expanded="true"], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2724
+ background: var(--atbl-control-open-surface, var(--atbl-surface));
2725
+ }
2726
+
2727
+ :where([data-atbl-internal-surface="control"]):-webkit-any([data-variant="outline"], [data-variant="elevated"]):-webkit-any([aria-expanded="true"], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2728
+ border-color: var(--atbl-control-open-border, var(--atbl-muted));
2729
+ }
2730
+
2731
+ :where([data-atbl-internal-surface="control"]):-moz-any([data-variant="outline"], [data-variant="elevated"]):-moz-any([aria-expanded="true"], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2732
+ border-color: var(--atbl-control-open-border, var(--atbl-muted));
2733
+ }
2734
+
2735
+ :where([data-atbl-internal-surface="control"]):is([data-variant="outline"], [data-variant="elevated"]):is([aria-expanded="true"], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2736
+ border-color: var(--atbl-control-open-border, var(--atbl-muted));
2737
+ }
2738
+
2739
+ :where([data-atbl-internal-surface="control"]):-webkit-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2740
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2741
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2742
+ }
2743
+
2744
+ :where([data-atbl-internal-surface="control"]):-moz-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2745
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2746
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2747
+ }
2748
+
2749
+ :where([data-atbl-internal-surface="control"]):is([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2750
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2751
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2752
+ }
2753
+
2754
+ :where([data-atbl-internal-surface="option"])[data-selected]:not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2755
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2756
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2757
+ }
2758
+
2759
+ :where([data-atbl-internal-surface="option"])[data-selected]:not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2760
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2761
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2762
+ }
2763
+
2764
+ :where([data-atbl-internal-surface="option"])[data-selected]:not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2765
+ background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2766
+ color: var(--atbl-control-selected-text, var(--atbl-text));
2767
+ }
2768
+
2769
+ :where([data-atbl-internal-surface="option"])[data-selected]:-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2770
+ background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2771
+ }
2772
+
2773
+ :where([data-atbl-internal-surface="option"])[data-selected]:-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2774
+ background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2775
+ }
2776
+
2777
+ :where([data-atbl-internal-surface="option"])[data-selected]:is(:hover, [data-hovered]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2778
+ background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2779
+ }
2780
+
2781
+ :where([data-atbl-internal-surface="option"])[data-selected]:-webkit-any(:active, [data-pressed]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2782
+ background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2688
2783
  }
2689
2784
 
2690
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-moz-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2691
- background: var(--atbl-control-selected-surface, var(--atbl-accent-subtle, color-mix(in srgb, var(--atbl-accent) var(--atbl-accent-subtle-strength), var(--atbl-surface))));
2692
- color: var(--atbl-control-selected-text, var(--atbl-accent));
2785
+ :where([data-atbl-internal-surface="option"])[data-selected]:-moz-any(:active, [data-pressed]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2786
+ background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2693
2787
  }
2694
2788
 
2695
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):is([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2696
- background: var(--atbl-control-selected-surface, var(--atbl-accent-subtle, color-mix(in srgb, var(--atbl-accent) var(--atbl-accent-subtle-strength), var(--atbl-surface))));
2697
- color: var(--atbl-control-selected-text, var(--atbl-accent));
2789
+ :where([data-atbl-internal-surface="option"])[data-selected]:is(:active, [data-pressed]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2790
+ background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2698
2791
  }
2699
2792
 
2700
- [data-atbl-internal-surface="field"]:-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:has(input:disabled), [data-disabled], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2793
+ :where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2701
2794
  border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2702
2795
  }
2703
2796
 
2704
- [data-atbl-internal-surface="field"]:-moz-any(:hover, [data-hovered]):not(:-moz-any(:has(input:disabled), [data-disabled], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2797
+ :where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2705
2798
  border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2706
2799
  }
2707
2800
 
2708
- [data-atbl-internal-surface="field"]:is(:hover, [data-hovered]):not(:is(:has(input:disabled), [data-disabled], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2801
+ :where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):is(:hover, [data-hovered]):not(:is(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
2709
2802
  border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2710
2803
  }
2711
2804
 
@@ -2757,16 +2850,20 @@ export {
2757
2850
  DataApp,
2758
2851
  DataSection,
2759
2852
  DataValue,
2853
+ DateDisplay2 as DateDisplay,
2760
2854
  DateTimeTooltip2 as DateTimeTooltip,
2855
+ DetailContent2 as DetailContent,
2856
+ DetailView2 as DetailView,
2761
2857
  EmptyState2 as EmptyState,
2762
- Grid2 as Grid,
2858
+ Grid,
2763
2859
  GridItem,
2764
2860
  IconButton2 as IconButton,
2765
2861
  MetricWidget,
2766
2862
  PeriodSummary,
2767
2863
  Ranking,
2864
+ SectionHeading2 as SectionHeading,
2768
2865
  Skeleton2 as Skeleton,
2769
- Stack,
2866
+ Stack2 as Stack,
2770
2867
  TableWidget,
2771
2868
  TextContent2 as TextContent,
2772
2869
  TextWidget,
@@ -2785,7 +2882,9 @@ export {
2785
2882
  mountDataApp2 as mountDataApp,
2786
2883
  multiChoiceVariable2 as multiChoiceVariable,
2787
2884
  searchVariable2 as searchVariable,
2788
- useDataAppAnnotations2 as useDataAppAnnotations
2885
+ useDataAppAnnotations2 as useDataAppAnnotations,
2886
+ useDateFormatting2 as useDateFormatting,
2887
+ useDetailNavigation2 as useDetailNavigation
2789
2888
  };
2790
2889
 
2791
- //# debugId=F82763879127085B64756E2164756E21
2890
+ //# debugId=004515EB2CD3758264756E2164756E21