@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
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
/** Props for `DialogContent` — the portaled, centered dialog popup. */
|
|
3
3
|
export interface DialogContentProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
* · `lg` (832px) · `xl` (992px) · `2xl` (1136px).
|
|
7
|
-
*/
|
|
8
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
|
+
/** Popup max-width. `sm` (512px, default) is the Figma-defined size; `large` (832px) is a legacy backward-compatibility size. */
|
|
5
|
+
size?: 'sm' | 'large';
|
|
9
6
|
/**
|
|
10
7
|
* Render the content inside a portal (default `true`). Disable only when you
|
|
11
8
|
* supply your own `DialogPortal` ancestor (e.g. inline usage).
|
|
@@ -22,3 +19,83 @@ export interface DialogContentProps {
|
|
|
22
19
|
className?: string;
|
|
23
20
|
children?: React.ReactNode;
|
|
24
21
|
}
|
|
22
|
+
/** Props for `Dialog` — the public, variant-driven dialog recipe. */
|
|
23
|
+
export interface DialogProps {
|
|
24
|
+
/**
|
|
25
|
+
* Selects the canned title / body / footer preset. Defaults to `'default'`.
|
|
26
|
+
* `'wide'` is a legacy escape hatch (no Figma preset) kept for backward
|
|
27
|
+
* compatibility — pair it with `size="large"` and the `footer` prop.
|
|
28
|
+
*/
|
|
29
|
+
variant?: 'default' | 'rename' | 'save changes' | 'reset password' | 'discard changes' | 'accept' | 'read-only' | 'wide';
|
|
30
|
+
/**
|
|
31
|
+
* Show a spinner overlay across the body + footer, and make both `inert`
|
|
32
|
+
* so a keyboard user can't activate the obscured footer buttons.
|
|
33
|
+
*/
|
|
34
|
+
hasLoading?: boolean;
|
|
35
|
+
/** Overrides the loading overlay's accessible label. Ignored when `hasLoading` is `false`. */
|
|
36
|
+
loadingLabel?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Show the header (title + close button). Defaults to `true`. When `false`,
|
|
39
|
+
* the title is still rendered off-screen so the dialog keeps an accessible
|
|
40
|
+
* name — only the visible bar and close button are omitted.
|
|
41
|
+
*/
|
|
42
|
+
hasHeader?: boolean;
|
|
43
|
+
/** Show the footer (action buttons). Defaults to `true`. When `false`, `footer` is not rendered either. */
|
|
44
|
+
hasFooter?: boolean;
|
|
45
|
+
/** Overrides the variant's default body content. */
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
/** Overrides the variant's default title. */
|
|
48
|
+
title?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The real name of the object being acted on (e.g. a file or resource
|
|
51
|
+
* name). Interpolated into the `rename`/`discard changes`/`accept`
|
|
52
|
+
* variants' canned title/body in place of the generic placeholder text;
|
|
53
|
+
* ignored by variants that don't reference an object name.
|
|
54
|
+
*/
|
|
55
|
+
objectName?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Overrides the accessible name of the `rename` variant's text field
|
|
58
|
+
* (default `'Object name'`). Ignored by every other variant.
|
|
59
|
+
*/
|
|
60
|
+
objectNameLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Overrides the variant's default secondary (dismiss) button label. Passing
|
|
63
|
+
* this on a variant with no secondary button by default (e.g. `read-only`)
|
|
64
|
+
* also makes the button appear. Ignored when `footer` is provided.
|
|
65
|
+
*/
|
|
66
|
+
secondaryLabel?: string;
|
|
67
|
+
/** Overrides the variant's default primary button label. Ignored when `footer` is provided. */
|
|
68
|
+
primaryLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Fires when the primary footer button is clicked. The dialog does not
|
|
71
|
+
* close automatically afterwards — pair this with `open`/`onOpenChange` to
|
|
72
|
+
* close it once the action completes. Ignored when `footer` is provided.
|
|
73
|
+
*/
|
|
74
|
+
onPrimaryAction?: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Replaces the footer's action content entirely with free-form buttons —
|
|
77
|
+
* the escape hatch the `wide` variant is meant to be paired with, for
|
|
78
|
+
* legacy call sites that don't fit one of the seven canned presets.
|
|
79
|
+
*/
|
|
80
|
+
footer?: React.ReactNode;
|
|
81
|
+
/** Overrides the close button's accessible name. Defaults to `'Close'`. */
|
|
82
|
+
closeLabel?: string;
|
|
83
|
+
/** Popup max-width. Defaults to `'sm'`, or to `'large'` when `variant` is `'wide'`. */
|
|
84
|
+
size?: 'sm' | 'large';
|
|
85
|
+
/** Render inside a portal (default `true`). */
|
|
86
|
+
portal?: boolean;
|
|
87
|
+
/** Portal container. Pass a shadow-root mount for isolated-style previews. */
|
|
88
|
+
portalContainer?: HTMLElement | null;
|
|
89
|
+
/** Keep the content mounted while closed. */
|
|
90
|
+
keepMounted?: boolean;
|
|
91
|
+
/** Extra classes merged onto the popup container. */
|
|
92
|
+
className?: string;
|
|
93
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
94
|
+
open?: boolean;
|
|
95
|
+
/** Open on mount, uncontrolled. */
|
|
96
|
+
defaultOpen?: boolean;
|
|
97
|
+
/** Modal behavior — focus trap and scroll lock while open. Defaults to `true`. */
|
|
98
|
+
modal?: boolean | 'trap-focus';
|
|
99
|
+
/** Fires when the dialog opens or closes. */
|
|
100
|
+
onOpenChange?: (open: boolean, eventDetails: unknown) => void;
|
|
101
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { DialogRoot, DialogPortal, DialogOverlay, DialogClose, DialogCloseButton, DialogTrigger, DialogContent, DialogHeaderRoot, DialogFooterRoot, DialogTitle, DialogBodyRoot, DialogDescription, dialogContentVariants, Dialog, type DialogContentProps, type DialogCloseButtonProps, type DialogProps, type DialogVariant, } from './dialog';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CarouselDialogProps } from '../carousel-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type DialogFooterCarouselVariant = 'start' | 'middle' | 'end';
|
|
4
|
+
export interface DialogFooterCarouselProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, Pick<CarouselDialogProps, 'slideCount' | 'selectedIndex' | 'onSelectIndex' | 'onBack' | 'onNext' | 'onPrimaryAction' | 'backLabel' | 'nextLabel' | 'primaryLabel' | 'goToSlideLabel'> {
|
|
5
|
+
/** Which slide position this renders for. Defaults to `'start'`. */
|
|
6
|
+
variant?: DialogFooterCarouselVariant;
|
|
7
|
+
}
|
|
8
|
+
declare const DialogFooterCarousel: React.ForwardRefExoticComponent<DialogFooterCarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { DialogFooterCarousel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DialogFooterCarousel, type DialogFooterCarouselProps, type DialogFooterCarouselVariant, } from './dialog-footer-carousel';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface DialogFooterDefaultProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
/** Truncated description text next to the actions. Mutually exclusive with `link`. */
|
|
4
|
+
description?: string;
|
|
5
|
+
/** A `Link` (or similar) element next to the actions. Mutually exclusive with `description`. */
|
|
6
|
+
link?: React.ReactNode;
|
|
7
|
+
/** End-aligned actions — typically a secondary and a primary `Button`. */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const DialogFooterDefault: React.ForwardRefExoticComponent<DialogFooterDefaultProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { DialogFooterDefault };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DialogFooterDefault, type DialogFooterDefaultProps } from './dialog-footer-default';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DialogContentProps, DialogRoot } from '../dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface DialogWelcomeSlide {
|
|
4
|
+
/** Illustration/media for the slide. Falls back to a placeholder surface when omitted. */
|
|
5
|
+
image?: React.ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export type DialogWelcomeVariant = 'carousel' | 'single';
|
|
10
|
+
type DialogRootProps = React.ComponentPropsWithoutRef<typeof DialogRoot>;
|
|
11
|
+
export interface DialogWelcomeProps extends Omit<DialogRootProps, 'children'> {
|
|
12
|
+
/** Selects the Figma-defined layout. Defaults to `'carousel'`. */
|
|
13
|
+
variant?: DialogWelcomeVariant;
|
|
14
|
+
/** Slides shown one at a time (`variant="carousel"`). Defaults to a 3-slide placeholder. */
|
|
15
|
+
slides?: DialogWelcomeSlide[];
|
|
16
|
+
/** Controls the active slide (`variant="carousel"`). Uncontrolled when omitted. */
|
|
17
|
+
selectedIndex?: number;
|
|
18
|
+
/** Fires whenever the active slide changes (`variant="carousel"`). */
|
|
19
|
+
onSelectedIndexChange?: (index: number) => void;
|
|
20
|
+
/** `Back` button label (`variant="carousel"`). Defaults to `'Back'`. */
|
|
21
|
+
backLabel?: string;
|
|
22
|
+
/** `Next` button label (`variant="carousel"`). Defaults to `'Next'`. */
|
|
23
|
+
nextLabel?: string;
|
|
24
|
+
/** Builds each carousel dot's accessible name (`variant="carousel"`). */
|
|
25
|
+
goToSlideLabel?: (index: number, count: number) => string;
|
|
26
|
+
/** Illustration/media (`variant="single"`). */
|
|
27
|
+
image?: React.ReactNode;
|
|
28
|
+
/** Title (`variant="single"`). Defaults to `'Title'`. */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** Description (`variant="single"`). Defaults to `'Feature description.'`. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** `Close` link label (`variant="single"`). Defaults to `'Close'`. */
|
|
33
|
+
closeLabel?: string;
|
|
34
|
+
/** Fires when `Close` (`variant="single"`) is activated, before the dialog closes. */
|
|
35
|
+
onCloseAction?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Call-to-action button label — the last carousel slide's button
|
|
38
|
+
* (`variant="carousel"`) or the single body's primary button
|
|
39
|
+
* (`variant="single"`). Defaults to `'Call to action'`.
|
|
40
|
+
*/
|
|
41
|
+
primaryLabel?: string;
|
|
42
|
+
/** Fires when the call-to-action button is activated. */
|
|
43
|
+
onPrimaryAction?: () => void;
|
|
44
|
+
/** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */
|
|
45
|
+
portal?: boolean;
|
|
46
|
+
/** Portal container (forwarded to `DialogContent`). */
|
|
47
|
+
portalContainer?: DialogContentProps['portalContainer'];
|
|
48
|
+
/** Keep the content mounted while closed (forwarded to `DialogContent`). */
|
|
49
|
+
keepMounted?: DialogContentProps['keepMounted'];
|
|
50
|
+
/** Extra classes merged onto the popup container. */
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
declare const DialogWelcome: React.ForwardRefExoticComponent<DialogWelcomeProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export { DialogWelcome };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Props for `DialogWelcome` — the onboarding/announcement dialog recipe. */
|
|
2
|
+
export interface DialogWelcomeProps {
|
|
3
|
+
/** Selects the Figma-defined layout. Defaults to `'carousel'`. */
|
|
4
|
+
variant?: 'carousel' | 'single';
|
|
5
|
+
/** Slides shown one at a time (`variant="carousel"`). Defaults to a 3-slide placeholder. */
|
|
6
|
+
slides?: Array<{
|
|
7
|
+
image?: unknown;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Controls the active slide (`variant="carousel"`). Uncontrolled when omitted. */
|
|
12
|
+
selectedIndex?: number;
|
|
13
|
+
/** Fires whenever the active slide changes (`variant="carousel"`). */
|
|
14
|
+
onSelectedIndexChange?: (index: number) => void;
|
|
15
|
+
/** `Back` button label (`variant="carousel"`). Defaults to `'Back'`. */
|
|
16
|
+
backLabel?: string;
|
|
17
|
+
/** `Next` button label (`variant="carousel"`). Defaults to `'Next'`. */
|
|
18
|
+
nextLabel?: string;
|
|
19
|
+
/** Builds each carousel dot's accessible name (`variant="carousel"`). */
|
|
20
|
+
goToSlideLabel?: (index: number, count: number) => string;
|
|
21
|
+
/** Illustration/media (`variant="single"`). */
|
|
22
|
+
image?: unknown;
|
|
23
|
+
/** Title (`variant="single"`). Defaults to `'Title'`. */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Description (`variant="single"`). Defaults to `'Feature description.'`. */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** `Close` link label (`variant="single"`). Defaults to `'Close'`. */
|
|
28
|
+
closeLabel?: string;
|
|
29
|
+
/** Fires when `Close` (`variant="single"`) is activated, before the dialog closes. */
|
|
30
|
+
onCloseAction?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Call-to-action button label — the last carousel slide's button
|
|
33
|
+
* (`variant="carousel"`) or the single body's primary button
|
|
34
|
+
* (`variant="single"`). Defaults to `'Call to action'`.
|
|
35
|
+
*/
|
|
36
|
+
primaryLabel?: string;
|
|
37
|
+
/** Fires when the call-to-action button is activated. */
|
|
38
|
+
onPrimaryAction?: () => void;
|
|
39
|
+
/** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */
|
|
40
|
+
portal?: boolean;
|
|
41
|
+
/** Portal container (forwarded to `DialogContent`). */
|
|
42
|
+
portalContainer?: HTMLElement | null;
|
|
43
|
+
/** Keep the content mounted while closed (forwarded to `DialogContent`). */
|
|
44
|
+
keepMounted?: boolean;
|
|
45
|
+
/** Extra classes merged onto the popup container. */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
48
|
+
open?: boolean;
|
|
49
|
+
/** Open on mount, uncontrolled. */
|
|
50
|
+
defaultOpen?: boolean;
|
|
51
|
+
/** Modal behavior — focus trap and scroll lock while open. Defaults to `true`. */
|
|
52
|
+
modal?: boolean | 'trap-focus';
|
|
53
|
+
/** Fires when the dialog opens or closes. */
|
|
54
|
+
onOpenChange?: (open: boolean, eventDetails: unknown) => void;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DialogWelcome, type DialogWelcomeProps, type DialogWelcomeSlide, type DialogWelcomeVariant, } from './dialog-welcome';
|
|
@@ -16,7 +16,7 @@ interface FilterSearchFiltersContextValue {
|
|
|
16
16
|
* `onChange` to `setFilter`; Apply commits the draft, Cancel/dismiss reverts it.
|
|
17
17
|
*/
|
|
18
18
|
export declare function useFilterSearchFilters(): FilterSearchFiltersContextValue;
|
|
19
|
-
export interface FilterSearchFiltersProps {
|
|
19
|
+
export interface FilterSearchFiltersProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'onValueChange'> {
|
|
20
20
|
/** The applied filter values, keyed by an arbitrary consumer-chosen id. */
|
|
21
21
|
value: Record<string, unknown>;
|
|
22
22
|
/** Called with the committed filters when Apply is pressed. */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const funnelChartVariants: (props?: ({
|
|
5
|
+
lastShape?: "triangle" | "rectangle" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface FunnelChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof funnelChartVariants> {
|
|
8
|
+
/** Row-per-stage data. Each object holds the stage's `nameKey` label + its `dataKey` numeric value. */
|
|
9
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
10
|
+
/**
|
|
11
|
+
* Per-stage map of `label` / `color`, keyed by the stage's `nameKey` value
|
|
12
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
13
|
+
* custom properties. Colors are caller-supplied — reference an existing
|
|
14
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
15
|
+
*/
|
|
16
|
+
config: ChartConfig;
|
|
17
|
+
/** Numeric field that sizes each stage (the funnel narrows as it drops). */
|
|
18
|
+
dataKey: string;
|
|
19
|
+
/**
|
|
20
|
+
* Label field that names each stage (drives the legend, tooltip, on-chart
|
|
21
|
+
* labels, and the `--color-<name>` lookup). Values should be unique per chart —
|
|
22
|
+
* stages sharing a name share one `config`/color entry.
|
|
23
|
+
*/
|
|
24
|
+
nameKey: string;
|
|
25
|
+
/** Flip the funnel so it widens toward the bottom instead of narrowing. */
|
|
26
|
+
reversed?: boolean;
|
|
27
|
+
/** Render each stage's name beside its segment. */
|
|
28
|
+
showLabels?: boolean;
|
|
29
|
+
showTooltip?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
32
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
33
|
+
* to customize formatting, per-series rows, or extra fields without composing
|
|
34
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
35
|
+
*/
|
|
36
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
37
|
+
}
|
|
38
|
+
declare const FunnelChart: React.ForwardRefExoticComponent<Omit<FunnelChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export { FunnelChart, funnelChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FunnelChart, funnelChartVariants, type FunnelChartProps, } from './funnel-chart';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ChartConfig, CartesianChartProps } from '../chart';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface HistogramBin {
|
|
4
|
+
/** Lower bound of the bin (inclusive). */
|
|
5
|
+
x0: number;
|
|
6
|
+
/** Upper bound of the bin (exclusive, except the last bin which is inclusive). */
|
|
7
|
+
x1: number;
|
|
8
|
+
/** Human-readable range label, e.g. `"0–10"`. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** How many samples fell in the bin. */
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Split `values` into `binCount` equal-width bins and count the samples in each.
|
|
15
|
+
* The range is `domain` if given, else the data's [min, max]; values outside the
|
|
16
|
+
* domain are dropped, and the max value lands in the last (inclusive) bin.
|
|
17
|
+
* Returns [] when there's nothing to bin. Exported for unit tests; not part of
|
|
18
|
+
* the package's public API.
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeHistogramBins(values: ReadonlyArray<number>, binCount: number, domain?: [number, number]): HistogramBin[];
|
|
21
|
+
export interface HistogramProps extends Omit<React.ComponentProps<'div'>, 'children'>, CartesianChartProps {
|
|
22
|
+
/** Raw continuous samples to bin (non-finite values are ignored). */
|
|
23
|
+
values: ReadonlyArray<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Single-series map of `label` / `color`, keyed by `dataKey` (imported from
|
|
26
|
+
* the shared `Chart` primitives). Color is caller-supplied — reference an
|
|
27
|
+
* existing semantic `--ui-*` token; there is no chart palette tier yet.
|
|
28
|
+
*/
|
|
29
|
+
config: ChartConfig;
|
|
30
|
+
/** `config` key that colors + labels the frequency bars. */
|
|
31
|
+
dataKey?: string;
|
|
32
|
+
/** Number of equal-width bins. */
|
|
33
|
+
binCount?: number;
|
|
34
|
+
/** Fix the binning range instead of deriving it from the data's min/max. */
|
|
35
|
+
domain?: [number, number];
|
|
36
|
+
/** Corner radius on the top of each bar. */
|
|
37
|
+
barRadius?: number;
|
|
38
|
+
}
|
|
39
|
+
declare const Histogram: React.ForwardRefExoticComponent<Omit<HistogramProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export { Histogram };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Histogram, type HistogramProps, type HistogramBin } from './histogram';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputOTP, type InputOTPProps } from './input-otp';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface InputOTPProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'defaultValue' | 'children'> {
|
|
3
|
+
/** Number of single-character slots. */
|
|
4
|
+
length?: number;
|
|
5
|
+
/** Controlled value (the digits entered so far, left to right). */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Initial value for uncontrolled usage. */
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/** Fires with the full value on every change. */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** Fires once, the moment the value reaches `length` characters. */
|
|
12
|
+
onComplete?: (value: string) => void;
|
|
13
|
+
/** Disables every slot. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Switches every slot to the error treatment. */
|
|
16
|
+
error?: boolean;
|
|
17
|
+
/** Focuses the first slot on mount. */
|
|
18
|
+
autoFocus?: boolean;
|
|
19
|
+
/** Builds the accessible name for a slot from its 1-based index and the total length. */
|
|
20
|
+
slotAriaLabel?: (index: number, length: number) => string;
|
|
21
|
+
}
|
|
22
|
+
declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export { InputOTP };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputPassword, type InputPasswordProps } from './input-password';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface InputPasswordProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'children' | 'type'> {
|
|
3
|
+
/** Field label, rendered above the input. */
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
/** Marks the field required — appends a `*` after the label. */
|
|
6
|
+
required?: boolean;
|
|
7
|
+
/** Helper text below the input. Hidden while `error` is set. */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Error message below the input. Its presence switches the field to the error
|
|
11
|
+
* treatment (red box border + red message).
|
|
12
|
+
*/
|
|
13
|
+
error?: React.ReactNode;
|
|
14
|
+
/** Accessible label for the toggle button while the password is hidden. */
|
|
15
|
+
showPasswordLabel?: string;
|
|
16
|
+
/** Accessible label for the toggle button while the password is shown. */
|
|
17
|
+
hidePasswordLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function getInputPasswordBoxClassName(hasError: boolean, disabled?: boolean): string;
|
|
20
|
+
declare const InputPassword: React.ForwardRefExoticComponent<InputPasswordProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
export { InputPassword };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LineChart, lineChartVariants, type LineChartProps } from './line-chart';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig, CartesianChartProps } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const lineChartVariants: (props?: ({
|
|
5
|
+
curve?: "step" | "linear" | "monotone" | null | undefined;
|
|
6
|
+
lineStyle?: "dashed" | "solid" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Drop the synthetic delta-band range series from a recharts tooltip/legend
|
|
10
|
+
* payload, keeping the real series (and their order). recharts already excludes
|
|
11
|
+
* the band via `legendType`/`tooltipType="none"`, so this is a second, explicit
|
|
12
|
+
* guard — hence it's unit-tested rather than relying on that behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function dropBandSeries<T extends {
|
|
15
|
+
dataKey?: unknown;
|
|
16
|
+
}>(payload: readonly T[] | undefined): T[] | undefined;
|
|
17
|
+
type TooltipContentType = NonNullable<React.ComponentProps<typeof ChartTooltip>['content']>;
|
|
18
|
+
type TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;
|
|
19
|
+
type TooltipRenderProps = Parameters<TooltipContentFn>[0];
|
|
20
|
+
/**
|
|
21
|
+
* Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are
|
|
22
|
+
* stripped from the payload before it renders, while preserving recharts' own
|
|
23
|
+
* mount semantics — a function is mounted via `createElement` (its own component
|
|
24
|
+
* identity + hook state), an element via `cloneElement`. This mirrors what the
|
|
25
|
+
* pass-through charts get by handing `content` straight to recharts, so a
|
|
26
|
+
* function-form tooltip keeps its state across re-renders here too. The returned
|
|
27
|
+
* component is a stable content type (memoize it on `tooltipContent`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function createBandStrippedTooltip(tooltipContent: TooltipContentType): (props: TooltipRenderProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.FunctionComponentElement<import('recharts').TooltipContentProps<import('recharts').TooltipValueType, import('recharts/types/component/DefaultTooltipContent').NameType>>;
|
|
30
|
+
export interface LineChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof lineChartVariants>, CartesianChartProps {
|
|
31
|
+
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */
|
|
32
|
+
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
33
|
+
/**
|
|
34
|
+
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
35
|
+
* primitives). Series colors are caller-supplied — reference an existing
|
|
36
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
37
|
+
*/
|
|
38
|
+
config: ChartConfig;
|
|
39
|
+
/** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */
|
|
40
|
+
dataKeys: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Subset of `dataKeys` to render as comparison/trend overlays (e.g. a
|
|
43
|
+
* previous quarter or year) — dashed, dimmed, and dot-less, so they read as
|
|
44
|
+
* secondary to the current-period lines. Keeps each series' own `config` color.
|
|
45
|
+
*/
|
|
46
|
+
comparisonKeys?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a
|
|
49
|
+
* dimmed area filling the gap between the two series at each point,
|
|
50
|
+
* visualizing the QoQ/YoY difference. Tinted with the first key's `config`
|
|
51
|
+
* color. Rows where either value isn't numeric are left un-banded.
|
|
52
|
+
*
|
|
53
|
+
* Each pair mints an internal `__band_<n>` field (kept out of the tooltip and
|
|
54
|
+
* legend), so avoid data/`config` keys with that reserved prefix.
|
|
55
|
+
*/
|
|
56
|
+
deltaBands?: Array<[string, string]>;
|
|
57
|
+
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
58
|
+
xKey: string;
|
|
59
|
+
/** Stroke width of each line. */
|
|
60
|
+
strokeWidth?: number;
|
|
61
|
+
/** Render a dot at each data point. */
|
|
62
|
+
showDots?: boolean;
|
|
63
|
+
/** Bridge `null` gaps in the data instead of breaking the line. */
|
|
64
|
+
connectNulls?: boolean;
|
|
65
|
+
showLegend?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare const LineChart: React.ForwardRefExoticComponent<Omit<LineChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
export { LineChart, lineChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading, loadingVariants, type LoadingProps } from './loading';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const loadingVariants: (props?: ({
|
|
4
|
+
variant?: "inline" | "onSurfacePrimary" | "onSurfaceSecondary" | "onScreen" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface LoadingProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof loadingVariants> {
|
|
7
|
+
/** Whether the label is rendered. When `false`, `label` is still exposed to assistive tech via `aria-label`. */
|
|
8
|
+
hasLabel?: boolean;
|
|
9
|
+
/** The loading message. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Loading: React.ForwardRefExoticComponent<LoadingProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Loading, loadingVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Meter, type MeterProps } from './meter';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meter as MeterPrimitive } from '@base-ui/react/meter';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface MeterProps extends Omit<React.ComponentPropsWithoutRef<typeof MeterPrimitive.Root>, 'value' | 'color'> {
|
|
4
|
+
/** Row label shown on the left. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The value this meter represents. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Upper bound of the range — the whole the value is a share of. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Fill color for the bar — an existing semantic `--ui-*` token (or any CSS color). */
|
|
11
|
+
color: string;
|
|
12
|
+
/** Format the numeric value (label + tooltip). Defaults to `toLocaleString()`. */
|
|
13
|
+
valueFormatter?: (value: number) => string;
|
|
14
|
+
/** Show the hover tooltip (`label · value of max · %`). */
|
|
15
|
+
showTooltip?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Custom tooltip content — replaces the default (dot + label + `value of max
|
|
18
|
+
* · %`) inside the same chart-style card. Ignored when `showTooltip` is false.
|
|
19
|
+
*/
|
|
20
|
+
tooltip?: React.ReactNode;
|
|
21
|
+
/** Render with the tooltip initially open (Base UI `defaultOpen`). */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const Meter: React.ForwardRefExoticComponent<MeterProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export { Meter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Metric, type MetricProps } from './metric';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const metricVariants: (props?: ({
|
|
4
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
5
|
+
status?: "info" | "success" | "warning" | "critical" | "neutral" | "danger" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface MetricProps extends React.ComponentProps<'div'>, VariantProps<typeof metricVariants> {
|
|
8
|
+
/** What the value measures — e.g. "Gross margin". Rendered as an uppercase note heading. */
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The primary value, already formatted (`73`, `"94%"`, `"$72K"`, `"2.8"`).
|
|
12
|
+
* The kit does not format currency, units, or decimals.
|
|
13
|
+
*/
|
|
14
|
+
value: React.ReactNode;
|
|
15
|
+
/** Unit shown next to the value at a smaller, muted size — e.g. `"%"`, `"hours"`. */
|
|
16
|
+
unit?: React.ReactNode;
|
|
17
|
+
/** A top-right caption aligned with the label — e.g. a timeframe `Tag` ("Last 30 days"). */
|
|
18
|
+
caption?: React.ReactNode;
|
|
19
|
+
/** A trend slot on the right of the value — typically a `TrendIndicator`. */
|
|
20
|
+
trend?: React.ReactNode;
|
|
21
|
+
/** Secondary line below the value — e.g. "Target: 99%". */
|
|
22
|
+
supportingText?: React.ReactNode;
|
|
23
|
+
/** A small badge / metadata slot beside the value — e.g. a `Tag`. */
|
|
24
|
+
badge?: React.ReactNode;
|
|
25
|
+
/** Icon rendered in a status-tinted badge before the value. */
|
|
26
|
+
icon?: React.ReactNode;
|
|
27
|
+
/** Contextual hint on an info affordance next to the label (Base UI Tooltip). */
|
|
28
|
+
tooltip?: React.ReactNode;
|
|
29
|
+
/** Accessible name for the info affordance that reveals `tooltip`. */
|
|
30
|
+
tooltipLabel?: string;
|
|
31
|
+
/** Show a skeleton in place of the value, preserving its space. */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Card body below the header — e.g. a chart, a Separator, an insight line. */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare const Metric: React.ForwardRefExoticComponent<Omit<MetricProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export { Metric };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PieChart, pieChartVariants, type PieChartProps, type PieChartCenterLabel, } from './pie-chart';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartTooltip, ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const pieChartVariants: (props?: ({
|
|
5
|
+
shape?: "pie" | "donut" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface PieChartCenterLabel {
|
|
8
|
+
/** Headline metric rendered large in the donut hole (e.g. a total). */
|
|
9
|
+
value?: string | number;
|
|
10
|
+
/** Caption rendered under the value. */
|
|
11
|
+
label?: string | number;
|
|
12
|
+
}
|
|
13
|
+
export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof pieChartVariants> {
|
|
14
|
+
/** Row-per-slice data. Each object holds the slice's `nameKey` label + its `dataKey` numeric value. */
|
|
15
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
16
|
+
/**
|
|
17
|
+
* Per-slice map of `label` / `color`, keyed by the slice's `nameKey` value
|
|
18
|
+
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
19
|
+
* custom properties. Colors are caller-supplied — reference an existing
|
|
20
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
21
|
+
*/
|
|
22
|
+
config: ChartConfig;
|
|
23
|
+
/** Numeric field that sizes each slice. */
|
|
24
|
+
dataKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* Label field that names each slice (drives the legend, tooltip, and
|
|
27
|
+
* `--color-<name>` lookup). Values should be unique per chart — rows sharing a
|
|
28
|
+
* name share one `config`/color entry.
|
|
29
|
+
*/
|
|
30
|
+
nameKey: string;
|
|
31
|
+
/** Inner radius of the arc when `shape="donut"` (ignored for `shape="pie"`). */
|
|
32
|
+
innerRadius?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Custom content for the donut hole — a headline `value` and/or a `label`
|
|
35
|
+
* caption, stacked and centered. Rendered only for `shape="donut"` (a filled
|
|
36
|
+
* pie has no hole).
|
|
37
|
+
*/
|
|
38
|
+
centerLabel?: PieChartCenterLabel;
|
|
39
|
+
/** Outer radius of the arc. Omit to use recharts' responsive default. */
|
|
40
|
+
outerRadius?: number;
|
|
41
|
+
/** Gap between slices, in degrees. */
|
|
42
|
+
paddingAngle?: number;
|
|
43
|
+
showTooltip?: boolean;
|
|
44
|
+
showLegend?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
47
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
48
|
+
* to customize formatting, per-slice rows, or extra fields without composing
|
|
49
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
50
|
+
*/
|
|
51
|
+
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
52
|
+
}
|
|
53
|
+
declare const PieChart: React.ForwardRefExoticComponent<Omit<PieChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export { PieChart, pieChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Popover, PopoverTrigger, PopoverPortal, PopoverContent, type PopoverContentProps, } from './popover';
|
|
1
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverContent, type PopoverContentProps, PopoverBody, PopoverFooter, } from './popover';
|