@altertable/data-app 0.61.0 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/AGENTS.md +4 -32
  2. package/CONTRIBUTING.md +63 -72
  3. package/README.md +14 -38
  4. package/dist/chunks/{contract-d9skd1n7.js → contract-8wdybxj7.js} +163 -16
  5. package/dist/chunks/contract-8wdybxj7.js.map +13 -0
  6. package/dist/chunks/{contract-ryyf6dme.js → contract-cxr9t12b.js} +2 -5
  7. package/dist/chunks/contract-cxr9t12b.js.map +10 -0
  8. package/dist/chunks/{contract-14vxdcrs.js → contract-farfe948.js} +17 -21
  9. package/dist/chunks/contract-farfe948.js.map +10 -0
  10. package/dist/chunks/contract-mev09s5v.js.map +2 -2
  11. package/dist/chunks/{contract-ehk50k7e.js → contract-tf8c3qpv.js} +34 -4
  12. package/dist/chunks/contract-tf8c3qpv.js.map +11 -0
  13. package/dist/chunks/{contract-zr4s2g7m.js → contract-tkc552ze.js} +75 -36
  14. package/dist/chunks/contract-tkc552ze.js.map +12 -0
  15. package/dist/chunks/{contract-nt819swq.js → contract-wd8qe3mt.js} +6 -1
  16. package/dist/chunks/{contract-nt819swq.js.map → contract-wd8qe3mt.js.map} +3 -3
  17. package/dist/chunks/contract-wz59z8pq.js.map +1 -1
  18. package/dist/chunks/{contract-7gpsee0v.js → contract-zr3jd7mr.js} +51 -22
  19. package/dist/chunks/contract-zr3jd7mr.js.map +12 -0
  20. package/dist/client/index.js +7 -6
  21. package/dist/client/index.js.map +1 -1
  22. package/dist/core/appearance.js +1 -1
  23. package/dist/core/contract.js +6 -4
  24. package/dist/core/contract.js.map +1 -1
  25. package/dist/embed/index.js +41 -9
  26. package/dist/embed/index.js.map +5 -4
  27. package/dist/local.js +172 -84
  28. package/dist/local.js.map +7 -8
  29. package/dist/react/embed/index.js +83 -99
  30. package/dist/react/embed/index.js.map +4 -5
  31. package/dist/react/index.js +5701 -324
  32. package/dist/react/index.js.map +74 -65
  33. package/dist/server.js +153 -81
  34. package/dist/server.js.map +6 -7
  35. package/dist/types/client/data-client.d.ts +33 -0
  36. package/dist/types/client/iframe.d.ts +14 -0
  37. package/dist/types/client/index.d.ts +4 -34
  38. package/dist/types/client/location.d.ts +4 -6
  39. package/dist/types/client/navigation.d.ts +2 -1
  40. package/dist/types/core/appearance.d.ts +7 -6
  41. package/dist/types/core/bridge.d.ts +2 -8
  42. package/dist/types/core/config.d.ts +1 -1
  43. package/dist/types/core/contract.d.ts +9 -56
  44. package/dist/types/core/format.d.ts +0 -1
  45. package/dist/types/core/messages.d.ts +11 -30
  46. package/dist/types/core/navigation.d.ts +11 -0
  47. package/dist/types/core/operation-types.d.ts +76 -0
  48. package/dist/types/core/operation.d.ts +21 -0
  49. package/dist/types/core/presentation.d.ts +7 -0
  50. package/dist/types/core/variables.d.ts +2 -2
  51. package/dist/types/embed/bridge.d.ts +12 -0
  52. package/dist/types/embed/host.d.ts +14 -5
  53. package/dist/types/embed/index.d.ts +6 -4
  54. package/dist/types/embed/source.d.ts +15 -0
  55. package/dist/types/embed/sql.d.ts +4 -0
  56. package/dist/types/react/content.d.ts +3 -3
  57. package/dist/types/react/embed/bridge.d.ts +19 -10
  58. package/dist/types/react/embed/index.d.ts +0 -2
  59. package/dist/types/react/hooks.d.ts +65 -64
  60. package/dist/types/react/index.d.ts +135 -2
  61. package/dist/types/react/injectStyles.d.ts +7 -0
  62. package/dist/types/react/shellStyles.d.ts +3 -0
  63. package/dist/types/react/styles.d.ts +8 -0
  64. package/dist/types/react/ui/AboutData.d.ts +0 -1
  65. package/dist/types/react/ui/AppFooter.d.ts +0 -1
  66. package/dist/types/react/ui/AppHeader.d.ts +0 -1
  67. package/dist/types/react/ui/AppLayout.d.ts +0 -1
  68. package/dist/types/react/ui/AppScope.d.ts +0 -1
  69. package/dist/types/react/ui/AppToolbar.d.ts +0 -1
  70. package/dist/types/react/ui/Breakdown.d.ts +0 -1
  71. package/dist/types/react/ui/Button.d.ts +0 -1
  72. package/dist/types/react/ui/Checkbox.d.ts +0 -1
  73. package/dist/types/react/ui/Combobox.d.ts +0 -1
  74. package/dist/types/react/ui/ComparisonVisual.d.ts +0 -1
  75. package/dist/types/react/ui/ContentSkeleton.d.ts +2 -5
  76. package/dist/types/react/ui/DataApp.d.ts +2 -2
  77. package/dist/types/react/ui/DataAppSkeleton.d.ts +7 -0
  78. package/dist/types/react/ui/DataBoundary.d.ts +0 -1
  79. package/dist/types/react/ui/DataSection.d.ts +2 -4
  80. package/dist/types/react/ui/DataTable.d.ts +2 -3
  81. package/dist/types/react/ui/DataViewToast.d.ts +0 -1
  82. package/dist/types/react/ui/DataWidget.d.ts +4 -14
  83. package/dist/types/react/ui/DateRangePicker.d.ts +0 -1
  84. package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -1
  85. package/dist/types/react/ui/EmptyState.d.ts +2 -5
  86. package/dist/types/react/ui/GettingStarted.d.ts +0 -1
  87. package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -1
  88. package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -1
  89. package/dist/types/react/ui/GradientScroll.d.ts +0 -1
  90. package/dist/types/react/ui/Grid.d.ts +0 -1
  91. package/dist/types/react/ui/HelpPopover.d.ts +0 -2
  92. package/dist/types/react/ui/Kbd.d.ts +0 -1
  93. package/dist/types/react/ui/LiveControl.d.ts +0 -1
  94. package/dist/types/react/ui/MetricWidget.d.ts +0 -2
  95. package/dist/types/react/ui/PeriodSummary.d.ts +0 -1
  96. package/dist/types/react/ui/PresentStory.d.ts +0 -1
  97. package/dist/types/react/ui/QueryList.d.ts +0 -1
  98. package/dist/types/react/ui/Ranking.d.ts +0 -1
  99. package/dist/types/react/ui/RefreshControl.d.ts +0 -1
  100. package/dist/types/react/ui/RefreshRegion.d.ts +0 -1
  101. package/dist/types/react/ui/RequestHint.d.ts +0 -1
  102. package/dist/types/react/ui/SearchField.d.ts +0 -1
  103. package/dist/types/react/ui/SearchInput.d.ts +1 -2
  104. package/dist/types/react/ui/SearchMatch.d.ts +0 -1
  105. package/dist/types/react/ui/SelectableBarChart.d.ts +0 -1
  106. package/dist/types/react/ui/SelectionMark.d.ts +0 -1
  107. package/dist/types/react/ui/Sheet.d.ts +0 -1
  108. package/dist/types/react/ui/Skeleton.d.ts +0 -1
  109. package/dist/types/react/ui/Stack.d.ts +0 -1
  110. package/dist/types/react/ui/StatusPanel.d.ts +0 -1
  111. package/dist/types/react/ui/TableWidget.d.ts +2 -3
  112. package/dist/types/react/ui/Tabs.d.ts +0 -1
  113. package/dist/types/react/ui/TextContent.d.ts +4 -0
  114. package/dist/types/react/ui/TextWidget.d.ts +19 -0
  115. package/dist/types/react/ui/ThemeSelector.d.ts +0 -1
  116. package/dist/types/react/ui/Tooltip.d.ts +0 -1
  117. package/dist/types/react/ui/UpdatedAt.d.ts +0 -1
  118. package/dist/types/react/ui/VariableBar.d.ts +0 -1
  119. package/dist/types/react/ui/VisualizationWidget.d.ts +5 -13
  120. package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -1
  121. package/dist/types/react/ui/WidgetViewTabs.d.ts +2 -3
  122. package/dist/types/react/ui/data-identifiers.d.ts +0 -1
  123. package/dist/types/react/ui/presentation.d.ts +19 -0
  124. package/dist/types/react/ui/useAppAppearance.d.ts +3 -0
  125. package/dist/types/react/ui/useDataAppPresentation.d.ts +3 -0
  126. package/dist/types/react/view-controls.d.ts +2 -2
  127. package/dist/types/react/view.d.ts +2 -2
  128. package/dist/{bootstrap.js → worker.js} +144 -12
  129. package/docs/app-authoring.md +60 -24
  130. package/docs/client.md +48 -19
  131. package/docs/contract.md +10 -10
  132. package/docs/embed.md +94 -26
  133. package/docs/hosted-apps.md +39 -0
  134. package/docs/local-data-apps.md +14 -0
  135. package/docs/react-embed.md +75 -24
  136. package/docs/react.md +118 -93
  137. package/docs/server-bun.md +4 -1
  138. package/docs/server.md +2 -2
  139. package/docs/worker.md +55 -0
  140. package/examples/starter-data-app/index.tsx +159 -0
  141. package/package.json +18 -12
  142. package/dist/chunks/contract-14vxdcrs.js.map +0 -10
  143. package/dist/chunks/contract-7gpsee0v.js.map +0 -11
  144. package/dist/chunks/contract-d9skd1n7.js.map +0 -12
  145. package/dist/chunks/contract-ehk50k7e.js.map +0 -10
  146. package/dist/chunks/contract-ryyf6dme.js.map +0 -10
  147. package/dist/chunks/contract-zr4s2g7m.js.map +0 -12
  148. package/dist/react/index.css +0 -4478
  149. package/dist/react.css.d.ts +0 -1
  150. package/dist/types/embed/shell.d.ts +0 -21
  151. package/dist/types/embed/standalone.d.ts +0 -1
  152. package/dist/types/react/embed/shell.d.ts +0 -10
  153. package/dist/types/react/ui/index.d.ts +0 -129
  154. package/docs/appearance.md +0 -30
  155. package/docs/bootstrap.md +0 -76
  156. package/docs/config.md +0 -21
  157. package/docs/format.md +0 -29
  158. package/docs/react-styles.md +0 -17
  159. package/docs/starter-agent-instructions.md +0 -53
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type AppScopeProps = {
4
3
  organization: string;
5
4
  environment: string;
@@ -3,7 +3,6 @@ import type { DataView } from '../../core/data-view.js';
3
3
  import { type LiveControlProps } from './LiveControl.js';
4
4
  import { PresentStory } from './PresentStory.js';
5
5
  import { RefreshControl } from './RefreshControl.js';
6
-
7
6
  export type AppToolbarProps = {
8
7
  children?: ReactNode;
9
8
  end?: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type BreakdownItem = {
4
3
  id: string;
5
4
  label: ReactNode;
@@ -1,6 +1,5 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
2
  import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
3
-
4
3
  export type ButtonProps = ComponentPropsWithRef<'button'> & {
5
4
  variant?: 'elevated' | 'outline' | 'ghost';
6
5
  size?: 'default' | 'compact' | 'icon' | 'icon-compact';
@@ -1,5 +1,4 @@
1
1
  import { type ReactNode } from 'react';
2
-
3
2
  export type CheckboxProps = {
4
3
  label: string;
5
4
  description?: ReactNode;
@@ -1,4 +1,3 @@
1
-
2
1
  /** IDs are nonempty and unique across ordinary and missing options. */
3
2
  export type ComboboxOption = {
4
3
  id: string;
@@ -1,7 +1,6 @@
1
1
  import { type MetricComparison } from './comparison.js';
2
2
  import type { MetricDefinition } from './metric.js';
3
3
  import type { MetricReading } from '../../core/reading.js';
4
-
5
4
  type UnboundComparisonProps = MetricComparison & {
6
5
  label: string;
7
6
  emphasis?: 'standard' | 'story';
@@ -1,8 +1,5 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
-
3
- export type ContentSkeletonProps = {
4
- rows?: number;
5
- variant: 'metric' | 'panel' | 'ranking';
6
- } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
2
+ import type { SkeletonContent } from './presentation.js';
3
+ export type ContentSkeletonProps = SkeletonContent & Omit<ComponentPropsWithRef<'div'>, 'children'>;
7
4
  /** A metric, panel, or ranking placeholder to compose in the same layout as live content. */
8
5
  export declare function ContentSkeleton({ variant, rows, className, ...props }: ContentSkeletonProps): import("react").JSX.Element;
@@ -7,7 +7,7 @@ import { type AppToolbarProps } from './AppToolbar.js';
7
7
  import type { DataContext } from './data-context.js';
8
8
  import type { BoundStory } from './story.js';
9
9
  import { type SectionResult } from './DataSection.js';
10
- import type { EmptyStateProps } from './EmptyState.js';
10
+ import type { EmptyContent } from './presentation.js';
11
11
  type DataAppBaseProps = {
12
12
  config: DataAppConfig;
13
13
  dataContext: DataContext;
@@ -25,7 +25,7 @@ type DataAppBaseProps = {
25
25
  export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
26
26
  queries?: DisclosedQuery[];
27
27
  refresh?: AppToolbarProps['refresh'];
28
- empty: Pick<EmptyStateProps, 'title' | 'description'>;
28
+ empty: EmptyContent;
29
29
  controls?: ReactNode;
30
30
  };
31
31
  export type DataAppProps<Data = unknown, Input = unknown> = DataAppBaseProps & ({
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export type DataAppSkeletonProps = Omit<ComponentPropsWithRef<'output'>, 'children' | 'role' | 'aria-busy'> & {
3
+ header?: ReactNode;
4
+ footer?: ReactNode;
5
+ };
6
+ /** Host-side placeholder while a data app starts. Header and footer slots remain host-owned; widget placeholders are decorative. */
7
+ export declare function DataAppSkeleton({ header, footer, className, ...props }: DataAppSkeletonProps): import("react").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  import type { DataView } from '../../core/data-view.js';
4
3
  export type DataBoundaryProps<T, Input = unknown> = {
5
4
  view: DataView<T, Input>;
@@ -1,14 +1,13 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import type { DataView } from '../../core/data-view.js';
3
- import { type EmptyStateProps } from './EmptyState.js';
4
- type SectionEmpty = Pick<EmptyStateProps, 'title' | 'description'>;
3
+ import type { EmptyContent } from './presentation.js';
5
4
  export type SectionResult<Data, Input> = {
6
5
  view: DataView<Data, Input>;
7
6
  refetch: () => unknown;
8
7
  };
9
8
  export type DataSectionProps<Data, Input = unknown> = {
10
9
  result: SectionResult<Data, Input>;
11
- empty: SectionEmpty;
10
+ empty: EmptyContent;
12
11
  children: (data: Data, displayedInput: Input) => ReactNode;
13
12
  /** Placeholder layout for an initial request; use the ready view's grid without copied values. */
14
13
  loading?: ReactNode;
@@ -25,4 +24,3 @@ export type DataSectionProps<Data, Input = unknown> = {
25
24
  /** One request boundary for any number of cards. `DataBoundary` exposes the lower-level
26
25
  * view-state slots for custom composition. */
27
26
  export declare function DataSection<Data, Input>({ result, children, empty, loading, error, label, notice, dimOnUpdate, ...props }: DataSectionProps<Data, Input>): import("react").JSX.Element;
28
- export {};
@@ -1,7 +1,6 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
- import { type EmptyStateProps } from './EmptyState.js';
2
+ import type { EmptyContent } from './presentation.js';
3
3
  import { type SearchFieldProps } from './SearchField.js';
4
-
5
4
  export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue'> & {
6
5
  /** Number of available records before filtering or a display limit. */
7
6
  itemCount: number;
@@ -16,7 +15,7 @@ export declare function DataTable({ className, ref, searchable, ...props }: Data
16
15
  export declare function DataTableShare({ value }: {
17
16
  value: number;
18
17
  }): import("react").JSX.Element;
19
- export type DataTableEmptyRowProps = Pick<EmptyStateProps, 'title' | 'description'> & {
18
+ export type DataTableEmptyRowProps = EmptyContent & {
20
19
  colSpan: number;
21
20
  };
22
21
  export declare function DataTableEmptyRow({ colSpan, title, description, }: DataTableEmptyRowProps): import("react").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { DataView } from '../../core/data-view.js';
3
-
4
3
  export type DataViewToastProps<Data, Input> = {
5
4
  view: DataView<Data, Input>;
6
5
  message?: ReactNode;
@@ -1,12 +1,7 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
- import type { DataReading } from '../../core/reading.js';
3
2
  import { type WidgetStatus } from './RequestHint.js';
4
- import { type ContentSkeletonProps } from './ContentSkeleton.js';
5
- import { type EmptyStateProps } from './EmptyState.js';
3
+ import type { EmptyContent, BoundWidgetReading } from './presentation.js';
6
4
  import type { WidgetEvidence } from './WidgetEvidence.js';
7
-
8
-
9
- type Empty = Pick<EmptyStateProps, 'title' | 'description'>;
10
5
  type DataWidgetBaseProps = {
11
6
  title: ReactNode;
12
7
  count?: number;
@@ -21,18 +16,13 @@ type DataWidgetBaseProps = {
21
16
  /** Owns loading, empty content, actions, and inspection. Page and sheet mount the same
22
17
  * body and footer; hold interactive child state above the widget to share it across mounts.
23
18
  * A bound reading requires evidence; its child renderer runs only for nonempty ready data. */
24
- export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ({
25
- reading: DataReading<Data>;
26
- isEmpty: (data: Data) => boolean;
27
- empty: Empty;
28
- evidence: WidgetEvidence;
29
- skeleton?: Pick<ContentSkeletonProps, 'variant' | 'rows'>;
19
+ export type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ((BoundWidgetReading<Data> & {
30
20
  children: (data: Data) => ReactNode;
31
- } | {
21
+ }) | {
32
22
  reading?: never;
33
23
  isEmpty?: never;
34
24
  skeleton?: never;
35
- empty?: Empty;
25
+ empty?: EmptyContent;
36
26
  children: ReactNode;
37
27
  });
38
28
  export declare function DataWidget<Data>(props: DataWidgetProps<Data>): import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { type ComponentProps, type ReactNode } from 'react';
2
2
  import { type CalendarDate } from '@internationalized/date';
3
3
  import { DateRangePicker as AriaDateRangePicker } from 'react-aria-components';
4
-
5
4
  import { type DatePresetId, type DateRange } from '../../core/date-range.js';
6
5
  export type { DatePresetId, DateRange } from '../../core/date-range.js';
7
6
  export type DateRangePickerProps = {
@@ -1,6 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type HelpPopoverProps } from './HelpPopover.js';
3
-
4
3
  export type DateTimeTooltipProps = {
5
4
  date: Date;
6
5
  timeZone?: string;
@@ -1,8 +1,5 @@
1
- import type { ReactNode } from 'react';
2
-
3
- export type EmptyStateProps = {
4
- title: ReactNode;
5
- description?: ReactNode;
1
+ import type { EmptyContent } from './presentation.js';
2
+ export type EmptyStateProps = EmptyContent & {
6
3
  variant?: 'visual' | 'table';
7
4
  className?: string;
8
5
  };
@@ -1,6 +1,5 @@
1
1
  import type { DataAppConfig } from '../../core/config.js';
2
2
  import type { DataContext } from './data-context.js';
3
-
4
3
  /** Query-backed connection state and next steps for a newly created app. Mount within
5
4
  * `DataAppProvider` and register `connection: connectionCheck()` on the server. */
6
5
  export declare function GettingStarted({ config, dataContext, }: {
@@ -1,6 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { GlossaryEntry } from './data-context.js';
3
-
4
3
  export type GlossaryDefinitionProps = {
5
4
  entry: GlossaryEntry;
6
5
  children?: ReactNode;
@@ -2,7 +2,6 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import type { DisclosedQuery } from '../../core/contract.js';
3
3
  import type { DataContext, GlossaryEntry } from './data-context.js';
4
4
  import { type AboutEmpty } from './AboutData.js';
5
-
6
5
  export type GlossaryExplanationProps = {
7
6
  entry: GlossaryEntry;
8
7
  empty?: AboutEmpty;
@@ -1,5 +1,4 @@
1
1
  import { type ComponentPropsWithRef } from 'react';
2
-
3
2
  export type GradientScrollProps = ComponentPropsWithRef<'div'> & {
4
3
  axis?: 'vertical' | 'horizontal';
5
4
  /** Disable the start fade when sticky controls share the scrollport. */
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type GridProps = {
4
3
  children: ReactNode;
5
4
  /** Maximum columns; cards wrap sooner when the container cannot fit their minimum width. */
@@ -1,7 +1,5 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
2
  import { type Placement } from '@floating-ui/react';
3
-
4
-
5
3
  export type HelpPopoverTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'>;
6
4
  export type HelpPopoverPanelProps = Omit<ComponentPropsWithRef<'section'>, 'children' | 'role'>;
7
5
  export type HelpPopoverProps = {
@@ -1,6 +1,5 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
2
  import { type Shortcut } from './shortcuts.js';
3
-
4
3
  export type KbdProps = ComponentPropsWithRef<'kbd'> & {
5
4
  shortcut?: Shortcut;
6
5
  };
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
-
3
2
  export type LiveIntervalSeconds = 30 | 60 | 300;
4
3
  export type LiveControlProps = {
5
4
  enabled: boolean;
@@ -5,8 +5,6 @@ import { type MetricComparison } from './comparison.js';
5
5
  import { type MetricFormat } from '../../core/format.js';
6
6
  import type { MetricReading } from '../../core/reading.js';
7
7
  import { type MetricDefinition } from './metric.js';
8
-
9
-
10
8
  type MetricWidgetBaseProps = {
11
9
  label: string;
12
10
  description?: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import type { ReportingPeriod } from '../../core/contract.js';
2
-
3
2
  export type { ReportingPeriod } from '../../core/contract.js';
4
3
  export type PeriodComparison = {
5
4
  kind: 'previous';
@@ -3,7 +3,6 @@ import type { ThemeController } from '../../core/appearance.js';
3
3
  import { type AboutEmpty } from './AboutData.js';
4
4
  import type { DataContext } from './data-context.js';
5
5
  import { type StoryFinding } from './story.js';
6
-
7
6
  export type StoryStep = {
8
7
  id: string;
9
8
  empty?: AboutEmpty;
@@ -1,6 +1,5 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
2
  import type { DisclosedQuery } from '../../core/contract.js';
3
-
4
3
  export type QueryListProps = {
5
4
  queries?: DisclosedQuery[];
6
5
  names?: string[];
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type RankingItem = {
4
3
  id: string;
5
4
  label: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
-
3
2
  export type RefreshControlProps = {
4
3
  refreshing: boolean;
5
4
  children: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type RefreshRegionProps = {
4
3
  refreshing: boolean;
5
4
  dimOnUpdate?: boolean;
@@ -1,4 +1,3 @@
1
-
2
1
  /** Idle keeps the same reserved space as refresh and failure. Initial loading belongs to skeletons. */
3
2
  export type WidgetStatus = {
4
3
  kind: 'idle';
@@ -1,5 +1,4 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
-
3
2
  export type SearchFieldProps = {
4
3
  label: string;
5
4
  value: string;
@@ -1,7 +1,6 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  /** One search control surface for picker search and table/page search. */
4
- export declare function SearchInput({ size, endAction, loading, className, ...props }: Omit<ComponentPropsWithRef<'input'>, 'size' | 'children'> & {
3
+ export declare function SearchInput({ size, endAction, loading, className, onKeyDown, ...props }: Omit<ComponentPropsWithRef<'input'>, 'size' | 'children'> & {
5
4
  size?: 'default' | 'compact';
6
5
  endAction?: ReactNode;
7
6
  /** Replaces the search glyph in its existing space; input and results remain usable. */
@@ -1,6 +1,5 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
2
  import type { SearchMatchValue } from './searchItems.js';
3
-
4
3
  export type SearchMatchProps = {
5
4
  match: SearchMatchValue;
6
5
  } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
@@ -1,4 +1,3 @@
1
-
2
1
  export type SelectableBarItem = {
3
2
  id: string;
4
3
  label: string;
@@ -1,4 +1,3 @@
1
-
2
1
  /** Decorative selection indicator; the containing control owns its accessible semantics. */
3
2
  export declare function SelectionMark({ selected }: {
4
3
  selected: boolean;
@@ -1,5 +1,4 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
-
3
2
  export type SheetDialogProps = Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'open' | 'title' | 'aria-labelledby'>;
4
3
  export type SheetProps = {
5
4
  open: boolean;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
-
3
2
  export type SkeletonProps = Omit<ComponentPropsWithRef<'span'>, 'children' | 'aria-hidden'>;
4
3
  /** Decorative loading placeholder that fades in only when loading takes a moment.
5
4
  * Put the accessible status on its container. */
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type StackProps = {
4
3
  children: ReactNode;
5
4
  gap?: 'sm' | 'md' | 'lg';
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type StatusPanelProps = {
4
3
  status: 'loading' | 'empty' | 'error';
5
4
  title: ReactNode;
@@ -2,10 +2,9 @@ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
2
  import type { WidgetEvidence } from './WidgetEvidence.js';
3
3
  import type { WidgetStatus } from './RequestHint.js';
4
4
  import { type DataTableSearch } from './DataTable.js';
5
- import type { EmptyStateProps } from './EmptyState.js';
5
+ import type { EmptyContent } from './presentation.js';
6
6
  import { type SearchHit, type SearchItemsOptions } from './searchItems.js';
7
7
  import type { DataReading } from '../../core/reading.js';
8
-
9
8
  export type TableWidgetColumn<Row> = {
10
9
  /** Stable, nonempty identity; unique within this table. */
11
10
  id: string;
@@ -28,7 +27,7 @@ type TableWidgetBaseProps<Row> = {
28
27
  evidence?: WidgetEvidence;
29
28
  search?: TableWidgetSearch<Row>;
30
29
  /** Valid result with no rows; the header remains visible. */
31
- empty: Pick<EmptyStateProps, 'title' | 'description'>;
30
+ empty: EmptyContent;
32
31
  } & ({
33
32
  /** Positive integer preview cap after search; disables pagination. */
34
33
  limit: number;
@@ -1,5 +1,4 @@
1
1
  import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'react-aria-components/Tabs';
2
-
3
2
  /** React Aria tabs with keyboard and ARIA behavior; pair each Tab and TabPanel by stable id. */
4
3
  export { Tabs, TabList, Tab, TabPanels, TabPanel };
5
4
  /** Keep a page-level tab in `?view=`; reserve `?tab=` for the inspect sheet. */
@@ -0,0 +1,4 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ export type TextContentProps = ComponentPropsWithRef<'div'>;
3
+ /** Prose typography for page introductions, widget bodies, and inspection content. */
4
+ export declare function TextContent({ className, ...props }: TextContentProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DataReading } from '../../core/reading.js';
3
+ import { type DataWidgetProps } from './DataWidget.js';
4
+ import type { WidgetEvidence } from './WidgetEvidence.js';
5
+ type TextWidgetBaseProps = Omit<Extract<DataWidgetProps, {
6
+ reading?: never;
7
+ }>, 'reading' | 'children' | 'isEmpty' | 'empty' | 'skeleton' | 'bodyPadding'>;
8
+ /** Framed narrative context. Bind claims and scope to the same displayed reading.
9
+ * The renderer handles every ready value, including zero and empty collections. */
10
+ export type TextWidgetProps<Data = unknown> = TextWidgetBaseProps & ({
11
+ reading: DataReading<Data>;
12
+ evidence: WidgetEvidence;
13
+ children: (data: Data) => ReactNode;
14
+ } | {
15
+ reading?: never;
16
+ children: ReactNode;
17
+ });
18
+ export declare function TextWidget<Data>(props: TextWidgetProps<Data>): import("react").JSX.Element;
19
+ export {};
@@ -1,6 +1,5 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
2
  import type { ThemeController } from '../../core/appearance.js';
3
-
4
3
  export type ThemeSelectorProps = {
5
4
  theme: ThemeController;
6
5
  children?: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode, type RefObject } from 'react';
2
-
3
2
  export type TooltipProviderProps = {
4
3
  children: ReactNode;
5
4
  delay?: number;
@@ -1,6 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type DateTimeTooltipProps } from './DateTimeTooltip.js';
3
-
4
3
  export type UpdatedAtProps = {
5
4
  timestamp: number;
6
5
  locale?: string;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type VariableBarProps = {
4
3
  children: ReactNode;
5
4
  } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
@@ -1,18 +1,15 @@
1
1
  import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
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
-
3
+ import type { WidgetStatus } from './RequestHint.js';
4
+ import type { EmptyContent, BoundWidgetReading } from './presentation.js';
8
5
  type VisualizationWidgetBaseProps = {
9
6
  title: ReactNode;
10
7
  description?: ReactNode;
11
8
  insight?: ReactNode;
12
9
  action?: ReactNode;
13
10
  evidence?: WidgetEvidence;
14
- status?: DataWidgetProps['status'];
15
- empty?: Pick<EmptyStateProps, 'title' | 'description'>;
11
+ status?: WidgetStatus;
12
+ empty?: EmptyContent;
16
13
  } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
17
14
  type UnboundVisualizationWidgetProps = VisualizationWidgetBaseProps & ({
18
15
  loading: true;
@@ -27,12 +24,7 @@ export type VisualizationWidgetView<Data> = {
27
24
  label: ReactNode;
28
25
  render: (data: Data) => ReactNode;
29
26
  };
30
- type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & {
31
- evidence: WidgetEvidence;
32
- reading: DataReading<Data>;
33
- isEmpty: (data: Data) => boolean;
34
- empty: Pick<EmptyStateProps, 'title' | 'description'>;
35
- skeleton?: Pick<ContentSkeletonProps, 'variant' | 'rows'>;
27
+ type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & BoundWidgetReading<Data> & {
36
28
  visual?: never;
37
29
  loading?: never;
38
30
  };
@@ -1,5 +1,4 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
-
3
2
  export type WidgetDisclosureProps = {
4
3
  label: ReactNode;
5
4
  children: ReactNode;
@@ -1,11 +1,10 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
- import { type EmptyStateProps } from './EmptyState.js';
3
-
2
+ import type { EmptyContent } from './presentation.js';
4
3
  export type WidgetView = {
5
4
  id: string;
6
5
  label: ReactNode;
7
6
  content: ReactNode;
8
- empty: Pick<EmptyStateProps, 'title' | 'description'>;
7
+ empty: EmptyContent;
9
8
  isEmpty: boolean;
10
9
  };
11
10
  export type WidgetViewTabsProps<Views extends readonly WidgetView[] = readonly WidgetView[]> = {
@@ -1,4 +1,3 @@
1
-
2
1
  export type TableIdentifier = {
3
2
  catalog: string;
4
3
  schema: string;
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DataReading } from '../../core/reading.js';
3
+ import type { WidgetEvidence } from './WidgetEvidence.js';
4
+ export type EmptyContent = {
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ };
8
+ export type SkeletonContent = {
9
+ variant: 'metric' | 'panel' | 'ranking';
10
+ rows?: number;
11
+ };
12
+ /** A bound widget must explain empty results and link the reading to its evidence. */
13
+ export type BoundWidgetReading<Data> = {
14
+ reading: DataReading<Data>;
15
+ isEmpty: (data: Data) => boolean;
16
+ empty: EmptyContent;
17
+ evidence: WidgetEvidence;
18
+ skeleton?: SkeletonContent;
19
+ };
@@ -0,0 +1,3 @@
1
+ import { type Theme } from '../../core/appearance.js';
2
+ /** The parent theme takes precedence; only standalone viewers receive controls. */
3
+ export declare function useAppAppearance(appearance: unknown, hostTheme?: Theme): import("../../core/appearance.js").ThemeController | undefined;
@@ -0,0 +1,3 @@
1
+ import { type DataAppPresentation } from '../../core/presentation.js';
2
+ /** Local preview verifies its parent before accepting presentation context. */
3
+ export declare function useDataAppPresentation(): DataAppPresentation | undefined;
@@ -2,11 +2,11 @@ import type { ReactNode } from 'react';
2
2
  import { type AppVariableValues, type VariableCollection } from './ui/variables.js';
3
3
  import type { ResolvedVariables } from './view.js';
4
4
  /** URL values resolve before facets; facet keys include their dependent inputs for cached, bounded loading. */
5
- export declare function useViewVariables<Variables extends VariableCollection>(definitions: Variables, loadFacet: (operation: string, input: unknown, signal: AbortSignal) => Promise<unknown>): {
5
+ export declare function useViewVariables<Variables extends VariableCollection>(definitions: Variables, clientScope: string, loadFacet: (operation: string, input: unknown, signal: AbortSignal) => Promise<unknown>): {
6
6
  values: AppVariableValues<Variables>;
7
7
  set: <Key extends keyof Variables & string>(name: Key, value: AppVariableValues<Variables>[Key]) => void;
8
8
  reset: <Key extends keyof Variables & string>(name: Key) => void;
9
- update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/variables.js").HistoryMode) => void;
9
+ update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/navigation.js").HistoryMode) => void;
10
10
  bind: <Key extends keyof Variables & string>(name: Key) => {
11
11
  value: AppVariableValues<Variables>[Key];
12
12
  onChange(value: AppVariableValues<Variables>[Key]): void;