@acronis-platform/ui-react 3.0.0 → 4.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/accordion-container/accordion-container.js +14 -14
- package/dist/components/ui/accordion-container/accordion-container.js.map +1 -1
- package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +141 -139
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +295 -293
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +109 -93
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +113 -0
- package/dist/components/ui/chart/chart-palette.js.map +1 -0
- package/dist/components/ui/chart/chart.js +176 -129
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
- package/dist/components/ui/chart-state/chart-state.js +48 -34
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +87 -0
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +117 -115
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +94 -92
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/label/label.js +2 -9
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +143 -141
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +74 -185
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/page-content/page-content.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +201 -195
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +133 -131
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/section/section.js +157 -31
- package/dist/components/ui/section/section.js.map +1 -1
- package/dist/components/ui/stepper/stepper.js +24 -24
- package/dist/components/ui/stepper/stepper.js.map +1 -1
- package/dist/components/ui/stepper-item/stepper-item.js +43 -24
- package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +133 -124
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
- package/dist/components/ui/wizard/wizard.js +59 -0
- package/dist/components/ui/wizard/wizard.js.map +1 -0
- package/dist/hooks/use-wizard.js +75 -0
- package/dist/hooks/use-wizard.js.map +1 -0
- package/dist/index.js +502 -497
- package/dist/index.js.map +1 -1
- package/dist/llms/accordion-container.md +181 -0
- package/dist/llms/accordion.md +124 -0
- package/dist/llms/alert.md +225 -0
- package/dist/llms/app-shell-chat.md +415 -0
- package/dist/llms/area-chart.md +355 -0
- package/dist/llms/avatar.md +208 -0
- package/dist/llms/bar-chart.md +406 -0
- package/dist/llms/breadcrumb.md +326 -0
- package/dist/llms/button-group.md +298 -0
- package/dist/llms/button-icon-input.md +142 -0
- package/dist/llms/button-icon-menu.md +209 -0
- package/dist/llms/button-icon.md +128 -0
- package/dist/llms/button-menu.md +172 -0
- package/dist/llms/button.md +185 -0
- package/dist/llms/calendar-panel.md +733 -0
- package/dist/llms/calendar.md +188 -0
- package/dist/llms/card-filter.md +214 -0
- package/dist/llms/card-section.md +293 -0
- package/dist/llms/card.md +447 -0
- package/dist/llms/carousel-dialog.md +156 -0
- package/dist/llms/category-bar.md +193 -0
- package/dist/llms/chart-state.md +190 -0
- package/dist/llms/chart-widget.md +209 -0
- package/dist/llms/chart.md +182 -0
- package/dist/llms/checkbox.md +257 -0
- package/dist/llms/chip.md +195 -0
- package/dist/llms/combobox.md +164 -0
- package/dist/llms/composed-chart.md +508 -0
- package/dist/llms/confidence-cone.md +277 -0
- package/dist/llms/data-table.md +474 -0
- package/dist/llms/date-range-picker.md +272 -0
- package/dist/llms/description-list.md +131 -0
- package/dist/llms/dialog-footer-carousel.md +147 -0
- package/dist/llms/dialog-footer-default.md +142 -0
- package/dist/llms/dialog-root.md +246 -0
- package/dist/llms/dialog-welcome.md +223 -0
- package/dist/llms/dialog.md +403 -0
- package/dist/llms/dropdown-menu.md +193 -0
- package/dist/llms/empty-overlay.md +146 -0
- package/dist/llms/empty.md +156 -0
- package/dist/llms/field.md +185 -0
- package/dist/llms/filter-cards.md +157 -0
- package/dist/llms/filter-chips.md +323 -0
- package/dist/llms/filter-search.md +512 -0
- package/dist/llms/form.md +154 -0
- package/dist/llms/funnel-chart.md +333 -0
- package/dist/llms/grid.md +80 -0
- package/dist/llms/histogram.md +190 -0
- package/dist/llms/input-date-picker.md +203 -0
- package/dist/llms/input-otp.md +173 -0
- package/dist/llms/input-password.md +197 -0
- package/dist/llms/input-search.md +170 -0
- package/dist/llms/input-select.md +278 -0
- package/dist/llms/input-text-area.md +271 -0
- package/dist/llms/input-text.md +192 -0
- package/dist/llms/line-chart.md +369 -0
- package/dist/llms/link.md +209 -0
- package/dist/llms/loading.md +130 -0
- package/dist/llms/meter.md +177 -0
- package/dist/llms/metric.md +204 -0
- package/dist/llms/number-field.md +122 -0
- package/dist/llms/page-content.md +69 -0
- package/dist/llms/page-header.md +182 -0
- package/dist/llms/pagination.md +133 -0
- package/dist/llms/pie-chart.md +307 -0
- package/dist/llms/popover.md +252 -0
- package/dist/llms/progress-circle.md +126 -0
- package/dist/llms/progress.md +111 -0
- package/dist/llms/radar-chart.md +316 -0
- package/dist/llms/radial-bar-chart.md +319 -0
- package/dist/llms/radio.md +255 -0
- package/dist/llms/resizable.md +195 -0
- package/dist/llms/sankey-chart.md +208 -0
- package/dist/llms/scatter-chart.md +239 -0
- package/dist/llms/scroll-area.md +183 -0
- package/dist/llms/section.md +401 -0
- package/dist/llms/select.md +210 -0
- package/dist/llms/separator.md +87 -0
- package/dist/llms/sheet.md +202 -0
- package/dist/llms/sidebar-primary.md +360 -0
- package/dist/llms/sidebar-secondary.md +417 -0
- package/dist/llms/skeleton.md +81 -0
- package/dist/llms/slider.md +97 -0
- package/dist/llms/spinner.md +100 -0
- package/dist/llms/stack.md +80 -0
- package/dist/llms/stepper-item.md +309 -0
- package/dist/llms/stepper.md +251 -0
- package/dist/llms/switch.md +140 -0
- package/dist/llms/table.md +436 -0
- package/dist/llms/tabs.md +197 -0
- package/dist/llms/tag.md +139 -0
- package/dist/llms/timeline.md +361 -0
- package/dist/llms/timer.md +259 -0
- package/dist/llms/toast.md +241 -0
- package/dist/llms/toggle-group.md +121 -0
- package/dist/llms/toolbar.md +453 -0
- package/dist/llms/tooltip.md +164 -0
- package/dist/llms/treemap.md +254 -0
- package/dist/llms/trend-indicator.md +132 -0
- package/dist/llms/widget-placeholder.md +169 -0
- package/dist/llms/wizard.md +412 -0
- package/dist/llms.txt +142 -0
- package/dist/react.js +502 -497
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
- package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
- package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
- package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
- package/dist/src/components/ui/chart/chart.d.ts +66 -15
- package/dist/src/components/ui/chart/index.d.ts +4 -2
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
- package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
- package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +1 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
- package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
- package/dist/src/components/ui/label/index.d.ts +1 -1
- package/dist/src/components/ui/label/label.d.ts +1 -5
- package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
- package/dist/src/components/ui/metric/metric.d.ts +13 -14
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
- package/dist/src/components/ui/section/index.d.ts +1 -1
- package/dist/src/components/ui/section/section.d.ts +75 -6
- package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
- package/dist/src/components/ui/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-wizard.d.ts +80 -0
- package/dist/src/index.d.ts +2 -3
- package/dist/ui-react.css +1 -1
- package/package.json +9 -3
- package/dist/components/ui/app-shell/app-shell.js +0 -75
- package/dist/components/ui/app-shell/app-shell.js.map +0 -1
- package/dist/components/ui/auth-layout/auth-layout.js +0 -56
- package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
- package/dist/components/ui/collapsible/collapsible.js +0 -22
- package/dist/components/ui/collapsible/collapsible.js.map +0 -1
- package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
- package/dist/src/components/ui/app-shell/index.d.ts +0 -1
- package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
- package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
- package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
- package/dist/src/components/ui/collapsible/index.d.ts +0 -1
- package/dist/src/components/ui/label/label.docs.d.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartConfig, CartesianChartProps, ChartAnimationProps } from '../chart';
|
|
1
|
+
import { ChartConfig, ChartPalette, CartesianChartProps, ChartAnimationProps } from '../chart';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export interface HistogramBin {
|
|
4
4
|
/** Lower bound of the bin (inclusive). */
|
|
@@ -19,12 +19,18 @@ export interface HistogramBin {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function computeHistogramBins(values: ReadonlyArray<number>, binCount: number, domain?: [number, number]): HistogramBin[];
|
|
21
21
|
export interface HistogramProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps, ChartAnimationProps {
|
|
22
|
+
/**
|
|
23
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
24
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
25
|
+
*/
|
|
26
|
+
palette?: ChartPalette;
|
|
22
27
|
/** Raw continuous samples to bin (non-finite values are ignored). */
|
|
23
28
|
values: ReadonlyArray<number>;
|
|
24
29
|
/**
|
|
25
|
-
* Single-series map of `label` / `
|
|
26
|
-
* the shared `Chart` primitives).
|
|
27
|
-
*
|
|
30
|
+
* Single-series map of `label` / `icon` / `tone`, keyed by `dataKey` (imported
|
|
31
|
+
* from the shared `Chart` primitives). Series take their colour from the
|
|
32
|
+
* container's `palette`; each entry maps a key to a `label` and an optional
|
|
33
|
+
* `tone`.
|
|
28
34
|
*/
|
|
29
35
|
config: ChartConfig;
|
|
30
36
|
/** `config` key that colors + labels the frequency bars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { labelClassName } from './label';
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare const labelClassName = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70";
|
|
3
|
-
export type LabelProps = React.ComponentPropsWithoutRef<'label'>;
|
|
4
|
-
declare const Label: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
-
export { Label, labelClassName };
|
|
1
|
+
export declare const labelClassName = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartTooltip, ChartConfig, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCurveType, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition } from '../chart';
|
|
2
|
+
import { ChartTooltip, ChartConfig, ChartPalette, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCurveType, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const lineChartVariants: (props?: ({
|
|
5
5
|
curve?: "step" | "linear" | "monotone" | "natural" | "basis" | "stepBefore" | "stepAfter" | null | undefined;
|
|
@@ -55,12 +55,17 @@ export interface LineChartLineSettings {
|
|
|
55
55
|
labelPosition?: CartesianLabelPosition;
|
|
56
56
|
}
|
|
57
57
|
export interface LineChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof lineChartVariants>, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
|
|
58
|
+
/**
|
|
59
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
60
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
61
|
+
*/
|
|
62
|
+
palette?: ChartPalette;
|
|
58
63
|
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */
|
|
59
64
|
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
60
65
|
/**
|
|
61
|
-
* Per-series map of `label` / `
|
|
62
|
-
* primitives). Series
|
|
63
|
-
*
|
|
66
|
+
* Per-series map of `label` / `icon` / `tone` (from the shared `Chart`
|
|
67
|
+
* primitives). Series take their colour from the container's `palette`; each
|
|
68
|
+
* entry maps a key to a `label` and an optional `tone`.
|
|
64
69
|
*/
|
|
65
70
|
config: ChartConfig;
|
|
66
71
|
/** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
size?: "small" | "medium" | "large" | null | undefined;
|
|
5
|
-
status?: "info" | "success" | "warning" | "critical" | "danger" | "neutral" | 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;
|
|
2
|
+
export interface MetricProps extends React.ComponentProps<'div'> {
|
|
10
3
|
/**
|
|
11
4
|
* The primary value, already formatted (`73`, `"94%"`, `"$72K"`, `"2.8"`).
|
|
12
5
|
* The kit does not format currency, units, or decimals.
|
|
@@ -14,15 +7,21 @@ export interface MetricProps extends React.ComponentProps<'div'>, VariantProps<t
|
|
|
14
7
|
value: React.ReactNode;
|
|
15
8
|
/** Unit shown next to the value at a smaller, muted size — e.g. `"%"`, `"hours"`. */
|
|
16
9
|
unit?: React.ReactNode;
|
|
17
|
-
/**
|
|
10
|
+
/** Caption at the right end of the stats row — e.g. a timeframe `Tag`. */
|
|
18
11
|
caption?: React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Trend direction — renders a `TrendIndicator` on its own row below the value.
|
|
14
|
+
* Sentiment follows direction: `up` → positive, `down` → negative, `stable` → neutral.
|
|
15
|
+
* Pair with `trendValue` for the change text.
|
|
16
|
+
*/
|
|
17
|
+
trend?: 'up' | 'down' | 'stable';
|
|
18
|
+
/** Change text shown next to the trend arrow — e.g. `"20%"`, `"+3"`. Requires `trend`. */
|
|
19
|
+
trendValue?: React.ReactNode;
|
|
20
|
+
/** Secondary line below the trend — e.g. "Target: 99%". */
|
|
22
21
|
supportingText?: React.ReactNode;
|
|
23
22
|
/** A small badge / metadata slot beside the value — e.g. a `Tag`. */
|
|
24
23
|
badge?: React.ReactNode;
|
|
25
|
-
/** Icon rendered in a status-tinted badge before the value. */
|
|
24
|
+
/** Icon rendered in a status-info-tinted badge before the value. */
|
|
26
25
|
icon?: React.ReactNode;
|
|
27
26
|
/** Contextual hint on an info affordance next to the label (Base UI Tooltip). */
|
|
28
27
|
tooltip?: React.ReactNode;
|
|
@@ -30,7 +29,7 @@ export interface MetricProps extends React.ComponentProps<'div'>, VariantProps<t
|
|
|
30
29
|
tooltipLabel?: string;
|
|
31
30
|
/** Show a skeleton in place of the value, preserving its space. */
|
|
32
31
|
loading?: boolean;
|
|
33
|
-
/**
|
|
32
|
+
/** Content below the stats strip — e.g. a chart, a `Separator`, an insight line. */
|
|
34
33
|
children?: React.ReactNode;
|
|
35
34
|
}
|
|
36
35
|
declare const Metric: React.ForwardRefExoticComponent<Omit<MetricProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartTooltip, ChartConfig, ChartTooltipContentProps, ChartAnimationProps, ChartDataLabelProps, PolarLabelPosition, TickFormatter } from '../chart';
|
|
2
|
+
import { ChartTooltip, ChartConfig, ChartPalette, ChartTooltipContentProps, ChartAnimationProps, ChartDataLabelProps, PolarLabelPosition, TickFormatter } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const pieChartVariants: (props?: ({
|
|
5
|
-
shape?: "
|
|
5
|
+
shape?: "donut" | "pie" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
/** Row-per-slice datum: the `nameKey` label plus the `dataKey` value. */
|
|
8
8
|
type PieChartDatum = Record<string, string | number>;
|
|
@@ -81,13 +81,19 @@ export interface PieChartCenterLabel {
|
|
|
81
81
|
label?: string | number;
|
|
82
82
|
}
|
|
83
83
|
export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof pieChartVariants>, ChartAnimationProps, ChartDataLabelProps {
|
|
84
|
+
/**
|
|
85
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
86
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
87
|
+
*/
|
|
88
|
+
palette?: ChartPalette;
|
|
84
89
|
/** Row-per-slice data. Each object holds the slice's `nameKey` label + its `dataKey` numeric value. */
|
|
85
90
|
data: ReadonlyArray<PieChartDatum>;
|
|
86
91
|
/**
|
|
87
|
-
* Per-slice map of `label` / `
|
|
88
|
-
* (imported from the shared `Chart` primitives). Turned into
|
|
89
|
-
* custom properties.
|
|
90
|
-
*
|
|
92
|
+
* Per-slice map of `label` / `icon` / `tone`, keyed by the slice's `nameKey`
|
|
93
|
+
* value (imported from the shared `Chart` primitives). Turned into
|
|
94
|
+
* `--color-<name>` custom properties. Series take their colour from the
|
|
95
|
+
* container's `palette`; each entry maps a key to a `label` and an optional
|
|
96
|
+
* `tone`.
|
|
91
97
|
*/
|
|
92
98
|
config: ChartConfig;
|
|
93
99
|
/** Numeric field that sizes each slice. */
|
|
@@ -136,8 +142,11 @@ export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'childr
|
|
|
136
142
|
sliceSettings?: Record<string, PieChartSliceSettings>;
|
|
137
143
|
showTooltip?: boolean;
|
|
138
144
|
showLegend?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Format each slice's value in the list legend. When omitted the raw value is
|
|
147
|
+
* stringified with `String()`.
|
|
148
|
+
*/
|
|
149
|
+
legendValueFormatter?: (value: string | number) => string;
|
|
141
150
|
/** Plot-area margin, in px. Omit to use recharts' default (5 on every side). */
|
|
142
151
|
margin?: {
|
|
143
152
|
top?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { AxisDomainItem } from 'recharts';
|
|
3
|
-
import { ChartTooltip, ChartConfig, ChartAnimationProps, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
3
|
+
import { ChartTooltip, ChartConfig, ChartPalette, ChartAnimationProps, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
declare const radarChartVariants: (props?: ({
|
|
6
6
|
gridType?: "circle" | "polygon" | null | undefined;
|
|
@@ -79,6 +79,11 @@ export interface RadarSeriesStyle {
|
|
|
79
79
|
*/
|
|
80
80
|
export declare function radarSeriesStyle(key: string, settings: RadarChartSeriesSettings | undefined, defaults: RadarSeriesDefaults): RadarSeriesStyle;
|
|
81
81
|
export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof radarChartVariants>, ChartAnimationProps, ChartDataLabelProps {
|
|
82
|
+
/**
|
|
83
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
84
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
85
|
+
*/
|
|
86
|
+
palette?: ChartPalette;
|
|
82
87
|
/**
|
|
83
88
|
* Row-per-axis data. Each object holds the `angleKey` label + one numeric field
|
|
84
89
|
* per series. Every plotted series needs a value in every row: recharts places a
|
|
@@ -86,10 +91,10 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
86
91
|
*/
|
|
87
92
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
88
93
|
/**
|
|
89
|
-
* Per-series map of `label` / `
|
|
90
|
-
* primitives). Turned into `--color-<key>` custom properties. Series
|
|
91
|
-
*
|
|
92
|
-
*
|
|
94
|
+
* Per-series map of `label` / `icon` / `tone` (imported from the shared
|
|
95
|
+
* `Chart` primitives). Turned into `--color-<key>` custom properties. Series
|
|
96
|
+
* take their colour from the container's `palette`; each entry maps a key to a
|
|
97
|
+
* `label` and an optional `tone`.
|
|
93
98
|
*/
|
|
94
99
|
config: ChartConfig;
|
|
95
100
|
/** Series to plot — one `<Radar>` per key. Each must exist in `config` and in every data row. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartTooltip, ChartConfig, ChartAnimationProps, ChartDataLabelProps, PolarLabelPosition, TickFormatter } from '../chart';
|
|
1
|
+
import { ChartTooltip, ChartConfig, ChartPalette, ChartAnimationProps, ChartDataLabelProps, PolarLabelPosition, TickFormatter } from '../chart';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
/** Row-per-arc datum: the `nameKey` label plus each metric's numeric value. */
|
|
4
4
|
type RadialBarChartDatum = Record<string, string | number>;
|
|
@@ -117,14 +117,19 @@ export declare function RadialBarChartSegmentedTooltipContent({ active, payload,
|
|
|
117
117
|
*/
|
|
118
118
|
export declare function radialBarChartBandName(row: RadialBarChartDatum | undefined, nameKey: string): string;
|
|
119
119
|
export interface RadialBarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, ChartAnimationProps, ChartDataLabelProps {
|
|
120
|
+
/**
|
|
121
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
122
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
123
|
+
*/
|
|
124
|
+
palette?: ChartPalette;
|
|
120
125
|
/** Row-per-arc data. Each object holds the arc's `nameKey` label + its `dataKey` numeric value. */
|
|
121
126
|
data: ReadonlyArray<RadialBarChartDatum>;
|
|
122
127
|
/**
|
|
123
|
-
* Per-arc map of `label` / `
|
|
124
|
-
* multi-metric mode, by each `dataKeys` entry (imported from the
|
|
125
|
-
* primitives). Turned into `--color-<name>` custom properties.
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
+
* Per-arc map of `label` / `icon` / `tone`, keyed by the arc's `nameKey` value
|
|
129
|
+
* — or, in multi-metric mode, by each `dataKeys` entry (imported from the
|
|
130
|
+
* shared `Chart` primitives). Turned into `--color-<name>` custom properties.
|
|
131
|
+
* Series take their colour from the container's `palette`; each entry maps a
|
|
132
|
+
* key to a `label` and an optional `tone`.
|
|
128
133
|
*/
|
|
129
134
|
config: ChartConfig;
|
|
130
135
|
/** Numeric field that sizes each arc. Ignored when `dataKeys` is set. */
|
|
@@ -223,6 +228,12 @@ export interface RadialBarChartProps extends Omit<React.ComponentProps<'div'>, '
|
|
|
223
228
|
centerLabel?: RadialBarChartCenterLabel;
|
|
224
229
|
showTooltip?: boolean;
|
|
225
230
|
showLegend?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Format each arc's value in the list legend. In single-metric mode each arc
|
|
233
|
+
* row gets its formatted value next to its label; in multi-metric mode values
|
|
234
|
+
* are per-row (not per-series) so this is ignored.
|
|
235
|
+
*/
|
|
236
|
+
legendValueFormatter?: (value: string | number) => string;
|
|
226
237
|
/**
|
|
227
238
|
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
228
239
|
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartTooltip, ChartConfig } from '../chart';
|
|
1
|
+
import { ChartTooltip, ChartConfig, ChartPalette } from '../chart';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
/** A node in the flow — `name` is its color/config key (CSS-safe, unique). */
|
|
4
4
|
export interface SankeyChartNode {
|
|
@@ -20,16 +20,21 @@ export interface SankeyChartLink {
|
|
|
20
20
|
color?: string;
|
|
21
21
|
}
|
|
22
22
|
export interface SankeyChartProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
23
|
+
/**
|
|
24
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
25
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
26
|
+
*/
|
|
27
|
+
palette?: ChartPalette;
|
|
23
28
|
/** The graph: `nodes` (color keys) + `links` (source/target indices + value). */
|
|
24
29
|
data: {
|
|
25
30
|
nodes: ReadonlyArray<SankeyChartNode>;
|
|
26
31
|
links: ReadonlyArray<SankeyChartLink>;
|
|
27
32
|
};
|
|
28
33
|
/**
|
|
29
|
-
* Per-node map of `label` / `
|
|
30
|
-
* the shared `Chart` primitives). Turned into `--color-<name>`
|
|
31
|
-
* properties.
|
|
32
|
-
*
|
|
34
|
+
* Per-node map of `label` / `icon` / `tone`, keyed by the node's `name`
|
|
35
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
36
|
+
* custom properties. Series take their colour from the container's `palette`;
|
|
37
|
+
* each entry maps a key to a `label` and an optional `tone`.
|
|
33
38
|
*/
|
|
34
39
|
config: ChartConfig;
|
|
35
40
|
/** Vertical gap between nodes in the same column. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartConfig, CartesianChartProps, ChartAnimationProps } from '../chart';
|
|
1
|
+
import { ChartConfig, ChartPalette, CartesianChartProps, ChartAnimationProps } from '../chart';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export type ScatterMarkerShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
|
|
4
4
|
export interface ScatterSeries {
|
|
@@ -8,13 +8,18 @@ export interface ScatterSeries {
|
|
|
8
8
|
data: ReadonlyArray<Record<string, number>>;
|
|
9
9
|
}
|
|
10
10
|
export interface ScatterChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps, ChartAnimationProps {
|
|
11
|
+
/**
|
|
12
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
13
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
14
|
+
*/
|
|
15
|
+
palette?: ChartPalette;
|
|
11
16
|
/** One `<Scatter>` per entry — each with its own point array. Use a single entry for an ungrouped scatter. */
|
|
12
17
|
series: ScatterSeries[];
|
|
13
18
|
/**
|
|
14
|
-
* Per-series map of `label` / `
|
|
15
|
-
* the shared `Chart` primitives). Turned into `--color-<key>`
|
|
16
|
-
* properties.
|
|
17
|
-
*
|
|
19
|
+
* Per-series map of `label` / `icon` / `tone`, keyed by `series[].key`
|
|
20
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<key>`
|
|
21
|
+
* custom properties. Series take their colour from the container's `palette`;
|
|
22
|
+
* each entry maps a key to a `label` and an optional `tone`.
|
|
18
23
|
*/
|
|
19
24
|
config: ChartConfig;
|
|
20
25
|
/** Numeric field for the horizontal axis. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Section, SectionHeader,
|
|
1
|
+
export { Section, SectionHeader, SectionContent, sectionVariants, useSectionContext, type SectionVariant, type SectionProps, type SectionHeaderProps, type SectionContentProps, } from './section';
|
|
@@ -1,7 +1,76 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
declare const sectionVariants: (props?: ({
|
|
5
|
+
variant?: "table" | "column1" | "column2-70-30" | "grid3" | null | undefined;
|
|
6
|
+
hasBottomBorder?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
type SectionVariant = NonNullable<VariantProps<typeof sectionVariants>['variant']>;
|
|
9
|
+
interface SectionContextValue {
|
|
10
|
+
variant: SectionVariant;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reads the content layout of the nearest `Section` ancestor. Falls back to
|
|
14
|
+
* `column1` for a part rendered outside a `Section`.
|
|
15
|
+
*/
|
|
16
|
+
declare const useSectionContext: () => SectionContextValue;
|
|
17
|
+
export interface SectionProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof sectionVariants> {
|
|
18
|
+
/**
|
|
19
|
+
* Replace the rendered `<section>` with another element or component (Base UI
|
|
20
|
+
* composition).
|
|
21
|
+
*/
|
|
22
|
+
render?: useRender.RenderProp;
|
|
23
|
+
}
|
|
24
|
+
declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>>;
|
|
25
|
+
export interface SectionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
26
|
+
/** The section's title. Renders nothing when omitted. */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** Helper text shown under the title; only rendered when `hasDescription`. */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Shows `description` below the title. */
|
|
31
|
+
hasDescription?: boolean;
|
|
32
|
+
/** Shows a toggle switch at the start of the header. */
|
|
33
|
+
isSwitchable?: boolean;
|
|
34
|
+
/** Controlled checked state of the header switch. */
|
|
35
|
+
switchChecked?: boolean;
|
|
36
|
+
/** Uncontrolled initial checked state of the header switch. */
|
|
37
|
+
defaultSwitchChecked?: boolean;
|
|
38
|
+
/** Fires when the header switch is toggled. */
|
|
39
|
+
onSwitchCheckedChange?: (checked: boolean) => void;
|
|
40
|
+
/** Disables the header switch. */
|
|
41
|
+
switchDisabled?: boolean;
|
|
42
|
+
/** Accessible label for the header switch. */
|
|
43
|
+
switchLabel?: string;
|
|
44
|
+
/** Extra content rendered inline next to the title (e.g. a tag or badge). */
|
|
45
|
+
extras?: React.ReactNode;
|
|
46
|
+
/** Actions rendered at the end of the header (e.g. a button). */
|
|
47
|
+
actions?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Shows a disclosure trigger at the end of the header. Only has an effect
|
|
50
|
+
* when this header renders inside a collapsible `AccordionContainer` —
|
|
51
|
+
* see the collapsible composition example.
|
|
52
|
+
*/
|
|
53
|
+
isCollapsible?: boolean;
|
|
54
|
+
/** Accessible label for the collapse trigger. */
|
|
55
|
+
collapseLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Replace the rendered `<div>` with another element or component (Base UI
|
|
58
|
+
* composition).
|
|
59
|
+
*/
|
|
60
|
+
render?: useRender.RenderProp;
|
|
61
|
+
}
|
|
62
|
+
declare const SectionHeader: React.ForwardRefExoticComponent<SectionHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
export interface SectionContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
/**
|
|
65
|
+
* The narrow (~30%) second column of the `column2-70-30` layout. Ignored by
|
|
66
|
+
* every other variant, which has only one content area.
|
|
67
|
+
*/
|
|
68
|
+
secondaryContent?: React.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Replace the rendered `<div>` with another element or component (Base UI
|
|
71
|
+
* composition).
|
|
72
|
+
*/
|
|
73
|
+
render?: useRender.RenderProp;
|
|
74
|
+
}
|
|
75
|
+
declare const SectionContent: React.ForwardRefExoticComponent<SectionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export { Section, SectionHeader, SectionContent, sectionVariants, useSectionContext, type SectionVariant, };
|
|
@@ -2,8 +2,8 @@ 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 stepperItemVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
6
|
-
state?: "active" | "hover" | "idle" | null | undefined;
|
|
5
|
+
variant?: "completed" | "current" | "future" | null | undefined;
|
|
6
|
+
state?: "focus" | "active" | "hover" | "idle" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
/** Kept in lockstep with the `cva` axes above. */
|
|
9
9
|
export type StepperItemVariant = NonNullable<VariantProps<typeof stepperItemVariants>['variant']>;
|
|
@@ -17,9 +17,10 @@ export interface StepperItemProps extends React.ComponentPropsWithoutRef<'div'>
|
|
|
17
17
|
variant?: StepperItemVariant;
|
|
18
18
|
/**
|
|
19
19
|
* Interaction state. Only produces a different look when `variant` is
|
|
20
|
-
* `completed`
|
|
21
|
-
*
|
|
22
|
-
* `
|
|
20
|
+
* `completed` — each of `idle`, `hover`, `active`, and `focus` is wired to its
|
|
21
|
+
* own token, so a brand can style any of them independently. Ignored for
|
|
22
|
+
* `current`, which always renders in its highlighted look, and for `future`,
|
|
23
|
+
* which always renders disabled and non-interactive.
|
|
23
24
|
*/
|
|
24
25
|
state?: StepperItemState;
|
|
25
26
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const tagVariants: (props?: ({
|
|
4
|
-
variant?: "info" | "success" | "warning" | "critical" | "danger" | "
|
|
4
|
+
variant?: "info" | "success" | "warning" | "critical" | "danger" | "neutral" | "ai" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface TagProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof tagVariants> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartTooltip, ChartConfig, ChartAnimationProps, TickFormatter } from '../chart';
|
|
1
|
+
import { ChartTooltip, ChartConfig, ChartPalette, ChartAnimationProps, TickFormatter } from '../chart';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Where a cell's label block sits inside its rectangle. Named logically, not
|
|
@@ -33,6 +33,11 @@ interface TreemapCellProps {
|
|
|
33
33
|
}
|
|
34
34
|
export declare function TreemapCell({ x, y, width, height, name, primaryLabel, secondaryLabel, showLabels, labelAlign, }: TreemapCellProps): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
export interface TreemapProps extends Omit<React.ComponentProps<'div'>, 'children'>, ChartAnimationProps {
|
|
36
|
+
/**
|
|
37
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
38
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
39
|
+
*/
|
|
40
|
+
palette?: ChartPalette;
|
|
36
41
|
/**
|
|
37
42
|
* Row-per-leaf data. Each object holds the leaf's `nameKey` label + its
|
|
38
43
|
* `dataKey` numeric size.
|
|
@@ -45,10 +50,11 @@ export interface TreemapProps extends Omit<React.ComponentProps<'div'>, 'childre
|
|
|
45
50
|
*/
|
|
46
51
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
47
52
|
/**
|
|
48
|
-
* Per-leaf map of `label` / `
|
|
49
|
-
* (imported from the shared `Chart` primitives). Turned into
|
|
50
|
-
* custom properties.
|
|
51
|
-
*
|
|
53
|
+
* Per-leaf map of `label` / `icon` / `tone`, keyed by the leaf's `nameKey`
|
|
54
|
+
* value (imported from the shared `Chart` primitives). Turned into
|
|
55
|
+
* `--color-<name>` custom properties. Series take their colour from the
|
|
56
|
+
* container's `palette`; each entry maps a key to a `label` and an optional
|
|
57
|
+
* `tone`.
|
|
52
58
|
*/
|
|
53
59
|
config: ChartConfig;
|
|
54
60
|
/** Numeric field that sizes each leaf's rectangle. */
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const trendIndicatorVariants: (props?: ({
|
|
4
|
-
sentiment?: "
|
|
5
|
-
size?: "small" | "medium" | null | undefined;
|
|
6
|
-
variant?: "inline" | "badge" | null | undefined;
|
|
4
|
+
sentiment?: "neutral" | "positive" | "negative" | null | undefined;
|
|
7
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
6
|
export interface TrendIndicatorProps extends Omit<React.ComponentProps<'span'>, 'children'>, VariantProps<typeof trendIndicatorVariants> {
|
|
9
7
|
/** What changed mathematically — selects the direction glyph. */
|
|
10
8
|
direction: 'up' | 'down' | 'flat';
|
|
11
9
|
/**
|
|
12
10
|
* Already-formatted change to display — e.g. `"12%"`, `"3.5 h"`,
|
|
13
|
-
* `"Improving"
|
|
11
|
+
* `"Improving"`. The kit does not format or compute it.
|
|
14
12
|
*/
|
|
15
13
|
value?: React.ReactNode;
|
|
16
|
-
/** Secondary comparison caption — e.g. `"vs previous quarter"`, `"YoY"`. */
|
|
17
|
-
comparisonLabel?: React.ReactNode;
|
|
18
14
|
/** Contextual hint shown on hover/focus (Base UI Tooltip). */
|
|
19
15
|
tooltip?: React.ReactNode;
|
|
20
16
|
/** Show the leading direction glyph. Defaults to `true` — color alone isn't enough. */
|
|
@@ -24,7 +20,7 @@ export interface TrendIndicatorProps extends Omit<React.ComponentProps<'span'>,
|
|
|
24
20
|
* compared with the previous quarter"). Applied as the element's label via
|
|
25
21
|
* `role="img"`, since the kit can't build a correct, localized sentence from
|
|
26
22
|
* `direction` + `value` alone. Without it, assistive tech reads the visible
|
|
27
|
-
* `value`
|
|
23
|
+
* `value` text (the glyph is decorative).
|
|
28
24
|
*/
|
|
29
25
|
ariaLabel?: string;
|
|
30
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Wizard, WizardHeader, WizardSubtitle, WizardBody } from './wizard';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Wizard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const WizardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const WizardSubtitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const WizardBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Wizard, WizardHeader, WizardSubtitle, WizardBody };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useSortState, type SortDirection, type SortState, type SortComparator, type UseSortStateOptions, type UseSortStateResult, } from './use-sort-state';
|
|
2
2
|
export { useIntersectionObserver, type UseIntersectionObserverOptions, } from './use-intersection-observer';
|
|
3
3
|
export { useTableUrlState, parseTableUrlState, serializeTableUrlState, DEFAULT_TABLE_URL_PARAM_KEYS, type TableUrlState, type TablePaginationState, type TableSortingState, type TableColumnFilterState, type TableUrlParamKeys, type TableUrlUpdater, type UseTableUrlStateOptions, type UseTableUrlStateResult, } from './use-table-url-state';
|
|
4
|
+
export { useWizard, type WizardStep, type WizardStepAvatarColor, type WizardStepVariant, type WizardStepState, type UseWizardOptions, type UseWizardResult, } from './use-wizard';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export interface WizardStep {
|
|
2
|
+
/** Stable identifier; `goToStep` and `initialStep` accept it as a string. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Step label, rendered by `StepperItem` and the `Stepper` summary. */
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export type WizardStepAvatarColor = 'blue' | 'green' | 'gray';
|
|
8
|
+
export type WizardStepVariant = 'completed' | 'current' | 'future';
|
|
9
|
+
/**
|
|
10
|
+
* A step enriched with everything a `StepperItem` needs. Intersects `TStep`, so
|
|
11
|
+
* any extra fields the consumer put on their own step objects survive.
|
|
12
|
+
*/
|
|
13
|
+
export type WizardStepState<TStep extends WizardStep = WizardStep> = TStep & {
|
|
14
|
+
/** Zero-based position in `steps`. */
|
|
15
|
+
index: number;
|
|
16
|
+
/** One-based position, for the avatar's displayed number. */
|
|
17
|
+
stepNumber: number;
|
|
18
|
+
/** `StepperItem`'s `variant`, derived from the position vs. `currentIndex`. */
|
|
19
|
+
variant: WizardStepVariant;
|
|
20
|
+
/** `Avatar`'s `color` for this step's variant. */
|
|
21
|
+
avatarColor: WizardStepAvatarColor;
|
|
22
|
+
/** Classes to merge onto this step's `Avatar`. */
|
|
23
|
+
avatarClassName: string;
|
|
24
|
+
};
|
|
25
|
+
export interface UseWizardOptions<TStep extends WizardStep = WizardStep> {
|
|
26
|
+
/** The flow's steps, in order. Must not be empty. */
|
|
27
|
+
steps: TStep[];
|
|
28
|
+
/**
|
|
29
|
+
* Where the flow starts — a zero-based index or a step `id`. A numeric
|
|
30
|
+
* index is truncated toward zero and clamped into range; `NaN` and an id
|
|
31
|
+
* that matches no step fall back to the first step. A seed, not a
|
|
32
|
+
* controlled input: later changes are ignored.
|
|
33
|
+
*/
|
|
34
|
+
initialStep?: number | string;
|
|
35
|
+
}
|
|
36
|
+
export interface UseWizardResult<TStep extends WizardStep = WizardStep> {
|
|
37
|
+
/** `steps` with per-step `variant`/avatar presentation derived. */
|
|
38
|
+
steps: WizardStepState<TStep>[];
|
|
39
|
+
/**
|
|
40
|
+
* Zero-based index of the active step. Always a valid index into `steps`:
|
|
41
|
+
* if `steps` shrinks so that the stored index is past the end, the
|
|
42
|
+
* effective index clamps to `steps.length - 1`.
|
|
43
|
+
*/
|
|
44
|
+
currentIndex: number;
|
|
45
|
+
/** One-based number of the active step, for `Stepper`'s `currentStep`. */
|
|
46
|
+
currentStepNumber: number;
|
|
47
|
+
/** Total number of steps, for `Stepper`'s `totalSteps`. */
|
|
48
|
+
stepCount: number;
|
|
49
|
+
/** The active step's label, for `Stepper`'s `current`. */
|
|
50
|
+
currentStepLabel: string;
|
|
51
|
+
/** The following step's label, or `undefined` on the last step. */
|
|
52
|
+
nextStepLabel: string | undefined;
|
|
53
|
+
isFirstStep: boolean;
|
|
54
|
+
isLastStep: boolean;
|
|
55
|
+
/** Advance one step; no-op on the last step (never wraps). */
|
|
56
|
+
goToNextStep: () => void;
|
|
57
|
+
/** Go back one step; no-op on the first step (never wraps). */
|
|
58
|
+
goToPreviousStep: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Jump to a zero-based index or a step `id`. A numeric index is truncated
|
|
61
|
+
* toward zero (`1.5` → `1`) and clamped into range; `NaN` is a no-op. An
|
|
62
|
+
* id that matches no step is a no-op; on duplicate ids the first wins.
|
|
63
|
+
*/
|
|
64
|
+
goToStep: (target: number | string) => void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Headless step state for a `Wizard`'s `Stepper` (the `Wizard` components
|
|
68
|
+
* themselves stay presentational and own no state). Returns the `Stepper`
|
|
69
|
+
* summary props plus a per-step `variant` + avatar presentation, and the
|
|
70
|
+
* navigation callbacks a consumer wires to its Back/Next buttons.
|
|
71
|
+
*
|
|
72
|
+
* Opt-in: a consumer that already owns its step state can keep driving
|
|
73
|
+
* `Stepper`/`StepperItem` by hand.
|
|
74
|
+
*
|
|
75
|
+
* `steps` may be a live, per-render value. The active index is stored as
|
|
76
|
+
* state but re-clamped against the *current* `steps.length` on every read,
|
|
77
|
+
* so a `steps` array that shrinks past the active index resolves to the last
|
|
78
|
+
* remaining step instead of reading past the end.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useWizard<TStep extends WizardStep = WizardStep>({ steps, initialStep, }: UseWizardOptions<TStep>): UseWizardResult<TStep>;
|