react-semaphor 0.1.259 → 0.1.261

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 (46) hide show
  1. package/dist/chunks/dashboard-controls-0hbftZxY.js +42 -0
  2. package/dist/chunks/dashboard-controls-BYi_r2lH.js +1971 -0
  3. package/dist/chunks/dashboard-filter-controls-button-BPCw1GMh.js +1066 -0
  4. package/dist/chunks/dashboard-filter-controls-button-f4pDkDUL.js +11 -0
  5. package/dist/chunks/{dashboard-json-B43n1l6C.js → dashboard-json-2NJCXsDD.js} +1 -1
  6. package/dist/chunks/{dashboard-json-D0oSxmLa.js → dashboard-json-Dpy-zKf2.js} +1 -1
  7. package/dist/chunks/{dashboard-summary-settings-dialog-CxZAMb8B.js → dashboard-summary-settings-dialog-B9zRCvc-.js} +1 -1
  8. package/dist/chunks/{dashboard-summary-settings-dialog-DMWYgbwB.js → dashboard-summary-settings-dialog-Be3JilRI.js} +1 -1
  9. package/dist/chunks/edit-dashboard-visual-Bon08erH.js +188 -0
  10. package/dist/chunks/{edit-dashboard-visual-CCoz1oGX.js → edit-dashboard-visual-CqTlmuYL.js} +5970 -5492
  11. package/dist/chunks/index-BoJEr_9F.js +1114 -0
  12. package/dist/chunks/{index-DpSxZvI0.js → index-C2c-_lPE.js} +48682 -45193
  13. package/dist/chunks/{normalize-dashboard-for-dirty-check-Bn27S0PN.js → normalize-dashboard-for-dirty-check-5KpZN8xr.js} +20 -19
  14. package/dist/chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js +1 -0
  15. package/dist/chunks/{resource-management-panel-L51m1i4h.js → resource-management-panel-BtLPW2b4.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-B_bDGuq_.js → resource-management-panel-Bva2_0OU.js} +70 -70
  17. package/dist/chunks/use-create-flow-overlay-state-9X7GyUzl.js +21 -0
  18. package/dist/chunks/use-create-flow-overlay-state-Vyd5mSnf.js +1445 -0
  19. package/dist/chunks/{use-visual-utils-V6paZich.js → use-visual-utils-Jv4hWSLm.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-Cp5KVbr6.js → use-visual-utils-OPk_1t4I.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +5 -4
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +102 -99
  25. package/dist/shared/index.cjs +1 -1
  26. package/dist/shared/index.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.cjs +1 -1
  29. package/dist/surfboard/index.js +5 -4
  30. package/dist/types/dashboard.d.ts +105 -0
  31. package/dist/types/index.cjs +1 -1
  32. package/dist/types/index.js +4 -3
  33. package/dist/types/main.d.ts +175 -1
  34. package/dist/types/shared.d.ts +89 -0
  35. package/dist/types/surfboard.d.ts +105 -0
  36. package/dist/types/types.d.ts +113 -0
  37. package/package.json +1 -1
  38. package/dist/chunks/dashboard-controls-51P6aUVB.js +0 -1847
  39. package/dist/chunks/dashboard-controls-BC3hDGwD.js +0 -47
  40. package/dist/chunks/edit-dashboard-visual-D1mwhPGF.js +0 -193
  41. package/dist/chunks/editor-action-buttons-B6ElCCo2.js +0 -412
  42. package/dist/chunks/editor-action-buttons-Dbs6eczj.js +0 -21
  43. package/dist/chunks/index-DAhkssOV.js +0 -1109
  44. package/dist/chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js +0 -1
  45. package/dist/chunks/notification-bell-DoIAAZqX.js +0 -6
  46. package/dist/chunks/notification-bell-cYCkxEbp.js +0 -839
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-DAhkssOV.js"),a=require("../types/index.cjs"),e=require("../chunks/dashboard-summary-settings-dialog-DMWYgbwB.js");exports.Surfboard=r.DashboardPlus;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CalendarPreferencesDialog=e.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=e.DashboardSummarySettingsDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/index-BoJEr_9F.js"),e=require("../types/index.cjs"),r=require("../chunks/dashboard-summary-settings-dialog-Be3JilRI.js");exports.Surfboard=a.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=r.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=r.DashboardSummarySettingsDialog;
@@ -1,9 +1,10 @@
1
- import { a as o } from "../chunks/index-DpSxZvI0.js";
2
- import { EMPTY_SELECTION as s } from "../types/index.js";
3
- import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-CxZAMb8B.js";
1
+ import { a as o } from "../chunks/index-C2c-_lPE.js";
2
+ import { CONTROL_CARD_DEFAULT_VALUE as s, EMPTY_SELECTION as D } from "../types/index.js";
3
+ import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-B9zRCvc-.js";
4
4
  export {
5
+ s as CONTROL_CARD_DEFAULT_VALUE,
5
6
  m as CalendarPreferencesDialog,
6
7
  t as DashboardSummarySettingsDialog,
7
- s as EMPTY_SELECTION,
8
+ D as EMPTY_SELECTION,
8
9
  o as Surfboard
9
10
  };
