{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "empty-state",
  "type": "registry:ui",
  "title": "EmptyState",
  "description": "حالت خالی: وقتی داده‌ای برای نمایش نیست؛ بگویید چرا و قدم بعدی را پیشنهاد کنید",
  "registryDependencies": [
    "https://kashi.sepantapouya.com/r/cx.json",
    "https://kashi.sepantapouya.com/r/kashi-provider.json"
  ],
  "files": [
    {
      "path": "registry/kashi/EmptyState.tsx",
      "type": "registry:ui",
      "target": "components/kashi/EmptyState.tsx",
      "content": "\"use client\";\n\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"./cx\";\nimport { useKashi } from \"./KashiProvider\";\n\nexport type EmptyStatePreset = \"noData\" | \"noResults\" | \"error\" | \"offline\" | \"noAccess\" | \"done\";\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n  /** عنوان؛ با preset اختیاری است */\n  title?: ReactNode;\n  description?: ReactNode;\n  icon?: ReactNode;\n  /** دکمه‌ها */\n  actions?: ReactNode;\n  /**\n   * حالت آماده با آیکون، عنوان و توضیح پیش‌فرض (فارسی و انگلیسی)؛ هر کدام را با title، description یا icon عوض کنید.\n   * noData خالی · noResults جستجو بی‌نتیجه · error خطای بارگذاری · offline بدون اینترنت · noAccess بدون دسترسی · done کار تمام شد\n   */\n  preset?: EmptyStatePreset;\n  /** sm داخل جدول و منو، md پیش‌فرض، lg صفحهٔ کامل @default \"md\" */\n  size?: \"sm\" | \"md\" | \"lg\";\n  /** قاب خط‌چین؛ مناسب جای خالی داخل صفحه یا محل رها کردن فایل */\n  bordered?: boolean;\n}\n\nconst P = { viewBox: \"0 0 20 20\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" as const, strokeLinejoin: \"round\" as const, \"aria-hidden\": true };\n// آیکون‌ها از @kashi-ui/icons، کپی‌شده تا پکیج React به آن وابسته نشود\nconst ICONS: Record<EmptyStatePreset, ReactNode> = {\n  noData: <svg {...P}><path d=\"M7.25 2.75h5.5c3.6 0 4.5.9 4.5 4.5v5.5c0 3.6-.9 4.5-4.5 4.5h-5.5c-3.6 0-4.5-.9-4.5-4.5v-5.5c0-3.6.9-4.5 4.5-4.5Z\" /><path d=\"M2.75 10.75h3.1c.55 0 1 .3 1.25.75l.5.95c.25.45.7.75 1.25.75h2.3c.55 0 1-.3 1.25-.75l.5-.95c.25-.45.7-.75 1.25-.75h3.1\" /></svg>,\n  noResults: <svg {...P}><circle cx=\"9.1\" cy=\"9.1\" r=\"6.2\" /><path d=\"m14.9 14.9 2.3 2.3M7.2 7.2l3.8 3.8M11 7.2l-3.8 3.8\" /></svg>,\n  error: <svg {...P}><path d=\"M8.33 3.9c.74-1.3 2.6-1.3 3.34 0l5.6 9.75c.74 1.3-.2 2.85-1.67 2.85H4.4c-1.48 0-2.41-1.56-1.67-2.85Z\" /><path d=\"M10 7.9v3.1M10 13.6v.01\" /></svg>,\n  offline: <svg {...P}><path d=\"M2.75 7.6a10.5 10.5 0 0 1 14.5 0M5.2 10.3a7 7 0 0 1 9.6 0M7.7 12.95a3.5 3.5 0 0 1 4.6 0M10 15.75v.01\" /><path d=\"m3 3 14 14\" /></svg>,\n  noAccess: <svg {...P}><path d=\"M7.25 8.25h5.5c2.6 0 3.25.65 3.25 3.25v2.75c0 2.6-.65 3.25-3.25 3.25h-5.5C4.65 17.5 4 16.85 4 14.25V11.5c0-2.6.65-3.25 3.25-3.25Z\" /><path d=\"M6.9 8.3V6.4a3.1 3.1 0 0 1 6.2 0v1.9M10 11.6v2.2\" /></svg>,\n  done: <svg {...P}><circle cx=\"10\" cy=\"10\" r=\"7.25\" /><path d=\"m6.75 10.1 2.2 2.2 4.3-4.5\" /></svg>,\n};\n\n/** حالت خالی: وقتی داده‌ای برای نمایش نیست؛ بگویید چرا و قدم بعدی را پیشنهاد کنید */\nexport function EmptyState({ title, description, icon, actions, preset, size = \"md\", bordered, className, ...rest }: EmptyStateProps) {\n  const { messages: M } = useKashi();\n  const text = preset ? M.empty[preset] : undefined;\n  title ??= text?.[0];\n  description ??= text?.[1];\n  icon ??= preset ? ICONS[preset] : undefined;\n  return (\n    <div\n      className={cx(\"k-empty\", size !== \"md\" && `k-empty--${size}`, bordered && \"k-empty--bordered\", className)}\n      data-preset={preset}\n      role={preset === \"error\" || preset === \"offline\" ? \"status\" : undefined}\n      {...rest}\n    >\n      {icon && <span className=\"k-empty__icon\" aria-hidden=\"true\">{icon}</span>}\n      {title && <p className=\"k-empty__title\">{title}</p>}\n      {description && <p className=\"k-empty__description\">{description}</p>}\n      {actions && <div className=\"k-empty__actions\">{actions}</div>}\n    </div>\n  );\n}\n"
    }
  ]
}