{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "money",
  "type": "registry:ui",
  "title": "Money",
  "description": "نمایش مبلغ با تومان یا ریال، حالت خلاصه (۱٫۲ میلیون) و مبلغ به حروف برای صفحه‌خوان",
  "dependencies": [
    "@kashi-ui/persian@^1.7.0"
  ],
  "registryDependencies": [
    "https://kashi.sepantapouya.com/r/cx.json",
    "https://kashi.sepantapouya.com/r/kashi-provider.json"
  ],
  "files": [
    {
      "path": "registry/kashi/Money.tsx",
      "type": "registry:ui",
      "target": "components/kashi/Money.tsx",
      "content": "\"use client\";\n\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { formatMoney, numberToWords, rialToToman, tomanToRial, type FormatMoneyOptions } from \"@kashi-ui/persian\";\nimport { cx } from \"./cx\";\nimport { useKashi } from \"./KashiProvider\";\n\nexport interface MoneyProps extends Omit<HTMLAttributes<HTMLElement>, \"children\">, Pick<FormatMoneyOptions, \"unit\" | \"from\" | \"compact\" | \"digits\"> {\n  value: number;\n  /** رنگ سبز برای مثبت و قرمز برای منفی، با علامت + @default false */\n  signed?: boolean;\n  /** مبلغ به حروف در title و برای صفحه‌خوان @default true */\n  words?: boolean;\n  size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n}\n\n/** نمایش مبلغ با تومان یا ریال، حالت خلاصه (۱٫۲ میلیون) و مبلغ به حروف برای صفحه‌خوان */\nexport const Money = forwardRef<HTMLElement, MoneyProps>(function Money(\n  { value, unit = \"toman\", from = \"toman\", compact, digits, signed, words = true, size = \"md\", className, ...rest },\n  ref,\n) {\n  const { messages: M, digits: D, locale } = useKashi();\n  digits ??= D;\n  const n = from === unit ? value : from === \"rial\" ? rialToToman(value) : tomanToRial(value);\n  const amount = formatMoney(n, { unit, compact, digits, locale, showUnit: false });\n  const full = formatMoney(n, { unit, compact, locale });\n  const unitName = unit === \"toman\" ? M.money.toman : M.money.rial;\n  const unitText = full.endsWith(\"همت\") ? null : unitName;\n  const spoken = words && Number.isSafeInteger(Math.round(n)) ? `${numberToWords(Math.round(n), { locale })} ${unitName}` : undefined;\n  const tone = signed ? (n > 0 ? \"positive\" : n < 0 ? \"negative\" : undefined) : undefined;\n  return (\n    <data ref={ref as never} value={String(n)} className={cx(\"k-money\", `k-money--${size}`, className)} data-tone={tone} title={spoken} {...rest}>\n      <span className=\"k-money__amount\" aria-hidden={spoken ? true : undefined}>{signed && n > 0 ? \"+\" : \"\"}{amount}</span>\n      {unitText && <span className=\"k-money__unit\" aria-hidden={spoken ? true : undefined}>{unitText}</span>}\n      {spoken && <span className=\"k-sr-only\">{n < 0 ? \"\" : signed && n > 0 ? M.money.positive : \"\"}{spoken}</span>}\n    </data>\n  );\n});\n"
    }
  ]
}