react-semaphor 0.1.423 → 0.1.425

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +243 -91
  3. package/dist/appearance/index.cjs +1 -1
  4. package/dist/appearance/index.js +1 -1
  5. package/dist/brand-studio/index.cjs +2 -2
  6. package/dist/brand-studio/index.js +8 -8
  7. package/dist/chunks/{analyze-result-contract-D7pjjYPy.js → analyze-result-contract-DnfF8kBb.js} +434 -427
  8. package/dist/chunks/analyze-result-contract-ege_u6Nl.js +1 -0
  9. package/dist/chunks/{braces-8TRlDwDw.js → braces-BdbUk_r9.js} +1 -1
  10. package/dist/chunks/{braces-D2tStQjF.js → braces-CbO-aIwH.js} +1 -1
  11. package/dist/chunks/calendar-preferences-dialog-BLaSWhLl.js +1 -0
  12. package/dist/chunks/{calendar-preferences-dialog-t5ET6MON.js → calendar-preferences-dialog-DJwV0aqn.js} +4 -4
  13. package/dist/chunks/{catalog-field-grounding-CJKAqtiC.js → catalog-field-grounding-DcxPLns0.js} +10 -10
  14. package/dist/chunks/{switch-2bh3Hka1.js → code-editor-Bkk7s8hI.js} +7382 -6809
  15. package/dist/chunks/code-editor-CkXyNgYc.js +138 -0
  16. package/dist/chunks/{common-types-4bjoIgvm.js → common-types-ClkOI-3O.js} +4 -4
  17. package/dist/chunks/comparison-document-migration-CQJ0DZlL.js +414 -0
  18. package/dist/chunks/comparison-document-migration-Db64RWYD.js +1 -0
  19. package/dist/chunks/{index-yHe0SeLO.js → dashboard-5agU0G_D.js} +56752 -55440
  20. package/dist/chunks/dashboard-MKIqgGDp.js +1402 -0
  21. package/dist/chunks/{dashboard-briefing-launcher-S2akO-ub.js → dashboard-briefing-launcher-CII8-4qo.js} +11 -6
  22. package/dist/chunks/{dashboard-briefing-launcher-Cavd0QJb.js → dashboard-briefing-launcher-qyEVfuOm.js} +226 -209
  23. package/dist/chunks/dashboard-controls-PJpeYZHw.js +36 -0
  24. package/dist/chunks/dashboard-controls-aJY0FNPP.js +2196 -0
  25. package/dist/chunks/dashboard-input-contract-BFpERluO.js +18 -0
  26. package/dist/chunks/dashboard-input-contract-DV3cshjz.js +1 -0
  27. package/dist/chunks/{dashboard-json-Do2-pdPZ.js → dashboard-json-CzHSP6Fa.js} +16 -15
  28. package/dist/chunks/dashboard-json-DtmR5yCf.js +1 -0
  29. package/dist/chunks/date-formatter-BTTYdAik.js +1 -0
  30. package/dist/chunks/date-formatter-D-89jTjG.js +514 -0
  31. package/dist/chunks/{edit-dashboard-visual-Cw6bq4_w.js → edit-dashboard-visual-AkZzwBCV.js} +8892 -8996
  32. package/dist/chunks/edit-dashboard-visual-Cif6uDqN.js +182 -0
  33. package/dist/chunks/{index-CjzRe2su.js → index-CnujJ3fa.js} +3 -3
  34. package/dist/chunks/{index-DRlMUglg.js → index-Dpm_VET4.js} +2 -2
  35. package/dist/chunks/{index-CJdxSyQq.js → index-If0wlXGi.js} +308 -308
  36. package/dist/chunks/index-jSrCwPQz.js +31 -0
  37. package/dist/chunks/{x-CXDkqdur.js → index-xHCrHprY.js} +59 -59
  38. package/dist/chunks/{layout-grid-C0OI-MRn.js → layout-grid-B08pP7v6.js} +1 -1
  39. package/dist/chunks/{layout-grid-CiubineE.js → layout-grid-D5tYJg1-.js} +1 -1
  40. package/dist/chunks/metric-comparison-4oA4ouU9.js +354 -0
  41. package/dist/chunks/metric-comparison-nQKquVnx.js +1 -0
  42. package/dist/chunks/{palette-C4KTXOug.js → palette-C0yjT5Tv.js} +1 -1
  43. package/dist/chunks/{palette-Cp1hqZtm.js → palette-jqaAcwiQ.js} +1 -1
  44. package/dist/chunks/{save-DgMfP0j8.js → save-HCJjjzdX.js} +1 -1
  45. package/dist/chunks/{save-C__QggEE.js → save-Xdc4pnys.js} +1 -1
  46. package/dist/chunks/{search-BHsQIWBV.js → search-DHZCro8B.js} +1 -1
  47. package/dist/chunks/{search-DNCejM7Z.js → search-Dcud9ajy.js} +1 -1
  48. package/dist/chunks/{update-policy-C1pmhLz9.js → update-policy-BgONreNd.js} +1 -1
  49. package/dist/chunks/{update-policy-BCJc0oI5.js → update-policy-CY2k-pJP.js} +9 -9
  50. package/dist/chunks/{use-create-flow-overlay-state-5MDbZcs1.js → use-create-flow-overlay-state-ByOKVV2K.js} +62 -62
  51. package/dist/chunks/{use-create-flow-overlay-state-BNczg9Gj.js → use-create-flow-overlay-state-DmuReEnk.js} +2 -2
  52. package/dist/chunks/validators-B4VMLX3_.js +1 -0
  53. package/dist/chunks/{validators-PXkij33j.js → validators-Cz-XuORM.js} +123 -119
  54. package/dist/dashboard/index.cjs +1 -1
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.cjs +2 -2
  57. package/dist/dashboard-authoring/index.js +6 -4
  58. package/dist/data-app-builder/index.cjs +6 -6
  59. package/dist/data-app-builder/index.js +5 -5
  60. package/dist/data-app-codegen/index.cjs +1 -1
  61. package/dist/data-app-codegen/index.js +2 -2
  62. package/dist/data-app-codegen-node/index.cjs +1 -1
  63. package/dist/data-app-codegen-node/index.js +3 -3
  64. package/dist/data-app-sdk/index.cjs +1 -1
  65. package/dist/data-app-sdk/index.js +6 -6
  66. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  67. package/dist/data-app-sdk-adapters/index.js +1 -1
  68. package/dist/data-app-sdk-validation/index.cjs +1 -1
  69. package/dist/data-app-sdk-validation/index.js +65 -68
  70. package/dist/format-utils/index.cjs +2 -2
  71. package/dist/format-utils/index.js +59 -58
  72. package/dist/index.cjs +1 -1
  73. package/dist/index.js +19 -19
  74. package/dist/style.css +1 -1
  75. package/dist/surfboard/index.cjs +1 -1
  76. package/dist/surfboard/index.js +3 -3
  77. package/dist/types/analytics-protocol.d.ts +299 -3
  78. package/dist/types/brand-studio.d.ts +2 -2
  79. package/dist/types/briefings.d.ts +65 -41
  80. package/dist/types/dashboard-assistant.d.ts +28 -7
  81. package/dist/types/dashboard-authoring.d.ts +123 -43
  82. package/dist/types/dashboard.d.ts +97 -48
  83. package/dist/types/data-app-builder.d.ts +2 -2
  84. package/dist/types/data-app-sdk.d.ts +1 -1
  85. package/dist/types/format-utils.d.ts +98 -10
  86. package/dist/types/index.js +1 -1
  87. package/dist/types/main.d.ts +229 -95
  88. package/dist/types/shared.d.ts +84 -43
  89. package/dist/types/surfboard.d.ts +99 -49
  90. package/dist/types/types.d.ts +110 -50
  91. package/package.json +2 -1
  92. package/dist/chunks/analyze-result-contract-DpDcImgk.js +0 -1
  93. package/dist/chunks/calendar-preferences-dialog-CTmeASaM.js +0 -1
  94. package/dist/chunks/contracts-CoCOpd_i.js +0 -11
  95. package/dist/chunks/contracts-CtB2VONT.js +0 -1
  96. package/dist/chunks/dashboard-controls-BJLrErjW.js +0 -2322
  97. package/dist/chunks/dashboard-controls-DzbP8AXA.js +0 -52
  98. package/dist/chunks/dashboard-json-5tWb5KD6.js +0 -1
  99. package/dist/chunks/date-formatter-B4EBSe9C.js +0 -1
  100. package/dist/chunks/date-formatter-BlhBftA9.js +0 -416
  101. package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +0 -178
  102. package/dist/chunks/index-BPM3gDRw.js +0 -1406
  103. package/dist/chunks/switch-DMT7qf_R.js +0 -138
  104. package/dist/chunks/validators-DMlVbd1p.js +0 -1
  105. package/dist/chunks/x-B6ghREd2.js +0 -31
