@altertable/data-app 0.65.0 → 0.67.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 (202) hide show
  1. package/AGENTS.md +38 -1
  2. package/CONTRIBUTING.md +54 -14
  3. package/README.md +1 -1
  4. package/dist/chunks/index-23dktynd.js +80 -0
  5. package/dist/chunks/index-23dktynd.js.map +10 -0
  6. package/dist/chunks/index-8qfxv0h5.js +14160 -0
  7. package/dist/chunks/index-8qfxv0h5.js.map +108 -0
  8. package/dist/chunks/index-ag0cgnvq.js +639 -0
  9. package/dist/chunks/index-ag0cgnvq.js.map +13 -0
  10. package/dist/chunks/index-dq7b35fn.js +307 -0
  11. package/dist/chunks/index-dq7b35fn.js.map +13 -0
  12. package/dist/chunks/{contract-a061yj6r.js → index-ev2b5aaf.js} +41 -72
  13. package/dist/chunks/index-ev2b5aaf.js.map +12 -0
  14. package/dist/chunks/{contract-awa2d5b1.js → index-f5cnbrjz.js} +19 -2
  15. package/dist/chunks/{contract-awa2d5b1.js.map → index-f5cnbrjz.js.map} +4 -3
  16. package/dist/chunks/{contract-sm7j7k95.js → index-ktmvs916.js} +9 -150
  17. package/dist/chunks/index-ktmvs916.js.map +13 -0
  18. package/dist/chunks/{contract-txjy0en2.js → index-m6n8ctfc.js} +64 -72
  19. package/dist/chunks/index-m6n8ctfc.js.map +10 -0
  20. package/dist/chunks/index-mt93ff2b.js +28 -0
  21. package/dist/chunks/index-mt93ff2b.js.map +10 -0
  22. package/dist/chunks/{contract-tf8c3qpv.js → index-qd5xgx6y.js} +46 -5
  23. package/dist/chunks/index-qd5xgx6y.js.map +13 -0
  24. package/dist/chunks/index-x69p7cv7.js +149 -0
  25. package/dist/chunks/index-x69p7cv7.js.map +10 -0
  26. package/dist/client/index.js +12 -7
  27. package/dist/client/index.js.map +1 -1
  28. package/dist/core/appearance.js +1 -1
  29. package/dist/core/config.js +7 -3
  30. package/dist/core/config.js.map +1 -1
  31. package/dist/core/contract.js +24 -6
  32. package/dist/core/contract.js.map +1 -1
  33. package/dist/core/format.js +1 -1
  34. package/dist/embed/index.js +16 -12
  35. package/dist/embed/index.js.map +4 -4
  36. package/dist/index.js +12 -0
  37. package/dist/index.js.map +9 -0
  38. package/dist/local.js +20 -30
  39. package/dist/local.js.map +7 -8
  40. package/dist/react/embed/index.js +1 -1
  41. package/dist/react/embed/index.js.map +2 -2
  42. package/dist/react/index.js +2567 -11542
  43. package/dist/react/index.js.map +16 -91
  44. package/dist/react/ui/index.js +2272 -0
  45. package/dist/react/ui/index.js.map +28 -0
  46. package/dist/server.js +13 -26
  47. package/dist/server.js.map +6 -7
  48. package/dist/types/client/annotations.d.ts +27 -0
  49. package/dist/types/client/data-client.d.ts +1 -2
  50. package/dist/types/client/iframe.d.ts +4 -2
  51. package/dist/types/client/index.d.ts +1 -0
  52. package/dist/types/core/annotations.d.ts +94 -0
  53. package/dist/types/core/appearance.d.ts +2 -2
  54. package/dist/types/core/config.d.ts +48 -4
  55. package/dist/types/core/contract.d.ts +21 -11
  56. package/dist/types/core/dimension.d.ts +6 -4
  57. package/dist/types/core/filters.d.ts +44 -0
  58. package/dist/types/core/messages.d.ts +2 -0
  59. package/dist/types/core/operation-types.d.ts +5 -2
  60. package/dist/types/core/operation.d.ts +3 -4
  61. package/dist/types/core/presentation.d.ts +2 -0
  62. package/dist/types/core/queries.d.ts +16 -0
  63. package/dist/types/core/uuid.d.ts +2 -0
  64. package/dist/types/core/variables.d.ts +34 -18
  65. package/dist/types/embed/runtime-html.d.ts +2 -0
  66. package/dist/types/embed/source.d.ts +2 -1
  67. package/dist/types/index.d.ts +3 -0
  68. package/dist/types/react/annotations/AnnotationBar.d.ts +30 -0
  69. package/dist/types/react/annotations/AnnotationControls.d.ts +10 -0
  70. package/dist/types/react/annotations/AnnotationEditor.d.ts +16 -0
  71. package/dist/types/react/annotations/AnnotationMarkers.d.ts +19 -0
  72. package/dist/types/react/annotations/AnnotationSelectionLayer.d.ts +12 -0
  73. package/dist/types/react/annotations/AnnotationTarget.d.ts +9 -0
  74. package/dist/types/react/annotations/AnnotationTooltip.d.ts +9 -0
  75. package/dist/types/react/annotations/AnnotationTrigger.d.ts +10 -0
  76. package/dist/types/react/annotations/annotation-editor-state.d.ts +56 -0
  77. package/dist/types/react/annotations/annotation-screenshot.d.ts +4 -0
  78. package/dist/types/react/annotations/annotation-targets.d.ts +33 -0
  79. package/dist/types/react/annotations/getAnnotationProps.d.ts +15 -0
  80. package/dist/types/react/annotations/styles.d.ts +3 -0
  81. package/dist/types/react/annotations/useAnnotationGeometry.d.ts +22 -0
  82. package/dist/types/react/annotations/useDataAppAnnotations.d.ts +22 -0
  83. package/dist/types/react/app-context.d.ts +3 -0
  84. package/dist/types/react/bindings.d.ts +110 -0
  85. package/dist/types/react/content.d.ts +24 -11
  86. package/dist/types/react/hooks.d.ts +29 -787
  87. package/dist/types/react/index.d.ts +31 -106
  88. package/dist/types/react/mount.d.ts +6 -4
  89. package/dist/types/react/source-owner.d.ts +2 -0
  90. package/dist/types/react/style-contract.d.ts +80 -0
  91. package/dist/types/react/style-validation.d.ts +2 -0
  92. package/dist/types/react/ui/AboutData.d.ts +9 -1
  93. package/dist/types/react/ui/AppHeader.d.ts +1 -2
  94. package/dist/types/react/ui/AppLayout.d.ts +3 -9
  95. package/dist/types/react/ui/AppToolbar.d.ts +5 -8
  96. package/dist/types/react/ui/AreaChart.d.ts +7 -0
  97. package/dist/types/react/ui/BarChart.d.ts +6 -0
  98. package/dist/types/react/ui/Button.d.ts +3 -3
  99. package/dist/types/react/ui/ChartLegend.d.ts +31 -0
  100. package/dist/types/react/ui/Checkbox.d.ts +15 -4
  101. package/dist/types/react/ui/CheckboxGroup.d.ts +7 -0
  102. package/dist/types/react/ui/{Combobox.d.ts → ChoicePicker.d.ts} +10 -15
  103. package/dist/types/react/ui/{ComparisonVisual.d.ts → Comparison.d.ts} +3 -3
  104. package/dist/types/react/ui/ComposedChart.d.ts +41 -0
  105. package/dist/types/react/ui/ComposedChartLegend.d.ts +8 -0
  106. package/dist/types/react/ui/ContentSkeleton.d.ts +2 -0
  107. package/dist/types/react/ui/DataApp.d.ts +17 -58
  108. package/dist/types/react/ui/DataAppFrame.d.ts +41 -0
  109. package/dist/types/react/ui/DataBoundary.d.ts +4 -5
  110. package/dist/types/react/ui/DataSection.d.ts +6 -18
  111. package/dist/types/react/ui/DataSectionBoundary.d.ts +30 -0
  112. package/dist/types/react/ui/DataValue.d.ts +9 -0
  113. package/dist/types/react/ui/DataWidget.d.ts +2 -1
  114. package/dist/types/react/ui/DateTimeTooltip.d.ts +1 -1
  115. package/dist/types/react/ui/DimensionPicker.d.ts +1 -1
  116. package/dist/types/react/ui/ExportControl.d.ts +1 -1
  117. package/dist/types/react/ui/FilterActions.d.ts +10 -0
  118. package/dist/types/react/ui/FilterBar.d.ts +3 -0
  119. package/dist/types/react/ui/GettingStarted.d.ts +2 -4
  120. package/dist/types/react/ui/HelpPopover.d.ts +3 -4
  121. package/dist/types/react/ui/InspectionContext.d.ts +2 -0
  122. package/dist/types/react/ui/InspectionProvider.d.ts +29 -0
  123. package/dist/types/react/ui/LineChart.d.ts +7 -0
  124. package/dist/types/react/ui/Menu.d.ts +12 -0
  125. package/dist/types/react/ui/MetricWidget.d.ts +4 -3
  126. package/dist/types/react/ui/NumberField.d.ts +27 -0
  127. package/dist/types/react/ui/NumberFilterPicker.d.ts +9 -0
  128. package/dist/types/react/ui/PieChart.d.ts +11 -0
  129. package/dist/types/react/ui/PresentStory.d.ts +2 -5
  130. package/dist/types/react/ui/RadioGroup.d.ts +18 -0
  131. package/dist/types/react/ui/RefreshControl.d.ts +1 -2
  132. package/dist/types/react/ui/ScatterChart.d.ts +17 -0
  133. package/dist/types/react/ui/SearchField.d.ts +1 -2
  134. package/dist/types/react/ui/SearchInput.d.ts +3 -1
  135. package/dist/types/react/ui/Select.d.ts +14 -0
  136. package/dist/types/react/ui/SelectionMark.d.ts +2 -1
  137. package/dist/types/react/ui/Sheet.d.ts +2 -1
  138. package/dist/types/react/ui/Skeleton.d.ts +5 -2
  139. package/dist/types/react/ui/StaticDataApp.d.ts +4 -0
  140. package/dist/types/react/ui/TableWidget.d.ts +19 -16
  141. package/dist/types/react/ui/Tabs.d.ts +6 -2
  142. package/dist/types/react/ui/TextWidget.d.ts +2 -1
  143. package/dist/types/react/ui/Tooltip.d.ts +4 -3
  144. package/dist/types/react/ui/TooltipSurface.d.ts +3 -0
  145. package/dist/types/react/ui/TrendChart.d.ts +5 -0
  146. package/dist/types/react/ui/UpdatedAt.d.ts +1 -1
  147. package/dist/types/react/ui/VisualizationWidget.d.ts +12 -13
  148. package/dist/types/react/ui/WidgetViewTabs.d.ts +1 -1
  149. package/dist/types/react/ui/chart-data.d.ts +25 -0
  150. package/dist/types/react/ui/chart-primitives.d.ts +20 -0
  151. package/dist/types/react/ui/data-context.d.ts +18 -7
  152. package/dist/types/react/ui/icons.d.ts +2 -0
  153. package/dist/types/react/ui/index.d.ts +98 -0
  154. package/dist/types/react/ui/keyboard.d.ts +6 -0
  155. package/dist/types/react/ui/metric.d.ts +1 -1
  156. package/dist/types/react/ui/presentation.d.ts +5 -1
  157. package/dist/types/react/ui/shortcuts.d.ts +14 -1
  158. package/dist/types/react/ui/useAppAppearance.d.ts +1 -1
  159. package/dist/types/react/ui/variables.d.ts +4 -2
  160. package/dist/types/react/view-controls.d.ts +3 -1
  161. package/dist/types/react/view-runtime.d.ts +29 -0
  162. package/dist/types/react/view.d.ts +21 -4
  163. package/dist/types/react/widgets.d.ts +79 -0
  164. package/dist/types/server/handler.d.ts +4 -4
  165. package/dist/worker.js +20 -737
  166. package/docs/app-authoring.md +72 -50
  167. package/docs/client.md +8 -8
  168. package/docs/contract.md +42 -20
  169. package/docs/data-context.md +91 -0
  170. package/docs/embed.md +10 -2
  171. package/docs/formatting-and-appearance.md +68 -0
  172. package/docs/hosted-apps.md +9 -15
  173. package/docs/layout.md +5 -3
  174. package/docs/react-embed.md +5 -4
  175. package/docs/react.md +22 -317
  176. package/docs/server-bun.md +1 -1
  177. package/docs/server.md +4 -4
  178. package/docs/stories-and-export.md +52 -0
  179. package/docs/styling.md +62 -0
  180. package/docs/ui-quality.md +20 -0
  181. package/docs/ui.md +196 -0
  182. package/docs/variables.md +171 -0
  183. package/docs/views.md +123 -0
  184. package/docs/widgets.md +145 -0
  185. package/examples/starter-data-app/index.tsx +115 -86
  186. package/package.json +25 -12
  187. package/dist/chunks/contract-a061yj6r.js.map +0 -12
  188. package/dist/chunks/contract-g6hky7x6.js +0 -282
  189. package/dist/chunks/contract-g6hky7x6.js.map +0 -12
  190. package/dist/chunks/contract-sm7j7k95.js.map +0 -14
  191. package/dist/chunks/contract-tf8c3qpv.js.map +0 -11
  192. package/dist/chunks/contract-txjy0en2.js.map +0 -10
  193. package/dist/chunks/contract-wz59z8pq.js +0 -8
  194. package/dist/chunks/contract-wz59z8pq.js.map +0 -10
  195. package/dist/chunks/contract-yxbjea23.js +0 -328
  196. package/dist/chunks/contract-yxbjea23.js.map +0 -12
  197. package/dist/types/react/ui/RefreshRegion.d.ts +0 -9
  198. package/dist/types/react/ui/SelectableBarChart.d.ts +0 -15
  199. package/docs/releasing.md +0 -79
  200. /package/dist/chunks/{contract-mev09s5v.js → index-mev09s5v.js} +0 -0
  201. /package/dist/chunks/{contract-mev09s5v.js.map → index-mev09s5v.js.map} +0 -0
  202. /package/dist/types/react/ui/{comparison.d.ts → metric-comparison.d.ts} +0 -0
