@altertable/data-app 0.69.0 → 0.71.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 (289) hide show
  1. package/AGENTS.md +11 -1
  2. package/CONTRIBUTING.md +59 -26
  3. package/README.md +22 -26
  4. package/REFERENCE.md +1900 -0
  5. package/dist/chunks/index-5a27erdg.js +54 -0
  6. package/dist/chunks/index-5a27erdg.js.map +10 -0
  7. package/dist/chunks/{index-2sbp9h2b.js → index-9yxr7nmm.js} +330 -21
  8. package/dist/chunks/index-9yxr7nmm.js.map +17 -0
  9. package/dist/chunks/{index-r7b1ftwy.js → index-j5q5n3ra.js} +8 -6
  10. package/dist/chunks/index-j5q5n3ra.js.map +10 -0
  11. package/dist/chunks/{index-22d576sn.js → index-q75zm3a7.js} +3 -3
  12. package/dist/chunks/{index-22d576sn.js.map → index-q75zm3a7.js.map} +3 -3
  13. package/dist/chunks/{index-kwnqycjt.js → index-vhaec7m5.js} +8 -6
  14. package/dist/chunks/index-vhaec7m5.js.map +10 -0
  15. package/dist/chunks/index-zp78caex.js +1047 -0
  16. package/dist/chunks/index-zp78caex.js.map +19 -0
  17. package/dist/client/index.js +284 -16
  18. package/dist/client/index.js.map +7 -3
  19. package/dist/core/appearance.js +181 -11
  20. package/dist/core/appearance.js.map +4 -3
  21. package/dist/core/config.js +3 -3
  22. package/dist/core/contract.js +13 -15
  23. package/dist/core/contract.js.map +1 -1
  24. package/dist/core/format.js +1 -1
  25. package/dist/index.js +4 -4
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal.js +418 -0
  28. package/dist/internal.js.map +15 -0
  29. package/dist/server/index.js +102 -0
  30. package/dist/server/index.js.map +10 -0
  31. package/dist/types/client/annotations.d.ts +1 -1
  32. package/dist/types/client/data-client.d.ts +21 -10
  33. package/dist/types/client/iframe.d.ts +6 -6
  34. package/dist/types/client/index.d.ts +3 -4
  35. package/dist/types/client/location.d.ts +2 -2
  36. package/dist/types/client/logger.d.ts +1 -1
  37. package/dist/types/client/navigation.d.ts +1 -1
  38. package/dist/types/client/transport.d.ts +1 -1
  39. package/dist/types/core/bridge.d.ts +1 -1
  40. package/dist/types/core/config.d.ts +20 -17
  41. package/dist/types/core/contract.d.ts +23 -13
  42. package/dist/types/core/dimension-source.d.ts +64 -0
  43. package/dist/types/core/dimension.d.ts +31 -23
  44. package/dist/types/core/facets.d.ts +13 -0
  45. package/dist/types/core/filters.d.ts +1 -1
  46. package/dist/types/core/format.d.ts +1 -2
  47. package/dist/types/core/keys.d.ts +2 -0
  48. package/dist/types/core/messages.d.ts +3 -3
  49. package/dist/types/core/operation-types.d.ts +7 -6
  50. package/dist/types/core/presentation.d.ts +1 -1
  51. package/dist/types/core/queries.d.ts +75 -7
  52. package/dist/types/core/reading.d.ts +1 -1
  53. package/dist/types/core/variables.d.ts +38 -12
  54. package/dist/types/index.d.ts +1 -1
  55. package/dist/types/internal.d.ts +22 -0
  56. package/dist/types/server/index.d.ts +1 -2
  57. package/docs/app-authoring.md +12 -4
  58. package/docs/client.md +5 -6
  59. package/docs/composition.md +84 -0
  60. package/docs/contract.md +41 -21
  61. package/docs/data-context.md +5 -3
  62. package/docs/embed.md +4 -4
  63. package/docs/formatting-and-appearance.md +1 -1
  64. package/docs/hosted-apps.md +4 -0
  65. package/docs/react-embed.md +7 -6
  66. package/docs/react.md +5 -5
  67. package/docs/server-bun.md +5 -5
  68. package/docs/server.md +1 -1
  69. package/docs/stories-and-export.md +3 -3
  70. package/docs/styling.md +6 -2
  71. package/docs/ui.md +18 -7
  72. package/docs/variables.md +83 -11
  73. package/docs/views.md +57 -3
  74. package/docs/widgets.md +97 -4
  75. package/docs/worker.md +4 -4
  76. package/examples/starter-data-app/index.tsx +11 -23
  77. package/examples/starter-local-data-app/AGENTS.md +1 -1
  78. package/examples/starter-local-data-app/README.md +12 -10
  79. package/examples/starter-local-data-app/app.ts +7 -1
  80. package/examples/starter-local-data-app/package.json +3 -1
  81. package/examples/starter-local-data-app/src/App.tsx +1 -1
  82. package/examples/starter-local-data-app/src/data-context.ts +1 -1
  83. package/examples/starter-local-data-app/src/main.tsx +1 -1
  84. package/examples/starter-local-data-app/src/server.ts +1 -1
  85. package/examples/starter-local-data-app/tsconfig.json +7 -1
  86. package/package.json +16 -92
  87. package/THIRD_PARTY_NOTICES +0 -18
  88. package/dist/chunks/index-2sbp9h2b.js.map +0 -13
  89. package/dist/chunks/index-ap60vggk.js +0 -80
  90. package/dist/chunks/index-ap60vggk.js.map +0 -10
  91. package/dist/chunks/index-cv36cyna.js +0 -180
  92. package/dist/chunks/index-cv36cyna.js.map +0 -10
  93. package/dist/chunks/index-k766wwwr.js +0 -643
  94. package/dist/chunks/index-k766wwwr.js.map +0 -13
  95. package/dist/chunks/index-kwnqycjt.js.map +0 -10
  96. package/dist/chunks/index-m0gbxtgp.js +0 -355
  97. package/dist/chunks/index-m0gbxtgp.js.map +0 -13
  98. package/dist/chunks/index-qhzdzca2.js +0 -15869
  99. package/dist/chunks/index-qhzdzca2.js.map +0 -118
  100. package/dist/chunks/index-r7b1ftwy.js.map +0 -10
  101. package/dist/chunks/index-sx488hvs.js +0 -221
  102. package/dist/chunks/index-sx488hvs.js.map +0 -12
  103. package/dist/chunks/index-wss3gd3h.js +0 -319
  104. package/dist/chunks/index-wss3gd3h.js.map +0 -13
  105. package/dist/chunks/index-zcqxfwdq.js +0 -197
  106. package/dist/chunks/index-zcqxfwdq.js.map +0 -13
  107. package/dist/embed/index.js +0 -138
  108. package/dist/embed/index.js.map +0 -12
  109. package/dist/local.js +0 -432
  110. package/dist/local.js.map +0 -14
  111. package/dist/preview.js +0 -1456
  112. package/dist/preview.js.map +0 -17
  113. package/dist/react/embed/index.js +0 -117
  114. package/dist/react/embed/index.js.map +0 -10
  115. package/dist/react/index.js +0 -2948
  116. package/dist/react/index.js.map +0 -26
  117. package/dist/react/ui/index.js +0 -3142
  118. package/dist/react/ui/index.js.map +0 -35
  119. package/dist/server.js +0 -301
  120. package/dist/server.js.map +0 -13
  121. package/dist/types/core/time-interval.d.ts +0 -96
  122. package/dist/types/embed/bootstrap.d.ts +0 -5
  123. package/dist/types/embed/bridge.d.ts +0 -12
  124. package/dist/types/embed/host.d.ts +0 -36
  125. package/dist/types/embed/index.d.ts +0 -14
  126. package/dist/types/embed/navigation.d.ts +0 -6
  127. package/dist/types/embed/runtime-html.d.ts +0 -2
  128. package/dist/types/embed/source.d.ts +0 -16
  129. package/dist/types/embed/sql.d.ts +0 -4
  130. package/dist/types/react/annotations/AnnotationBar.d.ts +0 -30
  131. package/dist/types/react/annotations/AnnotationControls.d.ts +0 -10
  132. package/dist/types/react/annotations/AnnotationEditor.d.ts +0 -16
  133. package/dist/types/react/annotations/AnnotationMarkers.d.ts +0 -19
  134. package/dist/types/react/annotations/AnnotationSelectionLayer.d.ts +0 -12
  135. package/dist/types/react/annotations/AnnotationTarget.d.ts +0 -9
  136. package/dist/types/react/annotations/AnnotationTooltip.d.ts +0 -9
  137. package/dist/types/react/annotations/AnnotationTrigger.d.ts +0 -10
  138. package/dist/types/react/annotations/annotation-editor-state.d.ts +0 -58
  139. package/dist/types/react/annotations/annotation-screenshot.d.ts +0 -4
  140. package/dist/types/react/annotations/annotation-targets.d.ts +0 -34
  141. package/dist/types/react/annotations/getAnnotationProps.d.ts +0 -17
  142. package/dist/types/react/annotations/styles.d.ts +0 -3
  143. package/dist/types/react/annotations/useAnnotationGeometry.d.ts +0 -22
  144. package/dist/types/react/annotations/useDataAppAnnotations.d.ts +0 -22
  145. package/dist/types/react/app-context.d.ts +0 -3
  146. package/dist/types/react/bindings.d.ts +0 -133
  147. package/dist/types/react/content.d.ts +0 -36
  148. package/dist/types/react/date-formatting.d.ts +0 -12
  149. package/dist/types/react/embed/bridge.d.ts +0 -21
  150. package/dist/types/react/embed/index.d.ts +0 -7
  151. package/dist/types/react/hooks.d.ts +0 -75
  152. package/dist/types/react/index.d.ts +0 -75
  153. package/dist/types/react/injectStyles.d.ts +0 -7
  154. package/dist/types/react/mount.d.ts +0 -13
  155. package/dist/types/react/search-suggestions.d.ts +0 -8
  156. package/dist/types/react/source-owner.d.ts +0 -2
  157. package/dist/types/react/style-contract.d.ts +0 -88
  158. package/dist/types/react/style-validation.d.ts +0 -2
  159. package/dist/types/react/styles.d.ts +0 -8
  160. package/dist/types/react/ui/AboutData.d.ts +0 -68
  161. package/dist/types/react/ui/AltertableLogo.d.ts +0 -3
  162. package/dist/types/react/ui/AppFooter.d.ts +0 -6
  163. package/dist/types/react/ui/AppHeader.d.ts +0 -10
  164. package/dist/types/react/ui/AppLayout.d.ts +0 -10
  165. package/dist/types/react/ui/AppScope.d.ts +0 -7
  166. package/dist/types/react/ui/AppToolbar.d.ts +0 -30
  167. package/dist/types/react/ui/AreaChart.d.ts +0 -7
  168. package/dist/types/react/ui/BarChart.d.ts +0 -6
  169. package/dist/types/react/ui/Breakdown.d.ts +0 -13
  170. package/dist/types/react/ui/Button.d.ts +0 -11
  171. package/dist/types/react/ui/ChartLegend.d.ts +0 -32
  172. package/dist/types/react/ui/Checkbox.d.ts +0 -21
  173. package/dist/types/react/ui/CheckboxGroup.d.ts +0 -7
  174. package/dist/types/react/ui/ChoicePicker.d.ts +0 -39
  175. package/dist/types/react/ui/Comparison.d.ts +0 -14
  176. package/dist/types/react/ui/ComposedChart.d.ts +0 -41
  177. package/dist/types/react/ui/ComposedChartLegend.d.ts +0 -8
  178. package/dist/types/react/ui/ContentSkeleton.d.ts +0 -7
  179. package/dist/types/react/ui/DataApp.d.ts +0 -21
  180. package/dist/types/react/ui/DataAppFrame.d.ts +0 -52
  181. package/dist/types/react/ui/DataBoundary.d.ts +0 -14
  182. package/dist/types/react/ui/DataSection.d.ts +0 -14
  183. package/dist/types/react/ui/DataSectionBoundary.d.ts +0 -30
  184. package/dist/types/react/ui/DataTable.d.ts +0 -29
  185. package/dist/types/react/ui/DataValue.d.ts +0 -9
  186. package/dist/types/react/ui/DataViewToast.d.ts +0 -11
  187. package/dist/types/react/ui/DataWidget.d.ts +0 -34
  188. package/dist/types/react/ui/DateDisplay.d.ts +0 -9
  189. package/dist/types/react/ui/DateRangePicker.d.ts +0 -30
  190. package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -10
  191. package/dist/types/react/ui/DimensionPicker.d.ts +0 -13
  192. package/dist/types/react/ui/EmptyState.d.ts +0 -6
  193. package/dist/types/react/ui/ExportControl.d.ts +0 -4
  194. package/dist/types/react/ui/FilterActions.d.ts +0 -10
  195. package/dist/types/react/ui/FilterBar.d.ts +0 -3
  196. package/dist/types/react/ui/FunnelChart.d.ts +0 -20
  197. package/dist/types/react/ui/GettingStarted.d.ts +0 -6
  198. package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -7
  199. package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -16
  200. package/dist/types/react/ui/GradientScroll.d.ts +0 -23
  201. package/dist/types/react/ui/Grid.d.ts +0 -12
  202. package/dist/types/react/ui/GridItem.d.ts +0 -7
  203. package/dist/types/react/ui/HelpPopover.d.ts +0 -21
  204. package/dist/types/react/ui/IconButton.d.ts +0 -19
  205. package/dist/types/react/ui/InspectionContext.d.ts +0 -12
  206. package/dist/types/react/ui/InspectionProvider.d.ts +0 -29
  207. package/dist/types/react/ui/JourneyChart.d.ts +0 -10
  208. package/dist/types/react/ui/Kbd.d.ts +0 -7
  209. package/dist/types/react/ui/LineChart.d.ts +0 -7
  210. package/dist/types/react/ui/LiveControl.d.ts +0 -10
  211. package/dist/types/react/ui/Menu.d.ts +0 -12
  212. package/dist/types/react/ui/MetricWidget.d.ts +0 -49
  213. package/dist/types/react/ui/NumberField.d.ts +0 -27
  214. package/dist/types/react/ui/NumberFilterPicker.d.ts +0 -11
  215. package/dist/types/react/ui/PeriodSummary.d.ts +0 -17
  216. package/dist/types/react/ui/PickerField.d.ts +0 -15
  217. package/dist/types/react/ui/PieChart.d.ts +0 -11
  218. package/dist/types/react/ui/PopoverSurface.d.ts +0 -5
  219. package/dist/types/react/ui/PresentStory.d.ts +0 -30
  220. package/dist/types/react/ui/QueryList.d.ts +0 -14
  221. package/dist/types/react/ui/RadioGroup.d.ts +0 -18
  222. package/dist/types/react/ui/Ranking.d.ts +0 -13
  223. package/dist/types/react/ui/RefreshControl.d.ts +0 -9
  224. package/dist/types/react/ui/RequestHint.d.ts +0 -20
  225. package/dist/types/react/ui/RetentionChart.d.ts +0 -27
  226. package/dist/types/react/ui/ScatterChart.d.ts +0 -17
  227. package/dist/types/react/ui/SearchField.d.ts +0 -23
  228. package/dist/types/react/ui/SearchInput.d.ts +0 -10
  229. package/dist/types/react/ui/SearchMatch.d.ts +0 -6
  230. package/dist/types/react/ui/SearchTypeahead.d.ts +0 -15
  231. package/dist/types/react/ui/SectionHeading.d.ts +0 -8
  232. package/dist/types/react/ui/Select.d.ts +0 -18
  233. package/dist/types/react/ui/SelectionMark.d.ts +0 -5
  234. package/dist/types/react/ui/Sheet.d.ts +0 -21
  235. package/dist/types/react/ui/Skeleton.d.ts +0 -8
  236. package/dist/types/react/ui/Stack.d.ts +0 -7
  237. package/dist/types/react/ui/StaticDataApp.d.ts +0 -4
  238. package/dist/types/react/ui/StatusPanel.d.ts +0 -10
  239. package/dist/types/react/ui/TableWidget.d.ts +0 -67
  240. package/dist/types/react/ui/Tabs.d.ts +0 -10
  241. package/dist/types/react/ui/TextContent.d.ts +0 -4
  242. package/dist/types/react/ui/TextWidget.d.ts +0 -20
  243. package/dist/types/react/ui/ThemeSelector.d.ts +0 -12
  244. package/dist/types/react/ui/Toast.d.ts +0 -8
  245. package/dist/types/react/ui/Tooltip.d.ts +0 -23
  246. package/dist/types/react/ui/TooltipSurface.d.ts +0 -3
  247. package/dist/types/react/ui/TrendChart.d.ts +0 -5
  248. package/dist/types/react/ui/UpdatedAt.d.ts +0 -9
  249. package/dist/types/react/ui/VariableBar.d.ts +0 -6
  250. package/dist/types/react/ui/VisualizationWidget.d.ts +0 -43
  251. package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -6
  252. package/dist/types/react/ui/WidgetEvidence.d.ts +0 -12
  253. package/dist/types/react/ui/WidgetViewTabs.d.ts +0 -16
  254. package/dist/types/react/ui/chart-data.d.ts +0 -34
  255. package/dist/types/react/ui/chart-date-axis.d.ts +0 -15
  256. package/dist/types/react/ui/chart-interaction.d.ts +0 -21
  257. package/dist/types/react/ui/chart-primitives.d.ts +0 -22
  258. package/dist/types/react/ui/chart-time.d.ts +0 -16
  259. package/dist/types/react/ui/chartColor.d.ts +0 -2
  260. package/dist/types/react/ui/classNames.d.ts +0 -1
  261. package/dist/types/react/ui/csv-export.d.ts +0 -19
  262. package/dist/types/react/ui/data-context.d.ts +0 -76
  263. package/dist/types/react/ui/data-identifiers.d.ts +0 -32
  264. package/dist/types/react/ui/icons.d.ts +0 -47
  265. package/dist/types/react/ui/index.d.ts +0 -109
  266. package/dist/types/react/ui/journey-flow.d.ts +0 -49
  267. package/dist/types/react/ui/keyboard.d.ts +0 -6
  268. package/dist/types/react/ui/metric-comparison.d.ts +0 -30
  269. package/dist/types/react/ui/metric.d.ts +0 -11
  270. package/dist/types/react/ui/presentation.d.ts +0 -25
  271. package/dist/types/react/ui/search.d.ts +0 -6
  272. package/dist/types/react/ui/searchItems.d.ts +0 -36
  273. package/dist/types/react/ui/shortcuts.d.ts +0 -45
  274. package/dist/types/react/ui/story.d.ts +0 -20
  275. package/dist/types/react/ui/useAppAppearance.d.ts +0 -3
  276. package/dist/types/react/ui/useDataAppPresentation.d.ts +0 -3
  277. package/dist/types/react/ui/useSvgId.d.ts +0 -2
  278. package/dist/types/react/ui/variables.d.ts +0 -38
  279. package/dist/types/react/ui/widget-views.d.ts +0 -3
  280. package/dist/types/react/view-control-bar.d.ts +0 -16
  281. package/dist/types/react/view-controls.d.ts +0 -20
  282. package/dist/types/react/view-runtime.d.ts +0 -31
  283. package/dist/types/react/view.d.ts +0 -78
  284. package/dist/types/react/widgets.d.ts +0 -79
  285. package/dist/types/server/local.d.ts +0 -19
  286. package/dist/types/server/preview/host.d.ts +0 -1
  287. package/dist/types/server/preview/index.d.ts +0 -16
  288. package/dist/types/server/reload-channel.d.ts +0 -6
  289. package/dist/worker.js +0 -106
