@altertable/data-app-react 0.73.0 → 0.75.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,9 +1,9 @@
1
- import { $ as TableWidgetColumn, $t as defineDataIdentifiers, A as AppVariableValues, At as EmptyContent, B as dateRangeVariable, Bt as DataContext, C as MetricWidgetProps$1, Ct as CsvCell, D as DataAppControlProps, E as DataAppBaseProps, F as DateRangeVariableOptions, G as mountDataApp, Gt as StoryFinding, H as searchVariable, Ht as GlossaryEntry, I as MultiChoiceVariable, J as DataAppStyleToken, Jt as MetricDefinition, K as DataAppStyle, L as SearchVariable, M as ChoiceVariable, N as DateRangeSelection, P as DateRangeVariable, Qt as TableIdentifier, R as VariablePresentation, T as DataValueProps$1, Tt as CsvTable, Ut as createDataContext, V as multiChoiceVariable, Vt as EvidenceDeclaration, X as injectDataAppStyles, Xt as ColumnIdentifier, Y as DataAppStylesOptions, Yt as MetricComparison, Z as TableDisplayMode, Zt as DataIdentifierDefinition, _ as VisualizationWidgetView$1, a as SectionHeadingProps, c as TooltipProvider, d as AppIconName, en as Button, et as TableWidgetProps$1, g as VisualizationWidgetProps$1, i as SectionHeading, j as ChoiceOption, jt as WidgetEvidence, k as AppVariable, kt as ItemActions, l as TooltipProviderProps, m as HelpPopoverProps, n as DateDisplay, o as Tooltip, q as DataAppStyleHooks, r as DateDisplayProps, s as TooltipProps, t as useDateFormatting, tn as ButtonProps, tt as TableWidgetSearch, vt as SearchSuggestion, y as TextWidgetProps$1, z as choiceVariable, zt as AuthoringDataContext } from "./chunks/date-formatting.js";
1
+ import { $ as multiChoiceVariable, $t as EvidenceDeclaration, A as DataAppControlProps, At as SearchSuggestion, B as DateTimeRangeComparisonSelection, E as MetricWidgetProps$1, F as ChoiceVariable, Ft as CsvCell, G as DateTimeRangeVariableOptions, H as DateTimeRangeComparisonVariableOptions, Ht as EmptyContent, I as DateRangeSelection, J as VariablePresentation, K as MultiChoiceVariable, L as DateRangeVariable, Lt as CsvTable, M as AppVariable, N as AppVariableValues, O as DataValueProps$1, P as ChoiceOption, Q as dateTimeRangeVariable, Qt as DataContext, R as DateRangeVariableOptions, S as TextWidgetProps$1, U as DateTimeRangePreset, Ut as WidgetEvidence, V as DateTimeRangeComparisonVariable, Vt as ItemActions, W as DateTimeRangeVariable, X as dateRangeVariable, Y as choiceVariable, Z as dateTimeRangePresets, Zt as AuthoringDataContext, _ as HelpPopoverProps, a as DateDisplay, at as DataAppStyleHooks, b as VisualizationWidgetView$1, c as SectionHeadingProps, cn as ColumnIdentifier, ct as injectDataAppStyles, d as TooltipProvider, dn as defineDataIdentifiers, dt as TableWidgetColumn, en as GlossaryEntry, et as searchVariable, f as TooltipProviderProps, fn as Button, ft as TableWidgetProps$1, i as useDateFormatting, it as DataAppStyle, k as DataAppBaseProps, l as Tooltip, ln as DataIdentifierDefinition, lt as TableDisplayMode, m as AppIconName, n as DateTimeRangePickerProps, o as DateDisplayProps, on as MetricDefinition, ot as DataAppStyleToken, pn as ButtonProps, pt as TableWidgetSearch, q as SearchVariable, rn as StoryFinding, rt as mountDataApp, s as SectionHeading, sn as MetricComparison, st as DataAppStylesOptions, t as DateTimeRangePicker, tn as createDataContext, u as TooltipProps, un as TableIdentifier, y as VisualizationWidgetProps$1, z as DateTimeRangeComparisonRequest } from "./chunks/DateTimeRangePicker.js";
2
2
  import { DataClient, InputOf, OutputOf } from "@altertable/data-app/client";
3
3
  import { AppVariableValues as AppVariableValues$1, CheckedFacetContexts, CheckedVariableDeclarations, ChoiceVariable as ChoiceVariable$1, DataReading, DataView, DateRangeVariable as DateRangeVariable$1, DimensionFilterSettings, DimensionValue, DisplayedSnapshot, FacetVariable, IsUnion, MetricReading, MetricValues, MetricValues as MetricValues$1, VariableCollection } from "@altertable/data-app/internal";
4
4
  import { ComponentPropsWithRef, ReactNode, Ref, RefObject } from "react";
5
+ import { DataAppAnnotationDraft, DataOperations, DateRangeRequest, DateTimeRangeComparisonRequest as DateTimeRangeComparisonRequest$1, DateTimeRangeComparisonVariable as DateTimeRangeComparisonVariable$1, DimensionOption, DisclosedQuery, ReportingPeriod, ReportingPeriod as ReportingPeriod$1 } from "@altertable/data-app/contract";
5
6
  import { DateFormat, MetricFormat } from "@altertable/data-app/format";
6
- import { DataAppAnnotationDraft, DataOperations, DateRangeRequest, DimensionOption, DisclosedQuery, ReportingPeriod, ReportingPeriod as ReportingPeriod$1 } from "@altertable/data-app/contract";
7
7
  import { Theme } from "@altertable/data-app/appearance";
8
8
  //#region src/view-runtime.d.ts
