@altertable/data-app-react 0.0.0-stage → 0.71.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 +58 -2
  3. package/THIRD_PARTY_NOTICES +18 -0
  4. package/dist/chunks/index-1nbjx0se.js +17022 -0
  5. package/dist/chunks/index-1nbjx0se.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,30 @@
1
+ import { type ControlLabelPlacement } from './PickerField.js';
2
+ import { type ComponentProps, type ReactNode } from 'react';
3
+ import { type CalendarDate } from '@internationalized/date';
4
+ import { DateRangePicker as AriaDateRangePicker } from 'react-aria-components';
5
+ import { type DatePresetId, type DateRange } from '@altertable/data-app/internal';
6
+ export { type DatePresetId, type DateRange, } from '@altertable/data-app/internal';
7
+ export type DateRangePickerProps = {
8
+ label?: string;
9
+ labelPlacement?: Exclude<ControlLabelPlacement, 'inline'>;
10
+ value: DateRange | null;
11
+ onChange: (range: DateRange | null) => void;
12
+ minDate?: string;
13
+ maxDate?: string;
14
+ maxRangeDays?: number;
15
+ timeZone?: string;
16
+ /** Used to display the reset affordance. The app variable owns the URL and reset meaning. */
17
+ resetValue?: DateRange;
18
+ isDefault?: boolean;
19
+ onReset?: () => void;
20
+ onPresetChange?: (id: DatePresetId) => void;
21
+ selectedPresetId?: DatePresetId | null;
22
+ calendarFooter?: ReactNode;
23
+ comparison?: {
24
+ enabled: boolean;
25
+ range: DateRange | null;
26
+ onChange: (enabled: boolean) => void;
27
+ };
28
+ } & Omit<ComponentProps<typeof AriaDateRangePicker<CalendarDate>>, 'children' | 'value' | 'onChange' | 'minValue' | 'maxValue' | 'isOpen' | 'onOpenChange' | 'defaultValue' | 'defaultOpen'>;
29
+ /** The app owns URL state; `dateRangeControl` binds a date variable to this picker. */
30
+ export declare function DateRangePicker({ label, labelPlacement, value, onChange, minDate, maxDate, maxRangeDays, timeZone, resetValue, isDefault, onReset, onPresetChange, selectedPresetId, calendarFooter, comparison, className, ...props }: DateRangePickerProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type HelpPopoverProps } from './HelpPopover.js';
3
+ export type DateTimeTooltipProps = {
4
+ date: Date;
5
+ timeZone?: string;
6
+ locale?: string;
7
+ children?: ReactNode;
8
+ } & Omit<HelpPopoverProps, 'trigger' | 'triggerLabel' | 'label' | 'children'>;
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;
@@ -0,0 +1,14 @@
1
+ import type { ControlLabelPlacement } from './PickerField.js';
2
+ import type { DimensionOption, DimensionSelection } from '@altertable/data-app/contract';
3
+ import type { DimensionValue, DimensionSelectionVariable } from '@altertable/data-app/internal';
4
+ /** Adapts the typed dimension contract to the shared ChoicePicker control. */
5
+ export declare function DimensionPicker<T extends DimensionValue>({ filter, labelPlacement, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
6
+ filter: DimensionSelectionVariable<T>;
7
+ labelPlacement?: ControlLabelPlacement;
8
+ value: DimensionSelection<T>;
9
+ onChange: (value: DimensionSelection<T>) => void;
10
+ options?: readonly DimensionOption<T>[];
11
+ loading?: boolean;
12
+ error?: boolean;
13
+ onRetry?: () => void;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type EmptyContent } from './presentation.js';
2
+ export type EmptyStateProps = EmptyContent & {
3
+ variant?: 'visual' | 'table';
4
+ className?: string;
5
+ };
6
+ export declare function EmptyState({ title, description, action, variant, className, }: EmptyStateProps): import("react").JSX.Element;
@@ -0,0 +1,60 @@
1
+ import { type ComponentRef, type RefObject, type Ref, type KeyboardEvent } from 'react';
2
+ /** A resolved action available for one displayed exploration item. */
3
+ export type ExplorationAction = {
4
+ id: string;
5
+ label: string;
6
+ onSelect: (trigger?: HTMLElement | SVGElement) => void;
7
+ /** Keep this action directly available when other actions require a menu. */
8
+ primary?: boolean;
9
+ /** Keep utility actions separate from exploration destinations. */
10
+ group?: 'clipboard';
11
+ };
12
+ /** Resolves the actions available for a displayed domain row. */
13
+ export type ItemActions<Row> = (row: Row) => readonly ExplorationAction[];
14
+ export type ExplorationActionControlProps = {
15
+ actions: readonly ExplorationAction[];
16
+ /** Identifies the item whose actions the control exposes. */
17
+ ariaLabel: string;
18
+ /** Use when another item-level hit target already exposes the primary action. */
19
+ hidePrimary?: boolean;
20
+ /** Own a context menu without adding a second visible or keyboard trigger. */
21
+ contextOnly?: boolean;
22
+ /** Chart labels use a chevron; other action menus use an ellipsis. */
23
+ indicator?: 'ellipsis' | 'chevron';
24
+ /** Shares this menu trigger with an item's context and keyboard actions. */
25
+ ref?: Ref<HTMLButtonElement>;
26
+ className?: string;
27
+ };
28
+ /**
29
+ * Presents exploration actions consistently: a sole action is direct, an explicit
30
+ * primary action stays direct, and all available choices remain in the menu.
31
+ */
32
+ export declare function ExplorationActionControl({ actions, ariaLabel, className, hidePrimary, contextOnly, indicator, ref, }: ExplorationActionControlProps): import("react").JSX.Element | null;
33
+ /** Menu content for an item-level trigger composed by a chart or custom control. */
34
+ export declare function ExplorationActionMenu({ actions, ariaLabel, triggerRef, placement, }: Pick<ExplorationActionControlProps, 'actions' | 'ariaLabel'> & {
35
+ triggerRef?: RefObject<ComponentRef<'button'> | null>;
36
+ placement?: 'bottom' | 'bottom start' | 'bottom end';
37
+ }): import("react").JSX.Element;
38
+ /** Adds clipboard utilities derived only from the displayed chart item. */
39
+ export declare function useChartActions(): {
40
+ actions(declared: readonly ExplorationAction[], label: string, summary: string): readonly ExplorationAction[];
41
+ feedback: import("react").JSX.Element | null;
42
+ };
43
+ export declare function openExplorationMenu(trigger: RefObject<HTMLButtonElement | null>, event: {
44
+ preventDefault: () => void;
45
+ currentTarget?: EventTarget | null;
46
+ }, point?: {
47
+ x: number;
48
+ y: number;
49
+ }): void;
50
+ /** Reuse the item's menu for pointer and keyboard context requests. */
51
+ export declare function explorationMenuEvents(trigger: RefObject<HTMLButtonElement | null>): {
52
+ onContextMenu: (event: {
53
+ preventDefault: () => void;
54
+ clientX: number;
55
+ clientY: number;
56
+ }) => void;
57
+ onKeyDown(event: KeyboardEvent<Element>): void;
58
+ };
59
+ /** The direct action for an item, when the action declaration supplies one. */
60
+ export declare function getPrimaryExplorationAction(actions: readonly ExplorationAction[]): ExplorationAction | undefined;
@@ -0,0 +1,4 @@
1
+ import { type CsvExport } from './csv-export.js';
2
+ export declare function ExportControl({ csv }: {
3
+ csv?: CsvExport;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export type FilterActionsProps = {
2
+ onClear?: () => void;
3
+ } & ({
4
+ onApply: () => void;
5
+ onCancel: () => void;
6
+ } | {
7
+ onApply?: never;
8
+ onCancel?: never;
9
+ });
10
+ export declare function FilterActions({ onClear, onApply, onCancel, }: FilterActionsProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export type FilterBarProps = ComponentPropsWithRef<'div'>;
3
+ export declare function FilterBar({ className, role, 'aria-label': label, ...props }: FilterBarProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { type CountChartProps } from './chart-data.js';
2
+ /** Ordered step with a unique, nonblank ID. */
3
+ export type FunnelChartStep = {
4
+ id: string;
5
+ label: string;
6
+ };
7
+ export type FunnelChartSeries = {
8
+ /** Unique, nonblank population ID. */
9
+ id: string;
10
+ label: string;
11
+ /** Finite, nonnegative counts aligned with steps and nonincreasing. */
12
+ values: readonly number[];
13
+ };
14
+ export type FunnelChartProps = CountChartProps & {
15
+ steps: readonly FunnelChartStep[];
16
+ series: readonly FunnelChartSeries[];
17
+ };
18
+ /** Conversion columns with previous-step drop-off, normalized to each series' first step.
19
+ * Owns series highlighting and portion-specific inspection; compose inside VisualizationWidget. */
20
+ export declare function FunnelChart({ steps, series, unit, ariaLabel, className, formatValue, }: FunnelChartProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { DataContext } from './data-context.js';
2
+ /** Query-backed connection state and next steps for a newly created app. Mount within
3
+ * `DataAppProvider` and register `connection: connectionCheck(app.queries)` on the server. */
4
+ export declare function GettingStarted({ dataContext }: {
5
+ dataContext: DataContext;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type GlossaryEntry } from './data-context.js';
3
+ export type GlossaryDefinitionProps = {
4
+ entry: GlossaryEntry;
5
+ children?: ReactNode;
6
+ };
7
+ export declare function GlossaryDefinition({ entry, children, }: GlossaryDefinitionProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DisclosedQuery } from '@altertable/data-app/contract';
3
+ import { type DataContext, type GlossaryEntry } from './data-context.js';
4
+ import { type AboutEmpty } from './AboutData.js';
5
+ export type GlossaryExplanationProps = {
6
+ entry: GlossaryEntry;
7
+ empty?: AboutEmpty;
8
+ title?: ReactNode;
9
+ description?: ReactNode;
10
+ visual?: ReactNode;
11
+ queries?: DisclosedQuery[];
12
+ dataContext?: DataContext;
13
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
14
+ /** Opens the inspect sheet for one glossary term. Prefer a card's evidence slot
15
+ * when the surface already has a title, description, and visual. */
16
+ export declare function GlossaryExplanation({ entry, empty, title, description, visual, queries, dataContext, className, ...props }: GlossaryExplanationProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export type GradientScrollProps = ComponentPropsWithRef<'div'> & {
3
+ axis?: 'vertical' | 'horizontal';
4
+ /** Disable the start fade when sticky controls share the scrollport. */
5
+ fadeStart?: boolean;
6
+ };
7
+ type ScrollMetrics = Pick<HTMLElement, 'scrollTop' | 'scrollHeight' | 'clientHeight' | 'scrollLeft' | 'scrollWidth' | 'clientWidth'>;
8
+ /** The visible edges that still have content beyond them. */
9
+ export declare function scrollFadeEdges(metrics: ScrollMetrics, axis: 'vertical' | 'horizontal'): {
10
+ start: boolean;
11
+ end: boolean;
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
+ };
21
+ /** Fades only scrollable edges; content, size, and scroll changes update the mask. */
22
+ export declare function GradientScroll({ axis, fadeStart, className, children, ref, ...props }: GradientScrollProps): import("react").JSX.Element;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type GridProps = {
3
+ children: ReactNode;
4
+ /** Maximum columns; cards wrap sooner when the container cannot fit their minimum width. */
5
+ columns?: 1 | 2 | 3 | 4;
6
+ minItemWidth?: 'compact' | 'regular' | 'wide';
7
+ gap?: 'sm' | 'md' | 'lg';
8
+ /** `stretch` gives widgets in each row the same height. */
9
+ align?: 'stretch' | 'start';
10
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
11
+ /** Responsive layout for peer cards and panels. Cards keep their content height by default. */
12
+ export declare function Grid({ children, columns, minItemWidth, gap, align, className, ...props }: GridProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type GridItemProps = {
3
+ children: ReactNode;
4
+ /** Maximum tracks occupied; collapses to one when the grid container is narrow. */
5
+ span?: 1 | 2;
6
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
+ export declare function GridItem({ children, span, className, ...props }: GridItemProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+ import { type Placement } from '@floating-ui/react';
3
+ import { type DataAppStyleHooks } from '../style-contract.js';
4
+ export type HelpPopoverTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'> & DataAppStyleHooks;
5
+ export type HelpPopoverPanelProps = Omit<ComponentPropsWithRef<'section'>, 'children' | 'role'>;
6
+ export type HelpPopoverProps = {
7
+ trigger: ReactNode;
8
+ triggerLabel: string;
9
+ label: string;
10
+ children: ReactNode;
11
+ placement?: Placement;
12
+ portalRoot?: RefObject<HTMLElement | null>;
13
+ triggerProps?: HelpPopoverTriggerProps;
14
+ panelProps?: HelpPopoverPanelProps;
15
+ open?: boolean;
16
+ onOpenChange?: (open: boolean) => void;
17
+ };
18
+ /** A supplemental explanation that opens on click, Enter, or a deliberate mouse hover. Tabbing
19
+ * past the trigger does not open it, and a click keeps a hover-opened panel in place.
20
+ * triggerProps and panelProps target its two surfaces. */
21
+ export declare function HelpPopover({ trigger, triggerLabel, label, children, portalRoot, triggerProps, panelProps, placement, open: openProp, onOpenChange, }: HelpPopoverProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+ import { type ButtonProps } from './Button.js';
3
+ import { type AppIconName } from './icons.js';
4
+ import { type Shortcut } from './shortcuts.js';
5
+ export type IconButtonProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'aria-label'> & {
6
+ icon: AppIconName;
7
+ label: string;
8
+ variant?: ButtonProps['variant'];
9
+ shortcut?: Shortcut | {
10
+ label: string;
11
+ aria: string;
12
+ };
13
+ tooltip?: ReactNode;
14
+ portalRoot?: RefObject<HTMLElement | null>;
15
+ tooltipPlacement?: 'top' | 'bottom';
16
+ tooltipAlign?: 'start' | 'center' | 'end';
17
+ children?: ReactNode;
18
+ };
19
+ export declare function IconButton({ icon, label, variant, shortcut, tooltip, portalRoot, tooltipPlacement, tooltipAlign, children, type, ...props }: IconButtonProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type DataView } from '@altertable/data-app/internal';
2
+ import { type DisclosedQuery } from '@altertable/data-app/contract';
3
+ import { type AboutEmpty } from './AboutData.js';
4
+ import { type DataContext } from './data-context.js';
5
+ export type InspectionDefaults = {
6
+ dataContext: DataContext;
7
+ primaryView?: DataView<unknown, unknown>;
8
+ empty?: AboutEmpty;
9
+ queries?: DisclosedQuery[];
10
+ };
11
+ export declare const InspectionContext: import("react").Context<InspectionDefaults | null>;
12
+ export declare function useInspectionDefaults(): InspectionDefaults | null;
@@ -0,0 +1,29 @@
1
+ import { type ComponentRef, type ReactNode, type RefObject } from 'react';
2
+ import { type AboutDataProps, type AboutTab } from './AboutData.js';
3
+ type Inspection = {
4
+ key: string;
5
+ id: string;
6
+ props: AboutDataProps;
7
+ trigger: RefObject<ComponentRef<'button'> | null>;
8
+ };
9
+ type Selection = {
10
+ inspection: Inspection;
11
+ open: boolean;
12
+ tab: AboutTab;
13
+ } | null;
14
+ export declare const InspectionOwner: import("react").Context<{
15
+ subscribe(this: void, listener: () => void): () => void;
16
+ snapshot: () => Selection;
17
+ sync: () => void;
18
+ register(inspection: Inspection): void;
19
+ remove(key: string): void;
20
+ open(inspection: Inspection): void;
21
+ close(key: string): void;
22
+ controlled(inspection: Inspection, open: boolean | undefined): void;
23
+ selectTab(this: void, tab: AboutTab): void;
24
+ } | null>;
25
+ export declare const InspectionVisual: import("react").Context<boolean>;
26
+ export declare function InspectionProvider({ children }: {
27
+ children: ReactNode;
28
+ }): 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;
29
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CountChartProps } from './chart-data.js';
2
+ import { type JourneyChartPath } from './journey-flow.js';
3
+ export type { JourneyChartPath } from './journey-flow.js';
4
+ export type JourneyChartProps = CountChartProps & {
5
+ /** Full paths and their population counts. Branches and outcomes are derived internally. */
6
+ paths: readonly JourneyChartPath[];
7
+ };
8
+ /** Path exploration with two initial steps, expandable prefixes, and three events per depth.
9
+ * Counts and flows use the Step 1 population. Compose inside VisualizationWidget. */
10
+ export declare function JourneyChart({ paths, unit, ariaLabel, className, formatValue, }: JourneyChartProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import { type Shortcut } from './shortcuts.js';
3
+ export type KbdProps = ComponentPropsWithRef<'kbd'> & {
4
+ shortcut?: Shortcut;
5
+ };
6
+ /** A visible key or shortcut. Keep aria-keyshortcuts on the associated control. */
7
+ export declare function Kbd({ shortcut, children, className, ...props }: KbdProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ChartItem, type ValueChartProps } from './chart-data.js';
2
+ export type LineChartItem = ChartItem;
3
+ export type LineChartProps<Row extends LineChartItem = LineChartItem> = ValueChartProps<Row>;
4
+ /** Equally spaced finite samples in supplied order; fill missing periods explicitly.
5
+ * Supports negative values, single points, and horizontal scrolling for long series.
6
+ * Compose inside VisualizationWidget; hover/touch tooltips need no caller state. */
7
+ export declare function LineChart<Row extends LineChartItem>(props: LineChartProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export type LiveIntervalSeconds = 30 | 60 | 300;
3
+ export type LiveControlProps = {
4
+ enabled: boolean;
5
+ onChange: (enabled: boolean) => void;
6
+ intervalSeconds: LiveIntervalSeconds;
7
+ onIntervalChange: (seconds: LiveIntervalSeconds) => void;
8
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'onClick' | 'onChange'>;
9
+ /** Toggle an app-owned recurring refresh. The app supplies the timer and its cadence. */
10
+ export declare function LiveControl({ enabled, onChange, intervalSeconds, onIntervalChange, className, ...props }: LiveControlProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ import { MenuTrigger, MenuSection, Separator, type MenuProps, type MenuItemProps, type MenuTriggerProps } from 'react-aria-components';
3
+ import { PopoverSurface } from './PopoverSurface.js';
4
+ export { MenuTrigger, MenuSection };
5
+ export { PressButton as MenuButton } from './Button.js';
6
+ export type { MenuProps, MenuItemProps, MenuTriggerProps };
7
+ export type MenuPopoverProps = ComponentPropsWithRef<typeof PopoverSurface>;
8
+ /** Anchored popup for a Menu; the surrounding MenuTrigger owns focus and dismissal. */
9
+ export declare function MenuPopover({ className, placement, ...props }: MenuPopoverProps): import("react").JSX.Element;
10
+ /** Actions by default; single selection creates radio items, multiple creates checkbox items. */
11
+ export declare function Menu<T extends object>({ className, ...props }: MenuProps<T>): import("react").JSX.Element;
12
+ export declare function MenuItem<T extends object>({ className, children, ...props }: MenuItemProps<T>): import("react").JSX.Element;
13
+ export declare function MenuSeparator({ className, ...props }: ComponentPropsWithRef<typeof Separator>): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import type { InspectionRecords } from './AboutData.js';
2
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
3
+ import type { WidgetStatus } from './RequestHint.js';
4
+ import type { WidgetEvidence } from './WidgetEvidence.js';
5
+ import { type MetricComparison } from './metric-comparison.js';
6
+ import { type MetricFormat } from '@altertable/data-app/format';
7
+ import type { MetricReading } from '@altertable/data-app/internal';
8
+ import { type MetricDefinition } from './metric.js';
9
+ type MetricWidgetBaseProps = {
10
+ label: string;
11
+ /** Document outline level. The label keeps the shared widget-heading appearance. */
12
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
13
+ annotationId?: string;
14
+ description?: ReactNode;
15
+ comparison?: MetricComparison;
16
+ evidence?: WidgetEvidence;
17
+ records?: InspectionRecords;
18
+ action?: ReactNode;
19
+ status?: WidgetStatus;
20
+ visual?: ReactNode;
21
+ } & Omit<ComponentPropsWithRef<'div'>, 'about' | 'children'>;
22
+ type UnboundMetricWidgetProps = MetricWidgetBaseProps & ({
23
+ loading: true;
24
+ value?: never;
25
+ format?: never;
26
+ content?: never;
27
+ } | ({
28
+ loading?: false;
29
+ } & ({
30
+ value: number;
31
+ format: MetricFormat;
32
+ content?: never;
33
+ } | {
34
+ content: ReactNode;
35
+ value?: never;
36
+ format?: never;
37
+ })));
38
+ /** VisualizationWidget with a formatted metric, optional comparison, and evidence. */
39
+ export type MetricWidgetProps = UnboundMetricWidgetProps | (Omit<MetricWidgetBaseProps, 'label' | 'comparison' | 'evidence'> & {
40
+ metric: MetricDefinition;
41
+ reading: MetricReading;
42
+ label?: never;
43
+ value?: never;
44
+ format?: never;
45
+ content?: never;
46
+ comparison?: never;
47
+ evidence?: never;
48
+ loading?: never;
49
+ });
50
+ export declare function MetricWidget(props: MetricWidgetProps): import("react").JSX.Element;
51
+ export {};
@@ -0,0 +1,27 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import { NumberField as AriaNumberField } from 'react-aria-components';
3
+ export type NumberFieldProps = Omit<ComponentPropsWithRef<typeof AriaNumberField>, 'value' | 'onChange' | 'className'> & {
4
+ label: string;
5
+ value: number | null;
6
+ onChange: (value: number | null) => void;
7
+ className?: string;
8
+ };
9
+ /** Localized numeric entry. Empty input is null rather than zero. */
10
+ export declare function NumberField({ label, value, onChange, className, ...props }: NumberFieldProps): import("react").JSX.Element;
11
+ export type NumberRange = {
12
+ min?: number;
13
+ max?: number;
14
+ };
15
+ export type NumberRangeFieldProps = {
16
+ label: string;
17
+ value: NumberRange;
18
+ onChange: (value: NumberRange) => void;
19
+ /** Reports whether the current draft interval can be committed. */
20
+ onValidityChange?: (valid: boolean) => void;
21
+ min?: number;
22
+ max?: number;
23
+ disabled?: boolean;
24
+ className?: string;
25
+ };
26
+ /** Commit valid intervals; retain invalid draft bounds so users can correct them. */
27
+ export declare function NumberRangeField({ label, value, onChange, onValidityChange, min, max, disabled, className, }: NumberRangeFieldProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ControlLabelPlacement } from './PickerField.js';
2
+ import { type NumberFilter, type NumberSelection } from '@altertable/data-app/contract';
3
+ export type NumberFilterPickerProps = {
4
+ filter: NumberFilter;
5
+ labelPlacement?: ControlLabelPlacement;
6
+ value: NumberSelection;
7
+ onChange: (value: NumberSelection) => void;
8
+ disabled?: boolean;
9
+ };
10
+ /** Edit a numeric predicate in a panel. Apply commits one complete value; dismissing discards the draft. */
11
+ export declare function NumberFilterPicker({ filter, value, onChange, disabled, labelPlacement, }: NumberFilterPickerProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { type ReportingPeriod } from '@altertable/data-app/contract';
2
+ import { type DateTimeFormatOptions } from '@altertable/data-app/format';
3
+ export { type ReportingPeriod } from '@altertable/data-app/contract';
4
+ export type PeriodComparison = {
5
+ kind: 'previous';
6
+ } | {
7
+ kind: 'period';
8
+ period: ReportingPeriod;
9
+ };
10
+ export type PeriodSummaryProps = {
11
+ period: ReportingPeriod;
12
+ comparison?: PeriodComparison;
13
+ className?: string;
14
+ };
15
+ export declare function reportingPeriodText(period: ReportingPeriod, options?: DateTimeFormatOptions): string;
16
+ /** Read-only period context for the variable bar, including exact bounds for assistive technology. */
17
+ export declare function PeriodSummary({ period, comparison, className, }: PeriodSummaryProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type AppIconName } from './icons.js';
3
+ /** Inline labels sit with the value; above and beside labels have a separate layout slot. */
4
+ export type ControlLabelPlacement = 'inline' | 'above' | 'beside';
5
+ /** Popup triggers retain their accessible names when the visible label moves outside. */
6
+ export declare function PickerField({ label, labelPlacement, children, }: {
7
+ label: string;
8
+ labelPlacement?: ControlLabelPlacement;
9
+ children: ReactNode;
10
+ }): 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;
11
+ /** Shared label and value slots for pickers and active-filter summaries. */
12
+ export declare function ControlLabelValue({ label, value, }: {
13
+ label?: ReactNode;
14
+ value: ReactNode;
15
+ }): import("react").JSX.Element;
16
+ /** Shared label, value, and disclosure layout for selection and predicate controls. */
17
+ export declare function PickerTriggerContent({ label, labelPlacement, value, icon, iconSize, }: {
18
+ label: string;
19
+ labelPlacement: ControlLabelPlacement;
20
+ value: ReactNode;
21
+ icon?: AppIconName;
22
+ iconSize?: number;
23
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ChartItem, ValueChartProps } from './chart-data.js';
2
+ export type PieChartItem = ChartItem;
3
+ export type PieChartProps<Row extends PieChartItem = PieChartItem> = ValueChartProps<Row> & {
4
+ /** Omit the built-in key when composing a separate ChartLegend. */
5
+ showLegend?: boolean;
6
+ };
7
+ /** Nonnegative, mutually exclusive parts; shares use the sum of supplied items.
8
+ * Include Other to represent the whole. Zero values remain in the legend; all-zero
9
+ * data shows an empty circle. Colors follow item order. Compose inside VisualizationWidget;
10
+ * hover/touch tooltips coordinate slice and legend emphasis without caller state. */
11
+ export declare function PieChart<Row extends PieChartItem>({ items, unit, ariaLabel, showLegend, formatValue, itemActions, }: PieChartProps<Row>): 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;
@@ -0,0 +1,30 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { ThemeController } from '@altertable/data-app/appearance';
3
+ import { type AboutEmpty } from './AboutData.js';
4
+ import type { DataContext } from './data-context.js';
5
+ import { type StoryFinding } from './story.js';
6
+ export type StoryStep = {
7
+ id: string;
8
+ empty?: AboutEmpty;
9
+ headline: string;
10
+ context?: string;
11
+ glossaryIds?: string[];
12
+ queryNames?: string[];
13
+ visual: ReactNode;
14
+ visualKind?: 'metric' | 'chart';
15
+ };
16
+ export type PresentStoryProps = {
17
+ title: string;
18
+ findings: readonly StoryFinding[];
19
+ empty?: AboutEmpty;
20
+ scope?: ReactNode;
21
+ dataContext: DataContext;
22
+ theme?: ThemeController;
23
+ headerActions?: ReactNode;
24
+ footer?: ReactNode;
25
+ } & Omit<ComponentPropsWithRef<'button'>, 'title'>;
26
+ /**
27
+ * Uses an already loaded snapshot. Navigation is stored in `?present=1&step=`, and step
28
+ * inspection uses `?about=`. The presentation owns its modal structure.
29
+ */
30
+ export declare function PresentStory({ title, findings, empty, scope, dataContext, theme, headerActions, footer, children, className, onClick, disabled, ref, ...props }: PresentStoryProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { type DisclosedQuery } from '@altertable/data-app/contract';
3
+ export type QueryListProps = {
4
+ queries?: DisclosedQuery[];
5
+ names?: string[];
6
+ summary?: ReactNode;
7
+ expanded?: boolean;
8
+ } & Omit<ComponentPropsWithRef<'details'>, 'children'>;
9
+ export declare function formatSql(statement: string): string;
10
+ /**
11
+ * `names` selects supporting queries. Missing query evidence is shown explicitly; `expanded`
12
+ * skips the disclosure in a dedicated Queries view.
13
+ */
14
+ export declare function QueryList({ queries, names, summary, expanded, className, ...props }: QueryListProps): import("react").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import { RadioGroup as AriaRadioGroup, Radio as AriaRadio } from 'react-aria-components';
3
+ import { type ChoiceOption } from '@altertable/data-app/internal';
4
+ export type RadioGroupProps = Omit<ComponentPropsWithRef<typeof AriaRadioGroup>, 'className' | 'children'> & {
5
+ children: ReactNode;
6
+ label: string;
7
+ className?: string;
8
+ };
9
+ export declare function RadioGroup({ label, className, children, ...props }: RadioGroupProps): import("react").JSX.Element;
10
+ export type RadioProps = Omit<ComponentPropsWithRef<typeof AriaRadio>, 'className'> & {
11
+ className?: string;
12
+ };
13
+ export declare function Radio({ className, children, ...props }: RadioProps): import("react").JSX.Element;
14
+ export type SegmentedControlProps = Omit<RadioGroupProps, 'children'> & {
15
+ options: readonly ChoiceOption[];
16
+ };
17
+ /** A compact radio group; arrow keys follow standard radio selection behavior. */
18
+ export declare function SegmentedControl({ options, className, ...props }: SegmentedControlProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export type RankingItem = {
3
+ id: string;
4
+ label: ReactNode;
5
+ value: number;
6
+ detail?: ReactNode;
7
+ };
8
+ export type RankingProps = {
9
+ items: readonly RankingItem[];
10
+ formatValue?: (value: number) => ReactNode;
11
+ } & Omit<ComponentPropsWithRef<'ol'>, 'children'>;
12
+ /** Ordered values scaled to the largest visible item, not shares of a whole. */
13
+ export declare function Ranking({ items, formatValue, className, ...props }: RankingProps): import("react").JSX.Element;