@altertable/data-app-react 0.0.0-stage → 0.72.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/LICENSE +21 -0
- package/README.md +59 -2
- package/THIRD_PARTY_NOTICES +18 -0
- package/dist/chunks/index-xwy62xrb.js +16996 -0
- package/dist/chunks/index-xwy62xrb.js.map +120 -0
- package/dist/index.js +2888 -0
- package/dist/index.js.map +23 -0
- package/dist/types/actions.d.ts +53 -0
- package/dist/types/annotations/AnnotationBar.d.ts +30 -0
- package/dist/types/annotations/AnnotationControls.d.ts +10 -0
- package/dist/types/annotations/AnnotationEditor.d.ts +16 -0
- package/dist/types/annotations/AnnotationMarkers.d.ts +19 -0
- package/dist/types/annotations/AnnotationSelectionLayer.d.ts +12 -0
- package/dist/types/annotations/AnnotationTarget.d.ts +9 -0
- package/dist/types/annotations/AnnotationTooltip.d.ts +9 -0
- package/dist/types/annotations/AnnotationTrigger.d.ts +10 -0
- package/dist/types/annotations/annotation-editor-state.d.ts +58 -0
- package/dist/types/annotations/annotation-screenshot.d.ts +4 -0
- package/dist/types/annotations/annotation-targets.d.ts +34 -0
- package/dist/types/annotations/getAnnotationProps.d.ts +17 -0
- package/dist/types/annotations/styles.d.ts +3 -0
- package/dist/types/annotations/useAnnotationGeometry.d.ts +22 -0
- package/dist/types/annotations/useDataAppAnnotations.d.ts +22 -0
- package/dist/types/app-context.d.ts +3 -0
- package/dist/types/bindings.d.ts +169 -0
- package/dist/types/content.d.ts +36 -0
- package/dist/types/date-formatting.d.ts +12 -0
- package/dist/types/details.d.ts +46 -0
- package/dist/types/exploration.d.ts +44 -0
- package/dist/types/hooks.d.ts +114 -0
- package/dist/types/index.d.ts +78 -0
- package/dist/types/injectStyles.d.ts +7 -0
- package/dist/types/mount.d.ts +13 -0
- package/dist/types/search-suggestions.d.ts +8 -0
- package/dist/types/source-owner.d.ts +2 -0
- package/dist/types/style-contract.d.ts +88 -0
- package/dist/types/style-validation.d.ts +2 -0
- package/dist/types/styles.d.ts +8 -0
- package/dist/types/ui/AboutData.d.ts +73 -0
- package/dist/types/ui/AltertableLogo.d.ts +3 -0
- package/dist/types/ui/AppFooter.d.ts +6 -0
- package/dist/types/ui/AppHeader.d.ts +10 -0
- package/dist/types/ui/AppLayout.d.ts +10 -0
- package/dist/types/ui/AppScope.d.ts +7 -0
- package/dist/types/ui/AppToolbar.d.ts +30 -0
- package/dist/types/ui/AreaChart.d.ts +7 -0
- package/dist/types/ui/BarChart.d.ts +6 -0
- package/dist/types/ui/Breakdown.d.ts +13 -0
- package/dist/types/ui/Button.d.ts +12 -0
- package/dist/types/ui/ChartLegend.d.ts +32 -0
- package/dist/types/ui/Checkbox.d.ts +21 -0
- package/dist/types/ui/CheckboxGroup.d.ts +7 -0
- package/dist/types/ui/ChoicePicker.d.ts +39 -0
- package/dist/types/ui/Comparison.d.ts +14 -0
- package/dist/types/ui/ComposedChart.d.ts +41 -0
- package/dist/types/ui/ComposedChartLegend.d.ts +9 -0
- package/dist/types/ui/ContentSkeleton.d.ts +7 -0
- package/dist/types/ui/DataApp.d.ts +24 -0
- package/dist/types/ui/DataAppFrame.d.ts +52 -0
- package/dist/types/ui/DataBoundary.d.ts +14 -0
- package/dist/types/ui/DataSection.d.ts +14 -0
- package/dist/types/ui/DataSectionBoundary.d.ts +30 -0
- package/dist/types/ui/DataTable.d.ts +29 -0
- package/dist/types/ui/DataValue.d.ts +9 -0
- package/dist/types/ui/DataViewToast.d.ts +11 -0
- package/dist/types/ui/DataWidget.d.ts +37 -0
- package/dist/types/ui/DateDisplay.d.ts +9 -0
- package/dist/types/ui/DateRangePicker.d.ts +30 -0
- package/dist/types/ui/DateTimeTooltip.d.ts +10 -0
- package/dist/types/ui/DimensionPicker.d.ts +14 -0
- package/dist/types/ui/EmptyState.d.ts +6 -0
- package/dist/types/ui/ExplorationActionControl.d.ts +60 -0
- package/dist/types/ui/ExportControl.d.ts +4 -0
- package/dist/types/ui/FilterActions.d.ts +10 -0
- package/dist/types/ui/FilterBar.d.ts +3 -0
- package/dist/types/ui/FunnelChart.d.ts +20 -0
- package/dist/types/ui/GettingStarted.d.ts +6 -0
- package/dist/types/ui/GlossaryDefinition.d.ts +7 -0
- package/dist/types/ui/GlossaryExplanation.d.ts +16 -0
- package/dist/types/ui/GradientScroll.d.ts +23 -0
- package/dist/types/ui/Grid.d.ts +12 -0
- package/dist/types/ui/GridItem.d.ts +7 -0
- package/dist/types/ui/HelpPopover.d.ts +21 -0
- package/dist/types/ui/IconButton.d.ts +19 -0
- package/dist/types/ui/InspectionContext.d.ts +12 -0
- package/dist/types/ui/InspectionProvider.d.ts +29 -0
- package/dist/types/ui/JourneyChart.d.ts +10 -0
- package/dist/types/ui/Kbd.d.ts +7 -0
- package/dist/types/ui/LineChart.d.ts +7 -0
- package/dist/types/ui/LiveControl.d.ts +10 -0
- package/dist/types/ui/Menu.d.ts +13 -0
- package/dist/types/ui/MetricWidget.d.ts +51 -0
- package/dist/types/ui/NumberField.d.ts +27 -0
- package/dist/types/ui/NumberFilterPicker.d.ts +11 -0
- package/dist/types/ui/PeriodSummary.d.ts +17 -0
- package/dist/types/ui/PickerField.d.ts +23 -0
- package/dist/types/ui/PieChart.d.ts +11 -0
- package/dist/types/ui/PopoverSurface.d.ts +5 -0
- package/dist/types/ui/PresentStory.d.ts +30 -0
- package/dist/types/ui/QueryList.d.ts +14 -0
- package/dist/types/ui/RadioGroup.d.ts +18 -0
- package/dist/types/ui/Ranking.d.ts +13 -0
- package/dist/types/ui/RefreshControl.d.ts +9 -0
- package/dist/types/ui/RequestHint.d.ts +20 -0
- package/dist/types/ui/RetentionChart.d.ts +27 -0
- package/dist/types/ui/ScatterChart.d.ts +17 -0
- package/dist/types/ui/SearchField.d.ts +23 -0
- package/dist/types/ui/SearchInput.d.ts +10 -0
- package/dist/types/ui/SearchMatch.d.ts +6 -0
- package/dist/types/ui/SearchTypeahead.d.ts +15 -0
- package/dist/types/ui/SectionHeading.d.ts +8 -0
- package/dist/types/ui/Select.d.ts +22 -0
- package/dist/types/ui/SelectionMark.d.ts +5 -0
- package/dist/types/ui/Sheet.d.ts +21 -0
- package/dist/types/ui/Skeleton.d.ts +8 -0
- package/dist/types/ui/Stack.d.ts +7 -0
- package/dist/types/ui/StaticDataApp.d.ts +4 -0
- package/dist/types/ui/StatusPanel.d.ts +10 -0
- package/dist/types/ui/TableWidget.d.ts +67 -0
- package/dist/types/ui/Tabs.d.ts +10 -0
- package/dist/types/ui/TextContent.d.ts +4 -0
- package/dist/types/ui/TextWidget.d.ts +20 -0
- package/dist/types/ui/ThemeSelector.d.ts +12 -0
- package/dist/types/ui/Toast.d.ts +8 -0
- package/dist/types/ui/Tooltip.d.ts +23 -0
- package/dist/types/ui/TooltipSurface.d.ts +3 -0
- package/dist/types/ui/TrendChart.d.ts +5 -0
- package/dist/types/ui/UpdatedAt.d.ts +9 -0
- package/dist/types/ui/VariableBar.d.ts +6 -0
- package/dist/types/ui/VisualizationWidget.d.ts +43 -0
- package/dist/types/ui/WidgetDisclosure.d.ts +6 -0
- package/dist/types/ui/WidgetEvidence.d.ts +12 -0
- package/dist/types/ui/WidgetViewTabs.d.ts +16 -0
- package/dist/types/ui/chart-data.d.ts +36 -0
- package/dist/types/ui/chart-date-axis.d.ts +15 -0
- package/dist/types/ui/chart-interaction.d.ts +27 -0
- package/dist/types/ui/chart-primitives.d.ts +22 -0
- package/dist/types/ui/chart-time.d.ts +19 -0
- package/dist/types/ui/chartColor.d.ts +2 -0
- package/dist/types/ui/classNames.d.ts +1 -0
- package/dist/types/ui/csv-export.d.ts +19 -0
- package/dist/types/ui/data-context.d.ts +76 -0
- package/dist/types/ui/data-identifiers.d.ts +32 -0
- package/dist/types/ui/icons.d.ts +49 -0
- package/dist/types/ui/index.d.ts +111 -0
- package/dist/types/ui/journey-flow.d.ts +49 -0
- package/dist/types/ui/keyboard.d.ts +6 -0
- package/dist/types/ui/metric-comparison.d.ts +30 -0
- package/dist/types/ui/metric.d.ts +11 -0
- package/dist/types/ui/presentation.d.ts +25 -0
- package/dist/types/ui/search.d.ts +6 -0
- package/dist/types/ui/searchItems.d.ts +36 -0
- package/dist/types/ui/shortcuts.d.ts +45 -0
- package/dist/types/ui/story.d.ts +20 -0
- package/dist/types/ui/time-interval.d.ts +96 -0
- package/dist/types/ui/use-chart-scroll-to-end.d.ts +2 -0
- package/dist/types/ui/useAppAppearance.d.ts +3 -0
- package/dist/types/ui/useDataAppPresentation.d.ts +3 -0
- package/dist/types/ui/useSvgId.d.ts +2 -0
- package/dist/types/ui/variables.d.ts +36 -0
- package/dist/types/ui/widget-views.d.ts +3 -0
- package/dist/types/view-control-bar.d.ts +18 -0
- package/dist/types/view-controls.d.ts +20 -0
- package/dist/types/view-runtime.d.ts +34 -0
- package/dist/types/view.d.ts +87 -0
- package/dist/types/widgets.d.ts +90 -0
- package/dist/ui/index.js +3520 -0
- package/dist/ui/index.js.map +36 -0
- package/package.json +65 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Only ISO calendar dates and zoned instants are inferred. Numbers require scale="utc". */
|
|
2
|
+
export declare function chartTimestamp(value: unknown, numeric?: boolean): number | null;
|
|
3
|
+
type ChartTimeModel = {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
times: readonly number[];
|
|
7
|
+
/** Smallest gap in milliseconds; a single instant uses a one-day extent. */
|
|
8
|
+
minimumInterval: number;
|
|
9
|
+
tooltip: (value: unknown) => string;
|
|
10
|
+
};
|
|
11
|
+
export declare function timeModel(values: readonly unknown[], numeric?: boolean): ChartTimeModel | null;
|
|
12
|
+
export declare function timeTicks(model: ChartTimeModel, width: number): {
|
|
13
|
+
ticks: number[];
|
|
14
|
+
label: (value: number, index: number) => {
|
|
15
|
+
main: string;
|
|
16
|
+
context: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function classNames(...values: Array<string | false | null | undefined>): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type CsvCell = string | number | boolean | null | undefined;
|
|
2
|
+
/** One named dataset with ordered columns and raw displayed values. */
|
|
3
|
+
export type CsvTable = {
|
|
4
|
+
name: string;
|
|
5
|
+
columns: readonly string[];
|
|
6
|
+
rows: readonly (readonly CsvCell[])[];
|
|
7
|
+
};
|
|
8
|
+
/** All distinct datasets in the displayed result; filename names the download. */
|
|
9
|
+
export type CsvExport = {
|
|
10
|
+
filename: string;
|
|
11
|
+
tables: readonly [CsvTable, ...CsvTable[]];
|
|
12
|
+
};
|
|
13
|
+
export declare function formatCsv({ columns, rows, }: Pick<CsvTable, 'columns' | 'rows'>): string;
|
|
14
|
+
export declare function createCsvDownload(data: CsvExport, selectedTable?: CsvTable): {
|
|
15
|
+
filename: string;
|
|
16
|
+
blob: Blob;
|
|
17
|
+
route: 'export:csv' | 'export:zip';
|
|
18
|
+
};
|
|
19
|
+
export declare function exportCsv(data: CsvExport, table?: CsvTable): Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DataIdentifierDefinition } from './data-identifiers.js';
|
|
3
|
+
import { type MetricFormat } from '@altertable/data-app/format';
|
|
4
|
+
import { type MetricDefinition } from './metric.js';
|
|
5
|
+
import { type StoryFinding } from './story.js';
|
|
6
|
+
import { type WidgetEvidence } from './WidgetEvidence.js';
|
|
7
|
+
export type GlossaryEntry = {
|
|
8
|
+
term: string;
|
|
9
|
+
definition: ReactNode;
|
|
10
|
+
queryNames?: string[];
|
|
11
|
+
};
|
|
12
|
+
export type DataContext = {
|
|
13
|
+
description: ReactNode;
|
|
14
|
+
glossary: Record<string, GlossaryEntry>;
|
|
15
|
+
identifiers?: Readonly<Record<string, DataIdentifierDefinition>>;
|
|
16
|
+
queryNames?: Readonly<Record<string, string>>;
|
|
17
|
+
};
|
|
18
|
+
export type MetricDeclaration = {
|
|
19
|
+
id: string;
|
|
20
|
+
glossaryId: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
format: MetricFormat;
|
|
23
|
+
favorableDirection?: 'up' | 'down';
|
|
24
|
+
queryNames?: readonly string[];
|
|
25
|
+
};
|
|
26
|
+
export type EvidenceDeclaration = {
|
|
27
|
+
id: string;
|
|
28
|
+
} & ({
|
|
29
|
+
glossaryIds: readonly [string, ...string[]];
|
|
30
|
+
queryNames?: readonly string[];
|
|
31
|
+
} | {
|
|
32
|
+
queryNames: readonly [string, ...string[]];
|
|
33
|
+
glossaryIds?: readonly string[];
|
|
34
|
+
});
|
|
35
|
+
export type AuthoringDataContext = DataContext & {
|
|
36
|
+
metric(definition: MetricDeclaration): MetricDefinition;
|
|
37
|
+
evidence(definition: EvidenceDeclaration): WidgetEvidence;
|
|
38
|
+
};
|
|
39
|
+
/** Bind glossary query references and card evidence to the same registry. */
|
|
40
|
+
export declare function createDataContext<const Names extends Record<string, string>>(queryNames: Names): <const Context extends Omit<DataContext, 'glossary'> & {
|
|
41
|
+
glossary: Record<string, Omit<GlossaryEntry, 'queryNames'> & {
|
|
42
|
+
queryNames?: Names[keyof Names][];
|
|
43
|
+
}>;
|
|
44
|
+
}>(context: Context) => Context & {
|
|
45
|
+
queryNames: Names;
|
|
46
|
+
evidence: (input: {
|
|
47
|
+
id: string;
|
|
48
|
+
} & ({
|
|
49
|
+
glossaryIds: readonly [keyof Context["glossary"] & string, ...(keyof Context["glossary"] & string)[]];
|
|
50
|
+
queryNames?: readonly Names[keyof Names][];
|
|
51
|
+
} | {
|
|
52
|
+
queryNames: readonly [Names[keyof Names], ...Names[keyof Names][]];
|
|
53
|
+
glossaryIds?: readonly (keyof Context["glossary"] & string)[];
|
|
54
|
+
})) => WidgetEvidence;
|
|
55
|
+
finding: (input: Omit<StoryFinding, 'evidence'> & {
|
|
56
|
+
evidence: Parameters<(input: {
|
|
57
|
+
id: string;
|
|
58
|
+
} & ({
|
|
59
|
+
glossaryIds: readonly [keyof Context["glossary"] & string, ...(keyof Context["glossary"] & string)[]];
|
|
60
|
+
queryNames?: readonly Names[keyof Names][];
|
|
61
|
+
} | {
|
|
62
|
+
queryNames: readonly [Names[keyof Names], ...Names[keyof Names][]];
|
|
63
|
+
glossaryIds?: readonly (keyof Context["glossary"] & string)[];
|
|
64
|
+
})) => WidgetEvidence>[0];
|
|
65
|
+
}) => StoryFinding & {
|
|
66
|
+
evidence: WidgetEvidence;
|
|
67
|
+
};
|
|
68
|
+
metric: (definition: {
|
|
69
|
+
id: string;
|
|
70
|
+
glossaryId: keyof Context['glossary'] & string;
|
|
71
|
+
label?: string;
|
|
72
|
+
format: MetricFormat;
|
|
73
|
+
favorableDirection?: 'up' | 'down';
|
|
74
|
+
queryNames?: readonly Names[keyof Names][];
|
|
75
|
+
}) => MetricDefinition;
|
|
76
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type TableIdentifier = {
|
|
2
|
+
catalog: string;
|
|
3
|
+
schema: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
export type ColumnIdentifier<TableId extends string = string> = {
|
|
7
|
+
table: TableId;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
export type DataIdentifierDefinition = ({
|
|
11
|
+
kind: 'table';
|
|
12
|
+
} & TableIdentifier) | {
|
|
13
|
+
kind: 'column';
|
|
14
|
+
tableId: `tables.${string}`;
|
|
15
|
+
table: TableIdentifier;
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
type IdentifierId<Tables extends Record<string, TableIdentifier>, Columns extends Record<string, ColumnIdentifier<Extract<keyof Tables, string>>>> = `tables.${Extract<keyof Tables, string>}` | {
|
|
19
|
+
[Id in Extract<keyof Columns, string>]: `columns.${Columns[Id]['table']}.${Id}`;
|
|
20
|
+
}[Extract<keyof Columns, string>];
|
|
21
|
+
/** Register exact source names once; returned JSX IDs are checked against this registry. */
|
|
22
|
+
export declare function defineDataIdentifiers<const Tables extends Record<string, TableIdentifier>, const Columns extends Record<string, ColumnIdentifier<Extract<keyof Tables, string>>>>({ tables, columns }: {
|
|
23
|
+
tables: Tables;
|
|
24
|
+
columns: Columns;
|
|
25
|
+
}): {
|
|
26
|
+
definitions: Readonly<Record<IdentifierId<Tables, Columns>, DataIdentifierDefinition>>;
|
|
27
|
+
DataIdentifier: ({ id, display, }: {
|
|
28
|
+
id: IdentifierId<Tables, Columns>;
|
|
29
|
+
display?: 'short' | 'qualified';
|
|
30
|
+
}) => import("react").JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type LucideProps } from 'lucide-react';
|
|
2
|
+
/** Use semantic names to keep icon meaning and optical size consistent across controls. */
|
|
3
|
+
declare const brandedIcons: {
|
|
4
|
+
readonly annotate: import("lucide-react").LucideIcon;
|
|
5
|
+
readonly cancel: import("lucide-react").LucideIcon;
|
|
6
|
+
readonly calendar: import("lucide-react").LucideIcon;
|
|
7
|
+
readonly clock: import("lucide-react").LucideIcon;
|
|
8
|
+
readonly check: import("lucide-react").LucideIcon;
|
|
9
|
+
readonly disclosure: import("lucide-react").LucideIcon;
|
|
10
|
+
readonly breakdown: import("lucide-react").LucideIcon;
|
|
11
|
+
readonly moreActions: import("lucide-react").LucideIcon;
|
|
12
|
+
readonly previousMonth: import("lucide-react").LucideIcon;
|
|
13
|
+
readonly nextMonth: import("lucide-react").LucideIcon;
|
|
14
|
+
readonly explore: import("lucide-react").LucideIcon;
|
|
15
|
+
/** @deprecated Use openDetails for inspection triggers. */
|
|
16
|
+
readonly inspect: import("lucide-react").LucideIcon;
|
|
17
|
+
readonly info: import("lucide-react").LucideIcon;
|
|
18
|
+
readonly openDetails: import("lucide-react").LucideIcon;
|
|
19
|
+
readonly present: import("lucide-react").LucideIcon;
|
|
20
|
+
readonly export: import("lucide-react").LucideIcon;
|
|
21
|
+
readonly error: import("lucide-react").LucideIcon;
|
|
22
|
+
readonly close: import("lucide-react").LucideIcon;
|
|
23
|
+
readonly filters: import("lucide-react").LucideIcon;
|
|
24
|
+
readonly clearFilters: import("lucide-react").LucideIcon;
|
|
25
|
+
readonly displayOptions: import("lucide-react").LucideIcon;
|
|
26
|
+
readonly previous: import("lucide-react").LucideIcon;
|
|
27
|
+
readonly next: import("lucide-react").LucideIcon;
|
|
28
|
+
readonly lightTheme: import("lucide-react").LucideIcon;
|
|
29
|
+
readonly darkTheme: import("lucide-react").LucideIcon;
|
|
30
|
+
readonly live: import("lucide-react").LucideIcon;
|
|
31
|
+
readonly loading: import("lucide-react").LucideIcon;
|
|
32
|
+
readonly refresh: import("lucide-react").LucideIcon;
|
|
33
|
+
readonly stop: import("lucide-react").LucideIcon;
|
|
34
|
+
readonly reset: import("lucide-react").LucideIcon;
|
|
35
|
+
readonly search: import("lucide-react").LucideIcon;
|
|
36
|
+
readonly copy: import("lucide-react").LucideIcon;
|
|
37
|
+
readonly sql: import("lucide-react").LucideIcon;
|
|
38
|
+
readonly wrap: import("lucide-react").LucideIcon;
|
|
39
|
+
readonly trendDown: import("lucide-react").LucideIcon;
|
|
40
|
+
readonly trendFlat: import("lucide-react").LucideIcon;
|
|
41
|
+
readonly trendUp: import("lucide-react").LucideIcon;
|
|
42
|
+
};
|
|
43
|
+
export type AppIconName = keyof typeof brandedIcons;
|
|
44
|
+
export type AppIconProps = Omit<LucideProps, 'size'> & {
|
|
45
|
+
name: AppIconName;
|
|
46
|
+
size?: number | string;
|
|
47
|
+
};
|
|
48
|
+
export declare function AppIcon({ name, size, strokeWidth, style, ...props }: AppIconProps): import("react").FunctionComponentElement<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Direct UI composition and static screens. Requests use declared views from /react. */
|
|
2
|
+
export { DataAppProvider } from '../mount.js';
|
|
3
|
+
export { isPlainKeyEvent } from './keyboard.js';
|
|
4
|
+
export { GettingStarted } from './GettingStarted.js';
|
|
5
|
+
export { DataWidget } from './DataWidget.js';
|
|
6
|
+
export type { WidgetStatus } from './RequestHint.js';
|
|
7
|
+
export type { DataWidgetProps } from './DataWidget.js';
|
|
8
|
+
export { TextWidget } from './TextWidget.js';
|
|
9
|
+
export type { TextWidgetProps } from './TextWidget.js';
|
|
10
|
+
export { VisualizationWidget } from './VisualizationWidget.js';
|
|
11
|
+
export type { VisualizationWidgetProps } from './VisualizationWidget.js';
|
|
12
|
+
export { TableWidget } from './TableWidget.js';
|
|
13
|
+
export type { TableWidgetProps } from './TableWidget.js';
|
|
14
|
+
export { DataTable, DataTableEmptyRow, DataTableTimestamp, DataTableShare, } from './DataTable.js';
|
|
15
|
+
export type { DataTableProps, DataTableSearch, DataTableEmptyRowProps, DataTableTimestampProps, } from './DataTable.js';
|
|
16
|
+
export { MetricWidget } from './MetricWidget.js';
|
|
17
|
+
export type { MetricWidgetProps } from './MetricWidget.js';
|
|
18
|
+
export { DimensionPicker } from './DimensionPicker.js';
|
|
19
|
+
export { LiveControl } from './LiveControl.js';
|
|
20
|
+
export type { LiveControlProps, LiveIntervalSeconds } from './LiveControl.js';
|
|
21
|
+
export { DateRangePicker } from './DateRangePicker.js';
|
|
22
|
+
export type { DatePresetId, DateRange, DateRangePickerProps, } from './DateRangePicker.js';
|
|
23
|
+
export { useAppVariables } from './variables.js';
|
|
24
|
+
export { SearchField } from './SearchField.js';
|
|
25
|
+
export type { SearchFieldProps } from './SearchField.js';
|
|
26
|
+
export { searchItems, matchSearchText } from './searchItems.js';
|
|
27
|
+
export type { SearchAttribute, SearchHit, SearchItemsOptions, SearchMatchValue, SearchRange, } from './searchItems.js';
|
|
28
|
+
export { SearchMatch } from './SearchMatch.js';
|
|
29
|
+
export type { SearchMatchProps } from './SearchMatch.js';
|
|
30
|
+
export { ChoicePicker } from './ChoicePicker.js';
|
|
31
|
+
export type { ChoiceOption, ChoicePickerProps } from './ChoicePicker.js';
|
|
32
|
+
export { MenuTrigger, MenuButton, MenuPopover, Menu, MenuItem, MenuSection, MenuSeparator, } from './Menu.js';
|
|
33
|
+
export type { MenuTriggerProps, MenuPopoverProps, MenuProps, MenuItemProps, } from './Menu.js';
|
|
34
|
+
export { GradientScroll } from './GradientScroll.js';
|
|
35
|
+
export type { GradientScrollProps } from './GradientScroll.js';
|
|
36
|
+
export { Tabs, TabList, Tab, TabPanels, TabPanel, useViewTab, } from './Tabs.js';
|
|
37
|
+
export { GlossaryExplanation } from './GlossaryExplanation.js';
|
|
38
|
+
export type { GlossaryExplanationProps } from './GlossaryExplanation.js';
|
|
39
|
+
export { GlossaryDefinition } from './GlossaryDefinition.js';
|
|
40
|
+
export type { GlossaryDefinitionProps } from './GlossaryDefinition.js';
|
|
41
|
+
export { AboutData } from './AboutData.js';
|
|
42
|
+
export type { AboutDataProps, AboutEmpty, AboutSubject, AboutTab, } from './AboutData.js';
|
|
43
|
+
export { PresentStory } from './PresentStory.js';
|
|
44
|
+
export type { PresentStoryProps } from './PresentStory.js';
|
|
45
|
+
export type { StoryFinding, BoundStory } from './story.js';
|
|
46
|
+
export { Checkbox } from './Checkbox.js';
|
|
47
|
+
export type { CheckboxProps } from './Checkbox.js';
|
|
48
|
+
export { AppIcon } from './icons.js';
|
|
49
|
+
export type { AppIconName, AppIconProps } from './icons.js';
|
|
50
|
+
export { Sheet } from './Sheet.js';
|
|
51
|
+
export type { SheetProps } from './Sheet.js';
|
|
52
|
+
export { HelpPopover } from './HelpPopover.js';
|
|
53
|
+
export type { HelpPopoverProps } from './HelpPopover.js';
|
|
54
|
+
export { DataApp } from './StaticDataApp.js';
|
|
55
|
+
export type { DataAppProps } from './StaticDataApp.js';
|
|
56
|
+
export { injectDataAppStyles } from '../styles.js';
|
|
57
|
+
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
58
|
+
export type { TooltipProps, TooltipProviderProps } from './Tooltip.js';
|
|
59
|
+
export { LineChart } from './LineChart.js';
|
|
60
|
+
export type { LineChartProps, LineChartItem } from './LineChart.js';
|
|
61
|
+
export { AreaChart } from './AreaChart.js';
|
|
62
|
+
export type { AreaChartProps, AreaChartItem } from './AreaChart.js';
|
|
63
|
+
export { PieChart } from './PieChart.js';
|
|
64
|
+
export type { PieChartProps, PieChartItem } from './PieChart.js';
|
|
65
|
+
export { ScatterChart } from './ScatterChart.js';
|
|
66
|
+
export type { ScatterChartProps, ScatterChartItem } from './ScatterChart.js';
|
|
67
|
+
export { BarChart } from './BarChart.js';
|
|
68
|
+
export type { BarChartProps, BarChartItem } from './BarChart.js';
|
|
69
|
+
export { DataValue } from './DataValue.js';
|
|
70
|
+
export type { DataValueProps } from './DataValue.js';
|
|
71
|
+
export type { CsvExport, CsvTable } from './csv-export.js';
|
|
72
|
+
export type { TableWidgetColumn } from './TableWidget.js';
|
|
73
|
+
export type { DataReading, MetricReading } from '@altertable/data-app/internal';
|
|
74
|
+
export type { DataAppStyle, DataAppStyleToken, DataAppStyleHooks, } from '../style-contract.js';
|
|
75
|
+
export { Select } from './Select.js';
|
|
76
|
+
export type { SelectProps } from './Select.js';
|
|
77
|
+
export { RadioGroup, Radio, SegmentedControl } from './RadioGroup.js';
|
|
78
|
+
export type { RadioGroupProps, RadioProps, SegmentedControlProps, } from './RadioGroup.js';
|
|
79
|
+
export { CheckboxGroup } from './CheckboxGroup.js';
|
|
80
|
+
export type { CheckboxGroupProps } from './CheckboxGroup.js';
|
|
81
|
+
export { NumberField, NumberRangeField } from './NumberField.js';
|
|
82
|
+
export type { NumberFieldProps, NumberRangeFieldProps, NumberRange, } from './NumberField.js';
|
|
83
|
+
export { FilterBar } from './FilterBar.js';
|
|
84
|
+
export type { FilterBarProps } from './FilterBar.js';
|
|
85
|
+
export { VariableBar } from './VariableBar.js';
|
|
86
|
+
export type { VariableBarProps } from './VariableBar.js';
|
|
87
|
+
export { FilterActions } from './FilterActions.js';
|
|
88
|
+
export type { FilterActionsProps } from './FilterActions.js';
|
|
89
|
+
export { NumberFilterPicker } from './NumberFilterPicker.js';
|
|
90
|
+
export type { NumberFilterPickerProps } from './NumberFilterPicker.js';
|
|
91
|
+
export { ComposedChart } from './ComposedChart.js';
|
|
92
|
+
export type { ComposedChartProps } from './ComposedChart.js';
|
|
93
|
+
export { ChartLegend } from './ChartLegend.js';
|
|
94
|
+
export type { ChartLegendProps, ChartLegendItemProps, ChartLegendMarkerProps, ChartLegendLabelProps, ChartLegendMarkerKind, } from './ChartLegend.js';
|
|
95
|
+
export type { ComposedChartLegendProps } from './ComposedChartLegend.js';
|
|
96
|
+
export { FunnelChart } from './FunnelChart.js';
|
|
97
|
+
export type { FunnelChartProps, FunnelChartStep, FunnelChartSeries, } from './FunnelChart.js';
|
|
98
|
+
export { RetentionChart } from './RetentionChart.js';
|
|
99
|
+
export type { RetentionChartProps, RetentionChartPoint, RetentionChartSeries, } from './RetentionChart.js';
|
|
100
|
+
export { JourneyChart } from './JourneyChart.js';
|
|
101
|
+
export type { JourneyChartProps, JourneyChartPath } from './JourneyChart.js';
|
|
102
|
+
export { useSvgId } from './useSvgId.js';
|
|
103
|
+
export { SearchTypeahead } from './SearchTypeahead.js';
|
|
104
|
+
export type { SearchTypeaheadProps, SearchSuggestion, } from './SearchTypeahead.js';
|
|
105
|
+
export { SectionHeading } from './SectionHeading.js';
|
|
106
|
+
export type { SectionHeadingProps } from './SectionHeading.js';
|
|
107
|
+
export { DateDisplay } from './DateDisplay.js';
|
|
108
|
+
export type { DateDisplayProps } from './DateDisplay.js';
|
|
109
|
+
export { useDateFormatting } from '../date-formatting.js';
|
|
110
|
+
export { ExplorationActionControl } from './ExplorationActionControl.js';
|
|
111
|
+
export type { ExplorationActionControlProps, ExplorationAction, ItemActions, } from './ExplorationActionControl.js';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Aggregated route; repeated events remain distinct by depth and prefix. */
|
|
2
|
+
export type JourneyChartPath = {
|
|
3
|
+
/** Unique, nonblank path ID. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** At least one nonblank event; null property means no property grouping. */
|
|
6
|
+
steps: readonly {
|
|
7
|
+
event: string;
|
|
8
|
+
property: string | null;
|
|
9
|
+
}[];
|
|
10
|
+
/** Finite, nonnegative population following this route. */
|
|
11
|
+
count: number;
|
|
12
|
+
/** True: converted; false: dropped off; null: no conversion classification. */
|
|
13
|
+
converted: boolean | null;
|
|
14
|
+
/** Stops at the last loaded event, without adding an outcome or expand control. */
|
|
15
|
+
truncated: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type JourneyNode = {
|
|
18
|
+
key: string;
|
|
19
|
+
label: string;
|
|
20
|
+
depth: number;
|
|
21
|
+
outcome: 'event' | 'converted' | 'drop-off' | 'truncated' | 'end' | 'other';
|
|
22
|
+
count: number;
|
|
23
|
+
pathKeys: string[];
|
|
24
|
+
branchKeys?: string[];
|
|
25
|
+
expandable?: boolean;
|
|
26
|
+
expanded?: boolean;
|
|
27
|
+
hiddenBranchCount?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function journeyNodes(path: JourneyChartPath): Omit<JourneyNode, 'count' | 'pathKeys'>[];
|
|
30
|
+
export declare function buildJourneyFlow(paths: readonly JourneyChartPath[], expandedBranch?: string[]): {
|
|
31
|
+
nodes: JourneyNode[];
|
|
32
|
+
links: {
|
|
33
|
+
key: string;
|
|
34
|
+
source: string;
|
|
35
|
+
target: string;
|
|
36
|
+
count: number;
|
|
37
|
+
pathKeys: string[];
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
export declare function limitJourneyFlow(graph: ReturnType<typeof buildJourneyFlow>, visibleEventsByDepth?: Record<number, number>): {
|
|
41
|
+
nodes: JourneyNode[];
|
|
42
|
+
links: {
|
|
43
|
+
key: string;
|
|
44
|
+
source: string;
|
|
45
|
+
target: string;
|
|
46
|
+
count: number;
|
|
47
|
+
pathKeys: string[];
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type KeyEvent = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'isComposing'>;
|
|
2
|
+
/** Keep local key actions separate from shortcuts and IME composition. Pass React's nativeEvent. */
|
|
3
|
+
export declare function isPlainKeyEvent(event: KeyEvent, { allowShift }?: {
|
|
4
|
+
allowShift?: boolean;
|
|
5
|
+
}): boolean;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type DateRangeRequest } from '@altertable/data-app/contract';
|
|
2
|
+
import { type MetricFormat, type DateFormatOptions } from '@altertable/data-app/format';
|
|
3
|
+
export type MetricComparison = {
|
|
4
|
+
current: {
|
|
5
|
+
value: number;
|
|
6
|
+
formattedValue: string;
|
|
7
|
+
periodLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
previous?: {
|
|
10
|
+
value: number | null;
|
|
11
|
+
formattedValue: string;
|
|
12
|
+
periodLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
favorableDirection?: 'up' | 'down';
|
|
15
|
+
};
|
|
16
|
+
/** Label a comparison from the input that produced the displayed result. Null means the
|
|
17
|
+
* requested previous period has no comparable value; zero remains a measured value. */
|
|
18
|
+
export declare function calendarMetricComparison(displayedInput: DateRangeRequest, values: {
|
|
19
|
+
current: number;
|
|
20
|
+
previous: number | null;
|
|
21
|
+
format: MetricFormat;
|
|
22
|
+
favorableDirection?: MetricComparison['favorableDirection'];
|
|
23
|
+
}, options?: DateFormatOptions): MetricComparison | undefined;
|
|
24
|
+
/** A zero or missing baseline has no meaningful relative percentage. */
|
|
25
|
+
export declare function comparisonChange({ current, previous, favorableDirection, }: MetricComparison): {
|
|
26
|
+
readonly percent: number | null;
|
|
27
|
+
readonly direction: "down" | "flat" | "up";
|
|
28
|
+
readonly tone: "bad" | "good" | "neutral";
|
|
29
|
+
readonly icon: "trendDown" | "trendFlat" | "trendUp";
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MetricFormat, type DateFormatOptions } from '@altertable/data-app/format';
|
|
2
|
+
import { type WidgetEvidence } from './WidgetEvidence.js';
|
|
3
|
+
import { type MetricReading } from '@altertable/data-app/internal';
|
|
4
|
+
export type MetricDefinition = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
format: MetricFormat;
|
|
8
|
+
favorableDirection?: 'up' | 'down';
|
|
9
|
+
evidence: WidgetEvidence;
|
|
10
|
+
};
|
|
11
|
+
export declare function metricComparison(metric: MetricDefinition, reading: MetricReading, options?: DateFormatOptions): import("./metric-comparison.js").MetricComparison | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DataReading } from '@altertable/data-app/internal';
|
|
3
|
+
import { type WidgetEvidence } from './WidgetEvidence.js';
|
|
4
|
+
export type EmptyContent = {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** A relevant recovery action; omit when there is nothing the user can change. */
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type SkeletonContent = {
|
|
11
|
+
variant: 'metric' | 'panel' | 'ranking';
|
|
12
|
+
/**
|
|
13
|
+
* Placeholder rows, clamped to 0–100.
|
|
14
|
+
* @default 4
|
|
15
|
+
*/
|
|
16
|
+
rows?: number;
|
|
17
|
+
};
|
|
18
|
+
/** A bound widget must explain empty results and link the reading to its evidence. */
|
|
19
|
+
export type BoundWidgetReading<Data> = {
|
|
20
|
+
reading: DataReading<Data>;
|
|
21
|
+
isEmpty: (data: Data) => boolean;
|
|
22
|
+
emptyFallback: EmptyContent;
|
|
23
|
+
evidence: WidgetEvidence;
|
|
24
|
+
skeleton?: SkeletonContent;
|
|
25
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function searchParams(): URLSearchParams;
|
|
2
|
+
/** Listen to Back/Forward and writes made by another runtime control. */
|
|
3
|
+
export declare function subscribeSearch(listener: () => void): () => void;
|
|
4
|
+
/** Write search keys. `null` removes a key. Skips the history write when nothing changed. */
|
|
5
|
+
export declare function writeSearch(update: Record<string, string | null>, mode?: 'replace' | 'push'): void;
|
|
6
|
+
export declare function slug(value: string): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type SearchRange = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
/** The exact displayed text and its offsets stay together for safe rendering. */
|
|
6
|
+
export type SearchMatchValue = {
|
|
7
|
+
text: string;
|
|
8
|
+
ranges: readonly SearchRange[];
|
|
9
|
+
};
|
|
10
|
+
export type SearchAttribute<Item> = {
|
|
11
|
+
name: string;
|
|
12
|
+
getter: (item: Item) => string;
|
|
13
|
+
weight?: number;
|
|
14
|
+
};
|
|
15
|
+
export type SearchHit<Item> = {
|
|
16
|
+
item: Item;
|
|
17
|
+
score: number;
|
|
18
|
+
/** Render displayed fields with <SearchMatch match={hit.matches.fieldName} />. */
|
|
19
|
+
matches: Record<string, SearchMatchValue>;
|
|
20
|
+
};
|
|
21
|
+
export type SearchItemsOptions<Item> = {
|
|
22
|
+
attributes: readonly [SearchAttribute<Item>, ...SearchAttribute<Item>[]];
|
|
23
|
+
/** Literal filtering preserves source order; fuzzy search ranks discovery results. */
|
|
24
|
+
mode?: 'literal' | 'fuzzy';
|
|
25
|
+
limit?: number;
|
|
26
|
+
fuzzyThreshold?: number;
|
|
27
|
+
};
|
|
28
|
+
/** Highlight literal query terms in supplied text without filtering or reordering results. */
|
|
29
|
+
export declare function matchSearchText(text: string, query: string): SearchMatchValue;
|
|
30
|
+
/**
|
|
31
|
+
* Search only a complete local collection. Empty queries retain every item.
|
|
32
|
+
* When a searched field is displayed, render its match with SearchMatch:
|
|
33
|
+
* `hits.map(hit => <SearchMatch match={hit.matches.name} />)`.
|
|
34
|
+
* Fields used only to find a row need no visible highlight.
|
|
35
|
+
*/
|
|
36
|
+
export declare function searchItems<Item>(items: readonly Item[], query: string, options: SearchItemsOptions<Item>): SearchHit<Item>[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `alt` is Alt/Option, leaving character keys and browser refresh untouched; `mod` is ⌘ on Apple
|
|
3
|
+
* platforms and Ctrl elsewhere.
|
|
4
|
+
*/
|
|
5
|
+
export type Shortcut = {
|
|
6
|
+
modifier: 'alt' | 'mod';
|
|
7
|
+
shift?: boolean;
|
|
8
|
+
code: string;
|
|
9
|
+
key: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const shortcuts: {
|
|
12
|
+
readonly annotate: {
|
|
13
|
+
readonly modifier: 'mod';
|
|
14
|
+
readonly shift: true;
|
|
15
|
+
readonly code: 'Period';
|
|
16
|
+
readonly key: '.';
|
|
17
|
+
};
|
|
18
|
+
readonly sendAnnotations: {
|
|
19
|
+
readonly modifier: 'mod';
|
|
20
|
+
readonly code: 'Enter';
|
|
21
|
+
readonly key: 'Enter';
|
|
22
|
+
};
|
|
23
|
+
readonly refresh: {
|
|
24
|
+
readonly modifier: 'alt';
|
|
25
|
+
readonly code: 'KeyR';
|
|
26
|
+
readonly key: 'R';
|
|
27
|
+
};
|
|
28
|
+
readonly aboutData: {
|
|
29
|
+
readonly modifier: 'alt';
|
|
30
|
+
readonly code: 'KeyI';
|
|
31
|
+
readonly key: 'I';
|
|
32
|
+
};
|
|
33
|
+
readonly playStory: {
|
|
34
|
+
readonly modifier: 'mod';
|
|
35
|
+
readonly shift: true;
|
|
36
|
+
readonly code: 'Enter';
|
|
37
|
+
readonly key: 'Enter';
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function shortcutLabel({ modifier, shift, key }: Shortcut): string;
|
|
41
|
+
export declare function ariaKeyShortcuts({ modifier, shift, key }: Shortcut): string;
|
|
42
|
+
export declare function isEditingTarget(target: EventTarget | null): boolean;
|
|
43
|
+
export declare function matchesShortcut(event: KeyboardEvent, shortcut: Shortcut): boolean;
|
|
44
|
+
/** Bind a page-level shortcut. Ignored while typing or while a modal layer is open. */
|
|
45
|
+
export declare function useShortcut(shortcut: Shortcut, action: () => void, enabled?: boolean, allowWhileEditing?: boolean): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DisplayedSnapshot } from '@altertable/data-app/internal';
|
|
3
|
+
import { type MetricDefinition } from './metric.js';
|
|
4
|
+
import { type StoryStep } from './PresentStory.js';
|
|
5
|
+
import { type WidgetEvidence } from './WidgetEvidence.js';
|
|
6
|
+
import { type DataContext } from './data-context.js';
|
|
7
|
+
/** One consequential, inspectable finding from the displayed result. */
|
|
8
|
+
export type StoryFinding = {
|
|
9
|
+
id: string;
|
|
10
|
+
headline: string;
|
|
11
|
+
context?: string;
|
|
12
|
+
visual: ReactNode;
|
|
13
|
+
visualKind?: 'metric' | 'chart';
|
|
14
|
+
evidence: WidgetEvidence | MetricDefinition;
|
|
15
|
+
};
|
|
16
|
+
/** One to four findings with unique, nonempty IDs and registered evidence.
|
|
17
|
+
* Receives the displayed result and its original input during refresh or failure. */
|
|
18
|
+
export type BoundStory<Data, Input> = (snapshot: DisplayedSnapshot<Data, Input>) => readonly StoryFinding[];
|
|
19
|
+
/** Validate the authored findings before handing them to the presentation UI. */
|
|
20
|
+
export declare function storySteps(findings: readonly StoryFinding[], context: DataContext): StoryStep[];
|