@altertable/data-app 0.66.0 → 0.68.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/CONTRIBUTING.md +22 -16
- package/dist/chunks/{contract-19ckn3n7.js → index-23dktynd.js} +8 -6
- package/dist/chunks/index-23dktynd.js.map +10 -0
- package/dist/chunks/{contract-rfbakka4.js → index-ag0cgnvq.js} +169 -35
- package/dist/chunks/index-ag0cgnvq.js.map +13 -0
- package/dist/chunks/index-dq7b35fn.js +307 -0
- package/dist/chunks/index-dq7b35fn.js.map +13 -0
- package/dist/chunks/{contract-e11m4y7f.js → index-ev2b5aaf.js} +11 -6
- package/dist/chunks/{contract-e11m4y7f.js.map → index-ev2b5aaf.js.map} +3 -3
- package/dist/chunks/{contract-awa2d5b1.js → index-f5cnbrjz.js} +19 -2
- package/dist/chunks/{contract-awa2d5b1.js.map → index-f5cnbrjz.js.map} +4 -3
- package/dist/chunks/{contract-havnjmdr.js → index-gvers8jw.js} +2429 -1110
- package/dist/chunks/index-gvers8jw.js.map +109 -0
- package/dist/chunks/{contract-13j5zb3c.js → index-ktmvs916.js} +8 -7
- package/dist/chunks/index-ktmvs916.js.map +13 -0
- package/dist/chunks/index-mt93ff2b.js +28 -0
- package/dist/chunks/index-mt93ff2b.js.map +10 -0
- package/dist/chunks/{contract-tf8c3qpv.js → index-qd5xgx6y.js} +46 -5
- package/dist/chunks/index-qd5xgx6y.js.map +13 -0
- package/dist/chunks/{contract-pk603qj7.js → index-x69p7cv7.js} +12 -9
- package/dist/chunks/index-x69p7cv7.js.map +10 -0
- package/dist/client/index.js +6 -6
- package/dist/core/appearance.js +1 -1
- package/dist/core/config.js +7 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/contract.js +14 -6
- package/dist/core/contract.js.map +1 -1
- package/dist/core/format.js +1 -1
- package/dist/embed/index.js +12 -10
- package/dist/embed/index.js.map +4 -4
- package/dist/index.js +12 -0
- package/dist/index.js.map +9 -0
- package/dist/local.js +20 -30
- package/dist/local.js.map +7 -8
- package/dist/react/embed/index.js +1 -1
- package/dist/react/embed/index.js.map +2 -2
- package/dist/react/index.js +79 -29
- package/dist/react/index.js.map +5 -6
- package/dist/react/ui/index.js +1702 -177
- package/dist/react/ui/index.js.map +20 -9
- package/dist/server.js +13 -26
- package/dist/server.js.map +6 -7
- package/dist/types/client/annotations.d.ts +4 -0
- package/dist/types/client/data-client.d.ts +1 -2
- package/dist/types/client/iframe.d.ts +4 -2
- package/dist/types/core/annotations.d.ts +2 -0
- package/dist/types/core/config.d.ts +48 -4
- package/dist/types/core/contract.d.ts +20 -12
- package/dist/types/core/dimension.d.ts +6 -4
- package/dist/types/core/filters.d.ts +44 -0
- package/dist/types/core/messages.d.ts +2 -0
- package/dist/types/core/operation-types.d.ts +5 -2
- package/dist/types/core/operation.d.ts +3 -4
- package/dist/types/core/queries.d.ts +16 -0
- package/dist/types/core/uuid.d.ts +2 -0
- package/dist/types/core/variables.d.ts +32 -13
- package/dist/types/embed/runtime-html.d.ts +2 -0
- package/dist/types/embed/source.d.ts +2 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/react/annotations/AnnotationBar.d.ts +7 -1
- package/dist/types/react/annotations/AnnotationEditor.d.ts +2 -1
- package/dist/types/react/annotations/useDataAppAnnotations.d.ts +3 -0
- package/dist/types/react/app-context.d.ts +3 -0
- package/dist/types/react/index.d.ts +3 -3
- package/dist/types/react/mount.d.ts +6 -4
- package/dist/types/react/style-contract.d.ts +34 -2
- package/dist/types/react/ui/Button.d.ts +3 -3
- package/dist/types/react/ui/ChartLegend.d.ts +31 -0
- package/dist/types/react/ui/Checkbox.d.ts +15 -4
- package/dist/types/react/ui/CheckboxGroup.d.ts +7 -0
- package/dist/types/react/ui/{Combobox.d.ts → ChoicePicker.d.ts} +10 -15
- package/dist/types/react/ui/ComposedChart.d.ts +41 -0
- package/dist/types/react/ui/ComposedChartLegend.d.ts +8 -0
- package/dist/types/react/ui/DataAppFrame.d.ts +1 -2
- package/dist/types/react/ui/DimensionPicker.d.ts +1 -1
- package/dist/types/react/ui/FilterActions.d.ts +10 -0
- package/dist/types/react/ui/FilterBar.d.ts +3 -0
- package/dist/types/react/ui/FunnelChart.d.ts +20 -0
- package/dist/types/react/ui/GettingStarted.d.ts +2 -4
- package/dist/types/react/ui/JourneyChart.d.ts +10 -0
- package/dist/types/react/ui/Menu.d.ts +12 -0
- package/dist/types/react/ui/NumberField.d.ts +27 -0
- package/dist/types/react/ui/NumberFilterPicker.d.ts +9 -0
- package/dist/types/react/ui/PieChart.d.ts +5 -2
- package/dist/types/react/ui/RadioGroup.d.ts +18 -0
- package/dist/types/react/ui/RetentionChart.d.ts +27 -0
- package/dist/types/react/ui/SearchInput.d.ts +2 -2
- package/dist/types/react/ui/Select.d.ts +14 -0
- package/dist/types/react/ui/SelectionMark.d.ts +2 -1
- package/dist/types/react/ui/TooltipSurface.d.ts +3 -0
- package/dist/types/react/ui/chart-data.d.ts +10 -1
- package/dist/types/react/ui/chart-primitives.d.ts +22 -0
- package/dist/types/react/ui/chartColor.d.ts +1 -0
- package/dist/types/react/ui/icons.d.ts +1 -0
- package/dist/types/react/ui/index.d.ts +33 -2
- package/dist/types/react/ui/journey-flow.d.ts +49 -0
- package/dist/types/react/ui/keyboard.d.ts +6 -0
- package/dist/types/react/ui/shortcuts.d.ts +7 -0
- package/dist/types/react/ui/useAppAppearance.d.ts +1 -1
- package/dist/types/react/ui/useSvgId.d.ts +2 -0
- package/dist/types/react/ui/variables.d.ts +4 -2
- package/dist/types/react/view-controls.d.ts +3 -1
- package/dist/types/server/handler.d.ts +4 -4
- package/dist/worker.js +21 -738
- package/docs/app-authoring.md +15 -1
- package/docs/client.md +8 -8
- package/docs/contract.md +43 -20
- package/docs/data-context.md +8 -6
- package/docs/embed.md +10 -2
- package/docs/formatting-and-appearance.md +23 -7
- package/docs/hosted-apps.md +9 -2
- package/docs/layout.md +1 -1
- package/docs/react-embed.md +3 -2
- package/docs/react.md +4 -3
- package/docs/server-bun.md +1 -1
- package/docs/server.md +4 -4
- package/docs/styling.md +10 -3
- package/docs/ui.md +176 -3
- package/docs/variables.md +80 -7
- package/docs/views.md +4 -8
- package/docs/widgets.md +19 -13
- package/docs/worker.md +2 -1
- package/examples/starter-data-app/index.tsx +34 -32
- package/package.json +16 -11
- package/dist/chunks/contract-13j5zb3c.js.map +0 -13
- package/dist/chunks/contract-19ckn3n7.js.map +0 -10
- package/dist/chunks/contract-h8a6f559.js +0 -286
- package/dist/chunks/contract-h8a6f559.js.map +0 -12
- package/dist/chunks/contract-havnjmdr.js.map +0 -99
- package/dist/chunks/contract-pk603qj7.js.map +0 -10
- package/dist/chunks/contract-rfbakka4.js.map +0 -13
- package/dist/chunks/contract-tf8c3qpv.js.map +0 -11
- package/dist/chunks/contract-wz59z8pq.js +0 -8
- package/dist/chunks/contract-wz59z8pq.js.map +0 -10
- /package/dist/chunks/{contract-m6n8ctfc.js → index-m6n8ctfc.js} +0 -0
- /package/dist/chunks/{contract-m6n8ctfc.js.map → index-m6n8ctfc.js.map} +0 -0
- /package/dist/chunks/{contract-mev09s5v.js → index-mev09s5v.js} +0 -0
- /package/dist/chunks/{contract-mev09s5v.js.map → index-mev09s5v.js.map} +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type { DataOperations, Lakehouse, DataQueryBody } from './operation-types.js';
|
|
1
|
+
import type { DataOperations, Lakehouse, OperationContext, DataQueryBody } from './operation-types.js';
|
|
2
2
|
type Operation = DataOperations[string];
|
|
3
3
|
type OperationExecutionOptions = {
|
|
4
4
|
operationName: string;
|
|
5
5
|
lakehouse: Lakehouse;
|
|
6
6
|
signal: AbortSignal;
|
|
7
|
-
/** Include query evidence in the response; this does not keep browser-owned SQL private. */
|
|
8
|
-
includeSql: boolean;
|
|
9
7
|
requestId: string;
|
|
8
|
+
queryParams?: OperationContext['queryParams'];
|
|
10
9
|
};
|
|
11
10
|
/** Shared operation execution. Adapters own authorization, delivery, and public errors. */
|
|
12
|
-
export declare function executeDataOperation(operation: Operation, value: unknown, { operationName, lakehouse, signal: requestSignal,
|
|
11
|
+
export declare function executeDataOperation(operation: Operation, value: unknown, { operationName, lakehouse, signal: requestSignal, requestId, queryParams, }: OperationExecutionOptions): Promise<{
|
|
13
12
|
body: DataQueryBody<unknown>;
|
|
14
13
|
serializedBody: string;
|
|
15
14
|
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type QueryParameterValue = string | number | boolean | null;
|
|
2
|
+
type QueryDefinition = {
|
|
3
|
+
statement: string;
|
|
4
|
+
params: Readonly<Record<string, {
|
|
5
|
+
defaultValue?: QueryParameterValue;
|
|
6
|
+
}>>;
|
|
7
|
+
};
|
|
8
|
+
export type QueryDefinitions = Readonly<Record<string, QueryDefinition>>;
|
|
9
|
+
/** Parameters are scalar SQL values, never identifiers or SQL fragments. */
|
|
10
|
+
export type QueryParameters = Readonly<Record<string, QueryParameterValue>>;
|
|
11
|
+
export declare function isQueryParameters(value: unknown): value is QueryParameters;
|
|
12
|
+
/** Retain authored statements and defaults, rejecting empty SQL and invalid scalar defaults. */
|
|
13
|
+
export declare function snapshotQueries(definitions: QueryDefinitions): QueryDefinitions;
|
|
14
|
+
/** Context owns protected values; callers supply filters; defaults fill remaining declarations. */
|
|
15
|
+
export declare function resolveQueryParameters(declarations: QueryDefinition['params'], values: Partial<QueryParameters>, context: QueryParameters): QueryParameters;
|
|
16
|
+
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { type DatePresetId, type DateRange } from './date-range.js';
|
|
2
2
|
import type { DateRangeContract, DateRangeRequest } from './contract.js';
|
|
3
3
|
import type { DimensionSelection, DimensionVariable } from './dimension.js';
|
|
4
|
+
import type { NumberFilter, BooleanFilter } from './filters.js';
|
|
4
5
|
import type { HistoryMode } from './navigation.js';
|
|
5
6
|
export type { HistoryMode } from './navigation.js';
|
|
6
7
|
/** An app-owned value with one URL representation. Controls never parse or write routes. */
|
|
7
|
-
export type AppVariable<Value, Kind extends string =
|
|
8
|
+
export type AppVariable<Value, Kind extends string = string> = {
|
|
8
9
|
kind: Kind;
|
|
9
10
|
label?: string;
|
|
10
|
-
options?: readonly {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}[];
|
|
14
11
|
urlKeys: readonly string[];
|
|
15
12
|
defaultValue: Value;
|
|
13
|
+
/** Unrestricted value, when this variable represents a filter. */
|
|
14
|
+
clearValue?: Value;
|
|
15
|
+
describe?: (value: Value) => string;
|
|
16
16
|
history: HistoryMode;
|
|
17
17
|
read: (params: URLSearchParams) => Value;
|
|
18
18
|
write: (value: Value) => Record<string, string | null>;
|
|
19
19
|
valid: (value: Value) => boolean;
|
|
20
20
|
same: (left: Value, right: Value) => boolean;
|
|
21
21
|
};
|
|
22
|
-
export type VariableCollection = Record<string,
|
|
22
|
+
export type VariableCollection = Record<string, SearchVariable | ChoiceVariable | MultiChoiceVariable | DateRangeVariable | DimensionVariable<any> | NumberFilter | BooleanFilter>;
|
|
23
23
|
export type AppVariableValues<Variables> = {
|
|
24
24
|
[Key in keyof Variables]: Variables[Key] extends DimensionVariable<infer Value> ? DimensionSelection<Value> : Variables[Key] extends AppVariable<infer Value, string> ? Value : never;
|
|
25
25
|
};
|
|
@@ -31,13 +31,32 @@ type ScalarVariableOptions = {
|
|
|
31
31
|
defaultValue?: string;
|
|
32
32
|
history?: HistoryMode;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
export type SearchVariable = AppVariable<string, 'search'>;
|
|
35
|
+
export type ChoiceOption = {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
};
|
|
40
|
+
export type ChoiceVariable = AppVariable<string, 'choice'> & {
|
|
41
|
+
options: readonly ChoiceOption[];
|
|
42
|
+
};
|
|
43
|
+
export type MultiChoiceVariable = AppVariable<readonly string[], 'multiChoice'> & {
|
|
44
|
+
options: readonly ChoiceOption[];
|
|
45
|
+
maxSelected: number;
|
|
46
|
+
};
|
|
47
|
+
/** Search query state; typing replaces history by default. */
|
|
48
|
+
export declare function searchVariable({ key, label, defaultValue, history, }: ScalarVariableOptions): SearchVariable;
|
|
49
|
+
/** Validate labeled choices before controls or URL state consume them. */
|
|
50
|
+
export declare function validateChoiceOptions(options: readonly ChoiceOption[]): void;
|
|
51
|
+
export declare function choiceVariable({ key, label, defaultValue, options, history, }: ScalarVariableOptions & {
|
|
38
52
|
defaultValue: string;
|
|
39
|
-
|
|
40
|
-
}):
|
|
53
|
+
options: readonly ChoiceOption[];
|
|
54
|
+
}): ChoiceVariable;
|
|
55
|
+
export declare function multiChoiceVariable({ key, label, defaultValue, options, maxSelected, history, }: Omit<ScalarVariableOptions, 'defaultValue'> & {
|
|
56
|
+
defaultValue?: readonly string[];
|
|
57
|
+
options: readonly ChoiceOption[];
|
|
58
|
+
maxSelected?: number;
|
|
59
|
+
}): MultiChoiceVariable;
|
|
41
60
|
export type DateRangeSelection = {
|
|
42
61
|
kind: 'preset';
|
|
43
62
|
id: DatePresetId;
|
|
@@ -60,7 +79,7 @@ export type DateRangeVariableOptions = {
|
|
|
60
79
|
/** Opt into a URL-backed comparison with the preceding equal-length range. */
|
|
61
80
|
comparison?: boolean;
|
|
62
81
|
};
|
|
63
|
-
export type DateRangeVariable = AppVariable<DateRangeSelection> & {
|
|
82
|
+
export type DateRangeVariable = AppVariable<DateRangeSelection, 'dateRange'> & {
|
|
64
83
|
kind: 'dateRange';
|
|
65
84
|
supportsComparison: boolean;
|
|
66
85
|
input: (selection: DateRangeSelection) => DateRangeRequest;
|
|
@@ -4,7 +4,8 @@ export type DataAppSource = {
|
|
|
4
4
|
url: string;
|
|
5
5
|
} | {
|
|
6
6
|
type: 'bundle';
|
|
7
|
-
|
|
7
|
+
/** Omit to use the packaged, network-isolated data document. */
|
|
8
|
+
bootstrapUrl?: string;
|
|
8
9
|
javascript: string;
|
|
9
10
|
};
|
|
10
11
|
export type DataAppSourceOptions = DataAppHostOptions & {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
1
2
|
import type { Theme } from '../../core/appearance.js';
|
|
2
3
|
import { type DataAppAnnotationDraft } from '../../core/annotations.js';
|
|
4
|
+
export type AnnotationBarHandle = {
|
|
5
|
+
/** Submit through the same guards, pending state, and retry feedback as the Send button. */
|
|
6
|
+
send: () => Promise<void>;
|
|
7
|
+
};
|
|
3
8
|
export type AnnotationBarProps = {
|
|
9
|
+
ref?: Ref<AnnotationBarHandle>;
|
|
4
10
|
annotations: readonly DataAppAnnotationDraft[];
|
|
5
11
|
active?: boolean;
|
|
6
12
|
theme?: Theme;
|
|
@@ -21,4 +27,4 @@ export type AnnotationBarProps = {
|
|
|
21
27
|
onClose: () => void;
|
|
22
28
|
};
|
|
23
29
|
/** Host-owned batch controls. Collection changes and agent submission stay with the outer app. */
|
|
24
|
-
export declare function AnnotationBar({ annotations, active, theme, disabled, deletedAnnotationId, onUndoDelete, onDismissUndo, hasUnsavedChanges, pinsVisible, onPinsVisibleChange, onSelect, onDelete, onClear, requestDiscard, onSend, onClose, }: AnnotationBarProps): import("react").JSX.Element | null;
|
|
30
|
+
export declare function AnnotationBar({ ref, annotations, active, theme, disabled, deletedAnnotationId, onUndoDelete, onDismissUndo, hasUnsavedChanges, pinsVisible, onPinsVisibleChange, onSelect, onDelete, onClear, requestDiscard, onSend, onClose, }: AnnotationBarProps): import("react").JSX.Element | null;
|
|
@@ -8,8 +8,9 @@ type AnnotationEditorProps = {
|
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
onCommentChange: (comment: string) => void;
|
|
10
10
|
onSubmit: () => void;
|
|
11
|
+
onSend: () => void;
|
|
11
12
|
onRetryScreenshot: () => void;
|
|
12
13
|
onShakeEnd: () => void;
|
|
13
14
|
};
|
|
14
|
-
export declare function AnnotationEditor({ editor, editorRef, textareaRef, style, disabled, onCommentChange, onSubmit, onRetryScreenshot, onShakeEnd, }: AnnotationEditorProps): import("react").JSX.Element;
|
|
15
|
+
export declare function AnnotationEditor({ editor, editorRef, textareaRef, style, disabled, onCommentChange, onSubmit, onSend, onRetryScreenshot, onShakeEnd, }: AnnotationEditorProps): import("react").JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** Bind annotation delivery to this app's current iframe bridge. The host owns storage and submission. */
|
|
2
2
|
export declare function useDataAppAnnotations(): {
|
|
3
|
+
requestSendAnnotations(options?: {
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
}): Promise<null>;
|
|
3
6
|
reportAnnotationEditorState(state: {
|
|
4
7
|
hasUnsavedChanges: boolean;
|
|
5
8
|
}, options?: {
|
|
@@ -46,8 +46,8 @@ export { UpdatedAt } from './ui/UpdatedAt.js';
|
|
|
46
46
|
export type { UpdatedAtProps } from './ui/UpdatedAt.js';
|
|
47
47
|
export { DateTimeTooltip } from './ui/DateTimeTooltip.js';
|
|
48
48
|
export type { DateTimeTooltipProps } from './ui/DateTimeTooltip.js';
|
|
49
|
-
export {
|
|
50
|
-
export type { AppVariable, AppVariableValues, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
|
|
49
|
+
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';
|
|
51
51
|
export { PeriodSummary } from './ui/PeriodSummary.js';
|
|
52
52
|
export type { ReportingPeriod, PeriodComparison, PeriodSummaryProps, } from './ui/PeriodSummary.js';
|
|
53
53
|
export { createDataContext } from './ui/data-context.js';
|
|
@@ -66,5 +66,5 @@ export { AnnotationTarget } from './annotations/AnnotationTarget.js';
|
|
|
66
66
|
export type { AnnotationTargetProps } from './annotations/AnnotationTarget.js';
|
|
67
67
|
export { useDataAppAnnotations } from './annotations/useDataAppAnnotations.js';
|
|
68
68
|
export { AnnotationBar } from './annotations/AnnotationBar.js';
|
|
69
|
-
export type { AnnotationBarProps } from './annotations/AnnotationBar.js';
|
|
69
|
+
export type { AnnotationBarHandle, AnnotationBarProps, } from './annotations/AnnotationBar.js';
|
|
70
70
|
export { injectDataAppAnnotationStyles } from './annotations/styles.js';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataAppDefinition, type QueryDefinitions } from '../core/config.js';
|
|
3
3
|
/** Mount once per document; installs document identity and the shared request provider. */
|
|
4
|
-
export declare function mountDataApp({
|
|
5
|
-
|
|
4
|
+
export declare function mountDataApp<const Queries extends QueryDefinitions>({ app, component: Component, root, }: {
|
|
5
|
+
app: DataAppDefinition<Queries>;
|
|
6
6
|
component: ComponentType;
|
|
7
7
|
root?: HTMLElement | null;
|
|
8
8
|
}): void;
|
|
9
|
-
|
|
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>;
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
}): import("react").JSX.Element;
|
|
@@ -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-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-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'];
|
|
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': {
|
|
@@ -43,6 +43,38 @@ export declare const dataAppStyleClasses: {
|
|
|
43
43
|
readonly component: 'DataAppSkeleton';
|
|
44
44
|
readonly kind: 'root';
|
|
45
45
|
};
|
|
46
|
+
readonly 'altertable-chart-legend': {
|
|
47
|
+
readonly component: 'ChartLegend';
|
|
48
|
+
readonly kind: 'root';
|
|
49
|
+
};
|
|
50
|
+
readonly 'altertable-chart-legend-item': {
|
|
51
|
+
readonly component: 'ChartLegend.Item';
|
|
52
|
+
readonly kind: 'root';
|
|
53
|
+
};
|
|
54
|
+
readonly 'altertable-chart-legend-marker': {
|
|
55
|
+
readonly component: 'ChartLegend.Marker';
|
|
56
|
+
readonly kind: 'root';
|
|
57
|
+
};
|
|
58
|
+
readonly 'altertable-chart-legend-label': {
|
|
59
|
+
readonly component: 'ChartLegend.Label';
|
|
60
|
+
readonly kind: 'root';
|
|
61
|
+
};
|
|
62
|
+
readonly 'altertable-funnel-chart': {
|
|
63
|
+
readonly component: 'FunnelChart';
|
|
64
|
+
readonly kind: 'root';
|
|
65
|
+
};
|
|
66
|
+
readonly 'altertable-retention-chart': {
|
|
67
|
+
readonly component: 'RetentionChart';
|
|
68
|
+
readonly kind: 'root';
|
|
69
|
+
};
|
|
70
|
+
readonly 'altertable-journey-chart': {
|
|
71
|
+
readonly component: 'JourneyChart';
|
|
72
|
+
readonly kind: 'root';
|
|
73
|
+
};
|
|
74
|
+
readonly 'altertable-composed-chart': {
|
|
75
|
+
readonly component: 'ComposedChart';
|
|
76
|
+
readonly kind: 'root';
|
|
77
|
+
};
|
|
46
78
|
readonly 'altertable-sr-only': {
|
|
47
79
|
readonly component: null;
|
|
48
80
|
readonly kind: 'utility';
|
|
@@ -50,7 +82,7 @@ export declare const dataAppStyleClasses: {
|
|
|
50
82
|
};
|
|
51
83
|
export declare const dataAppStyleHooks: {
|
|
52
84
|
readonly 'data-atbl-focus': readonly ['ring', 'inset', 'group'];
|
|
53
|
-
readonly 'data-atbl-control': readonly ['action', 'help', 'text'];
|
|
85
|
+
readonly 'data-atbl-control': readonly ['default', 'action', 'help', 'text'];
|
|
54
86
|
};
|
|
55
87
|
export type DataAppStyleToken = (typeof dataAppStyleTokens)[number];
|
|
56
88
|
/** React style properties with checked public Altertable custom properties. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Button as AriaButton } from 'react-aria-components';
|
|
3
3
|
export type ButtonProps = ComponentPropsWithRef<'button'> & {
|
|
4
|
-
variant?: 'elevated' | 'outline' | 'ghost';
|
|
4
|
+
variant?: 'primary' | 'elevated' | 'outline' | 'ghost';
|
|
5
5
|
size?: 'default' | 'compact' | 'icon' | 'icon-compact';
|
|
6
6
|
};
|
|
7
7
|
export declare function Button({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
8
8
|
/** React Aria trigger behavior with the same presentation as the native Button. */
|
|
9
|
-
export declare function PressButton({ variant, size, className, ...props }: Omit<
|
|
9
|
+
export declare function PressButton({ variant, size, className, ...props }: Omit<ComponentPropsWithRef<typeof AriaButton>, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
|
|
10
10
|
className?: string;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
export type ChartLegendProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
layout?: 'horizontal' | 'vertical';
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
/** Maximum visible cells, including the expansion control; defaults to six. */
|
|
7
|
+
maxVisibleItems?: number;
|
|
8
|
+
} & Omit<ComponentPropsWithRef<'ul'>, 'children'>;
|
|
9
|
+
/** Optional chart key, placed beside any chart with the app's layout components.
|
|
10
|
+
* Items describe displayed series or categories; the caller owns series visibility and interactions. */
|
|
11
|
+
declare function ChartLegendRoot({ children, layout, align, maxVisibleItems, className, 'aria-label': ariaLabel, ...props }: ChartLegendProps): import("react").JSX.Element;
|
|
12
|
+
export type ChartLegendItemProps = ComponentPropsWithRef<'li'> & {
|
|
13
|
+
inactive?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Descriptive by default; compose a button inside the item for an authored series toggle. */
|
|
16
|
+
declare function ChartLegendItem({ inactive, className, ...props }: ChartLegendItemProps): import("react").JSX.Element;
|
|
17
|
+
export type ChartLegendMarkerKind = 'square' | 'bar' | 'line' | 'area' | 'point' | 'slice';
|
|
18
|
+
export type ChartLegendMarkerProps = Omit<ComponentPropsWithRef<'svg'>, 'children'> & {
|
|
19
|
+
kind: ChartLegendMarkerKind;
|
|
20
|
+
};
|
|
21
|
+
/** Decorative mark; color accepts public palette tokens or any CSS color.
|
|
22
|
+
* Defaults match the shared bar or accent-colored series primitives. */
|
|
23
|
+
declare function ChartLegendMarker({ kind, color, className, style, ...props }: ChartLegendMarkerProps): import("react").JSX.Element;
|
|
24
|
+
export type ChartLegendLabelProps = ComponentPropsWithRef<'span'>;
|
|
25
|
+
declare function ChartLegendLabel({ className, children, title, ...props }: ChartLegendLabelProps): import("react").JSX.Element;
|
|
26
|
+
export declare const ChartLegend: typeof ChartLegendRoot & {
|
|
27
|
+
Item: typeof ChartLegendItem;
|
|
28
|
+
Marker: typeof ChartLegendMarker;
|
|
29
|
+
Label: typeof ChartLegendLabel;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
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>;
|
|
2
7
|
export type CheckboxProps = {
|
|
3
8
|
label: string;
|
|
4
9
|
description?: ReactNode;
|
|
5
|
-
checked: boolean;
|
|
6
|
-
onChange: (checked: boolean) => void;
|
|
7
10
|
disabled?: boolean;
|
|
8
11
|
className?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
};
|
|
1
|
+
import type { ChoiceOption } from '../../core/variables.js';
|
|
2
|
+
export type { ChoiceOption } from '../../core/variables.js';
|
|
7
3
|
type SharedProps = {
|
|
8
4
|
label: string;
|
|
9
|
-
options:
|
|
5
|
+
options: readonly ChoiceOption[];
|
|
10
6
|
/** Separate source state, rendered last with a divider and the shared option component. */
|
|
11
|
-
missingOption?:
|
|
7
|
+
missingOption?: ChoiceOption;
|
|
12
8
|
disabled?: boolean;
|
|
13
9
|
placeholder?: string;
|
|
14
10
|
emptyMessage?: string;
|
|
@@ -18,15 +14,16 @@ type SharedProps = {
|
|
|
18
14
|
error?: boolean;
|
|
19
15
|
onRetry?: () => void;
|
|
20
16
|
};
|
|
21
|
-
export type
|
|
17
|
+
export type SingleChoicePickerProps = SharedProps & {
|
|
18
|
+
selectionMode: 'single';
|
|
22
19
|
value: string;
|
|
23
20
|
onChange: (value: string) => void;
|
|
24
|
-
resetValue?: string;
|
|
25
21
|
values?: never;
|
|
26
22
|
maxSelected?: never;
|
|
27
23
|
emptySelectionLabel?: never;
|
|
28
24
|
};
|
|
29
|
-
export type
|
|
25
|
+
export type MultiChoicePickerProps = SharedProps & {
|
|
26
|
+
selectionMode: 'multiple';
|
|
30
27
|
values: readonly string[];
|
|
31
28
|
onChange: (values: string[]) => void;
|
|
32
29
|
/** Positive integer; at capacity, only unselected options are disabled. */
|
|
@@ -34,9 +31,7 @@ export type MultiComboboxProps = SharedProps & {
|
|
|
34
31
|
/** Meaning of an empty selection belongs to the caller, e.g. All or Select a value. */
|
|
35
32
|
emptySelectionLabel: string;
|
|
36
33
|
value?: never;
|
|
37
|
-
resetValue?: never;
|
|
38
34
|
};
|
|
39
|
-
export type
|
|
35
|
+
export type ChoicePickerProps = SingleChoicePickerProps | MultiChoicePickerProps;
|
|
40
36
|
/** Searchable selection picker with one focus and popup model for single and multiple values. */
|
|
41
|
-
export declare function
|
|
42
|
-
export {};
|
|
37
|
+
export declare function ChoicePicker(props: ChoicePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { ComposedChartLegend as Legend } from './ComposedChartLegend.js';
|
|
3
|
+
import { ComposedChart as RechartsComposedChart, ZAxis, ReferenceLine, ReferenceArea, ReferenceDot, Brush, Label, LabelList, ErrorBar } from 'recharts';
|
|
4
|
+
import { ChartBar as Bar, ChartDot as Dot, ChartLine as Line, ChartArea as Area, ChartScatter as Scatter, ChartXAxis as XAxis, ChartYAxis as YAxis, ChartGrid as CartesianGrid, ChartTooltip as Tooltip } from './chart-primitives.js';
|
|
5
|
+
export type ComposedChartProps<Row = unknown> = Omit<ComponentProps<typeof RechartsComposedChart<Row>>, 'data' | 'title'> & {
|
|
6
|
+
/** Displayed rows; series and axes select fields with Recharts dataKey props. */
|
|
7
|
+
data: readonly Row[];
|
|
8
|
+
/** Describes the measures and scope for assistive technology. */
|
|
9
|
+
ariaLabel: string;
|
|
10
|
+
};
|
|
11
|
+
/** Compose Cartesian series inside VisualizationWidget. Defaults to responsive
|
|
12
|
+
* full width and 300px height. Children retain native Recharts props and behavior,
|
|
13
|
+
* including stacking, numeric/time axes, missing values, tooltips, and keyboard
|
|
14
|
+
* navigation. Match yAxisId on axes and series for different units; use stackId
|
|
15
|
+
* for stacks. Preserve missing measures as null and choose connectNulls deliberately.
|
|
16
|
+
* Use public chart tokens for series colors. Dataset bindings own
|
|
17
|
+
* loading, empty results, evidence, and CSV; this primitive owns only the plot. */
|
|
18
|
+
declare function ComposedChartRoot<Row>({ data, ariaLabel, width, height, responsive, className, ...props }: ComposedChartProps<Row>): import("react").JSX.Element;
|
|
19
|
+
/** Shared themed series and controls; other children retain native Recharts defaults. */
|
|
20
|
+
export declare const ComposedChart: typeof ComposedChartRoot & {
|
|
21
|
+
Dot: typeof Dot;
|
|
22
|
+
Area: typeof Area;
|
|
23
|
+
Bar: typeof Bar;
|
|
24
|
+
Line: typeof Line;
|
|
25
|
+
Scatter: typeof Scatter;
|
|
26
|
+
XAxis: typeof XAxis;
|
|
27
|
+
YAxis: typeof YAxis;
|
|
28
|
+
ZAxis: typeof ZAxis;
|
|
29
|
+
CartesianGrid: typeof CartesianGrid;
|
|
30
|
+
Tooltip: typeof Tooltip;
|
|
31
|
+
Legend: typeof Legend;
|
|
32
|
+
ReferenceLine: typeof ReferenceLine;
|
|
33
|
+
ReferenceArea: typeof ReferenceArea;
|
|
34
|
+
ReferenceDot: typeof ReferenceDot;
|
|
35
|
+
Brush: typeof Brush;
|
|
36
|
+
Cell: import("react").FunctionComponent<import("recharts").CellProps>;
|
|
37
|
+
Label: typeof Label;
|
|
38
|
+
LabelList: typeof LabelList;
|
|
39
|
+
ErrorBar: typeof ErrorBar;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { Legend } from 'recharts';
|
|
3
|
+
export type ComposedChartLegendProps = ComponentProps<typeof Legend> & {
|
|
4
|
+
maxVisibleItems?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Opt in inside ComposedChart to derive the shared legend from its displayed series.
|
|
7
|
+
* Native positioning, sorting, formatters, callbacks, and custom content remain available. */
|
|
8
|
+
export declare function ComposedChartLegend({ maxVisibleItems, ...props }: ComposedChartLegendProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { DisclosedQuery } from '../../core/contract.js';
|
|
3
|
-
import type { DataAppConfig } from '../../core/config.js';
|
|
4
3
|
import type { CsvExport } from './csv-export.js';
|
|
5
4
|
import { type DisplayedSnapshot } from '../../core/data-view.js';
|
|
6
5
|
import type { DataContext } from './data-context.js';
|
|
@@ -8,8 +7,8 @@ import type { BoundStory } from './story.js';
|
|
|
8
7
|
import type { SectionResult } from './DataSectionBoundary.js';
|
|
9
8
|
export type DataAppBaseProps = {
|
|
10
9
|
children: ReactNode;
|
|
11
|
-
config: DataAppConfig;
|
|
12
10
|
dataContext: DataContext;
|
|
11
|
+
/** Override the declared subtitle; null hides it. */
|
|
13
12
|
description?: ReactNode;
|
|
14
13
|
toolbarActions?: ReactNode;
|
|
15
14
|
footerActions?: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DimensionOption, DimensionSelection, DimensionValue, DimensionVariable } from '../../core/dimension.js';
|
|
2
|
-
/** Adapts the typed dimension contract to the shared
|
|
2
|
+
/** Adapts the typed dimension contract to the shared ChoicePicker control. */
|
|
3
3
|
export declare function DimensionPicker<T extends DimensionValue>({ filter, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
|
|
4
4
|
filter: DimensionVariable<T>;
|
|
5
5
|
value: DimensionSelection<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type FilterActionsProps = {
|
|
2
|
+
onClear?: () => void;
|
|
3
|
+
} & ({
|
|
4
|
+
onApply: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
} | {
|
|
7
|
+
onApply?: never;
|
|
8
|
+
onCancel?: never;
|
|
9
|
+
});
|
|
10
|
+
export declare function FilterActions({ onClear, onApply, onCancel, }: FilterActionsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CountChartProps } from './chart-data.js';
|
|
2
|
+
/** Ordered step with a unique, nonblank ID. */
|
|
3
|
+
export type FunnelChartStep = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
export type FunnelChartSeries = {
|
|
8
|
+
/** Unique, nonblank population ID. */
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Finite, nonnegative counts aligned with steps and nonincreasing. */
|
|
12
|
+
values: readonly number[];
|
|
13
|
+
};
|
|
14
|
+
export type FunnelChartProps = CountChartProps & {
|
|
15
|
+
steps: readonly FunnelChartStep[];
|
|
16
|
+
series: readonly FunnelChartSeries[];
|
|
17
|
+
};
|
|
18
|
+
/** Conversion columns with previous-step drop-off, normalized to each series' first step.
|
|
19
|
+
* Owns series highlighting and portion-specific inspection; compose inside VisualizationWidget. */
|
|
20
|
+
export declare function FunnelChart({ steps, series, unit, ariaLabel, className, formatValue, }: FunnelChartProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { DataAppConfig } from '../../core/config.js';
|
|
2
1
|
import type { DataContext } from './data-context.js';
|
|
3
2
|
/** Query-backed connection state and next steps for a newly created app. Mount within
|
|
4
|
-
* `DataAppProvider` and register `connection: connectionCheck()` on the server. */
|
|
5
|
-
export declare function GettingStarted({
|
|
6
|
-
config: DataAppConfig;
|
|
3
|
+
* `DataAppProvider` and register `connection: connectionCheck(app.queries)` on the server. */
|
|
4
|
+
export declare function GettingStarted({ dataContext }: {
|
|
7
5
|
dataContext: DataContext;
|
|
8
6
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CountChartProps } from './chart-data.js';
|
|
2
|
+
import { type JourneyChartPath } from './journey-flow.js';
|
|
3
|
+
export type { JourneyChartPath } from './journey-flow.js';
|
|
4
|
+
export type JourneyChartProps = CountChartProps & {
|
|
5
|
+
/** Full paths and their population counts. Branches and outcomes are derived internally. */
|
|
6
|
+
paths: readonly JourneyChartPath[];
|
|
7
|
+
};
|
|
8
|
+
/** Path exploration with two initial steps, expandable prefixes, and three events per depth.
|
|
9
|
+
* Counts and flows use the Step 1 population. Compose inside VisualizationWidget. */
|
|
10
|
+
export declare function JourneyChart({ paths, unit, ariaLabel, className, formatValue, }: JourneyChartProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { MenuTrigger, MenuSection, Popover, Separator, type MenuProps, type MenuItemProps, type MenuTriggerProps } from 'react-aria-components';
|
|
3
|
+
export { MenuTrigger, MenuSection };
|
|
4
|
+
export { PressButton as MenuButton } from './Button.js';
|
|
5
|
+
export type { MenuProps, MenuItemProps, MenuTriggerProps };
|
|
6
|
+
export type MenuPopoverProps = ComponentPropsWithRef<typeof Popover>;
|
|
7
|
+
/** Anchored popup for a Menu; the surrounding MenuTrigger owns focus and dismissal. */
|
|
8
|
+
export declare function MenuPopover({ className, placement, ...props }: MenuPopoverProps): import("react").JSX.Element;
|
|
9
|
+
/** Actions by default; single selection creates radio items, multiple creates checkbox items. */
|
|
10
|
+
export declare function Menu<T extends object>({ className, ...props }: MenuProps<T>): import("react").JSX.Element;
|
|
11
|
+
export declare function MenuItem<T extends object>({ className, children, ...props }: MenuItemProps<T>): import("react").JSX.Element;
|
|
12
|
+
export declare function MenuSeparator({ className, ...props }: ComponentPropsWithRef<typeof Separator>): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { NumberField as AriaNumberField } from 'react-aria-components';
|
|
3
|
+
export type NumberFieldProps = Omit<ComponentPropsWithRef<typeof AriaNumberField>, 'value' | 'onChange' | 'className'> & {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number | null;
|
|
6
|
+
onChange: (value: number | null) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Localized numeric entry. Empty input is null rather than zero. */
|
|
10
|
+
export declare function NumberField({ label, value, onChange, className, ...props }: NumberFieldProps): import("react").JSX.Element;
|
|
11
|
+
export type NumberRange = {
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
};
|
|
15
|
+
export type NumberRangeFieldProps = {
|
|
16
|
+
label: string;
|
|
17
|
+
value: NumberRange;
|
|
18
|
+
onChange: (value: NumberRange) => void;
|
|
19
|
+
/** Reports whether the current draft interval can be committed. */
|
|
20
|
+
onValidityChange?: (valid: boolean) => void;
|
|
21
|
+
min?: number;
|
|
22
|
+
max?: number;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Commit valid intervals; retain invalid draft bounds so users can correct them. */
|
|
27
|
+
export declare function NumberRangeField({ label, value, onChange, onValidityChange, min, max, disabled, className, }: NumberRangeFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type NumberFilter, type NumberSelection } from '../../core/filters.js';
|
|
2
|
+
export type NumberFilterPickerProps = {
|
|
3
|
+
filter: NumberFilter;
|
|
4
|
+
value: NumberSelection;
|
|
5
|
+
onChange: (value: NumberSelection) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** Edit a numeric predicate in a panel. Apply commits one complete value; dismissing discards the draft. */
|
|
9
|
+
export declare function NumberFilterPicker({ filter, value, onChange, disabled, }: NumberFilterPickerProps): import("react").JSX.Element;
|