@acronis-platform/ui-react 4.1.0 → 5.0.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/chart/chart.js +17 -14
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +189 -113
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/input-select/input-select.js +18 -9
- package/dist/components/ui/input-select/input-select.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +76 -66
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/index.js +51 -51
- package/dist/llms/funnel-chart.md +269 -101
- package/dist/llms/input-select.md +175 -1
- package/dist/llms/radar-chart.md +15 -5
- package/dist/llms.txt +2 -2
- package/dist/react.js +51 -51
- package/dist/src/components/ui/chart/chart.d.ts +8 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +92 -26
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/input-select/input-select.d.ts +34 -2
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +42 -9
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -8,13 +8,12 @@ declare const funnelChartVariants: (props?: ({
|
|
|
8
8
|
export type FunnelChartLabelPosition = 'right' | 'left' | 'inside';
|
|
9
9
|
/** What a stage's label says. */
|
|
10
10
|
export type FunnelChartLabelFormat = 'name' | 'value' | 'percent' | 'name-value' | 'name-percent' | 'value-percent';
|
|
11
|
-
/** How the stages are coloured: one `config` entry each, or one shared ramp. */
|
|
12
|
-
export type FunnelChartColorMode = 'palette' | 'gradient';
|
|
13
11
|
/** Override for a single stage, keyed by its `nameKey` value. */
|
|
14
12
|
export interface FunnelChartStageSettings {
|
|
15
13
|
/**
|
|
16
|
-
* Paint this stage with a colour of its own
|
|
17
|
-
*
|
|
14
|
+
* Paint this stage with a colour of its own instead of its `palette` stop —
|
|
15
|
+
* the same per-item escape hatch `PieChart`'s `sliceSettings` offers.
|
|
16
|
+
* Reference an existing semantic `--ui-*` token.
|
|
18
17
|
*/
|
|
19
18
|
color?: string;
|
|
20
19
|
/**
|
|
@@ -33,6 +32,75 @@ export interface FunnelChartStageSettings {
|
|
|
33
32
|
* name with its own value.
|
|
34
33
|
*/
|
|
35
34
|
export declare function funnelChartOppositeSide(labelPosition: FunnelChartLabelPosition): FunnelChartLabelPosition;
|
|
35
|
+
/**
|
|
36
|
+
* The palette Figma paints the funnel from: the sequential blue ramp, whose
|
|
37
|
+
* stops read as one quantity falling down the funnel. Every other chart keeps
|
|
38
|
+
* the shared categorical default — a funnel's stages are an *ordered* series,
|
|
39
|
+
* which is what a sequential ramp is for.
|
|
40
|
+
*
|
|
41
|
+
* Figma `8811:175245` uses `dataviz/sequential/blue/{2,4,6,8}`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const FUNNEL_CHART_DEFAULT_PALETTE: ChartPalette;
|
|
44
|
+
/**
|
|
45
|
+
* The `d` for one funnel stage — recharts' trapezoid geometry with the design's
|
|
46
|
+
* rounded corners.
|
|
47
|
+
*
|
|
48
|
+
* `x`/`y` is the top-left of the *upper* edge and the shape is centred on
|
|
49
|
+
* `x + upperWidth / 2`, matching recharts' own `getTrapezoidPath`.
|
|
50
|
+
*
|
|
51
|
+
* Either edge can collapse to a single rounded apex rather than a zero-length
|
|
52
|
+
* one — the `triangle` last shape narrows to a point at the bottom, and a
|
|
53
|
+
* `reversed` funnel stands that same triangle on its head at the top.
|
|
54
|
+
*/
|
|
55
|
+
export declare function funnelChartStagePath(options: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
upperWidth: number;
|
|
59
|
+
lowerWidth: number;
|
|
60
|
+
height: number;
|
|
61
|
+
/**
|
|
62
|
+
* Uniform corner radius — applies to all four corners. Overridden per-side
|
|
63
|
+
* by `topRadius` / `bottomRadius`. When absent, defaults to
|
|
64
|
+
* `STAGE_RADIUS` (top) and `STAGE_BOTTOM_RADIUS` (bottom).
|
|
65
|
+
*/
|
|
66
|
+
radius?: number;
|
|
67
|
+
/** Radius for the two upper corners (default: `STAGE_RADIUS = 2`). */
|
|
68
|
+
topRadius?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Radius for the two lower corners (default: `STAGE_BOTTOM_RADIUS = 1`).
|
|
71
|
+
*
|
|
72
|
+
* Figma's bottom corners clip ~0.85px — much smaller than the upper ones —
|
|
73
|
+
* so the default is intentionally lower than `topRadius`.
|
|
74
|
+
*/
|
|
75
|
+
bottomRadius?: number;
|
|
76
|
+
}): string;
|
|
77
|
+
/**
|
|
78
|
+
* Pull a stage's **top** edge down by `gap`, so surface shows between it and the
|
|
79
|
+
* stage above.
|
|
80
|
+
*
|
|
81
|
+
* The top rather than the bottom on purpose: the bottom edge is what
|
|
82
|
+
* `lastShapeType` defines — the triangle's apex — so leaving it exactly where
|
|
83
|
+
* recharts put it keeps a `triangle` funnel ending in a real point instead of a
|
|
84
|
+
* blunt 2px edge. The upper edge slides down the funnel's own slope, so the
|
|
85
|
+
* taper is unchanged rather than steepened.
|
|
86
|
+
*
|
|
87
|
+
* A stage with no room for the gap is returned untouched: better a missing gap
|
|
88
|
+
* than an inverted shape.
|
|
89
|
+
*/
|
|
90
|
+
export declare function funnelChartStageInset(options: {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
upperWidth: number;
|
|
94
|
+
lowerWidth: number;
|
|
95
|
+
height: number;
|
|
96
|
+
gap: number;
|
|
97
|
+
}): {
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
upperWidth: number;
|
|
101
|
+
lowerWidth: number;
|
|
102
|
+
height: number;
|
|
103
|
+
};
|
|
36
104
|
/**
|
|
37
105
|
* Reserve room for a composite label beside the funnel, by narrowing the
|
|
38
106
|
* **funnel** rather than the plot area.
|
|
@@ -70,11 +138,15 @@ export declare function funnelChartLabelReserve(options: {
|
|
|
70
138
|
labelFormat: FunnelChartLabelFormat;
|
|
71
139
|
}): string | undefined;
|
|
72
140
|
/**
|
|
73
|
-
* The plot-area margin.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
141
|
+
* The plot-area margin.
|
|
142
|
+
*
|
|
143
|
+
* With nothing beside the funnel — the default, and what Figma draws — the plot
|
|
144
|
+
* is the design's own inset (`PLOT_MARGIN`): just the few px the rounded corners
|
|
145
|
+
* and the apex need, so the funnel fills its 120px square instead of being
|
|
146
|
+
* squeezed into the middle by label room it isn't using.
|
|
76
147
|
*
|
|
77
|
-
*
|
|
148
|
+
* As soon as a label list *does* sit beside the funnel, the side insets come
|
|
149
|
+
* back: this is overflow protection, not label room — the wrap width comes from
|
|
78
150
|
* `funnelChartLabelReserve`. A caller-supplied `margin` is merged over these
|
|
79
151
|
* defaults per side, so `margin={{ right: 160 }}` keeps the default top, bottom
|
|
80
152
|
* and left rather than collapsing them to zero.
|
|
@@ -85,10 +157,10 @@ export declare function funnelChartLabelMargin(options: {
|
|
|
85
157
|
showValueLabels: boolean;
|
|
86
158
|
valuePosition: FunnelChartLabelPosition;
|
|
87
159
|
}): {
|
|
88
|
-
left: number;
|
|
89
160
|
top: number;
|
|
90
161
|
right: number;
|
|
91
162
|
bottom: number;
|
|
163
|
+
left: number;
|
|
92
164
|
};
|
|
93
165
|
/**
|
|
94
166
|
* Format a conversion share the way the default `percent` label reads it:
|
|
@@ -121,8 +193,12 @@ export declare function funnelChartLabelText(options: {
|
|
|
121
193
|
}): string;
|
|
122
194
|
export interface FunnelChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof funnelChartVariants>, ChartAnimationProps {
|
|
123
195
|
/**
|
|
124
|
-
* The dataviz palette
|
|
125
|
-
*
|
|
196
|
+
* The dataviz palette the stages are painted from — the only source of a
|
|
197
|
+
* stage's colour, bar a per-stage `stageSettings.color`. Defaults to
|
|
198
|
+
* `FUNNEL_CHART_DEFAULT_PALETTE` (the sequential blue ramp), which is what
|
|
199
|
+
* Figma paints the funnel with; a funnel's stages are an ordered series, so a
|
|
200
|
+
* ramp reads them better than the shared categorical default.
|
|
201
|
+
* See `ChartPalette`.
|
|
126
202
|
*/
|
|
127
203
|
palette?: ChartPalette;
|
|
128
204
|
/** Row-per-stage data. Each object holds the stage's `nameKey` label + its `dataKey` numeric value. */
|
|
@@ -186,23 +262,13 @@ export interface FunnelChartProps extends Omit<React.ComponentProps<'div'>, 'chi
|
|
|
186
262
|
* for a locale that doesn't write a bare `%`.
|
|
187
263
|
*/
|
|
188
264
|
percentFormatter?: TickFormatter;
|
|
189
|
-
/** Render the legend. Off by default: a funnel labels its stages on the chart. */
|
|
190
|
-
showLegend?: boolean;
|
|
191
|
-
/** Which edge the legend sits on. */
|
|
192
|
-
legendPos?: 'top' | 'bottom';
|
|
193
265
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* stage down to the narrowest.
|
|
266
|
+
* Render the stage list beside the funnel. On by default: the design's funnel
|
|
267
|
+
* carries no on-plot labels, so the legend is where the stages are named.
|
|
197
268
|
*/
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
* own colour — including a `stageSettings` colour set on it — so a palette
|
|
202
|
-
* config becomes a ramp without a second colour decision. Ignored when
|
|
203
|
-
* `colorMode` is `palette`.
|
|
204
|
-
*/
|
|
205
|
-
gradientColor?: string;
|
|
269
|
+
showLegend?: boolean;
|
|
270
|
+
/** Format the value in each legend row — the stage's `dataKey` number. */
|
|
271
|
+
legendValueFormatter?: (value: string | number) => string;
|
|
206
272
|
/** Per-stage `color` / `hidden` overrides, keyed by the stage's `nameKey` value. */
|
|
207
273
|
stageSettings?: Record<string, FunnelChartStageSettings>;
|
|
208
274
|
/** Outline the hovered segment. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FunnelChart, funnelChartVariants, funnelChartPercent,
|
|
1
|
+
export { FunnelChart, funnelChartVariants, funnelChartPercent, FUNNEL_CHART_DEFAULT_PALETTE, type FunnelChartProps, type FunnelChartLabelFormat, type FunnelChartLabelPosition, type FunnelChartStageSettings, } from './funnel-chart';
|
|
@@ -30,11 +30,43 @@ declare const InputSelectContent: React.ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
30
30
|
align?: SelectPrimitive.Positioner.Props["align"];
|
|
31
31
|
side?: SelectPrimitive.Positioner.Props["side"];
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* Offset in px along the alignment axis (perpendicular to `side`). Defaults
|
|
34
|
+
* to Base UI's own `0` when omitted — pass a value to nudge the dropdown
|
|
35
|
+
* along the trigger's edge without changing its `align`.
|
|
36
|
+
*/
|
|
37
|
+
alignOffset?: SelectPrimitive.Positioner.Props["alignOffset"];
|
|
38
|
+
/**
|
|
39
|
+
* Collision-avoidance strategy. Defaults to Base UI's own flip/shift
|
|
40
|
+
* behavior, which may move the dropdown off the requested `side`/`align`
|
|
41
|
+
* when it doesn't fit. Pass `{ side: 'none', fallbackAxisSide: 'none' }`
|
|
42
|
+
* alongside an explicit `side`/`align` to lock the popup to that placement
|
|
43
|
+
* with no auto-flip fallback (e.g. "always to the right, no matter what":
|
|
44
|
+
* `side="right" sideOffset={20} collisionAvoidance={{ side: 'none',
|
|
45
|
+
* fallbackAxisSide: 'none' }}`).
|
|
46
|
+
*/
|
|
47
|
+
collisionAvoidance?: SelectPrimitive.Positioner.Props["collisionAvoidance"];
|
|
48
|
+
/**
|
|
49
|
+
* Element (or ref/getter) the popup positions itself against, overriding
|
|
50
|
+
* the default of anchoring to `InputSelectTrigger`. Use when the visible
|
|
51
|
+
* trigger isn't the element Base UI tracks internally — e.g. an external
|
|
52
|
+
* button drives a hidden trigger, and the popup should align with the
|
|
53
|
+
* button instead of the hidden trigger's layout position.
|
|
54
|
+
*/
|
|
55
|
+
anchor?: SelectPrimitive.Positioner.Props["anchor"];
|
|
56
|
+
/**
|
|
57
|
+
* Container to portal the dropdown into. Defaults to the nearest
|
|
58
|
+
* `PortalContainerProvider`, or `document.body` when there is none; pass an
|
|
59
|
+
* element to scope the portal explicitly (e.g. a shadow root, so the popup
|
|
35
60
|
* inherits styles defined there).
|
|
36
61
|
*/
|
|
37
62
|
portalContainer?: SelectPrimitive.Portal.Props["container"];
|
|
63
|
+
/**
|
|
64
|
+
* Render the dropdown chrome like `PopoverContent` (`--ui-popover-container-*`
|
|
65
|
+
* tokens, no shadow, fade/zoom/slide enter-exit animation) instead of the
|
|
66
|
+
* default `--ui-input-select-dropdown-container-*` tokens + static `shadow-md`.
|
|
67
|
+
* See `components/ui/popover/popover.tsx`.
|
|
68
|
+
*/
|
|
69
|
+
isPopoverStyled?: boolean;
|
|
38
70
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
39
71
|
/**
|
|
40
72
|
* In-dropdown search row (magnifier + input). By default it drives the
|
|
@@ -113,9 +113,9 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
113
113
|
fillOpacity?: number;
|
|
114
114
|
/** Stroke width of each radar outline. */
|
|
115
115
|
strokeWidth?: number;
|
|
116
|
-
/** Render a dot at each axis point. */
|
|
116
|
+
/** Render a dot at each axis point. Defaults to `true`. */
|
|
117
117
|
showDots?: boolean;
|
|
118
|
-
/** Radius of the per-point dots when `showDots` is on. */
|
|
118
|
+
/** Radius of the per-point dots when `showDots` is on. Defaults to `2`. */
|
|
119
119
|
dotRadius?: number;
|
|
120
120
|
/**
|
|
121
121
|
* Enlarge the hovered point's dot. On by default (recharts' behavior) — pass
|
|
@@ -148,9 +148,9 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
148
148
|
/** Draw a tick line from the axis line to each spoke label. Defaults to `true`. */
|
|
149
149
|
angleTickLine?: boolean;
|
|
150
150
|
/**
|
|
151
|
-
* Distance from
|
|
152
|
-
*
|
|
153
|
-
*
|
|
151
|
+
* Distance from each polygon vertex to its outer category label, in px.
|
|
152
|
+
* Defaults to `4` (Figma geometry). When `showLabels` is on and no explicit
|
|
153
|
+
* value is given, widens automatically to clear the value labels.
|
|
154
154
|
*/
|
|
155
155
|
angleTickSize?: number;
|
|
156
156
|
/**
|
|
@@ -211,7 +211,11 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
211
211
|
radiusAxisReversed?: boolean;
|
|
212
212
|
/** Horizontal centre of the web, in px or a percentage of the width. Defaults to `50%`. */
|
|
213
213
|
cx?: number | string;
|
|
214
|
-
/**
|
|
214
|
+
/**
|
|
215
|
+
* Vertical centre of the web, in px or a percentage of the height. Defaults to
|
|
216
|
+
* the middle of the plot band — i.e. `50%` of what the legend leaves, not of
|
|
217
|
+
* the whole box (see `radarPlotBox`).
|
|
218
|
+
*/
|
|
215
219
|
cy?: number | string;
|
|
216
220
|
/** Angle the first category sits at, in degrees. Defaults to `90` (12 o'clock). */
|
|
217
221
|
startAngle?: number;
|
|
@@ -227,7 +231,12 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
227
231
|
* which separates the series where they all bottom out.
|
|
228
232
|
*/
|
|
229
233
|
innerRadius?: number | string;
|
|
230
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Outer radius of the web, in px or a percentage of the available radius.
|
|
236
|
+
* Defaults to `78px`, matching the Figma radar geometry. The legend and labels
|
|
237
|
+
* do not change the radius — they change the box it is drawn in (see
|
|
238
|
+
* `radarPlotBox`).
|
|
239
|
+
*/
|
|
231
240
|
outerRadius?: number | string;
|
|
232
241
|
/**
|
|
233
242
|
* Plot-area margin, in px. Omit it entirely to use recharts' default (5 on
|
|
@@ -242,8 +251,6 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
242
251
|
};
|
|
243
252
|
showTooltip?: boolean;
|
|
244
253
|
showLegend?: boolean;
|
|
245
|
-
/** Which side of the chart the legend sits on. Defaults to `bottom`. */
|
|
246
|
-
legendPosition?: 'top' | 'bottom';
|
|
247
254
|
/**
|
|
248
255
|
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
249
256
|
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
@@ -254,5 +261,31 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
254
261
|
/** Position of the value labels when `showLabels` is on. Defaults to `top`. */
|
|
255
262
|
labelPosition?: CartesianLabelPosition;
|
|
256
263
|
}
|
|
264
|
+
/** The chart's own box: the height it reserves, and the polar centre inside it. */
|
|
265
|
+
export interface RadarPlotBox {
|
|
266
|
+
/**
|
|
267
|
+
* Tailwind height for the outer element. Merged *before* the consumer's
|
|
268
|
+
* `className`, so a caller-supplied height still wins.
|
|
269
|
+
*/
|
|
270
|
+
heightClass: string;
|
|
271
|
+
/** `cy` for recharts, or `undefined` to keep its own `height / 2` default. */
|
|
272
|
+
cy: string | undefined;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Size the chart's box around its category ring, and centre the web in the part
|
|
276
|
+
* of that box the legend does not take. Exported for unit tests; not part of the
|
|
277
|
+
* package's public API.
|
|
278
|
+
*
|
|
279
|
+
* `ringRadius` is how far the category labels reach from the centre —
|
|
280
|
+
* `outerRadius + angleTickSize + RADAR_TICK_TEXT_HALF_LINE` — or `undefined`
|
|
281
|
+
* when `outerRadius` is a percentage, which recharts already fits to the plot
|
|
282
|
+
* area (legend included) on its own.
|
|
283
|
+
*
|
|
284
|
+
* `cy` comes back as a percentage rather than the px it resolves to at the
|
|
285
|
+
* default height, so a caller-supplied height keeps the proportion instead of
|
|
286
|
+
* pinning the web to an absolute offset. On a taller box that lifts the web a
|
|
287
|
+
* little further than the legend alone needs — towards the side with the slack.
|
|
288
|
+
*/
|
|
289
|
+
export declare function radarPlotBox(ringRadius: number | undefined, showLegend: boolean): RadarPlotBox;
|
|
257
290
|
declare const RadarChart: React.ForwardRefExoticComponent<Omit<RadarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
258
291
|
export { RadarChart, radarChartVariants };
|