@acronis-platform/ui-react 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion-container/accordion-container.js +144 -0
- package/dist/components/ui/accordion-container/accordion-container.js.map +1 -0
- package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +141 -139
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +33 -22
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +295 -293
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/card/card.js +150 -74
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/card-section/card-section.js +111 -0
- package/dist/components/ui/card-section/card-section.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +109 -93
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +113 -0
- package/dist/components/ui/chart/chart-palette.js.map +1 -0
- package/dist/components/ui/chart/chart.js +176 -129
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
- package/dist/components/ui/chart-state/chart-state.js +48 -34
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +87 -0
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +117 -115
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +4 -2
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/empty-overlay/empty-overlay.js +49 -0
- package/dist/components/ui/empty-overlay/empty-overlay.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +94 -92
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/label/label.js +2 -9
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +143 -141
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +74 -185
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/page-content/page-content.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +201 -195
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +133 -131
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/section/section.js +157 -31
- package/dist/components/ui/section/section.js.map +1 -1
- package/dist/components/ui/stepper/stepper.js +24 -24
- package/dist/components/ui/stepper/stepper.js.map +1 -1
- package/dist/components/ui/stepper-item/stepper-item.js +43 -24
- package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
- package/dist/components/ui/table/table.js +27 -27
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +133 -124
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
- package/dist/components/ui/wizard/wizard.js +59 -0
- package/dist/components/ui/wizard/wizard.js.map +1 -0
- package/dist/hooks/use-wizard.js +75 -0
- package/dist/hooks/use-wizard.js.map +1 -0
- package/dist/index.js +540 -525
- package/dist/index.js.map +1 -1
- package/dist/llms/accordion-container.md +181 -0
- package/dist/llms/accordion.md +124 -0
- package/dist/llms/alert.md +225 -0
- package/dist/llms/app-shell-chat.md +415 -0
- package/dist/llms/area-chart.md +355 -0
- package/dist/llms/avatar.md +208 -0
- package/dist/llms/bar-chart.md +406 -0
- package/dist/llms/breadcrumb.md +326 -0
- package/dist/llms/button-group.md +298 -0
- package/dist/llms/button-icon-input.md +142 -0
- package/dist/llms/button-icon-menu.md +209 -0
- package/dist/llms/button-icon.md +128 -0
- package/dist/llms/button-menu.md +172 -0
- package/dist/llms/button.md +185 -0
- package/dist/llms/calendar-panel.md +733 -0
- package/dist/llms/calendar.md +188 -0
- package/dist/llms/card-filter.md +214 -0
- package/dist/llms/card-section.md +293 -0
- package/dist/llms/card.md +447 -0
- package/dist/llms/carousel-dialog.md +156 -0
- package/dist/llms/category-bar.md +193 -0
- package/dist/llms/chart-state.md +190 -0
- package/dist/llms/chart-widget.md +209 -0
- package/dist/llms/chart.md +182 -0
- package/dist/llms/checkbox.md +257 -0
- package/dist/llms/chip.md +195 -0
- package/dist/llms/combobox.md +164 -0
- package/dist/llms/composed-chart.md +508 -0
- package/dist/llms/confidence-cone.md +277 -0
- package/dist/llms/data-table.md +474 -0
- package/dist/llms/date-range-picker.md +272 -0
- package/dist/llms/description-list.md +131 -0
- package/dist/llms/dialog-footer-carousel.md +147 -0
- package/dist/llms/dialog-footer-default.md +142 -0
- package/dist/llms/dialog-root.md +246 -0
- package/dist/llms/dialog-welcome.md +223 -0
- package/dist/llms/dialog.md +403 -0
- package/dist/llms/dropdown-menu.md +193 -0
- package/dist/llms/empty-overlay.md +146 -0
- package/dist/llms/empty.md +156 -0
- package/dist/llms/field.md +185 -0
- package/dist/llms/filter-cards.md +157 -0
- package/dist/llms/filter-chips.md +323 -0
- package/dist/llms/filter-search.md +512 -0
- package/dist/llms/form.md +154 -0
- package/dist/llms/funnel-chart.md +333 -0
- package/dist/llms/grid.md +80 -0
- package/dist/llms/histogram.md +190 -0
- package/dist/llms/input-date-picker.md +203 -0
- package/dist/llms/input-otp.md +173 -0
- package/dist/llms/input-password.md +197 -0
- package/dist/llms/input-search.md +170 -0
- package/dist/llms/input-select.md +278 -0
- package/dist/llms/input-text-area.md +271 -0
- package/dist/llms/input-text.md +192 -0
- package/dist/llms/line-chart.md +369 -0
- package/dist/llms/link.md +209 -0
- package/dist/llms/loading.md +130 -0
- package/dist/llms/meter.md +177 -0
- package/dist/llms/metric.md +204 -0
- package/dist/llms/number-field.md +122 -0
- package/dist/llms/page-content.md +69 -0
- package/dist/llms/page-header.md +182 -0
- package/dist/llms/pagination.md +133 -0
- package/dist/llms/pie-chart.md +307 -0
- package/dist/llms/popover.md +252 -0
- package/dist/llms/progress-circle.md +126 -0
- package/dist/llms/progress.md +111 -0
- package/dist/llms/radar-chart.md +316 -0
- package/dist/llms/radial-bar-chart.md +319 -0
- package/dist/llms/radio.md +255 -0
- package/dist/llms/resizable.md +195 -0
- package/dist/llms/sankey-chart.md +208 -0
- package/dist/llms/scatter-chart.md +239 -0
- package/dist/llms/scroll-area.md +183 -0
- package/dist/llms/section.md +401 -0
- package/dist/llms/select.md +210 -0
- package/dist/llms/separator.md +87 -0
- package/dist/llms/sheet.md +202 -0
- package/dist/llms/sidebar-primary.md +360 -0
- package/dist/llms/sidebar-secondary.md +417 -0
- package/dist/llms/skeleton.md +81 -0
- package/dist/llms/slider.md +97 -0
- package/dist/llms/spinner.md +100 -0
- package/dist/llms/stack.md +80 -0
- package/dist/llms/stepper-item.md +309 -0
- package/dist/llms/stepper.md +251 -0
- package/dist/llms/switch.md +140 -0
- package/dist/llms/table.md +436 -0
- package/dist/llms/tabs.md +197 -0
- package/dist/llms/tag.md +139 -0
- package/dist/llms/timeline.md +361 -0
- package/dist/llms/timer.md +259 -0
- package/dist/llms/toast.md +241 -0
- package/dist/llms/toggle-group.md +121 -0
- package/dist/llms/toolbar.md +453 -0
- package/dist/llms/tooltip.md +164 -0
- package/dist/llms/treemap.md +254 -0
- package/dist/llms/trend-indicator.md +132 -0
- package/dist/llms/widget-placeholder.md +169 -0
- package/dist/llms/wizard.md +412 -0
- package/dist/llms.txt +142 -0
- package/dist/react.js +540 -525
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/accordion-container/accordion-container.d.ts +44 -0
- package/dist/src/components/ui/accordion-container/index.d.ts +1 -0
- package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
- package/dist/src/components/ui/avatar/avatar.d.ts +27 -8
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/card/card.d.ts +69 -8
- package/dist/src/components/ui/card/index.d.ts +1 -1
- package/dist/src/components/ui/card-section/card-section.d.ts +50 -0
- package/dist/src/components/ui/card-section/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
- package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
- package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
- package/dist/src/components/ui/chart/chart.d.ts +66 -15
- package/dist/src/components/ui/chart/index.d.ts +4 -2
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
- package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
- package/dist/src/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +20 -0
- package/dist/src/components/ui/empty-overlay/index.d.ts +2 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
- package/dist/src/components/ui/grid/grid.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
- package/dist/src/components/ui/label/index.d.ts +1 -1
- package/dist/src/components/ui/label/label.d.ts +1 -5
- package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
- package/dist/src/components/ui/metric/metric.d.ts +13 -14
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
- package/dist/src/components/ui/section/index.d.ts +1 -1
- package/dist/src/components/ui/section/section.d.ts +75 -6
- package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
- package/dist/src/components/ui/stack/stack.d.ts +1 -1
- package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
- package/dist/src/components/ui/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-wizard.d.ts +80 -0
- package/dist/src/index.d.ts +5 -3
- package/dist/ui-react.css +1 -1
- package/package.json +12 -6
- package/dist/components/ui/app-shell/app-shell.js +0 -75
- package/dist/components/ui/app-shell/app-shell.js.map +0 -1
- package/dist/components/ui/auth-layout/auth-layout.js +0 -56
- package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
- package/dist/components/ui/collapsible/collapsible.js +0 -22
- package/dist/components/ui/collapsible/collapsible.js.map +0 -1
- package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
- package/dist/src/components/ui/app-shell/index.d.ts +0 -1
- package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
- package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
- package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
- package/dist/src/components/ui/collapsible/index.d.ts +0 -1
- package/dist/src/components/ui/label/label.docs.d.ts +0 -10
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,44 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface AccordionContainerState {
|
|
4
|
+
open: boolean;
|
|
5
|
+
}
|
|
6
|
+
type AccordionContainerChildren = React.ReactNode | ((state: AccordionContainerState) => React.ReactNode);
|
|
7
|
+
type AccordionContainerBaseProps = Omit<React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>, 'children'>;
|
|
8
|
+
interface AccordionContainerProps extends AccordionContainerBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the disclosure exists at all. When `false`, `children` render
|
|
11
|
+
* directly with no trigger and no panel wrapper — the Figma
|
|
12
|
+
* `isCollapsable=false` state has no disclosure UI.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
collapsible?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Accepts a plain node, or a render-prop function receiving the current
|
|
18
|
+
* `{ open }` state — for content outside `AccordionContainer.Content` (e.g.
|
|
19
|
+
* a header) that still needs to know whether the panel is expanded, even
|
|
20
|
+
* when this component owns the open state itself (uncontrolled).
|
|
21
|
+
*/
|
|
22
|
+
children?: AccordionContainerChildren;
|
|
23
|
+
}
|
|
24
|
+
interface AccordionContainerContextValue {
|
|
25
|
+
collapsible: boolean;
|
|
26
|
+
open: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Reads whether the nearest `AccordionContainer` ancestor is `collapsible`
|
|
30
|
+
* and, if so, its current `open` state — for content outside
|
|
31
|
+
* `AccordionContainer.Content` (e.g. a header) that needs to react to the
|
|
32
|
+
* panel's state without a dedicated prop, such as `CardHeader` dropping its
|
|
33
|
+
* bottom divider while collapsed.
|
|
34
|
+
*/
|
|
35
|
+
declare const useAccordionContainerContext: () => AccordionContainerContextValue;
|
|
36
|
+
type AccordionContainerTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;
|
|
37
|
+
declare const AccordionContainerTrigger: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
type AccordionContainerContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Panel>;
|
|
39
|
+
declare const AccordionContainerContent: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const AccordionContainerRoot: React.ForwardRefExoticComponent<AccordionContainerProps & React.RefAttributes<HTMLDivElement>> & {
|
|
41
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
Content: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
};
|
|
44
|
+
export { AccordionContainerRoot as AccordionContainer, AccordionContainerTrigger, AccordionContainerContent, useAccordionContainerContext, type AccordionContainerProps, type AccordionContainerTriggerProps, type AccordionContainerContentProps, type AccordionContainerState, type AccordionContainerContextValue, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccordionContainer, AccordionContainerTrigger, AccordionContainerContent, useAccordionContainerContext, type AccordionContainerProps, type AccordionContainerTriggerProps, type AccordionContainerContentProps, type AccordionContainerState, type AccordionContainerContextValue, } from './accordion-container';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartConfig, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCurveType, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition } from '../chart';
|
|
2
|
+
import { ChartConfig, ChartPalette, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCurveType, ChartDataLabelProps, ChartReferenceLine, CartesianLabelPosition } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const areaChartVariants: (props?: ({
|
|
5
5
|
layout?: "single" | "stacked" | null | undefined;
|
|
@@ -34,12 +34,17 @@ export interface AreaChartAreaSettings {
|
|
|
34
34
|
labelPosition?: CartesianLabelPosition;
|
|
35
35
|
}
|
|
36
36
|
export interface AreaChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof areaChartVariants>, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
|
|
37
|
+
/**
|
|
38
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
39
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
40
|
+
*/
|
|
41
|
+
palette?: ChartPalette;
|
|
37
42
|
/** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */
|
|
38
43
|
data: ReadonlyArray<Record<string, string | number | null>>;
|
|
39
44
|
/**
|
|
40
|
-
* Per-series map of `label` / `
|
|
41
|
-
* primitives). Series
|
|
42
|
-
*
|
|
45
|
+
* Per-series map of `label` / `icon` / `tone` (from the shared `Chart`
|
|
46
|
+
* primitives). Series take their colour from the container's `palette`; each
|
|
47
|
+
* entry maps a key to a `label` and an optional `tone`.
|
|
43
48
|
*/
|
|
44
49
|
config: ChartConfig;
|
|
45
50
|
/** Series to plot — one `<Area>` per key. Each must exist in `config` and in every data row. */
|
|
@@ -2,21 +2,40 @@ 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?: "blue" | "
|
|
5
|
+
color?: "blue" | "green" | "gray" | "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A user/entity avatar: a colored circle showing an image or initials. Compose
|
|
11
|
-
* `AvatarImage` and/or `AvatarFallback` inside; stack several in `AvatarGroup`.
|
|
12
|
-
*/
|
|
13
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
14
7
|
export type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;
|
|
15
8
|
/** The avatar image; hidden by Base UI until it loads, revealing the fallback. */
|
|
16
9
|
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AvatarImageProps, "ref"> & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
17
10
|
export type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;
|
|
18
11
|
/** Shown when there's no image (or it fails) — typically the user's initials. */
|
|
19
12
|
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AvatarFallbackProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
14
|
+
/**
|
|
15
|
+
* Selects the auto-rendered fallback content when no `children` are
|
|
16
|
+
* composed: initials (`label`) or an `icon`. Ignored once `children` (e.g.
|
|
17
|
+
* `AvatarImage`/`AvatarFallback`) are composed directly — including an
|
|
18
|
+
* explicit `null`, which renders an empty circle.
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'text' | 'icon';
|
|
21
|
+
/**
|
|
22
|
+
* Initials shown for the `text` variant when no `children` are composed
|
|
23
|
+
* (i.e. `children` is `undefined`).
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon shown for the `icon` variant when no `children` are composed
|
|
28
|
+
* (i.e. `children` is `undefined`).
|
|
29
|
+
*/
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A user/entity avatar: a colored circle showing an image, initials, or an
|
|
34
|
+
* icon. Compose `AvatarImage`/`AvatarFallback` for the photo-with-fallback
|
|
35
|
+
* case, or use `variant`/`label`/`icon` for a quick text or icon badge; stack
|
|
36
|
+
* several in `AvatarGroup`.
|
|
37
|
+
*/
|
|
38
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
20
39
|
export type AvatarGroupProps = React.HTMLAttributes<HTMLDivElement>;
|
|
21
40
|
/**
|
|
22
41
|
* Overlapping stack of avatars. Each avatar after the first is pulled left by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { BarShapeProps } from 'recharts/types/cartesian/Bar';
|
|
3
|
-
import { ChartLegend, ChartTooltip, ChartConfig, ChartReferenceLine, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCategoryRange, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
3
|
+
import { ChartLegend, ChartTooltip, ChartConfig, ChartPalette, ChartReferenceLine, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartCategoryRange, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
declare const barChartVariants: (props?: ({
|
|
6
6
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
@@ -118,12 +118,17 @@ export declare function createTrackShape({ inRange, trackFill, paint, }: {
|
|
|
118
118
|
paint?: BarPaintOverride;
|
|
119
119
|
}): ({ background: track, index: row, ...bar }: BarShapeProps) => import("react/jsx-runtime").JSX.Element;
|
|
120
120
|
export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof barChartVariants>, CartesianChartProps, ChartAnimationProps, ChartBrushProps, ChartDataLabelProps {
|
|
121
|
+
/**
|
|
122
|
+
* The dataviz palette this chart's series are painted from. Series that
|
|
123
|
+
* state no `color` of their own take a stop of it. See `ChartPalette`.
|
|
124
|
+
*/
|
|
125
|
+
palette?: ChartPalette;
|
|
121
126
|
/** Row-per-category data. Each object holds the category key + one numeric field per series. */
|
|
122
127
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
123
128
|
/**
|
|
124
|
-
* Per-series map of `label` / `
|
|
125
|
-
* primitives). Series
|
|
126
|
-
*
|
|
129
|
+
* Per-series map of `label` / `icon` / `tone` (from the shared `Chart`
|
|
130
|
+
* primitives). Series take their colour from the container's `palette`; each
|
|
131
|
+
* entry maps a key to a `label` and an optional `tone`.
|
|
127
132
|
*/
|
|
128
133
|
config: ChartConfig;
|
|
129
134
|
/** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */
|
|
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "ghost" | "secondary" | "destructive" | "ai" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
/**
|
|
@@ -1,17 +1,78 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
+
declare const cardVariants: (props?: ({
|
|
5
|
+
hasError?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
4
8
|
/**
|
|
5
9
|
* Replace the rendered `<div>` with another element or component (Base UI
|
|
6
|
-
* composition) — e.g. render `
|
|
7
|
-
|
|
10
|
+
* composition) — e.g. render `Card` as an `<article>`.
|
|
11
|
+
*/
|
|
12
|
+
render?: useRender.RenderProp;
|
|
13
|
+
}
|
|
14
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface CardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
16
|
+
/** The card's title. Renders nothing when omitted. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Helper text shown under the title; only rendered when `hasDescription`. */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** Shows `description` below the title. */
|
|
21
|
+
hasDescription?: boolean;
|
|
22
|
+
/** Shows a drag handle at the start of the header, for reorderable lists. */
|
|
23
|
+
isDraggable?: boolean;
|
|
24
|
+
/** Accessible label for the drag handle. */
|
|
25
|
+
dragHandleLabel?: string;
|
|
26
|
+
/** Shows a toggle switch at the start of the header. */
|
|
27
|
+
isSwitchable?: boolean;
|
|
28
|
+
/** Controlled checked state of the header switch. */
|
|
29
|
+
switchChecked?: boolean;
|
|
30
|
+
/** Uncontrolled initial checked state of the header switch. */
|
|
31
|
+
defaultSwitchChecked?: boolean;
|
|
32
|
+
/** Fires when the header switch is toggled. */
|
|
33
|
+
onSwitchCheckedChange?: (checked: boolean) => void;
|
|
34
|
+
/** Disables the header switch. */
|
|
35
|
+
switchDisabled?: boolean;
|
|
36
|
+
/** Accessible label for the header switch. */
|
|
37
|
+
switchLabel?: string;
|
|
38
|
+
/** Shows an avatar before the title. */
|
|
39
|
+
hasAvatar?: boolean;
|
|
40
|
+
/** Initials shown in the default avatar; ignored if `avatar` is provided. */
|
|
41
|
+
avatarLabel?: string;
|
|
42
|
+
/** Replaces the default initials avatar with custom content. */
|
|
43
|
+
avatar?: React.ReactNode;
|
|
44
|
+
/** Shows a rename button next to the title. */
|
|
45
|
+
hasRename?: boolean;
|
|
46
|
+
/** Fires when the rename button is activated. */
|
|
47
|
+
onRename?: () => void;
|
|
48
|
+
/** Accessible label for the rename button. */
|
|
49
|
+
renameLabel?: string;
|
|
50
|
+
/** Extra content rendered inline next to the title (e.g. a tag or badge). */
|
|
51
|
+
extras?: React.ReactNode;
|
|
52
|
+
/** Actions rendered at the end of the header (e.g. a menu button). */
|
|
53
|
+
actions?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Shows a disclosure trigger at the end of the header. Only has an effect
|
|
56
|
+
* when this header renders inside a collapsible `AccordionContainer` —
|
|
57
|
+
* see the collapsible composition example.
|
|
58
|
+
*/
|
|
59
|
+
isCollapsible?: boolean;
|
|
60
|
+
/** Accessible label for the collapse trigger. */
|
|
61
|
+
collapseLabel?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Replace the rendered `<div>` with another element or component (Base UI
|
|
64
|
+
* composition).
|
|
65
|
+
*/
|
|
66
|
+
render?: useRender.RenderProp;
|
|
67
|
+
}
|
|
68
|
+
declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
69
|
+
export interface CardPartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
70
|
+
/**
|
|
71
|
+
* Replace the rendered `<div>` with another element or component (Base UI
|
|
72
|
+
* composition).
|
|
8
73
|
*/
|
|
9
74
|
render?: useRender.RenderProp;
|
|
10
75
|
}
|
|
11
|
-
declare const Card: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const CardHeader: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
declare const CardTitle: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
declare const CardDescription: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
76
|
declare const CardContent: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
77
|
declare const CardFooter: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
export { Card, CardHeader,
|
|
78
|
+
export { Card, CardHeader, CardContent, CardFooter, cardVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Card, CardHeader, CardFooter,
|
|
1
|
+
export { Card, CardHeader, CardContent, CardFooter, cardVariants, type CardProps, type CardHeaderProps, type CardPartProps, } from './card';
|
|
@@ -0,0 +1,50 @@
|
|
|
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 cardSectionVariants: (props?: ({
|
|
5
|
+
variant?: "slot" | "list" | "tag" | "table-actions" | "card-primary" | "card-secondary" | null | undefined;
|
|
6
|
+
hasBottomBorder?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface CardSectionBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'>, VariantProps<typeof cardSectionVariants> {
|
|
9
|
+
/** Extra content rendered inline next to the section title (e.g. a tag). */
|
|
10
|
+
extras?: React.ReactNode;
|
|
11
|
+
/** Actions rendered at the end of the section header row (e.g. a menu button). */
|
|
12
|
+
actions?: React.ReactNode;
|
|
13
|
+
/** Body of the `slot` variant — arbitrary passthrough content. */
|
|
14
|
+
content?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Body of the `tag` variant — a wrapping row of tags. Has no built-in
|
|
17
|
+
* default: like `contentList`, the consumer supplies the tags.
|
|
18
|
+
*/
|
|
19
|
+
contentTag?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Body of the `list` variant — title/description key-value rows. Has no
|
|
22
|
+
* built-in default: the `ListItem` tokens the design references
|
|
23
|
+
* (`--ui-card-body-section-item-*`) do not exist in tokens-pd yet.
|
|
24
|
+
*/
|
|
25
|
+
contentList?: React.ReactNode;
|
|
26
|
+
/** Body of the `table-actions` variant — a table with row actions. */
|
|
27
|
+
contentTable?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Replace the rendered `<div>` with another element or component (Base UI
|
|
30
|
+
* composition) — e.g. render the section as a `<section>`.
|
|
31
|
+
*/
|
|
32
|
+
render?: useRender.RenderProp;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A band of content stacked inside a `Card`'s body.
|
|
36
|
+
*
|
|
37
|
+
* `hasHeader` and `title` form a discriminated union: turning the section's own
|
|
38
|
+
* mini-header on requires a title, because the header row always renders one.
|
|
39
|
+
*/
|
|
40
|
+
export type CardSectionProps = CardSectionBaseProps & ({
|
|
41
|
+
/** Shows the section's own mini-header row (14px, distinct from `CardHeader`). */
|
|
42
|
+
hasHeader: true;
|
|
43
|
+
/** The section header's title. Required whenever `hasHeader` is set. */
|
|
44
|
+
title: string;
|
|
45
|
+
} | {
|
|
46
|
+
hasHeader?: false;
|
|
47
|
+
title?: never;
|
|
48
|
+
});
|
|
49
|
+
declare const CardSection: React.ForwardRefExoticComponent<CardSectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export { CardSection, cardSectionVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardSection, cardSectionVariants, type CardSectionProps, type CardSectionBaseProps, } from './card-section';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartConfig } from '../chart';
|
|
2
|
+
import { ChartConfig, ChartPalette } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const categoryBarVariants: (props?: ({
|
|
5
5
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
@@ -18,16 +18,22 @@ export interface CategoryBarTooltipContext extends CategoryBarSegment {
|
|
|
18
18
|
percent: number;
|
|
19
19
|
/**
|
|
20
20
|
* CSS color reference for the segment — the `var(--color-<key>)` bridge, which
|
|
21
|
-
* resolves the
|
|
22
|
-
*
|
|
21
|
+
* resolves the palette stop assigned to this segment. Usable anywhere a CSS
|
|
22
|
+
* color is (e.g. a `style` background); not a literal value.
|
|
23
23
|
*/
|
|
24
24
|
color: string;
|
|
25
25
|
}
|
|
26
26
|
export interface CategoryBarProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof categoryBarVariants> {
|
|
27
27
|
/** Ordered segments (left → right). Widths are proportional to `value`. */
|
|
28
28
|
data: ReadonlyArray<CategoryBarSegment>;
|
|
29
|
-
/** Maps each segment `key` to a `label` and
|
|
29
|
+
/** Maps each segment `key` to a `label` and, optionally, a palette `tone`. */
|
|
30
30
|
config: ChartConfig;
|
|
31
|
+
/**
|
|
32
|
+
* The dataviz palette the segments are painted from. Segments take a stop of
|
|
33
|
+
* it in the palette's defined order, or the one their `tone` names. Defaults
|
|
34
|
+
* to `categorical`.
|
|
35
|
+
*/
|
|
36
|
+
palette?: ChartPalette;
|
|
31
37
|
/** Show the legend below the bar (color dot + label + value + %). */
|
|
32
38
|
showLegend?: boolean;
|
|
33
39
|
/** Show a hover tooltip per segment (dot + label + value + %). */
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const paletteArgTypes: {
|
|
2
|
+
palette: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
control: {
|
|
6
|
+
type: "select";
|
|
7
|
+
};
|
|
8
|
+
options: string[];
|
|
9
|
+
mapping: {
|
|
10
|
+
categorical: {
|
|
11
|
+
type: "categorical";
|
|
12
|
+
};
|
|
13
|
+
'sequential-blue': {
|
|
14
|
+
type: "sequential";
|
|
15
|
+
ramp: "blue";
|
|
16
|
+
};
|
|
17
|
+
'sequential-teal': {
|
|
18
|
+
type: "sequential";
|
|
19
|
+
ramp: "teal";
|
|
20
|
+
};
|
|
21
|
+
'sequential-orange': {
|
|
22
|
+
type: "sequential";
|
|
23
|
+
ramp: "orange";
|
|
24
|
+
};
|
|
25
|
+
'sequential-violet': {
|
|
26
|
+
type: "sequential";
|
|
27
|
+
ramp: "violet";
|
|
28
|
+
};
|
|
29
|
+
'diverging-blue-orange': {
|
|
30
|
+
type: "diverging";
|
|
31
|
+
pair: "blue-orange";
|
|
32
|
+
};
|
|
33
|
+
'diverging-teal-violet': {
|
|
34
|
+
type: "diverging";
|
|
35
|
+
pair: "teal-violet";
|
|
36
|
+
};
|
|
37
|
+
status: {
|
|
38
|
+
type: "status";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
table: {
|
|
42
|
+
category: string;
|
|
43
|
+
defaultValue: {
|
|
44
|
+
summary: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** A sequential ramp: one hue, eight stops from lightest to darkest. */
|
|
2
|
+
export type ChartSequentialRamp = 'blue' | 'teal' | 'orange' | 'violet';
|
|
3
|
+
/** A diverging pair: two hues meeting at a pale midpoint. */
|
|
4
|
+
export type ChartDivergingPair = 'blue-orange' | 'teal-violet';
|
|
5
|
+
/**
|
|
6
|
+
* A semantic status tone. Ordered by severity in the product's picker:
|
|
7
|
+
* danger (red) · critical (orange) · warning (yellow) · success (green) ·
|
|
8
|
+
* info (blue) · neutral (gray). Note that `critical` is orange and ranks
|
|
9
|
+
* *below* `danger` — that is what the tokens say, across the whole semantic
|
|
10
|
+
* tier, not a typo here.
|
|
11
|
+
*/
|
|
12
|
+
export type ChartStatusTone = 'danger' | 'critical' | 'warning' | 'success' | 'info' | 'neutral';
|
|
13
|
+
/** Which palette a chart's series are painted from. */
|
|
14
|
+
export type ChartPalette = {
|
|
15
|
+
type: 'categorical';
|
|
16
|
+
} | {
|
|
17
|
+
type: 'sequential';
|
|
18
|
+
ramp: ChartSequentialRamp;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'diverging';
|
|
21
|
+
pair: ChartDivergingPair;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'status';
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* How one series picks its color out of the active palette.
|
|
27
|
+
*
|
|
28
|
+
* Only the two palettes whose colors are independent of each other accept an
|
|
29
|
+
* override:
|
|
30
|
+
*
|
|
31
|
+
* - `categorical` — `{ slot }` picks one of the 16 hues.
|
|
32
|
+
* - `status` — `{ status }` names a tone.
|
|
33
|
+
*
|
|
34
|
+
* `sequential` and `diverging` accept none. Their stops are a *ramp*: the
|
|
35
|
+
* colors mean something only in relation to each other, so letting one series
|
|
36
|
+
* jump to an arbitrary stop would break the reading order the ramp exists to
|
|
37
|
+
* convey. The product's widget editor agrees — it offers a ramp/pair picker
|
|
38
|
+
* and no per-series control. An override passed under those palettes is
|
|
39
|
+
* ignored, with a dev warning.
|
|
40
|
+
*
|
|
41
|
+
* Neither form can express a color from outside the palette — that is the point.
|
|
42
|
+
*/
|
|
43
|
+
export type ChartSeriesTone = {
|
|
44
|
+
slot: number;
|
|
45
|
+
status?: never;
|
|
46
|
+
sameAs?: never;
|
|
47
|
+
} | {
|
|
48
|
+
slot?: never;
|
|
49
|
+
status: ChartStatusTone;
|
|
50
|
+
sameAs?: never;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Paint whatever the series under this key paints, under any palette. For a
|
|
54
|
+
* twin series that is the *same* metric drawn differently — a forecast tail
|
|
55
|
+
* continuing its actuals, a projection band behind its bars — where two hues
|
|
56
|
+
* would read as two metrics. Resolved by `resolveChartColors`, which is the
|
|
57
|
+
* only place the whole config is in view.
|
|
58
|
+
*/
|
|
59
|
+
| {
|
|
60
|
+
slot?: never;
|
|
61
|
+
status?: never;
|
|
62
|
+
sameAs: string;
|
|
63
|
+
};
|
|
64
|
+
/** The 16 categorical hues, in the order the product's picker lists them. */
|
|
65
|
+
export declare const CHART_CATEGORICAL_TOKENS: readonly string[];
|
|
66
|
+
/** Each sequential ramp's eight stops, lightest (1) to darkest (8). */
|
|
67
|
+
export declare const CHART_SEQUENTIAL_TOKENS: Readonly<Record<ChartSequentialRamp, readonly string[]>>;
|
|
68
|
+
/** Each diverging pair's six stops, one hue's strongest through to the other's. */
|
|
69
|
+
export declare const CHART_DIVERGING_TOKENS: Readonly<Record<ChartDivergingPair, readonly string[]>>;
|
|
70
|
+
/** The six semantic status tones. */
|
|
71
|
+
export declare const CHART_STATUS_TOKENS: Readonly<Record<ChartStatusTone, string>>;
|
|
72
|
+
/** The default palette — what a chart paints with when none is chosen. */
|
|
73
|
+
export declare const CHART_DEFAULT_PALETTE: ChartPalette;
|
|
74
|
+
/**
|
|
75
|
+
* The stops a palette offers, in picker order. `status` has named tones rather
|
|
76
|
+
* than positional stops, so it returns an empty list — use
|
|
77
|
+
* `CHART_STATUS_TOKENS` for those.
|
|
78
|
+
*/
|
|
79
|
+
export declare function listPaletteStops(palette: ChartPalette): readonly string[];
|
|
80
|
+
/**
|
|
81
|
+
* Every choice a per-series picker may offer for this palette — what the
|
|
82
|
+
* product's widget editor renders in its dropdown. Pure, so the form can build
|
|
83
|
+
* its UI without re-deriving the palette.
|
|
84
|
+
*
|
|
85
|
+
* Empty for `sequential` and `diverging`: those have no per-series control, so
|
|
86
|
+
* a form driven by this function renders no picker for them, which is exactly
|
|
87
|
+
* the design.
|
|
88
|
+
*/
|
|
89
|
+
export declare function listPaletteChoices(palette: ChartPalette): readonly ChartSeriesTone[];
|
|
90
|
+
export interface ResolveSeriesColorOptions {
|
|
91
|
+
/** This series' position among the chart's series. */
|
|
92
|
+
index: number;
|
|
93
|
+
/** This series' explicit choice within the palette, if it may make one. */
|
|
94
|
+
tone?: ChartSeriesTone;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The color one series paints with.
|
|
98
|
+
*
|
|
99
|
+
* Series walk the palette **in its defined order** — series 1 takes stop 1,
|
|
100
|
+
* series 2 takes stop 2, and so on, wrapping once the stops run out. The order
|
|
101
|
+
* is the design's, not something derived here: no re-ordering, no spreading
|
|
102
|
+
* across a ramp, no skipping stops.
|
|
103
|
+
*
|
|
104
|
+
* On top of that, `categorical` and `status` honour a per-series override
|
|
105
|
+
* (see `ChartSeriesTone`); `sequential` and `diverging` do not.
|
|
106
|
+
*
|
|
107
|
+
* Always returns a token from the active palette. A `slot` out of range is
|
|
108
|
+
* clamped (with a dev warning) rather than passed through, so switching
|
|
109
|
+
* palettes can never leave a series painting off-palette.
|
|
110
|
+
*/
|
|
111
|
+
export declare function resolveSeriesColor(palette: ChartPalette, { index, tone }: ResolveSeriesColorOptions): string;
|
|
112
|
+
/**
|
|
113
|
+
* Series that would paint the same color — what the widget editor's "duplicate
|
|
114
|
+
* color" warning is keyed to. Returns one group per collision, each holding the
|
|
115
|
+
* colliding series' keys in input order.
|
|
116
|
+
*
|
|
117
|
+
* Only series that named a `tone` can collide: automatic assignment is
|
|
118
|
+
* injective by construction (up to `categorical`'s 16-series wrap).
|
|
119
|
+
*
|
|
120
|
+
* Pass the chart's `config` to exclude intentional aliases: a series with
|
|
121
|
+
* `tone: { sameAs }` shares its target's colour on purpose, so it is not a
|
|
122
|
+
* collision. Without the config every alias reads as a duplicate.
|
|
123
|
+
*/
|
|
124
|
+
export declare function findDuplicateTones(colors: Readonly<Record<string, string>>, config?: Readonly<Record<string, {
|
|
125
|
+
tone?: {
|
|
126
|
+
sameAs?: string;
|
|
127
|
+
};
|
|
128
|
+
}>>): string[][];
|
|
@@ -2,24 +2,43 @@ import { LegendPayload } from 'recharts/types/component/DefaultLegendContent';
|
|
|
2
2
|
import { NameType, Payload, ValueType } from 'recharts/types/component/DefaultTooltipContent';
|
|
3
3
|
import { Props as LegendProps } from 'recharts/types/component/Legend';
|
|
4
4
|
import { TooltipContentProps } from 'recharts/types/component/Tooltip';
|
|
5
|
+
import { ChartPalette, ChartSeriesTone } from './chart-palette';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import * as RechartsPrimitive from 'recharts';
|
|
7
|
-
declare const THEMES: {
|
|
8
|
-
readonly light: "";
|
|
9
|
-
readonly dark: "[data-theme='dark']";
|
|
10
|
-
};
|
|
11
8
|
export type ChartConfig = {
|
|
12
9
|
[k in string]: {
|
|
13
10
|
label?: React.ReactNode;
|
|
14
11
|
icon?: React.ComponentType;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Which stop of the container's `palette` this series paints with. Left
|
|
14
|
+
* unset, it is assigned from the series' position. See `ChartSeriesTone`.
|
|
15
|
+
*
|
|
16
|
+
* There is deliberately no free-form `color` here: every series colour
|
|
17
|
+
* comes from the chart's palette, so a chart cannot paint a hue the design
|
|
18
|
+
* system does not define. Pick a different palette on `ChartContainer`, or
|
|
19
|
+
* a different stop of it with this.
|
|
20
|
+
*/
|
|
21
|
+
tone?: ChartSeriesTone;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A `ChartConfig` with every series' palette colour filled in. This is what the
|
|
26
|
+
* container puts on the context, so the plot, the tooltip rows and the legend
|
|
27
|
+
* markers all read the same resolved colour.
|
|
28
|
+
*/
|
|
29
|
+
export type ResolvedChartConfig = {
|
|
30
|
+
[k in string]: ChartConfig[string] & {
|
|
31
|
+
color: string;
|
|
32
|
+
};
|
|
22
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Resolve each series' colour out of `palette` — in the palette's defined
|
|
36
|
+
* order, honouring any `tone` a series named.
|
|
37
|
+
*
|
|
38
|
+
* Exported for tests and for the widget editor, which needs the same resolved
|
|
39
|
+
* map to detect duplicate colours (`findDuplicateTones`) without re-deriving it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveChartColors(config: ChartConfig, palette: ChartPalette): ResolvedChartConfig;
|
|
23
42
|
export type ChartTooltipContentProps = Partial<TooltipContentProps<ValueType, NameType>> & {
|
|
24
43
|
className?: string;
|
|
25
44
|
hideLabel?: boolean;
|
|
@@ -44,20 +63,52 @@ export type ChartLegendContentProps = {
|
|
|
44
63
|
* legend out inside its plot (see `Treemap`).
|
|
45
64
|
*/
|
|
46
65
|
config?: ChartConfig;
|
|
66
|
+
/**
|
|
67
|
+
* `default` — the current horizontal wrap layout (one row of chips).
|
|
68
|
+
* `list` — a vertical list where each entry is `[dot] [label flex-1] [value]`,
|
|
69
|
+
* matching the Figma donut/radial widget legend. Use alongside a manually-built
|
|
70
|
+
* `payload` passed from outside the chart's recharts composition.
|
|
71
|
+
*/
|
|
72
|
+
variant?: 'default' | 'list';
|
|
73
|
+
/**
|
|
74
|
+
* When `variant="list"`, the field on `payload[i].payload` to display as the
|
|
75
|
+
* right-hand value. Typically the chart's `dataKey` (the numeric series field).
|
|
76
|
+
*/
|
|
77
|
+
valueKey?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Format the value shown in each list entry. When omitted the raw value is
|
|
80
|
+
* stringified with `String()`.
|
|
81
|
+
*/
|
|
82
|
+
valueFormatter?: (value: string | number) => string;
|
|
47
83
|
};
|
|
48
84
|
export interface ChartContainerProps extends React.ComponentProps<'div'> {
|
|
85
|
+
/**
|
|
86
|
+
* The series this chart draws, keyed by data field.
|
|
87
|
+
*
|
|
88
|
+
* Declare exactly what the chart plots. A stop is assigned by an entry's
|
|
89
|
+
* position here, not by which series end up rendered, so an entry for a
|
|
90
|
+
* series the chart doesn't draw still consumes a colour and shifts the ones
|
|
91
|
+
* that follow it. (That is deliberate: a series then keeps its colour when a
|
|
92
|
+
* sibling is toggled off, instead of the whole chart recolouring.)
|
|
93
|
+
*/
|
|
49
94
|
config: ChartConfig;
|
|
95
|
+
/**
|
|
96
|
+
* The dataviz palette this chart's series are painted from. Series take a
|
|
97
|
+
* stop of it in the palette's defined order, or the one their `tone` names.
|
|
98
|
+
* Defaults to `categorical` — there is no "no palette" state.
|
|
99
|
+
*/
|
|
100
|
+
palette?: ChartPalette;
|
|
50
101
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
51
102
|
}
|
|
52
|
-
declare function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
declare const ChartStyle: ({ id, config }: {
|
|
103
|
+
declare function ChartContainer({ id, className, children, config, palette, ...props }: ChartContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
declare const ChartStyle: ({ id, config, }: {
|
|
54
105
|
id: string;
|
|
55
|
-
config:
|
|
106
|
+
config: ResolvedChartConfig;
|
|
56
107
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
57
108
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
58
109
|
/** The `content` a caller passes to override the default tooltip (recharts' `Tooltip['content']`). */
|
|
59
110
|
export type ChartTooltipContentType = React.ComponentProps<typeof ChartTooltip>['content'];
|
|
60
111
|
declare function ChartTooltipContent({ active, payload, label, className, hideLabel, hideIndicator, labelFormatter, formatter, labelClassName, color, nameKey, labelKey, }: ChartTooltipContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
61
112
|
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
62
|
-
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, config: configFromProps, }: ChartLegendContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
113
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, config: configFromProps, variant, valueKey, valueFormatter, }: ChartLegendContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
63
114
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|