@acronis-platform/ui-react 0.58.0 → 0.61.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.
Files changed (118) hide show
  1. package/README.md +5 -5
  2. package/dist/components/ui/app-shell/app-shell.js.map +1 -1
  3. package/dist/components/ui/area-chart/area-chart.js +210 -119
  4. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  5. package/dist/components/ui/avatar/avatar.js +26 -23
  6. package/dist/components/ui/avatar/avatar.js.map +1 -1
  7. package/dist/components/ui/bar-chart/bar-chart.js +595 -149
  8. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  9. package/dist/components/ui/calendar/calendar.js +17 -15
  10. package/dist/components/ui/calendar/calendar.js.map +1 -1
  11. package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
  12. package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
  13. package/dist/components/ui/category-bar/category-bar.js +147 -0
  14. package/dist/components/ui/category-bar/category-bar.js.map +1 -0
  15. package/dist/components/ui/chart/chart-format.js +170 -0
  16. package/dist/components/ui/chart/chart-format.js.map +1 -0
  17. package/dist/components/ui/chart/chart.js +204 -150
  18. package/dist/components/ui/chart/chart.js.map +1 -1
  19. package/dist/components/ui/composed-chart/composed-chart.js +423 -98
  20. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  21. package/dist/components/ui/confidence-cone/confidence-cone.js +306 -172
  22. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  23. package/dist/components/ui/dialog/dialog.js +29 -29
  24. package/dist/components/ui/dialog/dialog.js.map +1 -1
  25. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
  26. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
  27. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
  28. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
  29. package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
  30. package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
  31. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  32. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  33. package/dist/components/ui/histogram/histogram.js +96 -64
  34. package/dist/components/ui/histogram/histogram.js.map +1 -1
  35. package/dist/components/ui/input/input.js.map +1 -1
  36. package/dist/components/ui/line-chart/line-chart.js +230 -159
  37. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  38. package/dist/components/ui/metric/metric.js +88 -70
  39. package/dist/components/ui/metric/metric.js.map +1 -1
  40. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  41. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  42. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  43. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  44. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  45. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  46. package/dist/components/ui/sankey-chart/sankey-chart.js +199 -0
  47. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
  48. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -50
  49. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  50. package/dist/components/ui/timeline/timeline.js +206 -142
  51. package/dist/components/ui/timeline/timeline.js.map +1 -1
  52. package/dist/components/ui/toolbar/toolbar.js +82 -92
  53. package/dist/components/ui/toolbar/toolbar.js.map +1 -1
  54. package/dist/components/ui/treemap/treemap.js +183 -59
  55. package/dist/components/ui/treemap/treemap.js.map +1 -1
  56. package/dist/index.js +481 -439
  57. package/dist/index.js.map +1 -1
  58. package/dist/lib/breakpoints.js +9 -6
  59. package/dist/lib/breakpoints.js.map +1 -1
  60. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
  61. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
  62. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
  63. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
  64. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
  65. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
  66. package/dist/react.js +481 -439
  67. package/dist/react.js.map +1 -1
  68. package/dist/src/components/ui/area-chart/area-chart.d.ts +52 -17
  69. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  70. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  71. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +152 -29
  72. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  73. package/dist/src/components/ui/button/button.d.ts +1 -1
  74. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  75. package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
  76. package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
  77. package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
  78. package/dist/src/components/ui/category-bar/index.d.ts +1 -0
  79. package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
  80. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  81. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  82. package/dist/src/components/ui/chart/chart-format.d.ts +526 -0
  83. package/dist/src/components/ui/chart/chart.d.ts +11 -3
  84. package/dist/src/components/ui/chart/index.d.ts +3 -1
  85. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +154 -20
  86. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  87. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -37
  88. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  89. package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
  90. package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
  91. package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
  92. package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
  93. package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
  94. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  95. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  96. package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
  97. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  98. package/dist/src/components/ui/line-chart/line-chart.d.ts +50 -17
  99. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  100. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  101. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  102. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  103. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  104. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  105. package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
  106. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
  107. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
  108. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  109. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  110. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  111. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  112. package/dist/src/index.d.ts +5 -1
  113. package/dist/ui-react.css +1 -1
  114. package/package.json +5 -4
  115. package/dist/components/ui/search-global/search-global.js +0 -60
  116. package/dist/components/ui/search-global/search-global.js.map +0 -1
  117. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  118. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
