{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "persian-input",
  "type": "registry:ui",
  "title": "PersianInput",
  "description": "فیلد فارسی",
  "registryDependencies": [
    "https://kashi.sepantapouya.com/r/card-number-input.json",
    "https://kashi.sepantapouya.com/r/cx.json",
    "https://kashi.sepantapouya.com/r/iban-input.json",
    "https://kashi.sepantapouya.com/r/kashi-provider.json",
    "https://kashi.sepantapouya.com/r/keyboard-fix-input.json",
    "https://kashi.sepantapouya.com/r/landline-input.json",
    "https://kashi.sepantapouya.com/r/legal-id-input.json",
    "https://kashi.sepantapouya.com/r/mobile-input.json",
    "https://kashi.sepantapouya.com/r/national-id-input.json",
    "https://kashi.sepantapouya.com/r/plate-input.json",
    "https://kashi.sepantapouya.com/r/postal-code-input.json",
    "https://kashi.sepantapouya.com/r/price-input.json",
    "https://kashi.sepantapouya.com/r/time-input.json"
  ],
  "files": [
    {
      "path": "registry/kashi/PersianInput.tsx",
      "type": "registry:ui",
      "target": "components/kashi/PersianInput.tsx",
      "content": "\"use client\";\n\nimport { forwardRef, type ReactNode } from \"react\";\nimport { CardNumberInput, type CardNumberInputProps } from \"./CardNumberInput\";\nimport { IbanInput, type IbanInputProps } from \"./IbanInput\";\nimport { KeyboardFixInput, type KeyboardFixInputProps } from \"./KeyboardFixInput\";\nimport { LandlineInput, type LandlineInputProps } from \"./LandlineInput\";\nimport { LegalIdInput, type LegalIdInputProps } from \"./LegalIdInput\";\nimport { MobileInput, type MobileInputProps } from \"./MobileInput\";\nimport { NationalIdInput, type NationalIdInputProps } from \"./NationalIdInput\";\nimport { PostalCodeInput, type PostalCodeInputProps } from \"./PostalCodeInput\";\nimport { PlateInput, type PlateInputProps } from \"./PlateInput\";\nimport { PriceInput, type PriceInputProps } from \"./PriceInput\";\nimport { TimeInput, type TimeInputProps } from \"./TimeInput\";\nimport { useKashi } from \"./KashiProvider\";\n\n/** نوع‌های پشتیبانی‌شده و ویژگی‌های هر کدام؛ همان ویژگی‌های کامپوننت تخصصی */\nexport interface PersianInputKinds {\n  text: KeyboardFixInputProps;\n  \"national-id\": NationalIdInputProps;\n  \"legal-id\": LegalIdInputProps;\n  mobile: MobileInputProps;\n  landline: LandlineInputProps;\n  card: CardNumberInputProps;\n  iban: IbanInputProps;\n  price: PriceInputProps;\n  postal: PostalCodeInputProps;\n  time: TimeInputProps;\n  plate: PlateInputProps;\n}\nexport type PersianInputKind = keyof PersianInputKinds;\nexport type PersianInputProps = { [K in PersianInputKind]: { kind: K } & PersianInputKinds[K] }[PersianInputKind];\n\n/** برچسب پیش‌فرض هر نوع، اگر label یا aria-label داده نشود */\nexport const PERSIAN_INPUT_LABELS: Record<PersianInputKind, string> = {\n  text: \"متن\",\n  \"national-id\": \"کد ملی\",\n  \"legal-id\": \"شناسهٔ ملی شرکت\",\n  mobile: \"شمارهٔ موبایل\",\n  landline: \"تلفن ثابت\",\n  card: \"شمارهٔ کارت\",\n  iban: \"شمارهٔ شبا\",\n  price: \"مبلغ\",\n  postal: \"کد پستی\",\n  time: \"ساعت\",\n  plate: \"پلاک خودرو\",\n};\n\nconst COMPONENTS = {\n  text: KeyboardFixInput,\n  \"national-id\": NationalIdInput,\n  \"legal-id\": LegalIdInput,\n  mobile: MobileInput,\n  landline: LandlineInput,\n  card: CardNumberInput,\n  iban: IbanInput,\n  price: PriceInput,\n  postal: PostalCodeInput,\n  time: TimeInput,\n  plate: PlateInput,\n} as const;\n\n/**\n * یک فیلد برای همهٔ داده‌های فارسی (کد ملی، شبا، کارت، مبلغ، کد پستی، ساعت، پلاک و…): نوع را با kind انتخاب کنید و بقیهٔ ویژگی‌ها همان کامپوننت تخصصی است.\n * `<PersianInput kind=\"iban\" />` همان `<IbanInput />` است. برای حجم کمتر، کامپوننت تخصصی را مستقیم import کنید.\n */\nexport const PersianInput = forwardRef<HTMLInputElement, PersianInputProps>(function PersianInput({ kind, ...rest }, ref) {\n  const Component = COMPONENTS[kind] as unknown as (p: Record<string, unknown> & { ref?: unknown }) => ReactNode;\n  const props = rest as Record<string, unknown>;\n  const { messages: M } = useKashi();\n  const label = props.label ?? (props[\"aria-label\"] ? undefined : M.persianInput[kind]);\n  // PlateInput چند فیلد دارد و ref نمی‌گیرد\n  return <Component ref={kind === \"plate\" ? undefined : ref} {...props} label={label} data-kind={kind} />;\n});\n"
    }
  ]
}