@zevcommerce/theme-starter 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1468 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default,
34
+ settingsSchema: () => settingsSchema,
35
+ starterBlockRegistry: () => starterBlockRegistry,
36
+ starterSectionRegistry: () => starterSectionRegistry
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+ var import_theme_sdk2 = require("@zevcommerce/theme-sdk");
40
+
41
+ // src/settings.ts
42
+ var import_theme_sdk = require("@zevcommerce/theme-sdk");
43
+ var settingsSchema = (0, import_theme_sdk.defineSettings)([
44
+ // ============================================================
45
+ // BRAND
46
+ // ============================================================
47
+ {
48
+ name: "Brand",
49
+ icon: "palette",
50
+ settings: [
51
+ { type: "color", id: "brand.primary", label: "Primary Color", default: "#2563EB" },
52
+ { type: "color", id: "brand.background", label: "Background Color", default: "#ffffff" },
53
+ { type: "color", id: "brand.text", label: "Text Color", default: "#374151" },
54
+ { type: "color", id: "brand.accent", label: "Accent Color", default: "#F59E0B" },
55
+ {
56
+ type: "select",
57
+ id: "brand.font",
58
+ label: "Body Font",
59
+ default: "Inter",
60
+ options: [
61
+ { value: "Inter", label: "Inter" },
62
+ { value: "Roboto", label: "Roboto" },
63
+ { value: "Open Sans", label: "Open Sans" },
64
+ { value: "Poppins", label: "Poppins" },
65
+ { value: "Lato", label: "Lato" }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ // ============================================================
71
+ // HEADER
72
+ // ============================================================
73
+ {
74
+ name: "Header",
75
+ icon: "layout",
76
+ settings: [
77
+ { type: "image", id: "header.logo", label: "Logo Image" },
78
+ { type: "range", id: "header.logoHeight", label: "Logo Height (px)", min: 20, max: 80, step: 4, default: 36 },
79
+ { type: "checkbox", id: "header.sticky", label: "Sticky Header", default: true },
80
+ { type: "checkbox", id: "header.showSearch", label: "Show Search Icon", default: true },
81
+ { type: "text", id: "header.menuHandle", label: "Menu Handle", default: "main-menu" }
82
+ ]
83
+ },
84
+ // ============================================================
85
+ // HERO BANNER
86
+ // ============================================================
87
+ {
88
+ name: "Hero Banner",
89
+ icon: "image",
90
+ settings: [
91
+ { type: "checkbox", id: "hero.enabled", label: "Show Hero", default: true },
92
+ { type: "image", id: "hero.backgroundImage", label: "Background Image" },
93
+ { type: "text", id: "hero.heading", label: "Heading", default: "Welcome to our store" },
94
+ { type: "textarea", id: "hero.subheading", label: "Subheading", default: "Discover amazing products at great prices." },
95
+ { type: "text", id: "hero.buttonText", label: "Button Text", default: "Shop Now" },
96
+ { type: "text", id: "hero.buttonLink", label: "Button Link", default: "/collections/all" },
97
+ { type: "range", id: "hero.overlayOpacity", label: "Overlay Opacity", min: 0, max: 100, step: 5, default: 50 },
98
+ { type: "color", id: "hero.overlayColor", label: "Overlay Color", default: "#000000" },
99
+ { type: "color", id: "hero.textColor", label: "Text Color", default: "#ffffff" }
100
+ ]
101
+ },
102
+ // ============================================================
103
+ // PRODUCTS
104
+ // ============================================================
105
+ {
106
+ name: "Products",
107
+ icon: "shopping-bag",
108
+ settings: [
109
+ { type: "checkbox", id: "products.enabled", label: "Show Featured Products", default: true },
110
+ { type: "text", id: "products.heading", label: "Section Heading", default: "Featured Products" },
111
+ { type: "collection_picker", id: "products.collection", label: "Collection", default: "all" },
112
+ { type: "range", id: "products.limit", label: "Number of Products", min: 4, max: 24, step: 4, default: 8 },
113
+ {
114
+ type: "select",
115
+ id: "products.columns",
116
+ label: "Grid Columns (Desktop)",
117
+ default: "4",
118
+ options: [
119
+ { value: "2", label: "2 Columns" },
120
+ { value: "3", label: "3 Columns" },
121
+ { value: "4", label: "4 Columns" }
122
+ ]
123
+ }
124
+ ]
125
+ },
126
+ // ============================================================
127
+ // CONTACT
128
+ // ============================================================
129
+ {
130
+ name: "Contact",
131
+ icon: "phone",
132
+ settings: [
133
+ { type: "checkbox", id: "contact.enabled", label: "Show Contact Section", default: false },
134
+ { type: "text", id: "contact.heading", label: "Section Heading", default: "Get in Touch" },
135
+ { type: "checkbox", id: "contact.showPhone", label: "Show Phone", default: true },
136
+ { type: "text", id: "contact.phone", label: "Phone Number", default: "" },
137
+ { type: "checkbox", id: "contact.showEmail", label: "Show Email", default: true },
138
+ { type: "text", id: "contact.email", label: "Email Address", default: "" },
139
+ { type: "checkbox", id: "contact.showWhatsApp", label: "Show WhatsApp", default: false },
140
+ { type: "text", id: "contact.whatsapp", label: "WhatsApp Number", default: "" },
141
+ { type: "checkbox", id: "contact.showAddress", label: "Show Address", default: false },
142
+ { type: "textarea", id: "contact.address", label: "Address", default: "" }
143
+ ]
144
+ },
145
+ // ============================================================
146
+ // FOOTER
147
+ // ============================================================
148
+ {
149
+ name: "Footer",
150
+ icon: "align-bottom",
151
+ settings: [
152
+ { type: "textarea", id: "footer.description", label: "Store Description", default: "" },
153
+ { type: "text", id: "footer.menuHandle", label: "Footer Menu Handle", default: "footer" },
154
+ { type: "text", id: "footer.copyright", label: "Copyright Text", default: "" },
155
+ { type: "text", id: "footer.instagram", label: "Instagram URL", default: "" },
156
+ { type: "text", id: "footer.facebook", label: "Facebook URL", default: "" },
157
+ { type: "text", id: "footer.twitter", label: "Twitter / X URL", default: "" },
158
+ { type: "text", id: "footer.tiktok", label: "TikTok URL", default: "" }
159
+ ]
160
+ },
161
+ // ============================================================
162
+ // ANNOUNCEMENT
163
+ // ============================================================
164
+ {
165
+ name: "Announcement",
166
+ icon: "megaphone",
167
+ settings: [
168
+ { type: "checkbox", id: "announcement.enabled", label: "Show Announcement Bar", default: false },
169
+ { type: "text", id: "announcement.text", label: "Announcement Text", default: "Free shipping on orders over $50!" },
170
+ { type: "color", id: "announcement.backgroundColor", label: "Background Color", default: "#2563EB" },
171
+ { type: "color", id: "announcement.textColor", label: "Text Color", default: "#ffffff" }
172
+ ]
173
+ }
174
+ ]);
175
+
176
+ // src/sections/Header.tsx
177
+ var import_react = require("react");
178
+ var import_link = __toESM(require("next/link"));
179
+ var import_storefront_api = require("@zevcommerce/storefront-api");
180
+ var import_navigation = require("next/navigation");
181
+ var import_jsx_runtime = require("react/jsx-runtime");
182
+ function Header() {
183
+ const { theme: theme2, storeConfig, menus } = (0, import_storefront_api.useTheme)();
184
+ const { openCart, items } = (0, import_storefront_api.useCartStore)();
185
+ const router = (0, import_navigation.useRouter)();
186
+ const params = (0, import_navigation.useParams)();
187
+ const header = theme2?.settings?.header;
188
+ const logoSrc = header?.logo || storeConfig?.storeLogo;
189
+ const logoHeight = header?.logoHeight || 36;
190
+ const sticky = header?.sticky !== false;
191
+ const showSearch = header?.showSearch !== false;
192
+ const menuHandle = header?.menuHandle || "main-menu";
193
+ const domain = params?.domain || storeConfig?.handle || "";
194
+ const storeName = storeConfig?.name || "Store";
195
+ const availableMenus = Object.values(menus || {});
196
+ const defaultMenu = availableMenus.find((m) => m.isDefault);
197
+ const activeMenu = menuHandle && menus?.[menuHandle] || defaultMenu || availableMenus[0];
198
+ const menuItems = activeMenu?.items || [];
199
+ const [mobileOpen, setMobileOpen] = (0, import_react.useState)(false);
200
+ const [searchOpen, setSearchOpen] = (0, import_react.useState)(false);
201
+ const [searchQuery, setSearchQuery] = (0, import_react.useState)("");
202
+ const [suggestions, setSuggestions] = (0, import_react.useState)([]);
203
+ const searchRef = (0, import_react.useRef)(null);
204
+ const cartCount = items.reduce((sum, item) => sum + item.quantity, 0);
205
+ (0, import_react.useEffect)(() => {
206
+ document.body.style.overflow = mobileOpen || searchOpen ? "hidden" : "";
207
+ return () => {
208
+ document.body.style.overflow = "";
209
+ };
210
+ }, [mobileOpen, searchOpen]);
211
+ (0, import_react.useEffect)(() => {
212
+ if (searchOpen) searchRef.current?.focus();
213
+ }, [searchOpen]);
214
+ (0, import_react.useEffect)(() => {
215
+ const handler = (e) => {
216
+ if (e.key === "Escape") {
217
+ setSearchOpen(false);
218
+ setMobileOpen(false);
219
+ }
220
+ };
221
+ window.addEventListener("keydown", handler);
222
+ return () => window.removeEventListener("keydown", handler);
223
+ }, []);
224
+ (0, import_react.useEffect)(() => {
225
+ const timer = setTimeout(async () => {
226
+ if (searchQuery.length > 2) {
227
+ try {
228
+ const { data } = await (0, import_storefront_api.getProducts)(domain, 1, 5, searchQuery);
229
+ setSuggestions(data);
230
+ } catch {
231
+ setSuggestions([]);
232
+ }
233
+ } else {
234
+ setSuggestions([]);
235
+ }
236
+ }, 300);
237
+ return () => clearTimeout(timer);
238
+ }, [searchQuery, domain]);
239
+ const handleSearch = (e) => {
240
+ e.preventDefault();
241
+ if (!searchQuery.trim()) return;
242
+ router.push((0, import_storefront_api.getStorePermalink)(domain, `/search?q=${encodeURIComponent(searchQuery)}`));
243
+ setSearchOpen(false);
244
+ setSearchQuery("");
245
+ setSuggestions([]);
246
+ };
247
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
248
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
249
+ "header",
250
+ {
251
+ style: {
252
+ backgroundColor: "var(--color-background)",
253
+ borderBottom: "1px solid #e5e7eb",
254
+ position: sticky ? "sticky" : "relative",
255
+ top: 0,
256
+ zIndex: 50
257
+ },
258
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "container mx-auto px-4 sm:px-6", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16", children: [
259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_storefront_api.getStorePermalink)(domain, "/"), className: "flex-shrink-0", children: logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
260
+ "img",
261
+ {
262
+ src: logoSrc,
263
+ alt: storeName,
264
+ style: { height: `${logoHeight}px`, width: "auto", objectFit: "contain" }
265
+ }
266
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
267
+ "span",
268
+ {
269
+ className: "text-xl font-bold",
270
+ style: { color: "var(--color-text)" },
271
+ children: storeName
272
+ }
273
+ ) }),
274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: "hidden md:flex items-center gap-6", children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
275
+ import_link.default,
276
+ {
277
+ href: (0, import_storefront_api.resolveMenuUrl)(item, domain),
278
+ className: "text-sm font-medium transition-colors hover:opacity-70",
279
+ style: { color: "var(--color-text)" },
280
+ children: item.title
281
+ },
282
+ item.id
283
+ )) }),
284
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [
285
+ showSearch && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
286
+ "button",
287
+ {
288
+ onClick: () => setSearchOpen(true),
289
+ "aria-label": "Search",
290
+ className: "p-2 transition-opacity hover:opacity-70",
291
+ style: { color: "var(--color-text)" },
292
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
294
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
295
+ ] })
296
+ }
297
+ ),
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
299
+ "button",
300
+ {
301
+ onClick: openCart,
302
+ "aria-label": "Cart",
303
+ className: "relative p-2 transition-opacity hover:opacity-70",
304
+ style: { color: "var(--color-text)" },
305
+ children: [
306
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
307
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z" }),
308
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
309
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M16 10a4 4 0 01-8 0" })
310
+ ] }),
311
+ cartCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
312
+ "span",
313
+ {
314
+ className: "absolute -top-0.5 -right-0.5 text-[10px] font-bold min-w-[18px] h-[18px] flex items-center justify-center rounded-full px-1",
315
+ style: { backgroundColor: "var(--color-primary)", color: "#fff" },
316
+ children: cartCount
317
+ }
318
+ )
319
+ ]
320
+ }
321
+ ),
322
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
323
+ "button",
324
+ {
325
+ onClick: () => setMobileOpen(true),
326
+ "aria-label": "Open menu",
327
+ className: "md:hidden p-2 transition-opacity hover:opacity-70",
328
+ style: { color: "var(--color-text)" },
329
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
331
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
332
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
333
+ ] })
334
+ }
335
+ )
336
+ ] })
337
+ ] }) })
338
+ }
339
+ ),
340
+ searchOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
341
+ "div",
342
+ {
343
+ className: "fixed inset-0 z-[200] flex items-start justify-center pt-24",
344
+ style: { backgroundColor: "rgba(0,0,0,0.6)" },
345
+ onClick: (e) => {
346
+ if (e.target === e.currentTarget) {
347
+ setSearchOpen(false);
348
+ setSuggestions([]);
349
+ }
350
+ },
351
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full max-w-lg mx-4 rounded-lg overflow-hidden", style: { backgroundColor: "var(--color-background)" }, children: [
352
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: handleSearch, className: "flex items-center px-4 py-3 border-b", style: { borderColor: "#e5e7eb" }, children: [
353
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "mr-3 flex-shrink-0", style: { color: "var(--color-text)", opacity: 0.4 }, children: [
354
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
355
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
356
+ ] }),
357
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
358
+ "input",
359
+ {
360
+ ref: searchRef,
361
+ type: "text",
362
+ value: searchQuery,
363
+ onChange: (e) => setSearchQuery(e.target.value),
364
+ placeholder: "Search products...",
365
+ className: "flex-1 text-sm outline-none bg-transparent",
366
+ style: { color: "var(--color-text)" }
367
+ }
368
+ ),
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
370
+ "button",
371
+ {
372
+ type: "button",
373
+ onClick: () => {
374
+ setSearchOpen(false);
375
+ setSuggestions([]);
376
+ setSearchQuery("");
377
+ },
378
+ className: "p-1 ml-2",
379
+ style: { color: "var(--color-text)", opacity: 0.4 },
380
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
381
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
382
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
383
+ ] })
384
+ }
385
+ )
386
+ ] }),
387
+ suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-h-80 overflow-y-auto", children: suggestions.map((product) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
388
+ import_link.default,
389
+ {
390
+ href: (0, import_storefront_api.getStorePermalink)(domain, `/products/${product.slug}`),
391
+ onClick: () => {
392
+ setSearchOpen(false);
393
+ setSuggestions([]);
394
+ setSearchQuery("");
395
+ },
396
+ className: "flex items-center gap-3 px-4 py-3 transition-colors hover:bg-gray-50",
397
+ children: [
398
+ product.media?.[0]?.url && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: product.media[0].url, alt: product.title, className: "w-10 h-10 object-cover rounded" }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium truncate", style: { color: "var(--color-text)" }, children: product.title }) })
400
+ ]
401
+ },
402
+ product.id
403
+ )) })
404
+ ] })
405
+ }
406
+ ),
407
+ mobileOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "fixed inset-0 z-[200] md:hidden", children: [
408
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
409
+ "div",
410
+ {
411
+ className: "absolute inset-0",
412
+ style: { backgroundColor: "rgba(0,0,0,0.5)" },
413
+ onClick: () => setMobileOpen(false)
414
+ }
415
+ ),
416
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
417
+ "div",
418
+ {
419
+ className: "absolute left-0 top-0 bottom-0 w-[80%] max-w-[320px] flex flex-col",
420
+ style: { backgroundColor: "var(--color-background)" },
421
+ children: [
422
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between px-4 py-4 border-b", style: { borderColor: "#e5e7eb" }, children: [
423
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_storefront_api.getStorePermalink)(domain, "/"), onClick: () => setMobileOpen(false), children: logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logoSrc, alt: storeName, style: { height: "28px", width: "auto" } }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-lg font-bold", style: { color: "var(--color-text)" }, children: storeName }) }),
424
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
425
+ "button",
426
+ {
427
+ onClick: () => setMobileOpen(false),
428
+ "aria-label": "Close menu",
429
+ className: "p-1",
430
+ style: { color: "var(--color-text)" },
431
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
432
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
433
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
434
+ ] })
435
+ }
436
+ )
437
+ ] }),
438
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: "flex-1 overflow-y-auto px-4 py-4", children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
439
+ import_link.default,
440
+ {
441
+ href: (0, import_storefront_api.resolveMenuUrl)(item, domain),
442
+ onClick: () => setMobileOpen(false),
443
+ className: "block py-3 text-sm font-medium border-b transition-opacity hover:opacity-70",
444
+ style: { color: "var(--color-text)", borderColor: "#f3f4f6" },
445
+ children: item.title
446
+ },
447
+ item.id
448
+ )) })
449
+ ]
450
+ }
451
+ )
452
+ ] })
453
+ ] });
454
+ }
455
+ var schema = {
456
+ type: "header",
457
+ name: "Header",
458
+ limit: 1,
459
+ settings: []
460
+ };
461
+
462
+ // src/sections/Announcement.tsx
463
+ var import_storefront_api2 = require("@zevcommerce/storefront-api");
464
+ var import_jsx_runtime2 = require("react/jsx-runtime");
465
+ function Announcement() {
466
+ const { theme: theme2 } = (0, import_storefront_api2.useTheme)();
467
+ const announcement = theme2?.settings?.announcement;
468
+ if (!announcement?.enabled) return null;
469
+ const text = announcement.text || "Free shipping on orders over $50!";
470
+ const backgroundColor = announcement.backgroundColor || "#2563EB";
471
+ const textColor = announcement.textColor || "#ffffff";
472
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
473
+ "div",
474
+ {
475
+ className: "py-2.5 text-center",
476
+ style: { backgroundColor, color: textColor, fontFamily: "var(--font-body)" },
477
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-xs sm:text-sm font-medium px-4", children: text })
478
+ }
479
+ );
480
+ }
481
+ var schema2 = {
482
+ type: "announcement",
483
+ name: "Announcement Bar",
484
+ limit: 1,
485
+ settings: []
486
+ };
487
+
488
+ // src/sections/Hero.tsx
489
+ var import_link2 = __toESM(require("next/link"));
490
+ var import_storefront_api3 = require("@zevcommerce/storefront-api");
491
+ var import_navigation2 = require("next/navigation");
492
+ var import_jsx_runtime3 = require("react/jsx-runtime");
493
+ function Hero() {
494
+ const { theme: theme2, storeConfig } = (0, import_storefront_api3.useTheme)();
495
+ const params = (0, import_navigation2.useParams)();
496
+ const domain = params?.domain || storeConfig?.handle || "";
497
+ const hero = theme2?.settings?.hero;
498
+ if (!hero?.enabled) return null;
499
+ const heading = hero.heading || "Welcome to our store";
500
+ const subheading = hero.subheading || "";
501
+ const buttonText = hero.buttonText || "Shop Now";
502
+ const buttonLink = hero.buttonLink || "/collections/all";
503
+ const overlayOpacity = (hero.overlayOpacity ?? 50) / 100;
504
+ const overlayColor = hero.overlayColor || "#000000";
505
+ const textColor = hero.textColor || "#ffffff";
506
+ const resolveImage = (img) => {
507
+ if (!img) return void 0;
508
+ if (typeof img === "string") return img;
509
+ if (typeof img === "object" && img.url) return img.url;
510
+ return void 0;
511
+ };
512
+ const bgImage = resolveImage(hero.backgroundImage);
513
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
514
+ "section",
515
+ {
516
+ className: "relative flex items-center justify-center min-h-[60vh] md:min-h-[75vh]",
517
+ style: {
518
+ backgroundImage: bgImage ? `url("${bgImage}")` : void 0,
519
+ backgroundSize: "cover",
520
+ backgroundPosition: "center",
521
+ backgroundColor: !bgImage ? "#1f2937" : void 0
522
+ },
523
+ children: [
524
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
525
+ "div",
526
+ {
527
+ className: "absolute inset-0",
528
+ style: { backgroundColor: overlayColor, opacity: overlayOpacity }
529
+ }
530
+ ),
531
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative z-10 container mx-auto px-4 sm:px-6 py-16 text-center", children: [
532
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
533
+ "h1",
534
+ {
535
+ className: "text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold mb-4 leading-tight",
536
+ style: { color: textColor },
537
+ children: heading
538
+ }
539
+ ),
540
+ subheading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
541
+ "p",
542
+ {
543
+ className: "text-base sm:text-lg md:text-xl max-w-2xl mx-auto mb-8 opacity-90",
544
+ style: { color: textColor },
545
+ children: subheading
546
+ }
547
+ ),
548
+ buttonText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
549
+ import_link2.default,
550
+ {
551
+ href: (0, import_storefront_api3.getStorePermalink)(domain, buttonLink),
552
+ className: "btn-primary inline-flex items-center px-6 py-3 sm:px-8 sm:py-3.5 text-sm sm:text-base font-semibold rounded-lg transition-opacity hover:opacity-90",
553
+ style: { backgroundColor: "var(--color-primary)", color: "#ffffff" },
554
+ children: buttonText
555
+ }
556
+ )
557
+ ] })
558
+ ]
559
+ }
560
+ );
561
+ }
562
+ var schema3 = {
563
+ type: "hero",
564
+ name: "Hero Banner",
565
+ limit: 1,
566
+ settings: []
567
+ };
568
+
569
+ // src/sections/FeaturedProducts.tsx
570
+ var import_react2 = require("react");
571
+ var import_link3 = __toESM(require("next/link"));
572
+ var import_storefront_api4 = require("@zevcommerce/storefront-api");
573
+ var import_navigation3 = require("next/navigation");
574
+ var import_jsx_runtime4 = require("react/jsx-runtime");
575
+ function FeaturedProducts() {
576
+ const { theme: theme2, storeConfig } = (0, import_storefront_api4.useTheme)();
577
+ const params = (0, import_navigation3.useParams)();
578
+ const domain = params?.domain || storeConfig?.handle || "";
579
+ const products_settings = theme2?.settings?.products;
580
+ if (!products_settings?.enabled) return null;
581
+ const heading = products_settings.heading || "Featured Products";
582
+ const collectionHandle = products_settings.collection || "all";
583
+ const limit = parseInt(products_settings.limit || "8");
584
+ const columns = parseInt(products_settings.columns || "4");
585
+ const [products, setProducts] = (0, import_react2.useState)([]);
586
+ const [loading, setLoading] = (0, import_react2.useState)(true);
587
+ (0, import_react2.useEffect)(() => {
588
+ async function fetchData() {
589
+ if (!domain || !collectionHandle) {
590
+ setLoading(false);
591
+ return;
592
+ }
593
+ setLoading(true);
594
+ try {
595
+ const collection = await (0, import_storefront_api4.getCollection)(domain, collectionHandle);
596
+ if (collection) {
597
+ const productList = collection.products?.map((p) => p.product || p) || [];
598
+ setProducts(productList.slice(0, limit));
599
+ }
600
+ } catch (error) {
601
+ if (error?.response?.status !== 404) {
602
+ console.error("Error fetching products:", error);
603
+ }
604
+ } finally {
605
+ setLoading(false);
606
+ }
607
+ }
608
+ fetchData();
609
+ }, [domain, collectionHandle, limit]);
610
+ const gridColsMap = {
611
+ 2: "sm:grid-cols-2",
612
+ 3: "sm:grid-cols-2 lg:grid-cols-3",
613
+ 4: "sm:grid-cols-2 lg:grid-cols-4"
614
+ };
615
+ const gridColsClass = gridColsMap[columns] || "sm:grid-cols-2 lg:grid-cols-4";
616
+ if (loading) {
617
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "py-12 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "container mx-auto px-4 sm:px-6", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "animate-pulse", children: [
618
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "h-8 w-48 mb-8 rounded", style: { backgroundColor: "#e5e7eb" } }),
619
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: `grid grid-cols-2 ${gridColsClass} gap-4 sm:gap-6`, children: [...Array(columns)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "aspect-[3/4] rounded-lg", style: { backgroundColor: "#e5e7eb" } }, i)) })
620
+ ] }) }) });
621
+ }
622
+ if (products.length === 0) return null;
623
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "py-12 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "container mx-auto px-4 sm:px-6", children: [
624
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between mb-8", children: [
625
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
626
+ "h2",
627
+ {
628
+ className: "text-2xl md:text-3xl font-bold",
629
+ style: { color: "var(--color-text)" },
630
+ children: heading
631
+ }
632
+ ),
633
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
634
+ import_link3.default,
635
+ {
636
+ href: (0, import_storefront_api4.getStorePermalink)(domain, `/collections/${collectionHandle}`),
637
+ className: "text-sm font-medium transition-opacity hover:opacity-70",
638
+ style: { color: "var(--color-primary)" },
639
+ children: "View All"
640
+ }
641
+ )
642
+ ] }),
643
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: `grid grid-cols-2 ${gridColsClass} gap-4 sm:gap-6`, children: products.map((product) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
644
+ import_storefront_api4.ProductCard,
645
+ {
646
+ product,
647
+ domain
648
+ },
649
+ product.id
650
+ )) })
651
+ ] }) });
652
+ }
653
+ var schema4 = {
654
+ type: "featured-products",
655
+ name: "Featured Products",
656
+ limit: 1,
657
+ settings: []
658
+ };
659
+
660
+ // src/sections/ContactInfo.tsx
661
+ var import_storefront_api5 = require("@zevcommerce/storefront-api");
662
+ var import_jsx_runtime5 = require("react/jsx-runtime");
663
+ function ContactInfo() {
664
+ const { theme: theme2 } = (0, import_storefront_api5.useTheme)();
665
+ const contact = theme2?.settings?.contact;
666
+ if (!contact?.enabled) return null;
667
+ const heading = contact.heading || "Get in Touch";
668
+ const showPhone = contact.showPhone && contact.phone;
669
+ const showEmail = contact.showEmail && contact.email;
670
+ const showWhatsApp = contact.showWhatsApp && contact.whatsapp;
671
+ const showAddress = contact.showAddress && contact.address;
672
+ const hasItems = showPhone || showEmail || showWhatsApp || showAddress;
673
+ if (!hasItems) return null;
674
+ const cards = [];
675
+ if (showPhone) {
676
+ cards.push({
677
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" }) }),
678
+ label: "Phone",
679
+ value: contact.phone,
680
+ href: `tel:${contact.phone}`
681
+ });
682
+ }
683
+ if (showEmail) {
684
+ cards.push({
685
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
686
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
687
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("polyline", { points: "22,6 12,13 2,6" })
688
+ ] }),
689
+ label: "Email",
690
+ value: contact.email,
691
+ href: `mailto:${contact.email}`
692
+ });
693
+ }
694
+ if (showWhatsApp) {
695
+ const waNumber = contact.whatsapp.replace(/[^0-9]/g, "");
696
+ cards.push({
697
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z" }) }),
698
+ label: "WhatsApp",
699
+ value: contact.whatsapp,
700
+ href: `https://wa.me/${waNumber}`
701
+ });
702
+ }
703
+ if (showAddress) {
704
+ cards.push({
705
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
706
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }),
707
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "10", r: "3" })
708
+ ] }),
709
+ label: "Address",
710
+ value: contact.address
711
+ });
712
+ }
713
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("section", { className: "py-12 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "container mx-auto px-4 sm:px-6", children: [
714
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
715
+ "h2",
716
+ {
717
+ className: "text-2xl md:text-3xl font-bold text-center mb-10",
718
+ style: { color: "var(--color-text)" },
719
+ children: heading
720
+ }
721
+ ),
722
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 max-w-4xl mx-auto", children: cards.map((card, i) => {
723
+ const content = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
724
+ "div",
725
+ {
726
+ className: "flex flex-col items-center text-center p-6 rounded-lg border transition-shadow hover:shadow-md",
727
+ style: { borderColor: "#e5e7eb" },
728
+ children: [
729
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
730
+ "div",
731
+ {
732
+ className: "mb-3",
733
+ style: { color: "var(--color-primary)" },
734
+ children: card.icon
735
+ }
736
+ ),
737
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { className: "text-xs font-semibold uppercase tracking-wider mb-1", style: { color: "var(--color-text)", opacity: 0.5 }, children: card.label }),
738
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm font-medium", style: { color: "var(--color-text)" }, children: card.value })
739
+ ]
740
+ },
741
+ i
742
+ );
743
+ if (card.href) {
744
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: card.href, target: card.label === "WhatsApp" ? "_blank" : void 0, rel: "noopener noreferrer", children: content }, i);
745
+ }
746
+ return content;
747
+ }) })
748
+ ] }) });
749
+ }
750
+ var schema5 = {
751
+ type: "contact-info",
752
+ name: "Contact Info",
753
+ limit: 1,
754
+ settings: []
755
+ };
756
+
757
+ // src/sections/Footer.tsx
758
+ var import_link4 = __toESM(require("next/link"));
759
+ var import_storefront_api6 = require("@zevcommerce/storefront-api");
760
+ var import_navigation4 = require("next/navigation");
761
+ var import_jsx_runtime6 = require("react/jsx-runtime");
762
+ function Footer() {
763
+ const { theme: theme2, storeConfig, menus } = (0, import_storefront_api6.useTheme)();
764
+ const params = (0, import_navigation4.useParams)();
765
+ const domain = params?.domain || storeConfig?.handle || "";
766
+ const footer = theme2?.settings?.footer;
767
+ const storeName = storeConfig?.name || "Store";
768
+ const logoSrc = storeConfig?.storeLogo;
769
+ const description = footer?.description || "";
770
+ const menuHandle = footer?.menuHandle || "footer";
771
+ const copyright = footer?.copyright || `${(/* @__PURE__ */ new Date()).getFullYear()} ${storeName}. All rights reserved.`;
772
+ const socialLinks = [];
773
+ if (footer?.instagram) {
774
+ socialLinks.push({
775
+ platform: "Instagram",
776
+ url: footer.instagram,
777
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
778
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", ry: "5" }),
779
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "4" }),
780
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "17.5", cy: "6.5", r: "0.5", fill: "currentColor" })
781
+ ] })
782
+ });
783
+ }
784
+ if (footer?.facebook) {
785
+ socialLinks.push({
786
+ platform: "Facebook",
787
+ url: footer.facebook,
788
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z" }) })
789
+ });
790
+ }
791
+ if (footer?.twitter) {
792
+ socialLinks.push({
793
+ platform: "Twitter",
794
+ url: footer.twitter,
795
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) })
796
+ });
797
+ }
798
+ if (footer?.tiktok) {
799
+ socialLinks.push({
800
+ platform: "TikTok",
801
+ url: footer.tiktok,
802
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M19.59 6.69a4.83 4.83 0 01-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 01-2.88 2.5 2.89 2.89 0 01-2.89-2.89 2.89 2.89 0 012.89-2.89c.28 0 .54.04.79.1V9.01a6.33 6.33 0 00-.79-.05 6.34 6.34 0 00-6.34 6.34 6.34 6.34 0 006.34 6.34 6.34 6.34 0 006.33-6.34V9.04a8.28 8.28 0 004.84 1.55V7.14a4.85 4.85 0 01-1.07-.45z" }) })
803
+ });
804
+ }
805
+ const footerMenu = menus?.[menuHandle];
806
+ const menuItems = footerMenu?.items || [];
807
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
808
+ "footer",
809
+ {
810
+ className: "py-12 md:py-16 border-t",
811
+ style: { backgroundColor: "var(--color-background)", borderColor: "#e5e7eb" },
812
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "container mx-auto px-4 sm:px-6", children: [
813
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-10 md:gap-12", children: [
814
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
815
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_link4.default, { href: (0, import_storefront_api6.getStorePermalink)(domain, "/"), className: "inline-block mb-4", children: logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: logoSrc, alt: storeName, className: "h-8 w-auto object-contain" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-lg font-bold", style: { color: "var(--color-text)" }, children: storeName }) }),
816
+ description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm leading-relaxed max-w-xs", style: { color: "var(--color-text)", opacity: 0.6 }, children: description }),
817
+ socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center gap-4 mt-5", children: socialLinks.map((link, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
818
+ "a",
819
+ {
820
+ href: link.url,
821
+ target: "_blank",
822
+ rel: "noopener noreferrer",
823
+ "aria-label": link.platform,
824
+ className: "transition-opacity hover:opacity-70",
825
+ style: { color: "var(--color-text)", opacity: 0.5 },
826
+ children: link.icon
827
+ },
828
+ i
829
+ )) })
830
+ ] }),
831
+ menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
832
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider mb-4", style: { color: "var(--color-text)" }, children: "Quick Links" }),
833
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "flex flex-col gap-2.5", children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
834
+ import_link4.default,
835
+ {
836
+ href: (0, import_storefront_api6.resolveMenuUrl)(item, domain),
837
+ className: "text-sm transition-opacity hover:opacity-70",
838
+ style: { color: "var(--color-text)", opacity: 0.6 },
839
+ children: item.title
840
+ },
841
+ item.id
842
+ )) })
843
+ ] }),
844
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
845
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider mb-4", style: { color: "var(--color-text)" }, children: "Store" }),
846
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-2.5 text-sm", style: { color: "var(--color-text)", opacity: 0.6 }, children: [
847
+ storeConfig?.email && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: storeConfig.email }),
848
+ storeConfig?.phone && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: storeConfig.phone })
849
+ ] })
850
+ ] })
851
+ ] }),
852
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-12 pt-8 border-t text-center", style: { borderColor: "#e5e7eb" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-xs", style: { color: "var(--color-text)", opacity: 0.4 }, children: [
853
+ "\xA9 ",
854
+ copyright
855
+ ] }) })
856
+ ] })
857
+ }
858
+ );
859
+ }
860
+ var schema6 = {
861
+ type: "footer",
862
+ name: "Footer",
863
+ limit: 1,
864
+ settings: []
865
+ };
866
+
867
+ // src/sections/ProductDetail.tsx
868
+ var import_react3 = require("react");
869
+ var import_link5 = __toESM(require("next/link"));
870
+ var import_storefront_api7 = require("@zevcommerce/storefront-api");
871
+ var import_navigation5 = require("next/navigation");
872
+
873
+ // src/helpers/format-price.ts
874
+ var CURRENCY_LOCALES = {
875
+ USD: "en-US",
876
+ EUR: "de-DE",
877
+ GBP: "en-GB",
878
+ NGN: "en-NG",
879
+ GHS: "en-GH",
880
+ KES: "en-KE",
881
+ ZAR: "en-ZA",
882
+ CAD: "en-CA",
883
+ AUD: "en-AU",
884
+ JPY: "ja-JP",
885
+ INR: "en-IN",
886
+ BRL: "pt-BR",
887
+ MXN: "es-MX",
888
+ AED: "ar-AE",
889
+ SAR: "ar-SA",
890
+ XOF: "fr-SN",
891
+ XAF: "fr-CM",
892
+ TZS: "en-TZ",
893
+ UGX: "en-UG",
894
+ RWF: "en-RW"
895
+ };
896
+ function formatPrice(amount, currency = "NGN") {
897
+ const value = typeof amount === "string" ? parseFloat(amount) : amount;
898
+ if (isNaN(value)) return `${currency} 0.00`;
899
+ const locale = CURRENCY_LOCALES[currency] || "en-US";
900
+ try {
901
+ return new Intl.NumberFormat(locale, {
902
+ style: "currency",
903
+ currency,
904
+ minimumFractionDigits: 2,
905
+ maximumFractionDigits: 2
906
+ }).format(value);
907
+ } catch {
908
+ return `${currency} ${value.toFixed(2)}`;
909
+ }
910
+ }
911
+
912
+ // src/sections/ProductDetail.tsx
913
+ var import_jsx_runtime7 = require("react/jsx-runtime");
914
+ function ProductDetail() {
915
+ const { theme: theme2, storeConfig } = (0, import_storefront_api7.useTheme)();
916
+ const { product, selectedVariant, quantity, setQuantity, setSelectedVariant } = (0, import_storefront_api7.useProduct)();
917
+ const { addItem, openCart } = (0, import_storefront_api7.useCartStore)();
918
+ const params = (0, import_navigation5.useParams)();
919
+ const domain = params?.domain || storeConfig?.handle || "";
920
+ const currency = storeConfig?.currency || "NGN";
921
+ const [activeImageIndex, setActiveImageIndex] = (0, import_react3.useState)(0);
922
+ const [addedToCart, setAddedToCart] = (0, import_react3.useState)(false);
923
+ (0, import_react3.useEffect)(() => {
924
+ setActiveImageIndex(0);
925
+ setAddedToCart(false);
926
+ }, [product?.id]);
927
+ if (!product) {
928
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "py-24 text-center", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm", style: { color: "var(--color-text)", opacity: 0.5 }, children: "Product not found" }) });
929
+ }
930
+ const images = product.media || [];
931
+ const variants = product.variants || [];
932
+ const hasVariants = variants.length > 1;
933
+ const currentVariant = selectedVariant || variants[0];
934
+ const price = parseFloat(currentVariant?.price || product.price || "0");
935
+ const compareAtPrice = parseFloat(currentVariant?.compareAtPrice || product.compareAtPrice || "0");
936
+ const isOnSale = compareAtPrice > 0 && compareAtPrice > price;
937
+ const optionGroups = {};
938
+ variants.forEach((v) => {
939
+ (v.options || []).forEach((opt) => {
940
+ if (!optionGroups[opt.name]) optionGroups[opt.name] = [];
941
+ if (!optionGroups[opt.name].includes(opt.value)) {
942
+ optionGroups[opt.name].push(opt.value);
943
+ }
944
+ });
945
+ });
946
+ const handleAddToCart = () => {
947
+ if (!currentVariant) return;
948
+ addItem({
949
+ variantId: currentVariant.id,
950
+ productId: product.id,
951
+ title: product.title,
952
+ variantTitle: currentVariant.title || "",
953
+ price: currentVariant.price,
954
+ quantity,
955
+ image: images[0]?.url || "",
956
+ slug: product.slug
957
+ });
958
+ setAddedToCart(true);
959
+ openCart();
960
+ setTimeout(() => setAddedToCart(false), 2e3);
961
+ };
962
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("section", { className: "py-8 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "container mx-auto px-4 sm:px-6 max-w-6xl", children: [
963
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "flex items-center gap-2 text-xs mb-8", style: { color: "var(--color-text)", opacity: 0.5 }, children: [
964
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_link5.default, { href: (0, import_storefront_api7.getStorePermalink)(domain, "/"), className: "hover:opacity-70 transition-opacity", children: "Home" }),
965
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "/" }),
966
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_link5.default, { href: (0, import_storefront_api7.getStorePermalink)(domain, "/collections/all"), className: "hover:opacity-70 transition-opacity", children: "Products" }),
967
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "/" }),
968
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { opacity: 1, color: "var(--color-text)" }, children: product.title })
969
+ ] }),
970
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12", children: [
971
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
972
+ images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative aspect-square mb-3 rounded-lg overflow-hidden", style: { backgroundColor: "#f3f4f6" }, children: [
973
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
974
+ "img",
975
+ {
976
+ src: images[activeImageIndex]?.url,
977
+ alt: product.title,
978
+ className: "w-full h-full object-cover"
979
+ }
980
+ ),
981
+ isOnSale && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
982
+ "span",
983
+ {
984
+ className: "absolute top-3 left-3 text-xs font-semibold px-2.5 py-1 rounded",
985
+ style: { backgroundColor: "#ef4444", color: "#fff" },
986
+ children: "Sale"
987
+ }
988
+ )
989
+ ] }),
990
+ images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex gap-2 overflow-x-auto", children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
991
+ "button",
992
+ {
993
+ onClick: () => setActiveImageIndex(i),
994
+ className: "flex-shrink-0 w-16 h-16 rounded overflow-hidden border-2 transition-colors",
995
+ style: {
996
+ borderColor: i === activeImageIndex ? "var(--color-primary)" : "transparent"
997
+ },
998
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: img.url, alt: "", className: "w-full h-full object-cover" })
999
+ },
1000
+ i
1001
+ )) })
1002
+ ] }),
1003
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lg:sticky lg:top-24 lg:self-start", children: [
1004
+ product.vendor && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs font-medium uppercase tracking-wider mb-2", style: { color: "var(--color-primary)" }, children: product.vendor }),
1005
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1006
+ "h1",
1007
+ {
1008
+ className: "text-2xl md:text-3xl font-bold mb-3",
1009
+ style: { color: "var(--color-text)" },
1010
+ children: product.title
1011
+ }
1012
+ ),
1013
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [
1014
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-xl font-bold", style: { color: "var(--color-text)" }, children: formatPrice(price, currency) }),
1015
+ isOnSale && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-base line-through", style: { color: "var(--color-text)", opacity: 0.4 }, children: formatPrice(compareAtPrice, currency) })
1016
+ ] }),
1017
+ hasVariants && Object.entries(optionGroups).map(([optionName, values]) => {
1018
+ const currentValue = currentVariant?.options?.find((o) => o.name === optionName)?.value;
1019
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mb-5", children: [
1020
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "block text-sm font-medium mb-2", style: { color: "var(--color-text)" }, children: [
1021
+ optionName,
1022
+ ": ",
1023
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-normal", children: currentValue })
1024
+ ] }),
1025
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-wrap gap-2", children: values.map((val) => {
1026
+ const isSelected = currentValue === val;
1027
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1028
+ "button",
1029
+ {
1030
+ onClick: () => {
1031
+ const match = variants.find(
1032
+ (v) => v.options?.some((o) => o.name === optionName && o.value === val)
1033
+ );
1034
+ if (match) setSelectedVariant(match);
1035
+ },
1036
+ className: "px-4 py-2 text-sm border rounded transition-colors",
1037
+ style: {
1038
+ backgroundColor: isSelected ? "var(--color-primary)" : "transparent",
1039
+ color: isSelected ? "#fff" : "var(--color-text)",
1040
+ borderColor: isSelected ? "var(--color-primary)" : "#d1d5db"
1041
+ },
1042
+ children: val
1043
+ },
1044
+ val
1045
+ );
1046
+ }) })
1047
+ ] }, optionName);
1048
+ }),
1049
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mb-6", children: [
1050
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { className: "block text-sm font-medium mb-2", style: { color: "var(--color-text)" }, children: "Quantity" }),
1051
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "inline-flex items-center border rounded", style: { borderColor: "#d1d5db" }, children: [
1052
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1053
+ "button",
1054
+ {
1055
+ onClick: () => setQuantity(Math.max(1, quantity - 1)),
1056
+ className: "px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
1057
+ style: { color: "var(--color-text)" },
1058
+ children: "-"
1059
+ }
1060
+ ),
1061
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "px-4 py-2 text-sm font-medium", style: { color: "var(--color-text)" }, children: quantity }),
1062
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1063
+ "button",
1064
+ {
1065
+ onClick: () => setQuantity(quantity + 1),
1066
+ className: "px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
1067
+ style: { color: "var(--color-text)" },
1068
+ children: "+"
1069
+ }
1070
+ )
1071
+ ] })
1072
+ ] }),
1073
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1074
+ "button",
1075
+ {
1076
+ onClick: handleAddToCart,
1077
+ className: "w-full py-3.5 text-sm font-semibold rounded-lg transition-opacity hover:opacity-90",
1078
+ style: { backgroundColor: "var(--color-primary)", color: "#fff" },
1079
+ children: addedToCart ? "Added!" : "Add to Cart"
1080
+ }
1081
+ ),
1082
+ product.description && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mt-8 pt-8 border-t", style: { borderColor: "#e5e7eb" }, children: [
1083
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { className: "text-sm font-semibold mb-3", style: { color: "var(--color-text)" }, children: "Description" }),
1084
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1085
+ "div",
1086
+ {
1087
+ className: "text-sm leading-relaxed prose prose-sm max-w-none",
1088
+ style: { color: "var(--color-text)", opacity: 0.7 },
1089
+ dangerouslySetInnerHTML: { __html: product.description }
1090
+ }
1091
+ )
1092
+ ] })
1093
+ ] })
1094
+ ] })
1095
+ ] }) });
1096
+ }
1097
+ var schema7 = {
1098
+ type: "product-detail",
1099
+ name: "Product Detail",
1100
+ settings: [],
1101
+ disabled_on: { templates: ["*"] },
1102
+ enabled_on: { templates: ["product_detail"] }
1103
+ };
1104
+
1105
+ // src/sections/ProductList.tsx
1106
+ var import_storefront_api8 = require("@zevcommerce/storefront-api");
1107
+ var import_navigation6 = require("next/navigation");
1108
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1109
+ function ProductList() {
1110
+ const { storeConfig } = (0, import_storefront_api8.useTheme)();
1111
+ const { collection } = (0, import_storefront_api8.useCollection)();
1112
+ const params = (0, import_navigation6.useParams)();
1113
+ const domain = params?.domain || storeConfig?.handle || "";
1114
+ if (!collection) {
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "py-24 text-center", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "animate-pulse flex flex-col items-center", children: [
1116
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-8 w-48 rounded mb-4", style: { backgroundColor: "#e5e7eb" } }),
1117
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-4 w-full max-w-6xl mx-auto px-4", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "aspect-[3/4] rounded-lg", style: { backgroundColor: "#e5e7eb" } }, i)) })
1118
+ ] }) });
1119
+ }
1120
+ const products = collection.products?.map((p) => p.product || p) || [];
1121
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("section", { className: "py-8 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "container mx-auto px-4 sm:px-6 max-w-6xl", children: [
1122
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mb-8 md:mb-10", children: [
1123
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1124
+ "h1",
1125
+ {
1126
+ className: "text-2xl md:text-3xl font-bold mb-2",
1127
+ style: { color: "var(--color-text)" },
1128
+ children: collection.title
1129
+ }
1130
+ ),
1131
+ collection.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm max-w-2xl", style: { color: "var(--color-text)", opacity: 0.6 }, children: collection.description })
1132
+ ] }),
1133
+ products.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6", children: products.map((product) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1134
+ import_storefront_api8.ProductCard,
1135
+ {
1136
+ product,
1137
+ domain
1138
+ },
1139
+ product.id
1140
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "py-16 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm", style: { color: "var(--color-text)", opacity: 0.5 }, children: "No products found in this collection." }) })
1141
+ ] }) });
1142
+ }
1143
+ var schema8 = {
1144
+ type: "product-list",
1145
+ name: "Product List",
1146
+ settings: [],
1147
+ disabled_on: { templates: ["*"] },
1148
+ enabled_on: { templates: ["collection"] }
1149
+ };
1150
+
1151
+ // src/sections/CartSection.tsx
1152
+ var import_link6 = __toESM(require("next/link"));
1153
+ var import_storefront_api9 = require("@zevcommerce/storefront-api");
1154
+ var import_navigation7 = require("next/navigation");
1155
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1156
+ function CartSection() {
1157
+ const { storeConfig } = (0, import_storefront_api9.useTheme)();
1158
+ const { items, totalPrice, removeItem, updateQuantity } = (0, import_storefront_api9.useCartStore)();
1159
+ const params = (0, import_navigation7.useParams)();
1160
+ const domain = params?.domain || storeConfig?.handle || "";
1161
+ const currency = storeConfig?.currency || "NGN";
1162
+ const total = typeof totalPrice === "function" ? totalPrice() : totalPrice;
1163
+ if (items.length === 0) {
1164
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "py-24 text-center", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "container mx-auto px-4 sm:px-6", children: [
1165
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1166
+ "div",
1167
+ {
1168
+ className: "w-16 h-16 mx-auto mb-6 rounded-full flex items-center justify-center",
1169
+ style: { backgroundColor: "#f3f4f6" },
1170
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", style: { color: "var(--color-text)", opacity: 0.4 }, children: [
1171
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z" }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
1173
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M16 10a4 4 0 01-8 0" })
1174
+ ] })
1175
+ }
1176
+ ),
1177
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h1", { className: "text-xl font-bold mb-2", style: { color: "var(--color-text)" }, children: "Your cart is empty" }),
1178
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm mb-6", style: { color: "var(--color-text)", opacity: 0.5 }, children: "Start browsing to add items to your cart." }),
1179
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1180
+ import_link6.default,
1181
+ {
1182
+ href: (0, import_storefront_api9.getStorePermalink)(domain, "/collections/all"),
1183
+ className: "btn-primary",
1184
+ children: "Browse Products"
1185
+ }
1186
+ )
1187
+ ] }) });
1188
+ }
1189
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", { className: "py-8 md:py-16", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "container mx-auto px-4 sm:px-6 max-w-4xl", children: [
1190
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h1", { className: "text-2xl md:text-3xl font-bold mb-8", style: { color: "var(--color-text)" }, children: [
1191
+ "Your Cart",
1192
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-base font-normal ml-2", style: { opacity: 0.5 }, children: [
1193
+ "(",
1194
+ items.length,
1195
+ " ",
1196
+ items.length === 1 ? "item" : "items",
1197
+ ")"
1198
+ ] })
1199
+ ] }),
1200
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "divide-y", style: { borderColor: "#e5e7eb" }, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-4 py-6", children: [
1201
+ item.image && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1202
+ import_link6.default,
1203
+ {
1204
+ href: (0, import_storefront_api9.getStorePermalink)(domain, `/products/${item.slug}`),
1205
+ className: "flex-shrink-0",
1206
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1207
+ "img",
1208
+ {
1209
+ src: item.image,
1210
+ alt: item.title,
1211
+ className: "w-20 h-20 sm:w-24 sm:h-24 object-cover rounded-lg"
1212
+ }
1213
+ )
1214
+ }
1215
+ ),
1216
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
1217
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1218
+ import_link6.default,
1219
+ {
1220
+ href: (0, import_storefront_api9.getStorePermalink)(domain, `/products/${item.slug}`),
1221
+ className: "text-sm font-medium hover:opacity-70 transition-opacity",
1222
+ style: { color: "var(--color-text)" },
1223
+ children: item.title
1224
+ }
1225
+ ),
1226
+ item.variantTitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs mt-1", style: { color: "var(--color-text)", opacity: 0.5 }, children: item.variantTitle }),
1227
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-semibold mt-2", style: { color: "var(--color-text)" }, children: formatPrice(parseFloat(item.price) * item.quantity, currency) }),
1228
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 mt-3", children: [
1229
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "inline-flex items-center border rounded text-sm", style: { borderColor: "#d1d5db" }, children: [
1230
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1231
+ "button",
1232
+ {
1233
+ onClick: () => updateQuantity(item.variantId, -1),
1234
+ className: "px-2.5 py-1 hover:bg-gray-50 transition-colors",
1235
+ style: { color: "var(--color-text)" },
1236
+ children: "-"
1237
+ }
1238
+ ),
1239
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "px-3 py-1", style: { color: "var(--color-text)" }, children: item.quantity }),
1240
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1241
+ "button",
1242
+ {
1243
+ onClick: () => updateQuantity(item.variantId, 1),
1244
+ className: "px-2.5 py-1 hover:bg-gray-50 transition-colors",
1245
+ style: { color: "var(--color-text)" },
1246
+ children: "+"
1247
+ }
1248
+ )
1249
+ ] }),
1250
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1251
+ "button",
1252
+ {
1253
+ onClick: () => removeItem(item.variantId),
1254
+ className: "text-xs font-medium transition-opacity hover:opacity-70",
1255
+ style: { color: "#ef4444" },
1256
+ children: "Remove"
1257
+ }
1258
+ )
1259
+ ] })
1260
+ ] })
1261
+ ] }, item.variantId)) }),
1262
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-8 pt-6 border-t", style: { borderColor: "#e5e7eb" }, children: [
1263
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [
1264
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-base font-semibold", style: { color: "var(--color-text)" }, children: "Total" }),
1265
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-lg font-bold", style: { color: "var(--color-text)" }, children: formatPrice(total, currency) })
1266
+ ] }),
1267
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1268
+ import_link6.default,
1269
+ {
1270
+ href: (0, import_storefront_api9.getStorePermalink)(domain, "/checkout"),
1271
+ className: "btn-primary w-full text-center block py-3.5",
1272
+ children: "Proceed to Checkout"
1273
+ }
1274
+ )
1275
+ ] })
1276
+ ] }) });
1277
+ }
1278
+ var schema9 = {
1279
+ type: "cart-page",
1280
+ name: "Cart Page",
1281
+ settings: [],
1282
+ disabled_on: { templates: ["*"] },
1283
+ enabled_on: { templates: ["cart"] }
1284
+ };
1285
+
1286
+ // src/sections/CheckoutSection.tsx
1287
+ var import_storefront_api10 = require("@zevcommerce/storefront-api");
1288
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1289
+ function CheckoutSection() {
1290
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "min-h-screen", style: { backgroundColor: "var(--color-background)" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "container mx-auto px-4 sm:px-6 py-8 md:py-16 max-w-4xl", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_storefront_api10.CheckoutForm, {}) }) });
1291
+ }
1292
+ var schema10 = {
1293
+ type: "checkout-page",
1294
+ name: "Checkout Page",
1295
+ settings: [],
1296
+ disabled_on: { templates: ["*"] },
1297
+ enabled_on: { templates: ["checkout"] }
1298
+ };
1299
+
1300
+ // src/registry.ts
1301
+ var starterSectionRegistry = {
1302
+ "header": { component: Header, schema },
1303
+ "announcement": { component: Announcement, schema: schema2 },
1304
+ "hero": { component: Hero, schema: schema3 },
1305
+ "featured-products": { component: FeaturedProducts, schema: schema4 },
1306
+ "contact-info": { component: ContactInfo, schema: schema5 },
1307
+ "footer": { component: Footer, schema: schema6 },
1308
+ "product-detail": { component: ProductDetail, schema: schema7 },
1309
+ "product-list": { component: ProductList, schema: schema8 },
1310
+ "cart-page": { component: CartSection, schema: schema9 },
1311
+ "checkout-page": { component: CheckoutSection, schema: schema10 }
1312
+ };
1313
+ var starterBlockRegistry = {};
1314
+
1315
+ // src/preset.json
1316
+ var preset_default = {
1317
+ name: "Starter",
1318
+ settings: {
1319
+ brand: {
1320
+ primary: "#2563EB",
1321
+ background: "#ffffff",
1322
+ text: "#374151",
1323
+ accent: "#F59E0B",
1324
+ font: "Inter"
1325
+ },
1326
+ header: {
1327
+ logo: null,
1328
+ logoHeight: 36,
1329
+ sticky: true,
1330
+ showSearch: true,
1331
+ menuHandle: "main-menu"
1332
+ },
1333
+ hero: {
1334
+ enabled: true,
1335
+ backgroundImage: null,
1336
+ heading: "Welcome to our store",
1337
+ subheading: "Discover amazing products at great prices.",
1338
+ buttonText: "Shop Now",
1339
+ buttonLink: "/collections/all",
1340
+ overlayOpacity: 50,
1341
+ overlayColor: "#000000",
1342
+ textColor: "#ffffff"
1343
+ },
1344
+ products: {
1345
+ enabled: true,
1346
+ heading: "Featured Products",
1347
+ collection: "all",
1348
+ limit: 8,
1349
+ columns: "4"
1350
+ },
1351
+ contact: {
1352
+ enabled: false,
1353
+ heading: "Get in Touch",
1354
+ showPhone: true,
1355
+ phone: "",
1356
+ showEmail: true,
1357
+ email: "",
1358
+ showWhatsApp: false,
1359
+ whatsapp: "",
1360
+ showAddress: false,
1361
+ address: ""
1362
+ },
1363
+ footer: {
1364
+ description: "",
1365
+ menuHandle: "footer",
1366
+ copyright: "",
1367
+ instagram: "",
1368
+ facebook: "",
1369
+ twitter: "",
1370
+ tiktok: ""
1371
+ },
1372
+ announcement: {
1373
+ enabled: false,
1374
+ text: "Free shipping on orders over $50!",
1375
+ backgroundColor: "#2563EB",
1376
+ textColor: "#ffffff"
1377
+ }
1378
+ },
1379
+ sections: {
1380
+ announcement_1: {
1381
+ type: "announcement",
1382
+ settings: {}
1383
+ },
1384
+ header_1: {
1385
+ type: "header",
1386
+ settings: {}
1387
+ },
1388
+ hero_1: {
1389
+ type: "hero",
1390
+ settings: {}
1391
+ },
1392
+ featured_products_1: {
1393
+ type: "featured-products",
1394
+ settings: {}
1395
+ },
1396
+ contact_info_1: {
1397
+ type: "contact-info",
1398
+ settings: {}
1399
+ },
1400
+ footer_1: {
1401
+ type: "footer",
1402
+ settings: {}
1403
+ },
1404
+ "main-product": {
1405
+ type: "product-detail",
1406
+ settings: {}
1407
+ },
1408
+ "main-collection": {
1409
+ type: "product-list",
1410
+ settings: {}
1411
+ },
1412
+ "main-cart": {
1413
+ type: "cart-page",
1414
+ settings: {}
1415
+ },
1416
+ "main-checkout": {
1417
+ type: "checkout-page",
1418
+ settings: {}
1419
+ }
1420
+ },
1421
+ layout: {
1422
+ header: [
1423
+ "announcement_1",
1424
+ "header_1"
1425
+ ],
1426
+ content: [
1427
+ "hero_1",
1428
+ "featured_products_1",
1429
+ "contact_info_1"
1430
+ ],
1431
+ footer: [
1432
+ "footer_1"
1433
+ ]
1434
+ },
1435
+ templates: {
1436
+ product_detail: { order: ["main-product"] },
1437
+ collection: { order: ["main-collection"] },
1438
+ cart: { order: ["main-cart"] },
1439
+ checkout: { order: ["main-checkout"] }
1440
+ }
1441
+ };
1442
+
1443
+ // src/index.ts
1444
+ var theme = (0, import_theme_sdk2.defineTheme)({
1445
+ handle: "starter",
1446
+ name: "Starter",
1447
+ version: "1.0.0",
1448
+ author: {
1449
+ name: "ZevCommerce",
1450
+ url: "https://zevcommerce.com"
1451
+ },
1452
+ description: "A simple, mobile-first theme for ZevCommerce \u2014 perfect for getting started quickly.",
1453
+ tags: ["simple", "mobile-first", "starter", "minimal", "responsive"],
1454
+ settingsSchema,
1455
+ defaultPreset: preset_default,
1456
+ registry: {
1457
+ sections: starterSectionRegistry,
1458
+ blocks: starterBlockRegistry
1459
+ }
1460
+ });
1461
+ var index_default = theme;
1462
+ // Annotate the CommonJS export names for ESM import in node:
1463
+ 0 && (module.exports = {
1464
+ settingsSchema,
1465
+ starterBlockRegistry,
1466
+ starterSectionRegistry
1467
+ });
1468
+ //# sourceMappingURL=index.js.map