@@ -1,15 +1,115 @@
1
- import { ChartTooltip, ChartConfig } from '../chart';
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { ChartConfig, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCategoryRange, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition, ChartYAxisTarget, SecondaryYAxisProps } from '../chart';
2
3
  import * as React from 'react';
4
+ declare const composedChartVariants: (props?: ({
5
+ orientation?: "horizontal" | "vertical" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
3
7
  export type ComposedSeriesType = 'bar' | 'line' | 'area';
8
+ /** Interpolation for a line or area series. */
9
+ export type ComposedCurveType = 'linear' | 'monotone' | 'step';
10
+ /**
11
+ * How a series is marked in the legend. Deliberately narrower than recharts'
12
+ * icon set: `ChartLegendContent` draws its own marker and reads only whether the
13
+ * entry is a `line` (a rule, dashed when the series is) or anything else (a
14
+ * swatch), so the wider union would advertise icons that never render. `none`
15
+ * keeps the series off the legend entirely.
16
+ */
17
+ export type ComposedSeriesLegendType = 'line' | 'rect' | 'none';
18
+ /** Plot-area inset, in px. Any side left out keeps the chart's own default. */
19
+ export interface ComposedChartMargin {
20
+ top?: number;
21
+ right?: number;
22
+ bottom?: number;
23
+ left?: number;
24
+ }
4
25
  export interface ComposedSeries {
5
26
  /** Column key to plot — must match a `config` entry; drives its `--color-<key>` paint. */
6
27
  key: string;
7
28
  /** How this series renders. */
8
29
  type: ComposedSeriesType;
30
+ /**
31
+ * Which value axis this series is measured against. Defaults to `primary`.
32
+ * The secondary axis is rendered only when at least one series selects it — use
33
+ * it when a series carries a different unit or magnitude (a rate next to a
34
+ * count) that a shared scale would flatten.
35
+ */
36
+ yAxis?: ChartYAxisTarget;
37
+ /**
38
+ * Paint for this series, overriding its `config` color. Reference an existing
39
+ * semantic `--ui-*` token; there is no chart palette tier yet.
40
+ */
41
+ color?: string;
42
+ /**
43
+ * Stack this series with every other series of the *same mark type* carrying
44
+ * the same id. Bars stack with bars and areas with areas — the ids are
45
+ * namespaced per type, so one id can't merge a bar into an area stack. Ignored
46
+ * on a line series, which recharts does not stack.
47
+ */
48
+ stackId?: string;
49
+ /** Interpolation, overriding the chart's `curve`. Line and area series only. */
50
+ curve?: ComposedCurveType;
51
+ /**
52
+ * Stroke width, overriding the chart's `strokeWidth` on a line or area series.
53
+ * On a bar it sizes the dashed outline `strokeDasharray` draws — a bar has no
54
+ * other stroke, so the chart-level default never reaches one and this is the
55
+ * only way to set it.
56
+ */
57
+ strokeWidth?: number;
58
+ /**
59
+ * Dash pattern for the stroke (an SVG `stroke-dasharray`, e.g. `'5 5'`) — the
60
+ * conventional way to mark a series as a projection. On a bar series it draws a
61
+ * dashed outline in the series colour.
62
+ */
63
+ strokeDasharray?: string;
64
+ /** Render a dot at each point, overriding the chart's `showDots`. Line and area series only. */
65
+ showDots?: boolean;
66
+ /** Render the hover dot, overriding the chart's `showActiveDots`. Line and area series only. */
67
+ showActiveDots?: boolean;
68
+ /** Bridge `null` gaps instead of breaking the series, overriding `connectNulls`. */
69
+ connectNulls?: boolean;
70
+ /** Corner radius on the growing end, overriding the chart's `barRadius`. Bar series only. */
71
+ barRadius?: number;
72
+ /** Fixed bar thickness in px, overriding the chart's `barSize`. Bar series only. */
73
+ barSize?: number;
74
+ /** Highlight this bar on hover, overriding the chart's `showActiveBar`. Bar series only. */
75
+ showActiveBar?: boolean;
76
+ /** Draw a full-height track behind this series' bars, overriding `showBackground`. Bar series only. */
77
+ showBackground?: boolean;
78
+ /** Fill opacity, overriding the chart's `fillOpacity` (which applies to area series). */
79
+ fillOpacity?: number;
80
+ /** How this series is marked in the legend — `none` keeps it off the legend. */
81
+ legendType?: ComposedSeriesLegendType;
9
82
  }
10
- export interface ComposedChartProps extends Omit<React.ComponentProps<'div'>, 'children'> {
11
- /** Row-per-category data. Each object holds `xKey` + one numeric field per series. */
12
- data: ReadonlyArray<Record<string, string | number>>;
83
+ /**
84
+ * A dashed rule on the chart. Either a position on the *value* axis (a fixed
85
+ * `value`, or the mean of one/every series via `average`) or, with `category`, a
86
+ * rule across the *category* axis at one category — the "today" divider between
87
+ * actuals and forecast. A value position wins if both are given.
88
+ */
89
+ export interface ComposedChartReferenceLine extends ChartReferenceLine {
90
+ /**
91
+ * Category to draw the rule at — the category's own value (an `xKey` cell) or
92
+ * its 0-based row index.
93
+ */
94
+ category?: string | number;
95
+ /**
96
+ * Which value axis the rule is measured against, on a chart carrying two.
97
+ * Defaults to the axis of the series named by `average`, and to `primary`
98
+ * otherwise — so a target read off the secondary scale lands on it rather
99
+ * than being plotted against the primary one. `average: true` then pools only
100
+ * the series on this axis, never two scales at once. Inert while no series
101
+ * selects the secondary axis.
102
+ */
103
+ yAxis?: ChartYAxisTarget;
104
+ }
105
+ /** A shaded band behind a range of categories. */
106
+ export interface ComposedChartReferenceArea extends ChartCategoryRange {
107
+ /** Caption above the band. */
108
+ label?: string;
109
+ }
110
+ export interface ComposedChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof composedChartVariants>, CartesianChartProps, SecondaryYAxisProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
111
+ /** Row-per-category data. Each object holds `xKey` + one numeric field per series (`null` breaks a line/area unless `connectNulls`). */
112
+ data: ReadonlyArray<Record<string, string | number | null>>;
13
113
  /**
14
114
  * Per-series map of `label` / `color`, keyed by `series[].key` (imported from
15
115
  * the shared `Chart` primitives). Turned into `--color-<key>` custom
@@ -17,32 +117,66 @@ export interface ComposedChartProps extends Omit<React.ComponentProps<'div'>, 'c
17
117
  * `--ui-*` token; there is no chart palette tier yet.
18
118
  */
19
119
  config: ChartConfig;
20
- /** Series to plot, each `{ key, type }` — one bar/line/area per entry. Each key must exist in `config` and every data row. */
120
+ /**
121
+ * Series to plot, each `{ key, type }` plus any per-series style override —
122
+ * one bar/line/area per entry. Each key must exist in `config` and every data
123
+ * row. Every styling prop on the chart is the default a series overrides here.
124
+ */
21
125
  series: ComposedSeries[];
22
126
  /** Category axis key (the shared dimension across rows, e.g. `"month"`). */
23
127
  xKey: string;
24
- /** Title rendered beneath the horizontal (X) axis. */
25
- xAxisLabel?: string;
26
- /** Title rendered beside the vertical (Y) axis (rotated). */
27
- yAxisLabel?: string;
28
- /** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */
29
- yUnit?: string;
128
+ /**
129
+ * One or more dashed reference lines — on a value axis (`value` / `average`,
130
+ * placed by the entry's `yAxis`) or across the category axis (`category`).
131
+ * Pass a single object or an array.
132
+ */
133
+ referenceLine?: ComposedChartReferenceLine | ComposedChartReferenceLine[];
134
+ /**
135
+ * One or more shaded bands behind a range of categories — e.g. a forecast
136
+ * period. Pass a single object or an array to draw several.
137
+ */
138
+ referenceArea?: ComposedChartReferenceArea | ComposedChartReferenceArea[];
139
+ /** Unit suffix on the value-axis tick values when it is X (`orientation="horizontal"`). */
140
+ xUnit?: string;
30
141
  /** Interpolation for the line and area series. */
31
- curve?: 'linear' | 'monotone' | 'step';
142
+ curve?: ComposedCurveType;
32
143
  /** Corner radius on the growing end of bar series. */
33
144
  barRadius?: number;
145
+ /** Fixed bar thickness, in px. Unset, recharts sizes bars from the available width. */
146
+ barSize?: number;
147
+ /** Gap between bars of the same category, in px or a percentage string. */
148
+ barGap?: number | string;
149
+ /** Gap between category groups, in px or a percentage string. */
150
+ barCategoryGap?: number | string;
151
+ /** Draw a full-height track behind every bar. */
152
+ showBackground?: boolean;
153
+ /** Fill for the track background. Defaults to the secondary surface. */
154
+ backgroundFill?: string;
155
+ /** Highlight the hovered bar. */
156
+ showActiveBar?: boolean;
34
157
  /** Flat-fill opacity for area series. */
35
158
  fillOpacity?: number;
36
- showGrid?: boolean;
37
- showTooltip?: boolean;
159
+ /** Stroke width for the line series. Areas keep recharts' thinner outline unless set. */
160
+ strokeWidth?: number;
161
+ /** Render a dot at each point of the line and area series. */
162
+ showDots?: boolean;
163
+ /** Render the hover dot on the line and area series. Unset, recharts' own default applies. */
164
+ showActiveDots?: boolean;
165
+ /** Bridge `null` gaps in the data instead of breaking the line/area. */
166
+ connectNulls?: boolean;
167
+ /** Plot-area inset. Any side left out keeps the chart's own default. */
168
+ margin?: ComposedChartMargin;
169
+ /** Draw the hover cursor (the band/rule under the tooltip). Defaults to `true`. */
170
+ tooltipCursor?: boolean;
38
171
  showLegend?: boolean;
172
+ /** Which edge the legend sits on. Defaults to `bottom`. */
173
+ legendPosition?: 'top' | 'bottom';
39
174
  /**
40
- * Replace the default tooltip. Pass a configured `ChartTooltipContent`
41
- * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /
42
- * `indicator` — to customize formatting, per-series rows, or extra fields
43
- * without composing recharts yourself. Ignored when `showTooltip` is false.
175
+ * Position of the value labels when `showLabels` is on. Defaults to each
176
+ * series' growing end — `top` (or `right` when horizontal), and the centre of
177
+ * a stacked segment, which has no free space at its end.
44
178
  */
45
- tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
179
+ labelPosition?: CartesianLabelPosition;
46
180
  }
47
181
  declare const ComposedChart: React.ForwardRefExoticComponent<Omit<ComposedChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
48
- export { ComposedChart };
182
+ export { ComposedChart, composedChartVariants };
@@ -1 +1 @@
1
- export { ComposedChart, type ComposedChartProps, type ComposedSeries, type ComposedSeriesType, } from './composed-chart';
1
+ export { ComposedChart, composedChartVariants, type ComposedChartProps, type ComposedChartMargin, type ComposedChartReferenceArea, type ComposedChartReferenceLine, type ComposedCurveType, type ComposedSeries, type ComposedSeriesLegendType, type ComposedSeriesType, } from './composed-chart';
@@ -1,14 +1,23 @@
1
- import { ChartTooltip, ChartConfig } from '../chart';
1
+ import { ChartTooltip, ChartConfig, CartesianChartProps, ChartAnimationProps } from '../chart';
2
2
  import * as React from 'react';
3
3
  /**
4
- * Drop the synthetic cone-band range series from a recharts tooltip/legend
4
+ * Drop every synthetic cone-band range series from a recharts tooltip/legend
5
5
  * payload, keeping the real actual/forecast series (and their order). Applied to
6
- * both the default tooltip and any caller-supplied `tooltipContent`, so the
7
- * `__cone` band never surfaces regardless of which path renders.
6
+ * both the default tooltip and any caller-supplied `tooltipContent`, so no band
7
+ * surfaces regardless of which path renders or how many series are plotted.
8
8
  */
9
9
  export declare function dropConeBand<T extends {
10
10
  dataKey?: unknown;
11
11
  }>(payload: readonly T[] | undefined): T[] | undefined;
12
+ /**
13
+ * Reduce a legend payload to the metrics the chart plots — one entry per series.
14
+ * A series' actual, forecast and cone are three recharts series painting a
15
+ * single metric in a single hue, so the legend names each metric once, with its
16
+ * actual series' swatch, instead of listing line styles as separate series.
17
+ */
18
+ export declare function keepMetricSeries<T extends {
19
+ dataKey?: unknown;
20
+ }>(payload: readonly T[] | undefined, actualKeys: readonly string[]): T[] | undefined;
12
21
  /**
13
22
  * Wrap a caller-supplied `tooltipContent` so the synthetic cone band is stripped
14
23
  * from the payload before it renders, while preserving recharts' own mount
@@ -22,58 +31,150 @@ type TooltipContentType = NonNullable<React.ComponentProps<typeof ChartTooltip>[
22
31
  type TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;
23
32
  type TooltipRenderProps = Parameters<TooltipContentFn>[0];
24
33
  export declare function createConeTooltip(tooltipContent: TooltipContentType): (props: TooltipRenderProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.FunctionComponentElement<import('recharts').TooltipContentProps<import('recharts').TooltipValueType, import('recharts/types/component/DefaultTooltipContent').NameType>>;
25
- export interface ConfidenceConeProps extends Omit<React.ComponentProps<'div'>, 'children'> {
34
+ /**
35
+ * One plotted metric: its actual / forecast columns and, optionally, the two
36
+ * bound columns that shade its cone. Omit `lowerKey`/`upperKey` for a band-less
37
+ * metric — a solid line handing off to a bare dashed projection.
38
+ */
39
+ export interface ConfidenceConeSeries {
40
+ /** Field for the known/actual values — drawn as a solid line with a filled area. */
41
+ actualKey: string;
42
+ /** Field for the projected values — drawn as a dashed line. */
43
+ forecastKey: string;
44
+ /** Field for the cone's lower bound. Omit (with `upperKey`) for no cone. */
45
+ lowerKey?: string;
46
+ /** Field for the cone's upper bound. Omit (with `lowerKey`) for no cone. */
47
+ upperKey?: string;
48
+ }
49
+ /**
50
+ * The x values of the projected period — every row carrying a forecast value for
51
+ * at least one series, in data order. The first is the hand-off point (where the
52
+ * shaded region and divider start); the whole set drives the forecast tick
53
+ * styling, matched by value so tick `interval` can't skew it the way a tick
54
+ * index would. Exported for unit tests; not part of the package's public API.
55
+ */
56
+ export declare function forecastPeriodX(data: ReadonlyArray<Record<string, string | number | null | undefined>>, series: readonly ConfidenceConeSeries[], xKey: string): Array<string | number | null | undefined>;
57
+ /**
58
+ * Build the X-axis tick renderer that sets the projected columns apart: italic,
59
+ * in the metric's hue. Styled inline rather than through the `fill` attribute
60
+ * recharts hands every tick, so the accent survives the class-based tick color
61
+ * a chart theme may apply. A custom tick owns its own text, so the caller's
62
+ * `xTickFormatter` is applied here — recharts only applies it to default ticks.
63
+ * Exported for unit tests; not part of the package's public API.
64
+ */
65
+ export declare function createForecastTick(forecastX: ReadonlySet<string | number | null | undefined>, color: string, tickFormatter?: CartesianChartProps['xTickFormatter']): ({ payload, index, ...tickProps }: {
66
+ payload?: {
67
+ value?: string | number;
68
+ };
69
+ index?: number;
70
+ }) => import("react/jsx-runtime").JSX.Element;
71
+ /** A dashed horizontal threshold on the value axis. */
72
+ export interface ConfidenceConeReferenceLine {
73
+ /** Position on the value (Y) axis. */
74
+ value: number;
75
+ /** Optional caption rendered at the line's right end. */
76
+ label?: string;
77
+ }
78
+ /**
79
+ * Every prop except the one-form-or-the-other requirement `ConfidenceConeProps`
80
+ * layers on below. Exported so the stories can type their `Meta` on a single
81
+ * object shape — Storybook can't split a union's required args between `meta.args`
82
+ * and a story's. Not re-exported from `index.ts`; not part of the public API.
83
+ */
84
+ export interface ConfidenceConeBaseProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps, ChartAnimationProps {
26
85
  /**
27
- * Row-per-point data — the shared x dimension plus the actual / forecast /
28
- * bound fields. Rows are naturally sparse (a point has either an actual or a
29
- * forecast + bounds), so missing fields are allowed. Avoid a field named
30
- * `__cone` — it's reserved for the internal prediction-band series.
86
+ * Row-per-point data — the shared x dimension plus each series' actual /
87
+ * forecast / bound fields. Rows are naturally sparse (a point has either an
88
+ * actual or a forecast + bounds), so missing fields are allowed. Avoid fields
89
+ * starting with `__cone` — that prefix is reserved for the internal
90
+ * prediction-band series.
31
91
  */
32
92
  data: ReadonlyArray<Record<string, string | number | null | undefined>>;
33
93
  /**
34
94
  * Per-series map of `label` / `color` for the actual + forecast lines
35
95
  * (imported from the shared `Chart` primitives). Colors are caller-supplied —
36
96
  * reference an existing semantic `--ui-*` token; there is no chart palette tier
37
- * yet. The cone band and the forecast line both reuse the actual series'
38
- * color — actual and forecast differ by line style, not hue.
97
+ * yet. Each metric renders in one hue: its cone band and forecast line both
98
+ * reuse its actual series' color — actual and forecast differ by line style,
99
+ * not hue.
39
100
  */
40
101
  config: ChartConfig;
41
102
  /** Category / time axis key (the shared dimension across rows). */
42
103
  xKey: string;
43
- /** Field for the known/actual values — drawn as a solid line with a filled area. */
44
- actualKey: string;
45
- /** Field for the projected values — drawn as a dashed line. */
46
- forecastKey: string;
47
- /** Field for the cone's lower bound. */
48
- lowerKey: string;
49
- /** Field for the cone's upper bound. */
50
- upperKey: string;
51
- /** Title rendered beneath the horizontal (X) axis. */
52
- xAxisLabel?: string;
53
- /** Title rendered beside the vertical (Y) axis (rotated). */
54
- yAxisLabel?: string;
55
- /** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */
56
- yUnit?: string;
104
+ /**
105
+ * Plot several metrics against one shared axis — each with its own actual /
106
+ * forecast / bound fields and its own hue (from `config[actualKey]`). Takes
107
+ * precedence over the single-series `actualKey`/`forecastKey`/`lowerKey`/
108
+ * `upperKey` shorthand below; pass one form or the other, not both. One of the
109
+ * two forms is required.
110
+ */
111
+ series?: readonly ConfidenceConeSeries[];
112
+ /**
113
+ * Single-series shorthand — field for the known/actual values, drawn as a
114
+ * solid line with a filled area. Required (with `forecastKey`) unless `series`
115
+ * is set, which supersedes it.
116
+ */
117
+ actualKey?: string;
118
+ /**
119
+ * Single-series shorthand — field for the projected values, drawn as a dashed
120
+ * line. Required (with `actualKey`) unless `series` is set, which supersedes
121
+ * it.
122
+ */
123
+ forecastKey?: string;
124
+ /** Field for the cone's lower bound. Omit (with `upperKey`) for no cone. */
125
+ lowerKey?: string;
126
+ /** Field for the cone's upper bound. Omit (with `lowerKey`) for no cone. */
127
+ upperKey?: string;
128
+ /**
129
+ * How the known/actual period is drawn: a filled `area` under the line (the
130
+ * default), or a bare `line` — for a chart where the cone is the only shaded
131
+ * region, or where several metrics' fills would muddy each other.
132
+ */
133
+ actualType?: 'area' | 'line';
57
134
  /** Stroke width of the actual + forecast lines. */
58
135
  strokeWidth?: number;
136
+ /**
137
+ * Mark each data point: a filled dot on the observed values, a hollow one on
138
+ * the projection — so a point reads as measured or predicted at a glance.
139
+ */
140
+ showDots?: boolean;
141
+ /**
142
+ * Italicize the X-axis ticks over the forecast period and paint them in the
143
+ * first series' hue, so the projected columns read as projected even when the
144
+ * shaded region is off.
145
+ */
146
+ styleForecastTicks?: boolean;
147
+ /**
148
+ * One or more dashed horizontal thresholds on the value axis — e.g. a target
149
+ * or a capacity limit. Pass a single object or an array to draw several.
150
+ */
151
+ referenceLine?: ConfidenceConeReferenceLine | ConfidenceConeReferenceLine[];
59
152
  /**
60
153
  * Set off the forecast period from the actuals with a dashed divider at the
61
154
  * hand-off point (the first row with a forecast value) and a subtle shaded
62
155
  * band over the forecast region.
63
156
  */
64
157
  showForecastRegion?: boolean;
65
- showGrid?: boolean;
66
- showTooltip?: boolean;
67
158
  showLegend?: boolean;
68
- /**
69
- * Replace the default tooltip. Pass a configured `ChartTooltipContent`
70
- * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
71
- * to customize the tooltip without composing recharts yourself. The synthetic
72
- * cone band is filtered out of the payload before your tooltip sees it, so a
73
- * `__cone` item never reaches your formatter. Ignored when `showTooltip` is
74
- * false.
75
- */
76
- tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
77
159
  }
78
- declare const ConfidenceCone: React.ForwardRefExoticComponent<Omit<ConfidenceConeProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
160
+ /**
161
+ * Which columns to plot has to be spelled out one way or the other: the `series`
162
+ * array, or the flat `actualKey` + `forecastKey` shorthand. Expressed as a union
163
+ * so a chart with neither is a compile error rather than a silent plot of axes
164
+ * and nothing else. Both forms together stay legal — `series` wins (see
165
+ * `plotted`), which is what the multi-series stories rely on to clear the args
166
+ * table.
167
+ */
168
+ export type ConfidenceConeProps = ConfidenceConeBaseProps & ({
169
+ series: readonly ConfidenceConeSeries[];
170
+ } | {
171
+ actualKey: string;
172
+ forecastKey: string;
173
+ });
174
+ declare const ConfidenceCone: React.ForwardRefExoticComponent<(Omit<ConfidenceConeBaseProps & {
175
+ series: readonly ConfidenceConeSeries[];
176
+ }, "ref"> | Omit<ConfidenceConeBaseProps & {
177
+ actualKey: string;
178
+ forecastKey: string;
179
+ }, "ref">) & React.RefAttributes<HTMLDivElement>>;
79
180
  export { ConfidenceCone };
@@ -1 +1 @@
1
- export { ConfidenceCone, type ConfidenceConeProps } from './confidence-cone';
1
+ export { ConfidenceCone, type ConfidenceConeProps, type ConfidenceConeSeries, type ConfidenceConeReferenceLine, } from './confidence-cone';
@@ -0,0 +1,9 @@
1
+ import { CarouselDialogProps } from '../carousel-dialog';
2
+ import * as React from 'react';
3
+ export type DialogFooterCarouselVariant = 'start' | 'middle' | 'end';
4
+ export interface DialogFooterCarouselProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, Pick<CarouselDialogProps, 'slideCount' | 'selectedIndex' | 'onSelectIndex' | 'onBack' | 'onNext' | 'onPrimaryAction' | 'backLabel' | 'nextLabel' | 'primaryLabel' | 'goToSlideLabel'> {
5
+ /** Which slide position this renders for. Defaults to `'start'`. */
6
+ variant?: DialogFooterCarouselVariant;
7
+ }
8
+ declare const DialogFooterCarousel: React.ForwardRefExoticComponent<DialogFooterCarouselProps & React.RefAttributes<HTMLDivElement>>;
9
+ export { DialogFooterCarousel };
@@ -0,0 +1 @@
1
+ export { DialogFooterCarousel, type DialogFooterCarouselProps, type DialogFooterCarouselVariant, } from './dialog-footer-carousel';
@@ -0,0 +1,54 @@
1
+ import { DialogContentProps, DialogRoot } from '../dialog';
2
+ import * as React from 'react';
3
+ export interface DialogWelcomeSlide {
4
+ /** Illustration/media for the slide. Falls back to a placeholder surface when omitted. */
5
+ image?: React.ReactNode;
6
+ title: string;
7
+ description: string;
8
+ }
9
+ export type DialogWelcomeVariant = 'carousel' | 'single';
10
+ type DialogRootProps = React.ComponentPropsWithoutRef<typeof DialogRoot>;
11
+ export interface DialogWelcomeProps extends Omit<DialogRootProps, 'children'> {
12
+ /** Selects the Figma-defined layout. Defaults to `'carousel'`. */
13
+ variant?: DialogWelcomeVariant;
14
+ /** Slides shown one at a time (`variant="carousel"`). Defaults to a 3-slide placeholder. */
15
+ slides?: DialogWelcomeSlide[];
16
+ /** Controls the active slide (`variant="carousel"`). Uncontrolled when omitted. */
17
+ selectedIndex?: number;
18
+ /** Fires whenever the active slide changes (`variant="carousel"`). */
19
+ onSelectedIndexChange?: (index: number) => void;
20
+ /** `Back` button label (`variant="carousel"`). Defaults to `'Back'`. */
21
+ backLabel?: string;
22
+ /** `Next` button label (`variant="carousel"`). Defaults to `'Next'`. */
23
+ nextLabel?: string;
24
+ /** Builds each carousel dot's accessible name (`variant="carousel"`). */
25
+ goToSlideLabel?: (index: number, count: number) => string;
26
+ /** Illustration/media (`variant="single"`). */
27
+ image?: React.ReactNode;
28
+ /** Title (`variant="single"`). Defaults to `'Title'`. */
29
+ title?: string;
30
+ /** Description (`variant="single"`). Defaults to `'Feature description.'`. */
31
+ description?: string;
32
+ /** `Close` link label (`variant="single"`). Defaults to `'Close'`. */
33
+ closeLabel?: string;
34
+ /** Fires when `Close` (`variant="single"`) is activated, before the dialog closes. */
35
+ onCloseAction?: () => void;
36
+ /**
37
+ * Call-to-action button label — the last carousel slide's button
38
+ * (`variant="carousel"`) or the single body's primary button
39
+ * (`variant="single"`). Defaults to `'Call to action'`.
40
+ */
41
+ primaryLabel?: string;
42
+ /** Fires when the call-to-action button is activated. */
43
+ onPrimaryAction?: () => void;
44
+ /** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */
45
+ portal?: boolean;
46
+ /** Portal container (forwarded to `DialogContent`). */
47
+ portalContainer?: DialogContentProps['portalContainer'];
48
+ /** Keep the content mounted while closed (forwarded to `DialogContent`). */
49
+ keepMounted?: DialogContentProps['keepMounted'];
50
+ /** Extra classes merged onto the popup container. */
51
+ className?: string;
52
+ }
53
+ declare const DialogWelcome: React.ForwardRefExoticComponent<DialogWelcomeProps & React.RefAttributes<HTMLDivElement>>;
54
+ export { DialogWelcome };
@@ -0,0 +1,55 @@
1
+ /** Props for `DialogWelcome` — the onboarding/announcement dialog recipe. */
2
+ export interface DialogWelcomeProps {
3
+ /** Selects the Figma-defined layout. Defaults to `'carousel'`. */
4
+ variant?: 'carousel' | 'single';
5
+ /** Slides shown one at a time (`variant="carousel"`). Defaults to a 3-slide placeholder. */
6
+ slides?: Array<{
7
+ image?: unknown;
8
+ title: string;
9
+ description: string;
10
+ }>;
11
+ /** Controls the active slide (`variant="carousel"`). Uncontrolled when omitted. */
12
+ selectedIndex?: number;
13
+ /** Fires whenever the active slide changes (`variant="carousel"`). */
14
+ onSelectedIndexChange?: (index: number) => void;
15
+ /** `Back` button label (`variant="carousel"`). Defaults to `'Back'`. */
16
+ backLabel?: string;
17
+ /** `Next` button label (`variant="carousel"`). Defaults to `'Next'`. */
18
+ nextLabel?: string;
19
+ /** Builds each carousel dot's accessible name (`variant="carousel"`). */
20
+ goToSlideLabel?: (index: number, count: number) => string;
21
+ /** Illustration/media (`variant="single"`). */
22
+ image?: unknown;
23
+ /** Title (`variant="single"`). Defaults to `'Title'`. */
24
+ title?: string;
25
+ /** Description (`variant="single"`). Defaults to `'Feature description.'`. */
26
+ description?: string;
27
+ /** `Close` link label (`variant="single"`). Defaults to `'Close'`. */
28
+ closeLabel?: string;
29
+ /** Fires when `Close` (`variant="single"`) is activated, before the dialog closes. */
30
+ onCloseAction?: () => void;
31
+ /**
32
+ * Call-to-action button label — the last carousel slide's button
33
+ * (`variant="carousel"`) or the single body's primary button
34
+ * (`variant="single"`). Defaults to `'Call to action'`.
35
+ */
36
+ primaryLabel?: string;
37
+ /** Fires when the call-to-action button is activated. */
38
+ onPrimaryAction?: () => void;
39
+ /** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */
40
+ portal?: boolean;
41
+ /** Portal container (forwarded to `DialogContent`). */
42
+ portalContainer?: HTMLElement | null;
43
+ /** Keep the content mounted while closed (forwarded to `DialogContent`). */
44
+ keepMounted?: boolean;
45
+ /** Extra classes merged onto the popup container. */
46
+ className?: string;
47
+ /** Controlled open state. Pair with `onOpenChange`. */
48
+ open?: boolean;
49
+ /** Open on mount, uncontrolled. */
50
+ defaultOpen?: boolean;
51
+ /** Modal behavior — focus trap and scroll lock while open. Defaults to `true`. */
52
+ modal?: boolean | 'trap-focus';
53
+ /** Fires when the dialog opens or closes. */
54
+ onOpenChange?: (open: boolean, eventDetails: unknown) => void;
55
+ }
@@ -0,0 +1 @@
1
+ export { DialogWelcome, type DialogWelcomeProps, type DialogWelcomeSlide, type DialogWelcomeVariant, } from './dialog-welcome';