// ============================================================
// Mobile app extras v2 — extended icons, Modal, Toast, AutoSave
// Loads AFTER components/shared.jsx (extends window.Icons)
// ============================================================
Object.assign(Icons, {
google: (p) => (
),
lock: (p) => ,
mail: (p) => ,
eyeOff: (p) => ,
file: (p) => ,
save: (p) => ,
alert: (p) => ,
clock: (p) => ,
logout: (p) => ,
chevL: (p) => ,
phone: (p) => ,
at: (p) => ,
image: (p) => ,
zap: (p) => ,
trophy: (p) => ,
msgCircle: (p) => ,
timerReset: (p) => ,
newspaper: (p) => ,
arrowUp: (p) => ,
});
// ---- Shared input style (consistent across all screens) ----
const nkInput = {
width: "100%", borderRadius: 10, padding: "12px 14px",
fontFamily: "var(--ff-ui)", fontSize: 15, color: "var(--text)",
background: "var(--bg-card)", border: "1px solid var(--border-2)",
outline: "none", transition: "border-color .15s ease",
};
// ---- Section label ----
const SectionLabel = ({ children }) => (
{children}
);
// ---------- Toast ----------
function Toast({ message, tone }) {
if (!message) return null;
const tones = {
success: { c: "var(--st-approve)", ic: },
info: { c: "var(--blue)", ic: },
amber: { c: "var(--st-review)", ic: },
error: { c: "var(--red)", ic: },
};
const t = tones[tone] || tones.success;
return (
);
}
// ---------- Modal (confirm / alert) ----------
function Modal({ data, onClose }) {
if (!data) return null;
const { title, body, confirmLabel = "Confirm", cancelLabel = "Cancel",
tone = "blue", icon, onConfirm, single } = data;
const toneC = tone === "red" ? "var(--red)" : tone === "amber" ? "var(--st-review)"
: tone === "green" ? "var(--st-approve)" : "var(--blue)";
const Ic = icon || (tone === "red" ? Icons.alert : tone === "amber" ? Icons.alert : Icons.check);
return (
e.stopPropagation()} style={{ width: "100%", maxWidth: 320,
background: "var(--bg-card)", borderRadius: 18, padding: "22px 20px 18px",
boxShadow: "0 24px 60px rgba(0,0,0,0.34)",
animation: "nk-pop .22s cubic-bezier(.2,.9,.3,1)" }}>
{title}
{body}
{!single && (
)}
);
}
// ---------- Auto-save indicator ----------
function AutoSaveIndicator({ dirty, saving, lastSaved }) {
return (
{saving ? (
Saving…
) : dirty ? (
Unsaved changes
) : lastSaved ? (
Saved {lastSaved}
) : null}
);
}
Object.assign(window, { Toast, Modal, AutoSaveIndicator, nkInput, SectionLabel });