@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.
- package/README.md +5 -5
- package/dist/components/ui/app-shell/app-shell.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +210 -119
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +26 -23
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +595 -149
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +17 -15
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
- package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +147 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -0
- package/dist/components/ui/chart/chart-format.js +170 -0
- package/dist/components/ui/chart/chart-format.js.map +1 -0
- package/dist/components/ui/chart/chart.js +204 -150
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +423 -98
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +306 -172
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +29 -29
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
- package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
- package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +96 -64
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +230 -159
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +88 -70
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +234 -80
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +210 -57
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +199 -0
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +86 -50
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +206 -142
- package/dist/components/ui/timeline/timeline.js.map +1 -1
- package/dist/components/ui/toolbar/toolbar.js +82 -92
- package/dist/components/ui/toolbar/toolbar.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +183 -59
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +481 -439
- package/dist/index.js.map +1 -1
- package/dist/lib/breakpoints.js +9 -6
- package/dist/lib/breakpoints.js.map +1 -1
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
- package/dist/react.js +481 -439
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +52 -17
- package/dist/src/components/ui/area-chart/index.d.ts +1 -1
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +152 -29
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
- package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
- package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
- package/dist/src/components/ui/category-bar/index.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +526 -0
- package/dist/src/components/ui/chart/chart.d.ts +11 -3
- package/dist/src/components/ui/chart/index.d.ts +3 -1
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +154 -20
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -37
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
- package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
- package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
- package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
- package/dist/src/components/ui/line-chart/index.d.ts +1 -1
- package/dist/src/components/ui/line-chart/line-chart.d.ts +50 -17
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
- package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
- package/dist/src/components/ui/timeline/index.d.ts +1 -1
- package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
- package/dist/src/components/ui/treemap/index.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
- package/dist/src/index.d.ts +5 -1
- package/dist/ui-react.css +1 -1
- package/package.json +5 -4
- package/dist/components/ui/search-global/search-global.js +0 -60
- package/dist/components/ui/search-global/search-global.js.map +0 -1
- package/dist/src/components/ui/search-global/index.d.ts +0 -1
- package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import {
|
|
2
|
+
import { ChartConfig, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCurveType, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const areaChartVariants: (props?: ({
|
|
5
5
|
layout?: "single" | "stacked" | null | undefined;
|
|
6
6
|
fill?: "solid" | "gradient" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Style override for one series, keyed by its `dataKeys` entry. Anything left
|
|
10
|
+
* unset falls back to the chart-wide prop, so an entry only states what differs
|
|
11
|
+
* — e.g. a projection band that reads fainter than the actuals beside it.
|
|
12
|
+
*/
|
|
13
|
+
export interface AreaChartAreaSettings {
|
|
14
|
+
/** Stroke and fill color. Defaults to the series' `config` color. */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Width of this series' top border. Defaults to the chart's `strokeWidth`. */
|
|
17
|
+
strokeWidth?: number;
|
|
18
|
+
/** Dash this series' top border. */
|
|
19
|
+
dashed?: boolean;
|
|
20
|
+
/** Interpolation for this series only. Defaults to the chart's `curve`. */
|
|
21
|
+
curveType?: ChartCurveType;
|
|
22
|
+
/**
|
|
23
|
+
* Fill opacity for this series. Under `fill="gradient"` it scales the
|
|
24
|
+
* gradient's own alpha rather than replacing it.
|
|
25
|
+
*/
|
|
26
|
+
fillOpacity?: number;
|
|
27
|
+
/** Render this series' per-point dots. Defaults to the chart's `showDots`. */
|
|
28
|
+
showDots?: boolean;
|
|
29
|
+
/** Dot radius for this series, in px. Defaults to the chart's `dotSize`. */
|
|
30
|
+
dotSize?: number;
|
|
31
|
+
/** Show/hide this series' value labels, overriding the chart's `showLabels`. */
|
|
32
|
+
showLabel?: boolean;
|
|
33
|
+
/** Position of this series' value labels. Defaults to the chart's `labelPosition`. */
|
|
34
|
+
labelPosition?: CartesianLabelPosition;
|
|
35
|
+
}
|
|
36
|
+
export interface AreaChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof areaChartVariants>, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
|
|
9
37
|
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */
|
|
10
38
|
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
11
39
|
/**
|
|
@@ -18,32 +46,39 @@ export interface AreaChartProps extends Omit<React.ComponentProps<'div'>, 'child
|
|
|
18
46
|
dataKeys: string[];
|
|
19
47
|
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
20
48
|
xKey: string;
|
|
21
|
-
/** Title rendered beneath the horizontal (X) axis. */
|
|
22
|
-
xAxisLabel?: string;
|
|
23
|
-
/** Title rendered beside the vertical (Y) axis (rotated). */
|
|
24
|
-
yAxisLabel?: string;
|
|
25
|
-
/** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */
|
|
26
|
-
yUnit?: string;
|
|
27
49
|
/** Interpolation between points. */
|
|
28
|
-
curve?:
|
|
50
|
+
curve?: ChartCurveType;
|
|
29
51
|
/** Stroke width of each area's top border. */
|
|
30
52
|
strokeWidth?: number;
|
|
31
53
|
/** Flat-fill opacity — used only when `fill="solid"` (gradient controls its own stops). */
|
|
32
54
|
fillOpacity?: number;
|
|
33
55
|
/** Render a dot at each data point. */
|
|
34
56
|
showDots?: boolean;
|
|
57
|
+
/** Radius of each point's dot, in px. Its hover dot is 2px larger. */
|
|
58
|
+
dotSize?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Enlarge the hovered point's dot. Defaults to following `showDots`, so pass
|
|
61
|
+
* it explicitly to get hover dots on a dot-less area (`showDots={false}` with
|
|
62
|
+
* `showActiveDot`) or a static-only area (dots without the hover one).
|
|
63
|
+
*/
|
|
64
|
+
showActiveDot?: boolean;
|
|
35
65
|
/** Bridge `null` gaps in the data instead of breaking the area. */
|
|
36
66
|
connectNulls?: boolean;
|
|
37
|
-
showGrid?: boolean;
|
|
38
|
-
showTooltip?: boolean;
|
|
39
|
-
showLegend?: boolean;
|
|
40
67
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* `indicator` — to customize formatting, per-series rows, or extra fields
|
|
44
|
-
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
68
|
+
* Per-series style overrides, keyed by `dataKeys` entry. Series with no entry
|
|
69
|
+
* render from the chart-wide props.
|
|
45
70
|
*/
|
|
46
|
-
|
|
71
|
+
areaSettings?: Record<string, AreaChartAreaSettings>;
|
|
72
|
+
/**
|
|
73
|
+
* One or more dashed reference/average lines on the value axis — a target, a
|
|
74
|
+
* threshold, or a series mean. Pass a single object or an array to draw
|
|
75
|
+
* several at once. On a stacked chart the value is read against the stack's
|
|
76
|
+
* axis, not one series.
|
|
77
|
+
*/
|
|
78
|
+
referenceLine?: ChartReferenceLine | ChartReferenceLine[];
|
|
79
|
+
showLegend?: boolean;
|
|
80
|
+
/** Position of the value labels when `showLabels` is on. Defaults to `top`. */
|
|
81
|
+
labelPosition?: CartesianLabelPosition;
|
|
47
82
|
}
|
|
48
83
|
declare const AreaChart: React.ForwardRefExoticComponent<Omit<AreaChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
49
84
|
export { AreaChart, areaChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AreaChart, areaChartVariants, type AreaChartProps } from './area-chart';
|
|
1
|
+
export { AreaChart, areaChartVariants, type AreaChartProps, type AreaChartAreaSettings, } from './area-chart';
|
|
@@ -2,7 +2,7 @@ import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const avatarVariants: (props?: ({
|
|
5
|
-
color?: "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
|
|
5
|
+
color?: "blue" | "gray" | "green" | "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
8
8
|
}
|
|
@@ -1,30 +1,123 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import {
|
|
2
|
+
import { BarShapeProps } from 'recharts/types/cartesian/Bar';
|
|
3
|
+
import { ChartLegend, ChartTooltip, ChartConfig, ChartReferenceLine, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCategoryRange, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
declare const barChartVariants: (props?: ({
|
|
5
6
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
7
|
layout?: "stacked" | "grouped" | null | undefined;
|
|
7
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* How a bar is painted. `rounded` rounds the growing end by `barRadius`; `pill`
|
|
11
|
+
* rounds every corner to a capsule; `gradient` fades the series color down the
|
|
12
|
+
* bar; `pattern` fills it with diagonal hatching in the series color (a
|
|
13
|
+
* colorblind-safe way to set a subset of bars apart).
|
|
14
|
+
*/
|
|
15
|
+
export type BarChartBarShape = 'rounded' | 'pill' | 'gradient' | 'pattern';
|
|
16
|
+
/**
|
|
17
|
+
* Style override for one series over a range of categories — e.g. "the forecast
|
|
18
|
+
* tail from September onward reads translucent and dashed". Anything left unset
|
|
19
|
+
* keeps the series' normal painting.
|
|
20
|
+
*/
|
|
21
|
+
export interface BarChartBarSettings extends ChartCategoryRange {
|
|
22
|
+
/** Fill for the matched bars. Defaults to the series color. */
|
|
23
|
+
fill?: string;
|
|
24
|
+
/** Fill opacity for the matched bars. */
|
|
25
|
+
opacity?: number;
|
|
26
|
+
/** Outline the matched bars with a dashed stroke in the series color. */
|
|
27
|
+
dashed?: boolean;
|
|
28
|
+
/** Shape for the matched bars, overriding the chart's `barShape`. */
|
|
29
|
+
shape?: BarChartBarShape;
|
|
11
30
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
31
|
+
* Track behind the matched bars: `true` fills the plot height, while a data
|
|
32
|
+
* field name caps it at that row's value — the headroom between a projection
|
|
33
|
+
* and its upper bound. A capped track stacks on its bar, so it needs the
|
|
34
|
+
* default `layout="grouped"`; under `layout="stacked"` it is ignored.
|
|
14
35
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
36
|
+
background?: boolean | string;
|
|
37
|
+
}
|
|
38
|
+
/** A shaded band behind a range of categories. */
|
|
39
|
+
export interface BarChartReferenceArea extends ChartCategoryRange {
|
|
40
|
+
/** Caption above the band. */
|
|
17
41
|
label?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Mark the category ticks under the band — accent color, italic — so the
|
|
44
|
+
* highlighted range reads on the axis too. On by default.
|
|
45
|
+
*/
|
|
46
|
+
highlightTicks?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Draw a dashed rule at the band's leading edge — the hand-off into a
|
|
49
|
+
* forecast. Off by default.
|
|
50
|
+
*/
|
|
51
|
+
divider?: boolean;
|
|
18
52
|
}
|
|
19
53
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
54
|
+
* Drop the synthetic headroom series from a recharts tooltip/legend payload,
|
|
55
|
+
* keeping the real series (and their order). `legendType`/`tooltipType="none"`
|
|
56
|
+
* are set on those bars too, but recharts still lists them, so this filter is
|
|
57
|
+
* what actually keeps them out — hence it's unit-tested.
|
|
58
|
+
*/
|
|
59
|
+
export declare function dropHeadroomSeries<T extends {
|
|
60
|
+
dataKey?: unknown;
|
|
61
|
+
}>(payload: readonly T[] | undefined, dataKeys?: string[]): T[] | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Swap a paint-server fill back to the series color for the chrome. A
|
|
64
|
+
* `gradient` / `pattern` bar fills from `url(#…)`, which paints SVG but means
|
|
65
|
+
* nothing as a CSS background — the legend swatch and the tooltip dot would
|
|
66
|
+
* render blank — so they fall back to the series' own `--color-<key>`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function withSeriesColor<T extends {
|
|
69
|
+
dataKey?: unknown;
|
|
70
|
+
color?: string;
|
|
71
|
+
}>(payload: readonly T[] | undefined): T[] | undefined;
|
|
72
|
+
type TooltipContentType = NonNullable<React.ComponentProps<typeof ChartTooltip>['content']>;
|
|
73
|
+
type TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;
|
|
74
|
+
type TooltipRenderProps = Parameters<TooltipContentFn>[0];
|
|
75
|
+
type LegendContentType = NonNullable<React.ComponentProps<typeof ChartLegend>['content']>;
|
|
76
|
+
type LegendContentFn = Extract<LegendContentType, (...args: never[]) => unknown>;
|
|
77
|
+
type LegendRenderProps = Parameters<LegendContentFn>[0];
|
|
78
|
+
/**
|
|
79
|
+
* Tooltip content that normalizes recharts' payload before anything renders it:
|
|
80
|
+
* the synthetic headroom series stripped, the rows put back in `dataKeys` order,
|
|
81
|
+
* and paint-server fills swapped back to the series color. Falls through to a
|
|
82
|
+
* caller-supplied `content`, preserving recharts' own mount semantics — a
|
|
83
|
+
* function via `createElement` (its own component identity + hook state), an
|
|
84
|
+
* element via `cloneElement`.
|
|
85
|
+
*
|
|
86
|
+
* This is a component rather than a per-render wrapper factory on purpose:
|
|
87
|
+
* recharts renders `content` by cloning the element it is given
|
|
88
|
+
* (`Tooltip.js:27-28`), so a stable module-level type here means the subtree is
|
|
89
|
+
* never remounted, whatever the caller passes.
|
|
25
90
|
*/
|
|
26
|
-
export declare function
|
|
27
|
-
|
|
91
|
+
export declare function NormalizedTooltipContent({ content, dataKeys, ...props }: Partial<TooltipRenderProps> & {
|
|
92
|
+
content?: TooltipContentType;
|
|
93
|
+
dataKeys?: string[];
|
|
94
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
/**
|
|
96
|
+
* Legend content over the same normalization. Ordering is the reason this
|
|
97
|
+
* applies unconditionally: recharts sorts legend entries alphabetically by
|
|
98
|
+
* series name by default (`itemSorter: 'value'`), so without putting them back
|
|
99
|
+
* in `dataKeys` order the legend would silently reorder itself depending on
|
|
100
|
+
* which bar-styling props happen to be set.
|
|
101
|
+
*/
|
|
102
|
+
export declare function NormalizedLegendContent({ dataKeys, ...props }: Partial<LegendRenderProps> & {
|
|
103
|
+
dataKeys: string[];
|
|
104
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
/** Paint overrides recharts spreads over a bar to mark it as the active one. */
|
|
106
|
+
interface BarPaintOverride {
|
|
107
|
+
fill?: string;
|
|
108
|
+
fillOpacity?: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Build the `<Bar shape>` that draws a range-scoped track. recharts' own
|
|
112
|
+
* `background` is all-or-nothing per series, so the track is drawn per row and
|
|
113
|
+
* hidden where the range doesn't apply.
|
|
114
|
+
*/
|
|
115
|
+
export declare function createTrackShape({ inRange, trackFill, paint, }: {
|
|
116
|
+
inRange: (row: number) => boolean;
|
|
117
|
+
trackFill: string;
|
|
118
|
+
paint?: BarPaintOverride;
|
|
119
|
+
}): ({ background: track, index: row, ...bar }: BarShapeProps) => import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof barChartVariants>, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
|
|
28
121
|
/** Row-per-category data. Each object holds the category key + one numeric field per series. */
|
|
29
122
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
30
123
|
/**
|
|
@@ -42,27 +135,57 @@ export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'childr
|
|
|
42
135
|
* bars, X for horizontal). Each is driven by a fixed `value` or a computed
|
|
43
136
|
* series `average`. Pass a single object or an array to draw several at once.
|
|
44
137
|
*/
|
|
45
|
-
referenceLine?:
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
138
|
+
referenceLine?: ChartReferenceLine | ChartReferenceLine[];
|
|
139
|
+
/**
|
|
140
|
+
* One or more shaded bands behind a range of categories — e.g. a forecast
|
|
141
|
+
* period. Pass a single object or an array to draw several.
|
|
142
|
+
*/
|
|
143
|
+
referenceArea?: BarChartReferenceArea | BarChartReferenceArea[];
|
|
144
|
+
/**
|
|
145
|
+
* Per-series style override for a range of categories, keyed by `dataKeys`
|
|
146
|
+
* entry. Bars outside a series' range — and series with no entry — render
|
|
147
|
+
* normally.
|
|
148
|
+
*/
|
|
149
|
+
barSettings?: Record<string, BarChartBarSettings>;
|
|
50
150
|
/** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation="horizontal"`). */
|
|
51
151
|
xUnit?: string;
|
|
52
|
-
/** Unit suffix on Y-axis tick values (recharts `unit`) — applies when the Y axis is numeric (`orientation="vertical"`). */
|
|
53
|
-
yUnit?: string;
|
|
54
152
|
/** Corner radius applied to the growing end of each bar. */
|
|
55
153
|
barRadius?: number;
|
|
56
|
-
|
|
57
|
-
|
|
154
|
+
/** How every bar is painted. Per-range overrides come from `barSettings`. */
|
|
155
|
+
barShape?: BarChartBarShape;
|
|
156
|
+
/** Fixed bar thickness, in px. Unset, recharts sizes bars from the available width. */
|
|
157
|
+
barSize?: number;
|
|
158
|
+
/** Upper bound on the computed bar thickness, in px. */
|
|
159
|
+
maxBarSize?: number;
|
|
160
|
+
/** Gap between bars of the same category, in px or a percentage string. */
|
|
161
|
+
barGap?: number | string;
|
|
162
|
+
/** Gap between category groups, in px or a percentage string. */
|
|
163
|
+
barCategoryGap?: number | string;
|
|
164
|
+
/**
|
|
165
|
+
* Minimum rendered length for a bar, in px, so a tiny value stays visible. A
|
|
166
|
+
* value of exactly `0` still renders nothing — a floor on it would read as a
|
|
167
|
+
* small positive.
|
|
168
|
+
*/
|
|
169
|
+
minPointSize?: number;
|
|
170
|
+
/** Draw a full-height track behind every bar. */
|
|
171
|
+
showBackground?: boolean;
|
|
172
|
+
/** Fill for the track background. Defaults to the secondary surface. */
|
|
173
|
+
backgroundFill?: string;
|
|
174
|
+
/** Highlight the hovered bar. */
|
|
175
|
+
showActiveBar?: boolean;
|
|
176
|
+
/** Painting of the hovered bar when `showActiveBar` is on. */
|
|
177
|
+
activeBar?: {
|
|
178
|
+
/** Fill for the hovered bar. Defaults to the series color. */
|
|
179
|
+
fill?: string;
|
|
180
|
+
/** Fill opacity for the hovered bar. */
|
|
181
|
+
opacity?: number;
|
|
182
|
+
};
|
|
58
183
|
showLegend?: boolean;
|
|
59
184
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* `indicator` — to customize formatting, per-series rows, or extra fields
|
|
63
|
-
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
185
|
+
* Position of the value labels when `showLabels` is on. Defaults to the growing
|
|
186
|
+
* end — `top` for vertical bars, `right` for horizontal.
|
|
64
187
|
*/
|
|
65
|
-
|
|
188
|
+
labelPosition?: CartesianLabelPosition;
|
|
66
189
|
}
|
|
67
190
|
declare const BarChart: React.ForwardRefExoticComponent<Omit<BarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
68
191
|
export { BarChart, barChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BarChart, barChartVariants, type BarChartProps, type
|
|
1
|
+
export { BarChart, barChartVariants, type BarChartProps, type BarChartReferenceArea, type BarChartBarSettings, type BarChartBarShape, } from './bar-chart';
|
|
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "destructive" | "ai" | "
|
|
5
|
+
variant?: "destructive" | "ai" | "secondary" | "default" | "ghost" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const buttonMenuVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "primary" | "secondary" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonMenuProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>, VariantProps<typeof buttonMenuVariants> {
|
|
8
8
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CarouselDialogVariant = 'first' | 'middle' | 'last';
|
|
3
|
+
export interface CarouselDialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Which slide position this renders for. Defaults to `'first'`. */
|
|
5
|
+
variant?: CarouselDialogVariant;
|
|
6
|
+
/** Total number of slides, used to render the dot `ListIndicator`. Defaults to `1`. */
|
|
7
|
+
slideCount?: number;
|
|
8
|
+
/** The currently active slide index (0-based). Defaults to `0`. */
|
|
9
|
+
selectedIndex?: number;
|
|
10
|
+
/** Fires when a dot is activated, with the dot's slide index. */
|
|
11
|
+
onSelectIndex?: (index: number) => void;
|
|
12
|
+
/** Fires when `Back` (hidden on `variant="first"`) is activated. */
|
|
13
|
+
onBack?: () => void;
|
|
14
|
+
/** Fires when `Next` (`variant="first" | "middle"`) is activated. */
|
|
15
|
+
onNext?: () => void;
|
|
16
|
+
/** Fires when the call-to-action button (`variant="last"`) is activated. */
|
|
17
|
+
onPrimaryAction?: () => void;
|
|
18
|
+
/** `Back` button label. Defaults to `'Back'`. */
|
|
19
|
+
backLabel?: string;
|
|
20
|
+
/** `Next` button label (`variant="first" | "middle"`). Defaults to `'Next'`. */
|
|
21
|
+
nextLabel?: string;
|
|
22
|
+
/** Call-to-action button label (`variant="last"`). Defaults to `'Call to action'`. */
|
|
23
|
+
primaryLabel?: string;
|
|
24
|
+
/** Builds each dot's accessible name from its 0-based index and the slide count. */
|
|
25
|
+
goToSlideLabel?: (index: number, count: number) => string;
|
|
26
|
+
}
|
|
27
|
+
declare const CarouselDialog: React.ForwardRefExoticComponent<CarouselDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { CarouselDialog };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarouselDialog, type CarouselDialogProps, type CarouselDialogVariant, } from './carousel-dialog';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const categoryBarVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface CategoryBarSegment {
|
|
8
|
+
/** Key into `config` for this segment's label + color. */
|
|
9
|
+
key: string;
|
|
10
|
+
/** The segment's value — its width is this over the sum of all values. */
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
/** The resolved segment passed to a custom `tooltipContent` renderer. */
|
|
14
|
+
export interface CategoryBarTooltipContext extends CategoryBarSegment {
|
|
15
|
+
/** Resolved `config` label (falls back to the key); may be any `ReactNode`. */
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
/** Share of the total as a rounded percentage (0–100). */
|
|
18
|
+
percent: number;
|
|
19
|
+
/**
|
|
20
|
+
* CSS color reference for the segment — the `var(--color-<key>)` bridge, which
|
|
21
|
+
* resolves the config entry's `color` or its per-theme `theme` value. Usable
|
|
22
|
+
* anywhere a CSS color is (e.g. a `style` background); not a literal value.
|
|
23
|
+
*/
|
|
24
|
+
color: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CategoryBarProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof categoryBarVariants> {
|
|
27
|
+
/** Ordered segments (left → right). Widths are proportional to `value`. */
|
|
28
|
+
data: ReadonlyArray<CategoryBarSegment>;
|
|
29
|
+
/** Maps each segment `key` to a `label` and `color` (an existing `--ui-*` token). */
|
|
30
|
+
config: ChartConfig;
|
|
31
|
+
/** Show the legend below the bar (color dot + label + value + %). */
|
|
32
|
+
showLegend?: boolean;
|
|
33
|
+
/** Show a hover tooltip per segment (dot + label + value + %). */
|
|
34
|
+
showTooltip?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Custom tooltip content per segment — replaces the default (dot + label +
|
|
37
|
+
* `value · %`) inside the same card. Ignored when `showTooltip` is false.
|
|
38
|
+
*/
|
|
39
|
+
tooltipContent?: (segment: CategoryBarTooltipContext) => React.ReactNode;
|
|
40
|
+
/** Format the numeric value (legend + tooltip). Defaults to `toLocaleString()`. */
|
|
41
|
+
valueFormatter?: (value: number) => string;
|
|
42
|
+
/** Render the tooltip for this segment index initially open (VR/testing). */
|
|
43
|
+
defaultOpenIndex?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible summary of the whole bar. Defaults to a `label value` list built
|
|
46
|
+
* from the data; pass a fuller sentence for screen readers if you have one.
|
|
47
|
+
*/
|
|
48
|
+
'aria-label'?: string;
|
|
49
|
+
}
|
|
50
|
+
declare const CategoryBar: React.ForwardRefExoticComponent<Omit<CategoryBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export { CategoryBar, categoryBarVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CategoryBar, categoryBarVariants, type CategoryBarProps, type CategoryBarSegment, type CategoryBarTooltipContext, } from './category-bar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Width the faked layout reports to recharts. */
|
|
2
|
+
export declare const CHART_WIDTH = 600;
|
|
3
|
+
/** Height the faked layout reports to recharts. */
|
|
4
|
+
export declare const CHART_HEIGHT = 400;
|
|
5
|
+
/**
|
|
6
|
+
* Give recharts a laid-out container for the duration of the calling test.
|
|
7
|
+
*
|
|
8
|
+
* recharts' `ResponsiveContainer` measures its box through a `ResizeObserver`,
|
|
9
|
+
* which happy-dom never fires, and reads `getBoundingClientRect()` once in its
|
|
10
|
+
* effect — so by default the chart renders at 0×0 and every SVG child bails out.
|
|
11
|
+
* Feeding it a size is what makes the axes, grid and series observable in a unit
|
|
12
|
+
* test at all; without it the only honest assertion left is "the chart root
|
|
13
|
+
* exists", which passes whether or not the feature works.
|
|
14
|
+
*
|
|
15
|
+
* Only the responsive container may report the size. recharts also measures the
|
|
16
|
+
* legend wrapper; if that reported the full height too, it would claim the whole
|
|
17
|
+
* plot area and the series would again render at zero height.
|
|
18
|
+
*
|
|
19
|
+
* happy-dom defines the rect once, on `Element.prototype` — patching that one
|
|
20
|
+
* prototype covers every element type, and patching a subclass's prototype as
|
|
21
|
+
* well would capture this wrapper as its own "original" and leave it installed
|
|
22
|
+
* after the restore.
|
|
23
|
+
*
|
|
24
|
+
* Call it inside the test, before rendering. Cleanup is registered automatically,
|
|
25
|
+
* so no `afterEach` is needed at the call site. Calling it more than once in the
|
|
26
|
+
* same test (a loop that renders one chart per case) re-stubs nothing — that
|
|
27
|
+
* would capture this wrapper as its own "original" — though each call does queue
|
|
28
|
+
* its own teardown, and the second one finds the patches already lifted.
|
|
29
|
+
*/
|
|
30
|
+
export declare function giveTheChartASize(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Suite-level form of `giveTheChartASize`, for a file where every case renders a
|
|
33
|
+
* laid-out chart — including the ones that call `render()` directly instead of
|
|
34
|
+
* going through a shared `renderChart` helper. Call it once at the top of the
|
|
35
|
+
* file; it registers its own `beforeEach`/`afterEach`, so the size is in place
|
|
36
|
+
* whichever way a case renders and is torn down between cases either way.
|
|
37
|
+
*/
|
|
38
|
+
export declare function giveEveryChartASize(): void;
|
|
39
|
+
/**
|
|
40
|
+
* The tick elements recharts painted for one cartesian axis, in document order.
|
|
41
|
+
*
|
|
42
|
+
* Selected by recharts' own `orientation` attribute rather than by descending
|
|
43
|
+
* from `.recharts-xAxis` / `.recharts-yAxis`, because as of recharts 3.8 a tick
|
|
44
|
+
* is not inside its axis group at all: the labels are hoisted into a separate
|
|
45
|
+
* top-level `recharts-zIndex-layer_*` that is a *sibling* of the axis. So
|
|
46
|
+
* `.recharts-xAxis .recharts-text` matches nothing and `axis.contains(tick)` is
|
|
47
|
+
* false — and a test written the obvious way passes vacuously instead of
|
|
48
|
+
* asserting anything. (Descendant selectors themselves are fine here; `svg text`
|
|
49
|
+
* and `clipPath rect` both work.)
|
|
50
|
+
*
|
|
51
|
+
* `'x'` and `'y'` mean *both* axes of that dimension, so on a chart with a
|
|
52
|
+
* secondary scale they return the two axes' ticks concatenated. Pass a single
|
|
53
|
+
* side (`'left'`, `'right'`, `'top'`, `'bottom'`) to assert against one of them
|
|
54
|
+
* — the orientation attribute is the only thing separating them.
|
|
55
|
+
*
|
|
56
|
+
* An empty result means "no tick carried that orientation", which is also what
|
|
57
|
+
* you get if a recharts upgrade stops emitting the attribute. Assert a length
|
|
58
|
+
* before looping, or a broken selector reads as a chart with no ticks.
|
|
59
|
+
*/
|
|
60
|
+
export type ChartAxisSide = 'left' | 'right' | 'top' | 'bottom';
|
|
61
|
+
export declare function axisTicks(container: Element, axis: 'x' | 'y' | ChartAxisSide): Element[];
|
|
62
|
+
/** Text of every tick on one cartesian axis — see `axisTicks` for the caveats. */
|
|
63
|
+
export declare function axisTickLabels(container: Element, axis: 'x' | 'y' | ChartAxisSide): (string | null)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|