{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "author": "Lopifi (https://lopifi.com)",
  "categories": [
    "primitives",
    "finance",
    "accounting"
  ],
  "dependencies": [],
  "description": "ISO code + optional flag.",
  "files": [
    {
      "content": "import * as React from \"react\";\nimport { cn } from \"@/lib/ledger/cn\";\n\n/**\n * Flags are regional, not linguistic. Any currency without a clean\n * single-country mapping gets no flag rather than a wrong one.\n */\nconst FLAGS: Record<string, string> = {\n  AUD: \"🇦🇺\",\n  BRL: \"🇧🇷\",\n  CAD: \"🇨🇦\",\n  CHF: \"🇨🇭\",\n  CZK: \"🇨🇿\",\n  DKK: \"🇩🇰\",\n  EUR: \"🇪🇺\",\n  GBP: \"🇬🇧\",\n  HKD: \"🇭🇰\",\n  INR: \"🇮🇳\",\n  JPY: \"🇯🇵\",\n  KWD: \"🇰🇼\",\n  MXN: \"🇲🇽\",\n  NOK: \"🇳🇴\",\n  NZD: \"🇳🇿\",\n  PLN: \"🇵🇱\",\n  SEK: \"🇸🇪\",\n  SGD: \"🇸🇬\",\n  USD: \"🇺🇸\",\n  ZAR: \"🇿🇦\",\n};\n\nexport interface CurrencyBadgeProps extends React.ComponentPropsWithoutRef<\"span\"> {\n  currency: string;\n  showFlag?: boolean;\n  size?: \"sm\" | \"md\";\n}\n\n/** The code is always present; the flag is decoration. */\nexport const CurrencyBadge = React.forwardRef<HTMLSpanElement, CurrencyBadgeProps>(\n  ({ className, currency, showFlag = true, size = \"sm\", ...props }, ref) => {\n    const flag = showFlag ? FLAGS[currency] : undefined;\n    return (\n      <span\n        className={cn(\n          \"inline-flex items-center gap-1.5 font-medium\",\n          size === \"sm\" ? \"text-label\" : \"text-body\",\n          className,\n        )}\n        ref={ref}\n        {...props}\n      >\n        {flag ? (\n          <span aria-hidden=\"true\" className=\"text-[1.1em] leading-none\">\n            {flag}\n          </span>\n        ) : null}\n        <span className=\"reference-numeric\">{currency}</span>\n      </span>\n    );\n  },\n);\nCurrencyBadge.displayName = \"CurrencyBadge\";\n\nexport const CURRENCY_FLAGS = FLAGS;\n",
      "path": "components/ledger/currency-badge.tsx",
      "target": "components/ledger/currency-badge.tsx",
      "type": "registry:ui"
    }
  ],
  "name": "currency-badge",
  "registryDependencies": [
    "@lopifi/theme",
    "@lopifi/cn"
  ],
  "title": "CurrencyBadge",
  "type": "registry:ui"
}
