{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "type": "registry:ui",
  "title": "Badge",
  "description": "بج",
  "registryDependencies": [
    "https://kashi.sepantapouya.com/r/cx.json",
    "https://kashi.sepantapouya.com/r/kashi-provider.json"
  ],
  "files": [
    {
      "path": "registry/kashi/Badge.tsx",
      "type": "registry:ui",
      "target": "components/kashi/Badge.tsx",
      "content": "\"use client\";\n\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"./cx\";\nimport { useKashi } from \"./KashiProvider\";\n\nexport type BadgeTone = \"neutral\" | \"brand\" | \"error\" | \"warning\" | \"success\" | \"info\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n  /** @default \"neutral\" */\n  tone?: BadgeTone;\n  /** «soft» پس‌زمینهٔ کم‌رنگ، «solid» پررنگ، «outline» فقط حاشیه @default \"soft\" */\n  variant?: \"soft\" | \"solid\" | \"outline\";\n  /** @default \"md\" */\n  size?: \"sm\" | \"md\" | \"lg\";\n  /** نقطهٔ رنگی ابتدای متن */\n  dot?: boolean;\n  /** آیکون ابتدای متن */\n  icon?: ReactNode;\n  /** گوشهٔ کم به‌جای گرد */\n  square?: boolean;\n  /** با دادن این تابع، دکمهٔ حذف نمایش داده می‌شود (مثل برچسب‌های فیلتر) */\n  onRemove?: () => void;\n  /** @default (متن) => «حذف {متن}» */\n  removeLabel?: string;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n  { tone = \"neutral\", variant = \"soft\", size = \"md\", dot = false, icon, square = false, onRemove, removeLabel, className, children, ...rest },\n  ref,\n) {\n  const { messages: M } = useKashi();\n  const label = removeLabel ?? (typeof children === \"string\" ? M.common.remove(children) : M.common.removeShort);\n  return (\n    <span\n      ref={ref}\n      data-tone={tone}\n      data-variant={variant}\n      className={cx(\n        \"k-badge\",\n        tone !== \"neutral\" && `k-badge--${tone}`,\n        variant !== \"soft\" && `k-badge--${variant}`,\n        size !== \"md\" && `k-badge--${size}`,\n        square && \"k-badge--square\",\n        onRemove && \"k-badge--removable\",\n        className,\n      )}\n      {...rest}\n    >\n      {dot && <span className=\"k-badge__dot\" aria-hidden=\"true\" />}\n      {icon && <span className=\"k-badge__icon\" aria-hidden=\"true\">{icon}</span>}\n      {children}\n      {onRemove && (\n        <button type=\"button\" className=\"k-badge__remove\" aria-label={label} onClick={onRemove}>\n          <svg viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"m6 6 8 8M14 6l-8 8\" /></svg>\n        </button>\n      )}\n    </span>\n  );\n});\n"
    }
  ]
}