@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.
Files changed (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/THIRD_PARTY_NOTICES +18 -0
  4. package/dist/chunks/index-xwy62xrb.js +16996 -0
  5. package/dist/chunks/index-xwy62xrb.js.map +120 -0
  6. package/dist/index.js +2888 -0
  7. package/dist/index.js.map +23 -0
  8. package/dist/types/actions.d.ts +53 -0
  9. package/dist/types/annotations/AnnotationBar.d.ts +30 -0
  10. package/dist/types/annotations/AnnotationControls.d.ts +10 -0
  11. package/dist/types/annotations/AnnotationEditor.d.ts +16 -0
  12. package/dist/types/annotations/AnnotationMarkers.d.ts +19 -0
  13. package/dist/types/annotations/AnnotationSelectionLayer.d.ts +12 -0
  14. package/dist/types/annotations/AnnotationTarget.d.ts +9 -0
  15. package/dist/types/annotations/AnnotationTooltip.d.ts +9 -0
  16. package/dist/types/annotations/AnnotationTrigger.d.ts +10 -0
  17. package/dist/types/annotations/annotation-editor-state.d.ts +58 -0
  18. package/dist/types/annotations/annotation-screenshot.d.ts +4 -0
  19. package/dist/types/annotations/annotation-targets.d.ts +34 -0
  20. package/dist/types/annotations/getAnnotationProps.d.ts +17 -0
  21. package/dist/types/annotations/styles.d.ts +3 -0
  22. package/dist/types/annotations/useAnnotationGeometry.d.ts +22 -0
  23. package/dist/types/annotations/useDataAppAnnotations.d.ts +22 -0
  24. package/dist/types/app-context.d.ts +3 -0
  25. package/dist/types/bindings.d.ts +169 -0
  26. package/dist/types/content.d.ts +36 -0
  27. package/dist/types/date-formatting.d.ts +12 -0
  28. package/dist/types/details.d.ts +46 -0
  29. package/dist/types/exploration.d.ts +44 -0
  30. package/dist/types/hooks.d.ts +114 -0
  31. package/dist/types/index.d.ts +78 -0
  32. package/dist/types/injectStyles.d.ts +7 -0
  33. package/dist/types/mount.d.ts +13 -0
  34. package/dist/types/search-suggestions.d.ts +8 -0
  35. package/dist/types/source-owner.d.ts +2 -0
  36. package/dist/types/style-contract.d.ts +88 -0
  37. package/dist/types/style-validation.d.ts +2 -0
  38. package/dist/types/styles.d.ts +8 -0
  39. package/dist/types/ui/AboutData.d.ts +73 -0
  40. package/dist/types/ui/AltertableLogo.d.ts +3 -0
  41. package/dist/types/ui/AppFooter.d.ts +6 -0
  42. package/dist/types/ui/AppHeader.d.ts +10 -0
  43. package/dist/types/ui/AppLayout.d.ts +10 -0
  44. package/dist/types/ui/AppScope.d.ts +7 -0
  45. package/dist/types/ui/AppToolbar.d.ts +30 -0
  46. package/dist/types/ui/AreaChart.d.ts +7 -0
  47. package/dist/types/ui/BarChart.d.ts +6 -0
  48. package/dist/types/ui/Breakdown.d.ts +13 -0
  49. package/dist/types/ui/Button.d.ts +12 -0
  50. package/dist/types/ui/ChartLegend.d.ts +32 -0
  51. package/dist/types/ui/Checkbox.d.ts +21 -0
  52. package/dist/types/ui/CheckboxGroup.d.ts +7 -0
  53. package/dist/types/ui/ChoicePicker.d.ts +39 -0
  54. package/dist/types/ui/Comparison.d.ts +14 -0
  55. package/dist/types/ui/ComposedChart.d.ts +41 -0
  56. package/dist/types/ui/ComposedChartLegend.d.ts +9 -0
  57. package/dist/types/ui/ContentSkeleton.d.ts +7 -0
  58. package/dist/types/ui/DataApp.d.ts +24 -0
  59. package/dist/types/ui/DataAppFrame.d.ts +52 -0
  60. package/dist/types/ui/DataBoundary.d.ts +14 -0
  61. package/dist/types/ui/DataSection.d.ts +14 -0
  62. package/dist/types/ui/DataSectionBoundary.d.ts +30 -0
  63. package/dist/types/ui/DataTable.d.ts +29 -0
  64. package/dist/types/ui/DataValue.d.ts +9 -0
  65. package/dist/types/ui/DataViewToast.d.ts +11 -0
  66. package/dist/types/ui/DataWidget.d.ts +37 -0
  67. package/dist/types/ui/DateDisplay.d.ts +9 -0
  68. package/dist/types/ui/DateRangePicker.d.ts +30 -0
  69. package/dist/types/ui/DateTimeTooltip.d.ts +10 -0
  70. package/dist/types/ui/DimensionPicker.d.ts +14 -0
  71. package/dist/types/ui/EmptyState.d.ts +6 -0
  72. package/dist/types/ui/ExplorationActionControl.d.ts +60 -0
  73. package/dist/types/ui/ExportControl.d.ts +4 -0
  74. package/dist/types/ui/FilterActions.d.ts +10 -0
  75. package/dist/types/ui/FilterBar.d.ts +3 -0
  76. package/dist/types/ui/FunnelChart.d.ts +20 -0
  77. package/dist/types/ui/GettingStarted.d.ts +6 -0
  78. package/dist/types/ui/GlossaryDefinition.d.ts +7 -0
  79. package/dist/types/ui/GlossaryExplanation.d.ts +16 -0
  80. package/dist/types/ui/GradientScroll.d.ts +23 -0
  81. package/dist/types/ui/Grid.d.ts +12 -0
  82. package/dist/types/ui/GridItem.d.ts +7 -0
  83. package/dist/types/ui/HelpPopover.d.ts +21 -0
  84. package/dist/types/ui/IconButton.d.ts +19 -0
  85. package/dist/types/ui/InspectionContext.d.ts +12 -0
  86. package/dist/types/ui/InspectionProvider.d.ts +29 -0
  87. package/dist/types/ui/JourneyChart.d.ts +10 -0
  88. package/dist/types/ui/Kbd.d.ts +7 -0
  89. package/dist/types/ui/LineChart.d.ts +7 -0
  90. package/dist/types/ui/LiveControl.d.ts +10 -0
  91. package/dist/types/ui/Menu.d.ts +13 -0
  92. package/dist/types/ui/MetricWidget.d.ts +51 -0
  93. package/dist/types/ui/NumberField.d.ts +27 -0
  94. package/dist/types/ui/NumberFilterPicker.d.ts +11 -0
  95. package/dist/types/ui/PeriodSummary.d.ts +17 -0
  96. package/dist/types/ui/PickerField.d.ts +23 -0
  97. package/dist/types/ui/PieChart.d.ts +11 -0
  98. package/dist/types/ui/PopoverSurface.d.ts +5 -0
  99. package/dist/types/ui/PresentStory.d.ts +30 -0
  100. package/dist/types/ui/QueryList.d.ts +14 -0
  101. package/dist/types/ui/RadioGroup.d.ts +18 -0
  102. package/dist/types/ui/Ranking.d.ts +13 -0
  103. package/dist/types/ui/RefreshControl.d.ts +9 -0
  104. package/dist/types/ui/RequestHint.d.ts +20 -0
  105. package/dist/types/ui/RetentionChart.d.ts +27 -0
  106. package/dist/types/ui/ScatterChart.d.ts +17 -0
  107. package/dist/types/ui/SearchField.d.ts +23 -0
  108. package/dist/types/ui/SearchInput.d.ts +10 -0
  109. package/dist/types/ui/SearchMatch.d.ts +6 -0
  110. package/dist/types/ui/SearchTypeahead.d.ts +15 -0
  111. package/dist/types/ui/SectionHeading.d.ts +8 -0
  112. package/dist/types/ui/Select.d.ts +22 -0
  113. package/dist/types/ui/SelectionMark.d.ts +5 -0
  114. package/dist/types/ui/Sheet.d.ts +21 -0
  115. package/dist/types/ui/Skeleton.d.ts +8 -0
  116. package/dist/types/ui/Stack.d.ts +7 -0
  117. package/dist/types/ui/StaticDataApp.d.ts +4 -0
  118. package/dist/types/ui/StatusPanel.d.ts +10 -0
  119. package/dist/types/ui/TableWidget.d.ts +67 -0
  120. package/dist/types/ui/Tabs.d.ts +10 -0
  121. package/dist/types/ui/TextContent.d.ts +4 -0
  122. package/dist/types/ui/TextWidget.d.ts +20 -0
  123. package/dist/types/ui/ThemeSelector.d.ts +12 -0
  124. package/dist/types/ui/Toast.d.ts +8 -0
  125. package/dist/types/ui/Tooltip.d.ts +23 -0
  126. package/dist/types/ui/TooltipSurface.d.ts +3 -0
  127. package/dist/types/ui/TrendChart.d.ts +5 -0
  128. package/dist/types/ui/UpdatedAt.d.ts +9 -0
  129. package/dist/types/ui/VariableBar.d.ts +6 -0
  130. package/dist/types/ui/VisualizationWidget.d.ts +43 -0
  131. package/dist/types/ui/WidgetDisclosure.d.ts +6 -0
  132. package/dist/types/ui/WidgetEvidence.d.ts +12 -0
  133. package/dist/types/ui/WidgetViewTabs.d.ts +16 -0
  134. package/dist/types/ui/chart-data.d.ts +36 -0
  135. package/dist/types/ui/chart-date-axis.d.ts +15 -0
  136. package/dist/types/ui/chart-interaction.d.ts +27 -0
  137. package/dist/types/ui/chart-primitives.d.ts +22 -0
  138. package/dist/types/ui/chart-time.d.ts +19 -0
  139. package/dist/types/ui/chartColor.d.ts +2 -0
  140. package/dist/types/ui/classNames.d.ts +1 -0
  141. package/dist/types/ui/csv-export.d.ts +19 -0
  142. package/dist/types/ui/data-context.d.ts +76 -0
  143. package/dist/types/ui/data-identifiers.d.ts +32 -0
  144. package/dist/types/ui/icons.d.ts +49 -0
  145. package/dist/types/ui/index.d.ts +111 -0
  146. package/dist/types/ui/journey-flow.d.ts +49 -0
  147. package/dist/types/ui/keyboard.d.ts +6 -0
  148. package/dist/types/ui/metric-comparison.d.ts +30 -0
  149. package/dist/types/ui/metric.d.ts +11 -0
  150. package/dist/types/ui/presentation.d.ts +25 -0
  151. package/dist/types/ui/search.d.ts +6 -0
  152. package/dist/types/ui/searchItems.d.ts +36 -0
  153. package/dist/types/ui/shortcuts.d.ts +45 -0
  154. package/dist/types/ui/story.d.ts +20 -0
  155. package/dist/types/ui/time-interval.d.ts +96 -0
  156. package/dist/types/ui/use-chart-scroll-to-end.d.ts +2 -0
  157. package/dist/types/ui/useAppAppearance.d.ts +3 -0
  158. package/dist/types/ui/useDataAppPresentation.d.ts +3 -0
  159. package/dist/types/ui/useSvgId.d.ts +2 -0
  160. package/dist/types/ui/variables.d.ts +36 -0
  161. package/dist/types/ui/widget-views.d.ts +3 -0
  162. package/dist/types/view-control-bar.d.ts +18 -0
  163. package/dist/types/view-controls.d.ts +20 -0
  164. package/dist/types/view-runtime.d.ts +34 -0
  165. package/dist/types/view.d.ts +87 -0
  166. package/dist/types/widgets.d.ts +90 -0
  167. package/dist/ui/index.js +3520 -0
  168. package/dist/ui/index.js.map +36 -0
  169. package/package.json +65 -4
@@ -0,0 +1,8 @@
1
+ export interface DataAppStylesOptions {
2
+ /** Defaults to the current browser document. */
3
+ document?: Document;
4
+ /** Nonce permitted by the document's style-src CSP. */
5
+ nonce?: string;
6
+ }
7
+ /** Install the complete UI stylesheet once per document, before mounting. */
8
+ export declare function injectDataAppStyles(options?: DataAppStylesOptions): HTMLStyleElement;
@@ -0,0 +1,73 @@
1
+ import { type ComponentPropsWithRef, type ComponentRef, type ReactNode, type RefObject } from 'react';
2
+ import { type DisclosedQuery } from '@altertable/data-app/contract';
3
+ import { type DataContext, type GlossaryEntry } from './data-context.js';
4
+ import { type ButtonProps } from './Button.js';
5
+ import { type SheetDialogProps } from './Sheet.js';
6
+ export type InspectionRecords = {
7
+ scope: string;
8
+ content: ReactNode;
9
+ };
10
+ export type AboutTab = 'records' | 'glossary' | 'queries';
11
+ export declare function resolveAboutTab(tab: string | null | undefined): AboutTab;
12
+ export type AboutEmpty = {
13
+ glossary: {
14
+ title: string;
15
+ description?: string;
16
+ };
17
+ queries: {
18
+ title: string;
19
+ description?: string;
20
+ };
21
+ };
22
+ export declare const defaultAboutEmpty: AboutEmpty;
23
+ export type AboutSubject = {
24
+ empty?: AboutEmpty;
25
+ id?: string;
26
+ title?: ReactNode;
27
+ description?: ReactNode;
28
+ visual?: ReactNode;
29
+ visualKind?: 'metric' | 'chart' | 'widget';
30
+ dataContext?: DataContext;
31
+ references?: {
32
+ kind: 'ids';
33
+ glossaryIds?: readonly string[];
34
+ queryNames?: readonly string[];
35
+ } | {
36
+ kind: 'entries';
37
+ entries: readonly GlossaryEntry[];
38
+ };
39
+ queries?: DisclosedQuery[];
40
+ records?: InspectionRecords;
41
+ };
42
+ export type AboutDataProps = AboutSubject & {
43
+ variant?: ButtonProps['variant'];
44
+ iconOnly?: boolean;
45
+ /**
46
+ * Register the global inspect shortcut. Defaults on for existing toolbar triggers; local
47
+ * triggers set false.
48
+ */
49
+ shortcut?: boolean;
50
+ tooltip?: ReactNode;
51
+ children?: ReactNode;
52
+ footer?: ReactNode;
53
+ portalRoot?: RefObject<HTMLElement | null>;
54
+ sheetProps?: SheetDialogProps;
55
+ headerActions?: ReactNode;
56
+ open?: boolean;
57
+ onOpenChange?: (open: boolean) => void;
58
+ /** Initial inspect tab. While open, the URL's `tab` parameter tracks selection. */
59
+ tab?: AboutTab;
60
+ trigger?: boolean;
61
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
62
+ /**
63
+ * Open state uses `?about=`; tab selection uses `?tab=`. Enable the global shortcut only on the
64
+ * page-level trigger.
65
+ */
66
+ export declare function InspectionSheet({ id, title, description, visual, visualKind, dataContext, references, queries, records, empty, footer, sheetProps, headerActions, open, onOpenChange, tab, onTabChange, returnFocus, }: AboutDataProps & {
67
+ open: boolean;
68
+ onOpenChange: (open: boolean) => void;
69
+ tab: AboutTab;
70
+ onTabChange: (tab: AboutTab) => void;
71
+ returnFocus: RefObject<ComponentRef<'button'> | null>;
72
+ }): import("react").JSX.Element;
73
+ export declare function AboutData(props: AboutDataProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type SVGProps } from 'react';
2
+ export type AltertableLogoProps = SVGProps<SVGSVGElement>;
3
+ export declare function AltertableLogo(props: AltertableLogoProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type AppFooterProps = ComponentPropsWithRef<'footer'> & {
3
+ attribution?: ReactNode;
4
+ };
5
+ /** `children` fills the action slot; `attribution` replaces the default link. */
6
+ export declare function AppFooter({ children, attribution, className, ...props }: AppFooterProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type AppHeaderProps = {
3
+ scope?: ReactNode;
4
+ title: ReactNode;
5
+ description?: ReactNode;
6
+ toolbar?: ReactNode;
7
+ children?: ReactNode;
8
+ } & Omit<ComponentPropsWithRef<'header'>, 'children' | 'title'>;
9
+ /** Page identity and actions; on narrow screens the scope shares a row with actions. */
10
+ export declare function AppHeader({ scope, title, description, toolbar, children, className, ...props }: AppHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type AppLayoutProps = {
3
+ children: ReactNode;
4
+ footerActions?: ReactNode;
5
+ footer?: ReactNode;
6
+ } & Omit<ComponentPropsWithRef<'main'>, 'children'>;
7
+ /**
8
+ * Native props target `<main>`. The shell owns its wrapper and tooltip defaults.
9
+ */
10
+ export declare function AppLayout({ children, footerActions, footer, className, ...props }: AppLayoutProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type AppScopeProps = {
3
+ organization: string;
4
+ environment: string;
5
+ children?: ReactNode;
6
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
+ export declare function AppScope({ organization, environment, children, className, ...props }: AppScopeProps): import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { type ComponentProps, type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DataView } from '@altertable/data-app/internal';
3
+ import { type CsvExport } from './csv-export.js';
4
+ import { type LiveControlProps } from './LiveControl.js';
5
+ import { PresentStory } from './PresentStory.js';
6
+ export type AppToolbarProps = {
7
+ children?: ReactNode;
8
+ end?: ReactNode;
9
+ updatedAt?: ReactNode;
10
+ requestState?: DataView<unknown, unknown>['kind'];
11
+ refresh?: {
12
+ refreshing: boolean;
13
+ onRefresh: () => void;
14
+ onCancel?: () => void;
15
+ label?: string;
16
+ tooltip?: ReactNode;
17
+ };
18
+ live?: LiveControlProps;
19
+ aboutData?: ReactNode;
20
+ /** Null reserves a disabled story action while its findings are unavailable. */
21
+ story?: ComponentProps<typeof PresentStory> | null;
22
+ /** Null reserves a disabled export action while its data is unavailable. */
23
+ csvExport?: CsvExport | null;
24
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
25
+ /** Header actions only. Put reader-controlled inputs in DataApp.variables below the header.
26
+ * Observation time, or an initial loading status, sits before Refresh. Children prepend app controls in the right
27
+ * cluster; end follows the built-in actions. Live sits beside Refresh when supplied. Refresh also
28
+ * answers Alt/Option+R and uses the button to cancel a running request when onCancel is provided;
29
+ * refresh.tooltip overrides its static label. All built-in controls are optional. */
30
+ export declare function AppToolbar({ children, updatedAt, requestState, refresh, live, aboutData, story, csvExport, end, className, role, 'aria-label': ariaLabel, ...props }: AppToolbarProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ChartItem, type ValueChartProps } from './chart-data.js';
2
+ export type AreaChartItem = ChartItem;
3
+ export type AreaChartProps<Row extends AreaChartItem = AreaChartItem> = ValueChartProps<Row>;
4
+ /** Ordered finite samples filled to a zero baseline, including negative values.
5
+ * Samples are equally spaced; supply missing periods explicitly.
6
+ * Compose inside VisualizationWidget; hover/touch tooltips need no caller state. */
7
+ export declare function AreaChart<Row extends AreaChartItem>(props: AreaChartProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type ChartItem, type ValueChartProps } from './chart-data.js';
2
+ export type BarChartItem = ChartItem;
3
+ export type BarChartProps<Row extends BarChartItem = BarChartItem> = ValueChartProps<Row>;
4
+ /** Nonnegative category values. Compose inside VisualizationWidget for a titled panel.
5
+ * Owns hover/touch tooltips; no selection state or keyboard navigation. */
6
+ export declare function BarChart<Row extends BarChartItem>({ items, unit, ariaLabel, formatValue, itemActions, }: BarChartProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type BreakdownItem = {
3
+ id: string;
4
+ label: ReactNode;
5
+ value: number;
6
+ };
7
+ export type BreakdownProps = {
8
+ total: number;
9
+ items: readonly BreakdownItem[];
10
+ formatValue?: (value: number) => ReactNode;
11
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
12
+ /** Mutually exclusive parts of one observed whole. Every share uses the supplied total. */
13
+ export declare function Breakdown({ total, items, formatValue, className, ...props }: BreakdownProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import { Button as AriaButton } from 'react-aria-components';
3
+ export type ButtonProps = ComponentPropsWithRef<'button'> & {
4
+ /** Inline actions retain button semantics without a padded control surface. */
5
+ variant?: 'primary' | 'elevated' | 'outline' | 'ghost' | 'inline';
6
+ size?: 'default' | 'compact' | 'icon' | 'icon-compact';
7
+ };
8
+ export declare function Button({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
9
+ /** React Aria trigger behavior with the same presentation as the native Button. */
10
+ export declare function PressButton({ variant, size, className, ...props }: Omit<ComponentPropsWithRef<typeof AriaButton>, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
11
+ className?: string;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type ChartLegendProps = {
3
+ children: ReactNode;
4
+ /** Single-row fits up to four cells before expansion, adapting to available width. */
5
+ layout?: 'horizontal' | 'vertical' | 'single-row';
6
+ align?: 'start' | 'center' | 'end';
7
+ /** Optional cell cap, including expansion. Horizontal legends default to two rows. */
8
+ maxVisibleItems?: number;
9
+ } & Omit<ComponentPropsWithRef<'ul'>, 'children'>;
10
+ /** Optional chart key, placed beside any chart with the app's layout components.
11
+ * Items describe displayed series or categories; the caller owns series visibility and interactions. */
12
+ declare function ChartLegendRoot({ children, layout, align, maxVisibleItems, className, 'aria-label': ariaLabel, ...props }: ChartLegendProps): import("react").JSX.Element;
13
+ export type ChartLegendItemProps = ComponentPropsWithRef<'li'> & {
14
+ inactive?: boolean;
15
+ };
16
+ /** Descriptive by default; compose a button inside the item for an authored series toggle. */
17
+ declare function ChartLegendItem({ inactive, className, ...props }: ChartLegendItemProps): import("react").JSX.Element;
18
+ export type ChartLegendMarkerKind = 'square' | 'bar' | 'line' | 'area' | 'point' | 'slice';
19
+ export type ChartLegendMarkerProps = Omit<ComponentPropsWithRef<'svg'>, 'children'> & {
20
+ kind: ChartLegendMarkerKind;
21
+ };
22
+ /** Decorative mark; color accepts public palette tokens or any CSS color.
23
+ * Defaults match the shared bar or accent-colored series primitives. */
24
+ declare function ChartLegendMarker({ kind, color, className, style, ...props }: ChartLegendMarkerProps): import("react").JSX.Element;
25
+ export type ChartLegendLabelProps = ComponentPropsWithRef<'span'>;
26
+ declare function ChartLegendLabel({ className, children, title, ...props }: ChartLegendLabelProps): import("react").JSX.Element;
27
+ export declare const ChartLegend: typeof ChartLegendRoot & {
28
+ Item: typeof ChartLegendItem;
29
+ Marker: typeof ChartLegendMarker;
30
+ Label: typeof ChartLegendLabel;
31
+ };
32
+ export {};
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare const CheckboxGroupContext: import("react").Context<{
3
+ values: readonly string[];
4
+ disabled?: boolean;
5
+ onChange: (value: string, checked: boolean) => void;
6
+ } | null>;
7
+ export type CheckboxProps = {
8
+ label: string;
9
+ description?: ReactNode;
10
+ disabled?: boolean;
11
+ className?: string;
12
+ } & ({
13
+ value: string;
14
+ checked?: never;
15
+ onChange?: never;
16
+ } | {
17
+ value?: never;
18
+ checked: boolean;
19
+ onChange: (checked: boolean) => void;
20
+ });
21
+ export declare function Checkbox({ label, description, checked, value, onChange, disabled, className, }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export type CheckboxGroupProps = Omit<ComponentPropsWithRef<'fieldset'>, 'onChange'> & {
3
+ label: string;
4
+ values: readonly string[];
5
+ onChange: (values: string[]) => void;
6
+ };
7
+ export declare function CheckboxGroup({ label, values, onChange, className, children, disabled, ...props }: CheckboxGroupProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { type ControlLabelPlacement } from './PickerField.js';
2
+ import type { ChoiceOption } from '@altertable/data-app/internal';
3
+ export type { ChoiceOption } from '@altertable/data-app/internal';
4
+ type SharedProps = {
5
+ label: string;
6
+ labelPlacement?: ControlLabelPlacement;
7
+ options: readonly ChoiceOption[];
8
+ /** Separate source state, rendered last with a divider and the shared option component. */
9
+ missingOption?: ChoiceOption;
10
+ disabled?: boolean;
11
+ placeholder?: string;
12
+ emptyMessage?: string;
13
+ /** Known options remain selectable while refreshing; unavailable selected IDs are retained. */
14
+ loading?: boolean;
15
+ /** Shows failure feedback without removing known options or unavailable selections. */
16
+ error?: boolean;
17
+ onRetry?: () => void;
18
+ };
19
+ export type SingleChoicePickerProps = SharedProps & {
20
+ selectionMode: 'single';
21
+ value: string;
22
+ onChange: (value: string) => void;
23
+ values?: never;
24
+ maxSelected?: never;
25
+ emptySelectionLabel?: never;
26
+ };
27
+ export type MultiChoicePickerProps = SharedProps & {
28
+ selectionMode: 'multiple';
29
+ values: readonly string[];
30
+ onChange: (values: string[]) => void;
31
+ /** Positive integer; at capacity, only unselected options are disabled. */
32
+ maxSelected: number;
33
+ /** Meaning of an empty selection belongs to the caller, e.g. All or Select a value. */
34
+ emptySelectionLabel: string;
35
+ value?: never;
36
+ };
37
+ export type ChoicePickerProps = SingleChoicePickerProps | MultiChoicePickerProps;
38
+ /** Searchable selection picker with one focus and popup model for single and multiple values. */
39
+ export declare function ChoicePicker(props: ChoicePickerProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type MetricComparison } from './metric-comparison.js';
2
+ import { type MetricDefinition } from './metric.js';
3
+ import { type MetricReading } from '@altertable/data-app/internal';
4
+ type UnboundComparisonProps = MetricComparison & {
5
+ label: string;
6
+ emphasis?: 'standard' | 'story';
7
+ };
8
+ export type ComparisonProps = UnboundComparisonProps | {
9
+ metric: MetricDefinition;
10
+ reading: MetricReading;
11
+ emphasis?: 'standard' | 'story';
12
+ };
13
+ export declare function Comparison(props: ComparisonProps): import("react").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,41 @@
1
+ import { type ComponentProps } from 'react';
2
+ import { ComposedChartLegend as Legend } from './ComposedChartLegend.js';
3
+ import { ComposedChart as RechartsComposedChart, ZAxis, ReferenceLine, ReferenceArea, ReferenceDot, Brush, Label, LabelList, ErrorBar } from 'recharts';
4
+ import { ChartBar as Bar, ChartDot as Dot, ChartLine as Line, ChartArea as Area, ChartScatter as Scatter, ChartXAxis as XAxis, ChartYAxis as YAxis, ChartGrid as CartesianGrid, ChartTooltip as Tooltip } from './chart-primitives.js';
5
+ export type ComposedChartProps<Row = unknown> = Omit<ComponentProps<typeof RechartsComposedChart<Row>>, 'data' | 'title'> & {
6
+ /** Displayed rows; series and axes select fields with Recharts dataKey props. */
7
+ data: readonly Row[];
8
+ /** Describes the measures and scope for assistive technology. */
9
+ ariaLabel: string;
10
+ };
11
+ /** Compose Cartesian series inside VisualizationWidget. Defaults to responsive
12
+ * full width and 300px height. Children retain native Recharts props and behavior,
13
+ * including stacking, numeric/time axes, missing values, tooltips, and keyboard
14
+ * navigation. Match yAxisId on axes and series for different units; use stackId
15
+ * for stacks. Preserve missing measures as null and choose connectNulls deliberately.
16
+ * Use public chart tokens for series colors. Dataset bindings own
17
+ * loading, empty results, evidence, and CSV; this primitive owns only the plot. */
18
+ declare function ComposedChartRoot<Row>({ data, ariaLabel, width, height, responsive, className, ...props }: ComposedChartProps<Row>): import("react").JSX.Element;
19
+ /** Shared themed series and controls; other children retain native Recharts defaults. */
20
+ export declare const ComposedChart: typeof ComposedChartRoot & {
21
+ Dot: typeof Dot;
22
+ Area: typeof Area;
23
+ Bar: typeof Bar;
24
+ Line: typeof Line;
25
+ Scatter: typeof Scatter;
26
+ XAxis: typeof XAxis;
27
+ YAxis: typeof YAxis;
28
+ ZAxis: typeof ZAxis;
29
+ CartesianGrid: typeof CartesianGrid;
30
+ Tooltip: typeof Tooltip;
31
+ Legend: typeof Legend;
32
+ ReferenceLine: typeof ReferenceLine;
33
+ ReferenceArea: typeof ReferenceArea;
34
+ ReferenceDot: typeof ReferenceDot;
35
+ Brush: typeof Brush;
36
+ Cell: import("react").FunctionComponent<import("recharts").CellProps>;
37
+ Label: typeof Label;
38
+ LabelList: typeof LabelList;
39
+ ErrorBar: typeof ErrorBar;
40
+ };
41
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type ComponentProps } from 'react';
2
+ import { Legend } from 'recharts';
3
+ export type ComposedChartLegendProps = ComponentProps<typeof Legend> & {
4
+ maxVisibleItems?: number;
5
+ };
6
+ /** Opt in inside ComposedChart to derive the shared legend from its displayed series.
7
+ * Give native series unique IDs when they share a data key.
8
+ * Native positioning, sorting, formatters, callbacks, and custom content remain available. */
9
+ export declare function ComposedChartLegend({ maxVisibleItems, ...props }: ComposedChartLegendProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import { type SkeletonContent } from './presentation.js';
3
+ export type ContentSkeletonProps = SkeletonContent & Omit<ComponentPropsWithRef<'div'>, 'children'>;
4
+ /** A metric, panel, or ranking placeholder to compose in the same layout as live content. */
5
+ export declare function ContentSkeleton({ variant, rows, className, ...props }: ContentSkeletonProps): import("react").JSX.Element;
6
+ /** Placeholder for a widget body; static headings stay outside it. */
7
+ export declare function ContentSkeletonBody({ variant, rows }: SkeletonContent): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type ExportDataset, type RegisteredBinding } from '../bindings.js';
2
+ import type { DisplayedSnapshot } from '@altertable/data-app/internal';
3
+ import type { StoryFinding } from './story.js';
4
+ import { type DataAppBaseProps, type DataAppControlProps } from './DataAppFrame.js';
5
+ import { type DeclaredView } from '../view-runtime.js';
6
+ import { type DetailContent } from '../details.js';
7
+ export type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'> & DataAppControlProps & {
8
+ view: DeclaredView<Data, Input> & {
9
+ scope(snapshot: DisplayedSnapshot<Data, Input>): string;
10
+ };
11
+ /** Show supplied datasets’ record suggestions on the first declared search. Defaults to true. */
12
+ showSearchSuggestions?: boolean;
13
+ story: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
14
+ evidence: RegisteredBinding;
15
+ })[];
16
+ datasets: readonly [
17
+ ExportDataset<Data, Input>,
18
+ ...ExportDataset<Data, Input>[]
19
+ ];
20
+ /** Detail destinations available to dataset actions and metric record inspection. */
21
+ details?: readonly DetailContent<any, any>[];
22
+ };
23
+ /** Executes the primary view and owns its controls, inspection, exports, and stories. */
24
+ export declare function DataApp<Data, Input>(props: DataAppProps<Data, Input>): import("react").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DisclosedQuery } from '@altertable/data-app/contract';
3
+ import { type CsvExport } from './csv-export.js';
4
+ import { type DisplayedSnapshot } from '@altertable/data-app/internal';
5
+ import { type DataContext } from './data-context.js';
6
+ import { type BoundStory } from './story.js';
7
+ import { type SectionResult } from './DataSectionBoundary.js';
8
+ export type DataAppBaseProps = {
9
+ children: ReactNode;
10
+ dataContext: DataContext;
11
+ /** Override the declared subtitle; null hides it. */
12
+ description?: ReactNode;
13
+ toolbarActions?: ReactNode;
14
+ footerActions?: ReactNode;
15
+ /** Optional source, coverage, or methodology note below the app content.
16
+ * Compose prose and inline components; typography and spacing are provided.
17
+ * Put data widgets in children and app controls in footerActions. */
18
+ footer?: ReactNode;
19
+ };
20
+ export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
21
+ queries?: DisclosedQuery[];
22
+ /** Actual request activity, including retries with retained data. */
23
+ refreshing?: boolean;
24
+ cancel?: () => unknown;
25
+ searchControls?: ReactNode;
26
+ filterControls?: ReactNode;
27
+ };
28
+ export type DataAppControlProps = {
29
+ /** Show declared search controls. Defaults to true; hiding preserves their values. */
30
+ showSearch?: boolean;
31
+ /** Show declared filter controls, including display options. Defaults to true; hiding preserves their values. */
32
+ showFilters?: boolean;
33
+ };
34
+ export type StaticDataAppProps = DataAppBaseProps & {
35
+ csvExport?: CsvExport;
36
+ queries?: DisclosedQuery[];
37
+ };
38
+ export type DataAppProps<Data = unknown, Input = unknown> = (DataAppBaseProps & DataAppControlProps & {
39
+ request: DataAppRequest<Data, Input>;
40
+ /** Findings are always derived from the result currently visible to the user. */
41
+ story: BoundStory<Data, Input>;
42
+ /** Export every distinct dataset in the displayed result. */
43
+ csvExport: (snapshot: DisplayedSnapshot<Data, Input>) => CsvExport;
44
+ queries?: never;
45
+ }) | (StaticDataAppProps & {
46
+ request?: never;
47
+ story?: never;
48
+ });
49
+ /** Owns the page title, header, gutter, and width; body content uses section headings.
50
+ * The primary request binds the toolbar, controls, refresh, and inspection.
51
+ * Children always render; compose DataSection boundaries around independently loading content. */
52
+ export declare function DataAppFrame<Data, Input>(props: DataAppProps<Data, Input>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DataView } from '@altertable/data-app/internal';
3
+ export type DataBoundaryProps<T, Input = unknown> = {
4
+ view: DataView<T, Input>;
5
+ loadingFallback: ReactNode;
6
+ emptyFallback: ReactNode;
7
+ error: (error: Error) => ReactNode;
8
+ staleError?: (error: Error) => ReactNode;
9
+ notice?: 'inline' | 'none';
10
+ children: (data: T, displayedInput: Input) => ReactNode;
11
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
12
+ /** Render one request state at a time. Prior content remains readable during an update.
13
+ * Feedback ownership is supplied by the containing section. */
14
+ export declare function DataBoundary<T, Input>({ view, loadingFallback, emptyFallback, error, staleError, notice, children, className, ...props }: DataBoundaryProps<T, Input>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ViewContent } from '../content.js';
2
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
3
+ import { type EmptyContent } from './presentation.js';
4
+ export type DataSectionProps<Data, Input = unknown> = {
5
+ content: ViewContent<Data, Input>;
6
+ emptyFallback?: EmptyContent;
7
+ error?: {
8
+ title: ReactNode;
9
+ description?: ReactNode;
10
+ onRetry?: () => void;
11
+ };
12
+ label?: string;
13
+ } & Omit<ComponentPropsWithRef<'div'>, 'children' | 'content'>;
14
+ export declare function DataSection<Data, Input>({ content, ...presentation }: DataSectionProps<Data, Input>): import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DataView } from '@altertable/data-app/internal';
3
+ import { type EmptyContent } from './presentation.js';
4
+ export type SectionResult<Data, Input> = {
5
+ view: DataView<Data, Input>;
6
+ refetch: () => unknown;
7
+ };
8
+ export type DataSectionProps<Data, Input = unknown> = {
9
+ children: (data: Data, displayedInput: Input) => ReactNode;
10
+ /** Placeholder layout for an initial request; use the ready view's grid without copied values. */
11
+ loadingFallback: ReactNode;
12
+ error?: {
13
+ title: ReactNode;
14
+ description?: ReactNode;
15
+ onRetry?: () => void;
16
+ };
17
+ label?: string;
18
+ notice?: 'none' | 'inline';
19
+ } & ({
20
+ result: SectionResult<Data, Input> & {
21
+ emptyFallback: EmptyContent;
22
+ };
23
+ emptyFallback?: EmptyContent;
24
+ } | {
25
+ result: SectionResult<Data, Input>;
26
+ emptyFallback: EmptyContent;
27
+ }) & Omit<ComponentPropsWithRef<'div'>, 'children'>;
28
+ /** One request boundary for any number of cards. `DataBoundary` exposes the lower-level
29
+ * view-state slots internally. The primary DataApp request uses page-level feedback. */
30
+ export declare function DataSectionBoundary<Data, Input>({ result, children, emptyFallback, loadingFallback, error, label, notice: feedback, ...props }: DataSectionProps<Data, Input>): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type EmptyContent } from './presentation.js';
3
+ import { type SearchFieldProps } from './SearchField.js';
4
+ export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue' | 'inputProps'> & {
5
+ /** Number of available records before filtering or a display limit. */
6
+ itemCount: number;
7
+ };
8
+ export type DataTableProps = ComponentPropsWithRef<'table'> & {
9
+ searchable?: DataTableSearch;
10
+ };
11
+ /** Scrollable native table. Mark quantitative th/td cells with data-type="number";
12
+ * the runtime aligns them to the end and uses tabular digits. */
13
+ export declare function DataTable({ className, ref, searchable, ...props }: DataTableProps): import("react").JSX.Element;
14
+ /** Accepts a fraction of the stated whole, using `formatPercent` semantics. */
15
+ export declare function DataTableShare({ value }: {
16
+ value: number;
17
+ }): import("react").JSX.Element;
18
+ export type DataTableEmptyRowProps = EmptyContent & {
19
+ colSpan: number;
20
+ };
21
+ export declare function DataTableEmptyRow({ colSpan, title, description, action, }: DataTableEmptyRowProps): import("react").JSX.Element;
22
+ export type DataTableTimestampProps = {
23
+ value: string | Date | number;
24
+ children?: ReactNode;
25
+ timeZone?: string;
26
+ locale?: string;
27
+ precision?: 'minute' | 'second';
28
+ };
29
+ export declare function DataTableTimestamp({ value, children, timeZone, locale, precision, }: DataTableTimestampProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DataReading } from '@altertable/data-app/internal';
3
+ export type DataValueProps<Value> = {
4
+ reading: DataReading<Value>;
5
+ loadingFallback: ReactNode;
6
+ children: (value: Value) => ReactNode;
7
+ } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
8
+ /** Bind inline content to displayed data. Keep static wording outside this span. */
9
+ export declare function DataValue<Value>({ reading, loadingFallback, children, ...props }: DataValueProps<Value>): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DataView } from '@altertable/data-app/internal';
3
+ export type DataViewToastProps<Data, Input> = {
4
+ view: DataView<Data, Input>;
5
+ message?: ReactNode;
6
+ notice?: ReactNode;
7
+ onRetry?: () => void;
8
+ };
9
+ /** One page-level refresh status. Updating waits briefly; a failed refresh waits
10
+ * long enough to avoid interrupting the displayed result before showing retry. */
11
+ export declare function DataViewToast<Data, Input>({ view, message, notice, onRetry, }: DataViewToastProps<Data, Input>): import("react").JSX.Element | null;
@@ -0,0 +1,37 @@
1
+ import type { InspectionRecords } from './AboutData.js';
2
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
3
+ import { type WidgetStatus } from './RequestHint.js';
4
+ import type { EmptyContent, BoundWidgetReading } from './presentation.js';
5
+ import type { WidgetEvidence } from './WidgetEvidence.js';
6
+ type DataWidgetBaseProps = {
7
+ title: ReactNode;
8
+ /** Document outline level. The widget title keeps the shared widget-heading appearance. */
9
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
10
+ /** Unique stable target for persisted feedback; overrides automatic evidence identity. */
11
+ annotationId?: string;
12
+ /** Result count beside the heading. Derive from the displayed result; zero is visible. */
13
+ count?: number;
14
+ description?: ReactNode;
15
+ evidence?: WidgetEvidence;
16
+ /** Lazy detail records rendered as the first inspection tab. */
17
+ records?: InspectionRecords;
18
+ action?: ReactNode;
19
+ /** Reserved feedback slot; retain displayed content while refreshing or after failure. */
20
+ status?: WidgetStatus;
21
+ footer?: ReactNode;
22
+ bodyPadding?: 'inset' | 'flush';
23
+ } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
24
+ /** Owns loading, empty content, actions, and inspection. Page and sheet mount the same
25
+ * body and footer; hold interactive child state above the widget to share it across mounts.
26
+ * A bound reading requires evidence; its child renderer runs only for nonempty ready data. */
27
+ export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ((BoundWidgetReading<Data> & {
28
+ children: (data: Data) => ReactNode;
29
+ }) | {
30
+ reading?: never;
31
+ isEmpty?: never;
32
+ skeleton?: never;
33
+ emptyFallback?: EmptyContent;
34
+ children: ReactNode;
35
+ });
36
+ export declare function DataWidget<Data>(props: DataWidgetProps<Data>): import("react").JSX.Element;
37
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import { type DateFormat } from '@altertable/data-app/format';
3
+ export type DateDisplayProps = {
4
+ value: string | Date | number | null | undefined;
5
+ /** Calendar dates stay dates; instants require a Date, epoch milliseconds, or an offset-bearing ISO string. */
6
+ format?: DateFormat;
7
+ } & Omit<ComponentPropsWithRef<'time'>, 'children' | 'dateTime'>;
8
+ /** Readable dates with exact-time disclosure for instants; invalid or ambiguous values render as missing. */
9
+ export declare function DateDisplay({ value, format, className, ...props }: DateDisplayProps): import("react").JSX.Element;