@altertable/data-app-react 0.72.0 → 0.73.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 (170) hide show
  1. package/README.md +3 -7
  2. package/dist/chunks/SectionHeading-CVenpddF.js +7813 -0
  3. package/dist/chunks/SectionHeading-CVenpddF.js.map +1 -0
  4. package/dist/index.js +1004 -2847
  5. package/dist/index.js.map +1 -23
  6. package/dist/types/chunks/date-formatting.d.ts +863 -0
  7. package/dist/types/index.d.ts +745 -78
  8. package/dist/types/ui/index.d.ts +572 -111
  9. package/dist/ui/index.js +2779 -3403
  10. package/dist/ui/index.js.map +1 -36
  11. package/package.json +7 -6
  12. package/dist/chunks/index-xwy62xrb.js +0 -16996
  13. package/dist/chunks/index-xwy62xrb.js.map +0 -120
  14. package/dist/types/actions.d.ts +0 -53
  15. package/dist/types/annotations/AnnotationBar.d.ts +0 -30
  16. package/dist/types/annotations/AnnotationControls.d.ts +0 -10
  17. package/dist/types/annotations/AnnotationEditor.d.ts +0 -16
  18. package/dist/types/annotations/AnnotationMarkers.d.ts +0 -19
  19. package/dist/types/annotations/AnnotationSelectionLayer.d.ts +0 -12
  20. package/dist/types/annotations/AnnotationTarget.d.ts +0 -9
  21. package/dist/types/annotations/AnnotationTooltip.d.ts +0 -9
  22. package/dist/types/annotations/AnnotationTrigger.d.ts +0 -10
  23. package/dist/types/annotations/annotation-editor-state.d.ts +0 -58
  24. package/dist/types/annotations/annotation-screenshot.d.ts +0 -4
  25. package/dist/types/annotations/annotation-targets.d.ts +0 -34
  26. package/dist/types/annotations/getAnnotationProps.d.ts +0 -17
  27. package/dist/types/annotations/styles.d.ts +0 -3
  28. package/dist/types/annotations/useAnnotationGeometry.d.ts +0 -22
  29. package/dist/types/annotations/useDataAppAnnotations.d.ts +0 -22
  30. package/dist/types/app-context.d.ts +0 -3
  31. package/dist/types/bindings.d.ts +0 -169
  32. package/dist/types/content.d.ts +0 -36
  33. package/dist/types/date-formatting.d.ts +0 -12
  34. package/dist/types/details.d.ts +0 -46
  35. package/dist/types/exploration.d.ts +0 -44
  36. package/dist/types/hooks.d.ts +0 -114
  37. package/dist/types/injectStyles.d.ts +0 -7
  38. package/dist/types/mount.d.ts +0 -13
  39. package/dist/types/search-suggestions.d.ts +0 -8
  40. package/dist/types/source-owner.d.ts +0 -2
  41. package/dist/types/style-contract.d.ts +0 -88
  42. package/dist/types/style-validation.d.ts +0 -2
  43. package/dist/types/styles.d.ts +0 -8
  44. package/dist/types/ui/AboutData.d.ts +0 -73
  45. package/dist/types/ui/AltertableLogo.d.ts +0 -3
  46. package/dist/types/ui/AppFooter.d.ts +0 -6
  47. package/dist/types/ui/AppHeader.d.ts +0 -10
  48. package/dist/types/ui/AppLayout.d.ts +0 -10
  49. package/dist/types/ui/AppScope.d.ts +0 -7
  50. package/dist/types/ui/AppToolbar.d.ts +0 -30
  51. package/dist/types/ui/AreaChart.d.ts +0 -7
  52. package/dist/types/ui/BarChart.d.ts +0 -6
  53. package/dist/types/ui/Breakdown.d.ts +0 -13
  54. package/dist/types/ui/Button.d.ts +0 -12
  55. package/dist/types/ui/ChartLegend.d.ts +0 -32
  56. package/dist/types/ui/Checkbox.d.ts +0 -21
  57. package/dist/types/ui/CheckboxGroup.d.ts +0 -7
  58. package/dist/types/ui/ChoicePicker.d.ts +0 -39
  59. package/dist/types/ui/Comparison.d.ts +0 -14
  60. package/dist/types/ui/ComposedChart.d.ts +0 -41
  61. package/dist/types/ui/ComposedChartLegend.d.ts +0 -9
  62. package/dist/types/ui/ContentSkeleton.d.ts +0 -7
  63. package/dist/types/ui/DataApp.d.ts +0 -24
  64. package/dist/types/ui/DataAppFrame.d.ts +0 -52
  65. package/dist/types/ui/DataBoundary.d.ts +0 -14
  66. package/dist/types/ui/DataSection.d.ts +0 -14
  67. package/dist/types/ui/DataSectionBoundary.d.ts +0 -30
  68. package/dist/types/ui/DataTable.d.ts +0 -29
  69. package/dist/types/ui/DataValue.d.ts +0 -9
  70. package/dist/types/ui/DataViewToast.d.ts +0 -11
  71. package/dist/types/ui/DataWidget.d.ts +0 -37
  72. package/dist/types/ui/DateDisplay.d.ts +0 -9
  73. package/dist/types/ui/DateRangePicker.d.ts +0 -30
  74. package/dist/types/ui/DateTimeTooltip.d.ts +0 -10
  75. package/dist/types/ui/DimensionPicker.d.ts +0 -14
  76. package/dist/types/ui/EmptyState.d.ts +0 -6
  77. package/dist/types/ui/ExplorationActionControl.d.ts +0 -60
  78. package/dist/types/ui/ExportControl.d.ts +0 -4
  79. package/dist/types/ui/FilterActions.d.ts +0 -10
  80. package/dist/types/ui/FilterBar.d.ts +0 -3
  81. package/dist/types/ui/FunnelChart.d.ts +0 -20
  82. package/dist/types/ui/GettingStarted.d.ts +0 -6
  83. package/dist/types/ui/GlossaryDefinition.d.ts +0 -7
  84. package/dist/types/ui/GlossaryExplanation.d.ts +0 -16
  85. package/dist/types/ui/GradientScroll.d.ts +0 -23
  86. package/dist/types/ui/Grid.d.ts +0 -12
  87. package/dist/types/ui/GridItem.d.ts +0 -7
  88. package/dist/types/ui/HelpPopover.d.ts +0 -21
  89. package/dist/types/ui/IconButton.d.ts +0 -19
  90. package/dist/types/ui/InspectionContext.d.ts +0 -12
  91. package/dist/types/ui/InspectionProvider.d.ts +0 -29
  92. package/dist/types/ui/JourneyChart.d.ts +0 -10
  93. package/dist/types/ui/Kbd.d.ts +0 -7
  94. package/dist/types/ui/LineChart.d.ts +0 -7
  95. package/dist/types/ui/LiveControl.d.ts +0 -10
  96. package/dist/types/ui/Menu.d.ts +0 -13
  97. package/dist/types/ui/MetricWidget.d.ts +0 -51
  98. package/dist/types/ui/NumberField.d.ts +0 -27
  99. package/dist/types/ui/NumberFilterPicker.d.ts +0 -11
  100. package/dist/types/ui/PeriodSummary.d.ts +0 -17
  101. package/dist/types/ui/PickerField.d.ts +0 -23
  102. package/dist/types/ui/PieChart.d.ts +0 -11
  103. package/dist/types/ui/PopoverSurface.d.ts +0 -5
  104. package/dist/types/ui/PresentStory.d.ts +0 -30
  105. package/dist/types/ui/QueryList.d.ts +0 -14
  106. package/dist/types/ui/RadioGroup.d.ts +0 -18
  107. package/dist/types/ui/Ranking.d.ts +0 -13
  108. package/dist/types/ui/RefreshControl.d.ts +0 -9
  109. package/dist/types/ui/RequestHint.d.ts +0 -20
  110. package/dist/types/ui/RetentionChart.d.ts +0 -27
  111. package/dist/types/ui/ScatterChart.d.ts +0 -17
  112. package/dist/types/ui/SearchField.d.ts +0 -23
  113. package/dist/types/ui/SearchInput.d.ts +0 -10
  114. package/dist/types/ui/SearchMatch.d.ts +0 -6
  115. package/dist/types/ui/SearchTypeahead.d.ts +0 -15
  116. package/dist/types/ui/SectionHeading.d.ts +0 -8
  117. package/dist/types/ui/Select.d.ts +0 -22
  118. package/dist/types/ui/SelectionMark.d.ts +0 -5
  119. package/dist/types/ui/Sheet.d.ts +0 -21
  120. package/dist/types/ui/Skeleton.d.ts +0 -8
  121. package/dist/types/ui/Stack.d.ts +0 -7
  122. package/dist/types/ui/StaticDataApp.d.ts +0 -4
  123. package/dist/types/ui/StatusPanel.d.ts +0 -10
  124. package/dist/types/ui/TableWidget.d.ts +0 -67
  125. package/dist/types/ui/Tabs.d.ts +0 -10
  126. package/dist/types/ui/TextContent.d.ts +0 -4
  127. package/dist/types/ui/TextWidget.d.ts +0 -20
  128. package/dist/types/ui/ThemeSelector.d.ts +0 -12
  129. package/dist/types/ui/Toast.d.ts +0 -8
  130. package/dist/types/ui/Tooltip.d.ts +0 -23
  131. package/dist/types/ui/TooltipSurface.d.ts +0 -3
  132. package/dist/types/ui/TrendChart.d.ts +0 -5
  133. package/dist/types/ui/UpdatedAt.d.ts +0 -9
  134. package/dist/types/ui/VariableBar.d.ts +0 -6
  135. package/dist/types/ui/VisualizationWidget.d.ts +0 -43
  136. package/dist/types/ui/WidgetDisclosure.d.ts +0 -6
  137. package/dist/types/ui/WidgetEvidence.d.ts +0 -12
  138. package/dist/types/ui/WidgetViewTabs.d.ts +0 -16
  139. package/dist/types/ui/chart-data.d.ts +0 -36
  140. package/dist/types/ui/chart-date-axis.d.ts +0 -15
  141. package/dist/types/ui/chart-interaction.d.ts +0 -27
  142. package/dist/types/ui/chart-primitives.d.ts +0 -22
  143. package/dist/types/ui/chart-time.d.ts +0 -19
  144. package/dist/types/ui/chartColor.d.ts +0 -2
  145. package/dist/types/ui/classNames.d.ts +0 -1
  146. package/dist/types/ui/csv-export.d.ts +0 -19
  147. package/dist/types/ui/data-context.d.ts +0 -76
  148. package/dist/types/ui/data-identifiers.d.ts +0 -32
  149. package/dist/types/ui/icons.d.ts +0 -49
  150. package/dist/types/ui/journey-flow.d.ts +0 -49
  151. package/dist/types/ui/keyboard.d.ts +0 -6
  152. package/dist/types/ui/metric-comparison.d.ts +0 -30
  153. package/dist/types/ui/metric.d.ts +0 -11
  154. package/dist/types/ui/presentation.d.ts +0 -25
  155. package/dist/types/ui/search.d.ts +0 -6
  156. package/dist/types/ui/searchItems.d.ts +0 -36
  157. package/dist/types/ui/shortcuts.d.ts +0 -45
  158. package/dist/types/ui/story.d.ts +0 -20
  159. package/dist/types/ui/time-interval.d.ts +0 -96
  160. package/dist/types/ui/use-chart-scroll-to-end.d.ts +0 -2
  161. package/dist/types/ui/useAppAppearance.d.ts +0 -3
  162. package/dist/types/ui/useDataAppPresentation.d.ts +0 -3
  163. package/dist/types/ui/useSvgId.d.ts +0 -2
  164. package/dist/types/ui/variables.d.ts +0 -36
  165. package/dist/types/ui/widget-views.d.ts +0 -3
  166. package/dist/types/view-control-bar.d.ts +0 -18
  167. package/dist/types/view-controls.d.ts +0 -20
  168. package/dist/types/view-runtime.d.ts +0 -34
  169. package/dist/types/view.d.ts +0 -87
  170. package/dist/types/widgets.d.ts +0 -90
