@altertable/data-app 0.61.0 → 0.63.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 +4 -32
- package/CONTRIBUTING.md +63 -72
- package/README.md +14 -38
- package/dist/chunks/{contract-d9skd1n7.js → contract-8wdybxj7.js} +163 -16
- package/dist/chunks/contract-8wdybxj7.js.map +13 -0
- package/dist/chunks/{contract-ryyf6dme.js → contract-cxr9t12b.js} +2 -5
- package/dist/chunks/contract-cxr9t12b.js.map +10 -0
- package/dist/chunks/{contract-14vxdcrs.js → contract-farfe948.js} +17 -21
- package/dist/chunks/contract-farfe948.js.map +10 -0
- package/dist/chunks/contract-mev09s5v.js.map +2 -2
- package/dist/chunks/{contract-ehk50k7e.js → contract-tf8c3qpv.js} +34 -4
- package/dist/chunks/contract-tf8c3qpv.js.map +11 -0
- package/dist/chunks/{contract-zr4s2g7m.js → contract-tkc552ze.js} +75 -36
- package/dist/chunks/contract-tkc552ze.js.map +12 -0
- package/dist/chunks/{contract-nt819swq.js → contract-wd8qe3mt.js} +6 -1
- package/dist/chunks/{contract-nt819swq.js.map → contract-wd8qe3mt.js.map} +3 -3
- package/dist/chunks/contract-wz59z8pq.js.map +1 -1
- package/dist/chunks/{contract-7gpsee0v.js → contract-zr3jd7mr.js} +51 -22
- package/dist/chunks/contract-zr3jd7mr.js.map +12 -0
- package/dist/client/index.js +7 -6
- package/dist/client/index.js.map +1 -1
- package/dist/core/appearance.js +1 -1
- package/dist/core/contract.js +6 -4
- package/dist/core/contract.js.map +1 -1
- package/dist/embed/index.js +41 -9
- package/dist/embed/index.js.map +5 -4
- package/dist/local.js +172 -84
- package/dist/local.js.map +7 -8
- package/dist/react/embed/index.js +83 -99
- package/dist/react/embed/index.js.map +4 -5
- package/dist/react/index.js +5701 -324
- package/dist/react/index.js.map +74 -65
- package/dist/server.js +153 -81
- package/dist/server.js.map +6 -7
- package/dist/types/client/data-client.d.ts +33 -0
- package/dist/types/client/iframe.d.ts +14 -0
- package/dist/types/client/index.d.ts +4 -34
- package/dist/types/client/location.d.ts +4 -6
- package/dist/types/client/navigation.d.ts +2 -1
- package/dist/types/core/appearance.d.ts +7 -6
- package/dist/types/core/bridge.d.ts +2 -8
- package/dist/types/core/config.d.ts +1 -1
- package/dist/types/core/contract.d.ts +9 -56
- package/dist/types/core/format.d.ts +0 -1
- package/dist/types/core/messages.d.ts +11 -30
- package/dist/types/core/navigation.d.ts +11 -0
- package/dist/types/core/operation-types.d.ts +76 -0
- package/dist/types/core/operation.d.ts +21 -0
- package/dist/types/core/presentation.d.ts +7 -0
- package/dist/types/core/variables.d.ts +2 -2
- package/dist/types/embed/bridge.d.ts +12 -0
- package/dist/types/embed/host.d.ts +14 -5
- package/dist/types/embed/index.d.ts +6 -4
- package/dist/types/embed/source.d.ts +15 -0
- package/dist/types/embed/sql.d.ts +4 -0
- package/dist/types/react/content.d.ts +3 -3
- package/dist/types/react/embed/bridge.d.ts +19 -10
- package/dist/types/react/embed/index.d.ts +0 -2
- package/dist/types/react/hooks.d.ts +65 -64
- package/dist/types/react/index.d.ts +135 -2
- package/dist/types/react/injectStyles.d.ts +7 -0
- package/dist/types/react/shellStyles.d.ts +3 -0
- package/dist/types/react/styles.d.ts +8 -0
- package/dist/types/react/ui/AboutData.d.ts +0 -1
- package/dist/types/react/ui/AppFooter.d.ts +0 -1
- package/dist/types/react/ui/AppHeader.d.ts +0 -1
- package/dist/types/react/ui/AppLayout.d.ts +0 -1
- package/dist/types/react/ui/AppScope.d.ts +0 -1
- package/dist/types/react/ui/AppToolbar.d.ts +0 -1
- package/dist/types/react/ui/Breakdown.d.ts +0 -1
- package/dist/types/react/ui/Button.d.ts +0 -1
- package/dist/types/react/ui/Checkbox.d.ts +0 -1
- package/dist/types/react/ui/Combobox.d.ts +0 -1
- package/dist/types/react/ui/ComparisonVisual.d.ts +0 -1
- package/dist/types/react/ui/ContentSkeleton.d.ts +2 -5
- package/dist/types/react/ui/DataApp.d.ts +2 -2
- package/dist/types/react/ui/DataAppSkeleton.d.ts +7 -0
- package/dist/types/react/ui/DataBoundary.d.ts +0 -1
- package/dist/types/react/ui/DataSection.d.ts +2 -4
- package/dist/types/react/ui/DataTable.d.ts +2 -3
- package/dist/types/react/ui/DataViewToast.d.ts +0 -1
- package/dist/types/react/ui/DataWidget.d.ts +4 -14
- package/dist/types/react/ui/DateRangePicker.d.ts +0 -1
- package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -1
- package/dist/types/react/ui/EmptyState.d.ts +2 -5
- package/dist/types/react/ui/GettingStarted.d.ts +0 -1
- package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -1
- package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -1
- package/dist/types/react/ui/GradientScroll.d.ts +0 -1
- package/dist/types/react/ui/Grid.d.ts +0 -1
- package/dist/types/react/ui/HelpPopover.d.ts +0 -2
- package/dist/types/react/ui/Kbd.d.ts +0 -1
- package/dist/types/react/ui/LiveControl.d.ts +0 -1
- package/dist/types/react/ui/MetricWidget.d.ts +0 -2
- package/dist/types/react/ui/PeriodSummary.d.ts +0 -1
- package/dist/types/react/ui/PresentStory.d.ts +0 -1
- package/dist/types/react/ui/QueryList.d.ts +0 -1
- package/dist/types/react/ui/Ranking.d.ts +0 -1
- package/dist/types/react/ui/RefreshControl.d.ts +0 -1
- package/dist/types/react/ui/RefreshRegion.d.ts +0 -1
- package/dist/types/react/ui/RequestHint.d.ts +0 -1
- package/dist/types/react/ui/SearchField.d.ts +0 -1
- package/dist/types/react/ui/SearchInput.d.ts +1 -2
- package/dist/types/react/ui/SearchMatch.d.ts +0 -1
- package/dist/types/react/ui/SelectableBarChart.d.ts +0 -1
- package/dist/types/react/ui/SelectionMark.d.ts +0 -1
- package/dist/types/react/ui/Sheet.d.ts +0 -1
- package/dist/types/react/ui/Skeleton.d.ts +0 -1
- package/dist/types/react/ui/Stack.d.ts +0 -1
- package/dist/types/react/ui/StatusPanel.d.ts +0 -1
- package/dist/types/react/ui/TableWidget.d.ts +2 -3
- package/dist/types/react/ui/Tabs.d.ts +0 -1
- package/dist/types/react/ui/TextContent.d.ts +4 -0
- package/dist/types/react/ui/TextWidget.d.ts +19 -0
- package/dist/types/react/ui/ThemeSelector.d.ts +0 -1
- package/dist/types/react/ui/Tooltip.d.ts +0 -1
- package/dist/types/react/ui/UpdatedAt.d.ts +0 -1
- package/dist/types/react/ui/VariableBar.d.ts +0 -1
- package/dist/types/react/ui/VisualizationWidget.d.ts +5 -13
- package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -1
- package/dist/types/react/ui/WidgetViewTabs.d.ts +2 -3
- package/dist/types/react/ui/data-identifiers.d.ts +0 -1
- package/dist/types/react/ui/presentation.d.ts +19 -0
- package/dist/types/react/ui/useAppAppearance.d.ts +3 -0
- package/dist/types/react/ui/useDataAppPresentation.d.ts +3 -0
- package/dist/types/react/view-controls.d.ts +2 -2
- package/dist/types/react/view.d.ts +2 -2
- package/dist/{bootstrap.js → worker.js} +144 -12
- package/docs/app-authoring.md +60 -24
- package/docs/client.md +48 -19
- package/docs/contract.md +10 -10
- package/docs/embed.md +94 -26
- package/docs/hosted-apps.md +39 -0
- package/docs/local-data-apps.md +14 -0
- package/docs/react-embed.md +75 -24
- package/docs/react.md +118 -93
- package/docs/server-bun.md +4 -1
- package/docs/server.md +2 -2
- package/docs/worker.md +55 -0
- package/examples/starter-data-app/index.tsx +159 -0
- package/package.json +18 -12
- package/dist/chunks/contract-14vxdcrs.js.map +0 -10
- package/dist/chunks/contract-7gpsee0v.js.map +0 -11
- package/dist/chunks/contract-d9skd1n7.js.map +0 -12
- package/dist/chunks/contract-ehk50k7e.js.map +0 -10
- package/dist/chunks/contract-ryyf6dme.js.map +0 -10
- package/dist/chunks/contract-zr4s2g7m.js.map +0 -12
- package/dist/react/index.css +0 -4478
- package/dist/react.css.d.ts +0 -1
- package/dist/types/embed/shell.d.ts +0 -21
- package/dist/types/embed/standalone.d.ts +0 -1
- package/dist/types/react/embed/shell.d.ts +0 -10
- package/dist/types/react/ui/index.d.ts +0 -129
- package/docs/appearance.md +0 -30
- package/docs/bootstrap.md +0 -76
- package/docs/config.md +0 -21
- package/docs/format.md +0 -29
- package/docs/react-styles.md +0 -17
- package/docs/starter-agent-instructions.md +0 -53
|
@@ -3,7 +3,6 @@ import type { DataView } from '../../core/data-view.js';
|
|
|
3
3
|
import { type LiveControlProps } from './LiveControl.js';
|
|
4
4
|
import { PresentStory } from './PresentStory.js';
|
|
5
5
|
import { RefreshControl } from './RefreshControl.js';
|
|
6
|
-
|
|
7
6
|
export type AppToolbarProps = {
|
|
8
7
|
children?: ReactNode;
|
|
9
8
|
end?: ReactNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
|
-
|
|
4
3
|
export type ButtonProps = ComponentPropsWithRef<'button'> & {
|
|
5
4
|
variant?: 'elevated' | 'outline' | 'ghost';
|
|
6
5
|
size?: 'default' | 'compact' | 'icon' | 'icon-compact';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type MetricComparison } from './comparison.js';
|
|
2
2
|
import type { MetricDefinition } from './metric.js';
|
|
3
3
|
import type { MetricReading } from '../../core/reading.js';
|
|
4
|
-
|
|
5
4
|
type UnboundComparisonProps = MetricComparison & {
|
|
6
5
|
label: string;
|
|
7
6
|
emphasis?: 'standard' | 'story';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
|
-
export type ContentSkeletonProps =
|
|
4
|
-
rows?: number;
|
|
5
|
-
variant: 'metric' | 'panel' | 'ranking';
|
|
6
|
-
} & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
2
|
+
import type { SkeletonContent } from './presentation.js';
|
|
3
|
+
export type ContentSkeletonProps = SkeletonContent & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
7
4
|
/** A metric, panel, or ranking placeholder to compose in the same layout as live content. */
|
|
8
5
|
export declare function ContentSkeleton({ variant, rows, className, ...props }: ContentSkeletonProps): import("react").JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { type AppToolbarProps } from './AppToolbar.js';
|
|
|
7
7
|
import type { DataContext } from './data-context.js';
|
|
8
8
|
import type { BoundStory } from './story.js';
|
|
9
9
|
import { type SectionResult } from './DataSection.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { EmptyContent } from './presentation.js';
|
|
11
11
|
type DataAppBaseProps = {
|
|
12
12
|
config: DataAppConfig;
|
|
13
13
|
dataContext: DataContext;
|
|
@@ -25,7 +25,7 @@ type DataAppBaseProps = {
|
|
|
25
25
|
export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
|
|
26
26
|
queries?: DisclosedQuery[];
|
|
27
27
|
refresh?: AppToolbarProps['refresh'];
|
|
28
|
-
empty:
|
|
28
|
+
empty: EmptyContent;
|
|
29
29
|
controls?: ReactNode;
|
|
30
30
|
};
|
|
31
31
|
export type DataAppProps<Data = unknown, Input = unknown> = DataAppBaseProps & ({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export type DataAppSkeletonProps = Omit<ComponentPropsWithRef<'output'>, 'children' | 'role' | 'aria-busy'> & {
|
|
3
|
+
header?: ReactNode;
|
|
4
|
+
footer?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/** Host-side placeholder while a data app starts. Header and footer slots remain host-owned; widget placeholders are decorative. */
|
|
7
|
+
export declare function DataAppSkeleton({ header, footer, className, ...props }: DataAppSkeletonProps): import("react").JSX.Element;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import type { DataView } from '../../core/data-view.js';
|
|
3
|
-
import {
|
|
4
|
-
type SectionEmpty = Pick<EmptyStateProps, 'title' | 'description'>;
|
|
3
|
+
import type { EmptyContent } from './presentation.js';
|
|
5
4
|
export type SectionResult<Data, Input> = {
|
|
6
5
|
view: DataView<Data, Input>;
|
|
7
6
|
refetch: () => unknown;
|
|
8
7
|
};
|
|
9
8
|
export type DataSectionProps<Data, Input = unknown> = {
|
|
10
9
|
result: SectionResult<Data, Input>;
|
|
11
|
-
empty:
|
|
10
|
+
empty: EmptyContent;
|
|
12
11
|
children: (data: Data, displayedInput: Input) => ReactNode;
|
|
13
12
|
/** Placeholder layout for an initial request; use the ready view's grid without copied values. */
|
|
14
13
|
loading?: ReactNode;
|
|
@@ -25,4 +24,3 @@ export type DataSectionProps<Data, Input = unknown> = {
|
|
|
25
24
|
/** One request boundary for any number of cards. `DataBoundary` exposes the lower-level
|
|
26
25
|
* view-state slots for custom composition. */
|
|
27
26
|
export declare function DataSection<Data, Input>({ result, children, empty, loading, error, label, notice, dimOnUpdate, ...props }: DataSectionProps<Data, Input>): import("react").JSX.Element;
|
|
28
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { EmptyContent } from './presentation.js';
|
|
3
3
|
import { type SearchFieldProps } from './SearchField.js';
|
|
4
|
-
|
|
5
4
|
export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue'> & {
|
|
6
5
|
/** Number of available records before filtering or a display limit. */
|
|
7
6
|
itemCount: number;
|
|
@@ -16,7 +15,7 @@ export declare function DataTable({ className, ref, searchable, ...props }: Data
|
|
|
16
15
|
export declare function DataTableShare({ value }: {
|
|
17
16
|
value: number;
|
|
18
17
|
}): import("react").JSX.Element;
|
|
19
|
-
export type DataTableEmptyRowProps =
|
|
18
|
+
export type DataTableEmptyRowProps = EmptyContent & {
|
|
20
19
|
colSpan: number;
|
|
21
20
|
};
|
|
22
21
|
export declare function DataTableEmptyRow({ colSpan, title, description, }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
-
import type { DataReading } from '../../core/reading.js';
|
|
3
2
|
import { type WidgetStatus } from './RequestHint.js';
|
|
4
|
-
import {
|
|
5
|
-
import { type EmptyStateProps } from './EmptyState.js';
|
|
3
|
+
import type { EmptyContent, BoundWidgetReading } from './presentation.js';
|
|
6
4
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type Empty = Pick<EmptyStateProps, 'title' | 'description'>;
|
|
10
5
|
type DataWidgetBaseProps = {
|
|
11
6
|
title: ReactNode;
|
|
12
7
|
count?: number;
|
|
@@ -21,18 +16,13 @@ type DataWidgetBaseProps = {
|
|
|
21
16
|
/** Owns loading, empty content, actions, and inspection. Page and sheet mount the same
|
|
22
17
|
* body and footer; hold interactive child state above the widget to share it across mounts.
|
|
23
18
|
* A bound reading requires evidence; its child renderer runs only for nonempty ready data. */
|
|
24
|
-
export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ({
|
|
25
|
-
reading: DataReading<Data>;
|
|
26
|
-
isEmpty: (data: Data) => boolean;
|
|
27
|
-
empty: Empty;
|
|
28
|
-
evidence: WidgetEvidence;
|
|
29
|
-
skeleton?: Pick<ContentSkeletonProps, 'variant' | 'rows'>;
|
|
19
|
+
export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ((BoundWidgetReading<Data> & {
|
|
30
20
|
children: (data: Data) => ReactNode;
|
|
31
|
-
} | {
|
|
21
|
+
}) | {
|
|
32
22
|
reading?: never;
|
|
33
23
|
isEmpty?: never;
|
|
34
24
|
skeleton?: never;
|
|
35
|
-
empty?:
|
|
25
|
+
empty?: EmptyContent;
|
|
36
26
|
children: ReactNode;
|
|
37
27
|
});
|
|
38
28
|
export declare function DataWidget<Data>(props: DataWidgetProps<Data>): import("react").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
2
|
import { type CalendarDate } from '@internationalized/date';
|
|
3
3
|
import { DateRangePicker as AriaDateRangePicker } from 'react-aria-components';
|
|
4
|
-
|
|
5
4
|
import { type DatePresetId, type DateRange } from '../../core/date-range.js';
|
|
6
5
|
export type { DatePresetId, DateRange } from '../../core/date-range.js';
|
|
7
6
|
export type DateRangePickerProps = {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type EmptyStateProps = {
|
|
4
|
-
title: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
1
|
+
import type { EmptyContent } from './presentation.js';
|
|
2
|
+
export type EmptyStateProps = EmptyContent & {
|
|
6
3
|
variant?: 'visual' | 'table';
|
|
7
4
|
className?: string;
|
|
8
5
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DataAppConfig } from '../../core/config.js';
|
|
2
2
|
import type { DataContext } from './data-context.js';
|
|
3
|
-
|
|
4
3
|
/** Query-backed connection state and next steps for a newly created app. Mount within
|
|
5
4
|
* `DataAppProvider` and register `connection: connectionCheck()` on the server. */
|
|
6
5
|
export declare function GettingStarted({ config, dataContext, }: {
|
|
@@ -2,7 +2,6 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
2
2
|
import type { DisclosedQuery } from '../../core/contract.js';
|
|
3
3
|
import type { DataContext, GlossaryEntry } from './data-context.js';
|
|
4
4
|
import { type AboutEmpty } from './AboutData.js';
|
|
5
|
-
|
|
6
5
|
export type GlossaryExplanationProps = {
|
|
7
6
|
entry: GlossaryEntry;
|
|
8
7
|
empty?: AboutEmpty;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
|
|
2
2
|
import { type Placement } from '@floating-ui/react';
|
|
3
|
-
|
|
4
|
-
|
|
5
3
|
export type HelpPopoverTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'>;
|
|
6
4
|
export type HelpPopoverPanelProps = Omit<ComponentPropsWithRef<'section'>, 'children' | 'role'>;
|
|
7
5
|
export type HelpPopoverProps = {
|
|
@@ -5,8 +5,6 @@ import { type MetricComparison } from './comparison.js';
|
|
|
5
5
|
import { type MetricFormat } from '../../core/format.js';
|
|
6
6
|
import type { MetricReading } from '../../core/reading.js';
|
|
7
7
|
import { type MetricDefinition } from './metric.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
8
|
type MetricWidgetBaseProps = {
|
|
11
9
|
label: string;
|
|
12
10
|
description?: ReactNode;
|
|
@@ -3,7 +3,6 @@ import type { ThemeController } from '../../core/appearance.js';
|
|
|
3
3
|
import { type AboutEmpty } from './AboutData.js';
|
|
4
4
|
import type { DataContext } from './data-context.js';
|
|
5
5
|
import { type StoryFinding } from './story.js';
|
|
6
|
-
|
|
7
6
|
export type StoryStep = {
|
|
8
7
|
id: string;
|
|
9
8
|
empty?: AboutEmpty;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
|
|
3
2
|
/** One search control surface for picker search and table/page search. */
|
|
4
|
-
export declare function SearchInput({ size, endAction, loading, className, ...props }: Omit<ComponentPropsWithRef<'input'>, 'size' | 'children'> & {
|
|
3
|
+
export declare function SearchInput({ size, endAction, loading, className, onKeyDown, ...props }: Omit<ComponentPropsWithRef<'input'>, 'size' | 'children'> & {
|
|
5
4
|
size?: 'default' | 'compact';
|
|
6
5
|
endAction?: ReactNode;
|
|
7
6
|
/** Replaces the search glyph in its existing space; input and results remain usable. */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
2
|
export type SkeletonProps = Omit<ComponentPropsWithRef<'span'>, 'children' | 'aria-hidden'>;
|
|
4
3
|
/** Decorative loading placeholder that fades in only when loading takes a moment.
|
|
5
4
|
* Put the accessible status on its container. */
|
|
@@ -2,10 +2,9 @@ import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
|
2
2
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
3
3
|
import type { WidgetStatus } from './RequestHint.js';
|
|
4
4
|
import { type DataTableSearch } from './DataTable.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EmptyContent } from './presentation.js';
|
|
6
6
|
import { type SearchHit, type SearchItemsOptions } from './searchItems.js';
|
|
7
7
|
import type { DataReading } from '../../core/reading.js';
|
|
8
|
-
|
|
9
8
|
export type TableWidgetColumn<Row> = {
|
|
10
9
|
/** Stable, nonempty identity; unique within this table. */
|
|
11
10
|
id: string;
|
|
@@ -28,7 +27,7 @@ type TableWidgetBaseProps<Row> = {
|
|
|
28
27
|
evidence?: WidgetEvidence;
|
|
29
28
|
search?: TableWidgetSearch<Row>;
|
|
30
29
|
/** Valid result with no rows; the header remains visible. */
|
|
31
|
-
empty:
|
|
30
|
+
empty: EmptyContent;
|
|
32
31
|
} & ({
|
|
33
32
|
/** Positive integer preview cap after search; disables pagination. */
|
|
34
33
|
limit: number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'react-aria-components/Tabs';
|
|
2
|
-
|
|
3
2
|
/** React Aria tabs with keyboard and ARIA behavior; pair each Tab and TabPanel by stable id. */
|
|
4
3
|
export { Tabs, TabList, Tab, TabPanels, TabPanel };
|
|
5
4
|
/** Keep a page-level tab in `?view=`; reserve `?tab=` for the inspect sheet. */
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type TextContentProps = ComponentPropsWithRef<'div'>;
|
|
3
|
+
/** Prose typography for page introductions, widget bodies, and inspection content. */
|
|
4
|
+
export declare function TextContent({ className, ...props }: TextContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DataReading } from '../../core/reading.js';
|
|
3
|
+
import { type DataWidgetProps } from './DataWidget.js';
|
|
4
|
+
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
5
|
+
type TextWidgetBaseProps = Omit<Extract<DataWidgetProps, {
|
|
6
|
+
reading?: never;
|
|
7
|
+
}>, 'reading' | 'children' | 'isEmpty' | 'empty' | 'skeleton' | 'bodyPadding'>;
|
|
8
|
+
/** Framed narrative context. Bind claims and scope to the same displayed reading.
|
|
9
|
+
* The renderer handles every ready value, including zero and empty collections. */
|
|
10
|
+
export type TextWidgetProps<Data = unknown> = TextWidgetBaseProps & ({
|
|
11
|
+
reading: DataReading<Data>;
|
|
12
|
+
evidence: WidgetEvidence;
|
|
13
|
+
children: (data: Data) => ReactNode;
|
|
14
|
+
} | {
|
|
15
|
+
reading?: never;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
});
|
|
18
|
+
export declare function TextWidget<Data>(props: TextWidgetProps<Data>): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import type { DataReading } from '../../core/reading.js';
|
|
6
|
-
import { type ContentSkeletonProps } from './ContentSkeleton.js';
|
|
7
|
-
|
|
3
|
+
import type { WidgetStatus } from './RequestHint.js';
|
|
4
|
+
import type { EmptyContent, BoundWidgetReading } from './presentation.js';
|
|
8
5
|
type VisualizationWidgetBaseProps = {
|
|
9
6
|
title: ReactNode;
|
|
10
7
|
description?: ReactNode;
|
|
11
8
|
insight?: ReactNode;
|
|
12
9
|
action?: ReactNode;
|
|
13
10
|
evidence?: WidgetEvidence;
|
|
14
|
-
status?:
|
|
15
|
-
empty?:
|
|
11
|
+
status?: WidgetStatus;
|
|
12
|
+
empty?: EmptyContent;
|
|
16
13
|
} & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
|
|
17
14
|
type UnboundVisualizationWidgetProps = VisualizationWidgetBaseProps & ({
|
|
18
15
|
loading: true;
|
|
@@ -27,12 +24,7 @@ export type VisualizationWidgetView<Data> = {
|
|
|
27
24
|
label: ReactNode;
|
|
28
25
|
render: (data: Data) => ReactNode;
|
|
29
26
|
};
|
|
30
|
-
type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & {
|
|
31
|
-
evidence: WidgetEvidence;
|
|
32
|
-
reading: DataReading<Data>;
|
|
33
|
-
isEmpty: (data: Data) => boolean;
|
|
34
|
-
empty: Pick<EmptyStateProps, 'title' | 'description'>;
|
|
35
|
-
skeleton?: Pick<ContentSkeletonProps, 'variant' | 'rows'>;
|
|
27
|
+
type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & BoundWidgetReading<Data> & {
|
|
36
28
|
visual?: never;
|
|
37
29
|
loading?: never;
|
|
38
30
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { EmptyContent } from './presentation.js';
|
|
4
3
|
export type WidgetView = {
|
|
5
4
|
id: string;
|
|
6
5
|
label: ReactNode;
|
|
7
6
|
content: ReactNode;
|
|
8
|
-
empty:
|
|
7
|
+
empty: EmptyContent;
|
|
9
8
|
isEmpty: boolean;
|
|
10
9
|
};
|
|
11
10
|
export type WidgetViewTabsProps<Views extends readonly WidgetView[] = readonly WidgetView[]> = {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DataReading } from '../../core/reading.js';
|
|
3
|
+
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
4
|
+
export type EmptyContent = {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type SkeletonContent = {
|
|
9
|
+
variant: 'metric' | 'panel' | 'ranking';
|
|
10
|
+
rows?: number;
|
|
11
|
+
};
|
|
12
|
+
/** A bound widget must explain empty results and link the reading to its evidence. */
|
|
13
|
+
export type BoundWidgetReading<Data> = {
|
|
14
|
+
reading: DataReading<Data>;
|
|
15
|
+
isEmpty: (data: Data) => boolean;
|
|
16
|
+
empty: EmptyContent;
|
|
17
|
+
evidence: WidgetEvidence;
|
|
18
|
+
skeleton?: SkeletonContent;
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type Theme } from '../../core/appearance.js';
|
|
2
|
+
/** The parent theme takes precedence; only standalone viewers receive controls. */
|
|
3
|
+
export declare function useAppAppearance(appearance: unknown, hostTheme?: Theme): import("../../core/appearance.js").ThemeController | undefined;
|
|
@@ -2,11 +2,11 @@ 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. */
|
|
5
|
-
export declare function useViewVariables<Variables extends VariableCollection>(definitions: Variables, loadFacet: (operation: string, input: unknown, signal: AbortSignal) => Promise<unknown>): {
|
|
5
|
+
export declare function useViewVariables<Variables extends VariableCollection>(definitions: Variables, clientScope: string, loadFacet: (operation: string, input: unknown, signal: AbortSignal) => Promise<unknown>): {
|
|
6
6
|
values: AppVariableValues<Variables>;
|
|
7
7
|
set: <Key extends keyof Variables & string>(name: Key, value: AppVariableValues<Variables>[Key]) => void;
|
|
8
8
|
reset: <Key extends keyof Variables & string>(name: Key) => void;
|
|
9
|
-
update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/
|
|
9
|
+
update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/navigation.js").HistoryMode) => void;
|
|
10
10
|
bind: <Key extends keyof Variables & string>(name: Key) => {
|
|
11
11
|
value: AppVariableValues<Variables>[Key];
|
|
12
12
|
onChange(value: AppVariableValues<Variables>[Key]): void;
|