@altertable/data-app-react 0.78.0 → 0.79.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.
@@ -1,5 +1,5 @@
1
1
  import { DataAppDefinition, QueryDefinitions } from "@altertable/data-app/config";
2
- import { DataReading, DataView, DateTimeRangeComparison, DateTimeRangeFilter, DateTimeRangeFilterOptions, DateTimeRangePreset as DateTimeRangePreset$1, DateTimeRangeSelection, DisplayedSnapshot, FilterCollection, FilterValues, HistoryMode, MetricReading, dateTimeRangeFilter, dateTimeRangePresets } from "@altertable/data-app/internal";
2
+ import { DataReading, DateTimeRangeComparison, DateTimeRangeFilter, DateTimeRangeFilterOptions, DateTimeRangePreset as DateTimeRangePreset$1, DateTimeRangeSelection, DisplayedSnapshot, FilterCollection, FilterValues, HistoryMode, MetricReading, dateTimeRangeFilter, dateTimeRangePresets } from "@altertable/data-app/internal";
3
3
  import { CSSProperties, ComponentPropsWithRef, ComponentType, ReactNode, Ref, RefObject } from "react";
4
4
  import { Button } from "react-aria-components";
5
5
  import { Placement } from "@floating-ui/react";
@@ -519,7 +519,6 @@ type TableWidgetProps<Row> = TableWidgetBaseProps<Row> & ({
519
519
  skeletonRows?: number;
520
520
  evidence: WidgetEvidence;
521
521
  });
522
- declare function TableWidget<Row>(props: TableWidgetProps<Row>): import("react").JSX.Element;
523
522
  //#endregion
524
523
  //#region src/styles.d.ts
525
524
  interface DataAppStylesOptions {
@@ -573,35 +572,6 @@ declare function useAppFilters<const Collection extends FilterCollection>(defini
573
572
  };
574
573
  };
575
574
  //#endregion
576
- //#region src/ui/DataAppFrame.d.ts
577
- type DataAppBaseProps = {
578
- children: ReactNode;
579
- dataContext: DataContext;
580
- /** Override the declared subtitle; null hides it. */
581
- description?: ReactNode;
582
- /** Show page actions. Defaults to true; does not hide filters or data states.
583
- * Embedded surfaces have no toolbar: the host runs page actions through its bridge. */
584
- showToolbar?: boolean;
585
- /** Standalone toolbar controls; embedded surfaces omit them. */
586
- toolbarActions?: ReactNode;
587
- /** Standalone footer controls; embedded surfaces omit them. */
588
- footerActions?: ReactNode;
589
- /** Optional source, coverage, or methodology note below the app content.
590
- * Compose prose and inline components; typography and spacing are provided.
591
- * Put data widgets in children and app controls in footerActions. */
592
- footer?: ReactNode;
593
- };
594
- type DataAppControlProps = {
595
- /** Show declared search controls. Defaults to true; hiding preserves their values. */
596
- showSearch?: boolean;
597
- /** Show declared filter controls, including display options. Defaults to true; hiding preserves their values. */
598
- showFilters?: boolean;
599
- };
600
- type StaticDataAppProps = DataAppBaseProps & {
601
- csvExport?: CsvExport;
602
- queries?: DisclosedQuery[];
603
- };
604
- //#endregion
605
575
  //#region src/ui/Notice.d.ts
