@cimplify/sdk 0.39.0 → 0.40.0

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.
Files changed (72) hide show
  1. package/dist/dispatcher.mjs +39 -5
  2. package/dist/styles.css +1 -1
  3. package/package.json +1 -1
  4. package/templates/{storefront → storefront-bakery}/README.md +8 -1
  5. package/templates/storefront-bakery/app/about/page.tsx +61 -0
  6. package/templates/storefront-bakery/app/categories/[slug]/listing-client.tsx +19 -0
  7. package/templates/{storefront → storefront-bakery}/app/categories/[slug]/page.tsx +42 -10
  8. package/templates/storefront-bakery/app/collections/[slug]/listing-client.tsx +20 -0
  9. package/templates/{storefront → storefront-bakery}/app/collections/[slug]/page.tsx +42 -10
  10. package/templates/storefront-bakery/app/faq/page.tsx +122 -0
  11. package/templates/{storefront → storefront-bakery}/app/page.tsx +39 -6
  12. package/templates/storefront-bakery/app/privacy/page.tsx +88 -0
  13. package/templates/storefront-bakery/app/terms/page.tsx +102 -0
  14. package/templates/storefront-bakery/components/cart-pill.tsx +32 -0
  15. package/templates/storefront-bakery/components/footer.tsx +190 -0
  16. package/templates/storefront-bakery/components/header.tsx +51 -0
  17. package/templates/storefront-bakery/components/nav-link.tsx +20 -0
  18. package/templates/{storefront → storefront-bakery}/components/store-product-card.tsx +9 -25
  19. package/templates/{storefront → storefront-bakery}/next.config.ts +3 -4
  20. package/templates/{storefront → storefront-bakery}/package.json +1 -1
  21. package/templates/storefront-retail/.env.example +11 -0
  22. package/templates/storefront-retail/README.md +77 -0
  23. package/templates/storefront-retail/app/about/page.tsx +71 -0
  24. package/templates/storefront-retail/app/cart/page.tsx +9 -0
  25. package/templates/storefront-retail/app/categories/[slug]/listing-client.tsx +19 -0
  26. package/templates/storefront-retail/app/categories/[slug]/page.tsx +117 -0
  27. package/templates/storefront-retail/app/checkout/page.tsx +17 -0
  28. package/templates/storefront-retail/app/collections/[slug]/listing-client.tsx +20 -0
  29. package/templates/storefront-retail/app/collections/[slug]/page.tsx +117 -0
  30. package/templates/storefront-retail/app/faq/page.tsx +127 -0
  31. package/templates/storefront-retail/app/globals.css +47 -0
  32. package/templates/storefront-retail/app/layout.tsx +46 -0
  33. package/templates/storefront-retail/app/orders/[id]/page.tsx +24 -0
  34. package/templates/storefront-retail/app/page.tsx +97 -0
  35. package/templates/storefront-retail/app/privacy/page.tsx +101 -0
  36. package/templates/storefront-retail/app/shop/page.tsx +30 -0
  37. package/templates/storefront-retail/app/shop/shop-client.tsx +27 -0
  38. package/templates/storefront-retail/app/terms/page.tsx +117 -0
  39. package/templates/storefront-retail/components/cart-pill.tsx +32 -0
  40. package/templates/storefront-retail/components/category-grid.tsx +28 -0
  41. package/templates/storefront-retail/components/collection-strip.tsx +45 -0
  42. package/templates/storefront-retail/components/footer.tsx +188 -0
  43. package/templates/storefront-retail/components/header.tsx +47 -0
  44. package/templates/storefront-retail/components/hero.tsx +28 -0
  45. package/templates/storefront-retail/components/nav-link.tsx +20 -0
  46. package/templates/storefront-retail/components/product-modal.tsx +105 -0
  47. package/templates/storefront-retail/components/providers.tsx +31 -0
  48. package/templates/storefront-retail/components/store-product-card.tsx +83 -0
  49. package/templates/storefront-retail/lib/cart.ts +27 -0
  50. package/templates/storefront-retail/next.config.ts +40 -0
  51. package/templates/storefront-retail/package.json +28 -0
  52. package/templates/storefront-retail/postcss.config.mjs +7 -0
  53. package/templates/storefront-retail/tsconfig.json +23 -0
  54. package/templates/storefront/components/footer.tsx +0 -19
  55. package/templates/storefront/components/header.tsx +0 -41
  56. package/templates/storefront/lib/server-client.ts +0 -27
  57. /package/templates/{storefront → storefront-bakery}/.env.example +0 -0
  58. /package/templates/{storefront → storefront-bakery}/app/cart/page.tsx +0 -0
  59. /package/templates/{storefront → storefront-bakery}/app/checkout/page.tsx +0 -0
  60. /package/templates/{storefront → storefront-bakery}/app/globals.css +0 -0
  61. /package/templates/{storefront → storefront-bakery}/app/layout.tsx +0 -0
  62. /package/templates/{storefront → storefront-bakery}/app/orders/[id]/page.tsx +0 -0
  63. /package/templates/{storefront → storefront-bakery}/app/shop/page.tsx +0 -0
  64. /package/templates/{storefront → storefront-bakery}/app/shop/shop-client.tsx +0 -0
  65. /package/templates/{storefront → storefront-bakery}/components/category-grid.tsx +0 -0
  66. /package/templates/{storefront → storefront-bakery}/components/collection-strip.tsx +0 -0
  67. /package/templates/{storefront → storefront-bakery}/components/hero.tsx +0 -0
  68. /package/templates/{storefront → storefront-bakery}/components/product-modal.tsx +0 -0
  69. /package/templates/{storefront → storefront-bakery}/components/providers.tsx +0 -0
  70. /package/templates/{storefront → storefront-bakery}/lib/cart.ts +0 -0
  71. /package/templates/{storefront → storefront-bakery}/postcss.config.mjs +0 -0
  72. /package/templates/{storefront → storefront-bakery}/tsconfig.json +0 -0
