@acronis-platform/ui-react 0.57.1 → 0.58.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/dist/components/ui/area-chart/area-chart.js +149 -0
- package/dist/components/ui/area-chart/area-chart.js.map +1 -0
- package/dist/components/ui/bar-chart/bar-chart.js +152 -77
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/button-icon-input/button-icon-input.js +36 -0
- package/dist/components/ui/button-icon-input/button-icon-input.js.map +1 -0
- package/dist/components/ui/button-menu/button-menu.js +1 -1
- package/dist/components/ui/button-menu/button-menu.js.map +1 -1
- package/dist/components/ui/card-filter/card-filter.js +40 -27
- package/dist/components/ui/card-filter/card-filter.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state.js +42 -0
- package/dist/components/ui/chart-state/chart-state.js.map +1 -0
- package/dist/components/ui/chip/chip.js +13 -13
- package/dist/components/ui/chip/chip.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +107 -0
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js +195 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -0
- package/dist/components/ui/date-range-picker/date-range-picker.js +21 -21
- package/dist/components/ui/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +250 -78
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +26 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +21 -21
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/filter-search/filter-search.js +91 -90
- package/dist/components/ui/filter-search/filter-search.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +87 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -0
- package/dist/components/ui/histogram/histogram.js +108 -0
- package/dist/components/ui/histogram/histogram.js.map +1 -0
- package/dist/components/ui/input-otp/input-otp.js +104 -0
- package/dist/components/ui/input-otp/input-otp.js.map +1 -0
- package/dist/components/ui/input-password/input-password.js +120 -0
- package/dist/components/ui/input-password/input-password.js.map +1 -0
- package/dist/components/ui/input-text/input-text.js +9 -9
- package/dist/components/ui/input-text/input-text.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +206 -0
- package/dist/components/ui/line-chart/line-chart.js.map +1 -0
- package/dist/components/ui/link/link.js +5 -5
- package/dist/components/ui/link/link.js.map +1 -1
- package/dist/components/ui/loading/loading.js +79 -0
- package/dist/components/ui/loading/loading.js.map +1 -0
- package/dist/components/ui/meter/meter.js +93 -0
- package/dist/components/ui/meter/meter.js.map +1 -0
- package/dist/components/ui/metric/metric.js +185 -0
- package/dist/components/ui/metric/metric.js.map +1 -0
- package/dist/components/ui/pie-chart/pie-chart.js +113 -0
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/ui/popover/popover.js +57 -27
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +74 -0
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -0
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +69 -0
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +102 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -0
- package/dist/components/ui/search/search.js +16 -16
- package/dist/components/ui/search/search.js.map +1 -1
- package/dist/components/ui/sheet/sheet-details.js +16 -16
- package/dist/components/ui/sheet/sheet-details.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +175 -0
- package/dist/components/ui/timeline/timeline.js.map +1 -0
- package/dist/components/ui/treemap/treemap.js +83 -0
- package/dist/components/ui/treemap/treemap.js.map +1 -0
- package/dist/components/ui/trend-indicator/trend-indicator.js +97 -0
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -0
- package/dist/index.js +423 -384
- package/dist/index.js.map +1 -1
- package/dist/react.js +423 -384
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +49 -0
- package/dist/src/components/ui/area-chart/index.d.ts +1 -0
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +42 -2
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button-icon-input/button-icon-input.d.ts +21 -0
- package/dist/src/components/ui/button-icon-input/index.d.ts +1 -0
- package/dist/src/components/ui/card-filter/card-filter.d.ts +5 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +11 -0
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +48 -0
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +79 -0
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -0
- package/dist/src/components/ui/dialog/dialog.d.ts +105 -9
- package/dist/src/components/ui/dialog/dialog.docs.d.ts +82 -5
- package/dist/src/components/ui/dialog/index.d.ts +1 -1
- package/dist/src/components/ui/dialog-footer-default/dialog-footer-default.d.ts +11 -0
- package/dist/src/components/ui/dialog-footer-default/index.d.ts +1 -0
- package/dist/src/components/ui/filter-search/filter-search.d.ts +1 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +39 -0
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -0
- package/dist/src/components/ui/histogram/histogram.d.ts +55 -0
- package/dist/src/components/ui/histogram/index.d.ts +1 -0
- package/dist/src/components/ui/input-otp/index.d.ts +1 -0
- package/dist/src/components/ui/input-otp/input-otp.d.ts +23 -0
- package/dist/src/components/ui/input-password/index.d.ts +1 -0
- package/dist/src/components/ui/input-password/input-password.d.ts +21 -0
- package/dist/src/components/ui/line-chart/index.d.ts +1 -0
- package/dist/src/components/ui/line-chart/line-chart.d.ts +83 -0
- package/dist/src/components/ui/loading/index.d.ts +1 -0
- package/dist/src/components/ui/loading/loading.d.ts +13 -0
- package/dist/src/components/ui/meter/index.d.ts +1 -0
- package/dist/src/components/ui/meter/meter.d.ts +25 -0
- package/dist/src/components/ui/metric/index.d.ts +1 -0
- package/dist/src/components/ui/metric/metric.d.ts +37 -0
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -0
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +54 -0
- package/dist/src/components/ui/popover/index.d.ts +1 -1
- package/dist/src/components/ui/popover/popover.d.ts +13 -1
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -0
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +40 -0
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -0
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +45 -0
- package/dist/src/components/ui/scatter-chart/index.d.ts +1 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +50 -0
- package/dist/src/components/ui/stack/stack.d.ts +1 -1
- package/dist/src/components/ui/timeline/index.d.ts +1 -0
- package/dist/src/components/ui/timeline/timeline.d.ts +41 -0
- package/dist/src/components/ui/treemap/index.d.ts +1 -0
- package/dist/src/components/ui/treemap/treemap.d.ts +44 -0
- package/dist/src/components/ui/trend-indicator/index.d.ts +1 -0
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +32 -0
- package/dist/src/index.d.ts +22 -2
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface HistogramBin {
|
|
4
|
+
/** Lower bound of the bin (inclusive). */
|
|
5
|
+
x0: number;
|
|
6
|
+
/** Upper bound of the bin (exclusive, except the last bin which is inclusive). */
|
|
7
|
+
x1: number;
|
|
8
|
+
/** Human-readable range label, e.g. `"0–10"`. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** How many samples fell in the bin. */
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Split `values` into `binCount` equal-width bins and count the samples in each.
|
|
15
|
+
* The range is `domain` if given, else the data's [min, max]; values outside the
|
|
16
|
+
* domain are dropped, and the max value lands in the last (inclusive) bin.
|
|
17
|
+
* Returns [] when there's nothing to bin. Exported for unit tests; not part of
|
|
18
|
+
* the package's public API.
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeHistogramBins(values: ReadonlyArray<number>, binCount: number, domain?: [number, number]): HistogramBin[];
|
|
21
|
+
export interface HistogramProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
22
|
+
/** Raw continuous samples to bin (non-finite values are ignored). */
|
|
23
|
+
values: ReadonlyArray<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Single-series map of `label` / `color`, keyed by `dataKey` (imported from
|
|
26
|
+
* the shared `Chart` primitives). Color is caller-supplied — reference an
|
|
27
|
+
* existing semantic `--ui-*` token; there is no chart palette tier yet.
|
|
28
|
+
*/
|
|
29
|
+
config: ChartConfig;
|
|
30
|
+
/** `config` key that colors + labels the frequency bars. */
|
|
31
|
+
dataKey?: string;
|
|
32
|
+
/** Number of equal-width bins. */
|
|
33
|
+
binCount?: number;
|
|
34
|
+
/** Fix the binning range instead of deriving it from the data's min/max. */
|
|
35
|
+
domain?: [number, number];
|
|
36
|
+
/** Title rendered beneath the horizontal (X) axis. */
|
|
37
|
+
xAxisLabel?: string;
|
|
38
|
+
/** Title rendered beside the vertical (Y) axis (rotated). */
|
|
39
|
+
yAxisLabel?: string;
|
|
40
|
+
/** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is the bin label). */
|
|
41
|
+
yUnit?: string;
|
|
42
|
+
/** Corner radius on the top of each bar. */
|
|
43
|
+
barRadius?: number;
|
|
44
|
+
showGrid?: boolean;
|
|
45
|
+
showTooltip?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
48
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
49
|
+
* to customize the tooltip without composing recharts yourself. Ignored when
|
|
50
|
+
* `showTooltip` is false.
|
|
51
|
+
*/
|
|
52
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
53
|
+
}
|
|
54
|
+
declare const Histogram: React.ForwardRefExoticComponent<Omit<HistogramProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
export { Histogram };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Histogram, type HistogramProps, type HistogramBin } from './histogram';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputOTP, type InputOTPProps } from './input-otp';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface InputOTPProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'defaultValue' | 'children'> {
|
|
3
|
+
/** Number of single-character slots. */
|
|
4
|
+
length?: number;
|
|
5
|
+
/** Controlled value (the digits entered so far, left to right). */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Initial value for uncontrolled usage. */
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/** Fires with the full value on every change. */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** Fires once, the moment the value reaches `length` characters. */
|
|
12
|
+
onComplete?: (value: string) => void;
|
|
13
|
+
/** Disables every slot. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Switches every slot to the error treatment. */
|
|
16
|
+
error?: boolean;
|
|
17
|
+
/** Focuses the first slot on mount. */
|
|
18
|
+
autoFocus?: boolean;
|
|
19
|
+
/** Builds the accessible name for a slot from its 1-based index and the total length. */
|
|
20
|
+
slotAriaLabel?: (index: number, length: number) => string;
|
|
21
|
+
}
|
|
22
|
+
declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export { InputOTP };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputPassword, type InputPasswordProps } from './input-password';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface InputPasswordProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'children' | 'type'> {
|
|
3
|
+
/** Field label, rendered above the input. */
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
/** Marks the field required — appends a `*` after the label. */
|
|
6
|
+
required?: boolean;
|
|
7
|
+
/** Helper text below the input. Hidden while `error` is set. */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Error message below the input. Its presence switches the field to the error
|
|
11
|
+
* treatment (red box border + red message).
|
|
12
|
+
*/
|
|
13
|
+
error?: React.ReactNode;
|
|
14
|
+
/** Accessible label for the toggle button while the password is hidden. */
|
|
15
|
+
showPasswordLabel?: string;
|
|
16
|
+
/** Accessible label for the toggle button while the password is shown. */
|
|
17
|
+
hidePasswordLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function getInputPasswordBoxClassName(hasError: boolean, disabled?: boolean): string;
|
|
20
|
+
declare const InputPassword: React.ForwardRefExoticComponent<InputPasswordProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
export { InputPassword };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LineChart, lineChartVariants, type LineChartProps } from './line-chart';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const lineChartVariants: (props?: ({
|
|
5
|
+
curve?: "step" | "linear" | "monotone" | null | undefined;
|
|
6
|
+
lineStyle?: "dashed" | "solid" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Drop the synthetic delta-band range series from a recharts tooltip/legend
|
|
10
|
+
* payload, keeping the real series (and their order). recharts already excludes
|
|
11
|
+
* the band via `legendType`/`tooltipType="none"`, so this is a second, explicit
|
|
12
|
+
* guard — hence it's unit-tested rather than relying on that behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function dropBandSeries<T extends {
|
|
15
|
+
dataKey?: unknown;
|
|
16
|
+
}>(payload: readonly T[] | undefined): T[] | undefined;
|
|
17
|
+
type TooltipContentType = NonNullable<React.ComponentProps<typeof ChartTooltip>['content']>;
|
|
18
|
+
type TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;
|
|
19
|
+
type TooltipRenderProps = Parameters<TooltipContentFn>[0];
|
|
20
|
+
/**
|
|
21
|
+
* Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are
|
|
22
|
+
* stripped from the payload before it renders, while preserving recharts' own
|
|
23
|
+
* mount semantics — a function is mounted via `createElement` (its own component
|
|
24
|
+
* identity + hook state), an element via `cloneElement`. This mirrors what the
|
|
25
|
+
* pass-through charts get by handing `content` straight to recharts, so a
|
|
26
|
+
* function-form tooltip keeps its state across re-renders here too. The returned
|
|
27
|
+
* component is a stable content type (memoize it on `tooltipContent`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function createBandStrippedTooltip(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>>;
|
|
30
|
+
export interface LineChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof lineChartVariants> {
|
|
31
|
+
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */
|
|
32
|
+
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
33
|
+
/**
|
|
34
|
+
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
35
|
+
* primitives). Series colors are caller-supplied — reference an existing
|
|
36
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
37
|
+
*/
|
|
38
|
+
config: ChartConfig;
|
|
39
|
+
/** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */
|
|
40
|
+
dataKeys: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Subset of `dataKeys` to render as comparison/trend overlays (e.g. a
|
|
43
|
+
* previous quarter or year) — dashed, dimmed, and dot-less, so they read as
|
|
44
|
+
* secondary to the current-period lines. Keeps each series' own `config` color.
|
|
45
|
+
*/
|
|
46
|
+
comparisonKeys?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a
|
|
49
|
+
* dimmed area filling the gap between the two series at each point,
|
|
50
|
+
* visualizing the QoQ/YoY difference. Tinted with the first key's `config`
|
|
51
|
+
* color. Rows where either value isn't numeric are left un-banded.
|
|
52
|
+
*
|
|
53
|
+
* Each pair mints an internal `__band_<n>` field (kept out of the tooltip and
|
|
54
|
+
* legend), so avoid data/`config` keys with that reserved prefix.
|
|
55
|
+
*/
|
|
56
|
+
deltaBands?: Array<[string, string]>;
|
|
57
|
+
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
58
|
+
xKey: string;
|
|
59
|
+
/** Title rendered beneath the horizontal (X) axis. */
|
|
60
|
+
xAxisLabel?: string;
|
|
61
|
+
/** Title rendered beside the vertical (Y) axis (rotated). */
|
|
62
|
+
yAxisLabel?: string;
|
|
63
|
+
/** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */
|
|
64
|
+
yUnit?: string;
|
|
65
|
+
/** Stroke width of each line. */
|
|
66
|
+
strokeWidth?: number;
|
|
67
|
+
/** Render a dot at each data point. */
|
|
68
|
+
showDots?: boolean;
|
|
69
|
+
/** Bridge `null` gaps in the data instead of breaking the line. */
|
|
70
|
+
connectNulls?: boolean;
|
|
71
|
+
showGrid?: boolean;
|
|
72
|
+
showTooltip?: boolean;
|
|
73
|
+
showLegend?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
76
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` /
|
|
77
|
+
* `indicator` — to customize formatting, per-series rows, or extra fields
|
|
78
|
+
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
79
|
+
*/
|
|
80
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
81
|
+
}
|
|
82
|
+
declare const LineChart: React.ForwardRefExoticComponent<Omit<LineChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
83
|
+
export { LineChart, lineChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading, loadingVariants, type LoadingProps } from './loading';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const loadingVariants: (props?: ({
|
|
4
|
+
variant?: "inline" | "onSurfacePrimary" | "onSurfaceSecondary" | "onScreen" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface LoadingProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof loadingVariants> {
|
|
7
|
+
/** Whether the label is rendered. When `false`, `label` is still exposed to assistive tech via `aria-label`. */
|
|
8
|
+
hasLabel?: boolean;
|
|
9
|
+
/** The loading message. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Loading: React.ForwardRefExoticComponent<LoadingProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Loading, loadingVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Meter, type MeterProps } from './meter';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meter as MeterPrimitive } from '@base-ui/react/meter';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface MeterProps extends Omit<React.ComponentPropsWithoutRef<typeof MeterPrimitive.Root>, 'value' | 'color'> {
|
|
4
|
+
/** Row label shown on the left. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The value this meter represents. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Upper bound of the range — the whole the value is a share of. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Fill color for the bar — an existing semantic `--ui-*` token (or any CSS color). */
|
|
11
|
+
color: string;
|
|
12
|
+
/** Format the numeric value (label + tooltip). Defaults to `toLocaleString()`. */
|
|
13
|
+
valueFormatter?: (value: number) => string;
|
|
14
|
+
/** Show the hover tooltip (`label · value of max · %`). */
|
|
15
|
+
showTooltip?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Custom tooltip content — replaces the default (dot + label + `value of max
|
|
18
|
+
* · %`) inside the same chart-style card. Ignored when `showTooltip` is false.
|
|
19
|
+
*/
|
|
20
|
+
tooltip?: React.ReactNode;
|
|
21
|
+
/** Render with the tooltip initially open (Base UI `defaultOpen`). */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const Meter: React.ForwardRefExoticComponent<MeterProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export { Meter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Metric, type MetricProps } from './metric';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const metricVariants: (props?: ({
|
|
4
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
5
|
+
status?: "info" | "success" | "warning" | "critical" | "neutral" | "danger" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface MetricProps extends React.ComponentProps<'div'>, VariantProps<typeof metricVariants> {
|
|
8
|
+
/** What the value measures — e.g. "Gross margin". Rendered as an uppercase note heading. */
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The primary value, already formatted (`73`, `"94%"`, `"$72K"`, `"2.8"`).
|
|
12
|
+
* The kit does not format currency, units, or decimals.
|
|
13
|
+
*/
|
|
14
|
+
value: React.ReactNode;
|
|
15
|
+
/** Unit shown next to the value at a smaller, muted size — e.g. `"%"`, `"hours"`. */
|
|
16
|
+
unit?: React.ReactNode;
|
|
17
|
+
/** A top-right caption aligned with the label — e.g. a timeframe `Tag` ("Last 30 days"). */
|
|
18
|
+
caption?: React.ReactNode;
|
|
19
|
+
/** A trend slot on the right of the value — typically a `TrendIndicator`. */
|
|
20
|
+
trend?: React.ReactNode;
|
|
21
|
+
/** Secondary line below the value — e.g. "Target: 99%". */
|
|
22
|
+
supportingText?: React.ReactNode;
|
|
23
|
+
/** A small badge / metadata slot beside the value — e.g. a `Tag`. */
|
|
24
|
+
badge?: React.ReactNode;
|
|
25
|
+
/** Icon rendered in a status-tinted badge before the value. */
|
|
26
|
+
icon?: React.ReactNode;
|
|
27
|
+
/** Contextual hint on an info affordance next to the label (Base UI Tooltip). */
|
|
28
|
+
tooltip?: React.ReactNode;
|
|
29
|
+
/** Accessible name for the info affordance that reveals `tooltip`. */
|
|
30
|
+
tooltipLabel?: string;
|
|
31
|
+
/** Show a skeleton in place of the value, preserving its space. */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Card body below the header — e.g. a chart, a Separator, an insight line. */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare const Metric: React.ForwardRefExoticComponent<Omit<MetricProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export { Metric };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PieChart, pieChartVariants, type PieChartProps, type PieChartCenterLabel, } from './pie-chart';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const pieChartVariants: (props?: ({
|
|
5
|
+
shape?: "pie" | "donut" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface PieChartCenterLabel {
|
|
8
|
+
/** Headline metric rendered large in the donut hole (e.g. a total). */
|
|
9
|
+
value?: string | number;
|
|
10
|
+
/** Caption rendered under the value. */
|
|
11
|
+
label?: string | number;
|
|
12
|
+
}
|
|
13
|
+
export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof pieChartVariants> {
|
|
14
|
+
/** Row-per-slice data. Each object holds the slice's `nameKey` label + its `dataKey` numeric value. */
|
|
15
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
16
|
+
/**
|
|
17
|
+
* Per-slice map of `label` / `color`, keyed by the slice's `nameKey` value
|
|
18
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
19
|
+
* custom properties. Colors are caller-supplied — reference an existing
|
|
20
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
21
|
+
*/
|
|
22
|
+
config: ChartConfig;
|
|
23
|
+
/** Numeric field that sizes each slice. */
|
|
24
|
+
dataKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* Label field that names each slice (drives the legend, tooltip, and
|
|
27
|
+
* `--color-<name>` lookup). Values should be unique per chart — rows sharing a
|
|
28
|
+
* name share one `config`/color entry.
|
|
29
|
+
*/
|
|
30
|
+
nameKey: string;
|
|
31
|
+
/** Inner radius of the arc when `shape="donut"` (ignored for `shape="pie"`). */
|
|
32
|
+
innerRadius?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Custom content for the donut hole — a headline `value` and/or a `label`
|
|
35
|
+
* caption, stacked and centered. Rendered only for `shape="donut"` (a filled
|
|
36
|
+
* pie has no hole).
|
|
37
|
+
*/
|
|
38
|
+
centerLabel?: PieChartCenterLabel;
|
|
39
|
+
/** Outer radius of the arc. Omit to use recharts' responsive default. */
|
|
40
|
+
outerRadius?: number;
|
|
41
|
+
/** Gap between slices, in degrees. */
|
|
42
|
+
paddingAngle?: number;
|
|
43
|
+
showTooltip?: boolean;
|
|
44
|
+
showLegend?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
47
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
48
|
+
* to customize formatting, per-slice rows, or extra fields without composing
|
|
49
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
50
|
+
*/
|
|
51
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
52
|
+
}
|
|
53
|
+
declare const PieChart: React.ForwardRefExoticComponent<Omit<PieChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export { PieChart, pieChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Popover, PopoverTrigger, PopoverPortal, PopoverContent, type PopoverContentProps, } from './popover';
|
|
1
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverContent, type PopoverContentProps, PopoverBody, PopoverFooter, } from './popover';
|
|
@@ -24,4 +24,16 @@ export interface PopoverContentProps extends React.ComponentPropsWithoutRef<type
|
|
|
24
24
|
keepMounted?: PopoverPrimitive.Portal.Props['keepMounted'];
|
|
25
25
|
}
|
|
26
26
|
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Vertical-rhythm wrapper for a `PopoverContent`'s main content — the `Body`
|
|
29
|
+
* slot in the Figma node. Themed from `--ui-popover-body-*` (gap, padding-y);
|
|
30
|
+
* horizontal inset is a plain utility since the design has no dedicated
|
|
31
|
+
* component token for it.
|
|
32
|
+
*/
|
|
33
|
+
declare const PopoverBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
/**
|
|
35
|
+
* Default action-row footer — the `FooterDefault` (`variant=default`) recipe
|
|
36
|
+
* from the Figma node. Themed from the shared `--ui-footer-*` tier.
|
|
37
|
+
*/
|
|
38
|
+
declare const PopoverFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverContent, PopoverBody, PopoverFooter, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadarChart, radarChartVariants, type RadarChartProps } from './radar-chart';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const radarChartVariants: (props?: ({
|
|
5
|
+
gridType?: "circle" | "polygon" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof radarChartVariants> {
|
|
8
|
+
/** Row-per-axis data. Each object holds the `angleKey` label + one numeric field per series. */
|
|
9
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
10
|
+
/**
|
|
11
|
+
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
12
|
+
* primitives). Turned into `--color-<key>` custom properties. Series colors
|
|
13
|
+
* are caller-supplied — reference an existing semantic `--ui-*` token; there is
|
|
14
|
+
* no chart palette tier yet.
|
|
15
|
+
*/
|
|
16
|
+
config: ChartConfig;
|
|
17
|
+
/** Series to plot — one `<Radar>` per key. Each must exist in `config` and in every data row. */
|
|
18
|
+
dataKeys: string[];
|
|
19
|
+
/** The categorical axis key placed around the web (e.g. `"subject"`). */
|
|
20
|
+
angleKey: string;
|
|
21
|
+
/** Fill opacity of each radar area. */
|
|
22
|
+
fillOpacity?: number;
|
|
23
|
+
/** Stroke width of each radar outline. */
|
|
24
|
+
strokeWidth?: number;
|
|
25
|
+
/** Render a dot at each axis point. */
|
|
26
|
+
showDots?: boolean;
|
|
27
|
+
/** Render the polar grid (the web). */
|
|
28
|
+
showGrid?: boolean;
|
|
29
|
+
showTooltip?: boolean;
|
|
30
|
+
showLegend?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
33
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` /
|
|
34
|
+
* `indicator` — to customize formatting, per-series rows, or extra fields
|
|
35
|
+
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
36
|
+
*/
|
|
37
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
38
|
+
}
|
|
39
|
+
declare const RadarChart: React.ForwardRefExoticComponent<Omit<RadarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export { RadarChart, radarChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadialBarChart, type RadialBarChartProps, } from './radial-bar-chart';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface RadialBarChartProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
4
|
+
/** Row-per-arc data. Each object holds the arc's `nameKey` label + its `dataKey` numeric value. */
|
|
5
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
6
|
+
/**
|
|
7
|
+
* Per-arc map of `label` / `color`, keyed by the arc's `nameKey` value
|
|
8
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
9
|
+
* custom properties. Colors are caller-supplied — reference an existing
|
|
10
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
11
|
+
*/
|
|
12
|
+
config: ChartConfig;
|
|
13
|
+
/** Numeric field that sizes each arc. */
|
|
14
|
+
dataKey: string;
|
|
15
|
+
/**
|
|
16
|
+
* Label field that names each arc (drives the legend, tooltip, and
|
|
17
|
+
* `--color-<name>` lookup). Values should be unique per chart (arcs sharing a
|
|
18
|
+
* name share one `config`/color entry) and CSS-safe — they become part of a
|
|
19
|
+
* custom-property name.
|
|
20
|
+
*/
|
|
21
|
+
nameKey: string;
|
|
22
|
+
/** Inner radius of the innermost arc. */
|
|
23
|
+
innerRadius?: number;
|
|
24
|
+
/** Outer radius of the outermost arc. */
|
|
25
|
+
outerRadius?: number;
|
|
26
|
+
/** Angle (degrees) the arcs sweep from. */
|
|
27
|
+
startAngle?: number;
|
|
28
|
+
/** Angle (degrees) the arcs sweep to (default is a full clockwise circle). */
|
|
29
|
+
endAngle?: number;
|
|
30
|
+
/** Corner radius on each arc's ends. */
|
|
31
|
+
cornerRadius?: number;
|
|
32
|
+
/** Render a muted background track behind each arc. */
|
|
33
|
+
showBackground?: boolean;
|
|
34
|
+
showTooltip?: boolean;
|
|
35
|
+
showLegend?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
38
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
39
|
+
* to customize formatting, per-arc rows, or extra fields without composing
|
|
40
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
41
|
+
*/
|
|
42
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
43
|
+
}
|
|
44
|
+
declare const RadialBarChart: React.ForwardRefExoticComponent<Omit<RadialBarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export { RadialBarChart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScatterChart, type ScatterChartProps, type ScatterSeries, type ScatterMarkerShape, } from './scatter-chart';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type ScatterMarkerShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
|
|
4
|
+
export interface ScatterSeries {
|
|
5
|
+
/** Series key — must match a `config` entry; drives its `--color-<key>` fill and legend label. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** This series' points — each row holds at least `xKey` and `yKey` (and `zKey` when used). */
|
|
8
|
+
data: ReadonlyArray<Record<string, number>>;
|
|
9
|
+
}
|
|
10
|
+
export interface ScatterChartProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
11
|
+
/** One `<Scatter>` per entry — each with its own point array. Use a single entry for an ungrouped scatter. */
|
|
12
|
+
series: ScatterSeries[];
|
|
13
|
+
/**
|
|
14
|
+
* Per-series map of `label` / `color`, keyed by `series[].key` (imported from
|
|
15
|
+
* the shared `Chart` primitives). Turned into `--color-<key>` custom
|
|
16
|
+
* properties. Colors are caller-supplied — reference an existing semantic
|
|
17
|
+
* `--ui-*` token; there is no chart palette tier yet.
|
|
18
|
+
*/
|
|
19
|
+
config: ChartConfig;
|
|
20
|
+
/** Numeric field for the horizontal axis. */
|
|
21
|
+
xKey: string;
|
|
22
|
+
/** Numeric field for the vertical axis. */
|
|
23
|
+
yKey: 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 X-axis tick values (recharts `unit`). */
|
|
29
|
+
xUnit?: string;
|
|
30
|
+
/** Unit suffix appended to Y-axis tick values (recharts `unit`). */
|
|
31
|
+
yUnit?: string;
|
|
32
|
+
/** Optional numeric field mapped to point size (a bubble chart), via recharts `ZAxis`. */
|
|
33
|
+
zKey?: string;
|
|
34
|
+
/** Point-size range `[min, max]` the `zKey` maps into. Ignored when `zKey` is unset (points use recharts' default size). */
|
|
35
|
+
zRange?: [number, number];
|
|
36
|
+
/** Marker shape for every point. */
|
|
37
|
+
shape?: ScatterMarkerShape;
|
|
38
|
+
showGrid?: boolean;
|
|
39
|
+
showTooltip?: boolean;
|
|
40
|
+
showLegend?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
43
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` /
|
|
44
|
+
* `indicator` — to customize formatting, per-series rows, or extra fields
|
|
45
|
+
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
46
|
+
*/
|
|
47
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
48
|
+
}
|
|
49
|
+
declare const ScatterChart: React.ForwardRefExoticComponent<Omit<ScatterChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export { ScatterChart };
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const stackVariants: (props?: ({
|
|
4
4
|
direction?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
-
gap?: "none" | "
|
|
5
|
+
gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
6
6
|
align?: "center" | "end" | "start" | "stretch" | null | undefined;
|
|
7
7
|
justify?: "center" | "end" | "start" | "between" | null | undefined;
|
|
8
8
|
wrap?: boolean | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Timeline, TimelineItem, type TimelineProps, type TimelineItemProps, type TimelineStatus, } from './timeline';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const timelineVariants: (props?: ({
|
|
4
|
+
size?: "small" | "medium" | null | undefined;
|
|
5
|
+
density?: "compact" | "default" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface TimelineProps extends React.ComponentProps<'ol'>, VariantProps<typeof timelineVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* `Timeline.Item`s — pass them as direct children (the connector auto-hides on
|
|
10
|
+
* the last one). Grouping/headings aren't supported as intervening children.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type TimelineStatus = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'critical';
|
|
15
|
+
export interface TimelineItemProps extends Omit<React.ComponentProps<'li'>, 'title'> {
|
|
16
|
+
/** Event time — pass a `<time dateTime>` for an accessible, machine-readable stamp. */
|
|
17
|
+
timestamp?: React.ReactNode;
|
|
18
|
+
/** Event title (the primary line). */
|
|
19
|
+
title: React.ReactNode;
|
|
20
|
+
/** Optional secondary description. */
|
|
21
|
+
description?: React.ReactNode;
|
|
22
|
+
/** Semantic status — tints the marker (a subtle cue, never large blocks of text). */
|
|
23
|
+
status?: TimelineStatus;
|
|
24
|
+
/** Icon shown in a status-tinted marker badge instead of the plain dot. */
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/** Metadata slot under the description — e.g. `Tag`s. */
|
|
27
|
+
metadata?: React.ReactNode;
|
|
28
|
+
/** Actions slot — e.g. a `Link` or `ButtonMenu`. */
|
|
29
|
+
actions?: React.ReactNode;
|
|
30
|
+
/** Emphasize this item as the current one (a ringed marker). */
|
|
31
|
+
current?: boolean;
|
|
32
|
+
/** Dim a non-applicable / inactive item. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Expandable detail composed by the caller — e.g. an `Accordion`. */
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare const TimelineItem: React.ForwardRefExoticComponent<Omit<TimelineItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
38
|
+
declare const Timeline: React.ForwardRefExoticComponent<Omit<TimelineProps, "ref"> & React.RefAttributes<HTMLOListElement>> & {
|
|
39
|
+
Item: React.ForwardRefExoticComponent<Omit<TimelineItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
40
|
+
};
|
|
41
|
+
export { Timeline, TimelineItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Treemap, type TreemapProps } from './treemap';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface TreemapCellProps {
|
|
4
|
+
x?: number;
|
|
5
|
+
y?: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
showLabels?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function TreemapCell({ x, y, width, height, name, showLabels, }: TreemapCellProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export interface TreemapProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
13
|
+
/** Row-per-leaf data. Each object holds the leaf's `nameKey` label + its `dataKey` numeric size. */
|
|
14
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
15
|
+
/**
|
|
16
|
+
* Per-leaf map of `label` / `color`, keyed by the leaf's `nameKey` value
|
|
17
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
18
|
+
* custom properties. Colors are caller-supplied — reference an existing
|
|
19
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
20
|
+
*/
|
|
21
|
+
config: ChartConfig;
|
|
22
|
+
/** Numeric field that sizes each leaf's rectangle. */
|
|
23
|
+
dataKey: string;
|
|
24
|
+
/**
|
|
25
|
+
* Label field that names each leaf (drives the on-cell label, tooltip, and
|
|
26
|
+
* `--color-<name>` lookup). Values should be unique and CSS-safe (they become
|
|
27
|
+
* part of a custom-property name).
|
|
28
|
+
*/
|
|
29
|
+
nameKey: string;
|
|
30
|
+
/** Width-to-height ratio the tiling targets. */
|
|
31
|
+
aspectRatio?: number;
|
|
32
|
+
/** Render each leaf's name inside its cell (when it fits). */
|
|
33
|
+
showLabels?: boolean;
|
|
34
|
+
showTooltip?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
37
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
38
|
+
* to customize formatting, per-cell rows, or extra fields without composing
|
|
39
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
40
|
+
*/
|
|
41
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
42
|
+
}
|
|
43
|
+
declare const Treemap: React.ForwardRefExoticComponent<Omit<TreemapProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export { Treemap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TrendIndicator, trendIndicatorVariants, type TrendIndicatorProps, } from './trend-indicator';
|