606
576
  type NoticeProps = {
607
577
  title: ReactNode;
@@ -611,59 +581,6 @@ type NoticeProps = {
611
581
  /** Quiet contextual feedback with an optional action. Content wraps before its action on narrow containers. */
612
582
  declare function Notice({ title, description, action, className, ...props }: NoticeProps): import("react").JSX.Element;
613
583
  //#endregion
614
- //#region src/ui/DataValue.d.ts
615
- type DataValueProps<Value> = {
616
- reading: DataReading<Value>;
617
- loadingFallback: ReactNode;
618
- children: (value: Value) => ReactNode;
619
- } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
620
- /** Bind inline content to displayed data. Keep static wording outside this span. */
621
- declare function DataValue<Value>({ reading, loadingFallback, children, ...props }: DataValueProps<Value>): import("react").JSX.Element;
622
- //#endregion
623
- //#region src/ui/MetricWidget.d.ts
624
- type MetricWidgetBaseProps = {
625
- label: string;
626
- /** Document outline level. The label keeps the shared widget-heading appearance. */
627
- headingLevel?: 2 | 3 | 4 | 5 | 6;
628
- annotationId?: string;
629
- description?: ReactNode;
630
- comparison?: MetricComparison;
631
- evidence?: WidgetEvidence;
632
- records?: InspectionRecords;
633
- action?: ReactNode;
634
- status?: WidgetStatus;
635
- visual?: ReactNode;
636
- } & Omit<ComponentPropsWithRef<'div'>, 'about' | 'children'>;
637
- type UnboundMetricWidgetProps = MetricWidgetBaseProps & ({
638
- loading: true;
639
- value?: never;
640
- format?: never;
641
- content?: never;
642
- } | ({
643
- loading?: false;
644
- } & ({
645
- value: number;
646
- format: MetricFormat;
647
- content?: never;
648
- } | {
649
- content: ReactNode;
650
- value?: never;
651
- format?: never;
652
- })));
653
- /** VisualizationWidget with a formatted metric, optional comparison, and evidence. */
654
- type MetricWidgetProps = UnboundMetricWidgetProps | (Omit<MetricWidgetBaseProps, 'label' | 'comparison' | 'evidence'> & {
655
- metric: MetricDefinition;
656
- reading: MetricReading;
657
- label?: never;
658
- value?: never;
659
- format?: never;
660
- content?: never;
661
- comparison?: never;
662
- evidence?: never;
663
- loading?: never;
664
- });
665
- declare function MetricWidget(props: MetricWidgetProps): import("react").JSX.Element;
666
- //#endregion
667
584
  //#region src/ui/DataWidget.d.ts
668
585
  type DataWidgetBaseProps = {
669
586
  title: ReactNode;
@@ -698,64 +615,6 @@ type DataWidgetProps<Data = unknown> = DataWidgetBaseProps & ((BoundWidgetReadin
698
615
  declare function DataWidgetInner<Data>(props: DataWidgetProps<Data>): import("react").JSX.Element;
699
616
  declare const DataWidget: typeof DataWidgetInner;
700
617
  //#endregion
701
- //#region src/ui/TextWidget.d.ts
702
- type TextWidgetBaseProps = Omit<Extract<DataWidgetProps, {
703
- reading?: never;
704
- }>, 'reading' | 'children' | 'isEmpty' | 'empty' | 'skeleton' | 'bodyPadding'>;
705
- /** Narrative sibling of VisualizationWidget, composing DataWidget with TextContent.
706
- * Use TextContent directly for borderless prose. Bind claims and scope to the same displayed reading.
707
- * The renderer handles every ready value, including zero and empty collections. */
708
- type TextWidgetProps<Data = unknown> = TextWidgetBaseProps & ({
709
- reading: DataReading<Data>;
710
- evidence: WidgetEvidence;
711
- children: (data: Data) => ReactNode;
712
- } | {
713
- reading?: never;
714
- children: ReactNode;
715
- });
716
- declare function TextWidget<Data>(props: TextWidgetProps<Data>): import("react").JSX.Element;
717
- //#endregion
718
- //#region src/ui/VisualizationWidget.d.ts
719
- type VisualizationWidgetBaseProps = Pick<DataWidgetProps, 'title' | 'headingLevel' | 'annotationId' | 'description' | 'count' | 'action' | 'evidence' | 'records' | 'status' | 'emptyFallback'> & {
720
- /** Footer controls, such as table pagination. */
721
- footer?: ReactNode;
722
- } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
723
- type UnboundVisualizationWidgetProps = VisualizationWidgetBaseProps & ({
724
- loading: true;
725
- loadingContent?: ReactNode;
726
- visual?: never;
727
- } | {
728
- loading?: false;
729
- visual: ReactNode;
730
- loadingContent?: never;
731
- });
732
- type VisualizationWidgetView<Data> = {
733
- /** Stable, nonempty identity; unique within this widget. */
734
- id: string;
735
- label: ReactNode;
736
- render: (data: Data) => ReactNode;
737
- };
738
- type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & BoundWidgetReading<Data> & {
739
- visual?: never;
740
- loading?: never;
741
- };
742
- /** DataWidget frame for charts, DataTable, metrics, or a custom data display.
743
- * Owns alternate-view selection and shares it with inspection. Built-in charts own
744
- * transient tooltips; lift persistent custom interactions above both mounts.
745
- * For narrative prose use the sibling TextWidget, which composes DataWidget directly. */
746
- type VisualizationWidgetProps<Data = unknown> = UnboundVisualizationWidgetProps | (BoundVisualizationWidgetBase<Data> & {
747
- children: (data: Data) => ReactNode;
748
- views?: never;
749
- }) | (BoundVisualizationWidgetBase<Data> & {
750
- views: readonly VisualizationWidgetView<Data>[];
751
- viewLabel: string;
752
- /** An existing view ID; defaults to the first view. Validated while loading too. */
753
- initialView?: string;
754
- children?: never;
755
- });
756
- /** Compose an unframed visual with the shared heading and inspection. */
757
- declare function VisualizationWidget<Data>(props: VisualizationWidgetProps<Data>): import("react").JSX.Element;
758
- //#endregion
759
618
  //#region src/ui/HelpPopover.d.ts
760
619
  type HelpPopoverTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'> & DataAppStyleHooks;
761
620
  type HelpPopoverPanelProps = Omit<ComponentPropsWithRef<'section'>, 'children' | 'role'>;
@@ -928,5 +787,5 @@ type DateTimeRangePickerProps = {
928
787
  */
929
788
  declare function DateTimeRangePicker({ value, onChange, liveOption, comparison, isDefault, onReset, calendarFooter, className, placeholder, label, labelPlacement, maxRangeDays, policy, presets: configuredPresets, disabled }: DateTimeRangePickerProps): import("react").JSX.Element;
930
789
  //#endregion
931
- export { TableWidgetSearch as $, TableIdentifier as $t, NoticeProps as A, DataContext as At, dateTimeRangePresets as B, AboutData as Bt, DataWidget as C, CsvTable as Ct, DataValue as D, ItemActions as Dt, MetricWidgetProps as E, ExplorationActionControlProps as Et, DateTimeRangeFilter as F, StoryFinding as Ft, DataAppStyleHooks as G, Sheet as Gt, DataAppProvider as H, AboutEmpty as Ht, DateTimeRangeFilterOptions as I, PresentStory as It, injectDataAppStyles as J, ButtonProps as Jt, DataAppStyleToken as K, SheetProps as Kt, DateTimeRangePreset$1 as L, PresentStoryProps as Lt, DataAppControlProps as M, GlossaryEntry as Mt, StaticDataAppProps as N, createDataContext as Nt, DataValueProps as O, EmptyContent as Ot, DateTimeRangeComparison as P, BoundStory as Pt, TableWidgetProps as Q, DataIdentifierDefinition as Qt, DateTimeRangeSelection as R, MetricDefinition as Rt, TextWidgetProps as S, CsvExport as St, MetricWidget as T, ExplorationActionControl as Tt, mountDataApp as U, AboutSubject as Ut, useAppFilters as V, AboutDataProps as Vt, DataAppStyle as W, AboutTab as Wt, TableWidget as X, MetricComparison as Xt, TableDisplayMode as Y, PressButton as Yt, TableWidgetColumn as Z, ColumnIdentifier as Zt, HelpPopoverProps as _, SearchTypeahead as _t, DateDisplay as a, matchSearchText as at, VisualizationWidgetView as b, SearchFieldProps as bt, SectionHeadingProps as c, DataTable as ct, TooltipProvider as d, DataTableProps as dt, defineDataIdentifiers as en, SearchAttribute as et, TooltipProviderProps as f, DataTableSearch as ft, HelpPopover as g, SearchSuggestion as gt, AppIconProps as h, DataTableTimestampProps as ht, useDateFormatting as i, SearchRange as it, DataAppBaseProps as j, EvidenceDeclaration as jt, Notice as k, AuthoringDataContext as kt, Tooltip as l, DataTableEmptyRow as lt, AppIconName as m, DataTableTimestamp as mt, DateTimeRangePickerProps as n, SearchItemsOptions as nt, DateDisplayProps as o, searchItems as ot, AppIcon as p, DataTableShare as pt, DataAppStylesOptions as q, Button$1 as qt, ControlLabelPlacement as r, SearchMatchValue as rt, SectionHeading as s, WidgetStatus as st, DateTimeRangePicker as t, SearchHit as tt, TooltipProps as u, DataTableEmptyRowProps as ut, VisualizationWidget as v, SearchTypeaheadProps as vt, DataWidgetProps as w, ExplorationAction as wt, TextWidget as x, CsvCell as xt, VisualizationWidgetProps as y, SearchField as yt, dateTimeRangeFilter as z, WidgetEvidence as zt };
790
+ export { DataTableSearch as $, DataAppProvider as A, AboutEmpty as At, TableWidgetSearch as B, ColumnIdentifier as Bt, DateTimeRangeFilter as C, StoryFinding as Ct, dateTimeRangeFilter as D, WidgetEvidence as Dt, DateTimeRangeSelection as E, MetricDefinition as Et, DataAppStylesOptions as F, SheetProps as Ft, SearchRange as G, SearchHit as H, TableIdentifier as Ht, injectDataAppStyles as I, Button$1 as It, WidgetStatus as J, matchSearchText as K, TableDisplayMode as L, ButtonProps as Lt, DataAppStyle as M, AboutTab as Mt, DataAppStyleHooks as N, InspectionRecords as Nt, dateTimeRangePresets as O, AboutData as Ot, DataAppStyleToken as P, Sheet as Pt, DataTableProps as Q, TableWidgetColumn as R, PressButton as Rt, DateTimeRangeComparison as S, BoundStory as St, DateTimeRangePreset$1 as T, PresentStoryProps as Tt, SearchItemsOptions as U, defineDataIdentifiers as Ut, SearchAttribute as V, DataIdentifierDefinition as Vt, SearchMatchValue as W, DataTableEmptyRow as X, DataTable as Y, DataTableEmptyRowProps as Z, HelpPopoverProps as _, AuthoringDataContext as _t, DateDisplay as a, SearchTypeaheadProps as at, Notice as b, GlossaryEntry as bt, SectionHeadingProps as c, CsvCell as ct, TooltipProvider as d, ExplorationAction as dt, DataTableShare as et, TooltipProviderProps as f, ExplorationActionControl as ft, HelpPopover as g, EmptyContent as gt, AppIconProps as h, BoundWidgetReading as ht, useDateFormatting as i, SearchTypeahead as it, mountDataApp as j, AboutSubject as jt, useAppFilters as k, AboutDataProps as kt, Tooltip as l, CsvExport as lt, AppIconName as m, ItemActions as mt, DateTimeRangePickerProps as n, DataTableTimestampProps as nt, DateDisplayProps as o, SearchField as ot, AppIcon as p, ExplorationActionControlProps as pt, searchItems as q, ControlLabelPlacement as r, SearchSuggestion as rt, SectionHeading as s, SearchFieldProps as st, DateTimeRangePicker as t, DataTableTimestamp as tt, TooltipProps as u, CsvTable as ut, DataWidget as v, DataContext as vt, DateTimeRangeFilterOptions as w, PresentStory as wt, NoticeProps as x, createDataContext as xt, DataWidgetProps as y, EvidenceDeclaration as yt, TableWidgetProps as z, MetricComparison as zt };
932
791
  //# sourceMappingURL=DateTimeRangePicker.d.ts.map
@@ -1,4 +1,4 @@
1
- import { $ as TableWidgetSearch, $t as TableIdentifier, A as NoticeProps, At as DataContext, Ct as CsvTable, Dt as ItemActions, E as MetricWidgetProps$1, F as DateTimeRangeFilter, Ft as StoryFinding, G as DataAppStyleHooks, J as injectDataAppStyles, Jt as ButtonProps, K as DataAppStyleToken, M as DataAppControlProps, Mt as GlossaryEntry, Nt as createDataContext, O as DataValueProps$1, Ot as EmptyContent, Q as TableWidgetProps$1, Qt as DataIdentifierDefinition, Rt as MetricDefinition, S as TextWidgetProps$1, U as mountDataApp, W as DataAppStyle, Xt as MetricComparison, Y as TableDisplayMode, Z as TableWidgetColumn, Zt as ColumnIdentifier, _ as HelpPopoverProps, a as DateDisplay, b as VisualizationWidgetView$1, c as SectionHeadingProps, d as TooltipProvider, en as defineDataIdentifiers, f as TooltipProviderProps, gt as SearchSuggestion, i as useDateFormatting, j as DataAppBaseProps, jt as EvidenceDeclaration, k as Notice, kt as AuthoringDataContext, l as Tooltip, m as AppIconName, n as DateTimeRangePickerProps, o as DateDisplayProps, q as DataAppStylesOptions, qt as Button, s as SectionHeading, t as DateTimeRangePicker, u as TooltipProps, xt as CsvCell, y as VisualizationWidgetProps$1, zt as WidgetEvidence } from "./chunks/DateTimeRangePicker.js";
1
+ import { B as TableWidgetSearch, Bt as ColumnIdentifier, C as DateTimeRangeFilter, Ct as StoryFinding, Dt as WidgetEvidence, Et as MetricDefinition, F as DataAppStylesOptions, Ht as TableIdentifier, I as injectDataAppStyles, It as Button, J as WidgetStatus, L as TableDisplayMode, Lt as ButtonProps, M as DataAppStyle, N as DataAppStyleHooks, Nt as InspectionRecords, P as DataAppStyleToken, R as TableWidgetColumn, Ut as defineDataIdentifiers, Vt as DataIdentifierDefinition, _ as HelpPopoverProps, _t as AuthoringDataContext, a as DateDisplay, b as Notice, bt as GlossaryEntry, c as SectionHeadingProps, ct as CsvCell, d as TooltipProvider, f as TooltipProviderProps, gt as EmptyContent, ht as BoundWidgetReading, i as useDateFormatting, j as mountDataApp, l as Tooltip, m as AppIconName, mt as ItemActions, n as DateTimeRangePickerProps, o as DateDisplayProps, rt as SearchSuggestion, s as SectionHeading, t as DateTimeRangePicker, u as TooltipProps, ut as CsvTable, vt as DataContext, x as NoticeProps, xt as createDataContext, y as DataWidgetProps, yt as EvidenceDeclaration, z as TableWidgetProps$1, zt as MetricComparison } from "./chunks/DateTimeRangePicker.js";
2
2
  import { DataClient, InputOf, OutputOf } from "@altertable/data-app/client";
3
3
  import { ChoiceFilter, DataReading, DataView, DisplayedSnapshot, FilterCollection, FilterInput, FilterValues, IsUnion, MetricReading, MetricValues, MetricValues as MetricValues$1 } from "@altertable/data-app/internal";
4
4
  import { ComponentPropsWithRef, ReactNode, Ref, RefObject } from "react";
@@ -80,9 +80,10 @@ type ResolvedViewDefinition<Name extends string, Filters extends FilterCollectio
80
80
  /** The operation's date filter, which sets the reporting period. */
81
81
  dateFilter?: keyof Filters & string;
82
82
  };
83
- /** Omit both for a result that is never empty, such as a total. */
83
+ /** Omit both for rows, or for a result that is never empty, such as a total. */
84
84
  type ViewEmptiness<Data> = {
85
- /** App-owned semantics: measured zero need not mean an empty result. Defaults to never empty. */
85
+ /** App-owned semantics: measured zero need not mean an empty result.
86
+ * @default A result with no rows is empty; any other result never is */
86
87
  isEmpty?: (data: Data) => boolean;
87
88
  /** Inherited by DataSection unless it supplies its own copy. */
88
89
  emptyFallback?: EmptyContent;
@@ -208,7 +209,8 @@ type SourceReading<Source, Value> = Source extends {
208
209
  loading: false;
209
210
  value: Value;
210
211
  };
211
- /** Keys supply IDs; accessors supply raw CSV values. Formats affect display only. */
212
+ /** Keys supply IDs; accessors supply raw CSV values. Formats affect display only.
213
+ * A column named after a row field reads that field; set `value` for computed columns. */
212
214
  type DatasetColumn<Row> = {
213
215
  label?: string;
214
216
  } & ({
@@ -228,10 +230,41 @@ type DatasetColumn<Row> = {
228
230
  kind: 'date';
229
231
  }>;
230
232
  });
233
+ /** A column that reads the row field named by its key. */
234
+ type DatasetFieldColumn<Row> = {
235
+ label?: string;
236
+ value?: never;
237
+ format?: ((row: Row) => ReactNode) | MetricFormat | DateFormat;
238
+ };
239
+ /** The field values a format can display. */
240
+ type FormattedField<Format> = Format extends {
241
+ kind: 'date';
242
+ } ? string | null | undefined : Format extends {
243
+ kind: 'dateTime';
244
+ } ? string | number | null | undefined : Format extends MetricFormat ? number | null | undefined : CsvCell;
245
+ /** Checks columns without `value`: the key must name a row field its format can display.
246
+ * A failed check asks for the explicit accessor. TypeScript cannot run this check when
247
+ * the same dataset declares inline accessors; a misnamed column then shows missing values. */
248
+ type DatasetColumns<Row, Columns> = string extends keyof Columns ? unknown : { [Key in keyof Columns]: Columns[Key] extends {
249
+ value: object;
250
+ } ? unknown : FormattedField<Columns[Key] extends {
251
+ format: infer Format;
252
+ } ? Format : undefined> extends (infer Field) ? Key extends keyof Row ? [Row[Key]] extends [Field] ? unknown : {
253
+ value: (row: Row) => Field;
254
+ } : {
255
+ value: (row: Row) => Field;
256
+ } : never; };
257
+ /** The rows of an operation that returns them directly. */
258
+ type DatasetRows<Data> = Data extends readonly (infer Row)[] ? Row : never;
259
+ /** `select` is required unless the operation returns the rows themselves. */
260
+ type DatasetSelect<Data, Input, Row> = Data extends readonly unknown[] ? unknown : {
261
+ select: (data: Data, input: Input) => readonly Row[];
262
+ };
231
263
  type DatasetDefinition<Data, Input, Row, Evidence = WidgetEvidence> = {
232
264
  name: string;
233
- select: (data: Data, input: Input) => readonly Row[];
234
- columns: Record<string, DatasetColumn<NoInfer<Row>>>;
265
+ /** Rows to bind. Omit when the operation returns the rows themselves. */
266
+ select?: (data: Data, input: Input) => readonly Row[];
267
+ columns: Record<string, DatasetColumn<NoInfer<Row>> | DatasetFieldColumn<NoInfer<Row>>>;
235
268
  rowKey: (row: NoInfer<Row>) => string | number;
236
269
  evidence: Evidence;
237
270
  emptyFallback?: EmptyContent;
@@ -327,6 +360,11 @@ declare class MetricRecords<Data, Input, DetailData, DetailInput> {
327
360
  //#endregion
328
361
  //#region src/hooks.d.ts
329
362
  type NonEmptyColumns<Columns extends object> = keyof Columns extends never ? never : Columns;
363
+ /** A view's dataset: rows default to the operation's result, and a column named
364
+ * after a row field reads it. Evidence references are checked against the view's context. */
365
+ type BoundDatasetDefinition<Data, Input, Row, Columns extends Record<string, object>, Context extends AuthoringDataContext> = DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & DatasetSelect<Data, Input, Row> & {
366
+ columns: Columns & NonEmptyColumns<Columns> & DatasetColumns<NoInfer<Row>, NoInfer<Columns>>;
367
+ };
330
368
  /** The filters an operation declares; `{}` when it reads none. */
331
369
  type FiltersOf<Operation> = Operation extends {
332
370
  filters: infer Filters extends FilterCollection;
@@ -348,9 +386,7 @@ type BoundView<Name extends string, Filters extends FilterCollection, Data, Cont
348
386
  }> & {
349
387
  filter(): FilterTarget<FilterPatch<Filters>>;
350
388
  breakdown<Key extends DisplayChoiceName<Filters>>(key: Key): Filters[Key] extends ChoiceFilter<infer Value> ? BreakdownTarget<Value> : never;
351
- dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, FilterInput<Filters>, Row, Parameters<Context['evidence']>[0]> & {
352
- columns: Columns & NonEmptyColumns<Columns>;
353
- }): Dataset<Data, FilterInput<Filters>, Row>;
389
+ dataset<Row = DatasetRows<Data>, const Columns extends Record<string, object> = Record<string, object>>(definition: BoundDatasetDefinition<Data, FilterInput<Filters>, Row, Columns, Context>): Dataset<Data, FilterInput<Filters>, Row>;
354
390
  metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: FilterInput<Filters>) => HasPeriod<Filters> extends true ? MetricValues$1 : {
355
391
  current: number;
356
392
  previous?: never;
@@ -359,9 +395,7 @@ type BoundView<Name extends string, Filters extends FilterCollection, Data, Cont
359
395
  content(render: (state: DataContentState<Data, FilterInput<Filters>>) => ReactNode): ViewContent<Data, FilterInput<Filters>>;
360
396
  };
361
397
  type BoundDetailView<Data, Input, Context extends AuthoringDataContext, Own = Input> = DetailView<Data, Input, Own> & {
362
- dataset<Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & {
363
- columns: Columns & NonEmptyColumns<Columns>;
364
- }): Dataset<Data, Input, Row>;
398
+ dataset<Row = DatasetRows<Data>, const Columns extends Record<string, object> = Record<string, object>>(definition: BoundDatasetDefinition<Data, Input, Row, Columns, Context>): Dataset<Data, Input, Row>;
365
399
  metric(definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => {
366
400
  current: number;
367
401
  previous?: never;
@@ -380,6 +414,31 @@ export declare function createDataHooks<Operations extends DataOperations>(clien
380
414
  }) => BoundDetailView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Context, DetailOwnInput<Operations[Name]>>;
381
415
  };
382
416
  //#endregion
417
+ //#region src/ui/DataAppFrame.d.ts
418
+ type DataAppBaseProps = {
419
+ children: ReactNode;
420
+ dataContext: DataContext;
421
+ /** Override the declared subtitle; null hides it. */
422
+ description?: ReactNode;
423
+ /** Show page actions. Defaults to true; does not hide filters or data states.
424
+ * Embedded surfaces have no toolbar: the host runs page actions through its bridge. */
425
+ showToolbar?: boolean;
426
+ /** Standalone toolbar controls; embedded surfaces omit them. */
427
+ toolbarActions?: ReactNode;
428
+ /** Standalone footer controls; embedded surfaces omit them. */
429
+ footerActions?: ReactNode;
430
+ /** Optional source, coverage, or methodology note below the app content.
431
+ * Compose prose and inline components; typography and spacing are provided.
432
+ * Put data widgets in children and app controls in footerActions. */
433
+ footer?: ReactNode;
434
+ };
435
+ type DataAppControlProps = {
436
+ /** Show declared search controls. Defaults to true; hiding preserves their values. */
437
+ showSearch?: boolean;
438
+ /** Show declared filter controls, including display options. Defaults to true; hiding preserves their values. */
439
+ showFilters?: boolean;
440
+ };
441
+ //#endregion
383
442
  //#region src/ui/DataApp.d.ts
384
443
  /** A declared data or time view that `<DataApp>` can run and describe. */
385
444
  type DataAppView<Data, Input> = DeclaredView<Data, Input> & {
@@ -396,6 +455,14 @@ type ExportOf<View> = View extends {
396
455
  type StoryFindings = readonly (Omit<StoryFinding, 'evidence'> & {
397
456
  evidence: RegisteredBinding;
398
457
  })[];
458
+ /** A setup or static screen: the page shell without a view, filters, story, or export. */
459
+ type DataAppScreenProps = DataAppBaseProps & {
460
+ view?: never;
461
+ summaryViews?: never;
462
+ story?: never;
463
+ datasets?: never;
464
+ details?: never;
465
+ };
399
466
  type DataAppProps<Data, Input = unknown, SummaryViews extends readonly AnyView[] = []> = Omit<DataAppBaseProps, 'dataContext'> & DataAppControlProps & {
400
467
  /** The headline view. `<DataApp>` renders the controls for every filter its
401
468
  * client's operations read and owns their URL state. */
@@ -413,8 +480,10 @@ type DataAppProps<Data, Input = unknown, SummaryViews extends readonly AnyView[]
413
480
  /** Detail destinations available to dataset actions and metric record inspection. */
414
481
  details?: readonly DetailContent<any, any>[];
415
482
  };
483
+ /** Renders a setup or static screen from its `dataContext` and children. */
484
+ export declare function DataApp(props: DataAppScreenProps): ReactNode;
416
485
  /** Executes the primary view and its summary views, and owns controls, inspection, exports, and stories. */
417
- export declare function DataApp<Data, Input, const SummaryViews extends readonly AnyView[] = []>(props: DataAppProps<Data, Input, SummaryViews>): import("react").JSX.Element;
486
+ export declare function DataApp<Data, Input, const SummaryViews extends readonly AnyView[] = []>(props: DataAppProps<Data, Input, SummaryViews>): ReactNode;
418
487
  //#endregion
419
488
  //#region src/ui/Stack.d.ts
420
489
  type StackProps = {
@@ -450,6 +519,111 @@ type TextContentProps = ComponentPropsWithRef<'div'>;
450
519
  /** Prose typography for page introductions, widget bodies, and inspection content. */
451
520
  export declare function TextContent({ className, ...props }: TextContentProps): import("react").JSX.Element;
452
521
  //#endregion
522
+ //#region src/ui/DataValue.d.ts
523
+ type DataValueProps$1<Value> = {
524
+ reading: DataReading<Value>;
525
+ loadingFallback: ReactNode;
526
+ children: (value: Value) => ReactNode;
527
+ } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
528
+ //#endregion
529
+ //#region src/ui/MetricWidget.d.ts
530
+ type MetricWidgetBaseProps = {
531
+ label: string;
532
+ /** Document outline level. The label keeps the shared widget-heading appearance. */
533
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
534
+ annotationId?: string;
535
+ description?: ReactNode;
536
+ comparison?: MetricComparison;
537
+ evidence?: WidgetEvidence;
538
+ records?: InspectionRecords;
539
+ action?: ReactNode;
540
+ status?: WidgetStatus;
541
+ visual?: ReactNode;
542
+ } & Omit<ComponentPropsWithRef<'div'>, 'about' | 'children'>;
543
+ type UnboundMetricWidgetProps = MetricWidgetBaseProps & ({
544
+ loading: true;
545
+ value?: never;
546
+ format?: never;
547
+ content?: never;
548
+ } | ({
549
+ loading?: false;
550
+ } & ({
551
+ value: number;
552
+ format: MetricFormat;
553
+ content?: never;
554
+ } | {
555
+ content: ReactNode;
556
+ value?: never;
557
+ format?: never;
558
+ })));
559
+ /** VisualizationWidget with a formatted metric, optional comparison, and evidence. */
560
+ type MetricWidgetProps$1 = UnboundMetricWidgetProps | (Omit<MetricWidgetBaseProps, 'label' | 'comparison' | 'evidence'> & {
561
+ metric: MetricDefinition;
562
+ reading: MetricReading;
563
+ label?: never;
564
+ value?: never;
565
+ format?: never;
566
+ content?: never;
567
+ comparison?: never;
568
+ evidence?: never;
569
+ loading?: never;
570
+ });
571
+ //#endregion
572
+ //#region src/ui/TextWidget.d.ts
573
+ type TextWidgetBaseProps = Omit<Extract<DataWidgetProps, {
574
+ reading?: never;
575
+ }>, 'reading' | 'children' | 'isEmpty' | 'empty' | 'skeleton' | 'bodyPadding'>;
576
+ /** Narrative sibling of VisualizationWidget, composing DataWidget with TextContent.
577
+ * Use TextContent directly for borderless prose. Bind claims and scope to the same displayed reading.
578
+ * The renderer handles every ready value, including zero and empty collections. */
579
+ type TextWidgetProps$1<Data = unknown> = TextWidgetBaseProps & ({
580
+ reading: DataReading<Data>;
581
+ evidence: WidgetEvidence;
582
+ children: (data: Data) => ReactNode;
583
+ } | {
584
+ reading?: never;
585
+ children: ReactNode;
586
+ });
587
+ //#endregion
588
+ //#region src/ui/VisualizationWidget.d.ts
589
+ type VisualizationWidgetBaseProps = Pick<DataWidgetProps, 'title' | 'headingLevel' | 'annotationId' | 'description' | 'count' | 'action' | 'evidence' | 'records' | 'status' | 'emptyFallback'> & {
590
+ /** Footer controls, such as table pagination. */
591
+ footer?: ReactNode;
592
+ } & Omit<ComponentPropsWithRef<'section'>, 'about' | 'title' | 'children'>;
593
+ type UnboundVisualizationWidgetProps = VisualizationWidgetBaseProps & ({
594
+ loading: true;
595
+ loadingContent?: ReactNode;
596
+ visual?: never;
597
+ } | {
598
+ loading?: false;
599
+ visual: ReactNode;
600
+ loadingContent?: never;
601
+ });
602
+ type VisualizationWidgetView$1<Data> = {
603
+ /** Stable, nonempty identity; unique within this widget. */
604
+ id: string;
605
+ label: ReactNode;
606
+ render: (data: Data) => ReactNode;
607
+ };
608
+ type BoundVisualizationWidgetBase<Data> = VisualizationWidgetBaseProps & BoundWidgetReading<Data> & {
609
+ visual?: never;
610
+ loading?: never;
611
+ };
612
+ /** DataWidget frame for charts, DataTable, metrics, or a custom data display.
613
+ * Owns alternate-view selection and shares it with inspection. Built-in charts own
614
+ * transient tooltips; lift persistent custom interactions above both mounts.
615
+ * For narrative prose use the sibling TextWidget, which composes DataWidget directly. */
616
+ type VisualizationWidgetProps$1<Data = unknown> = UnboundVisualizationWidgetProps | (BoundVisualizationWidgetBase<Data> & {
617
+ children: (data: Data) => ReactNode;
618
+ views?: never;
619
+ }) | (BoundVisualizationWidgetBase<Data> & {
620
+ views: readonly VisualizationWidgetView$1<Data>[];
621
+ viewLabel: string;
622
+ /** An existing view ID; defaults to the first view. Validated while loading too. */
623
+ initialView?: string;
624
+ children?: never;
625
+ });
626
+ //#endregion
453
627
  //#region src/widgets.d.ts
454
628
  type MetricWidgetProps<Data = unknown, Input = unknown> = Omit<Extract<MetricWidgetProps$1, {
455
629
  metric: MetricDefinition;
@@ -1,4 +1,4 @@
1
- import { A as NoticeProps, At as DataContext, B as dateTimeRangePresets, Bt as AboutData, C as DataWidget, Ct as CsvTable, D as DataValue, Dt as ItemActions, E as MetricWidgetProps, Et as ExplorationActionControlProps, F as DateTimeRangeFilter, Ft as StoryFinding, G as DataAppStyleHooks, Gt as Sheet, H as DataAppProvider, Ht as AboutEmpty, I as DateTimeRangeFilterOptions, It as PresentStory, J as injectDataAppStyles, K as DataAppStyleToken, Kt as SheetProps, L as DateTimeRangePreset, Lt as PresentStoryProps, Mt as GlossaryEntry, N as StaticDataAppProps, O as DataValueProps, P as DateTimeRangeComparison, Pt as BoundStory, Q as TableWidgetProps, R as DateTimeRangeSelection, S as TextWidgetProps, St as CsvExport, T as MetricWidget$1, Tt as ExplorationActionControl, Ut as AboutSubject, V as useAppFilters, Vt as AboutDataProps, W as DataAppStyle, Wt as AboutTab, X as TableWidget$1, Yt as PressButton, Z as TableWidgetColumn, _ as HelpPopoverProps, _t as SearchTypeahead, a as DateDisplay, at as matchSearchText, bt as SearchFieldProps, c as SectionHeadingProps, ct as DataTable, d as TooltipProvider, dt as DataTableProps, et as SearchAttribute, f as TooltipProviderProps, ft as DataTableSearch, g as HelpPopover, gt as SearchSuggestion, h as AppIconProps, ht as DataTableTimestampProps, i as useDateFormatting, it as SearchRange, k as Notice, l as Tooltip, lt as DataTableEmptyRow, m as AppIconName, mt as DataTableTimestamp, n as DateTimeRangePickerProps, nt as SearchItemsOptions, o as DateDisplayProps, ot as searchItems, p as AppIcon, pt as DataTableShare, r as ControlLabelPlacement, rt as SearchMatchValue, s as SectionHeading, st as WidgetStatus, t as DateTimeRangePicker, tt as SearchHit, u as TooltipProps, ut as DataTableEmptyRowProps, v as VisualizationWidget$1, vt as SearchTypeaheadProps, w as DataWidgetProps, wt as ExplorationAction, x as TextWidget$1, y as VisualizationWidgetProps, yt as SearchField, z as dateTimeRangeFilter } from "../chunks/DateTimeRangePicker.js";
1
+ import { $ as DataTableSearch, A as DataAppProvider, At as AboutEmpty, C as DateTimeRangeFilter, Ct as StoryFinding, D as dateTimeRangeFilter, E as DateTimeRangeSelection, Ft as SheetProps, G as SearchRange, H as SearchHit, I as injectDataAppStyles, J as WidgetStatus, K as matchSearchText, M as DataAppStyle, Mt as AboutTab, N as DataAppStyleHooks, O as dateTimeRangePresets, Ot as AboutData, P as DataAppStyleToken, Pt as Sheet, Q as DataTableProps, R as TableWidgetColumn, Rt as PressButton, S as DateTimeRangeComparison, St as BoundStory, T as DateTimeRangePreset, Tt as PresentStoryProps, U as SearchItemsOptions, V as SearchAttribute, W as SearchMatchValue, X as DataTableEmptyRow, Y as DataTable, Z as DataTableEmptyRowProps, _ as HelpPopoverProps, a as DateDisplay, at as SearchTypeaheadProps, b as Notice, bt as GlossaryEntry, c as SectionHeadingProps, d as TooltipProvider, dt as ExplorationAction, et as DataTableShare, f as TooltipProviderProps, ft as ExplorationActionControl, g as HelpPopover, h as AppIconProps, i as useDateFormatting, it as SearchTypeahead, jt as AboutSubject, k as useAppFilters, kt as AboutDataProps, l as Tooltip, lt as CsvExport, m as AppIconName, mt as ItemActions, n as DateTimeRangePickerProps, nt as DataTableTimestampProps, o as DateDisplayProps, ot as SearchField, p as AppIcon, pt as ExplorationActionControlProps, q as searchItems, r as ControlLabelPlacement, rt as SearchSuggestion, s as SectionHeading, st as SearchFieldProps, t as DateTimeRangePicker, tt as DataTableTimestamp, u as TooltipProps, ut as CsvTable, v as DataWidget, vt as DataContext, w as DateTimeRangeFilterOptions, wt as PresentStory, x as NoticeProps, y as DataWidgetProps } from "../chunks/DateTimeRangePicker.js";
2
2
  import { DataClient } from "@altertable/data-app/client";
3
3
  import { ChoiceOption, ChoiceOption as ChoiceOption$1, DataReading, DimensionSelectionFilter, DimensionValue, MetricReading } from "@altertable/data-app/internal";
4
4
  import { ComponentProps, ComponentPropsWithRef, ReactNode, RefAttributes } from "react";
@@ -168,11 +168,6 @@ type CheckboxProps = {
168
168
  });
169
169
  export declare function Checkbox({ label, description, checked, value, onChange, disabled, className }: CheckboxProps): import("react").JSX.Element;
170
170
  //#endregion
171
- //#region src/ui/StaticDataApp.d.ts
172
- type DataAppProps = StaticDataAppProps;
173
- /** Setup and static screens; fetched data uses the declared-view DataApp. */
174
- export declare function DataApp({ csvExport, ...props }: DataAppProps): import("react").JSX.Element;
175
- //#endregion
176
171
  //#region src/ui/use-chart-cursor-group.d.ts
177
172
  declare const groupBrand: unique symbol;
178
173
  /** Opaque shared-cursor handle. Create with useChartCursorGroup and pass through chart cursorGroup props. */
@@ -463,7 +458,7 @@ type ComposedChartProps<Row = unknown> = HorizontalGridProps & Omit<ComponentPro
463
458
  * for stacks. Preserve missing measures as null and choose connectNulls deliberately.
464
459
  * Use public chart tokens for series colors. Dataset bindings own
465
460
  * loading, empty results, evidence, and CSV; this primitive owns only the plot. */
466
- declare function ComposedChartRoot<Row>({ data, ariaLabel, valueFormat, cursorGroup, horizontalGrid, children, width, height, responsive, layout, className, ...props }: ComposedChartProps<Row>): import("react").JSX.Element;
461
+ declare function ComposedChartRoot<Row>(props: ComposedChartProps<Row>): import("react").JSX.Element;
467
462
  /** Shared themed series and controls; other children retain native Recharts defaults. */
468
463
  export declare const ComposedChart: typeof ComposedChartRoot & {
469
464
  Dot: typeof ChartDot;
@@ -603,12 +598,5 @@ export declare function JourneyChart({ paths, unit, ariaLabel, className, format
603
598
  /** Stable React ID for SVG definitions and their URL references; safe with identifier prefixes. */
604
599
  export declare function useSvgId(): string;
605
600
  //#endregion
606
- //#region src/ui/index.d.ts
607
- export declare const TextWidget: typeof TextWidget$1;
608
- /** Compose an unframed visual with the shared heading and inspection. */
609
- export declare const VisualizationWidget: typeof VisualizationWidget$1;
610
- export declare const TableWidget: typeof TableWidget$1;
611
- export declare const MetricWidget: typeof MetricWidget$1;
612
- //#endregion
613
- export { AboutData, type AboutDataProps, type AboutEmpty, type AboutSubject, type AboutTab, AppIcon, type AppIconName, type AppIconProps, type AreaChartItem, type AreaChartProps, type BarChartItem, type BarChartProps, type BoundStory, type ChartCursorGroup, type ChartLegendItemProps, type ChartLegendLabelProps, type ChartLegendMarkerKind, type ChartLegendMarkerProps, type ChartLegendProps, type CheckboxGroupProps, type CheckboxProps, type ChoiceOption, type ChoicePickerProps, type ComposedChartLegendProps, type ComposedChartProps, type ControlBarProps, type CsvExport, type CsvTable, type DataAppProps, DataAppProvider, type DataAppStyle, type DataAppStyleHooks, type DataAppStyleToken, type DataReading, DataTable, DataTableEmptyRow, type DataTableEmptyRowProps, type DataTableProps, type DataTableSearch, DataTableShare, DataTableTimestamp, type DataTableTimestampProps, DataValue, type DataValueProps, DataWidget, type DataWidgetProps, DateDisplay, type DateDisplayProps, type DateTimeRangeComparison, type DateTimeRangeFilter, type DateTimeRangeFilterOptions, DateTimeRangePicker, type DateTimeRangePickerProps, type DateTimeRangePreset, type DateTimeRangeSelection, type ExplorationAction, ExplorationActionControl, type ExplorationActionControlProps, type FilterActionsProps, type FilterBarProps, type FunnelChartProps, type FunnelChartSeries, type FunnelChartStep, type GlossaryDefinitionProps, type GlossaryExplanationProps, type GradientScrollProps, HelpPopover, type HelpPopoverProps, type ItemActions, type JourneyChartPath, type JourneyChartProps, type LineChartItem, type LineChartProps, type LiveControlProps, type LiveIntervalSeconds, PressButton as MenuButton, type MenuItemProps, type MenuPopoverProps, type MenuProps, MenuSection, MenuTrigger, type MenuTriggerProps, type MetricReading, type MetricWidgetProps, Notice, type NoticeProps, type NumberFieldProps, type NumberFilterPickerProps, type NumberRange, type NumberRangeFieldProps, type PieChartItem, type PieChartProps, PresentStory, type PresentStoryProps, type RadioGroupProps, type RadioProps, type RetentionChartPoint, type RetentionChartProps, type RetentionChartSeries, type ScatterChartItem, type ScatterChartProps, type SearchAttribute, SearchField, type SearchFieldProps, type SearchHit, type SearchItemsOptions, type SearchMatchProps, type SearchMatchValue, type SearchRange, type SearchSuggestion, SearchTypeahead, type SearchTypeaheadProps, SectionHeading, type SectionHeadingProps, type SegmentedControlProps, type SelectProps, Sheet, type SheetProps, type ShimmerTextProps, type StoryFinding, TabPanels, type TableWidgetColumn, type TableWidgetProps, type TextWidgetProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type VisualizationWidgetProps, type WidgetStatus, dateTimeRangeFilter, dateTimeRangePresets, injectDataAppStyles, matchSearchText, searchItems, useAppFilters, useDateFormatting };
601
+ export { AboutData, type AboutDataProps, type AboutEmpty, type AboutSubject, type AboutTab, AppIcon, type AppIconName, type AppIconProps, type AreaChartItem, type AreaChartProps, type BarChartItem, type BarChartProps, type BoundStory, type ChartCursorGroup, type ChartLegendItemProps, type ChartLegendLabelProps, type ChartLegendMarkerKind, type ChartLegendMarkerProps, type ChartLegendProps, type CheckboxGroupProps, type CheckboxProps, type ChoiceOption, type ChoicePickerProps, type ComposedChartLegendProps, type ComposedChartProps, type ControlBarProps, type CsvExport, type CsvTable, DataAppProvider, type DataAppStyle, type DataAppStyleHooks, type DataAppStyleToken, type DataReading, DataTable, DataTableEmptyRow, type DataTableEmptyRowProps, type DataTableProps, type DataTableSearch, DataTableShare, DataTableTimestamp, type DataTableTimestampProps, DataWidget, type DataWidgetProps, DateDisplay, type DateDisplayProps, type DateTimeRangeComparison, type DateTimeRangeFilter, type DateTimeRangeFilterOptions, DateTimeRangePicker, type DateTimeRangePickerProps, type DateTimeRangePreset, type DateTimeRangeSelection, type ExplorationAction, ExplorationActionControl, type ExplorationActionControlProps, type FilterActionsProps, type FilterBarProps, type FunnelChartProps, type FunnelChartSeries, type FunnelChartStep, type GlossaryDefinitionProps, type GlossaryExplanationProps, type GradientScrollProps, HelpPopover, type HelpPopoverProps, type ItemActions, type JourneyChartPath, type JourneyChartProps, type LineChartItem, type LineChartProps, type LiveControlProps, type LiveIntervalSeconds, PressButton as MenuButton, type MenuItemProps, type MenuPopoverProps, type MenuProps, MenuSection, MenuTrigger, type MenuTriggerProps, type MetricReading, Notice, type NoticeProps, type NumberFieldProps, type NumberFilterPickerProps, type NumberRange, type NumberRangeFieldProps, type PieChartItem, type PieChartProps, PresentStory, type PresentStoryProps, type RadioGroupProps, type RadioProps, type RetentionChartPoint, type RetentionChartProps, type RetentionChartSeries, type ScatterChartItem, type ScatterChartProps, type SearchAttribute, SearchField, type SearchFieldProps, type SearchHit, type SearchItemsOptions, type SearchMatchProps, type SearchMatchValue, type SearchRange, type SearchSuggestion, SearchTypeahead, type SearchTypeaheadProps, SectionHeading, type SectionHeadingProps, type SegmentedControlProps, type SelectProps, Sheet, type SheetProps, type ShimmerTextProps, type StoryFinding, TabPanels, type TableWidgetColumn, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type WidgetStatus, dateTimeRangeFilter, dateTimeRangePresets, injectDataAppStyles, matchSearchText, searchItems, useAppFilters, useDateFormatting };
614
602
  //# sourceMappingURL=index.d.ts.map