@@ -2,11 +2,11 @@ import { Chart as Chart_2 } from 'chart.js';
2
2
  import { ChartConfiguration } from 'chart.js';
3
3
  import { ColumnSizingState } from '@tanstack/react-table';
4
4
  import { DateRange } from 'react-day-picker';
5
- import { default as default_2 } from 'react-grid-layout';
5
+ import { default as default_2 } from 'react';
6
+ import { default as default_3 } from 'react-grid-layout';
6
7
  import { FetchStatus } from '@tanstack/query-core';
7
8
  import { FontSpec } from 'chart.js';
8
- import { JSX } from 'react/jsx-runtime';
9
- import { JSX as JSX_2 } from 'react';
9
+ import { JSX } from 'react';
10
10
  import { JSXElementConstructor } from 'react';
11
11
  import { QueryObserverResult } from '@tanstack/query-core';
12
12
  import * as React_2 from 'react';
@@ -47,6 +47,8 @@ declare type Actions_2 = {
47
47
  setDashboardInputValues: (values: DashboardInputValues) => void;
48
48
  setDashboardInputValuesAreAuthoritative: (isAuthoritative: boolean) => void;
49
49
  setDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget, slot: DashboardInputSlot) => void;
50
+ setDashboardInputComparisonSelection: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget, selection: GlobalDateComparisonSelection) => void;
51
+ resetDashboardInputComparisonSelection: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
50
52
  clearDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