9
9
  type ViewResult<Data, Input> = {
@@ -61,19 +61,19 @@ type DetailNavigation = {
61
61
  export declare function useDetailNavigation(): DetailNavigation;
62
62
  //#endregion
63
63
  //#region src/view.d.ts
64
- type ResolvedVariable<Variable> = Variable extends DateRangeVariable$1 ? DateRangeRequest : AppVariableValues$1<{
64
+ type ResolvedVariable<Variable> = Variable extends DateTimeRangeComparisonVariable$1 ? DateTimeRangeComparisonRequest$1 : Variable extends DateRangeVariable$1 ? DateRangeRequest : AppVariableValues$1<{
65
65
  value: Variable;
66
66
  }>['value'];
67
67
  type ResolvedVariables<Variables extends VariableCollection> = { [Key in keyof Variables]: ResolvedVariable<Variables[Key]> | (string extends keyof Variables ? undefined : never); };
68
- type DateVariableKey<Variables extends VariableCollection> = { [Key in keyof Variables]: Variables[Key] extends DateRangeVariable$1 ? Key : never; }[keyof Variables] & string;
68
+ type DateVariableKey<Variables extends VariableCollection> = { [Key in keyof Variables]: Variables[Key] extends DateRangeVariable$1 | DateTimeRangeComparisonVariable$1 ? Key : never; }[keyof Variables] & string;
69
+ /** Extract the selected range and comparison unchanged, including from nested inputs. */
69
70
  type ViewDate<Variables extends VariableCollection, Input> = {
70
71
  variable: DateVariableKey<Variables>;
71
- /** Extract the selected range and comparison unchanged, including from nested inputs. */
72
- input: (input: Input) => DateRangeRequest;
72
+ input: (input: Input) => DateRangeRequest | DateTimeRangeComparisonRequest$1;
73
73
  };
74
74
  /** Read variable values from a custom operation input; omitted keys use top-level fields. */
75
75
  type ViewBindings<Variables extends VariableCollection, Input> = Partial<{ [Key in keyof Variables]: (input: Input) => ResolvedVariables<Variables>[Key]; }>;
76
- type RequiredFilterBindingKeys<Variables extends VariableCollection, Input> = { [Key in keyof Variables]: Variables[Key]['kind'] extends 'dateRange' ? never : Variables[Key]['kind'] extends 'choice' ? [Input] extends [Record<Key, unknown>] ? ResolvedVariables<Variables>[Key] extends Input[Key] ? never : Key : Key : Extract<Variables[Key]['presentation'], {
76
+ type RequiredFilterBindingKeys<Variables extends VariableCollection, Input> = { [Key in keyof Variables]: Variables[Key]['kind'] extends 'dateRange' | 'dateTimeRangeComparison' ? never : Variables[Key]['kind'] extends 'choice' ? [Input] extends [Record<Key, unknown>] ? ResolvedVariables<Variables>[Key] extends Input[Key] ? never : Key : Key : Extract<Variables[Key]['presentation'], {
77
77
  group: 'display';
78
78
  }> extends never ? [Input] extends [Record<Key, ResolvedVariables<Variables>[Key]>] ? [ResolvedVariables<Variables>[Key]] extends [Input[Key]] ? never : Key : Key : never; }[keyof Variables];
79
79
  /** Derive compatible top-level filter bindings; require readers for other input shapes. */
@@ -266,9 +266,9 @@ declare class Dataset<Data, Input, Row> extends ExportDataset<Data, Input> {
266
266
  declare class Metric<Data, Input> extends RegisteredBinding {
267
267
  #private;
268
268
  readonly definition: MetricDefinition;
269
- constructor(definition: MetricDefinition, select: (data: Data, input: Input) => MetricValues$1, date?: (input: Input) => DateRangeRequest, owner?: object);
269
+ constructor(definition: MetricDefinition, select: (data: Data, input: Input) => MetricValues$1, date?: (input: Input) => DateRangeRequest | DateTimeRangeComparisonRequest$1, owner?: object);
270
270
  read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, MetricValues$1 & {
271
- period?: DateRangeRequest;
271
+ period?: DateRangeRequest | DateTimeRangeComparisonRequest$1;
272
272
  }>;
273
273
  records<DetailData, DetailInput>(options: {
274
274
  target: DetailView<DetailData, DetailInput>;
@@ -324,6 +324,34 @@ declare class ViewContent<Data, Input> {
324
324
  }
325
325
  //#endregion
326
326
  //#region src/hooks.d.ts
327
+ type CalendarTimeViewDefinition<Operations extends DataOperations, Name extends keyof Operations & string, Additional extends VariableCollection, Context extends AuthoringDataContext> = {
328
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
329
+ dataContext: Context;
330
+ time: Omit<DateRangeVariableOptions, 'key'>;
331
+ variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
332
+ period?: never;
333
+ } & Omit<CheckedFacetContexts<TimeVariables<NoInfer<Additional>>>, 'period'> & Omit<CheckedFacetSources<Operations, TimeVariables<NoInfer<Additional>>>, 'period'>;
334
+ isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
335
+ emptyFallback: EmptyContent;
336
+ } & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>;
337
+ type DateTimeViewDefinition<Operations extends DataOperations, Name extends keyof Operations & string, Additional extends VariableCollection, Context extends AuthoringDataContext, Period extends DateTimeRangeVariable | DateTimeRangeComparisonVariable = DateTimeRangeVariable> = Omit<DataViewDefinition<Name, {
338
+ period: Period;
339
+ } & NoInfer<Additional>, InputOf<Operations[Name]>, OutputOf<Operations[Name]>>, 'variables' | 'describeInput' | 'date'> & {
340
+ operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
341
+ dataContext: Context;
342
+ time: Period;
343
+ variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
344
+ period?: never;
345
+ } & Omit<CheckedFacetContexts<{
346
+ period: Period;
347
+ } & NoInfer<Additional>>, 'period'> & Omit<CheckedFacetSources<Operations, {
348
+ period: Period;
349
+ } & NoInfer<Additional>>, 'period'>;
350
+ } & ViewBindingOptions<{
351
+ period: Period;
352
+ } & NoInfer<Additional>, InputOf<Operations[Name]>, Period extends DateTimeRangeComparisonVariable ? InputOf<Operations[Name]> extends {
353
+ period: DateTimeRangeComparisonRequest;
354
+ } ? never : 'period' : never>;
327
355
  type TimeVariables<Additional extends VariableCollection> = {
328
356
  period: ReturnType<typeof dateRangeVariable>;
329
357
  } & Additional;
@@ -394,18 +422,15 @@ export declare function createDataHooks<Operations extends DataOperations>(clien
394
422
  operation: Name;
395
423
  dataContext: Context;
396
424
  }) => BoundDetailView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Context>;
397
- defineTimeView: <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: {
398
- operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown);
399
- dataContext: Context;
400
- time: Omit<DateRangeVariableOptions, 'key'>;
401
- variables?: Additional & CheckedVariableDeclarations<NoInfer<Additional>> & {
402
- period?: never;
403
- } & Omit<CheckedFacetContexts<TimeVariables<NoInfer<Additional>>>, 'period'> & Omit<CheckedFacetSources<Operations, TimeVariables<NoInfer<Additional>>>, 'period'>;
404
- isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
405
- emptyFallback: EmptyContent;
406
- } & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>) => BoundDataView<Name, {
407
- period: DateRangeVariable;
408
- } & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
425
+ defineTimeView: {
426
+ <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DateTimeViewDefinition<Operations, Name, Additional, Context, DateTimeRangeComparisonVariable>): BoundDataView<Name, {
427
+ period: DateTimeRangeComparisonVariable;
428
+ } & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
429
+ <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DateTimeViewDefinition<Operations, Name, Additional, Context>): BoundDataView<Name, {
430
+ period: DateTimeRangeVariable;
431
+ } & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, false>;
432
+ <Name extends keyof Operations & string, const Additional extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: CalendarTimeViewDefinition<Operations, Name, Additional, Context>): BoundDataView<Name, TimeVariables<Additional>, InputOf<Operations[Name]>, OutputOf<Operations[Name]>, Context, true>;
433
+ };
409
434
  defineFacetFilter: {
410
435
  <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, string>>(config: FacetConfig<Operations, string, Context, Name>): FacetVariable<string, Readonly<Context>, Name, InputOf<Operations[Name]>>;
411
436
  <const Context extends VariableCollection, const Name extends FacetOperationName<Operations, number>>(config: FacetConfig<Operations, number, Context, Name>): FacetVariable<number, Readonly<Context>, Name, InputOf<Operations[Name]>>;
@@ -419,10 +444,12 @@ type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'>
419
444
  };
420
445
  /** Show supplied datasets’ record suggestions on the first declared search. Defaults to true. */
421
446
  showSearchSuggestions?: boolean;
422
- story: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
447
+ /** Omit to leave presentation out of the toolbar. */
448
+ story?: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
423
449
  evidence: RegisteredBinding;
424
450
  })[];
