// Shared components for Janaushadhi app screens
// All screens are 402 x 874 inside an IOSDevice.
// App content area is approx 402 x 786 (status 54 + home indicator 34).
const C = {
navy900: '#0A1733', navy800: '#0B1F4D', navy700: '#143278',
blue600: '#1B5BFF', blue500: '#2F6BFF', blue400: '#5B9EFF',
blue300: '#8FB8FF', blue100: '#DCE7FF', blue50: '#EEF3FF', blue25: '#F6F9FF',
mint500: '#22C29A', mint100: '#D6F5EA',
amber500: '#F5A524', amber100: '#FFEFD1',
rose500: '#E5484D', rose100: '#FFE4E4',
ink900: '#0B132B', ink700: '#2E3957', ink500: '#5B6784',
ink400: '#8693B0', ink300: '#B5BFD4', ink200: '#D9DFEC',
ink100: '#ECF0F8', ink50: '#F5F7FC', white: '#FFFFFF',
};
// ── Striped placeholder for product imagery ───────────────────
function ProductPlaceholder({ hue = 'blue', label, w = '100%', h = 110, radius = 14 }) {
const palettes = {
blue: [C.blue50, C.blue100, C.blue300],
mint: [C.mint100, '#B3EAD7', C.mint500],
amber: [C.amber100, '#F8DDA0', C.amber500],
rose: [C.rose100, '#F8C7C9', C.rose500],
navy: ['#E2E8FA', C.blue100, C.navy800],
};
const [bg, stripe, glyph] = palettes[hue] || palettes.blue;
return (
);
}
// ── Bottom Nav (used on Home, Rx, Cart, Orders, Profile) ──────
function BottomNav({ active = 'home' }) {
const items = [
{ id: 'home', label: 'Home', Icon: IconHome },
{ id: 'rx', label: 'Rx', Icon: IconRx, prominent: true },
{ id: 'cart', label: 'Cart', Icon: IconCart, badge: 3 },
{ id: 'orders', label: 'Orders', Icon: IconBox },
{ id: 'profile', label: 'Profile', Icon: IconUser },
];
return (
{items.map((it) => {
const isActive = it.id === active;
if (it.prominent) {
return (
);
}
const color = isActive ? C.blue600 : C.ink400;
return (
{it.badge && (
{it.badge}
)}
{it.label}
);
})}
);
}
// ── Top bar (location + bell) ─────────────────────────────────
function TopBar({ location = 'Bengaluru — Indiranagar', count = 2, dark = false }) {
const text = dark ? 'white' : C.ink900;
const muted = dark ? 'rgba(255,255,255,0.7)' : C.ink500;
return (
);
}
// ── Search bar ────────────────────────────────────────────────
function SearchBar({ placeholder = 'Search medicines, brands, wellness', onMic = true, onScan = true }) {
return (
{placeholder}
{onMic &&
}
{onScan && (
<>
>
)}
);
}
// ── Status banner (Rx active / refill due) ────────────────────
function StatusBanner({ title, sub, cta = 'View', tone = 'blue' }) {
const palettes = {
blue: { bg: C.blue50, text: C.navy800, accent: C.blue600 },
mint: { bg: C.mint100, text: '#0F5A48', accent: C.mint500 },
amber:{ bg: C.amber100, text: '#7A4500', accent: C.amber500 },
};
const p = palettes[tone] || palettes.blue;
return (
);
}
// ── Section header ────────────────────────────────────────────
function SectionHeader({ title, action = 'See all' }) {
return (
{title}
{action &&
{action}
}
);
}
Object.assign(window, {
C, ProductPlaceholder, BottomNav, TopBar, SearchBar, StatusBanner, SectionHeader,
});