*/ public static function for(Store $store): array { return self::forName($store->name); } /** * @return array */ public static function forName(string $name): array { return PlanUpgrader::upgrade(self::flat($name)); } /** * The sample written as one flat list, header first and footer last, which is the easiest form to read. * PlanUpgrader then moves the header and footer out and puts the rest on the home page. * * @return array */ private static function flat(string $name): array { return [ 'version' => 1, 'theme' => [ 'colors' => [ 'background' => '#FBF7F0', 'surface' => '#F3EADB', 'foreground' => '#2A1A12', 'muted' => '#7A6557', 'primary' => '#B4411F', 'primaryForeground' => '#FFF8F0', 'accent' => '#E2A93B', 'border' => '#E3D5C0', ], 'fonts' => ['heading' => 'fraunces', 'body' => 'dm-sans'], 'radius' => 'medium', 'style' => [ 'buttons' => 'solid', 'cards' => 'shadow', 'spacing' => 'normal', 'headings' => 'normal', 'backgrounds' => 'alternate', 'motion' => 'gentle', ], ], 'sections' => [ [ 'id' => 'header', 'type' => 'header', 'variant' => 'simple', 'content' => [ 'logoText' => $name, 'links' => [ ['label' => 'Shop', 'href' => '#products'], ['label' => 'Our story', 'href' => '#about'], ['label' => 'FAQ', 'href' => '#faq'], ['label' => 'Contact', 'href' => '#contact'], ], 'cta' => ['label' => 'Shop now', 'href' => '#products'], ], ], [ 'id' => 'hero', 'type' => 'hero', 'variant' => 'split', 'content' => [ 'eyebrow' => 'Small batch · Made in Malaysia', 'headline' => 'Sambal the way grandma made it', 'subheadline' => 'Slow-cooked for six hours with fresh chillies and no preservatives. One spoon turns plain rice into a meal.', 'primaryCta' => ['label' => 'Shop the range', 'href' => '#products'], 'secondaryCta' => ['label' => 'Our story', 'href' => '#about'], ], ], [ 'id' => 'trust', 'type' => 'trust_bar', 'variant' => 'row', 'content' => [ 'items' => [ ['kind' => 'shipping'], ['kind' => 'payment'], ['kind' => 'custom', 'icon' => 'clock', 'title' => 'Slow-cooked for six hours', 'text' => 'No preservatives'], ], ], ], [ 'id' => 'products', 'type' => 'product_grid', 'variant' => 'grid', 'content' => [ 'heading' => 'Best sellers', 'subheading' => 'Cooked fresh every week and delivered across Malaysia.', 'items' => [ ['name' => 'Sambal Ikan Bilis', 'price' => 18.90, 'badge' => 'Best seller'], ['name' => 'Sambal Hijau', 'price' => 16.90, 'badge' => null], ['name' => 'Sambal Petai', 'price' => 21.90, 'badge' => 'New'], ['name' => 'Sambal Belacan', 'price' => 15.90, 'badge' => null], ], ], ], [ 'id' => 'featured', 'type' => 'featured_product', 'variant' => 'image-right', 'content' => [ 'eyebrow' => 'Gift set', 'name' => 'The Family Trio', 'description' => 'Three of our most loved sambals in one box. A good first order, and an easy gift for anyone who misses home cooking.', 'price' => 49.90, 'bullets' => [ 'Three 180g jars', 'Keeps for 3 months unopened', 'Free delivery in Peninsular Malaysia', ], 'cta' => ['label' => 'Add to cart', 'href' => '#products'], ], ], [ 'id' => 'about', 'type' => 'about', 'variant' => 'with-stats', 'content' => [ 'heading' => 'A family recipe, three generations old', 'body' => "$name began in a home kitchen, with a recipe passed from grandmother to mother to daughter. We still cook in small batches, taste every pot, and use chillies bought from the same farms each week.", 'stats' => [ ['value' => '6 hrs', 'label' => 'Slow-cooked per batch'], ['value' => '0', 'label' => 'Preservatives'], ['value' => '12k+', 'label' => 'Jars delivered'], ], ], ], [ 'id' => 'testimonials', 'type' => 'testimonials', 'variant' => 'cards', 'content' => [ 'heading' => 'What customers say', 'items' => [ ['quote' => 'Tastes exactly like my late mother\'s sambal. I order four jars every month.', 'name' => 'Aishah R.', 'role' => 'Shah Alam'], ['quote' => 'Spicy, but balanced. My kids now ask for it with every meal.', 'name' => 'Daniel L.', 'role' => 'Penang'], ['quote' => 'Arrived well packed and fresh. The petai one is dangerous.', 'name' => 'Farah N.', 'role' => 'Johor Bahru'], ], ], ], [ 'id' => 'faq', 'type' => 'faq', 'variant' => 'list', 'content' => [ 'heading' => 'Common questions', 'items' => [ ['question' => 'How long does it keep?', 'answer' => 'Three months unopened. After opening, keep it in the fridge and finish within four weeks.'], ['question' => 'How spicy is it?', 'answer' => 'Most of our sambals are medium. Sambal Hijau is the mildest and Sambal Belacan is the hottest.'], ['question' => 'Do you deliver to East Malaysia?', 'answer' => 'Yes. Delivery to Sabah and Sarawak takes three to five working days.'], ], ], ], [ 'id' => 'newsletter', 'type' => 'newsletter', 'variant' => 'banner', 'content' => [ 'heading' => 'Get 10% off your first order', 'body' => 'Join our list for new flavours and recipes. No spam.', 'placeholder' => 'Your email address', 'buttonLabel' => 'Sign up', ], ], [ 'id' => 'contact', 'type' => 'contact', 'variant' => 'simple', 'content' => [ 'heading' => 'Talk to us', 'body' => 'Questions about an order, or want to stock our sambal? We reply within a day.', 'email' => 'hello@example.com', 'phone' => '+60 12-345 6789', 'whatsapp' => '60123456789', 'address' => 'Shah Alam, Selangor', ], ], [ 'id' => 'footer', 'type' => 'footer', 'variant' => 'simple', 'content' => [ 'text' => "© $name. All rights reserved.", 'links' => [ ['label' => 'Shop', 'href' => '#products'], ['label' => 'FAQ', 'href' => '#faq'], ['label' => 'Contact', 'href' => '#contact'], ], ], ], ], ]; } }