{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kpi-dashboard-grid",
  "title": "KPI Dashboard Grid",
  "description": "A dashboard overview grid: a large featured chart and KPI cards with counting numbers, change against the previous period (inverse for metrics like churn), hoverable sparklines or goal bars, a period switch, a compare toggle with dashed previous lines, and a Customize menu to show or hide metrics.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/kpi-dashboard-grid/kpi-dashboard-grid.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, animate, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type KpiFormat = \"currency\" | \"number\" | \"percent\";\n\nexport interface Kpi {\n  id: string;\n  label: string;\n  format: KpiFormat;\n  /** One series per period id, oldest first. The last point is the current value. */\n  series: Record<string, number[]>;\n  /** Previous period values for comparison, same length as series. */\n  previous?: Record<string, number[]>;\n  /** When true, going down is good (churn, refunds, response time). */\n  inverse?: boolean;\n  /** Optional goal for the current value, shown as a progress bar. */\n  target?: number;\n  /** Show this KPI as the large chart. */\n  featured?: boolean;\n  /** How the headline number is made from the period: add it up (revenue, orders), take the latest (users, scores) or average it. Defaults to sum, or last for percentages. */\n  aggregate?: \"sum\" | \"last\" | \"avg\";\n}\n\nexport interface KpiDashboardGridProps {\n  title?: string;\n  kpis?: Kpi[];\n  periods?: { id: string; label: string; points: number; step: \"day\" | \"week\" | \"month\" }[];\n  /** Last day of the data as YYYY-MM-DD. */\n  endDate?: string;\n  currency?: string;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", card: \"#121212\", border: \"rgba(255,255,255,0.09)\", chip: \"rgba(255,255,255,0.06)\", grid: \"rgba(255,255,255,0.06)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", up: \"#4ADE80\", down: \"#F87171\", line: \"#F5F4F1\", accent: \"#FB923C\", ring: \"rgba(245,244,241,0.6)\", track: \"rgba(255,255,255,0.08)\", tip: \"#1C1C1C\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.4)\", card: \"#FFFFFF\", border: \"rgba(10,10,10,0.09)\", chip: \"rgba(10,10,10,0.05)\", grid: \"rgba(10,10,10,0.06)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", up: \"#15803D\", down: \"#DC2626\", line: \"#0A0A0A\", accent: \"#EA580C\", ring: \"rgba(10,10,10,0.5)\", track: \"rgba(10,10,10,0.07)\", tip: \"#FFFFFF\" },\n};\ntype Pal = (typeof PALETTES)[\"dark\"];\n\nconst DEFAULT_PERIODS = [\n  { id: \"7d\", label: \"7D\", points: 7, step: \"day\" as const },\n  { id: \"30d\", label: \"30D\", points: 30, step: \"day\" as const },\n  { id: \"90d\", label: \"90D\", points: 13, step: \"week\" as const },\n  { id: \"12m\", label: \"12M\", points: 12, step: \"month\" as const },\n];\n\n// Seeded noise so server and client render the same numbers.\nfunction rng(seed: number) {\n  let s = seed;\n  return () => {\n    s = (s * 16807) % 2147483647;\n    return (s - 1) / 2147483646;\n  };\n}\nfunction makeSeries(seed: number, n: number, base: number, trend: number, noise: number, round = 0) {\n  const r = rng(seed);\n  return Array.from({ length: n }, (_, i) => {\n    const v = base * (1 + trend * (i / Math.max(1, n - 1))) * (1 + (r() - 0.5) * noise);\n    const f = 10 ** round;\n    return Math.round(v * f) / f;\n  });\n}\nfunction build(id: string, label: string, format: KpiFormat, base: number, trend: number, noise: number, opts: Partial<Kpi> & { round?: number } = {}): Kpi {\n  const series: Record<string, number[]> = {};\n  const previous: Record<string, number[]> = {};\n  DEFAULT_PERIODS.forEach((p, k) => {\n    const scale = p.step === \"week\" ? 7 : p.step === \"month\" ? 30 : 1;\n    const sums = (opts.aggregate ?? (format === \"percent\" ? \"last\" : \"sum\")) === \"sum\";\n    const b = sums ? base * scale : base;\n    series[p.id] = makeSeries(id.length * 97 + k * 13 + 1, p.points, b, trend, noise, opts.round);\n    previous[p.id] = makeSeries(id.length * 53 + k * 7 + 5, p.points, b / (1 + trend * 0.8), trend * 0.5, noise, opts.round);\n  });\n  return { id, label, format, series, previous, ...opts };\n}\nconst DEFAULT_KPIS: Kpi[] = [\n  build(\"revenue\", \"Revenue\", \"currency\", 4200, 0.32, 0.22, { featured: true }),\n  build(\"users\", \"Active users\", \"number\", 1850, 0.18, 0.16, { target: 2400, aggregate: \"last\" }),\n  build(\"conversion\", \"Conversion rate\", \"percent\", 3.4, 0.12, 0.12, { round: 1 }),\n  build(\"aov\", \"Avg order value\", \"currency\", 86, 0.06, 0.1, { round: 0, aggregate: \"avg\" }),\n  build(\"churn\", \"Churn\", \"percent\", 2.6, -0.2, 0.15, { inverse: true, round: 1 }),\n  build(\"nps\", \"NPS\", \"number\", 48, 0.1, 0.08, { round: 0, target: 60, aggregate: \"last\" }),\n];\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nfunction dateLabel(end: string, stepsBack: number, step: \"day\" | \"week\" | \"month\") {\n  const [y, m, d] = end.split(\"-\").map(Number);\n  if (step === \"month\") {\n    const idx = (m - 1 - stepsBack + 1200) % 12;\n    const year = y - Math.ceil(Math.max(0, stepsBack - (m - 1)) / 12);\n    return `${MONTHS[idx]} ${year}`;\n  }\n  const t = Date.UTC(y, m - 1, d) - stepsBack * (step === \"week\" ? 7 : 1) * 864e5;\n  const dt = new Date(t);\n  return `${dt.getUTCDate()} ${MONTHS[dt.getUTCMonth()]}`;\n}\n\nfunction formatValue(v: number, f: KpiFormat, currency: string, compact = false) {\n  if (f === \"percent\") return `${v.toFixed(1)}%`;\n  const abs = Math.abs(v);\n  const num = compact && abs >= 1000 ? (abs >= 1e6 ? `${(v / 1e6).toFixed(1)}M` : `${(v / 1000).toFixed(abs >= 1e5 ? 0 : 1)}k`) : Math.round(v).toLocaleString(\"en-US\");\n  return f === \"currency\" ? `${currency}${num}` : num;\n}\n\nfunction CountUp({ value, format, currency, reduce }: { value: number; format: KpiFormat; currency: string; reduce: boolean }) {\n  const ref = React.useRef<HTMLSpanElement>(null);\n  const from = React.useRef(value);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    if (reduce) {\n      el.textContent = formatValue(value, format, currency);\n      from.current = value;\n      return;\n    }\n    const c = animate(from.current, value, { duration: 0.7, ease: [0.22, 1, 0.36, 1], onUpdate: (v) => (el.textContent = formatValue(v, format, currency)) });\n    from.current = value;\n    return () => c.stop();\n  }, [value, format, currency, reduce]);\n  return <span ref={ref}>{formatValue(value, format, currency)}</span>;\n}\n\nfunction pathFor(values: number[], w: number, h: number, min: number, max: number, pad = 2) {\n  const span = max - min || 1;\n  return values.map((v, i) => `${i ? \"L\" : \"M\"}${((i / Math.max(1, values.length - 1)) * w).toFixed(1)},${(pad + (1 - (v - min) / span) * (h - pad * 2)).toFixed(1)}`).join(\" \");\n}\n\nfunction Chart({ values, prev, labels, w, h, p, format, currency, big, color, uid }: { values: number[]; prev?: number[]; labels: string[]; w: number; h: number; p: Pal; format: KpiFormat; currency: string; big?: boolean; color: string; uid: string }) {\n  const [hover, setHover] = React.useState<number | null>(null);\n  const all = [...values, ...(prev ?? [])];\n  const min = Math.min(...all) * (big ? 0.9 : 0.97);\n  const max = Math.max(...all) * 1.03;\n  const line = pathFor(values, w, h, min, max);\n  const area = `${line} L${w},${h} L0,${h} Z`;\n  const x = (i: number) => (i / Math.max(1, values.length - 1)) * w;\n  const y = (v: number) => 2 + (1 - (v - min) / (max - min || 1)) * (h - 4);\n  const move = (e: React.PointerEvent<SVGSVGElement>) => {\n    const r = e.currentTarget.getBoundingClientRect();\n    const i = Math.round(((e.clientX - r.left) / r.width) * (values.length - 1));\n    setHover(Math.max(0, Math.min(values.length - 1, i)));\n  };\n  return (\n    <div className=\"relative\">\n      <svg viewBox={`0 0 ${w} ${h}`} preserveAspectRatio=\"none\" className=\"block w-full overflow-visible\" style={{ height: h }} onPointerMove={move} onPointerLeave={() => setHover(null)} role=\"img\" aria-label={`Trend from ${formatValue(values[0], format, currency)} to ${formatValue(values[values.length - 1], format, currency)}`}>\n        <defs>\n          <linearGradient id={`${uid}-fill`} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n            <stop offset=\"0%\" stopColor={color} stopOpacity={big ? 0.22 : 0.16} />\n            <stop offset=\"100%\" stopColor={color} stopOpacity=\"0\" />\n          </linearGradient>\n        </defs>\n        {big && [0.25, 0.5, 0.75].map((g) => <line key={g} x1=\"0\" x2={w} y1={h * g} y2={h * g} stroke={p.grid} strokeWidth=\"1\" vectorEffect=\"non-scaling-stroke\" />)}\n        <motion.path d={area} fill={`url(#${uid}-fill)`} initial={false} animate={{ d: area }} transition={{ duration: 0.5 }} />\n        {prev && <motion.path d={pathFor(prev, w, h, min, max)} fill=\"none\" stroke={p.faint} strokeWidth=\"1.25\" strokeDasharray=\"4 4\" vectorEffect=\"non-scaling-stroke\" initial={false} animate={{ d: pathFor(prev, w, h, min, max) }} transition={{ duration: 0.5 }} />}\n        <motion.path d={line} fill=\"none\" stroke={color} strokeWidth={big ? 2 : 1.5} strokeLinejoin=\"round\" vectorEffect=\"non-scaling-stroke\" initial={false} animate={{ d: line }} transition={{ duration: 0.5 }} />\n        {hover !== null && <line x1={x(hover)} x2={x(hover)} y1=\"0\" y2={h} stroke={p.faint} strokeWidth=\"1\" vectorEffect=\"non-scaling-stroke\" />}\n      </svg>\n      {hover !== null && (\n        <>\n          <span className=\"pointer-events-none absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2\" style={{ left: `${(x(hover) / w) * 100}%`, top: y(values[hover]), background: p.card, borderColor: color }} />\n          <div className=\"pointer-events-none absolute -top-2 z-10 -translate-y-full rounded-lg border px-2.5 py-1.5 text-[12px] whitespace-nowrap shadow-lg\" style={{ left: `clamp(0px, calc(${(x(hover) / w) * 100}% - 60px), calc(100% - 120px))`, background: p.tip, borderColor: p.border }}>\n            <span className=\"block\" style={{ color: p.faint }}>\n              {labels[hover]}\n            </span>\n            <span className=\"block font-semibold tabular-nums\">{formatValue(values[hover], format, currency)}</span>\n            {prev && (\n              <span className=\"block tabular-nums\" style={{ color: p.faint }}>\n                Prev {formatValue(prev[hover], format, currency)}\n              </span>\n            )}\n          </div>\n        </>\n      )}\n    </div>\n  );\n}\n\nexport function KpiDashboardGrid({ title = \"Overview\", kpis = DEFAULT_KPIS, periods = DEFAULT_PERIODS, endDate = \"2026-11-01\", currency = \"$\", theme = \"dark\", className }: KpiDashboardGridProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId().replace(/:/g, \"\");\n  const [period, setPeriod] = React.useState(periods[1]?.id ?? periods[0].id);\n  const [compare, setCompare] = React.useState(true);\n  const [hidden, setHidden] = React.useState<string[]>([]);\n  const [menu, setMenu] = React.useState(false);\n  const menuRef = React.useRef<HTMLDivElement>(null);\n  React.useEffect(() => {\n    if (!menu) return;\n    const down = (e: MouseEvent) => menuRef.current && !menuRef.current.contains(e.target as Node) && setMenu(false);\n    const key = (e: KeyboardEvent) => e.key === \"Escape\" && setMenu(false);\n    document.addEventListener(\"mousedown\", down);\n    document.addEventListener(\"keydown\", key);\n    return () => {\n      document.removeEventListener(\"mousedown\", down);\n      document.removeEventListener(\"keydown\", key);\n    };\n  }, [menu]);\n\n  const per = periods.find((x) => x.id === period) ?? periods[0];\n  const labels = Array.from({ length: per.points }, (_, i) => dateLabel(endDate, per.points - 1 - i, per.step));\n  const visible = kpis.filter((k) => !hidden.includes(k.id));\n  const featured = visible.find((k) => k.featured);\n  const rest = visible.filter((k) => k !== featured);\n  const stats = (k: Kpi) => {\n    const s = k.series[period] ?? [];\n    const pv = k.previous?.[period];\n    const agg = k.aggregate ?? (k.format === \"percent\" ? \"last\" : \"sum\");\n    const of = (v: number[]) => (agg === \"last\" ? v[v.length - 1] : agg === \"avg\" ? v.reduce((a, b) => a + b, 0) / v.length : v.reduce((a, b) => a + b, 0));\n    const cur = of(s);\n    const prevTotal = pv ? of(pv) : undefined;\n    const delta = prevTotal ? ((cur - prevTotal) / prevTotal) * 100 : 0;\n    const good = k.inverse ? delta <= 0 : delta >= 0;\n    return { s, pv, cur, delta, good };\n  };\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.bg } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const deltaPill = (delta: number, good: boolean) => (\n    <span className=\"inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-[11.5px] font-semibold tabular-nums\" style={{ background: p.chip, color: good ? p.up : p.down }}>\n      <svg width=\"9\" height=\"9\" viewBox=\"0 0 10 10\" aria-hidden=\"true\" style={{ transform: delta < 0 ? \"rotate(180deg)\" : undefined }}>\n        <path d=\"M5 1.5 9 7H1z\" fill=\"currentColor\" />\n      </svg>\n      {Math.abs(delta).toFixed(1)}%<span className=\"sr-only\">{delta >= 0 ? \" up\" : \" down\"} vs previous period</span>\n    </span>\n  );\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-6xl px-4 py-10 @[640px]:px-6 @[640px]:py-14\">\n        <div className=\"flex flex-wrap items-end justify-between gap-4\">\n          <div>\n            <h2 className=\"m-0 text-[24px] font-semibold tracking-[-0.02em]\">{title}</h2>\n            <p className=\"m-0 mt-1 text-[13.5px]\" style={{ color: p.muted }}>\n              {labels[0]} – {labels[labels.length - 1]}\n            </p>\n          </div>\n          <div className=\"flex flex-wrap items-center gap-2\">\n            <div role=\"radiogroup\" aria-label=\"Period\" className=\"flex rounded-lg border p-0.5\" style={{ borderColor: p.border }}>\n              {periods.map((x) => (\n                <button key={x.id} type=\"button\" role=\"radio\" aria-checked={period === x.id} onClick={() => setPeriod(x.id)} className={cn(\"relative h-7 cursor-pointer rounded-md border-0 bg-transparent px-2.5 text-[12.5px] font-medium tabular-nums\", focus)} style={{ color: period === x.id ? p.text : p.faint, ...ring }}>\n                  {period === x.id && <motion.span layoutId={`${uid}-period`} className=\"absolute inset-0 rounded-md\" style={{ background: p.chip }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 38 }} />}\n                  <span className=\"relative\">{x.label}</span>\n                </button>\n              ))}\n            </div>\n            <button type=\"button\" role=\"switch\" aria-checked={compare} onClick={() => setCompare((c) => !c)} className={cn(\"flex h-8 cursor-pointer items-center gap-2 rounded-lg border bg-transparent px-2.5 text-[12.5px]\", focus)} style={{ borderColor: p.border, color: p.muted, ...ring }}>\n              <span className=\"relative h-4 w-7 rounded-full transition-colors\" style={{ background: compare ? p.on : p.track }} aria-hidden=\"true\">\n                <motion.span className=\"absolute top-0.5 h-3 w-3 rounded-full\" style={{ background: compare ? p.onText : p.faint }} initial={false} animate={{ left: compare ? 14 : 2 }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 600, damping: 34 }} />\n              </span>\n              Compare\n            </button>\n            <div ref={menuRef} className=\"relative\">\n              <button type=\"button\" aria-haspopup=\"true\" aria-expanded={menu} onClick={() => setMenu((m) => !m)} className={cn(\"flex h-8 cursor-pointer items-center gap-1.5 rounded-lg border bg-transparent px-2.5 text-[12.5px]\", focus)} style={{ borderColor: p.border, color: p.muted, ...ring }}>\n                <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                  <path d=\"M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0\" />\n                  <circle cx=\"16\" cy=\"6\" r=\"2\" />\n                  <circle cx=\"10\" cy=\"12\" r=\"2\" />\n                  <circle cx=\"18\" cy=\"18\" r=\"2\" />\n                </svg>\n                Customize\n              </button>\n              <AnimatePresence>\n                {menu && (\n                  <motion.div initial={reduce ? false : { opacity: 0, y: -4 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: -4 }} transition={{ duration: 0.14 }} className=\"absolute right-0 z-20 mt-1.5 w-56 rounded-xl border p-1.5 shadow-xl\" style={{ background: p.card, borderColor: p.border }}>\n                    <p className=\"m-0 px-2 pt-1 pb-1.5 text-[11.5px]\" style={{ color: p.faint }}>\n                      Show metrics\n                    </p>\n                    {kpis.map((k) => {\n                      const on = !hidden.includes(k.id);\n                      return (\n                        <label key={k.id} className=\"flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-[13px] hover:bg-[var(--kpi-h)]\" style={{ [\"--kpi-h\" as string]: p.chip }}>\n                          <input type=\"checkbox\" checked={on} disabled={on && visible.length === 1} onChange={() => setHidden((h) => (on ? [...h, k.id] : h.filter((x) => x !== k.id)))} className=\"h-3.5 w-3.5 cursor-pointer\" style={{ accentColor: p.on }} />\n                          {k.label}\n                        </label>\n                      );\n                    })}\n                  </motion.div>\n                )}\n              </AnimatePresence>\n            </div>\n          </div>\n        </div>\n\n        <motion.div layout={!reduce} className=\"mt-6 grid gap-3 @[640px]:grid-cols-2 @[960px]:grid-cols-4\">\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {featured &&\n              (() => {\n                const st = stats(featured);\n                return (\n                  <motion.article key={featured.id} layout={!reduce} initial={reduce ? false : { opacity: 0, scale: 0.98 }} animate={{ opacity: 1, scale: 1 }} exit={reduce ? undefined : { opacity: 0, scale: 0.98 }} className=\"rounded-2xl border p-5 @[640px]:col-span-2 @[960px]:row-span-2\" style={{ background: p.card, borderColor: p.border }}>\n                    <div className=\"flex items-start justify-between gap-3\">\n                      <div>\n                        <h3 className=\"m-0 text-[13px] font-medium\" style={{ color: p.muted }}>\n                          {featured.label}\n                        </h3>\n                        <p className=\"m-0 mt-1.5 text-[34px] leading-none font-semibold tracking-[-0.03em] tabular-nums\">\n                          <CountUp value={st.cur} format={featured.format} currency={currency} reduce={reduce} />\n                        </p>\n                      </div>\n                      {deltaPill(st.delta, st.good)}\n                    </div>\n                    <div className=\"mt-6\">\n                      <Chart values={st.s} prev={compare ? st.pv : undefined} labels={labels} w={600} h={200} p={p} format={featured.format} currency={currency} big color={p.accent} uid={`${uid}-${featured.id}`} />\n                      <div className=\"mt-2 flex justify-between text-[11px] tabular-nums\" style={{ color: p.faint }}>\n                        <span>{labels[0]}</span>\n                        <span>{labels[Math.floor(labels.length / 2)]}</span>\n                        <span>{labels[labels.length - 1]}</span>\n                      </div>\n                    </div>\n                    {compare && (\n                      <div className=\"mt-3 flex gap-4 text-[11.5px]\" style={{ color: p.faint }}>\n                        <span className=\"flex items-center gap-1.5\">\n                          <span className=\"h-0.5 w-4 rounded\" style={{ background: p.accent }} aria-hidden=\"true\" />\n                          This period\n                        </span>\n                        <span className=\"flex items-center gap-1.5\">\n                          <span className=\"h-0 w-4 border-t border-dashed\" style={{ borderColor: p.faint }} aria-hidden=\"true\" />\n                          Previous\n                        </span>\n                      </div>\n                    )}\n                  </motion.article>\n                );\n              })()}\n            {rest.map((k) => {\n              const st = stats(k);\n              return (\n                <motion.article key={k.id} layout={!reduce} initial={reduce ? false : { opacity: 0, scale: 0.98 }} animate={{ opacity: 1, scale: 1 }} exit={reduce ? undefined : { opacity: 0, scale: 0.98 }} className=\"flex flex-col rounded-2xl border p-4\" style={{ background: p.card, borderColor: p.border }}>\n                  <div className=\"flex items-start justify-between gap-2\">\n                    <h3 className=\"m-0 text-[12.5px] font-medium\" style={{ color: p.muted }}>\n                      {k.label}\n                    </h3>\n                    {deltaPill(st.delta, st.good)}\n                  </div>\n                  <p className=\"m-0 mt-1.5 text-[22px] leading-tight font-semibold tracking-[-0.02em] tabular-nums\">\n                    <CountUp value={st.cur} format={k.format} currency={currency} reduce={reduce} />\n                  </p>\n                  <div className=\"mt-auto pt-3\">\n                    {k.target ? (\n                      <div>\n                        <div className=\"h-1.5 overflow-hidden rounded-full\" style={{ background: p.track }} role=\"progressbar\" aria-label={`${k.label} target`} aria-valuenow={Math.round((st.s[st.s.length - 1] / k.target) * 100)} aria-valuemin={0} aria-valuemax={100}>\n                          <motion.div className=\"h-full rounded-full\" style={{ background: p.on }} initial={false} animate={{ width: `${Math.min(100, (st.s[st.s.length - 1] / k.target) * 100)}%` }} transition={{ duration: reduce ? 0 : 0.6 }} />\n                        </div>\n                        <p className=\"m-0 mt-1.5 text-[11.5px] tabular-nums\" style={{ color: p.faint }}>\n                          {Math.round((st.s[st.s.length - 1] / k.target) * 100)}% of {formatValue(k.target, k.format, currency, true)} goal\n                        </p>\n                      </div>\n                    ) : (\n                      <Chart values={st.s} prev={compare ? st.pv : undefined} labels={labels} w={240} h={44} p={p} format={k.format} currency={currency} color={st.good ? p.up : p.down} uid={`${uid}-${k.id}`} />\n                    )}\n                  </div>\n                </motion.article>\n              );\n            })}\n          </AnimatePresence>\n        </motion.div>\n      </div>\n    </section>\n  );\n}\n\nexport default KpiDashboardGrid;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}