425
- datasets: readonly [ExportDataset<Data, Input>, ...ExportDataset<Data, Input>[]];
451
+ /** Omit to leave CSV export out of the toolbar. */
452
+ datasets?: readonly [ExportDataset<Data, Input>, ...ExportDataset<Data, Input>[]];
426
453
  /** Detail destinations available to dataset actions and metric record inspection. */
427
454
  details?: readonly DetailContent<any, any>[];
428
455
  };
@@ -472,7 +499,7 @@ type MetricWidgetProps<Data = unknown, Input = unknown> = Omit<Extract<MetricWid
472
499
  records?: MetricRecords<Data, Input, any, any>;
473
500
  actions?: ExplorationActions<void, NoInfer<Input>>;
474
501
  };
475
- export declare function MetricWidget<Data, Input>({ metric, source, records, actions, action, ...presentation }: MetricWidgetProps<Data, Input>): import("react").JSX.Element;
502
+ declare function MetricWidgetContent<Data, Input>({ metric, source, records, actions, action, ...presentation }: MetricWidgetProps<Data, Input>): import("react").JSX.Element;
476
503
  type BoundTableProps<Row> = Extract<TableWidgetProps$1<Row>, {
477
504
  reading: DataReading<readonly Row[]>;
478
505
  }>;
@@ -483,7 +510,7 @@ type TableWidgetProps<Row, Data = unknown, Input = unknown> = Omit<BoundTablePro
483
510
  title?: ReactNode;
484
511
  actions?: ExplorationActions<NoInfer<Row>, NoInfer<Input>>;
485
512
  };
486
- export declare function TableWidget<Row, Data, Input>({ dataset, source, title, actions, ...presentation }: TableWidgetProps<Row, Data, Input>): import("react").JSX.Element;
513
+ declare function TableWidgetContent<Row, Data, Input>({ dataset, source, title, actions, ...presentation }: TableWidgetProps<Row, Data, Input>): import("react").JSX.Element;
487
514
  type BoundVisual<Row> = Extract<VisualizationWidgetProps$1<readonly Row[]>, {
488
515
  reading: DataReading<readonly Row[]>;
489
516
  }>;
@@ -508,7 +535,7 @@ type VisualizationWidgetProps<Row, Data = unknown, Input = unknown> = Omit<Bound
508
535
  actions?: ExplorationActions<NoInfer<Row>, NoInfer<Input>>;
509
536
  breakdown?: BreakdownTarget<any>;
510
537
  };
511
- export declare function VisualizationWidget<Row, Data, Input>({ dataset, source, title, actions, breakdown, children, views, viewLabel, initialView, ...presentation }: VisualizationWidgetProps<Row, Data, Input>): import("react").JSX.Element;
538
+ declare function VisualizationWidgetContent<Row, Data, Input>({ dataset, source, title, actions, breakdown, children, views, viewLabel, initialView, ...presentation }: VisualizationWidgetProps<Row, Data, Input>): import("react").JSX.Element;
512
539
  type NarrativeBinding<Data, Input, Row> = {
513
540
  metric: Metric<Data, Input>;
514
541
  dataset?: never;
@@ -525,7 +552,7 @@ type TextWidgetProps<Data = unknown, Input = unknown, Row = never> = Omit<Extrac
525
552
  }>, 'reading' | 'evidence' | 'children' | 'title' | 'emptyFallback'> & NarrativeBinding<Data, Input, Row> & {
526
553
  title?: ReactNode;
527
554
  };
528
- export declare function TextWidget<Data, Input, Row>(props: TextWidgetProps<Data, Input, Row>): import("react").JSX.Element;
555
+ declare function TextWidgetContent<Data, Input, Row>(props: TextWidgetProps<Data, Input, Row>): import("react").JSX.Element;
529
556
  type InlinePresentation = Omit<DataValueProps$1<unknown>, 'reading' | 'children' | 'loadingFallback'> & {
530
557
  loadingFallback?: ReactNode;
531
558
  };
@@ -539,6 +566,10 @@ type DataValueProps<Data = unknown, Input = unknown, Row = never> = InlinePresen
539
566
  children?: (scope: string) => ReactNode;
540
567
  });
541
568
  export declare function DataValue<Data, Input, Row>(props: DataValueProps<Data, Input, Row>): import("react").JSX.Element;
569
+ export declare const MetricWidget: typeof MetricWidgetContent;
570
+ export declare const TableWidget: typeof TableWidgetContent;
571
+ export declare const VisualizationWidget: typeof VisualizationWidgetContent;
572
+ export declare const TextWidget: typeof TextWidgetContent;
542
573
  //#endregion
543
574
  //#region src/ui/chartColor.d.ts
544
575
  export declare function chartColor(id: string): string;
