@altertable/data-app 0.68.0 → 0.69.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 +6 -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-ktmvs916.js → index-2sbp9h2b.js} +37 -21
- package/dist/chunks/index-2sbp9h2b.js.map +13 -0
- package/dist/chunks/{index-23dktynd.js → index-ap60vggk.js} +4 -4
- 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-k766wwwr.js} +13 -9
- package/dist/chunks/index-k766wwwr.js.map +13 -0
- package/dist/chunks/{index-mt93ff2b.js → index-kwnqycjt.js} +2 -2
- package/dist/chunks/index-kwnqycjt.js.map +10 -0
- package/dist/chunks/index-m0gbxtgp.js +355 -0
- package/dist/chunks/index-m0gbxtgp.js.map +13 -0
- package/dist/chunks/{index-gvers8jw.js → index-qhzdzca2.js} +3709 -2170
- package/dist/chunks/index-qhzdzca2.js.map +118 -0
- package/dist/chunks/{index-x69p7cv7.js → index-r7b1ftwy.js} +3 -3
- package/dist/chunks/index-r7b1ftwy.js.map +10 -0
- package/dist/chunks/{index-ev2b5aaf.js → index-sx488hvs.js} +4 -4
- package/dist/chunks/{index-f5cnbrjz.js → index-wss3gd3h.js} +39 -9
- package/dist/chunks/index-wss3gd3h.js.map +13 -0
- package/dist/chunks/{index-qd5xgx6y.js → index-zcqxfwdq.js} +5 -12
- package/dist/chunks/index-zcqxfwdq.js.map +13 -0
- 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 +3 -3
- 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 +166 -144
- package/dist/local.js.map +8 -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 +250 -93
- package/dist/react/index.js.map +10 -10
- package/dist/react/ui/index.js +1168 -1165
- package/dist/react/ui/index.js.map +13 -11
- package/dist/server.js +68 -57
- package/dist/server.js.map +7 -6
- 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 +5 -0
- package/dist/types/core/contract.d.ts +3 -1
- package/dist/types/core/date-format.d.ts +24 -0
- package/dist/types/core/dimension.d.ts +2 -1
- package/dist/types/core/filters.d.ts +4 -3
- package/dist/types/core/format.d.ts +5 -3
- package/dist/types/core/messages.d.ts +3 -1
- package/dist/types/core/operation-types.d.ts +7 -7
- package/dist/types/core/time-interval.d.ts +96 -0
- package/dist/types/core/variables.d.ts +13 -4
- package/dist/types/embed/host.d.ts +4 -4
- 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 +26 -3
- package/dist/types/react/date-formatting.d.ts +12 -0
- package/dist/types/react/hooks.d.ts +10 -9
- package/dist/types/react/index.d.ts +7 -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/ChartLegend.d.ts +3 -2
- package/dist/types/react/ui/ChoicePicker.d.ts +2 -0
- package/dist/types/react/ui/DataApp.d.ts +5 -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 +4 -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 +3 -1
- package/dist/types/react/ui/EmptyState.d.ts +1 -1
- 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/MetricWidget.d.ts +2 -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 +15 -0
- 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 +5 -1
- package/dist/types/react/ui/Sheet.d.ts +3 -1
- 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/VariableBar.d.ts +1 -1
- package/dist/types/react/ui/VisualizationWidget.d.ts +1 -1
- package/dist/types/react/ui/chart-date-axis.d.ts +15 -0
- package/dist/types/react/ui/chart-interaction.d.ts +21 -0
- package/dist/types/react/ui/chart-primitives.d.ts +4 -4
- package/dist/types/react/ui/chart-time.d.ts +16 -0
- package/dist/types/react/ui/chartColor.d.ts +1 -1
- package/dist/types/react/ui/icons.d.ts +3 -1
- package/dist/types/react/ui/index.d.ts +8 -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/variables.d.ts +1 -1
- package/dist/types/react/view-control-bar.d.ts +16 -0
- package/dist/types/react/view-controls.d.ts +3 -2
- package/dist/types/react/view-runtime.d.ts +3 -1
- package/dist/types/react/view.d.ts +14 -2
- 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 +17 -9
- package/docs/client.md +1 -1
- package/docs/contract.md +8 -9
- 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 +1 -1
- package/docs/styling.md +7 -28
- package/docs/ui.md +21 -18
- package/docs/variables.md +92 -15
- package/docs/views.md +13 -36
- package/docs/widgets.md +38 -26
- package/examples/starter-data-app/index.tsx +0 -1
- 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 +22 -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 +15 -0
- package/package.json +13 -3
- 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-23dktynd.js.map → index-ap60vggk.js.map} +0 -0
- /package/dist/chunks/{index-ev2b5aaf.js.map → index-sx488hvs.js.map} +0 -0
|
@@ -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 { ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import type { DimensionOption, DimensionSelection, DimensionValue, DimensionVariable } 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
|
+
export declare function DimensionPicker<T extends DimensionValue>({ filter, labelPlacement, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
|
|
4
5
|
filter: DimensionVariable<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;
|
|
@@ -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. */
|
|
@@ -7,6 +7,8 @@ import type { MetricReading } from '../../core/reading.js';
|
|
|
7
7
|
import { type MetricDefinition } from './metric.js';
|
|
8
8
|
type MetricWidgetBaseProps = {
|
|
9
9
|
label: string;
|
|
10
|
+
/** Document outline level. The label keeps the shared widget-heading appearance. */
|
|
11
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
10
12
|
annotationId?: string;
|
|
11
13
|
description?: ReactNode;
|
|
12
14
|
comparison?: MetricComparison;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import { type NumberFilter, type NumberSelection } from '../../core/filters.js';
|
|
2
3
|
export type NumberFilterPickerProps = {
|
|
3
4
|
filter: NumberFilter;
|
|
5
|
+
labelPlacement?: ControlLabelPlacement;
|
|
4
6
|
value: NumberSelection;
|
|
5
7
|
onChange: (value: NumberSelection) => void;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
};
|
|
8
10
|
/** 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;
|
|
11
|
+
export declare function NumberFilterPicker({ filter, value, onChange, disabled, labelPlacement, }: NumberFilterPickerProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReportingPeriod } from '../../core/contract.js';
|
|
2
|
+
import { type DateTimeFormatOptions } from '../../core/format.js';
|
|
2
3
|
export type { ReportingPeriod } from '../../core/contract.js';
|
|
3
4
|
export type PeriodComparison = {
|
|
4
5
|
kind: 'previous';
|
|
@@ -11,6 +12,6 @@ export type PeriodSummaryProps = {
|
|
|
11
12
|
comparison?: PeriodComparison;
|
|
12
13
|
className?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function reportingPeriodText(period: ReportingPeriod): string;
|
|
15
|
+
export declare function reportingPeriodText(period: ReportingPeriod, options?: DateTimeFormatOptions): string;
|
|
15
16
|
/** Read-only period context for the variable bar, including exact bounds for assistive technology. */
|
|
16
17
|
export declare function PeriodSummary({ period, comparison, className, }: PeriodSummaryProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Inline labels sit with the value; above and beside labels have a separate layout slot. */
|
|
3
|
+
export type ControlLabelPlacement = 'inline' | 'above' | 'beside';
|
|
4
|
+
/** Popup triggers retain their accessible names when the visible label moves outside. */
|
|
5
|
+
export declare function PickerField({ label, labelPlacement, children, }: {
|
|
6
|
+
label: string;
|
|
7
|
+
labelPlacement?: ControlLabelPlacement;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
10
|
+
/** Shared label, value, and disclosure layout for selection and predicate controls. */
|
|
11
|
+
export declare function PickerTriggerContent({ label, labelPlacement, value, }: {
|
|
12
|
+
label: string;
|
|
13
|
+
labelPlacement: ControlLabelPlacement;
|
|
14
|
+
value: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { Popover } from 'react-aria-components';
|
|
3
|
+
export declare const PopoverContainerContext: import("react").Context<HTMLElement | undefined>;
|
|
4
|
+
/** Shared popup paint; each control owns placement, dimensions, and contents. */
|
|
5
|
+
export declare function PopoverSurface({ className, ...props }: ComponentProps<typeof Popover>): import("react").JSX.Element;
|
|
@@ -14,7 +14,7 @@ export declare function RequestHint({ status, retryLabel, }: {
|
|
|
14
14
|
status?: WidgetStatus;
|
|
15
15
|
retryLabel?: string;
|
|
16
16
|
}): import("react").JSX.Element;
|
|
17
|
-
/**
|
|
17
|
+
/** Supplied status reserves a fixed footprint across request states; omission leaves space for the title. */
|
|
18
18
|
export declare function WidgetStatusControl({ status }: {
|
|
19
19
|
status?: WidgetStatus;
|
|
20
|
-
}): import("react").JSX.Element;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
@@ -6,6 +6,8 @@ export type SearchFieldProps = {
|
|
|
6
6
|
onSubmit?: (value: string) => void;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
showLabel?: boolean;
|
|
9
|
+
/** Enable page search shortcuts on one primary search field per app. */
|
|
10
|
+
focusShortcut?: boolean;
|
|
9
11
|
size?: 'default' | 'compact';
|
|
10
12
|
description?: ReactNode;
|
|
11
13
|
status?: ReactNode;
|
|
@@ -18,4 +20,4 @@ export type SearchFieldProps = {
|
|
|
18
20
|
* The caller owns filtering, URL state, and whether search runs while typing or on submit.
|
|
19
21
|
* Escape and Clear reset the query.
|
|
20
22
|
*/
|
|
21
|
-
export declare function SearchField({ label, value, onChange, onSubmit, placeholder, showLabel, size, description, status, busy, resetValue, inputProps, children, className, ...props }: SearchFieldProps): import("react").JSX.Element;
|
|
23
|
+
export declare function SearchField({ label, value, onChange, onSubmit, placeholder, showLabel, focusShortcut, size, description, status, busy, resetValue, inputProps, children, className, ...props }: SearchFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SearchFieldProps } from './SearchField.js';
|
|
2
|
+
export type SearchSuggestion = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Override completing the query with this title, for example to open record details. */
|
|
7
|
+
onSelect?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type SearchTypeaheadProps = SearchFieldProps & {
|
|
10
|
+
/** Suggestions from the displayed result, in its order. No additional filtering or request. */
|
|
11
|
+
items: readonly SearchSuggestion[];
|
|
12
|
+
};
|
|
13
|
+
/** An editable combobox with manual selection: typing searches, selecting completes the query unless overridden.
|
|
14
|
+
* Input retains focus during navigation; Escape dismisses suggestions before clearing search. */
|
|
15
|
+
export declare function SearchTypeahead({ items, busy, inputProps, ...props }: SearchTypeaheadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export type SectionHeadingProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Document outline level. Defaults to the section level below the page title. */
|
|
5
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
} & Omit<ComponentPropsWithRef<'h2'>, 'children'>;
|
|
7
|
+
/** A section title with the shared section-heading appearance. */
|
|
8
|
+
export declare function SectionHeading({ children, level, className, ...props }: SectionHeadingProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import { type ChoiceOption } from '../../core/variables.js';
|
|
2
3
|
export type SelectProps = {
|
|
3
4
|
label: string;
|
|
5
|
+
labelPlacement?: ControlLabelPlacement;
|
|
4
6
|
options: readonly ChoiceOption[];
|
|
5
7
|
value: string;
|
|
6
8
|
onChange: (value: string) => void;
|
|
@@ -9,6 +11,8 @@ export type SelectProps = {
|
|
|
9
11
|
name?: string;
|
|
10
12
|
id?: string;
|
|
11
13
|
className?: string;
|
|
14
|
+
/** Align the popup with the selection button. Defaults to start. */
|
|
15
|
+
align?: 'start' | 'end';
|
|
12
16
|
};
|
|
13
17
|
/** Labeled single selection with keyboard navigation and a styled listbox. */
|
|
14
|
-
export declare function Select({ label, options, value, onChange, disabled, required, className, ...props }: SelectProps): import("react").JSX.Element;
|
|
18
|
+
export declare function Select({ label, options, value, onChange, disabled, required, className, align, labelPlacement, ...props }: SelectProps): import("react").JSX.Element;
|
|
@@ -10,10 +10,12 @@ export type SheetProps = {
|
|
|
10
10
|
footer?: ReactNode;
|
|
11
11
|
wide?: boolean;
|
|
12
12
|
placement?: 'side' | 'center';
|
|
13
|
+
/** Edge for side placement. Defaults to right; small screens use a bottom sheet. */
|
|
14
|
+
side?: 'left' | 'right';
|
|
13
15
|
returnFocus?: RefObject<HTMLElement | null>;
|
|
14
16
|
} & SheetDialogProps;
|
|
15
17
|
/**
|
|
16
18
|
* Uses the native dialog top layer and focus trap. Closing keeps the modal mounted until its
|
|
17
19
|
* exit transition completes.
|
|
18
20
|
*/
|
|
19
|
-
export declare function Sheet({ open, onOpenChange, title, description, children, headerActions, footer, wide, placement, returnFocus, className, onCancel, onClose, onClick, onTransitionEnd, ref, ...props }: SheetProps): import("react").JSX.Element;
|
|
21
|
+
export declare function Sheet({ open, onOpenChange, title, description, children, headerActions, footer, wide, placement, side, returnFocus, className, onCancel, onClose, onClick, onTransitionEnd, ref, ...props }: SheetProps): import("react").JSX.Element;
|
|
@@ -29,8 +29,14 @@ export type TableDisplayMode = {
|
|
|
29
29
|
};
|
|
30
30
|
type TableWidgetBaseProps<Row> = {
|
|
31
31
|
title: ReactNode;
|
|
32
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
32
33
|
annotationId?: string;
|
|
34
|
+
/** Show the matching supplied-row count before pagination or limits. Defaults to true. */
|
|
35
|
+
showCount?: boolean;
|
|
36
|
+
/** Override the derived count, for example with a server total. Hidden when showCount is false or loading. */
|
|
33
37
|
count?: number;
|
|
38
|
+
/** Clear only filters affecting this dataset. Supply only while those filters are active; enables empty-result recovery. */
|
|
39
|
+
onClearFilters?: () => void;
|
|
34
40
|
description?: ReactNode;
|
|
35
41
|
columns: readonly [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
|
|
36
42
|
/** Unique, nonempty row identity. Numeric keys must be finite; 1 and "1" collide. */
|
|
@@ -41,6 +47,8 @@ type TableWidgetBaseProps<Row> = {
|
|
|
41
47
|
search?: TableWidgetSearch<Row>;
|
|
42
48
|
/** Valid result with no rows; the header remains visible. */
|
|
43
49
|
emptyFallback: EmptyContent;
|
|
50
|
+
/** No local search matches or explicitly filtered results. Defaults to “No matching results” with recovery guidance. */
|
|
51
|
+
noMatchesFallback?: EmptyContent;
|
|
44
52
|
} & TableDisplayMode & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
|
|
45
53
|
/** Composes VisualizationWidget with DataTable, search, and local pagination.
|
|
46
54
|
* Columns own header and body semantics; the first column is the row header.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef } from 'react';
|
|
2
|
-
import { Tabs as AriaTabs,
|
|
1
|
+
import { type ComponentPropsWithRef, type RefAttributes } from 'react';
|
|
2
|
+
import { Tabs as AriaTabs, type TabListProps, Tab as AriaTab, TabPanels, TabPanel as AriaTabPanel } from 'react-aria-components/Tabs';
|
|
3
3
|
/** React Aria tabs with keyboard and ARIA behavior; pair each Tab and TabPanel by stable id. */
|
|
4
|
-
export {
|
|
4
|
+
export { TabPanels };
|
|
5
|
+
export declare function TabList<T>({ className, ref, ...props }: TabListProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
5
6
|
export declare function Tab(props: ComponentPropsWithRef<typeof AriaTab>): import("react").JSX.Element;
|
|
6
7
|
export declare function TabPanel(props: ComponentPropsWithRef<typeof AriaTabPanel>): import("react").JSX.Element;
|
|
7
8
|
export declare function Tabs({ className, ...props }: ComponentPropsWithRef<typeof AriaTabs>): import("react").JSX.Element;
|
|
@@ -2,5 +2,5 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
2
2
|
export type VariableBarProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
} & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
5
|
-
/**
|
|
5
|
+
/** User-controlled inputs below the page header. */
|
|
6
6
|
export declare function VariableBar({ children, className, role, 'aria-label': ariaLabel, ...props }: VariableBarProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
import { type DataWidgetProps } from './DataWidget.js';
|
|
3
3
|
import type { BoundWidgetReading } from './presentation.js';
|
|
4
|
-
type VisualizationWidgetBaseProps = Pick<DataWidgetProps, 'title' | 'annotationId' | 'description' | 'count' | 'action' | 'evidence' | 'status' | 'emptyFallback'> & {
|
|
4
|
+
type VisualizationWidgetBaseProps = Pick<DataWidgetProps, 'title' | 'headingLevel' | 'annotationId' | 'description' | 'count' | 'action' | 'evidence' | 'status' | 'emptyFallback'> & {
|
|
5
5
|
/** Footer controls, such as table pagination. */
|
|
6
6
|
footer?: ReactNode;
|
|
7
7
|
} & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { XAxis } from 'recharts';
|
|
3
|
+
type LabelFormatter = (value: unknown) => string;
|
|
4
|
+
export declare function ChartDateAxes({ data, children, }: {
|
|
5
|
+
data: readonly unknown[];
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function useDateAxisLabel(id?: string | number): LabelFormatter | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Infers temporal input from ISO dates, zoned ISO timestamps, and Date values.
|
|
11
|
+
* Use scale="utc" for epoch milliseconds or type="category" for date-like categories.
|
|
12
|
+
* Explicit tick formatters and tick lists retain authored axis behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ChartXAxis<Row = unknown, Value = string | number>(props: ComponentProps<typeof XAxis<Row, Value>>): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const ChartInteraction: import("react").Context<{
|
|
3
|
+
pointer: boolean;
|
|
4
|
+
point: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} | undefined;
|
|
8
|
+
seriesCount: number;
|
|
9
|
+
registerPoint: (id: string, x: number, y: number) => () => void;
|
|
10
|
+
registerSeries: (id: string) => () => void;
|
|
11
|
+
hovered: string | null;
|
|
12
|
+
setHovered: (id: string | null) => void;
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare function useChartSeries(id?: string): {
|
|
15
|
+
id: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function ChartSeries({ id, children, }: {
|
|
19
|
+
id: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import { type
|
|
1
|
+
export { ChartXAxis } from './chart-date-axis.js';
|
|
2
|
+
import { type ComponentProps } from 'react';
|
|
3
|
+
import { type DotProps, Scatter, YAxis, CartesianGrid, Tooltip, DefaultTooltipContent, type BarProps, type LineProps, type AreaProps } from 'recharts';
|
|
3
4
|
/** Hollow sample marker shared by standalone and composed series. */
|
|
4
5
|
export declare function ChartDot({ active, stroke, fill, r, ...props }: DotProps & {
|
|
5
6
|
active?: boolean;
|
|
6
7
|
}): import("react").JSX.Element;
|
|
7
8
|
/** Shared series defaults; native props override every authored choice. */
|
|
8
9
|
export declare function ChartBar<Row = unknown, Value = number | null>(props: BarProps<Row, Value>): import("react").JSX.Element;
|
|
9
|
-
/**
|
|
10
|
+
/** Sample dots are opt-in with dot=true.
|
|
10
11
|
* activeDot independently controls the hovered point. Native dot props and renderers remain available. */
|
|
11
12
|
export declare function ChartLine<Row = unknown, Value = number | null>({ stroke, dot, activeDot, ...props }: LineProps<Row, Value>): import("react").JSX.Element;
|
|
12
13
|
/** Filled series with the same sample-dot and activeDot options as ChartLine. */
|
|
13
14
|
export declare function ChartArea<Row = unknown, Value = number | null>({ stroke, dot, activeDot, ...props }: AreaProps<Row, Value>): import("react").JSX.Element;
|
|
14
15
|
export declare function ChartScatter<Row = unknown, Value = number>(props: ComponentProps<typeof Scatter<Row, Value>>): import("react").JSX.Element;
|
|
15
|
-
export declare function ChartXAxis<Row = unknown, Value = string | number>(props: ComponentProps<typeof XAxis<Row, Value>>): import("react").JSX.Element;
|
|
16
16
|
export declare function ChartYAxis<Row = unknown, Value = number>(props: ComponentProps<typeof YAxis<Row, Value>>): import("react").JSX.Element;
|
|
17
17
|
export declare function ChartGrid(props: ComponentProps<typeof CartesianGrid>): import("react").JSX.Element;
|
|
18
18
|
export declare function ChartTooltipContent(props: ComponentProps<typeof DefaultTooltipContent> & {
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare function timeModel(values: readonly unknown[], numeric?: boolean): {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
times: number[];
|
|
7
|
+
precision: number;
|
|
8
|
+
tooltip: (value: unknown) => string;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare function timeTicks(model: NonNullable<ReturnType<typeof timeModel>>, width: number): {
|
|
11
|
+
ticks: number[];
|
|
12
|
+
label: (value: number, index: number) => {
|
|
13
|
+
main: string;
|
|
14
|
+
context: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function chartColor(id: string): string;
|
|
2
|
-
export declare const chartBarFill = "var(--atbl-chart-fill, color-mix(in srgb, var(--atbl-
|
|
2
|
+
export declare const chartBarFill = "var(--atbl-chart-fill, color-mix(in srgb, var(--atbl-chart-1) 75%, var(--atbl-surface)))";
|
|
@@ -18,7 +18,9 @@ declare const brandedIcons: {
|
|
|
18
18
|
readonly export: import("lucide-react").LucideIcon;
|
|
19
19
|
readonly error: import("lucide-react").LucideIcon;
|
|
20
20
|
readonly close: import("lucide-react").LucideIcon;
|
|
21
|
+
readonly filters: import("lucide-react").LucideIcon;
|
|
21
22
|
readonly clearFilters: import("lucide-react").LucideIcon;
|
|
23
|
+
readonly displayOptions: import("lucide-react").LucideIcon;
|
|
22
24
|
readonly previous: import("lucide-react").LucideIcon;
|
|
23
25
|
readonly next: import("lucide-react").LucideIcon;
|
|
24
26
|
readonly lightTheme: import("lucide-react").LucideIcon;
|
|
@@ -39,7 +41,7 @@ declare const brandedIcons: {
|
|
|
39
41
|
export type AppIconName = keyof typeof brandedIcons;
|
|
40
42
|
export type AppIconProps = Omit<LucideProps, 'size'> & {
|
|
41
43
|
name: AppIconName;
|
|
42
|
-
size?: number;
|
|
44
|
+
size?: number | string;
|
|
43
45
|
};
|
|
44
46
|
export declare function AppIcon({ name, size, strokeWidth, style, ...props }: AppIconProps): import("react").FunctionComponentElement<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
45
47
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** Direct UI composition and static screens. Requests use declared views from /react. */
|
|
2
|
-
export { injectDataAppShellStyles } from '../shellStyles.js';
|
|
3
2
|
export { DataAppProvider } from '../mount.js';
|
|
4
3
|
export { isPlainKeyEvent } from './keyboard.js';
|
|
5
4
|
export { GettingStarted } from './GettingStarted.js';
|
|
@@ -17,8 +16,6 @@ export type { DataTableProps, DataTableSearch, DataTableEmptyRowProps, DataTable
|
|
|
17
16
|
export { MetricWidget } from './MetricWidget.js';
|
|
18
17
|
export type { MetricWidgetProps } from './MetricWidget.js';
|
|
19
18
|
export { DimensionPicker } from './DimensionPicker.js';
|
|
20
|
-
export { DataAppSkeleton } from './DataAppSkeleton.js';
|
|
21
|
-
export type { DataAppSkeletonProps } from './DataAppSkeleton.js';
|
|
22
19
|
export { LiveControl } from './LiveControl.js';
|
|
23
20
|
export type { LiveControlProps, LiveIntervalSeconds, } from './LiveControl.js';
|
|
24
21
|
export { DateRangePicker } from './DateRangePicker.js';
|
|
@@ -26,7 +23,7 @@ export type { DatePresetId, DateRange, DateRangePickerProps, } from './DateRange
|
|
|
26
23
|
export { useAppVariables } from './variables.js';
|
|
27
24
|
export { SearchField } from './SearchField.js';
|
|
28
25
|
export type { SearchFieldProps } from './SearchField.js';
|
|
29
|
-
export { searchItems } from './searchItems.js';
|
|
26
|
+
export { searchItems, matchSearchText } from './searchItems.js';
|
|
30
27
|
export type { SearchAttribute, SearchHit, SearchItemsOptions, SearchMatchValue, SearchRange, } from './searchItems.js';
|
|
31
28
|
export { SearchMatch } from './SearchMatch.js';
|
|
32
29
|
export type { SearchMatchProps } from './SearchMatch.js';
|
|
@@ -103,3 +100,10 @@ export type { RetentionChartProps, RetentionChartPoint, RetentionChartSeries, }
|
|
|
103
100
|
export { JourneyChart } from './JourneyChart.js';
|
|
104
101
|
export type { JourneyChartProps, JourneyChartPath, } from './JourneyChart.js';
|
|
105
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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DateRangeRequest } from '../../core/contract.js';
|
|
2
|
-
import { type MetricFormat } from '../../core/format.js';
|
|
2
|
+
import { type MetricFormat, type DateFormatOptions } from '../../core/format.js';
|
|
3
3
|
export type MetricComparison = {
|
|
4
4
|
current: {
|
|
5
5
|
value: number;
|
|
@@ -20,7 +20,7 @@ export declare function calendarMetricComparison(displayedInput: DateRangeReques
|
|
|
20
20
|
previous: number | null;
|
|
21
21
|
format: MetricFormat;
|
|
22
22
|
favorableDirection?: MetricComparison['favorableDirection'];
|
|
23
|
-
}): MetricComparison | undefined;
|
|
23
|
+
}, options?: DateFormatOptions): MetricComparison | undefined;
|
|
24
24
|
/** A zero or missing baseline has no meaningful relative percentage. */
|
|
25
25
|
export declare function comparisonChange({ current, previous, favorableDirection, }: MetricComparison): {
|
|
26
26
|
readonly percent: number | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MetricFormat } from '../../core/format.js';
|
|
1
|
+
import type { MetricFormat, DateFormatOptions } from '../../core/format.js';
|
|
2
2
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
3
3
|
import type { MetricReading } from '../../core/reading.js';
|
|
4
4
|
export type MetricDefinition = {
|
|
@@ -8,4 +8,4 @@ export type MetricDefinition = {
|
|
|
8
8
|
favorableDirection?: 'up' | 'down';
|
|
9
9
|
evidence: WidgetEvidence;
|
|
10
10
|
};
|
|
11
|
-
export declare function metricComparison(metric: MetricDefinition, reading: MetricReading): import("./metric-comparison.js").MetricComparison | undefined;
|
|
11
|
+
export declare function metricComparison(metric: MetricDefinition, reading: MetricReading, options?: DateFormatOptions): import("./metric-comparison.js").MetricComparison | undefined;
|
|
@@ -4,6 +4,8 @@ import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
|
4
4
|
export type EmptyContent = {
|
|
5
5
|
title: ReactNode;
|
|
6
6
|
description?: ReactNode;
|
|
7
|
+
/** A relevant recovery action; omit when there is nothing the user can change. */
|
|
8
|
+
action?: ReactNode;
|
|
7
9
|
};
|
|
8
10
|
export type SkeletonContent = {
|
|
9
11
|
variant: 'metric' | 'panel' | 'ranking';
|
|
@@ -25,6 +25,8 @@ export type SearchItemsOptions<Item> = {
|
|
|
25
25
|
limit?: number;
|
|
26
26
|
fuzzyThreshold?: number;
|
|
27
27
|
};
|
|
28
|
+
/** Highlight literal query terms in supplied text without filtering or reordering results. */
|
|
29
|
+
export declare function matchSearchText(text: string, query: string): SearchMatchValue;
|
|
28
30
|
/**
|
|
29
31
|
* Search only a complete local collection. Empty queries retain every item.
|
|
30
32
|
* When a searched field is displayed, render its match with SearchMatch:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatePresetId, DateRange } from '../../core/date-range.js';
|
|
2
2
|
import { type AppVariableValues, type DateRangeSelection, type DateRangeVariable, type HistoryMode, type VariableCollection } from '../../core/variables.js';
|
|
3
3
|
export { defineAppVariables, searchVariable, choiceVariable, multiChoiceVariable, dateRangeVariable, } from '../../core/variables.js';
|
|
4
|
-
export type { AppVariable, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, VariableCollection, } from '../../core/variables.js';
|
|
4
|
+
export type { VariablePresentation, AppVariable, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, VariableCollection, } from '../../core/variables.js';
|
|
5
5
|
/** Adapt one date variable to the controlled picker without giving the picker URL ownership. */
|
|
6
6
|
export declare function dateRangeControl(variable: DateRangeVariable, selection: DateRangeSelection, onChange: (selection: DateRangeSelection) => void): {
|
|
7
7
|
minDate?: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type ActiveFilterControl = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
renderControl: (onDeactivate: () => void) => ReactNode;
|
|
6
|
+
onClear?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function ViewControlBar({ primaryFilters, activeSecondaryFilters, allFilters, activeFilterCount, displayOptions, changedDisplayOptionCount, onClear, }: {
|
|
9
|
+
primaryFilters: ReactNode[];
|
|
10
|
+
allFilters: ReactNode[];
|
|
11
|
+
activeSecondaryFilters: ActiveFilterControl[];
|
|
12
|
+
activeFilterCount: number;
|
|
13
|
+
displayOptions: ReactNode[];
|
|
14
|
+
changedDisplayOptionCount: number;
|
|
15
|
+
onClear?: () => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type AppVariableValues, type VariableCollection } from './ui/variables.js';
|
|
3
3
|
import type { ResolvedVariables } from './view.js';
|
|
4
4
|
/** URL values resolve before facets; facet keys include their dependent inputs for cached, bounded loading. */
|
|
@@ -15,5 +15,6 @@ export declare function useViewVariables<Variables extends VariableCollection>(d
|
|
|
15
15
|
resetValue: AppVariableValues<Variables>[Key];
|
|
16
16
|
};
|
|
17
17
|
resolved: ResolvedVariables<Variables>;
|
|
18
|
-
|
|
18
|
+
searchControls: ReactNode[] | null;
|
|
19
|
+
filterControls: import("react").JSX.Element | null;
|
|
19
20
|
};
|
|
@@ -5,13 +5,15 @@ import type { DisclosedQuery } from '../core/contract.js';
|
|
|
5
5
|
import type { EmptyContent } from './ui/presentation.js';
|
|
6
6
|
export type ViewResult<Data, Input> = {
|
|
7
7
|
dataContext: DataContext;
|
|
8
|
+
timeZone?: string;
|
|
8
9
|
view: DataView<Data, Input>;
|
|
9
10
|
snapshot?: DisplayedSnapshot<Data, Input>;
|
|
10
11
|
refetch: () => unknown;
|
|
11
12
|
cancel: () => unknown;
|
|
12
13
|
refreshing: boolean;
|
|
13
14
|
queries?: DisclosedQuery[];
|
|
14
|
-
|
|
15
|
+
searchControls?: ReactNode;
|
|
16
|
+
filterControls?: ReactNode;
|
|
15
17
|
emptyFallback: EmptyContent;
|
|
16
18
|
};
|
|
17
19
|
/** The executor is private; declarations expose data composition, not subscription hooks. */
|
|
@@ -17,6 +17,19 @@ export type ViewDate<Variables extends VariableCollection, Input> = {
|
|
|
17
17
|
export type ViewBindings<Variables extends VariableCollection, Input> = Partial<{
|
|
18
18
|
[Key in keyof Variables]: (input: Input) => ResolvedVariables<Variables>[Key];
|
|
19
19
|
}>;
|
|
20
|
+
type RequiredFilterBindingKeys<Variables extends VariableCollection, Input> = {
|
|
21
|
+
[Key in keyof Variables]: Extract<Variables[Key]['kind'], 'dimension' | 'numberFilter' | 'booleanFilter'> extends never ? never : [Input] extends [Record<Key, ResolvedVariables<Variables>[Key]>] ? [ResolvedVariables<Variables>[Key]] extends [Input[Key]] ? never : Key : Key;
|
|
22
|
+
}[keyof Variables];
|
|
23
|
+
/** Derive compatible top-level filter bindings; require readers for other input shapes. */
|
|
24
|
+
export type ViewBindingOptions<Variables extends VariableCollection, Input, AdditionalRequired extends keyof Variables = never> = [RequiredFilterBindingKeys<Variables, Input> | AdditionalRequired] extends [
|
|
25
|
+
never
|
|
26
|
+
] ? {
|
|
27
|
+
bindings?: ViewBindings<Variables, Input>;
|
|
28
|
+
} : {
|
|
29
|
+
bindings: ViewBindings<Variables, Input> & {
|
|
30
|
+
[Key in RequiredFilterBindingKeys<Variables, Input> | AdditionalRequired]-?: (input: Input) => ResolvedVariables<Variables>[Key];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
20
33
|
type SameViewInput<Variables extends VariableCollection, Input> = [
|
|
21
34
|
ResolvedVariables<Variables>
|
|
22
35
|
] extends [Input] ? [Input] extends [ResolvedVariables<Variables>] ? [Input] extends [Record<string, never>] ? true : [keyof Input] extends [keyof Variables] ? true : false : false : false;
|
|
@@ -28,7 +41,6 @@ type ViewInputMapping<Variables extends VariableCollection, Input> = SameViewInp
|
|
|
28
41
|
export type DataViewDefinition<Name extends string, Variables extends VariableCollection, Input, Data> = {
|
|
29
42
|
operation: Name;
|
|
30
43
|
dataContext: DataContext;
|
|
31
|
-
bindings?: ViewBindings<Variables, Input>;
|
|
32
44
|
/** App-owned semantics: measured zero need not mean an empty result. */
|
|
33
45
|
isEmpty: (data: Data) => boolean;
|
|
34
46
|
/** Inherited by DataSection unless it supplies its own copy. */
|
|
@@ -37,7 +49,7 @@ export type DataViewDefinition<Name extends string, Variables extends VariableCo
|
|
|
37
49
|
variables?: Variables;
|
|
38
50
|
} : {
|
|
39
51
|
variables: Variables;
|
|
40
|
-
}) & ViewInputMapping<NoInfer<Variables>, Input> & ({
|
|
52
|
+
}) & ViewInputMapping<NoInfer<Variables>, Input> & ViewBindingOptions<NoInfer<Variables>, Input> & ({
|
|
41
53
|
date: ViewDate<Variables, Input>;
|
|
42
54
|
describeInput?: (input: Input) => string;
|
|
43
55
|
} | {
|
|
@@ -13,5 +13,7 @@ export declare function serveLocalApp({ page, operations, title, port, }: {
|
|
|
13
13
|
title: string;
|
|
14
14
|
port?: number;
|
|
15
15
|
}): Bun.Server<undefined>;
|
|
16
|
-
/**
|
|
16
|
+
/** Throw an actionable startup error when the selected lakehouse credentials are missing. */
|
|
17
|
+
export declare function validateLakehouseCredentials(environment?: Record<string, string | undefined>): void;
|
|
18
|
+
/** Server-only SDK adapter. Local development uses the selected CLI profile's proxy. */
|
|
17
19
|
export declare function localLakehouse(environment?: Record<string, string | undefined>, request?: typeof fetch): Lakehouse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Lakehouse } from '../../core/contract.js';
|
|
2
|
+
export type AppFilePreviewOptions = {
|
|
3
|
+
/** Absolute path to the app source. */
|
|
4
|
+
file: string;
|
|
5
|
+
/** Localhost port. Use 0 to select an available port. Defaults to 25837. */
|
|
6
|
+
port?: number;
|
|
7
|
+
/** Server-only query backend; the caller owns credentials and profile selection. */
|
|
8
|
+
lakehouse: Lakehouse;
|
|
9
|
+
};
|
|
10
|
+
export type AppFilePreview = {
|
|
11
|
+
url: URL;
|
|
12
|
+
/** Stop serving, close reload connections, and release all file watchers. */
|
|
13
|
+
stop(): Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
/** Preview a single-file app in the hosted sandbox. Requires the Bun runtime. */
|
|
16
|
+
export declare function serveAppFile({ file: appFile, port, lakehouse, }: AppFilePreviewOptions): Promise<AppFilePreview>;
|