@factorialco/f0-react 6.3.3 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2045,7 +2045,7 @@ declare interface ChatDashboardBarChartConfig extends ChatDashboardChartConfigBa
2045
2045
  stacked?: boolean;
2046
2046
  }
2047
2047
 
2048
- declare type ChatDashboardChartConfig = ChatDashboardBarChartConfig | ChatDashboardLineChartConfig | ChatDashboardFunnelChartConfig | ChatDashboardRadarChartConfig | ChatDashboardPieChartConfig | ChatDashboardGaugeChartConfig | ChatDashboardHeatmapChartConfig;
2048
+ declare type ChatDashboardChartConfig = ChatDashboardBarChartConfig | ChatDashboardLineChartConfig | ChatDashboardFunnelChartConfig | ChatDashboardRadarChartConfig | ChatDashboardPieChartConfig | ChatDashboardGaugeChartConfig | ChatDashboardHeatmapChartConfig | ChatDashboardScatterChartConfig;
2049
2049
 
2050
2050
  declare interface ChatDashboardChartConfigBase {
2051
2051
  showLegend?: boolean;
@@ -2057,7 +2057,7 @@ declare interface ChatDashboardChartConfigBase {
2057
2057
  declare interface ChatDashboardChartItem extends ChatDashboardItemBase {
2058
2058
  type: "chart";
2059
2059
  chart: ChatDashboardChartConfig;
2060
- computation: ChartComputation | RadarComputation | PieComputation | GaugeComputation | HeatmapComputation;
2060
+ computation: ChartComputation | RadarComputation | PieComputation | GaugeComputation | HeatmapComputation | ScatterComputation;
2061
2061
  }
2062
2062
 
2063
2063
  declare interface ChatDashboardCollectionItem extends ChatDashboardItemBase {
@@ -2244,6 +2244,23 @@ declare interface ChatDashboardRadarChartConfig extends ChatDashboardChartConfig
2244
2244
  showArea?: boolean;
2245
2245
  }
2246
2246
 
2247
+ declare interface ChatDashboardScatterChartConfig {
2248
+ type: "scatter";
2249
+ pointSize?: number;
2250
+ scaleAxes?: boolean;
2251
+ showGrid?: boolean;
2252
+ /** Only rendered with 2+ series, but still needed so a skeleton can reserve for it. */
2253
+ showLegend?: boolean;
2254
+ /** What the X measure is, e.g. "salary" — labels the x row in the tooltip */
2255
+ xAxisName?: string;
2256
+ /** What the Y measure is, e.g. "tenure" — labels the y row in the tooltip */
2257
+ yAxisName?: string;
2258
+ /** Formats the Y measure */
2259
+ valueFormat?: FormatPreset;
2260
+ /** Formats the X measure, which is a second measure rather than a category */
2261
+ xValueFormat?: FormatPreset;
2262
+ }
2263
+
2247
2264
  export declare type ChatWidgetEmptyStateProps = Props_6;
2248
2265
 
2249
2266
  declare type ChildrenPaginationInfo = {
@@ -3908,6 +3925,7 @@ declare const defaultTranslations: {
3908
3925
  readonly title: "No data available";
3909
3926
  readonly description: "Try a different date or fewer filters";
3910
3927
  };
3928
+ readonly windowedCategories: "Showing {{count}} of {{total}} categories";
3911
3929
  readonly tooltip: {
3912
3930
  readonly ofTotal: "of total";
3913
3931
  readonly total: "total";
@@ -9622,6 +9640,21 @@ export declare type RichTextEditorProps = F0RichTextEditorProps;
9622
9640
  /** @deprecated Use F0RichTextEditorSkeletonProps */
9623
9641
  export declare type RichTextEditorSkeletonProps = F0RichTextEditorSkeletonProps;
9624
9642
 
9643
+ /**
9644
+ * Both axes are measures, so there is no aggregation: a scatter plots one
9645
+ * point per row rather than grouping rows into categories. `label` names the
9646
+ * column identifying each point, and `series` the optional column that splits
9647
+ * the points into colour groups.
9648
+ */
9649
+ declare interface ScatterComputation {
9650
+ datasetId: string;
9651
+ xAxis: string;
9652
+ yAxis: string;
9653
+ label?: string;
9654
+ series?: string;
9655
+ limit?: number;
9656
+ }
9657
+
9625
9658
  export declare const ScrollArea: WithDataTestIdReturnType<ForwardRefExoticComponent<Omit<Omit<ScrollAreaProps & RefAttributes<HTMLDivElement>, "ref"> & {
9626
9659
  showBar?: boolean;
9627
9660
  viewportRef?: React.RefObject<HTMLDivElement>;
@@ -11965,11 +11998,9 @@ declare module "@tiptap/core" {
11965
11998
 
11966
11999
  declare module "@tiptap/core" {
11967
12000
  interface Commands<ReturnType> {
11968
- enhanceHighlight: {
11969
- setEnhanceHighlight: (from: number, to: number, options?: {
11970
- placeholder?: string;
11971
- }) => ReturnType;
11972
- clearEnhanceHighlight: () => ReturnType;
12001
+ fontSize: {
12002
+ setFontSize: (fontSize: string) => ReturnType;
12003
+ unsetFontSize: () => ReturnType;
11973
12004
  };
11974
12005
  }
11975
12006
  }
@@ -11977,9 +12008,11 @@ declare module "@tiptap/core" {
11977
12008
 
11978
12009
  declare module "@tiptap/core" {
11979
12010
  interface Commands<ReturnType> {
11980
- fontSize: {
11981
- setFontSize: (fontSize: string) => ReturnType;
11982
- unsetFontSize: () => ReturnType;
12011
+ enhanceHighlight: {
12012
+ setEnhanceHighlight: (from: number, to: number, options?: {
12013
+ placeholder?: string;
12014
+ }) => ReturnType;
12015
+ clearEnhanceHighlight: () => ReturnType;
11983
12016
  };
11984
12017
  }
11985
12018
  }
package/dist/f0.d.ts CHANGED
@@ -2802,7 +2802,7 @@ export declare interface ChatDashboardBarChartConfig extends ChatDashboardChartC
2802
2802
  stacked?: boolean;
2803
2803
  }
2804
2804
 
2805
- export declare type ChatDashboardChartConfig = ChatDashboardBarChartConfig | ChatDashboardLineChartConfig | ChatDashboardFunnelChartConfig | ChatDashboardRadarChartConfig | ChatDashboardPieChartConfig | ChatDashboardGaugeChartConfig | ChatDashboardHeatmapChartConfig;
2805
+ export declare type ChatDashboardChartConfig = ChatDashboardBarChartConfig | ChatDashboardLineChartConfig | ChatDashboardFunnelChartConfig | ChatDashboardRadarChartConfig | ChatDashboardPieChartConfig | ChatDashboardGaugeChartConfig | ChatDashboardHeatmapChartConfig | ChatDashboardScatterChartConfig;
2806
2806
 
2807
2807
  declare interface ChatDashboardChartConfigBase {
2808
2808
  showLegend?: boolean;
@@ -2814,7 +2814,7 @@ declare interface ChatDashboardChartConfigBase {
2814
2814
  export declare interface ChatDashboardChartItem extends ChatDashboardItemBase {
2815
2815
  type: "chart";
2816
2816
  chart: ChatDashboardChartConfig;
2817
- computation: ChartComputation | RadarComputation | PieComputation | GaugeComputation | HeatmapComputation;
2817
+ computation: ChartComputation | RadarComputation | PieComputation | GaugeComputation | HeatmapComputation | ScatterComputation;
2818
2818
  }
2819
2819
 
2820
2820
  export declare interface ChatDashboardCollectionItem extends ChatDashboardItemBase {
@@ -3001,6 +3001,23 @@ export declare interface ChatDashboardRadarChartConfig extends ChatDashboardChar
3001
3001
  showArea?: boolean;
3002
3002
  }
3003
3003
 
3004
+ export declare interface ChatDashboardScatterChartConfig {
3005
+ type: "scatter";
3006
+ pointSize?: number;
3007
+ scaleAxes?: boolean;
3008
+ showGrid?: boolean;
3009
+ /** Only rendered with 2+ series, but still needed so a skeleton can reserve for it. */
3010
+ showLegend?: boolean;
3011
+ /** What the X measure is, e.g. "salary" — labels the x row in the tooltip */
3012
+ xAxisName?: string;
3013
+ /** What the Y measure is, e.g. "tenure" — labels the y row in the tooltip */
3014
+ yAxisName?: string;
3015
+ /** Formats the Y measure */
3016
+ valueFormat?: FormatPreset;
3017
+ /** Formats the X measure, which is a second measure rather than a category */
3018
+ xValueFormat?: FormatPreset;
3019
+ }
3020
+
3004
3021
  export declare const ChatSpinner: ForwardRefExoticComponent<ChatSpinnerProps & RefAttributes<HTMLDivElement>>;
3005
3022
 
3006
3023
  declare interface ChatSpinnerProps {
@@ -3645,7 +3662,7 @@ export declare type DashboardCanvasContent = CanvasContentBase & {
3645
3662
  * Chart display configuration — discriminated on `type`.
3646
3663
  * This object is JSON-serializable (no functions, except optional formatters).
3647
3664
  */
3648
- export declare type DashboardChartConfig = BarChartConfig | LineChartConfig | FunnelChartConfig | PieChartConfig | RadarChartConfig | GaugeChartConfig | HeatmapChartConfig;
3665
+ export declare type DashboardChartConfig = BarChartConfig | LineChartConfig | FunnelChartConfig | PieChartConfig | RadarChartConfig | GaugeChartConfig | HeatmapChartConfig | ScatterChartConfig;
3649
3666
 
3650
3667
  export declare interface DashboardChartData {
3651
3668
  /** Category axis labels. Required for bar/line charts. */
@@ -3663,6 +3680,12 @@ export declare interface DashboardChartData {
3663
3680
  };
3664
3681
  /** Heatmap data points as [xIndex, yIndex, value] tuples. */
3665
3682
  data?: [number, number, number][];
3683
+ /**
3684
+ * Scatter series — x/y pairs, optionally split into color groups. Kept on
3685
+ * its own field rather than reusing `series` or `data` so shape detection
3686
+ * can never confuse it with a bar/line series array or the heatmap grid.
3687
+ */
3688
+ scatterSeries?: F0DataChartScatterSeries[];
3666
3689
  }
3667
3690
 
3668
3691
  export declare interface DashboardChartItem<Filters extends FiltersDefinition = FiltersDefinition> extends DashboardItemBase {
@@ -5196,6 +5219,7 @@ export declare const defaultTranslations: {
5196
5219
  readonly title: "No data available";
5197
5220
  readonly description: "Try a different date or fewer filters";
5198
5221
  };
5222
+ readonly windowedCategories: "Showing {{count}} of {{total}} categories";
5199
5223
  readonly tooltip: {
5200
5224
  readonly ofTotal: "of total";
5201
5225
  readonly total: "total";
@@ -8402,7 +8426,7 @@ export declare interface F0DataChartBarProps extends F0DataChartBaseProps {
8402
8426
  /**
8403
8427
  * Per-side clearance in pixels the widest value must have before
8404
8428
  * {@link F0DataChartBarProps.hideOverflowingLabels} counts it as fitting.
8405
- * Overrides the default, which is placement-based: **12** for stacked (inside)
8429
+ * Overrides the default, which is placement-based: **6** for stacked (inside)
8406
8430
  * labels, **0** for labels outside the bar.
8407
8431
  */
8408
8432
  labelFitPadding?: number;
@@ -8415,6 +8439,43 @@ export declare interface F0DataChartBarProps extends F0DataChartBaseProps {
8415
8439
  * widths differ. Height overflow is also evaluated per bar. @default true
8416
8440
  */
8417
8441
  hideAllLabelsOnOverflow?: boolean;
8442
+ /**
8443
+ * Draw only as many categories as fit at a readable bar thickness, instead of
8444
+ * compressing every one of them into the available height.
8445
+ *
8446
+ * Opt-in, because it hides data: a windowed chart shows the first N rows in
8447
+ * data order and nothing in the chart itself leads to the rest. Set it only
8448
+ * where the surrounding UI offers the way back — subscribe to
8449
+ * {@link F0DataChartBarProps.onHiddenCategoriesChange} and put a control next
8450
+ * to the count, as `F0AnalyticsDashboard` does. Left off, a dense chart stays
8451
+ * complete and its bars get thinner, which is the readable-but-honest end of
8452
+ * the trade.
8453
+ *
8454
+ * Ignored by vertical charts, which lay categories out along the width.
8455
+ * @default false
8456
+ */
8457
+ windowCategories?: boolean;
8458
+ /**
8459
+ * Render every category at once, overriding
8460
+ * {@link F0DataChartBarProps.windowCategories}.
8461
+ *
8462
+ * Set this when the reader has asked to see the whole distribution — an
8463
+ * expanded or fullscreen view — and accepts thinner bars in exchange. Ignored
8464
+ * by vertical charts, which lay categories out along the width.
8465
+ * @default false
8466
+ */
8467
+ showAllCategories?: boolean;
8468
+ /**
8469
+ * Reports how many categories the row window is hiding — `0` when every
8470
+ * category is on screen. Fires whenever the count changes, which includes
8471
+ * container resizes and {@link F0DataChartBarProps.showAllCategories} being
8472
+ * switched on.
8473
+ *
8474
+ * The chart states the fact rather than rendering an affordance for it: only
8475
+ * the surrounding UI knows where a "see everything" control belongs. The
8476
+ * dashboard puts it in the widget's description, next to the count.
8477
+ */
8478
+ onHiddenCategoriesChange?: (hiddenCategoryCount: number) => void;
8418
8479
  /**
8419
8480
  * Suggested number of segments on the value axis — lower values draw fewer
8420
8481
  * grid lines. Applies to whichever axis is the value axis (Y for vertical
@@ -8751,9 +8812,9 @@ export declare interface F0DataChartPieSeries {
8751
8812
  * Props for the F0DataChart component.
8752
8813
  *
8753
8814
  * A unified chart component that supports bar, line, funnel, pie, radar,
8754
- * gauge, and heatmap chart types via a discriminated `type` prop.
8815
+ * gauge, heatmap, and scatter chart types via a discriminated `type` prop.
8755
8816
  */
8756
- export declare type F0DataChartProps = F0DataChartBarProps | F0DataChartLineProps | F0DataChartFunnelProps | F0DataChartPieProps | F0DataChartRadarProps | F0DataChartGaugeProps | F0DataChartHeatmapProps;
8817
+ export declare type F0DataChartProps = F0DataChartBarProps | F0DataChartLineProps | F0DataChartFunnelProps | F0DataChartPieProps | F0DataChartRadarProps | F0DataChartGaugeProps | F0DataChartHeatmapProps | F0DataChartScatterProps;
8757
8818
 
8758
8819
  /**
8759
8820
  * A radar chart indicator (axis/dimension).
@@ -8808,6 +8869,89 @@ export declare interface F0DataChartRadarSeries {
8808
8869
  color?: ChartColorToken;
8809
8870
  }
8810
8871
 
8872
+ /**
8873
+ * A single point in a scatter series.
8874
+ *
8875
+ * The bare `[x, y]` tuple is the terse form. The object form additionally
8876
+ * carries `label` — the point's identity (e.g. an employee or team name),
8877
+ * shown as the tooltip header.
8878
+ */
8879
+ export declare type F0DataChartScatterDataPoint = [number, number] | {
8880
+ /** Horizontal position, plotted on the value X axis */
8881
+ x: number;
8882
+ /** Vertical position, plotted on the value Y axis */
8883
+ y: number;
8884
+ /** Identity of this point, used as the tooltip header (e.g. "Ana Ruiz") */
8885
+ label?: string;
8886
+ /** Override color for this individual point. Must be an F0 design token name. */
8887
+ color?: ChartColorToken;
8888
+ };
8889
+
8890
+ /**
8891
+ * Scatter chart variant props.
8892
+ *
8893
+ * Plots x/y pairs on two value axes to show the relationship between two
8894
+ * measures. Unlike bar/line there is no category axis — both axes are
8895
+ * continuous — so this interface is separate from `F0DataChartBaseProps`.
8896
+ * Pass multiple `series` to color-split the points by a group dimension.
8897
+ */
8898
+ export declare interface F0DataChartScatterProps extends F0DataChartCommonProps {
8899
+ /** Chart type */
8900
+ type: "scatter";
8901
+ /** One or more point groups. Multiple series render as a color split. */
8902
+ series: F0DataChartScatterSeries[];
8903
+ /** Point diameter in pixels. @default 12 */
8904
+ pointSize?: number;
8905
+ /**
8906
+ * Fit each axis to its data range instead of anchoring it at zero. Turn off
8907
+ * to force both axes through the origin. @default true
8908
+ */
8909
+ scaleAxes?: boolean;
8910
+ /** Show the legend below the chart. Only rendered with 2+ series. @default true */
8911
+ showLegend?: boolean;
8912
+ /** Show the background grid lines on both axes. @default true */
8913
+ showGrid?: boolean;
8914
+ /** Format the Y axis tick labels */
8915
+ valueFormatter?: (value: number) => string;
8916
+ /** Format the X axis tick labels */
8917
+ xValueFormatter?: (value: number) => string;
8918
+ /**
8919
+ * Formatter for the y value shown in the hover tooltip. Defaults to
8920
+ * {@link valueFormatter}, so a unit or a currency on the Y axis reads the same
8921
+ * on hover, then to a plain localized number. Set it when the axis has to
8922
+ * stay compact ("107.5K") but the tooltip should be exact ("107,505").
8923
+ */
8924
+ tooltipValueFormatter?: (value: number) => string;
8925
+ /**
8926
+ * Formatter for the x value shown in the hover tooltip. Same contract as
8927
+ * {@link tooltipValueFormatter}, against {@link xValueFormatter}.
8928
+ */
8929
+ xTooltipValueFormatter?: (value: number) => string;
8930
+ /**
8931
+ * What the X measure is, e.g. "salary". Labels the x row in the tooltip —
8932
+ * a scatter has no headline value, so both coordinates read as rows and
8933
+ * need naming, the same way radar names its indicators.
8934
+ */
8935
+ xAxisName?: string;
8936
+ /** What the Y measure is, e.g. "tenure". Labels the y row in the tooltip. */
8937
+ yAxisName?: string;
8938
+ /** Escape hatch: raw ECharts options merged (shallow) on top of the generated config */
8939
+ echartsOptions?: Partial<echarts_2.EChartsOption>;
8940
+ }
8941
+
8942
+ /**
8943
+ * A group of points sharing a color and a legend entry. Use one series per
8944
+ * group value to split a scatter by a dimension (e.g. one per department).
8945
+ */
8946
+ export declare interface F0DataChartScatterSeries {
8947
+ /** Display name used in legend and tooltip */
8948
+ name: string;
8949
+ /** Points in this group */
8950
+ data: F0DataChartScatterDataPoint[];
8951
+ /** Override color for this series. Must be an F0 design token name. Falls back to the theme palette. */
8952
+ color?: ChartColorToken;
8953
+ }
8954
+
8811
8955
  /**
8812
8956
  * F0 config options specific to date fields
8813
8957
  *
@@ -16287,6 +16431,53 @@ declare type SampleRatingQuestion = {
16287
16431
  maxLabel?: string;
16288
16432
  };
16289
16433
 
16434
+ export declare interface ScatterChartConfig {
16435
+ type: "scatter";
16436
+ /** Point diameter in pixels. @default 12 */
16437
+ pointSize?: number;
16438
+ /** Fit each axis to its data range instead of anchoring it at zero. @default true */
16439
+ scaleAxes?: boolean;
16440
+ /** Show the legend below the chart. Only rendered with 2+ series. @default true */
16441
+ showLegend?: boolean;
16442
+ /** Show the background grid lines. @default true */
16443
+ showGrid?: boolean;
16444
+ /** Format the Y axis tick labels */
16445
+ valueFormatter?: (value: number) => string;
16446
+ /** Format the X axis tick labels */
16447
+ xValueFormatter?: (value: number) => string;
16448
+ /** Format the y value in the tooltip, which shows full numbers */
16449
+ tooltipValueFormatter?: (value: number) => string;
16450
+ /** Format the x value in the tooltip, which shows full numbers */
16451
+ xTooltipValueFormatter?: (value: number) => string;
16452
+ /** What the X measure is, e.g. "salary" — labels the x row in the tooltip */
16453
+ xAxisName?: string;
16454
+ /** What the Y measure is, e.g. "tenure" — labels the y row in the tooltip */
16455
+ yAxisName?: string;
16456
+ }
16457
+
16458
+ /** Skeleton for scatter chart content area — points with no connecting path. */
16459
+ export declare function ScatterChartSkeleton({ showLegend, }?: ScatterChartSkeletonProps): JSX_2.Element;
16460
+
16461
+ declare interface ScatterChartSkeletonProps {
16462
+ /** Show the legend row below the plot. @default true */
16463
+ showLegend?: boolean;
16464
+ }
16465
+
16466
+ /**
16467
+ * Both axes are measures, so there is no aggregation: a scatter plots one
16468
+ * point per row rather than grouping rows into categories. `label` names the
16469
+ * column identifying each point, and `series` the optional column that splits
16470
+ * the points into colour groups.
16471
+ */
16472
+ export declare interface ScatterComputation {
16473
+ datasetId: string;
16474
+ xAxis: string;
16475
+ yAxis: string;
16476
+ label?: string;
16477
+ series?: string;
16478
+ limit?: number;
16479
+ }
16480
+
16290
16481
  export declare type SearchFilterDefinition = BaseFilterDefinition<"search">;
16291
16482
 
16292
16483
  declare type SearchOptions = {
@@ -19095,11 +19286,9 @@ declare module "@tiptap/core" {
19095
19286
 
19096
19287
  declare module "@tiptap/core" {
19097
19288
  interface Commands<ReturnType> {
19098
- enhanceHighlight: {
19099
- setEnhanceHighlight: (from: number, to: number, options?: {
19100
- placeholder?: string;
19101
- }) => ReturnType;
19102
- clearEnhanceHighlight: () => ReturnType;
19289
+ fontSize: {
19290
+ setFontSize: (fontSize: string) => ReturnType;
19291
+ unsetFontSize: () => ReturnType;
19103
19292
  };
19104
19293
  }
19105
19294
  }
@@ -19107,9 +19296,11 @@ declare module "@tiptap/core" {
19107
19296
 
19108
19297
  declare module "@tiptap/core" {
19109
19298
  interface Commands<ReturnType> {
19110
- fontSize: {
19111
- setFontSize: (fontSize: string) => ReturnType;
19112
- unsetFontSize: () => ReturnType;
19299
+ enhanceHighlight: {
19300
+ setEnhanceHighlight: (from: number, to: number, options?: {
19301
+ placeholder?: string;
19302
+ }) => ReturnType;
19303
+ clearEnhanceHighlight: () => ReturnType;
19113
19304
  };
19114
19305
  }
19115
19306
  }