@acronis-platform/ui-react 0.60.0 → 0.61.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.
Files changed (83) hide show
  1. package/README.md +5 -5
  2. package/dist/components/ui/app-shell/app-shell.js.map +1 -1
  3. package/dist/components/ui/area-chart/area-chart.js +209 -146
  4. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  5. package/dist/components/ui/avatar/avatar.js +26 -23
  6. package/dist/components/ui/avatar/avatar.js.map +1 -1
  7. package/dist/components/ui/bar-chart/bar-chart.js +595 -180
  8. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  9. package/dist/components/ui/category-bar/category-bar.js +98 -77
  10. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  11. package/dist/components/ui/chart/chart-format.js +144 -14
  12. package/dist/components/ui/chart/chart-format.js.map +1 -1
  13. package/dist/components/ui/chart/chart.js +204 -150
  14. package/dist/components/ui/chart/chart.js.map +1 -1
  15. package/dist/components/ui/composed-chart/composed-chart.js +422 -125
  16. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  17. package/dist/components/ui/confidence-cone/confidence-cone.js +308 -202
  18. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  19. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  20. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  21. package/dist/components/ui/histogram/histogram.js +85 -81
  22. package/dist/components/ui/histogram/histogram.js.map +1 -1
  23. package/dist/components/ui/line-chart/line-chart.js +227 -184
  24. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  25. package/dist/components/ui/metric/metric.js +88 -70
  26. package/dist/components/ui/metric/metric.js.map +1 -1
  27. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  28. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  29. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  30. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  31. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  32. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  33. package/dist/components/ui/sankey-chart/sankey-chart.js +25 -18
  34. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  35. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -78
  36. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  37. package/dist/components/ui/timeline/timeline.js +206 -142
  38. package/dist/components/ui/timeline/timeline.js.map +1 -1
  39. package/dist/components/ui/treemap/treemap.js +183 -59
  40. package/dist/components/ui/treemap/treemap.js.map +1 -1
  41. package/dist/index.js +441 -421
  42. package/dist/index.js.map +1 -1
  43. package/dist/react.js +441 -421
  44. package/dist/react.js.map +1 -1
  45. package/dist/src/components/ui/area-chart/area-chart.d.ts +53 -3
  46. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  47. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  48. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +154 -16
  49. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  50. package/dist/src/components/ui/button/button.d.ts +1 -1
  51. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  52. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  53. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  54. package/dist/src/components/ui/chart/chart-format.d.ts +415 -0
  55. package/dist/src/components/ui/chart/chart.d.ts +9 -3
  56. package/dist/src/components/ui/chart/index.d.ts +2 -2
  57. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +156 -7
  58. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  59. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -20
  60. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  61. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  62. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  63. package/dist/src/components/ui/histogram/histogram.d.ts +2 -2
  64. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  65. package/dist/src/components/ui/line-chart/line-chart.d.ts +51 -3
  66. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  67. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  68. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  69. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  70. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  71. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  72. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -2
  73. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  74. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  75. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  76. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  77. package/dist/src/index.d.ts +0 -1
  78. package/dist/ui-react.css +1 -1
  79. package/package.json +3 -3
  80. package/dist/components/ui/search-global/search-global.js +0 -60
  81. package/dist/components/ui/search-global/search-global.js.map +0 -1
  82. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  83. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
