@acronis-platform/ui-react 0.57.1 → 0.60.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 +177 -0
- package/dist/components/ui/area-chart/area-chart.js.map +1 -0
- package/dist/components/ui/bar-chart/bar-chart.js +184 -78
- 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/calendar/calendar.js +17 -15
- package/dist/components/ui/calendar/calendar.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/carousel-dialog/carousel-dialog.js +87 -0
- package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +126 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -0
- package/dist/components/ui/chart/chart-format.js +40 -0
- package/dist/components/ui/chart/chart-format.js.map +1 -0
- package/dist/components/ui/chart/chart.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 +135 -0
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js +223 -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 +248 -76
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +26 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -0
- package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
- package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
- package/dist/components/ui/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 +136 -0
- package/dist/components/ui/histogram/histogram.js.map +1 -0
- package/dist/components/ui/input/input.js.map +1 -1
- 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 +234 -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/sankey-chart/sankey-chart.js +192 -0
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +130 -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/toolbar/toolbar.js +82 -92
- package/dist/components/ui/toolbar/toolbar.js.map +1 -1
- 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 +461 -400
- package/dist/index.js.map +1 -1
- package/dist/lib/breakpoints.js +9 -6
- package/dist/lib/breakpoints.js.map +1 -1
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
- package/dist/react.js +461 -400
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +34 -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 +30 -5
- 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/carousel-dialog/carousel-dialog.d.ts +28 -0
- package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
- package/dist/src/components/ui/category-bar/index.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +111 -0
- package/dist/src/components/ui/chart/chart.d.ts +2 -0
- package/dist/src/components/ui/chart/index.d.ts +3 -1
- 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 +33 -0
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +62 -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-carousel/dialog-footer-carousel.d.ts +9 -0
- package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
- package/dist/src/components/ui/dialog-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/dialog-welcome/dialog-welcome.d.ts +54 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
- package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
- package/dist/src/components/ui/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 +40 -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 +68 -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/sankey-chart/index.d.ts +2 -0
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
- package/dist/src/components/ui/scatter-chart/index.d.ts +1 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +35 -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 +27 -2
- package/dist/ui-react.css +1 -1
- package/package.json +5 -4
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartConfig, CartesianChartProps } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const areaChartVariants: (props?: ({
|
|
5
|
+
layout?: "single" | "stacked" | null | undefined;
|
|
6
|
+
fill?: "solid" | "gradient" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface AreaChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof areaChartVariants>, CartesianChartProps {
|
|
9
|
+
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */
|
|
10
|
+
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
11
|
+
/**
|
|
12
|
+
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
13
|
+
* primitives). Series colors are caller-supplied — reference an existing
|
|
14
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
15
|
+
*/
|
|
16
|
+
config: ChartConfig;
|
|
17
|
+
/** Series to plot — one `<Area>` per key. Each must exist in `config` and in every data row. */
|
|
18
|
+
dataKeys: string[];
|
|
19
|
+
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
20
|
+
xKey: string;
|
|
21
|
+
/** Interpolation between points. */
|
|
22
|
+
curve?: 'linear' | 'monotone' | 'step';
|
|
23
|
+
/** Stroke width of each area's top border. */
|
|
24
|
+
strokeWidth?: number;
|
|
25
|
+
/** Flat-fill opacity — used only when `fill="solid"` (gradient controls its own stops). */
|
|
26
|
+
fillOpacity?: number;
|
|
27
|
+
/** Render a dot at each data point. */
|
|
28
|
+
showDots?: boolean;
|
|
29
|
+
/** Bridge `null` gaps in the data instead of breaking the area. */
|
|
30
|
+
connectNulls?: boolean;
|
|
31
|
+
showLegend?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const AreaChart: React.ForwardRefExoticComponent<Omit<AreaChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export { AreaChart, areaChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AreaChart, areaChartVariants, type AreaChartProps } from './area-chart';
|
|
@@ -2,7 +2,7 @@ import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const avatarVariants: (props?: ({
|
|
5
|
-
color?: "
|
|
5
|
+
color?: "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
8
8
|
}
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartConfig } from '../chart';
|
|
2
|
+
import { ChartConfig, CartesianChartProps } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const barChartVariants: (props?: ({
|
|
5
5
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
-
layout?: "
|
|
6
|
+
layout?: "stacked" | "grouped" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
export interface
|
|
8
|
+
export interface BarChartReferenceLine {
|
|
9
|
+
/** Fixed position on the value axis. Takes precedence over `average`. */
|
|
10
|
+
value?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Draw the line at the mean of one series (a `dataKeys` entry) or, when
|
|
13
|
+
* `true`, of every plotted series' values.
|
|
14
|
+
*/
|
|
15
|
+
average?: boolean | string;
|
|
16
|
+
/** Optional caption rendered alongside the line. */
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolve a `referenceLine` config to a position on the value axis: a fixed
|
|
21
|
+
* `value` wins; otherwise the mean of the requested series (a single `dataKeys`
|
|
22
|
+
* entry, or all of them when `average` is `true`). Returns `undefined` when
|
|
23
|
+
* there is nothing to draw (no config, or no numeric values to average).
|
|
24
|
+
* Exported for unit tests; not part of the package's public API.
|
|
25
|
+
*/
|
|
26
|
+
export declare function barChartReferenceValue(referenceLine: BarChartReferenceLine | undefined, data: ReadonlyArray<Record<string, string | number>>, dataKeys: string[]): number | undefined;
|
|
27
|
+
export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof barChartVariants>, CartesianChartProps {
|
|
9
28
|
/** Row-per-category data. Each object holds the category key + one numeric field per series. */
|
|
10
29
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
11
30
|
/**
|
|
@@ -18,10 +37,16 @@ export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'childr
|
|
|
18
37
|
dataKeys: string[];
|
|
19
38
|
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
20
39
|
xKey: string;
|
|
40
|
+
/**
|
|
41
|
+
* One or more dashed reference/average lines on the value axis (Y for vertical
|
|
42
|
+
* bars, X for horizontal). Each is driven by a fixed `value` or a computed
|
|
43
|
+
* series `average`. Pass a single object or an array to draw several at once.
|
|
44
|
+
*/
|
|
45
|
+
referenceLine?: BarChartReferenceLine | BarChartReferenceLine[];
|
|
46
|
+
/** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation="horizontal"`). */
|
|
47
|
+
xUnit?: string;
|
|
21
48
|
/** Corner radius applied to the growing end of each bar. */
|
|
22
49
|
barRadius?: number;
|
|
23
|
-
showGrid?: boolean;
|
|
24
|
-
showTooltip?: boolean;
|
|
25
50
|
showLegend?: boolean;
|
|
26
51
|
}
|
|
27
52
|
declare const BarChart: React.ForwardRefExoticComponent<Omit<BarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BarChart, barChartVariants, type BarChartProps } from './bar-chart';
|
|
1
|
+
export { BarChart, barChartVariants, type BarChartProps, type BarChartReferenceLine, } from './bar-chart';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const buttonIconInputVariants: (props?: ({
|
|
5
|
+
variant?: "error" | "normal" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonIconInputProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonIconInputVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* Replace the rendered `<button>` with another element or component
|
|
10
|
+
* (Base UI composition). Accepts a React element or a render function —
|
|
11
|
+
* the component's props and class names are merged onto it.
|
|
12
|
+
*/
|
|
13
|
+
render?: useRender.RenderProp;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Small icon-only button meant to sit inside an input's box. The icon is
|
|
17
|
+
* passed as `children`; provide an `aria-label` (or `aria-labelledby`) so the
|
|
18
|
+
* control has an accessible name.
|
|
19
|
+
*/
|
|
20
|
+
declare const ButtonIconInput: React.ForwardRefExoticComponent<ButtonIconInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export { ButtonIconInput, buttonIconInputVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonIconInput, buttonIconInputVariants, type ButtonIconInputProps, } from './button-icon-input';
|
|
@@ -11,6 +11,11 @@ export interface CardFilterProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
11
11
|
value?: React.ReactNode;
|
|
12
12
|
/** Optional leading icon (16px) rendered before the value. Hidden for `static-empty`. */
|
|
13
13
|
icon?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* `clickable` only — applies the selected (active) styling and exposes the
|
|
16
|
+
* card as a pressed toggle (`aria-pressed`). Controlled only.
|
|
17
|
+
*/
|
|
18
|
+
selected?: boolean;
|
|
14
19
|
/**
|
|
15
20
|
* Replace the rendered element (`<button>` for `clickable`, otherwise `<div>`)
|
|
16
21
|
* with another element or component (Base UI composition) — e.g. a router link
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CarouselDialogVariant = 'first' | 'middle' | 'last';
|
|
3
|
+
export interface CarouselDialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Which slide position this renders for. Defaults to `'first'`. */
|
|
5
|
+
variant?: CarouselDialogVariant;
|
|
6
|
+
/** Total number of slides, used to render the dot `ListIndicator`. Defaults to `1`. */
|
|
7
|
+
slideCount?: number;
|
|
8
|
+
/** The currently active slide index (0-based). Defaults to `0`. */
|
|
9
|
+
selectedIndex?: number;
|
|
10
|
+
/** Fires when a dot is activated, with the dot's slide index. */
|
|
11
|
+
onSelectIndex?: (index: number) => void;
|
|
12
|
+
/** Fires when `Back` (hidden on `variant="first"`) is activated. */
|
|
13
|
+
onBack?: () => void;
|
|
14
|
+
/** Fires when `Next` (`variant="first" | "middle"`) is activated. */
|
|
15
|
+
onNext?: () => void;
|
|
16
|
+
/** Fires when the call-to-action button (`variant="last"`) is activated. */
|
|
17
|
+
onPrimaryAction?: () => void;
|
|
18
|
+
/** `Back` button label. Defaults to `'Back'`. */
|
|
19
|
+
backLabel?: string;
|
|
20
|
+
/** `Next` button label (`variant="first" | "middle"`). Defaults to `'Next'`. */
|
|
21
|
+
nextLabel?: string;
|
|
22
|
+
/** Call-to-action button label (`variant="last"`). Defaults to `'Call to action'`. */
|
|
23
|
+
primaryLabel?: string;
|
|
24
|
+
/** Builds each dot's accessible name from its 0-based index and the slide count. */
|
|
25
|
+
goToSlideLabel?: (index: number, count: number) => string;
|
|
26
|
+
}
|
|
27
|
+
declare const CarouselDialog: React.ForwardRefExoticComponent<CarouselDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { CarouselDialog };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarouselDialog, type CarouselDialogProps, type CarouselDialogVariant, } from './carousel-dialog';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const categoryBarVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface CategoryBarSegment {
|
|
8
|
+
/** Key into `config` for this segment's label + color. */
|
|
9
|
+
key: string;
|
|
10
|
+
/** The segment's value — its width is this over the sum of all values. */
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
/** The resolved segment passed to a custom `tooltipContent` renderer. */
|
|
14
|
+
export interface CategoryBarTooltipContext extends CategoryBarSegment {
|
|
15
|
+
/** Resolved `config` label (falls back to the key); may be any `ReactNode`. */
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
/** Share of the total as a rounded percentage (0–100). */
|
|
18
|
+
percent: number;
|
|
19
|
+
/**
|
|
20
|
+
* CSS color reference for the segment — the `var(--color-<key>)` bridge, which
|
|
21
|
+
* resolves the config entry's `color` or its per-theme `theme` value. Usable
|
|
22
|
+
* anywhere a CSS color is (e.g. a `style` background); not a literal value.
|
|
23
|
+
*/
|
|
24
|
+
color: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CategoryBarProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof categoryBarVariants> {
|
|
27
|
+
/** Ordered segments (left → right). Widths are proportional to `value`. */
|
|
28
|
+
data: ReadonlyArray<CategoryBarSegment>;
|
|
29
|
+
/** Maps each segment `key` to a `label` and `color` (an existing `--ui-*` token). */
|
|
30
|
+
config: ChartConfig;
|
|
31
|
+
/** Show the legend below the bar (color dot + label + value + %). */
|
|
32
|
+
showLegend?: boolean;
|
|
33
|
+
/** Show a hover tooltip per segment (dot + label + value + %). */
|
|
34
|
+
showTooltip?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Custom tooltip content per segment — replaces the default (dot + label +
|
|
37
|
+
* `value · %`) inside the same card. Ignored when `showTooltip` is false.
|
|
38
|
+
*/
|
|
39
|
+
tooltipContent?: (segment: CategoryBarTooltipContext) => React.ReactNode;
|
|
40
|
+
/** Format the numeric value (legend + tooltip). Defaults to `toLocaleString()`. */
|
|
41
|
+
valueFormatter?: (value: number) => string;
|
|
42
|
+
/** Render the tooltip for this segment index initially open (VR/testing). */
|
|
43
|
+
defaultOpenIndex?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible summary of the whole bar. Defaults to a `label value` list built
|
|
46
|
+
* from the data; pass a fuller sentence for screen readers if you have one.
|
|
47
|
+
*/
|
|
48
|
+
'aria-label'?: string;
|
|
49
|
+
}
|
|
50
|
+
declare const CategoryBar: React.ForwardRefExoticComponent<Omit<CategoryBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export { CategoryBar, categoryBarVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CategoryBar, categoryBarVariants, type CategoryBarProps, type CategoryBarSegment, type CategoryBarTooltipContext, } from './category-bar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { AxisDomainItem } from 'recharts';
|
|
2
|
+
import { ChartTooltipContentType } from './chart';
|
|
3
|
+
/** A recharts-compatible tick formatter: `(value, index) => label`. */
|
|
4
|
+
export type TickFormatter = (value: number | string, index?: number) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Props shared by every cartesian chart (Bar, Line, Area, Composed, Scatter,
|
|
7
|
+
* ConfidenceCone, Histogram) — chrome toggles, axis titles/units, tick
|
|
8
|
+
* formatting/visibility, and grid trim. All optional. `showLegend` and `xUnit`
|
|
9
|
+
* are deliberately *not* here: `showLegend` doesn't apply to `Histogram` and
|
|
10
|
+
* `xUnit` only to charts with a numeric X axis, so they stay per-component.
|
|
11
|
+
*/
|
|
12
|
+
export interface CartesianChartProps {
|
|
13
|
+
/** Render the CartesianGrid. Defaults to `true`. */
|
|
14
|
+
showGrid?: boolean;
|
|
15
|
+
/** Render the hover tooltip. Defaults to `true`. */
|
|
16
|
+
showTooltip?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent` (from
|
|
19
|
+
* this library) — e.g. with a `formatter` / `labelFormatter` — to customize it
|
|
20
|
+
* without composing recharts yourself. Ignored when `showTooltip` is false.
|
|
21
|
+
*/
|
|
22
|
+
tooltipContent?: ChartTooltipContentType;
|
|
23
|
+
/** Title rendered beneath the X axis. */
|
|
24
|
+
xAxisLabel?: string;
|
|
25
|
+
/** Title rendered beside the Y axis (rotated). */
|
|
26
|
+
yAxisLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Unit suffix appended to the Y axis's tick values (recharts `unit`) — applies
|
|
29
|
+
* when the Y axis is the numeric one. `BarChart` with
|
|
30
|
+
* `orientation="horizontal"` puts the values on X instead; use `xUnit` there.
|
|
31
|
+
*/
|
|
32
|
+
yUnit?: string;
|
|
33
|
+
/** Show the X axis (its ticks + title). Defaults to `true`. */
|
|
34
|
+
showXAxis?: boolean;
|
|
35
|
+
/** Show the Y axis (its ticks + title). Defaults to `true`. */
|
|
36
|
+
showYAxis?: boolean;
|
|
37
|
+
/** Format each X-axis tick value — e.g. `formatCompactNumber` or a `createTickFormatter(...)`. */
|
|
38
|
+
xTickFormatter?: TickFormatter;
|
|
39
|
+
/** Format each Y-axis tick value — e.g. `formatCompactNumber` or a `createTickFormatter(...)`. */
|
|
40
|
+
yTickFormatter?: TickFormatter;
|
|
41
|
+
/**
|
|
42
|
+
* Rotate the X-axis tick labels by this many degrees. A negative angle (e.g.
|
|
43
|
+
* `-45`) tilts them up toward the right; the tick anchor + axis height adjust
|
|
44
|
+
* to keep long labels readable.
|
|
45
|
+
*/
|
|
46
|
+
xAxisAngle?: number;
|
|
47
|
+
/**
|
|
48
|
+
* X-axis tick density — a recharts placement strategy, or a fixed number of
|
|
49
|
+
* ticks to *skip* between two rendered ones (recharts `interval`: `0` shows
|
|
50
|
+
* every tick, `1` every other one, `2` every third, …).
|
|
51
|
+
*/
|
|
52
|
+
xAxisInterval?: number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart';
|
|
53
|
+
/**
|
|
54
|
+
* Desired number of ticks on the value axis (recharts `tickCount`; a hint, not
|
|
55
|
+
* exact). Applies to whichever axis holds the values — Y for most charts, X for
|
|
56
|
+
* `BarChart` with `orientation="horizontal"`.
|
|
57
|
+
*/
|
|
58
|
+
yAxisTickCount?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Value-axis domain preset. Applies to whichever axis holds the values — Y for
|
|
61
|
+
* most charts, X for `BarChart` with `orientation="horizontal"`.
|
|
62
|
+
*
|
|
63
|
+
* - `auto` — fit the data at both ends; the axis need not include 0.
|
|
64
|
+
* - `zero` — anchor the axis at 0. This is also recharts' behavior when the
|
|
65
|
+
* prop is omitted, so it's the explicit form of the default.
|
|
66
|
+
* - `dataMin-dataMax` — tight to the data, with no padding.
|
|
67
|
+
*/
|
|
68
|
+
yAxisDomain?: 'auto' | 'dataMin-dataMax' | 'zero';
|
|
69
|
+
/** Draw grid lines dashed instead of solid. */
|
|
70
|
+
gridDashed?: boolean;
|
|
71
|
+
/** Show horizontal grid lines. Defaults to each chart's own default when unset. */
|
|
72
|
+
gridHorizontal?: boolean;
|
|
73
|
+
/** Show vertical grid lines. Defaults to each chart's own default when unset. */
|
|
74
|
+
gridVertical?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Map a `yAxisDomain` preset to a recharts `domain`. Shared by all 7 cartesian
|
|
78
|
+
* charts, and applied to whichever axis holds the values (X for horizontal bars).
|
|
79
|
+
*
|
|
80
|
+
* `undefined` (no preset) is left to recharts, whose default is `[0, 'auto']` —
|
|
81
|
+
* i.e. already zero-anchored. That's why `auto` has to be spelled out as
|
|
82
|
+
* `['auto', 'auto']`: passing `undefined` for it would silently anchor at 0 and
|
|
83
|
+
* make the preset indistinguishable from `zero`.
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveAxisDomain(preset: 'auto' | 'dataMin-dataMax' | 'zero' | undefined): Readonly<[AxisDomainItem, AxisDomainItem]> | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Compact thousands/millions: `1234 → "1.2K"`, `1_500_000 → "1.5M"`. Non-numeric
|
|
88
|
+
* values (including blank strings) pass through unchanged. Use for large-count
|
|
89
|
+
* axes (revenue, users, …).
|
|
90
|
+
*
|
|
91
|
+
* Formats in `en`. For another locale use
|
|
92
|
+
* `createTickFormatter({ notation: 'compact', maximumFractionDigits: 1 }, locale)`.
|
|
93
|
+
*/
|
|
94
|
+
export declare const formatCompactNumber: TickFormatter;
|
|
95
|
+
/**
|
|
96
|
+
* Append a percent sign to an already-scaled value: `41.8 → "41.8%"`. (The value
|
|
97
|
+
* is treated as a percentage, not a 0–1 fraction.) Non-numeric values (including
|
|
98
|
+
* blank strings) pass through.
|
|
99
|
+
*
|
|
100
|
+
* Appends a bare `%`, which is not how every locale writes it. For locale-correct
|
|
101
|
+
* output on values that really are fractions, use
|
|
102
|
+
* `createTickFormatter({ style: 'percent' }, locale)`.
|
|
103
|
+
*/
|
|
104
|
+
export declare const formatPercent: TickFormatter;
|
|
105
|
+
/**
|
|
106
|
+
* Build a tick formatter from `Intl.NumberFormat` options — the escape hatch for
|
|
107
|
+
* currency, fixed decimals, or a specific locale. E.g.
|
|
108
|
+
* `createTickFormatter({ style: 'currency', currency: 'USD', notation: 'compact' })`
|
|
109
|
+
* → `146500 → "$147K"`. Non-numeric values pass through unchanged.
|
|
110
|
+
*/
|
|
111
|
+
export declare function createTickFormatter(options: Intl.NumberFormatOptions, locale?: string): TickFormatter;
|
|
@@ -49,6 +49,8 @@ declare const ChartStyle: ({ id, config }: {
|
|
|
49
49
|
config: ChartConfig;
|
|
50
50
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
51
51
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
52
|
+
/** The `content` a caller passes to override the default tooltip (recharts' `Tooltip['content']`). */
|
|
53
|
+
export type ChartTooltipContentType = React.ComponentProps<typeof ChartTooltip>['content'];
|
|
52
54
|
declare function ChartTooltipContent({ active, payload, label, className, indicator, hideLabel, hideIndicator, labelFormatter, formatter, labelClassName, color, nameKey, labelKey, }: ChartTooltipContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
53
55
|
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
54
56
|
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: ChartLegendContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, } from './chart';
|
|
2
|
-
export type { ChartConfig, ChartContainerProps, ChartTooltipContentProps, ChartLegendContentProps, } from './chart';
|
|
2
|
+
export type { ChartConfig, ChartContainerProps, ChartTooltipContentProps, ChartLegendContentProps, ChartTooltipContentType, } from './chart';
|
|
3
|
+
export { formatCompactNumber, formatPercent, createTickFormatter, resolveAxisDomain, } from './chart-format';
|
|
4
|
+
export type { TickFormatter, CartesianChartProps } from './chart-format';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ChartStateProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
3
|
+
/** Which placeholder to show. Drives the leading glyph and default label. */
|
|
4
|
+
state: 'loading' | 'empty' | 'error';
|
|
5
|
+
/** Overrides the default label for the current `state`. */
|
|
6
|
+
message?: string;
|
|
7
|
+
/** Trailing action (e.g. a "Try again" button) — shown for `error` only. */
|
|
8
|
+
action?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const ChartState: React.ForwardRefExoticComponent<ChartStateProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { ChartState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChartState, type ChartStateProps } from './chart-state';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChartConfig, CartesianChartProps } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type ComposedSeriesType = 'bar' | 'line' | 'area';
|
|
4
|
+
export interface ComposedSeries {
|
|
5
|
+
/** Column key to plot — must match a `config` entry; drives its `--color-<key>` paint. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** How this series renders. */
|
|
8
|
+
type: ComposedSeriesType;
|
|
9
|
+
}
|
|
10
|
+
export interface ComposedChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps {
|
|
11
|
+
/** Row-per-category data. Each object holds `xKey` + one numeric field per series. */
|
|
12
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
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
|
+
/** Series to plot, each `{ key, type }` — one bar/line/area per entry. Each key must exist in `config` and every data row. */
|
|
21
|
+
series: ComposedSeries[];
|
|
22
|
+
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
23
|
+
xKey: string;
|
|
24
|
+
/** Interpolation for the line and area series. */
|
|
25
|
+
curve?: 'linear' | 'monotone' | 'step';
|
|
26
|
+
/** Corner radius on the growing end of bar series. */
|
|
27
|
+
barRadius?: number;
|
|
28
|
+
/** Flat-fill opacity for area series. */
|
|
29
|
+
fillOpacity?: number;
|
|
30
|
+
showLegend?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const ComposedChart: React.ForwardRefExoticComponent<Omit<ComposedChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export { ComposedChart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComposedChart, type ComposedChartProps, type ComposedSeries, type ComposedSeriesType, } from './composed-chart';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ChartTooltip, ChartConfig, CartesianChartProps } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Drop the synthetic cone-band range series from a recharts tooltip/legend
|
|
5
|
+
* payload, keeping the real actual/forecast series (and their order). Applied to
|
|
6
|
+
* both the default tooltip and any caller-supplied `tooltipContent`, so the
|
|
7
|
+
* `__cone` band never surfaces regardless of which path renders.
|
|
8
|
+
*/
|
|
9
|
+
export declare function dropConeBand<T extends {
|
|
10
|
+
dataKey?: unknown;
|
|
11
|
+
}>(payload: readonly T[] | undefined): T[] | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Wrap a caller-supplied `tooltipContent` so the synthetic cone band is stripped
|
|
14
|
+
* from the payload before it renders, while preserving recharts' own mount
|
|
15
|
+
* semantics — a function is mounted via `createElement` (its own component
|
|
16
|
+
* identity + hook state), an element via `cloneElement`. This mirrors what the
|
|
17
|
+
* pass-through charts get by handing `content` straight to recharts, so a
|
|
18
|
+
* function-form tooltip keeps its state across re-renders here too. The returned
|
|
19
|
+
* component is a stable content type (memoize it on `tooltipContent`).
|
|
20
|
+
*/
|
|
21
|
+
type TooltipContentType = NonNullable<React.ComponentProps<typeof ChartTooltip>['content']>;
|
|
22
|
+
type TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;
|
|
23
|
+
type TooltipRenderProps = Parameters<TooltipContentFn>[0];
|
|
24
|
+
export declare function createConeTooltip(tooltipContent: TooltipContentType): (props: TooltipRenderProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.FunctionComponentElement<import('recharts').TooltipContentProps<import('recharts').TooltipValueType, import('recharts/types/component/DefaultTooltipContent').NameType>>;
|
|
25
|
+
export interface ConfidenceConeProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps {
|
|
26
|
+
/**
|
|
27
|
+
* Row-per-point data — the shared x dimension plus the actual / forecast /
|
|
28
|
+
* bound fields. Rows are naturally sparse (a point has either an actual or a
|
|
29
|
+
* forecast + bounds), so missing fields are allowed. Avoid a field named
|
|
30
|
+
* `__cone` — it's reserved for the internal prediction-band series.
|
|
31
|
+
*/
|
|
32
|
+
data: ReadonlyArray<Record<string, string | number | null | undefined>>;
|
|
33
|
+
/**
|
|
34
|
+
* Per-series map of `label` / `color` for the actual + forecast lines
|
|
35
|
+
* (imported from the shared `Chart` primitives). Colors are caller-supplied —
|
|
36
|
+
* reference an existing semantic `--ui-*` token; there is no chart palette tier
|
|
37
|
+
* yet. The cone band and the forecast line both reuse the actual series'
|
|
38
|
+
* color — actual and forecast differ by line style, not hue.
|
|
39
|
+
*/
|
|
40
|
+
config: ChartConfig;
|
|
41
|
+
/** Category / time axis key (the shared dimension across rows). */
|
|
42
|
+
xKey: string;
|
|
43
|
+
/** Field for the known/actual values — drawn as a solid line with a filled area. */
|
|
44
|
+
actualKey: string;
|
|
45
|
+
/** Field for the projected values — drawn as a dashed line. */
|
|
46
|
+
forecastKey: string;
|
|
47
|
+
/** Field for the cone's lower bound. */
|
|
48
|
+
lowerKey: string;
|
|
49
|
+
/** Field for the cone's upper bound. */
|
|
50
|
+
upperKey: string;
|
|
51
|
+
/** Stroke width of the actual + forecast lines. */
|
|
52
|
+
strokeWidth?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Set off the forecast period from the actuals with a dashed divider at the
|
|
55
|
+
* hand-off point (the first row with a forecast value) and a subtle shaded
|
|
56
|
+
* band over the forecast region.
|
|
57
|
+
*/
|
|
58
|
+
showForecastRegion?: boolean;
|
|
59
|
+
showLegend?: boolean;
|
|
60
|
+
}
|
|
61
|
+
declare const ConfidenceCone: React.ForwardRefExoticComponent<Omit<ConfidenceConeProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export { ConfidenceCone };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConfidenceCone, type ConfidenceConeProps } from './confidence-cone';
|
|
@@ -2,17 +2,18 @@ import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const dialogContentVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "sm" | "large" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
declare const
|
|
7
|
+
declare const DialogRoot: typeof DialogPrimitive.Root;
|
|
8
8
|
declare const DialogTrigger: DialogPrimitive.Trigger;
|
|
9
9
|
declare const DialogPortal: React.ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
declare const DialogClose: React.ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AlertDialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Popup>, VariantProps<typeof dialogContentVariants> {
|
|
13
13
|
/**
|
|
14
|
-
* Popup max-width. `sm`
|
|
15
|
-
*
|
|
14
|
+
* Popup max-width. `sm` (512px, default) is the Figma-defined size; `large`
|
|
15
|
+
* (832px) is a backward-compatibility size with no design token (see the
|
|
16
|
+
* `Large` story).
|
|
16
17
|
*/
|
|
17
18
|
size?: VariantProps<typeof dialogContentVariants>['size'];
|
|
18
19
|
/**
|
|
@@ -30,10 +31,105 @@ export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeo
|
|
|
30
31
|
keepMounted?: DialogPrimitive.Portal.Props['keepMounted'];
|
|
31
32
|
}
|
|
32
33
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
declare const
|
|
34
|
-
declare const
|
|
35
|
-
declare const
|
|
34
|
+
declare const DialogHeaderRoot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const DialogFooterRoot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const DialogBodyRoot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
36
37
|
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AlertDialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
37
38
|
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AlertDialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
export interface DialogCloseButtonProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {
|
|
40
|
+
/** Accessible name for screen readers. Defaults to `'Close'`. */
|
|
41
|
+
closeLabel?: string;
|
|
42
|
+
}
|
|
43
|
+
declare const DialogCloseButton: React.ForwardRefExoticComponent<DialogCloseButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
export type DialogVariant = 'default' | 'rename' | 'save changes' | 'reset password' | 'discard changes' | 'accept' | 'read-only' | 'wide';
|
|
45
|
+
type DialogRootProps = React.ComponentPropsWithoutRef<typeof DialogRoot>;
|
|
46
|
+
export interface DialogProps extends Omit<DialogRootProps, 'children'> {
|
|
47
|
+
/**
|
|
48
|
+
* Selects the canned title / body / footer preset. Defaults to `'default'`.
|
|
49
|
+
* `'wide'` is a legacy escape hatch (no canned preset) kept for backward
|
|
50
|
+
* compatibility — pair it with `size="large"` and the `footer` prop.
|
|
51
|
+
*/
|
|
52
|
+
variant?: DialogVariant;
|
|
53
|
+
/**
|
|
54
|
+
* Show a spinner overlay across the body + footer, and make both `inert`
|
|
55
|
+
* (unfocusable, unclickable, hidden from assistive tech) so a keyboard user
|
|
56
|
+
* can't activate the visually obscured footer buttons while busy.
|
|
57
|
+
*/
|
|
58
|
+
hasLoading?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Overrides the loading overlay's accessible label. Defaults to `Loading`'s
|
|
61
|
+
* own default (`'Data is loading…'`). Ignored when `hasLoading` is `false`.
|
|
62
|
+
*/
|
|
63
|
+
loadingLabel?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Show the header (title + close button). Defaults to `true`. When `false`,
|
|
66
|
+
* the title is still rendered off-screen so the dialog keeps an accessible
|
|
67
|
+
* name — only the visible bar and close button are omitted. Beyond the
|
|
68
|
+
* strict Figma contract (all seven `DialogDefault` variants always show the
|
|
69
|
+
* header); a ui-react-only extension, like `wide`/`size="large"`.
|
|
70
|
+
*/
|
|
71
|
+
hasHeader?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Show the footer (action buttons). Defaults to `true`. Beyond the strict
|
|
74
|
+
* Figma contract (all seven `DialogDefault` variants always show the
|
|
75
|
+
* footer); a ui-react-only extension, like `wide`/`size="large"`. When
|
|
76
|
+
* `false`, `footer` (and the canned footer it would otherwise replace) is
|
|
77
|
+
* not rendered either.
|
|
78
|
+
*/
|
|
79
|
+
hasFooter?: boolean;
|
|
80
|
+
/** Overrides the variant's default body content. */
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
/** Overrides the variant's default title. */
|
|
83
|
+
title?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The real name of the object being acted on (e.g. a file or resource
|
|
86
|
+
* name). Interpolated into the `rename`/`discard changes`/`accept`
|
|
87
|
+
* variants' canned title/body in place of the generic placeholder text;
|
|
88
|
+
* ignored by variants that don't reference an object name.
|
|
89
|
+
*/
|
|
90
|
+
objectName?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Overrides the accessible name of the `rename` variant's text field
|
|
93
|
+
* (default `'Object name'`). Ignored by every other variant.
|
|
94
|
+
*/
|
|
95
|
+
objectNameLabel?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Overrides the variant's default secondary (dismiss) button label. Passing
|
|
98
|
+
* this for a variant with no secondary button by default (e.g. `read-only`)
|
|
99
|
+
* also makes the button appear. Ignored when `footer` is provided.
|
|
100
|
+
*/
|
|
101
|
+
secondaryLabel?: string;
|
|
102
|
+
/** Overrides the variant's default primary button label. Ignored when `footer` is provided. */
|
|
103
|
+
primaryLabel?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Fires when the primary footer button is clicked. The dialog does not
|
|
106
|
+
* close automatically afterwards — pair this with `open`/`onOpenChange` to
|
|
107
|
+
* close it once the action completes. Ignored when `footer` is provided
|
|
108
|
+
* (wire behavior onto your own buttons there instead).
|
|
109
|
+
*/
|
|
110
|
+
onPrimaryAction?: () => void;
|
|
111
|
+
/**
|
|
112
|
+
* Replaces the footer's action content entirely with free-form buttons —
|
|
113
|
+
* the escape hatch the `wide` variant is meant to be paired with, for
|
|
114
|
+
* legacy call sites that don't fit one of the seven canned presets. Ignored
|
|
115
|
+
* (along with the canned footer) when `hasFooter` is `false`.
|
|
116
|
+
*/
|
|
117
|
+
footer?: React.ReactNode;
|
|
118
|
+
/** Overrides the close button's accessible name. Defaults to `'Close'`. */
|
|
119
|
+
closeLabel?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Popup max-width (forwarded to `DialogContent`). Defaults to `'sm'`, or to
|
|
122
|
+
* `'large'` when `variant` is `'wide'`.
|
|
123
|
+
*/
|
|
124
|
+
size?: DialogContentProps['size'];
|
|
125
|
+
/** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */
|
|
126
|
+
portal?: boolean;
|
|
127
|
+
/** Portal container (forwarded to `DialogContent`). */
|
|
128
|
+
portalContainer?: DialogContentProps['portalContainer'];
|
|
129
|
+
/** Keep the content mounted while closed (forwarded to `DialogContent`). */
|
|
130
|
+
keepMounted?: DialogContentProps['keepMounted'];
|
|
131
|
+
/** Extra classes merged onto the popup container. */
|
|
132
|
+
className?: string;
|
|
133
|
+
}
|
|
134
|
+
declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
135
|
+
export { DialogRoot, DialogPortal, DialogOverlay, DialogClose, DialogCloseButton, DialogTrigger, DialogContent, DialogHeaderRoot, DialogFooterRoot, DialogTitle, DialogBodyRoot, DialogDescription, dialogContentVariants, Dialog, };
|