@altertable/data-app 0.59.1

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 (174) hide show
  1. package/AGENTS.md +35 -0
  2. package/CONTRIBUTING.md +83 -0
  3. package/LICENSE +21 -0
  4. package/README.md +63 -0
  5. package/dist/bootstrap.js +388 -0
  6. package/dist/chunks/contract-14vxdcrs.js +192 -0
  7. package/dist/chunks/contract-14vxdcrs.js.map +10 -0
  8. package/dist/chunks/contract-8q35dcyh.js +9 -0
  9. package/dist/chunks/contract-8q35dcyh.js.map +10 -0
  10. package/dist/chunks/contract-jksbmt5q.js +133 -0
  11. package/dist/chunks/contract-jksbmt5q.js.map +10 -0
  12. package/dist/chunks/contract-mb5nfzwg.js +375 -0
  13. package/dist/chunks/contract-mb5nfzwg.js.map +12 -0
  14. package/dist/chunks/contract-mev09s5v.js +77 -0
  15. package/dist/chunks/contract-mev09s5v.js.map +10 -0
  16. package/dist/chunks/contract-nt819swq.js +321 -0
  17. package/dist/chunks/contract-nt819swq.js.map +11 -0
  18. package/dist/chunks/contract-ryyf6dme.js +21 -0
  19. package/dist/chunks/contract-ryyf6dme.js.map +10 -0
  20. package/dist/chunks/contract-tkkc28tg.js +213 -0
  21. package/dist/chunks/contract-tkkc28tg.js.map +12 -0
  22. package/dist/chunks/contract-tqrf3ykr.js +232 -0
  23. package/dist/chunks/contract-tqrf3ykr.js.map +11 -0
  24. package/dist/chunks/contract-wz59z8pq.js +8 -0
  25. package/dist/chunks/contract-wz59z8pq.js.map +10 -0
  26. package/dist/client/index.js +27 -0
  27. package/dist/client/index.js.map +9 -0
  28. package/dist/core/appearance.js +12 -0
  29. package/dist/core/appearance.js.map +9 -0
  30. package/dist/core/config.js +8 -0
  31. package/dist/core/config.js.map +9 -0
  32. package/dist/core/contract.js +55 -0
  33. package/dist/core/contract.js.map +9 -0
  34. package/dist/core/format.js +18 -0
  35. package/dist/core/format.js.map +9 -0
  36. package/dist/embed/index.js +91 -0
  37. package/dist/embed/index.js.map +11 -0
  38. package/dist/local.js +332 -0
  39. package/dist/local.js.map +15 -0
  40. package/dist/react/embed/index.js +130 -0
  41. package/dist/react/embed/index.js.map +11 -0
  42. package/dist/react/index.css +4478 -0
  43. package/dist/react/index.js +6105 -0
  44. package/dist/react/index.js.map +90 -0
  45. package/dist/react.css.d.ts +1 -0
  46. package/dist/server.js +231 -0
  47. package/dist/server.js.map +14 -0
  48. package/dist/types/client/iframe.d.ts +39 -0
  49. package/dist/types/client/index.d.ts +42 -0
  50. package/dist/types/client/location.d.ts +15 -0
  51. package/dist/types/client/messages.d.ts +7 -0
  52. package/dist/types/client/navigation.d.ts +14 -0
  53. package/dist/types/client/transport.d.ts +15 -0
  54. package/dist/types/core/appearance.d.ts +28 -0
  55. package/dist/types/core/bridge.d.ts +35 -0
  56. package/dist/types/core/config.d.ts +14 -0
  57. package/dist/types/core/contract.d.ts +139 -0
  58. package/dist/types/core/data-view.d.ts +46 -0
  59. package/dist/types/core/date-range.d.ts +20 -0
  60. package/dist/types/core/dimension.d.ts +60 -0
  61. package/dist/types/core/format.d.ts +40 -0
  62. package/dist/types/core/invariant.d.ts +2 -0
  63. package/dist/types/core/messages.d.ts +77 -0
  64. package/dist/types/core/reading.d.ts +17 -0
  65. package/dist/types/core/variables.d.ts +82 -0
  66. package/dist/types/embed/bootstrap.d.ts +5 -0
  67. package/dist/types/embed/host.d.ts +23 -0
  68. package/dist/types/embed/index.d.ts +11 -0
  69. package/dist/types/embed/navigation.d.ts +6 -0
  70. package/dist/types/embed/shell.d.ts +21 -0
  71. package/dist/types/embed/standalone.d.ts +1 -0
  72. package/dist/types/react/content.d.ts +23 -0
  73. package/dist/types/react/embed/bridge.d.ts +12 -0
  74. package/dist/types/react/embed/index.d.ts +9 -0
  75. package/dist/types/react/embed/shell.d.ts +10 -0
  76. package/dist/types/react/hooks.d.ts +831 -0
  77. package/dist/types/react/index.d.ts +11 -0
  78. package/dist/types/react/mount.d.ts +11 -0
  79. package/dist/types/react/ui/AboutData.d.ts +61 -0
  80. package/dist/types/react/ui/AltertableLogo.d.ts +3 -0
  81. package/dist/types/react/ui/AppFooter.d.ts +7 -0
  82. package/dist/types/react/ui/AppHeader.d.ts +12 -0
  83. package/dist/types/react/ui/AppLayout.d.ts +17 -0
  84. package/dist/types/react/ui/AppScope.d.ts +8 -0
  85. package/dist/types/react/ui/AppToolbar.d.ts +32 -0
  86. package/dist/types/react/ui/Breakdown.d.ts +14 -0
  87. package/dist/types/react/ui/Button.d.ts +12 -0
  88. package/dist/types/react/ui/Checkbox.d.ts +11 -0
  89. package/dist/types/react/ui/Combobox.d.ts +43 -0
  90. package/dist/types/react/ui/ComparisonVisual.d.ts +15 -0
  91. package/dist/types/react/ui/ContentSkeleton.d.ts +8 -0
  92. package/dist/types/react/ui/DataApp.d.ts +56 -0
  93. package/dist/types/react/ui/DataBoundary.d.ts +16 -0
  94. package/dist/types/react/ui/DataSection.d.ts +28 -0
  95. package/dist/types/react/ui/DataTable.d.ts +28 -0
  96. package/dist/types/react/ui/DataViewToast.d.ts +12 -0
  97. package/dist/types/react/ui/DataWidget.d.ts +39 -0
  98. package/dist/types/react/ui/DateRangePicker.d.ts +29 -0
  99. package/dist/types/react/ui/DateTimeTooltip.d.ts +10 -0
  100. package/dist/types/react/ui/DimensionPicker.d.ts +11 -0
  101. package/dist/types/react/ui/EmptyState.d.ts +9 -0
  102. package/dist/types/react/ui/GettingStarted.d.ts +9 -0
  103. package/dist/types/react/ui/GlossaryDefinition.d.ts +8 -0
  104. package/dist/types/react/ui/GlossaryExplanation.d.ts +17 -0
  105. package/dist/types/react/ui/GradientScroll.d.ts +16 -0
  106. package/dist/types/react/ui/Grid.d.ts +13 -0
  107. package/dist/types/react/ui/GridItem.d.ts +7 -0
  108. package/dist/types/react/ui/HelpPopover.d.ts +24 -0
  109. package/dist/types/react/ui/IconButton.d.ts +19 -0
  110. package/dist/types/react/ui/InspectionContext.d.ts +10 -0
  111. package/dist/types/react/ui/Kbd.d.ts +8 -0
  112. package/dist/types/react/ui/LiveControl.d.ts +11 -0
  113. package/dist/types/react/ui/MetricWidget.d.ts +48 -0
  114. package/dist/types/react/ui/PeriodSummary.d.ts +17 -0
  115. package/dist/types/react/ui/PresentStory.d.ts +34 -0
  116. package/dist/types/react/ui/QueryList.d.ts +15 -0
  117. package/dist/types/react/ui/Ranking.d.ts +14 -0
  118. package/dist/types/react/ui/RefreshControl.d.ts +11 -0
  119. package/dist/types/react/ui/RefreshRegion.d.ts +10 -0
  120. package/dist/types/react/ui/RequestHint.d.ts +21 -0
  121. package/dist/types/react/ui/SearchField.d.ts +23 -0
  122. package/dist/types/react/ui/SearchInput.d.ts +9 -0
  123. package/dist/types/react/ui/SearchMatch.d.ts +7 -0
  124. package/dist/types/react/ui/SelectableBarChart.d.ts +16 -0
  125. package/dist/types/react/ui/SelectionMark.d.ts +5 -0
  126. package/dist/types/react/ui/Sheet.d.ts +19 -0
  127. package/dist/types/react/ui/Skeleton.d.ts +6 -0
  128. package/dist/types/react/ui/Stack.d.ts +8 -0
  129. package/dist/types/react/ui/StatusPanel.d.ts +11 -0
  130. package/dist/types/react/ui/TableWidget.d.ts +57 -0
  131. package/dist/types/react/ui/Tabs.d.ts +6 -0
  132. package/dist/types/react/ui/ThemeSelector.d.ts +13 -0
  133. package/dist/types/react/ui/Tooltip.d.ts +23 -0
  134. package/dist/types/react/ui/UpdatedAt.d.ts +10 -0
  135. package/dist/types/react/ui/VariableBar.d.ts +7 -0
  136. package/dist/types/react/ui/VisualizationWidget.d.ts +52 -0
  137. package/dist/types/react/ui/WidgetDisclosure.d.ts +7 -0
  138. package/dist/types/react/ui/WidgetEvidence.d.ts +12 -0
  139. package/dist/types/react/ui/WidgetViewTabs.d.ts +17 -0
  140. package/dist/types/react/ui/chartColor.d.ts +1 -0
  141. package/dist/types/react/ui/classNames.d.ts +1 -0
  142. package/dist/types/react/ui/comparison.d.ts +30 -0
  143. package/dist/types/react/ui/data-context.d.ts +65 -0
  144. package/dist/types/react/ui/data-identifiers.d.ts +33 -0
  145. package/dist/types/react/ui/icons.d.ts +42 -0
  146. package/dist/types/react/ui/index.d.ts +129 -0
  147. package/dist/types/react/ui/metric.d.ts +11 -0
  148. package/dist/types/react/ui/search.d.ts +6 -0
  149. package/dist/types/react/ui/searchItems.d.ts +34 -0
  150. package/dist/types/react/ui/shortcuts.d.ts +32 -0
  151. package/dist/types/react/ui/story.d.ts +20 -0
  152. package/dist/types/react/ui/variables.d.ts +36 -0
  153. package/dist/types/react/ui/widget-views.d.ts +3 -0
  154. package/dist/types/react/view-controls.d.ts +17 -0
  155. package/dist/types/react/view.d.ts +49 -0
  156. package/dist/types/server/handler.d.ts +13 -0
  157. package/dist/types/server/index.d.ts +7 -0
  158. package/dist/types/server/local.d.ts +17 -0
  159. package/docs/app-authoring.md +26 -0
  160. package/docs/appearance.md +30 -0
  161. package/docs/bootstrap.md +76 -0
  162. package/docs/client.md +127 -0
  163. package/docs/config.md +21 -0
  164. package/docs/contract.md +95 -0
  165. package/docs/embed.md +98 -0
  166. package/docs/format.md +29 -0
  167. package/docs/react-embed.md +57 -0
  168. package/docs/react-styles.md +17 -0
  169. package/docs/react.md +248 -0
  170. package/docs/releasing.md +74 -0
  171. package/docs/server-bun.md +26 -0
  172. package/docs/server.md +47 -0
  173. package/docs/starter-agent-instructions.md +51 -0
  174. package/package.json +124 -0
