{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-line-chart",
  "title": "Line Chart",
  "description": "A responsive line chart with plain lines, gradient area fills, stacked areas, reference lines, and brush zoom.",
  "dependencies": [
    "recharts",
    "class-variance-authority",
    "lucide-react"
  ],
  "registryDependencies": [
    "@lema-ds/skeleton",
    "@lema-ds/ui-i18n",
    "@lema-ds/format-utils",
    "@lema-ds/chart-axis-width",
    "@lema-ds/ds-locale-provider"
  ],
  "files": [
    {
      "path": "components/ds/ds-line-chart.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  Area,\n  AreaChart as RechartsAreaChart,\n  Brush,\n  CartesianGrid,\n  Legend,\n  ReferenceLine as RechartsReferenceLine,\n  ResponsiveContainer,\n  Tooltip,\n  XAxis,\n  YAxis,\n} from \"recharts\"\nimport { cva } from \"class-variance-authority\"\nimport { TrendingUp } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport { UI_I18N, type UILocale } from \"@/lib/ui-i18n\"\nimport { useUILocale } from \"@/components/ui/ds-locale-provider\"\nimport { formatChartValue, type FormatPreset } from \"@/lib/format-utils\"\nimport { measureAxisWidth } from \"@/lib/chart-axis-width\"\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\n/** \"line\" = plain strokes; \"area\" = gradient fill; \"area-stacked\" = stacked gradient areas */\nexport type LineChartVariant = \"line\" | \"area\" | \"area-stacked\"\nexport type LegendPosition = \"top\" | \"bottom\" | \"left\" | \"right\"\n\n/** When data-point dots are rendered */\nexport type LineDotVisibility = \"none\" | \"hover\" | \"always\"\n\n/** Line interpolation style */\nexport type LineCurve = \"linear\" | \"smooth\" | \"step\"\n\nexport interface LineChartKey {\n  key: string\n  label?: string\n  /** Defaults to the next --chart-N token */\n  color?: string\n  /** Render as a dashed stroke — useful for projected or estimated series */\n  dashed?: boolean\n}\n\nexport interface LineChartReferenceLine {\n  value: number\n  label?: string\n  color?: string\n  /** @default true */\n  dashed?: boolean\n}\n\nexport interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {\n  data: Record<string, string | number>[]\n  /** Keys to plot — accepts plain strings or { key, label, color, dashed } objects */\n  dataKeys: LineChartKey[] | string[]\n  /** Object key mapped to the category (X) axis */\n  categoryKey: string\n  title?: string\n  subtitle?: string\n  footer?: React.ReactNode\n  variant?: LineChartVariant\n  curve?: LineCurve\n  /** When to show data-point dots */\n  dots?: LineDotVisibility\n  height?: number\n  showGrid?: boolean\n  showLegend?: boolean\n  /** @default \"bottom\" */\n  legendPosition?: LegendPosition\n  showTooltip?: boolean\n  /** Bridge over null / undefined values instead of breaking the line */\n  connectNulls?: boolean\n  /** Horizontal threshold lines — targets, SLA limits, averages, etc. */\n  referenceLines?: LineChartReferenceLine[]\n  /** Format value-axis tick labels and tooltip values */\n  valueFormatter?: (value: number) => string\n  /**\n   * Show a range brush below the chart to scroll and zoom the category axis.\n   * The brush occupies ~30 px of the chart height, so increase `height`\n   * accordingly when enabling.\n   */\n  showBrush?: boolean\n  format?: FormatPreset\n  decimals?: number\n  currency?: string\n  abbreviate?: boolean\n  /** Show animated skeleton in place of the chart while data loads */\n  loading?: boolean\n  locale?: UILocale\n  /** Label centred on the horizontal (category/value) axis */\n  xAxisLabel?: string\n  /** Label centred on the vertical (value/category) axis */\n  yAxisLabel?: string\n}\n\n// ── Constants ──────────────────────────────────────────────────────────────\n\nconst CHART_COLORS = [\n  \"var(--chart-1)\",\n  \"var(--chart-2)\",\n  \"var(--chart-3)\",\n  \"var(--chart-4)\",\n  \"var(--chart-5)\",\n]\n\nconst CURVE_TYPE = {\n  linear: \"linear\",\n  smooth: \"monotone\",\n  step: \"step\",\n} as const\n\nconst LEGEND_LAYOUT: Record<\n  LegendPosition,\n  {\n    verticalAlign: \"top\" | \"middle\" | \"bottom\"\n    align: \"left\" | \"center\" | \"right\"\n    layout: \"horizontal\" | \"vertical\"\n  }\n> = {\n  top: { verticalAlign: \"top\", align: \"center\", layout: \"horizontal\" },\n  bottom: { verticalAlign: \"bottom\", align: \"center\", layout: \"horizontal\" },\n  left: { verticalAlign: \"middle\", align: \"left\", layout: \"vertical\" },\n  right: { verticalAlign: \"middle\", align: \"right\", layout: \"vertical\" },\n}\n\n// ── Skeleton ───────────────────────────────────────────────────────────────\n\nconst SKELETON_YAXIS_WIDTHS = [28, 20, 24, 18]\nconst SKELETON_XAXIS_WIDTHS = [28, 36, 24, 32, 28, 20, 34, 26]\nconst SKELETON_LINE_DOTS = [\n  [0, 65],\n  [13, 40],\n  [26, 52],\n  [39, 20],\n  [52, 35],\n  [65, 10],\n  [78, 28],\n  [91, 15],\n]\n\ninterface LineChartSkeletonProps {\n  height?: number\n  hasTitle?: boolean\n  hasSubtitle?: boolean\n  hasFooter?: boolean\n  className?: string\n}\n\nfunction LineChartSkeleton({\n  height = 280,\n  hasTitle = false,\n  hasSubtitle = false,\n  hasFooter = false,\n  className,\n}: LineChartSkeletonProps) {\n  const polylinePoints = SKELETON_LINE_DOTS.map(([x, y]) => `${x},${y}`).join(\n    \" \"\n  )\n  const areaPath = `M 0,65 L 13,40 L 26,52 L 39,20 L 52,35 L 65,10 L 78,28 L 91,15 L 91,100 L 0,100 Z`\n\n  return (\n    <div\n      className={cn(\"flex w-full flex-col\", className)}\n      data-slot=\"line-chart-skeleton\"\n    >\n      {(hasTitle || hasSubtitle) && (\n        <div className=\"flex flex-col gap-1.5 px-1 pb-4\">\n          {hasTitle && (\n            <Skeleton\n              className=\"h-3.5 w-44 rounded-md\"\n              style={{ animationDelay: \"0s\" }}\n            />\n          )}\n          {hasSubtitle && (\n            <Skeleton\n              className=\"mt-0.5 h-2.5 w-28 rounded-md\"\n              style={{ animationDelay: \"0.1s\" }}\n            />\n          )}\n        </div>\n      )}\n\n      <div className=\"relative overflow-hidden\" style={{ height }}>\n        {/* Y-axis tick labels */}\n        <div className=\"absolute top-2 bottom-8 left-0 flex w-9 flex-col items-end justify-between pr-1\">\n          {SKELETON_YAXIS_WIDTHS.map((w, i) => (\n            <Skeleton\n              key={i}\n              className=\"h-2.5 rounded-sm\"\n              style={{ width: w, animationDelay: `${0.5 + i * 0.12}s` }}\n            />\n          ))}\n        </div>\n\n        {/* Chart area with SVG line */}\n        <div className=\"absolute top-2 right-1 bottom-8 left-11\">\n          <svg\n            viewBox=\"0 0 100 100\"\n            preserveAspectRatio=\"none\"\n            className=\"h-full w-full\"\n          >\n            {/* Horizontal grid lines */}\n            {[25, 50, 75].map((y, i) => (\n              <line\n                key={y}\n                x1=\"0\"\n                y1={y}\n                x2=\"100\"\n                y2={y}\n                stroke=\"var(--muted)\"\n                strokeWidth=\"0.8\"\n                style={{ animationDelay: `${0.6 + i * 0.15}s` }}\n              />\n            ))}\n            {/* Area fill */}\n            <path d={areaPath} fill=\"var(--muted)\" fillOpacity={0.15} />\n            {/* Line */}\n            <polyline\n              points={polylinePoints}\n              fill=\"none\"\n              stroke=\"var(--muted)\"\n              strokeWidth=\"2\"\n              className=\"motion-safe:animate-pulse\"\n            />\n            {/* Dots */}\n            {SKELETON_LINE_DOTS.map(([x, y], i) => (\n              <circle\n                key={i}\n                cx={x}\n                cy={y}\n                r=\"2.5\"\n                fill=\"var(--muted)\"\n                className=\"motion-safe:animate-pulse\"\n                style={{ animationDelay: `${i * 0.09}s` }}\n              />\n            ))}\n          </svg>\n        </div>\n\n        {/* X-axis tick labels */}\n        <div className=\"absolute right-1 bottom-0 left-11 flex h-7 items-center justify-around\">\n          {SKELETON_XAXIS_WIDTHS.map((w, i) => (\n            <Skeleton\n              key={i}\n              className=\"h-2.5 rounded-sm\"\n              style={{ width: w, animationDelay: `${0.05 + i * 0.1}s` }}\n            />\n          ))}\n        </div>\n      </div>\n\n      {hasFooter && (\n        <div className=\"mt-4 flex items-center gap-2 border-t border-border px-1 pt-3\">\n          <Skeleton\n            className=\"h-3.5 w-3.5 shrink-0 rounded-full\"\n            style={{ animationDelay: \"0.7s\" }}\n          />\n          <Skeleton\n            className=\"h-2.5 w-36 rounded-md\"\n            style={{ animationDelay: \"0.8s\" }}\n          />\n          <Skeleton\n            className=\"ml-auto h-2.5 w-20 rounded-md\"\n            style={{ animationDelay: \"0.9s\" }}\n          />\n        </div>\n      )}\n    </div>\n  )\n}\n\n// ── Variants ───────────────────────────────────────────────────────────────\n\nconst chartWrapperVariants = cva(\"flex w-full flex-col\")\n\nconst chartHeaderVariants = cva(\"flex flex-col px-1 pb-4\")\n\nconst chartTitleVariants = cva(\n  \"text-sm leading-tight font-semibold text-foreground\"\n)\n\nconst chartSubtitleVariants = cva(\"mt-0.5 text-xs text-muted-foreground\")\n\nconst chartFooterVariants = cva(\n  \"mt-4 flex items-center gap-2 border-t border-border px-1 pt-3 text-xs text-muted-foreground\"\n)\n\n// ── Custom Tooltip ─────────────────────────────────────────────────────────\n\ninterface TooltipPayloadEntry {\n  name: string\n  value: number\n  stroke: string\n  color: string\n  strokeDasharray?: string\n}\n\nfunction ChartTooltip({\n  active,\n  payload,\n  label,\n  fmt,\n}: {\n  active?: boolean\n  payload?: TooltipPayloadEntry[]\n  label?: string\n  fmt: (v: number) => string\n}) {\n  if (!active || !payload?.length) return null\n\n  return (\n    <div className=\"min-w-36 rounded-lg border border-border bg-card px-3 py-2 shadow-md\">\n      <p className=\"mb-1.5 text-xs font-semibold text-foreground\">{label}</p>\n      <div className=\"flex flex-col gap-1\">\n        {payload.map((entry) => {\n          const color = entry.stroke ?? entry.color\n          const isDashed = !!entry.strokeDasharray\n          return (\n            <div key={entry.name} className=\"flex items-center gap-2\">\n              {/* Line swatch — solid or dashed to mirror the series style */}\n              <svg width=\"16\" height=\"8\" className=\"shrink-0\">\n                <line\n                  x1=\"0\"\n                  y1=\"4\"\n                  x2=\"16\"\n                  y2=\"4\"\n                  stroke={color}\n                  strokeWidth=\"2\"\n                  strokeDasharray={isDashed ? \"4 2\" : undefined}\n                  strokeLinecap=\"round\"\n                />\n              </svg>\n              <span className=\"text-xs text-muted-foreground\">\n                {entry.name}\n              </span>\n              <span className=\"ml-auto pl-4 text-xs font-semibold text-foreground tabular-nums\">\n                {fmt(entry.value)}\n              </span>\n            </div>\n          )\n        })}\n      </div>\n    </div>\n  )\n}\n\n// ── Custom Legend ──────────────────────────────────────────────────────────\n\ninterface LegendPayloadEntry {\n  value: string\n  color: string\n  payload?: { strokeDasharray?: string }\n}\n\nfunction ChartLegend({\n  payload,\n  hiddenSeries,\n  onToggle,\n  vertical = false,\n}: {\n  payload?: LegendPayloadEntry[]\n  hiddenSeries?: Set<string>\n  onToggle?: (name: string) => void\n  vertical?: boolean\n}) {\n  if (!payload?.length) return null\n  return (\n    <div\n      className={cn(\n        \"flex gap-y-1\",\n        vertical\n          ? \"flex-col px-2 py-1\"\n          : \"flex-wrap items-center justify-center gap-x-5 pt-3\"\n      )}\n    >\n      {payload.map((entry, i) => {\n        const isDashed = !!entry.payload?.strokeDasharray\n        const hidden = hiddenSeries?.has(entry.value)\n        return (\n          <div\n            key={entry.value ?? i}\n            role=\"button\"\n            tabIndex={0}\n            aria-pressed={hidden}\n            aria-label={entry.value}\n            onClick={() => onToggle?.(entry.value)}\n            onKeyDown={(e) =>\n              (e.key === \"Enter\" || e.key === \" \") && onToggle?.(entry.value)\n            }\n            className={cn(\n              \"flex cursor-pointer items-center gap-1.5 rounded px-1 py-0.5 select-none\",\n              \"transition-opacity focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none\",\n              hidden ? \"opacity-40\" : \"hover:opacity-70\"\n            )}\n          >\n            <svg width=\"16\" height=\"8\" className=\"shrink-0\">\n              <line\n                x1=\"0\"\n                y1=\"4\"\n                x2=\"16\"\n                y2=\"4\"\n                stroke={entry.color}\n                strokeWidth=\"2\"\n                strokeDasharray={isDashed ? \"4 2\" : undefined}\n                strokeLinecap=\"round\"\n              />\n            </svg>\n            <span className=\"text-xs text-muted-foreground\">{entry.value}</span>\n          </div>\n        )\n      })}\n    </div>\n  )\n}\n\n// ── Reference Line Label ───────────────────────────────────────────────────\n\nfunction ReferenceLineLabel({\n  viewBox,\n  label,\n  color,\n}: {\n  viewBox?: { x?: number; width?: number; y?: number }\n  label: string\n  color: string\n}) {\n  const x = (viewBox?.x ?? 0) + (viewBox?.width ?? 0)\n  const y = viewBox?.y ?? 0\n  const padding = 6\n  const estimatedWidth = label.length * 6 + padding * 2\n\n  return (\n    <g>\n      <rect\n        x={x - estimatedWidth - 4}\n        y={y - 10}\n        width={estimatedWidth}\n        height={16}\n        rx={4}\n        fill={color}\n        fillOpacity={0.12}\n      />\n      <text\n        x={x - estimatedWidth / 2 - 4}\n        y={y + 3}\n        textAnchor=\"middle\"\n        fontSize={10}\n        fontWeight={600}\n        fill={color}\n      >\n        {label}\n      </text>\n    </g>\n  )\n}\n\n// ── Helpers ────────────────────────────────────────────────────────────────\n\n// Custom traveller handle for recharts Brush — styled with semantic tokens\nfunction BrushHandle(props: {\n  x?: number\n  y?: number\n  width?: number\n  height?: number\n}): React.ReactElement {\n  const { x = 0, y = 0, width = 8, height = 30 } = props\n  const midY = y + height / 2\n  return (\n    <g>\n      <rect\n        x={x}\n        y={y + 5}\n        width={width}\n        height={height - 10}\n        rx={3}\n        fill=\"var(--card)\"\n        stroke=\"var(--border)\"\n        strokeWidth={1.5}\n      />\n      <line\n        x1={x + 2}\n        y1={midY - 3}\n        x2={x + width - 2}\n        y2={midY - 3}\n        stroke=\"var(--muted-foreground)\"\n        strokeWidth={1}\n        opacity={0.5}\n      />\n      <line\n        x1={x + 2}\n        y1={midY + 3}\n        x2={x + width - 2}\n        y2={midY + 3}\n        stroke=\"var(--muted-foreground)\"\n        strokeWidth={1}\n        opacity={0.5}\n      />\n    </g>\n  )\n}\n\nfunction normalizeKeys(\n  raw: LineChartKey[] | string[]\n): Required<LineChartKey>[] {\n  return raw.map((k, i) => {\n    const color = CHART_COLORS[i % CHART_COLORS.length]\n    if (typeof k === \"string\") return { key: k, label: k, color, dashed: false }\n    return { label: k.key, dashed: false, ...k, color: k.color ?? color }\n  })\n}\n\n// ── LineChart ──────────────────────────────────────────────────────────────\n\nexport function LineChart({\n  data,\n  dataKeys,\n  categoryKey,\n  title,\n  subtitle,\n  footer,\n  variant = \"line\",\n  curve = \"smooth\",\n  dots = \"hover\",\n  height = 280,\n  showGrid = true,\n  showLegend = false,\n  legendPosition = \"bottom\",\n  showTooltip = true,\n  connectNulls = false,\n  referenceLines,\n  valueFormatter,\n  format,\n  decimals,\n  currency,\n  abbreviate,\n  showBrush = false,\n  loading = false,\n  locale: localeProp,\n  xAxisLabel,\n  yAxisLabel,\n  className,\n  ...props\n}: LineChartProps) {\n  const locale = useUILocale(localeProp)\n  // Hooks must be called unconditionally before any early returns\n  const fmt = React.useCallback(\n    (v: number) =>\n      formatChartValue(v, {\n        format,\n        decimals,\n        locale,\n        currency,\n        abbreviate,\n        valueFormatter,\n      }),\n    [valueFormatter, format, decimals, locale, currency, abbreviate]\n  )\n\n  // useId produces strings like \":r0:\" — strip non-alphanumeric for safe SVG IDs\n  const uid = React.useId().replace(/[^a-zA-Z0-9]/g, \"\")\n  const [hiddenSeries, setHiddenSeries] = React.useState<Set<string>>(new Set())\n  const toggleSeries = React.useCallback((name: string) => {\n    setHiddenSeries((prev) => {\n      const next = new Set(prev)\n      if (next.has(name)) next.delete(name)\n      else next.add(name)\n      return next\n    })\n  }, [])\n\n  // Stable identity across renders — an inline arrow function here would give Recharts'\n  // Legend a new `content` type every render, forcing it to unmount/remount the legend\n  // subtree instead of reconciling it (and dropping click events along the way).\n  const renderLegendContent = React.useCallback(\n    (props: { payload?: unknown }) => (\n      <ChartLegend\n        payload={props.payload as LegendPayloadEntry[]}\n        hiddenSeries={hiddenSeries}\n        onToggle={toggleSeries}\n        vertical={legendPosition === \"left\" || legendPosition === \"right\"}\n      />\n    ),\n    [hiddenSeries, toggleSeries, legendPosition]\n  )\n\n  if (loading) {\n    return (\n      <LineChartSkeleton\n        height={height}\n        hasTitle={!!title}\n        hasSubtitle={!!subtitle}\n        hasFooter={!!footer}\n        className={className}\n      />\n    )\n  }\n\n  if (data.length === 0) {\n    return (\n      <div\n        className={cn(chartWrapperVariants(), className)}\n        data-slot=\"line-chart\"\n        {...props}\n      >\n        {(title || subtitle) && (\n          <div className={chartHeaderVariants()} data-slot=\"line-chart-header\">\n            {title && <p className={chartTitleVariants()}>{title}</p>}\n            {subtitle && <p className={chartSubtitleVariants()}>{subtitle}</p>}\n          </div>\n        )}\n        <div\n          className=\"flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border text-muted-foreground\"\n          data-slot=\"line-chart-empty\"\n          style={{ height }}\n        >\n          <div className=\"flex size-10 items-center justify-center rounded-full bg-muted\">\n            <TrendingUp className=\"size-5\" />\n          </div>\n          <div className=\"text-center\">\n            <p className=\"text-sm font-medium text-foreground\">\n              {UI_I18N[locale].emptyState.noData}\n            </p>\n            <p className=\"mt-0.5 text-xs\">\n              {UI_I18N[locale].emptyState.dataWillAppear}\n            </p>\n          </div>\n        </div>\n        {footer && (\n          <div className={chartFooterVariants()} data-slot=\"line-chart-footer\">\n            {footer}\n          </div>\n        )}\n      </div>\n    )\n  }\n\n  const keys = normalizeKeys(dataKeys)\n  const isArea = variant !== \"line\"\n  const curveType = CURVE_TYPE[curve]\n  const axisStyle = { fontSize: \"12px\", fill: \"var(--muted-foreground)\" }\n\n  const axisLabelStyle = {\n    fontSize: \"11px\",\n    fill: \"var(--muted-foreground)\",\n  }\n\n  // Expand chart margins when axis labels are present to avoid clipping\n  const marginBottom = xAxisLabel ? 28 : 4\n  const marginLeft = yAxisLabel ? 8 : 4\n  // Sized from the actual formatted tick values (not a fixed guess) so\n  // abbreviated currency (\"R$ 800,0 mi\") never wraps or clips — see\n  // lib/chart-axis-width.ts.\n  const yAxisValues = [\n    0,\n    ...data.flatMap((d) => keys.map((k) => Number(d[k.key]))),\n  ]\n  const yAxisWidth = measureAxisWidth(yAxisValues, fmt, {\n    padding: yAxisLabel ? 52 : 32,\n  })\n  const yAxisLabelOffset = yAxisLabel ? 0 : 10\n\n  return (\n    <div\n      className={cn(chartWrapperVariants(), className)}\n      data-slot=\"line-chart\"\n      {...props}\n    >\n      {(title || subtitle) && (\n        <div className={chartHeaderVariants()} data-slot=\"line-chart-header\">\n          {title && <p className={chartTitleVariants()}>{title}</p>}\n          {subtitle && <p className={chartSubtitleVariants()}>{subtitle}</p>}\n        </div>\n      )}\n\n      <ResponsiveContainer\n        width=\"100%\"\n        height={height}\n        data-slot=\"line-chart-chart\"\n      >\n        <RechartsAreaChart\n          data={data}\n          margin={{ top: 12, right: 4, bottom: marginBottom, left: marginLeft }}\n        >\n          {/* Gradient fills — only injected when variant is area or area-stacked */}\n          {isArea && (\n            <defs>\n              {keys.map((k) => (\n                <linearGradient\n                  key={k.key}\n                  id={`${uid}-${k.key}`}\n                  x1=\"0\"\n                  y1=\"0\"\n                  x2=\"0\"\n                  y2=\"1\"\n                >\n                  <stop offset=\"0%\" stopColor={k.color} stopOpacity={0.28} />\n                  <stop offset=\"100%\" stopColor={k.color} stopOpacity={0.02} />\n                </linearGradient>\n              ))}\n            </defs>\n          )}\n\n          {showGrid && (\n            <CartesianGrid\n              strokeDasharray=\"3 3\"\n              stroke=\"var(--border)\"\n              vertical={false}\n            />\n          )}\n\n          <XAxis\n            dataKey={categoryKey}\n            tick={axisStyle}\n            axisLine={false}\n            tickLine={false}\n            dy={6}\n            label={\n              xAxisLabel\n                ? {\n                    value: xAxisLabel,\n                    position: \"insideBottom\",\n                    offset: -16,\n                    style: axisLabelStyle,\n                  }\n                : undefined\n            }\n          />\n          <YAxis\n            tick={axisStyle}\n            axisLine={false}\n            tickLine={false}\n            tickFormatter={fmt}\n            width={yAxisWidth}\n            label={\n              yAxisLabel\n                ? {\n                    value: yAxisLabel,\n                    angle: -90,\n                    position: \"insideLeft\",\n                    offset: yAxisLabelOffset,\n                    style: { ...axisLabelStyle, textAnchor: \"middle\" },\n                  }\n                : undefined\n            }\n          />\n\n          {showTooltip && (\n            <Tooltip\n              content={<ChartTooltip fmt={fmt} />}\n              cursor={{\n                stroke: \"var(--border)\",\n                strokeWidth: 1,\n                strokeDasharray: \"4 3\",\n              }}\n            />\n          )}\n\n          {showLegend && (\n            <Legend\n              {...LEGEND_LAYOUT[legendPosition]}\n              content={renderLegendContent}\n            />\n          )}\n\n          {referenceLines?.map((ref, i) => (\n            <RechartsReferenceLine\n              key={i}\n              y={ref.value}\n              stroke={ref.color ?? \"var(--muted-foreground)\"}\n              strokeDasharray={ref.dashed !== false ? \"4 3\" : undefined}\n              strokeWidth={1.5}\n              label={\n                ref.label\n                  ? (labelProps: {\n                      viewBox?: { x?: number; width?: number; y?: number }\n                    }) => (\n                      <ReferenceLineLabel\n                        key={`ref-label-${i}`}\n                        viewBox={labelProps.viewBox}\n                        label={ref.label!}\n                        color={ref.color ?? \"var(--muted-foreground)\"}\n                      />\n                    )\n                  : undefined\n              }\n            />\n          ))}\n\n          {keys.map((k) => (\n            <Area\n              key={k.key}\n              type={curveType}\n              dataKey={k.key}\n              name={k.label}\n              stroke={k.color}\n              strokeWidth={2}\n              strokeDasharray={k.dashed ? \"6 3\" : undefined}\n              fill={isArea ? `url(#${uid}-${k.key})` : \"none\"}\n              stackId={variant === \"area-stacked\" ? \"stack\" : undefined}\n              connectNulls={connectNulls}\n              hide={hiddenSeries.has(k.label)}\n              dot={\n                dots === \"always\"\n                  ? {\n                      r: 3,\n                      fill: k.color,\n                      stroke: \"var(--card)\",\n                      strokeWidth: 2,\n                    }\n                  : false\n              }\n              activeDot={\n                dots === \"none\"\n                  ? false\n                  : {\n                      r: 4,\n                      fill: k.color,\n                      stroke: \"var(--card)\",\n                      strokeWidth: 2,\n                    }\n              }\n            />\n          ))}\n\n          {showBrush && (\n            <Brush\n              dataKey={categoryKey}\n              height={30}\n              stroke=\"var(--border)\"\n              fill=\"var(--card)\"\n              travellerWidth={8}\n              traveller={(<BrushHandle />) as React.ReactElement<SVGElement>}\n              tickFormatter={(v) => (typeof v === \"string\" ? v : String(v))}\n            />\n          )}\n        </RechartsAreaChart>\n      </ResponsiveContainer>\n\n      {footer && (\n        <div className={chartFooterVariants()} data-slot=\"line-chart-footer\">\n          {footer}\n        </div>\n      )}\n    </div>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