@@ -309,6 +309,78 @@ export declare type ConnectionPolicy = {
309
309
 
310
310
  declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
311
311
 
312
+ export declare const CONTROL_CARD_DEFAULT_VALUE: "__card_default__";
313
+
314
+ export declare type ControlBinding = {
315
+ controlId: string;
316
+ target: 'sql_param';
317
+ paramId: string;
318
+ } | {
319
+ controlId: string;
320
+ target: 'config_metric_selector';
321
+ mapping: Record<string, StructuralMetricSelectorTarget>;
322
+ } | {
323
+ controlId: string;
324
+ target: 'config_field_selector';
325
+ mapping: Record<string, StructuralFieldSelectorTarget>;
326
+ } | {
327
+ controlId: string;
328
+ target: 'config_aggregation';
329
+ mapping: Record<string, string>;
330
+ } | {
331
+ controlId: string;
332
+ target: 'config_grain';
333
+ mapping: Record<string, string>;
334
+ };
335
+
336
+ export declare type ControlDefinition = {
337
+ id: string;
338
+ label: string;
339
+ scope: ControlScope;
340
+ type: ControlType;
341
+ source: ControlSource;
342
+ initialValueStrategy: ControlInitialValueStrategy;
343
+ defaultValue?: unknown;
344
+ requiredAtExecution: boolean;
345
+ hidden?: boolean;
346
+ locked?: boolean;
347
+ helpText?: string;
348
+ placement?: 'toolbar' | 'card_header' | 'advanced';
349
+ showLabel?: boolean;
350
+ toolbarWidth?: number;
351
+ };
352
+
353
+ export declare type ControlInitialValueStrategy = 'saved_default' | 'builtin' | 'embed_required' | 'schedule_snapshot';
354
+
355
+ export declare type ControlOption = {
356
+ value: string;
357
+ label: string;
358
+ presentation?: {
359
+ granularity?: TimeGranularity;
360
+ dateFormat?: DateFormatValue;
361
+ customFormat?: string;
362
+ };
363
+ };
364
+
365
+ export declare type ControlScope = 'dashboard' | 'card';
366
+
367
+ export declare type ControlSource = {
368
+ kind: 'manual';
369
+ options: ControlOption[];
370
+ } | {
371
+ kind: 'dataset_values';
372
+ fieldId: string;
373
+ connectionId?: string;
374
+ } | {
375
+ kind: 'field_allowlist';
376
+ fieldIds: string[];
377
+ } | {
378
+ kind: 'metric_allowlist';
379
+ metricIds: string[];
380
+ };
381
+
382
+ export declare type ControlType = 'enum' | 'multi_enum' | 'text' | 'number' | 'boolean' | 'date' | 'field_selector' | 'metric_selector' | 'aggregation_selector' | 'grain_selector';
383
+
312
384
  export declare type CustomCard = CardWithContent | CardWithFooter;
313
385
 
314
386
  export declare function Dashboard(props: DashboardProps): JSX.Element | null;
@@ -360,6 +432,20 @@ export declare type DashboardProps = {
360
432
  * Default filter values for the dashboard. The dashboard will be filtered by these values when the user loads the dashboard.
361
433
  */
362
434
  defaultFilterValues?: TFilterValue[];
435
+ /**
436
+ * Default runtime control values for the dashboard. Used by print/render flows
437
+ * and other external entry points that need deterministic control state.
438
+ */
439
+ defaultControlValues?: Record<string, unknown>;
440
+ /**
441
+ * Optional control contract override used by print/replay entry points that
442
+ * need to execute against a saved card/dashboard control contract snapshot.
443
+ */
444
+ controlContractOverrides?: {
445
+ controlDefinitions?: ControlDefinition[];
446
+ cardControlDefinitions?: ControlDefinition[];
447
+ controlBindings?: ControlBinding[];
448
+ };
363
449
  customStyle?: TStyle;
364
450
  currentTheme?: Theme;
365
451
  version?: string;
@@ -799,6 +885,11 @@ export declare type FilterLayoutSettings = {
799
885
  * Useful when embedding Dashboard component without Surfboard's controls
800
886
  */
801
887
  showDownloadButton?: boolean;
888
+ /**
889
+ * Mixed toolbar item order for dashboard-level filter and control chips.
890
+ * Values use prefixed ids like `filter:<id>` and `control:<id>`.
891
+ */
892
+ toolbarItemOrder?: string[];
802
893
  };
803
894
 
804
895
  declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
@@ -1205,6 +1296,10 @@ declare type StringOptions = {
1205
1296
  maxLength?: number;
1206
1297
  };
1207
1298
 
1299
+ export declare type StructuralFieldSelectorTarget = GroupByField;
1300
+
1301
+ export declare type StructuralMetricSelectorTarget = MetricField;
1302
+
1208
1303
  /**
1209
1304
  * Style propeerites for the dashboard
1210
1305
  */
@@ -1428,6 +1523,14 @@ export declare type TCard = {
1428
1523
  * Configured by editors via the visual editor settings.
1429
1524
  */
1430
1525
  inlineFilters?: TInlineFilter[];
1526
+ /**
1527
+ * Card-scoped control definitions for this card.
1528
+ */
1529
+ controls?: ControlDefinition[];
1530
+ /**
1531
+ * Per-card bindings that connect dashboard or card controls to this card's runtime targets.
1532
+ */
1533
+ controlBindings?: ControlBinding[];
1431
1534
  };
1432
1535
 
1433
1536
  export declare type TCardContext = {
@@ -1644,6 +1747,8 @@ export declare type TDashboard = {
1644
1747
  globalCacheConfig?: CacheConfig;
1645
1748
  emailSettings?: EmailSettings;
1646
1749
  defaultFilterValues?: TFilterValue[];
1750
+ controls?: ControlDefinition[];
1751
+ defaultControlValues?: Record<string, unknown>;
1647
1752
  filterLayout?: FilterLayoutSettings;
1648
1753
  };
1649
1754
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E={mode:"all"},T={tz:"UTC",weekStart:1,anchor:"now"},t={database:null,schema:null,table:null};exports.DEFAULT_CALENDAR_CONTEXT=T;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=E;exports.EMPTY_SELECTION=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _={mode:"all"},E={tz:"UTC",weekStart:1,anchor:"now"},A={database:null,schema:null,table:null},T="__card_default__";exports.CONTROL_CARD_DEFAULT_VALUE=T;exports.DEFAULT_CALENDAR_CONTEXT=E;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=_;exports.EMPTY_SELECTION=A;
@@ -1,4 +1,4 @@
1
- const l = {
1
+ const _ = {
2
2
  mode: "all"
3
3
  }, t = {
4
4
  tz: "UTC",
@@ -9,9 +9,10 @@ const l = {
9
9
  database: null,
10
10
  schema: null,
11
11
  table: null
12
- };
12
+ }, a = "__card_default__";
13
13
  export {
14
+ a as CONTROL_CARD_DEFAULT_VALUE,
14
15
  t as DEFAULT_CALENDAR_CONTEXT,
15
- l as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
16
+ _ as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
16
17
  E as EMPTY_SELECTION
17
18
  };
@@ -11,6 +11,7 @@ import { JSX } from 'react/jsx-runtime';
11
11
  import { JSX as JSX_2 } from 'react';
12
12
  import { QueryObserverResult } from '@tanstack/query-core';
13
13
  import * as React_2 from 'react';
14
+ import { ReactNode } from 'react';
14
15
  import { RefetchOptions } from '@tanstack/query-core';
15
16
  import { StoreApi } from 'zustand';
16
17
  import { UseBoundStore } from 'zustand';
@@ -39,6 +40,10 @@ declare type Actions_2 = {
39
40
  setInitStore: () => void;
40
41
  setGlobalStyle: (style: TStyle) => void;
41
42
  setDefaultFilterValues: (filterValues: TFilterValue[] | undefined) => void;
43
+ setDefaultControlValues: (controlValues: Record<string, unknown> | undefined) => void;
44
+ setDashboardControlsModel: (controls: ControlDefinition[], defaultValues?: Record<string, unknown>, options?: DashboardControlsModelOptions) => void;
45
+ updateDashboardControl: (controlId: string, updates: Partial<ControlDefinition>) => void;
46
+ reorderDashboardControls: (orderedControlIds: string[]) => void;
42
47
  updateEmailSettings: (emailSettings: EmailSettings) => void;
43
48
  setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
44
49
  setLenses: (lenses: TLens[]) => void;
@@ -56,7 +61,8 @@ declare type Actions_2 = {
56
61
  setAuthToken: (authToken: AuthToken) => void;
57
62
  setThemeStyle: (themeStyle: StyleProps) => void;
58
63
  setDashboard: (dashboard: TDashboard) => void;
59
- setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[]) => void;
64
+ setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[], runtimeOverrides?: Record<string, unknown>) => void;
65
+ hydrateRuntimeControlValues: (dashboard: TDashboard, runtimeOverrides?: Record<string, unknown>) => void;
60
66
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
61
67
  setDashboardTitle: (title: string) => void;
62
68
  setDashboardDescription: (description: string) => void;
@@ -81,6 +87,16 @@ declare type Actions_2 = {
81
87
  setCardInlineFilterValue: (cardId: string, filterValue: TFilterValue) => void;
82
88
  removeCardInlineFilterValue: (cardId: string, filterId: string) => void;
83
89
  getCardInlineFilterValues: (cardId: string) => TFilterValue[];
90
+ setControlValue: (controlId: string, value: unknown) => void;
91
+ removeControlValue: (controlId: string) => void;
92
+ setCardControlValue: (cardId: string, controlId: string, value: unknown) => void;
93
+ removeCardControlValue: (cardId: string, controlId: string) => void;
94
+ setCardControlRuntimeModel: (cardId: string, controls: ControlDefinition[], options?: {
95
+ renamed?: {
96
+ oldId: string;
97
+ newId: string;
98
+ };
99
+ }) => void;
84
100
  clearAllInlineFilterValues: () => void;
85
101
  setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
86
102
  setCardInlineFilterMode: (sheetId: string, cardId: string, filterId: string, filterMode: 'include' | 'exclude') => void;
@@ -386,6 +402,10 @@ declare type AlertDraft = {
386
402
  deliveryConfig?: Partial<DeliveryConfig>;
387
403
  };
388
404
 
405
+ export declare type AlertExecutionControlContext = {
406
+ values: Record<string, unknown>;
407
+ };
408
+
389
409
  export declare type AlertExecutionFilterContext = {
390
410
  active_filters: TFilterValue[];
391
411
  };
@@ -522,6 +542,10 @@ export declare type AlertSource = {
522
542
  executionSnapshot: {
523
543
  queryConfig: AlertExecutionQueryConfig;
524
544
  filterContext: AlertExecutionFilterContext;
545
+ controlContext?: AlertExecutionControlContext;
546
+ controlDefinitions?: ControlDefinition[];
547
+ cardControlDefinitions?: ControlDefinition[];
548
+ controlBindings?: ControlBinding[];
525
549
  connectionId: string;
526
550
  calendarContext?: {
527
551
  tz: string;
@@ -1114,6 +1138,80 @@ export declare type ContextSource = {
1114
1138
  outputAs?: string;
1115
1139
  };
1116
1140
 
1141
+ export declare const CONTROL_CARD_DEFAULT_VALUE: "__card_default__";
1142
+
1143
+ export declare type ControlBinding = {
1144
+ controlId: string;
1145
+ target: 'sql_param';
1146
+ paramId: string;
1147
+ } | {
1148
+ controlId: string;
1149
+ target: 'config_metric_selector';
1150
+ mapping: Record<string, StructuralMetricSelectorTarget>;
1151
+ } | {
1152
+ controlId: string;
1153
+ target: 'config_field_selector';
1154
+ mapping: Record<string, StructuralFieldSelectorTarget>;
1155
+ } | {
1156
+ controlId: string;
1157
+ target: 'config_aggregation';
1158
+ mapping: Record<string, string>;
1159
+ } | {
1160
+ controlId: string;
1161
+ target: 'config_grain';
1162
+ mapping: Record<string, string>;
1163
+ };
1164
+
1165
+ declare type ControlBindingsByCardId = Record<string, ControlBinding[] | undefined>;
1166
+
1167
+ export declare type ControlDefinition = {
1168
+ id: string;
1169
+ label: string;
1170
+ scope: ControlScope;
1171
+ type: ControlType;
1172
+ source: ControlSource;
1173
+ initialValueStrategy: ControlInitialValueStrategy;
1174
+ defaultValue?: unknown;
1175
+ requiredAtExecution: boolean;
1176
+ hidden?: boolean;
1177
+ locked?: boolean;
1178
+ helpText?: string;
1179
+ placement?: 'toolbar' | 'card_header' | 'advanced';
1180
+ showLabel?: boolean;
1181
+ toolbarWidth?: number;
1182
+ };
1183
+
1184
+ export declare type ControlInitialValueStrategy = 'saved_default' | 'builtin' | 'embed_required' | 'schedule_snapshot';
1185
+
1186
+ export declare type ControlOption = {
1187
+ value: string;
1188
+ label: string;
1189
+ presentation?: {
1190
+ granularity?: TimeGranularity;
1191
+ dateFormat?: DateFormatValue;
1192
+ customFormat?: string;
1193
+ };
1194
+ };
1195
+
1196
+ export declare type ControlScope = 'dashboard' | 'card';
1197
+
1198
+ export declare type ControlSource = {
1199
+ kind: 'manual';
1200
+ options: ControlOption[];
1201
+ } | {
1202
+ kind: 'dataset_values';
1203
+ fieldId: string;
1204
+ connectionId?: string;
1205
+ } | {
1206
+ kind: 'field_allowlist';
1207
+ fieldIds: string[];
1208
+ } | {
1209
+ kind: 'metric_allowlist';
1210
+ metricIds: string[];
1211
+ };
1212
+
1213
+ export declare type ControlType = 'enum' | 'multi_enum' | 'text' | 'number' | 'boolean' | 'date' | 'field_selector' | 'metric_selector' | 'aggregation_selector' | 'grain_selector';
1214
+
1117
1215
  export declare function createAlert(apiServiceUrl: string, token: string, payload: CreateAlertRequest): Promise<{
1118
1216
  alert: Alert;
1119
1217
  }>;
@@ -1162,6 +1260,10 @@ export declare interface CreateExportRequest {
1162
1260
  cardConfig: CardConfig;
1163
1261
  cardDataSource: DataSource;
1164
1262
  active_filters: TFilterValue[];
1263
+ controlValues?: Record<string, unknown>;
1264
+ controlDefinitions?: ControlDefinition[];
1265
+ cardControlDefinitions?: ControlDefinition[];
1266
+ controlBindings?: ControlBinding[];
1165
1267
  timezone?: string;
1166
1268
  totalRows: number;
1167
1269
  format: ExportFormat;
@@ -1198,6 +1300,26 @@ declare type DashboardAIContext = AIContext & {
1198
1300
 
1199
1301
  declare type DashboardAIContextMode = 'auto' | 'fixed';
1200
1302
 
1303
+ declare type DashboardControlsModelOptions = {
1304
+ renamed?: {
1305
+ oldId: string;
1306
+ newId: string;
1307
+ };
1308
+ removedControlId?: string;
1309
+ cardBindingsById?: ControlBindingsByCardId;
1310
+ affectedBindingControlIds?: string[];
1311
+ };
1312
+
1313
+ export declare function DashboardControlsSettings({ open, onOpenChange, trigger, showTrigger, initialMode, }: DashboardControlsSettingsProps): JSX.Element;
1314
+
1315
+ declare type DashboardControlsSettingsProps = {
1316
+ open?: boolean;
1317
+ onOpenChange?: (open: boolean) => void;
1318
+ trigger?: ReactNode;
1319
+ showTrigger?: boolean;
1320
+ initialMode?: 'manage' | 'create';
1321
+ };
1322
+
1201
1323
  export declare type DashboardEventHandlers = {
1202
1324
  onExportData?: (payload: ExportDataPayload) => void;
1203
1325
  };
@@ -1209,6 +1331,21 @@ declare interface DashboardExportDialogProps {
1209
1331
  onOpenChange: (open: boolean) => void;
1210
1332
  }
1211
1333
 
1334
+ export declare function DashboardFilterControlsButton({ showFilters, onToggleFilters, onAddFilter, onAddControl, onManageControls, size, className, primaryButtonClassName, secondaryButtonClassName, dropdownContentClassName, }: DashboardFilterControlsButtonProps): JSX.Element;
1335
+
1336
+ declare type DashboardFilterControlsButtonProps = {
1337
+ showFilters: boolean;
1338
+ onToggleFilters: () => void;
1339
+ onAddFilter: () => void;
1340
+ onAddControl: () => void;
1341
+ onManageControls: () => void;
1342
+ size?: 'default' | 'toolbar';
1343
+ className?: string;
1344
+ primaryButtonClassName?: string;
1345
+ secondaryButtonClassName?: string;
1346
+ dropdownContentClassName?: string;
1347
+ };
1348
+
1212
1349
  declare type DashboardPlusProps = {
1213
1350
  showControls?: boolean;
1214
1351
  showFooter?: boolean;
@@ -1251,6 +1388,20 @@ export declare type DashboardProps = {
1251
1388
  * Default filter values for the dashboard. The dashboard will be filtered by these values when the user loads the dashboard.
1252
1389
  */
1253
1390
  defaultFilterValues?: TFilterValue[];
1391
+ /**
1392
+ * Default runtime control values for the dashboard. Used by print/render flows
1393
+ * and other external entry points that need deterministic control state.
1394
+ */
1395
+ defaultControlValues?: Record<string, unknown>;
1396
+ /**
1397
+ * Optional control contract override used by print/replay entry points that
1398
+ * need to execute against a saved card/dashboard control contract snapshot.
1399
+ */
1400
+ controlContractOverrides?: {
1401
+ controlDefinitions?: ControlDefinition[];
1402
+ cardControlDefinitions?: ControlDefinition[];
1403
+ controlBindings?: ControlBinding[];
1404
+ };
1254
1405
  customStyle?: TStyle;
1255
1406
  currentTheme?: Theme;
1256
1407
  version?: string;
@@ -1304,6 +1455,10 @@ export declare type DashboardStore = {
1304
1455
  filterValues?: TFilterValue[];
1305
1456
  /** Runtime-only inline filter values, keyed by cardId. Not persisted with dashboard. */
1306
1457
  inlineFilterValuesMap: Record<string, TFilterValue[]>;
1458
+ /** Runtime-only dashboard control values keyed by globally unique controlId. */
1459
+ controlValues: Record<string, unknown>;
1460
+ /** Runtime-only card-scoped control values, keyed by cardId then controlId. */
1461
+ cardControlValuesMap: Record<string, Record<string, unknown>>;
1307
1462
  isDashboardPanelOpen: boolean;
1308
1463
  drillHistory: Array<{
1309
1464
  sourceDashboardId: string;
@@ -2229,6 +2384,11 @@ export declare type FilterLayoutSettings = {
2229
2384
  * Useful when embedding Dashboard component without Surfboard's controls
2230
2385
  */
2231
2386
  showDownloadButton?: boolean;
2387
+ /**
2388
+ * Mixed toolbar item order for dashboard-level filter and control chips.
2389
+ * Values use prefixed ids like `filter:<id>` and `control:<id>`.
2390
+ */
2391
+ toolbarItemOrder?: string[];
2232
2392
  };
2233
2393
 
2234
2394
  declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
@@ -3169,6 +3329,10 @@ declare type StringOptions = {
3169
3329
  maxLength?: number;
3170
3330
  };
3171
3331
 
3332
+ export declare type StructuralFieldSelectorTarget = GroupByField;
3333
+
3334
+ export declare type StructuralMetricSelectorTarget = MetricField;
3335
+
3172
3336
  /**
3173
3337
  * Style propeerites for the dashboard
3174
3338
  */
@@ -3487,6 +3651,14 @@ export declare type TCard = {
3487
3651
  * Configured by editors via the visual editor settings.
3488
3652
  */
3489
3653
  inlineFilters?: TInlineFilter[];
3654
+ /**
3655
+ * Card-scoped control definitions for this card.
3656
+ */
3657
+ controls?: ControlDefinition[];
3658
+ /**
3659
+ * Per-card bindings that connect dashboard or card controls to this card's runtime targets.
3660
+ */
3661
+ controlBindings?: ControlBinding[];
3490
3662
  };
3491
3663
 
3492
3664
  export declare type TCardContext = {
@@ -3705,6 +3877,8 @@ export declare type TDashboard = {
3705
3877
  globalCacheConfig?: CacheConfig;
3706
3878
  emailSettings?: EmailSettings;
3707
3879
  defaultFilterValues?: TFilterValue[];
3880
+ controls?: ControlDefinition[];
3881
+ defaultControlValues?: Record<string, unknown>;
3708
3882
  filterLayout?: FilterLayoutSettings;
3709
3883
  };
3710
3884
 
@@ -290,6 +290,76 @@ declare type ColumnType = 'string' | 'number' | 'date';
290
290
 
291
291
  declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
292
292
 
293
+ declare type ControlBinding = {
294
+ controlId: string;
295
+ target: 'sql_param';
296
+ paramId: string;
297
+ } | {
298
+ controlId: string;
299
+ target: 'config_metric_selector';
300
+ mapping: Record<string, StructuralMetricSelectorTarget>;
301
+ } | {
302
+ controlId: string;
303
+ target: 'config_field_selector';
304
+ mapping: Record<string, StructuralFieldSelectorTarget>;
305
+ } | {
306
+ controlId: string;
307
+ target: 'config_aggregation';
308
+ mapping: Record<string, string>;
309
+ } | {
310
+ controlId: string;
311
+ target: 'config_grain';
312
+ mapping: Record<string, string>;
313
+ };
314
+
315
+ declare type ControlDefinition = {
316
+ id: string;
317
+ label: string;
318
+ scope: ControlScope;
319
+ type: ControlType;
320
+ source: ControlSource;
321
+ initialValueStrategy: ControlInitialValueStrategy;
322
+ defaultValue?: unknown;
323
+ requiredAtExecution: boolean;
324
+ hidden?: boolean;
325
+ locked?: boolean;
326
+ helpText?: string;
327
+ placement?: 'toolbar' | 'card_header' | 'advanced';
328
+ showLabel?: boolean;
329
+ toolbarWidth?: number;
330
+ };
331
+
332
+ declare type ControlInitialValueStrategy = 'saved_default' | 'builtin' | 'embed_required' | 'schedule_snapshot';
333
+
334
+ declare type ControlOption = {
335
+ value: string;
336
+ label: string;
337
+ presentation?: {
338
+ granularity?: TimeGranularity;
339
+ dateFormat?: DateFormatValue;
340
+ customFormat?: string;
341
+ };
342
+ };
343
+
344
+ declare type ControlScope = 'dashboard' | 'card';
345
+
346
+ declare type ControlSource = {
347
+ kind: 'manual';
348
+ options: ControlOption[];
349
+ } | {
350
+ kind: 'dataset_values';
351
+ fieldId: string;
352
+ connectionId?: string;
353
+ } | {
354
+ kind: 'field_allowlist';
355
+ fieldIds: string[];
356
+ } | {
357
+ kind: 'metric_allowlist';
358
+ metricIds: string[];
359
+ };
360
+
361
+ declare type ControlType = 'enum' | 'multi_enum' | 'text' | 'number' | 'boolean' | 'date' | 'field_selector' | 'metric_selector' | 'aggregation_selector' | 'grain_selector';
362
+
293
363
  declare type CustomCard = CardWithContent | CardWithFooter;
294
364
 
295
365
  declare type DashboardAIContext = AIContext & {
@@ -695,6 +765,11 @@ declare type FilterLayoutSettings = {
695
765
  * Useful when embedding Dashboard component without Surfboard's controls
696
766
  */
697
767
  showDownloadButton?: boolean;
768
+ /**
769
+ * Mixed toolbar item order for dashboard-level filter and control chips.
770
+ * Values use prefixed ids like `filter:<id>` and `control:<id>`.
771
+ */
772
+ toolbarItemOrder?: string[];
698
773
  };
699
774
 
700
775
  declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
@@ -1063,6 +1138,10 @@ declare type StringOptions = {
1063
1138
  maxLength?: number;
1064
1139
  };
1065
1140
 
1141
+ declare type StructuralFieldSelectorTarget = GroupByField;
1142
+
1143
+ declare type StructuralMetricSelectorTarget = MetricField;
1144
+
1066
1145
  /**
1067
1146
  * Style propeerites for the dashboard
1068
1147
  */
@@ -1286,6 +1365,14 @@ declare type TCard = {
1286
1365
  * Configured by editors via the visual editor settings.
1287
1366
  */
1288
1367
  inlineFilters?: TInlineFilter[];
1368
+ /**
1369
+ * Card-scoped control definitions for this card.
1370
+ */
1371
+ controls?: ControlDefinition[];
1372
+ /**
1373
+ * Per-card bindings that connect dashboard or card controls to this card's runtime targets.
1374
+ */
1375
+ controlBindings?: ControlBinding[];
1289
1376
  };
1290
1377
 
1291
1378
  declare type TCardPreferences = {
@@ -1495,6 +1582,8 @@ declare type TDashboard = {
1495
1582
  globalCacheConfig?: CacheConfig;
1496
1583
  emailSettings?: EmailSettings;
1497
1584
  defaultFilterValues?: TFilterValue[];
1585
+ controls?: ControlDefinition[];
1586
+ defaultControlValues?: Record<string, unknown>;
1498
1587
  filterLayout?: FilterLayoutSettings;
1499
1588
  };
1500
1589