51
53
  removeDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
52
54
  setDashboardControlsModel: (controls: ControlDefinition[], defaultValues?: Record<string, unknown>, options?: DashboardControlsModelOptions) => void;
@@ -72,12 +74,14 @@ declare type Actions_2 = {
72
74
  semanticExecutionPayload?: SemanticExecutionPayload;
73
75
  dashboardInputValues?: DashboardInputValues;
74
76
  dashboardInputValuesAreAuthoritative?: boolean;
77
+ dashboardInputReferenceTime?: string;
75
78
  }) => void;
76
79
  setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[], runtimeOverrides?: Record<string, unknown>, options?: {
77
80
  selectedSheetId?: string | null;
78
81
  semanticExecutionPayload?: SemanticExecutionPayload;
79
82
  dashboardInputValues?: DashboardInputValues;
80
83
  dashboardInputValuesAreAuthoritative?: boolean;
84
+ dashboardInputReferenceTime?: string;
81
85
  }) => void;
82
86
  hydrateRuntimeControlValues: (dashboard: TDashboard, runtimeOverrides?: Record<string, unknown>) => void;
83
87
  mergeSemanticExecutionPayload: (semanticExecutionPayload: SemanticExecutionPayload) => void;
@@ -103,8 +107,8 @@ declare type Actions_2 = {
103
107
  setDocumentInputControlValue: (sheetId: string, inputId: string, value: unknown) => void;
104
108
  clearDocumentInputRuntime: (sheetId?: string) => void;
105
109
  setSelectedSheetId: (sheetId: string | null) => void;
106
- setSheetLayout: (sheetId: string, layout: default_2.Layout[]) => void;
107
- setSheetLayouts: (sheetId: string, layouts: default_2.Layouts) => void;
110
+ setSheetLayout: (sheetId: string, layout: default_3.Layout[]) => void;
111
+ setSheetLayouts: (sheetId: string, layouts: default_3.Layouts) => void;
108
112
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
109
113
  setSelectedFrameId: (frameId: string) => void;
110
114
  clearSelectedFrameId: () => void;
@@ -179,8 +183,8 @@ declare type Actions_2 = {
179
183
  getSelectedFrame: () => TFrame | undefined;
180
184
  getCardFrame: (cardId: string) => TFrame | undefined;
181
185
  getCardSheet: (cardId: string) => TSheet | undefined;
182
- getSelectedSheetLayout: () => default_2.Layout[] | undefined;
183
- getSelectedSheetLayouts: () => default_2.Layouts | undefined;
186
+ getSelectedSheetLayout: () => default_3.Layout[] | undefined;
187
+ getSelectedSheetLayouts: () => default_3.Layouts | undefined;
184
188
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
185
189
  addBaseQuery: (baseQuery: TBaseQuery) => void;
186
190
  removeBaseQuery: (baseQueryId: string) => void;
@@ -199,7 +203,6 @@ declare type Actions_3 = TableActions & ExplorerActions & DrillActions & {
199
203
  /** Resets the editor store to its initial state. Called when loading a new dashboard. */
200
204
  resetEditorStore: () => void;
201
205
  setEditorFilterMode: (filterColumnName: string, filterMode: 'include' | 'exclude') => void;
202
- setLowerIsBetter: (lowerIsBetter: boolean) => void;
203
206
  setValueAlignment: (valueAlignment: 'left' | 'center') => void;
204
207
  clearEditorFilter: (filterColumn: FilterByColumn) => void;
205
208
  removeEditorFilter: (filterColumn: FilterByColumn) => void;
@@ -460,6 +463,10 @@ declare type AsyncMutation<TInput, TOutput> = {
460
463
  mutateAsync: (input: TInput) => Promise<TOutput>;
461
464
  };
462
465
 
466
+ export declare type AuthoritativeExportFormattingConfig = ExportFormattingConfig & {
467
+ comparisonPresentation: ComparisonPresentationSpec;
468
+ };
469
+
463
470
  export declare type AuthToken = {
464
471
  accessToken: string;
465
472
  refreshToken?: string;
@@ -1212,7 +1219,7 @@ export declare type CalendarContext = {
1212
1219
  };
1213
1220
  };
1214
1221
 
1215
- export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): JSX.Element;
1222
+ export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): default_2.JSX.Element;
1216
1223
 
1217
1224
  declare interface CalendarPreferencesDialogProps {
1218
1225
  open: boolean;
@@ -1237,6 +1244,8 @@ export declare type CancelBriefingRunResponse = {
1237
1244
  */
1238
1245
  export declare function cancelExport(apiServiceUrl: string, token: string, exportId: string): Promise<void>;
1239
1246
 
1247
+ declare type CanonicalDurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1248
+
1240
1249
  export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat;
1241
1250
 
1242
1251
  export declare interface CardConfig {
@@ -1300,9 +1309,6 @@ export declare interface CardConfig {
1300
1309
  * Configuration for on-click dashboard filters triggered by this card.
1301
1310
  */
1302
1311
  clickFilterInteractions?: ClickFilterInteraction[];
1303
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
1304
- targetValue?: number;
1305
- showComparisonInLegend?: boolean;
1306
1312
  showTrendline?: boolean;
1307
1313
  trendlineWindow?: number;
1308
1314
  trendlineGranularity?: 'day' | 'week' | 'month';
@@ -1522,7 +1528,7 @@ export declare function Combobox({ name, items, value, onChange, isLoading, isEr
1522
1528
  refetch: () => void;
1523
1529
  className?: string;
1524
1530
  showNone?: boolean;
1525
- }): JSX.Element;
1531
+ }): React_2.JSX.Element;
1526
1532
 
1527
1533
  declare type ComboBoxOption = {
1528
1534
  id: number | string;
@@ -1530,33 +1536,50 @@ declare type ComboBoxOption = {
1530
1536
  [key: string]: number | string;
1531
1537
  };
1532
1538
 
1533
- export declare interface ComparisonMetadataEntry {
1534
- /** Type of comparison being performed */
1535
- type: 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1536
- /** Display name for the metric (UI convenience) */
1537
- displayName?: string;
1538
- /** Human-readable comparison label (UI convenience) */
1539
- displayLabel?: string;
1540
- /** Current period date range */
1541
- currentPeriod?: {
1542
- /** ISO date string */
1543
- start: string;
1544
- /** ISO date string */
1545
- end: string;
1546
- };
1547
- /** Comparison period date range */
1548
- comparisonPeriod?: {
1549
- /** ISO date string */
1550
- start: string;
1551
- /** ISO date string */
1552
- end: string;
1553
- };
1554
- }
1539
+ declare type ComparisonAvailability = {
1540
+ status: 'available';
1541
+ } | {
1542
+ status: 'unavailable';
1543
+ reason: ComparisonUnavailableReason;
1544
+ traceId?: string;
1545
+ };
1546
+
1547
+ export declare type ComparisonMetadataEntry = MetricComparisonMetadataEntry;
1555
1548
 
1556
- export declare type ComparisonMetadataMap = Record<string, ComparisonMetadataEntry>;
1549
+ /** Keyed by MetricComparisonOutput.outputId, never by a display label. */
1550
+ export declare type ComparisonMetadataMap = MetricComparisonMetadataMap;
1557
1551
 
1558
1552
  declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
1559
1553
 
1554
+ declare type ComparisonPresentationSpec = {
1555
+ /** Defaults to difference. */
1556
+ displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
1557
+ /** Defaults to true. This controls display, not baseline selection. */
1558
+ showComparison?: boolean;
1559
+ /** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
1560
+ precision?: number;
1561
+ /** Defaults to arrow_badge. */
1562
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
1563
+ /** Defaults to true. */
1564
+ showColor?: boolean;
1565
+ position?: 'left' | 'right' | 'top';
1566
+ /** Defaults to false. */
1567
+ conditionalLabel?: boolean;
1568
+ labelName?: string;
1569
+ conditionalLabels?: {
1570
+ increase?: string;
1571
+ decrease?: string;
1572
+ neutral?: string;
1573
+ };
1574
+ colors?: {
1575
+ increase?: string;
1576
+ decrease?: string;
1577
+ neutral?: string;
1578
+ };
1579
+ };
1580
+
1581
+ declare type ComparisonUnavailableReason = 'finite_current_window_required' | 'current_window_not_started' | 'temporal_binding_missing' | 'temporal_binding_ambiguous' | 'temporal_binding_invalid' | 'unsupported_output_shape' | 'unsupported_raw_sql' | 'insufficient_history' | 'invalid_comparison_spec' | 'comparison_execution_failed';
1582
+
1560
1583
  declare type ConditionalFormatCondition = {
1561
1584
  kind: 'comparison';
1562
1585
  columnId: string;
@@ -1781,10 +1804,12 @@ export declare interface CreateExportRequest {
1781
1804
  cardControlDefinitions?: ControlDefinition[];
1782
1805
  controlBindings?: ControlBinding[];
1783
1806
  resolvedPrimaryDateField?: ResolvedPrimaryDateField;
1807
+ globalDateComparison?: GlobalDateComparisonContext;
1808
+ calendarContext?: CalendarContext;
1784
1809
  timezone?: string;
1785
1810
  totalRows: number;
1786
1811
  format: ExportFormat;
1787
- formatOptions?: ExportFormattingConfig;
1812
+ formatOptions: AuthoritativeExportFormattingConfig;
1788
1813
  }
1789
1814
 
1790
1815
  /** Response from creating an export job */
@@ -2054,11 +2079,17 @@ export declare type DashboardInputScope = {
2054
2079
  sectionIds: string[];
2055
2080
  };
2056
2081
 
2057
- export declare type DashboardInputSlot = {
2082
+ export declare type DashboardInputSlot = ({
2058
2083
  status: 'set';
2059
2084
  value: DashboardInputValue;
2060
- } | {
2085
+ comparisonSelection?: GlobalDateComparisonSelection;
2086
+ }) | ({
2061
2087
  status: 'cleared';
2088
+ comparisonSelection?: GlobalDateComparisonSelection;
2089
+ }) | {
2090
+ status?: never;
2091
+ value?: never;
2092
+ comparisonSelection: GlobalDateComparisonSelection;
2062
2093
  };
2063
2094
 
2064
2095
  export declare type DashboardInputTextContent = Array<{
@@ -2325,6 +2356,8 @@ export declare type DashboardStore = {
2325
2356
  dashboardInputValues: DashboardInputValues;
2326
2357
  /** True when dashboardInputValues came from a strict execution snapshot. */
2327
2358
  dashboardInputValuesAreAuthoritative: boolean;
2359
+ /** Fixed execution clock from a strict dashboard input replay snapshot. */
2360
+ dashboardInputReferenceTime?: string;
2328
2361
  semanticExecutionPayload: SemanticExecutionPayload;
2329
2362
  drillHistory: Array<{
2330
2363
  sourceDashboardId: string;
@@ -2520,7 +2553,6 @@ export declare interface DetailTableBackupConfig {
2520
2553
  function: AggregateFunction;
2521
2554
  pivotLevel: string | 'ALL';
2522
2555
  }>;
2523
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
2524
2556
  }
2525
2557
 
2526
2558
  export declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
@@ -3029,18 +3061,16 @@ export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
3029
3061
 
3030
3062
  declare type DurationCanonicalFormat = {
3031
3063
  type: 'duration';
3032
- inputUnit?: DurationUnit;
3064
+ inputUnit?: CanonicalDurationUnit;
3033
3065
  outputStyle?: 'compact' | 'digital' | 'long';
3034
- largestUnit?: DurationUnit;
3035
- smallestUnit?: DurationUnit;
3066
+ largestUnit?: CanonicalDurationUnit;
3067
+ smallestUnit?: CanonicalDurationUnit;
3036
3068
  maxUnits?: number;
3037
3069
  prefix?: string;
3038
3070
  suffix?: string;
3039
3071
  negativeStyle?: 'minus' | 'parentheses';
3040
3072
  };
3041
3073
 
3042
- declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3043
-
3044
3074
  export declare interface DynamicDrillEvent extends BaseInteractionEvent {
3045
3075
  interactionMode: 'dynamicDrill';
3046
3076
  filterGroups: ClickFilterConditionGroup[];
@@ -3230,6 +3260,8 @@ export declare interface ExportFormattingConfig {
3230
3260
  includeHeaders: boolean;
3231
3261
  columnSettings?: Record<string, unknown>;
3232
3262
  visibleColumns?: string[];
3263
+ columnLabels?: Record<string, string>;
3264
+ comparisonPresentation?: ComparisonPresentationSpec;
3233
3265
  }
3234
3266
 
3235
3267
  /** Export job from list endpoint */
@@ -3273,7 +3305,7 @@ export declare interface ExportJobStatus {
3273
3305
  * - Completed: Download button with file size
3274
3306
  * - Failed: Error message with dismiss option
3275
3307
  */
3276
- export declare function ExportNotificationItem({ export: exp, onRemove, }: ExportNotificationItemProps): JSX.Element;
3308
+ export declare function ExportNotificationItem({ export: exp, onRemove, }: ExportNotificationItemProps): default_2.JSX.Element;
3277
3309
 
3278
3310
  declare interface ExportNotificationItemProps {
3279
3311
  /** The export data to display */
@@ -3288,7 +3320,7 @@ declare interface ExportNotificationItemProps {
3288
3320
  * Displays all active and recent exports with their status,
3289
3321
  * progress, and download options.
3290
3322
  */
3291
- export declare function ExportNotificationList(): JSX.Element;
3323
+ export declare function ExportNotificationList(): default_2.JSX.Element;
3292
3324
 
3293
3325
  export declare type ExportStatus = 'pending' | 'processing' | 'chunking' | 'compacting' | 'completed' | 'failed' | 'cancelled';
3294
3326
 
@@ -3594,7 +3626,8 @@ export declare function getColumnDataType(column: TDataColumn): string;
3594
3626
  export declare type GetDashboardResponse = {
3595
3627
  dashboard: TDashboard;
3596
3628
  lenses: TLens[];
3597
- filterValues?: TFilterValue[];
3629
+ filterValues?: TFilterValue[] | null;
3630
+ inputValues?: LensInputValuesSnapshot | null;
3598
3631
  defaultLensId?: string;
3599
3632
  assistantProfileId?: string;
3600
3633
  semanticExecutionPayload: SemanticExecutionPayload;
@@ -3625,7 +3658,7 @@ export declare function getExportStatus(apiServiceUrl: string, token: string, ex
3625
3658
 
3626
3659
  export declare function getFieldRuntimeColumnName(field: Pick<Field, 'name' | 'sourceField'> | null | undefined): string;
3627
3660
 
3628
- export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
3661
+ export declare function getFilterValueType(filter: TFilter): "date" | "string" | "number" | "boolean";
3629
3662
 
3630
3663
  export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, databaseName, capabilities, connectionType, }: {
3631
3664
  schemaName: string;
@@ -3653,6 +3686,20 @@ export declare function getQualifiedTableName({ schemaName, tableName, databaseN
3653
3686
 
3654
3687
  export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, databaseName: string, capabilities: TDbCapabilities, qualifiedEntityName?: string): string | undefined;
3655
3688
 
3689
+ declare type GlobalDateComparisonContext = {
3690
+ selection: GlobalDateComparisonSelection;
3691
+ inheritGlobalComparison?: false;
3692
+ /** Fixed execution clock carried by authoritative dashboard replay snapshots. */
3693
+ referenceTime?: string;
3694
+ };
3695
+
3696
+ declare type GlobalDateComparisonSelection = {
3697
+ mode: 'off';
3698
+ } | {
3699
+ mode: 'period';
3700
+ spec: ViewerPeriodComparisonSpec;
3701
+ };
3702
+
3656
3703
  export declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
3657
3704
 
3658
3705
  export declare interface GroupByColumn extends BaseColumn {
@@ -3915,7 +3962,12 @@ export declare interface JoinPlan {
3915
3962
  export declare type KPICardProps = {
3916
3963
  card: TCard;
3917
3964
  isLoading?: boolean;
3918
- renderFilterInfo?: () => JSX_2.Element | null;
3965
+ renderFilterInfo?: () => JSX.Element | null;
3966
+ };
3967
+
3968
+ export declare type LensInputValuesSnapshot = {
3969
+ generatedAt: string;
3970
+ dashboardInputValues: DashboardInputValues;
3919
3971
  };
3920
3972
 
3921
3973
  export declare type Level = 'database' | 'schema' | 'table';
@@ -4335,6 +4387,80 @@ export declare interface MetricColumn extends BaseColumn {
4335
4387
  aliasTemplate?: string;
4336
4388
  }
4337
4389
 
4390
+ declare type MetricComparisonConfig = {
4391
+ mode: 'off';
4392
+ } | {
4393
+ mode: 'explicit';
4394
+ spec: MetricComparisonSpec;
4395
+ };
4396
+
4397
+ declare type MetricComparisonMetadataEntry = {
4398
+ type: MetricComparisonSpec['kind'];
4399
+ displayName?: string;
4400
+ displayLabel?: string;
4401
+ output: MetricComparisonOutput;
4402
+ };
4403
+
4404
+ /** Keyed by MetricComparisonOutput.outputId, never by source id or label. */
4405
+ declare type MetricComparisonMetadataMap = Record<MetricComparisonOutput['outputId'], MetricComparisonMetadataEntry>;
4406
+
4407
+ declare type MetricComparisonOutput = MetricComparisonOutputBase & ({
4408
+ request: ResolvedMetricComparisonRequest;
4409
+ availability: {
4410
+ status: 'available';
4411
+ };
4412
+ comparisonColumnKey: string;
4413
+ deltaColumnKey: string;
4414
+ percentChangeColumnKey: string;
4415
+ ratioColumnKey: string;
4416
+ rowStatusColumnKey?: string;
4417
+ currentBucketColumnKey?: string;
4418
+ comparisonSourceBucketColumnKey?: string;
4419
+ } | {
4420
+ request?: ResolvedMetricComparisonRequest;
4421
+ availability: Extract<ComparisonAvailability, {
4422
+ status: 'unavailable';
4423
+ }>;
4424
+ comparisonColumnKey?: never;
4425
+ deltaColumnKey?: never;
4426
+ percentChangeColumnKey?: never;
4427
+ ratioColumnKey?: never;
4428
+ rowStatusColumnKey?: never;
4429
+ currentBucketColumnKey?: never;
4430
+ comparisonSourceBucketColumnKey?: never;
4431
+ });
4432
+
4433
+ declare type MetricComparisonOutputBase = {
4434
+ outputId: string;
4435
+ metricId: string;
4436
+ metricAlias: string;
4437
+ currentColumnKey: string;
4438
+ windowGrain?: MetricComparisonWindowGrain;
4439
+ currentWindow?: ResolvedDateWindow;
4440
+ comparisonWindow?: ResolvedDateWindow;
4441
+ referenceTime?: string;
4442
+ temporalField?: SemaphorFieldRef;
4443
+ };
4444
+
4445
+ declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
4446
+
4447
+ declare type MetricComparisonSpec = {
4448
+ kind: 'previous_period';
4449
+ offsetPeriods?: number;
4450
+ alignment?: 'calendar' | 'weekday';
4451
+ toDate?: boolean;
4452
+ } | {
4453
+ kind: 'previous_year';
4454
+ offsetYears?: number;
4455
+ alignment?: 'calendar' | 'weekday';
4456
+ toDate?: boolean;
4457
+ } | {
4458
+ kind: 'target';
4459
+ targetValue: number;
4460
+ };
4461
+
4462
+ declare type MetricComparisonWindowGrain = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4463
+
4338
4464
  export declare interface MetricField extends Field {
4339
4465
  role: 'metric';
4340
4466
  aggregate?: AggregateFunction;
@@ -4383,9 +4509,10 @@ export declare interface MetricField extends Field {
4383
4509
  * pre-aggregated metric input.
4384
4510
  */
4385
4511
  isPreAggregated?: boolean;
4386
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
4387
- comparisonDisplay?: 'column' | 'inline' | 'hover';
4388
- targetValue?: number;
4512
+ comparison?: MetricComparisonConfig;
4513
+ comparisonPolarity?: MetricComparisonPolarity;
4514
+ /** Governed runtime annotation. When present, authoring polarity is read-only. */
4515
+ semanticComparisonPolarity?: MetricComparisonPolarity;
4389
4516
  }
4390
4517
 
4391
4518
  declare interface MinimalResourceForSharing {
@@ -4432,7 +4559,7 @@ export declare function normalizeDashboardForDirtyCheck(dashboard: TDashboard |
4432
4559
  */
4433
4560
  export declare function NotificationBell({ variant, }: {
4434
4561
  variant?: 'outline' | 'ghost';
4435
- }): JSX.Element;
4562
+ }): default_2.JSX.Element;
4436
4563
 
4437
4564
  export declare type NumberAxisFormat = {
4438
4565
  decimalPlaces?: number;
@@ -4452,6 +4579,15 @@ export declare type NumberOptions = {
4452
4579
  colorRanges?: ColorRange[];
4453
4580
  };
4454
4581
 
4582
+ /**
4583
+ * Shared format types for export system
4584
+ * IMPORTANT: No React imports allowed in this file
4585
+ *
4586
+ * These types are used by:
4587
+ * - react-semaphor (browser) for client-side exports
4588
+ * - semaphor-app (Next.js) for API routes
4589
+ * - Lambda (Node.js) for async export processing
4590
+ */
4455
4591
  declare type NumericCanonicalFormat = {
4456
4592
  type: 'number' | 'currency' | 'percent' | 'scientific';
4457
4593
  locale?: string;
@@ -4524,6 +4660,7 @@ export declare interface PivotByField extends Field {
4524
4660
 
4525
4661
  export declare interface PivotColumnSchema {
4526
4662
  alias: string;
4663
+ metricAlias?: string;
4527
4664
  metricId: string;
4528
4665
  metricName: string;
4529
4666
  metricLabel?: string;
@@ -4691,6 +4828,7 @@ export declare type ResolvedDashboardInput = {
4691
4828
  control?: ControlDefinition;
4692
4829
  controlValue?: unknown;
4693
4830
  missingRequiredValue?: boolean;
4831
+ comparisonSelection?: GlobalDateComparisonSelection;
4694
4832
  };
4695
4833
 
4696
4834
  export declare type ResolvedDashboardInputContext = {
@@ -4702,10 +4840,17 @@ export declare type ResolvedDashboardInputContext = {
4702
4840
  controlBindings: ControlBinding[];
4703
4841
  controlValues: Record<string, unknown>;
4704
4842
  variablesByName: Record<string, ResolvedDashboardInput>;
4843
+ globalDateComparisonSelection?: GlobalDateComparisonSelection;
4705
4844
  variablesById: Record<string, ResolvedDashboardInput>;
4706
4845
  missingRequiredInputs: ResolvedDashboardInput[];
4707
4846
  };
4708
4847
 
4848
+ declare type ResolvedDateWindow = {
4849
+ startInclusive: string;
4850
+ endExclusive: string;
4851
+ timezone: string;
4852
+ };
4853
+
4709
4854
  export declare type ResolvedDocumentInput = {
4710
4855
  inputId: string;
4711
4856
  variableName: string;
@@ -4716,6 +4861,14 @@ export declare type ResolvedDocumentInput = {
4716
4861
  exports: Record<string, string | number | boolean | null>;
4717
4862
  };
4718
4863
 
4864
+ declare type ResolvedMetricComparisonRequest = {
4865
+ source: 'explicit';
4866
+ spec: MetricComparisonSpec;
4867
+ } | {
4868
+ source: 'inherited';
4869
+ spec: ViewerPeriodComparisonSpec;
4870
+ };
4871
+
4719
4872
  declare type ResolvedPrimaryDateField = {
4720
4873
  sourceDataset: string;
4721
4874
  sourceField: string;
@@ -5910,6 +6063,11 @@ export declare type TCardContext = {
5910
6063
  };
5911
6064
 
5912
6065
  export declare type TCardPreferences = {
6066
+ comparisonPresentation?: ComparisonPresentationSpec;
6067
+ /** Absence means eligible metrics inherit the Global Date comparison. */
6068
+ inheritGlobalComparison?: false;
6069
+ /** Separate two-metric KPI feature; defaults to false. */
6070
+ metricPairComparisonEnabled?: boolean;
5913
6071
  onClickFilter?: FilterOnClick[];
5914
6072
  filterOnClick?: boolean;
5915
6073
  filterOnClickField?: string;
@@ -5982,43 +6140,14 @@ export declare type TCardPreferences = {
5982
6140
  colorScale?: string;
5983
6141
  };
5984
6142
  kpiVisualOptions?: {
5985
- lowerIsBetter?: boolean;
5986
6143
  countryLogoId?: string;
5987
6144
  valueAlignment?: 'left' | 'center';
5988
6145
  formatOptions?: TFormatOptions;
5989
- metricComparison?: {
5990
- enabled?: boolean;
5991
- calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
5992
- formatOptions?: TFormatOptions;
5993
- showArrow?: boolean;
5994
- showColor?: boolean;
5995
- conditionalLabel?: boolean;
5996
- labelName?: string;
5997
- position?: 'left' | 'right' | 'top';
5998
- conditionalLabels?: {
5999
- increase?: string;
6000
- decrease?: string;
6001
- noChange?: string;
6002
- };
6003
- colorConfig?: {
6004
- increase?: 'green' | 'red' | 'neutral' | string;
6005
- decrease?: 'green' | 'red' | 'neutral' | string;
6006
- noChange?: 'green' | 'red' | 'neutral' | string;
6007
- };
6008
- };
6009
- };
6010
- tableVisualOptions?: {
6011
- metricComparison?: {
6012
- calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
6013
- indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
6014
- formatOptions?: TFormatOptions;
6015
- colors?: {
6016
- increase?: 'green' | 'red' | 'neutral' | string;
6017
- decrease?: 'green' | 'red' | 'neutral' | string;
6018
- neutral?: 'green' | 'red' | 'neutral' | string;
6019
- };
6020
- lowerIsBetter?: boolean;
6021
- };
6146
+ /**
6147
+ * Presentation-only polarity for a query-backed KPI's manually returned
6148
+ * current/prior value pair. Governed KPIs use per-metric polarity instead.
6149
+ */
6150
+ queryComparisonPolarity?: MetricComparisonPolarity;
6022
6151
  };
6023
6152
  pivotTableOptions?: {
6024
6153
  showRowTotals?: boolean;
@@ -6515,7 +6644,8 @@ export declare type TLens = {
6515
6644
  id: string;
6516
6645
  name: string;
6517
6646
  template?: string;
6518
- filterValues?: TFilterValue[];
6647
+ filterValues?: TFilterValue[] | null;
6648
+ inputValues?: LensInputValuesSnapshot | null;
6519
6649
  isDefault?: boolean;
6520
6650
  shared?: boolean;
6521
6651
  };
@@ -6940,12 +7070,12 @@ export declare function useCard(cardId: string): {
6940
7070
  queryKey: string[];
6941
7071
  queryRequestPayload: Record<string, unknown> | undefined;
6942
7072
  pagination: PaginationMetadata | undefined;
6943
- comparisonMetadata: ComparisonMetadataMap | undefined;
7073
+ comparisonMetadata: MetricComparisonMetadataMap | undefined;
6944
7074
  resolvedPrimaryDateField: ResolvedPrimaryDateField | undefined;
6945
7075
  };
6946
7076
 
6947
7077
  export declare function useCardSummary(card: TCard, options?: UseCardSummaryOptions): {
6948
- data: SummaryResponse | undefined;
7078
+ data: NoInfer<SummaryResponse> | undefined;
6949
7079
  isLoading: boolean;
6950
7080
  isFetching: boolean;
6951
7081
  isError: boolean;
@@ -6977,11 +7107,11 @@ export declare function useDashboardById(dashboardId: string, options?: {
6977
7107
  }): UseQueryResult<any, Error>;
6978
7108
 
6979
7109
  export declare function useDashboardQuery(): {
6980
- data: GetDashboardResponse | null | undefined;
7110
+ data: NoInfer<GetDashboardResponse | null> | undefined;
6981
7111
  isLoading: boolean;
6982
7112
  isFetching: boolean;
6983
7113
  isError: boolean;
6984
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetDashboardResponse | null, Error>>;
7114
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<NoInfer<GetDashboardResponse | null>, Error>>;
6985
7115
  dashboardIdToFetch: string | null;
6986
7116
  };
6987
7117
 
@@ -6991,12 +7121,12 @@ setState(nextStateOrUpdater: DashboardStore | ((state: WritableDraft<DashboardSt
6991
7121
  }>;
6992
7122
 
6993
7123
  export declare function useDashboardSummary(): {
6994
- data: SummaryResponse | undefined;
7124
+ data: NoInfer<SummaryResponse> | undefined;
6995
7125
  isLoading: boolean;
6996
7126
  isFetching: boolean;
6997
7127
  isError: boolean;
6998
7128
  error: Error | null;
6999
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<SummaryResponse, Error>>;
7129
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<NoInfer<SummaryResponse>, Error>>;
7000
7130
  refresh: UseMutateAsyncFunction<SummaryResponse, Error, void, unknown>;
7001
7131
  isRefreshing: boolean;
7002
7132
  applyAction: (action: SummaryAction) => Promise<void>;
@@ -7242,6 +7372,10 @@ export declare function useTextFilterHook(filterId: string): {
7242
7372
 
7243
7373
  export declare function validateBriefingFormDraft(draft: BriefingFormDraft): BriefingFormValidationResult;
7244
7374
 
7375
+ declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
7376
+ kind: 'previous_period' | 'previous_year';
7377
+ }>;
7378
+
7245
7379
  export declare function Visual(props: VisualProps): JSX.Element;
7246
7380
 
7247
7381
  /**