{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "recharts-bar-chart",
  "description": "Deprecated: Recharts bar chart. Use bar-chart instead.",
  "dependencies": [
    "recharts",
    "cn@^0.2.4"
  ],
  "registryDependencies": [
    "https://ui-three-mu.vercel.app/r/recharts-chart.json"
  ],
  "files": [
    {
      "path": "registry/preskok/ui/preskok-ui/recharts-bar-chart.tsx",
      "content": "\"use client\"\n\nimport React, { startTransition, type ComponentProps } from \"react\"\nimport { twMerge } from \"cn\"\nimport { Bar, BarChart as BarChartPrimitive } from \"recharts\"\nimport type {\n  NameType,\n  ValueType,\n} from \"recharts/types/component/DefaultTooltipContent\"\n\nimport {\n  CartesianGrid,\n  Chart,\n  ChartLegend,\n  ChartLegendContent,\n  ChartTooltip,\n  ChartTooltipContent,\n  constructCategoryColors,\n  DEFAULT_COLORS,\n  getColorValue,\n  valueToPercent,\n  XAxis,\n  YAxis,\n  type BaseChartProps,\n} from \"./recharts-chart\"\n\ninterface RechartsBarChartProps<\n  TValue extends ValueType,\n  TName extends NameType,\n> extends BaseChartProps<TValue, TName> {\n  barCategoryGap?: number\n  barRadius?: number\n  barGap?: number\n  barSize?: number\n  barProps?: Partial<React.ComponentProps<typeof Bar>>\n\n  chartProps?: Omit<\n    ComponentProps<typeof BarChartPrimitive>,\n    \"data\" | \"stackOffset\"\n  >\n}\n\nconst defaultValueFormatter = (value: number) => value.toString()\n\n/**\n * @deprecated Use `BarChart` from `@preskok/bar-chart`, built on TanStack Charts.\n */\nconst RechartsBarChart = <TValue extends ValueType, TName extends NameType>({\n  data = [],\n  dataKey,\n  colors = DEFAULT_COLORS,\n  type = \"default\",\n  className,\n  config,\n  children,\n  layout = \"horizontal\",\n\n  // Components\n  tooltip = true,\n  tooltipProps,\n\n  legend = true,\n  legendProps,\n\n  intervalType = \"equidistantPreserveStart\",\n\n  barCategoryGap = 5,\n  barGap,\n  barSize,\n  barRadius,\n  barProps,\n\n  valueFormatter = defaultValueFormatter,\n\n  // XAxis\n  displayEdgeLabelsOnly = false,\n  xAxisProps,\n  hideXAxis = false,\n\n  // YAxis\n  yAxisProps,\n  hideYAxis = false,\n\n  hideGridLines = false,\n  chartProps,\n  ...props\n}: RechartsBarChartProps<TValue, TName>) => {\n  const categoryColors = constructCategoryColors(Object.keys(config), colors)\n\n  const stacked = type === \"stacked\" || type === \"percent\"\n  return (\n    <Chart\n      className={twMerge(\"w-full\", className)}\n      config={config}\n      data={data}\n      dataKey={dataKey}\n      layout={layout}\n      {...props}\n    >\n      {({ onLegendSelect, selectedLegend }) => (\n        <BarChartPrimitive\n          onClick={() => {\n            onLegendSelect(null)\n          }}\n          data={data}\n          margin={{\n            bottom: 0,\n            left: 5,\n            right: 0,\n            top: 5,\n          }}\n          layout={layout === \"radial\" ? \"horizontal\" : layout}\n          barGap={barGap}\n          barSize={barSize}\n          barCategoryGap={barCategoryGap}\n          stackOffset={\n            type === \"percent\" ? \"expand\" : stacked ? \"sign\" : undefined\n          }\n          {...chartProps}\n        >\n          {!hideGridLines && <CartesianGrid strokeDasharray=\"4 4\" />}\n          <XAxis\n            hide={hideXAxis}\n            className=\"**:[text]:fill-muted-foreground\"\n            displayEdgeLabelsOnly={displayEdgeLabelsOnly}\n            intervalType={intervalType}\n            {...xAxisProps}\n          />\n          <YAxis\n            hide={hideYAxis}\n            className=\"**:[text]:fill-muted-foreground\"\n            tickFormatter={type === \"percent\" ? valueToPercent : valueFormatter}\n            {...yAxisProps}\n          />\n\n          {legend && (\n            <ChartLegend\n              content={\n                typeof legend === \"boolean\" ? <ChartLegendContent /> : legend\n              }\n              {...legendProps}\n            />\n          )}\n\n          {tooltip && (\n            <ChartTooltip\n              content={\n                typeof tooltip === \"boolean\" ? (\n                  <ChartTooltipContent accessibilityLayer />\n                ) : (\n                  tooltip\n                )\n              }\n              {...tooltipProps}\n            />\n          )}\n\n          {!children\n            ? Object.entries(config).map(([category, values]) => {\n                return (\n                  <Bar\n                    key={category}\n                    name={category}\n                    dataKey={category}\n                    stroke={getColorValue(\n                      values.color || categoryColors.get(category)\n                    )}\n                    strokeWidth={1}\n                    stackId={stacked ? \"stack\" : undefined}\n                    onClick={(_item, _number, event) => {\n                      event.stopPropagation()\n\n                      startTransition(() => {\n                        onLegendSelect(category)\n                      })\n                    }}\n                    radius={barRadius ?? (stacked ? undefined : 4)}\n                    strokeOpacity={\n                      selectedLegend && selectedLegend !== category ? 0.2 : 0\n                    }\n                    fillOpacity={\n                      selectedLegend && selectedLegend !== category ? 0.1 : 1\n                    }\n                    fill={getColorValue(\n                      values.color || categoryColors.get(category)\n                    )}\n                    {...barProps}\n                  />\n                )\n              })\n            : children}\n        </BarChartPrimitive>\n      )}\n    </Chart>\n  )\n}\n\nexport { RechartsBarChart }\nexport type { RechartsBarChartProps }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}