@@ -0,0 +1,24 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+ import { type Placement } from '@floating-ui/react';
3
+
4
+
5
+ export type HelpPopoverTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'>;
6
+ export type HelpPopoverPanelProps = Omit<ComponentPropsWithRef<'section'>, 'children' | 'role'>;
7
+ export type HelpPopoverProps = {
8
+ trigger: ReactNode;
9
+ triggerLabel: string;
10
+ label: string;
11
+ children: ReactNode;
12
+ triggerClassName?: string;
13
+ panelClassName?: string;
14
+ placement?: Placement;
15
+ portalRoot?: RefObject<HTMLElement | null>;
16
+ triggerProps?: HelpPopoverTriggerProps;
17
+ panelProps?: HelpPopoverPanelProps;
18
+ open?: boolean;
19
+ onOpenChange?: (open: boolean) => void;
20
+ };
21
+ /** A supplemental explanation that opens on click, Enter, or a deliberate mouse hover. Tabbing
22
+ * past the trigger does not open it, and a click keeps a hover-opened panel in place.
23
+ * triggerProps and panelProps target its two surfaces. */
24
+ export declare function HelpPopover({ trigger, triggerLabel, label, children, triggerClassName, panelClassName, portalRoot, triggerProps, panelProps, placement, open: openProp, onOpenChange, }: HelpPopoverProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ComponentPropsWithRef, ReactNode, 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,10 @@
1
+ import type { DisclosedQuery } from '../../core/contract.js';
2
+ import type { AboutEmpty } from './AboutData.js';
3
+ import type { DataContext } from './data-context.js';
4
+ export type InspectionDefaults = {
5
+ dataContext: DataContext;
6
+ empty?: AboutEmpty;
7
+ queries?: DisclosedQuery[];
8
+ };
9
+ export declare const InspectionContext: import("react").Context<InspectionDefaults | null>;
10
+ export declare function useInspectionDefaults(): InspectionDefaults | null;
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ import { type Shortcut } from './shortcuts.js';
3
+
4
+ export type KbdProps = ComponentPropsWithRef<'kbd'> & {
5
+ shortcut?: Shortcut;
6
+ };
7
+ /** A visible key or shortcut. Keep aria-keyshortcuts on the associated control. */
8
+ export declare function Kbd({ shortcut, children, className, ...props }: KbdProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+
3
+ export type LiveIntervalSeconds = 30 | 60 | 300;
4
+ export type LiveControlProps = {
5
+ enabled: boolean;
6
+ onChange: (enabled: boolean) => void;
7
+ intervalSeconds: LiveIntervalSeconds;
8
+ onIntervalChange: (seconds: LiveIntervalSeconds) => void;
9
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'onClick' | 'onChange'>;
10
+ /** Toggle an app-owned recurring refresh. The app supplies the timer and its cadence. */
11
+ export declare function LiveControl({ enabled, onChange, intervalSeconds, onIntervalChange, className, ...props }: LiveControlProps): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { type WidgetStatus } from './RequestHint.js';
3
+ import type { WidgetEvidence } from './WidgetEvidence.js';
4
+ import { type MetricComparison } from './comparison.js';
5
+ import { type MetricFormat } from '../../core/format.js';
6
+ import type { MetricReading } from '../../core/reading.js';
7
+ import { type MetricDefinition } from './metric.js';
8
+
9
+
10
+ type MetricWidgetBaseProps = {
11
+ label: string;
12
+ description?: ReactNode;
13
+ comparison?: MetricComparison;
14
+ evidence?: WidgetEvidence;
15
+ action?: ReactNode;
16
+ insight?: ReactNode;
17
+ status?: WidgetStatus;
18
+ visual?: ReactNode;
19
+ } & Omit<ComponentPropsWithRef<'div'>, 'about' | 'children'>;
20
+ type UnboundMetricWidgetProps = MetricWidgetBaseProps & ({
21
+ loading: true;
22
+ value?: never;
23
+ format?: never;
24
+ content?: never;
25
+ } | ({
26
+ loading?: false;
27
+ } & ({
28
+ value: number;
29
+ format: MetricFormat;
30
+ content?: never;
31
+ } | {
32
+ content: ReactNode;
33
+ value?: never;
34
+ format?: never;
35
+ })));
36
+ export type MetricWidgetProps = UnboundMetricWidgetProps | (Omit<MetricWidgetBaseProps, 'label' | 'comparison' | 'evidence'> & {
37
+ metric: MetricDefinition;
38
+ reading: MetricReading;
39
+ label?: never;
40
+ value?: never;
41
+ format?: never;
42
+ content?: never;
43
+ comparison?: never;
44
+ evidence?: never;
45
+ loading?: never;
46
+ });
47
+ export declare function MetricWidget(props: MetricWidgetProps): import("react").JSX.Element;
48
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { ReportingPeriod } from '../../core/contract.js';
2
+
3
+ export type { ReportingPeriod } from '../../core/contract.js';
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): 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,34 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { ThemeController } from '../../core/appearance.js';
3
+ import { type AboutEmpty } from './AboutData.js';
4
+ import type { DataContext } from './data-context.js';
5
+ import { type StoryFinding } from './story.js';
6
+
7
+ export type StoryStep = {
8
+ id: string;
9
+ empty?: AboutEmpty;
10
+ headline: string;
11
+ context?: string;
12
+ glossaryIds?: string[];
13
+ queryNames?: string[];
14
+ visual: ReactNode;
15
+ visualKind?: 'metric' | 'chart';
16
+ };
17
+ export type PresentStoryProps = {
18
+ title: string;
19
+ findings: readonly StoryFinding[];
20
+ empty?: AboutEmpty;
21
+ scope?: ReactNode;
22
+ dataContext: DataContext;
23
+ theme?: ThemeController;
24
+ launcherProps?: Omit<ComponentPropsWithRef<'span'>, 'children'>;
25
+ dialogProps?: Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'aria-labelledby' | 'open'>;
26
+ headerActions?: ReactNode;
27
+ footer?: ReactNode;
28
+ } & Omit<ComponentPropsWithRef<'button'>, 'title'>;
29
+ /**
30
+ * Uses an already loaded snapshot. Navigation is stored in `?present=1&step=`, and step
31
+ * inspection uses `?about=`. `launcherProps` targets the outer span; `dialogProps` targets the
32
+ * modal.
33
+ */
34
+ export declare function PresentStory({ title, findings, empty, scope, dataContext, theme, launcherProps, dialogProps, headerActions, footer, children, className, onClick, disabled, ref, ...props }: PresentStoryProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { DisclosedQuery } from '../../core/contract.js';
3
+
4
+ export type QueryListProps = {
5
+ queries?: DisclosedQuery[];
6
+ names?: string[];
7
+ summary?: ReactNode;
8
+ expanded?: boolean;
9
+ } & Omit<ComponentPropsWithRef<'details'>, 'children'>;
10
+ export declare function formatSql(statement: string): string;
11
+ /**
12
+ * `names` selects supporting queries. Missing query evidence is shown explicitly; `expanded`
13
+ * skips the disclosure in a dedicated Queries view.
14
+ */
15
+ export declare function QueryList({ queries, names, summary, expanded, className, ...props }: QueryListProps): import("react").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type RankingItem = {
4
+ id: string;
5
+ label: ReactNode;
6
+ value: number;
7
+ detail?: ReactNode;
8
+ };
9
+ export type RankingProps = {
10
+ items: readonly RankingItem[];
11
+ formatValue?: (value: number) => ReactNode;
12
+ } & Omit<ComponentPropsWithRef<'ol'>, 'children'>;
13
+ /** Ordered values scaled to the largest visible item, not shares of a whole. */
14
+ export declare function Ranking({ items, formatValue, className, ...props }: RankingProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+
3
+ export type RefreshControlProps = {
4
+ refreshing: boolean;
5
+ children: ReactNode;
6
+ label?: string;
7
+ statusProps?: Omit<ComponentPropsWithRef<'div'>, 'children' | 'role'>;
8
+ status?: ReactNode;
9
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
10
+ /** Show refresh progress just before its action after a short delay. */
11
+ export declare function RefreshControl({ refreshing, children, label, statusProps, status, className, ...props }: RefreshControlProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type RefreshRegionProps = {
4
+ refreshing: boolean;
5
+ dimOnUpdate?: boolean;
6
+ children: ReactNode;
7
+ contentProps?: Omit<ComponentPropsWithRef<'div'>, 'children' | 'aria-busy'>;
8
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
9
+ /** Keep prior content in place while a fresh result loads. Local results can opt into dimming. */
10
+ export declare function RefreshRegion({ refreshing, dimOnUpdate, children, contentProps, className, ...props }: RefreshRegionProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+
2
+ /** Idle keeps the same reserved space as refresh and failure. Initial loading belongs to skeletons. */
3
+ export type WidgetStatus = {
4
+ kind: 'idle';
5
+ } | {
6
+ kind: 'updating';
7
+ message?: string;
8
+ } | {
9
+ kind: 'error';
10
+ message?: string;
11
+ onRetry?: () => void;
12
+ };
13
+ /** Fixed-height feedback keeps data in place; the retry belongs beside its failure message. */
14
+ export declare function RequestHint({ status, retryLabel, }: {
15
+ status?: WidgetStatus;
16
+ retryLabel?: string;
17
+ }): import("react").JSX.Element;
18
+ /** Fixed toolbar footprint preserves the title and action positions across request states. */
19
+ export declare function WidgetStatusControl({ status }: {
20
+ status?: WidgetStatus;
21
+ }): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+
3
+ export type SearchFieldProps = {
4
+ label: string;
5
+ value: string;
6
+ onChange: (value: string) => void;
7
+ onSubmit?: (value: string) => void;
8
+ placeholder?: string;
9
+ showLabel?: boolean;
10
+ size?: 'default' | 'compact';
11
+ description?: ReactNode;
12
+ status?: ReactNode;
13
+ busy?: boolean;
14
+ resetValue?: string;
15
+ inputProps?: Omit<ComponentPropsWithRef<'input'>, 'type' | 'value' | 'children'>;
16
+ clearButtonProps?: Omit<ComponentPropsWithRef<'button'>, 'type' | 'children'>;
17
+ children?: ReactNode;
18
+ } & Omit<ComponentPropsWithRef<'form'>, 'onChange' | 'onSubmit' | 'children'>;
19
+ /**
20
+ * The caller owns filtering, URL state, and whether search runs while typing or on submit.
21
+ * Escape and Clear reset the query.
22
+ */
23
+ export declare function SearchField({ label, value, onChange, onSubmit, placeholder, showLabel, size, description, status, busy, resetValue, inputProps, clearButtonProps, children, className, ...props }: SearchFieldProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ /** 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'> & {
5
+ size?: 'default' | 'compact';
6
+ endAction?: ReactNode;
7
+ /** Replaces the search glyph in its existing space; input and results remain usable. */
8
+ loading?: boolean;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ import type { SearchMatchValue } from './searchItems.js';
3
+
4
+ export type SearchMatchProps = {
5
+ match: SearchMatchValue;
6
+ } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
7
+ export declare function SearchMatch({ match, className, ...props }: SearchMatchProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+
2
+ export type SelectableBarItem = {
3
+ id: string;
4
+ label: string;
5
+ value: number;
6
+ };
7
+ export type SelectableBarChartProps = {
8
+ items: readonly SelectableBarItem[];
9
+ selectedId: string | null;
10
+ onSelectionChange: (id: string | null) => void;
11
+ unit: string;
12
+ ariaLabel: string;
13
+ formatValue?: (value: number) => string;
14
+ };
15
+ /** Selection inspects a bar; it never silently filters the rest of the page. */
16
+ export declare function SelectableBarChart({ items, selectedId, onSelectionChange, unit, ariaLabel, formatValue, }: SelectableBarChartProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+
2
+ /** Decorative selection indicator; the containing control owns its accessible semantics. */
3
+ export declare function SelectionMark({ selected }: {
4
+ selected: boolean;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+
3
+ export type SheetDialogProps = Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'open' | 'title' | 'aria-labelledby'>;
4
+ export type SheetProps = {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ title: ReactNode;
8
+ description?: ReactNode;
9
+ children: ReactNode;
10
+ headerActions?: ReactNode;
11
+ footer?: ReactNode;
12
+ wide?: boolean;
13
+ returnFocus?: RefObject<HTMLElement | null>;
14
+ } & SheetDialogProps;
15
+ /**
16
+ * Uses the native dialog top layer and focus trap. Closing keeps the modal mounted until its
17
+ * exit transition completes.
18
+ */
19
+ export declare function Sheet({ open, onOpenChange, title, description, children, headerActions, footer, wide, returnFocus, className, onCancel, onClose, onClick, onTransitionEnd, ref, ...props }: SheetProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+
3
+ export type SkeletonProps = Omit<ComponentPropsWithRef<'span'>, 'children' | 'aria-hidden'>;
4
+ /** Decorative loading placeholder that fades in only when loading takes a moment.
5
+ * Put the accessible status on its container. */
6
+ export declare function Skeleton({ className, ...props }: SkeletonProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type StackProps = {
4
+ children: ReactNode;
5
+ gap?: 'sm' | 'md' | 'lg';
6
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
+ /** Vertical layout for peer sections or request boundaries, with the page's section gap. */
8
+ export declare function Stack({ children, gap, className, ...props }: StackProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type StatusPanelProps = {
4
+ status: 'loading' | 'empty' | 'error';
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ details?: ReactNode;
8
+ action?: ReactNode;
9
+ children?: ReactNode;
10
+ } & Omit<ComponentPropsWithRef<'div'>, 'children' | 'title'>;
11
+ export declare function StatusPanel({ status, title, description, details, action, children, className, role, ...props }: StatusPanelProps): import("react").JSX.Element;
@@ -0,0 +1,57 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { WidgetEvidence } from './WidgetEvidence.js';
3
+ import type { WidgetStatus } from './RequestHint.js';
4
+ import { type DataTableSearch } from './DataTable.js';
5
+ import type { EmptyStateProps } from './EmptyState.js';
6
+ import { type SearchHit, type SearchItemsOptions } from './searchItems.js';
7
+ import type { DataReading } from '../../core/reading.js';
8
+
9
+ export type TableWidgetColumn<Row> = {
10
+ /** Stable, nonempty identity; unique within this table. */
11
+ id: string;
12
+ header: ReactNode;
13
+ type?: 'number' | 'datetime';
14
+ /** Render this column's value for one row. The table owns its cell element and semantics. */
15
+ cell: (row: Row, hit?: SearchHit<Row>) => ReactNode;
16
+ };
17
+ export type TableWidgetSearch<Row> = Omit<DataTableSearch, 'itemCount'> & Pick<SearchItemsOptions<Row>, 'attributes' | 'mode' | 'fuzzyThreshold'>;
18
+ type TableWidgetBaseProps<Row> = {
19
+ title: ReactNode;
20
+ count?: number;
21
+ description?: ReactNode;
22
+ columns: readonly [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
23
+ /** Unique, nonempty row identity. Numeric keys must be finite; 1 and "1" collide. */
24
+ rowKey: (row: Row) => string | number;
25
+ insight?: ReactNode;
26
+ status?: WidgetStatus;
27
+ action?: ReactNode;
28
+ evidence?: WidgetEvidence;
29
+ search?: TableWidgetSearch<Row>;
30
+ /** Valid result with no rows; the header remains visible. */
31
+ empty: Pick<EmptyStateProps, 'title' | 'description'>;
32
+ } & ({
33
+ /** Positive integer preview cap after search; disables pagination. */
34
+ limit: number;
35
+ pagination?: never;
36
+ } | {
37
+ /** Local pagination after search: 10 rows by default, false shows all supplied rows.
38
+ * pageSize must be a positive integer. Counts refer only to supplied rows.
39
+ * The widget owns bottom-footer controls and shares the current page with inspection. */
40
+ pagination?: {
41
+ pageSize: number;
42
+ } | false;
43
+ limit?: never;
44
+ }) & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
45
+ /** Column definitions own both header and body semantics; the first column is the row header. */
46
+ export type TableWidgetProps<Row> = TableWidgetBaseProps<Row> & ({
47
+ rows: readonly Row[];
48
+ reading?: never;
49
+ skeletonRows?: never;
50
+ } | {
51
+ reading: DataReading<readonly Row[]>;
52
+ rows?: never;
53
+ skeletonRows?: number;
54
+ evidence: WidgetEvidence;
55
+ });
56
+ export declare function TableWidget<Row>(props: TableWidgetProps<Row>): import("react").JSX.Element;
57
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'react-aria-components/Tabs';
2
+
3
+ /** React Aria tabs with keyboard and ARIA behavior; pair each Tab and TabPanel by stable id. */
4
+ export { Tabs, TabList, Tab, TabPanels, TabPanel };
5
+ /** Keep a page-level tab in `?view=`; reserve `?tab=` for the inspect sheet. */
6
+ export declare function useViewTab<View extends string>(views: readonly View[], fallback: View): [View, (key: string | number) => void];
@@ -0,0 +1,13 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+ import type { ThemeController } from '../../core/appearance.js';
3
+
4
+ export type ThemeSelectorProps = {
5
+ theme: ThemeController;
6
+ children?: ReactNode;
7
+ } & Omit<ComponentPropsWithRef<'fieldset'>, 'children'>;
8
+ /** Viewer color preference. Brand tokens remain app-owned. */
9
+ export declare function ThemeSelector({ theme, children, className, ...props }: ThemeSelectorProps): import("react").JSX.Element;
10
+ export declare function ThemeToggle({ theme, portalRoot, }: {
11
+ theme: ThemeController;
12
+ portalRoot?: RefObject<HTMLElement | null>;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+
3
+ export type TooltipProviderProps = {
4
+ children: ReactNode;
5
+ delay?: number;
6
+ skipDelayDuration?: number;
7
+ };
8
+ /** Delay the first hover, then open nearby tooltips without waiting during the skip window.
9
+ * Keyboard focus always opens immediately. AppLayout provides this by default. */
10
+ export declare function TooltipProvider({ children, delay, skipDelayDuration, }: TooltipProviderProps): import("react").JSX.Element;
11
+ export type TooltipProps = {
12
+ content: ReactNode;
13
+ children: ReactNode;
14
+ variant?: 'hint' | 'chart';
15
+ align?: 'start' | 'center' | 'end';
16
+ placement?: 'top' | 'bottom';
17
+ portalRoot?: RefObject<HTMLElement | null>;
18
+ tooltipProps?: Omit<ComponentPropsWithRef<'span'>, 'children' | 'role'>;
19
+ } & Omit<ComponentPropsWithRef<'span'>, 'children' | 'content'>;
20
+ /** Short visual hint for an already labeled control. variant="chart" follows the cursor
21
+ * on hover and toggles on tap so a bar or point can show the period and value. Hint
22
+ * tooltips hide once the control is pressed. Escape closes either. */
23
+ export declare function Tooltip({ content, children, variant, align, placement, portalRoot, tooltipProps, className, ref, onPointerEnter, onPointerMove, onPointerLeave, onPointerDown, onFocusCapture, onBlurCapture, ...props }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DateTimeTooltipProps } from './DateTimeTooltip.js';
3
+
4
+ export type UpdatedAtProps = {
5
+ timestamp: number;
6
+ locale?: string;
7
+ label?: string;
8
+ children?: ReactNode;
9
+ } & Omit<DateTimeTooltipProps, 'date' | 'children'>;
10
+ export declare function UpdatedAt({ timestamp, locale, label, children, triggerClassName, ...props }: UpdatedAtProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type VariableBarProps = {
4
+ children: ReactNode;
5
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
6
+ /** Reader-controlled inputs below the page header. */
7
+ export declare function VariableBar({ children, className, role, 'aria-label': ariaLabel, ...props }: VariableBarProps): import("react").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { WidgetEvidence } from './WidgetEvidence.js';
3
+ import { type DataWidgetProps } from './DataWidget.js';
4
+ import type { EmptyStateProps } from './EmptyState.js';
5
+ import type { DataReading } from '../../core/reading.js';
6
+ import { type ContentSkeletonProps } from './ContentSkeleton.js';
7
+
8
+ type VisualizationWidgetBaseProps = {
9
+ title: ReactNode;
10
+ description?: ReactNode;
11
+ insight?: ReactNode;
12
+ action?: ReactNode;
13
+ evidence?: WidgetEvidence;
14
+ status?: DataWidgetProps['status'];
15
+ empty?: Pick<EmptyStateProps, 'title' | 'description'>;
16
+ } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
17
+ type UnboundVisualizationWidgetProps = VisualizationWidgetBaseProps & ({
18
+ loading: true;
19
+ visual?: never;
20
+ } | {
21
+ loading?: false;
22
+ visual: ReactNode;
23
+ });
24
+ export type VisualizationWidgetView<Data> = {
25
+ /** Stable, nonempty identity; unique within this widget. */
26
+ id: string;
27
+ label: ReactNode;
28
+ render: (data: Data) => ReactNode;
29
+ };
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'>;
36
+ visual?: never;
37
+ loading?: never;
38
+ };
39
+ /** The widget owns alternate-view selection and shares it with inspection.
40
+ * Custom chart interactions remain controlled by the caller, above both mounts. */
41
+ export type VisualizationWidgetProps<Data = unknown> = UnboundVisualizationWidgetProps | (BoundVisualizationWidgetBase<Data> & {
42
+ children: (data: Data) => ReactNode;
43
+ views?: never;
44
+ }) | (BoundVisualizationWidgetBase<Data> & {
45
+ views: readonly VisualizationWidgetView<Data>[];
46
+ viewLabel: string;
47
+ /** An existing view ID; defaults to the first view. Validated while loading too. */
48
+ initialView?: string;
49
+ children?: never;
50
+ });
51
+ export declare function VisualizationWidget<Data>(props: VisualizationWidgetProps<Data>): import("react").JSX.Element;
52
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type WidgetDisclosureProps = {
4
+ label: ReactNode;
5
+ children: ReactNode;
6
+ } & Omit<ComponentPropsWithRef<'details'>, 'children'>;
7
+ export declare function WidgetDisclosure({ label, children, className, ...props }: WidgetDisclosureProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { AboutSubject } from './AboutData.js';
2
+ type EvidenceDetails = Omit<AboutSubject, 'id' | 'title' | 'description' | 'visual' | 'visualKind' | 'references'> & {
3
+ id: string;
4
+ };
5
+ export type WidgetEvidence = EvidenceDetails & ({
6
+ glossaryIds: [string, ...string[]];
7
+ queryNames?: string[];
8
+ } | {
9
+ queryNames: [string, ...string[]];
10
+ glossaryIds?: string[];
11
+ });
12
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { type EmptyStateProps } from './EmptyState.js';
3
+
4
+ export type WidgetView = {
5
+ id: string;
6
+ label: ReactNode;
7
+ content: ReactNode;
8
+ empty: Pick<EmptyStateProps, 'title' | 'description'>;
9
+ isEmpty: boolean;
10
+ };
11
+ export type WidgetViewTabsProps<Views extends readonly WidgetView[] = readonly WidgetView[]> = {
12
+ label: string;
13
+ views: Views;
14
+ selectedKey: NoInfer<Views[number]['id']>;
15
+ onSelectionChange: (key: Views[number]['id']) => void;
16
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
17
+ export declare function WidgetViewTabs<const Views extends readonly WidgetView[]>({ label, views, selectedKey, onSelectionChange, className, ...props }: WidgetViewTabsProps<Views>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function chartColor(id: string): string;
@@ -0,0 +1 @@
1
+ export declare function classNames(...values: Array<string | false | null | undefined>): string;
@@ -0,0 +1,30 @@
1
+ import type { DateRangeRequest } from '../../core/contract.js';
2
+ import { type MetricFormat } from '../../core/format.js';
3
+ export type MetricComparison = {
4
+ current: {
5
+ value: number;
6
+ formattedValue: string;
7
+ periodLabel?: string;
8
+ };
9
+ previous?: {
10
+ value: number | null;
11
+ formattedValue: string;
12
+ periodLabel?: string;
13
+ };
14
+ favorableDirection?: 'up' | 'down';
15
+ };
16
+ /** Label a comparison from the input that produced the displayed result. Null means the
17
+ * requested previous period has no comparable value; zero remains a measured value. */
18
+ export declare function calendarMetricComparison(displayedInput: DateRangeRequest, values: {
19
+ current: number;
20
+ previous: number | null;
21
+ format: MetricFormat;
22
+ favorableDirection?: MetricComparison['favorableDirection'];
23
+ }): MetricComparison | undefined;
24
+ /** A zero or missing baseline has no meaningful relative percentage. */
25
+ export declare function comparisonChange({ current, previous, favorableDirection, }: MetricComparison): {
26
+ readonly percent: number | null;
27
+ readonly direction: "down" | "flat" | "up";
28
+ readonly tone: "bad" | "good" | "neutral";
29
+ readonly icon: "trendDown" | "trendFlat" | "trendUp";
30
+ };