/* ============================================================
Molecules — Cards, Search, Lists, Bottom sheet, Toasts
============================================================ */
/* ---------- Sample data ---------- */
const SAMPLE_PRODUCTS = [
{ id: 1, name: "Pão de fermentação natural artesanal 500g", cat: "Alimentos", company: "Casa do Pão", price: ["R$","18","90"], badge: "new", letter: "P", bg: "linear-gradient(135deg,#FAE4C8,#E6CFAB)" },
{ id: 2, name: "Mentoria 1:1 — Empresário cristão", cat: "Serviços", company: "Caminho Sólido", price: ["R$","290","00"], badge: "featured", letter: "M", bg: "linear-gradient(135deg,#E5D6E8,#C8B0CE)" },
{ id: 3, name: "Curso online — Liderança bíblica", cat: "Educação", company: "Escola Caleb", price: ["R$","149","00"], badge: "verified", letter: "C", bg: "linear-gradient(135deg,#D9E8DD,#BAD0C2)" },
{ id: 4, name: "Devocional encadernado em couro", cat: "Livros", company: "Editora Refúgio", price: ["R$","78","50"], letter: "D", bg: "linear-gradient(135deg,#E6D9C5,#CBB892)" },
];
/* ---------- PRODUCT CARDS ---------- */
function ProductCard({ p, expanded, fav, onFav, skeleton, badgeOverride }) {
if (skeleton) {
return (
);
}
const badge = badgeOverride || p.badge;
return (
{p.letter}
{badge === "new" && Novo}
{badge === "featured" && Destaque}
{badge === "verified" && Verificado}
{p.cat}
{p.name}
{p.company}
{p.price[0]}
{p.price[1]}
,{p.price[2]}
);
}
function ProductCardsSection() {
const [favs, setFavs] = useState({1: true});
const toggle = (id) => setFavs({...favs, [id]: !favs[id]});
return (
<>
Grid · 2 colunas (mobile padrão)
{SAMPLE_PRODUCTS.slice(0,4).map(p => (
toggle(p.id)} />
))}
Lista expandida · 1 coluna
{SAMPLE_PRODUCTS.slice(0,2).map(p => (
{p.letter}
{p.cat}
{p.name}
{p.company}
{p.price[0]}
{p.price[1]}
,{p.price[2]}
))}
>
);
}
/* ---------- COMPANY CARDS ---------- */
const COMPANIES = [
{ name: "Casa do Pão", cat: "Padaria artesanal", city: "São Paulo · SP", initial: "CP", color: "linear-gradient(135deg, #C95A1B, #7B3613)", verified: true },
{ name: "Caminho Sólido Mentoria", cat: "Consultoria empresarial", city: "Belo Horizonte · MG", initial: "CS", color: "linear-gradient(135deg, #4A2F52, #1A0F1D)", verified: true },
{ name: "Editora Refúgio", cat: "Livros e devocionais", city: "Curitiba · PR", initial: "ER", color: "linear-gradient(135deg, #2D7A4F, #1F5736)", verified: false },
{ name: "Tribo Imobiliária Cristã", cat: "Imobiliária", city: "Brasília · DF", initial: "TI", color: "linear-gradient(135deg, #2C5F87, #1B405E)", verified: true },
];
function CompanyCardsSection() {
return (
<>
Horizontal · lista
{COMPANIES.slice(0,3).map((c, i) => (
{c.initial}
{c.name}
{c.verified && }
{c.cat}
{c.city}
))}
Vertical · grid (scroll horizontal no mobile)
{COMPANIES.map((c, i) => (
{c.initial}
{c.name}
{c.verified && }
{c.cat}
{c.city}
))}
>
);
}
/* ---------- CATEGORY CARDS ---------- */
const CATEGORIES = [
{ name: "Alimentos", icon: "bread", color: "var(--ember-50)", iconColor: "var(--ember-600)" },
{ name: "Serviços", icon: "wrench", color: "var(--info-50)", iconColor: "var(--info-700)" },
{ name: "Tecnologia", icon: "cpu", color: "#ECE3F3", iconColor: "#4F2A6E" },
{ name: "Educação", icon: "book-open", color: "var(--success-50)", iconColor: "var(--success-700)" },
{ name: "Saúde", icon: "heartbeat", color: "var(--error-50)", iconColor: "var(--error-700)" },
{ name: "Causas", icon: "hand-heart", color: "#FBE9D5", iconColor: "#8A4516" },
{ name: "Imobiliária", icon: "house-line", color: "#E1EDE3", iconColor: "var(--success-700)" },
{ name: "Eventos", icon: "calendar-star", color: "#E3DDEF", iconColor: "var(--plum-700)" },
];
function CategoryCardsSection() {
const [active, setActive] = useState("Alimentos");
return (
<>
Card padrão · ícone + nome
{CATEGORIES.map(c => (
))}
Chips (filtros e tags ativas)
{CATEGORIES.slice(0, 6).map(c => (
setActive(c.name)}>
{c.name}
))}
>
);
}
/* ---------- SEARCH BAR ---------- */
function SearchBarSection() {
const [open, setOpen] = useState(false);
const [q, setQ] = useState("pão");
const suggestions = [
{ type: "produto", title: "Pão de fermentação natural", sub: "Casa do Pão · Alimentos" },
{ type: "produto", title: "Pão sem glúten artesanal", sub: "Padaria do Pão Vivo · Alimentos" },
{ type: "empresa", title: "Casa do Pão", sub: "Padaria · São Paulo, SP · verificada" },
{ type: "categoria", title: "Padarias artesanais", sub: "248 empresas" },
];
return (
<>
Com sugestões dropdown
Sugestões para “{q}”
{suggestions.map((s, i) => (
))}
>
);
}
/* ---------- LISTS ---------- */
function ListsSection() {
return (
<>
Produto em lista
{SAMPLE_PRODUCTS.slice(0, 3).map((p, i) => (
{p.letter}
{p.name}
{p.company} · {p.cat}
{p.price[0]}
{p.price[1]}
))}
Empresa em lista
{COMPANIES.map((c, i) => (
{c.initial}
{c.name}
{c.verified && }
{c.cat} · {c.city}
))}
Categoria com ícone
{CATEGORIES.slice(0,5).map((c, i) => (
{c.name}
{42 + i * 17} empresas · {180 + i * 41} produtos
))}
>
);
}
/* ---------- BOTTOM SHEET ---------- */
function BottomSheetSection() {
const [show, setShow] = useState("filters");
const sheets = {
filters: (
<>
Filtros
>
),
confirm: (
<>
Remover este produto?
O produto sairá da sua sacola. Você pode adicioná-lo novamente a qualquer momento.
>
),
preview: (
<>
{SAMPLE_PRODUCTS[0].cat}
{SAMPLE_PRODUCTS[0].name}
{SAMPLE_PRODUCTS[0].company}
R$
18,90
Pão de fermentação natural feito artesanalmente todas as manhãs com farinha orgânica.
>
),
};
return (
<>
Variantes
Resultado da busca
42 produtos encontrados
{SAMPLE_PRODUCTS.slice(0,2).map(p =>
)}
>
);
}
/* ---------- TOASTS ---------- */
function ToastsSection() {
return (
<>
Variantes
Produto adicionado aos favoritos
Você pode encontrar todos os seus favoritos no Perfil.
Não foi possível finalizar o pagamento
Verifique os dados do cartão e tente novamente.
Endereço de entrega ainda não confirmado
Atualize antes do checkout.
Sua empresa foi enviada para verificação
Em até 48h você recebe o selo iGod por e-mail.
>
);
}
Object.assign(window, {
ProductCard,
SAMPLE_PRODUCTS, COMPANIES, CATEGORIES,
ProductCardsSection, CompanyCardsSection, CategoryCardsSection,
SearchBarSection, ListsSection, BottomSheetSection, ToastsSection
});