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