react-semaphor 0.1.424 → 0.1.426

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 (107) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +246 -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-C-gN-vlq.js +1 -0
  12. package/dist/chunks/{calendar-preferences-dialog-D5mABNDT.js → calendar-preferences-dialog-tBSngRN-.js} +4 -4
  13. package/dist/chunks/{catalog-field-grounding-CJKAqtiC.js → catalog-field-grounding-AOGwWu0K.js} +11 -11
  14. package/dist/chunks/{switch-2bh3Hka1.js → code-editor-Pod1s6SK.js} +9927 -9098
  15. package/dist/chunks/code-editor-tfzm8LWW.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-BJH1idOd.js +414 -0
  18. package/dist/chunks/comparison-document-migration-b6c3xiWh.js +1 -0
  19. package/dist/chunks/dashboard-JNK2ly_e.js +1402 -0
  20. package/dist/chunks/{index-Dzz6jXSY.js → dashboard-ZoKNg47G.js} +67158 -65267
  21. package/dist/chunks/{dashboard-briefing-launcher-DuWgwtxX.js → dashboard-briefing-launcher-0kR-QThz.js} +11 -6
  22. package/dist/chunks/{dashboard-briefing-launcher-BNDzMjjt.js → dashboard-briefing-launcher-BE-sNAzW.js} +226 -209
  23. package/dist/chunks/dashboard-controls-BUYTVauu.js +36 -0
  24. package/dist/chunks/dashboard-controls-Ce_Bps8f.js +2196 -0
  25. package/dist/chunks/dashboard-date-comparison-definition-BaYxjLi5.js +167 -0
  26. package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +1 -0
  27. package/dist/chunks/dashboard-input-contract-BFpERluO.js +18 -0
  28. package/dist/chunks/dashboard-input-contract-DV3cshjz.js +1 -0
  29. package/dist/chunks/{dashboard-json-CkTEDNtH.js → dashboard-json-4quaFoSw.js} +16 -15
  30. package/dist/chunks/dashboard-json-81uc8aVR.js +1 -0
  31. package/dist/chunks/date-formatter-BTTYdAik.js +1 -0
  32. package/dist/chunks/date-formatter-D-89jTjG.js +514 -0
  33. package/dist/chunks/{edit-dashboard-visual-CRjVRZLk.js → edit-dashboard-visual-DqQsH7rN.js} +8470 -8520
  34. package/dist/chunks/edit-dashboard-visual-nVRXv1Lq.js +182 -0
  35. package/dist/chunks/{index-CjzRe2su.js → index-CnujJ3fa.js} +3 -3
  36. package/dist/chunks/{index-DRlMUglg.js → index-Dpm_VET4.js} +2 -2
  37. package/dist/chunks/{index-CJdxSyQq.js → index-If0wlXGi.js} +308 -308
  38. package/dist/chunks/index-jSrCwPQz.js +31 -0
  39. package/dist/chunks/{x-CXDkqdur.js → index-xHCrHprY.js} +59 -59
  40. package/dist/chunks/{layout-grid-C0OI-MRn.js → layout-grid-B08pP7v6.js} +1 -1
  41. package/dist/chunks/{layout-grid-CiubineE.js → layout-grid-D5tYJg1-.js} +1 -1
  42. package/dist/chunks/metric-comparison-BKgkMy9r.js +1 -0
  43. package/dist/chunks/metric-comparison-CWweq9RG.js +387 -0
  44. package/dist/chunks/{palette-C4KTXOug.js → palette-C0yjT5Tv.js} +1 -1
  45. package/dist/chunks/{palette-Cp1hqZtm.js → palette-jqaAcwiQ.js} +1 -1
  46. package/dist/chunks/{save-DgMfP0j8.js → save-HCJjjzdX.js} +1 -1
  47. package/dist/chunks/{save-C__QggEE.js → save-Xdc4pnys.js} +1 -1
  48. package/dist/chunks/{search-BHsQIWBV.js → search-DHZCro8B.js} +1 -1
  49. package/dist/chunks/{search-DNCejM7Z.js → search-Dcud9ajy.js} +1 -1
  50. package/dist/chunks/{update-policy-C1pmhLz9.js → update-policy-BgONreNd.js} +1 -1
  51. package/dist/chunks/{update-policy-BCJc0oI5.js → update-policy-CY2k-pJP.js} +9 -9
  52. package/dist/chunks/{use-create-flow-overlay-state-B-bYbtix.js → use-create-flow-overlay-state-CoANTEXS.js} +2 -2
  53. package/dist/chunks/{use-create-flow-overlay-state-B9vArrvr.js → use-create-flow-overlay-state-DUVIsF0y.js} +62 -62
  54. package/dist/chunks/validators-B4VMLX3_.js +1 -0
  55. package/dist/chunks/{validators-PXkij33j.js → validators-Cz-XuORM.js} +123 -119
  56. package/dist/dashboard/index.cjs +1 -1
  57. package/dist/dashboard/index.js +2 -2
  58. package/dist/dashboard-authoring/index.cjs +2 -2
  59. package/dist/dashboard-authoring/index.js +6 -4
  60. package/dist/data-app-builder/index.cjs +6 -6
  61. package/dist/data-app-builder/index.js +5 -5
  62. package/dist/data-app-codegen/index.cjs +1 -1
  63. package/dist/data-app-codegen/index.js +2 -2
  64. package/dist/data-app-codegen-node/index.cjs +1 -1
  65. package/dist/data-app-codegen-node/index.js +3 -3
  66. package/dist/data-app-sdk/index.cjs +1 -1
  67. package/dist/data-app-sdk/index.js +6 -6
  68. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  69. package/dist/data-app-sdk-adapters/index.js +1 -1
  70. package/dist/data-app-sdk-validation/index.cjs +1 -1
  71. package/dist/data-app-sdk-validation/index.js +65 -68
  72. package/dist/format-utils/index.cjs +2 -2
  73. package/dist/format-utils/index.js +59 -58
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.js +19 -19
  76. package/dist/style.css +1 -1
  77. package/dist/surfboard/index.cjs +1 -1
  78. package/dist/surfboard/index.js +3 -3
  79. package/dist/types/analytics-protocol.d.ts +337 -3
  80. package/dist/types/brand-studio.d.ts +2 -2
  81. package/dist/types/briefings.d.ts +65 -41
  82. package/dist/types/dashboard-assistant.d.ts +28 -7
  83. package/dist/types/dashboard-authoring.d.ts +123 -43
  84. package/dist/types/dashboard.d.ts +122 -48
  85. package/dist/types/data-app-builder.d.ts +2 -2
  86. package/dist/types/data-app-sdk.d.ts +1 -1
  87. package/dist/types/format-utils.d.ts +98 -10
  88. package/dist/types/index.js +1 -1
  89. package/dist/types/main.d.ts +264 -100
  90. package/dist/types/shared.d.ts +84 -43
  91. package/dist/types/surfboard.d.ts +124 -49
  92. package/dist/types/types.d.ts +135 -50
  93. package/package.json +2 -1
  94. package/dist/chunks/analyze-result-contract-DpDcImgk.js +0 -1
  95. package/dist/chunks/calendar-preferences-dialog-iokD3HbE.js +0 -1
  96. package/dist/chunks/contracts-CoCOpd_i.js +0 -11
  97. package/dist/chunks/contracts-CtB2VONT.js +0 -1
  98. package/dist/chunks/dashboard-controls-bbEF-AbK.js +0 -52
  99. package/dist/chunks/dashboard-controls-id39vb7G.js +0 -2322
  100. package/dist/chunks/dashboard-json-DVoqS1ks.js +0 -1
  101. package/dist/chunks/date-formatter-B4EBSe9C.js +0 -1
  102. package/dist/chunks/date-formatter-BlhBftA9.js +0 -416
  103. package/dist/chunks/edit-dashboard-visual-CkrxZCcp.js +0 -178
  104. package/dist/chunks/index-S1CGUcSz.js +0 -1406
  105. package/dist/chunks/switch-DMT7qf_R.js +0 -138
  106. package/dist/chunks/validators-DMlVbd1p.js +0 -1
  107. 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';
