@altertable/data-app-react 0.71.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 -6
  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-1nbjx0se.js +0 -17022
  13. package/dist/chunks/index-1nbjx0se.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,44 +0,0 @@
1
- import type { DateRangeRequest } from '@altertable/data-app/contract';
2
- import type { AppVariableValues, VariableCollection } from '@altertable/data-app/internal';
3
- import type { ChoiceVariable } from '@altertable/data-app/internal';
4
- import { type ViewBindings } from './view.js';
5
- declare const filterPatch: unique symbol;
6
- declare const breakdownValue: unique symbol;
7
- export declare class FilterTarget<Patch> {
8
- readonly [filterPatch]: Patch;
9
- }
10
- export declare class BreakdownTarget<Value extends string> {
11
- readonly [breakdownValue]: Value;
12
- }
13
- export type FilterPatch<Variables extends VariableCollection> = Partial<{
14
- [Key in keyof Variables]: Extract<Variables[Key]['presentation'], {
15
- group: 'display';
16
- }> extends never ? AppVariableValues<Variables>[Key] : never;
17
- }>;
18
- type TargetDefinition = {
19
- owner: object;
20
- variables: VariableCollection;
21
- input: (values: any) => unknown;
22
- bindings?: ViewBindings<any, any>;
23
- date?: {
24
- variable: string;
25
- input: (input: any) => DateRangeRequest;
26
- };
27
- key?: string;
28
- };
29
- export declare function createFilterTarget<Variables extends VariableCollection>(definition: TargetDefinition): FilterTarget<FilterPatch<Variables>>;
30
- export declare function createBreakdownTarget<Value extends string>(definition: TargetDefinition): BreakdownTarget<Value>;
31
- export declare function breakdownDefinition(target: BreakdownTarget<any>): TargetDefinition;
32
- export declare function targetAvailable(target: object, displayedInput: unknown, owner: object): boolean;
33
- /** Apply an explicit scope patch and optional chart choice in one history entry. */
34
- export declare function applyFilter(target: object, patch: Record<string, unknown>, breakdown?: {
35
- target: BreakdownTarget<any>;
36
- value: string;
37
- }): void;
38
- export declare function breakdownState(target: BreakdownTarget<any>, owner: object | undefined, input?: unknown): {
39
- variable: ChoiceVariable;
40
- value: string;
41
- options: readonly import("@altertable/data-app/internal").ChoiceOption[];
42
- set(id: string): void;
43
- };
44
- export {};
@@ -1,114 +0,0 @@
1
- import type { CheckedVariableDeclarations } from '@altertable/data-app/internal';
2
- import type { IsUnion } from '@altertable/data-app/internal';
3
- import { type FacetVariable } from '@altertable/data-app/internal';
4
- import { type FilterTarget, type BreakdownTarget, type FilterPatch } from './exploration.js';
5
- import type { ChoiceVariable } from '@altertable/data-app/internal';
6
- import { DeclaredView } from './view-runtime.js';
7
- import { type DatasetDefinition, type Dataset, type Metric } from './bindings.js';
8
- import type { AuthoringDataContext } from './ui/data-context.js';
9
- import type { MetricValues } from '@altertable/data-app/internal';
10
- import type { DisplayedSnapshot } from '@altertable/data-app/internal';
11
- import { type ReactNode } from 'react';
12
- import type { DataOperations, DateRangeRequest } from '@altertable/data-app/contract';
13
- import type { DataClient } from '@altertable/data-app/client';
14
- import type { InputOf, OutputOf } from '@altertable/data-app/client';
15
- import { type VariableCollection, type CheckedFacetContexts } from '@altertable/data-app/internal';
16
- import { dateRangeVariable, type DateRangeVariable, type DateRangeVariableOptions } from './ui/variables.js';
17
- import { type DimensionFilterSettings, type DimensionValue } from '@altertable/data-app/internal';
18
- import { type DimensionOption } from '@altertable/data-app/contract';
19
- import type { EmptyContent } from './ui/presentation.js';
20
- import { ViewContent, type DataContentState } from './content.js';
21
- import { type DataViewDefinition, type ResolvedDataViewDefinition, type ResolvedVariables, type ViewBindingOptions, type ViewDate } from './view.js';
22
- import { DetailView, type DetailViewDefinition } from './details.js';
23
- type TimeVariables<Additional extends VariableCollection> = {
24
- period: ReturnType<typeof dateRangeVariable>;
25
- } & Additional;
26
- type TimeInput<Additional extends VariableCollection> = keyof Additional extends never ? DateRangeRequest : ResolvedVariables<TimeVariables<Additional>>;
27
- type TimeInputMapping<Additional extends VariableCollection, Input> = TimeInput<Additional> extends Input ? {
28
- input?: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
29
- } : {
30
- input: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
31
- };
32
- /** Match the period reader's precedence for each possible operation input. */
33
- type RequiredPeriodBinding<Input> = Input extends unknown ? 'period' extends keyof Input ? Input extends {
34
- period: DateRangeRequest;
35
- } ? never : 'period' : Input extends DateRangeRequest ? never : 'period' : never;
36
- type NonEmptyColumns<Columns extends object> = keyof Columns extends never ? never : Columns;
37
- type BoundDataView<Name extends string, Variables extends VariableCollection, Input, Data, Context extends AuthoringDataContext, HasDate extends boolean> = DeclaredView<Data, Input, ResolvedDataViewDefinition<Name, Variables, Input, Data> & {
38
- describeInput: (input: Input) => string;
39
- }> & {
40
- filter(): FilterTarget<FilterPatch<Variables>>;
41
- breakdown<Key extends keyof Variables & string>(key: Key & (Variables[Key] extends ChoiceVariable<any> ? Extract<Variables[Key]['presentation'], {
42
- group: 'display';
43
- }> extends never ? never : unknown : never)): Variables[Key] extends ChoiceVariable<infer Value> ? BreakdownTarget<Value> : never;
44
- dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
45
- columns: Columns & NonEmptyColumns<Columns>;
46
- }): Dataset<Data, Input, Row>;
47
- metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => HasDate extends true ? MetricValues : {
48
- current: number;
49
- previous?: never;
50
- }): Metric<Data, Input>;
51
- scope(snapshot: DisplayedSnapshot<Data, Input>): string;
52
- content(render: (state: DataContentState<Data, Input>) => ReactNode): ViewContent<Data, Input>;
53
- };
54
- type FacetOperationName<Operations extends DataOperations, Value extends DimensionValue> = {
55
- [Name in keyof Operations & string]: OutputOf<Operations[Name]> extends readonly DimensionOption<Value>[] ? Name : never;
56
- }[keyof Operations & string];
57
- type FacetConfig<Operations extends DataOperations, Value extends DimensionValue, Context extends VariableCollection, Name extends keyof Operations & string> = DimensionFilterSettings<Value> & {
58
- facet: {
59
- context: Context & CheckedVariableDeclarations<NoInfer<Context>> & (string extends keyof Context ? never : unknown);
60
- operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
61
- input: (values: ResolvedVariables<NoInfer<Context>>) => InputOf<Operations[NoInfer<Name>]>;
62
- };
63
- };
64
- type CheckedFacetSources<Operations extends DataOperations, Variables extends VariableCollection> = CheckedVariableDeclarations<Variables> & {
65
- [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];
66
- };
67
- type BoundDetailView<Data, Input, Context extends AuthoringDataContext> = DetailView<Data, Input> & {
68
- dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
69
- columns: Columns & NonEmptyColumns<Columns>;
70
- }): Dataset<Data, Input, Row>;
71
- metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => {
72
- current: number;
73
- previous?: never;
74
- }): Metric<Data, Input>;
75
- };
76
- /** Bind declared operations to URL variables, displayed readings, and request feedback. */
77
- export declare function createDataHooks<Operations extends DataOperations>(client: DataClient<Operations>): {
78
- defineDataView: {
79
- <Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
80
- operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
81
- variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
82
- } & {
83
- dataContext: Context;
84
- date: ViewDate<Variables, InputOf<Operations[Name]>>;
85
- }): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
86
- <Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
87
- operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
88
- variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
89
- } & {
90
- dataContext: Context;
91
- }): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, false>;
92
- };
93
- defineDetailView: <Name extends keyof Operations & string, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DetailViewDefinition<OutputOf<Operations[Name]>, InputOf<Operations[Name]>> & {
94
- operation: Name;
95
- dataContext: Context;
96
- }) => BoundDetailView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Context>;
97
- defineTimeView: <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: {
98
- operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
99
- dataContext: Context;
100
- time: Omit<DateRangeVariableOptions, 'key'>;
101
- variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
102
- period?: never;
103
- } & Omit<CheckedFacetContexts<TimeVariables<NoInfer<Additional>>>, 'period'> & Omit<CheckedFacetSources<Operations, TimeVariables<NoInfer<Additional>>>, 'period'>;
104
- isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
105
- emptyFallback: EmptyContent;
106
- } & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>) => BoundDataView<Name, {
107
- period: DateRangeVariable;
108
- } & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
109
- defineFacetFilter: {
110
- <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, string>>(config: FacetConfig<Operations, string, Context, Name>): FacetVariable<string, Readonly<Context>, Name, InputOf<Operations[Name]>>;
111
- <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, number>>(config: FacetConfig<Operations, number, Context, Name>): FacetVariable<number, Readonly<Context>, Name, InputOf<Operations[Name]>>;
112
- };
113
- };
114
- export {};
@@ -1,7 +0,0 @@
1
- import { type DataAppStylesOptions } from './styles.js';
2
- export declare function injectStyles({ name, attribute, css, options, }: {
3
- name: string;
4
- attribute: string;
5
- css: string;
6
- options: DataAppStylesOptions;
7
- }): HTMLStyleElement;
@@ -1,13 +0,0 @@
1
- import { type ComponentType, type ReactNode } from 'react';
2
- import { type DataAppDefinition, type QueryDefinitions } from '@altertable/data-app/config';
3
- /** Mount once per document; installs document identity and the shared request provider. */
4
- export declare function mountDataApp<const Queries extends QueryDefinitions>({ app, component: Component, root, }: {
5
- app: DataAppDefinition<Queries>;
6
- component: ComponentType;
7
- root?: HTMLElement | null;
8
- }): void;
9
- /** Provide one app identity and shared requests to a custom React root. */
10
- export declare function DataAppProvider<const Queries extends QueryDefinitions>({ app, children, }: {
11
- app: DataAppDefinition<Queries>;
12
- children: ReactNode;
13
- }): import("react").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { type SearchSuggestion } from './ui/SearchTypeahead.js';
2
- /** The primary view supplies suggestions from exactly the source displayed by its widgets. */
3
- export declare const SearchSuggestionsContext: import("react").Context<{
4
- groups: readonly (readonly SearchSuggestion[])[];
5
- busy: boolean;
6
- } | null>;
7
- /** Share five slots across datasets, then prioritize title matches without filtering source rows. */
8
- export declare function balanceSearchSuggestions(groups: readonly (readonly SearchSuggestion[])[], query?: string): SearchSuggestion[];
@@ -1,2 +0,0 @@
1
- export declare function ownedSource<Source extends object>(owner: object, source: Source): Source;
2
- export declare function assertSourceOwner(owner: object, source: object): void;
@@ -1,88 +0,0 @@
1
- import { type CSSProperties } from 'react';
2
- /** Public custom-property names for authoring types and validation. CSS owns their defaults. */
3
- export declare const dataAppStyleTokens: readonly ['--atbl-control-text-size', '--atbl-annotation-accent', '--atbl-annotation-accent-hover', '--atbl-annotation-on-accent', '--atbl-annotation-highlight', '--atbl-background', '--atbl-surface', '--atbl-subtle', '--atbl-text', '--atbl-muted', '--atbl-border', '--atbl-accent', '--atbl-accent-subtle', '--atbl-on-accent', '--atbl-positive', '--atbl-negative', '--atbl-danger', '--atbl-danger-subtle', '--atbl-backdrop', '--atbl-code-surface', '--atbl-code-text', '--atbl-code-keyword', '--atbl-chart-fill', '--atbl-control-hover-border', '--atbl-focus-color', '--atbl-focus-outline', '--atbl-focus-ring-offset', '--atbl-focus-ring-inset', '--atbl-font', '--atbl-font-heading', '--atbl-mono-font', '--atbl-space-xs', '--atbl-space-sm', '--atbl-space-md', '--atbl-space-lg', '--atbl-space-xl', '--atbl-layout-gap', '--atbl-surface-padding', '--atbl-content-width', '--atbl-control-height', '--atbl-dropdown-padding', '--atbl-dropdown-item-padding-block', '--atbl-dropdown-item-padding-inline', '--atbl-dropdown-item-gap', '--atbl-radius-control', '--atbl-radius-surface', '--atbl-radius-overlay', '--atbl-shadow-surface', '--atbl-shadow-overlay', '--atbl-shadow-control', '--atbl-cursor-action', '--atbl-cursor-disabled', '--atbl-cursor-help', '--atbl-duration-fast', '--atbl-duration-normal', '--atbl-duration-slow', '--atbl-ease-standard', '--atbl-ease-enter', '--atbl-chart-1', '--atbl-chart-2', '--atbl-chart-3', '--atbl-chart-4', '--atbl-chart-5', '--atbl-chart-6', '--atbl-chart-7', '--atbl-chart-8', '--atbl-type-emphasis-weight', '--atbl-type-meta-weight', '--atbl-type-page-size', '--atbl-type-section-size', '--atbl-type-widget-size', '--atbl-type-body-size', '--atbl-type-label-size', '--atbl-type-meta-size', '--atbl-type-metric-size', '--atbl-type-heading-weight', '--atbl-type-label-weight', '--atbl-type-body-leading', '--atbl-type-label-leading', '--atbl-type-heading-leading', '--atbl-type-metric-leading', '--atbl-text-measure', '--atbl-control-compact-height', '--atbl-control-icon-size', '--atbl-control-padding-inline', '--atbl-control-padding-block', '--atbl-control-gap', '--atbl-control-disabled-opacity', '--atbl-cursor-busy', '--atbl-control-hover-surface', '--atbl-control-pressed-surface', '--atbl-control-open-surface', '--atbl-control-open-border', '--atbl-control-selected-surface', '--atbl-control-selected-text'];
4
- /** Stable component roots for CSS customization; only utilities may be placed on native markup. */
5
- export declare const dataAppStyleClasses: {
6
- readonly 'altertable-app-layout': {
7
- readonly component: 'AppLayout';
8
- readonly kind: 'root';
9
- };
10
- readonly 'altertable-stack': {
11
- readonly component: 'Stack';
12
- readonly kind: 'root';
13
- };
14
- readonly 'altertable-grid': {
15
- readonly component: 'Grid';
16
- readonly kind: 'root';
17
- };
18
- readonly 'altertable-grid-item': {
19
- readonly component: 'GridItem';
20
- readonly kind: 'root';
21
- };
22
- readonly 'altertable-text-content': {
23
- readonly component: 'TextContent';
24
- readonly kind: 'root';
25
- };
26
- readonly 'altertable-button': {
27
- readonly component: 'Button';
28
- readonly kind: 'root';
29
- };
30
- readonly 'altertable-tabs': {
31
- readonly component: 'Tabs';
32
- readonly kind: 'root';
33
- };
34
- readonly 'altertable-data-widget': {
35
- readonly component: 'DataWidget';
36
- readonly kind: 'root';
37
- };
38
- readonly 'altertable-metric-widget': {
39
- readonly component: 'MetricWidget';
40
- readonly kind: 'root';
41
- };
42
- readonly 'altertable-chart-legend': {
43
- readonly component: 'ChartLegend';
44
- readonly kind: 'root';
45
- };
46
- readonly 'altertable-chart-legend-item': {
47
- readonly component: 'ChartLegend.Item';
48
- readonly kind: 'root';
49
- };
50
- readonly 'altertable-chart-legend-marker': {
51
- readonly component: 'ChartLegend.Marker';
52
- readonly kind: 'root';
53
- };
54
- readonly 'altertable-chart-legend-label': {
55
- readonly component: 'ChartLegend.Label';
56
- readonly kind: 'root';
57
- };
58
- readonly 'altertable-funnel-chart': {
59
- readonly component: 'FunnelChart';
60
- readonly kind: 'root';
61
- };
62
- readonly 'altertable-retention-chart': {
63
- readonly component: 'RetentionChart';
64
- readonly kind: 'root';
65
- };
66
- readonly 'altertable-journey-chart': {
67
- readonly component: 'JourneyChart';
68
- readonly kind: 'root';
69
- };
70
- readonly 'altertable-composed-chart': {
71
- readonly component: 'ComposedChart';
72
- readonly kind: 'root';
73
- };
74
- readonly 'altertable-sr-only': {
75
- readonly component: null;
76
- readonly kind: 'utility';
77
- };
78
- };
79
- export declare const dataAppStyleHooks: {
80
- readonly 'data-atbl-focus': readonly ['ring', 'inset', 'group'];
81
- readonly 'data-atbl-control': readonly ['default', 'action', 'help', 'text'];
82
- };
83
- export type DataAppStyleToken = (typeof dataAppStyleTokens)[number];
84
- /** React style properties with checked public Altertable custom properties. */
85
- export type DataAppStyle = CSSProperties & Partial<Record<DataAppStyleToken, string | number>>;
86
- export type DataAppStyleHooks = {
87
- [Name in keyof typeof dataAppStyleHooks]?: (typeof dataAppStyleHooks)[Name][number];
88
- };
@@ -1,2 +0,0 @@
1
- /** Static authoring checks; app-owned names are allowed, package implementation names are not. */
2
- export declare function validateAuthoredStyles(source: string, kind: 'css' | 'markup'): string[];
@@ -1,8 +0,0 @@
1
- export interface DataAppStylesOptions {
2
- /** Defaults to the current browser document. */
3
- document?: Document;
4
- /** Nonce permitted by the document's style-src CSP. */
5
- nonce?: string;
6
- }
7
- /** Install the complete UI stylesheet once per document, before mounting. */
8
- export declare function injectDataAppStyles(options?: DataAppStylesOptions): HTMLStyleElement;
@@ -1,73 +0,0 @@
1
- import { type ComponentPropsWithRef, type ComponentRef, type ReactNode, type RefObject } from 'react';
2
- import { type DisclosedQuery } from '@altertable/data-app/contract';
3
- import { type DataContext, type GlossaryEntry } from './data-context.js';
4
- import { type ButtonProps } from './Button.js';
5
- import { type SheetDialogProps } from './Sheet.js';
6
- export type InspectionRecords = {
7
- scope: string;
8
- content: ReactNode;
9
- };
10
- export type AboutTab = 'records' | 'glossary' | 'queries';
11
- export declare function resolveAboutTab(tab: string | null | undefined): AboutTab;
12
- export type AboutEmpty = {
13
- glossary: {
14
- title: string;
15
- description?: string;
16
- };
17
- queries: {
18
- title: string;
19
- description?: string;
20
- };
21
- };
22
- export declare const defaultAboutEmpty: AboutEmpty;
23
- export type AboutSubject = {
24
- empty?: AboutEmpty;
25
- id?: string;
26
- title?: ReactNode;
27
- description?: ReactNode;
28
- visual?: ReactNode;
29
- visualKind?: 'metric' | 'chart' | 'widget';
30
- dataContext?: DataContext;
31
- references?: {
32
- kind: 'ids';
33
- glossaryIds?: readonly string[];
34
- queryNames?: readonly string[];
35
- } | {
36
- kind: 'entries';
37
- entries: readonly GlossaryEntry[];
38
- };
39
- queries?: DisclosedQuery[];
40
- records?: InspectionRecords;
41
- };
42
- export type AboutDataProps = AboutSubject & {
43
- variant?: ButtonProps['variant'];
44
- iconOnly?: boolean;
45
- /**
46
- * Register the global inspect shortcut. Defaults on for existing toolbar triggers; local
47
- * triggers set false.
48
- */
49
- shortcut?: boolean;
50
- tooltip?: ReactNode;
51
- children?: ReactNode;
52
- footer?: ReactNode;
53
- portalRoot?: RefObject<HTMLElement | null>;
54
- sheetProps?: SheetDialogProps;
55
- headerActions?: ReactNode;
56
- open?: boolean;
57
- onOpenChange?: (open: boolean) => void;
58
- /** Initial inspect tab. While open, the URL's `tab` parameter tracks selection. */
59
- tab?: AboutTab;
60
- trigger?: boolean;
61
- } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
62
- /**
63
- * Open state uses `?about=`; tab selection uses `?tab=`. Enable the global shortcut only on the
64
- * page-level trigger.
65
- */
66
- export declare function InspectionSheet({ id, title, description, visual, visualKind, dataContext, references, queries, records, empty, footer, sheetProps, headerActions, open, onOpenChange, tab, onTabChange, returnFocus, }: AboutDataProps & {
67
- open: boolean;
68
- onOpenChange: (open: boolean) => void;
69
- tab: AboutTab;
70
- onTabChange: (tab: AboutTab) => void;
71
- returnFocus: RefObject<ComponentRef<'button'> | null>;
72
- }): import("react").JSX.Element;
73
- export declare function AboutData(props: AboutDataProps): import("react").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { type SVGProps } from 'react';
2
- export type AltertableLogoProps = SVGProps<SVGSVGElement>;
3
- export declare function AltertableLogo(props: AltertableLogoProps): import("react").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type AppFooterProps = ComponentPropsWithRef<'footer'> & {
3
- attribution?: ReactNode;
4
- };
5
- /** `children` fills the action slot; `attribution` replaces the default link. */
6
- export declare function AppFooter({ children, attribution, className, ...props }: AppFooterProps): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type AppHeaderProps = {
3
- scope?: ReactNode;
4
- title: ReactNode;
5
- description?: ReactNode;
6
- toolbar?: ReactNode;
7
- children?: ReactNode;
8
- } & Omit<ComponentPropsWithRef<'header'>, 'children' | 'title'>;
9
- /** Page identity and actions; on narrow screens the scope shares a row with actions. */
10
- export declare function AppHeader({ scope, title, description, toolbar, children, className, ...props }: AppHeaderProps): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type AppLayoutProps = {
3
- children: ReactNode;
4
- footerActions?: ReactNode;
5
- footer?: ReactNode;
6
- } & Omit<ComponentPropsWithRef<'main'>, 'children'>;
7
- /**
8
- * Native props target `<main>`. The shell owns its wrapper and tooltip defaults.
9
- */
10
- export declare function AppLayout({ children, footerActions, footer, className, ...props }: AppLayoutProps): import("react").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type AppScopeProps = {
3
- organization: string;
4
- environment: string;
5
- children?: ReactNode;
6
- } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
- export declare function AppScope({ organization, environment, children, className, ...props }: AppScopeProps): import("react").JSX.Element;
@@ -1,30 +0,0 @@
1
- import { type ComponentProps, type ComponentPropsWithRef, type ReactNode } from 'react';
2
- import { type DataView } from '@altertable/data-app/internal';
3
- import { type CsvExport } from './csv-export.js';
4
- import { type LiveControlProps } from './LiveControl.js';
5
- import { PresentStory } from './PresentStory.js';
6
- export type AppToolbarProps = {
7
- children?: ReactNode;
8
- end?: ReactNode;
9
- updatedAt?: ReactNode;
10
- requestState?: DataView<unknown, unknown>['kind'];
11
- refresh?: {
12
- refreshing: boolean;
13
- onRefresh: () => void;
14
- onCancel?: () => void;
15
- label?: string;
16
- tooltip?: ReactNode;
17
- };
18
- live?: LiveControlProps;
19
- aboutData?: ReactNode;
20
- /** Null reserves a disabled story action while its findings are unavailable. */
21
- story?: ComponentProps<typeof PresentStory> | null;
22
- /** Null reserves a disabled export action while its data is unavailable. */
23
- csvExport?: CsvExport | null;
24
- } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
25
- /** Header actions only. Put reader-controlled inputs in DataApp.variables below the header.
26
- * Observation time, or an initial loading status, sits before Refresh. Children prepend app controls in the right
27
- * cluster; end follows the built-in actions. Live sits beside Refresh when supplied. Refresh also
28
- * answers Alt/Option+R and uses the button to cancel a running request when onCancel is provided;
29
- * refresh.tooltip overrides its static label. All built-in controls are optional. */
30
- export declare function AppToolbar({ children, updatedAt, requestState, refresh, live, aboutData, story, csvExport, end, className, role, 'aria-label': ariaLabel, ...props }: AppToolbarProps): import("react").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { type ChartItem, type ValueChartProps } from './chart-data.js';
2
- export type AreaChartItem = ChartItem;
3
- export type AreaChartProps<Row extends AreaChartItem = AreaChartItem> = ValueChartProps<Row>;
4
- /** Ordered finite samples filled to a zero baseline, including negative values.
5
- * Samples are equally spaced; supply missing periods explicitly.
6
- * Compose inside VisualizationWidget; hover/touch tooltips need no caller state. */
7
- export declare function AreaChart<Row extends AreaChartItem>(props: AreaChartProps<Row>): import("react").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { type ChartItem, type ValueChartProps } from './chart-data.js';
2
- export type BarChartItem = ChartItem;
3
- export type BarChartProps<Row extends BarChartItem = BarChartItem> = ValueChartProps<Row>;
4
- /** Nonnegative category values. Compose inside VisualizationWidget for a titled panel.
5
- * Owns hover/touch tooltips; no selection state or keyboard navigation. */
6
- export declare function BarChart<Row extends BarChartItem>({ items, unit, ariaLabel, formatValue, itemActions, }: BarChartProps<Row>): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type BreakdownItem = {
3
- id: string;
4
- label: ReactNode;
5
- value: number;
6
- };
7
- export type BreakdownProps = {
8
- total: number;
9
- items: readonly BreakdownItem[];
10
- formatValue?: (value: number) => ReactNode;
11
- } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
12
- /** Mutually exclusive parts of one observed whole. Every share uses the supplied total. */
13
- export declare function Breakdown({ total, items, formatValue, className, ...props }: BreakdownProps): import("react").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { type ComponentPropsWithRef } from 'react';
2
- import { Button as AriaButton } from 'react-aria-components';
3
- export type ButtonProps = ComponentPropsWithRef<'button'> & {
4
- /** Inline actions retain button semantics without a padded control surface. */
5
- variant?: 'primary' | 'elevated' | 'outline' | 'ghost' | 'inline';
6
- size?: 'default' | 'compact' | 'icon' | 'icon-compact';
7
- };
8
- export declare function Button({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
9
- /** React Aria trigger behavior with the same presentation as the native Button. */
10
- export declare function PressButton({ variant, size, className, ...props }: Omit<ComponentPropsWithRef<typeof AriaButton>, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
11
- className?: string;
12
- }): import("react").JSX.Element;
@@ -1,32 +0,0 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- export type ChartLegendProps = {
3
- children: ReactNode;
4
- /** Single-row fits up to four cells before expansion, adapting to available width. */
5
- layout?: 'horizontal' | 'vertical' | 'single-row';
6
- align?: 'start' | 'center' | 'end';
7
- /** Optional cell cap, including expansion. Horizontal legends default to two rows. */
8
- maxVisibleItems?: number;
9
- } & Omit<ComponentPropsWithRef<'ul'>, 'children'>;
10
- /** Optional chart key, placed beside any chart with the app's layout components.
11
- * Items describe displayed series or categories; the caller owns series visibility and interactions. */
12
- declare function ChartLegendRoot({ children, layout, align, maxVisibleItems, className, 'aria-label': ariaLabel, ...props }: ChartLegendProps): import("react").JSX.Element;
13
- export type ChartLegendItemProps = ComponentPropsWithRef<'li'> & {
14
- inactive?: boolean;
15
- };
16
- /** Descriptive by default; compose a button inside the item for an authored series toggle. */
17
- declare function ChartLegendItem({ inactive, className, ...props }: ChartLegendItemProps): import("react").JSX.Element;
18
- export type ChartLegendMarkerKind = 'square' | 'bar' | 'line' | 'area' | 'point' | 'slice';
19
- export type ChartLegendMarkerProps = Omit<ComponentPropsWithRef<'svg'>, 'children'> & {
20
- kind: ChartLegendMarkerKind;
21
- };
22
- /** Decorative mark; color accepts public palette tokens or any CSS color.
23
- * Defaults match the shared bar or accent-colored series primitives. */
24
- declare function ChartLegendMarker({ kind, color, className, style, ...props }: ChartLegendMarkerProps): import("react").JSX.Element;
25
- export type ChartLegendLabelProps = ComponentPropsWithRef<'span'>;
26
- declare function ChartLegendLabel({ className, children, title, ...props }: ChartLegendLabelProps): import("react").JSX.Element;
27
- export declare const ChartLegend: typeof ChartLegendRoot & {
28
- Item: typeof ChartLegendItem;
29
- Marker: typeof ChartLegendMarker;
30
- Label: typeof ChartLegendLabel;
31
- };
32
- export {};
@@ -1,21 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- export declare const CheckboxGroupContext: import("react").Context<{
3
- values: readonly string[];
4
- disabled?: boolean;
5
- onChange: (value: string, checked: boolean) => void;
6
- } | null>;
7
- export type CheckboxProps = {
8
- label: string;
9
- description?: ReactNode;
10
- disabled?: boolean;
11
- className?: string;
12
- } & ({
13
- value: string;
14
- checked?: never;
15
- onChange?: never;
16
- } | {
17
- value?: never;
18
- checked: boolean;
19
- onChange: (checked: boolean) => void;
20
- });
21
- export declare function Checkbox({ label, description, checked, value, onChange, disabled, className, }: CheckboxProps): import("react").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { type ComponentPropsWithRef } from 'react';
2
- export type CheckboxGroupProps = Omit<ComponentPropsWithRef<'fieldset'>, 'onChange'> & {
3
- label: string;
4
- values: readonly string[];
5
- onChange: (values: string[]) => void;
6
- };
7
- export declare function CheckboxGroup({ label, values, onChange, className, children, disabled, ...props }: CheckboxGroupProps): import("react").JSX.Element;
@@ -1,39 +0,0 @@
1
- import { type ControlLabelPlacement } from './PickerField.js';
2
- import type { ChoiceOption } from '@altertable/data-app/internal';
3
- export type { ChoiceOption } from '@altertable/data-app/internal';
4
- type SharedProps = {
5
- label: string;
6
- labelPlacement?: ControlLabelPlacement;
7
- options: readonly ChoiceOption[];
8
- /** Separate source state, rendered last with a divider and the shared option component. */
9
- missingOption?: ChoiceOption;
10
- disabled?: boolean;
11
- placeholder?: string;
12
- emptyMessage?: string;
13
- /** Known options remain selectable while refreshing; unavailable selected IDs are retained. */
14
- loading?: boolean;
15
- /** Shows failure feedback without removing known options or unavailable selections. */
16
- error?: boolean;
17
- onRetry?: () => void;
18
- };
19
- export type SingleChoicePickerProps = SharedProps & {
20
- selectionMode: 'single';
21
- value: string;
22
- onChange: (value: string) => void;
23
- values?: never;
24
- maxSelected?: never;
25
- emptySelectionLabel?: never;
26
- };
27
- export type MultiChoicePickerProps = SharedProps & {
28
- selectionMode: 'multiple';
29
- values: readonly string[];
30
- onChange: (values: string[]) => void;
31
- /** Positive integer; at capacity, only unselected options are disabled. */
32
- maxSelected: number;
33
- /** Meaning of an empty selection belongs to the caller, e.g. All or Select a value. */
34
- emptySelectionLabel: string;
35
- value?: never;
36
- };
37
- export type ChoicePickerProps = SingleChoicePickerProps | MultiChoicePickerProps;
38
- /** Searchable selection picker with one focus and popup model for single and multiple values. */
39
- export declare function ChoicePicker(props: ChoicePickerProps): import("react").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { type MetricComparison } from './metric-comparison.js';
2
- import { type MetricDefinition } from './metric.js';
3
- import { type MetricReading } from '@altertable/data-app/internal';
4
- type UnboundComparisonProps = MetricComparison & {
5
- label: string;
6
- emphasis?: 'standard' | 'story';
7
- };
8
- export type ComparisonProps = UnboundComparisonProps | {
9
- metric: MetricDefinition;
10
- reading: MetricReading;
11
- emphasis?: 'standard' | 'story';
12
- };
13
- export declare function Comparison(props: ComparisonProps): import("react").JSX.Element | null;
14
- export {};