@acronis-platform/ui-react 0.57.1 → 0.58.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 +149 -0
- package/dist/components/ui/area-chart/area-chart.js.map +1 -0
- package/dist/components/ui/bar-chart/bar-chart.js +152 -77
- 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/card-filter/card-filter.js +40 -27
- package/dist/components/ui/card-filter/card-filter.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 +107 -0
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js +195 -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 +250 -78
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- 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/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 +108 -0
- package/dist/components/ui/histogram/histogram.js.map +1 -0
- 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 +206 -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/scatter-chart/scatter-chart.js +102 -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/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 +423 -384
- package/dist/index.js.map +1 -1
- package/dist/react.js +423 -384
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +49 -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 +42 -2
- 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/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 +48 -0
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +79 -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-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/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 +55 -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 +83 -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/scatter-chart/index.d.ts +1 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +50 -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 +22 -2
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { cva as R } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { AreaChart as V, CartesianGrid as k, XAxis as w, YAxis as z, Area as B } from "recharts";
|
|
5
|
+
import { cn as K } from "../../../lib/utils.js";
|
|
6
|
+
import { ChartContainer as M, ChartTooltip as S, ChartTooltipContent as X, ChartLegend as Y, ChartLegendContent as _ } from "../chart/chart.js";
|
|
7
|
+
const b = R("", {
|
|
8
|
+
variants: {
|
|
9
|
+
layout: {
|
|
10
|
+
single: "",
|
|
11
|
+
stacked: ""
|
|
12
|
+
},
|
|
13
|
+
fill: {
|
|
14
|
+
solid: "",
|
|
15
|
+
gradient: ""
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
layout: "single",
|
|
20
|
+
fill: "gradient"
|
|
21
|
+
}
|
|
22
|
+
}), q = f.forwardRef(
|
|
23
|
+
({
|
|
24
|
+
className: p,
|
|
25
|
+
config: m,
|
|
26
|
+
data: h,
|
|
27
|
+
dataKeys: s,
|
|
28
|
+
xKey: g,
|
|
29
|
+
xAxisLabel: e,
|
|
30
|
+
yAxisLabel: r,
|
|
31
|
+
yUnit: v,
|
|
32
|
+
layout: i = "single",
|
|
33
|
+
fill: o = "gradient",
|
|
34
|
+
curve: C = "monotone",
|
|
35
|
+
strokeWidth: u = 2,
|
|
36
|
+
fillOpacity: $ = 0.4,
|
|
37
|
+
showDots: l = !1,
|
|
38
|
+
connectNulls: A = !1,
|
|
39
|
+
showGrid: x = !0,
|
|
40
|
+
showTooltip: y = !0,
|
|
41
|
+
showLegend: T = !0,
|
|
42
|
+
tooltipContent: G,
|
|
43
|
+
...I
|
|
44
|
+
}, L) => {
|
|
45
|
+
const N = i === "stacked", n = o === "gradient", O = e ? { value: e, position: "insideBottom", offset: 0 } : void 0, j = r ? {
|
|
46
|
+
value: r,
|
|
47
|
+
angle: -90,
|
|
48
|
+
position: "insideLeft",
|
|
49
|
+
style: { textAnchor: "middle" }
|
|
50
|
+
} : void 0, d = `area-gradient-${f.useId().replace(/:/g, "")}`;
|
|
51
|
+
return /* @__PURE__ */ t(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref: L,
|
|
55
|
+
"data-layout": i,
|
|
56
|
+
"data-fill": o,
|
|
57
|
+
className: K(b({ layout: i, fill: o }), p),
|
|
58
|
+
...I,
|
|
59
|
+
children: /* @__PURE__ */ t(
|
|
60
|
+
M,
|
|
61
|
+
{
|
|
62
|
+
config: m,
|
|
63
|
+
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
64
|
+
children: /* @__PURE__ */ c(V, { data: h, children: [
|
|
65
|
+
n && /* @__PURE__ */ t("defs", { children: s.map((a) => /* @__PURE__ */ c(
|
|
66
|
+
"linearGradient",
|
|
67
|
+
{
|
|
68
|
+
id: `${d}-${a}`,
|
|
69
|
+
x1: "0",
|
|
70
|
+
y1: "0",
|
|
71
|
+
x2: "0",
|
|
72
|
+
y2: "1",
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
|
+
"stop",
|
|
76
|
+
{
|
|
77
|
+
offset: "5%",
|
|
78
|
+
stopColor: `var(--color-${a})`,
|
|
79
|
+
stopOpacity: 0.8
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
"stop",
|
|
84
|
+
{
|
|
85
|
+
offset: "95%",
|
|
86
|
+
stopColor: `var(--color-${a})`,
|
|
87
|
+
stopOpacity: 0.1
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
a
|
|
93
|
+
)) }),
|
|
94
|
+
x && /* @__PURE__ */ t(k, { vertical: !1 }),
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
w,
|
|
97
|
+
{
|
|
98
|
+
dataKey: g,
|
|
99
|
+
type: "category",
|
|
100
|
+
tickLine: !1,
|
|
101
|
+
axisLine: !1,
|
|
102
|
+
tickMargin: 8,
|
|
103
|
+
height: e ? 48 : void 0,
|
|
104
|
+
label: O
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
z,
|
|
109
|
+
{
|
|
110
|
+
type: "number",
|
|
111
|
+
tickLine: !1,
|
|
112
|
+
axisLine: !1,
|
|
113
|
+
unit: v,
|
|
114
|
+
width: r ? 72 : void 0,
|
|
115
|
+
label: j
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
y && /* @__PURE__ */ t(S, { content: G ?? /* @__PURE__ */ t(X, {}) }),
|
|
119
|
+
T && /* @__PURE__ */ t(Y, { content: /* @__PURE__ */ t(_, {}) }),
|
|
120
|
+
s.map((a) => /* @__PURE__ */ t(
|
|
121
|
+
B,
|
|
122
|
+
{
|
|
123
|
+
type: C ?? "monotone",
|
|
124
|
+
dataKey: a,
|
|
125
|
+
stackId: N ? "a" : void 0,
|
|
126
|
+
stroke: `var(--color-${a})`,
|
|
127
|
+
strokeWidth: u,
|
|
128
|
+
fill: n ? `url(#${d}-${a})` : `var(--color-${a})`,
|
|
129
|
+
fillOpacity: n ? 1 : $,
|
|
130
|
+
dot: l ? { r: 3 } : !1,
|
|
131
|
+
activeDot: l ? { r: 5 } : !1,
|
|
132
|
+
connectNulls: A,
|
|
133
|
+
isAnimationActive: !1
|
|
134
|
+
},
|
|
135
|
+
a
|
|
136
|
+
))
|
|
137
|
+
] })
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
q.displayName = "AreaChart";
|
|
145
|
+
export {
|
|
146
|
+
q as AreaChart,
|
|
147
|
+
b as areaChartVariants
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=area-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area-chart.js","sources":["../../../../src/components/ui/area-chart/area-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n AreaChart as RechartsAreaChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Area-chart variant set: `layout` (independent\n// overlapping areas vs summed on a shared stack) and `fill` (a flat translucent\n// fill vs a vertical gradient). The classes stay empty because recharts' SVG —\n// not CSS — draws the areas: `layout` drives each `<Area>`'s `stackId` and `fill`\n// drives whether it paints from a `<linearGradient>` def or a flat token color.\n// CVA is kept so the variant set is a first-class, spec-conformant part of the\n// API (matched against ui-spec's api.yaml enums) and exposed via `VariantProps`;\n// the resolved values are also mirrored onto `data-layout` / `data-fill`.\nconst areaChartVariants = cva('', {\n variants: {\n layout: {\n single: '',\n stacked: '',\n },\n fill: {\n solid: '',\n gradient: '',\n },\n },\n defaultVariants: {\n layout: 'single',\n fill: 'gradient',\n },\n});\n\nexport interface AreaChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof areaChartVariants> {\n /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Area>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */\n yUnit?: string;\n /** Interpolation between points. */\n curve?: 'linear' | 'monotone' | 'step';\n /** Stroke width of each area's top border. */\n strokeWidth?: number;\n /** Flat-fill opacity — used only when `fill=\"solid\"` (gradient controls its own stops). */\n fillOpacity?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the area. */\n connectNulls?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n layout = 'single',\n fill = 'gradient',\n curve = 'monotone',\n strokeWidth = 2,\n fillOpacity = 0.4,\n showDots = false,\n connectNulls = false,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n const isStacked = layout === 'stacked';\n const isGradient = fill === 'gradient';\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // recharts renders SVG <defs> once per chart; the gradient ids must be unique\n // across chart instances on the page. useId gives a stable per-instance id;\n // strip the colons React emits (invalid in a url(#…) reference) — same guard\n // the shared ChartContainer applies to its chart id.\n const gradientId = `area-gradient-${React.useId().replace(/:/g, '')}`;\n\n return (\n <div\n ref={ref}\n data-layout={layout}\n data-fill={fill}\n className={cn(areaChartVariants({ layout, fill }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsAreaChart data={data as readonly unknown[]}>\n {isGradient && (\n <defs>\n {dataKeys.map((key) => (\n <linearGradient\n key={key}\n id={`${gradientId}-${key}`}\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop\n offset=\"5%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.8}\n />\n <stop\n offset=\"95%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.1}\n />\n </linearGradient>\n ))}\n </defs>\n )}\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key) => (\n <Area\n key={key}\n type={curve ?? 'monotone'}\n dataKey={key}\n stackId={isStacked ? 'a' : undefined}\n stroke={`var(--color-${key})`}\n strokeWidth={strokeWidth}\n fill={isGradient ? `url(#${gradientId}-${key})` : `var(--color-${key})`}\n fillOpacity={isGradient ? 1 : fillOpacity}\n dot={showDots ? { r: 3 } : false}\n activeDot={showDots ? { r: 5 } : false}\n connectNulls={connectNulls}\n isAnimationActive={false}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n </div>\n );\n }\n);\nAreaChart.displayName = 'AreaChart';\n\nexport { AreaChart, areaChartVariants };\n"],"names":["areaChartVariants","cva","AreaChart","React","className","config","data","dataKeys","xKey","xAxisLabel","yAxisLabel","yUnit","layout","fill","curve","strokeWidth","fillOpacity","showDots","connectNulls","showGrid","showTooltip","showLegend","tooltipContent","props","ref","isStacked","isGradient","xAxisTitle","yAxisTitle","gradientId","jsx","cn","ChartContainer","jsxs","RechartsAreaChart","key","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","Area"],"mappings":";;;;;;AA+BA,MAAMA,IAAoBC,EAAI,IAAI;AAAA,EAChC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAEV,CAAC,GA6CKC,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,aAAAC,IAAc;AAAA,IACd,UAAAC,IAAW;AAAA,IACX,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAYb,MAAW,WACvBc,IAAab,MAAS,YAKtBc,IAAalB,IACf,EAAE,OAAOA,GAAY,UAAU,gBAAyB,QAAQ,EAAA,IAChE,QACEmB,IAAalB,IACf;AAAA,MACE,OAAOA;AAAA,MACP,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,EAAE,YAAY,SAAA;AAAA,IAAkB,IAEzC,QAMEmB,IAAa,iBAAiB1B,EAAM,MAAA,EAAQ,QAAQ,MAAM,EAAE,CAAC;AAEnE,W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AAAA,cAAA;AAAA,cAET,gBAAAG;AAAA,gBAACQ;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,MAAM3B;AAAA,kBACN,OAAOD,IAAa,KAAK;AAAA,kBACzB,OAAOkB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAERR,KACC,gBAAAU,EAACS,GAAA,EAAa,SAASjB,KAAkB,gBAAAQ,EAACU,KAAoB,GAAI;AAAA,cAEnEnB,KAAc,gBAAAS,EAACW,GAAA,EAAY,SAAS,gBAAAX,EAACY,KAAmB,GAAI;AAAA,cAC5DnC,EAAS,IAAI,CAAC4B,MACb,gBAAAL;AAAA,gBAACa;AAAA,gBAAA;AAAA,kBAEC,MAAM7B,KAAS;AAAA,kBACf,SAASqB;AAAA,kBACT,SAASV,IAAY,MAAM;AAAA,kBAC3B,QAAQ,eAAeU,CAAG;AAAA,kBAC1B,aAAApB;AAAA,kBACA,MAAMW,IAAa,QAAQG,CAAU,IAAIM,CAAG,MAAM,eAAeA,CAAG;AAAA,kBACpE,aAAaT,IAAa,IAAIV;AAAA,kBAC9B,KAAKC,IAAW,EAAE,GAAG,MAAM;AAAA,kBAC3B,WAAWA,IAAW,EAAE,GAAG,MAAM;AAAA,kBACjC,cAAAC;AAAA,kBACA,mBAAmB;AAAA,gBAAA;AAAA,gBAXdiB;AAAA,cAAA,CAaR;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAjC,EAAU,cAAc;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { BarChart as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ChartContainer as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import * as R from "react";
|
|
3
|
+
import { cva as S } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { BarChart as F, CartesianGrid as G, XAxis as z, YAxis as k, Bar as I, ReferenceLine as M } from "recharts";
|
|
5
|
+
import { cn as O } from "../../../lib/utils.js";
|
|
6
|
+
import { ChartContainer as X, ChartTooltip as Y, ChartTooltipContent as _, ChartLegend as q, ChartLegendContent as E } from "../chart/chart.js";
|
|
7
|
+
const H = S("", {
|
|
8
8
|
variants: {
|
|
9
9
|
orientation: {
|
|
10
10
|
vertical: "",
|
|
@@ -19,86 +19,161 @@ const K = A("", {
|
|
|
19
19
|
orientation: "vertical",
|
|
20
20
|
layout: "grouped"
|
|
21
21
|
}
|
|
22
|
-
})
|
|
22
|
+
});
|
|
23
|
+
function J(e, h, d) {
|
|
24
|
+
if (!e) return;
|
|
25
|
+
if (typeof e.value == "number") return e.value;
|
|
26
|
+
if (!e.average) return;
|
|
27
|
+
const n = typeof e.average == "string" ? [e.average] : d, l = h.flatMap(
|
|
28
|
+
(o) => n.map((a) => o[a]).filter((a) => typeof a == "number")
|
|
29
|
+
);
|
|
30
|
+
if (l.length !== 0)
|
|
31
|
+
return l.reduce((o, a) => o + a, 0) / l.length;
|
|
32
|
+
}
|
|
33
|
+
const K = R.forwardRef(
|
|
23
34
|
({
|
|
24
|
-
className:
|
|
25
|
-
config:
|
|
26
|
-
data:
|
|
35
|
+
className: e,
|
|
36
|
+
config: h,
|
|
37
|
+
data: d,
|
|
27
38
|
dataKeys: n,
|
|
28
39
|
xKey: l,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
referenceLine: o,
|
|
41
|
+
xAxisLabel: a,
|
|
42
|
+
yAxisLabel: u,
|
|
43
|
+
xUnit: x,
|
|
44
|
+
yUnit: B,
|
|
45
|
+
orientation: r = "vertical",
|
|
46
|
+
layout: f = "grouped",
|
|
47
|
+
barRadius: s = 4,
|
|
48
|
+
showGrid: b = !0,
|
|
49
|
+
showTooltip: T = !0,
|
|
50
|
+
showLegend: w = !0,
|
|
51
|
+
tooltipContent: $,
|
|
52
|
+
...A
|
|
53
|
+
}, N) => {
|
|
54
|
+
const V = r === "horizontal" ? "vertical" : "horizontal", m = f === "stacked", j = o ? Array.isArray(o) ? o : [o] : [], g = a ? { value: a, position: "insideBottom", offset: 0 } : void 0, y = u ? {
|
|
55
|
+
value: u,
|
|
56
|
+
angle: -90,
|
|
57
|
+
position: "insideLeft",
|
|
58
|
+
style: { textAnchor: "middle" }
|
|
59
|
+
} : void 0, D = r === "horizontal" ? [0, s, s, 0] : [s, s, 0, 0];
|
|
38
60
|
return /* @__PURE__ */ t(
|
|
39
61
|
"div",
|
|
40
62
|
{
|
|
41
|
-
ref:
|
|
42
|
-
"data-orientation":
|
|
43
|
-
"data-layout":
|
|
44
|
-
className:
|
|
45
|
-
...
|
|
46
|
-
children: /* @__PURE__ */ t(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
63
|
+
ref: N,
|
|
64
|
+
"data-orientation": r,
|
|
65
|
+
"data-layout": f,
|
|
66
|
+
className: O(H({ orientation: r, layout: f }), e),
|
|
67
|
+
...A,
|
|
68
|
+
children: /* @__PURE__ */ t(
|
|
69
|
+
X,
|
|
70
|
+
{
|
|
71
|
+
config: h,
|
|
72
|
+
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
73
|
+
children: /* @__PURE__ */ p(F, { data: d, layout: V, children: [
|
|
74
|
+
b && /* @__PURE__ */ t(
|
|
75
|
+
G,
|
|
76
|
+
{
|
|
77
|
+
horizontal: r === "vertical",
|
|
78
|
+
vertical: r === "horizontal"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
r === "horizontal" ? /* @__PURE__ */ p(C, { children: [
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
z,
|
|
84
|
+
{
|
|
85
|
+
type: "number",
|
|
86
|
+
tickLine: !1,
|
|
87
|
+
axisLine: !1,
|
|
88
|
+
unit: x,
|
|
89
|
+
height: a ? 48 : void 0,
|
|
90
|
+
label: g
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ t(
|
|
94
|
+
k,
|
|
95
|
+
{
|
|
96
|
+
dataKey: l,
|
|
97
|
+
type: "category",
|
|
98
|
+
tickLine: !1,
|
|
99
|
+
axisLine: !1,
|
|
100
|
+
width: u ? 96 : 80,
|
|
101
|
+
label: y
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] }) : /* @__PURE__ */ p(C, { children: [
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
z,
|
|
107
|
+
{
|
|
108
|
+
dataKey: l,
|
|
109
|
+
type: "category",
|
|
110
|
+
tickLine: !1,
|
|
111
|
+
axisLine: !1,
|
|
112
|
+
height: a ? 48 : void 0,
|
|
113
|
+
label: g
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
k,
|
|
118
|
+
{
|
|
119
|
+
type: "number",
|
|
120
|
+
tickLine: !1,
|
|
121
|
+
axisLine: !1,
|
|
122
|
+
unit: B,
|
|
123
|
+
width: u ? 72 : void 0,
|
|
124
|
+
label: y
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }),
|
|
128
|
+
T && /* @__PURE__ */ t(Y, { content: $ ?? /* @__PURE__ */ t(_, {}) }),
|
|
129
|
+
w && /* @__PURE__ */ t(q, { content: /* @__PURE__ */ t(E, {}) }),
|
|
130
|
+
n.map((i, v) => {
|
|
131
|
+
const c = m ? v === n.length - 1 : !0;
|
|
132
|
+
return /* @__PURE__ */ t(
|
|
133
|
+
I,
|
|
134
|
+
{
|
|
135
|
+
dataKey: i,
|
|
136
|
+
fill: `var(--color-${i})`,
|
|
137
|
+
stackId: m ? "a" : void 0,
|
|
138
|
+
radius: s > 0 && c ? D : void 0,
|
|
139
|
+
isAnimationActive: !1
|
|
140
|
+
},
|
|
141
|
+
i
|
|
142
|
+
);
|
|
143
|
+
}),
|
|
144
|
+
j.map((i, v) => {
|
|
145
|
+
const c = J(i, d, n);
|
|
146
|
+
return c === void 0 ? null : /* @__PURE__ */ t(
|
|
147
|
+
M,
|
|
148
|
+
{
|
|
149
|
+
...r === "horizontal" ? { x: c } : { y: c },
|
|
150
|
+
stroke: "var(--ui-text-on-surface-secondary)",
|
|
151
|
+
strokeDasharray: "4 4",
|
|
152
|
+
ifOverflow: "extendDomain",
|
|
153
|
+
label: i.label ? {
|
|
154
|
+
value: i.label,
|
|
155
|
+
// Sit the caption at the top of the line: above the
|
|
156
|
+
// right end of a horizontal line (vertical bars), or
|
|
157
|
+
// above the top of a vertical line (horizontal bars).
|
|
158
|
+
position: r === "horizontal" ? "top" : "insideTopRight",
|
|
159
|
+
fill: "var(--ui-text-on-surface-secondary)",
|
|
160
|
+
fontSize: 12
|
|
161
|
+
} : void 0
|
|
162
|
+
},
|
|
163
|
+
`${i.label ?? "ref"}-${v}`
|
|
164
|
+
);
|
|
165
|
+
})
|
|
166
|
+
] })
|
|
167
|
+
}
|
|
168
|
+
)
|
|
95
169
|
}
|
|
96
170
|
);
|
|
97
171
|
}
|
|
98
172
|
);
|
|
99
|
-
|
|
173
|
+
K.displayName = "BarChart";
|
|
100
174
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
175
|
+
K as BarChart,
|
|
176
|
+
J as barChartReferenceValue,
|
|
177
|
+
H as barChartVariants
|
|
103
178
|
};
|
|
104
179
|
//# sourceMappingURL=bar-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants> {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n ...props\n },\n ref\n ) => {\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer config={config} className=\"size-full\">\n <RechartsBarChart data={data as readonly unknown[]} layout={rechartsLayout}>\n {showGrid && (\n <CartesianGrid\n horizontal={orientation === 'vertical'}\n vertical={orientation === 'horizontal'}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n <XAxis type=\"number\" tickLine={false} axisLine={false} />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n width={80}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n />\n <YAxis type=\"number\" tickLine={false} axisLine={false} />\n </>\n )}\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n return (\n <Bar\n key={key}\n dataKey={key}\n fill={`var(--color-${key})`}\n stackId={isStacked ? 'a' : undefined}\n radius={barRadius > 0 && rounded ? endRadius : undefined}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","BarChart","React","className","config","data","dataKeys","xKey","orientation","layout","barRadius","showGrid","showTooltip","showLegend","props","ref","rechartsLayout","isStacked","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","key","index","rounded","Bar"],"mappings":";;;;;;AA+BA,MAAMA,IAAmBC,EAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,EAAA;AAEZ,CAAC,GAwBKC,IAAWC,EAAM;AAAA,EACrB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EAAA,GAELC,MACG;AAEH,UAAMC,I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ACS,GAAA,EAAa,SAAS,gBAAAT,EAACU,KAAoB,GAAI;AAAA,UAC/DhB,KAAc,gBAAAM,EAACW,GAAA,EAAY,SAAS,gBAAAX,EAACY,KAAmB,GAAI;AAAA,UAC5DzB,EAAS,IAAI,CAAC0B,GAAKC,MAAU;AAG5B,kBAAMC,IAAUjB,IAAYgB,MAAU3B,EAAS,SAAS,IAAI;AAC5D,mBACE,gBAAAa;AAAA,cAACgB;AAAA,cAAA;AAAA,gBAEC,SAASH;AAAA,gBACT,MAAM,eAAeA,CAAG;AAAA,gBACxB,SAASf,IAAY,MAAM;AAAA,gBAC3B,QAAQP,IAAY,KAAKwB,IAAUhB,IAAY;AAAA,gBAC/C,mBAAmB;AAAA,cAAA;AAAA,cALdc;AAAA,YAAA;AAAA,UAQX,CAAC;AAAA,QAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA/B,EAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\nexport interface BarChartReferenceLine {\n /** Fixed position on the value axis. Takes precedence over `average`. */\n value?: number;\n /**\n * Draw the line at the mean of one series (a `dataKeys` entry) or, when\n * `true`, of every plotted series' values.\n */\n average?: boolean | string;\n /** Optional caption rendered alongside the line. */\n label?: string;\n}\n\n/**\n * Resolve a `referenceLine` config to a position on the value axis: a fixed\n * `value` wins; otherwise the mean of the requested series (a single `dataKeys`\n * entry, or all of them when `average` is `true`). Returns `undefined` when\n * there is nothing to draw (no config, or no numeric values to average).\n * Exported for unit tests; not part of the package's public API.\n */\nexport function barChartReferenceValue(\n referenceLine: BarChartReferenceLine | undefined,\n data: ReadonlyArray<Record<string, string | number>>,\n dataKeys: string[]\n): number | undefined {\n if (!referenceLine) return undefined;\n if (typeof referenceLine.value === 'number') return referenceLine.value;\n if (!referenceLine.average) return undefined;\n\n const keys =\n typeof referenceLine.average === 'string'\n ? [referenceLine.average]\n : dataKeys;\n const nums = data.flatMap((row) =>\n keys\n .map((key) => row[key])\n .filter((value): value is number => typeof value === 'number')\n );\n if (nums.length === 0) return undefined;\n return nums.reduce((sum, n) => sum + n, 0) / nums.length;\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants> {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /**\n * One or more dashed reference/average lines on the value axis (Y for vertical\n * bars, X for horizontal). Each is driven by a fixed `value` or a computed\n * series `average`. Pass a single object or an array to draw several at once.\n */\n referenceLine?: BarChartReferenceLine | BarChartReferenceLine[];\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Unit suffix on Y-axis tick values (recharts `unit`) — applies when the Y axis is numeric (`orientation=\"vertical\"`). */\n yUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n\n const referenceLines = referenceLine\n ? Array.isArray(referenceLine)\n ? referenceLine\n : [referenceLine]\n : [];\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data as readonly unknown[]} layout={rechartsLayout}>\n {showGrid && (\n <CartesianGrid\n horizontal={orientation === 'vertical'}\n vertical={orientation === 'horizontal'}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n <XAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n )}\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n return (\n <Bar\n key={key}\n dataKey={key}\n fill={`var(--color-${key})`}\n stackId={isStacked ? 'a' : undefined}\n radius={barRadius > 0 && rounded ? endRadius : undefined}\n isAnimationActive={false}\n />\n );\n })}\n {referenceLines.map((ref, index) => {\n const value = barChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n // Draw on the value axis: Y for vertical bars, X for horizontal.\n {...(orientation === 'horizontal' ? { x: value } : { y: value })}\n stroke=\"var(--ui-text-on-surface-secondary)\"\n strokeDasharray=\"4 4\"\n // extendDomain so a target beyond the data max stays visible.\n ifOverflow=\"extendDomain\"\n label={\n ref.label\n ? {\n value: ref.label,\n // Sit the caption at the top of the line: above the\n // right end of a horizontal line (vertical bars), or\n // above the top of a vertical line (horizontal bars).\n position:\n orientation === 'horizontal'\n ? 'top'\n : 'insideTopRight',\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined\n }\n />\n );\n })}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","barChartReferenceValue","referenceLine","data","dataKeys","keys","nums","row","key","value","sum","n","BarChart","React","className","config","xKey","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","showGrid","showTooltip","showLegend","tooltipContent","props","ref","rechartsLayout","isStacked","referenceLines","xAxisTitle","yAxisTitle","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","index","rounded","Bar","ReferenceLine"],"mappings":";;;;;;AAgCA,MAAMA,IAAmBC,EAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,EAAA;AA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AA,sBACE,OAAOA,EAAI;AAAA;AAAA;AAAA;AAAA,sBAIX,UACER,MAAgB,eACZ,QACA;AAAA,sBACN,MAAM;AAAA,sBACN,UAAU;AAAA,oBAAA,IAEZ;AAAA,kBAAA;AAAA,kBArBD,GAAGQ,EAAI,SAAS,KAAK,IAAIoB,CAAK;AAAA,gBAAA;AAAA,cAyBzC,CAAC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACArC,EAAS,cAAc;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { mergeProps as a } from "@base-ui/react/merge-props";
|
|
3
|
+
import { useRender as u } from "@base-ui/react/use-render";
|
|
4
|
+
import { cva as c } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { cn as l } from "../../../lib/utils.js";
|
|
6
|
+
const v = c(
|
|
7
|
+
"inline-flex size-[var(--ui-button-icon-input-global-container-width)] shrink-0 items-center justify-center rounded-[var(--ui-button-icon-input-global-container-border-radius)] outline-none transition-colors cursor-pointer disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-[var(--ui-button-icon-input-normal-container-color-disabled)] disabled:text-[var(--ui-button-icon-input-normal-icon-color-disabled)] focus-visible:ring-[3px] [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
normal: "bg-[var(--ui-button-icon-input-normal-container-color-idle)] text-[var(--ui-button-icon-input-normal-icon-color-idle)] hover:bg-[var(--ui-button-icon-input-normal-container-color-hover)] hover:text-[var(--ui-button-icon-input-normal-icon-color-hover)] active:bg-[var(--ui-button-icon-input-normal-container-color-active)] active:text-[var(--ui-button-icon-input-normal-icon-color-active)] focus-visible:ring-[var(--ui-focus-primary)] [&_svg]:size-[var(--ui-button-icon-input-normal-icon-size)]",
|
|
12
|
+
error: "bg-[var(--ui-button-icon-input-error-container-color-idle)] text-[var(--ui-button-icon-input-error-icon-color-idle)] hover:bg-[var(--ui-button-icon-input-error-container-color-hover)] hover:text-[var(--ui-button-icon-input-error-icon-color-hover)] active:bg-[var(--ui-button-icon-input-error-container-color-active)] active:text-[var(--ui-button-icon-input-error-icon-color-active)] focus-visible:ring-[var(--ui-focus-error)] [&_svg]:size-[var(--ui-button-icon-input-error-icon-size)]"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "normal"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
), s = e.forwardRef(({ className: o, variant: n, render: r, ...i }, t) => u({
|
|
20
|
+
render: r,
|
|
21
|
+
ref: t,
|
|
22
|
+
defaultTagName: "button",
|
|
23
|
+
props: a(
|
|
24
|
+
{
|
|
25
|
+
type: "button",
|
|
26
|
+
className: l(v({ variant: n, className: o }))
|
|
27
|
+
},
|
|
28
|
+
i
|
|
29
|
+
)
|
|
30
|
+
}));
|
|
31
|
+
s.displayName = "ButtonIconInput";
|
|
32
|
+
export {
|
|
33
|
+
s as ButtonIconInput,
|
|
34
|
+
v as buttonIconInputVariants
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=button-icon-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-icon-input.js","sources":["../../../../src/components/ui/button-icon-input/button-icon-input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"ButtonIconInput\" component set: a smaller icon-only\n// button (20px box, 16px glyph) meant to live inside an input's box (e.g. the\n// clear/reveal affordance), as opposed to `ButtonIcon`'s standalone 32px/24px\n// sizing. `variant` (`normal` / `error`) picks the field's tone — `error`\n// mirrors the input's error-state red — and each interaction state\n// (idle/hover/active) is wired to its own `--ui-button-icon-input-*` token per\n// variant (they use distinct tokens, not a shared `global` tier like\n// `ButtonIcon`). The Figma set has no `disabled` variant for `error` (only\n// `normal` does), so disabled always uses the `normal` disabled tokens\n// regardless of `variant` — there's no dead-token fallback here, just the one\n// disabled treatment the design actually defines. Focus is a 3px ring —\n// `--ui-focus-primary` for `normal`, `--ui-focus-error` for `error` —\n// matching the field it sits in.\nconst buttonIconInputVariants = cva(\n 'inline-flex size-[var(--ui-button-icon-input-global-container-width)] shrink-0 items-center justify-center rounded-[var(--ui-button-icon-input-global-container-border-radius)] outline-none transition-colors cursor-pointer disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-[var(--ui-button-icon-input-normal-container-color-disabled)] disabled:text-[var(--ui-button-icon-input-normal-icon-color-disabled)] focus-visible:ring-[3px] [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n normal:\n 'bg-[var(--ui-button-icon-input-normal-container-color-idle)] text-[var(--ui-button-icon-input-normal-icon-color-idle)] hover:bg-[var(--ui-button-icon-input-normal-container-color-hover)] hover:text-[var(--ui-button-icon-input-normal-icon-color-hover)] active:bg-[var(--ui-button-icon-input-normal-container-color-active)] active:text-[var(--ui-button-icon-input-normal-icon-color-active)] focus-visible:ring-[var(--ui-focus-primary)] [&_svg]:size-[var(--ui-button-icon-input-normal-icon-size)]',\n error:\n 'bg-[var(--ui-button-icon-input-error-container-color-idle)] text-[var(--ui-button-icon-input-error-icon-color-idle)] hover:bg-[var(--ui-button-icon-input-error-container-color-hover)] hover:text-[var(--ui-button-icon-input-error-icon-color-hover)] active:bg-[var(--ui-button-icon-input-error-container-color-active)] active:text-[var(--ui-button-icon-input-error-icon-color-active)] focus-visible:ring-[var(--ui-focus-error)] [&_svg]:size-[var(--ui-button-icon-input-error-icon-size)]',\n },\n },\n defaultVariants: {\n variant: 'normal',\n },\n }\n);\n\nexport interface ButtonIconInputProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonIconInputVariants> {\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function —\n * the component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * Small icon-only button meant to sit inside an input's box. The icon is\n * passed as `children`; provide an `aria-label` (or `aria-labelledby`) so the\n * control has an accessible name.\n */\nconst ButtonIconInput = React.forwardRef<\n HTMLButtonElement,\n ButtonIconInputProps\n>(({ className, variant, render, ...props }, ref) => {\n return useRender({\n render,\n ref,\n defaultTagName: 'button',\n props: mergeProps<'button'>(\n {\n type: 'button',\n className: cn(buttonIconInputVariants({ variant, className })),\n },\n props\n ),\n });\n});\nButtonIconInput.displayName = 'ButtonIconInput';\n\nexport { ButtonIconInput, buttonIconInputVariants };\n"],"names":["buttonIconInputVariants","cva","ButtonIconInput","React","className","variant","render","props","ref","useRender","mergeProps","cn"],"mappings":";;;;;AAoBA,MAAMA,IAA0BC;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QACE;AAAA,QACF,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAmBMC,IAAkBC,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MACpCC,EAAU;AAAA,EACf,QAAAH;AAAA,EACA,KAAAE;AAAA,EACA,gBAAgB;AAAA,EAChB,OAAOE;AAAA,IACL;AAAA,MACE,MAAM;AAAA,MACN,WAAWC,EAAGX,EAAwB,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,CAAC;AAAA,IAAA;AAAA,IAE/DG;AAAA,EAAA;AACF,CACD,CACF;AACDL,EAAgB,cAAc;"}
|
|
@@ -6,7 +6,7 @@ import { ChevronUpIcon as m, ChevronDownIcon as p } from "@acronis-platform/icon
|
|
|
6
6
|
import { cva as g } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
import { cn as y } from "../../../lib/utils.js";
|
|
8
8
|
const h = g(
|
|
9
|
-
"inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0",
|
|
9
|
+
"inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] cursor-pointer items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-menu.js","sources":["../../../../src/components/ui/button-menu/button-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"ButtonMenu\" component: a Button-like trigger (label +\n// trailing chevron) that opens a menu. `variant` maps to the Figma `variant`\n// property (Primary / Secondary); the Figma `active` state is the **open** state\n// — the chevron flips down→up and the container takes its `*-active` colors. Each\n// interaction state wires the container fill, label, icon, and — for `secondary`\n// — the border to its own dedicated `--ui-button-menu-*` token from\n// @acronis-platform/tokens-pd. Every state is referenced explicitly (runtime\n// `var()` lookups: a brand override is only honored if the matching state token is\n// referenced). `primary` keeps a single label/icon color across states; only\n// `secondary` diverges them per state. Geometry — 32px height, 8px gap, 12px\n// padding-x, 4px radius, 64px min-width, 16px icon — comes from the\n// `--ui-button-menu-global-*` tokens. The open treatment is driven by the\n// `data-open` attribute (set from the `open` prop) and CSS `:active` for press\n// feedback; disabled uses the explicit disabled tokens (not opacity). Focus: the\n// Figma focus state is a 3px `--ui-focus-primary` ring flush to the button edge\n// (no offset) — `ring-[3px]`, no `ring-offset`.\nconst buttonMenuVariants = cva(\n 'inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-[var(--ui-button-menu-primary-container-color-idle)] text-[var(--ui-button-menu-primary-label-color)] [&_svg]:text-[var(--ui-button-menu-primary-icon-color)] hover:bg-[var(--ui-button-menu-primary-container-color-hover)] active:bg-[var(--ui-button-menu-primary-container-color-active)] data-[open]:bg-[var(--ui-button-menu-primary-container-color-active)] disabled:bg-[var(--ui-button-menu-primary-container-color-disabled)]',\n secondary:\n 'bg-[var(--ui-button-menu-secondary-container-color-idle)] text-[var(--ui-button-menu-secondary-label-color-idle)] border-[var(--ui-button-menu-secondary-container-border-color-idle)] [&_svg]:text-[var(--ui-button-menu-secondary-icon-color-idle)] hover:bg-[var(--ui-button-menu-secondary-container-color-hover)] hover:text-[var(--ui-button-menu-secondary-label-color-hover)] hover:border-[var(--ui-button-menu-secondary-container-border-color-hover)] hover:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-hover)] active:bg-[var(--ui-button-menu-secondary-container-color-active)] active:text-[var(--ui-button-menu-secondary-label-color-active)] active:border-[var(--ui-button-menu-secondary-container-border-color-active)] active:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] data-[open]:bg-[var(--ui-button-menu-secondary-container-color-active)] data-[open]:text-[var(--ui-button-menu-secondary-label-color-active)] data-[open]:border-[var(--ui-button-menu-secondary-container-border-color-active)] data-[open]:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] disabled:bg-[var(--ui-button-menu-secondary-container-color-disabled)] disabled:text-[var(--ui-button-menu-secondary-label-color-disabled)] disabled:border-[var(--ui-button-menu-secondary-container-border-color-disabled)] disabled:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-disabled)]',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n }\n);\n\nexport interface ButtonMenuProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n VariantProps<typeof buttonMenuVariants> {\n /**\n * Whether the associated menu is open. Flips the trailing chevron\n * (down → up), applies the open (`*-active`) treatment, and reflects\n * `aria-expanded`. Control this in sync with the menu you trigger.\n */\n open?: boolean;\n /** Label content rendered before the chevron. */\n children?: React.ReactNode;\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function —\n * the component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A button that opens a dropdown menu: a label followed by a chevron that\n * points up while `open`. Pair it with the menu/popover it controls and keep\n * the `open` prop in sync.\n */\nconst ButtonMenu = React.forwardRef<HTMLButtonElement, ButtonMenuProps>(\n ({ className, variant, open, render, children, ...props }, ref) => {\n const Chevron = open ? ChevronUpIcon : ChevronDownIcon;\n return useRender({\n render,\n ref,\n defaultTagName: 'button',\n props: mergeProps<'button'>(\n {\n className: cn(buttonMenuVariants({ variant, className })),\n 'aria-expanded': open,\n // `data-open` drives the open (`*-active`) token switch via attribute\n // selectors; present only while open, and typed loosely because\n // React's button attribute map doesn't include arbitrary data-* keys\n // as literals.\n ...(open ? ({ 'data-open': '' } as Record<string, string>) : {}),\n children: (\n <>\n {children}\n <Chevron />\n </>\n ),\n },\n props\n ),\n });\n }\n);\nButtonMenu.displayName = 'ButtonMenu';\n\nexport { ButtonMenu, buttonMenuVariants };\n"],"names":["buttonMenuVariants","cva","ButtonMenu","React","className","variant","open","render","children","props","ref","Chevron","ChevronUpIcon","ChevronDownIcon","useRender","mergeProps","cn","jsxs","Fragment"],"mappings":";;;;;;;AA2BA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GA2BMC,IAAaC,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AACjE,UAAMC,IAAUL,IAAOM,IAAgBC;AACvC,WAAOC,EAAU;AAAA,MACf,QAAAP;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOK;AAAA,QACL;AAAA,UACE,WAAWC,EAAGhB,EAAmB,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,CAAC;AAAA,UACxD,iBAAiBE;AAAA;AAAA;AAAA;AAAA;AAAA,UAKjB,GAAIA,IAAQ,EAAE,aAAa,GAAA,IAAkC,CAAA;AAAA,UAC7D,UACE,gBAAAW,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAV;AAAA,8BACAG,GAAA,CAAA,CAAQ;AAAA,UAAA,EAAA,CACX;AAAA,QAAA;AAAA,QAGJF;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAP,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"button-menu.js","sources":["../../../../src/components/ui/button-menu/button-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"ButtonMenu\" component: a Button-like trigger (label +\n// trailing chevron) that opens a menu. `variant` maps to the Figma `variant`\n// property (Primary / Secondary); the Figma `active` state is the **open** state\n// — the chevron flips down→up and the container takes its `*-active` colors. Each\n// interaction state wires the container fill, label, icon, and — for `secondary`\n// — the border to its own dedicated `--ui-button-menu-*` token from\n// @acronis-platform/tokens-pd. Every state is referenced explicitly (runtime\n// `var()` lookups: a brand override is only honored if the matching state token is\n// referenced). `primary` keeps a single label/icon color across states; only\n// `secondary` diverges them per state. Geometry — 32px height, 8px gap, 12px\n// padding-x, 4px radius, 64px min-width, 16px icon — comes from the\n// `--ui-button-menu-global-*` tokens. The open treatment is driven by the\n// `data-open` attribute (set from the `open` prop) and CSS `:active` for press\n// feedback; disabled uses the explicit disabled tokens (not opacity). Focus: the\n// Figma focus state is a 3px `--ui-focus-primary` ring flush to the button edge\n// (no offset) — `ring-[3px]`, no `ring-offset`.\nconst buttonMenuVariants = cva(\n 'inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] cursor-pointer items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-[var(--ui-button-menu-primary-container-color-idle)] text-[var(--ui-button-menu-primary-label-color)] [&_svg]:text-[var(--ui-button-menu-primary-icon-color)] hover:bg-[var(--ui-button-menu-primary-container-color-hover)] active:bg-[var(--ui-button-menu-primary-container-color-active)] data-[open]:bg-[var(--ui-button-menu-primary-container-color-active)] disabled:bg-[var(--ui-button-menu-primary-container-color-disabled)]',\n secondary:\n 'bg-[var(--ui-button-menu-secondary-container-color-idle)] text-[var(--ui-button-menu-secondary-label-color-idle)] border-[var(--ui-button-menu-secondary-container-border-color-idle)] [&_svg]:text-[var(--ui-button-menu-secondary-icon-color-idle)] hover:bg-[var(--ui-button-menu-secondary-container-color-hover)] hover:text-[var(--ui-button-menu-secondary-label-color-hover)] hover:border-[var(--ui-button-menu-secondary-container-border-color-hover)] hover:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-hover)] active:bg-[var(--ui-button-menu-secondary-container-color-active)] active:text-[var(--ui-button-menu-secondary-label-color-active)] active:border-[var(--ui-button-menu-secondary-container-border-color-active)] active:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] data-[open]:bg-[var(--ui-button-menu-secondary-container-color-active)] data-[open]:text-[var(--ui-button-menu-secondary-label-color-active)] data-[open]:border-[var(--ui-button-menu-secondary-container-border-color-active)] data-[open]:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] disabled:bg-[var(--ui-button-menu-secondary-container-color-disabled)] disabled:text-[var(--ui-button-menu-secondary-label-color-disabled)] disabled:border-[var(--ui-button-menu-secondary-container-border-color-disabled)] disabled:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-disabled)]',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n }\n);\n\nexport interface ButtonMenuProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n VariantProps<typeof buttonMenuVariants> {\n /**\n * Whether the associated menu is open. Flips the trailing chevron\n * (down → up), applies the open (`*-active`) treatment, and reflects\n * `aria-expanded`. Control this in sync with the menu you trigger.\n */\n open?: boolean;\n /** Label content rendered before the chevron. */\n children?: React.ReactNode;\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function —\n * the component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A button that opens a dropdown menu: a label followed by a chevron that\n * points up while `open`. Pair it with the menu/popover it controls and keep\n * the `open` prop in sync.\n */\nconst ButtonMenu = React.forwardRef<HTMLButtonElement, ButtonMenuProps>(\n ({ className, variant, open, render, children, ...props }, ref) => {\n const Chevron = open ? ChevronUpIcon : ChevronDownIcon;\n return useRender({\n render,\n ref,\n defaultTagName: 'button',\n props: mergeProps<'button'>(\n {\n className: cn(buttonMenuVariants({ variant, className })),\n 'aria-expanded': open,\n // `data-open` drives the open (`*-active`) token switch via attribute\n // selectors; present only while open, and typed loosely because\n // React's button attribute map doesn't include arbitrary data-* keys\n // as literals.\n ...(open ? ({ 'data-open': '' } as Record<string, string>) : {}),\n children: (\n <>\n {children}\n <Chevron />\n </>\n ),\n },\n props\n ),\n });\n }\n);\nButtonMenu.displayName = 'ButtonMenu';\n\nexport { ButtonMenu, buttonMenuVariants };\n"],"names":["buttonMenuVariants","cva","ButtonMenu","React","className","variant","open","render","children","props","ref","Chevron","ChevronUpIcon","ChevronDownIcon","useRender","mergeProps","cn","jsxs","Fragment"],"mappings":";;;;;;;AA2BA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GA2BMC,IAAaC,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AACjE,UAAMC,IAAUL,IAAOM,IAAgBC;AACvC,WAAOC,EAAU;AAAA,MACf,QAAAP;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOK;AAAA,QACL;AAAA,UACE,WAAWC,EAAGhB,EAAmB,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,CAAC;AAAA,UACxD,iBAAiBE;AAAA;AAAA;AAAA;AAAA;AAAA,UAKjB,GAAIA,IAAQ,EAAE,aAAa,GAAA,IAAkC,CAAA;AAAA,UAC7D,UACE,gBAAAW,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAV;AAAA,8BACAG,GAAA,CAAA,CAAQ;AAAA,UAAA,EAAA,CACX;AAAA,QAAA;AAAA,QAGJF;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAP,EAAW,cAAc;"}
|