@@ -45,8 +45,9 @@ declare type Actions_2 = {
45
45
  removeDashboardInput: (inputId: string) => void;
46
46
  setDefaultDashboardInputValues: (values: DashboardInputValues | undefined) => void;
47
47
  setDashboardInputValues: (values: DashboardInputValues) => void;
48
- setDashboardInputValuesAreAuthoritative: (isAuthoritative: boolean) => void;
49
48
  setDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget, slot: DashboardInputSlot) => void;
49
+ setDashboardInputComparisonSelection: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget, selection: GlobalDateComparisonSelection) => void;
50
+ resetDashboardInputComparisonSelection: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
50
51
  clearDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
51
52
  removeDashboardInputSlot: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget) => void;
52
53
  setDashboardControlsModel: (controls: ControlDefinition[], defaultValues?: Record<string, unknown>, options?: DashboardControlsModelOptions) => void;
@@ -71,13 +72,13 @@ declare type Actions_2 = {
71
72
  setDashboard: (dashboard: TDashboard, options?: {
72
73
  semanticExecutionPayload?: SemanticExecutionPayload;
73
74
  dashboardInputValues?: DashboardInputValues;
74
- dashboardInputValuesAreAuthoritative?: boolean;
75
+ dashboardInputReferenceTime?: string;
75
76
  }) => void;
76
77
  setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[], runtimeOverrides?: Record<string, unknown>, options?: {
77
78
  selectedSheetId?: string | null;
78
79
  semanticExecutionPayload?: SemanticExecutionPayload;
79
80
  dashboardInputValues?: DashboardInputValues;
80
- dashboardInputValuesAreAuthoritative?: boolean;
81
+ dashboardInputReferenceTime?: string;
81
82
  }) => void;
82
83
  hydrateRuntimeControlValues: (dashboard: TDashboard, runtimeOverrides?: Record<string, unknown>) => void;
