SPB Git

Repository Public

icons.tsx 4.8 KB 82 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : MacLustr Social Engine & Remote Navigator8 * File             : apps/navigator-web/src/icons.tsx9 * Module           : navigator-web10 * Repository       : https://git.spboucher.ai/maclustr-social11 * Project Website  : https://social.spboucher.ai12 * Created          : 2026-12-0113 * Last Modified    : 2026-12-0114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: admin@spboucher.ai23 * Technical Contact: dev@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Line icons drawn by hand as inline SVG (no icon font, no external asset). Always decorative: the control carries the label.43import type { ReactNode } from 'react';44import type { SessionState } from './types.ts';4546const Svg = ({ children, size = 20 }: { children: ReactNode; size?: number }) => (47  <svg className="ico" width={size} height={size} viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="square" strokeLinejoin="miter" aria-hidden="true" focusable="false">{children}</svg>48);49export const IcoBack = () => <Svg><path d="M12 4 6 10l6 6" /></Svg>;50export const IcoForward = () => <Svg><path d="m8 4 6 6-6 6" /></Svg>;51export const IcoReload = () => <Svg><path d="M16 10a6 6 0 1 1-2-4.5" /><path d="M16 3v4h-4" /></Svg>;52export const IcoKeyboard = () => <Svg><rect x="2" y="5" width="16" height="10" /><path d="M5 8h1M8 8h1M11 8h1M14 8h1M6 12h8" /></Svg>;53export const IcoFullscreen = () => <Svg><path d="M3 7V3h4M13 3h4v4M17 13v4h-4M7 17H3v-4" /></Svg>;54export const IcoExitFullscreen = () => <Svg><path d="M7 3v4H3M17 7h-4V3M13 17v-4h4M3 13h4v4" /></Svg>;55export const IcoPlus = () => <Svg><path d="M10 4v12M4 10h12" /></Svg>;56export const IcoMinus = () => <Svg><path d="M4 10h12" /></Svg>;57export const IcoClose = ({ size }: { size?: number }) => <Svg size={size}><path d="m5 5 10 10M15 5 5 15" /></Svg>;58export const IcoPanel = () => <Svg><rect x="3" y="4" width="14" height="12" /><path d="M12 4v12" /></Svg>;59export const IcoMore = () => <Svg><path d="M4 10h.01M10 10h.01M16 10h.01" strokeWidth="2.4" /></Svg>;60export const IcoFit = () => <Svg><rect x="3" y="5" width="14" height="10" /><path d="M7 10h6M7 10l1.5-1.5M7 10l1.5 1.5M13 10l-1.5-1.5M13 10l-1.5 1.5" /></Svg>;61export const IcoResetZoom = () => <Svg><circle cx="9" cy="9" r="5" /><path d="m13 13 4 4M7 9h4" /></Svg>;62export const IcoTheme = () => <Svg><circle cx="10" cy="10" r="6" /><path d="M10 4v12" /><path d="M10 4a6 6 0 0 1 0 12z" fill="currentColor" stroke="none" /></Svg>;63export const IcoStop = () => <Svg><path d="M7 3h6l4 4v6l-4 4H7l-4-4V7z" /><path d="M7 10h6" /></Svg>;64export const IcoGo = () => <Svg><path d="M4 10h11M11 6l4 4-4 4" /></Svg>;6566/** One distinct shape per session state, so the state never depends on colour. */67export function StateGlyph({ state }: { state: SessionState }) {68  const shapes: Record<SessionState, ReactNode> = {69    UNINITIALIZED: <circle cx="10" cy="10" r="6" strokeDasharray="2.5 2.5" />,70    LOGIN_REQUIRED: <><rect x="4" y="4" width="12" height="12" /><path d="M10 7v4M10 13.5v.01" /></>,71    MANUAL_CONTROL: <rect x="4" y="4" width="12" height="12" fill="currentColor" />,72    READY: <circle cx="10" cy="10" r="6" fill="currentColor" />,73    BUSY: <><path d="m4 5 5 5-5 5" /><path d="m11 5 5 5-5 5" /></>,74    SECURITY_CHALLENGE: <><path d="M10 2.5 17.5 16h-15z" /><path d="M10 8v3.5M10 13.5v.01" /></>,75    EXPIRED: <><circle cx="10" cy="10" r="6" /><path d="M10 6.5V10l2.5 1.5" /></>,76    PAUSED: <path d="M7 4v12M13 4v12" strokeWidth="2.6" />,77    FAILED: <path d="m4.5 4.5 11 11M15.5 4.5l-11 11" strokeWidth="2.2" />,78    REVOKED: <><circle cx="10" cy="10" r="6" /><path d="m5.8 14.2 8.4-8.4" /></>,79  };80  return <Svg size={16}>{shapes[state]}</Svg>;81}82
Files main
Menu

Theme