@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,11 @@
1
+ /**
2
+ * React bindings and UI; load the stylesheet separately in the browser entry.
3
+ * @module @altertable/data-app/react
4
+ * @see https://github.com/altertable-ai/data-app/blob/main/docs/react.md
5
+ */
6
+ export { mountDataApp, DataAppProvider } from './mount.js';
7
+ export { createDataHooks } from './hooks.js';
8
+ export { defineDataContent } from './content.js';
9
+ export type { DataContentState } from './content.js';
10
+ export type { DataViewDefinition, ResolvedVariables, ViewBindings, } from './view.js';
11
+ export * from './ui/index.js';
@@ -0,0 +1,11 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import { type DataAppConfig } from '../core/config.js';
3
+ /** Mount once per document; installs document identity and the shared request provider. */
4
+ export declare function mountDataApp({ config, component: Component, root, }: {
5
+ config: DataAppConfig;
6
+ component: ComponentType;
7
+ root?: HTMLElement | null;
8
+ }): void;
9
+ export declare function DataAppProvider({ children }: {
10
+ children: ReactNode;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,61 @@
1
+ import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
+ import type { DisclosedQuery } from '../../core/contract.js';
3
+ import type { DataContext, GlossaryEntry } from './data-context.js';
4
+ import { type ButtonProps } from './Button.js';
5
+ import { type SheetDialogProps } from './Sheet.js';
6
+
7
+ export type AboutTab = 'glossary' | 'queries';
8
+ export type AboutEmpty = {
9
+ glossary: {
10
+ title: string;
11
+ description?: string;
12
+ };
13
+ queries: {
14
+ title: string;
15
+ description?: string;
16
+ };
17
+ };
18
+ export declare const defaultAboutEmpty: AboutEmpty;
19
+ export type AboutSubject = {
20
+ empty?: AboutEmpty;
21
+ id?: string;
22
+ title?: ReactNode;
23
+ description?: ReactNode;
24
+ visual?: ReactNode;
25
+ visualKind?: 'metric' | 'chart' | 'widget';
26
+ dataContext?: DataContext;
27
+ references?: {
28
+ kind: 'ids';
29
+ glossaryIds?: readonly string[];
30
+ queryNames?: readonly string[];
31
+ } | {
32
+ kind: 'entries';
33
+ entries: readonly GlossaryEntry[];
34
+ };
35
+ queries?: DisclosedQuery[];
36
+ };
37
+ export type AboutDataProps = AboutSubject & {
38
+ variant?: ButtonProps['variant'];
39
+ iconOnly?: boolean;
40
+ /**
41
+ * Register the global inspect shortcut. Defaults on for existing toolbar triggers; local
42
+ * triggers set false.
43
+ */
44
+ shortcut?: boolean;
45
+ tooltip?: ReactNode;
46
+ children?: ReactNode;
47
+ footer?: ReactNode;
48
+ portalRoot?: RefObject<HTMLElement | null>;
49
+ sheetProps?: SheetDialogProps;
50
+ headerActions?: ReactNode;
51
+ open?: boolean;
52
+ onOpenChange?: (open: boolean) => void;
53
+ /** Initial inspect tab. While open, the URL's `tab` parameter tracks selection. */
54
+ tab?: AboutTab;
55
+ trigger?: boolean;
56
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
57
+ /**
58
+ * Open state uses `?about=`; tab selection uses `?tab=`. Enable the global shortcut only on the
59
+ * page-level trigger.
60
+ */
61
+ export declare function AboutData({ id, title, description, visual, visualKind, variant, dataContext, references, queries, empty, iconOnly, shortcut, tooltip, children, footer, portalRoot, sheetProps, headerActions, open: openProp, onOpenChange, tab, trigger, className, onClick, ref, ...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,7 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type AppFooterProps = ComponentPropsWithRef<'footer'> & {
4
+ attribution?: ReactNode;
5
+ };
6
+ /** `children` fills the action slot; `attribution` replaces the default link. */
7
+ export declare function AppFooter({ children, attribution, className, ...props }: AppFooterProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type AppHeaderProps = {
4
+ scope?: ReactNode;
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ toolbar?: ReactNode;
8
+ children?: ReactNode;
9
+ headingProps?: Omit<ComponentPropsWithRef<'div'>, 'children'>;
10
+ } & Omit<ComponentPropsWithRef<'header'>, 'children' | 'title'>;
11
+ /** Page identity and actions; on narrow screens the scope shares a row with actions. */
12
+ export declare function AppHeader({ scope, title, description, toolbar, children, headingProps, className, ...props }: AppHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ComponentProps, ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { AppFooter } from './AppFooter.js';
3
+ import { type TooltipProviderProps } from './Tooltip.js';
4
+
5
+ export type AppLayoutProps = {
6
+ children: ReactNode;
7
+ footerActions?: ReactNode;
8
+ footer?: ReactNode;
9
+ footerProps?: Omit<ComponentProps<typeof AppFooter>, 'children'>;
10
+ layoutProps?: Omit<ComponentPropsWithRef<'div'>, 'children'>;
11
+ tooltipProviderProps?: Omit<TooltipProviderProps, 'children'>;
12
+ } & Omit<ComponentPropsWithRef<'main'>, 'children'>;
13
+ /**
14
+ * Native props target `<main>`. `layoutProps` targets the outer wrapper; `footer` replaces the
15
+ * default footer, while `footerActions` fills it.
16
+ */
17
+ export declare function AppLayout({ children, footerActions, footer, footerProps, layoutProps, tooltipProviderProps, className, ...props }: AppLayoutProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type AppScopeProps = {
4
+ organization: string;
5
+ environment: string;
6
+ children?: ReactNode;
7
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
8
+ export declare function AppScope({ organization, environment, children, className, ...props }: AppScopeProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import type { ComponentProps, ComponentPropsWithRef, ReactNode } from 'react';
2
+ import type { DataView } from '../../core/data-view.js';
3
+ import { type LiveControlProps } from './LiveControl.js';
4
+ import { PresentStory } from './PresentStory.js';
5
+ import { RefreshControl } from './RefreshControl.js';
6
+
7
+ export type AppToolbarProps = {
8
+ children?: ReactNode;
9
+ end?: ReactNode;
10
+ controlsProps?: Omit<ComponentPropsWithRef<'div'>, 'children'>;
11
+ updatedAt?: ReactNode;
12
+ initialLoading?: boolean;
13
+ requestState?: DataView<unknown, unknown>['kind'];
14
+ refresh?: {
15
+ refreshing: boolean;
16
+ onRefresh: () => void;
17
+ onCancel?: () => void;
18
+ label?: string;
19
+ tooltip?: ReactNode;
20
+ buttonProps?: Omit<ComponentPropsWithRef<'button'>, 'children' | 'onClick'>;
21
+ statusProps?: ComponentProps<typeof RefreshControl>['statusProps'];
22
+ };
23
+ live?: LiveControlProps;
24
+ aboutData?: ReactNode;
25
+ story?: ComponentProps<typeof PresentStory>;
26
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
27
+ /** Header actions only. Put reader-controlled inputs in DataApp.variables below the header.
28
+ * Observation time, or an initial loading status, sits before Refresh. Children prepend app controls in the right
29
+ * cluster; end follows the built-in actions. Live sits beside Refresh when supplied. Refresh also
30
+ * answers Alt/Option+R and uses the button to cancel a running request when onCancel is provided;
31
+ * refresh.tooltip overrides its static label. All built-in controls are optional. */
32
+ export declare function AppToolbar({ children, updatedAt, initialLoading, requestState, refresh, live, aboutData, story, end, controlsProps, className, role, 'aria-label': ariaLabel, ...props }: AppToolbarProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type BreakdownItem = {
4
+ id: string;
5
+ label: ReactNode;
6
+ value: number;
7
+ };
8
+ export type BreakdownProps = {
9
+ total: number;
10
+ items: readonly BreakdownItem[];
11
+ formatValue?: (value: number) => ReactNode;
12
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
13
+ /** Mutually exclusive parts of one observed whole. Every share uses the supplied total. */
14
+ 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 { type ButtonProps as AriaButtonProps } from 'react-aria-components';
3
+
4
+ export type ButtonProps = ComponentPropsWithRef<'button'> & {
5
+ variant?: 'elevated' | 'outline' | 'ghost';
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<AriaButtonProps, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
11
+ className?: string;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+
3
+ export type CheckboxProps = {
4
+ label: string;
5
+ description?: ReactNode;
6
+ checked: boolean;
7
+ onChange: (checked: boolean) => void;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ };
11
+ export declare function Checkbox({ label, description, checked, onChange, disabled, className, }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+
2
+ /** IDs are nonempty and unique across ordinary and missing options. */
3
+ export type ComboboxOption = {
4
+ id: string;
5
+ label: string;
6
+ description?: string;
7
+ };
8
+ type SharedProps = {
9
+ label: string;
10
+ options: ComboboxOption[];
11
+ /** Separate source state, rendered last with a divider and the shared option component. */
12
+ missingOption?: ComboboxOption;
13
+ disabled?: boolean;
14
+ placeholder?: string;
15
+ emptyMessage?: string;
16
+ /** Known options remain selectable while refreshing; unavailable selected IDs are retained. */
17
+ loading?: boolean;
18
+ /** Shows failure feedback without removing known options or unavailable selections. */
19
+ error?: boolean;
20
+ onRetry?: () => void;
21
+ };
22
+ export type SingleComboboxProps = SharedProps & {
23
+ value: string;
24
+ onChange: (value: string) => void;
25
+ resetValue?: string;
26
+ values?: never;
27
+ maxSelected?: never;
28
+ emptySelectionLabel?: never;
29
+ };
30
+ export type MultiComboboxProps = SharedProps & {
31
+ values: readonly string[];
32
+ onChange: (values: string[]) => void;
33
+ /** Positive integer; at capacity, only unselected options are disabled. */
34
+ maxSelected: number;
35
+ /** Meaning of an empty selection belongs to the caller, e.g. All or Select a value. */
36
+ emptySelectionLabel: string;
37
+ value?: never;
38
+ resetValue?: never;
39
+ };
40
+ export type ComboboxProps = SingleComboboxProps | MultiComboboxProps;
41
+ /** Searchable selection picker with one focus and popup model for single and multiple values. */
42
+ export declare function Combobox(props: ComboboxProps): import("react").JSX.Element;
43
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type MetricComparison } from './comparison.js';
2
+ import type { MetricDefinition } from './metric.js';
3
+ import type { MetricReading } from '../../core/reading.js';
4
+
5
+ type UnboundComparisonProps = MetricComparison & {
6
+ label: string;
7
+ emphasis?: 'standard' | 'story';
8
+ };
9
+ export type ComparisonVisualProps = UnboundComparisonProps | {
10
+ metric: MetricDefinition;
11
+ reading: MetricReading;
12
+ emphasis?: 'standard' | 'story';
13
+ };
14
+ export declare function ComparisonVisual(props: ComparisonVisualProps): import("react").JSX.Element | null;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+
3
+ export type ContentSkeletonProps = {
4
+ rows?: number;
5
+ variant: 'metric' | 'panel' | 'ranking';
6
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
+ /** A metric, panel, or ranking placeholder to compose in the same layout as live content. */
8
+ export declare function ContentSkeleton({ variant, rows, className, ...props }: ContentSkeletonProps): import("react").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { type ComponentProps, type ReactNode } from 'react';
2
+ import type { DisclosedQuery } from '../../core/contract.js';
3
+ import type { DataAppConfig } from '../../core/config.js';
4
+ import { type AboutEmpty } from './AboutData.js';
5
+ import { AppLayout } from './AppLayout.js';
6
+ import { type AppToolbarProps } from './AppToolbar.js';
7
+ import type { DataContext } from './data-context.js';
8
+ import type { BoundStory } from './story.js';
9
+ import { type SectionResult } from './DataSection.js';
10
+ import type { EmptyStateProps } from './EmptyState.js';
11
+ type DataAppBaseProps = {
12
+ config: DataAppConfig;
13
+ dataContext: DataContext;
14
+ aboutEmpty?: AboutEmpty;
15
+ description?: ReactNode;
16
+ /** Display names only; config.scope remains the connection identity. */
17
+ scopeLabels?: {
18
+ organization?: string;
19
+ environment?: string;
20
+ };
21
+ toolbarActions?: ReactNode;
22
+ footerActions?: ReactNode;
23
+ layoutProps?: Omit<ComponentProps<typeof AppLayout>, 'children' | 'footerActions'>;
24
+ };
25
+ export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
26
+ queries?: DisclosedQuery[];
27
+ refresh?: AppToolbarProps['refresh'];
28
+ empty: Pick<EmptyStateProps, 'title' | 'description'>;
29
+ controls?: ReactNode;
30
+ };
31
+ export type DataAppProps<Data = unknown, Input = unknown> = DataAppBaseProps & ({
32
+ request: DataAppRequest<Data, Input>;
33
+ /** Findings are always derived from the result currently visible to the reader. */
34
+ story?: BoundStory<Data, Input>;
35
+ children: (data: Data, displayedInput: Input) => ReactNode;
36
+ loading?: ReactNode;
37
+ label?: string;
38
+ queries?: never;
39
+ refresh?: never;
40
+ variables?: never;
41
+ } | {
42
+ request?: never;
43
+ story?: never;
44
+ children: ReactNode;
45
+ queries?: DisclosedQuery[];
46
+ refresh?: AppToolbarProps['refresh'];
47
+ variables?: ReactNode;
48
+ loading?: never;
49
+ empty?: never;
50
+ label?: never;
51
+ });
52
+ /** Owns the page title, header, gutter, and width; body content uses section headings.
53
+ * The primary request owns controls, empty state, displayed input, refresh, and inspection.
54
+ * Without a request, the shell accepts authored children for setup or static views. */
55
+ export declare function DataApp<Data, Input>(props: DataAppProps<Data, Input>): import("react").JSX.Element;
56
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ import type { DataView } from '../../core/data-view.js';
4
+ export type DataBoundaryProps<T, Input = unknown> = {
5
+ view: DataView<T, Input>;
6
+ loading: ReactNode;
7
+ empty: ReactNode;
8
+ error: (error: Error) => ReactNode;
9
+ staleError?: (error: Error) => ReactNode;
10
+ notice?: 'inline' | 'none';
11
+ dimOnUpdate?: boolean;
12
+ children: (data: T, displayedInput: Input) => ReactNode;
13
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
14
+ /** Render one request state at a time. Prior content remains readable during an update.
15
+ * Local boundaries can opt into an inline notice and delayed dimming. */
16
+ export declare function DataBoundary<T, Input>({ view, loading, empty, error, staleError, notice, dimOnUpdate, children, className, ...props }: DataBoundaryProps<T, Input>): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import type { DataView } from '../../core/data-view.js';
3
+ import { type EmptyStateProps } from './EmptyState.js';
4
+ type SectionEmpty = Pick<EmptyStateProps, 'title' | 'description'>;
5
+ export type SectionResult<Data, Input> = {
6
+ view: DataView<Data, Input>;
7
+ refetch: () => unknown;
8
+ };
9
+ export type DataSectionProps<Data, Input = unknown> = {
10
+ result: SectionResult<Data, Input>;
11
+ empty: SectionEmpty;
12
+ children: (data: Data, displayedInput: Input) => ReactNode;
13
+ /** Placeholder layout for an initial request; use the ready view's grid without copied values. */
14
+ loading?: ReactNode;
15
+ error?: {
16
+ title: ReactNode;
17
+ description?: ReactNode;
18
+ onRetry?: () => void;
19
+ };
20
+ label?: string;
21
+ /** DataApp suppresses this local notice in favor of its page-level toast. */
22
+ notice?: 'inline' | 'none';
23
+ dimOnUpdate?: boolean;
24
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
25
+ /** One request boundary for any number of cards. `DataBoundary` exposes the lower-level
26
+ * view-state slots for custom composition. */
27
+ export declare function DataSection<Data, Input>({ result, children, empty, loading, error, label, notice, dimOnUpdate, ...props }: DataSectionProps<Data, Input>): import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { type EmptyStateProps } from './EmptyState.js';
3
+ import { type SearchFieldProps } from './SearchField.js';
4
+
5
+ export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue'> & {
6
+ /** Number of available records before filtering or a display limit. */
7
+ itemCount: number;
8
+ };
9
+ export type DataTableProps = ComponentPropsWithRef<'table'> & {
10
+ searchable?: DataTableSearch;
11
+ };
12
+ /** Scrollable native table. Mark quantitative th/td cells with data-type="number";
13
+ * the runtime aligns them to the end and uses tabular digits. */
14
+ export declare function DataTable({ className, ref, searchable, ...props }: DataTableProps): import("react").JSX.Element;
15
+ /** Accepts a fraction of the stated whole, using `formatPercent` semantics. */
16
+ export declare function DataTableShare({ value }: {
17
+ value: number;
18
+ }): import("react").JSX.Element;
19
+ export type DataTableEmptyRowProps = Pick<EmptyStateProps, 'title' | 'description'> & {
20
+ colSpan: number;
21
+ };
22
+ export declare function DataTableEmptyRow({ colSpan, title, description, }: DataTableEmptyRowProps): import("react").JSX.Element;
23
+ export type DataTableTimestampProps = {
24
+ value: string | Date;
25
+ children?: ReactNode;
26
+ timeZone?: string;
27
+ };
28
+ export declare function DataTableTimestamp({ value, children, timeZone, }: DataTableTimestampProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { DataView } from '../../core/data-view.js';
3
+
4
+ export type DataViewToastProps<Data, Input> = {
5
+ view: DataView<Data, Input>;
6
+ message?: ReactNode;
7
+ notice?: ReactNode;
8
+ onRetry?: () => void;
9
+ };
10
+ /** One page-level refresh status. Updating waits briefly; a failed refresh waits
11
+ * long enough to avoid interrupting the displayed result before showing retry. */
12
+ export declare function DataViewToast<Data, Input>({ view, message, notice, onRetry, }: DataViewToastProps<Data, Input>): import("react").JSX.Element | null;
@@ -0,0 +1,39 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ import type { DataReading } from '../../core/reading.js';
3
+ import { type WidgetStatus } from './RequestHint.js';
4
+ import { type ContentSkeletonProps } from './ContentSkeleton.js';
5
+ import { type EmptyStateProps } from './EmptyState.js';
6
+ import type { WidgetEvidence } from './WidgetEvidence.js';
7
+
8
+
9
+ type Empty = Pick<EmptyStateProps, 'title' | 'description'>;
10
+ type DataWidgetBaseProps = {
11
+ title: ReactNode;
12
+ count?: number;
13
+ description?: ReactNode;
14
+ evidence?: WidgetEvidence;
15
+ action?: ReactNode;
16
+ /** Reserved feedback slot; retain displayed content while refreshing or after failure. */
17
+ status?: WidgetStatus;
18
+ footer?: ReactNode;
19
+ bodyPadding?: 'inset' | 'flush';
20
+ } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
21
+ /** Owns loading, empty content, actions, and inspection. Page and sheet mount the same
22
+ * body and footer; hold interactive child state above the widget to share it across mounts.
23
+ * A bound reading requires evidence; its child renderer runs only for nonempty ready data. */
24
+ export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ({
25
+ reading: DataReading<Data>;
26
+ isEmpty: (data: Data) => boolean;
27
+ empty: Empty;
28
+ evidence: WidgetEvidence;
29
+ skeleton?: Pick<ContentSkeletonProps, 'variant' | 'rows'>;
30
+ children: (data: Data) => ReactNode;
31
+ } | {
32
+ reading?: never;
33
+ isEmpty?: never;
34
+ skeleton?: never;
35
+ empty?: Empty;
36
+ children: ReactNode;
37
+ });
38
+ export declare function DataWidget<Data>(props: DataWidgetProps<Data>): import("react").JSX.Element;
39
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type ComponentProps, type ReactNode } from 'react';
2
+ import { type CalendarDate } from '@internationalized/date';
3
+ import { DateRangePicker as AriaDateRangePicker } from 'react-aria-components';
4
+
5
+ import { type DatePresetId, type DateRange } from '../../core/date-range.js';
6
+ export type { DatePresetId, DateRange } from '../../core/date-range.js';
7
+ export type DateRangePickerProps = {
8
+ label?: string;
9
+ value: DateRange | null;
10
+ onChange: (range: DateRange | null) => void;
11
+ minDate?: string;
12
+ maxDate?: string;
13
+ maxRangeDays?: number;
14
+ timeZone?: string;
15
+ /** Used to display the reset affordance. The app variable owns the URL and reset meaning. */
16
+ resetValue?: DateRange;
17
+ isDefault?: boolean;
18
+ onReset?: () => void;
19
+ onPresetChange?: (id: DatePresetId) => void;
20
+ selectedPresetId?: DatePresetId | null;
21
+ calendarFooter?: ReactNode;
22
+ comparison?: {
23
+ enabled: boolean;
24
+ range: DateRange | null;
25
+ onChange: (enabled: boolean) => void;
26
+ };
27
+ } & Omit<ComponentProps<typeof AriaDateRangePicker<CalendarDate>>, 'children' | 'value' | 'onChange' | 'minValue' | 'maxValue' | 'isOpen' | 'onOpenChange' | 'defaultValue' | 'defaultOpen'>;
28
+ /** The app owns URL state; `dateRangeControl` binds a date variable to this picker. */
29
+ export declare function DateRangePicker({ label, 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
+
4
+ export type DateTimeTooltipProps = {
5
+ date: Date;
6
+ timeZone?: string;
7
+ children?: ReactNode;
8
+ } & Omit<HelpPopoverProps, 'trigger' | 'triggerLabel' | 'label' | 'children'>;
9
+ /** Pass the viewer's account time zone when known; the popover also exposes UTC and Unix time. */
10
+ export declare function DateTimeTooltip({ date, timeZone, children, triggerClassName, panelClassName, ...props }: DateTimeTooltipProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { DimensionOption, DimensionSelection, DimensionValue, DimensionVariable } from '../../core/dimension.js';
2
+ /** Adapts the typed dimension contract to the shared Combobox control. */
3
+ export declare function DimensionPicker<T extends DimensionValue>({ filter, value, onChange, options: suppliedOptions, loading, error, onRetry, }: {
4
+ filter: DimensionVariable<T>;
5
+ value: DimensionSelection<T>;
6
+ onChange: (value: DimensionSelection<T>) => void;
7
+ options?: readonly DimensionOption<T>[];
8
+ loading?: boolean;
9
+ error?: boolean;
10
+ onRetry?: () => void;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type EmptyStateProps = {
4
+ title: ReactNode;
5
+ description?: ReactNode;
6
+ variant?: 'visual' | 'table';
7
+ className?: string;
8
+ };
9
+ export declare function EmptyState({ title, description, variant, className, }: EmptyStateProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { DataAppConfig } from '../../core/config.js';
2
+ import type { DataContext } from './data-context.js';
3
+
4
+ /** Query-backed connection state and next steps for a newly created app. Mount within
5
+ * `DataAppProvider` and register `connection: connectionCheck()` on the server. */
6
+ export declare function GettingStarted({ config, dataContext, }: {
7
+ config: DataAppConfig;
8
+ dataContext: DataContext;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { GlossaryEntry } from './data-context.js';
3
+
4
+ export type GlossaryDefinitionProps = {
5
+ entry: GlossaryEntry;
6
+ children?: ReactNode;
7
+ };
8
+ export declare function GlossaryDefinition({ entry, children, }: GlossaryDefinitionProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import type { DisclosedQuery } from '../../core/contract.js';
3
+ import type { DataContext, GlossaryEntry } from './data-context.js';
4
+ import { type AboutEmpty } from './AboutData.js';
5
+
6
+ export type GlossaryExplanationProps = {
7
+ entry: GlossaryEntry;
8
+ empty?: AboutEmpty;
9
+ title?: ReactNode;
10
+ description?: ReactNode;
11
+ visual?: ReactNode;
12
+ queries?: DisclosedQuery[];
13
+ dataContext?: DataContext;
14
+ } & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
15
+ /** Opens the inspect sheet for one glossary term. Prefer a card's evidence slot
16
+ * when the surface already has a title, description, and visual. */
17
+ export declare function GlossaryExplanation({ entry, empty, title, description, visual, queries, dataContext, className, ...props }: GlossaryExplanationProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+
3
+ export type GradientScrollProps = ComponentPropsWithRef<'div'> & {
4
+ axis?: 'vertical' | 'horizontal';
5
+ /** Disable the start fade when sticky controls share the scrollport. */
6
+ fadeStart?: boolean;
7
+ };
8
+ type ScrollMetrics = Pick<HTMLElement, 'scrollTop' | 'scrollHeight' | 'clientHeight' | 'scrollLeft' | 'scrollWidth' | 'clientWidth'>;
9
+ /** The visible edges that still have content beyond them. */
10
+ export declare function scrollFadeEdges(metrics: ScrollMetrics, axis: 'vertical' | 'horizontal'): {
11
+ start: boolean;
12
+ end: boolean;
13
+ };
14
+ /** Fades only scrollable edges; content, size, and scroll changes update the mask. */
15
+ export declare function GradientScroll({ axis, fadeStart, className, children, ref, ...props }: GradientScrollProps): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+
3
+ export type GridProps = {
4
+ children: ReactNode;
5
+ /** Maximum columns; cards wrap sooner when the container cannot fit their minimum width. */
6
+ columns?: 1 | 2 | 3 | 4;
7
+ minItemWidth?: 'compact' | 'regular' | 'wide';
8
+ gap?: 'sm' | 'md' | 'lg';
9
+ /** Stretch peer cards to the tallest item in their row only when needed. */
10
+ align?: 'stretch' | 'start';
11
+ } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
12
+ /** Responsive layout for peer cards and panels. Cards keep their content height by default. */
13
+ export declare function Grid({ children, columns, minItemWidth, gap, align, className, ...props }: GridProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef, 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;