@@ -1,2948 +0,0 @@
1
- import {
2
- injectStyles,
3
- injectDataAppStyles2,
4
- useDataApp,
5
- DateFormattingContext,
6
- useDateFormatting2,
7
- AppIcon2,
8
- classNames,
9
- Button2,
10
- EmptyState2,
11
- shortcuts,
12
- Kbd,
13
- TooltipProvider2,
14
- Tooltip2,
15
- Sheet2,
16
- InspectionContext,
17
- useInspectionDefaults,
18
- mountDataApp2,
19
- useDeclaredResult,
20
- PrimaryViewContext,
21
- ownedSource,
22
- DateTimeTooltip2,
23
- DateDisplay2,
24
- registeredEvidence,
25
- datasetTable,
26
- exportDatasets,
27
- searchVariable2,
28
- choiceVariable2,
29
- multiChoiceVariable2,
30
- dateRangeVariable2,
31
- sectionContent,
32
- SearchSuggestionsContext,
33
- Skeleton2,
34
- createDataHooks2,
35
- useDataAppAnnotations2,
36
- AnnotationTooltip,
37
- IconButton2,
38
- TextContent2,
39
- Stack2,
40
- DataAppFrame,
41
- getAnnotationProps,
42
- ContentSkeleton,
43
- VisualizationWidget2,
44
- comparisonChange,
45
- metricComparison,
46
- MetricWidget2,
47
- TableWidget2,
48
- TextWidget2,
49
- DataValue2,
50
- chartColor2,
51
- createDataContext2,
52
- SectionHeading2
53
- } from "../chunks/index-qhzdzca2.js";
54
- import {
55
- parseDateTime2,
56
- formatDateTime2,
57
- formatDateRange2,
58
- formatMetric2,
59
- formatCount2,
60
- formatPercent2
61
- } from "../chunks/index-22d576sn.js";
62
- import {
63
- parseDataAppAnnotationDraft2
64
- } from "../chunks/index-k766wwwr.js";
65
- import"../chunks/index-kwnqycjt.js";
66
- import"../chunks/index-cv36cyna.js";
67
- import"../chunks/index-sx488hvs.js";
68
- import {
69
- DataAppError2
70
- } from "../chunks/index-2sbp9h2b.js";
71
- import {
72
- invariant
73
- } from "../chunks/index-zcqxfwdq.js";
74
- // src/react/ui/DataApp.tsx
75
- import { jsx } from "react/jsx-runtime";
76
- function DataApp(props) {
77
- const {
78
- view,
79
- datasets,
80
- story,
81
- showSearchSuggestions = true,
82
- ...frame
83
- } = props;
84
- const app = useDataApp();
85
- const result = useDeclaredResult(view);
86
- const source = ownedSource(view, result.snapshot ?? { loading: true });
87
- const suggestionGroups = showSearchSuggestions && frame.showSearch !== false && result.searchControls ? datasets.flatMap((dataset, index) => {
88
- const reading = dataset.readSearchSuggestions(source);
89
- if (!reading)
90
- return [];
91
- return [
92
- reading.loading ? [] : reading.value.map((item) => ({
93
- ...item,
94
- id: `${index}:${item.id}`
95
- }))
96
- ];
97
- }) : [];
98
- return /* @__PURE__ */ jsx(DateFormattingContext, {
99
- value: { timeZone: result.timeZone },
100
- children: /* @__PURE__ */ jsx(SearchSuggestionsContext, {
101
- value: suggestionGroups.length ? {
102
- groups: suggestionGroups,
103
- busy: result.refreshing
104
- } : null,
105
- children: /* @__PURE__ */ jsx(PrimaryViewContext, {
106
- 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)
116
- })
117
- })
118
- })
119
- });
120
- }
121
- // src/react/ui/Grid.tsx
122
- import { jsx as jsx2 } from "react/jsx-runtime";
123
- function Grid({
124
- children,
125
- columns = 1,
126
- minItemWidth = "regular",
127
- gap = "lg",
128
- align = "start",
129
- className,
130
- ...props
131
- }) {
132
- return /* @__PURE__ */ jsx2("div", {
133
- ...props,
134
- className: classNames("altertable-grid", className),
135
- "data-columns": columns,
136
- "data-min-item-width": minItemWidth,
137
- "data-gap": gap,
138
- "data-align": align,
139
- children
140
- });
141
- }
142
- // src/react/ui/GridItem.tsx
143
- import { jsx as jsx3 } from "react/jsx-runtime";
144
- function GridItem({
145
- children,
146
- span = 1,
147
- className,
148
- ...props
149
- }) {
150
- return /* @__PURE__ */ jsx3("div", {
151
- ...props,
152
- className: classNames("altertable-grid-item", className),
153
- "data-span": span,
154
- children
155
- });
156
- }
157
- // src/react/widgets.tsx
158
- import { jsx as jsx4 } from "react/jsx-runtime";
159
- function MetricWidget({
160
- metric,
161
- source,
162
- ...presentation
163
- }) {
164
- return /* @__PURE__ */ jsx4(MetricWidget2, {
165
- ...presentation,
166
- metric: metric.definition,
167
- reading: metric.read(source)
168
- });
169
- }
170
- function TableWidget({
171
- dataset,
172
- source,
173
- title,
174
- ...presentation
175
- }) {
176
- const data = datasetTable(dataset, source);
177
- return /* @__PURE__ */ jsx4(TableWidget2, {
178
- ...presentation,
179
- ...data,
180
- title: title ?? data.title
181
- });
182
- }
183
- function VisualizationWidget({
184
- dataset,
185
- source,
186
- title,
187
- ...presentation
188
- }) {
189
- const data = datasetTable(dataset, source);
190
- return /* @__PURE__ */ jsx4(VisualizationWidget2, {
191
- ...presentation,
192
- title: title ?? data.title,
193
- reading: data.reading,
194
- evidence: data.evidence,
195
- emptyFallback: data.emptyFallback,
196
- isEmpty: (rows) => rows.length === 0
197
- });
198
- }
199
- function TextWidget(props) {
200
- if (props.metric) {
201
- const { metric, source, title, children, ...presentation } = props;
202
- return /* @__PURE__ */ jsx4(TextWidget2, {
203
- ...presentation,
204
- title: title ?? metric.definition.label,
205
- evidence: metric.definition.evidence,
206
- reading: metric.read(source),
207
- children: children ?? ((values) => formatMetric2(values.current, metric.definition.format))
208
- });
209
- }
210
- const { dataset, source, title, children, ...presentation } = props;
211
- return /* @__PURE__ */ jsx4(TextWidget2, {
212
- ...presentation,
213
- title: title ?? dataset.name,
214
- evidence: dataset.evidence,
215
- reading: dataset.read(source),
216
- children
217
- });
218
- }
219
- function DataValue(props) {
220
- if (props.metric) {
221
- const {
222
- metric,
223
- source,
224
- children,
225
- loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
226
- inline: true
227
- }),
228
- ...presentation
229
- } = props;
230
- return /* @__PURE__ */ jsx4(DataValue2, {
231
- ...presentation,
232
- reading: metric.read(source),
233
- loadingFallback,
234
- children: children ?? ((values) => formatMetric2(values.current, metric.definition.format))
235
- });
236
- }
237
- if (props.dataset) {
238
- const {
239
- dataset,
240
- source,
241
- children,
242
- loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
243
- inline: true
244
- }),
245
- ...presentation
246
- } = props;
247
- return /* @__PURE__ */ jsx4(DataValue2, {
248
- ...presentation,
249
- reading: dataset.read(source),
250
- loadingFallback,
251
- children
252
- });
253
- }
254
- const {
255
- scope,
256
- children,
257
- loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
258
- inline: true
259
- }),
260
- ...presentation
261
- } = props;
262
- return /* @__PURE__ */ jsx4(DataValue2, {
263
- ...presentation,
264
- reading: scope,
265
- loadingFallback,
266
- children: children ?? ((value) => value)
267
- });
268
- }
269
- // src/react/ui/Breakdown.tsx
270
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
271
- function Breakdown({
272
- total,
273
- items,
274
- formatValue = formatCount2,
275
- className,
276
- ...props
277
- }) {
278
- 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
- const dominant = total > 0 && items.some((item) => item.value / total >= 0.85);
280
- return /* @__PURE__ */ jsxs("div", {
281
- ...props,
282
- className: classNames("altertable-breakdown", className),
283
- "data-dominant": dominant || undefined,
284
- children: [
285
- /* @__PURE__ */ jsxs("div", {
286
- className: "altertable-breakdown-summary",
287
- children: [
288
- /* @__PURE__ */ jsx5("span", {
289
- children: "Share of total"
290
- }),
291
- /* @__PURE__ */ jsxs("strong", {
292
- children: [
293
- formatValue(total),
294
- " total"
295
- ]
296
- })
297
- ]
298
- }),
299
- /* @__PURE__ */ jsx5("div", {
300
- className: "altertable-breakdown-bar",
301
- "aria-hidden": "true",
302
- children: items.map((item) => /* @__PURE__ */ jsx5("span", {
303
- style: {
304
- width: `${total ? item.value / total * 100 : 0}%`,
305
- backgroundColor: chartColor2(item.id)
306
- }
307
- }, item.id))
308
- }),
309
- /* @__PURE__ */ jsx5("dl", {
310
- className: "altertable-breakdown-list",
311
- children: items.map((item) => {
312
- const share = total ? item.value / total : 0;
313
- const color = {
314
- "--altertable-breakdown-color": chartColor2(item.id)
315
- };
316
- return /* @__PURE__ */ jsxs("div", {
317
- className: "altertable-breakdown-row",
318
- "data-empty": item.value === 0 || undefined,
319
- style: color,
320
- children: [
321
- /* @__PURE__ */ jsxs("dt", {
322
- children: [
323
- /* @__PURE__ */ jsx5("span", {
324
- className: "altertable-breakdown-swatch",
325
- "aria-hidden": "true"
326
- }),
327
- item.label
328
- ]
329
- }),
330
- /* @__PURE__ */ jsx5("dd", {
331
- className: "altertable-breakdown-value",
332
- children: formatValue(item.value)
333
- }),
334
- /* @__PURE__ */ jsx5("dd", {
335
- className: "altertable-breakdown-share",
336
- children: formatPercent2(share)
337
- })
338
- ]
339
- }, item.id);
340
- })
341
- })
342
- ]
343
- });
344
- }
345
- // src/react/ui/Ranking.tsx
346
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
347
- function Ranking({
348
- items,
349
- formatValue = formatCount2,
350
- className,
351
- ...props
352
- }) {
353
- invariant(items.every((item) => Number.isFinite(item.value) && item.value >= 0), "Ranking values must be finite and nonnegative.");
354
- const max = Math.max(0, ...items.map((item) => item.value));
355
- return /* @__PURE__ */ jsx6("ol", {
356
- ...props,
357
- className: classNames("altertable-ranking", className),
358
- children: items.map((item) => /* @__PURE__ */ jsxs2("li", {
359
- children: [
360
- /* @__PURE__ */ jsxs2("div", {
361
- className: "altertable-ranking-reading",
362
- children: [
363
- /* @__PURE__ */ jsx6("span", {
364
- children: item.label
365
- }),
366
- /* @__PURE__ */ jsx6("strong", {
367
- children: formatValue(item.value)
368
- })
369
- ]
370
- }),
371
- /* @__PURE__ */ jsx6("div", {
372
- className: "altertable-ranking-track",
373
- "aria-hidden": "true",
374
- children: /* @__PURE__ */ jsx6("span", {
375
- style: { width: `${max ? item.value / max * 100 : 0}%` }
376
- })
377
- }),
378
- item.detail != null && /* @__PURE__ */ jsx6("div", {
379
- className: "altertable-ranking-detail",
380
- children: item.detail
381
- })
382
- ]
383
- }, item.id))
384
- });
385
- }
386
- // src/react/ui/Comparison.tsx
387
- import { jsx as jsx7, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
388
- function Comparison(props) {
389
- const dateFormatting = useDateFormatting2();
390
- if ("metric" in props) {
391
- if (props.reading.loading)
392
- return /* @__PURE__ */ jsx7(ContentSkeleton, {
393
- variant: "panel"
394
- });
395
- const comparison = metricComparison(props.metric, props.reading, dateFormatting);
396
- if (!comparison)
397
- return null;
398
- return /* @__PURE__ */ jsx7(ComparisonContent, {
399
- ...comparison,
400
- label: props.metric.label,
401
- emphasis: props.emphasis
402
- });
403
- }
404
- return /* @__PURE__ */ jsx7(ComparisonContent, {
405
- ...props
406
- });
407
- }
408
- function ComparisonContent({
409
- label,
410
- current,
411
- previous,
412
- favorableDirection,
413
- emphasis = "standard"
414
- }) {
415
- const max = Math.max(current.value, previous?.value ?? 0, 1);
416
- const { percent, tone, icon } = comparisonChange({
417
- current,
418
- previous,
419
- favorableDirection
420
- });
421
- return /* @__PURE__ */ jsxs3("figure", {
422
- className: "altertable-comparison-visual",
423
- "data-emphasis": emphasis,
424
- "aria-label": `${label} comparison`,
425
- children: [
426
- /* @__PURE__ */ jsx7("figcaption", {
427
- children: label
428
- }),
429
- /* @__PURE__ */ jsxs3("div", {
430
- className: "altertable-comparison-row",
431
- "data-period": "current",
432
- children: [
433
- /* @__PURE__ */ jsxs3("div", {
434
- children: [
435
- /* @__PURE__ */ jsx7("span", {
436
- children: current.periodLabel ?? "Current period"
437
- }),
438
- /* @__PURE__ */ jsx7("strong", {
439
- children: current.formattedValue
440
- })
441
- ]
442
- }),
443
- /* @__PURE__ */ jsx7("span", {
444
- className: "altertable-comparison-track",
445
- children: /* @__PURE__ */ jsx7("span", {
446
- style: { width: `${current.value / max * 100}%` }
447
- })
448
- })
449
- ]
450
- }),
451
- previous && /* @__PURE__ */ jsxs3("div", {
452
- className: "altertable-comparison-row",
453
- "data-period": "previous",
454
- children: [
455
- /* @__PURE__ */ jsxs3("div", {
456
- children: [
457
- /* @__PURE__ */ jsx7("span", {
458
- children: previous.periodLabel ?? "Previous period"
459
- }),
460
- /* @__PURE__ */ jsx7("strong", {
461
- children: previous.formattedValue
462
- })
463
- ]
464
- }),
465
- /* @__PURE__ */ jsx7("span", {
466
- className: "altertable-comparison-track",
467
- children: /* @__PURE__ */ jsx7("span", {
468
- style: { width: `${(previous.value ?? 0) / max * 100}%` }
469
- })
470
- })
471
- ]
472
- }),
473
- /* @__PURE__ */ jsx7("p", {
474
- className: "altertable-comparison-change",
475
- "data-tone": tone,
476
- children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs3(Fragment, {
477
- children: [
478
- /* @__PURE__ */ jsx7(AppIcon2, {
479
- name: icon,
480
- size: 17
481
- }),
482
- Math.abs(percent).toFixed(1),
483
- "% vs",
484
- " ",
485
- previous?.periodLabel?.toLowerCase() ?? "previous period"
486
- ]
487
- })
488
- })
489
- ]
490
- });
491
- }
492
- // src/react/ui/DataSection.tsx
493
- 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";
694
- function DataSection({
695
- content,
696
- ...presentation
697
- }) {
698
- const primary = useContext(PrimaryViewContext);
699
- const { view, ...section } = sectionContent(content);
700
- if (primary?.declaration === view) {
701
- const result = primary.result;
702
- return /* @__PURE__ */ jsx11(DataSectionBoundary, {
703
- ...section,
704
- ...presentation,
705
- result,
706
- notice: "none"
707
- });
708
- }
709
- return /* @__PURE__ */ jsx11(IndependentSection, {
710
- view,
711
- ...section,
712
- ...presentation
713
- });
714
- }
715
- function IndependentSection({
716
- view,
717
- ...props
718
- }) {
719
- const result = useDeclaredResult(view);
720
- const defaults = useInspectionDefaults();
721
- const section = /* @__PURE__ */ jsx11(DataSectionBoundary, {
722
- ...props,
723
- result,
724
- notice: "inline"
725
- });
726
- return /* @__PURE__ */ jsx11(DateFormattingContext, {
727
- value: { timeZone: result.timeZone },
728
- children: /* @__PURE__ */ jsx11(InspectionContext, {
729
- value: {
730
- ...defaults,
731
- dataContext: result.dataContext,
732
- queries: result.queries
733
- },
734
- children: section
735
- })
736
- });
737
- }
738
- // src/react/ui/UpdatedAt.tsx
739
- import { useEffect, useState } from "react";
740
- import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
741
- function UpdatedAt({
742
- timestamp,
743
- locale,
744
- label = "Updated",
745
- children,
746
- triggerProps,
747
- ...props
748
- }) {
749
- const defaults = useDateFormatting2({ locale, timeZone: props.timeZone });
750
- const [now, setNow] = useState(Date.now);
751
- useEffect(() => {
752
- const interval = window.setInterval(() => setNow(Date.now()), 30000);
753
- return () => window.clearInterval(interval);
754
- }, []);
755
- const elapsedMinutes = Math.floor(Math.max(0, now - timestamp) / 60000);
756
- const relative = new Intl.RelativeTimeFormat(defaults.locale, {
757
- numeric: "auto"
758
- });
759
- let age = "just now";
760
- if (elapsedMinutes >= 1440)
761
- age = relative.format(-Math.floor(elapsedMinutes / 1440), "day");
762
- else if (elapsedMinutes >= 60)
763
- age = relative.format(-Math.floor(elapsedMinutes / 60), "hour");
764
- else if (elapsedMinutes >= 1)
765
- age = relative.format(-elapsedMinutes, "minute");
766
- const date = parseDateTime2(timestamp);
767
- if (!date)
768
- return /* @__PURE__ */ jsx12("span", {
769
- children: children ?? `${label} —`
770
- });
771
- return /* @__PURE__ */ jsx12(DateTimeTooltip2, {
772
- ...props,
773
- ...defaults,
774
- date,
775
- triggerProps: {
776
- ...triggerProps,
777
- className: ["altertable-updated-at", triggerProps?.className].filter(Boolean).join(" ")
778
- },
779
- children: children ?? /* @__PURE__ */ jsxs6("time", {
780
- dateTime: date.toISOString(),
781
- children: [
782
- label,
783
- " ",
784
- age
785
- ]
786
- })
787
- });
788
- }
789
- // src/react/ui/PeriodSummary.tsx
790
- import { jsx as jsx13, jsxs as jsxs7, Fragment as Fragment2 } from "react/jsx-runtime";
791
- function duration(period) {
792
- return `${period.amount} ${period.unit}${period.amount === 1 ? "" : "s"}`;
793
- }
794
- function label(period, options = {}) {
795
- if (period.kind === "rolling")
796
- return `Last ${duration(period)}`;
797
- return formatDateRange2(period, options);
798
- }
799
- function comparisonLabel(period, comparison, options) {
800
- if (comparison.kind === "period") {
801
- if (comparison.period.kind === "calendar")
802
- return label(comparison.period, options);
803
- return `${duration(comparison.period)} ending ${formatDateTime2(comparison.period.end, options)}`;
804
- }
805
- return period.kind === "rolling" ? `Previous ${duration(period)}` : "Previous period";
806
- }
807
- function reportingPeriodText(period, options = {}) {
808
- if (period.kind === "calendar")
809
- return `${label(period, options)} in ${period.timeZone}`;
810
- const end = parseDateTime2(period.end);
811
- if (!end)
812
- return label(period, options);
813
- const start = new Date(end.getTime() - period.amount * (period.unit === "hour" ? 3600000 : 86400000));
814
- return `${label(period, options)}, ${formatDateTime2(start, options)} to ${formatDateTime2(end, options)} in ${options.timeZone ?? "UTC"}`;
815
- }
816
- function PeriodSummary({
817
- period,
818
- comparison,
819
- className
820
- }) {
821
- const options = useDateFormatting2();
822
- const comparisonText = comparison ? comparisonLabel(period, comparison, options) : null;
823
- const comparisonDetail = comparison?.kind === "period" ? reportingPeriodText(comparison.period, options) : comparisonText;
824
- return /* @__PURE__ */ jsxs7("p", {
825
- className: classNames("altertable-period-summary", className),
826
- children: [
827
- /* @__PURE__ */ jsx13("span", {
828
- className: "altertable-sr-only",
829
- children: `Reporting period: ${reportingPeriodText(period, options)}${comparisonDetail ? `, compared with ${comparisonDetail}` : ""}`
830
- }),
831
- /* @__PURE__ */ jsxs7("span", {
832
- "aria-hidden": "true",
833
- className: "altertable-period-summary-visible",
834
- children: [
835
- /* @__PURE__ */ jsx13(AppIcon2, {
836
- name: period.kind === "rolling" ? "clock" : "calendar",
837
- size: 16
838
- }),
839
- /* @__PURE__ */ jsx13("span", {
840
- className: "altertable-period-summary-current",
841
- children: label(period, options)
842
- }),
843
- comparisonText && /* @__PURE__ */ jsxs7(Fragment2, {
844
- children: [
845
- /* @__PURE__ */ jsx13("span", {
846
- className: "altertable-period-summary-vs",
847
- "aria-hidden": "true",
848
- children: "vs"
849
- }),
850
- /* @__PURE__ */ jsx13("span", {
851
- children: comparisonText
852
- })
853
- ]
854
- })
855
- ]
856
- })
857
- ]
858
- });
859
- }
860
- // src/react/ui/data-identifiers.tsx
861
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
862
- function qualifiedName(definition) {
863
- const table = definition.kind === "table" ? definition : definition.table;
864
- const path = [table.catalog, table.schema, table.name].join(".");
865
- return definition.kind === "column" ? `${path}.${definition.name}` : path;
866
- }
867
- function assertAlias(id) {
868
- invariant(!!id && !id.includes("."), `Invalid data identifier alias ${id}.`);
869
- }
870
- function defineDataIdentifiers({ tables, columns }) {
871
- const definitions = Object.create(null);
872
- for (const [id, table] of Object.entries(tables)) {
873
- assertAlias(id);
874
- definitions[`tables.${id}`] = { kind: "table", ...table };
875
- }
876
- for (const [id, column] of Object.entries(columns)) {
877
- assertAlias(id);
878
- const table = tables[column.table];
879
- invariant(table, `Unknown table ${column.table} for column ${id}.`);
880
- definitions[`columns.${column.table}.${id}`] = {
881
- kind: "column",
882
- tableId: `tables.${column.table}`,
883
- table,
884
- name: column.name
885
- };
886
- }
887
- function DataIdentifier({
888
- id,
889
- display
890
- }) {
891
- const definition = definitions[id];
892
- invariant(definition, `Unknown data identifier ${id}.`);
893
- const qualified = qualifiedName(definition);
894
- const shown = display ?? (definition.kind === "table" ? "qualified" : "short");
895
- const table = definition.kind === "table" ? definition : definition.table;
896
- const prefix = definition.kind === "table" ? [table.catalog, table.schema] : [table.catalog, table.schema, table.name];
897
- return /* @__PURE__ */ jsxs8("code", {
898
- className: "altertable-data-identifier",
899
- "data-kind": definition.kind,
900
- title: qualified,
901
- "data-identifier-id": id,
902
- children: [
903
- shown === "qualified" && /* @__PURE__ */ jsx14("span", {
904
- className: "altertable-data-identifier-path",
905
- children: prefix.map((segment, index) => /* @__PURE__ */ jsxs8("span", {
906
- children: [
907
- segment,
908
- ".",
909
- /* @__PURE__ */ jsx14("wbr", {})
910
- ]
911
- }, index))
912
- }),
913
- /* @__PURE__ */ jsx14("span", {
914
- className: "altertable-data-identifier-name",
915
- children: definition.name
916
- })
917
- ]
918
- });
919
- }
920
- return {
921
- definitions,
922
- DataIdentifier
923
- };
924
- }
925
- // src/react/annotations/AnnotationTarget.tsx
926
- import { jsx as jsx15 } from "react/jsx-runtime";
927
- function AnnotationTarget({
928
- annotationId,
929
- label,
930
- evidence,
931
- ...props
932
- }) {
933
- return /* @__PURE__ */ jsx15("div", {
934
- ...props,
935
- ...getAnnotationProps({
936
- id: annotationId,
937
- label,
938
- evidence,
939
- kind: "element"
940
- })
941
- });
942
- }
943
- // src/react/annotations/AnnotationBar.tsx
944
- import {
945
- useEffect as useEffect2,
946
- useEffectEvent,
947
- useRef,
948
- useReducer,
949
- useImperativeHandle
950
- } from "react";
951
- import { createPortal } from "react-dom";
952
- import {
953
- autoUpdate,
954
- flip,
955
- offset,
956
- shift,
957
- useFloating,
958
- useMergeRefs
959
- } from "@floating-ui/react";
960
- import {
961
- GripVertical,
962
- Eye,
963
- EyeOff,
964
- Trash2,
965
- X,
966
- Minus,
967
- LoaderCircle
968
- } from "lucide-react";
969
- import { jsx as jsx16, jsxs as jsxs9, Fragment as Fragment3 } from "react/jsx-runtime";
970
- function annotationBarReducer(state, action) {
971
- switch (action.type) {
972
- case "positionMoved":
973
- return { ...state, position: action.position };
974
- case "reviewToggled":
975
- return { ...state, reviewOpen: !state.reviewOpen };
976
- case "reviewClosed":
977
- return { ...state, reviewOpen: false };
978
- case "previewOpened":
979
- return { ...state, previewId: action.id };
980
- case "previewClosed":
981
- return { ...state, previewId: undefined };
982
- case "discardDialogChanged":
983
- return { ...state, discardOpen: action.open };
984
- case "annotationsDiscarded":
985
- return { ...state, discardOpen: false, reviewOpen: false };
986
- case "submissionStarted":
987
- return { ...state, pending: true, error: "" };
988
- case "submissionAccepted":
989
- return { ...state, reviewOpen: false };
990
- case "submissionFailed":
991
- return { ...state, error: "Could not send annotations. Try again." };
992
- case "submissionFinished":
993
- return { ...state, pending: false };
994
- case "annotationModeObserved":
995
- return {
996
- ...state,
997
- observedActive: action.active,
998
- ...!action.active ? { reviewOpen: false, previewId: undefined } : {}
999
- };
1000
- }
1001
- }
1002
- function AnnotationBar({
1003
- ref,
1004
- annotations,
1005
- active = true,
1006
- theme = "light",
1007
- disabled = false,
1008
- deletedAnnotationId,
1009
- onUndoDelete,
1010
- onDismissUndo,
1011
- hasUnsavedChanges = false,
1012
- pinsVisible,
1013
- onPinsVisibleChange,
1014
- onSelect,
1015
- onDelete,
1016
- onClear,
1017
- requestDiscard,
1018
- onSend,
1019
- onClose
1020
- }) {
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);
1027
- const [state, dispatch] = useReducer(annotationBarReducer, {
1028
- reviewOpen: false,
1029
- pending: false,
1030
- error: "",
1031
- discardOpen: false,
1032
- observedActive: active
1033
- });
1034
- const { position, reviewOpen, pending, error, discardOpen, previewId } = state;
1035
- const preview = annotations.find((annotation) => annotation.id === previewId);
1036
- const locked = disabled || pending;
1037
- const canSend = active && !locked && !hasUnsavedChanges && annotations.length > 0;
1038
- const { refs, floatingStyles } = useFloating({
1039
- placement: "top",
1040
- strategy: "fixed",
1041
- middleware: [offset(10), flip(), shift({ padding: 12 })],
1042
- whileElementsMounted: autoUpdate
1043
- });
1044
- const barElementRef = useMergeRefs([refs.setReference, barRef]);
1045
- const reviewRef = useMergeRefs([refs.setFloating, reviewElement]);
1046
- function move(left, top) {
1047
- const rect = barRef.current?.getBoundingClientRect();
1048
- if (!rect)
1049
- return;
1050
- dispatch({
1051
- type: "positionMoved",
1052
- position: {
1053
- left: Math.max(12, Math.min(left, window.innerWidth - rect.width - 12)),
1054
- top: Math.max(12, Math.min(top, window.innerHeight - rect.height - 12))
1055
- }
1056
- });
1057
- }
1058
- const keepInViewport = useEffectEvent(() => {
1059
- if (position)
1060
- move(position.left, position.top);
1061
- });
1062
- useEffect2(() => {
1063
- window.addEventListener("resize", keepInViewport);
1064
- return () => window.removeEventListener("resize", keepInViewport);
1065
- }, []);
1066
- useEffect2(() => {
1067
- if (reviewOpen)
1068
- reviewElement.current?.querySelector("button")?.focus();
1069
- }, [reviewOpen]);
1070
- if (state.observedActive !== active)
1071
- dispatch({ type: "annotationModeObserved", active });
1072
- function closeReview() {
1073
- dispatch({ type: "reviewClosed" });
1074
- reviewTrigger.current?.focus();
1075
- }
1076
- async function send() {
1077
- if (submitting.current || !canSend)
1078
- return;
1079
- submitting.current = true;
1080
- dispatch({ type: "submissionStarted" });
1081
- try {
1082
- const snapshot = annotations.map(parseDataAppAnnotationDraft2);
1083
- await onSend(snapshot);
1084
- dispatch({ type: "submissionAccepted" });
1085
- } catch {
1086
- dispatch({ type: "submissionFailed" });
1087
- } finally {
1088
- submitting.current = false;
1089
- dispatch({ type: "submissionFinished" });
1090
- }
1091
- }
1092
- useImperativeHandle(ref, () => ({ send }));
1093
- useEffect2(() => {
1094
- if (discardOpen)
1095
- cancelDiscard.current?.focus();
1096
- }, [discardOpen]);
1097
- function discardAnnotations() {
1098
- dispatch({ type: "annotationsDiscarded" });
1099
- onClear();
1100
- onClose();
1101
- }
1102
- const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs9("div", {
1103
- className: "altertable-annotation-undo",
1104
- "data-theme": theme,
1105
- "data-inline": active && reviewOpen && annotations.length > 0 || undefined,
1106
- "data-bar-visible": active && annotations.length > 0 || undefined,
1107
- children: [
1108
- /* @__PURE__ */ jsx16("output", {
1109
- children: "Annotation deleted"
1110
- }),
1111
- /* @__PURE__ */ jsx16(Button2, {
1112
- variant: "ghost",
1113
- onClick: () => onUndoDelete(deletedAnnotationId),
1114
- children: "Undo"
1115
- }),
1116
- onDismissUndo && /* @__PURE__ */ jsx16(Button2, {
1117
- variant: "ghost",
1118
- size: "icon-compact",
1119
- "aria-label": "Dismiss deleted annotation",
1120
- onClick: onDismissUndo,
1121
- children: /* @__PURE__ */ jsx16(X, {
1122
- size: 14,
1123
- "aria-hidden": true
1124
- })
1125
- })
1126
- ]
1127
- }) : null;
1128
- if (annotations.length === 0 && !deletedAnnotationId)
1129
- return null;
1130
- const style = position ? {
1131
- left: position.left,
1132
- top: position.top,
1133
- bottom: "auto",
1134
- transform: "none"
1135
- } : {};
1136
- return /* @__PURE__ */ jsxs9(TooltipProvider2, {
1137
- children: [
1138
- active && annotations.length > 0 && /* @__PURE__ */ jsxs9("div", {
1139
- ref: barElementRef,
1140
- className: "altertable-annotation-bar",
1141
- "data-theme": theme,
1142
- style,
1143
- tabIndex: -1,
1144
- role: "toolbar",
1145
- "aria-label": "Annotations",
1146
- onKeyDown: (event) => {
1147
- if (event.key !== "Escape" || locked || hasUnsavedChanges)
1148
- return;
1149
- event.preventDefault();
1150
- if (reviewOpen)
1151
- closeReview();
1152
- else
1153
- onClose();
1154
- },
1155
- children: [
1156
- /* @__PURE__ */ jsx16(Button2, {
1157
- variant: "ghost",
1158
- size: "icon-compact",
1159
- "aria-label": "Move annotation bar",
1160
- "data-atbl-internal-drag-handle": true,
1161
- disabled: locked,
1162
- onPointerDown: (event) => {
1163
- const rect = barRef.current?.getBoundingClientRect();
1164
- if (!rect)
1165
- return;
1166
- drag.current = {
1167
- x: event.clientX,
1168
- y: event.clientY,
1169
- left: rect.left,
1170
- top: rect.top
1171
- };
1172
- event.currentTarget.setPointerCapture(event.pointerId);
1173
- },
1174
- onPointerMove: (event) => {
1175
- const origin = drag.current;
1176
- if (origin)
1177
- move(origin.left + event.clientX - origin.x, origin.top + event.clientY - origin.y);
1178
- },
1179
- onPointerUp: () => {
1180
- drag.current = undefined;
1181
- },
1182
- onPointerCancel: () => {
1183
- drag.current = undefined;
1184
- },
1185
- onKeyDown: (event) => {
1186
- const delta = {
1187
- ArrowLeft: [-10, 0],
1188
- ArrowRight: [10, 0],
1189
- ArrowUp: [0, -10],
1190
- ArrowDown: [0, 10]
1191
- }[event.key];
1192
- const rect = barRef.current?.getBoundingClientRect();
1193
- if (!delta || !rect)
1194
- return;
1195
- event.preventDefault();
1196
- move(rect.left + delta[0], rect.top + delta[1]);
1197
- },
1198
- children: /* @__PURE__ */ jsx16(GripVertical, {
1199
- size: 16,
1200
- "aria-hidden": true
1201
- })
1202
- }),
1203
- /* @__PURE__ */ jsxs9(Button2, {
1204
- ref: reviewTrigger,
1205
- className: "altertable-annotation-bar-count",
1206
- variant: "ghost",
1207
- size: "compact",
1208
- "aria-label": "Review annotations",
1209
- "aria-expanded": reviewOpen && annotations.length > 0,
1210
- "aria-haspopup": "dialog",
1211
- disabled: locked || !annotations.length,
1212
- onClick: () => dispatch({ type: "reviewToggled" }),
1213
- children: [
1214
- "Annotating · ",
1215
- annotations.length
1216
- ]
1217
- }),
1218
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1219
- content: pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1220
- theme,
1221
- children: /* @__PURE__ */ jsx16(Button2, {
1222
- variant: "ghost",
1223
- size: "icon-compact",
1224
- "aria-label": pinsVisible ? "Hide annotation pins" : "Show annotation pins",
1225
- "aria-pressed": !pinsVisible,
1226
- disabled: locked,
1227
- onClick: () => onPinsVisibleChange(!pinsVisible),
1228
- children: pinsVisible ? /* @__PURE__ */ jsx16(EyeOff, {
1229
- size: 16,
1230
- "aria-hidden": true
1231
- }) : /* @__PURE__ */ jsx16(Eye, {
1232
- size: 16,
1233
- "aria-hidden": true
1234
- })
1235
- })
1236
- }),
1237
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1238
- content: "Discard all annotations",
1239
- theme,
1240
- children: /* @__PURE__ */ jsx16(Button2, {
1241
- variant: "ghost",
1242
- size: "icon-compact",
1243
- "aria-label": "Discard all annotations",
1244
- disabled: locked,
1245
- onClick: () => requestDiscard ? requestDiscard(discardAnnotations) : dispatch({ type: "discardDialogChanged", open: true }),
1246
- children: /* @__PURE__ */ jsx16(Trash2, {
1247
- size: 16,
1248
- "aria-hidden": true
1249
- })
1250
- })
1251
- }),
1252
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1253
- content: hasUnsavedChanges ? "Save the open annotation before sending" : /* @__PURE__ */ jsxs9(Fragment3, {
1254
- children: [
1255
- "Send annotations ",
1256
- /* @__PURE__ */ jsx16(Kbd, {
1257
- shortcut: shortcuts.sendAnnotations
1258
- })
1259
- ]
1260
- }),
1261
- theme,
1262
- children: /* @__PURE__ */ jsxs9(Button2, {
1263
- className: "altertable-annotation-bar-send",
1264
- "data-pending": pending || undefined,
1265
- "aria-busy": pending,
1266
- size: "compact",
1267
- "aria-label": "Send annotations",
1268
- disabled: !canSend,
1269
- onClick: () => void send(),
1270
- children: [
1271
- /* @__PURE__ */ jsx16("span", {
1272
- className: "altertable-annotation-bar-send-label",
1273
- children: "Send"
1274
- }),
1275
- pending && /* @__PURE__ */ jsx16(LoaderCircle, {
1276
- className: "altertable-annotation-bar-spinner",
1277
- size: 16,
1278
- "aria-hidden": true
1279
- })
1280
- ]
1281
- })
1282
- }),
1283
- /* @__PURE__ */ jsx16(AnnotationTooltip, {
1284
- content: /* @__PURE__ */ jsxs9(Fragment3, {
1285
- children: [
1286
- hasUnsavedChanges ? "Save or discard the open annotation first" : "Exit annotation mode",
1287
- " ",
1288
- /* @__PURE__ */ jsx16(Kbd, {
1289
- children: "Esc"
1290
- })
1291
- ]
1292
- }),
1293
- theme,
1294
- children: /* @__PURE__ */ jsx16(Button2, {
1295
- variant: "ghost",
1296
- size: "icon-compact",
1297
- "aria-label": "Exit annotation mode",
1298
- disabled: locked || hasUnsavedChanges,
1299
- onClick: onClose,
1300
- children: /* @__PURE__ */ jsx16(X, {
1301
- size: 16,
1302
- "aria-hidden": true
1303
- })
1304
- })
1305
- }),
1306
- error && /* @__PURE__ */ jsx16("output", {
1307
- className: "altertable-annotation-bar-error",
1308
- role: "alert",
1309
- children: error
1310
- })
1311
- ]
1312
- }),
1313
- (!active || !reviewOpen || annotations.length === 0) && undo && createPortal(undo, document.body),
1314
- active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs9("dialog", {
1315
- open: true,
1316
- ref: reviewRef,
1317
- className: "altertable-annotation-bar-panel",
1318
- "data-theme": theme,
1319
- style: floatingStyles,
1320
- "aria-label": "Review annotations",
1321
- onKeyDown: (event) => {
1322
- if (event.key === "Escape") {
1323
- event.preventDefault();
1324
- closeReview();
1325
- }
1326
- },
1327
- children: [
1328
- /* @__PURE__ */ jsxs9("header", {
1329
- children: [
1330
- /* @__PURE__ */ jsx16("strong", {
1331
- children: "Annotations"
1332
- }),
1333
- /* @__PURE__ */ jsx16(Button2, {
1334
- variant: "ghost",
1335
- size: "icon-compact",
1336
- "aria-label": "Minimize annotation review",
1337
- onClick: closeReview,
1338
- children: /* @__PURE__ */ jsx16(Minus, {
1339
- size: 16,
1340
- "aria-hidden": true
1341
- })
1342
- })
1343
- ]
1344
- }),
1345
- /* @__PURE__ */ jsx16("div", {
1346
- "aria-label": "Annotation drafts",
1347
- children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs9("div", {
1348
- className: "altertable-annotation-bar-row",
1349
- children: [
1350
- annotation.context.screenshot && /* @__PURE__ */ jsx16("button", {
1351
- "data-atbl-focus": "ring",
1352
- "data-atbl-control": "action",
1353
- type: "button",
1354
- className: "altertable-annotation-thumbnail",
1355
- "aria-label": `View screenshot of ${annotation.target.label}`,
1356
- onClick: () => dispatch({ type: "previewOpened", id: annotation.id }),
1357
- children: /* @__PURE__ */ jsx16("img", {
1358
- src: annotation.context.screenshot.dataUrl,
1359
- alt: ""
1360
- })
1361
- }),
1362
- /* @__PURE__ */ jsxs9(Button2, {
1363
- variant: "ghost",
1364
- className: "altertable-annotation-bar-open",
1365
- "aria-label": `Open annotation ${index + 1}`,
1366
- disabled: locked,
1367
- onClick: () => {
1368
- onPinsVisibleChange(true);
1369
- onSelect(annotation.id);
1370
- dispatch({ type: "reviewClosed" });
1371
- },
1372
- children: [
1373
- /* @__PURE__ */ jsx16("strong", {
1374
- children: annotation.target.label
1375
- }),
1376
- /* @__PURE__ */ jsx16("span", {
1377
- children: annotation.comment
1378
- })
1379
- ]
1380
- }),
1381
- /* @__PURE__ */ jsx16(Button2, {
1382
- variant: "ghost",
1383
- size: "icon-compact",
1384
- "aria-label": `Delete annotation ${index + 1}`,
1385
- disabled: locked,
1386
- onClick: () => onDelete(annotation.id),
1387
- children: /* @__PURE__ */ jsx16(Trash2, {
1388
- size: 16,
1389
- "aria-hidden": true
1390
- })
1391
- })
1392
- ]
1393
- }, annotation.id))
1394
- }),
1395
- undo
1396
- ]
1397
- }), document.body),
1398
- /* @__PURE__ */ jsx16(Sheet2, {
1399
- open: Boolean(preview),
1400
- onOpenChange: (open) => {
1401
- if (!open)
1402
- dispatch({ type: "previewClosed" });
1403
- },
1404
- placement: "center",
1405
- className: "altertable-annotation-image-dialog",
1406
- title: preview?.target.label ?? "Screenshot",
1407
- description: preview?.comment,
1408
- returnFocus: reviewTrigger,
1409
- children: preview?.context.screenshot && /* @__PURE__ */ jsx16("img", {
1410
- className: "altertable-annotation-preview",
1411
- src: preview.context.screenshot.dataUrl,
1412
- alt: `Captured area for ${preview.target.label}`
1413
- })
1414
- }),
1415
- !requestDiscard && /* @__PURE__ */ jsx16(Sheet2, {
1416
- open: discardOpen,
1417
- onOpenChange: (open) => dispatch({ type: "discardDialogChanged", open }),
1418
- placement: "center",
1419
- title: "Discard all pending annotations?",
1420
- returnFocus: barRef,
1421
- footer: /* @__PURE__ */ jsxs9(Fragment3, {
1422
- children: [
1423
- /* @__PURE__ */ jsx16(Button2, {
1424
- ref: cancelDiscard,
1425
- variant: "ghost",
1426
- onClick: () => dispatch({ type: "discardDialogChanged", open: false }),
1427
- children: "Cancel"
1428
- }),
1429
- /* @__PURE__ */ jsx16(Button2, {
1430
- className: "altertable-annotation-discard-confirm",
1431
- disabled: locked,
1432
- onClick: discardAnnotations,
1433
- children: "Discard"
1434
- })
1435
- ]
1436
- }),
1437
- children: /* @__PURE__ */ jsx16("p", {
1438
- className: "altertable-annotation-discard-description",
1439
- children: "These annotations will be removed and won’t be sent to the agent."
1440
- })
1441
- })
1442
- ]
1443
- });
1444
- }
1445
- // src/react/annotations/styles.ts
1446
- function injectDataAppAnnotationStyles(options = {}) {
1447
- return injectStyles({
1448
- name: "injectDataAppAnnotationStyles",
1449
- attribute: "data-altertable-annotation-styles",
1450
- css: `/* src/react/tokens.css */
1451
- @layer atbl.tokens {
1452
- :root {
1453
- --atbl-background: var(--atbl-palette-background);
1454
- --atbl-surface: var(--atbl-palette-surface);
1455
- --atbl-subtle: var(--atbl-palette-subtle);
1456
- --atbl-backdrop: #0f171e38;
1457
- --atbl-text: var(--atbl-palette-text);
1458
- --atbl-muted: var(--atbl-palette-muted);
1459
- --atbl-border: var(--atbl-palette-border);
1460
- --atbl-accent: var(--atbl-palette-accent);
1461
- --atbl-on-accent: var(--atbl-palette-on-accent);
1462
- --atbl-positive: var(--atbl-palette-positive);
1463
- --atbl-danger: var(--atbl-palette-danger);
1464
- --atbl-code-surface: #f4f6f9;
1465
- --atbl-code-text: #273242;
1466
- --atbl-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1467
- --atbl-focus-ring-offset: 2px;
1468
- --atbl-focus-ring-inset: -1px;
1469
- --atbl-font: var(--atbl-input-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, sans-serif);
1470
- --atbl-space-xs: 5px;
1471
- --atbl-space-sm: 10px;
1472
- --atbl-space-md: 16px;
1473
- --atbl-space-lg: 24px;
1474
- --atbl-space-xl: 32px;
1475
- --atbl-content-width: 1920px;
1476
- --atbl-control-height: 2.375rem;
1477
- --atbl-control-compact-height: 1.875rem;
1478
- --atbl-control-icon-size: 1rem;
1479
- --atbl-control-padding-inline: .75rem;
1480
- --atbl-control-padding-block: .375rem;
1481
- --atbl-control-gap: .5rem;
1482
- --atbl-control-disabled-opacity: .5;
1483
- --atbl-radius-control: 7px;
1484
- --atbl-radius-surface: 12px;
1485
- --atbl-radius-overlay: 16px;
1486
- --atbl-shadow-surface: 0 3px 16px #141c280d;
1487
- --atbl-shadow-overlay: 0 18px 50px #00000029;
1488
- --atbl-shadow-control: 0 1px 3px #0000001a;
1489
- --atbl-cursor-action: pointer;
1490
- --atbl-cursor-disabled: default;
1491
- --atbl-cursor-help: help;
1492
- --atbl-cursor-busy: progress;
1493
- --atbl-duration-fast: .12s;
1494
- --atbl-duration-normal: .18s;
1495
- --atbl-duration-slow: .24s;
1496
- --atbl-ease-standard: ease;
1497
- --atbl-ease-enter: cubic-bezier(.2, .7, .2, 1);
1498
- --atbl-chart-1: color-mix(in srgb, var(--atbl-input-chart-1, #285fc0) var(--atbl-chart-strength), white);
1499
- --atbl-chart-2: color-mix(in srgb, var(--atbl-input-chart-2, #a95319) var(--atbl-chart-strength), white);
1500
- --atbl-chart-3: color-mix(in srgb, var(--atbl-input-chart-3, #147862) var(--atbl-chart-strength), white);
1501
- --atbl-chart-4: color-mix(in srgb, var(--atbl-input-chart-4, #7243aa) var(--atbl-chart-strength), white);
1502
- --atbl-chart-5: color-mix(in srgb, var(--atbl-input-chart-5, #aa3958) var(--atbl-chart-strength), white);
1503
- --atbl-chart-6: color-mix(in srgb, var(--atbl-input-chart-6, #475569) var(--atbl-chart-strength), white);
1504
- --atbl-chart-7: color-mix(in srgb, var(--atbl-input-chart-7, #285fc0) var(--atbl-chart-strength), white);
1505
- --atbl-chart-8: color-mix(in srgb, var(--atbl-input-chart-8, #a95319) var(--atbl-chart-strength), white);
1506
- --atbl-type-emphasis-weight: 680;
1507
- --atbl-type-meta-weight: 500;
1508
- --atbl-type-page-size: clamp(1.375rem, 2.4vw, 1.75rem);
1509
- --atbl-type-section-size: 1.25rem;
1510
- --atbl-type-widget-size: var(--atbl-type-label-size);
1511
- --atbl-type-body-size: .875rem;
1512
- --atbl-type-label-size: .8125rem;
1513
- --atbl-type-meta-size: .75rem;
1514
- --atbl-type-metric-size: clamp(1.625rem, 3vw, 2.125rem);
1515
- --atbl-type-heading-weight: 650;
1516
- --atbl-type-label-weight: 600;
1517
- --atbl-type-body-leading: 1.65;
1518
- --atbl-type-label-leading: 1.4;
1519
- --atbl-type-heading-leading: 1.3;
1520
- --atbl-type-metric-leading: 1.08;
1521
- --atbl-text-measure: 70ch;
1522
- }
1523
- }
1524
-
1525
- /* src/react/appearance.css */
1526
- @layer atbl.tokens {
1527
- :root {
1528
- --atbl-palette-background: #fff;
1529
- --atbl-palette-surface: #fff;
1530
- --atbl-palette-subtle: #f6f7f7;
1531
- --atbl-palette-text: #202124;
1532
- --atbl-palette-muted: #687078;
1533
- --atbl-palette-border: #e3e6e8;
1534
- --atbl-palette-accent: var(--atbl-input-accent, var(--atbl-text));
1535
- --atbl-palette-on-accent: var(--atbl-input-on-accent, #fff);
1536
- --atbl-palette-positive: #147862;
1537
- --atbl-palette-danger: #b42318;
1538
- --atbl-chart-strength: 100%;
1539
- --atbl-accent-subtle-strength: 12%;
1540
- }
1541
-
1542
- :root[data-atbl-theme="dark"] {
1543
- --atbl-palette-background: #151719;
1544
- --atbl-palette-surface: #202326;
1545
- --atbl-palette-subtle: #292d31;
1546
- --atbl-palette-text: #f2f3f4;
1547
- --atbl-palette-muted: #aeb5bc;
1548
- --atbl-palette-border: #3b4248;
1549
- }
1550
-
1551
- :root[data-atbl-base-color="slate"] {
1552
- --atbl-palette-background: #f8fafc;
1553
- --atbl-palette-surface: #fff;
1554
- --atbl-palette-subtle: #f1f5f9;
1555
- --atbl-palette-text: #17212f;
1556
- --atbl-palette-muted: #607083;
1557
- --atbl-palette-border: #dce3ea;
1558
- }
1559
-
1560
- :root[data-atbl-base-color="slate"][data-atbl-theme="dark"] {
1561
- --atbl-palette-background: #111820;
1562
- --atbl-palette-surface: #1b2530;
1563
- --atbl-palette-subtle: #263340;
1564
- --atbl-palette-text: #f0f4f8;
1565
- --atbl-palette-muted: #a8b5c3;
1566
- --atbl-palette-border: #3a4857;
1567
- }
1568
-
1569
- :root[data-atbl-base-color="warm"] {
1570
- --atbl-palette-background: #fbfaf8;
1571
- --atbl-palette-surface: #fff;
1572
- --atbl-palette-subtle: #f5f2ed;
1573
- --atbl-palette-text: #292723;
1574
- --atbl-palette-muted: #736e66;
1575
- --atbl-palette-border: #e8e2da;
1576
- }
1577
-
1578
- :root[data-atbl-base-color="warm"][data-atbl-theme="dark"] {
1579
- --atbl-palette-background: #1b1916;
1580
- --atbl-palette-surface: #25221e;
1581
- --atbl-palette-subtle: #302c27;
1582
- --atbl-palette-text: #f5f1eb;
1583
- --atbl-palette-muted: #bcb3a8;
1584
- --atbl-palette-border: #494239;
1585
- }
1586
-
1587
- :root[data-atbl-theme="dark"] {
1588
- --atbl-palette-accent: var(--atbl-input-dark-accent, var(--atbl-text));
1589
- --atbl-accent-subtle-strength: 22%;
1590
- --atbl-palette-on-accent: var(--atbl-input-on-accent, var(--atbl-background));
1591
- --atbl-palette-positive: #6bc39a;
1592
- --atbl-palette-danger: #f97066;
1593
- --atbl-backdrop: #0000008c;
1594
- --atbl-code-surface: #242a31;
1595
- --atbl-code-text: #e5e9ef;
1596
- --atbl-chart-strength: 60%;
1597
- }
1598
-
1599
- :root[data-atbl-density="compact"] {
1600
- --atbl-control-height: 2.125rem;
1601
- --atbl-control-compact-height: 1.625rem;
1602
- --atbl-control-gap: .375rem;
1603
- --atbl-control-padding-inline: .625rem;
1604
- --atbl-control-padding-block: .25rem;
1605
- --atbl-space-xs: 4px;
1606
- --atbl-space-sm: 8px;
1607
- --atbl-space-md: 12px;
1608
- --atbl-space-lg: 18px;
1609
- --atbl-space-xl: 24px;
1610
- }
1611
-
1612
- :root[data-atbl-density="spacious"] {
1613
- --atbl-control-height: 2.625rem;
1614
- --atbl-control-compact-height: 2.125rem;
1615
- --atbl-control-gap: .625rem;
1616
- --atbl-control-padding-inline: 1rem;
1617
- --atbl-control-padding-block: .5rem;
1618
- --atbl-space-xs: 6px;
1619
- --atbl-space-sm: 12px;
1620
- --atbl-space-md: 20px;
1621
- --atbl-space-lg: 30px;
1622
- --atbl-space-xl: 40px;
1623
- }
1624
-
1625
- :root[data-atbl-radius="none"] {
1626
- --atbl-radius-control: 0px;
1627
- --atbl-radius-surface: 0px;
1628
- --atbl-radius-overlay: 0px;
1629
- }
1630
-
1631
- :root[data-atbl-radius="small"] {
1632
- --atbl-radius-control: 4px;
1633
- --atbl-radius-surface: 7px;
1634
- --atbl-radius-overlay: 9px;
1635
- }
1636
-
1637
- :root[data-atbl-radius="large"] {
1638
- --atbl-radius-control: 10px;
1639
- --atbl-radius-surface: 18px;
1640
- --atbl-radius-overlay: 24px;
1641
- }
1642
-
1643
- :root[data-atbl-elevation="flat"] {
1644
- --atbl-shadow-surface: none;
1645
- --atbl-shadow-overlay: none;
1646
- --atbl-shadow-control: none;
1647
- }
1648
-
1649
- :root[data-atbl-elevation="raised"] {
1650
- --atbl-shadow-surface: 0 8px 28px #141c281a;
1651
- --atbl-shadow-overlay: 0 24px 72px #0000003d;
1652
- --atbl-shadow-control: 0 2px 6px #00000029;
1653
- }
1654
-
1655
- @media (forced-colors: active) {
1656
- :root {
1657
- --atbl-focus-color: Highlight !important;
1658
- --atbl-on-accent: HighlightText !important;
1659
- }
1660
- }
1661
- }
1662
-
1663
- /* src/react/base.css */
1664
- @layer atbl.base {
1665
- :where([class^="altertable-"], [class*=" altertable-"]) {
1666
- box-sizing: border-box;
1667
- }
1668
-
1669
- :where([class^="altertable-"], [class*=" altertable-"]) * {
1670
- box-sizing: border-box;
1671
- }
1672
-
1673
- :where([class^="starter-"], [class*=" starter-"]) * {
1674
- box-sizing: border-box;
1675
- }
1676
-
1677
- :where([class^="altertable-"], [class*=" altertable-"]) button {
1678
- font: inherit;
1679
- }
1680
-
1681
- :root[data-atbl-appearance] {
1682
- scrollbar-gutter: stable;
1683
- font-family: var(--atbl-font);
1684
- color: var(--atbl-text);
1685
- background: var(--atbl-background);
1686
- font-synthesis: none;
1687
- -webkit-font-smoothing: antialiased;
1688
- text-rendering: optimizeLegibility;
1689
- }
1690
-
1691
- :root[data-atbl-theme="light"] {
1692
- --buncss-light: initial;
1693
- --buncss-dark: ;
1694
- color-scheme: light;
1695
- }
1696
-
1697
- :root[data-atbl-theme="dark"] {
1698
- --buncss-light: ;
1699
- --buncss-dark: initial;
1700
- color-scheme: dark;
1701
- }
1702
-
1703
- :root[data-atbl-appearance] body, :root[data-atbl-appearance] #root {
1704
- margin: 0;
1705
- }
1706
-
1707
- .altertable-sr-only {
1708
- position: fixed;
1709
- overflow: hidden;
1710
- clip: rect(0, 0, 0, 0);
1711
- clip-path: inset(50%);
1712
- white-space: nowrap;
1713
- border: 0;
1714
- width: 1px;
1715
- height: 1px;
1716
- margin: -1px;
1717
- padding: 0;
1718
- }
1719
- }
1720
-
1721
- /* src/react/annotations/colors.css */
1722
- @layer atbl.components {
1723
- :root {
1724
- --atbl-annotation-accent: #c026d3;
1725
- --atbl-annotation-accent-hover: #a21caf;
1726
- --atbl-annotation-on-accent: #fff;
1727
- }
1728
-
1729
- .altertable-annotation-trigger, .altertable-annotation-composer {
1730
- --atbl-control-selected-surface: var(--atbl-annotation-accent);
1731
- --atbl-control-selected-text: var(--atbl-annotation-on-accent);
1732
- --atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
1733
- }
1734
-
1735
- .altertable-annotation-trigger[aria-pressed="true"], .altertable-annotation-trigger:not([aria-pressed]) {
1736
- background: var(--atbl-annotation-accent);
1737
- color: var(--atbl-annotation-on-accent);
1738
- border-color: #0000;
1739
- }
1740
-
1741
- .altertable-annotation-trigger[aria-pressed="true"]:hover:not(:disabled) {
1742
- --atbl-control-selected-surface: var(--atbl-annotation-accent-hover);
1743
- }
1744
-
1745
- .altertable-annotation-trigger:not([aria-pressed]) {
1746
- --atbl-control-hover-surface: var(--atbl-annotation-accent-hover);
1747
- --atbl-control-pressed-surface: var(--atbl-annotation-accent-hover);
1748
- }
1749
- }
1750
-
1751
- /* src/react/ui/Button.css */
1752
- @layer atbl.components {
1753
- .altertable-button {
1754
- display: inline-flex;
1755
- justify-content: center;
1756
- align-items: center;
1757
- gap: var(--atbl-control-gap);
1758
- min-height: var(--atbl-control-height);
1759
- padding: var(--atbl-control-padding-block) var(--atbl-control-padding-inline);
1760
- border: 1px solid var(--atbl-border);
1761
- border-radius: var(--atbl-radius-control);
1762
- background: var(--atbl-surface);
1763
- color: var(--atbl-text);
1764
- font: inherit;
1765
- font-size: var(--atbl-type-label-size);
1766
- font-weight: var(--atbl-type-label-weight);
1767
- line-height: var(--atbl-type-label-leading);
1768
- overflow-wrap: anywhere;
1769
- transition: background-color var(--atbl-duration-fast) var(--atbl-ease-standard), border-color var(--atbl-duration-fast) var(--atbl-ease-standard), color var(--atbl-duration-fast) var(--atbl-ease-standard);
1770
- -webkit-tap-highlight-color: transparent;
1771
- max-inline-size: 100%;
1772
- }
1773
-
1774
- .altertable-button[data-size="icon"] {
1775
- width: var(--atbl-control-height);
1776
- min-width: var(--atbl-control-height);
1777
- height: var(--atbl-control-height);
1778
- min-height: var(--atbl-control-height);
1779
- flex: none;
1780
- padding: 0;
1781
- }
1782
-
1783
- .altertable-button[data-variant="primary"] {
1784
- border-color: var(--atbl-text);
1785
- background: var(--atbl-text);
1786
- color: var(--atbl-background);
1787
- --atbl-control-hover-surface: color-mix(in srgb, var(--atbl-text) 92%, var(--atbl-background));
1788
- --atbl-control-pressed-surface: color-mix(in srgb, var(--atbl-text) 84%, var(--atbl-background));
1789
- }
1790
-
1791
- .altertable-button[data-variant="outline"] {
1792
- box-shadow: none;
1793
- }
1794
-
1795
- .altertable-button[data-variant="elevated"] {
1796
- box-shadow: var(--atbl-shadow-surface);
1797
- }
1798
-
1799
- .altertable-button[data-variant="ghost"] {
1800
- box-shadow: none;
1801
- background: none;
1802
- border-color: #0000;
1803
- }
1804
-
1805
- @media (prefers-reduced-motion: reduce) {
1806
- .altertable-button {
1807
- transition: none;
1808
- }
1809
- }
1810
-
1811
- .altertable-button[data-size="compact"] {
1812
- min-height: var(--atbl-control-compact-height);
1813
- padding: calc(var(--atbl-control-padding-block) * 2 / 3) calc(var(--atbl-control-padding-inline) * 2 / 3);
1814
- font-size: var(--atbl-type-meta-size);
1815
- }
1816
-
1817
- .altertable-button[data-size="icon-compact"] {
1818
- width: var(--atbl-control-compact-height);
1819
- min-width: var(--atbl-control-compact-height);
1820
- height: var(--atbl-control-compact-height);
1821
- min-height: var(--atbl-control-compact-height);
1822
- flex: none;
1823
- padding: 0;
1824
- }
1825
-
1826
- .altertable-button[data-size^="icon"] > svg {
1827
- inline-size: var(--atbl-control-icon-size);
1828
- block-size: var(--atbl-control-icon-size);
1829
- }
1830
- }
1831
-
1832
- /* src/react/ui/Tooltip.css */
1833
- @layer atbl.components {
1834
- .altertable-tooltip-trigger {
1835
- display: inline-flex;
1836
- align-items: center;
1837
- }
1838
-
1839
- .altertable-tooltip-trigger[data-variant="chart"] {
1840
- display: flex;
1841
- align-items: flex-end;
1842
- width: 100%;
1843
- min-width: 0;
1844
- height: 100%;
1845
- }
1846
-
1847
- .altertable-tooltip-content {
1848
- z-index: 1300;
1849
- border: 1px solid var(--atbl-border);
1850
- border-radius: var(--atbl-radius-control);
1851
- background: var(--atbl-surface);
1852
- color: var(--atbl-text);
1853
- box-shadow: var(--atbl-shadow-overlay);
1854
- font: var(--atbl-type-meta-weight) var(--atbl-type-meta-size) / var(--atbl-type-label-leading) var(--atbl-font);
1855
- white-space: normal;
1856
- pointer-events: none;
1857
- animation: altertable-tooltip-in var(--atbl-duration-fast) ease-out;
1858
- width: max-content;
1859
- max-width: min(240px, 100vw - 24px);
1860
- padding: 6px 9px;
1861
- }
1862
-
1863
- .altertable-tooltip-content[data-variant="chart"] {
1864
- display: grid;
1865
- font-variant-numeric: tabular-nums;
1866
- gap: 2px;
1867
- padding: 8px 10px;
1868
- }
1869
-
1870
- .altertable-tooltip-content[data-variant="chart"] strong {
1871
- font-size: var(--atbl-type-body-size);
1872
- font-weight: 650;
1873
- line-height: 1.2;
1874
- }
1875
-
1876
- @keyframes altertable-tooltip-in {
1877
- from {
1878
- opacity: 0;
1879
- }
1880
- }
1881
-
1882
- @media (prefers-reduced-motion: reduce) {
1883
- .altertable-tooltip-content {
1884
- animation: none;
1885
- }
1886
- }
1887
-
1888
- .altertable-chart-tooltip-row {
1889
- display: flex;
1890
- align-items: flex-start;
1891
- gap: 6px;
1892
- }
1893
-
1894
- .altertable-chart-tooltip-marker {
1895
- flex-shrink: 0;
1896
- width: 8px;
1897
- height: 8px;
1898
- margin-top: .3em;
1899
- }
1900
-
1901
- .altertable-chart-tooltip-reading {
1902
- overflow-wrap: anywhere;
1903
- min-width: 0;
1904
- }
1905
- }
1906
-
1907
- /* src/react/ui/Kbd.css */
1908
- @layer atbl.components {
1909
- .altertable-kbd {
1910
- display: inline-flex;
1911
- border: 1px solid var(--atbl-border);
1912
- background: var(--atbl-subtle);
1913
- color: var(--atbl-muted);
1914
- font: var(--atbl-type-label-weight) var(--atbl-type-meta-size) / var(--atbl-type-label-leading) var(--atbl-font);
1915
- font-variant-numeric: tabular-nums;
1916
- white-space: nowrap;
1917
- border-radius: 5px;
1918
- justify-content: center;
1919
- align-items: center;
1920
- min-width: 1.6em;
1921
- padding: 2px 5px;
1922
- }
1923
-
1924
- .altertable-button[data-variant="primary"] .altertable-kbd {
1925
- color: inherit;
1926
- border-color: color-mix(in srgb, currentColor 30%, transparent);
1927
- background: none;
1928
- }
1929
- }
1930
-
1931
- /* src/react/annotations/AnnotationBar.css */
1932
- @layer atbl.components {
1933
- .altertable-annotation-bar, .altertable-annotation-bar-panel {
1934
- --bar-surface: #202326;
1935
- --bar-text: #f2f3f4;
1936
- --bar-muted: #aeb5bc;
1937
- --bar-border: #3b4248;
1938
- --bar-danger: #ffa6a0;
1939
- --bar-danger-surface: #572723;
1940
- --atbl-control-selected-surface: var(--atbl-subtle);
1941
- --atbl-control-selected-text: var(--bar-text);
1942
- --atbl-control-disabled-opacity: 1;
1943
- --atbl-surface: var(--bar-surface);
1944
- --atbl-text: var(--bar-text);
1945
- --atbl-muted: var(--bar-muted);
1946
- --atbl-border: var(--bar-border);
1947
- --atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
1948
- --atbl-subtle: color-mix(in srgb, var(--bar-text) 8%, var(--bar-surface));
1949
- color: var(--bar-text);
1950
- background: var(--bar-surface);
1951
- font: 14px / 1.5 var(--atbl-font);
1952
- box-sizing: border-box;
1953
- border: 1px solid var(--bar-border);
1954
- box-shadow: 0 8px 28px #0003;
1955
- }
1956
-
1957
- .altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip) {
1958
- --bar-surface: #202326;
1959
- --bar-text: #f2f3f4;
1960
- --bar-muted: #aeb5bc;
1961
- --bar-border: #3b4248;
1962
- --bar-danger: #ffa6a0;
1963
- --bar-danger-surface: #572723;
1964
- --atbl-control-selected-surface: var(--atbl-subtle);
1965
- --atbl-control-selected-text: var(--bar-text);
1966
- --atbl-control-disabled-opacity: 1;
1967
- --atbl-surface: var(--bar-surface);
1968
- --atbl-text: var(--bar-text);
1969
- --atbl-muted: var(--bar-muted);
1970
- --atbl-border: var(--bar-border);
1971
- --atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
1972
- --atbl-subtle: color-mix(in srgb, var(--bar-text) 8%, var(--bar-surface));
1973
- color: var(--bar-text);
1974
- background: var(--bar-surface);
1975
- font: 14px / 1.5 var(--atbl-font);
1976
- box-sizing: border-box;
1977
- border: 1px solid var(--bar-border);
1978
- box-shadow: 0 8px 28px #0003;
1979
- }
1980
-
1981
- .altertable-annotation-bar[data-theme="dark"], .altertable-annotation-bar-panel[data-theme="dark"] {
1982
- --bar-surface: #f2f3f4;
1983
- --bar-text: #151719;
1984
- --bar-muted: #505963;
1985
- --bar-border: #dfe3e6;
1986
- --bar-danger: #b42318;
1987
- --bar-danger-surface: #ffe3e3;
1988
- }
1989
-
1990
- .altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip[data-theme="dark"]) {
1991
- --bar-surface: #f2f3f4;
1992
- --bar-text: #151719;
1993
- --bar-muted: #505963;
1994
- --bar-border: #dfe3e6;
1995
- --bar-danger: #b42318;
1996
- --bar-danger-surface: #ffe3e3;
1997
- }
1998
-
1999
- .altertable-annotation-bar {
2000
- position: fixed;
2001
- z-index: 1200;
2002
- display: flex;
2003
- border-radius: 18px;
2004
- align-items: center;
2005
- gap: 4px;
2006
- max-width: calc(100vw - 24px);
2007
- padding: 8px;
2008
- bottom: 16px;
2009
- left: 50%;
2010
- transform: translateX(-50%);
2011
- }
2012
-
2013
- .altertable-annotation-bar .altertable-button, .altertable-annotation-bar-panel .altertable-button {
2014
- color: var(--bar-muted);
2015
- font: inherit;
2016
- flex-shrink: 0;
2017
- width: auto;
2018
- transition: none;
2019
- }
2020
-
2021
- .altertable-annotation-bar .altertable-annotation-bar-count {
2022
- white-space: nowrap;
2023
- color: var(--bar-text);
2024
- padding-inline-start: 6px;
2025
- padding-inline-end: 6px;
2026
- }
2027
-
2028
- .altertable-annotation-bar .altertable-button[data-atbl-internal-drag-handle] {
2029
- --atbl-cursor-action: grab;
2030
- touch-action: none;
2031
- }
2032
-
2033
- .altertable-annotation-bar .altertable-button[data-atbl-internal-drag-handle]:active {
2034
- --atbl-cursor-action: grabbing;
2035
- }
2036
-
2037
- .altertable-annotation-bar .altertable-annotation-bar-send {
2038
- --atbl-control-hover-surface: var(--atbl-annotation-accent-hover);
2039
- --atbl-control-pressed-surface: var(--atbl-annotation-accent-hover);
2040
- background: var(--atbl-annotation-accent);
2041
- color: var(--atbl-annotation-on-accent);
2042
- border-color: #0000;
2043
- border-radius: 12px;
2044
- padding-inline-start: 14px;
2045
- padding-inline-end: 14px;
2046
- font-weight: 600;
2047
- line-height: 1.25;
2048
- }
2049
-
2050
- .altertable-annotation-bar-panel {
2051
- position: fixed;
2052
- z-index: 1201;
2053
- overflow: auto;
2054
- border-radius: 16px;
2055
- width: min(420px, 100vw - 24px);
2056
- max-height: min(440px, 45vh);
2057
- margin: 0;
2058
- padding: 6px;
2059
- }
2060
-
2061
- .altertable-annotation-bar-panel header {
2062
- display: flex;
2063
- justify-content: space-between;
2064
- align-items: center;
2065
- padding: 4px 8px;
2066
- }
2067
-
2068
- .altertable-annotation-bar-row {
2069
- display: flex;
2070
- border-radius: 10px;
2071
- align-items: center;
2072
- gap: 8px;
2073
- padding: 4px;
2074
- }
2075
-
2076
- .altertable-annotation-bar-row:hover, .altertable-annotation-bar-row:focus-within {
2077
- background: var(--atbl-subtle);
2078
- }
2079
-
2080
- .altertable-annotation-bar-row + .altertable-annotation-bar-row {
2081
- border-top: 1px solid var(--bar-border);
2082
- }
2083
-
2084
- .altertable-annotation-bar-panel .altertable-annotation-bar-open {
2085
- display: grid;
2086
- text-align: left;
2087
- flex: 1;
2088
- justify-content: stretch;
2089
- gap: 2px;
2090
- min-width: 0;
2091
- height: auto;
2092
- padding: 4px 6px;
2093
- }
2094
-
2095
- .altertable-annotation-bar-open strong {
2096
- color: var(--bar-text);
2097
- font-weight: 600;
2098
- }
2099
-
2100
- .altertable-annotation-bar-open span {
2101
- color: var(--bar-muted);
2102
- overflow-wrap: anywhere;
2103
- font-size: 13px;
2104
- }
2105
-
2106
- .altertable-annotation-bar-panel .altertable-annotation-bar-open:hover:not(:disabled) {
2107
- background: none;
2108
- }
2109
-
2110
- .altertable-annotation-bar-error {
2111
- position: absolute;
2112
- background: var(--bar-surface);
2113
- color: var(--bar-text);
2114
- border: 1px solid var(--bar-border);
2115
- border-radius: 10px;
2116
- padding: 8px 12px;
2117
- font-size: 12px;
2118
- bottom: calc(100% + 8px);
2119
- left: 0;
2120
- right: 0;
2121
- }
2122
-
2123
- @media (max-width: 420px) {
2124
- .altertable-annotation-bar {
2125
- gap: 0;
2126
- padding: 6px;
2127
- font-size: 12px;
2128
- }
2129
-
2130
- .altertable-annotation-bar .altertable-annotation-bar-send {
2131
- padding-inline-start: 10px;
2132
- padding-inline-end: 10px;
2133
- }
2134
- }
2135
-
2136
- @media (max-width: 360px) {
2137
- .altertable-annotation-bar .altertable-button[data-size="icon-compact"] {
2138
- width: 26px;
2139
- min-width: 26px;
2140
- }
2141
- }
2142
-
2143
- .altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip) {
2144
- font-size: 12px;
2145
- line-height: 1.3;
2146
- }
2147
-
2148
- .altertable-annotation-bar .altertable-button:hover:not(:disabled), .altertable-annotation-bar-panel .altertable-button:hover:not(:disabled) {
2149
- color: var(--bar-text);
2150
- background: var(--atbl-subtle);
2151
- }
2152
-
2153
- .altertable-annotation-bar .altertable-annotation-bar-send:hover:not(:disabled) {
2154
- color: var(--atbl-annotation-on-accent);
2155
- background: var(--atbl-annotation-accent-hover);
2156
- }
2157
-
2158
- .altertable-annotation-bar .altertable-button:disabled, .altertable-annotation-bar-panel .altertable-button:disabled {
2159
- color: var(--bar-muted);
2160
- }
2161
-
2162
- .altertable-annotation-bar .altertable-annotation-bar-send:disabled {
2163
- color: var(--bar-muted);
2164
- background: var(--atbl-subtle);
2165
- }
2166
-
2167
- .altertable-annotation-bar .altertable-annotation-bar-send {
2168
- position: relative;
2169
- }
2170
-
2171
- .altertable-annotation-bar-send[data-pending] .altertable-annotation-bar-send-label {
2172
- visibility: hidden;
2173
- }
2174
-
2175
- .altertable-annotation-bar-spinner {
2176
- position: absolute;
2177
- animation: 1s linear infinite annotation-bar-spin;
2178
- margin: auto;
2179
- inset: 0;
2180
- }
2181
-
2182
- @keyframes annotation-bar-spin {
2183
- to {
2184
- rotate: 360deg;
2185
- }
2186
- }
2187
-
2188
- .altertable-annotation-discard-description {
2189
- color: var(--atbl-muted);
2190
- font: 14px / 1.55 var(--atbl-font);
2191
- margin: 0;
2192
- }
2193
-
2194
- .altertable-annotation-discard-confirm {
2195
- color: var(--atbl-danger);
2196
- }
2197
-
2198
- @media (prefers-reduced-motion: reduce) {
2199
- .altertable-annotation-bar-spinner {
2200
- animation: none;
2201
- }
2202
- }
2203
-
2204
- .altertable-annotation-bar .altertable-button[aria-pressed="true"] {
2205
- color: var(--bar-text);
2206
- background: var(--atbl-subtle);
2207
- }
2208
-
2209
- .altertable-annotation-undo {
2210
- position: fixed;
2211
- z-index: 1202;
2212
- display: flex;
2213
- border: 1px solid var(--atbl-border);
2214
- border-radius: var(--atbl-radius-overlay);
2215
- background: var(--atbl-surface);
2216
- color: var(--atbl-text);
2217
- box-shadow: var(--atbl-shadow-overlay);
2218
- font: 13px / 1.5 var(--atbl-font);
2219
- align-items: center;
2220
- gap: 12px;
2221
- padding: 8px 12px;
2222
- bottom: 16px;
2223
- left: 16px;
2224
- }
2225
-
2226
- .altertable-annotation-thumbnail {
2227
- border: 1px solid var(--bar-border);
2228
- overflow: hidden;
2229
- background: var(--bar-surface);
2230
- --atbl-cursor-action: zoom-in;
2231
- border-radius: 6px;
2232
- flex-shrink: 0;
2233
- width: 56px;
2234
- height: 40px;
2235
- padding: 0;
2236
- }
2237
-
2238
- .altertable-annotation-thumbnail img {
2239
- object-fit: contain;
2240
- display: block;
2241
- width: 100%;
2242
- height: 100%;
2243
- }
2244
-
2245
- .altertable-annotation-thumbnail:focus-visible {
2246
- outline: 2px solid var(--atbl-annotation-accent);
2247
- outline-offset: 2px;
2248
- }
2249
-
2250
- .altertable-annotation-preview {
2251
- display: block;
2252
- object-fit: contain;
2253
- width: 100%;
2254
- max-height: 65vh;
2255
- }
2256
-
2257
- .altertable-annotation-undo[data-bar-visible] {
2258
- bottom: 88px;
2259
- }
2260
-
2261
- .altertable-annotation-undo[data-inline] {
2262
- position: static;
2263
- box-shadow: none;
2264
- border-radius: 8px;
2265
- margin-top: 6px;
2266
- }
2267
-
2268
- .altertable-sheet.altertable-annotation-image-dialog[data-placement="center"] {
2269
- width: min(960px, 100vw - 32px);
2270
- }
2271
- }
2272
-
2273
- /* src/react/ui/Sheet.css */
2274
- @layer atbl.components {
2275
- :root:has(.altertable-sheet:modal) {
2276
- overflow: hidden;
2277
- }
2278
-
2279
- .altertable-sheet:not([open]) {
2280
- display: none;
2281
- }
2282
-
2283
- .altertable-sheet {
2284
- position: fixed;
2285
- overflow: visible;
2286
- border: 0;
2287
- border-left: 1px solid var(--atbl-border);
2288
- background: var(--atbl-surface);
2289
- color: var(--atbl-text);
2290
- box-shadow: var(--atbl-shadow-overlay);
2291
- font: var(--atbl-type-body-size) / var(--atbl-type-label-leading) var(--atbl-font);
2292
- opacity: 0;
2293
- transition: translate var(--atbl-duration-slow) cubic-bezier(.22, 1, .36, 1), opacity var(--atbl-duration-slow) var(--atbl-ease-standard);
2294
- border-radius: 0;
2295
- width: min(640px, 100vw);
2296
- max-width: none;
2297
- height: 100dvh;
2298
- max-height: none;
2299
- margin: 0;
2300
- padding: 0;
2301
- inset: 0 0 0 auto;
2302
- translate: 100%;
2303
- }
2304
-
2305
- .altertable-sheet[data-wide] {
2306
- width: min(960px, 100vw);
2307
- }
2308
-
2309
- .altertable-sheet[open] {
2310
- opacity: 1;
2311
- translate: 0;
2312
- }
2313
-
2314
- @starting-style {
2315
- .altertable-sheet[open] {
2316
- opacity: 0;
2317
- translate: 100%;
2318
- }
2319
- }
2320
-
2321
- .altertable-sheet[open][data-closing] {
2322
- opacity: 0;
2323
- transition-timing-function: ease-in;
2324
- translate: 100%;
2325
- }
2326
-
2327
- .altertable-sheet::backdrop {
2328
- background: var(--atbl-backdrop);
2329
- opacity: 0;
2330
- transition: opacity var(--atbl-duration-slow) var(--atbl-ease-standard);
2331
- }
2332
-
2333
- .altertable-sheet[open]::backdrop {
2334
- opacity: 1;
2335
- }
2336
-
2337
- .altertable-sheet[open][data-closing]::backdrop {
2338
- opacity: 0;
2339
- }
2340
-
2341
- @starting-style {
2342
- .altertable-sheet[open]::backdrop {
2343
- opacity: 0;
2344
- }
2345
- }
2346
-
2347
- .altertable-sheet-shell {
2348
- display: grid;
2349
- grid-template-rows: auto minmax(0, 1fr) auto;
2350
- height: 100%;
2351
- }
2352
-
2353
- .altertable-sheet-header {
2354
- display: flex;
2355
- justify-content: space-between;
2356
- align-items: flex-start;
2357
- gap: var(--atbl-space-md);
2358
- 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);
2359
- border-bottom: 1px solid var(--atbl-border);
2360
- }
2361
-
2362
- .altertable-sheet-header h2 {
2363
- font-size: var(--atbl-type-section-size);
2364
- font-weight: var(--atbl-type-heading-weight);
2365
- line-height: var(--atbl-type-heading-leading);
2366
- letter-spacing: -.02em;
2367
- overflow-wrap: anywhere;
2368
- margin: 0;
2369
- }
2370
-
2371
- .altertable-sheet-header p {
2372
- color: var(--atbl-muted);
2373
- font-size: var(--atbl-type-label-size);
2374
- margin: 4px 0 0;
2375
- line-height: 1.45;
2376
- }
2377
-
2378
- .altertable-sheet-actions {
2379
- display: flex;
2380
- align-items: center;
2381
- gap: 4px;
2382
- margin: -4px -8px 0 0;
2383
- }
2384
-
2385
- .altertable-sheet-close {
2386
- color: var(--atbl-muted);
2387
- }
2388
-
2389
- .altertable-sheet-body {
2390
- overflow-y: auto;
2391
- overscroll-behavior: contain;
2392
- 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);
2393
- min-height: 0;
2394
- }
2395
-
2396
- .altertable-sheet-footer {
2397
- padding: var(--atbl-space-md) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2);
2398
- border-top: 1px solid var(--atbl-border);
2399
- }
2400
-
2401
- @media (min-width: 601px) {
2402
- .altertable-sheet:where([data-placement="side"][data-side="left"]) {
2403
- border-left: 0;
2404
- border-right: 1px solid var(--atbl-border);
2405
- inset: 0 auto 0 0;
2406
- translate: -100%;
2407
- }
2408
-
2409
- .altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
2410
- translate: 0;
2411
- }
2412
-
2413
- .altertable-sheet:where([data-placement="side"][data-side="left"])[open][data-closing] {
2414
- translate: -100%;
2415
- }
2416
-
2417
- @starting-style {
2418
- .altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
2419
- translate: -100%;
2420
- }
2421
- }
2422
- }
2423
-
2424
- @media (max-width: 960px) {
2425
- .altertable-sheet[data-wide] {
2426
- box-shadow: none;
2427
- border: 0;
2428
- inset: auto 0 0;
2429
- translate: 0 100%;
2430
- }
2431
-
2432
- .altertable-sheet[data-wide][open] {
2433
- translate: 0;
2434
- }
2435
-
2436
- .altertable-sheet[data-wide][open][data-closing] {
2437
- translate: 0 100%;
2438
- }
2439
-
2440
- @starting-style {
2441
- .altertable-sheet[data-wide][open] {
2442
- translate: 0 100%;
2443
- }
2444
- }
2445
- }
2446
-
2447
- @media (max-width: 600px) {
2448
- .altertable-sheet {
2449
- box-shadow: none;
2450
- border: 0;
2451
- inset: auto 0 0;
2452
- translate: 0 100%;
2453
- }
2454
-
2455
- .altertable-sheet[open] {
2456
- translate: 0;
2457
- }
2458
-
2459
- .altertable-sheet[open][data-closing] {
2460
- translate: 0 100%;
2461
- }
2462
-
2463
- @starting-style {
2464
- .altertable-sheet[open] {
2465
- translate: 0 100%;
2466
- }
2467
- }
2468
-
2469
- .altertable-sheet-header {
2470
- padding: 20px 20px 16px;
2471
- }
2472
-
2473
- .altertable-sheet-body {
2474
- padding: 20px 20px 32px;
2475
- }
2476
-
2477
- .altertable-sheet-footer {
2478
- padding: 14px 20px;
2479
- }
2480
- }
2481
-
2482
- @media (prefers-reduced-motion: reduce) {
2483
- .altertable-sheet, .altertable-sheet[open][data-closing] {
2484
- transition: none;
2485
- translate: 0;
2486
- }
2487
-
2488
- .altertable-sheet::backdrop {
2489
- transition: none;
2490
- }
2491
-
2492
- @starting-style {
2493
- .altertable-sheet[open] {
2494
- translate: 0;
2495
- }
2496
- }
2497
- }
2498
-
2499
- .altertable-sheet[data-placement="center"] {
2500
- border: 1px solid var(--atbl-border, #e3e6e8);
2501
- border-radius: var(--atbl-radius-overlay);
2502
- width: min(480px, 100vw - 32px);
2503
- height: -moz-fit-content;
2504
- height: fit-content;
2505
- max-height: calc(100dvh - 32px);
2506
- margin: auto;
2507
- inset: 0;
2508
- translate: 0;
2509
- }
2510
-
2511
- .altertable-sheet[data-placement="center"] .altertable-sheet-shell {
2512
- height: auto;
2513
- }
2514
-
2515
- .altertable-sheet[data-placement="center"] .altertable-sheet-header {
2516
- padding: 20px 24px 16px;
2517
- }
2518
-
2519
- .altertable-sheet[data-placement="center"] .altertable-sheet-body {
2520
- padding: 0 24px 20px;
2521
- }
2522
-
2523
- .altertable-sheet[data-placement="center"] .altertable-sheet-footer {
2524
- padding: 16px 24px;
2525
- }
2526
- }
2527
-
2528
- /* src/react/ui/GradientScroll.css */
2529
- @layer atbl.components {
2530
- .altertable-gradient-scroll {
2531
- overflow: auto;
2532
- --atbl-scroll-fade-size: 1.5rem;
2533
- min-width: 0;
2534
- min-height: 0;
2535
- }
2536
-
2537
- .altertable-gradient-scroll[data-axis="vertical"] {
2538
- overflow-x: hidden;
2539
- }
2540
-
2541
- .altertable-gradient-scroll[data-axis="horizontal"] {
2542
- overflow-y: hidden;
2543
- }
2544
-
2545
- .altertable-gradient-scroll[data-axis="vertical"][data-fade-start][data-fade-end] {
2546
- mask-image: linear-gradient(to bottom, transparent, black var(--atbl-scroll-fade-size), black calc(100% - var(--atbl-scroll-fade-size)), transparent);
2547
- }
2548
-
2549
- .altertable-gradient-scroll[data-axis="vertical"][data-fade-start]:not([data-fade-end]) {
2550
- mask-image: linear-gradient(to bottom, transparent, black var(--atbl-scroll-fade-size));
2551
- }
2552
-
2553
- .altertable-gradient-scroll[data-axis="vertical"][data-fade-end]:not([data-fade-start]) {
2554
- mask-image: linear-gradient(to bottom, black, black calc(100% - var(--atbl-scroll-fade-size)), transparent);
2555
- }
2556
-
2557
- .altertable-gradient-scroll[data-axis="horizontal"][data-fade-start][data-fade-end] {
2558
- mask-image: linear-gradient(to right, transparent, black var(--atbl-scroll-fade-size), black calc(100% - var(--atbl-scroll-fade-size)), transparent);
2559
- }
2560
-
2561
- .altertable-gradient-scroll[data-axis="horizontal"][data-fade-start]:not([data-fade-end]) {
2562
- mask-image: linear-gradient(to right, transparent, black var(--atbl-scroll-fade-size));
2563
- }
2564
-
2565
- .altertable-gradient-scroll[data-axis="horizontal"][data-fade-end]:not([data-fade-start]) {
2566
- mask-image: linear-gradient(to right, black, black calc(100% - var(--atbl-scroll-fade-size)), transparent);
2567
- }
2568
- }
2569
-
2570
- /* src/react/ui/Focus.css */
2571
- @layer atbl.interaction {
2572
- [data-atbl-focus="inset"][data-atbl-internal-focus-state="focused"][data-focused] {
2573
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2574
- outline-offset: var(--atbl-focus-ring-offset);
2575
- }
2576
-
2577
- [data-atbl-focus="ring"]:-webkit-any(:focus-visible, [data-focus-visible]) {
2578
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2579
- outline-offset: var(--atbl-focus-ring-offset);
2580
- }
2581
-
2582
- [data-atbl-focus="ring"]:-moz-any(:focus-visible, [data-focus-visible]) {
2583
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2584
- outline-offset: var(--atbl-focus-ring-offset);
2585
- }
2586
-
2587
- [data-atbl-focus="ring"]:is(:focus-visible, [data-focus-visible]) {
2588
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2589
- outline-offset: var(--atbl-focus-ring-offset);
2590
- }
2591
-
2592
- [data-atbl-focus="ring"]:has( > input:focus-visible) {
2593
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2594
- outline-offset: var(--atbl-focus-ring-offset);
2595
- }
2596
-
2597
- [data-atbl-focus="inset"]:-webkit-any(:focus-visible, [data-focus-visible]) {
2598
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2599
- outline-offset: var(--atbl-focus-ring-offset);
2600
- }
2601
-
2602
- [data-atbl-focus="inset"]:-moz-any(:focus-visible, [data-focus-visible]) {
2603
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2604
- outline-offset: var(--atbl-focus-ring-offset);
2605
- }
2606
-
2607
- [data-atbl-focus="inset"]:is(:focus-visible, [data-focus-visible]) {
2608
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2609
- outline-offset: var(--atbl-focus-ring-offset);
2610
- }
2611
-
2612
- [data-atbl-internal-prose] a:focus-visible {
2613
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2614
- outline-offset: var(--atbl-focus-ring-offset);
2615
- }
2616
-
2617
- [data-atbl-focus="inset"][data-atbl-internal-focus-state="focused"][data-focused] {
2618
- outline-offset: var(--atbl-focus-ring-inset);
2619
- }
2620
-
2621
- [data-atbl-focus="inset"]:-webkit-any(:focus-visible, [data-focus-visible]) {
2622
- outline-offset: var(--atbl-focus-ring-inset);
2623
- }
2624
-
2625
- [data-atbl-focus="inset"]:-moz-any(:focus-visible, [data-focus-visible]) {
2626
- outline-offset: var(--atbl-focus-ring-inset);
2627
- }
2628
-
2629
- [data-atbl-focus="inset"]:is(:focus-visible, [data-focus-visible]) {
2630
- outline-offset: var(--atbl-focus-ring-inset);
2631
- }
2632
-
2633
- [data-atbl-focus="group"]:-webkit-any(:focus-within, [data-focus-within], [data-focus-visible]) {
2634
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2635
- outline-offset: var(--atbl-focus-ring-inset);
2636
- }
2637
-
2638
- [data-atbl-focus="group"]:-moz-any(:focus-within, [data-focus-within], [data-focus-visible]) {
2639
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2640
- outline-offset: var(--atbl-focus-ring-inset);
2641
- }
2642
-
2643
- [data-atbl-focus="group"]:is(:focus-within, [data-focus-within], [data-focus-visible]) {
2644
- outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
2645
- outline-offset: var(--atbl-focus-ring-inset);
2646
- }
2647
-
2648
- [data-atbl-focus="group"] input:focus-visible {
2649
- outline: none;
2650
- }
2651
-
2652
- @media (forced-colors: active) {
2653
- [data-atbl-focus]:-webkit-any(:focus-visible, :focus-within, [data-focus-visible]) {
2654
- outline-color: highlight !important;
2655
- }
2656
-
2657
- [data-atbl-focus]:-moz-any(:focus-visible, :focus-within, [data-focus-visible]) {
2658
- outline-color: highlight !important;
2659
- }
2660
-
2661
- [data-atbl-focus]:is(:focus-visible, :focus-within, [data-focus-visible]) {
2662
- outline-color: highlight !important;
2663
- }
2664
-
2665
- [data-atbl-internal-prose] a:focus-visible {
2666
- outline-color: highlight !important;
2667
- }
2668
- }
2669
- }
2670
-
2671
- /* src/react/interaction.css */
2672
- @layer atbl.interaction {
2673
- [data-atbl-control="default"] {
2674
- cursor: default;
2675
- }
2676
-
2677
- [data-atbl-control="action"], [data-atbl-internal-prose] a {
2678
- cursor: var(--atbl-cursor-action);
2679
- }
2680
-
2681
- [data-atbl-control="help"] {
2682
- cursor: var(--atbl-cursor-help);
2683
- }
2684
-
2685
- [data-atbl-control="text"] {
2686
- cursor: text;
2687
- font-size: var(--atbl-control-text-size, var(--atbl-type-body-size));
2688
- }
2689
-
2690
- @media (max-width: 560px), (any-pointer: coarse) {
2691
- [data-atbl-control="text"] {
2692
- font-size: max(16px, var(--atbl-control-text-size, var(--atbl-type-body-size)));
2693
- }
2694
- }
2695
-
2696
- [data-atbl-control]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
2697
- cursor: var(--atbl-cursor-disabled);
2698
- }
2699
-
2700
- [data-atbl-control]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
2701
- cursor: var(--atbl-cursor-disabled);
2702
- }
2703
-
2704
- [data-atbl-control]:is(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
2705
- cursor: var(--atbl-cursor-disabled);
2706
- }
2707
-
2708
- [data-atbl-control]:has( > input:disabled) {
2709
- cursor: var(--atbl-cursor-disabled);
2710
- }
2711
-
2712
- [data-atbl-control="action"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2713
- opacity: var(--atbl-control-disabled-opacity);
2714
- }
2715
-
2716
- [data-atbl-control="action"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2717
- opacity: var(--atbl-control-disabled-opacity);
2718
- }
2719
-
2720
- [data-atbl-control="action"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
2721
- opacity: var(--atbl-control-disabled-opacity);
2722
- }
2723
-
2724
- [data-atbl-control="help"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2725
- opacity: var(--atbl-control-disabled-opacity);
2726
- }
2727
-
2728
- [data-atbl-control="help"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2729
- opacity: var(--atbl-control-disabled-opacity);
2730
- }
2731
-
2732
- [data-atbl-control="help"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
2733
- opacity: var(--atbl-control-disabled-opacity);
2734
- }
2735
-
2736
- [data-atbl-control]:has( > input:disabled) {
2737
- opacity: var(--atbl-control-disabled-opacity);
2738
- }
2739
-
2740
- [data-atbl-control][aria-busy="true"]:not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2741
- cursor: var(--atbl-cursor-busy);
2742
- }
2743
-
2744
- [data-atbl-control][aria-busy="true"]:not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2745
- cursor: var(--atbl-cursor-busy);
2746
- }
2747
-
2748
- [data-atbl-control][aria-busy="true"]:not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2749
- cursor: var(--atbl-cursor-busy);
2750
- }
2751
-
2752
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-webkit-any(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2753
- background: var(--atbl-control-hover-surface, var(--atbl-subtle));
2754
- }
2755
-
2756
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-moz-any(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2757
- background: var(--atbl-control-hover-surface, var(--atbl-subtle));
2758
- }
2759
-
2760
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):is(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2761
- background: var(--atbl-control-hover-surface, var(--atbl-subtle));
2762
- }
2763
-
2764
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-webkit-any(:active, [data-pressed]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2765
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
2766
- }
2767
-
2768
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-moz-any(:active, [data-pressed]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2769
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
2770
- }
2771
-
2772
- :where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):is(:active, [data-pressed]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2773
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
2774
- }
2775
-
2776
- :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))) {
2777
- background: var(--atbl-control-open-surface, var(--atbl-surface));
2778
- }
2779
-
2780
- :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))) {
2781
- background: var(--atbl-control-open-surface, var(--atbl-surface));
2782
- }
2783
-
2784
- :where([data-atbl-internal-surface="control"]):is([aria-expanded="true"], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2785
- background: var(--atbl-control-open-surface, var(--atbl-surface));
2786
- }
2787
-
2788
- :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))) {
2789
- border-color: var(--atbl-control-open-border, var(--atbl-muted));
2790
- }
2791
-
2792
- :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))) {
2793
- border-color: var(--atbl-control-open-border, var(--atbl-muted));
2794
- }
2795
-
2796
- :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))) {
2797
- border-color: var(--atbl-control-open-border, var(--atbl-muted));
2798
- }
2799
-
2800
- :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))) {
2801
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2802
- color: var(--atbl-control-selected-text, var(--atbl-text));
2803
- }
2804
-
2805
- :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))) {
2806
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2807
- color: var(--atbl-control-selected-text, var(--atbl-text));
2808
- }
2809
-
2810
- :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))) {
2811
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2812
- color: var(--atbl-control-selected-text, var(--atbl-text));
2813
- }
2814
-
2815
- :where([data-atbl-internal-surface="option"])[data-selected]:not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2816
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2817
- color: var(--atbl-control-selected-text, var(--atbl-text));
2818
- }
2819
-
2820
- :where([data-atbl-internal-surface="option"])[data-selected]:not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2821
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2822
- color: var(--atbl-control-selected-text, var(--atbl-text));
2823
- }
2824
-
2825
- :where([data-atbl-internal-surface="option"])[data-selected]:not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2826
- background: var(--atbl-control-selected-surface, var(--atbl-subtle));
2827
- color: var(--atbl-control-selected-text, var(--atbl-text));
2828
- }
2829
-
2830
- :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))) {
2831
- background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2832
- }
2833
-
2834
- :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))) {
2835
- background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2836
- }
2837
-
2838
- :where([data-atbl-internal-surface="option"])[data-selected]:is(:hover, [data-hovered]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2839
- background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2840
- }
2841
-
2842
- :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))) {
2843
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2844
- }
2845
-
2846
- :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))) {
2847
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2848
- }
2849
-
2850
- :where([data-atbl-internal-surface="option"])[data-selected]:is(:active, [data-pressed]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
2851
- background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
2852
- }
2853
-
2854
- :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"]))) {
2855
- border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2856
- }
2857
-
2858
- :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"]))) {
2859
- border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2860
- }
2861
-
2862
- :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"]))) {
2863
- border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
2864
- }
2865
-
2866
- [data-atbl-internal-surface="field"]:-webkit-any([data-invalid], [aria-invalid="true"]) {
2867
- border-color: var(--atbl-danger);
2868
- --atbl-focus-color: var(--atbl-danger);
2869
- }
2870
-
2871
- [data-atbl-internal-surface="field"]:-moz-any([data-invalid], [aria-invalid="true"]) {
2872
- border-color: var(--atbl-danger);
2873
- --atbl-focus-color: var(--atbl-danger);
2874
- }
2875
-
2876
- [data-atbl-internal-surface="field"]:is([data-invalid], [aria-invalid="true"]) {
2877
- border-color: var(--atbl-danger);
2878
- --atbl-focus-color: var(--atbl-danger);
2879
- }
2880
-
2881
- [data-atbl-internal-surface="field"]:has(input[aria-invalid="true"]) {
2882
- border-color: var(--atbl-danger);
2883
- --atbl-focus-color: var(--atbl-danger);
2884
- }
2885
-
2886
- [data-atbl-control="text"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2887
- color: var(--atbl-muted);
2888
- }
2889
-
2890
- [data-atbl-control="text"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
2891
- color: var(--atbl-muted);
2892
- }
2893
-
2894
- [data-atbl-control="text"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
2895
- color: var(--atbl-muted);
2896
- }
2897
- }
2898
-
2899
- /* src/react/annotations/styles.css */
2900
- @layer atbl.tokens, atbl.base, atbl.components, atbl.interaction;
2901
- `,
2902
- options
2903
- });
2904
- }
2905
- export {
2906
- AnnotationBar,
2907
- AnnotationTarget,
2908
- Breakdown,
2909
- Button2 as Button,
2910
- Comparison,
2911
- DataApp,
2912
- DataSection,
2913
- DataValue,
2914
- DateDisplay2 as DateDisplay,
2915
- DateTimeTooltip2 as DateTimeTooltip,
2916
- EmptyState2 as EmptyState,
2917
- Grid,
2918
- GridItem,
2919
- IconButton2 as IconButton,
2920
- MetricWidget,
2921
- PeriodSummary,
2922
- Ranking,
2923
- SectionHeading2 as SectionHeading,
2924
- Skeleton2 as Skeleton,
2925
- Stack2 as Stack,
2926
- TableWidget,
2927
- TextContent2 as TextContent,
2928
- TextWidget,
2929
- Tooltip2 as Tooltip,
2930
- TooltipProvider2 as TooltipProvider,
2931
- UpdatedAt,
2932
- VisualizationWidget,
2933
- chartColor2 as chartColor,
2934
- choiceVariable2 as choiceVariable,
2935
- createDataContext2 as createDataContext,
2936
- createDataHooks2 as createDataHooks,
2937
- dateRangeVariable2 as dateRangeVariable,
2938
- defineDataIdentifiers,
2939
- injectDataAppAnnotationStyles,
2940
- injectDataAppStyles2 as injectDataAppStyles,
2941
- mountDataApp2 as mountDataApp,
2942
- multiChoiceVariable2 as multiChoiceVariable,
2943
- searchVariable2 as searchVariable,
2944
- useDataAppAnnotations2 as useDataAppAnnotations,
2945
- useDateFormatting2 as useDateFormatting
2946
- };
2947
-
2948
- //# debugId=1E1121DA24A2E4B464756E2164756E21