@@ -0,0 +1,2272 @@
1
+ import {
2
+ injectStyles,
3
+ injectDataAppStyles2,
4
+ AppIcon2,
5
+ classNames,
6
+ Button2,
7
+ PressButton,
8
+ TooltipSurface,
9
+ TooltipProvider2,
10
+ Tooltip2,
11
+ GradientScroll2,
12
+ Sheet2,
13
+ TabList2,
14
+ TabPanels2,
15
+ Tab2,
16
+ TabPanel2,
17
+ Tabs2,
18
+ useViewTab2,
19
+ AboutData2,
20
+ DataAppProvider2,
21
+ useDeclaredResult,
22
+ validateChoiceOptions,
23
+ useAppVariables2,
24
+ Select2,
25
+ FilterActions2,
26
+ NumberField2,
27
+ NumberRangeField2,
28
+ NumberFilterPicker2,
29
+ SearchField2,
30
+ Skeleton2,
31
+ SearchMatch2,
32
+ searchItems2,
33
+ ChoicePicker2,
34
+ CheckboxGroupContext,
35
+ Checkbox2,
36
+ DateRangePicker2,
37
+ FilterBar2,
38
+ DimensionPicker2,
39
+ createDataHooks2,
40
+ isPlainKeyEvent2,
41
+ MenuTrigger2,
42
+ MenuSection2,
43
+ MenuPopover2,
44
+ Menu2,
45
+ MenuItem2,
46
+ MenuSeparator2,
47
+ LiveControl2,
48
+ PresentStory2,
49
+ VariableBar2,
50
+ DataAppFrame,
51
+ Grid2,
52
+ DataWidget2,
53
+ VisualizationWidget2,
54
+ MetricWidget2,
55
+ HelpPopover2,
56
+ DataTable2,
57
+ DataTableShare2,
58
+ DataTableEmptyRow2,
59
+ DataTableTimestamp2,
60
+ TableWidget2,
61
+ TextWidget2,
62
+ DataValue2,
63
+ createDataContext2
64
+ } from "../../chunks/index-8qfxv0h5.js";
65
+ import"../../chunks/index-mev09s5v.js";
66
+ import"../../chunks/index-ag0cgnvq.js";
67
+ import"../../chunks/index-mt93ff2b.js";
68
+ import"../../chunks/index-m6n8ctfc.js";
69
+ import {
70
+ createDataClient2
71
+ } from "../../chunks/index-23dktynd.js";
72
+ import"../../chunks/index-x69p7cv7.js";
73
+ import"../../chunks/index-ev2b5aaf.js";
74
+ import {
75
+ invariant
76
+ } from "../../chunks/index-qd5xgx6y.js";
77
+
78
+ // src/react/shellStyles.ts
79
+ function injectDataAppShellStyles(options = {}) {
80
+ return injectStyles({
81
+ name: "injectDataAppShellStyles",
82
+ attribute: "data-altertable-shell-styles",
83
+ css: `/* src/react/tokens.css */
84
+ @layer atbl.tokens {
85
+ :root {
86
+ --atbl-control-text-size: var(--atbl-type-body-size);
87
+ --atbl-background: var(--atbl-palette-background);
88
+ --atbl-surface: var(--atbl-palette-surface);
89
+ --atbl-subtle: var(--atbl-palette-subtle);
90
+ --atbl-backdrop: #0f171e38;
91
+ --atbl-text: var(--atbl-palette-text);
92
+ --atbl-muted: var(--atbl-palette-muted);
93
+ --atbl-border: var(--atbl-palette-border);
94
+ --atbl-accent: var(--atbl-input-accent, #405d47);
95
+ --atbl-on-accent: var(--atbl-input-on-accent, #fff);
96
+ --atbl-danger: #b42318;
97
+ --atbl-danger-subtle: color-mix(in srgb, var(--atbl-danger) 9%, var(--atbl-surface));
98
+ --atbl-code-surface: #f4f6f9;
99
+ --atbl-code-text: #273242;
100
+ --atbl-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
101
+ --atbl-focus-ring-offset: 2px;
102
+ --atbl-focus-ring-inset: -1px;
103
+ --atbl-font: var(--atbl-input-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, sans-serif);
104
+ --atbl-space-xs: 5px;
105
+ --atbl-space-sm: 10px;
106
+ --atbl-space-md: 16px;
107
+ --atbl-space-lg: 24px;
108
+ --atbl-space-xl: 32px;
109
+ --atbl-content-width: 960px;
110
+ --atbl-control-height: 2.375rem;
111
+ --atbl-control-compact-height: 1.875rem;
112
+ --atbl-control-icon-size: 1rem;
113
+ --atbl-control-padding-inline: .75rem;
114
+ --atbl-control-padding-block: .375rem;
115
+ --atbl-control-gap: .5rem;
116
+ --atbl-control-disabled-opacity: .5;
117
+ --atbl-radius-control: 7px;
118
+ --atbl-radius-surface: 12px;
119
+ --atbl-radius-overlay: 16px;
120
+ --atbl-shadow-surface: 0 3px 16px #141c280d;
121
+ --atbl-shadow-overlay: 0 18px 50px #00000029;
122
+ --atbl-shadow-control: 0 1px 3px #0000001a;
123
+ --atbl-cursor-action: pointer;
124
+ --atbl-cursor-disabled: default;
125
+ --atbl-cursor-help: help;
126
+ --atbl-cursor-busy: progress;
127
+ --atbl-duration-fast: .12s;
128
+ --atbl-duration-normal: .18s;
129
+ --atbl-duration-slow: .24s;
130
+ --atbl-ease-standard: ease;
131
+ --atbl-ease-enter: cubic-bezier(.2, .7, .2, 1);
132
+ --atbl-chart-1: color-mix(in srgb, var(--atbl-input-chart-1, #285fc0) var(--atbl-chart-strength), white);
133
+ --atbl-chart-2: color-mix(in srgb, var(--atbl-input-chart-2, #a95319) var(--atbl-chart-strength), white);
134
+ --atbl-chart-3: color-mix(in srgb, var(--atbl-input-chart-3, #147862) var(--atbl-chart-strength), white);
135
+ --atbl-chart-4: color-mix(in srgb, var(--atbl-input-chart-4, #7243aa) var(--atbl-chart-strength), white);
136
+ --atbl-chart-5: color-mix(in srgb, var(--atbl-input-chart-5, #aa3958) var(--atbl-chart-strength), white);
137
+ --atbl-chart-6: color-mix(in srgb, var(--atbl-input-chart-6, #475569) var(--atbl-chart-strength), white);
138
+ --atbl-chart-7: color-mix(in srgb, var(--atbl-input-chart-7, #285fc0) var(--atbl-chart-strength), white);
139
+ --atbl-chart-8: color-mix(in srgb, var(--atbl-input-chart-8, #a95319) var(--atbl-chart-strength), white);
140
+ --atbl-type-emphasis-weight: 680;
141
+ --atbl-type-meta-weight: 500;
142
+ --atbl-type-page-size: clamp(1.375rem, 2.4vw, 1.75rem);
143
+ --atbl-type-section-size: 1.25rem;
144
+ --atbl-type-widget-size: 1.0625rem;
145
+ --atbl-type-body-size: .875rem;
146
+ --atbl-type-label-size: .8125rem;
147
+ --atbl-type-meta-size: .75rem;
148
+ --atbl-type-metric-size: clamp(1.625rem, 3vw, 2.125rem);
149
+ --atbl-type-heading-weight: 650;
150
+ --atbl-type-label-weight: 600;
151
+ --atbl-type-body-leading: 1.65;
152
+ --atbl-type-label-leading: 1.4;
153
+ --atbl-type-heading-leading: 1.3;
154
+ --atbl-type-metric-leading: 1.08;
155
+ --atbl-text-measure: 70ch;
156
+ }
157
+ }
158
+
159
+ /* src/react/appearance.css */
160
+ @layer atbl.tokens {
161
+ :root {
162
+ --atbl-palette-background: #fff;
163
+ --atbl-palette-surface: #fff;
164
+ --atbl-palette-subtle: #f6f7f7;
165
+ --atbl-palette-text: #202124;
166
+ --atbl-palette-muted: #687078;
167
+ --atbl-palette-border: #e3e6e8;
168
+ --atbl-chart-strength: 100%;
169
+ --atbl-accent-subtle-strength: 12%;
170
+ }
171
+
172
+ :root[data-atbl-theme="dark"] {
173
+ --atbl-palette-background: #151719;
174
+ --atbl-palette-surface: #202326;
175
+ --atbl-palette-subtle: #292d31;
176
+ --atbl-palette-text: #f2f3f4;
177
+ --atbl-palette-muted: #aeb5bc;
178
+ --atbl-palette-border: #3b4248;
179
+ }
180
+
181
+ :root[data-atbl-base-color="slate"] {
182
+ --atbl-palette-background: #f8fafc;
183
+ --atbl-palette-surface: #fff;
184
+ --atbl-palette-subtle: #f1f5f9;
185
+ --atbl-palette-text: #17212f;
186
+ --atbl-palette-muted: #607083;
187
+ --atbl-palette-border: #dce3ea;
188
+ }
189
+
190
+ :root[data-atbl-base-color="slate"][data-atbl-theme="dark"] {
191
+ --atbl-palette-background: #111820;
192
+ --atbl-palette-surface: #1b2530;
193
+ --atbl-palette-subtle: #263340;
194
+ --atbl-palette-text: #f0f4f8;
195
+ --atbl-palette-muted: #a8b5c3;
196
+ --atbl-palette-border: #3a4857;
197
+ }
198
+
199
+ :root[data-atbl-base-color="warm"] {
200
+ --atbl-palette-background: #fbfaf8;
201
+ --atbl-palette-surface: #fff;
202
+ --atbl-palette-subtle: #f5f2ed;
203
+ --atbl-palette-text: #292723;
204
+ --atbl-palette-muted: #736e66;
205
+ --atbl-palette-border: #e8e2da;
206
+ }
207
+
208
+ :root[data-atbl-base-color="warm"][data-atbl-theme="dark"] {
209
+ --atbl-palette-background: #1b1916;
210
+ --atbl-palette-surface: #25221e;
211
+ --atbl-palette-subtle: #302c27;
212
+ --atbl-palette-text: #f5f1eb;
213
+ --atbl-palette-muted: #bcb3a8;
214
+ --atbl-palette-border: #494239;
215
+ }
216
+
217
+ :root[data-atbl-theme="dark"] {
218
+ --atbl-accent: var(--atbl-input-dark-accent, color-mix(in srgb, var(--atbl-input-accent, #405d47) 50%, white));
219
+ --atbl-accent-subtle-strength: 22%;
220
+ --atbl-on-accent: var(--atbl-input-on-accent, var(--atbl-background));
221
+ --atbl-danger: #f97066;
222
+ --atbl-backdrop: #0000008c;
223
+ --atbl-code-surface: #242a31;
224
+ --atbl-code-text: #e5e9ef;
225
+ --atbl-chart-strength: 60%;
226
+ }
227
+
228
+ :root[data-atbl-density="compact"] {
229
+ --atbl-control-height: 2.125rem;
230
+ --atbl-control-padding-inline: .625rem;
231
+ --atbl-control-padding-block: .25rem;
232
+ --atbl-space-xs: 4px;
233
+ --atbl-space-sm: 8px;
234
+ --atbl-space-md: 12px;
235
+ --atbl-space-lg: 18px;
236
+ --atbl-space-xl: 24px;
237
+ }
238
+
239
+ :root[data-atbl-density="spacious"] {
240
+ --atbl-control-height: 2.625rem;
241
+ --atbl-control-padding-inline: 1rem;
242
+ --atbl-control-padding-block: .5rem;
243
+ --atbl-space-xs: 6px;
244
+ --atbl-space-sm: 12px;
245
+ --atbl-space-md: 20px;
246
+ --atbl-space-lg: 30px;
247
+ --atbl-space-xl: 40px;
248
+ }
249
+
250
+ :root[data-atbl-radius="none"] {
251
+ --atbl-radius-control: 0px;
252
+ --atbl-radius-surface: 0px;
253
+ --atbl-radius-overlay: 0px;
254
+ }
255
+
256
+ :root[data-atbl-radius="small"] {
257
+ --atbl-radius-control: 4px;
258
+ --atbl-radius-surface: 7px;
259
+ --atbl-radius-overlay: 9px;
260
+ }
261
+
262
+ :root[data-atbl-radius="large"] {
263
+ --atbl-radius-control: 10px;
264
+ --atbl-radius-surface: 18px;
265
+ --atbl-radius-overlay: 24px;
266
+ }
267
+
268
+ :root[data-atbl-elevation="flat"] {
269
+ --atbl-shadow-surface: none;
270
+ --atbl-shadow-overlay: none;
271
+ --atbl-shadow-control: none;
272
+ }
273
+
274
+ :root[data-atbl-elevation="raised"] {
275
+ --atbl-shadow-surface: 0 8px 28px #141c281a;
276
+ --atbl-shadow-overlay: 0 24px 72px #0000003d;
277
+ }
278
+
279
+ @media (forced-colors: active) {
280
+ :root {
281
+ --atbl-focus-color: Highlight !important;
282
+ --atbl-on-accent: HighlightText !important;
283
+ }
284
+ }
285
+ }
286
+
287
+ /* src/react/base.css */
288
+ @layer atbl.base {
289
+ :where([class^="altertable-"], [class*=" altertable-"]) {
290
+ box-sizing: border-box;
291
+ }
292
+
293
+ :where([class^="altertable-"], [class*=" altertable-"]) * {
294
+ box-sizing: border-box;
295
+ }
296
+
297
+ :where([class^="starter-"], [class*=" starter-"]) * {
298
+ box-sizing: border-box;
299
+ }
300
+
301
+ :where([class^="altertable-"], [class*=" altertable-"]) button {
302
+ font: inherit;
303
+ }
304
+
305
+ :root[data-atbl-appearance] {
306
+ scrollbar-gutter: stable;
307
+ font-family: var(--atbl-font);
308
+ color: var(--atbl-text);
309
+ background: var(--atbl-background);
310
+ font-synthesis: none;
311
+ -webkit-font-smoothing: antialiased;
312
+ text-rendering: optimizeLegibility;
313
+ }
314
+
315
+ :root[data-atbl-theme="light"] {
316
+ --buncss-light: initial;
317
+ --buncss-dark: ;
318
+ color-scheme: light;
319
+ }
320
+
321
+ :root[data-atbl-theme="dark"] {
322
+ --buncss-light: ;
323
+ --buncss-dark: initial;
324
+ color-scheme: dark;
325
+ }
326
+
327
+ :root[data-atbl-appearance] body, :root[data-atbl-appearance] #root {
328
+ margin: 0;
329
+ }
330
+
331
+ .altertable-sr-only {
332
+ position: fixed;
333
+ overflow: hidden;
334
+ clip: rect(0, 0, 0, 0);
335
+ clip-path: inset(50%);
336
+ white-space: nowrap;
337
+ border: 0;
338
+ width: 1px;
339
+ height: 1px;
340
+ margin: -1px;
341
+ padding: 0;
342
+ }
343
+ }
344
+
345
+ /* src/react/ui/Skeleton.css */
346
+ @layer atbl.components {
347
+ .altertable-skeleton {
348
+ display: block;
349
+ border-radius: var(--atbl-radius-control);
350
+ background: var(--atbl-subtle);
351
+ opacity: 0;
352
+ animation: altertable-skeleton-in .2s var(--atbl-ease-standard) .2s forwards, altertable-skeleton-pulse 1.4s ease-in-out .4s infinite alternate;
353
+ }
354
+
355
+ .altertable-skeleton[data-inline] {
356
+ display: inline-block;
357
+ vertical-align: middle;
358
+ width: 8ch;
359
+ height: 1em;
360
+ }
361
+
362
+ @keyframes altertable-skeleton-in {
363
+ to {
364
+ opacity: 1;
365
+ }
366
+ }
367
+
368
+ @keyframes altertable-skeleton-pulse {
369
+ to {
370
+ opacity: .5;
371
+ }
372
+ }
373
+
374
+ @media (prefers-reduced-motion: reduce) {
375
+ .altertable-skeleton {
376
+ animation: 1ms .2s forwards altertable-skeleton-in;
377
+ }
378
+ }
379
+ }
380
+
381
+ /* src/react/ui/Grid.css */
382
+ @layer atbl.components {
383
+ .altertable-grid {
384
+ display: grid;
385
+ container: altertable-grid / inline-size;
386
+ --atbl-grid-gap: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
387
+ --atbl-grid-min-item-width: 240px;
388
+ --atbl-grid-column-width: 100%;
389
+ --atbl-grid-max-columns: 1;
390
+ align-content: start;
391
+ align-items: start;
392
+ gap: var(--atbl-grid-gap);
393
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, max(var(--atbl-grid-min-item-width), var(--atbl-grid-column-width))), 1fr));
394
+ min-width: 0;
395
+ }
396
+
397
+ .altertable-grid > * {
398
+ min-width: 0;
399
+ min-height: 0;
400
+ margin: 0;
401
+ }
402
+
403
+ .altertable-grid[data-align="stretch"] {
404
+ align-items: stretch;
405
+ }
406
+
407
+ .altertable-grid[data-gap="sm"] {
408
+ --atbl-grid-gap: var(--atbl-space-sm);
409
+ }
410
+
411
+ .altertable-grid[data-gap="md"] {
412
+ --atbl-grid-gap: var(--atbl-space-md);
413
+ }
414
+
415
+ .altertable-grid[data-gap="lg"] {
416
+ --atbl-grid-gap: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
417
+ }
418
+
419
+ .altertable-grid[data-min-item-width="compact"] {
420
+ --atbl-grid-min-item-width: 192px;
421
+ }
422
+
423
+ .altertable-grid[data-min-item-width="wide"] {
424
+ --atbl-grid-min-item-width: 320px;
425
+ }
426
+
427
+ .altertable-grid[data-columns="2"] {
428
+ --atbl-grid-max-columns: 2;
429
+ --atbl-grid-column-width: calc((100% - var(--atbl-grid-gap)) / 2);
430
+ }
431
+
432
+ .altertable-grid[data-columns="3"] {
433
+ --atbl-grid-max-columns: 3;
434
+ --atbl-grid-column-width: calc((100% - var(--atbl-grid-gap) - var(--atbl-grid-gap)) / 3);
435
+ }
436
+
437
+ .altertable-grid[data-columns="4"] {
438
+ --atbl-grid-max-columns: 4;
439
+ --atbl-grid-column-width: calc((100% - var(--atbl-grid-gap) - var(--atbl-grid-gap) - var(--atbl-grid-gap)) / 4);
440
+ }
441
+
442
+ .altertable-grid-item {
443
+ min-width: 0;
444
+ min-height: 0;
445
+ }
446
+
447
+ .altertable-grid > * {
448
+ --atbl-grid-fitting-columns: clamp(1, round(down, tan(atan2(100cqw + var(--atbl-grid-gap) + .001px, var(--atbl-grid-min-item-width) + var(--atbl-grid-gap))), 1), var(--atbl-grid-max-columns));
449
+ }
450
+
451
+ .altertable-grid > .altertable-grid-item[data-span="2"] {
452
+ grid-column: span min(2, var(--atbl-grid-fitting-columns));
453
+ }
454
+
455
+ .altertable-grid[data-columns="3"]:has( > .altertable-grid-item[data-span="2"]) > :not(.altertable-grid-item[data-span="2"]) {
456
+ grid-column: span clamp(1, (3 - var(--atbl-grid-fitting-columns)) * 2, var(--atbl-grid-fitting-columns));
457
+ }
458
+
459
+ .altertable-grid[data-columns="3"]:not(:has( > .altertable-grid-item[data-span="2"])) > :last-child:nth-child(odd) {
460
+ grid-column: span clamp(1, (3 - var(--atbl-grid-fitting-columns)) * 2, var(--atbl-grid-fitting-columns));
461
+ }
462
+ }
463
+
464
+ /* src/react/ui/DataWidget.css */
465
+ @layer atbl.components {
466
+ .altertable-data-widget {
467
+ border: 1px solid var(--atbl-border);
468
+ border-radius: calc(var(--atbl-radius-surface) * 1.5);
469
+ corner-shape: squircle;
470
+ background: var(--atbl-surface);
471
+ box-shadow: var(--atbl-shadow-surface);
472
+ min-width: 0;
473
+ }
474
+
475
+ .altertable-data-widget-header {
476
+ display: flex;
477
+ justify-content: space-between;
478
+ align-items: flex-start;
479
+ gap: var(--atbl-space-md);
480
+ padding: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg))) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg))) 0;
481
+ min-height: 30px;
482
+ }
483
+
484
+ .altertable-data-widget-header > div:first-child {
485
+ flex: 1;
486
+ min-width: 0;
487
+ }
488
+
489
+ .altertable-data-widget-help {
490
+ display: flex;
491
+ flex: none;
492
+ align-items: flex-start;
493
+ }
494
+
495
+ .altertable-data-widget-header h2 {
496
+ color: var(--atbl-text);
497
+ font-family: var(--atbl-font-heading, var(--atbl-input-font-heading, var(--atbl-font)));
498
+ font-size: var(--atbl-type-widget-size);
499
+ font-weight: var(--atbl-type-heading-weight);
500
+ line-height: var(--atbl-type-heading-leading);
501
+ letter-spacing: -.02em;
502
+ margin: 0;
503
+ }
504
+
505
+ .altertable-data-widget-count {
506
+ color: var(--atbl-muted);
507
+ font-size: var(--atbl-type-meta-size);
508
+ font-weight: var(--atbl-type-meta-weight);
509
+ letter-spacing: 0;
510
+ white-space: nowrap;
511
+ margin-left: 8px;
512
+ }
513
+
514
+ .altertable-data-widget-header p {
515
+ color: var(--atbl-muted);
516
+ font-size: var(--atbl-type-meta-size);
517
+ margin: 4px 0 0;
518
+ line-height: 1.45;
519
+ }
520
+
521
+ .altertable-data-widget-body {
522
+ padding: var(--atbl-space-md) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg))) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
523
+ min-width: 0;
524
+ }
525
+
526
+ .altertable-data-widget-body[data-padding="flush"] {
527
+ padding: 0;
528
+ }
529
+
530
+ .altertable-data-widget-footer {
531
+ padding: var(--atbl-space-md) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
532
+ }
533
+
534
+ .altertable-data-widget-body > .altertable-status-panel {
535
+ background: none;
536
+ border: 0;
537
+ border-radius: 0;
538
+ margin: 0;
539
+ padding: 0;
540
+ }
541
+ }
542
+
543
+ /* src/react/ui/MetricWidget.css */
544
+ @layer atbl.components {
545
+ .altertable-metric-widget {
546
+ display: flex;
547
+ padding: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
548
+ border: 1px solid var(--atbl-border);
549
+ border-radius: calc(var(--atbl-radius-surface) * 1.5);
550
+ corner-shape: squircle;
551
+ background: var(--atbl-surface);
552
+ box-shadow: var(--atbl-shadow-surface);
553
+ flex-direction: column;
554
+ min-width: 0;
555
+ }
556
+
557
+ .altertable-metric-widget.altertable-data-widget {
558
+ padding: 0;
559
+ }
560
+
561
+ .altertable-metric-widget > .altertable-data-widget-header {
562
+ min-height: 0;
563
+ }
564
+
565
+ .altertable-metric-widget > .altertable-data-widget-header h2 {
566
+ color: var(--atbl-muted);
567
+ font-family: inherit;
568
+ font-size: var(--atbl-type-label-size);
569
+ font-weight: var(--atbl-type-label-weight);
570
+ letter-spacing: normal;
571
+ }
572
+
573
+ .altertable-metric-widget > .altertable-data-widget-body {
574
+ padding-top: 0;
575
+ }
576
+
577
+ .altertable-metric-widget > .altertable-data-widget-body:has( + footer) {
578
+ padding-bottom: 0;
579
+ }
580
+
581
+ .altertable-metric-widget > .altertable-data-widget-footer {
582
+ padding-top: 0;
583
+ padding-bottom: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
584
+ }
585
+
586
+ .altertable-metric-value {
587
+ margin: var(--atbl-space-sm) 0 2px;
588
+ color: var(--atbl-text);
589
+ font-family: var(--atbl-font-heading, var(--atbl-input-font-heading, var(--atbl-font)));
590
+ font-size: var(--atbl-type-metric-size);
591
+ font-weight: var(--atbl-type-emphasis-weight);
592
+ line-height: var(--atbl-type-metric-leading);
593
+ letter-spacing: -.04em;
594
+ overflow-wrap: anywhere;
595
+ font-variant-numeric: tabular-nums;
596
+ max-inline-size: 100%;
597
+ }
598
+
599
+ .altertable-metric-reading {
600
+ display: flex;
601
+ flex-direction: column;
602
+ justify-content: flex-start;
603
+ align-items: flex-start;
604
+ gap: 4px;
605
+ }
606
+
607
+ .altertable-metric-trend {
608
+ font-size: var(--atbl-type-meta-size);
609
+ }
610
+
611
+ .altertable-metric-change {
612
+ display: inline-flex;
613
+ color: var(--atbl-muted);
614
+ font-variant-numeric: tabular-nums;
615
+ align-items: center;
616
+ gap: 3px;
617
+ }
618
+
619
+ .altertable-metric-change[data-tone="good"] {
620
+ color: var(--atbl-positive, var(--atbl-accent));
621
+ }
622
+
623
+ .altertable-metric-change[data-tone="bad"] {
624
+ color: var(--atbl-negative, var(--atbl-danger));
625
+ }
626
+
627
+ .altertable-metric-description {
628
+ color: var(--atbl-muted);
629
+ font-size: var(--atbl-type-meta-size);
630
+ line-height: 1.45;
631
+ }
632
+
633
+ .altertable-metric-visual {
634
+ margin-top: var(--atbl-space-sm);
635
+ min-width: 0;
636
+ }
637
+
638
+ .altertable-metric-value[data-unavailable] {
639
+ opacity: .6;
640
+ }
641
+
642
+ .altertable-metric-value > .altertable-skeleton {
643
+ width: 6ch;
644
+ height: 1em;
645
+ }
646
+ }
647
+
648
+ /* src/react/ui/VisualizationWidget.css */
649
+ @layer atbl.components {
650
+ .altertable-visualization-widget-content {
651
+ padding: var(--atbl-space-md) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg))) var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
652
+ min-width: 0;
653
+ }
654
+
655
+ :where(.altertable-data-widget-body) > .altertable-visualization-widget-content {
656
+ padding: 0;
657
+ }
658
+ }
659
+
660
+ /* src/react/ui/ContentSkeleton.css */
661
+ @layer atbl.components {
662
+ .altertable-content-skeleton {
663
+ display: grid;
664
+ padding: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
665
+ align-content: start;
666
+ gap: 14px;
667
+ min-width: 0;
668
+ }
669
+
670
+ .altertable-content-skeleton-label {
671
+ width: 38%;
672
+ height: 15px;
673
+ }
674
+
675
+ .altertable-content-skeleton-value {
676
+ width: 56%;
677
+ height: 38px;
678
+ }
679
+
680
+ .altertable-content-skeleton-chart {
681
+ width: 100%;
682
+ height: 180px;
683
+ }
684
+
685
+ .altertable-content-skeleton-foot {
686
+ width: 70%;
687
+ height: 12px;
688
+ }
689
+
690
+ .altertable-content-skeleton-subtitle {
691
+ width: 52%;
692
+ height: 12px;
693
+ }
694
+
695
+ .altertable-content-skeleton-rows {
696
+ display: grid;
697
+ gap: 18px;
698
+ margin-top: 12px;
699
+ }
700
+
701
+ .altertable-content-skeleton-row {
702
+ display: grid;
703
+ gap: 8px;
704
+ }
705
+
706
+ .altertable-content-skeleton-row-label {
707
+ width: 56%;
708
+ height: 14px;
709
+ }
710
+
711
+ .altertable-content-skeleton-row-track {
712
+ width: 100%;
713
+ height: 8px;
714
+ }
715
+
716
+ .altertable-content-skeleton-row:nth-child(2) .altertable-content-skeleton-row-track {
717
+ width: 72%;
718
+ }
719
+
720
+ .altertable-content-skeleton-row:nth-child(3) .altertable-content-skeleton-row-track {
721
+ width: 48%;
722
+ }
723
+
724
+ .altertable-content-skeleton-row:nth-child(4) .altertable-content-skeleton-row-track {
725
+ width: 30%;
726
+ }
727
+
728
+ .altertable-content-skeleton-body {
729
+ display: grid;
730
+ gap: 14px;
731
+ min-width: 0;
732
+ }
733
+ }
734
+
735
+ /* src/react/shared.css */
736
+
737
+
738
+ /* src/react/ui/DataAppSkeleton.css */
739
+ @layer atbl.components {
740
+ .altertable-data-app-skeleton {
741
+ display: flex;
742
+ overflow: hidden;
743
+ padding: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
744
+ background: var(--atbl-background);
745
+ flex: 1;
746
+ min-width: 0;
747
+ min-height: 0;
748
+ }
749
+
750
+ .altertable-data-app-skeleton-content {
751
+ display: flex;
752
+ gap: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
753
+ max-width: var(--atbl-content-width);
754
+ flex-direction: column;
755
+ width: 100%;
756
+ min-width: 0;
757
+ margin-inline-start: auto;
758
+ margin-inline-end: auto;
759
+ }
760
+
761
+ .altertable-data-app-skeleton-body {
762
+ display: flex;
763
+ gap: var(--atbl-layout-gap, clamp(var(--atbl-space-md), 2.5vw, var(--atbl-space-lg)));
764
+ flex-direction: column;
765
+ min-width: 0;
766
+ }
767
+
768
+ .altertable-data-app-skeleton-header, .altertable-data-app-skeleton-footer {
769
+ min-width: 0;
770
+ }
771
+
772
+ .altertable-data-app-skeleton-widget-title {
773
+ width: 144px;
774
+ max-width: 100%;
775
+ height: 16px;
776
+ }
777
+
778
+ .altertable-data-app-skeleton-chart {
779
+ display: flex;
780
+ align-items: flex-end;
781
+ gap: var(--atbl-space-sm);
782
+ height: 180px;
783
+ }
784
+
785
+ .altertable-data-app-skeleton-chart > * {
786
+ flex: 1;
787
+ min-width: 0;
788
+ }
789
+
790
+ .altertable-data-app-skeleton-rows {
791
+ display: grid;
792
+ gap: 20px;
793
+ }
794
+
795
+ .altertable-data-app-skeleton-row {
796
+ display: grid;
797
+ grid-template-columns: 2fr 1fr 1fr;
798
+ gap: var(--atbl-space-md);
799
+ }
800
+
801
+ .altertable-data-app-skeleton-row > * {
802
+ height: 16px;
803
+ }
804
+ }
805
+
806
+ /* src/react/shellStyles.css */
807
+ @layer atbl.tokens, atbl.base, atbl.components, atbl.interaction;
808
+ `,
809
+ options
810
+ });
811
+ }
812
+ // src/react/ui/StaticDataApp.tsx
813
+ import { jsx } from "react/jsx-runtime";
814
+ function DataApp(props) {
815
+ return /* @__PURE__ */ jsx(DataAppFrame, {
816
+ ...props
817
+ });
818
+ }
819
+
820
+ // src/react/ui/GettingStarted.tsx
821
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
822
+ var connectionContext = createDataContext2({})({
823
+ description: "Connection setup",
824
+ glossary: {}
825
+ });
826
+ var client = /* @__PURE__ */ createDataClient2();
827
+ var { defineDataView } = /* @__PURE__ */ createDataHooks2(client);
828
+ var connectionView = defineDataView({
829
+ dataContext: connectionContext,
830
+ operation: "connection",
831
+ describeInput: () => "the connection",
832
+ isEmpty: () => false,
833
+ emptyFallback: { title: "No connection" }
834
+ });
835
+ function GettingStarted({ dataContext }) {
836
+ const connection = useDeclaredResult(connectionView);
837
+ const state = connection.view.kind === "error" || connection.view.kind === "stale-error" ? "error" : connection.refreshing || !connection.snapshot ? "checking" : "connected";
838
+ return /* @__PURE__ */ jsxs(DataApp, {
839
+ dataContext,
840
+ description: "Check your lakehouse connection, then build a view around a real question.",
841
+ queries: connection.queries,
842
+ toolbarActions: /* @__PURE__ */ jsx2(Button2, {
843
+ disabled: connection.refreshing,
844
+ onClick: () => connection.refetch(),
845
+ children: "Check connection"
846
+ }),
847
+ children: [
848
+ /* @__PURE__ */ jsxs("section", {
849
+ className: "starter-connection",
850
+ "data-state": state,
851
+ role: state === "error" ? "alert" : "status",
852
+ children: [
853
+ /* @__PURE__ */ jsx2("div", {
854
+ className: "starter-connection-icon",
855
+ children: /* @__PURE__ */ jsx2(AppIcon2, {
856
+ name: state === "connected" ? "check" : state === "error" ? "error" : "loading",
857
+ size: 24
858
+ })
859
+ }),
860
+ /* @__PURE__ */ jsxs("div", {
861
+ className: "starter-connection-copy",
862
+ children: [
863
+ /* @__PURE__ */ jsx2("span", {
864
+ className: "starter-eyebrow",
865
+ children: "Lakehouse connection"
866
+ }),
867
+ /* @__PURE__ */ jsx2("h2", {
868
+ children: state === "connected" ? "Connected" : state === "error" ? "Connection not verified" : "Checking connection…"
869
+ }),
870
+ /* @__PURE__ */ jsx2("p", {
871
+ children: state === "connected" ? "A query completed successfully using this app’s current profile. You’re ready to build your first view." : state === "error" ? connection.snapshot ? "An earlier query succeeded, but the latest check failed. Check the profile and try again." : "The query could not complete. Check the profile and lakehouse access, then try again." : "Running a lightweight query with this app’s current profile."
872
+ }),
873
+ state === "connected" && /* @__PURE__ */ jsx2("small", {
874
+ children: "This check does not verify access to every dataset."
875
+ })
876
+ ]
877
+ }),
878
+ state === "error" && /* @__PURE__ */ jsx2(Button2, {
879
+ onClick: () => connection.refetch(),
880
+ children: "Try again"
881
+ })
882
+ ]
883
+ }),
884
+ /* @__PURE__ */ jsxs("section", {
885
+ className: "starter-next",
886
+ "aria-labelledby": "starter-next-title",
887
+ children: [
888
+ /* @__PURE__ */ jsxs("div", {
889
+ className: "starter-next-heading",
890
+ children: [
891
+ /* @__PURE__ */ jsx2("span", {
892
+ className: "starter-eyebrow",
893
+ children: "Next steps"
894
+ }),
895
+ /* @__PURE__ */ jsx2("h2", {
896
+ id: "starter-next-title",
897
+ children: "Turn this starter into a useful app"
898
+ }),
899
+ /* @__PURE__ */ jsx2("p", {
900
+ children: "Start with one question your readers need answered."
901
+ })
902
+ ]
903
+ }),
904
+ /* @__PURE__ */ jsxs("ol", {
905
+ className: "starter-steps",
906
+ children: [
907
+ /* @__PURE__ */ jsxs("li", {
908
+ children: [
909
+ /* @__PURE__ */ jsx2("strong", {
910
+ children: "Choose a question"
911
+ }),
912
+ /* @__PURE__ */ jsx2("p", {
913
+ children: "Decide what someone should learn or do after opening this app."
914
+ })
915
+ ]
916
+ }),
917
+ /* @__PURE__ */ jsxs("li", {
918
+ children: [
919
+ /* @__PURE__ */ jsx2("strong", {
920
+ children: "Find the right data"
921
+ }),
922
+ /* @__PURE__ */ jsx2("p", {
923
+ children: "Inspect the relevant catalogs, tables, and columns before writing the query."
924
+ })
925
+ ]
926
+ }),
927
+ /* @__PURE__ */ jsxs("li", {
928
+ children: [
929
+ /* @__PURE__ */ jsx2("strong", {
930
+ children: "Build the first view"
931
+ }),
932
+ /* @__PURE__ */ jsxs("p", {
933
+ children: [
934
+ "Replace the connection check in ",
935
+ /* @__PURE__ */ jsx2("code", {
936
+ children: "src/operations.ts"
937
+ }),
938
+ ", then render its result in ",
939
+ /* @__PURE__ */ jsx2("code", {
940
+ children: "src/App.tsx"
941
+ }),
942
+ "."
943
+ ]
944
+ })
945
+ ]
946
+ })
947
+ ]
948
+ })
949
+ ]
950
+ })
951
+ ]
952
+ });
953
+ }
954
+ // src/react/ui/DataAppSkeleton.tsx
955
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
956
+ var chartHeights = [40, 60, 50, 80, 60, 100, 80, 60];
957
+ function DataAppSkeleton({
958
+ header,
959
+ footer,
960
+ className,
961
+ ...props
962
+ }) {
963
+ return /* @__PURE__ */ jsx3("output", {
964
+ "aria-label": "Loading data app",
965
+ ...props,
966
+ "aria-busy": "true",
967
+ className: classNames("altertable-data-app-skeleton", className),
968
+ children: /* @__PURE__ */ jsxs2("div", {
969
+ className: "altertable-data-app-skeleton-content",
970
+ children: [
971
+ header != null && header !== false && /* @__PURE__ */ jsx3("div", {
972
+ className: "altertable-data-app-skeleton-header",
973
+ children: header
974
+ }),
975
+ /* @__PURE__ */ jsxs2("div", {
976
+ className: "altertable-data-app-skeleton-body",
977
+ "aria-hidden": "true",
978
+ children: [
979
+ /* @__PURE__ */ jsx3(Grid2, {
980
+ columns: 3,
981
+ gap: "md",
982
+ children: [0, 1, 2].map((item) => /* @__PURE__ */ jsx3(MetricWidget2, {
983
+ label: "",
984
+ loading: true
985
+ }, item))
986
+ }),
987
+ /* @__PURE__ */ jsx3(VisualizationWidget2, {
988
+ title: /* @__PURE__ */ jsx3(Skeleton2, {
989
+ className: "altertable-data-app-skeleton-widget-title"
990
+ }),
991
+ visual: /* @__PURE__ */ jsx3("div", {
992
+ className: "altertable-data-app-skeleton-chart",
993
+ children: chartHeights.map((height, index) => /* @__PURE__ */ jsx3(Skeleton2, {
994
+ style: { height: `${height}%` }
995
+ }, index))
996
+ })
997
+ }),
998
+ /* @__PURE__ */ jsx3(DataWidget2, {
999
+ title: /* @__PURE__ */ jsx3(Skeleton2, {
1000
+ className: "altertable-data-app-skeleton-widget-title"
1001
+ }),
1002
+ children: /* @__PURE__ */ jsx3("div", {
1003
+ className: "altertable-data-app-skeleton-rows",
1004
+ children: [0, 1, 2].map((row) => /* @__PURE__ */ jsxs2("div", {
1005
+ className: "altertable-data-app-skeleton-row",
1006
+ children: [
1007
+ /* @__PURE__ */ jsx3(Skeleton2, {}),
1008
+ /* @__PURE__ */ jsx3(Skeleton2, {}),
1009
+ /* @__PURE__ */ jsx3(Skeleton2, {})
1010
+ ]
1011
+ }, row))
1012
+ })
1013
+ })
1014
+ ]
1015
+ }),
1016
+ footer != null && footer !== false && /* @__PURE__ */ jsx3("div", {
1017
+ className: "altertable-data-app-skeleton-footer",
1018
+ children: footer
1019
+ })
1020
+ ]
1021
+ })
1022
+ });
1023
+ }
1024
+ // src/react/ui/GlossaryExplanation.tsx
1025
+ import { jsx as jsx4 } from "react/jsx-runtime";
1026
+ function GlossaryExplanation({
1027
+ entry,
1028
+ empty,
1029
+ title,
1030
+ description,
1031
+ visual,
1032
+ queries,
1033
+ dataContext,
1034
+ className,
1035
+ ...props
1036
+ }) {
1037
+ return /* @__PURE__ */ jsx4(AboutData2, {
1038
+ ...props,
1039
+ shortcut: false,
1040
+ iconOnly: true,
1041
+ variant: "ghost",
1042
+ title: title ?? entry.term,
1043
+ description,
1044
+ visual,
1045
+ references: { kind: "entries", entries: [entry] },
1046
+ empty,
1047
+ dataContext,
1048
+ queries,
1049
+ className: className ?? "altertable-inspect-trigger",
1050
+ tooltip: "Explore this term",
1051
+ "aria-label": props["aria-label"] ?? `Explore ${entry.term}`,
1052
+ children: /* @__PURE__ */ jsx4(AppIcon2, {
1053
+ name: "openDetails"
1054
+ })
1055
+ });
1056
+ }
1057
+ // src/react/ui/GlossaryDefinition.tsx
1058
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1059
+ function GlossaryDefinition({
1060
+ entry,
1061
+ children
1062
+ }) {
1063
+ return /* @__PURE__ */ jsxs3(HelpPopover2, {
1064
+ trigger: children ?? entry.term,
1065
+ triggerLabel: `Explain ${entry.term}`,
1066
+ label: entry.term,
1067
+ triggerProps: {
1068
+ className: "altertable-glossary-definition-trigger",
1069
+ "data-atbl-control": "help"
1070
+ },
1071
+ panelProps: { className: "altertable-glossary-definition-popover" },
1072
+ children: [
1073
+ /* @__PURE__ */ jsx5("strong", {
1074
+ children: entry.term
1075
+ }),
1076
+ /* @__PURE__ */ jsx5("div", {
1077
+ children: entry.definition
1078
+ })
1079
+ ]
1080
+ });
1081
+ }
1082
+ // src/react/ui/TrendChart.tsx
1083
+ import { useLayoutEffect, useRef, useState } from "react";
1084
+ import {
1085
+ AreaChart as RechartsAreaChart,
1086
+ LineChart as RechartsLineChart,
1087
+ ReferenceLine
1088
+ } from "recharts";
1089
+
1090
+ // src/react/ui/chart-primitives.tsx
1091
+ import {
1092
+ Area,
1093
+ Dot,
1094
+ Bar,
1095
+ Line,
1096
+ Scatter,
1097
+ XAxis,
1098
+ YAxis,
1099
+ CartesianGrid,
1100
+ Tooltip,
1101
+ DefaultTooltipContent
1102
+ } from "recharts";
1103
+ import { jsx as jsx6 } from "react/jsx-runtime";
1104
+ var chartBarFill = "var(--atbl-chart-fill, color-mix(in srgb, var(--atbl-accent) 75%, var(--atbl-surface)))";
1105
+ var accent = "var(--atbl-accent)";
1106
+ function ChartDot({
1107
+ active = false,
1108
+ stroke = accent,
1109
+ fill = active ? stroke : "var(--atbl-surface)",
1110
+ r = active ? 4.5 : 3,
1111
+ ...props
1112
+ }) {
1113
+ return /* @__PURE__ */ jsx6(Dot, {
1114
+ stroke,
1115
+ fill,
1116
+ r,
1117
+ strokeWidth: 2,
1118
+ ...props
1119
+ });
1120
+ }
1121
+ function ChartBar(props) {
1122
+ return /* @__PURE__ */ jsx6(Bar, {
1123
+ fill: chartBarFill,
1124
+ radius: [5, 5, 0, 0],
1125
+ maxBarSize: 30,
1126
+ activeBar: { fill: accent },
1127
+ isAnimationActive: false,
1128
+ ...props
1129
+ });
1130
+ }
1131
+ function ChartLine({
1132
+ stroke = accent,
1133
+ dot,
1134
+ activeDot,
1135
+ ...props
1136
+ }) {
1137
+ return /* @__PURE__ */ jsx6(Line, {
1138
+ type: "linear",
1139
+ stroke,
1140
+ strokeWidth: 2,
1141
+ strokeLinecap: "round",
1142
+ strokeLinejoin: "round",
1143
+ dot: dot === undefined || dot === true ? ({ cx, cy }) => /* @__PURE__ */ jsx6(ChartDot, {
1144
+ cx,
1145
+ cy,
1146
+ stroke
1147
+ }) : dot,
1148
+ activeDot: activeDot === undefined || activeDot === true ? ({ cx, cy }) => /* @__PURE__ */ jsx6(ChartDot, {
1149
+ cx,
1150
+ cy,
1151
+ stroke,
1152
+ active: true
1153
+ }) : activeDot,
1154
+ isAnimationActive: false,
1155
+ ...props
1156
+ });
1157
+ }
1158
+ function ChartArea({
1159
+ stroke = accent,
1160
+ dot,
1161
+ activeDot,
1162
+ ...props
1163
+ }) {
1164
+ return /* @__PURE__ */ jsx6(Area, {
1165
+ legendType: "square",
1166
+ type: "linear",
1167
+ stroke,
1168
+ strokeWidth: 2,
1169
+ strokeLinecap: "round",
1170
+ strokeLinejoin: "round",
1171
+ fill: stroke,
1172
+ fillOpacity: 0.14,
1173
+ dot: dot === undefined || dot === true ? ({ cx, cy }) => /* @__PURE__ */ jsx6(ChartDot, {
1174
+ cx,
1175
+ cy,
1176
+ stroke
1177
+ }) : dot,
1178
+ activeDot: activeDot === undefined || activeDot === true ? ({ cx, cy }) => /* @__PURE__ */ jsx6(ChartDot, {
1179
+ cx,
1180
+ cy,
1181
+ stroke,
1182
+ active: true
1183
+ }) : activeDot,
1184
+ isAnimationActive: false,
1185
+ ...props
1186
+ });
1187
+ }
1188
+ function ChartScatter(props) {
1189
+ return /* @__PURE__ */ jsx6(Scatter, {
1190
+ fill: accent,
1191
+ isAnimationActive: false,
1192
+ ...props
1193
+ });
1194
+ }
1195
+ function ChartXAxis(props) {
1196
+ return /* @__PURE__ */ jsx6(XAxis, {
1197
+ stroke: "var(--atbl-muted)",
1198
+ tickLine: false,
1199
+ axisLine: { stroke: "var(--atbl-border)" },
1200
+ tick: { fontSize: "var(--atbl-type-meta-size)" },
1201
+ ...props
1202
+ });
1203
+ }
1204
+ function ChartYAxis(props) {
1205
+ return /* @__PURE__ */ jsx6(YAxis, {
1206
+ stroke: "var(--atbl-muted)",
1207
+ tickLine: false,
1208
+ axisLine: false,
1209
+ tick: { fontSize: "var(--atbl-type-meta-size)" },
1210
+ ...props
1211
+ });
1212
+ }
1213
+ function ChartGrid(props) {
1214
+ return /* @__PURE__ */ jsx6(CartesianGrid, {
1215
+ stroke: "var(--atbl-border)",
1216
+ vertical: false,
1217
+ ...props
1218
+ });
1219
+ }
1220
+ function ChartTooltipContent(props) {
1221
+ if (!props.active)
1222
+ return null;
1223
+ return /* @__PURE__ */ jsx6(TooltipSurface, {
1224
+ "data-variant": "chart",
1225
+ role: "tooltip",
1226
+ children: /* @__PURE__ */ jsx6(DefaultTooltipContent, {
1227
+ ...props,
1228
+ contentStyle: {
1229
+ margin: 0,
1230
+ padding: 0,
1231
+ background: "transparent",
1232
+ border: 0,
1233
+ whiteSpace: "normal",
1234
+ ...props.contentStyle
1235
+ },
1236
+ labelStyle: {
1237
+ color: "var(--atbl-text)",
1238
+ fontSize: "var(--atbl-type-body-size)",
1239
+ fontWeight: 650,
1240
+ lineHeight: 1.2,
1241
+ ...props.labelStyle
1242
+ },
1243
+ itemStyle: { paddingTop: 2, paddingBottom: 0, ...props.itemStyle }
1244
+ })
1245
+ });
1246
+ }
1247
+ function ChartTooltip(props) {
1248
+ return /* @__PURE__ */ jsx6(Tooltip, {
1249
+ content: /* @__PURE__ */ jsx6(ChartTooltipContent, {}),
1250
+ cursor: false,
1251
+ isAnimationActive: false,
1252
+ ...props
1253
+ });
1254
+ }
1255
+
1256
+ // src/react/ui/chart-data.ts
1257
+ function validateChartItems(kind, items) {
1258
+ const ids = new Set;
1259
+ for (const item of items) {
1260
+ invariant(item.id.trim().length > 0, `${kind} chart IDs must be nonempty and unique: blank ID.`);
1261
+ invariant(!ids.has(item.id), `${kind} chart IDs must be nonempty and unique: duplicate "${item.id}".`);
1262
+ ids.add(item.id);
1263
+ if (kind === "scatter") {
1264
+ const point = item;
1265
+ invariant(Number.isFinite(point.x) && Number.isFinite(point.y), `scatter chart "${item.id}" requires finite values for x and y.`);
1266
+ } else {
1267
+ const point = item;
1268
+ invariant(Number.isFinite(point.value), `${kind} chart "${item.id}" requires finite values.`);
1269
+ invariant(kind !== "bar" && kind !== "pie" || point.value >= 0, `${kind} chart "${item.id}" requires nonnegative values.`);
1270
+ }
1271
+ }
1272
+ }
1273
+
1274
+ // src/react/ui/TrendChart.tsx
1275
+ import { jsx as jsx7, jsxs as jsxs4, Fragment } from "react/jsx-runtime";
1276
+ function TrendChart({
1277
+ items,
1278
+ unit,
1279
+ ariaLabel,
1280
+ formatValue = (value) => new Intl.NumberFormat().format(value),
1281
+ area = false
1282
+ }) {
1283
+ validateChartItems(area ? "area" : "line", items);
1284
+ const Plot = area ? RechartsAreaChart : RechartsLineChart;
1285
+ const [activeIndex, setActiveIndex] = useState();
1286
+ const scrollport = useRef(null);
1287
+ useLayoutEffect(() => {
1288
+ const element = scrollport.current;
1289
+ if (element)
1290
+ element.scrollLeft = element.scrollWidth - element.clientWidth;
1291
+ }, [items]);
1292
+ const magnitude = items.reduce((max, item) => Math.max(max, Math.abs(item.value)), 1);
1293
+ const low = items.reduce((min, item) => Math.min(min, item.value / magnitude), 0);
1294
+ const high = items.reduce((max, item) => Math.max(max, item.value / magnitude), 0);
1295
+ return /* @__PURE__ */ jsxs4("section", {
1296
+ className: "altertable-trend-chart",
1297
+ "aria-label": ariaLabel,
1298
+ children: [
1299
+ items.length === 0 && /* @__PURE__ */ jsx7("span", {
1300
+ children: "No data"
1301
+ }),
1302
+ items.length > 0 && /* @__PURE__ */ jsx7(Fragment, {
1303
+ children: /* @__PURE__ */ jsx7("div", {
1304
+ className: "altertable-trend-scroll",
1305
+ ref: scrollport,
1306
+ children: /* @__PURE__ */ jsxs4("div", {
1307
+ className: "altertable-trend-plot",
1308
+ style: { minWidth: items.length * 40 },
1309
+ children: [
1310
+ /* @__PURE__ */ jsx7("div", {
1311
+ className: "altertable-chart-canvas",
1312
+ "aria-hidden": "true",
1313
+ children: /* @__PURE__ */ jsxs4(Plot, {
1314
+ data: items.map((item) => ({
1315
+ ...item,
1316
+ plotValue: item.value / magnitude
1317
+ })),
1318
+ title: ariaLabel,
1319
+ responsive: true,
1320
+ width: "100%",
1321
+ height: 220,
1322
+ margin: { top: 12, right: 0, bottom: 12, left: 0 },
1323
+ accessibilityLayer: false,
1324
+ tabIndex: -1,
1325
+ children: [
1326
+ /* @__PURE__ */ jsx7(ChartXAxis, {
1327
+ hide: true,
1328
+ dataKey: "id",
1329
+ scale: "band"
1330
+ }),
1331
+ /* @__PURE__ */ jsx7(ChartYAxis, {
1332
+ hide: true,
1333
+ domain: [low, high === low ? low + 1 : high]
1334
+ }),
1335
+ /* @__PURE__ */ jsx7(ReferenceLine, {
1336
+ y: 0,
1337
+ stroke: "var(--atbl-border)"
1338
+ }),
1339
+ area && /* @__PURE__ */ jsx7(ChartArea, {
1340
+ dataKey: "plotValue",
1341
+ stroke: "none",
1342
+ fill: "var(--atbl-accent)",
1343
+ dot: false,
1344
+ activeDot: false
1345
+ }),
1346
+ /* @__PURE__ */ jsx7(ChartLine, {
1347
+ dataKey: "plotValue",
1348
+ dot: ({ cx, cy, index }) => /* @__PURE__ */ jsx7(ChartDot, {
1349
+ cx,
1350
+ cy,
1351
+ active: index === activeIndex
1352
+ }),
1353
+ activeDot: false
1354
+ })
1355
+ ]
1356
+ })
1357
+ }),
1358
+ /* @__PURE__ */ jsx7("div", {
1359
+ className: "altertable-trend-points",
1360
+ children: items.map((item, index) => /* @__PURE__ */ jsx7(Tooltip2, {
1361
+ variant: "chart",
1362
+ onOpenChange: (open) => setActiveIndex((current) => open ? index : current === index ? undefined : current),
1363
+ content: /* @__PURE__ */ jsxs4(Fragment, {
1364
+ children: [
1365
+ /* @__PURE__ */ jsx7("strong", {
1366
+ children: item.label
1367
+ }),
1368
+ /* @__PURE__ */ jsxs4("span", {
1369
+ children: [
1370
+ formatValue(item.value),
1371
+ " ",
1372
+ unit
1373
+ ]
1374
+ })
1375
+ ]
1376
+ }),
1377
+ className: "altertable-chart-column",
1378
+ children: /* @__PURE__ */ jsxs4("button", {
1379
+ "data-atbl-focus": "ring",
1380
+ "data-atbl-control": "default",
1381
+ type: "button",
1382
+ tabIndex: -1,
1383
+ className: "altertable-trend-point",
1384
+ "aria-label": `${item.label}: ${formatValue(item.value)} ${unit}`,
1385
+ children: [
1386
+ /* @__PURE__ */ jsx7("span", {
1387
+ className: "altertable-trend-hit"
1388
+ }),
1389
+ /* @__PURE__ */ jsx7("span", {
1390
+ className: "altertable-trend-label",
1391
+ children: item.label
1392
+ })
1393
+ ]
1394
+ })
1395
+ }, item.id))
1396
+ })
1397
+ ]
1398
+ })
1399
+ })
1400
+ })
1401
+ ]
1402
+ });
1403
+ }
1404
+
1405
+ // src/react/ui/LineChart.tsx
1406
+ import { jsx as jsx8 } from "react/jsx-runtime";
1407
+ function LineChart(props) {
1408
+ return /* @__PURE__ */ jsx8(TrendChart, {
1409
+ ...props
1410
+ });
1411
+ }
1412
+ // src/react/ui/AreaChart.tsx
1413
+ import { jsx as jsx9 } from "react/jsx-runtime";
1414
+ function AreaChart(props) {
1415
+ return /* @__PURE__ */ jsx9(TrendChart, {
1416
+ ...props,
1417
+ area: true
1418
+ });
1419
+ }
1420
+ // src/react/ui/ChartLegend.tsx
1421
+ import {
1422
+ Children,
1423
+ useId,
1424
+ useState as useState2
1425
+ } from "react";
1426
+ import { jsx as jsx10, jsxs as jsxs5, Fragment as Fragment2 } from "react/jsx-runtime";
1427
+ function ChartLegendRoot({
1428
+ children,
1429
+ layout = "horizontal",
1430
+ align = "start",
1431
+ maxVisibleItems = 6,
1432
+ className,
1433
+ "aria-label": ariaLabel = "Chart legend",
1434
+ ...props
1435
+ }) {
1436
+ const [expanded, setExpanded] = useState2(false);
1437
+ const listId = useId();
1438
+ const items = Children.toArray(children);
1439
+ const limit = Number.isFinite(maxVisibleItems) ? Math.max(1, Math.floor(maxVisibleItems)) : 6;
1440
+ const visibleCount = items.length > limit ? limit - 1 : limit;
1441
+ const hiddenCount = Math.max(0, items.length - visibleCount);
1442
+ return /* @__PURE__ */ jsx10("div", {
1443
+ className: "altertable-chart-legend-container",
1444
+ children: /* @__PURE__ */ jsxs5("ul", {
1445
+ id: listId,
1446
+ ...props,
1447
+ "aria-label": ariaLabel,
1448
+ "data-layout": layout,
1449
+ "data-align": align,
1450
+ className: classNames("altertable-chart-legend", className),
1451
+ children: [
1452
+ expanded ? items : items.slice(0, visibleCount),
1453
+ hiddenCount > 0 && /* @__PURE__ */ jsx10("li", {
1454
+ className: "altertable-chart-legend-overflow",
1455
+ children: /* @__PURE__ */ jsx10("button", {
1456
+ type: "button",
1457
+ "data-atbl-control": "action",
1458
+ "data-atbl-focus": "ring",
1459
+ className: "altertable-chart-legend-action",
1460
+ "aria-expanded": expanded,
1461
+ "aria-controls": props.id ?? listId,
1462
+ onClick: () => setExpanded((value) => !value),
1463
+ children: expanded ? "Show fewer" : `+${hiddenCount} more`
1464
+ })
1465
+ })
1466
+ ]
1467
+ })
1468
+ });
1469
+ }
1470
+ function ChartLegendItem({
1471
+ inactive,
1472
+ className,
1473
+ ...props
1474
+ }) {
1475
+ return /* @__PURE__ */ jsx10("li", {
1476
+ ...props,
1477
+ "data-inactive": inactive || undefined,
1478
+ className: classNames("altertable-chart-legend-item", className)
1479
+ });
1480
+ }
1481
+ function ChartLegendMarker({
1482
+ kind,
1483
+ color = kind === "bar" ? chartBarFill : "var(--atbl-accent)",
1484
+ className,
1485
+ style,
1486
+ ...props
1487
+ }) {
1488
+ return /* @__PURE__ */ jsxs5("svg", {
1489
+ ...props,
1490
+ "aria-hidden": "true",
1491
+ focusable: "false",
1492
+ viewBox: "0 0 20 12",
1493
+ "data-kind": kind,
1494
+ className: classNames("altertable-chart-legend-marker", className),
1495
+ style: { color, ...style },
1496
+ children: [
1497
+ kind === "bar" && /* @__PURE__ */ jsx10("path", {
1498
+ d: "M6 11V3Q6 1 8 1H12Q14 1 14 3V11Z",
1499
+ fill: "currentColor"
1500
+ }),
1501
+ kind === "slice" && /* @__PURE__ */ jsx10("rect", {
1502
+ x: "5",
1503
+ y: "1",
1504
+ width: "10",
1505
+ height: "10",
1506
+ rx: "2",
1507
+ fill: "currentColor"
1508
+ }),
1509
+ kind === "point" && /* @__PURE__ */ jsx10("circle", {
1510
+ cx: "10",
1511
+ cy: "6",
1512
+ r: "3",
1513
+ fill: "currentColor"
1514
+ }),
1515
+ kind === "line" && /* @__PURE__ */ jsxs5(Fragment2, {
1516
+ children: [
1517
+ /* @__PURE__ */ jsx10("path", {
1518
+ d: "M1 6H19",
1519
+ fill: "none",
1520
+ stroke: "currentColor",
1521
+ strokeWidth: "2",
1522
+ strokeLinecap: "round"
1523
+ }),
1524
+ /* @__PURE__ */ jsx10("circle", {
1525
+ cx: "10",
1526
+ cy: "6",
1527
+ r: "2.5",
1528
+ fill: "var(--atbl-surface)",
1529
+ stroke: "currentColor",
1530
+ strokeWidth: "2"
1531
+ })
1532
+ ]
1533
+ }),
1534
+ kind === "area" && /* @__PURE__ */ jsxs5(Fragment2, {
1535
+ children: [
1536
+ /* @__PURE__ */ jsx10("path", {
1537
+ d: "M1 10L7 5L13 7L19 2V11H1Z",
1538
+ fill: "currentColor",
1539
+ fillOpacity: "0.14"
1540
+ }),
1541
+ /* @__PURE__ */ jsx10("path", {
1542
+ d: "M1 10L7 5L13 7L19 2",
1543
+ fill: "none",
1544
+ stroke: "currentColor",
1545
+ strokeWidth: "2",
1546
+ strokeLinejoin: "round",
1547
+ strokeLinecap: "round"
1548
+ })
1549
+ ]
1550
+ })
1551
+ ]
1552
+ });
1553
+ }
1554
+ function ChartLegendLabel({
1555
+ className,
1556
+ children,
1557
+ title,
1558
+ ...props
1559
+ }) {
1560
+ return /* @__PURE__ */ jsx10("span", {
1561
+ ...props,
1562
+ title: title ?? (typeof children === "string" ? children : undefined),
1563
+ className: classNames("altertable-chart-legend-label", className),
1564
+ children
1565
+ });
1566
+ }
1567
+ var ChartLegend = Object.assign(ChartLegendRoot, {
1568
+ Item: ChartLegendItem,
1569
+ Marker: ChartLegendMarker,
1570
+ Label: ChartLegendLabel
1571
+ });
1572
+
1573
+ // src/react/ui/PieChart.tsx
1574
+ import { useState as useState3 } from "react";
1575
+ import { jsx as jsx11, jsxs as jsxs6, Fragment as Fragment3 } from "react/jsx-runtime";
1576
+ function PieChart({
1577
+ items,
1578
+ unit,
1579
+ ariaLabel,
1580
+ showLegend = true,
1581
+ formatValue = (value) => new Intl.NumberFormat().format(value)
1582
+ }) {
1583
+ validateChartItems("pie", items);
1584
+ const [previewId, setPreviewId] = useState3(null);
1585
+ const [plotOpen, setPlotOpen] = useState3(false);
1586
+ const [legendId, setLegendId] = useState3(null);
1587
+ const maximum = items.reduce((max, item) => Math.max(max, item.value), 0);
1588
+ const total = maximum ? items.reduce((sum, item) => sum + item.value / maximum, 0) : 0;
1589
+ let cursor = -Math.PI / 2;
1590
+ const slices = [];
1591
+ for (const [index, item] of items.entries()) {
1592
+ let point = function(angle) {
1593
+ return `${110 + Math.cos(angle) * 100},${110 + Math.sin(angle) * 100}`;
1594
+ };
1595
+ const share = total ? item.value / maximum / total : 0;
1596
+ const start = cursor;
1597
+ cursor += share * Math.PI * 2;
1598
+ const middle = (start + cursor) / 2;
1599
+ slices.push({
1600
+ ...item,
1601
+ share,
1602
+ color: `var(--atbl-chart-${index % 8 + 1})`,
1603
+ path: `${share === 1 ? "M" : "M110,110 L"}${point(start)} A100,100 0 0 1 ${point(middle)} A100,100 0 0 1 ${point(cursor)} Z`
1604
+ });
1605
+ }
1606
+ function percent(share) {
1607
+ return new Intl.NumberFormat("en-US", {
1608
+ style: "percent",
1609
+ maximumFractionDigits: 1
1610
+ }).format(share);
1611
+ }
1612
+ function detail(item) {
1613
+ return /* @__PURE__ */ jsxs6(Fragment3, {
1614
+ children: [
1615
+ /* @__PURE__ */ jsx11("strong", {
1616
+ children: item.label
1617
+ }),
1618
+ /* @__PURE__ */ jsxs6("span", {
1619
+ children: [
1620
+ formatValue(item.value),
1621
+ " ",
1622
+ unit,
1623
+ " · ",
1624
+ percent(item.share)
1625
+ ]
1626
+ })
1627
+ ]
1628
+ });
1629
+ }
1630
+ const preview = slices.find((item) => item.id === previewId);
1631
+ return /* @__PURE__ */ jsxs6("section", {
1632
+ className: "altertable-pie-chart",
1633
+ "aria-label": ariaLabel,
1634
+ children: [
1635
+ items.length === 0 && /* @__PURE__ */ jsx11("span", {
1636
+ children: "No data"
1637
+ }),
1638
+ items.length > 0 && /* @__PURE__ */ jsxs6(Fragment3, {
1639
+ children: [
1640
+ /* @__PURE__ */ jsxs6("div", {
1641
+ className: "altertable-pie-plot",
1642
+ children: [
1643
+ /* @__PURE__ */ jsx11(Tooltip2, {
1644
+ variant: "chart",
1645
+ className: "altertable-pie-tooltip",
1646
+ onOpenChange: setPlotOpen,
1647
+ content: preview ? detail(preview) : null,
1648
+ children: /* @__PURE__ */ jsx11("svg", {
1649
+ viewBox: "0 0 220 220",
1650
+ "aria-hidden": "true",
1651
+ focusable: "false",
1652
+ children: total === 0 ? /* @__PURE__ */ jsx11("circle", {
1653
+ cx: "110",
1654
+ cy: "110",
1655
+ r: "100",
1656
+ className: "altertable-pie-empty"
1657
+ }) : slices.filter((item) => item.share > 0).map((item) => /* @__PURE__ */ jsx11("path", {
1658
+ d: item.path,
1659
+ fill: item.color,
1660
+ className: "altertable-pie-slice",
1661
+ "data-active": item.id === (plotOpen && previewId ? previewId : showLegend ? legendId : null) || undefined,
1662
+ onPointerDown: (event) => {
1663
+ if (plotOpen && previewId !== item.id)
1664
+ event.preventDefault();
1665
+ setPreviewId(item.id);
1666
+ },
1667
+ onPointerEnter: (event) => {
1668
+ if (event.pointerType === "mouse")
1669
+ setPreviewId(item.id);
1670
+ },
1671
+ onPointerLeave: (event) => {
1672
+ if (event.pointerType === "mouse")
1673
+ setPreviewId(null);
1674
+ }
1675
+ }, item.id))
1676
+ })
1677
+ }),
1678
+ total === 0 && /* @__PURE__ */ jsx11("span", {
1679
+ className: "altertable-pie-empty-label",
1680
+ children: "No nonzero values"
1681
+ })
1682
+ ]
1683
+ }),
1684
+ showLegend && /* @__PURE__ */ jsx11(ChartLegend, {
1685
+ layout: "vertical",
1686
+ "aria-label": `${ariaLabel} legend`,
1687
+ className: "altertable-pie-legend",
1688
+ children: slices.map((item) => /* @__PURE__ */ jsx11(ChartLegend.Item, {
1689
+ children: /* @__PURE__ */ jsx11(Tooltip2, {
1690
+ variant: "chart",
1691
+ content: detail(item),
1692
+ onOpenChange: (open) => setLegendId((current) => open ? item.id : current === item.id ? null : current),
1693
+ children: /* @__PURE__ */ jsxs6("button", {
1694
+ "data-atbl-focus": "ring",
1695
+ "data-atbl-control": "default",
1696
+ type: "button",
1697
+ tabIndex: -1,
1698
+ "aria-label": `${item.label}: ${formatValue(item.value)} ${unit}, ${percent(item.share)}`,
1699
+ children: [
1700
+ /* @__PURE__ */ jsx11(ChartLegend.Marker, {
1701
+ kind: "slice",
1702
+ color: item.color
1703
+ }),
1704
+ /* @__PURE__ */ jsx11(ChartLegend.Label, {
1705
+ className: "altertable-pie-label",
1706
+ children: item.label
1707
+ }),
1708
+ /* @__PURE__ */ jsx11("strong", {
1709
+ children: formatValue(item.value)
1710
+ }),
1711
+ /* @__PURE__ */ jsx11("span", {
1712
+ children: percent(item.share)
1713
+ })
1714
+ ]
1715
+ })
1716
+ })
1717
+ }, item.id))
1718
+ })
1719
+ ]
1720
+ })
1721
+ ]
1722
+ });
1723
+ }
1724
+ // src/react/ui/ScatterChart.tsx
1725
+ import { jsx as jsx12, jsxs as jsxs7, Fragment as Fragment4 } from "react/jsx-runtime";
1726
+ function formatNumber(value) {
1727
+ return new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(value);
1728
+ }
1729
+ function scale(values) {
1730
+ const magnitude = values.reduce((max, value) => Math.max(max, Math.abs(value)), 1);
1731
+ const low = values.reduce((min, value) => Math.min(min, value / magnitude), 0);
1732
+ const high = values.reduce((max, value) => Math.max(max, value / magnitude), 0) || (low === 0 ? 1 : 0);
1733
+ const span = high - low;
1734
+ return {
1735
+ position(value) {
1736
+ return (value / magnitude - low) / span * 100;
1737
+ },
1738
+ ticks: [low, low + span / 2, high].map((value) => value * magnitude)
1739
+ };
1740
+ }
1741
+ function ScatterChart({
1742
+ items,
1743
+ xLabel,
1744
+ yLabel,
1745
+ xUnit,
1746
+ yUnit,
1747
+ ariaLabel,
1748
+ formatX = formatNumber,
1749
+ formatY = formatNumber
1750
+ }) {
1751
+ validateChartItems("scatter", items);
1752
+ const xScale = scale(items.map((item) => item.x));
1753
+ const yScale = scale(items.map((item) => item.y));
1754
+ return /* @__PURE__ */ jsxs7("section", {
1755
+ className: "altertable-scatter-chart",
1756
+ "aria-label": ariaLabel,
1757
+ children: [
1758
+ items.length === 0 && /* @__PURE__ */ jsx12("span", {
1759
+ children: "No data"
1760
+ }),
1761
+ items.length > 0 && /* @__PURE__ */ jsxs7(Fragment4, {
1762
+ children: [
1763
+ /* @__PURE__ */ jsxs7("p", {
1764
+ className: "altertable-scatter-axis-title",
1765
+ children: [
1766
+ yLabel,
1767
+ yUnit && ` (${yUnit})`
1768
+ ]
1769
+ }),
1770
+ /* @__PURE__ */ jsx12("div", {
1771
+ className: "altertable-scatter-axes",
1772
+ children: /* @__PURE__ */ jsxs7("div", {
1773
+ className: "altertable-scatter-plot",
1774
+ children: [
1775
+ yScale.ticks.map((value, index) => /* @__PURE__ */ jsx12("div", {
1776
+ className: "altertable-scatter-gridline",
1777
+ style: { bottom: `${index * 50}%` },
1778
+ "aria-hidden": "true",
1779
+ children: /* @__PURE__ */ jsx12("span", {
1780
+ title: formatY(value),
1781
+ children: formatY(value)
1782
+ })
1783
+ }, index)),
1784
+ xScale.ticks.map((value, index) => /* @__PURE__ */ jsx12("span", {
1785
+ className: "altertable-scatter-x-tick",
1786
+ "data-edge": index,
1787
+ style: { left: `${index * 50}%` },
1788
+ "aria-hidden": "true",
1789
+ title: formatX(value),
1790
+ children: formatX(value)
1791
+ }, index)),
1792
+ items.map((item) => /* @__PURE__ */ jsx12(Tooltip2, {
1793
+ variant: "chart",
1794
+ content: /* @__PURE__ */ jsxs7(Fragment4, {
1795
+ children: [
1796
+ /* @__PURE__ */ jsx12("strong", {
1797
+ children: item.label
1798
+ }),
1799
+ /* @__PURE__ */ jsxs7("span", {
1800
+ children: [
1801
+ xLabel,
1802
+ ": ",
1803
+ formatX(item.x),
1804
+ " ",
1805
+ xUnit
1806
+ ]
1807
+ }),
1808
+ /* @__PURE__ */ jsxs7("span", {
1809
+ children: [
1810
+ yLabel,
1811
+ ": ",
1812
+ formatY(item.y),
1813
+ " ",
1814
+ yUnit
1815
+ ]
1816
+ })
1817
+ ]
1818
+ }),
1819
+ className: "altertable-scatter-tooltip",
1820
+ style: {
1821
+ left: `${xScale.position(item.x)}%`,
1822
+ bottom: `${yScale.position(item.y)}%`
1823
+ },
1824
+ children: /* @__PURE__ */ jsx12("button", {
1825
+ "data-atbl-focus": "ring",
1826
+ "data-atbl-control": "default",
1827
+ type: "button",
1828
+ tabIndex: -1,
1829
+ className: "altertable-scatter-point",
1830
+ "aria-label": `${item.label}: ${xLabel} ${formatX(item.x)} ${xUnit}, ${yLabel} ${formatY(item.y)} ${yUnit}`,
1831
+ children: /* @__PURE__ */ jsx12("span", {})
1832
+ })
1833
+ }, item.id))
1834
+ ]
1835
+ })
1836
+ }),
1837
+ /* @__PURE__ */ jsxs7("p", {
1838
+ className: "altertable-scatter-axis-title altertable-scatter-x-title",
1839
+ children: [
1840
+ xLabel,
1841
+ xUnit && ` (${xUnit})`
1842
+ ]
1843
+ })
1844
+ ]
1845
+ })
1846
+ ]
1847
+ });
1848
+ }
1849
+ // src/react/ui/BarChart.tsx
1850
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState4 } from "react";
1851
+ import { BarChart as RechartsBarChart, Cell } from "recharts";
1852
+ import { jsx as jsx13, jsxs as jsxs8, Fragment as Fragment5 } from "react/jsx-runtime";
1853
+ function BarChart({
1854
+ items,
1855
+ unit,
1856
+ ariaLabel,
1857
+ formatValue = (value) => new Intl.NumberFormat().format(value)
1858
+ }) {
1859
+ validateChartItems("bar", items);
1860
+ const [activeId, setActiveId] = useState4();
1861
+ const scrollport = useRef2(null);
1862
+ useLayoutEffect2(() => {
1863
+ const element = scrollport.current;
1864
+ if (element)
1865
+ element.scrollLeft = element.scrollWidth - element.clientWidth;
1866
+ }, [items]);
1867
+ const maximum = items.reduce((max, item) => Math.max(max, item.value), 1);
1868
+ return /* @__PURE__ */ jsxs8("section", {
1869
+ className: "altertable-selectable-bars",
1870
+ "aria-label": ariaLabel,
1871
+ children: [
1872
+ items.length === 0 && /* @__PURE__ */ jsx13("span", {
1873
+ children: "No data"
1874
+ }),
1875
+ /* @__PURE__ */ jsx13("div", {
1876
+ className: "altertable-selectable-bars-scroll",
1877
+ ref: scrollport,
1878
+ children: /* @__PURE__ */ jsxs8("div", {
1879
+ className: "altertable-selectable-bars-plot",
1880
+ style: { minWidth: items.length * 45 },
1881
+ children: [
1882
+ /* @__PURE__ */ jsx13("div", {
1883
+ className: "altertable-chart-canvas",
1884
+ "aria-hidden": "true",
1885
+ children: /* @__PURE__ */ jsxs8(RechartsBarChart, {
1886
+ data: items.map((item) => ({
1887
+ ...item,
1888
+ plotValue: item.value / maximum
1889
+ })),
1890
+ title: ariaLabel,
1891
+ responsive: true,
1892
+ width: "100%",
1893
+ height: 220,
1894
+ margin: { top: 0, right: 0, bottom: 0, left: 0 },
1895
+ accessibilityLayer: false,
1896
+ tabIndex: -1,
1897
+ barCategoryGap: "24%",
1898
+ children: [
1899
+ /* @__PURE__ */ jsx13(ChartXAxis, {
1900
+ hide: true,
1901
+ dataKey: "id",
1902
+ scale: "band"
1903
+ }),
1904
+ /* @__PURE__ */ jsx13(ChartYAxis, {
1905
+ hide: true,
1906
+ domain: [0, 1],
1907
+ allowDataOverflow: true
1908
+ }),
1909
+ /* @__PURE__ */ jsx13(ChartBar, {
1910
+ dataKey: "plotValue",
1911
+ minPointSize: (value) => (value ?? 0) > 0 ? 7 : 0,
1912
+ children: items.map((item) => /* @__PURE__ */ jsx13(Cell, {
1913
+ fill: activeId === item.id ? "var(--atbl-accent)" : chartBarFill
1914
+ }, item.id))
1915
+ })
1916
+ ]
1917
+ })
1918
+ }),
1919
+ /* @__PURE__ */ jsx13("div", {
1920
+ className: "altertable-selectable-bars-items",
1921
+ children: items.map((item) => /* @__PURE__ */ jsx13(Tooltip2, {
1922
+ variant: "chart",
1923
+ onOpenChange: (open) => setActiveId((current) => open ? item.id : current === item.id ? undefined : current),
1924
+ content: /* @__PURE__ */ jsxs8(Fragment5, {
1925
+ children: [
1926
+ /* @__PURE__ */ jsx13("strong", {
1927
+ children: item.label
1928
+ }),
1929
+ /* @__PURE__ */ jsxs8("span", {
1930
+ children: [
1931
+ formatValue(item.value),
1932
+ " ",
1933
+ unit
1934
+ ]
1935
+ })
1936
+ ]
1937
+ }),
1938
+ className: "altertable-chart-column",
1939
+ children: /* @__PURE__ */ jsxs8("button", {
1940
+ "data-atbl-focus": "ring",
1941
+ "data-atbl-control": "default",
1942
+ type: "button",
1943
+ tabIndex: -1,
1944
+ className: "altertable-selectable-bars-item",
1945
+ "aria-label": `${item.label}: ${formatValue(item.value)} ${unit}`,
1946
+ children: [
1947
+ /* @__PURE__ */ jsx13("span", {
1948
+ className: "altertable-selectable-bars-area"
1949
+ }),
1950
+ /* @__PURE__ */ jsx13("span", {
1951
+ className: "altertable-selectable-bars-label",
1952
+ children: item.label
1953
+ })
1954
+ ]
1955
+ })
1956
+ }, item.id))
1957
+ })
1958
+ ]
1959
+ })
1960
+ })
1961
+ ]
1962
+ });
1963
+ }
1964
+ // src/react/ui/RadioGroup.tsx
1965
+ import {
1966
+ RadioGroup as AriaRadioGroup,
1967
+ Radio as AriaRadio,
1968
+ Label
1969
+ } from "react-aria-components";
1970
+ import { jsx as jsx14, jsxs as jsxs9, Fragment as Fragment6 } from "react/jsx-runtime";
1971
+ function RadioGroup({
1972
+ label,
1973
+ className,
1974
+ children,
1975
+ ...props
1976
+ }) {
1977
+ return /* @__PURE__ */ jsxs9(AriaRadioGroup, {
1978
+ ...props,
1979
+ className: classNames("altertable-radio-group", className),
1980
+ children: [
1981
+ /* @__PURE__ */ jsx14(Label, {
1982
+ className: "altertable-control-label",
1983
+ children: label
1984
+ }),
1985
+ children
1986
+ ]
1987
+ });
1988
+ }
1989
+ function Radio({ className, children, ...props }) {
1990
+ return /* @__PURE__ */ jsx14(AriaRadio, {
1991
+ ...props,
1992
+ "data-atbl-control": "action",
1993
+ "data-atbl-focus": "ring",
1994
+ className: classNames("altertable-radio", className),
1995
+ children: (state) => /* @__PURE__ */ jsxs9(Fragment6, {
1996
+ children: [
1997
+ /* @__PURE__ */ jsx14("span", {
1998
+ className: "altertable-radio-mark",
1999
+ "aria-hidden": "true"
2000
+ }),
2001
+ typeof children === "function" ? children(state) : children
2002
+ ]
2003
+ })
2004
+ });
2005
+ }
2006
+ function SegmentedControl({
2007
+ options,
2008
+ className,
2009
+ ...props
2010
+ }) {
2011
+ validateChoiceOptions(options);
2012
+ return /* @__PURE__ */ jsx14(RadioGroup, {
2013
+ ...props,
2014
+ orientation: "horizontal",
2015
+ className: classNames("altertable-segmented-control", className),
2016
+ children: /* @__PURE__ */ jsx14("div", {
2017
+ className: "altertable-segmented-options",
2018
+ children: options.map((option) => /* @__PURE__ */ jsx14(Radio, {
2019
+ value: option.id,
2020
+ "data-atbl-internal-surface": "option",
2021
+ children: option.label
2022
+ }, option.id))
2023
+ })
2024
+ });
2025
+ }
2026
+ // src/react/ui/CheckboxGroup.tsx
2027
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
2028
+ function CheckboxGroup({
2029
+ label,
2030
+ values,
2031
+ onChange,
2032
+ className,
2033
+ children,
2034
+ disabled,
2035
+ ...props
2036
+ }) {
2037
+ invariant(new Set(values).size === values.length, "Checkbox group values must be unique.");
2038
+ return /* @__PURE__ */ jsxs10("fieldset", {
2039
+ ...props,
2040
+ disabled,
2041
+ className: classNames("altertable-checkbox-group", className),
2042
+ children: [
2043
+ /* @__PURE__ */ jsx15("legend", {
2044
+ children: label
2045
+ }),
2046
+ /* @__PURE__ */ jsx15(CheckboxGroupContext, {
2047
+ value: {
2048
+ values,
2049
+ disabled,
2050
+ onChange(value, checked) {
2051
+ onChange(checked ? [...values.filter((item) => item !== value), value] : values.filter((item) => item !== value));
2052
+ }
2053
+ },
2054
+ children
2055
+ })
2056
+ ]
2057
+ });
2058
+ }
2059
+ // src/react/ui/ComposedChartLegend.tsx
2060
+ import { Legend } from "recharts";
2061
+ import { jsx as jsx16, jsxs as jsxs11, Fragment as Fragment7 } from "react/jsx-runtime";
2062
+ var legendMarkerKinds = {
2063
+ square: "area",
2064
+ rect: "bar",
2065
+ line: "line",
2066
+ plainline: "line"
2067
+ };
2068
+ function LegendContent({
2069
+ payload = [],
2070
+ maxVisibleItems,
2071
+ formatter,
2072
+ layout,
2073
+ align,
2074
+ labelStyle,
2075
+ iconType,
2076
+ iconSize = 20,
2077
+ inactiveColor = "var(--atbl-muted)",
2078
+ position,
2079
+ verticalAlign,
2080
+ onClick,
2081
+ onMouseEnter,
2082
+ onMouseLeave,
2083
+ "aria-label": ariaLabel
2084
+ }) {
2085
+ if (!payload.some((entry) => entry.type !== "none"))
2086
+ return null;
2087
+ const vertical = layout === "vertical" || layout === "auto" && (position === "left" || position === "right");
2088
+ return /* @__PURE__ */ jsx16(ChartLegend, {
2089
+ "aria-label": ariaLabel,
2090
+ className: position === "top" || position == null && verticalAlign === "top" ? "altertable-composed-chart-legend-above" : position === "bottom" || position == null && verticalAlign !== "middle" && !vertical ? "altertable-composed-chart-legend-below" : undefined,
2091
+ maxVisibleItems,
2092
+ layout: vertical ? "vertical" : "horizontal",
2093
+ align: align === "right" ? "end" : align === "left" ? "start" : "center",
2094
+ children: payload.map((entry, index) => {
2095
+ if (entry.type === "none")
2096
+ return null;
2097
+ const type = iconType ?? entry.type;
2098
+ const kind = legendMarkerKinds[type ?? "none"] ?? "point";
2099
+ const formatLabel = entry.formatter ?? formatter;
2100
+ const label = formatLabel ? formatLabel(entry.value, entry, index) : entry.value;
2101
+ const content = /* @__PURE__ */ jsxs11(Fragment7, {
2102
+ children: [
2103
+ type !== "none" && (entry.legendIcon ?? /* @__PURE__ */ jsx16(ChartLegend.Marker, {
2104
+ kind,
2105
+ color: entry.inactive ? inactiveColor : entry.color,
2106
+ style: { width: iconSize, height: iconSize * 0.6 }
2107
+ })),
2108
+ /* @__PURE__ */ jsx16(ChartLegend.Label, {
2109
+ style: labelStyle,
2110
+ children: label
2111
+ })
2112
+ ]
2113
+ });
2114
+ return /* @__PURE__ */ jsx16(ChartLegend.Item, {
2115
+ inactive: entry.inactive,
2116
+ onMouseEnter: onMouseEnter ? (event) => onMouseEnter(entry, index, event) : undefined,
2117
+ onMouseLeave: onMouseLeave ? (event) => onMouseLeave(entry, index, event) : undefined,
2118
+ children: onClick ? /* @__PURE__ */ jsx16("button", {
2119
+ type: "button",
2120
+ "data-atbl-control": "action",
2121
+ "data-atbl-focus": "ring",
2122
+ className: "altertable-chart-legend-action",
2123
+ onClick: (event) => onClick(entry, index, event),
2124
+ children: content
2125
+ }) : content
2126
+ }, index);
2127
+ })
2128
+ });
2129
+ }
2130
+ function ComposedChartLegend({
2131
+ maxVisibleItems,
2132
+ ...props
2133
+ }) {
2134
+ return /* @__PURE__ */ jsx16(Legend, {
2135
+ iconSize: 20,
2136
+ inactiveColor: "var(--atbl-muted)",
2137
+ content: /* @__PURE__ */ jsx16(LegendContent, {
2138
+ maxVisibleItems
2139
+ }),
2140
+ ...props
2141
+ });
2142
+ }
2143
+
2144
+ // src/react/ui/ComposedChart.tsx
2145
+ import {
2146
+ ComposedChart as RechartsComposedChart,
2147
+ ZAxis,
2148
+ ReferenceLine as ReferenceLine2,
2149
+ ReferenceArea,
2150
+ ReferenceDot,
2151
+ Brush,
2152
+ Cell as Cell2,
2153
+ Label as Label2,
2154
+ LabelList,
2155
+ ErrorBar
2156
+ } from "recharts";
2157
+ import { jsx as jsx17 } from "react/jsx-runtime";
2158
+ function ComposedChartRoot({
2159
+ data,
2160
+ ariaLabel,
2161
+ width = "100%",
2162
+ height = 300,
2163
+ responsive = true,
2164
+ className,
2165
+ ...props
2166
+ }) {
2167
+ return /* @__PURE__ */ jsx17("section", {
2168
+ className: ["altertable-composed-chart", className].filter(Boolean).join(" "),
2169
+ "aria-label": ariaLabel,
2170
+ children: /* @__PURE__ */ jsx17(RechartsComposedChart, {
2171
+ "data-atbl-focus": "inset",
2172
+ ...props,
2173
+ data,
2174
+ width,
2175
+ height,
2176
+ responsive,
2177
+ title: ariaLabel
2178
+ })
2179
+ });
2180
+ }
2181
+ var ComposedChart = Object.assign(ComposedChartRoot, {
2182
+ Dot: ChartDot,
2183
+ Area: ChartArea,
2184
+ Bar: ChartBar,
2185
+ Line: ChartLine,
2186
+ Scatter: ChartScatter,
2187
+ XAxis: ChartXAxis,
2188
+ YAxis: ChartYAxis,
2189
+ ZAxis,
2190
+ CartesianGrid: ChartGrid,
2191
+ Tooltip: ChartTooltip,
2192
+ Legend: ComposedChartLegend,
2193
+ ReferenceLine: ReferenceLine2,
2194
+ ReferenceArea,
2195
+ ReferenceDot,
2196
+ Brush,
2197
+ Cell: Cell2,
2198
+ Label: Label2,
2199
+ LabelList,
2200
+ ErrorBar
2201
+ });
2202
+ export {
2203
+ AboutData2 as AboutData,
2204
+ AppIcon2 as AppIcon,
2205
+ AreaChart,
2206
+ BarChart,
2207
+ ChartLegend,
2208
+ Checkbox2 as Checkbox,
2209
+ CheckboxGroup,
2210
+ ChoicePicker2 as ChoicePicker,
2211
+ ComposedChart,
2212
+ DataApp,
2213
+ DataAppProvider2 as DataAppProvider,
2214
+ DataAppSkeleton,
2215
+ DataTable2 as DataTable,
2216
+ DataTableEmptyRow2 as DataTableEmptyRow,
2217
+ DataTableShare2 as DataTableShare,
2218
+ DataTableTimestamp2 as DataTableTimestamp,
2219
+ DataValue2 as DataValue,
2220
+ DataWidget2 as DataWidget,
2221
+ DateRangePicker2 as DateRangePicker,
2222
+ DimensionPicker2 as DimensionPicker,
2223
+ FilterActions2 as FilterActions,
2224
+ FilterBar2 as FilterBar,
2225
+ GettingStarted,
2226
+ GlossaryDefinition,
2227
+ GlossaryExplanation,
2228
+ GradientScroll2 as GradientScroll,
2229
+ HelpPopover2 as HelpPopover,
2230
+ LineChart,
2231
+ LiveControl2 as LiveControl,
2232
+ Menu2 as Menu,
2233
+ PressButton as MenuButton,
2234
+ MenuItem2 as MenuItem,
2235
+ MenuPopover2 as MenuPopover,
2236
+ MenuSection2 as MenuSection,
2237
+ MenuSeparator2 as MenuSeparator,
2238
+ MenuTrigger2 as MenuTrigger,
2239
+ MetricWidget2 as MetricWidget,
2240
+ NumberField2 as NumberField,
2241
+ NumberFilterPicker2 as NumberFilterPicker,
2242
+ NumberRangeField2 as NumberRangeField,
2243
+ PieChart,
2244
+ PresentStory2 as PresentStory,
2245
+ Radio,
2246
+ RadioGroup,
2247
+ ScatterChart,
2248
+ SearchField2 as SearchField,
2249
+ SearchMatch2 as SearchMatch,
2250
+ SegmentedControl,
2251
+ Select2 as Select,
2252
+ Sheet2 as Sheet,
2253
+ Tab2 as Tab,
2254
+ TabList2 as TabList,
2255
+ TabPanel2 as TabPanel,
2256
+ TabPanels2 as TabPanels,
2257
+ TableWidget2 as TableWidget,
2258
+ Tabs2 as Tabs,
2259
+ TextWidget2 as TextWidget,
2260
+ Tooltip2 as Tooltip,
2261
+ TooltipProvider2 as TooltipProvider,
2262
+ VariableBar2 as VariableBar,
2263
+ VisualizationWidget2 as VisualizationWidget,
2264
+ injectDataAppShellStyles,
2265
+ injectDataAppStyles2 as injectDataAppStyles,
2266
+ isPlainKeyEvent2 as isPlainKeyEvent,
2267
+ searchItems2 as searchItems,
2268
+ useAppVariables2 as useAppVariables,
2269
+ useViewTab2 as useViewTab
2270
+ };
2271
+
2272
+ //# debugId=FCD41F839B3A5B8964756E2164756E21