@@ -684,6 +715,16 @@ type AnnotationTargetProps = ComponentPropsWithRef<'div'> & {
684
715
  /** A stable feedback target for app-owned content outside the built-in widgets. */
685
716
  export declare function AnnotationTarget({ annotationId, label, evidence, ...props }: AnnotationTargetProps): import("react").JSX.Element;
686
717
  //#endregion
718
+ //#region src/ui/ExternalLink.d.ts
719
+ type ExternalLinkProps = {
720
+ href: string;
721
+ children: ReactNode;
722
+ className?: string;
723
+ title?: string;
724
+ };
725
+ /** Open HTTPS links through the host when embedded, or a native new tab when standalone. */
726
+ export declare function ExternalLink({ href, children, className, title }: ExternalLinkProps): import("react").JSX.Element;
727
+ //#endregion
687
728
  //#region src/annotations/useDataAppAnnotations.d.ts
688
729
  /** Bind annotation delivery to this app's current iframe bridge. The host owns storage and submission. */
689
730
  export declare function useDataAppAnnotations(): {
@@ -741,5 +782,5 @@ export declare function AnnotationBar({ ref, annotations, active, theme, disable
741
782
  /** Install only the outer-frame annotation controls; leave host page typography and layout intact. */
742
783
  export declare function injectDataAppAnnotationStyles(options?: DataAppStylesOptions): HTMLStyleElement;
743
784
  //#endregion
744
- export { type AnnotationBarHandle, type AnnotationBarProps, type AnnotationTargetProps, type AppVariable, type AppVariableValues, type BreakdownItem, type BreakdownProps, Button, type ButtonProps, type ChoiceOption, type ChoiceVariable, type ColumnIdentifier, type ComparisonProps, type CsvCell, type DataAppProps, type DataAppStyle, type DataAppStyleHooks, type DataAppStyleToken, type DataAppStylesOptions, type DataContext, type DataIdentifierDefinition, type DataSectionProps, type DataValueProps, type DatasetColumn, type DatasetDeclaration as DatasetDefinition, type DatasetSuggestionOptions, DateDisplay, type DateDisplayProps, type DateRangeSelection, type DateRangeVariable, type DateRangeVariableOptions, type DateTimeTooltipProps, type DetailViewDefinition, type EmptyStateProps, type GlossaryEntry, type GridItemProps, type GridProps, type IconButtonProps, type MetricDefinition, type MetricRecords, type MetricValues, type MetricWidgetProps, type MultiChoiceVariable, type PeriodComparison, type PeriodSummaryProps, type RankingItem, type RankingProps, type ReportingPeriod, type SearchVariable, SectionHeading, type SectionHeadingProps, type SkeletonProps, type StackProps, type TableIdentifier, type TableWidgetProps, type TableWidgetSearch, type TextContentProps, type TextWidgetProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type UpdatedAtProps, type VariablePresentation, type VisualizationWidgetProps, type VisualizationWidgetView, type WidgetEvidence, choiceVariable, createDataContext, dateRangeVariable, defineDataIdentifiers, injectDataAppStyles, mountDataApp, multiChoiceVariable, searchVariable, useDateFormatting };
785
+ export { type AnnotationBarHandle, type AnnotationBarProps, type AnnotationTargetProps, type AppVariable, type AppVariableValues, type BreakdownItem, type BreakdownProps, Button, type ButtonProps, type ChoiceOption, type ChoiceVariable, type ColumnIdentifier, type ComparisonProps, type CsvCell, type DataAppProps, type DataAppStyle, type DataAppStyleHooks, type DataAppStyleToken, type DataAppStylesOptions, type DataContext, type DataIdentifierDefinition, type DataSectionProps, type DataValueProps, type DatasetColumn, type DatasetDeclaration as DatasetDefinition, type DatasetSuggestionOptions, DateDisplay, type DateDisplayProps, type DateRangeSelection, type DateRangeVariable, type DateRangeVariableOptions, type DateTimeRangeComparisonRequest, type DateTimeRangeComparisonSelection, type DateTimeRangeComparisonVariable, type DateTimeRangeComparisonVariableOptions, DateTimeRangePicker, type DateTimeRangePickerProps, type DateTimeRangePreset, type DateTimeRangeVariable, type DateTimeRangeVariableOptions, type DateTimeTooltipProps, type DetailViewDefinition, type EmptyStateProps, type ExternalLinkProps, type GlossaryEntry, type GridItemProps, type GridProps, type IconButtonProps, type MetricDefinition, type MetricRecords, type MetricValues, type MetricWidgetProps, type MultiChoiceVariable, type PeriodComparison, type PeriodSummaryProps, type RankingItem, type RankingProps, type ReportingPeriod, type SearchVariable, SectionHeading, type SectionHeadingProps, type SkeletonProps, type StackProps, type TableIdentifier, type TableWidgetProps, type TableWidgetSearch, type TextContentProps, type TextWidgetProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type UpdatedAtProps, type VariablePresentation, type VisualizationWidgetProps, type VisualizationWidgetView, type WidgetEvidence, choiceVariable, createDataContext, dateRangeVariable, dateTimeRangePresets, dateTimeRangeVariable, defineDataIdentifiers, injectDataAppStyles, mountDataApp, multiChoiceVariable, searchVariable, useDateFormatting };
745
786
  //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,11 @@
1
- import { $ as TableWidgetColumn, Bt as DataContext, C as MetricWidgetProps, Dt as ExplorationActionControl, Et as ExplorationAction, Ft as AboutSubject, Gt as StoryFinding, Ht as GlossaryEntry, It as AboutTab, J as DataAppStyleToken, K as DataAppStyle, Kt as PresentStory, Lt as Sheet, Mt as AboutData, Nt as AboutDataProps, O as StaticDataAppProps, Ot as ExplorationActionControlProps, Pt as AboutEmpty, Q as TableWidget, Rt as SheetProps, S as MetricWidget, St as SearchFieldProps, T as DataValueProps, Tt as CsvTable, U as useAppVariables, W as DataAppProvider, Wt as BoundStory, X as injectDataAppStyles, _t as DataTableTimestampProps, a as SectionHeadingProps, at as SearchMatchValue, b as DataWidget, bt as SearchTypeaheadProps, c as TooltipProvider, ct as searchItems, d as AppIconName, dt as DataTableEmptyRow, et as TableWidgetProps, f as AppIconProps, ft as DataTableEmptyRowProps, g as VisualizationWidgetProps, gt as DataTableTimestamp, h as VisualizationWidget, ht as DataTableShare, i as SectionHeading, it as SearchItemsOptions, kt as ItemActions, l as TooltipProviderProps, lt as WidgetStatus, m as HelpPopoverProps, mt as DataTableSearch, n as DateDisplay, nn as PressButton, nt as SearchAttribute, o as Tooltip, ot as SearchRange, p as HelpPopover, pt as DataTableProps, q as DataAppStyleHooks, qt as PresentStoryProps, r as DateDisplayProps, rt as SearchHit, s as TooltipProps, st as matchSearchText, t as useDateFormatting, u as AppIcon, ut as DataTable, v as TextWidget, vt as SearchSuggestion, w as DataValue, wt as CsvExport, x as DataWidgetProps, xt as SearchField, y as TextWidgetProps, yt as SearchTypeahead } from "../chunks/date-formatting.js";
1
+ import { At as SearchSuggestion, B as DateTimeRangeComparisonSelection, Bt as ExplorationActionControlProps, C as DataWidget, Ct as DataTableEmptyRow, D as DataValue, Dt as DataTableShare, E as MetricWidgetProps, Et as DataTableSearch, G as DateTimeRangeVariableOptions, Gt as AboutDataProps, H as DateTimeRangeComparisonVariableOptions, It as CsvExport, Jt as AboutTab, Kt as AboutEmpty, Lt as CsvTable, Mt as SearchTypeaheadProps, Nt as SearchField, O as DataValueProps, Ot as DataTableTimestamp, Pt as SearchFieldProps, Q as dateTimeRangeVariable, Qt as DataContext, Rt as ExplorationAction, S as TextWidgetProps, St as DataTable, T as MetricWidget$1, Tt as DataTableProps, U as DateTimeRangePreset, V as DateTimeRangeComparisonVariable, Vt as ItemActions, W as DateTimeRangeVariable, Wt as AboutData, Xt as SheetProps, Yt as Sheet, Z as dateTimeRangePresets, _ as HelpPopoverProps, _t as SearchMatchValue, a as DateDisplay, an as PresentStoryProps, at as DataAppStyleHooks, bt as searchItems, c as SectionHeadingProps, ct as injectDataAppStyles, d as TooltipProvider, dt as TableWidgetColumn, en as GlossaryEntry, f as TooltipProviderProps, ft as TableWidgetProps, g as HelpPopover, gt as SearchItemsOptions, h as AppIconProps, ht as SearchHit, i as useDateFormatting, in as PresentStory, it as DataAppStyle, j as StaticDataAppProps, jt as SearchTypeahead, kt as DataTableTimestampProps, l as Tooltip, m as AppIconName, mn as PressButton, mt as SearchAttribute, n as DateTimeRangePickerProps, nn as BoundStory, nt as DataAppProvider, o as DateDisplayProps, ot as DataAppStyleToken, p as AppIcon, qt as AboutSubject, r as ControlLabelPlacement, rn as StoryFinding, s as SectionHeading, t as DateTimeRangePicker, tt as useAppVariables, u as TooltipProps, ut as TableWidget$1, v as VisualizationWidget$1, vt as SearchRange, w as DataWidgetProps, wt as DataTableEmptyRowProps, x as TextWidget$1, xt as WidgetStatus, y as VisualizationWidgetProps, yt as matchSearchText, z as DateTimeRangeComparisonRequest, zt as ExplorationActionControl } from "../chunks/DateTimeRangePicker.js";
2
2
  import { ChoiceOption, ChoiceOption as ChoiceOption$1, DataReading, DatePresetId, DatePresetId as DatePresetId$1, DateRange, DateRange as DateRange$1, DimensionSelectionVariable, DimensionValue, MetricReading } from "@altertable/data-app/internal";
3
3
  import { ComponentProps, ComponentPropsWithRef, ReactNode, RefAttributes } from "react";
4
4
  import { DateRangePicker as DateRangePicker$1, MenuItemProps, MenuProps, MenuSection, MenuTrigger, MenuTriggerProps, NumberField as NumberField$1, Popover, Radio as Radio$1, RadioGroup as RadioGroup$1, Separator } from "react-aria-components";
5
5
  import { Tab as Tab$1, TabListProps, TabPanel as TabPanel$1, TabPanels, Tabs as Tabs$1 } from "react-aria-components/Tabs";
6
- import { CalendarDate } from "@internationalized/date";
7
6
  import { DimensionOption, DimensionSelection, DisclosedQuery, NumberFilter, NumberSelection } from "@altertable/data-app/contract";
7
+ import { MetricFormat } from "@altertable/data-app/format";
8
+ import { CalendarDate } from "@internationalized/date";
8
9
  import { AreaProps, BarProps, Brush, CartesianGrid, ComposedChart as ComposedChart$1, DefaultTooltipContent, DotProps, ErrorBar, Label as Label$1, LabelList, Legend, LineProps, ReferenceArea, ReferenceDot, ReferenceLine, Scatter, Tooltip as Tooltip$1, XAxis, YAxis, ZAxis } from "recharts";
9
10
  //#region src/ui/keyboard.d.ts
10
11
  type KeyEvent = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'isComposing'>;
@@ -20,10 +21,6 @@ export declare function GettingStarted({ dataContext }: {
20
21
  dataContext: DataContext;
21
22
  }): import("react").JSX.Element;
22
23
  //#endregion
23
- //#region src/ui/PickerField.d.ts
24
- /** Inline labels sit with the value; above and beside labels have a separate layout slot. */
25
- type ControlLabelPlacement = 'inline' | 'above' | 'beside';
26
- //#endregion
27
24
  //#region src/ui/DimensionPicker.d.ts
28
25
  /** Adapts the typed dimension contract to the shared ChoicePicker control. */
29
26
  export declare function DimensionPicker<T extends DimensionValue>({ filter, labelPlacement, value, onChange, options: suppliedOptions, loading, error, onRetry }: {
@@ -80,6 +77,14 @@ type SearchMatchProps = {
80
77
  } & Omit<ComponentPropsWithRef<'span'>, 'children'>;
81
78
  export declare function SearchMatch({ match, className, ...props }: SearchMatchProps): import("react").JSX.Element;
82
79
  //#endregion
80
+ //#region src/ui/ShimmerText.d.ts
81
+ type ShimmerTextProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {
82
+ children: string;
83
+ };
84
+ /** Animated text for custom activity labels. Wrap in `<output>` to announce updates.
85
+ * Respects reduced motion. */
86
+ export declare function ShimmerText({ children, className, ...props }: ShimmerTextProps): import("react").JSX.Element;
87
+ //#endregion
83
88
  //#region src/ui/ChoicePicker.d.ts
84
89
  type SharedProps = {
85
90
  label: string;
@@ -424,6 +429,9 @@ type ComposedChartProps<Row = unknown> = Omit<ComponentProps<typeof ComposedChar
424
429
  data: readonly Row[];
425
430
  /** Describes the measures and scope for assistive technology. */
426
431
  ariaLabel: string;
432
+ /** Shared measure semantics: compact numeric axes and precise tooltips.
433
+ * For mixed units, use explicit axis tickFormatter and series/tooltip formatters. */
434
+ valueFormat?: MetricFormat;
427
435
  };
428
436
  /** Compose Cartesian series inside VisualizationWidget. Defaults to responsive
429
437
  * full width and 300px height. Children retain native Recharts props and behavior,
@@ -432,7 +440,7 @@ type ComposedChartProps<Row = unknown> = Omit<ComponentProps<typeof ComposedChar
432
440
  * for stacks. Preserve missing measures as null and choose connectNulls deliberately.
433
441
  * Use public chart tokens for series colors. Dataset bindings own
434
442
  * loading, empty results, evidence, and CSV; this primitive owns only the plot. */
435
- declare function ComposedChartRoot<Row>({ data, ariaLabel, width, height, responsive, className, ...props }: ComposedChartProps<Row>): import("react").JSX.Element;
443
+ declare function ComposedChartRoot<Row>({ data, ariaLabel, valueFormat, width, height, responsive, className, ...props }: ComposedChartProps<Row>): import("react").JSX.Element;
436
444
  /** Shared themed series and controls; other children retain native Recharts defaults. */
437
445
  export declare const ComposedChart: typeof ComposedChartRoot & {
438
446
  Dot: typeof ChartDot;
@@ -568,5 +576,12 @@ export declare function JourneyChart({ paths, unit, ariaLabel, className, format
568
576
  /** Stable React ID for SVG definitions and their URL references; safe with identifier prefixes. */
569
577
  export declare function useSvgId(): string;
570
578
  //#endregion
571
- 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 ChartLegendItemProps, type ChartLegendLabelProps, type ChartLegendMarkerKind, type ChartLegendMarkerProps, type ChartLegendProps, type CheckboxGroupProps, type CheckboxProps, type ChoiceOption, type ChoicePickerProps, type ComposedChartLegendProps, type ComposedChartProps, 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 DatePresetId, type DateRange, type DateRangePickerProps, 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, MetricWidget, type MetricWidgetProps, 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 StoryFinding, TabPanels, TableWidget, type TableWidgetColumn, type TableWidgetProps, TextWidget, type TextWidgetProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type VariableBarProps, VisualizationWidget, type VisualizationWidgetProps, type WidgetStatus, injectDataAppStyles, matchSearchText, searchItems, useAppVariables, useDateFormatting };
579
+ //#region src/ui/index.d.ts
580
+ export declare const TextWidget: typeof TextWidget$1;
581
+ /** Compose an unframed visual with the shared heading and inspection. */
582
+ export declare const VisualizationWidget: typeof VisualizationWidget$1;
583
+ export declare const TableWidget: typeof TableWidget$1;
584
+ export declare const MetricWidget: typeof MetricWidget$1;
585
+ //#endregion
586
+ 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 ChartLegendItemProps, type ChartLegendLabelProps, type ChartLegendMarkerKind, type ChartLegendMarkerProps, type ChartLegendProps, type CheckboxGroupProps, type CheckboxProps, type ChoiceOption, type ChoicePickerProps, type ComposedChartLegendProps, type ComposedChartProps, 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 DatePresetId, type DateRange, type DateRangePickerProps, type DateTimeRangeComparisonRequest, type DateTimeRangeComparisonSelection, type DateTimeRangeComparisonVariable, type DateTimeRangeComparisonVariableOptions, DateTimeRangePicker, type DateTimeRangePickerProps, type DateTimeRangePreset, type DateTimeRangeVariable, type DateTimeRangeVariableOptions, 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, 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 VariableBarProps, type VisualizationWidgetProps, type WidgetStatus, dateTimeRangePresets, dateTimeRangeVariable, injectDataAppStyles, matchSearchText, searchItems, useAppVariables, useDateFormatting };
572
587
  //# sourceMappingURL=index.d.ts.map
package/dist/ui/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { $ as DateRangePicker, A as Menu, At as DataAppProvider, B as createDataHooks, Bt as GradientScroll, C as useChartActions, F as MenuTrigger, Ft as TabPanel, G as SearchTypeahead, H as useDeclaredResult, Ht as TooltipProvider, It as TabPanels, J as NumberField, Jt as AppIcon, K as SearchField, Lt as Tabs, M as MenuPopover, Mt as AboutData, N as MenuSection, Nt as Tab, O as PresentStory, P as MenuSeparator, Pt as TabList, Q as FilterBar, Qt as classNames, Rt as useViewTab, S as openExplorationMenu, T as DataAppFrame, U as VariableBar, Ut as TooltipSurface, Vt as Tooltip, W as FilterActions, X as DimensionPicker, Xt as Button$1, Y as NumberRangeField, Z as Select, Zt as PressButton, a as TextWidget, b as explorationMenuEvents, c as DataTableEmptyRow, d as MetricWidget, en as useDateFormatting, et as Checkbox, f as VisualizationWidget, ft as useAppVariables, it as SearchMatch, j as MenuItem, k as LiveControl, l as DataTableShare, n as createDataContext, nn as injectDataAppStyles, nt as ChoicePicker, o as TableWidget, ot as matchSearchText, p as DataWidget, q as NumberFilterPicker, r as chartBarFill, s as DataTable, st as searchItems, t as SectionHeading, tt as CheckboxGroupContext, u as DataTableTimestamp, v as ExplorationActionControl, w as DataValue, x as getPrimaryExplorationAction, xt as HelpPopover, y as ExplorationActionMenu, yt as DateDisplay, z as isPlainKeyEvent, zt as Sheet } from "../chunks/SectionHeading-CVenpddF.js";
1
+ import { $ as DateTimeRangePicker, $t as AppIcon, A as LiveControl, B as isPlainKeyEvent, Bt as TabPanel, Ct as DateDisplay, E as DataAppFrame, F as MenuSeparator, Ft as DataAppProvider, G as FilterActions, Gt as GradientScroll, Ht as Tabs, I as MenuTrigger, J as NumberFilterPicker, Jt as TooltipSurface, K as SearchTypeahead, Kt as Tooltip, Lt as AboutData, M as MenuItem, N as MenuPopover, P as MenuSection, Q as FilterBar, Rt as Tab, S as withWidgetBoundary, T as DataValue, Tt as HelpPopover, U as useDeclaredResult, Ut as useViewTab, V as createDataHooks, Vt as TabPanels, W as VariableBar, Wt as Sheet, X as NumberRangeField, Y as NumberField, Z as DimensionPicker, _ as explorationMenuEvents, a as TextWidget$1, an as useDateFormatting, b as useChartActions, c as DataTableEmptyRow, ct as matchSearchText, d as MetricWidget$1, et as Select, f as VisualizationWidget$1, ft as dateTimeRangePresets, g as ExplorationActionMenu, gt as useAppVariables, h as ExplorationActionControl, it as ChoicePicker, j as Menu, jt as ShimmerText, k as PresentStory, l as DataTableShare, lt as searchItems, n as createDataContext, nn as PressButton, nt as Checkbox, o as TableWidget$1, ot as SearchMatch, pt as dateTimeRangeVariable, q as SearchField, qt as TooltipProvider, r as chartBarFill, rn as classNames, rt as CheckboxGroupContext, s as DataTable, sn as injectDataAppStyles, t as SectionHeading, tn as Button$1, tt as DateRangePicker, u as DataTableTimestamp, v as getPrimaryExplorationAction, x as DataWidget, y as openExplorationMenu, zt as TabList } from "../chunks/SectionHeading-CLvnHe1C.js";
2
2
  import { createDataClient } from "@altertable/data-app/client";
3
3
  import { KEY_SEPARATOR, invariant, validateChoiceOptions } from "@altertable/data-app/internal";
4
4
  import { Children, Fragment, createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { Label, Radio as Radio$1, RadioGroup as RadioGroup$1 } from "react-aria-components";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
- import { formatDate, formatDateTime, formatNumber, formatPercent, parseDateTime } from "@altertable/data-app/format";
8
- import { Area, AreaChart as AreaChart$1, Bar, BarChart as BarChart$1, Brush, CartesianGrid, Cell, ComposedChart as ComposedChart$1, DefaultTooltipContent, Dot, ErrorBar, Label as Label$1, LabelList, Legend, Line, LineChart as LineChart$1, ReferenceArea, ReferenceDot, ReferenceLine, Scatter, Tooltip as Tooltip$1, XAxis, YAxis, ZAxis, usePlotArea } from "recharts";
7
+ import { formatDate, formatDateTime, formatMetric, formatNumber, formatPercent, parseDateTime } from "@altertable/data-app/format";
8
+ import { Area, AreaChart as AreaChart$1, Bar, BarChart as BarChart$1, Brush, CartesianGrid, Cell, ComposedChart as ComposedChart$1, DefaultTooltipContent, Dot, ErrorBar, Label as Label$1, LabelList, Legend, Line, LineChart as LineChart$1, ReferenceArea, ReferenceDot, ReferenceLine, Scatter, Tooltip as Tooltip$1, XAxis, YAxis, ZAxis, usePlotArea, useYAxisTicks } from "recharts";
9
9
  //#region src/ui/StaticDataApp.tsx
10
10
  /** Setup and static screens; fetched data uses the declared-view DataApp. */
11
11
  function DataApp(props) {
@@ -753,15 +753,32 @@ function ChartDateAxes({ data, children }) {
753
753
  return next;
754
754
  });
755
755
  }, []);
756
+ const [barAxes, setBarAxes] = useState(() => /* @__PURE__ */ new Map());
757
+ const registerBar = useCallback((id) => {
758
+ setBarAxes((current) => new Map(current).set(id, (current.get(id) ?? 0) + 1));
759
+ return () => setBarAxes((current) => {
760
+ const next = new Map(current);
761
+ const count = (next.get(id) ?? 1) - 1;
762
+ if (count) next.set(id, count);
763
+ else next.delete(id);
764
+ return next;
765
+ });
766
+ }, []);
756
767
  return /* @__PURE__ */ jsx(ChartDateAxesContext.Provider, {
757
768
  value: {
758
769
  data,
759
770
  formatters,
760
- register
771
+ register,
772
+ barAxes,
773
+ registerBar
761
774
  },
762
775
  children
763
776
  });
764
777
  }
778
+ function useDateAxisBar(id = 0) {
779
+ const registerBar = useContext(ChartDateAxesContext)?.registerBar;
780
+ useLayoutEffect(() => registerBar?.(id), [registerBar, id]);
781
+ }
765
782
  function useDateAxisLabel(id = 0) {
766
783
  return useContext(ChartDateAxesContext)?.formatters.get(id);
767
784
  }
@@ -771,6 +788,7 @@ function field(row, key) {
771
788
  return String(key).replace(/\[(\d+)\]/g, ".$1").split(".").reduce((value, part) => value != null && typeof value === "object" ? value[part] : void 0, row);
772
789
  }
773
790
  const xAxisDefaults = {
791
+ interval: "preserveStartEnd",
774
792
  stroke: "var(--atbl-muted)",
775
793
  tickFormatter: (value) => typeof value === "number" ? formatNumber(value) : String(value),
776
794
  tickLine: false,
@@ -813,7 +831,7 @@ function ChartXAxis(props) {
813
831
  return /* @__PURE__ */ jsx(XAxis, {
814
832
  ...xAxisDefaults,
815
833
  scale: "utc",
816
- domain: model.start === model.end ? [model.start - model.minimumInterval / 2, model.end + model.minimumInterval / 2] : [model.start, model.end],
834
+ domain: model.start === model.end || context?.barAxes.has(id) ? [model.start - model.minimumInterval / 2, model.end + model.minimumInterval / 2] : [model.start, model.end],
817
835
  ticks: automaticTicks?.ticks,
818
836
  interval: automaticTicks ? 0 : void 0,
819
837
  height: 48,
@@ -868,6 +886,43 @@ function ChartSeries({ id, children }) {
868
886
  });
869
887
  }
870
888
  //#endregion
889
+ //#region src/ui/chart-value-format.ts
890
+ const ChartValueFormat = createContext(void 0);
891
+ /** Use one magnitude for every tick, and enough precision to distinguish them. */
892
+ function axisValueFormatter(values, format) {
893
+ const magnitude = Math.max(0, ...values.map(Math.abs));
894
+ const exponent = format?.kind !== "ratio" && !(format?.kind === "count" && format.compact === false) && magnitude >= 1e3 ? Math.min(12, Math.floor(Math.log10(magnitude) / 3) * 3) : 0;
895
+ const divisor = 10 ** exponent;
896
+ const sorted = [...new Set(values)].sort((a, b) => a - b);
897
+ const displayStep = sorted.slice(1).reduce((minimum, value, index) => Math.min(minimum, value - sorted[index]), Infinity) / divisor * (format?.kind === "ratio" ? 100 : 1);
898
+ const digits = Number.isFinite(displayStep) && displayStep > 0 ? Math.min(20, Math.max(0, -Math.floor(Math.log10(displayStep)) + 1)) : 2;
899
+ const locale = format?.locale ?? "en-US";
900
+ const options = {
901
+ maximumFractionDigits: digits,
902
+ minimumFractionDigits: 0,
903
+ ...format?.kind === "currency" ? {
904
+ style: "currency",
905
+ currency: format.currency
906
+ } : {},
907
+ ...format?.kind === "ratio" ? { style: "percent" } : {}
908
+ };
909
+ const suffix = [
910
+ "",
911
+ "k",
912
+ "M",
913
+ "B",
914
+ "T"
915
+ ][exponent / 3];
916
+ const formatter = new Intl.NumberFormat(locale, options);
917
+ return (value) => {
918
+ if (typeof value !== "number") return String(value);
919
+ if (!Number.isFinite(value)) return formatNumber(value);
920
+ const parts = formatter.formatToParts(value === 0 ? 0 : value / divisor);
921
+ const index = parts.findLastIndex((part) => part.type === "integer" || part.type === "fraction");
922
+ return parts.map((part, i) => part.value + (i === index && value !== 0 ? suffix : "")).join("");
923
+ };
924
+ }
925
+ //#endregion
871
926
  //#region src/ui/ChartLegend.tsx
872
927
  /** Optional chart key, placed beside any chart with the app's layout components.
873
928
  * Items describe displayed series or categories; the caller owns series visibility and interactions. */
@@ -1044,6 +1099,7 @@ function NearestChartDot({ seriesId, cx, cy, stroke }) {
1044
1099
  }
1045
1100
  /** Shared series defaults; native props override every authored choice. */
1046
1101
  function ChartBar(props) {
1102
+ useDateAxisBar(props.xAxisId);
1047
1103
  const series = useChartSeries(props.id);
1048
1104
  return /* @__PURE__ */ jsx(ChartSeries, {
1049
1105
  id: series.id,
@@ -1136,9 +1192,12 @@ function ChartScatter(props) {
1136
1192
  });
1137
1193
  }
1138
1194
  function ChartYAxis(props) {
1195
+ const format = useContext(ChartValueFormat);
1196
+ const formatter = axisValueFormatter((useYAxisTicks(props.yAxisId) ?? []).map((tick) => tick.value).filter((value) => typeof value === "number"), format);
1139
1197
  return /* @__PURE__ */ jsx(YAxis, {
1198
+ width: "auto",
1140
1199
  stroke: "var(--atbl-muted)",
1141
- tickFormatter: (value) => typeof value === "number" ? formatNumber(value) : String(value),
1200
+ tickFormatter: formatter,
1142
1201
  tickLine: false,
1143
1202
  axisLine: false,
1144
1203
  tick: { fontSize: "var(--atbl-type-meta-size)" },
@@ -1153,6 +1212,10 @@ function ChartGrid(props) {
1153
1212
  });
1154
1213
  }
1155
1214
  function ChartTooltipContent(props) {
1215
+ const valueFormat = useContext(ChartValueFormat);
1216
+ function formatValue(value) {
1217
+ return valueFormat ? formatMetric(value, valueFormat) : formatNumber(value);
1218
+ }
1156
1219
  if (!props.active || !props.payload?.length) return null;
1157
1220
  return /* @__PURE__ */ jsx(TooltipSurface, {
1158
1221
  "data-variant": "chart",
@@ -1165,7 +1228,7 @@ function ChartTooltipContent(props) {
1165
1228
  unit: void 0,
1166
1229
  formatter: (value, name, _item, index, payload) => {
1167
1230
  const formatter = entry.formatter ?? props.formatter;
1168
- const formatted = formatter ? formatter(value, name, entry, index, props.payload ?? payload) : Array.isArray(value) ? value.map((item) => typeof item === "number" ? formatNumber(item) : item).join(" ~ ") : typeof value === "number" ? formatNumber(value) : value;
1231
+ const formatted = formatter ? formatter(value, name, entry, index, props.payload ?? payload) : Array.isArray(value) ? value.map((item) => typeof item === "number" ? formatValue(item) : item).join(" ~ ") : typeof value === "number" ? formatValue(value) : value;
1169
1232
  if (formatted == null) return null;
1170
1233
  const [displayValue, displayName] = Array.isArray(formatted) ? formatted : [formatted, name];
1171
1234
  return [/* @__PURE__ */ jsxs("span", {
@@ -1848,7 +1911,10 @@ function BarChart({ items, unit, ariaLabel, formatValue = formatNumber, itemActi
1848
1911
  else menuTriggers.current.delete(item.id);
1849
1912
  },
1850
1913
  "aria-label": `${item.label}: Actions`,
1851
- children: [item.label, /* @__PURE__ */ jsx(AppIcon, {
1914
+ children: [/* @__PURE__ */ jsx("span", {
1915
+ title: item.label,
1916
+ children: item.label
1917
+ }), /* @__PURE__ */ jsx(AppIcon, {
1852
1918
  name: "disclosure",
1853
1919
  size: 12
1854
1920
  })]
@@ -1859,7 +1925,10 @@ function BarChart({ items, unit, ariaLabel, formatValue = formatNumber, itemActi
1859
1925
  placement: "bottom"
1860
1926
  })] }) : /* @__PURE__ */ jsx("span", {
1861
1927
  className: "altertable-selectable-bars-label",
1862
- children: item.label
1928
+ children: /* @__PURE__ */ jsx("span", {
1929
+ title: item.label,
1930
+ children: item.label
1931
+ })
1863
1932
  })
1864
1933
  })]
1865
1934
  }) }, item.id);
@@ -2059,7 +2128,7 @@ function findNearestSeriesId(hoveredSeriesId, points, position) {
2059
2128
  * for stacks. Preserve missing measures as null and choose connectNulls deliberately.
2060
2129
  * Use public chart tokens for series colors. Dataset bindings own
2061
2130
  * loading, empty results, evidence, and CSV; this primitive owns only the plot. */
2062
- function ComposedChartRoot({ data, ariaLabel, width = "100%", height = 300, responsive = true, className, ...props }) {
2131
+ function ComposedChartRoot({ data, ariaLabel, valueFormat, width = "100%", height = 300, responsive = true, className, ...props }) {
2063
2132
  const [hasPointerFocus, setHasPointerFocus] = useState(false);
2064
2133
  const [isPointerInspection, setIsPointerInspection] = useState(false);
2065
2134
  const [hoveredSeriesId, setHoveredSeriesId] = useState(null);
@@ -2145,16 +2214,19 @@ function ComposedChartRoot({ data, ariaLabel, width = "100%", height = 300, resp
2145
2214
  resetPointerInspection();
2146
2215
  }
2147
2216
  },
2148
- children: /* @__PURE__ */ jsx(ChartDateAxes, {
2149
- data,
2150
- children: /* @__PURE__ */ jsx(ComposedChart$1, {
2151
- "data-atbl-focus": "inset",
2152
- ...props,
2217
+ children: /* @__PURE__ */ jsx(ChartValueFormat.Provider, {
2218
+ value: valueFormat,
2219
+ children: /* @__PURE__ */ jsx(ChartDateAxes, {
2153
2220
  data,
2154
- width,
2155
- height,
2156
- responsive,
2157
- "aria-label": ariaLabel
2221
+ children: /* @__PURE__ */ jsx(ComposedChart$1, {
2222
+ "data-atbl-focus": "inset",
2223
+ ...props,
2224
+ data,
2225
+ width,
2226
+ height,
2227
+ responsive,
2228
+ "aria-label": ariaLabel
2229
+ })
2158
2230
  })
2159
2231
  })
2160
2232
  })
@@ -2891,6 +2963,14 @@ function JourneyFlow({ paths, unit, formatValue }) {
2891
2963
  });
2892
2964
  }
2893
2965
  //#endregion
2894
- export { AboutData, AppIcon, AreaChart, BarChart, ChartLegend, Checkbox, CheckboxGroup, ChoicePicker, ComposedChart, DataApp, DataAppProvider, DataTable, DataTableEmptyRow, DataTableShare, DataTableTimestamp, DataValue, DataWidget, DateDisplay, DateRangePicker, DimensionPicker, ExplorationActionControl, FilterActions, FilterBar, FunnelChart, GettingStarted, GlossaryDefinition, GlossaryExplanation, GradientScroll, HelpPopover, JourneyChart, LineChart, LiveControl, Menu, PressButton as MenuButton, MenuItem, MenuPopover, MenuSection, MenuSeparator, MenuTrigger, MetricWidget, NumberField, NumberFilterPicker, NumberRangeField, PieChart, PresentStory, Radio, RadioGroup, RetentionChart, ScatterChart, SearchField, SearchMatch, SearchTypeahead, SectionHeading, SegmentedControl, Select, Sheet, Tab, TabList, TabPanel, TabPanels, TableWidget, Tabs, TextWidget, Tooltip, TooltipProvider, VariableBar, VisualizationWidget, injectDataAppStyles, isPlainKeyEvent, matchSearchText, searchItems, useAppVariables, useDateFormatting, useSvgId, useViewTab };
2966
+ //#region src/ui/index.ts
2967
+ /** Direct UI composition and static screens. Requests use declared views from /react. */
2968
+ const TextWidget = withWidgetBoundary(TextWidget$1);
2969
+ /** Compose an unframed visual with the shared heading and inspection. */
2970
+ const VisualizationWidget = withWidgetBoundary(VisualizationWidget$1);
2971
+ const TableWidget = withWidgetBoundary(TableWidget$1);
2972
+ const MetricWidget = withWidgetBoundary(MetricWidget$1);
2973
+ //#endregion
2974
+ export { AboutData, AppIcon, AreaChart, BarChart, ChartLegend, Checkbox, CheckboxGroup, ChoicePicker, ComposedChart, DataApp, DataAppProvider, DataTable, DataTableEmptyRow, DataTableShare, DataTableTimestamp, DataValue, DataWidget, DateDisplay, DateRangePicker, DateTimeRangePicker, DimensionPicker, ExplorationActionControl, FilterActions, FilterBar, FunnelChart, GettingStarted, GlossaryDefinition, GlossaryExplanation, GradientScroll, HelpPopover, JourneyChart, LineChart, LiveControl, Menu, PressButton as MenuButton, MenuItem, MenuPopover, MenuSection, MenuSeparator, MenuTrigger, MetricWidget, NumberField, NumberFilterPicker, NumberRangeField, PieChart, PresentStory, Radio, RadioGroup, RetentionChart, ScatterChart, SearchField, SearchMatch, SearchTypeahead, SectionHeading, SegmentedControl, Select, Sheet, ShimmerText, Tab, TabList, TabPanel, TabPanels, TableWidget, Tabs, TextWidget, Tooltip, TooltipProvider, VariableBar, VisualizationWidget, dateTimeRangePresets, dateTimeRangeVariable, injectDataAppStyles, isPlainKeyEvent, matchSearchText, searchItems, useAppVariables, useDateFormatting, useSvgId, useViewTab };
2895
2975
 
2896
2976
  //# sourceMappingURL=index.js.map