@@ -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 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 resolveAxisDomain,\n type ChartConfig,\n type CartesianChartProps,\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 CartesianChartProps {\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 /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showLegend?: boolean;\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 showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\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 const yDomain = resolveAxisDomain(yAxisDomain);\n\n // Room for the X tick row: recharts' default 30, plus a rotated tick row\n // (+20) and/or the axis title (+18). Additive — both can be present at once,\n // which the old label-or-angle ternary under-allocated.\n const xAxisHeight =\n xAxisLabel || xAxisAngle != null\n ? 30 + (xAxisAngle != null ? 20 : 0) + (xAxisLabel ? 18 : 0)\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={gridHorizontal ?? orientation === 'vertical'}\n vertical={gridVertical ?? orientation === 'horizontal'}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n {/* Horizontal bars put the values on X, so the value-axis\n props (tickCount/domain) belong here — recharts ignores both\n on the category axis. */}\n <XAxis\n type=\"number\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n tickCount={yAxisTickCount}\n domain={yDomain}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={yTickFormatter}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\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","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","props","ref","rechartsLayout","isStacked","referenceLines","xAxisTitle","yAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","index","rounded","Bar","ReferenceLine"],"mappings":";;;;;;;AAkCA,MAAMA,KAAmBC,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;AAqBM,SAASC,GACdC,GACAC,GACAC,GACoB;AACpB,MAAI,CAACF,EAAe;AACpB,MAAI,OAAOA,EAAc,SAAU,iBAAiBA,EAAc;AAClE,MAAI,CAACA,EAAc,QAAS;AAE5B,QAAMG,IACJ,OAAOH,EAAc,WAAY,WAC7B,CAACA,EAAc,OAAO,IACtBE,GACAE,IAAOH,EAAK;AAAA,IAAQ,CAACI,MACzBF,EACG,IAAI,CAACG,MAAQD,EAAIC,CAAG,CAAC,EACrB,OAAO,CAACC,MAA2B,OAAOA,KAAU,QAAQ;AAAA,EAAA;AAEjE,MAAIH,EAAK,W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yC,IAAUf,IAAY;AAAA,oBAC/C,mBAAmB;AAAA,kBAAA;AAAA,kBALdzC;AAAA,gBAAA;AAAA,cAQX,CAAC;AAAA,cACAmC,EAAe,IAAI,CAACH,GAAKuB,MAAU;AAClC,sBAAMtD,IAAQR,GAAuBuC,GAAKrC,GAAMC,CAAQ;AACxD,uBAAIK,MAAU,SAAkB,OAE9B,gBAAAyC;AAAA,kBAACgB;AAAA,kBAAA;AAAA,oBAGE,GAAI7C,MAAgB,eAAe,EAAE,GAAGZ,MAAU,EAAE,GAAGA,EAAA;AAAA,oBACxD,QAAO;AAAA,oBACP,iBAAgB;AAAA,oBAEhB,YAAW;AAAA,oBACX,OACE+B,EAAI,QACA;AAAA,sBACE,OAAOA,EAAI;AAAA;AAAA;AAAA;AAAA,sBAIX,UACEnB,MAAgB,eACZ,QACA;AAAA,sBACN,MAAM;AAAA,sBACN,UAAU;AAAA,oBAAA,IAEZ;AAAA,kBAAA;AAAA,kBArBD,GAAGmB,EAAI,SAAS,KAAK,IAAIuB,CAAK;AAAA,gBAAA;AAAA,cAyBzC,CAAC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAnD,GAAS,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 Brush,\n CartesianGrid,\n Cell,\n LabelList,\n ReferenceArea,\n ReferenceLine,\n Rectangle,\n Text,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport type { BarShapeProps } from 'recharts/types/cartesian/Bar';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n resolveCartesianLabelPosition,\n resolveCategoryRange,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type ChartReferenceLine,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCategoryRange,\n type ChartDataLabelProps,\n type CartesianLabelPosition,\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\n/**\n * How a bar is painted. `rounded` rounds the growing end by `barRadius`; `pill`\n * rounds every corner to a capsule; `gradient` fades the series color down the\n * bar; `pattern` fills it with diagonal hatching in the series color (a\n * colorblind-safe way to set a subset of bars apart).\n */\nexport type BarChartBarShape = 'rounded' | 'pill' | 'gradient' | 'pattern';\n\n/**\n * Style override for one series over a range of categories — e.g. \"the forecast\n * tail from September onward reads translucent and dashed\". Anything left unset\n * keeps the series' normal painting.\n */\nexport interface BarChartBarSettings extends ChartCategoryRange {\n /** Fill for the matched bars. Defaults to the series color. */\n fill?: string;\n /** Fill opacity for the matched bars. */\n opacity?: number;\n /** Outline the matched bars with a dashed stroke in the series color. */\n dashed?: boolean;\n /** Shape for the matched bars, overriding the chart's `barShape`. */\n shape?: BarChartBarShape;\n /**\n * Track behind the matched bars: `true` fills the plot height, while a data\n * field name caps it at that row's value — the headroom between a projection\n * and its upper bound. A capped track stacks on its bar, so it needs the\n * default `layout=\"grouped\"`; under `layout=\"stacked\"` it is ignored.\n */\n background?: boolean | string;\n}\n\n/** A shaded band behind a range of categories. */\nexport interface BarChartReferenceArea extends ChartCategoryRange {\n /** Caption above the band. */\n label?: string;\n /**\n * Mark the category ticks under the band — accent color, italic — so the\n * highlighted range reads on the axis too. On by default.\n */\n highlightTicks?: boolean;\n /**\n * Draw a dashed rule at the band's leading edge — the hand-off into a\n * forecast. Off by default.\n */\n divider?: boolean;\n}\n\n// Reserved field prefix for the synthetic headroom series a capped track\n// stacks onto its bar. It must never surface in the tooltip or the legend.\nconst HEADROOM_FIELD_PREFIX = '__headroom_';\n\n/**\n * Drop the synthetic headroom series from a recharts tooltip/legend payload,\n * keeping the real series (and their order). `legendType`/`tooltipType=\"none\"`\n * are set on those bars too, but recharts still lists them, so this filter is\n * what actually keeps them out — hence it's unit-tested.\n */\nexport function dropHeadroomSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined,\n dataKeys?: string[]\n): T[] | undefined {\n const real = payload?.filter(\n (item) => !String(item.dataKey).startsWith(HEADROOM_FIELD_PREFIX)\n );\n // recharts sorts the legend payload alphabetically by series name by default\n // (its `itemSorter: 'value'`), so passing `dataKeys` puts the entries back in\n // the order the caller declared them.\n return dataKeys\n ? real?.slice().sort(\n (a, b) =>\n dataKeys.indexOf(String(a.dataKey)) -\n dataKeys.indexOf(String(b.dataKey))\n )\n : real;\n}\n\n/**\n * Swap a paint-server fill back to the series color for the chrome. A\n * `gradient` / `pattern` bar fills from `url(#…)`, which paints SVG but means\n * nothing as a CSS background — the legend swatch and the tooltip dot would\n * render blank — so they fall back to the series' own `--color-<key>`.\n */\nexport function withSeriesColor<T extends { dataKey?: unknown; color?: string }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.map((item) =>\n item.color?.startsWith('url(')\n ? { ...item, color: `var(--color-${String(item.dataKey)})` }\n : item\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<\n TooltipContentType,\n (...args: never[]) => unknown\n>;\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\ntype LegendContentType = NonNullable<\n React.ComponentProps<typeof ChartLegend>['content']\n>;\ntype LegendContentFn = Extract<LegendContentType, (...args: never[]) => unknown>;\ntype LegendRenderProps = Parameters<LegendContentFn>[0];\n\n/**\n * Tooltip content that normalizes recharts' payload before anything renders it:\n * the synthetic headroom series stripped, the rows put back in `dataKeys` order,\n * and paint-server fills swapped back to the series color. Falls through to a\n * caller-supplied `content`, preserving recharts' own mount semantics — a\n * function via `createElement` (its own component identity + hook state), an\n * element via `cloneElement`.\n *\n * This is a component rather than a per-render wrapper factory on purpose:\n * recharts renders `content` by cloning the element it is given\n * (`Tooltip.js:27-28`), so a stable module-level type here means the subtree is\n * never remounted, whatever the caller passes.\n */\nexport function NormalizedTooltipContent({\n content,\n dataKeys,\n ...props\n}: Partial<TooltipRenderProps> & {\n content?: TooltipContentType;\n dataKeys?: string[];\n}) {\n const merged = {\n ...props,\n payload: withSeriesColor(dropHeadroomSeries(props.payload, dataKeys)),\n } as TooltipRenderProps;\n\n if (!content) {\n return <ChartTooltipContent {...(merged as ChartTooltipContentProps)} />;\n }\n return typeof content === 'function'\n ? React.createElement(\n content as React.FunctionComponent<TooltipRenderProps>,\n merged\n )\n : React.cloneElement(content, merged);\n}\n\n/**\n * Legend content over the same normalization. Ordering is the reason this\n * applies unconditionally: recharts sorts legend entries alphabetically by\n * series name by default (`itemSorter: 'value'`), so without putting them back\n * in `dataKeys` order the legend would silently reorder itself depending on\n * which bar-styling props happen to be set.\n */\nexport function NormalizedLegendContent({\n dataKeys,\n ...props\n}: Partial<LegendRenderProps> & { dataKeys: string[] }) {\n return (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n withSeriesColor(\n dropHeadroomSeries(props.payload, dataKeys)\n ) as ChartLegendContentProps['payload']\n }\n />\n );\n}\n\n/** Paint overrides recharts spreads over a bar to mark it as the active one. */\ninterface BarPaintOverride {\n fill?: string;\n fillOpacity?: number;\n}\n\n/**\n * Draw a bar, optionally over its full-height track (recharts hands a custom\n * `<Bar shape>` the track geometry alongside the bar's). Only geometry and\n * paint props are forwarded — recharts also passes the whole data entry, and\n * spreading that onto an SVG node would leak data fields into the DOM.\n *\n * `paint` is how the active bar keeps its track: recharts swaps a custom\n * `shape` out for the `activeBar` option while a bar is hovered\n * (`Bar.js` `BarRectangleWithActiveState`), so the active option has to be a\n * shape of its own that redraws the track and applies the highlight itself.\n */\nfunction renderBarWithTrack({\n bar,\n track,\n trackFill,\n paint,\n}: {\n bar: Omit<BarShapeProps, 'background' | 'index'>;\n track?: BarShapeProps['background'];\n trackFill: string;\n paint?: BarPaintOverride;\n}) {\n return (\n <>\n {track && (\n <Rectangle\n className=\"recharts-bar-background-rectangle\"\n x={track.x ?? undefined}\n y={track.y ?? undefined}\n width={track.width ?? undefined}\n height={track.height ?? undefined}\n fill={trackFill}\n />\n )}\n <Rectangle\n x={bar.x ?? undefined}\n y={bar.y ?? undefined}\n width={bar.width ?? undefined}\n height={bar.height ?? undefined}\n radius={bar.radius}\n fill={paint?.fill ?? bar.fill}\n fillOpacity={paint?.fillOpacity ?? bar.fillOpacity}\n stroke={bar.stroke}\n strokeWidth={bar.strokeWidth}\n strokeDasharray={bar.strokeDasharray}\n />\n </>\n );\n}\n\n/**\n * Build the `<Bar shape>` that draws a range-scoped track. recharts' own\n * `background` is all-or-nothing per series, so the track is drawn per row and\n * hidden where the range doesn't apply.\n */\nexport function createTrackShape({\n inRange,\n trackFill,\n paint,\n}: {\n inRange: (row: number) => boolean;\n trackFill: string;\n paint?: BarPaintOverride;\n}) {\n return ({ background: track, index: row, ...bar }: BarShapeProps) =>\n renderBarWithTrack({\n bar,\n track: inRange(row) ? track : undefined,\n trackFill,\n paint,\n });\n}\n\n/**\n * The `shape` / `activeBar` pair one series' `<Bar>` is given.\n *\n * They resolve together because recharts swaps a custom `shape` out for the\n * `activeBar` option while a bar is hovered: a range-scoped track has to be\n * redrawn by the active option too, or the track blinks out under the cursor.\n */\nfunction resolveBarShapes({\n rangeBackground,\n inRange,\n trackFill,\n activeBarOption,\n}: {\n /**\n * recharts takes one `background` per series, so a range-scoped one is drawn\n * per row by a custom shape instead: hidden where it doesn't apply.\n */\n rangeBackground: boolean;\n inRange: (row: number) => boolean;\n trackFill: string;\n activeBarOption: BarPaintOverride | false;\n}) {\n if (!rangeBackground) {\n return { shape: undefined, activeBar: activeBarOption };\n }\n return {\n shape: createTrackShape({ inRange, trackFill }),\n activeBar: activeBarOption\n ? createTrackShape({ inRange, trackFill, paint: activeBarOption })\n : activeBarOption,\n };\n}\n\n/**\n * Draw a highlight band plus a dashed rule on its leading edge: the left edge\n * for vertical bars (the category axis runs along X), the top edge otherwise.\n *\n * The band's own paint comes from the props recharts hands the shape — a\n * `<ReferenceArea shape>` still receives the element's `fill`/`fillOpacity`\n * (`ReferenceArea.js` `renderRect`), so hardcoding them here would quietly\n * ignore whatever the caller set.\n */\nfunction renderBandWithDivider({\n band,\n vertical,\n}: {\n band: {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n fill?: string;\n fillOpacity?: number;\n };\n vertical: boolean;\n}) {\n const { x = 0, y = 0, width = 0, height = 0, fill, fillOpacity } = band;\n return (\n <>\n <Rectangle\n className=\"recharts-reference-area-rect\"\n x={x}\n y={y}\n width={width}\n height={height}\n fill={fill}\n fillOpacity={fillOpacity}\n />\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + width}\n y2={vertical ? y + height : y}\n stroke=\"var(--ui-border-on-surface-border)\"\n strokeDasharray=\"4 4\"\n />\n </>\n );\n}\n\n/**\n * The `<ReferenceArea shape>` for a band, or `undefined` so recharts draws its\n * own rect. A custom shape is only needed for the leading-edge rule: a\n * `ReferenceLine` would sit on the tick's centre, and only the band knows where\n * its own edge is.\n */\nfunction resolveBandShape({\n divider,\n vertical,\n}: {\n divider: boolean | undefined;\n vertical: boolean;\n}) {\n if (!divider) return undefined;\n return (band: { x?: number; y?: number; width?: number; height?: number }) =>\n renderBandWithDivider({ band, vertical });\n}\n\n/**\n * A band's caption as recharts' native `label`. `'insideTop'` is asserted\n * because, read outside the JSX attribute, it would widen to `string` and stop\n * matching recharts' `Position` union.\n */\nfunction resolveBandLabel(label: string | undefined) {\n return label\n ? {\n value: label,\n position: 'insideTop' as const,\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined;\n}\n\n/**\n * The `<defs>` a `gradient` / `pattern` bar fills from — one paint server per\n * series, since each is painted in that series' own color. Ids are namespaced\n * by the chart instance so two charts on a page can't collide.\n *\n * Safe to render as a component: unlike `Bar`'s cells, the chart renders its\n * children straight through rather than looking them up by type.\n */\nfunction BarPaintServers({\n id,\n dataKeys,\n shapes,\n horizontal,\n}: {\n id: string;\n dataKeys: string[];\n shapes: ReadonlySet<BarChartBarShape>;\n /** Bars grow along X, so a gradient runs left-to-right instead of top-down. */\n horizontal: boolean;\n}) {\n const hasGradient = shapes.has('gradient');\n const hasPattern = shapes.has('pattern');\n if (!hasGradient && !hasPattern) return null;\n\n return (\n <defs>\n {dataKeys.map((key) => (\n <React.Fragment key={key}>\n {hasGradient && (\n <linearGradient\n id={`${id}-gradient-${key}`}\n x1=\"0\"\n y1=\"0\"\n x2={horizontal ? '1' : '0'}\n y2={horizontal ? '0' : '1'}\n >\n <stop\n offset=\"0%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={1}\n />\n <stop\n offset=\"100%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.35}\n />\n </linearGradient>\n )}\n {hasPattern && (\n <pattern\n id={`${id}-pattern-${key}`}\n patternUnits=\"userSpaceOnUse\"\n width={6}\n height={6}\n patternTransform=\"rotate(45)\"\n >\n <rect\n width={6}\n height={6}\n fill={`var(--color-${key})`}\n fillOpacity={0.25}\n />\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={6}\n stroke={`var(--color-${key})`}\n strokeWidth={3}\n />\n </pattern>\n )}\n </React.Fragment>\n ))}\n </defs>\n );\n}\n\n/** Corner radius as recharts' `Rectangle` takes it: one value or a 4-tuple. */\ntype BarRadius = number | [number, number, number, number] | undefined;\n\ninterface RangeCellsOptions {\n data: ReadonlyArray<Record<string, string | number>>;\n /** `data` plus the synthetic headroom fields, if any were added. */\n chartData: ReadonlyArray<Record<string, string | number>>;\n xKey: string;\n seriesKey: string;\n settings: BarChartBarSettings;\n /** Inclusive row bounds the settings apply to. */\n range: [number, number];\n headroomKey: string | undefined;\n barShape: BarChartBarShape;\n rounded: boolean;\n fillOf: (key: string, shape: BarChartBarShape) => string;\n radiusFor: (shape: BarChartBarShape, rounded: boolean) => BarRadius;\n}\n\n/**\n * The `<Cell>` list that applies a series' `barSettings` over its range: the\n * matched rows take the override fill/opacity/dash/shape, the rest keep the\n * series' normal painting.\n *\n * A plain function returning the elements, deliberately not a component:\n * `Bar` discovers its cells with `findAllByType(props.children, Cell)`\n * (recharts `Bar.js`), which matches each direct child on its own display\n * name. Wrapping these in a component would make that lookup find nothing and\n * silently drop every per-range style — no error, just unstyled bars.\n * Returning an array keeps them direct children, since recharts' `toArray`\n * flattens arrays and unwraps fragments.\n */\nfunction rangeCells({\n data,\n chartData,\n xKey,\n seriesKey,\n settings,\n range,\n headroomKey,\n barShape,\n rounded,\n fillOf,\n radiusFor,\n}: RangeCellsOptions) {\n const { fill, opacity, dashed } = settings;\n\n return data.map((row, rowIndex) => {\n const on = rowIndex >= range[0] && rowIndex <= range[1];\n const shape = (on && settings.shape) || barShape;\n // Only a row that actually carries headroom gives up its rounded end — a\n // row in range whose upper bound is missing, or no higher than its value,\n // keeps it.\n const stacksHeadroom =\n headroomKey !== undefined &&\n Number(\n (chartData[rowIndex] as Record<string, unknown>)?.[\n `${HEADROOM_FIELD_PREFIX}${seriesKey}`\n ]\n ) > 0;\n\n return (\n <Cell\n key={`${seriesKey}-${String(row[xKey])}-${rowIndex}`}\n fill={\n on ? (fill ?? fillOf(seriesKey, shape)) : fillOf(seriesKey, barShape)\n }\n fillOpacity={on ? opacity : undefined}\n stroke={on && dashed ? `var(--color-${seriesKey})` : undefined}\n strokeWidth={on && dashed ? 1 : undefined}\n strokeDasharray={on && dashed ? '4 3' : undefined}\n // Cell types `radius` as the SVG attribute, but it feeds recharts'\n // Rectangle, which takes the 4-tuple. A bar with headroom stacked on it\n // hands the rounded end to that segment instead.\n radius={\n (stacksHeadroom ? undefined : radiusFor(shape, rounded)) as\n | number\n | undefined\n }\n />\n );\n });\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\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?: ChartReferenceLine | ChartReferenceLine[];\n /**\n * One or more shaded bands behind a range of categories — e.g. a forecast\n * period. Pass a single object or an array to draw several.\n */\n referenceArea?: BarChartReferenceArea | BarChartReferenceArea[];\n /**\n * Per-series style override for a range of categories, keyed by `dataKeys`\n * entry. Bars outside a series' range — and series with no entry — render\n * normally.\n */\n barSettings?: Record<string, BarChartBarSettings>;\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n /** How every bar is painted. Per-range overrides come from `barSettings`. */\n barShape?: BarChartBarShape;\n /** Fixed bar thickness, in px. Unset, recharts sizes bars from the available width. */\n barSize?: number;\n /** Upper bound on the computed bar thickness, in px. */\n maxBarSize?: number;\n /** Gap between bars of the same category, in px or a percentage string. */\n barGap?: number | string;\n /** Gap between category groups, in px or a percentage string. */\n barCategoryGap?: number | string;\n /**\n * Minimum rendered length for a bar, in px, so a tiny value stays visible. A\n * value of exactly `0` still renders nothing — a floor on it would read as a\n * small positive.\n */\n minPointSize?: number;\n /** Draw a full-height track behind every bar. */\n showBackground?: boolean;\n /** Fill for the track background. Defaults to the secondary surface. */\n backgroundFill?: string;\n /** Highlight the hovered bar. */\n showActiveBar?: boolean;\n /** Painting of the hovered bar when `showActiveBar` is on. */\n activeBar?: {\n /** Fill for the hovered bar. Defaults to the series color. */\n fill?: string;\n /** Fill opacity for the hovered bar. */\n opacity?: number;\n };\n showLegend?: boolean;\n /**\n * Position of the value labels when `showLabels` is on. Defaults to the growing\n * end — `top` for vertical bars, `right` for horizontal.\n */\n labelPosition?: CartesianLabelPosition;\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n referenceArea,\n barSettings,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n barShape = 'rounded',\n barSize,\n maxBarSize,\n barGap,\n barCategoryGap,\n minPointSize,\n showBackground = false,\n backgroundFill = 'var(--ui-background-surface-secondary)',\n showActiveBar = false,\n activeBar,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\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 // Labels sit at the growing end of the bar: above vertical bars, to the\n // right of horizontal ones — or centred in the segment when stacked.\n const barLabelPosition = resolveCartesianLabelPosition({\n labelPosition,\n isStacked,\n growingEnd: orientation === 'horizontal' ? 'right' : 'top',\n });\n\n const referenceLines = toReferenceLineList(referenceLine);\n\n // Bands + the per-series overrides resolved to inclusive row indices once,\n // so the Cells below are a lookup rather than a search per bar.\n const referenceAreas = (\n referenceArea\n ? Array.isArray(referenceArea)\n ? referenceArea\n : [referenceArea]\n : []\n )\n .map((area) => ({ area, range: resolveCategoryRange(area, data, xKey) }))\n .filter(\n (entry): entry is { area: BarChartReferenceArea; range: [number, number] } =>\n entry.range !== undefined\n );\n\n const settingsByKey = new Map(\n dataKeys.flatMap((key) => {\n const settings = barSettings?.[key];\n const range = settings\n ? resolveCategoryRange(settings, data, xKey)\n : undefined;\n return settings && range ? [[key, { settings, range }] as const] : [];\n })\n );\n\n // A capped track is drawn as a synthetic remainder (upper bound minus the\n // bar's own value) stacked on the bar, so recharts scales and animates it\n // rather than us guessing the axis scale from a mid-animation geometry.\n const headroomKeys = new Map(\n isStacked\n ? []\n : Array.from(settingsByKey, ([key, entry]) =>\n typeof entry.settings.background === 'string'\n ? ([key, entry.settings.background] as const)\n : undefined\n ).filter((pair): pair is readonly [string, string] => pair !== undefined)\n );\n\n const chartData = headroomKeys.size\n ? data.map((row, rowIndex) => {\n const extra: Record<string, number> = {};\n headroomKeys.forEach((upperKey, key) => {\n const entry = settingsByKey.get(key);\n if (!entry) return;\n const [start, end] = entry.range;\n if (rowIndex < start || rowIndex > end) return;\n const value = row[key];\n const upper = row[upperKey];\n if (typeof value !== 'number' || typeof upper !== 'number') return;\n extra[`${HEADROOM_FIELD_PREFIX}${key}`] = Math.max(0, upper - value);\n });\n return { ...row, ...extra };\n })\n : data;\n\n // The ticks under a band pick up the accent styling unless the band opts\n // out. Resolved to the categories' own values rather than kept as row\n // indices, because neither index a tick carries can be trusted here: the\n // `index` prop is a position in the list recharts actually renders, which\n // a numeric `interval` (and the default `preserveEnd`, dropping labels that\n // don't fit) has already filtered, and `payload.index` is relative to the\n // slice a `showBrush` selection leaves. The value survives both.\n const highlightedValues = new Set(\n referenceAreas\n .filter(({ area }) => area.highlightTicks !== false)\n .flatMap(({ range }) =>\n data.slice(range[0], range[1] + 1).map((row) => row[xKey])\n )\n );\n\n // recharts places the tick and hands the element its final geometry; we\n // reuse its own <Text> so angle/anchor behavior is unchanged and only add\n // the accent styling for the highlighted range. The formatter still takes\n // the rendered position, since that is what recharts passes its own\n // `tickFormatter`.\n const categoryTick = highlightedValues.size\n ? ({\n payload,\n index,\n ...tickProps\n }: {\n payload: { value: string | number };\n index: number;\n }) => {\n const formatter =\n orientation === 'horizontal' ? yTickFormatter : xTickFormatter;\n const value = formatter\n ? formatter(payload.value as never, index)\n : payload.value;\n return (\n <Text\n {...tickProps}\n className={cn(\n 'fill-muted-foreground',\n highlightedValues.has(payload.value) && 'fill-primary italic'\n )}\n fontSize={12}\n >\n {value}\n </Text>\n );\n }\n : undefined;\n\n // recharts spreads this over the bar's own props, so an explicitly\n // `undefined` fill would wipe the series color (an unfilled path paints\n // black). Only set what the caller asked for, and dim by default so\n // `showActiveBar` alone is visible.\n const activeBarOption = showActiveBar\n ? {\n ...(activeBar?.fill !== undefined ? { fill: activeBar.fill } : {}),\n fillOpacity: activeBar?.opacity ?? 0.85,\n }\n : false;\n\n // `gradient` and `pattern` paint from an SVG def, so the ids have to be\n // unique per chart instance — same guard the shared container applies.\n const defsId = `bar-${React.useId().replace(/:/g, '')}`;\n const usedShapes = new Set<BarChartBarShape>([barShape]);\n settingsByKey.forEach(({ settings }) => {\n if (settings.shape) usedShapes.add(settings.shape);\n });\n // recharts applies a flat minPointSize to zeroes too, which would draw a\n // sliver where there is nothing to show. For a grouped bar it hands the\n // callback the row's own value, but inside a stack it hands the running\n // total, so a zero segment riding on a non-zero stack would slip through —\n // there the value is read back off the row instead. That read uses the\n // index recharts counts from the *displayed* slice, so a stacked chart\n // whose brush has been dragged off its full range falls back to flooring\n // the zero; the plain (unbrushed) stack, which is what the prop is for, is\n // exact.\n const minPointSizeFor = (key: string) =>\n minPointSize === undefined\n ? undefined\n : (top: number | undefined | null, row: number) => {\n const own = isStacked ? chartData[row]?.[key] : top;\n return typeof own === 'number' && own !== 0 ? minPointSize : 0;\n };\n\n const fillOf = (key: string, shape: BarChartBarShape) =>\n shape === 'gradient'\n ? `url(#${defsId}-gradient-${key})`\n : shape === 'pattern'\n ? `url(#${defsId}-pattern-${key})`\n : `var(--color-${key})`;\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 = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\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 // A pill rounds every corner; recharts clamps the radius to half the bar's\n // shorter side, so an oversized number gives a true capsule at any width.\n const radiusFor = (shape: BarChartBarShape, rounded: boolean) =>\n shape === 'pill'\n ? 9999\n : barRadius > 0 && rounded\n ? endRadius\n : undefined;\n\n // Both take the normalization unconditionally: gating it on \"is a\n // headroom/paint-server series in play\" is what let the legend's ordering\n // drift between otherwise identical charts. The helpers are no-ops when\n // there is nothing to strip or recolor.\n const tooltipElement = (\n <NormalizedTooltipContent content={tooltipContent} dataKeys={dataKeys} />\n );\n const legendElement = <NormalizedLegendContent dataKeys={dataKeys} />;\n\n // The long chart children are lifted into these renderers so the returned\n // tree reads as a flat list. They are plain functions, not components:\n // recharts looks some of its children up by element type (see `rangeCells`\n // above), so what they return has to stay a *direct* child — an array or a\n // fragment is flattened, a component wrapper would not be.\n\n // `orientation` decides which axis is numeric, and with it which axis the\n // value props (unit/tickCount/domain) and the category props (dataKey/tick)\n // belong to — recharts ignores each set on the other axis. Both branches\n // stay spelled out because what differs is the prop *set*, not a couple of\n // values: folding them into one shared props object would trade a readable\n // fork for a merge whose per-axis prop list has to be re-derived by eye.\n const renderAxes = () =>\n orientation === 'horizontal' ? (\n <>\n {/* Horizontal bars put the values on X, so the value-axis props\n (tickCount/domain) belong here — recharts ignores both on the\n category axis. */}\n <XAxis\n type=\"number\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n tickCount={yAxisTickCount}\n domain={yDomain}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n tick={categoryTick}\n tickFormatter={yTickFormatter}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tick={categoryTick}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n );\n\n const renderSeries = () =>\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 const entry = settingsByKey.get(key);\n const inRange = (row: number) =>\n entry !== undefined && row >= entry.range[0] && row <= entry.range[1];\n const headroomKey = headroomKeys.get(key);\n const { shape, activeBar: activeBarShape } = resolveBarShapes({\n rangeBackground: entry?.settings.background === true,\n inRange,\n trackFill: backgroundFill,\n activeBarOption,\n });\n const cells =\n entry &&\n rangeCells({\n data,\n chartData,\n xKey,\n seriesKey: key,\n settings: entry.settings,\n range: entry.range,\n headroomKey,\n barShape,\n rounded,\n fillOf,\n radiusFor,\n });\n const labels = showLabels && (\n <LabelList\n dataKey={key}\n position={barLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(barLabelPosition)}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n );\n return (\n <React.Fragment key={key}>\n <Bar\n dataKey={key}\n fill={fillOf(key, barShape)}\n // Its own stack, so the headroom sits on this series' bar\n // while the series stay side by side.\n stackId={isStacked ? 'a' : headroomKey ? key : undefined}\n radius={radiusFor(barShape, rounded)}\n minPointSize={minPointSizeFor(key)}\n background={showBackground ? { fill: backgroundFill } : undefined}\n shape={shape}\n activeBar={activeBarShape}\n {...animation}\n >\n {cells}\n {labels}\n </Bar>\n {headroomKey && (\n <Bar\n dataKey={`${HEADROOM_FIELD_PREFIX}${key}`}\n stackId={key}\n fill={`var(--color-${key})`}\n fillOpacity={0.25}\n radius={radiusFor(barShape, true)}\n // Decoration for the bar below it — never its own row in the\n // tooltip or entry in the legend.\n legendType=\"none\"\n tooltipType=\"none\"\n {...animation}\n />\n )}\n </React.Fragment>\n );\n });\n\n const renderReferenceAreas = () =>\n referenceAreas.map(({ area, range }, index) => {\n const [start, end] = range;\n // Bands run along the category axis: X for vertical bars, Y for\n // horizontal ones.\n const bounds =\n orientation === 'horizontal'\n ? { y1: data[start]?.[xKey], y2: data[end]?.[xKey] }\n : { x1: data[start]?.[xKey], x2: data[end]?.[xKey] };\n return (\n <ReferenceArea\n key={`${area.label ?? 'area'}-${index}`}\n {...bounds}\n fill=\"var(--ui-background-surface-secondary)\"\n fillOpacity={0.6}\n ifOverflow=\"extendDomain\"\n shape={resolveBandShape({\n divider: area.divider,\n vertical: orientation !== 'horizontal',\n })}\n label={resolveBandLabel(area.label)}\n />\n );\n });\n\n const renderReferenceLines = () =>\n referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(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 // By default the caption sits at the top of the line: above the\n // right end of a horizontal line (vertical bars), or above the\n // top of a vertical line (horizontal bars).\n {...resolveReferenceLineProps(\n ref.label,\n ref.labelPosition ??\n (orientation === 'horizontal' ? 'top' : 'insideTopRight')\n )}\n />\n );\n });\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\n data={chartData as readonly unknown[]}\n layout={rechartsLayout}\n barSize={barSize}\n maxBarSize={maxBarSize}\n barGap={barGap}\n barCategoryGap={barCategoryGap}\n >\n <BarPaintServers\n id={defsId}\n dataKeys={dataKeys}\n shapes={usedShapes}\n horizontal={orientation === 'horizontal'}\n />\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? orientation === 'vertical'}\n vertical={gridVertical ?? orientation === 'horizontal'}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n {renderAxes()}\n {showTooltip && <ChartTooltip content={tooltipElement} />}\n {showLegend && <ChartLegend content={legendElement} />}\n {renderSeries()}\n {renderReferenceAreas()}\n {renderReferenceLines()}\n {showBrush && (\n <Brush\n dataKey={xKey}\n // The brush slices rows by index, so its captions come from\n // whichever axis holds the categories — Y for horizontal bars.\n tickFormatter={\n orientation === 'horizontal' ? yTickFormatter : xTickFormatter\n }\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","HEADROOM_FIELD_PREFIX","dropHeadroomSeries","payload","dataKeys","real","item","a","b","withSeriesColor","_a","NormalizedTooltipContent","content","props","merged","React","jsx","ChartTooltipContent","NormalizedLegendContent","ChartLegendContent","renderBarWithTrack","bar","track","trackFill","paint","jsxs","Fragment","Rectangle","createTrackShape","inRange","row","resolveBarShapes","rangeBackground","activeBarOption","renderBandWithDivider","band","vertical","x","y","width","height","fill","fillOpacity","resolveBandShape","divider","resolveBandLabel","label","BarPaintServers","id","shapes","horizontal","hasGradient","hasPattern","key","rangeCells","data","chartData","xKey","seriesKey","settings","range","headroomKey","barShape","rounded","fillOf","radiusFor","opacity","dashed","rowIndex","on","shape","stacksHeadroom","Cell","BarChart","className","config","referenceLine","referenceArea","barSettings","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","barSize","maxBarSize","barGap","barCategoryGap","minPointSize","showBackground","backgroundFill","showActiveBar","activeBar","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","animate","animationDuration","animationBegin","animationEasing","showLabels","labelPosition","labelFormatter","showBrush","brushHeight","brushAriaLabel","ref","animation","resolveAnimation","rechartsLayout","isStacked","barLabelPosition","resolveCartesianLabelPosition","referenceLines","toReferenceLineList","referenceAreas","area","resolveCategoryRange","entry","settingsByKey","headroomKeys","pair","extra","upperKey","start","end","value","upper","highlightedValues","categoryTick","index","tickProps","formatter","Text","cn","defsId","usedShapes","minPointSizeFor","top","own","xAxisTitle","resolveXAxisTitle","yAxisTitle","resolveYAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","resolveXAxisHeight","endRadius","tooltipElement","legendElement","renderAxes","XAxis","resolveRotatedTickAnchor","YAxis","renderSeries","activeBarShape","cells","labels","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","Bar","renderReferenceAreas","bounds","_b","_c","_d","ReferenceArea","renderReferenceLines","resolveChartReferenceValue","ReferenceLine","resolveReferenceLineProps","ChartContainer","RechartsBarChart","CartesianGrid","ChartTooltip","ChartLegend","Brush","resolveBrushProps"],"mappings":";;;;;;;AAgEA,MAAMA,KAAmBC,GAAI,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,GAmDKC,IAAwB;AAQvB,SAASC,GACdC,GACAC,GACiB;AACjB,QAAMC,IAAOF,KAAA,gBAAAA,EAAS;AAAA,IACpB,CAACG,MAAS,CAAC,OAAOA,EAAK,OAAO,EAAE,WAAWL,CAAqB;AAAA;AAKlE,SAAOG,IACHC,KAAA,gBAAAA,EAAM,QAAQ;AAAA,IACZ,CAACE,GAAGC,MACFJ,EAAS,QAAQ,OAAOG,EAAE,OAAO,CAAC,IAClCH,EAAS,QAAQ,OAAOI,EAAE,OAAO,CAAC;AAAA,MAEtCH;AACN;AAQO,SAASI,GACdN,G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AgB,eAAekB,IAAiBD;AAAA,sBAEjD,GAAG8F,GAAkB,EAAE,aAAA5E,IAAa,gBAAAC,IAAgB;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACvD;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA9C,GAAS,cAAc;"}
@@ -1,10 +1,10 @@
1
- import { jsxs as r, jsx as l, Fragment as z } from "react/jsx-runtime";
2
- import * as b from "react";
3
- import { cva as I } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { cn as x } from "../../../lib/utils.js";
5
- import { ChartStyle as y } from "../chart/chart.js";
6
- import { Tooltip as B, TooltipTrigger as O, TooltipContent as S } from "../tooltip/tooltip.js";
7
- const q = (c) => c.toLocaleString(), F = I("flex w-full overflow-hidden rounded-full bg-input", {
1
+ import { jsxs as l, jsx as a, Fragment as z } from "react/jsx-runtime";
2
+ import * as N from "react";
3
+ import { cva as B } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cn as k } from "../../../lib/utils.js";
5
+ import { ChartStyle as v } from "../chart/chart.js";
6
+ import { Tooltip as S, TooltipTrigger as I, TooltipContent as O } from "../tooltip/tooltip.js";
7
+ const q = (o) => o.toLocaleString(), F = B("flex w-full overflow-hidden rounded-full bg-input", {
8
8
  variants: {
9
9
  size: {
10
10
  sm: "h-1.5",
@@ -15,100 +15,121 @@ const q = (c) => c.toLocaleString(), F = I("flex w-full overflow-hidden rounded-
15
15
  defaultVariants: {
16
16
  size: "md"
17
17
  }
18
- }), R = b.forwardRef(
18
+ });
19
+ function R({
20
+ chartId: o,
21
+ config: n,
22
+ color: t,
23
+ label: d,
24
+ percent: m,
25
+ segmentKey: f,
26
+ value: u,
27
+ valueFormatter: s,
28
+ renderContent: c
29
+ }) {
30
+ return /* @__PURE__ */ l(
31
+ O,
32
+ {
33
+ "data-chart": o,
34
+ className: k(
35
+ "border border-border bg-background text-foreground shadow-md",
36
+ !c && "flex items-center gap-2"
37
+ ),
38
+ children: [
39
+ /* @__PURE__ */ a(v, { id: o, config: n }),
40
+ c ? c({ key: f, value: u, label: d, percent: m, color: t }) : /* @__PURE__ */ l(z, { children: [
41
+ /* @__PURE__ */ a(
42
+ "span",
43
+ {
44
+ className: "size-2.5 shrink-0 rounded-full",
45
+ style: { backgroundColor: t }
46
+ }
47
+ ),
48
+ /* @__PURE__ */ a("span", { className: "font-semibold", children: d }),
49
+ /* @__PURE__ */ l("span", { className: "text-muted-foreground tabular-nums", children: [
50
+ s(u),
51
+ " · ",
52
+ m,
53
+ "%"
54
+ ] })
55
+ ] })
56
+ ]
57
+ }
58
+ );
59
+ }
60
+ const V = N.forwardRef(
19
61
  ({
20
- className: c,
62
+ className: o,
21
63
  data: n,
22
- config: o,
23
- size: g,
24
- showLegend: k = !1,
25
- showTooltip: v = !0,
26
- tooltipContent: d,
27
- valueFormatter: i = q,
28
- defaultOpenIndex: N,
64
+ config: t,
65
+ size: d,
66
+ showLegend: m = !1,
67
+ showTooltip: f = !0,
68
+ tooltipContent: u,
69
+ valueFormatter: s = q,
70
+ defaultOpenIndex: c,
29
71
  "aria-label": w,
30
72
  ...C
31
73
  }, T) => {
32
- const s = `chart-${b.useId().replace(/:/g, "")}`, f = n.reduce((e, a) => e + a.value, 0), u = (e) => {
33
- var a;
34
- return ((a = o[e]) == null ? void 0 : a.label) ?? e;
74
+ const p = `chart-${N.useId().replace(/:/g, "")}`, h = n.reduce((e, r) => e + r.value, 0), b = (e) => {
75
+ var r;
76
+ return ((r = t[e]) == null ? void 0 : r.label) ?? e;
35
77
  }, $ = (e) => {
36
- var t;
37
- const a = (t = o[e]) == null ? void 0 : t.label;
38
- return typeof a == "string" || typeof a == "number" ? String(a) : e;
39
- }, p = (e) => `var(--color-${e})`, m = (e) => f > 0 ? Math.round(e / f * 100) : 0, j = w ?? n.map((e) => `${$(e.key)} ${i(e.value)}`).join(", ");
40
- return /* @__PURE__ */ r(
78
+ var i;
79
+ const r = (i = t[e]) == null ? void 0 : i.label;
80
+ return typeof r == "string" || typeof r == "number" ? String(r) : e;
81
+ }, x = (e) => `var(--color-${e})`, y = (e) => h > 0 ? Math.round(e / h * 100) : 0, j = w ?? n.map((e) => `${$(e.key)} ${s(e.value)}`).join(", ");
82
+ return /* @__PURE__ */ l(
41
83
  "div",
42
84
  {
43
85
  ref: T,
44
- "data-chart": s,
45
- className: x("flex w-full flex-col gap-3", c),
86
+ "data-chart": p,
87
+ className: k("flex w-full flex-col gap-3", o),
46
88
  ...C,
47
89
  children: [
48
- /* @__PURE__ */ l(y, { id: s, config: o }),
49
- /* @__PURE__ */ l("div", { className: F({ size: g }), role: "img", "aria-label": j, children: n.map((e, a) => {
50
- const t = p(e.key), h = /* @__PURE__ */ l(
90
+ /* @__PURE__ */ a(v, { id: p, config: t }),
91
+ /* @__PURE__ */ a("div", { className: F({ size: d }), role: "img", "aria-label": j, children: n.map((e, r) => {
92
+ const i = x(e.key), g = /* @__PURE__ */ a(
51
93
  "div",
52
94
  {
53
95
  className: "h-full min-w-0",
54
- style: { flex: `${e.value} 0 0%`, backgroundColor: t }
96
+ style: { flex: `${e.value} 0 0%`, backgroundColor: i }
55
97
  },
56
98
  e.key
57
99
  );
58
- return v ? /* @__PURE__ */ r(B, { defaultOpen: a === N, children: [
59
- /* @__PURE__ */ l(O, { render: h }),
60
- /* @__PURE__ */ r(
61
- S,
100
+ return f ? /* @__PURE__ */ l(S, { defaultOpen: r === c, children: [
101
+ /* @__PURE__ */ a(I, { render: g }),
102
+ /* @__PURE__ */ a(
103
+ R,
62
104
  {
63
- "data-chart": s,
64
- className: x(
65
- "border border-border bg-background text-foreground shadow-md",
66
- !d && "flex items-center gap-2"
67
- ),
68
- children: [
69
- /* @__PURE__ */ l(y, { id: s, config: o }),
70
- d ? d({
71
- key: e.key,
72
- value: e.value,
73
- label: u(e.key),
74
- percent: m(e.value),
75
- color: t
76
- }) : /* @__PURE__ */ r(z, { children: [
77
- /* @__PURE__ */ l(
78
- "span",
79
- {
80
- className: "size-2.5 shrink-0 rounded-full",
81
- style: { backgroundColor: t }
82
- }
83
- ),
84
- /* @__PURE__ */ l("span", { className: "font-semibold", children: u(e.key) }),
85
- /* @__PURE__ */ r("span", { className: "text-muted-foreground tabular-nums", children: [
86
- i(e.value),
87
- " · ",
88
- m(e.value),
89
- "%"
90
- ] })
91
- ] })
92
- ]
105
+ chartId: p,
106
+ config: t,
107
+ color: i,
108
+ label: b(e.key),
109
+ percent: y(e.value),
110
+ segmentKey: e.key,
111
+ value: e.value,
112
+ valueFormatter: s,
113
+ renderContent: u
93
114
  }
94
115
  )
95
- ] }, e.key) : h;
116
+ ] }, e.key) : g;
96
117
  }) }),
97
- k && /* @__PURE__ */ l("ul", { className: "flex flex-wrap justify-between gap-x-6 gap-y-3", children: n.map((e) => /* @__PURE__ */ r("li", { className: "flex flex-col gap-1.5", children: [
98
- /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5 text-sm leading-none text-muted-foreground", children: [
99
- /* @__PURE__ */ l(
118
+ m && /* @__PURE__ */ a("ul", { className: "flex flex-wrap justify-between gap-x-6 gap-y-3", children: n.map((e) => /* @__PURE__ */ l("li", { className: "flex flex-col gap-1.5", children: [
119
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-1.5 text-sm leading-none text-muted-foreground", children: [
120
+ /* @__PURE__ */ a(
100
121
  "span",
101
122
  {
102
- className: "size-2.5 shrink-0 rounded-full",
103
- style: { backgroundColor: p(e.key) }
123
+ className: "size-2.5 shrink-0 rounded-sm",
124
+ style: { backgroundColor: x(e.key) }
104
125
  }
105
126
  ),
106
- u(e.key)
127
+ b(e.key)
107
128
  ] }),
108
- /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1.5 leading-none tabular-nums", children: [
109
- /* @__PURE__ */ l("span", { className: "text-base font-semibold text-foreground", children: i(e.value) }),
110
- /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
111
- m(e.value),
129
+ /* @__PURE__ */ l("span", { className: "flex items-baseline gap-1.5 leading-none tabular-nums", children: [
130
+ /* @__PURE__ */ a("span", { className: "text-base font-semibold text-foreground", children: s(e.value) }),
131
+ /* @__PURE__ */ l("span", { className: "text-sm text-muted-foreground", children: [
132
+ y(e.value),
112
133
  "%"
113
134
  ] })
114
135
  ] })
@@ -118,9 +139,9 @@ const q = (c) => c.toLocaleString(), F = I("flex w-full overflow-hidden rounded-
118
139
  );
119
140
  }
120
141
  );
121
- R.displayName = "CategoryBar";
142
+ V.displayName = "CategoryBar";
122
143
  export {
123
- R as CategoryBar,
144
+ V as CategoryBar,
124
145
  F as categoryBarVariants
125
146
  };
126
147
  //# sourceMappingURL=category-bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-bar.js","sources":["../../../../src/components/ui/category-bar/category-bar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { ChartStyle, type ChartConfig } from '../chart';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';\n\n// A category bar: a single horizontal bar split into proportional colored\n// segments — one part-to-whole across a handful of categories, in one row\n// (onboarding stages, certification status, a rating scale). Unlike `Meter`\n// (one value per row, stacked into a bar list), all segments share the same bar.\n// It's a plain flex composition, not a recharts chart: each segment's width is\n// `value / total`, so exact proportions and the count/% legend are direct DOM,\n// with no axes/grid to hide. Segment colors are caller-supplied via `config`\n// (existing semantic `--ui-*` tokens); there is no chart palette tier yet.\n//\n// Colors are consumed through the same `--color-<key>` bridge the recharts\n// charts use: `ChartStyle` emits one custom property per config entry, so a\n// `theme: { light, dark }` entry works as well as a flat `color` — reading\n// `config[key].color` directly would render a themed config colorless. The\n// tooltip is portaled out of the bar's DOM, so its popup carries its own\n// `data-chart` scope + `ChartStyle` to keep the bridge resolvable there.\n\nconst defaultFormat = (value: number) => value.toLocaleString();\n\n// Track height only — the flex/rounded/overflow chrome is static.\nconst categoryBarVariants = cva('flex w-full overflow-hidden rounded-full bg-input', {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport interface CategoryBarSegment {\n /** Key into `config` for this segment's label + color. */\n key: string;\n /** The segment's value — its width is this over the sum of all values. */\n value: number;\n}\n\n/** The resolved segment passed to a custom `tooltipContent` renderer. */\nexport interface CategoryBarTooltipContext extends CategoryBarSegment {\n /** Resolved `config` label (falls back to the key); may be any `ReactNode`. */\n label: React.ReactNode;\n /** Share of the total as a rounded percentage (0–100). */\n percent: number;\n /**\n * CSS color reference for the segment — the `var(--color-<key>)` bridge, which\n * resolves the config entry's `color` or its per-theme `theme` value. Usable\n * anywhere a CSS color is (e.g. a `style` background); not a literal value.\n */\n color: string;\n}\n\nexport interface CategoryBarProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof categoryBarVariants> {\n /** Ordered segments (left → right). Widths are proportional to `value`. */\n data: ReadonlyArray<CategoryBarSegment>;\n /** Maps each segment `key` to a `label` and `color` (an existing `--ui-*` token). */\n config: ChartConfig;\n /** Show the legend below the bar (color dot + label + value + %). */\n showLegend?: boolean;\n /** Show a hover tooltip per segment (dot + label + value + %). */\n showTooltip?: boolean;\n /**\n * Custom tooltip content per segment — replaces the default (dot + label +\n * `value · %`) inside the same card. Ignored when `showTooltip` is false.\n */\n tooltipContent?: (segment: CategoryBarTooltipContext) => React.ReactNode;\n /** Format the numeric value (legend + tooltip). Defaults to `toLocaleString()`. */\n valueFormatter?: (value: number) => string;\n /** Render the tooltip for this segment index initially open (VR/testing). */\n defaultOpenIndex?: number;\n /**\n * Accessible summary of the whole bar. Defaults to a `label value` list built\n * from the data; pass a fuller sentence for screen readers if you have one.\n */\n 'aria-label'?: string;\n}\n\nconst CategoryBar = React.forwardRef<HTMLDivElement, CategoryBarProps>(\n (\n {\n className,\n data,\n config,\n size,\n showLegend = false,\n showTooltip = true,\n tooltipContent,\n valueFormatter = defaultFormat,\n defaultOpenIndex,\n 'aria-label': ariaLabel,\n ...props\n },\n ref\n ) => {\n const uniqueId = React.useId();\n const chartId = `chart-${uniqueId.replace(/:/g, '')}`;\n\n const total = data.reduce((sum, seg) => sum + seg.value, 0);\n const labelFor = (key: string): React.ReactNode => config[key]?.label ?? key;\n // The aria-label has to be a plain string, so a rich (element) label can't\n // be used there — fall back to the key rather than stringifying it into\n // \"[object Object]\".\n const labelTextFor = (key: string) => {\n const label = config[key]?.label;\n return typeof label === 'string' || typeof label === 'number'\n ? String(label)\n : key;\n };\n const colorOf = (key: string) => `var(--color-${key})`;\n const pctOf = (value: number) =>\n total > 0 ? Math.round((value / total) * 100) : 0;\n\n // A locale-neutral fallback: \"<label> <value>\" pairs. Consumers can pass a\n // fuller `aria-label` sentence.\n const summary =\n ariaLabel ??\n data\n .map((seg) => `${labelTextFor(seg.key)} ${valueFormatter(seg.value)}`)\n .join(', ');\n\n return (\n <div\n ref={ref}\n data-chart={chartId}\n className={cn('flex w-full flex-col gap-3', className)}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <div className={categoryBarVariants({ size })} role=\"img\" aria-label={summary}>\n {data.map((seg, index) => {\n const color = colorOf(seg.key);\n // flex-grow proportional to value with a zero basis → widths are\n // exactly value/total; a zero-value segment collapses.\n const segment = (\n <div\n key={seg.key}\n className=\"h-full min-w-0\"\n style={{ flex: `${seg.value} 0 0%`, backgroundColor: color }}\n />\n );\n\n if (!showTooltip) return segment;\n\n return (\n <Tooltip key={seg.key} defaultOpen={index === defaultOpenIndex}>\n <TooltipTrigger render={segment} />\n <TooltipContent\n // The popup is portaled out of the bar, so it needs its own\n // `data-chart` scope for the `--color-*` bridge to resolve.\n data-chart={chartId}\n className={cn(\n 'border border-border bg-background text-foreground shadow-md',\n !tooltipContent && 'flex items-center gap-2'\n )}\n >\n <ChartStyle id={chartId} config={config} />\n {tooltipContent ? (\n tooltipContent({\n key: seg.key,\n value: seg.value,\n label: labelFor(seg.key),\n percent: pctOf(seg.value),\n color,\n })\n ) : (\n <>\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: color }}\n />\n <span className=\"font-semibold\">{labelFor(seg.key)}</span>\n <span className=\"text-muted-foreground tabular-nums\">\n {valueFormatter(seg.value)} · {pctOf(seg.value)}%\n </span>\n </>\n )}\n </TooltipContent>\n </Tooltip>\n );\n })}\n </div>\n\n {showLegend && (\n <ul className=\"flex flex-wrap justify-between gap-x-6 gap-y-3\">\n {data.map((seg) => (\n <li key={seg.key} className=\"flex flex-col gap-1.5\">\n <span className=\"flex items-center gap-1.5 text-sm leading-none text-muted-foreground\">\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: colorOf(seg.key) }}\n />\n {labelFor(seg.key)}\n </span>\n <span className=\"flex items-baseline gap-1.5 leading-none tabular-nums\">\n <span className=\"text-base font-semibold text-foreground\">\n {valueFormatter(seg.value)}\n </span>\n <span className=\"text-sm text-muted-foreground\">\n {pctOf(seg.value)}%\n </span>\n </span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n }\n);\nCategoryBar.displayName = 'CategoryBar';\n\nexport { CategoryBar, categoryBarVariants };\n"],"names":["defaultFormat","value","categoryBarVariants","cva","CategoryBar","React","className","data","config","size","showLegend","showTooltip","tooltipContent","valueFormatter","defaultOpenIndex","ariaLabel","props","ref","chartId","total","sum","seg","labelFor","key","_a","labelTextFor","label","colorOf","pctOf","summary","jsxs","cn","jsx","ChartStyle","index","color","segment","Tooltip","TooltipTrigger","TooltipContent","Fragment"],"mappings":";;;;;;AAyBA,MAAMA,IAAgB,CAACC,MAAkBA,EAAM,eAAA,GAGzCC,IAAsBC,EAAI,qDAAqD;AAAA,EACnF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAA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A;AAAA,wBAAAjB,EAAeQ,EAAI,KAAK;AAAA,wBAAE;AAAA,wBAAIO,EAAMP,EAAI,KAAK;AAAA,wBAAE;AAAA,sBAAA,EAAA,CAClD;AAAA,oBAAA,EAAA,CACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YAEJ,EAAA,GAhCYA,EAAI,GAiClB,IApCuBe;AAAA,UAsC3B,CAAC,EAAA,CACH;AAAA,UAEC1B,KACC,gBAAAsB,EAAC,MAAA,EAAG,WAAU,kDACX,UAAAzB,EAAK,IAAI,CAACc,MACT,gBAAAS,EAAC,MAAA,EAAiB,WAAU,yBAC1B,UAAA;AAAA,YAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,wEACd,UAAA;AAAA,cAAA,gBAAAE;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,OAAO,EAAE,iBAAiBL,EAAQN,EAAI,GAAG,EAAA;AAAA,gBAAE;AAAA,cAAA;AAAA,cAE5CC,EAASD,EAAI,GAAG;AAAA,YAAA,GACnB;AAAA,YACA,gBAAAS,EAAC,QAAA,EAAK,WAAU,yDACd,UAAA;AAAA,cAAA,gBAAAE,EAAC,UAAK,WAAU,2CACb,UAAAnB,EAAeQ,EAAI,KAAK,GAC3B;AAAA,cACA,gBAAAS,EAAC,QAAA,EAAK,WAAU,iCACb,UAAA;AAAA,gBAAAF,EAAMP,EAAI,KAAK;AAAA,gBAAE;AAAA,cAAA,EAAA,CACpB;AAAA,YAAA,EAAA,CACF;AAAA,UAAA,KAfOA,EAAI,GAgBb,CACD,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAjB,EAAY,cAAc;"}
1
+ {"version":3,"file":"category-bar.js","sources":["../../../../src/components/ui/category-bar/category-bar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { ChartStyle, type ChartConfig } from '../chart';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';\n\n// A category bar: a single horizontal bar split into proportional colored\n// segments — one part-to-whole across a handful of categories, in one row\n// (onboarding stages, certification status, a rating scale). Unlike `Meter`\n// (one value per row, stacked into a bar list), all segments share the same bar.\n// It's a plain flex composition, not a recharts chart: each segment's width is\n// `value / total`, so exact proportions and the count/% legend are direct DOM,\n// with no axes/grid to hide. Segment colors are caller-supplied via `config`\n// (existing semantic `--ui-*` tokens); there is no chart palette tier yet.\n//\n// Colors are consumed through the same `--color-<key>` bridge the recharts\n// charts use: `ChartStyle` emits one custom property per config entry, so a\n// `theme: { light, dark }` entry works as well as a flat `color` — reading\n// `config[key].color` directly would render a themed config colorless. The\n// tooltip is portaled out of the bar's DOM, so its popup carries its own\n// `data-chart` scope + `ChartStyle` to keep the bridge resolvable there.\n\nconst defaultFormat = (value: number) => value.toLocaleString();\n\n// Track height only — the flex/rounded/overflow chrome is static.\nconst categoryBarVariants = cva('flex w-full overflow-hidden rounded-full bg-input', {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport interface CategoryBarSegment {\n /** Key into `config` for this segment's label + color. */\n key: string;\n /** The segment's value — its width is this over the sum of all values. */\n value: number;\n}\n\n/** The resolved segment passed to a custom `tooltipContent` renderer. */\nexport interface CategoryBarTooltipContext extends CategoryBarSegment {\n /** Resolved `config` label (falls back to the key); may be any `ReactNode`. */\n label: React.ReactNode;\n /** Share of the total as a rounded percentage (0–100). */\n percent: number;\n /**\n * CSS color reference for the segment — the `var(--color-<key>)` bridge, which\n * resolves the config entry's `color` or its per-theme `theme` value. Usable\n * anywhere a CSS color is (e.g. a `style` background); not a literal value.\n */\n color: string;\n}\n\nexport interface CategoryBarProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof categoryBarVariants> {\n /** Ordered segments (left → right). Widths are proportional to `value`. */\n data: ReadonlyArray<CategoryBarSegment>;\n /** Maps each segment `key` to a `label` and `color` (an existing `--ui-*` token). */\n config: ChartConfig;\n /** Show the legend below the bar (color dot + label + value + %). */\n showLegend?: boolean;\n /** Show a hover tooltip per segment (dot + label + value + %). */\n showTooltip?: boolean;\n /**\n * Custom tooltip content per segment — replaces the default (dot + label +\n * `value · %`) inside the same card. Ignored when `showTooltip` is false.\n */\n tooltipContent?: (segment: CategoryBarTooltipContext) => React.ReactNode;\n /** Format the numeric value (legend + tooltip). Defaults to `toLocaleString()`. */\n valueFormatter?: (value: number) => string;\n /** Render the tooltip for this segment index initially open (VR/testing). */\n defaultOpenIndex?: number;\n /**\n * Accessible summary of the whole bar. Defaults to a `label value` list built\n * from the data; pass a fuller sentence for screen readers if you have one.\n */\n 'aria-label'?: string;\n}\n\n/**\n * One segment's hover card.\n *\n * It re-declares `data-chart` and re-renders `ChartStyle` because the popup is\n * portaled out of the bar: outside that subtree the `--color-*` bridge the\n * swatch reads has nothing to resolve against.\n */\nfunction CategoryBarSegmentTooltip({\n chartId,\n config,\n color,\n label,\n percent,\n segmentKey,\n value,\n valueFormatter,\n renderContent,\n}: {\n chartId: string;\n config: ChartConfig;\n color: string;\n label: React.ReactNode;\n percent: number;\n segmentKey: string;\n value: number;\n valueFormatter: (value: number) => string;\n // Not named `render`: in this package that name is reserved for Base UI's\n // polymorphic composition prop (see `<TooltipTrigger render={…} />` below).\n renderContent?: (segment: CategoryBarTooltipContext) => React.ReactNode;\n}) {\n return (\n <TooltipContent\n data-chart={chartId}\n className={cn(\n 'border border-border bg-background text-foreground shadow-md',\n !renderContent && 'flex items-center gap-2'\n )}\n >\n <ChartStyle id={chartId} config={config} />\n {renderContent ? (\n renderContent({ key: segmentKey, value, label, percent, color })\n ) : (\n <>\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: color }}\n />\n <span className=\"font-semibold\">{label}</span>\n <span className=\"text-muted-foreground tabular-nums\">\n {valueFormatter(value)} · {percent}%\n </span>\n </>\n )}\n </TooltipContent>\n );\n}\n\nconst CategoryBar = React.forwardRef<HTMLDivElement, CategoryBarProps>(\n (\n {\n className,\n data,\n config,\n size,\n showLegend = false,\n showTooltip = true,\n tooltipContent,\n valueFormatter = defaultFormat,\n defaultOpenIndex,\n 'aria-label': ariaLabel,\n ...props\n },\n ref\n ) => {\n const uniqueId = React.useId();\n const chartId = `chart-${uniqueId.replace(/:/g, '')}`;\n\n const total = data.reduce((sum, seg) => sum + seg.value, 0);\n const labelFor = (key: string): React.ReactNode => config[key]?.label ?? key;\n // The aria-label has to be a plain string, so a rich (element) label can't\n // be used there — fall back to the key rather than stringifying it into\n // \"[object Object]\".\n const labelTextFor = (key: string) => {\n const label = config[key]?.label;\n return typeof label === 'string' || typeof label === 'number'\n ? String(label)\n : key;\n };\n const colorOf = (key: string) => `var(--color-${key})`;\n const pctOf = (value: number) =>\n total > 0 ? Math.round((value / total) * 100) : 0;\n\n // A locale-neutral fallback: \"<label> <value>\" pairs. Consumers can pass a\n // fuller `aria-label` sentence.\n const summary =\n ariaLabel ??\n data\n .map((seg) => `${labelTextFor(seg.key)} ${valueFormatter(seg.value)}`)\n .join(', ');\n\n return (\n <div\n ref={ref}\n data-chart={chartId}\n className={cn('flex w-full flex-col gap-3', className)}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <div className={categoryBarVariants({ size })} role=\"img\" aria-label={summary}>\n {data.map((seg, index) => {\n const color = colorOf(seg.key);\n // flex-grow proportional to value with a zero basis → widths are\n // exactly value/total; a zero-value segment collapses.\n const segment = (\n <div\n key={seg.key}\n className=\"h-full min-w-0\"\n style={{ flex: `${seg.value} 0 0%`, backgroundColor: color }}\n />\n );\n\n if (!showTooltip) return segment;\n\n return (\n <Tooltip key={seg.key} defaultOpen={index === defaultOpenIndex}>\n <TooltipTrigger render={segment} />\n <CategoryBarSegmentTooltip\n chartId={chartId}\n config={config}\n color={color}\n label={labelFor(seg.key)}\n percent={pctOf(seg.value)}\n segmentKey={seg.key}\n value={seg.value}\n valueFormatter={valueFormatter}\n renderContent={tooltipContent}\n />\n </Tooltip>\n );\n })}\n </div>\n\n {showLegend && (\n <ul className=\"flex flex-wrap justify-between gap-x-6 gap-y-3\">\n {data.map((seg) => (\n <li key={seg.key} className=\"flex flex-col gap-1.5\">\n <span className=\"flex items-center gap-1.5 text-sm leading-none text-muted-foreground\">\n <span\n className=\"size-2.5 shrink-0 rounded-sm\"\n style={{ backgroundColor: colorOf(seg.key) }}\n />\n {labelFor(seg.key)}\n </span>\n <span className=\"flex items-baseline gap-1.5 leading-none tabular-nums\">\n <span className=\"text-base font-semibold text-foreground\">\n {valueFormatter(seg.value)}\n </span>\n <span className=\"text-sm text-muted-foreground\">\n {pctOf(seg.value)}%\n </span>\n </span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n }\n);\nCategoryBar.displayName = 'CategoryBar';\n\nexport { CategoryBar, categoryBarVariants };\n"],"names":["defaultFormat","value","categoryBarVariants","cva","CategoryBarSegmentTooltip","chartId","config","color","label","percent","segmentKey","valueFormatter","renderContent","jsxs","TooltipContent","cn","jsx","ChartStyle","Fragment","CategoryBar","React","className","data","size","showLegend","showTooltip","tooltipContent","defaultOpenIndex","ariaLabel","props","ref","total","sum","seg","labelFor","key","_a","labelTextFor","colorOf","pctOf","summary","index","segment","Tooltip","TooltipTrigger"],"mappings":";;;;;;AAyBA,MAAMA,IAAgB,CAACC,MAAkBA,EAAM,eAAA,GAGzCC,IAAsBC,EAAI,qDAAqD;AAAA,EACnF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC;AAyDD,SAASC,EAA0B;AAAA,EACjC,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,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