@@ -1,41 +0,0 @@
1
- "use client";
2
-
3
- import Link from "next/link";
4
- import { usePathname } from "next/navigation";
5
- import { useCartCount } from "@/lib/cart";
6
-
7
- const TAGLINE = "ACCRA · SINCE 2018";
8
-
9
- function navLinkClass(active: boolean) {
10
- return [
11
- "text-[13px] font-medium tracking-wide transition-colors",
12
- active ? "text-primary" : "text-muted-foreground hover:text-foreground",
13
- ].join(" ");
14
- }
15
-
16
- export function Header() {
17
- const pathname = usePathname();
18
- const { count } = useCartCount();
19
- return (
20
- <header className="sticky top-0 z-30 flex items-center justify-between px-8 py-4 border-b border-border bg-background/90 backdrop-blur-md">
21
- <Link href="/" className="flex items-baseline gap-2">
22
- <span className="font-serif text-[22px] font-semibold -tracking-[0.02em]">
23
- Akua's Bakery
24
- </span>
25
- <span className="text-[11px] font-medium uppercase tracking-[0.12em] text-muted-foreground">
26
- {TAGLINE}
27
- </span>
28
- </Link>
29
- <nav className="flex items-center gap-6">
30
- <Link href="/" className={navLinkClass(pathname === "/")}>Home</Link>
31
- <Link href="/shop" className={navLinkClass(pathname === "/shop")}>Shop</Link>
32
- <Link
33
- href="/cart"
34
- className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-foreground text-background text-xs font-semibold tracking-wide transition-transform hover:scale-105"
35
- >
36
- Cart · {count}
37
- </Link>
38
- </nav>
39
- </header>
40
- );
41
- }
@@ -1,27 +0,0 @@
1
- import { createCimplifyClient, type CimplifyClient } from "@cimplify/sdk";
2
-
3
- /**
4
- * Server-side Cimplify client. Used by Server Components to fetch catalogue
5
- * data during SSR/RSC for SEO-friendly product/category/collection pages.
6
- *
7
- * Cached per-request via React's cache mechanism — calling this multiple
8
- * times within the same request returns the same client instance.
9
- *
10
- * Base-URL resolution:
11
- * 1) NEXT_PUBLIC_CIMPLIFY_API_URL (matches the client-side default)
12
- * 2) http://127.0.0.1:8787 — the local mock during dev
13
- */
14
- let cached: CimplifyClient | undefined;
15
-
16
- export function getServerClient(): CimplifyClient {
17
- if (cached) return cached;
18
- const baseUrl =
19
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() || "http://127.0.0.1:8787";
20
- const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY ?? "mock-dev";
21
- cached = createCimplifyClient({
22
- baseUrl,
23
- publicKey,
24
- suppressPublicKeyWarning: true,
25
- });
26
- return cached;
27
- }