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
@@ -188,9 +188,6 @@ declare interface CardConfig {
188
188
  * Configuration for on-click dashboard filters triggered by this card.
189
189
  */
190
190
  clickFilterInteractions?: ClickFilterInteraction[];
191
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
192
- targetValue?: number;
193
- showComparisonInLegend?: boolean;
194
191
  showTrendline?: boolean;
195
192
  trendlineWindow?: number;
196
193
  trendlineGranularity?: 'day' | 'week' | 'month';
@@ -343,8 +340,67 @@ declare type ColumnTextWrap = 'default' | 'truncate' | 'wrap' | 'nowrap' | 'pres
343
340
 
344
341
  declare type ColumnType = 'string' | 'number' | 'date';
345
342
 
343
+ export declare type ComparisonDocumentChange = {
344
+ kind: 'metric';
345
+ path: string;
346
+ metricId?: string;
347
+ legacyType: string;
348
+ comparison?: MetricComparisonConfig;
349
+ comparisonPolarity?: MetricComparisonPolarity;
350
+ removedFields: string[];
351
+ } | {
352
+ kind: 'presentation';
353
+ path: string;
354
+ comparisonPresentation?: ComparisonPresentationSpec;
355
+ metricPairComparisonEnabled?: boolean;
356
+ comparisonPolarityMetricIds?: string[];
357
+ intentionallyDiscardedFields?: string[];
358
+ removedFields: string[];
359
+ };
360
+
361
+ export declare type ComparisonDocumentTransformResult<T> = {
362
+ document: T;
363
+ changed: boolean;
364
+ changes: ComparisonDocumentChange[];
365
+ diagnostics: ComparisonMigrationDiagnostic[];
366
+ };
367
+
368
+ export declare type ComparisonMigrationDiagnostic = {
369
+ severity: 'warning' | 'error';
370
+ code: 'invalid_target_value' | 'unsupported_start_vs_end' | 'unsupported_comparison_type' | 'stray_target_value' | 'malformed_metric_columns' | 'conflicting_comparison_contracts' | 'conflicting_comparison_window_transform' | 'conflicting_comparison_presentation_contracts' | 'conflicting_legacy_presentation_namespaces' | 'conflicting_legacy_polarity' | 'invalid_legacy_comparison_presentation' | 'unsupported_comparison_format';
371
+ path: string;
372
+ message: string;
373
+ };
374
+
346
375
  declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
347
376
 
377
+ declare type ComparisonPresentationSpec = {
378
+ /** Defaults to difference. */
379
+ displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
380
+ /** Defaults to true. This controls display, not baseline selection. */
381
+ showComparison?: boolean;
382
+ /** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
383
+ precision?: number;
384
+ /** Defaults to arrow_badge. */
385
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
386
+ /** Defaults to true. */
387
+ showColor?: boolean;
388
+ position?: 'left' | 'right' | 'top';
389
+ /** Defaults to false. */
390
+ conditionalLabel?: boolean;
391
+ labelName?: string;
392
+ conditionalLabels?: {
393
+ increase?: string;
394
+ decrease?: string;
395
+ neutral?: string;
396
+ };
397
+ colors?: {
398
+ increase?: string;
399
+ decrease?: string;
400
+ neutral?: string;
401
+ };
402
+ };
403
+
348
404
  export declare function compileDashboardFromPlan(input: {
349
405
  dashboardId: string;
350
406
  plan: DashboardPlan;
@@ -676,11 +732,17 @@ declare type DashboardInputScope = {
676
732
  sectionIds: string[];
677
733
  };
678
734
 
679
- declare type DashboardInputSlot = {
735
+ declare type DashboardInputSlot = ({
680
736
  status: 'set';
681
737
  value: DashboardInputValue;
682
- } | {
738
+ comparisonSelection?: GlobalDateComparisonSelection;
739
+ }) | ({
683
740
  status: 'cleared';
741
+ comparisonSelection?: GlobalDateComparisonSelection;
742
+ }) | {
743
+ status?: never;
744
+ value?: never;
745
+ comparisonSelection: GlobalDateComparisonSelection;
684
746
  };
685
747
 
686
748
  declare type DashboardInputTextContent = Array<{
@@ -906,7 +968,6 @@ declare interface DetailTableBackupConfig {
906
968
  function: AggregateFunction;
907
969
  pivotLevel: string | 'ALL';
908
970
  }>;
909
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
910
971
  }
911
972
 
912
973
  declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
@@ -1506,6 +1567,13 @@ export declare type GeneratedDashboardCardArtifact = {
1506
1567
 
1507
1568
  export declare function getDashboardAuthoringCardSource(card: Pick<DashboardPlanCard, 'analyticsIntent'>): SemaphorSourceRef | undefined;
1508
1569
 
1570
+ declare type GlobalDateComparisonSelection = {
1571
+ mode: 'off';
1572
+ } | {
1573
+ mode: 'period';
1574
+ spec: ViewerPeriodComparisonSpec;
1575
+ };
1576
+
1509
1577
  declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1510
1578
 
1511
1579
  declare interface GroupByColumn extends BaseColumn {
@@ -1660,6 +1728,30 @@ declare interface MetricColumn extends BaseColumn {
1660
1728
  aliasTemplate?: string;
1661
1729
  }
1662
1730
 
1731
+ declare type MetricComparisonConfig = {
1732
+ mode: 'off';
1733
+ } | {
1734
+ mode: 'explicit';
1735
+ spec: MetricComparisonSpec;
1736
+ };
1737
+
1738
+ declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
1739
+
1740
+ declare type MetricComparisonSpec = {
1741
+ kind: 'previous_period';
1742
+ offsetPeriods?: number;
1743
+ alignment?: 'calendar' | 'weekday';
1744
+ toDate?: boolean;
1745
+ } | {
1746
+ kind: 'previous_year';
1747
+ offsetYears?: number;
1748
+ alignment?: 'calendar' | 'weekday';
1749
+ toDate?: boolean;
1750
+ } | {
1751
+ kind: 'target';
1752
+ targetValue: number;
1753
+ };
1754
+
1663
1755
  declare interface MetricField extends Field {
1664
1756
  role: 'metric';
1665
1757
  aggregate?: AggregateFunction;
@@ -1708,9 +1800,10 @@ declare interface MetricField extends Field {
1708
1800
  * pre-aggregated metric input.
1709
1801
  */
1710
1802
  isPreAggregated?: boolean;
1711
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1712
- comparisonDisplay?: 'column' | 'inline' | 'hover';
1713
- targetValue?: number;
1803
+ comparison?: MetricComparisonConfig;
1804
+ comparisonPolarity?: MetricComparisonPolarity;
1805
+ /** Governed runtime annotation. When present, authoring polarity is read-only. */
1806
+ semanticComparisonPolarity?: MetricComparisonPolarity;
1714
1807
  }
1715
1808
 
1716
1809
  declare type NoneOptions = {};
@@ -2687,6 +2780,11 @@ declare type TCard = {
2687
2780
  };
2688
2781
 
2689
2782
  declare type TCardPreferences = {
2783
+ comparisonPresentation?: ComparisonPresentationSpec;
2784
+ /** Absence means eligible metrics inherit the Global Date comparison. */
2785
+ inheritGlobalComparison?: false;
2786
+ /** Separate two-metric KPI feature; defaults to false. */
2787
+ metricPairComparisonEnabled?: boolean;
2690
2788
  onClickFilter?: FilterOnClick[];
2691
2789
  filterOnClick?: boolean;
2692
2790
  filterOnClickField?: string;
@@ -2759,43 +2857,14 @@ declare type TCardPreferences = {
2759
2857
  colorScale?: string;
2760
2858
  };
2761
2859
  kpiVisualOptions?: {
2762
- lowerIsBetter?: boolean;
2763
2860
  countryLogoId?: string;
2764
2861
  valueAlignment?: 'left' | 'center';
2765
2862
  formatOptions?: TFormatOptions;
2766
- metricComparison?: {
2767
- enabled?: boolean;
2768
- calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
2769
- formatOptions?: TFormatOptions;
2770
- showArrow?: boolean;
2771
- showColor?: boolean;
2772
- conditionalLabel?: boolean;
2773
- labelName?: string;
2774
- position?: 'left' | 'right' | 'top';
2775
- conditionalLabels?: {
2776
- increase?: string;
2777
- decrease?: string;
2778
- noChange?: string;
2779
- };
2780
- colorConfig?: {
2781
- increase?: 'green' | 'red' | 'neutral' | string;
2782
- decrease?: 'green' | 'red' | 'neutral' | string;
2783
- noChange?: 'green' | 'red' | 'neutral' | string;
2784
- };
2785
- };
2786
- };
2787
- tableVisualOptions?: {
2788
- metricComparison?: {
2789
- calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
2790
- indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
2791
- formatOptions?: TFormatOptions;
2792
- colors?: {
2793
- increase?: 'green' | 'red' | 'neutral' | string;
2794
- decrease?: 'green' | 'red' | 'neutral' | string;
2795
- neutral?: 'green' | 'red' | 'neutral' | string;
2796
- };
2797
- lowerIsBetter?: boolean;
2798
- };
2863
+ /**
2864
+ * Presentation-only polarity for a query-backed KPI's manually returned
2865
+ * current/prior value pair. Governed KPIs use per-metric polarity instead.
2866
+ */
2867
+ queryComparisonPolarity?: MetricComparisonPolarity;
2799
2868
  };
2800
2869
  pivotTableOptions?: {
2801
2870
  showRowTotals?: boolean;
@@ -3254,6 +3323,13 @@ declare type TotalsBehavior = 'sum' | 'avg' | 'count' | 'label' | 'none';
3254
3323
  /** Point style options supported by Chart.js */
3255
3324
  declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
3256
3325
 
3326
+ /**
3327
+ * Pure, atomic migration for persisted dashboard-shaped JSON documents.
3328
+ * Documents with neither an active legacy metric comparison nor legacy
3329
+ * comparison presentation are returned by identity.
3330
+ */
3331
+ export declare function transformComparisonDocument<T>(document: T): ComparisonDocumentTransformResult<T>;
3332
+
3257
3333
  declare type TSheet = {
3258
3334
  id: string;
3259
3335
  kind?: 'dashboard' | 'document';
@@ -3320,6 +3396,10 @@ export declare function validateDashboardChangePlan(plan: DashboardChangePlan):
3320
3396
 
3321
3397
  export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
3322
3398
 
3399
+ declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
3400
+ kind: 'previous_period' | 'previous_year';
3401
+ }>;
3402
+
3323
3403
  /**
3324
3404
  * Display mode for visual components - controls which UI elements are shown
3325
3405
  */
@@ -1,7 +1,6 @@
1
1
  import { ColumnSizingState } from '@tanstack/react-table';
2
2
  import { FontSpec } from 'chart.js';
3
- import { JSX } from 'react/jsx-runtime';
4
- import { JSX as JSX_2 } from 'react';
3
+ import { JSX } from 'react';
5
4
 
6
5
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
7
6
 
@@ -265,9 +264,6 @@ declare interface CardConfig {
265
264
  * Configuration for on-click dashboard filters triggered by this card.
266
265
  */
267
266
  clickFilterInteractions?: ClickFilterInteraction[];
268
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
269
- targetValue?: number;
270
- showComparisonInLegend?: boolean;
271
267
  showTrendline?: boolean;
272
268
  trendlineWindow?: number;
273
269
  trendlineGranularity?: 'day' | 'week' | 'month';
@@ -430,6 +426,33 @@ declare type ColumnType = 'string' | 'number' | 'date';
430
426
 
431
427
  declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
432
428
 
429
+ declare type ComparisonPresentationSpec = {
430
+ /** Defaults to difference. */
431
+ displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
432
+ /** Defaults to true. This controls display, not baseline selection. */
433
+ showComparison?: boolean;
434
+ /** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
435
+ precision?: number;
436
+ /** Defaults to arrow_badge. */
437
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
438
+ /** Defaults to true. */
439
+ showColor?: boolean;
440
+ position?: 'left' | 'right' | 'top';
441
+ /** Defaults to false. */
442
+ conditionalLabel?: boolean;
443
+ labelName?: string;
444
+ conditionalLabels?: {
445
+ increase?: string;
446
+ decrease?: string;
447
+ neutral?: string;
448
+ };
449
+ colors?: {
450
+ increase?: string;
451
+ decrease?: string;
452
+ neutral?: string;
453
+ };
454
+ };
455
+
433
456
  declare type ConditionalFormatCondition = {
434
457
  kind: 'comparison';
435
458
  columnId: string;
@@ -680,11 +703,17 @@ export declare type DashboardInputScope = {
680
703
  sectionIds: string[];
681
704
  };
682
705
 
683
- export declare type DashboardInputSlot = {
706
+ export declare type DashboardInputSlot = ({
684
707
  status: 'set';
685
708
  value: DashboardInputValue;
686
- } | {
709
+ comparisonSelection?: GlobalDateComparisonSelection;
710
+ }) | ({
687
711
  status: 'cleared';
712
+ comparisonSelection?: GlobalDateComparisonSelection;
713
+ }) | {
714
+ status?: never;
715
+ value?: never;
716
+ comparisonSelection: GlobalDateComparisonSelection;
688
717
  };
689
718
 
690
719
  export declare type DashboardInputTextContent = Array<{
@@ -919,7 +948,6 @@ declare interface DetailTableBackupConfig {
919
948
  function: AggregateFunction;
920
949
  pivotLevel: string | 'ALL';
921
950
  }>;
922
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
923
951
  }
924
952
 
925
953
  declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
@@ -1534,7 +1562,8 @@ declare type FormatSpec = {
1534
1562
  export declare type GetDashboardResponse = {
1535
1563
  dashboard: TDashboard;
1536
1564
  lenses: TLens[];
1537
- filterValues?: TFilterValue[];
1565
+ filterValues?: TFilterValue[] | null;
1566
+ inputValues?: LensInputValuesSnapshot | null;
1538
1567
  defaultLensId?: string;
1539
1568
  assistantProfileId?: string;
1540
1569
  semanticExecutionPayload: SemanticExecutionPayload;
@@ -1549,6 +1578,13 @@ export declare type GetPluginsResponse = {
1549
1578
  }[];
1550
1579
  };
1551
1580
 
1581
+ declare type GlobalDateComparisonSelection = {
1582
+ mode: 'off';
1583
+ } | {
1584
+ mode: 'period';
1585
+ spec: ViewerPeriodComparisonSpec;
1586
+ };
1587
+
1552
1588
  declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1553
1589
 
1554
1590
  declare interface GroupByColumn extends BaseColumn {
@@ -1684,7 +1720,12 @@ declare interface JoinPlan {
1684
1720
  export declare type KPICardProps = {
1685
1721
  card: TCard;
1686
1722
  isLoading?: boolean;
1687
- renderFilterInfo?: () => JSX_2.Element | null;
1723
+ renderFilterInfo?: () => JSX.Element | null;
1724
+ };
1725
+
1726
+ export declare type LensInputValuesSnapshot = {
1727
+ generatedAt: string;
1728
+ dashboardInputValues: DashboardInputValues;
1688
1729
  };
1689
1730
 
1690
1731
  export declare type Level = 'database' | 'schema' | 'table';
@@ -1703,12 +1744,44 @@ export declare type LoadingProps = {
1703
1744
 
1704
1745
  declare type LogicalOperator = 'AND' | 'OR';
1705
1746
 
1747
+ /**
1748
+ * A comparison input proven to be present in the card's executed filter set.
1749
+ * Ownership and UI coverage must consume this stage, never source inputs.
1750
+ */
1751
+ export declare type MaterializedDashboardDateComparisonInput = ResolvedDashboardDateComparisonInput & {
1752
+ effectiveFilterValue: TFilterValue;
1753
+ };
1754
+
1706
1755
  declare interface MetricColumn extends BaseColumn {
1707
1756
  role: 'metric';
1708
1757
  aggregate: AggregateFunction;
1709
1758
  aliasTemplate?: string;
1710
1759
  }
1711
1760
 
1761
+ declare type MetricComparisonConfig = {
1762
+ mode: 'off';
1763
+ } | {
1764
+ mode: 'explicit';
1765
+ spec: MetricComparisonSpec;
1766
+ };
1767
+
1768
+ declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
1769
+
1770
+ declare type MetricComparisonSpec = {
1771
+ kind: 'previous_period';
1772
+ offsetPeriods?: number;
1773
+ alignment?: 'calendar' | 'weekday';
1774
+ toDate?: boolean;
1775
+ } | {
1776
+ kind: 'previous_year';
1777
+ offsetYears?: number;
1778
+ alignment?: 'calendar' | 'weekday';
1779
+ toDate?: boolean;
1780
+ } | {
1781
+ kind: 'target';
1782
+ targetValue: number;
1783
+ };
1784
+
1712
1785
  declare interface MetricField extends Field {
1713
1786
  role: 'metric';
1714
1787
  aggregate?: AggregateFunction;
@@ -1757,9 +1830,10 @@ declare interface MetricField extends Field {
1757
1830
  * pre-aggregated metric input.
1758
1831
  */
1759
1832
  isPreAggregated?: boolean;
1760
- comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1761
- comparisonDisplay?: 'column' | 'inline' | 'hover';
1762
- targetValue?: number;
1833
+ comparison?: MetricComparisonConfig;
1834
+ comparisonPolarity?: MetricComparisonPolarity;
1835
+ /** Governed runtime annotation. When present, authoring polarity is read-only. */
1836
+ semanticComparisonPolarity?: MetricComparisonPolarity;
1763
1837
  }
1764
1838
 
1765
1839
  declare type NoneOptions = {};
@@ -1880,6 +1954,20 @@ declare type RelativeDateFilter = {
1880
1954
  to: number;
1881
1955
  };
1882
1956
 
1957
+ export declare type ResolvedDashboardDateComparisonInput = {
1958
+ inputId: string;
1959
+ filterId: string;
1960
+ label: string;
1961
+ filter: TFilter;
1962
+ /**
1963
+ * The active value before execution-only canonicalization. Comparison
1964
+ * ownership uses this value as provenance evidence and must fail closed
1965
+ * when its filter or field identity does not match the definition.
1966
+ */
1967
+ filterValue?: TFilterValue;
1968
+ selection: GlobalDateComparisonSelection;
1969
+ };
1970
+
1883
1971
  export declare type ResolvedDashboardInput = {
1884
1972
  id: string;
1885
1973
  kind: 'filter' | 'control';
@@ -1895,6 +1983,7 @@ export declare type ResolvedDashboardInput = {
1895
1983
  control?: ControlDefinition;
1896
1984
  controlValue?: unknown;
1897
1985
  missingRequiredValue?: boolean;
1986
+ comparisonSelection?: GlobalDateComparisonSelection;
1898
1987
  };
1899
1988
 
1900
1989
  export declare type ResolvedDashboardInputContext = {
@@ -1906,6 +1995,8 @@ export declare type ResolvedDashboardInputContext = {
1906
1995
  controlBindings: ControlBinding[];
1907
1996
  controlValues: Record<string, unknown>;
1908
1997
  variablesByName: Record<string, ResolvedDashboardInput>;
1998
+ globalDateComparisonSelection?: GlobalDateComparisonSelection;
1999
+ dateComparisonInputs?: ResolvedDashboardDateComparisonInput[];
1909
2000
  variablesById: Record<string, ResolvedDashboardInput>;
1910
2001
  missingRequiredInputs: ResolvedDashboardInput[];
1911
2002
  };
@@ -1930,6 +2021,8 @@ declare type ResolvedPrimaryDateField = {
1930
2021
  entityName: string;
1931
2022
  entityType: string;
1932
2023
  dataType: string;
2024
+ /** Canonical dataset coordinates stamped by the temporal grounding boundary. */
2025
+ source?: SemaphorSourceRef;
1933
2026
  dateFormat?: string;
1934
2027
  customFormat?: string;
1935
2028
  defaultGranularity?: TimeGranularity;
@@ -2651,6 +2744,11 @@ export declare type TCardContext = {
2651
2744
  };
2652
2745
 
2653
2746
  export declare type TCardPreferences = {
2747
+ comparisonPresentation?: ComparisonPresentationSpec;
2748
+ /** Absence means eligible metrics inherit the Global Date comparison. */
2749
+ inheritGlobalComparison?: false;
2750
+ /** Separate two-metric KPI feature; defaults to false. */
2751
+ metricPairComparisonEnabled?: boolean;
2654
2752
  onClickFilter?: FilterOnClick[];
2655
2753
  filterOnClick?: boolean;
2656
2754
  filterOnClickField?: string;
@@ -2723,43 +2821,14 @@ export declare type TCardPreferences = {
2723
2821
  colorScale?: string;
2724
2822
  };
2725
2823
  kpiVisualOptions?: {
2726
- lowerIsBetter?: boolean;
2727
2824
  countryLogoId?: string;
2728
2825
  valueAlignment?: 'left' | 'center';
2729
2826
  formatOptions?: TFormatOptions;
2730
- metricComparison?: {
2731
- enabled?: boolean;
2732
- calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
2733
- formatOptions?: TFormatOptions;
2734
- showArrow?: boolean;
2735
- showColor?: boolean;
2736
- conditionalLabel?: boolean;
2737
- labelName?: string;
2738
- position?: 'left' | 'right' | 'top';
2739
- conditionalLabels?: {
2740
- increase?: string;
2741
- decrease?: string;
2742
- noChange?: string;
2743
- };
2744
- colorConfig?: {
2745
- increase?: 'green' | 'red' | 'neutral' | string;
2746
- decrease?: 'green' | 'red' | 'neutral' | string;
2747
- noChange?: 'green' | 'red' | 'neutral' | string;
2748
- };
2749
- };
2750
- };
2751
- tableVisualOptions?: {
2752
- metricComparison?: {
2753
- calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
2754
- indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
2755
- formatOptions?: TFormatOptions;
2756
- colors?: {
2757
- increase?: 'green' | 'red' | 'neutral' | string;
2758
- decrease?: 'green' | 'red' | 'neutral' | string;
2759
- neutral?: 'green' | 'red' | 'neutral' | string;
2760
- };
2761
- lowerIsBetter?: boolean;
2762
- };
2827
+ /**
2828
+ * Presentation-only polarity for a query-backed KPI's manually returned
2829
+ * current/prior value pair. Governed KPIs use per-metric polarity instead.
2830
+ */
2831
+ queryComparisonPolarity?: MetricComparisonPolarity;
2763
2832
  };
2764
2833
  pivotTableOptions?: {
2765
2834
  showRowTotals?: boolean;
@@ -3248,7 +3317,8 @@ export declare type TLens = {
3248
3317
  id: string;
3249
3318
  name: string;
3250
3319
  template?: string;
3251
- filterValues?: TFilterValue[];
3320
+ filterValues?: TFilterValue[] | null;
3321
+ inputValues?: LensInputValuesSnapshot | null;
3252
3322
  isDefault?: boolean;
3253
3323
  shared?: boolean;
3254
3324
  };
@@ -3338,6 +3408,10 @@ export declare interface UserPreference {
3338
3408
  updatedAt: string;
3339
3409
  }
3340
3410
 
3411
+ declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
3412
+ kind: 'previous_period' | 'previous_year';
3413
+ }>;
3414
+
3341
3415
  /**
3342
3416
  * Display mode for visual components - controls which UI elements are shown
3343
3417
  */
@@ -1,4 +1,4 @@
1
- import { JSX } from 'react/jsx-runtime';
1
+ import * as ReactRuntime from 'react';
2
2
 
3
3
  export declare type ApiStatus = {
4
4
  ok: boolean;
@@ -169,7 +169,7 @@ export declare type BuilderTurnResult = {
169
169
  error?: string;
170
170
  };
171
171
 
172
- export declare function DataAppBuilder({ projectId, projectName, dataAppId, apiServiceUrl, adapters, }: DataAppBuilderProps): JSX.Element;
172
+ export declare function DataAppBuilder({ projectId, projectName, dataAppId, apiServiceUrl, adapters, }: DataAppBuilderProps): ReactRuntime.JSX.Element;
173
173
 
174
174
  export declare type DataAppBuilderAdapters = {
175
175
  readStatus?: (options: {
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
- import { JSX } from 'react/jsx-runtime';
2
+ import { JSX } from 'react';
3
3
  import { ReactElement } from 'react';
4
4
  import { ReactNode } from 'react';
5
5