83
84
  mergeSemanticExecutionPayload: (semanticExecutionPayload: SemanticExecutionPayload) => void;
@@ -103,8 +104,8 @@ declare type Actions_2 = {
103
104
  setDocumentInputControlValue: (sheetId: string, inputId: string, value: unknown) => void;
104
105
  clearDocumentInputRuntime: (sheetId?: string) => void;
105
106
  setSelectedSheetId: (sheetId: string | null) => void;
106
- setSheetLayout: (sheetId: string, layout: default_2.Layout[]) => void;
107
- setSheetLayouts: (sheetId: string, layouts: default_2.Layouts) => void;
107
+ setSheetLayout: (sheetId: string, layout: default_3.Layout[]) => void;
108
+ setSheetLayouts: (sheetId: string, layouts: default_3.Layouts) => void;
108
109
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
109
110
  setSelectedFrameId: (frameId: string) => void;
110
111
  clearSelectedFrameId: () => void;
@@ -179,8 +180,8 @@ declare type Actions_2 = {
179
180
  getSelectedFrame: () => TFrame | undefined;
180
181
  getCardFrame: (cardId: string) => TFrame | undefined;
181
182
  getCardSheet: (cardId: string) => TSheet | undefined;
182
- getSelectedSheetLayout: () => default_2.Layout[] | undefined;
183
- getSelectedSheetLayouts: () => default_2.Layouts | undefined;
183
+ getSelectedSheetLayout: () => default_3.Layout[] | undefined;
184
+ getSelectedSheetLayouts: () => default_3.Layouts | undefined;
184
185
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
185
186
  addBaseQuery: (baseQuery: TBaseQuery) => void;
186
187
  removeBaseQuery: (baseQueryId: string) => void;
@@ -199,7 +200,6 @@ declare type Actions_3 = TableActions & ExplorerActions & DrillActions & {
199
200
  /** Resets the editor store to its initial state. Called when loading a new dashboard. */
200
201
  resetEditorStore: () => void;
201
202
  setEditorFilterMode: (filterColumnName: string, filterMode: 'include' | 'exclude') => void;
202
- setLowerIsBetter: (lowerIsBetter: boolean) => void;
203
203
  setValueAlignment: (valueAlignment: 'left' | 'center') => void;
204
204
  clearEditorFilter: (filterColumn: FilterByColumn) => void;
205
205
  removeEditorFilter: (filterColumn: FilterByColumn) => void;
@@ -460,6 +460,10 @@ declare type AsyncMutation<TInput, TOutput> = {
460
460
  mutateAsync: (input: TInput) => Promise<TOutput>;
461
461
  };
462
462
 
463
+ export declare type AuthoritativeExportFormattingConfig = ExportFormattingConfig & {
464
+ comparisonPresentation: ComparisonPresentationSpec;
465
+ };
466
+
463
467
  export declare type AuthToken = {
464
468
  accessToken: string;
465
469
  refreshToken?: string;
@@ -1212,7 +1216,7 @@ export declare type CalendarContext = {
1212
1216
  };
1213
1217
  };
1214
1218
 
1215
- export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): JSX.Element;
1219
+ export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): default_2.JSX.Element;
1216
1220
 
1217
1221
  declare interface CalendarPreferencesDialogProps {
1218
1222
  open: boolean;
@@ -1237,6 +1241,8 @@ export declare type CancelBriefingRunResponse = {
1237
1241
  */
1238
1242
  export declare function cancelExport(apiServiceUrl: string, token: string, exportId: string): Promise<void>;
1239
1243
 
1244
+ declare type CanonicalDurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1245
+
1240
1246
  export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat;
1241
1247
 
1242
1248
  export declare interface CardConfig {
@@ -1300,9 +1306,6 @@ export declare interface CardConfig {
1300
1306
  * Configuration for on-click dashboard filters triggered by this card.
1301
1307
  */
1302
1308
  clickFilterInteractions?: ClickFilterInteraction[];
1303
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
1304
- targetValue?: number;
1305
- showComparisonInLegend?: boolean;
1306
1309
  showTrendline?: boolean;
1307
1310
  trendlineWindow?: number;
1308
1311
  trendlineGranularity?: 'day' | 'week' | 'month';
@@ -1522,7 +1525,7 @@ export declare function Combobox({ name, items, value, onChange, isLoading, isEr
1522
1525
  refetch: () => void;
1523
1526
  className?: string;
1524
1527
  showNone?: boolean;
1525
- }): JSX.Element;
1528
+ }): React_2.JSX.Element;
1526
1529
 
1527
1530
  declare type ComboBoxOption = {
1528
1531
  id: number | string;
@@ -1530,33 +1533,50 @@ declare type ComboBoxOption = {
1530
1533
  [key: string]: number | string;
1531
1534
  };
1532
1535
 
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
- }
1536
+ declare type ComparisonAvailability = {
1537
+ status: 'available';
1538
+ } | {
1539
+ status: 'unavailable';
1540
+ reason: ComparisonUnavailableReason;
1541
+ traceId?: string;
1542
+ };
1555
1543
 
1556
- export declare type ComparisonMetadataMap = Record<string, ComparisonMetadataEntry>;
1544
+ export declare type ComparisonMetadataEntry = MetricComparisonMetadataEntry;
1545
+
1546
+ /** Keyed by MetricComparisonOutput.outputId, never by a display label. */
1547
+ export declare type ComparisonMetadataMap = MetricComparisonMetadataMap;
1557
1548
 
1558
1549
  declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
1559
1550
 
1551
+ declare type ComparisonPresentationSpec = {
1552
+ /** Defaults to difference. */
1553
+ displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
1554
+ /** Defaults to true. This controls display, not baseline selection. */
1555
+ showComparison?: boolean;
1556
+ /** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
1557
+ precision?: number;
1558
+ /** Defaults to arrow_badge. */
1559
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
1560
+ /** Defaults to true. */
1561
+ showColor?: boolean;
1562
+ position?: 'left' | 'right' | 'top';
1563
+ /** Defaults to false. */
1564
+ conditionalLabel?: boolean;
1565
+ labelName?: string;
1566
+ conditionalLabels?: {
1567
+ increase?: string;
1568
+ decrease?: string;
1569
+ neutral?: string;
1570
+ };
1571
+ colors?: {
1572
+ increase?: string;
1573
+ decrease?: string;
1574
+ neutral?: string;
1575
+ };
1576
+ };
1577
+
1578
+ 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';
1579
+
1560
1580
  declare type ConditionalFormatCondition = {
1561
1581
  kind: 'comparison';
1562
1582
  columnId: string;
@@ -1781,10 +1801,12 @@ export declare interface CreateExportRequest {
1781
1801
  cardControlDefinitions?: ControlDefinition[];
1782
1802
  controlBindings?: ControlBinding[];
1783
1803
  resolvedPrimaryDateField?: ResolvedPrimaryDateField;
1804
+ globalDateComparison?: GlobalDateComparisonContext;
1805
+ calendarContext?: CalendarContext;
1784
1806
  timezone?: string;
1785
1807
  totalRows: number;
1786
1808
  format: ExportFormat;
1787
- formatOptions?: ExportFormattingConfig;
1809
+ formatOptions: AuthoritativeExportFormattingConfig;
1788
1810
  }
1789
1811
 
1790
1812
  /** Response from creating an export job */
@@ -1907,6 +1929,14 @@ export declare interface DashboardCreateDialogBaseProps {
1907
1929
  initialDomainId?: string;
1908
1930
  }
1909
1931
 
1932
+ declare type DashboardDateComparisonOwner = {
1933
+ kind: 'global_date';
1934
+ } | {
1935
+ kind: 'field_date';
1936
+ filterId: string;
1937
+ label: string;
1938
+ };
1939
+
1910
1940
  export declare type DashboardEventHandlers = {
1911
1941
  onExportData?: (payload: ExportDataPayload) => void;
1912
1942
  };
@@ -2054,11 +2084,17 @@ export declare type DashboardInputScope = {
2054
2084
  sectionIds: string[];
2055
2085
  };
2056
2086
 
2057
- export declare type DashboardInputSlot = {
2087
+ export declare type DashboardInputSlot = ({
2058
2088
  status: 'set';
2059
2089
  value: DashboardInputValue;
2060
- } | {
2090
+ comparisonSelection?: GlobalDateComparisonSelection;
2091
+ }) | ({
2061
2092
  status: 'cleared';
2093
+ comparisonSelection?: GlobalDateComparisonSelection;
2094
+ }) | {
2095
+ status?: never;
2096
+ value?: never;
2097
+ comparisonSelection: GlobalDateComparisonSelection;
2062
2098
  };
2063
2099
 
2064
2100
  export declare type DashboardInputTextContent = Array<{
@@ -2323,8 +2359,8 @@ export declare type DashboardStore = {
2323
2359
  cardControlValuesMap: Record<string, Record<string, unknown>>;
2324
2360
  /** Runtime-only dashboard input values keyed by input runtime scope. */
2325
2361
  dashboardInputValues: DashboardInputValues;
2326
- /** True when dashboardInputValues came from a strict execution snapshot. */
2327
- dashboardInputValuesAreAuthoritative: boolean;
2362
+ /** Fixed execution clock from a strict dashboard input replay snapshot. */
2363
+ dashboardInputReferenceTime?: string;
2328
2364
  semanticExecutionPayload: SemanticExecutionPayload;
2329
2365
  drillHistory: Array<{
2330
2366
  sourceDashboardId: string;
@@ -2520,7 +2556,6 @@ export declare interface DetailTableBackupConfig {
2520
2556
  function: AggregateFunction;
2521
2557
  pivotLevel: string | 'ALL';
2522
2558
  }>;
2523
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
2524
2559
  }
2525
2560
 
2526
2561
  export declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
@@ -3029,18 +3064,16 @@ export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
3029
3064
 
3030
3065
  declare type DurationCanonicalFormat = {
3031
3066
  type: 'duration';
3032
- inputUnit?: DurationUnit;
3067
+ inputUnit?: CanonicalDurationUnit;
3033
3068
  outputStyle?: 'compact' | 'digital' | 'long';
3034
- largestUnit?: DurationUnit;
3035
- smallestUnit?: DurationUnit;
3069
+ largestUnit?: CanonicalDurationUnit;
3070
+ smallestUnit?: CanonicalDurationUnit;
3036
3071
  maxUnits?: number;
3037
3072
  prefix?: string;
3038
3073
  suffix?: string;
3039
3074
  negativeStyle?: 'minus' | 'parentheses';
3040
3075
  };
3041
3076
 
3042
- declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3043
-
3044
3077
  export declare interface DynamicDrillEvent extends BaseInteractionEvent {
3045
3078
  interactionMode: 'dynamicDrill';
3046
3079
  filterGroups: ClickFilterConditionGroup[];
@@ -3230,6 +3263,8 @@ export declare interface ExportFormattingConfig {
3230
3263
  includeHeaders: boolean;
3231
3264
  columnSettings?: Record<string, unknown>;
3232
3265
  visibleColumns?: string[];
3266
+ columnLabels?: Record<string, string>;
3267
+ comparisonPresentation?: ComparisonPresentationSpec;
3233
3268
  }
3234
3269
 
3235
3270
  /** Export job from list endpoint */
@@ -3273,7 +3308,7 @@ export declare interface ExportJobStatus {
3273
3308
  * - Completed: Download button with file size
3274
3309
  * - Failed: Error message with dismiss option
3275
3310
  */
3276
- export declare function ExportNotificationItem({ export: exp, onRemove, }: ExportNotificationItemProps): JSX.Element;
3311
+ export declare function ExportNotificationItem({ export: exp, onRemove, }: ExportNotificationItemProps): default_2.JSX.Element;
3277
3312
 
3278
3313
  declare interface ExportNotificationItemProps {
3279
3314
  /** The export data to display */
@@ -3288,7 +3323,7 @@ declare interface ExportNotificationItemProps {
3288
3323
  * Displays all active and recent exports with their status,
3289
3324
  * progress, and download options.
3290
3325
  */
3291
- export declare function ExportNotificationList(): JSX.Element;
3326
+ export declare function ExportNotificationList(): default_2.JSX.Element;
3292
3327
 
3293
3328
  export declare type ExportStatus = 'pending' | 'processing' | 'chunking' | 'compacting' | 'completed' | 'failed' | 'cancelled';
3294
3329
 
@@ -3594,7 +3629,8 @@ export declare function getColumnDataType(column: TDataColumn): string;
3594
3629
  export declare type GetDashboardResponse = {
3595
3630
  dashboard: TDashboard;
3596
3631
  lenses: TLens[];
3597
- filterValues?: TFilterValue[];
3632
+ filterValues?: TFilterValue[] | null;
3633
+ inputValues?: LensInputValuesSnapshot | null;
3598
3634
  defaultLensId?: string;
3599
3635
  assistantProfileId?: string;
3600
3636
  semanticExecutionPayload: SemanticExecutionPayload;
@@ -3625,7 +3661,7 @@ export declare function getExportStatus(apiServiceUrl: string, token: string, ex
3625
3661
 
3626
3662
  export declare function getFieldRuntimeColumnName(field: Pick<Field, 'name' | 'sourceField'> | null | undefined): string;
3627
3663
 
3628
- export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
3664
+ export declare function getFilterValueType(filter: TFilter): "date" | "string" | "number" | "boolean";
3629
3665
 
3630
3666
  export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, databaseName, capabilities, connectionType, }: {
3631
3667
  schemaName: string;
@@ -3653,6 +3689,21 @@ export declare function getQualifiedTableName({ schemaName, tableName, databaseN
3653
3689
 
3654
3690
  export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, databaseName: string, capabilities: TDbCapabilities, qualifiedEntityName?: string): string | undefined;
3655
3691
 
3692
+ declare type GlobalDateComparisonContext = {
3693
+ selection: GlobalDateComparisonSelection;
3694
+ inheritGlobalComparison?: false;
3695
+ owner?: DashboardDateComparisonOwner;
3696
+ /** Fixed execution clock carried by authoritative dashboard replay snapshots. */
3697
+ referenceTime?: string;
3698
+ };
3699
+
3700
+ declare type GlobalDateComparisonSelection = {
3701
+ mode: 'off';
3702
+ } | {
3703
+ mode: 'period';
3704
+ spec: ViewerPeriodComparisonSpec;
3705
+ };
3706
+
3656
3707
  export declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
3657
3708
 
3658
3709
  export declare interface GroupByColumn extends BaseColumn {
@@ -3915,7 +3966,12 @@ export declare interface JoinPlan {
3915
3966
  export declare type KPICardProps = {
3916
3967
  card: TCard;
3917
3968
  isLoading?: boolean;
3918
- renderFilterInfo?: () => JSX_2.Element | null;
3969
+ renderFilterInfo?: () => JSX.Element | null;
3970
+ };
3971
+
3972
+ export declare type LensInputValuesSnapshot = {
3973
+ generatedAt: string;
3974
+ dashboardInputValues: DashboardInputValues;
3919
3975
  };
3920
3976
 
3921
3977
  export declare type Level = 'database' | 'schema' | 'table';
@@ -3966,6 +4022,14 @@ declare type ManagementStore = {
3966
4022
  actions: Actions;
3967
4023
  };
3968
4024
 
4025
+ /**
4026
+ * A comparison input proven to be present in the card's executed filter set.
4027
+ * Ownership and UI coverage must consume this stage, never source inputs.
4028
+ */
4029
+ export declare type MaterializedDashboardDateComparisonInput = ResolvedDashboardDateComparisonInput & {
4030
+ effectiveFilterValue: TFilterValue;
4031
+ };
4032
+
3969
4033
  declare type MatrixAxisLevelDescriptor = {
3970
4034
  instanceId: string;
3971
4035
  fieldKey: string;
@@ -4335,6 +4399,80 @@ export declare interface MetricColumn extends BaseColumn {
4335
4399
  aliasTemplate?: string;
4336
4400
  }
4337
4401
 
4402
+ declare type MetricComparisonConfig = {
4403
+ mode: 'off';
4404
+ } | {
4405
+ mode: 'explicit';
4406
+ spec: MetricComparisonSpec;
4407
+ };
4408
+
4409
+ declare type MetricComparisonMetadataEntry = {
4410
+ type: MetricComparisonSpec['kind'];
4411
+ displayName?: string;
4412
+ displayLabel?: string;
4413
+ output: MetricComparisonOutput;
4414
+ };
4415
+
4416
+ /** Keyed by MetricComparisonOutput.outputId, never by source id or label. */
4417
+ declare type MetricComparisonMetadataMap = Record<MetricComparisonOutput['outputId'], MetricComparisonMetadataEntry>;
4418
+
4419
+ declare type MetricComparisonOutput = MetricComparisonOutputBase & ({
4420
+ request: ResolvedMetricComparisonRequest;
4421
+ availability: {
4422
+ status: 'available';
4423
+ };
4424
+ comparisonColumnKey: string;
4425
+ deltaColumnKey: string;
4426
+ percentChangeColumnKey: string;
4427
+ ratioColumnKey: string;
4428
+ rowStatusColumnKey?: string;
4429
+ currentBucketColumnKey?: string;
4430
+ comparisonSourceBucketColumnKey?: string;
4431
+ } | {
4432
+ request?: ResolvedMetricComparisonRequest;
4433
+ availability: Extract<ComparisonAvailability, {
4434
+ status: 'unavailable';
4435
+ }>;
4436
+ comparisonColumnKey?: never;
4437
+ deltaColumnKey?: never;
4438
+ percentChangeColumnKey?: never;
4439
+ ratioColumnKey?: never;
4440
+ rowStatusColumnKey?: never;
4441
+ currentBucketColumnKey?: never;
4442
+ comparisonSourceBucketColumnKey?: never;
4443
+ });
4444
+
4445
+ declare type MetricComparisonOutputBase = {
4446
+ outputId: string;
4447
+ metricId: string;
4448
+ metricAlias: string;
4449
+ currentColumnKey: string;
4450
+ windowGrain?: MetricComparisonWindowGrain;
4451
+ currentWindow?: ResolvedDateWindow;
4452
+ comparisonWindow?: ResolvedDateWindow;
4453
+ referenceTime?: string;
4454
+ temporalField?: SemaphorFieldRef;
4455
+ };
4456
+
4457
+ declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
4458
+
4459
+ declare type MetricComparisonSpec = {
4460
+ kind: 'previous_period';
4461
+ offsetPeriods?: number;
4462
+ alignment?: 'calendar' | 'weekday';
4463
+ toDate?: boolean;
4464
+ } | {
4465
+ kind: 'previous_year';
4466
+ offsetYears?: number;
4467
+ alignment?: 'calendar' | 'weekday';
4468
+ toDate?: boolean;
4469
+ } | {
4470
+ kind: 'target';
4471
+ targetValue: number;
4472
+ };
4473
+
4474
+ declare type MetricComparisonWindowGrain = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4475
+
4338
4476
  export declare interface MetricField extends Field {
4339
4477
  role: 'metric';
4340
4478
  aggregate?: AggregateFunction;
@@ -4383,9 +4521,10 @@ export declare interface MetricField extends Field {
4383
4521
  * pre-aggregated metric input.
4384
4522
  */
4385
4523
  isPreAggregated?: boolean;
4386
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
4387
- comparisonDisplay?: 'column' | 'inline' | 'hover';
4388
- targetValue?: number;
4524
+ comparison?: MetricComparisonConfig;
4525
+ comparisonPolarity?: MetricComparisonPolarity;
4526
+ /** Governed runtime annotation. When present, authoring polarity is read-only. */
4527
+ semanticComparisonPolarity?: MetricComparisonPolarity;
4389
4528
  }
4390
4529
 
4391
4530
  declare interface MinimalResourceForSharing {
@@ -4432,7 +4571,7 @@ export declare function normalizeDashboardForDirtyCheck(dashboard: TDashboard |
4432
4571
  */
4433
4572
  export declare function NotificationBell({ variant, }: {
4434
4573
  variant?: 'outline' | 'ghost';
4435
- }): JSX.Element;
4574
+ }): default_2.JSX.Element;
4436
4575
 
4437
4576
  export declare type NumberAxisFormat = {
4438
4577
  decimalPlaces?: number;
@@ -4452,6 +4591,15 @@ export declare type NumberOptions = {
4452
4591
  colorRanges?: ColorRange[];
4453
4592
  };
4454
4593
 
4594
+ /**
4595
+ * Shared format types for export system
4596
+ * IMPORTANT: No React imports allowed in this file
4597
+ *
4598
+ * These types are used by:
4599
+ * - react-semaphor (browser) for client-side exports
4600
+ * - semaphor-app (Next.js) for API routes
4601
+ * - Lambda (Node.js) for async export processing
4602
+ */
4455
4603
  declare type NumericCanonicalFormat = {
4456
4604
  type: 'number' | 'currency' | 'percent' | 'scientific';
4457
4605
  locale?: string;
@@ -4524,6 +4672,7 @@ export declare interface PivotByField extends Field {
4524
4672
 
4525
4673
  export declare interface PivotColumnSchema {
4526
4674
  alias: string;
4675
+ metricAlias?: string;
4527
4676
  metricId: string;
4528
4677
  metricName: string;
4529
4678
  metricLabel?: string;
@@ -4676,6 +4825,20 @@ export declare function resolveDatamodelName(datamodelName: string): string;
4676
4825
 
4677
4826
  export declare const resolveDataType: (value: any) => string;
4678
4827
 
4828
+ export declare type ResolvedDashboardDateComparisonInput = {
4829
+ inputId: string;
4830
+ filterId: string;
4831
+ label: string;
4832
+ filter: TFilter;
4833
+ /**
4834
+ * The active value before execution-only canonicalization. Comparison
4835
+ * ownership uses this value as provenance evidence and must fail closed
4836
+ * when its filter or field identity does not match the definition.
4837
+ */
4838
+ filterValue?: TFilterValue;
4839
+ selection: GlobalDateComparisonSelection;
4840
+ };
4841
+
4679
4842
  export declare type ResolvedDashboardInput = {
4680
4843
  id: string;
4681
4844
  kind: 'filter' | 'control';
@@ -4691,6 +4854,7 @@ export declare type ResolvedDashboardInput = {
4691
4854
  control?: ControlDefinition;
4692
4855
  controlValue?: unknown;
4693
4856
  missingRequiredValue?: boolean;
4857
+ comparisonSelection?: GlobalDateComparisonSelection;
4694
4858
  };
4695
4859
 
4696
4860
  export declare type ResolvedDashboardInputContext = {
@@ -4702,10 +4866,18 @@ export declare type ResolvedDashboardInputContext = {
4702
4866
  controlBindings: ControlBinding[];
4703
4867
  controlValues: Record<string, unknown>;
4704
4868
  variablesByName: Record<string, ResolvedDashboardInput>;
4869
+ globalDateComparisonSelection?: GlobalDateComparisonSelection;
4870
+ dateComparisonInputs?: ResolvedDashboardDateComparisonInput[];
4705
4871
  variablesById: Record<string, ResolvedDashboardInput>;
4706
4872
  missingRequiredInputs: ResolvedDashboardInput[];
4707
4873
  };
4708
4874
 
4875
+ declare type ResolvedDateWindow = {
4876
+ startInclusive: string;
4877
+ endExclusive: string;
4878
+ timezone: string;
4879
+ };
4880
+
4709
4881
  export declare type ResolvedDocumentInput = {
4710
4882
  inputId: string;
4711
4883
  variableName: string;
@@ -4716,6 +4888,15 @@ export declare type ResolvedDocumentInput = {
4716
4888
  exports: Record<string, string | number | boolean | null>;
4717
4889
  };
4718
4890
 
4891
+ declare type ResolvedMetricComparisonRequest = {
4892
+ source: 'explicit';
4893
+ spec: MetricComparisonSpec;
4894
+ } | {
4895
+ source: 'inherited';
4896
+ spec: ViewerPeriodComparisonSpec;
4897
+ owner?: DashboardDateComparisonOwner;
4898
+ };
4899
+
4719
4900
  declare type ResolvedPrimaryDateField = {
4720
4901
  sourceDataset: string;
4721
4902
  sourceField: string;
@@ -4726,6 +4907,8 @@ declare type ResolvedPrimaryDateField = {
4726
4907
  entityName: string;
4727
4908
  entityType: string;
4728
4909
  dataType: string;
4910
+ /** Canonical dataset coordinates stamped by the temporal grounding boundary. */
4911
+ source?: SemaphorSourceRef;
4729
4912
  dateFormat?: string;
4730
4913
  customFormat?: string;
4731
4914
  defaultGranularity?: TimeGranularity;
@@ -5910,6 +6093,11 @@ export declare type TCardContext = {
5910
6093
  };
5911
6094
 
5912
6095
  export declare type TCardPreferences = {
6096
+ comparisonPresentation?: ComparisonPresentationSpec;
6097
+ /** Absence means eligible metrics inherit the Global Date comparison. */
6098
+ inheritGlobalComparison?: false;
6099
+ /** Separate two-metric KPI feature; defaults to false. */
6100
+ metricPairComparisonEnabled?: boolean;
5913
6101
  onClickFilter?: FilterOnClick[];
5914
6102
  filterOnClick?: boolean;
5915
6103
  filterOnClickField?: string;
@@ -5982,43 +6170,14 @@ export declare type TCardPreferences = {
5982
6170
  colorScale?: string;
5983
6171
  };
5984
6172
  kpiVisualOptions?: {
5985
- lowerIsBetter?: boolean;
5986
6173
  countryLogoId?: string;
5987
6174
  valueAlignment?: 'left' | 'center';
5988
6175
  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
- };
6176
+ /**
6177
+ * Presentation-only polarity for a query-backed KPI's manually returned
6178
+ * current/prior value pair. Governed KPIs use per-metric polarity instead.
6179
+ */
6180
+ queryComparisonPolarity?: MetricComparisonPolarity;
6022
6181
  };
6023
6182
  pivotTableOptions?: {
6024
6183
  showRowTotals?: boolean;
@@ -6515,7 +6674,8 @@ export declare type TLens = {
6515
6674
  id: string;
6516
6675
  name: string;
6517
6676
  template?: string;
6518
- filterValues?: TFilterValue[];
6677
+ filterValues?: TFilterValue[] | null;
6678
+ inputValues?: LensInputValuesSnapshot | null;
6519
6679
  isDefault?: boolean;
6520
6680
  shared?: boolean;
6521
6681
  };
@@ -6940,12 +7100,12 @@ export declare function useCard(cardId: string): {
6940
7100
  queryKey: string[];
6941
7101
  queryRequestPayload: Record<string, unknown> | undefined;
6942
7102
  pagination: PaginationMetadata | undefined;
6943
- comparisonMetadata: ComparisonMetadataMap | undefined;
7103
+ comparisonMetadata: MetricComparisonMetadataMap | undefined;
6944
7104
  resolvedPrimaryDateField: ResolvedPrimaryDateField | undefined;
6945
7105
  };
6946
7106
 
6947
7107
  export declare function useCardSummary(card: TCard, options?: UseCardSummaryOptions): {
6948
- data: SummaryResponse | undefined;
7108
+ data: NoInfer<SummaryResponse> | undefined;
6949
7109
  isLoading: boolean;
6950
7110
  isFetching: boolean;
6951
7111
  isError: boolean;
@@ -6977,11 +7137,11 @@ export declare function useDashboardById(dashboardId: string, options?: {
6977
7137
  }): UseQueryResult<any, Error>;
6978
7138
 
6979
7139
  export declare function useDashboardQuery(): {
6980
- data: GetDashboardResponse | null | undefined;
7140
+ data: NoInfer<GetDashboardResponse | null> | undefined;
6981
7141
  isLoading: boolean;
6982
7142
  isFetching: boolean;
6983
7143
  isError: boolean;
6984
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetDashboardResponse | null, Error>>;
7144
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<NoInfer<GetDashboardResponse | null>, Error>>;
6985
7145
  dashboardIdToFetch: string | null;
6986
7146
  };
6987
7147
 
@@ -6991,12 +7151,12 @@ setState(nextStateOrUpdater: DashboardStore | ((state: WritableDraft<DashboardSt
6991
7151
  }>;
6992
7152
 
6993
7153
  export declare function useDashboardSummary(): {
6994
- data: SummaryResponse | undefined;
7154
+ data: NoInfer<SummaryResponse> | undefined;
6995
7155
  isLoading: boolean;
6996
7156
  isFetching: boolean;
6997
7157
  isError: boolean;
6998
7158
  error: Error | null;
6999
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<SummaryResponse, Error>>;
7159
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<NoInfer<SummaryResponse>, Error>>;
7000
7160
  refresh: UseMutateAsyncFunction<SummaryResponse, Error, void, unknown>;
7001
7161
  isRefreshing: boolean;
7002
7162
  applyAction: (action: SummaryAction) => Promise<void>;
@@ -7242,6 +7402,10 @@ export declare function useTextFilterHook(filterId: string): {
7242
7402
 
7243
7403
  export declare function validateBriefingFormDraft(draft: BriefingFormDraft): BriefingFormValidationResult;
7244
7404
 
7405
+ declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
7406
+ kind: 'previous_period' | 'previous_year';
7407
+ }>;
7408
+
7245
7409
  export declare function Visual(props: VisualProps): JSX.Element;
7246
7410
 
7247
7411
  /**