{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dots",
  "type": "registry:lib",
  "title": "Doto Dots helper",
  "description": "Shared Doto UI helper (dots.tsx) used by several components.",
  "author": "Ahmad Raza (MrReal) <https://ahmadraza.cv>",
  "registryDependencies": [
    "https://doto-ui.ahmadraza.cv/r/doto-theme.json"
  ],
  "files": [
    {
      "path": "registry/doto-ui/dots.tsx",
      "content": "\"use client\";\n\nimport React from 'react';\n\n/** Hand-built 13×13-ish dot alphabets for key glyphs */\nconst DOTS: Record<string, [number, number][]> = {\n  sun: [[6, 0], [5, 1], [7, 1], [4, 3], [8, 3], [4, 4], [8, 4], [4, 5], [7, 5], [6, 6], [5, 6], [7, 6], [6, 7], [5, 8], [6, 8], [7, 8], [5, 9], [6, 9], [7, 9], [4, 11], [8, 11], [1, 6], [2, 6], [9, 6], [10, 6], [10, 7], [1, 7], [3, 5], [9, 5], [3, 6], [9, 6]],\n  cloud: [[3, 5], [4, 4], [5, 3], [6, 3], [7, 4], [8, 5], [2, 6], [9, 6], [2, 7], [9, 7], [3, 8], [8, 8], [4, 9], [5, 9], [6, 9], [7, 9]],\n  bolt: [[6, 0], [6, 1], [5, 2], [5, 3], [4, 4], [4, 5], [5, 6], [6, 6], [6, 7], [5, 8], [5, 9], [4, 10]],\n  heart: [[2, 2], [3, 1], [4, 1], [5, 2], [6, 2], [7, 1], [8, 1], [9, 2], [9, 3], [8, 4], [7, 5], [6, 6], [5, 7], [4, 6], [3, 5], [2, 4], [1, 3]],\n  bell: [[4, 1], [3, 3], [3, 4], [3, 5], [3, 6], [2, 7], [6, 7], [6, 8], [4, 9], [5, 9], [5, 0], [4, 0]],\n  music: [[4, 3], [6, 2], [5, 4], [7, 3], [4, 5], [6, 4], [4, 6], [4, 7], [3, 8], [4, 8], [6, 6], [6, 7], [7, 8], [8, 7]],\n  phone: [[3, 1], [4, 1], [2, 2], [5, 2], [2, 4], [2, 5], [2, 6], [3, 7], [2, 8], [2, 9], [4, 10], [5, 10], [3, 4]],\n  wifi: [[1, 4], [2, 4], [3, 4], [4, 5], [5, 5], [6, 4], [6, 3], [5, 2], [4, 1], [3, 1], [2, 2], [1, 3]],\n  moon: [[5, 0], [4, 1], [3, 3], [3, 4], [3, 5], [4, 6], [5, 7], [6, 6], [6, 5], [5, 4], [7, 3], [6, 2]],\n  wind: [[1, 3], [2, 3], [3, 3], [4, 2], [4, 1], [5, 1], [6, 1], [1, 6], [2, 6], [3, 6], [4, 6], [5, 5], [5, 4], [6, 3], [1, 8], [2, 8], [3, 7]],\n  battery: [[1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [1, 4], [6, 4], [1, 6], [6, 6], [1, 8], [6, 8], [2, 8], [3, 8], [4, 8], [5, 8], [7, 3], [7, 7], [3, 3], [4, 4], [3, 5]],\n  thermometer: [[4, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [4, 6], [2, 7], [2, 8], [3, 9], [5, 9], [6, 8], [6, 7], [5, 6], [5, 5], [5, 3], [5, 2], [5, 1]],\n  footprints: [[3, 1], [2, 2], [3, 3], [6, 1], [5, 2], [6, 3], [3, 6], [2, 7], [3, 8], [6, 6], [5, 7], [6, 8]],\n  calendar: [[1, 2], [7, 2], [1, 3], [7, 3], [1, 4], [7, 4], [2, 7], [6, 7], [7, 4], [1, 7], [3, 0], [5, 0], [4, 4], [5, 4], [4, 5], [5, 5]],\n  clock: [[4, 0], [3, 1], [2, 2], [2, 3], [3, 4], [5, 4], [6, 3], [6, 2], [5, 1], [4, 2], [3, 5], [4, 5], [5, 5]],\n};\n\nfunction dotView(dots: [number, number][], c: number, g: number) {\n  const mx = Math.max(...dots.map((d) => d[0])), my = Math.max(...dots.map((d) => d[1]));\n  return { w: (mx + 1) * (c + g), h: (my + 1) * (c + g) };\n}\n\nexport function DotIcon({\n  name,\n  cell = 3,\n  gap = 1,\n  r = 1.7,\n  accentDot,\n  accentSpeed = 'spin 3.4s linear infinite',\n  className,\n  style,\n}: {\n  name: 'sun' | 'cloud' | 'bolt' | 'heart' | 'bell' | 'music' | 'phone' | 'wifi' | 'moon' | 'wind' | 'battery' | 'thermometer' | 'footprints' | 'calendar' | 'clock';\n  cell?: number;\n  gap?: number;\n  r?: number;\n  accentDot?: [number, number];\n  accentSpeed?: string;\n  className?: string;\n  style?: React.CSSProperties;\n}) {\n  const dots = DOTS[name] || DOTS.sun;\n  const view = dotView(dots, cell, gap);\n  return (\n    <svg viewBox={`0 0 ${view.w} ${view.h}`} className={className} style={style} aria-hidden>\n      {dots.map(([x, y], i) => (\n        <circle\n          key={i}\n          cx={x * (cell + gap) + (cell + gap) / 2}\n          cy={y * (cell + gap) + (cell + gap) / 2}\n          r={r}\n          fill={accentDot && x === accentDot[0] && y === accentDot[1] ? 'var(--doto-accent)' : 'currentColor'}\n          style={accentDot && x === accentDot[0] && y === accentDot[1] ? { animation: accentSpeed } : undefined}\n        />\n      ))}\n    </svg>\n  );\n}\n",
      "type": "registry:lib",
      "target": "@components/doto-ui/dots.tsx"
    }
  ]
}
