SPB Git

Repository Public

Icon.tsx 9.8 KB 103 lines tsx

1import type { ReactNode } from "react";23// Own icon set: 24×24 grid, 1.75 stroke, round joins. Icons are decorative (aria-hidden); meaning is always carried4// by adjacent text or an accessible name on the control.5const P: Record<string, ReactNode> = {6  overview: <><rect x="3" y="3" width="8" height="10" rx="1.5" /><rect x="13" y="3" width="8" height="6" rx="1.5" /><rect x="13" y="11" width="8" height="10" rx="1.5" /><rect x="3" y="15" width="8" height="6" rx="1.5" /></>,7  nodes: <><rect x="3" y="4" width="18" height="7" rx="1.5" /><rect x="3" y="13" width="18" height="7" rx="1.5" /><path d="M7 7.5h.01M7 16.5h.01M11 7.5h6M11 16.5h6" /></>,8  services: <><path d="M12 3 3 7.5l9 4.5 9-4.5L12 3Z" /><path d="m3 12 9 4.5 9-4.5M3 16.5 12 21l9-4.5" /></>,9  models: <><rect x="6" y="6" width="12" height="12" rx="2" /><path d="M9.5 9.5h5v5h-5zM9 3v3M15 3v3M9 18v3M15 18v3M3 9h3M3 15h3M18 9h3M18 15h3" /></>,10  jobs: <><path d="M10 6h11M10 12h11M10 18h11" /><path d="m3 6 1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17" /></>,11  network: <><circle cx="12" cy="5" r="2.5" /><circle cx="5" cy="19" r="2.5" /><circle cx="19" cy="19" r="2.5" /><path d="M12 7.5v4M12 11.5 6.2 16.8M12 11.5l5.8 5.3" /></>,12  storage: <><ellipse cx="12" cy="6" rx="8" ry="3" /><path d="M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6" /></>,13  alerts: <><path d="M6 9a6 6 0 1 1 12 0c0 6 2.5 7 2.5 7h-17S6 15 6 9Z" /><path d="M10 20a2 2 0 0 0 4 0" /></>,14  maintenance: <><rect x="3" y="5" width="18" height="16" rx="2" /><path d="M3 10h18M8 3v4M16 3v4" /><path d="m9.5 16 1.8 1.8 3.4-3.6" /></>,15  activity: <path d="M3 12h4l2.5-7 5 14 2.5-7h4" />,16  audit: <><path d="M12 3 4.5 6v5.5c0 4.6 3.1 8.2 7.5 9.5 4.4-1.3 7.5-4.9 7.5-9.5V6L12 3Z" /><path d="m9 12 2.2 2.2L15.2 10" /></>,17  settings: <><circle cx="12" cy="12" r="3" /><path d="M19.4 14a1.5 1.5 0 0 0 .3 1.7l.1.1a1.9 1.9 0 1 1-2.7 2.7l-.1-.1a1.5 1.5 0 0 0-2.6 1.1V20a1.9 1.9 0 1 1-3.8 0v-.1a1.5 1.5 0 0 0-2.6-1l-.1.1a1.9 1.9 0 1 1-2.7-2.7l.1-.1a1.5 1.5 0 0 0-1-2.6H4a1.9 1.9 0 1 1 0-3.8h.1a1.5 1.5 0 0 0 1-2.6l-.1-.1A1.9 1.9 0 1 1 7.7 4.4l.1.1a1.5 1.5 0 0 0 2.6-1V3.4a1.9 1.9 0 1 1 3.8 0v.1a1.5 1.5 0 0 0 2.6 1l.1-.1a1.9 1.9 0 1 1 2.7 2.7l-.1.1a1.5 1.5 0 0 0 1 2.6h.1a1.9 1.9 0 1 1 0 3.8h-.1a1.5 1.5 0 0 0-1.2.400Z" /></>,18  search: <><circle cx="11" cy="11" r="6.5" /><path d="m20 20-4.2-4.2" /></>,19  close: <path d="M6 6l12 12M18 6 6 18" />,20  check: <path d="m5 12.5 4.5 4.5L19 7.5" />,21  "chevron-down": <path d="m6 9 6 6 6-6" />,22  "chevron-up": <path d="m6 15 6-6 6 6" />,23  "chevron-right": <path d="m9 6 6 6-6 6" />,24  "chevron-left": <path d="m15 6-6 6 6 6" />,25  plus: <path d="M12 5v14M5 12h14" />,26  minus: <path d="M5 12h14" />,27  more: <><circle cx="5" cy="12" r="1.2" /><circle cx="12" cy="12" r="1.2" /><circle cx="19" cy="12" r="1.2" /></>,28  copy: <><rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V6a2 2 0 0 1 2-2h9" /></>,29  refresh: <><path d="M20 11a8 8 0 0 0-14.3-4.3L4 8.5" /><path d="M4 4v4.5h4.5M4 13a8 8 0 0 0 14.3 4.3L20 15.5" /><path d="M20 20v-4.5h-4.5" /></>,30  // state icons — shapes differ so state never relies on colour alone31  ok: <><circle cx="12" cy="12" r="9" /><path d="m8 12.3 2.7 2.7L16 9.5" /></>,32  warning: <><path d="M12 3.5 2.5 20h19L12 3.5Z" /><path d="M12 10v4.5M12 17.3h.01" /></>,33  critical: <><path d="M8.3 3h7.4L21 8.3v7.4L15.7 21H8.3L3 15.7V8.3L8.3 3Z" /><path d="M12 7.5v5.5M12 16.3h.01" /></>,34  info: <><circle cx="12" cy="12" r="9" /><path d="M12 11v5.5M12 7.7h.01" /></>,35  stale: <><circle cx="12" cy="12" r="9" /><path d="M12 7v5.3l3.2 2" /></>,36  offline: <><circle cx="12" cy="12" r="9" /><path d="m5.7 5.7 12.6 12.6" /></>,37  wrench: <path d="M14.5 6.2a4.2 4.2 0 0 0 5.3 5.3l-9.5 9.5a2 2 0 0 1-2.9-2.9l9.5-9.5a4.2 4.2 0 0 0-2.4-2.4ZM14.5 6.2 17 3.7a4.2 4.2 0 0 1 3.3 3.3l-2.5 2.5" />,38  unknown: <><circle cx="12" cy="12" r="9" /><path d="M9.5 9.5a2.5 2.5 0 1 1 3.7 2.2c-.7.4-1.2 1-1.2 1.8M12 16.8h.01" /></>,39  unsupported: <><circle cx="12" cy="12" r="9" /><path d="M8 12h8" /></>,40  denied: <><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" /></>,41  pending: <><circle cx="12" cy="12" r="9" strokeDasharray="3 3.5" /><path d="M12 8v4.5" /></>,42  running: <><circle cx="12" cy="12" r="9" /><path d="m10 8.5 5.5 3.5-5.5 3.5v-7Z" /></>,43  user: <><circle cx="12" cy="8" r="4" /><path d="M4 21a8 8 0 0 1 16 0" /></>,44  users: <><circle cx="9" cy="8" r="3.5" /><path d="M2.5 20a6.5 6.5 0 0 1 13 0M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.2a6.5 6.5 0 0 1 3.5 5.8" /></>,45  logout: <><path d="M9 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h3" /><path d="M15 8l4 4-4 4M19 12H9" /></>,46  sun: <><circle cx="12" cy="12" r="4" /><path d="M12 2.5v2.5M12 19v2.5M2.5 12H5M19 12h2.5M5.3 5.3 7 7M17 17l1.7 1.7M18.7 5.3 17 7M7 17l-1.7 1.7" /></>,47  moon: <path d="M20 14.5A8.5 8.5 0 0 1 9.5 4 8.5 8.5 0 1 0 20 14.5Z" />,48  globe: <><circle cx="12" cy="12" r="9" /><path d="M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9s-1.3 6.3-3.8 9c-2.5-2.7-3.8-5.7-3.8-9S9.5 5.7 12 3Z" /></>,49  external: <><path d="M14 4h6v6M20 4l-9 9" /><path d="M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4" /></>,50  filter: <path d="M3 5h18l-7 8.5V19l-4 2v-7.5L3 5Z" />,51  "sort-asc": <path d="M12 19V5M6 11l6-6 6 6" />,52  "sort-desc": <path d="M12 5v14M6 13l6 6 6-6" />,53  sort: <path d="M8 4v16M4.5 7.5 8 4l3.5 3.5M16 20V4M12.5 16.5 16 20l3.5-3.5" />,54  play: <path d="M7 4.5v15l12-7.5L7 4.5Z" />,55  stop: <rect x="6" y="6" width="12" height="12" rx="1.5" />,56  restart: <><path d="M4 12a8 8 0 1 0 2.6-5.9L4 8.5" /><path d="M4 4v4.5h4.5" /></>,57  trash: <><path d="M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" /></>,58  edit: <><path d="M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17v3Z" /><path d="m14.5 7.5 3 3" /></>,59  pin: <><path d="M9 4h6l-1 6 3.5 3.5h-11L10 10 9 4Z" /><path d="M12 13.5V21" /></>,60  key: <><circle cx="8" cy="15" r="4" /><path d="m11 12 9-9M16 7l3 3M14 9l2 2" /></>,61  passkey: <><circle cx="9" cy="8" r="4" /><path d="M2.5 21a6.5 6.5 0 0 1 10-5.5" /><circle cx="18" cy="13" r="2.5" /><path d="M18 15.5V22l1.5-1.5M18 19l1.5-1" /></>,62  shield: <path d="M12 3 4.5 6v5.5c0 4.6 3.1 8.2 7.5 9.5 4.4-1.3 7.5-4.9 7.5-9.5V6L12 3Z" />,63  download: <><path d="M12 4v11M7 10.5l5 5 5-5" /><path d="M4 20h16" /></>,64  expand: <path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" />,65  collapse: <path d="M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5" />,66  table: <><rect x="3" y="4" width="18" height="16" rx="2" /><path d="M3 10h18M3 15h18M9 4v16" /></>,67  grid: <><rect x="3" y="3" width="7.5" height="7.5" rx="1.5" /><rect x="13.5" y="3" width="7.5" height="7.5" rx="1.5" /><rect x="3" y="13.5" width="7.5" height="7.5" rx="1.5" /><rect x="13.5" y="13.5" width="7.5" height="7.5" rx="1.5" /></>,68  chart: <><path d="M4 4v16h16" /><path d="m7.5 15 3.5-4.5 3 2.5 4.5-6" /></>,69  calendar: <><rect x="3" y="5" width="18" height="16" rx="2" /><path d="M3 10h18M8 3v4M16 3v4" /></>,70  clock: <><circle cx="12" cy="12" r="9" /><path d="M12 7v5.3l3.2 2" /></>,71  drag: <><circle cx="9" cy="6" r="1.2" /><circle cx="15" cy="6" r="1.2" /><circle cx="9" cy="12" r="1.2" /><circle cx="15" cy="12" r="1.2" /><circle cx="9" cy="18" r="1.2" /><circle cx="15" cy="18" r="1.2" /></>,72  link: <><path d="M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1" /><path d="M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1" /></>,73  qr: <><rect x="3.5" y="3.5" width="6" height="6" rx="1" /><rect x="14.5" y="3.5" width="6" height="6" rx="1" /><rect x="3.5" y="14.5" width="6" height="6" rx="1" /><path d="M14.5 14.5h2.5v2.5M20.5 14.5v.01M14.5 20.5h.01M17.5 20.5h3v-3" /></>,74  monitor: <><rect x="3" y="4" width="18" height="12" rx="2" /><path d="M8 20h8M12 16v4" /></>,75  bolt: <path d="M13 3 5 13.5h6L10 21l8-10.5h-6L13 3Z" />,76  note: <><path d="M6 3h9l4 4v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Z" /><path d="M8 11h8M8 15h5" /></>,77  comment: <path d="M4 5h16v11H9l-5 4V5Z" />,78  terminal: <><rect x="3" y="4" width="18" height="16" rx="2" /><path d="m7 9 3 3-3 3M12.5 15H17" /></>,79  lock: <><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" /></>,80  freeze: <path d="M12 2.5v19M4 7l16 10M20 7 4 17M9.5 4 12 6.5 14.5 4M9.5 20l2.5-2.5 2.5 2.5" />,81  device: <><rect x="7" y="2.5" width="10" height="19" rx="2" /><path d="M11 18.5h2" /></>,82  menu: <path d="M4 7h16M4 12h16M4 17h16" />,83  eye: <><path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z" /><circle cx="12" cy="12" r="2.5" /></>,84  history: <><path d="M4 12a8 8 0 1 0 2.6-5.9L4 8.5" /><path d="M4 4v4.5h4.5M12 8v4.5l3 1.8" /></>,85  silence: <><path d="M6 9a6 6 0 0 1 9.5-4.9M18 9c0 6 2.5 7 2.5 7H8" /><path d="M10 20a2 2 0 0 0 4 0M4 4l16 16" /></>,86};8788export type IconName =89  | "overview" | "nodes" | "services" | "models" | "jobs" | "network" | "storage" | "alerts" | "maintenance" | "activity" | "audit" | "settings"90  | "search" | "close" | "check" | "chevron-down" | "chevron-up" | "chevron-right" | "chevron-left" | "plus" | "minus" | "more" | "copy" | "refresh"91  | "ok" | "warning" | "critical" | "info" | "stale" | "offline" | "wrench" | "unknown" | "unsupported" | "denied" | "pending" | "running"92  | "user" | "users" | "logout" | "sun" | "moon" | "globe" | "external" | "filter" | "sort-asc" | "sort-desc" | "sort" | "play" | "stop" | "restart"93  | "trash" | "edit" | "pin" | "key" | "passkey" | "shield" | "download" | "expand" | "collapse" | "table" | "grid" | "chart" | "calendar" | "clock"94  | "drag" | "link" | "qr" | "monitor" | "bolt" | "note" | "comment" | "terminal" | "lock" | "freeze" | "device" | "menu" | "eye" | "history" | "silence";9596export function Icon({ name, size = 16, className }: { name: IconName; size?: number; className?: string }) {97  return (98    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false" className={className}>99      {P[name]}100    </svg>101  );102}103
Files main
Menu

Theme