@altertable/data-app 0.68.0 → 0.70.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.
- package/AGENTS.md +10 -0
- package/CONTRIBUTING.md +27 -1
- package/README.md +18 -21
- package/THIRD_PARTY_NOTICES +18 -0
- package/dist/chunks/index-22d576sn.js +153 -0
- package/dist/chunks/index-22d576sn.js.map +11 -0
- package/dist/chunks/index-2ajhmsc4.js +355 -0
- package/dist/chunks/index-2ajhmsc4.js.map +13 -0
- package/dist/chunks/{index-ktmvs916.js → index-58kks6a8.js} +37 -21
- package/dist/chunks/index-58kks6a8.js.map +13 -0
- package/dist/chunks/{index-23dktynd.js → index-7q99hf1z.js} +19 -12
- package/dist/chunks/index-7q99hf1z.js.map +10 -0
- package/dist/chunks/{index-mt93ff2b.js → index-9zqbrv2z.js} +7 -3
- package/dist/chunks/index-9zqbrv2z.js.map +10 -0
- package/dist/chunks/{index-m6n8ctfc.js → index-cv36cyna.js} +4 -4
- package/dist/chunks/index-cv36cyna.js.map +10 -0
- package/dist/chunks/{index-ag0cgnvq.js → index-q1w84fv9.js} +178 -31
- package/dist/chunks/index-q1w84fv9.js.map +15 -0
- package/dist/chunks/{index-qd5xgx6y.js → index-rew95tbg.js} +89 -21
- package/dist/chunks/index-rew95tbg.js.map +13 -0
- package/dist/chunks/{index-gvers8jw.js → index-vtpygsbq.js} +5651 -2711
- package/dist/chunks/index-vtpygsbq.js.map +126 -0
- package/dist/chunks/{index-x69p7cv7.js → index-wjt6cavj.js} +6 -4
- package/dist/chunks/index-wjt6cavj.js.map +10 -0
- package/dist/chunks/{index-f5cnbrjz.js → index-wss3gd3h.js} +39 -9
- package/dist/chunks/index-wss3gd3h.js.map +13 -0
- package/dist/chunks/{index-ev2b5aaf.js → index-xzb7sx6g.js} +4 -4
- package/dist/client/index.js +6 -6
- package/dist/core/appearance.js +1 -1
- package/dist/core/config.js +3 -3
- package/dist/core/contract.js +7 -7
- package/dist/core/contract.js.map +1 -1
- package/dist/core/format.js +10 -2
- package/dist/core/format.js.map +1 -1
- package/dist/embed/index.js +26 -25
- package/dist/embed/index.js.map +4 -4
- package/dist/index.js +3 -3
- package/dist/local.js +200 -145
- package/dist/local.js.map +10 -7
- package/dist/preview.js +1456 -0
- package/dist/preview.js.map +17 -0
- package/dist/react/embed/index.js +1 -1
- package/dist/react/index.js +500 -401
- package/dist/react/index.js.map +10 -13
- package/dist/react/ui/index.js +1851 -1476
- package/dist/react/ui/index.js.map +24 -21
- package/dist/server.js +102 -58
- package/dist/server.js.map +9 -6
- package/dist/types/client/data-client.d.ts +21 -10
- package/dist/types/client/download.d.ts +5 -0
- package/dist/types/client/iframe.d.ts +4 -2
- package/dist/types/client/logger.d.ts +10 -2
- package/dist/types/core/annotations.d.ts +5 -0
- package/dist/types/core/appearance.d.ts +2 -0
- package/dist/types/core/bridge-endpoint.d.ts +2 -2
- package/dist/types/core/bridge.d.ts +22 -0
- package/dist/types/core/config.d.ts +25 -17
- package/dist/types/core/contract.d.ts +26 -14
- package/dist/types/core/date-format.d.ts +24 -0
- package/dist/types/core/dimension-source.d.ts +64 -0
- package/dist/types/core/dimension.d.ts +33 -24
- package/dist/types/core/facets.d.ts +13 -0
- package/dist/types/core/filters.d.ts +4 -3
- package/dist/types/core/format.d.ts +5 -3
- package/dist/types/core/keys.d.ts +2 -0
- package/dist/types/core/messages.d.ts +3 -1
- package/dist/types/core/operation-types.d.ts +12 -11
- package/dist/types/core/queries.d.ts +75 -7
- package/dist/types/core/time-interval.d.ts +96 -0
- package/dist/types/core/variables.d.ts +49 -14
- package/dist/types/embed/host.d.ts +4 -4
- package/dist/types/embed/sql.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/react/actions.d.ts +53 -0
- package/dist/types/react/annotations/annotation-editor-state.d.ts +2 -0
- package/dist/types/react/annotations/annotation-targets.d.ts +1 -0
- package/dist/types/react/annotations/getAnnotationProps.d.ts +5 -3
- package/dist/types/react/annotations/useAnnotationGeometry.d.ts +2 -2
- package/dist/types/react/bindings.d.ts +62 -3
- package/dist/types/react/date-formatting.d.ts +12 -0
- package/dist/types/react/details.d.ts +46 -0
- package/dist/types/react/exploration.d.ts +44 -0
- package/dist/types/react/hooks.d.ts +82 -43
- package/dist/types/react/index.d.ts +10 -2
- package/dist/types/react/search-suggestions.d.ts +8 -0
- package/dist/types/react/style-contract.d.ts +1 -5
- package/dist/types/react/ui/AboutData.d.ts +9 -4
- package/dist/types/react/ui/AreaChart.d.ts +2 -2
- package/dist/types/react/ui/BarChart.d.ts +2 -2
- package/dist/types/react/ui/Button.d.ts +2 -1
- package/dist/types/react/ui/ChartLegend.d.ts +3 -2
- package/dist/types/react/ui/ChoicePicker.d.ts +2 -0
- package/dist/types/react/ui/ComposedChartLegend.d.ts +2 -1
- package/dist/types/react/ui/DataApp.d.ts +8 -4
- package/dist/types/react/ui/DataAppFrame.d.ts +14 -3
- package/dist/types/react/ui/DataTable.d.ts +6 -4
- package/dist/types/react/ui/DataWidget.d.ts +7 -0
- package/dist/types/react/ui/DateDisplay.d.ts +9 -0
- package/dist/types/react/ui/DateRangePicker.d.ts +3 -1
- package/dist/types/react/ui/DateTimeTooltip.d.ts +3 -2
- package/dist/types/react/ui/DimensionPicker.d.ts +5 -3
- package/dist/types/react/ui/EmptyState.d.ts +1 -1
- package/dist/types/react/ui/ExplorationActionControl.d.ts +60 -0
- package/dist/types/react/ui/GradientScroll.d.ts +8 -0
- package/dist/types/react/ui/Grid.d.ts +1 -1
- package/dist/types/react/ui/InspectionProvider.d.ts +2 -2
- package/dist/types/react/ui/LineChart.d.ts +2 -2
- package/dist/types/react/ui/Menu.d.ts +3 -2
- package/dist/types/react/ui/MetricWidget.d.ts +4 -0
- package/dist/types/react/ui/NumberFilterPicker.d.ts +3 -1
- package/dist/types/react/ui/PeriodSummary.d.ts +2 -1
- package/dist/types/react/ui/PickerField.d.ts +23 -0
- package/dist/types/react/ui/PieChart.d.ts +2 -2
- package/dist/types/react/ui/PopoverSurface.d.ts +5 -0
- package/dist/types/react/ui/RequestHint.d.ts +2 -2
- package/dist/types/react/ui/SearchField.d.ts +3 -1
- package/dist/types/react/ui/SearchTypeahead.d.ts +15 -0
- package/dist/types/react/ui/SectionHeading.d.ts +8 -0
- package/dist/types/react/ui/Select.d.ts +9 -1
- package/dist/types/react/ui/Sheet.d.ts +4 -2
- package/dist/types/react/ui/TableWidget.d.ts +8 -0
- package/dist/types/react/ui/Tabs.d.ts +4 -3
- package/dist/types/react/ui/TrendChart.d.ts +3 -3
- package/dist/types/react/ui/VariableBar.d.ts +1 -1
- package/dist/types/react/ui/VisualizationWidget.d.ts +1 -1
- package/dist/types/react/ui/chart-data.d.ts +8 -6
- package/dist/types/react/ui/chart-date-axis.d.ts +15 -0
- package/dist/types/react/ui/chart-interaction.d.ts +27 -0
- package/dist/types/react/ui/chart-primitives.d.ts +4 -4
- package/dist/types/react/ui/chart-time.d.ts +19 -0
- package/dist/types/react/ui/chartColor.d.ts +1 -1
- package/dist/types/react/ui/icons.d.ts +5 -1
- package/dist/types/react/ui/index.d.ts +10 -4
- package/dist/types/react/ui/metric-comparison.d.ts +2 -2
- package/dist/types/react/ui/metric.d.ts +2 -2
- package/dist/types/react/ui/presentation.d.ts +2 -0
- package/dist/types/react/ui/searchItems.d.ts +2 -0
- package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +2 -0
- package/dist/types/react/ui/variables.d.ts +1 -1
- package/dist/types/react/view-control-bar.d.ts +18 -0
- package/dist/types/react/view-controls.d.ts +3 -2
- package/dist/types/react/view-runtime.d.ts +8 -3
- package/dist/types/react/view.d.ts +28 -7
- package/dist/types/react/widgets.d.ts +22 -11
- package/dist/types/server/local.d.ts +3 -1
- package/dist/types/server/preview/host.d.ts +1 -0
- package/dist/types/server/preview/index.d.ts +16 -0
- package/dist/types/server/reload-channel.d.ts +6 -0
- package/dist/types/server/request-body.d.ts +4 -0
- package/dist/worker.js +1 -1
- package/docs/app-authoring.md +27 -12
- package/docs/client.md +6 -7
- package/docs/composition.md +84 -0
- package/docs/contract.md +45 -26
- package/docs/data-context.md +2 -0
- package/docs/embed.md +11 -3
- package/docs/formatting-and-appearance.md +36 -5
- package/docs/layout.md +31 -8
- package/docs/react-embed.md +4 -4
- package/docs/react.md +1 -1
- package/docs/server-bun.md +25 -0
- package/docs/server.md +2 -2
- package/docs/styling.md +10 -27
- package/docs/ui.md +32 -18
- package/docs/variables.md +174 -25
- package/docs/views.md +60 -29
- package/docs/widgets.md +131 -26
- package/examples/starter-data-app/index.tsx +10 -23
- package/examples/starter-local-data-app/.bun-version +1 -0
- package/examples/starter-local-data-app/.node-version +1 -0
- package/examples/starter-local-data-app/.oxfmtrc.json +4 -0
- package/examples/starter-local-data-app/.oxlintrc.json +33 -0
- package/examples/starter-local-data-app/AGENTS.md +22 -0
- package/examples/starter-local-data-app/README.md +54 -0
- package/examples/starter-local-data-app/app.ts +28 -0
- package/examples/starter-local-data-app/bunfig.toml +2 -0
- package/examples/starter-local-data-app/package.json +33 -0
- package/examples/starter-local-data-app/src/App.tsx +8 -0
- package/examples/starter-local-data-app/src/assets.d.ts +1 -0
- package/examples/starter-local-data-app/src/data-context.ts +21 -0
- package/examples/starter-local-data-app/src/favicon.svg +13 -0
- package/examples/starter-local-data-app/src/index.html +14 -0
- package/examples/starter-local-data-app/src/main.tsx +7 -0
- package/examples/starter-local-data-app/src/operations.ts +6 -0
- package/examples/starter-local-data-app/src/server.ts +6 -0
- package/examples/starter-local-data-app/tsconfig.json +21 -0
- package/package.json +13 -3
- package/dist/chunks/index-23dktynd.js.map +0 -10
- package/dist/chunks/index-ag0cgnvq.js.map +0 -13
- package/dist/chunks/index-dq7b35fn.js +0 -307
- package/dist/chunks/index-dq7b35fn.js.map +0 -13
- package/dist/chunks/index-f5cnbrjz.js.map +0 -13
- package/dist/chunks/index-gvers8jw.js.map +0 -109
- package/dist/chunks/index-ktmvs916.js.map +0 -13
- package/dist/chunks/index-m6n8ctfc.js.map +0 -10
- package/dist/chunks/index-mev09s5v.js +0 -77
- package/dist/chunks/index-mev09s5v.js.map +0 -10
- package/dist/chunks/index-mt93ff2b.js.map +0 -10
- package/dist/chunks/index-qd5xgx6y.js.map +0 -13
- package/dist/chunks/index-x69p7cv7.js.map +0 -10
- package/dist/types/react/shellStyles.d.ts +0 -3
- package/dist/types/react/ui/DataAppSkeleton.d.ts +0 -7
- /package/dist/chunks/{index-ev2b5aaf.js.map → index-xzb7sx6g.js.map} +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { CheckedVariableDeclarations } from '../core/variables.js';
|
|
2
|
+
import type { IsUnion } from '../core/queries.js';
|
|
3
|
+
import { type FacetVariable } from '../core/facets.js';
|
|
4
|
+
import { type FilterTarget, type BreakdownTarget, type FilterPatch } from './exploration.js';
|
|
5
|
+
import type { ChoiceVariable } from '../core/variables.js';
|
|
1
6
|
import { DeclaredView } from './view-runtime.js';
|
|
2
|
-
import { type DatasetDefinition } from './bindings.js';
|
|
7
|
+
import { type DatasetDefinition, type Dataset, type Metric } from './bindings.js';
|
|
3
8
|
import type { AuthoringDataContext } from './ui/data-context.js';
|
|
4
9
|
import type { MetricValues } from '../core/reading.js';
|
|
5
10
|
import type { DisplayedSnapshot } from '../core/data-view.js';
|
|
@@ -7,12 +12,13 @@ import { type ReactNode } from 'react';
|
|
|
7
12
|
import type { DataOperations, DateRangeRequest } from '../core/contract.js';
|
|
8
13
|
import type { DataClient } from '../client/data-client.js';
|
|
9
14
|
import type { InputOf, OutputOf } from '../core/operation-types.js';
|
|
10
|
-
import { type VariableCollection } from '../core/variables.js';
|
|
11
|
-
import { dateRangeVariable, type DateRangeVariableOptions } from './ui/variables.js';
|
|
12
|
-
import { type
|
|
15
|
+
import { type VariableCollection, type CheckedFacetContexts } from '../core/variables.js';
|
|
16
|
+
import { dateRangeVariable, type DateRangeVariable, type DateRangeVariableOptions } from './ui/variables.js';
|
|
17
|
+
import { type DimensionFilterSettings, type DimensionOption, type DimensionValue } from '../core/dimension.js';
|
|
13
18
|
import type { EmptyContent } from './ui/presentation.js';
|
|
14
19
|
import { ViewContent, type DataContentState } from './content.js';
|
|
15
|
-
import { type DataViewDefinition, type ResolvedVariables, type
|
|
20
|
+
import { type DataViewDefinition, type ResolvedDataViewDefinition, type ResolvedVariables, type ViewBindingOptions, type ViewDate } from './view.js';
|
|
21
|
+
import { DetailView, type DetailViewDefinition } from './details.js';
|
|
16
22
|
type TimeVariables<Additional extends VariableCollection> = {
|
|
17
23
|
period: ReturnType<typeof dateRangeVariable>;
|
|
18
24
|
} & Additional;
|
|
@@ -22,53 +28,86 @@ type TimeInputMapping<Additional extends VariableCollection, Input> = TimeInput<
|
|
|
22
28
|
} : {
|
|
23
29
|
input: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
|
|
24
30
|
};
|
|
31
|
+
/** Match the period reader's precedence for each possible operation input. */
|
|
32
|
+
type RequiredPeriodBinding<Input> = Input extends unknown ? 'period' extends keyof Input ? Input extends {
|
|
33
|
+
period: DateRangeRequest;
|
|
34
|
+
} ? never : 'period' : Input extends DateRangeRequest ? never : 'period' : never;
|
|
35
|
+
type NonEmptyColumns<Columns extends object> = keyof Columns extends never ? never : Columns;
|
|
36
|
+
type BoundDataView<Name extends string, Variables extends VariableCollection, Input, Data, Context extends AuthoringDataContext, HasDate extends boolean> = DeclaredView<Data, Input, ResolvedDataViewDefinition<Name, Variables, Input, Data> & {
|
|
37
|
+
describeInput: (input: Input) => string;
|
|
38
|
+
}> & {
|
|
39
|
+
filter(): FilterTarget<FilterPatch<Variables>>;
|
|
40
|
+
breakdown<Key extends keyof Variables & string>(key: Key & (Variables[Key] extends ChoiceVariable<any> ? Extract<Variables[Key]['presentation'], {
|
|
41
|
+
group: 'display';
|
|
42
|
+
}> extends never ? never : unknown : never)): Variables[Key] extends ChoiceVariable<infer Value> ? BreakdownTarget<Value> : never;
|
|
43
|
+
dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
|
|
44
|
+
columns: Columns & NonEmptyColumns<Columns>;
|
|
45
|
+
}): Dataset<Data, Input, Row>;
|
|
46
|
+
metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => HasDate extends true ? MetricValues : {
|
|
47
|
+
current: number;
|
|
48
|
+
previous?: never;
|
|
49
|
+
}): Metric<Data, Input>;
|
|
50
|
+
scope(snapshot: DisplayedSnapshot<Data, Input>): string;
|
|
51
|
+
content(render: (state: DataContentState<Data, Input>) => ReactNode): ViewContent<Data, Input>;
|
|
52
|
+
};
|
|
53
|
+
type FacetOperationName<Operations extends DataOperations, Value extends DimensionValue> = {
|
|
54
|
+
[Name in keyof Operations & string]: OutputOf<Operations[Name]> extends readonly DimensionOption<Value>[] ? Name : never;
|
|
55
|
+
}[keyof Operations & string];
|
|
56
|
+
type FacetConfig<Operations extends DataOperations, Value extends DimensionValue, Context extends VariableCollection, Name extends keyof Operations & string> = DimensionFilterSettings<Value> & {
|
|
57
|
+
facet: {
|
|
58
|
+
context: Context & CheckedVariableDeclarations<NoInfer<Context>> & (string extends keyof Context ? never : unknown);
|
|
59
|
+
operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
|
|
60
|
+
input: (values: ResolvedVariables<NoInfer<Context>>) => InputOf<Operations[NoInfer<Name>]>;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type CheckedFacetSources<Operations extends DataOperations, Variables extends VariableCollection> = CheckedVariableDeclarations<Variables> & {
|
|
64
|
+
[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];
|
|
65
|
+
};
|
|
66
|
+
type BoundDetailView<Data, Input, Context extends AuthoringDataContext> = DetailView<Data, Input> & {
|
|
67
|
+
dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
|
|
68
|
+
columns: Columns & NonEmptyColumns<Columns>;
|
|
69
|
+
}): Dataset<Data, Input, Row>;
|
|
70
|
+
metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => {
|
|
71
|
+
current: number;
|
|
72
|
+
previous?: never;
|
|
73
|
+
}): Metric<Data, Input>;
|
|
74
|
+
};
|
|
25
75
|
/** Bind declared operations to URL variables, displayed readings, and request feedback. */
|
|
26
76
|
export declare function createDataHooks<Operations extends DataOperations>(client: DataClient<Operations>): {
|
|
27
|
-
defineDataView:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
defineDataView: {
|
|
78
|
+
<Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
|
|
79
|
+
operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
|
|
80
|
+
variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
|
|
81
|
+
} & {
|
|
82
|
+
dataContext: Context;
|
|
83
|
+
date: ViewDate<Variables, InputOf<Operations[Name]>>;
|
|
84
|
+
}): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
|
|
85
|
+
<Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
|
|
86
|
+
operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
|
|
87
|
+
variables?: Variables & CheckedFacetSources<Operations, NoInfer<Variables>>;
|
|
88
|
+
} & {
|
|
89
|
+
dataContext: Context;
|
|
90
|
+
}): BoundDataView<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, false>;
|
|
38
91
|
};
|
|
39
|
-
|
|
92
|
+
defineDetailView: <Name extends keyof Operations & string, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DetailViewDefinition<OutputOf<Operations[Name]>, InputOf<Operations[Name]>> & {
|
|
40
93
|
operation: Name;
|
|
41
94
|
dataContext: Context;
|
|
95
|
+
}) => BoundDetailView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Context>;
|
|
96
|
+
defineTimeView: <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: {
|
|
97
|
+
operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
|
|
98
|
+
dataContext: Context;
|
|
42
99
|
time: Omit<DateRangeVariableOptions, 'key'>;
|
|
43
|
-
variables?: Additional & {
|
|
100
|
+
variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
|
|
44
101
|
period?: never;
|
|
45
|
-
}
|
|
46
|
-
bindings?: ViewBindings<{
|
|
47
|
-
period: ReturnType<typeof dateRangeVariable>;
|
|
48
|
-
} & NoInfer<Additional>, InputOf<Operations[Name]>>;
|
|
102
|
+
} & Omit<CheckedFacetContexts<TimeVariables<NoInfer<Additional>>>, 'period'> & Omit<CheckedFacetSources<Operations, TimeVariables<NoInfer<Additional>>>, 'period'>;
|
|
49
103
|
isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
|
|
50
104
|
emptyFallback: EmptyContent;
|
|
51
|
-
} & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>>
|
|
52
|
-
period:
|
|
53
|
-
} & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
input: (values: ResolvedVariables<NoInfer<{
|
|
58
|
-
period: import("../core/variables.js").DateRangeVariable;
|
|
59
|
-
} & Additional>>) => InputOf<Operations[Name]>;
|
|
60
|
-
describeInput: (input: InputOf<Operations[Name]>) => string;
|
|
61
|
-
}> & {
|
|
62
|
-
dataset<Row>(dataset: DatasetDefinition<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Row, Parameters<Context["evidence"]>[0]>): import("./bindings.js").Dataset<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Row>;
|
|
63
|
-
metric(metric: Parameters<Context["metric"]>[0], select: (data: OutputOf<Operations[Name]>, input: InputOf<Operations[Name]>) => MetricValues): import("./bindings.js").Metric<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>;
|
|
64
|
-
scope(snapshot: DisplayedSnapshot<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>): string;
|
|
65
|
-
content(render: (state: DataContentState<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>) => ReactNode): ViewContent<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>;
|
|
105
|
+
} & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>) => BoundDataView<Name, {
|
|
106
|
+
period: DateRangeVariable;
|
|
107
|
+
} & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
|
|
108
|
+
defineFacetFilter: {
|
|
109
|
+
<const Context extends VariableCollection, const Name extends FacetOperationName<Operations, string>>(config: FacetConfig<Operations, string, Context, Name>): FacetVariable<string, Readonly<Context>, Name, InputOf<Operations[Name]>>;
|
|
110
|
+
<const Context extends VariableCollection, const Name extends FacetOperationName<Operations, number>>(config: FacetConfig<Operations, number, Context, Name>): FacetVariable<number, Readonly<Context>, Name, InputOf<Operations[Name]>>;
|
|
66
111
|
};
|
|
67
|
-
defineFacetFilter: <Name extends keyof Operations & string, const T extends DimensionValue>(config: Omit<DimensionFilterOptions<T>, 'options' | 'facet'> & {
|
|
68
|
-
facet: {
|
|
69
|
-
operation: Name;
|
|
70
|
-
input: (values: Record<string, unknown>) => InputOf<Operations[Name]>;
|
|
71
|
-
};
|
|
72
|
-
} & (OutputOf<Operations[Name]> extends readonly DimensionOption<T>[] ? object : never)) => import("../core/dimension.js").DimensionVariable<T>;
|
|
73
112
|
};
|
|
74
113
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** Declared views, bound widgets, and layouts for data-app authoring. */
|
|
2
|
-
export type { DatasetColumn, DatasetDeclaration as DatasetDefinition, } from './bindings.js';
|
|
2
|
+
export type { DatasetColumn, DatasetSuggestionOptions, DatasetDeclaration as DatasetDefinition, } from './bindings.js';
|
|
3
|
+
export type { MetricRecords } from './bindings.js';
|
|
3
4
|
export { injectDataAppStyles } from './styles.js';
|
|
4
5
|
export type { DataAppStylesOptions } from './styles.js';
|
|
5
6
|
export type { DataAppStyle, DataAppStyleToken, DataAppStyleHooks, } from './style-contract.js';
|
|
6
7
|
export { mountDataApp } from './mount.js';
|
|
7
8
|
export { createDataHooks } from './hooks.js';
|
|
9
|
+
export { DetailView, DetailContent, useDetailNavigation, } from './details.js';
|
|
10
|
+
export type { DetailViewDefinition } from './details.js';
|
|
8
11
|
export type { CsvCell } from './ui/csv-export.js';
|
|
9
12
|
export { DataApp } from './ui/DataApp.js';
|
|
10
13
|
export type { DataAppProps } from './ui/DataApp.js';
|
|
@@ -47,7 +50,7 @@ export type { UpdatedAtProps } from './ui/UpdatedAt.js';
|
|
|
47
50
|
export { DateTimeTooltip } from './ui/DateTimeTooltip.js';
|
|
48
51
|
export type { DateTimeTooltipProps } from './ui/DateTimeTooltip.js';
|
|
49
52
|
export { searchVariable, choiceVariable, multiChoiceVariable, dateRangeVariable, } from './ui/variables.js';
|
|
50
|
-
export type { AppVariable, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
|
|
53
|
+
export type { AppVariable, VariablePresentation, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
|
|
51
54
|
export { PeriodSummary } from './ui/PeriodSummary.js';
|
|
52
55
|
export type { ReportingPeriod, PeriodComparison, PeriodSummaryProps, } from './ui/PeriodSummary.js';
|
|
53
56
|
export { createDataContext } from './ui/data-context.js';
|
|
@@ -68,3 +71,8 @@ export { useDataAppAnnotations } from './annotations/useDataAppAnnotations.js';
|
|
|
68
71
|
export { AnnotationBar } from './annotations/AnnotationBar.js';
|
|
69
72
|
export type { AnnotationBarHandle, AnnotationBarProps, } from './annotations/AnnotationBar.js';
|
|
70
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';
|
|
@@ -0,0 +1,8 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
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-content-width', '--atbl-control-height', '--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-selected-surface', '--atbl-control-selected-text'];
|
|
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
4
|
/** Stable component roots for CSS customization; only utilities may be placed on native markup. */
|
|
5
5
|
export declare const dataAppStyleClasses: {
|
|
6
6
|
readonly 'altertable-app-layout': {
|
|
@@ -39,10 +39,6 @@ export declare const dataAppStyleClasses: {
|
|
|
39
39
|
readonly component: 'MetricWidget';
|
|
40
40
|
readonly kind: 'root';
|
|
41
41
|
};
|
|
42
|
-
readonly 'altertable-data-app-skeleton': {
|
|
43
|
-
readonly component: 'DataAppSkeleton';
|
|
44
|
-
readonly kind: 'root';
|
|
45
|
-
};
|
|
46
42
|
readonly 'altertable-chart-legend': {
|
|
47
43
|
readonly component: 'ChartLegend';
|
|
48
44
|
readonly kind: 'root';
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
|
|
1
|
+
import { type ComponentPropsWithRef, type ComponentRef, type ReactNode, type RefObject } from 'react';
|
|
2
2
|
import type { DisclosedQuery } from '../../core/contract.js';
|
|
3
3
|
import type { DataContext, GlossaryEntry } from './data-context.js';
|
|
4
4
|
import { type ButtonProps } from './Button.js';
|
|
5
5
|
import { type SheetDialogProps } from './Sheet.js';
|
|
6
|
-
export type
|
|
6
|
+
export type InspectionRecords = {
|
|
7
|
+
scope: string;
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type AboutTab = 'records' | 'glossary' | 'queries';
|
|
7
11
|
export declare function resolveAboutTab(tab: string | null | undefined): AboutTab;
|
|
8
12
|
export type AboutEmpty = {
|
|
9
13
|
glossary: {
|
|
@@ -33,6 +37,7 @@ export type AboutSubject = {
|
|
|
33
37
|
entries: readonly GlossaryEntry[];
|
|
34
38
|
};
|
|
35
39
|
queries?: DisclosedQuery[];
|
|
40
|
+
records?: InspectionRecords;
|
|
36
41
|
};
|
|
37
42
|
export type AboutDataProps = AboutSubject & {
|
|
38
43
|
variant?: ButtonProps['variant'];
|
|
@@ -58,11 +63,11 @@ export type AboutDataProps = AboutSubject & {
|
|
|
58
63
|
* Open state uses `?about=`; tab selection uses `?tab=`. Enable the global shortcut only on the
|
|
59
64
|
* page-level trigger.
|
|
60
65
|
*/
|
|
61
|
-
export declare function InspectionSheet({ id, title, description, visual, visualKind, dataContext, references, queries, empty, footer, sheetProps, headerActions, open, onOpenChange, tab, onTabChange, returnFocus, }: AboutDataProps & {
|
|
66
|
+
export declare function InspectionSheet({ id, title, description, visual, visualKind, dataContext, references, queries, records, empty, footer, sheetProps, headerActions, open, onOpenChange, tab, onTabChange, returnFocus, }: AboutDataProps & {
|
|
62
67
|
open: boolean;
|
|
63
68
|
onOpenChange: (open: boolean) => void;
|
|
64
69
|
tab: AboutTab;
|
|
65
70
|
onTabChange: (tab: AboutTab) => void;
|
|
66
|
-
returnFocus: RefObject<
|
|
71
|
+
returnFocus: RefObject<ComponentRef<'button'> | null>;
|
|
67
72
|
}): import("react").JSX.Element;
|
|
68
73
|
export declare function AboutData(props: AboutDataProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChartItem, ValueChartProps } from './chart-data.js';
|
|
2
2
|
export type AreaChartItem = ChartItem;
|
|
3
|
-
export type AreaChartProps = ValueChartProps
|
|
3
|
+
export type AreaChartProps<Row extends AreaChartItem = AreaChartItem> = ValueChartProps<Row>;
|
|
4
4
|
/** Ordered finite samples filled to a zero baseline, including negative values.
|
|
5
5
|
* Samples are equally spaced; supply missing periods explicitly.
|
|
6
6
|
* Compose inside VisualizationWidget; hover/touch tooltips need no caller state. */
|
|
7
|
-
export declare function AreaChart(props: AreaChartProps): import("react").JSX.Element;
|
|
7
|
+
export declare function AreaChart<Row extends AreaChartItem>(props: AreaChartProps<Row>): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChartItem, type ValueChartProps } from './chart-data.js';
|
|
2
2
|
export type BarChartItem = ChartItem;
|
|
3
|
-
export type BarChartProps = ValueChartProps
|
|
3
|
+
export type BarChartProps<Row extends BarChartItem = BarChartItem> = ValueChartProps<Row>;
|
|
4
4
|
/** Nonnegative category values. Compose inside VisualizationWidget for a titled panel.
|
|
5
5
|
* Owns hover/touch tooltips; no selection state or keyboard navigation. */
|
|
6
|
-
export declare function BarChart({ items, unit, ariaLabel, formatValue, }: BarChartProps): import("react").JSX.Element;
|
|
6
|
+
export declare function BarChart<Row extends BarChartItem>({ items, unit, ariaLabel, formatValue, itemActions, }: BarChartProps<Row>): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { Button as AriaButton } from 'react-aria-components';
|
|
3
3
|
export type ButtonProps = ComponentPropsWithRef<'button'> & {
|
|
4
|
-
|
|
4
|
+
/** Inline actions retain button semantics without a padded control surface. */
|
|
5
|
+
variant?: 'primary' | 'elevated' | 'outline' | 'ghost' | 'inline';
|
|
5
6
|
size?: 'default' | 'compact' | 'icon' | 'icon-compact';
|
|
6
7
|
};
|
|
7
8
|
export declare function Button({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
export type ChartLegendProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
|
|
4
|
+
/** Single-row fits up to four cells before expansion, adapting to available width. */
|
|
5
|
+
layout?: 'horizontal' | 'vertical' | 'single-row';
|
|
5
6
|
align?: 'start' | 'center' | 'end';
|
|
6
|
-
/**
|
|
7
|
+
/** Optional cell cap, including expansion. Horizontal legends default to two rows. */
|
|
7
8
|
maxVisibleItems?: number;
|
|
8
9
|
} & Omit<ComponentPropsWithRef<'ul'>, 'children'>;
|
|
9
10
|
/** Optional chart key, placed beside any chart with the app's layout components.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import type { ChoiceOption } from '../../core/variables.js';
|
|
2
3
|
export type { ChoiceOption } from '../../core/variables.js';
|
|
3
4
|
type SharedProps = {
|
|
4
5
|
label: string;
|
|
6
|
+
labelPlacement?: ControlLabelPlacement;
|
|
5
7
|
options: readonly ChoiceOption[];
|
|
6
8
|
/** Separate source state, rendered last with a divider and the shared option component. */
|
|
7
9
|
missingOption?: ChoiceOption;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { Legend } from 'recharts';
|
|
3
3
|
export type ComposedChartLegendProps = ComponentProps<typeof Legend> & {
|
|
4
4
|
maxVisibleItems?: number;
|
|
5
5
|
};
|
|
6
6
|
/** Opt in inside ComposedChart to derive the shared legend from its displayed series.
|
|
7
|
+
* Give native series unique IDs when they share a data key.
|
|
7
8
|
* Native positioning, sorting, formatters, callbacks, and custom content remain available. */
|
|
8
9
|
export declare function ComposedChartLegend({ maxVisibleItems, ...props }: ComposedChartLegendProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type RegisteredBinding } from '../bindings.js';
|
|
1
|
+
import { type ExportDataset, type RegisteredBinding } from '../bindings.js';
|
|
2
2
|
import type { DisplayedSnapshot } from '../../core/data-view.js';
|
|
3
|
-
import { type ExportDataset } from '../bindings.js';
|
|
4
3
|
import type { StoryFinding } from './story.js';
|
|
5
|
-
import { type DataAppBaseProps } from './DataAppFrame.js';
|
|
4
|
+
import { type DataAppBaseProps, type DataAppControlProps } from './DataAppFrame.js';
|
|
6
5
|
import { type DeclaredView } from '../view-runtime.js';
|
|
7
|
-
|
|
6
|
+
import { type DetailContent } from '../details.js';
|
|
7
|
+
export type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'> & DataAppControlProps & {
|
|
8
8
|
view: DeclaredView<Data, Input> & {
|
|
9
9
|
scope(snapshot: DisplayedSnapshot<Data, Input>): string;
|
|
10
10
|
};
|
|
11
|
+
/** Show supplied datasets’ record suggestions on the first declared search. Defaults to true. */
|
|
12
|
+
showSearchSuggestions?: boolean;
|
|
11
13
|
story: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
|
|
12
14
|
evidence: RegisteredBinding;
|
|
13
15
|
})[];
|
|
@@ -15,6 +17,8 @@ export type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataCo
|
|
|
15
17
|
ExportDataset<Data, Input>,
|
|
16
18
|
...ExportDataset<Data, Input>[]
|
|
17
19
|
];
|
|
20
|
+
/** Detail destinations available to dataset actions and metric record inspection. */
|
|
21
|
+
details?: readonly DetailContent<any, any>[];
|
|
18
22
|
};
|
|
19
23
|
/** Executes the primary view and owns its controls, inspection, exports, and stories. */
|
|
20
24
|
export declare function DataApp<Data, Input>(props: DataAppProps<Data, Input>): import("react").JSX.Element;
|
|
@@ -12,21 +12,32 @@ export type DataAppBaseProps = {
|
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
toolbarActions?: ReactNode;
|
|
14
14
|
footerActions?: ReactNode;
|
|
15
|
+
/** Optional source, coverage, or methodology note below the app content.
|
|
16
|
+
* Compose prose and inline components; typography and spacing are provided.
|
|
17
|
+
* Put data widgets in children and app controls in footerActions. */
|
|
18
|
+
footer?: ReactNode;
|
|
15
19
|
};
|
|
16
20
|
export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
|
|
17
21
|
queries?: DisclosedQuery[];
|
|
18
22
|
/** Actual request activity, including retries with retained data. */
|
|
19
23
|
refreshing?: boolean;
|
|
20
24
|
cancel?: () => unknown;
|
|
21
|
-
|
|
25
|
+
searchControls?: ReactNode;
|
|
26
|
+
filterControls?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export type DataAppControlProps = {
|
|
29
|
+
/** Show declared search controls. Defaults to true; hiding preserves their values. */
|
|
30
|
+
showSearch?: boolean;
|
|
31
|
+
/** Show declared filter controls, including display options. Defaults to true; hiding preserves their values. */
|
|
32
|
+
showFilters?: boolean;
|
|
22
33
|
};
|
|
23
34
|
export type StaticDataAppProps = DataAppBaseProps & {
|
|
24
35
|
csvExport?: CsvExport;
|
|
25
36
|
queries?: DisclosedQuery[];
|
|
26
37
|
};
|
|
27
|
-
export type DataAppProps<Data = unknown, Input = unknown> = (DataAppBaseProps & {
|
|
38
|
+
export type DataAppProps<Data = unknown, Input = unknown> = (DataAppBaseProps & DataAppControlProps & {
|
|
28
39
|
request: DataAppRequest<Data, Input>;
|
|
29
|
-
/** Findings are always derived from the result currently visible to the
|
|
40
|
+
/** Findings are always derived from the result currently visible to the user. */
|
|
30
41
|
story: BoundStory<Data, Input>;
|
|
31
42
|
/** Export every distinct dataset in the displayed result. */
|
|
32
43
|
csvExport: (snapshot: DisplayedSnapshot<Data, Input>) => CsvExport;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import type { EmptyContent } from './presentation.js';
|
|
3
3
|
import { type SearchFieldProps } from './SearchField.js';
|
|
4
|
-
export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue'> & {
|
|
4
|
+
export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue' | 'inputProps'> & {
|
|
5
5
|
/** Number of available records before filtering or a display limit. */
|
|
6
6
|
itemCount: number;
|
|
7
7
|
};
|
|
@@ -18,10 +18,12 @@ export declare function DataTableShare({ value }: {
|
|
|
18
18
|
export type DataTableEmptyRowProps = EmptyContent & {
|
|
19
19
|
colSpan: number;
|
|
20
20
|
};
|
|
21
|
-
export declare function DataTableEmptyRow({ colSpan, title, description, }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
21
|
+
export declare function DataTableEmptyRow({ colSpan, title, description, action, }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
22
22
|
export type DataTableTimestampProps = {
|
|
23
|
-
value: string | Date;
|
|
23
|
+
value: string | Date | number;
|
|
24
24
|
children?: ReactNode;
|
|
25
25
|
timeZone?: string;
|
|
26
|
+
locale?: string;
|
|
27
|
+
precision?: 'minute' | 'second';
|
|
26
28
|
};
|
|
27
|
-
export declare function DataTableTimestamp({ value, children, timeZone, }: DataTableTimestampProps): import("react").JSX.Element;
|
|
29
|
+
export declare function DataTableTimestamp({ value, children, timeZone, locale, precision, }: DataTableTimestampProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import type { InspectionRecords } from './AboutData.js';
|
|
1
2
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
3
|
import { type WidgetStatus } from './RequestHint.js';
|
|
3
4
|
import type { EmptyContent, BoundWidgetReading } from './presentation.js';
|
|
4
5
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
5
6
|
type DataWidgetBaseProps = {
|
|
6
7
|
title: ReactNode;
|
|
8
|
+
/** Document outline level. The widget title keeps the shared widget-heading appearance. */
|
|
9
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
/** Unique stable target for persisted feedback; overrides automatic evidence identity. */
|
|
7
11
|
annotationId?: string;
|
|
12
|
+
/** Result count beside the heading. Derive from the displayed result; zero is visible. */
|
|
8
13
|
count?: number;
|
|
9
14
|
description?: ReactNode;
|
|
10
15
|
evidence?: WidgetEvidence;
|
|
16
|
+
/** Lazy detail records rendered as the first inspection tab. */
|
|
17
|
+
records?: InspectionRecords;
|
|
11
18
|
action?: ReactNode;
|
|
12
19
|
/** Reserved feedback slot; retain displayed content while refreshing or after failure. */
|
|
13
20
|
status?: WidgetStatus;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { type DateFormat } from '../../core/format.js';
|
|
3
|
+
export type DateDisplayProps = {
|
|
4
|
+
value: string | Date | number | null | undefined;
|
|
5
|
+
/** Calendar dates stay dates; instants require a Date, epoch milliseconds, or an offset-bearing ISO string. */
|
|
6
|
+
format?: DateFormat;
|
|
7
|
+
} & Omit<ComponentPropsWithRef<'time'>, 'children' | 'dateTime'>;
|
|
8
|
+
/** Readable dates with exact-time disclosure for instants; invalid or ambiguous values render as missing. */
|
|
9
|
+
export declare function DateDisplay({ value, format, className, ...props }: DateDisplayProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
3
|
import { type CalendarDate } from '@internationalized/date';
|
|
3
4
|
import { DateRangePicker as AriaDateRangePicker } from 'react-aria-components';
|
|
@@ -5,6 +6,7 @@ import { type DatePresetId, type DateRange } from '../../core/date-range.js';
|
|
|
5
6
|
export type { DatePresetId, DateRange } from '../../core/date-range.js';
|
|
6
7
|
export type DateRangePickerProps = {
|
|
7
8
|
label?: string;
|
|
9
|
+
labelPlacement?: Exclude<ControlLabelPlacement, 'inline'>;
|
|
8
10
|
value: DateRange | null;
|
|
9
11
|
onChange: (range: DateRange | null) => void;
|
|
10
12
|
minDate?: string;
|
|
@@ -25,4 +27,4 @@ export type DateRangePickerProps = {
|
|
|
25
27
|
};
|
|
26
28
|
} & Omit<ComponentProps<typeof AriaDateRangePicker<CalendarDate>>, 'children' | 'value' | 'onChange' | 'minValue' | 'maxValue' | 'isOpen' | 'onOpenChange' | 'defaultValue' | 'defaultOpen'>;
|
|
27
29
|
/** The app owns URL state; `dateRangeControl` binds a date variable to this picker. */
|
|
28
|
-
export declare function DateRangePicker({ label, value, onChange, minDate, maxDate, maxRangeDays, timeZone, resetValue, isDefault, onReset, onPresetChange, selectedPresetId, calendarFooter, comparison, className, ...props }: DateRangePickerProps): import("react").JSX.Element;
|
|
30
|
+
export declare function DateRangePicker({ label, labelPlacement, value, onChange, minDate, maxDate, maxRangeDays, timeZone, resetValue, isDefault, onReset, onPresetChange, selectedPresetId, calendarFooter, comparison, className, ...props }: DateRangePickerProps): import("react").JSX.Element;
|
|
@@ -3,7 +3,8 @@ import { type HelpPopoverProps } from './HelpPopover.js';
|
|
|
3
3
|
export type DateTimeTooltipProps = {
|
|
4
4
|
date: Date;
|
|
5
5
|
timeZone?: string;
|
|
6
|
+
locale?: string;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
} & Omit<HelpPopoverProps, 'trigger' | 'triggerLabel' | 'label' | 'children'>;
|
|
8
|
-
/**
|
|
9
|
-
export declare function DateTimeTooltip({ date, timeZone, children, panelProps, ...props }: DateTimeTooltipProps): import("react").JSX.Element;
|
|
9
|
+
/** Exact-time disclosure uses the same reporting zone and locale as other date displays. */
|
|
10
|
+
export declare function DateTimeTooltip({ date, timeZone, locale, children, panelProps, ...props }: DateTimeTooltipProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ControlLabelPlacement } from './PickerField.js';
|
|
2
|
+
import type { DimensionOption, DimensionSelection, DimensionValue, DimensionSelectionVariable } from '../../core/dimension.js';
|
|
2
3
|
/** Adapts the typed dimension contract to the shared ChoicePicker control. */
|
|
3
|
-
export declare function DimensionPicker<T extends DimensionValue>({ filter, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
|
|
4
|
-
filter:
|
|
4
|
+
export declare function DimensionPicker<T extends DimensionValue>({ filter, labelPlacement, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
|
|
5
|
+
filter: DimensionSelectionVariable<T>;
|
|
6
|
+
labelPlacement?: ControlLabelPlacement;
|
|
5
7
|
value: DimensionSelection<T>;
|
|
6
8
|
onChange: (value: DimensionSelection<T>) => void;
|
|
7
9
|
options?: readonly DimensionOption<T>[];
|
|
@@ -3,4 +3,4 @@ export type EmptyStateProps = EmptyContent & {
|
|
|
3
3
|
variant?: 'visual' | 'table';
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function EmptyState({ title, description, variant, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
6
|
+
export declare function EmptyState({ title, description, action, variant, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ComponentRef, type RefObject, type Ref, type KeyboardEvent } from 'react';
|
|
2
|
+
/** A resolved action available for one displayed exploration item. */
|
|
3
|
+
export type ExplorationAction = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
onSelect: (trigger?: HTMLElement | SVGElement) => void;
|
|
7
|
+
/** Keep this action directly available when other actions require a menu. */
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
/** Keep utility actions separate from exploration destinations. */
|
|
10
|
+
group?: 'clipboard';
|
|
11
|
+
};
|
|
12
|
+
/** Resolves the actions available for a displayed domain row. */
|
|
13
|
+
export type ItemActions<Row> = (row: Row) => readonly ExplorationAction[];
|
|
14
|
+
export type ExplorationActionControlProps = {
|
|
15
|
+
actions: readonly ExplorationAction[];
|
|
16
|
+
/** Identifies the item whose actions the control exposes. */
|
|
17
|
+
ariaLabel: string;
|
|
18
|
+
/** Use when another item-level hit target already exposes the primary action. */
|
|
19
|
+
hidePrimary?: boolean;
|
|
20
|
+
/** Own a context menu without adding a second visible or keyboard trigger. */
|
|
21
|
+
contextOnly?: boolean;
|
|
22
|
+
/** Chart labels use a chevron; other action menus use an ellipsis. */
|
|
23
|
+
indicator?: 'ellipsis' | 'chevron';
|
|
24
|
+
/** Shares this menu trigger with an item's context and keyboard actions. */
|
|
25
|
+
ref?: Ref<HTMLButtonElement>;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Presents exploration actions consistently: a sole action is direct, an explicit
|
|
30
|
+
* primary action stays direct, and all available choices remain in the menu.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ExplorationActionControl({ actions, ariaLabel, className, hidePrimary, contextOnly, indicator, ref, }: ExplorationActionControlProps): import("react").JSX.Element | null;
|
|
33
|
+
/** Menu content for an item-level trigger composed by a chart or custom control. */
|
|
34
|
+
export declare function ExplorationActionMenu({ actions, ariaLabel, triggerRef, placement, }: Pick<ExplorationActionControlProps, 'actions' | 'ariaLabel'> & {
|
|
35
|
+
triggerRef?: RefObject<ComponentRef<'button'> | null>;
|
|
36
|
+
placement?: 'bottom' | 'bottom start' | 'bottom end';
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
/** Adds clipboard utilities derived only from the displayed chart item. */
|
|
39
|
+
export declare function useChartActions(): {
|
|
40
|
+
actions(declared: readonly ExplorationAction[], label: string, summary: string): readonly ExplorationAction[];
|
|
41
|
+
feedback: import("react").JSX.Element | null;
|
|
42
|
+
};
|
|
43
|
+
export declare function openExplorationMenu(trigger: RefObject<HTMLButtonElement | null>, event: {
|
|
44
|
+
preventDefault: () => void;
|
|
45
|
+
currentTarget?: EventTarget | null;
|
|
46
|
+
}, point?: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}): void;
|
|
50
|
+
/** Reuse the item's menu for pointer and keyboard context requests. */
|
|
51
|
+
export declare function explorationMenuEvents(trigger: RefObject<HTMLButtonElement | null>): {
|
|
52
|
+
onContextMenu: (event: {
|
|
53
|
+
preventDefault: () => void;
|
|
54
|
+
clientX: number;
|
|
55
|
+
clientY: number;
|
|
56
|
+
}) => void;
|
|
57
|
+
onKeyDown(event: KeyboardEvent<Element>): void;
|
|
58
|
+
};
|
|
59
|
+
/** The direct action for an item, when the action declaration supplies one. */
|
|
60
|
+
export declare function getPrimaryExplorationAction(actions: readonly ExplorationAction[]): ExplorationAction | undefined;
|
|
@@ -10,6 +10,14 @@ export declare function scrollFadeEdges(metrics: ScrollMetrics, axis: 'vertical'
|
|
|
10
10
|
start: boolean;
|
|
11
11
|
end: boolean;
|
|
12
12
|
};
|
|
13
|
+
/** Track overflow on the element that owns scrolling. */
|
|
14
|
+
export declare function useScrollFade(axis: 'vertical' | 'horizontal'): {
|
|
15
|
+
ref: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null>>;
|
|
16
|
+
edges: {
|
|
17
|
+
start: boolean;
|
|
18
|
+
end: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
13
21
|
/** Fades only scrollable edges; content, size, and scroll changes update the mask. */
|
|
14
22
|
export declare function GradientScroll({ axis, fadeStart, className, children, ref, ...props }: GradientScrollProps): import("react").JSX.Element;
|
|
15
23
|
export {};
|
|
@@ -5,7 +5,7 @@ export type GridProps = {
|
|
|
5
5
|
columns?: 1 | 2 | 3 | 4;
|
|
6
6
|
minItemWidth?: 'compact' | 'regular' | 'wide';
|
|
7
7
|
gap?: 'sm' | 'md' | 'lg';
|
|
8
|
-
/**
|
|
8
|
+
/** `stretch` gives widgets in each row the same height. */
|
|
9
9
|
align?: 'stretch' | 'start';
|
|
10
10
|
} & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
11
11
|
/** Responsive layout for peer cards and panels. Cards keep their content height by default. */
|