@@ -1,78 +1,745 @@
1
- /** Declared views, bound widgets, and layouts for data-app authoring. */
2
- export type { DatasetColumn, DatasetSuggestionOptions, DatasetDeclaration as DatasetDefinition, } from './bindings.js';
3
- export type { MetricRecords } from './bindings.js';
4
- export { injectDataAppStyles } from './styles.js';
5
- export type { DataAppStylesOptions } from './styles.js';
6
- export type { DataAppStyle, DataAppStyleToken, DataAppStyleHooks, } from './style-contract.js';
7
- export { mountDataApp } from './mount.js';
8
- export { createDataHooks } from './hooks.js';
9
- export { DetailView, DetailContent, useDetailNavigation } from './details.js';
10
- export type { DetailViewDefinition } from './details.js';
11
- export type { CsvCell } from './ui/csv-export.js';
12
- export { DataApp } from './ui/DataApp.js';
13
- export type { DataAppProps } from './ui/DataApp.js';
14
- export { Stack } from './ui/Stack.js';
15
- export type { StackProps } from './ui/Stack.js';
16
- export { Grid } from './ui/Grid.js';
17
- export type { GridProps } from './ui/Grid.js';
18
- export { GridItem } from './ui/GridItem.js';
19
- export type { GridItemProps } from './ui/GridItem.js';
20
- export type { WidgetEvidence } from './ui/WidgetEvidence.js';
21
- export { TextContent } from './ui/TextContent.js';
22
- export type { TextContentProps } from './ui/TextContent.js';
23
- export { DataValue } from './widgets.js';
24
- export type { DataValueProps } from './widgets.js';
25
- export { TextWidget } from './widgets.js';
26
- export type { TextWidgetProps } from './widgets.js';
27
- export { VisualizationWidget } from './widgets.js';
28
- export type { VisualizationWidgetProps } from './widgets.js';
29
- export type { VisualizationWidgetView } from './widgets.js';
30
- export { TableWidget } from './widgets.js';
31
- export type { TableWidgetProps } from './widgets.js';
32
- export type { TableWidgetSearch } from './ui/TableWidget.js';
33
- export { chartColor } from './ui/chartColor.js';
34
- export { Breakdown } from './ui/Breakdown.js';
35
- export type { BreakdownItem, BreakdownProps } from './ui/Breakdown.js';
36
- export { Ranking } from './ui/Ranking.js';
37
- export type { RankingItem, RankingProps } from './ui/Ranking.js';
38
- export { Comparison } from './ui/Comparison.js';
39
- export type { ComparisonProps } from './ui/Comparison.js';
40
- export { MetricWidget } from './widgets.js';
41
- export type { MetricWidgetProps } from './widgets.js';
42
- export { EmptyState } from './ui/EmptyState.js';
43
- export type { EmptyStateProps } from './ui/EmptyState.js';
44
- export { Skeleton } from './ui/Skeleton.js';
45
- export type { SkeletonProps } from './ui/Skeleton.js';
46
- export { DataSection } from './ui/DataSection.js';
47
- export type { DataSectionProps } from './ui/DataSection.js';
48
- export { UpdatedAt } from './ui/UpdatedAt.js';
49
- export type { UpdatedAtProps } from './ui/UpdatedAt.js';
50
- export { DateTimeTooltip } from './ui/DateTimeTooltip.js';
51
- export type { DateTimeTooltipProps } from './ui/DateTimeTooltip.js';
52
- export { searchVariable, choiceVariable, multiChoiceVariable, dateRangeVariable, } from './ui/variables.js';
53
- export type { AppVariable, VariablePresentation, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
54
- export { PeriodSummary } from './ui/PeriodSummary.js';
55
- export type { ReportingPeriod, PeriodComparison, PeriodSummaryProps, } from './ui/PeriodSummary.js';
56
- export { createDataContext } from './ui/data-context.js';
57
- export type { DataContext, GlossaryEntry } from './ui/data-context.js';
58
- export { defineDataIdentifiers } from './ui/data-identifiers.js';
59
- export type { DataIdentifierDefinition, TableIdentifier, ColumnIdentifier, } from './ui/data-identifiers.js';
60
- export { IconButton } from './ui/IconButton.js';
61
- export type { IconButtonProps } from './ui/IconButton.js';
62
- export { Tooltip, TooltipProvider } from './ui/Tooltip.js';
63
- export type { TooltipProps, TooltipProviderProps } from './ui/Tooltip.js';
64
- export { Button } from './ui/Button.js';
65
- export type { ButtonProps } from './ui/Button.js';
66
- export type { MetricDefinition } from './ui/metric.js';
67
- export type { MetricValues } from '@altertable/data-app/internal';
68
- export { AnnotationTarget } from './annotations/AnnotationTarget.js';
69
- export type { AnnotationTargetProps } from './annotations/AnnotationTarget.js';
70
- export { useDataAppAnnotations } from './annotations/useDataAppAnnotations.js';
71
- export { AnnotationBar } from './annotations/AnnotationBar.js';
72
- export type { AnnotationBarHandle, AnnotationBarProps, } from './annotations/AnnotationBar.js';
73
- export { injectDataAppAnnotationStyles } from './annotations/styles.js';
74
- export { SectionHeading } from './ui/SectionHeading.js';
75
- export type { SectionHeadingProps } from './ui/SectionHeading.js';
76
- export { DateDisplay } from './ui/DateDisplay.js';
77
- export type { DateDisplayProps } from './ui/DateDisplay.js';
78
- export { useDateFormatting } from './date-formatting.js';
1
+ import { $ as TableWidgetColumn, $t as defineDataIdentifiers, A as AppVariableValues, At as EmptyContent, B as dateRangeVariable, Bt as DataContext, C as MetricWidgetProps$1, Ct as CsvCell, D as DataAppControlProps, E as DataAppBaseProps, F as DateRangeVariableOptions, G as mountDataApp, Gt as StoryFinding, H as searchVariable, Ht as GlossaryEntry, I as MultiChoiceVariable, J as DataAppStyleToken, Jt as MetricDefinition, K as DataAppStyle, L as SearchVariable, M as ChoiceVariable, N as DateRangeSelection, P as DateRangeVariable, Qt as TableIdentifier, R as VariablePresentation, T as DataValueProps$1, Tt as CsvTable, Ut as createDataContext, V as multiChoiceVariable, Vt as EvidenceDeclaration, X as injectDataAppStyles, Xt as ColumnIdentifier, Y as DataAppStylesOptions, Yt as MetricComparison, Z as TableDisplayMode, Zt as DataIdentifierDefinition, _ as VisualizationWidgetView$1, a as SectionHeadingProps, c as TooltipProvider, d as AppIconName, en as Button, et as TableWidgetProps$1, g as VisualizationWidgetProps$1, i as SectionHeading, j as ChoiceOption, jt as WidgetEvidence, k as AppVariable, kt as ItemActions, l as TooltipProviderProps, m as HelpPopoverProps, n as DateDisplay, o as Tooltip, q as DataAppStyleHooks, r as DateDisplayProps, s as TooltipProps, t as useDateFormatting, tn as ButtonProps, tt as TableWidgetSearch, vt as SearchSuggestion, y as TextWidgetProps$1, z as choiceVariable, zt as AuthoringDataContext } from "./chunks/date-formatting.js";
2
+ import { DataClient, InputOf, OutputOf } from "@altertable/data-app/client";
3
+ import { AppVariableValues as AppVariableValues$1, CheckedFacetContexts, CheckedVariableDeclarations, ChoiceVariable as ChoiceVariable$1, DataReading, DataView, DateRangeVariable as DateRangeVariable$1, DimensionFilterSettings, DimensionValue, DisplayedSnapshot, FacetVariable, IsUnion, MetricReading, MetricValues, MetricValues as MetricValues$1, VariableCollection } from "@altertable/data-app/internal";
4
+ import { ComponentPropsWithRef, ReactNode, Ref, RefObject } from "react";
5
+ import { DateFormat, MetricFormat } from "@altertable/data-app/format";
6
+ import { DataAppAnnotationDraft, DataOperations, DateRangeRequest, DimensionOption, DisclosedQuery, ReportingPeriod, ReportingPeriod as ReportingPeriod$1 } from "@altertable/data-app/contract";
7
+ import { Theme } from "@altertable/data-app/appearance";
8
+ //#region src/view-runtime.d.ts
9
+ type ViewResult<Data, Input> = {
10
+ dataContext: DataContext;
11
+ timeZone?: string;
12
+ view: DataView<Data, Input>;
13
+ snapshot?: DisplayedSnapshot<Data, Input>;
14
+ refetch: () => unknown;
15
+ cancel: () => unknown;
16
+ refreshing: boolean;
17
+ queries?: DisclosedQuery[];
18
+ searchControls?: ReactNode;
19
+ filterControls?: ReactNode;
20
+ emptyFallback: EmptyContent;
21
+ };
22
+ /** The executor is private; declarations expose data composition, not subscription hooks. */
23
+ declare class DeclaredView<Data, Input, Definition = unknown> {
24
+ #private;
25
+ constructor(useResult: () => ViewResult<Data, Input>, definition?: Definition);
26
+ static definition<Data, Input, Definition>(view: DeclaredView<Data, Input, Definition>): Definition;
27
+ static useResult<View extends DeclaredView<unknown, unknown>>(view: View): DeclaredViewResult<View>;
28
+ }
29
+ /** Distribute across declarations so each result keeps its own data and input together. */
30
+ type DeclaredViewResult<View> = View extends DeclaredView<infer Data, infer Input> ? ViewResult<Data, Input> : never;
31
+ //#endregion
32
+ //#region src/details.d.ts
33
+ type DetailViewDefinition<Data, Input> = {
34
+ id: string;
35
+ title: ReactNode;
36
+ /** Validates untrusted navigation input before a detail operation can run. */
37
+ parseInput: (input: unknown) => Input;
38
+ describeInput: (input: Input) => string;
39
+ isEmpty: (data: Data) => boolean;
40
+ emptyFallback: EmptyContent;
41
+ };
42
+ /** A typed, query-backed destination. */
43
+ export declare class DetailView<Data, Input> {
44
+ #private;
45
+ readonly definition: DetailViewDefinition<Data, Input>;
46
+ readonly useResult: (input: Input) => ViewResult<Data, Input>;
47
+ constructor(definition: DetailViewDefinition<Data, Input>, useResult: (input: Input) => ViewResult<Data, Input>);
48
+ content(render: (source: ViewSource<Data, Input>) => ReactNode): DetailContent<Data, Input>;
49
+ static content<Data, Input>(target: DetailView<Data, Input>): DetailContent<Data, Input>;
50
+ }
51
+ /** A destination’s rendered body. Pass these to DataApp.details. */
52
+ export declare class DetailContent<Data, Input> {
53
+ readonly target: DetailView<Data, Input>;
54
+ readonly render: (source: ViewSource<Data, Input>) => ReactNode;
55
+ constructor(target: DetailView<Data, Input>, render: (source: ViewSource<Data, Input>) => ReactNode);
56
+ }
57
+ type DetailNavigation = {
58
+ open<Data, Input>(target: DetailView<Data, Input>, input: Input, trigger?: HTMLElement | SVGElement | null): void;
59
+ };
60
+ /** Resolve a detail target from an interaction. The destination validates input before fetching. */
61
+ export declare function useDetailNavigation(): DetailNavigation;
62
+ //#endregion
63
+ //#region src/view.d.ts
64
+ type ResolvedVariable<Variable> = Variable extends DateRangeVariable$1 ? DateRangeRequest : AppVariableValues$1<{
65
+ value: Variable;
66
+ }>['value'];
67
+ type ResolvedVariables<Variables extends VariableCollection> = { [Key in keyof Variables]: ResolvedVariable<Variables[Key]> | (string extends keyof Variables ? undefined : never); };
68
+ type DateVariableKey<Variables extends VariableCollection> = { [Key in keyof Variables]: Variables[Key] extends DateRangeVariable$1 ? Key : never; }[keyof Variables] & string;
69
+ type ViewDate<Variables extends VariableCollection, Input> = {
70
+ variable: DateVariableKey<Variables>;
71
+ /** Extract the selected range and comparison unchanged, including from nested inputs. */
72
+ input: (input: Input) => DateRangeRequest;
73
+ };
74
+ /** Read variable values from a custom operation input; omitted keys use top-level fields. */
75
+ type ViewBindings<Variables extends VariableCollection, Input> = Partial<{ [Key in keyof Variables]: (input: Input) => ResolvedVariables<Variables>[Key]; }>;
76
+ type RequiredFilterBindingKeys<Variables extends VariableCollection, Input> = { [Key in keyof Variables]: Variables[Key]['kind'] extends 'dateRange' ? never : Variables[Key]['kind'] extends 'choice' ? [Input] extends [Record<Key, unknown>] ? ResolvedVariables<Variables>[Key] extends Input[Key] ? never : Key : Key : Extract<Variables[Key]['presentation'], {
77
+ group: 'display';
78
+ }> extends never ? [Input] extends [Record<Key, ResolvedVariables<Variables>[Key]>] ? [ResolvedVariables<Variables>[Key]] extends [Input[Key]] ? never : Key : Key : never; }[keyof Variables];
79
+ /** Derive compatible top-level filter bindings; require readers for other input shapes. */
80
+ type ViewBindingOptions<Variables extends VariableCollection, Input, AdditionalRequired extends keyof Variables = never> = [RequiredFilterBindingKeys<Variables, Input> | AdditionalRequired] extends [never] ? {
81
+ bindings?: ViewBindings<Variables, Input>;
82
+ } : {
83
+ bindings: ViewBindings<Variables, Input> & { [Key in RequiredFilterBindingKeys<Variables, Input> | AdditionalRequired]-?: (input: Input) => ResolvedVariables<Variables>[Key]; };
84
+ };
85
+ type SameViewInput<Variables extends VariableCollection, Input> = [ResolvedVariables<Variables>] extends [Input] ? [Input] extends [{ [Key in keyof Variables]: Variables[Key]['kind'] extends 'choice' ? string : ResolvedVariables<Variables>[Key]; }] ? [Input] extends [Record<string, never>] ? true : [keyof Input] extends [keyof Variables] ? true : false : false : false;
86
+ type ViewInputMapping<Variables extends VariableCollection, Input> = SameViewInput<Variables, Input> extends true ? {
87
+ input?: (values: ResolvedVariables<Variables>) => Input;
88
+ } : {
89
+ input: (values: ResolvedVariables<Variables>) => Input;
90
+ };
91
+ type DataViewDefinition<Name extends string, Variables extends VariableCollection, Input, Data> = {
92
+ operation: Name;
93
+ dataContext: DataContext;
94
+ /** App-owned semantics: measured zero need not mean an empty result. */
95
+ isEmpty: (data: Data) => boolean;
96
+ /** Inherited by DataSection unless it supplies its own copy. */
97
+ emptyFallback: EmptyContent;
98
+ } & (keyof Variables extends never ? {
99
+ variables?: Variables & CheckedFacetContexts<NoInfer<Variables>>;
100
+ } : {
101
+ variables: Variables & CheckedFacetContexts<NoInfer<Variables>>;
102
+ }) & ViewInputMapping<NoInfer<Variables>, Input> & ViewBindingOptions<NoInfer<Variables>, Input> & ({
103
+ date: ViewDate<Variables, Input>;
104
+ describeInput?: (input: Input) => string;
105
+ } | {
106
+ date?: never;
107
+ describeInput: (input: Input) => string;
108
+ });
109
+ type ResolvedDataViewDefinition<Name extends string, Variables extends VariableCollection, Input, Data> = Omit<DataViewDefinition<Name, Variables, Input, Data>, 'variables' | 'input'> & {
110
+ variables: Variables;
111
+ input: (values: ResolvedVariables<Variables>) => Input;
112
+ };
113
+ //#endregion
114
+ //#region src/exploration.d.ts
115
+ declare const filterPatch: unique symbol;
116
+ declare const breakdownValue: unique symbol;
117
+ declare class FilterTarget<Patch> {
118
+ readonly [filterPatch]: Patch;
119
+ }
120
+ declare class BreakdownTarget<Value extends string> {
121
+ readonly [breakdownValue]: Value;
122
+ }
123
+ type FilterPatch<Variables extends VariableCollection> = Partial<{ [Key in keyof Variables]: Extract<Variables[Key]['presentation'], {
124
+ group: 'display';
125
+ }> extends never ? AppVariableValues$1<Variables>[Key] : never; }>;
126
+ //#endregion
127
+ //#region src/actions.d.ts
128
+ type ActionCondition<Row> = {
129
+ label: string;
130
+ when?: (row: Row) => boolean;
131
+ };
132
+ type DetailAction<Row, Input, DestinationInput> = ActionCondition<Row> & {
133
+ label: string;
134
+ target: DetailView<any, DestinationInput>;
135
+ input: (row: Row, displayedInput: Input) => DestinationInput;
136
+ };
137
+ type ActionDeclaration<Row, Input> = ActionCondition<Row> & ({
138
+ kind: 'detail';
139
+ target: DetailView<any, any>;
140
+ input: (row: Row, input: Input) => unknown;
141
+ } | {
142
+ kind: 'filter';
143
+ target: object;
144
+ values: (row: Row) => object;
145
+ breakdown?: {
146
+ target: BreakdownTarget<any>;
147
+ value: (row: Row) => string;
148
+ };
149
+ });
150
+ declare class ActionBuilder<Row, Input> {
151
+ detail<DestinationInput>(config: DetailAction<Row, Input, DestinationInput>): ActionDeclaration<Row, Input>;
152
+ filter<Patch extends object, const Values extends NoInfer<Patch>, Value extends string = never>(config: ActionCondition<Row> & {
153
+ label: string;
154
+ target: FilterTarget<Patch>;
155
+ values: (row: Row) => Values & NoInfer<Patch>;
156
+ breakdown?: {
157
+ target: BreakdownTarget<Value>;
158
+ value: (row: Row) => NoInfer<Value>;
159
+ };
160
+ }): ActionDeclaration<Row, Input>;
161
+ }
162
+ declare const actionTypes: unique symbol;
163
+ /** Actions belong to one metric or dataset; its widget supplies displayed rows and input. */
164
+ declare class ExplorationActions<Row, Input> {
165
+ readonly [actionTypes]: {
166
+ row: Row;
167
+ input: Input;
168
+ };
169
+ }
170
+ //#endregion
171
+ //#region src/bindings.d.ts
172
+ /** Displayed data, or an initial loading reading. Pending filter values are never a source. */
173
+ type ViewSource<Data, Input> = {
174
+ loading: true;
175
+ } | {
176
+ loading?: false;
177
+ data: Data;
178
+ input: Input;
179
+ };
180
+ type SourceReading<Source, Value> = Source extends {
181
+ loading: true;
182
+ } ? {
183
+ loading: true;
184
+ } : {
185
+ loading: false;
186
+ value: Value;
187
+ };
188
+ /** Keys supply IDs; accessors supply raw CSV values. Formats affect display only. */
189
+ type DatasetColumn<Row> = {
190
+ label?: string;
191
+ } & ({
192
+ value: (row: Row) => CsvCell;
193
+ format?: (row: Row) => ReactNode;
194
+ } | {
195
+ value: (row: Row) => number | null | undefined;
196
+ format: MetricFormat;
197
+ } | {
198
+ value: (row: Row) => string | number | null | undefined;
199
+ format: Extract<DateFormat, {
200
+ kind: 'dateTime';
201
+ }>;
202
+ } | {
203
+ value: (row: Row) => string | null | undefined;
204
+ format: Extract<DateFormat, {
205
+ kind: 'date';
206
+ }>;
207
+ });
208
+ type DatasetDefinition<Data, Input, Row, Evidence = WidgetEvidence> = {
209
+ name: string;
210
+ select: (data: Data, input: Input) => readonly Row[];
211
+ columns: Record<string, DatasetColumn<NoInfer<Row>>>;
212
+ rowKey: (row: NoInfer<Row>) => string | number;
213
+ evidence: Evidence;
214
+ emptyFallback?: EmptyContent;
215
+ /** Declare for records whose titles are useful query completions; omit for aggregate rows. */
216
+ suggestions?: DatasetSuggestionOptions<Row>;
217
+ };
218
+ type DatasetSuggestionOptions<Row> = {
219
+ title: (row: Row) => string;
220
+ description?: (row: Row) => string;
221
+ /** Override query completion with an app action. */
222
+ onSelect?: (row: Row) => void;
223
+ };
224
+ /** Authoring references are registered by the owning view. */
225
+ type DatasetDeclaration<Data, Input, Row> = DatasetDefinition<Data, Input, Row, EvidenceDeclaration>;
226
+ /** Real view ownership and registered references, shared by metrics and datasets. */
227
+ declare class RegisteredBinding {
228
+ #private;
229
+ constructor(owner?: object, evidence?: WidgetEvidence);
230
+ /** @internal */
231
+ static owner(binding: RegisteredBinding): object | undefined;
232
+ protected assertSource(source: object): void;
233
+ static evidence(binding: RegisteredBinding, owner: object): WidgetEvidence;
234
+ }
235
+ declare class ExportDataset<Data, Input> extends RegisteredBinding {
236
+ #private;
237
+ readonly name: string;
238
+ /** @internal Undefined means this dataset declares no record suggestions. */
239
+ readSearchSuggestions(_source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
240
+ constructor(name: string, csv: (snapshot: DisplayedSnapshot<Data, Input>) => CsvTable, owner?: object, evidence?: WidgetEvidence);
241
+ static csv<Data, Input>(dataset: ExportDataset<Data, Input>, snapshot: DisplayedSnapshot<Data, Input>): CsvTable;
242
+ }
243
+ declare class Dataset<Data, Input, Row> extends ExportDataset<Data, Input> {
244
+ #private;
245
+ readonly evidence: WidgetEvidence;
246
+ constructor(definition: DatasetDefinition<Data, Input, Row>, owner?: object, timeZone?: string);
247
+ actions<const Actions extends Record<string, ActionDeclaration<Row, Input>>>(build: (action: ActionBuilder<Row, Input>) => Actions, options?: {
248
+ primary?: keyof Actions & string;
249
+ }): ExplorationActions<Row, Input>;
250
+ readSearchSuggestions(source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
251
+ read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, readonly Row[]>;
252
+ static table<Data, Input, Row>(dataset: Dataset<Data, Input, Row>, source: ViewSource<Data, Input>): {
253
+ title: string;
254
+ columns: [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
255
+ rowKey: (row: Row) => string | number;
256
+ evidence: WidgetEvidence;
257
+ emptyFallback: EmptyContent;
258
+ reading: {
259
+ loading: true;
260
+ } | {
261
+ loading: false;
262
+ value: readonly Row[];
263
+ };
264
+ };
265
+ }
266
+ declare class Metric<Data, Input> extends RegisteredBinding {
267
+ #private;
268
+ readonly definition: MetricDefinition;
269
+ constructor(definition: MetricDefinition, select: (data: Data, input: Input) => MetricValues$1, date?: (input: Input) => DateRangeRequest, owner?: object);
270
+ read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, MetricValues$1 & {
271
+ period?: DateRangeRequest;
272
+ }>;
273
+ records<DetailData, DetailInput>(options: {
274
+ target: DetailView<DetailData, DetailInput>;
275
+ input: (displayedInput: Input) => DetailInput;
276
+ }): MetricRecords<Data, Input, DetailData, DetailInput>;
277
+ actions<const Actions extends Record<string, ActionDeclaration<void, Input>>>(build: (action: ActionBuilder<void, Input>) => Actions, options?: {
278
+ primary?: keyof Actions & string;
279
+ }): ExplorationActions<void, Input>;
280
+ }
281
+ /** A metric-owned record destination. It can only render from that metric's displayed source. */
282
+ declare class MetricRecords<Data, Input, DetailData, DetailInput> {
283
+ #private;
284
+ constructor(metric: Metric<Data, Input>, target: DetailView<DetailData, DetailInput>, input: (displayedInput: Input) => DetailInput);
285
+ render(source: ViewSource<Data, Input>, navigation?: DetailNavigation): {
286
+ scope: string;
287
+ content: import("react").FunctionComponentElement<{
288
+ content: DetailContent<any, any>;
289
+ input: any;
290
+ navigation?: DetailNavigation;
291
+ }>;
292
+ } | undefined;
293
+ static render<Data, Input, DetailData, DetailInput>(records: MetricRecords<Data, Input, DetailData, DetailInput>, metric: Metric<Data, Input>, source: ViewSource<Data, Input>, navigation?: DetailNavigation): {
294
+ scope: string;
295
+ content: import("react").FunctionComponentElement<{
296
+ content: DetailContent<any, any>;
297
+ input: any;
298
+ navigation?: DetailNavigation;
299
+ }>;
300
+ } | undefined;
301
+ }
302
+ //#endregion
303
+ //#region src/content.d.ts
304
+ type DataContentState<Data, Input> = {
305
+ scope: DataReading<string>;
306
+ } & ({
307
+ loading: true;
308
+ data?: never;
309
+ input?: never;
310
+ } | {
311
+ loading: false;
312
+ data: Data;
313
+ input: Input;
314
+ });
315
+ /** A section's request owner and render layout are declared together. */
316
+ declare class ViewContent<Data, Input> {
317
+ #private;
318
+ constructor(view: DeclaredView<Data, Input>, render: (source: DataContentState<Data, Input>) => ReactNode, describeInput: (input: Input) => string);
319
+ static section<Data, Input>(content: ViewContent<Data, Input>): {
320
+ loadingFallback: ReactNode;
321
+ children(this: void, data: Data, input: Input): ReactNode;
322
+ view: DeclaredView<Data, Input, unknown>;
323
+ };
324
+ }
325
+ //#endregion
326
+ //#region src/hooks.d.ts
327
+ type TimeVariables<Additional extends VariableCollection> = {
328
+ period: ReturnType<typeof dateRangeVariable>;
329
+ } & Additional;
330
+ type TimeInput<Additional extends VariableCollection> = keyof Additional extends never ? DateRangeRequest : ResolvedVariables<TimeVariables<Additional>>;
331
+ type TimeInputMapping<Additional extends VariableCollection, Input> = TimeInput<Additional> extends Input ? {
332
+ input?: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
333
+ } : {
334
+ input: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
335
+ };
336
+ /** Match the period reader's precedence for each possible operation input. */
337
+ type RequiredPeriodBinding<Input> = Input extends unknown ? 'period' extends keyof Input ? Input extends {
338
+ period: DateRangeRequest;
339
+ } ? never : 'period' : Input extends DateRangeRequest ? never : 'period' : never;
340
+ type NonEmptyColumns<Columns extends object> = keyof Columns extends never ? never : Columns;
341
+ type BoundDataView<Name extends string, Variables extends VariableCollection, Input, Data, Context extends AuthoringDataContext, HasDate extends boolean> = DeclaredView<Data, Input, ResolvedDataViewDefinition<Name, Variables, Input, Data> & {
342
+ describeInput: (input: Input) => string;
343
+ }> & {
344
+ filter(): FilterTarget<FilterPatch<Variables>>;
345
+ breakdown<Key extends keyof Variables & string>(key: Key & (Variables[Key] extends ChoiceVariable$1<any> ? Extract<Variables[Key]['presentation'], {
346
+ group: 'display';
347
+ }> extends never ? never : unknown : never)): Variables[Key] extends ChoiceVariable$1<infer Value> ? BreakdownTarget<Value> : never;
348
+ dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
349
+ columns: Columns & NonEmptyColumns<Columns>;
350
+ }): Dataset<Data, Input, Row>;
351
+ metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => HasDate extends true ? MetricValues$1 : {
352
+ current: number;
353
+ previous?: never;
354
+ }): Metric<Data, Input>;
355
+ scope(snapshot: DisplayedSnapshot<Data, Input>): string;
356
+ content(render: (state: DataContentState<Data, Input>) => ReactNode): ViewContent<Data, Input>;
357
+ };
358
+ type FacetOperationName<Operations extends DataOperations, Value extends DimensionValue> = { [Name in keyof Operations & string]: OutputOf<Operations[Name]> extends readonly DimensionOption<Value>[] ? Name : never; }[keyof Operations & string];
359
+ type FacetConfig<Operations extends DataOperations, Value extends DimensionValue, Context extends VariableCollection, Name extends keyof Operations & string> = DimensionFilterSettings<Value> & {
360
+ facet: {
361
+ context: Context & CheckedVariableDeclarations<NoInfer<Context>> & (string extends keyof Context ? never : unknown);
362
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
363
+ input: (values: ResolvedVariables<NoInfer<Context>>) => InputOf<Operations[NoInfer<Name>]>;
364
+ };
365
+ };
366
+ type CheckedFacetSources<Operations extends DataOperations, Variables extends VariableCollection> = CheckedVariableDeclarations<Variables> & { [Key in keyof Variables]: Variables[Key] extends FacetVariable<infer Value, infer _Context, infer Name, infer Input> ? Name extends keyof Operations ? Input extends InputOf<Operations[Name]> ? OutputOf<Operations[Name]> extends readonly DimensionOption<Value>[] ? Variables[Key] : never : never : never : Variables[Key]; };
367
+ type BoundDetailView<Data, Input, Context extends AuthoringDataContext> = DetailView<Data, Input> & {
368
+ dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
369
+ columns: Columns & NonEmptyColumns<Columns>;
370
+ }): Dataset<Data, Input, Row>;
371
+ metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => {
372
+ current: number;
373
+ previous?: never;
374
+ }): Metric<Data, Input>;
375
+ };
376
+ /** Bind declared operations to URL variables, displayed readings, and request feedback. */
377
+ export declare function createDataHooks<Operations extends DataOperations>(client: DataClient<Operations>): {
378
+ defineDataView: {
379
+ <Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
380
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
381
+ variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
382
+ } & {
383
+ dataContext: Context;
384
+ date: ViewDate<Variables, InputOf<Operations[Name]>>;
385
+ }): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
386
+ <Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
387
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
388
+ variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
389
+ } & {
390
+ dataContext: Context;
391
+ }): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, false>;
392
+ };
393
+ defineDetailView: <Name extends keyof Operations & string, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DetailViewDefinition<OutputOf<Operations[Name]>, InputOf<Operations[Name]>> & {
394
+ operation: Name;
395
+ dataContext: Context;
396
+ }) => BoundDetailView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Context>;
397
+ defineTimeView: <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: {
398
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
399
+ dataContext: Context;
400
+ time: Omit<DateRangeVariableOptions, 'key'>;
401
+ variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
402
+ period?: never;
403
+ } & Omit<CheckedFacetContexts<TimeVariables<NoInfer<Additional>>>, 'period'> & Omit<CheckedFacetSources<Operations, TimeVariables<NoInfer<Additional>>>, 'period'>;
404
+ isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
405
+ emptyFallback: EmptyContent;
406
+ } & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>) => BoundDataView<Name, {
407
+ period: DateRangeVariable;
408
+ } & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
409
+ defineFacetFilter: {
410
+ <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, string>>(config: FacetConfig<Operations, string, Context, Name>): FacetVariable<string, Readonly<Context>, Name, InputOf<Operations[Name]>>;
411
+ <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, number>>(config: FacetConfig<Operations, number, Context, Name>): FacetVariable<number, Readonly<Context>, Name, InputOf<Operations[Name]>>;
412
+ };
413
+ };
414
+ //#endregion
415
+ //#region src/ui/DataApp.d.ts
416
+ type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'> & DataAppControlProps & {
417
+ view: DeclaredView<Data, Input> & {
418
+ scope(snapshot: DisplayedSnapshot<Data, Input>): string;
419
+ };
420
+ /** Show supplied datasets’ record suggestions on the first declared search. Defaults to true. */
421
+ showSearchSuggestions?: boolean;
422
+ story: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
423
+ evidence: RegisteredBinding;
424
+ })[];
425
+ datasets: readonly [ExportDataset<Data, Input>, ...ExportDataset<Data, Input>[]];
426
+ /** Detail destinations available to dataset actions and metric record inspection. */
427
+ details?: readonly DetailContent<any, any>[];
428
+ };
429
+ /** Executes the primary view and owns its controls, inspection, exports, and stories. */
430
+ export declare function DataApp<Data, Input>(props: DataAppProps<Data, Input>): import("react").JSX.Element;
431
+ //#endregion
432
+ //#region src/ui/Stack.d.ts
433
+ type StackProps = {
434
+ children: ReactNode;
435
+ gap?: 'sm' | 'md' | 'lg';
436
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
437
+ /** Vertical layout for peer sections or request boundaries, with the page's section gap. */
438
+ export declare function Stack({ children, gap, className, ...props }: StackProps): import("react").JSX.Element;
439
+ //#endregion
440
+ //#region src/ui/Grid.d.ts
441
+ type GridProps = {
442
+ children: ReactNode;
443
+ /** Maximum columns; cards wrap sooner when the container cannot fit their minimum width. */
444
+ columns?: 1 | 2 | 3 | 4;
445
+ minItemWidth?: 'compact' | 'regular' | 'wide';
446
+ gap?: 'sm' | 'md' | 'lg';
447
+ /** `stretch` gives widgets in each row the same height. */
448
+ align?: 'stretch' | 'start';
449
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
450
+ /** Responsive layout for peer cards and panels. Cards keep their content height by default. */
451
+ export declare function Grid({ children, columns, minItemWidth, gap, align, className, ...props }: GridProps): import("react").JSX.Element;
452
+ //#endregion
453
+ //#region src/ui/GridItem.d.ts
454
+ type GridItemProps = {
455
+ children: ReactNode;
456
+ /** Maximum tracks occupied; collapses to one when the grid container is narrow. */
457
+ span?: 1 | 2;
458
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
459
+ export declare function GridItem({ children, span, className, ...props }: GridItemProps): import("react").JSX.Element;
460
+ //#endregion
461
+ //#region src/ui/TextContent.d.ts
462
+ type TextContentProps = ComponentPropsWithRef<'div'>;
463
+ /** Prose typography for page introductions, widget bodies, and inspection content. */
464
+ export declare function TextContent({ className, ...props }: TextContentProps): import("react").JSX.Element;
465
+ //#endregion
466
+ //#region src/widgets.d.ts
467
+ type MetricWidgetProps<Data = unknown, Input = unknown> = Omit<Extract<MetricWidgetProps$1, {
468
+ metric: MetricDefinition;
469
+ }>, 'metric' | 'reading' | 'records'> & {
470
+ metric: Metric<Data, Input>;
471
+ source: ViewSource<NoInfer<Data>, NoInfer<Input>>;
472
+ records?: MetricRecords<Data, Input, any, any>;
473
+ actions?: ExplorationActions<void, NoInfer<Input>>;
474
+ };
475
+ export declare function MetricWidget<Data, Input>({ metric, source, records, actions, action, ...presentation }: MetricWidgetProps<Data, Input>): import("react").JSX.Element;
476
+ type BoundTableProps<Row> = Extract<TableWidgetProps$1<Row>, {
477
+ reading: DataReading<readonly Row[]>;
478
+ }>;
479
+ type TablePresentation<Row> = Pick<BoundTableProps<Row>, 'title' | 'columns' | 'rowKey' | 'reading' | 'evidence' | 'emptyFallback'>;
480
+ type TableWidgetProps<Row, Data = unknown, Input = unknown> = Omit<BoundTableProps<Row>, keyof TablePresentation<Row> | 'limit' | 'pagination'> & TableDisplayMode & {
481
+ dataset: Dataset<Data, Input, Row>;
482
+ source: ViewSource<NoInfer<Data>, NoInfer<Input>>;
483
+ title?: ReactNode;
484
+ actions?: ExplorationActions<NoInfer<Row>, NoInfer<Input>>;
485
+ };
486
+ export declare function TableWidget<Row, Data, Input>({ dataset, source, title, actions, ...presentation }: TableWidgetProps<Row, Data, Input>): import("react").JSX.Element;
487
+ type BoundVisual<Row> = Extract<VisualizationWidgetProps$1<readonly Row[]>, {
488
+ reading: DataReading<readonly Row[]>;
489
+ }>;
490
+ type VisualizationWidgetView<Row> = Omit<VisualizationWidgetView$1<readonly Row[]>, 'render'> & {
491
+ render: (rows: readonly Row[], actions: ItemActions<Row>) => ReactNode;
492
+ };
493
+ type VisualContent<Row> = {
494
+ children: (rows: readonly Row[], actions: ItemActions<Row>) => ReactNode;
495
+ views?: never;
496
+ viewLabel?: never;
497
+ initialView?: never;
498
+ } | {
499
+ children?: never;
500
+ views: readonly VisualizationWidgetView<Row>[];
501
+ viewLabel: string;
502
+ initialView?: string;
503
+ };
504
+ type VisualizationWidgetProps<Row, Data = unknown, Input = unknown> = Omit<BoundVisual<Row>, 'reading' | 'isEmpty' | 'emptyFallback' | 'evidence' | 'title' | 'children' | 'views' | 'viewLabel' | 'initialView'> & VisualContent<Row> & {
505
+ dataset: Dataset<Data, Input, Row>;
506
+ source: ViewSource<NoInfer<Data>, NoInfer<Input>>;
507
+ title?: ReactNode;
508
+ actions?: ExplorationActions<NoInfer<Row>, NoInfer<Input>>;
509
+ breakdown?: BreakdownTarget<any>;
510
+ };
511
+ export declare function VisualizationWidget<Row, Data, Input>({ dataset, source, title, actions, breakdown, children, views, viewLabel, initialView, ...presentation }: VisualizationWidgetProps<Row, Data, Input>): import("react").JSX.Element;
512
+ type NarrativeBinding<Data, Input, Row> = {
513
+ metric: Metric<Data, Input>;
514
+ dataset?: never;
515
+ source: ViewSource<NoInfer<Data>, NoInfer<Input>>;
516
+ children?: (values: MetricValues$1) => ReactNode;
517
+ } | {
518
+ metric?: never;
519
+ dataset: Dataset<Data, Input, Row>;
520
+ source: ViewSource<NoInfer<Data>, NoInfer<Input>>;
521
+ children: (rows: readonly Row[]) => ReactNode;
522
+ };
523
+ type TextWidgetProps<Data = unknown, Input = unknown, Row = never> = Omit<Extract<TextWidgetProps$1<unknown>, {
524
+ reading: DataReading<unknown>;
525
+ }>, 'reading' | 'evidence' | 'children' | 'title' | 'emptyFallback'> & NarrativeBinding<Data, Input, Row> & {
526
+ title?: ReactNode;
527
+ };
528
+ export declare function TextWidget<Data, Input, Row>(props: TextWidgetProps<Data, Input, Row>): import("react").JSX.Element;
529
+ type InlinePresentation = Omit<DataValueProps$1<unknown>, 'reading' | 'children' | 'loadingFallback'> & {
530
+ loadingFallback?: ReactNode;
531
+ };
532
+ type DataValueProps<Data = unknown, Input = unknown, Row = never> = InlinePresentation & ((NarrativeBinding<Data, Input, Row> & {
533
+ scope?: never;
534
+ }) | {
535
+ metric?: never;
536
+ dataset?: never;
537
+ source?: never;
538
+ scope: DataReading<string>;
539
+ children?: (scope: string) => ReactNode;
540
+ });
541
+ export declare function DataValue<Data, Input, Row>(props: DataValueProps<Data, Input, Row>): import("react").JSX.Element;
542
+ //#endregion
543
+ //#region src/ui/chartColor.d.ts
544
+ export declare function chartColor(id: string): string;
545
+ //#endregion
546
+ //#region src/ui/Breakdown.d.ts
547
+ type BreakdownItem = {
548
+ id: string;
549
+ label: ReactNode;
550
+ value: number;
551
+ };
552
+ type BreakdownProps = {
553
+ total: number;
554
+ items: readonly BreakdownItem[];
555
+ formatValue?: (value: number) => ReactNode;
556
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
557
+ /** Mutually exclusive parts of one observed whole. Every share uses the supplied total. */
558
+ export declare function Breakdown({ total, items, formatValue, className, ...props }: BreakdownProps): import("react").JSX.Element;
559
+ //#endregion
560
+ //#region src/ui/Ranking.d.ts
561
+ type RankingItem = {
562
+ id: string;
563
+ label: ReactNode;
564
+ value: number;
565
+ detail?: ReactNode;
566
+ };
567
+ type RankingProps = {
568
+ items: readonly RankingItem[];
569
+ formatValue?: (value: number) => ReactNode;
570
+ } & Omit<ComponentPropsWithRef<'ol'>, 'children'>;
571
+ /** Ordered values scaled to the largest visible item, not shares of a whole. */
572
+ export declare function Ranking({ items, formatValue, className, ...props }: RankingProps): import("react").JSX.Element;
573
+ //#endregion
574
+ //#region src/ui/Comparison.d.ts
575
+ type UnboundComparisonProps = MetricComparison & {
576
+ label: string;
577
+ emphasis?: 'standard' | 'story';
578
+ };
579
+ type ComparisonProps = UnboundComparisonProps | {
580
+ metric: MetricDefinition;
581
+ reading: MetricReading;
582
+ emphasis?: 'standard' | 'story';
583
+ };
584
+ export declare function Comparison(props: ComparisonProps): import("react").JSX.Element | null;
585
+ //#endregion
586
+ //#region src/ui/EmptyState.d.ts
587
+ type EmptyStateProps = EmptyContent & {
588
+ variant?: 'visual' | 'table';
589
+ className?: string;
590
+ };
591
+ export declare function EmptyState({ title, description, action, variant, className }: EmptyStateProps): import("react").JSX.Element;
592
+ //#endregion
593
+ //#region src/ui/Skeleton.d.ts
594
+ type SkeletonProps = Omit<ComponentPropsWithRef<'span'>, 'children' | 'aria-hidden'> & {
595
+ /** Align a text-sized placeholder with surrounding prose. */
596
+ inline?: boolean;
597
+ };
598
+ /** Decorative loading placeholder that fades in only when loading takes a moment.
599
+ * Put the accessible status on its container. */
600
+ export declare function Skeleton({ inline, className, ...props }: SkeletonProps): import("react").JSX.Element;
601
+ //#endregion
602
+ //#region src/ui/DataSection.d.ts
603
+ type DataSectionProps<Data, Input = unknown> = {
604
+ content: ViewContent<Data, Input>;
605
+ emptyFallback?: EmptyContent;
606
+ error?: {
607
+ title: ReactNode;
608
+ description?: ReactNode;
609
+ onRetry?: () => void;
610
+ };
611
+ label?: string;
612
+ } & Omit<ComponentPropsWithRef<'div'>, 'children' | 'content'>;
613
+ export declare function DataSection<Data, Input>({ content, ...presentation }: DataSectionProps<Data, Input>): import("react").JSX.Element;
614
+ //#endregion
615
+ //#region src/ui/DateTimeTooltip.d.ts
616
+ type DateTimeTooltipProps = {
617
+ date: Date;
618
+ timeZone?: string;
619
+ locale?: string;
620
+ children?: ReactNode;
621
+ } & Omit<HelpPopoverProps, 'trigger' | 'triggerLabel' | 'label' | 'children'>;
622
+ /** Exact-time disclosure uses the same reporting zone and locale as other date displays. */
623
+ export declare function DateTimeTooltip({ date, timeZone, locale, children, panelProps, ...props }: DateTimeTooltipProps): import("react").JSX.Element;
624
+ //#endregion
625
+ //#region src/ui/UpdatedAt.d.ts
626
+ type UpdatedAtProps = {
627
+ timestamp: number;
628
+ locale?: string;
629
+ label?: string;
630
+ children?: ReactNode;
631
+ } & Omit<DateTimeTooltipProps, 'date' | 'children'>;
632
+ export declare function UpdatedAt({ timestamp, locale, label, children, triggerProps, ...props }: UpdatedAtProps): import("react").JSX.Element;
633
+ //#endregion
634
+ //#region src/ui/PeriodSummary.d.ts
635
+ type PeriodComparison = {
636
+ kind: 'previous';
637
+ } | {
638
+ kind: 'period';
639
+ period: ReportingPeriod$1;
640
+ };
641
+ type PeriodSummaryProps = {
642
+ period: ReportingPeriod$1;
643
+ comparison?: PeriodComparison;
644
+ className?: string;
645
+ };
646
+ /** Read-only period context for the variable bar, including exact bounds for assistive technology. */
647
+ export declare function PeriodSummary({ period, comparison, className }: PeriodSummaryProps): import("react").JSX.Element;
648
+ //#endregion
649
+ //#region src/ui/shortcuts.d.ts
650
+ /**
651
+ * `alt` is Alt/Option, leaving character keys and browser refresh untouched; `mod` is ⌘ on Apple
652
+ * platforms and Ctrl elsewhere.
653
+ */
654
+ type Shortcut = {
655
+ modifier: 'alt' | 'mod';
656
+ shift?: boolean;
657
+ code: string;
658
+ key: string;
659
+ };
660
+ //#endregion
661
+ //#region src/ui/IconButton.d.ts
662
+ type IconButtonProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'aria-label'> & {
663
+ icon: AppIconName;
664
+ label: string;
665
+ variant?: ButtonProps['variant'];
666
+ shortcut?: Shortcut | {
667
+ label: string;
668
+ aria: string;
669
+ };
670
+ tooltip?: ReactNode;
671
+ portalRoot?: RefObject<HTMLElement | null>;
672
+ tooltipPlacement?: 'top' | 'bottom';
673
+ tooltipAlign?: 'start' | 'center' | 'end';
674
+ children?: ReactNode;
675
+ };
676
+ export declare function IconButton({ icon, label, variant, shortcut, tooltip, portalRoot, tooltipPlacement, tooltipAlign, children, type, ...props }: IconButtonProps): import("react").JSX.Element;
677
+ //#endregion
678
+ //#region src/annotations/AnnotationTarget.d.ts
679
+ type AnnotationTargetProps = ComponentPropsWithRef<'div'> & {
680
+ annotationId: string;
681
+ label: string;
682
+ evidence?: WidgetEvidence;
683
+ };
684
+ /** A stable feedback target for app-owned content outside the built-in widgets. */
685
+ export declare function AnnotationTarget({ annotationId, label, evidence, ...props }: AnnotationTargetProps): import("react").JSX.Element;
686
+ //#endregion
687
+ //#region src/annotations/useDataAppAnnotations.d.ts
688
+ /** Bind annotation delivery to this app's current iframe bridge. The host owns storage and submission. */
689
+ export declare function useDataAppAnnotations(): {
690
+ requestSendAnnotations(options?: {
691
+ signal?: AbortSignal;
692
+ }): Promise<null>;
693
+ reportAnnotationEditorState(state: {
694
+ hasUnsavedChanges: boolean;
695
+ }, options?: {
696
+ signal?: AbortSignal;
697
+ }): Promise<null>;
698
+ addAnnotation(draft: import("@altertable/data-app/contract").DataAppAnnotationDraft, options?: {
699
+ signal?: AbortSignal;
700
+ }): Promise<null>;
701
+ updateAnnotation(id: string, comment: string, options?: {
702
+ signal?: AbortSignal;
703
+ }): Promise<null>;
704
+ requestAnnotationModeChange(request: {
705
+ active: boolean;
706
+ }, options?: {
707
+ signal?: AbortSignal;
708
+ }): Promise<null>;
709
+ };
710
+ //#endregion
711
+ //#region src/annotations/AnnotationBar.d.ts
712
+ type AnnotationBarHandle = {
713
+ /** Submit through the same guards, pending state, and retry feedback as the Send button. */
714
+ send: () => Promise<void>;
715
+ };
716
+ type AnnotationBarProps = {
717
+ ref?: Ref<AnnotationBarHandle>;
718
+ annotations: readonly DataAppAnnotationDraft[];
719
+ active?: boolean;
720
+ theme?: Theme;
721
+ disabled?: boolean;
722
+ deletedAnnotationId?: string;
723
+ onUndoDelete?: (id: string) => void;
724
+ onDismissUndo?: () => void;
725
+ hasUnsavedChanges?: boolean;
726
+ pinsVisible: boolean;
727
+ onPinsVisibleChange: (visible: boolean) => void;
728
+ onSelect: (id: string) => void;
729
+ onDelete: (id: string) => void;
730
+ onClear: () => void;
731
+ /** Let host apps use their existing confirmation dialog. */
732
+ requestDiscard?: (discard: () => void) => void;
733
+ /** Resolve only after the outer application's agent API accepts this snapshot. */
734
+ onSend: (annotations: readonly DataAppAnnotationDraft[]) => Promise<void>;
735
+ onClose: () => void;
736
+ };
737
+ /** Host-owned batch controls. Collection changes and agent submission stay with the outer app. */
738
+ export declare function AnnotationBar({ ref, annotations, active, theme, disabled, deletedAnnotationId, onUndoDelete, onDismissUndo, hasUnsavedChanges, pinsVisible, onPinsVisibleChange, onSelect, onDelete, onClear, requestDiscard, onSend, onClose }: AnnotationBarProps): import("react").JSX.Element | null;
739
+ //#endregion
740
+ //#region src/annotations/styles.d.ts
741
+ /** Install only the outer-frame annotation controls; leave host page typography and layout intact. */
742
+ export declare function injectDataAppAnnotationStyles(options?: DataAppStylesOptions): HTMLStyleElement;
743
+ //#endregion
744
+ export { type AnnotationBarHandle, type AnnotationBarProps, type AnnotationTargetProps, type AppVariable, type AppVariableValues, type BreakdownItem, type BreakdownProps, Button, type ButtonProps, type ChoiceOption, type ChoiceVariable, type ColumnIdentifier, type ComparisonProps, type CsvCell, type DataAppProps, type DataAppStyle, type DataAppStyleHooks, type DataAppStyleToken, type DataAppStylesOptions, type DataContext, type DataIdentifierDefinition, type DataSectionProps, type DataValueProps, type DatasetColumn, type DatasetDeclaration as DatasetDefinition, type DatasetSuggestionOptions, DateDisplay, type DateDisplayProps, type DateRangeSelection, type DateRangeVariable, type DateRangeVariableOptions, type DateTimeTooltipProps, type DetailViewDefinition, type EmptyStateProps, type GlossaryEntry, type GridItemProps, type GridProps, type IconButtonProps, type MetricDefinition, type MetricRecords, type MetricValues, type MetricWidgetProps, type MultiChoiceVariable, type PeriodComparison, type PeriodSummaryProps, type RankingItem, type RankingProps, type ReportingPeriod, type SearchVariable, SectionHeading, type SectionHeadingProps, type SkeletonProps, type StackProps, type TableIdentifier, type TableWidgetProps, type TableWidgetSearch, type TextContentProps, type TextWidgetProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type UpdatedAtProps, type VariablePresentation, type VisualizationWidgetProps, type VisualizationWidgetView, type WidgetEvidence, choiceVariable, createDataContext, dateRangeVariable, defineDataIdentifiers, injectDataAppStyles, mountDataApp, multiChoiceVariable, searchVariable, useDateFormatting };
745
+ //# sourceMappingURL=index.d.ts.map