/* eslint-disable */ // Shared shell components for Receipt Analytics mockups // Exposes: Icon, AppShell, TopBar, Sidebar, FilterBar, KPICard, Card, Delta, // SectionTitle, Tag, Avatar, tokens, fmt const { useState, useEffect, useMemo, useRef } = React; /* ---------- tokens ---------- */ const tokens = { brand: "#4F46E5", // indigo-600 brandSoft: "#EEF2FF", // indigo-50 brandRing: "#C7D2FE", // indigo-200 ok: "#10B981", bad: "#EF4444", warn: "#F59E0B", ink: "#0B0B12", // grayscale for competitor charts gray: ["#E5E7EB", "#D1D5DB", "#9CA3AF", "#6B7280", "#4B5563", "#374151", "#1F2937"], }; /* ---------- formatters ---------- */ const fmt = { int: (n) => new Intl.NumberFormat("ro-RO").format(Math.round(n)), lei: (n) => new Intl.NumberFormat("ro-RO").format(Math.round(n)) + " LEI", leiK: (n) => { if (n >= 1_000_000) return (n / 1_000_000).toFixed(2).replace(/\.0+$/, "") + "M LEI"; if (n >= 1000) return Math.round(n / 1000) + "K LEI"; return Math.round(n) + " LEI"; }, pct: (n, d = 0) => (Math.round(n * Math.pow(10, d)) / Math.pow(10, d)).toFixed(d) + "%", delta: (n) => (n > 0 ? "+" : "") + n + "%", }; /* ---------- Icon library (lucide stroke style, 24 viewBox) ---------- */ const ICON_PATHS = { // nav "layout-grid": "M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z", receipt: "M4 2v20l2-2 2 2 2-2 2 2 2-2 2 2 2-2 2 2V2l-2 2-2-2-2 2-2-2-2 2-2-2-2 2-2-2zM8 7h8M8 12h8M8 17h5", package: "M16.5 9.4 7.5 4.21M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16zM3.27 6.96 12 12.01l8.73-5.05M12 22.08V12", "folder-tree": "M13 10h7a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 2h-2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1zM13 21h7a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2.88a1 1 0 0 1-.9-.55l-.44-.9a1 1 0 0 0-.9-.55H13a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1zM3 3v2c0 1.1.9 2 2 2h3M3 3v13c0 1.1.9 2 2 2h3", store: "M2 7h20l-1.5 4.5a2 2 0 0 1-1.9 1.5h-13.2a2 2 0 0 1-1.9-1.5L2 7zM4 7V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2M4 13v7h16v-7M10 20v-5h4v5", map: "M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3V6zM9 3v15M15 6v15", sparkles: "M12 3l1.9 4.4L18.4 9 14 11l-2 4-2-4-4.4-2 4.4-1.6L12 3zM5 14l.9 2.1L8 17l-2.1.9L5 20l-.9-2.1L2 17l2.1-.9L5 14zM19 4l.6 1.4L21 6l-1.4.6L19 8l-.6-1.4L17 6l1.4-.6L19 4z", search: "M11 11m-7 0a7 7 0 1 0 14 0a7 7 0 1 0-14 0M21 21l-4.35-4.35", bell: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0", "chevron-down": "M6 9l6 6 6-6", "chevron-right": "M9 6l6 6-6 6", "chevron-up": "M18 15l-6-6-6 6", "chevron-left": "M15 18l-6-6 6-6", "chevrons-up-down": "M7 15l5 5 5-5M7 9l5-5 5 5", "arrow-up": "M12 19V5M5 12l7-7 7 7", "arrow-down": "M12 5v14M19 12l-7 7-7-7", "arrow-up-right": "M7 7h10v10M7 17l10-10", "arrow-down-right": "M7 7l10 10M17 7v10H7", "arrow-right": "M5 12h14M12 5l7 7-7 7", "arrow-left": "M19 12H5M12 19l-7-7 7-7", filter: "M22 3H2l8 9.46V19l4 2v-8.54L22 3z", calendar: "M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6zM16 2v4M8 2v4M3 10h18", x: "M18 6L6 18M6 6l12 12", download: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3", upload: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12", settings: "M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-1.8-.3 1.6 1.6 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.6 1.6 0 0 0-1-1.5 1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.6 1.6 0 0 0 .3-1.8 1.6 1.6 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.6 1.6 0 0 0 1.5-1 1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.6 1.6 0 0 0 1.8.3h.1a1.6 1.6 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.6 1.6 0 0 0 1 1.5 1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.6 1.6 0 0 0-.3 1.8v.1a1.6 1.6 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1z", user: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z", "help-circle": "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01", info: "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 16v-4M12 8h.01", "external-link": "M15 3h6v6M10 14L21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5", "trending-up": "M22 7l-9.5 9.5-5-5L1 18M16 7h6v6", "trending-down": "M22 17l-9.5-9.5-5 5L1 6M16 17h6v-6", plus: "M12 5v14M5 12h14", minus: "M5 12h14", check: "M20 6L9 17l-5-5", "check-circle": "M22 11.08V12a10 10 0 1 1-5.93-9.14M22 4L12 14.01l-3-3", "alert-circle": "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 8v4M12 16h.01", "alert-triangle": "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01", "more-horizontal": "M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM19 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM5 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z", eye: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z", "file-text": "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zM14 2v6h6M16 13H8M16 17H8M10 9H8", building: "M3 21V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14M3 21h18M9 9h.01M9 13h.01M9 17h.01M15 9h.01M15 13h.01M15 17h.01", "map-pin": "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0zM12 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z", "zoom-in": "M11 11m-8 0a8 8 0 1 0 16 0a8 8 0 1 0-16 0M21 21l-4.35-4.35M11 8v6M8 11h6", "zoom-out": "M11 11m-8 0a8 8 0 1 0 16 0a8 8 0 1 0-16 0M21 21l-4.35-4.35M8 11h6", send: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z", image: "M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21", command: "M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z", "message-square": "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10z", bot: "M12 8V4H8M2 14h2M20 14h2M15 13v2M9 13v2M5 7h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2z", copy: "M9 9a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-9a2 2 0 0 1-2-2V9zM5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1", refresh: "M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5", scan: "M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2M7 12h10", paperclip: "M21.4 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48", globe: "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z", layers: "M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5", list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01", grid: "M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z", edit: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z", trash: "M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6", lock: "M5 11h14a2 2 0 0 1 2 2v8H3v-8a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4", "circle-dot": "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z", flag: "M4 22V4a2 2 0 0 1 2-2h13l-3 6 3 6H6a2 2 0 0 0-2 2", star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14l-5-4.87 6.91-1.01L12 2z", link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", "pie-chart": "M21.21 15.89A10 10 0 1 1 8 2.83M22 12A10 10 0 0 0 12 2v10z", "bar-chart": "M12 20V10M18 20V4M6 20v-6", database: "M12 8c4.97 0 9-1.79 9-4s-4.03-4-9-4-9 1.79-9 4 4.03 4 9 4zM3 5v14c0 2.21 4.03 4 9 4s9-1.79 9-4V5M3 12c0 2.21 4.03 4 9 4s9-1.79 9-4", }; function Icon({ name, size = 16, className = "", strokeWidth = 1.75, style }) { const d = ICON_PATHS[name]; if (!d) return ; return ( ); } /* ---------- Top bar ---------- */ function TopBar({ activeProject = "Campania Q1 2026" }) { return (
R
Receipt Analytics
MT
); } /* ---------- Sidebar ---------- */ const NAV = [ { key: "overview", label: "Overview", icon: "layout-grid", href: "01-overview.html" }, { key: "receipts", label: "Receipts", icon: "receipt", href: "06-receipts.html", badge: "12.8K" }, { key: "products", label: "Products", icon: "package", href: "07-products.html" }, { key: "categories", label: "Categories", icon: "folder-tree", href: "04-categories-l2.html" }, { key: "stores", label: "Stores", icon: "store", href: "10-stores.html" }, { key: "map", label: "Map", icon: "map", href: "02-map.html" }, { key: "ai", label: "AI Chat", icon: "sparkles", href: "05-ai-chat.html" }, ]; function Sidebar({ active = "overview" }) { return ( ); } /* ---------- Filter bar (global, sticky) ---------- */ function FilterPill({ icon, label, value, count, active = false, onChange }) { return ( ); } function FilterBar({ extra, onlyMine, onOnlyMineChange }) { const [internal, setInternal] = useState(true); const controlled = onlyMine !== undefined; const value = controlled ? onlyMine : internal; const toggle = () => { const next = !value; if (!controlled) setInternal(next); if (onOnlyMineChange) onOnlyMineChange(next); }; return (
{extra}
); } /* ---------- Card primitives ---------- */ function Card({ className = "", children, padding = "p-5", style, ...rest }) { return (
{children}
); } function CardHeader({ title, subtitle, action, kicker, className = "" }) { return (
{kicker &&
{kicker}
}
{title}
{subtitle &&
{subtitle}
}
{action}
); } function Delta({ value, suffix = "%", className = "" }) { const positive = value > 0; const negative = value < 0; return ( {Math.abs(value)}{suffix} ); } function Tag({ children, tone = "gray", className = "" }) { const tones = { gray: "bg-gray-100 text-gray-700", indigo: "bg-indigo-50 text-indigo-700 ring-1 ring-inset ring-indigo-100", emerald: "bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-100", rose: "bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-100", amber: "bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-100", outline: "border border-gray-200 text-gray-700 bg-white", }; return ( {children} ); } /* ---------- App shell ---------- */ function AppShell({ active = "overview", filterBarExtra, children, hideFilterBar = false, projectName, onlyMine, onOnlyMineChange }) { return (
{!hideFilterBar && }
{children}
); } /* ---------- expose ---------- */ Object.assign(window, { Icon, AppShell, TopBar, Sidebar, FilterBar, FilterPill, Card, CardHeader, Delta, Tag, tokens, fmt, });