@hszrdm/create-commerce 1.1.0 → 1.3.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 (54) hide show
  1. package/package.json +2 -2
  2. package/src/cli.mjs +5 -2
  3. package/templates/backend/.env.example +45 -0
  4. package/templates/backend/package.json +1 -1
  5. package/templates/storefront/README.md +14 -1
  6. package/templates/storefront/src/app/[countryCode]/products/[handle]/page.tsx +43 -9
  7. package/templates/storefront/src/app/account/page.tsx +12 -1
  8. package/templates/storefront/src/app/account/wishlist/page.tsx +9 -0
  9. package/templates/storefront/src/app/blog/[slug]/page.tsx +36 -0
  10. package/templates/storefront/src/app/blog/page.tsx +25 -0
  11. package/templates/storefront/src/app/contact/page.tsx +25 -0
  12. package/templates/storefront/src/app/core-ux.css +244 -0
  13. package/templates/storefront/src/app/customer-capabilities.css +60 -0
  14. package/templates/storefront/src/app/knowledge-base/[slug]/page.tsx +35 -0
  15. package/templates/storefront/src/app/knowledge-base/page.tsx +25 -0
  16. package/templates/storefront/src/app/layout.tsx +40 -12
  17. package/templates/storefront/src/app/newsletter/confirm/page.tsx +19 -0
  18. package/templates/storefront/src/app/newsletter/unsubscribe/page.tsx +19 -0
  19. package/templates/storefront/src/app/pages/[slug]/page.tsx +35 -0
  20. package/templates/storefront/src/app/quote-request/page.tsx +20 -0
  21. package/templates/storefront/src/components/accessibility-preferences.tsx +126 -0
  22. package/templates/storefront/src/components/accessible-dialog.tsx +88 -0
  23. package/templates/storefront/src/components/accessible-dropdown.tsx +98 -0
  24. package/templates/storefront/src/components/account-wishlist.tsx +95 -0
  25. package/templates/storefront/src/components/add-to-cart.tsx +110 -15
  26. package/templates/storefront/src/components/back-to-top.tsx +26 -0
  27. package/templates/storefront/src/components/breadcrumbs.tsx +26 -0
  28. package/templates/storefront/src/components/cart-view.tsx +72 -16
  29. package/templates/storefront/src/components/cms-content.tsx +75 -0
  30. package/templates/storefront/src/components/form-ux.tsx +47 -0
  31. package/templates/storefront/src/components/free-shipping-progress.tsx +35 -0
  32. package/templates/storefront/src/components/lead-form.tsx +203 -0
  33. package/templates/storefront/src/components/newsletter-action.tsx +66 -0
  34. package/templates/storefront/src/components/newsletter-signup.tsx +107 -0
  35. package/templates/storefront/src/components/product-gallery.tsx +64 -0
  36. package/templates/storefront/src/components/product-reviews.tsx +150 -0
  37. package/templates/storefront/src/components/quantity-stepper.tsx +41 -0
  38. package/templates/storefront/src/components/quote-request-form.tsx +212 -0
  39. package/templates/storefront/src/components/share-button.tsx +63 -0
  40. package/templates/storefront/src/components/storefront-header.tsx +72 -18
  41. package/templates/storefront/src/components/tier-progress-hint.tsx +32 -0
  42. package/templates/storefront/src/components/toast-provider.tsx +92 -0
  43. package/templates/storefront/src/components/variant-price-display.tsx +31 -0
  44. package/templates/storefront/src/components/wishlist-button.tsx +88 -0
  45. package/templates/storefront/src/lib/core/account.ts +3 -0
  46. package/templates/storefront/src/lib/core/cms-contract.ts +35 -0
  47. package/templates/storefront/src/lib/core/cms.ts +71 -11
  48. package/templates/storefront/src/lib/core/form-ux.ts +57 -0
  49. package/templates/storefront/src/lib/core/newsletter.ts +53 -0
  50. package/templates/storefront/src/lib/core/reviews.ts +40 -0
  51. package/templates/storefront/src/lib/core/share.ts +57 -0
  52. package/templates/storefront/src/lib/core/wishlist.ts +88 -0
  53. package/templates/storefront/src/lib/storefront-routes.ts +33 -0
  54. package/templates/storefront/src/proxy.ts +25 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hszrdm/create-commerce",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Create a complete HSZRDM Commerce webshop project.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "prepare:templates": "node ./scripts/prepare-templates.mjs",
18
18
  "prepack": "npm run prepare:templates",
19
- "test": "node --test"
19
+ "test": "npm run prepare:templates && node --test"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=22"
package/src/cli.mjs CHANGED
@@ -14,6 +14,9 @@ import { createInterface } from "node:readline/promises"
14
14
  import { stdin as input, stdout as output } from "node:process"
15
15
 
16
16
  const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..")
17
+ const packageVersion = clean(
18
+ JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8")).version,
19
+ )
17
20
 
18
21
  export async function main(argv = process.argv.slice(2)) {
19
22
  const parsed = parseArgs(argv)
@@ -191,7 +194,7 @@ async function collectSettings(projectName, flags) {
191
194
  cookieSecret: secret(48),
192
195
  integrationEncryptionKey: secret(48),
193
196
  shippingWebhookSecret: secret(48),
194
- coreVersion: clean(flags["core-version"] || "1.0.3"),
197
+ coreVersion: clean(flags["core-version"] || packageVersion),
195
198
  }
196
199
  } finally {
197
200
  rl?.close()
@@ -582,5 +585,5 @@ function bool(value) {
582
585
  }
583
586
 
584
587
  function printHelp() {
585
- console.log(`HSZRDM Commerce project generator\n\nHasználat:\n npx @hszrdm/create-commerce <project-name> [opciók]\n\nFő opciók:\n --name <név>\n --slug <slug>\n --locale hu-HU\n --country HU\n --currency HUF\n --backend-url http://localhost:9000\n --storefront-url http://localhost:3000\n --admin-email <email>\n --admin-password <password>\n --database-url postgres://...\n --redis-url redis://...\n --postgres-port <port>\n --redis-port <port>\n --core-version 1.0.3\n --non-interactive\n --force\n\nInfrastruktúra:\n Ha --database-url és --redis-url meg van adva, a generátor Dockert nem használ.\n Ha nincsenek megadva, Docker Compose a fallback.\n\nFejlesztői kapcsolók:\n --skip-install\n --skip-docker\n --skip-bootstrap\n --skip-verify\n --skip-git\n\nLokális Core package teszthez:\n HSZRDM_CORE_PACKAGE=/abs/path/to/packages/core npx @hszrdm/create-commerce test-shop\n`)
588
+ console.log(`HSZRDM Commerce project generator\n\nHasználat:\n npx @hszrdm/create-commerce <project-name> [opciók]\n\nFő opciók:\n --name <név>\n --slug <slug>\n --locale hu-HU\n --country HU\n --currency HUF\n --backend-url http://localhost:9000\n --storefront-url http://localhost:3000\n --admin-email <email>\n --admin-password <password>\n --database-url postgres://...\n --redis-url redis://...\n --postgres-port <port>\n --redis-port <port>\n --core-version <verzió> (alapértelmezett: a generator package verziója)\n --non-interactive\n --force\n\nInfrastruktúra:\n Ha --database-url és --redis-url meg van adva, a generátor Dockert nem használ.\n Ha nincsenek megadva, Docker Compose a fallback.\n\nFejlesztői kapcsolók:\n --skip-install\n --skip-docker\n --skip-bootstrap\n --skip-verify\n --skip-git\n\nLokális Core package teszthez:\n HSZRDM_CORE_PACKAGE=/abs/path/to/packages/core npx @hszrdm/create-commerce test-shop\n`)
586
589
  }
@@ -67,6 +67,51 @@ SUPPORT_EMAIL=support@example.com
67
67
  BILLING_EMAIL=billing@example.com
68
68
  SYSTEM_EMAIL=system@example.com
69
69
 
70
+ # -----------------------------------------------------------------------------
71
+ # Email Center / transactional email / newsletter campaigns
72
+ # -----------------------------------------------------------------------------
73
+ # Shared template, campaign and delivery layer on top of Medusa Notification.
74
+ EMAIL_CENTER_ENABLED=true
75
+
76
+ # Raw e-mail delivery provider. Supported: sendgrid, resend. Leave blank during
77
+ # local development to keep Medusa's local notification provider on e-mail.
78
+ # Generic credentials override provider-specific legacy variables.
79
+ EMAIL_PROVIDER=
80
+ EMAIL_API_KEY=
81
+ EMAIL_FROM=
82
+ EMAIL_REPLY_TO=
83
+ # Provider-specific fallbacks if EMAIL_API_KEY / EMAIL_FROM are left empty.
84
+ RESEND_API_KEY=
85
+ RESEND_FROM_EMAIL=
86
+
87
+ # Optional per-event overrides. Empty means Email Center defaults apply; with
88
+ # EMAIL_CENTER_ENABLED=true the customer/order transactional contracts are on.
89
+ # Set a specific switch to false to disable only that event.
90
+ EMAIL_CUSTOMER_WELCOME_ENABLED=
91
+ EMAIL_REGISTRATION_VERIFICATION_ENABLED=
92
+ EMAIL_PASSWORD_RESET_ENABLED=
93
+ EMAIL_CHANGE_VERIFICATION_ENABLED=
94
+ EMAIL_PASSWORD_CHANGED_ENABLED=
95
+ EMAIL_CHANGED_ENABLED=
96
+ EMAIL_ACCOUNT_DELETED_ENABLED=
97
+ EMAIL_ORDER_PLACED_ENABLED=
98
+ EMAIL_PAYMENT_CAPTURED_ENABLED=
99
+ EMAIL_FULFILLMENT_CREATED_ENABLED=
100
+ EMAIL_SHIPMENT_CREATED_ENABLED=
101
+ EMAIL_ORDER_CANCELED_ENABLED=
102
+ EMAIL_PAYMENT_REFUNDED_ENABLED=
103
+
104
+ # Optional public logo URL shown in the shared email layout.
105
+ EMAIL_LOGO_URL=
106
+ # Open/click tracking is signed. Empty EMAIL_TRACKING_SECRET falls back to the
107
+ # generated COOKIE_SECRET, then JWT_SECRET. Production has no weak built-in key.
108
+ EMAIL_TRACKING_ENABLED=true
109
+ EMAIL_TRACKING_BASE_URL=
110
+ EMAIL_TRACKING_SECRET=
111
+ # Optional secret for POST /hooks/email/status. A provider-specific adapter can
112
+ # normalize delivered/bounced/failed callbacks to this internal endpoint.
113
+ EMAIL_WEBHOOK_SECRET=
114
+
70
115
  # -----------------------------------------------------------------------------
71
116
  # Customer after-sales self-service
72
117
  # -----------------------------------------------------------------------------
@@ -26,7 +26,7 @@
26
26
  "@medusajs/ui": "4.2.6",
27
27
  "react": "^18.3.1",
28
28
  "react-dom": "^18.3.1",
29
- "react-router-dom": "7.18.4"
29
+ "react-router-dom": "7.18.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@swc/core": "1.16.13",
@@ -28,6 +28,8 @@ szükséges. A payment/shipping/legal/SEO/analytics capability-k a `GET /store/c
28
28
  - teljes terméklista: keresés, kategóriaszűrés, rendezés, lapozás;
29
29
  - kategória- és termékoldal Core SEO/JSON-LD contracttal;
30
30
  - variáns- és mennyiségválasztás, Add to Cart;
31
+ - wishlist guest móddal, account merge-dzsel és saját wishlist oldallal;
32
+ - termékértékelések approved listával, aggregált értékeléssel és bejelentkezett ügyfél review beküldéssel;
31
33
  - közös cart state, cart drawer és teljes kosároldal;
32
34
  - kupon hozzáadás/eltávolítás;
33
35
  - region automatikus feloldása a Core alapértelmezett országa alapján;
@@ -46,10 +48,21 @@ szükséges. A payment/shipping/legal/SEO/analytics capability-k a `GET /store/c
46
48
  - címjegyzék CRUD;
47
49
  - rendelési előzmények és rendelésrészlet;
48
50
  - return / exchange / claim self-service;
51
+ - CMS referencia UI: blog lista/detail, generic page detail és tudástár lista/detail;
52
+ - newsletter signup a footerben, double-opt-in confirm és leiratkozó oldalakkal;
53
+ - általános ajánlatkérő oldal a Core extra meződefinícióival;
54
+ - dinamikus lead/contact form privacy consenttel, honeypottal és opcionális Cloudflare Turnstile támogatással;
49
55
  - globális loading/error/404/empty state-ek;
56
+ - toast, share, accessibility preferences, keyboard/focus UX és reduced-motion támogatás;
50
57
  - Consent Mode v2, GA4/GTM és e-commerce tracking;
51
58
  - robots.txt / sitemap.xml proxy és Search Console verification.
52
59
 
60
+ ## Customer-facing Core capability elv
61
+
62
+ A starter célja, hogy minden általános, customer-facing Core képességhez legyen design-semleges referencia UI vagy route. Az ügyfélprojektekben a vizuális réteg szabadon cserélhető, de a `src/lib/core` contractok és a referencia flow-k mutatják a támogatott integrációt.
63
+
64
+ Admin-, számlázási-, fulfillment-, audit-, integration-settings- és más háttérképességekhez nem tartozik storefront UI, mert azok nem customer-facing funkciók.
65
+
53
66
  ## Authority boundary
54
67
 
55
68
  A starter **nem** számol újra:
@@ -105,4 +118,4 @@ npm run typecheck
105
118
  npm run build
106
119
  ```
107
120
 
108
- A backend unit suite statikus regressziós tesztje azt is ellenőrzi, hogy a kötelező starter route-ok és Core contractok megmaradjanak.
121
+ A backend unit suite statikus regressziós tesztje azt is ellenőrzi, hogy a kötelező starter route-ok, customer-facing Core capability-k és Core contractok megmaradjanak.
@@ -1,14 +1,20 @@
1
1
  import { notFound } from "next/navigation"
2
2
  import { AddToCart } from "@/components/add-to-cart"
3
+ import { Breadcrumbs } from "@/components/breadcrumbs"
4
+ import { ProductGallery } from "@/components/product-gallery"
5
+ import { ProductReviews } from "@/components/product-reviews"
3
6
  import { ProductViewTracker } from "@/components/product-view-tracker"
7
+ import { ShareButton } from "@/components/share-button"
8
+ import { VariantPriceDisplay } from "@/components/variant-price-display"
9
+ import { WishlistButton } from "@/components/wishlist-button"
4
10
  import { getCoreConfig } from "@/lib/core/client"
5
11
  import { checkoutApi } from "@/lib/core/checkout"
6
12
  import { getProductByHandle } from "@/lib/core/catalog"
7
- import { asRecords, formatMoney, productVariantCurrency, productVariantPrice, stringValue } from "@/lib/core/commerce"
13
+ import { asRecords, productVariantCurrency, productVariantPrice, stringValue } from "@/lib/core/commerce"
8
14
  import { metadataFromCore, structuredDataForEntity } from "@/lib/core/seo"
9
15
  import { ecommerceItemFromProduct } from "@/lib/core/tracking"
10
16
  import { storefrontCopy } from "@/lib/storefront-copy"
11
- import { medusaLocale, storefrontLocale } from "@/lib/storefront-routes"
17
+ import { medusaLocale, STOREFRONT_ROUTES, storefrontLocale } from "@/lib/storefront-routes"
12
18
 
13
19
  export async function generateMetadata({ params }: { params: Promise<{ countryCode: string; handle: string }> }) {
14
20
  const { handle, countryCode } = await params
@@ -20,6 +26,7 @@ export default async function ProductPage({ params }: { params: Promise<{ countr
20
26
  const { handle, countryCode } = await params
21
27
  const locale = storefrontLocale(countryCode)
22
28
  const copy = storefrontCopy(locale)
29
+ const routes = STOREFRONT_ROUTES[locale]
23
30
  const config = await getCoreConfig()
24
31
  const region = await checkoutApi(config).resolveDefaultRegion().catch(() => null)
25
32
  const product = await getProductByHandle(handle, region ? stringValue(region.id) : undefined, medusaLocale(locale)).then((result) => result.products[0]).catch(() => null)
@@ -31,25 +38,52 @@ export default async function ProductPage({ params }: { params: Promise<{ countr
31
38
  const currency = productVariantCurrency(first, config.store.default_currency)
32
39
  const tracking = ecommerceItemFromProduct({ product, variant: first, currency })
33
40
  const images = asRecords(product.images)
41
+ const productId = stringValue(product.id)
42
+ const title = stringValue(product.title)
34
43
  const thumbnail = stringValue(product.thumbnail || images[0]?.url)
44
+ const formatLocale = locale === "en" ? "en-US" : "hu-HU"
45
+ const galleryImages = [
46
+ ...(thumbnail ? [{ id: "thumbnail", url: thumbnail, alt: title }] : []),
47
+ ...images
48
+ .map((image, index) => ({
49
+ id: stringValue(image.id || `image-${index}`),
50
+ url: stringValue(image.url),
51
+ alt: `${title} – ${index + 1}`,
52
+ }))
53
+ .filter((image) => image.url && image.url !== thumbnail),
54
+ ]
35
55
 
36
56
  return (
37
57
  <div className="stack page-section">
38
58
  {jsonLd ? <script className="jsonld" type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} /> : null}
39
59
  <ProductViewTracker analytics={config.analytics} item={tracking.item} currency={tracking.currency} value={tracking.value} />
60
+ <Breadcrumbs
61
+ label={locale === "en" ? "Breadcrumb" : "Morzsanavigáció"}
62
+ items={[
63
+ { label: locale === "en" ? "Products" : "Termékek", href: routes.products },
64
+ { label: title },
65
+ ]}
66
+ />
40
67
  <div className="product-detail">
41
- <div className="product-gallery">
42
- <div className="product-main-image">{thumbnail ? <img src={thumbnail} alt={stringValue(product.title)} /> : <span className="media-placeholder">{copy.noImage}</span>}</div>
43
- {images.length > 1 ? <div className="thumbnail-row">{images.slice(0, 6).map((image, index) => <img key={`${stringValue(image.id)}:${index}`} src={stringValue(image.url)} alt="" />)}</div> : null}
44
- </div>
45
- <section className="product-copy stack">
46
- <div><p className="eyebrow">{copy.product}</p><h1>{stringValue(product.title)}</h1></div>
47
- {Number.isFinite(price) ? <div className="product-price">{formatMoney(price, currency, locale === "en" ? "en-US" : "hu-HU")}</div> : null}
68
+ <ProductGallery
69
+ title={title}
70
+ images={galleryImages}
71
+ emptyLabel={copy.noImage}
72
+ galleryLabel={locale === "en" ? "Product images" : "Termékképek"}
73
+ />
74
+ <section className="product-copy stack" aria-labelledby="product-title">
75
+ <div><p className="eyebrow">{copy.product}</p><h1 id="product-title">{title}</h1></div>
76
+ <VariantPriceDisplay initialPrice={price} initialCurrency={currency} locale={formatLocale} />
48
77
  {product.description ? <p className="product-description">{stringValue(product.description)}</p> : null}
49
78
  <AddToCart product={product} config={config} />
79
+ <div className="button-row product-secondary-actions">
80
+ {productId ? <WishlistButton productId={productId} /> : null}
81
+ <ShareButton title={title} text={stringValue(product.description)} />
82
+ </div>
50
83
  <div className="product-meta">{product.subtitle ? <span>{stringValue(product.subtitle)}</span> : null}{product.material ? <span>{copy.material}: {stringValue(product.material)}</span> : null}{product.origin_country ? <span>{copy.origin}: {stringValue(product.origin_country)}</span> : null}</div>
51
84
  </section>
52
85
  </div>
86
+ {productId ? <ProductReviews productId={productId} locale={locale} /> : null}
53
87
  </div>
54
88
  )
55
89
  }
@@ -1,10 +1,21 @@
1
+ import Link from "next/link"
1
2
  import { AccountDashboard } from "@/components/account-dashboard"
2
3
  import { getCoreConfig } from "@/lib/core/client"
4
+ import { requestStorefrontLocale } from "@/lib/storefront-locale-server"
5
+ import { STOREFRONT_ROUTES } from "@/lib/storefront-routes"
3
6
 
4
7
  export default async function AccountPage() {
5
- const config = await getCoreConfig()
8
+ const [config, locale] = await Promise.all([
9
+ getCoreConfig(),
10
+ requestStorefrontLocale(),
11
+ ])
6
12
  return (
7
13
  <div className="stack page-section">
14
+ <div className="button-row">
15
+ <Link className="button secondary" href={STOREFRONT_ROUTES[locale].wishlist}>
16
+ {locale === "en" ? "Wishlist" : "Kedvencek"}
17
+ </Link>
18
+ </div>
8
19
  <AccountDashboard config={config} />
9
20
  </div>
10
21
  )
@@ -0,0 +1,9 @@
1
+ import { AccountWishlist } from "@/components/account-wishlist"
2
+
3
+ export default function AccountWishlistPage() {
4
+ return (
5
+ <div className="stack page-section">
6
+ <AccountWishlist />
7
+ </div>
8
+ )
9
+ }
@@ -0,0 +1,36 @@
1
+ import type { Metadata } from "next"
2
+ import { notFound } from "next/navigation"
3
+ import { Breadcrumbs } from "@/components/breadcrumbs"
4
+ import { CmsEntryBody, CmsEntryMeta } from "@/components/cms-content"
5
+ import { cmsEntrySeo, getBlogPost } from "@/lib/core/cms"
6
+ import { requestStorefrontLocale } from "@/lib/storefront-locale-server"
7
+ import { STOREFRONT_ROUTES, medusaLocale } from "@/lib/storefront-routes"
8
+
9
+ export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
10
+ const { slug } = await params
11
+ const locale = await requestStorefrontLocale()
12
+ const result = await getBlogPost(slug, { locale: medusaLocale(locale) }).catch(() => null)
13
+ return result ? cmsEntrySeo(result.entry) : {}
14
+ }
15
+
16
+ export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) {
17
+ const { slug } = await params
18
+ const locale = await requestStorefrontLocale()
19
+ const english = locale === "en"
20
+ const result = await getBlogPost(slug, { locale: medusaLocale(locale) }).catch(() => null)
21
+ if (!result) notFound()
22
+ const entry = result.entry
23
+
24
+ return (
25
+ <article className="stack page-section cms-detail">
26
+ <Breadcrumbs items={[{ label: english ? "Blog" : "Blog", href: STOREFRONT_ROUTES[locale].blog }, { label: entry.title }]} label={english ? "Breadcrumb" : "Morzsanavigáció"} />
27
+ <header className="stack-sm">
28
+ <CmsEntryMeta entry={entry} locale={locale} />
29
+ <h1>{entry.title}</h1>
30
+ {entry.excerpt ? <p className="lead">{entry.excerpt}</p> : null}
31
+ {entry.featured_image_url ? <img className="cms-hero-image" src={entry.featured_image_url} alt={entry.featured_image_alt || entry.title} /> : null}
32
+ </header>
33
+ <CmsEntryBody entry={entry} />
34
+ </article>
35
+ )
36
+ }
@@ -0,0 +1,25 @@
1
+ import { CmsEntryCard } from "@/components/cms-content"
2
+ import { listBlogPosts } from "@/lib/core/cms"
3
+ import { requestStorefrontLocale } from "@/lib/storefront-locale-server"
4
+ import { blogPostPath, medusaLocale } from "@/lib/storefront-routes"
5
+
6
+ export default async function BlogPage() {
7
+ const locale = await requestStorefrontLocale()
8
+ const english = locale === "en"
9
+ const { entries } = await listBlogPosts({ locale: medusaLocale(locale), limit: 50 }).catch(() => ({ entries: [] }))
10
+
11
+ return (
12
+ <div className="stack page-section">
13
+ <header className="stack-sm">
14
+ <p className="eyebrow">{english ? "Articles" : "Cikkek"}</p>
15
+ <h1>{english ? "Blog" : "Blog"}</h1>
16
+ <p className="muted">{english ? "News, guides and useful content from the store." : "Hírek, útmutatók és hasznos tartalmak a webáruháztól."}</p>
17
+ </header>
18
+ {entries.length ? (
19
+ <div className="cms-grid">
20
+ {entries.map((entry) => <CmsEntryCard key={entry.id} entry={entry} href={blogPostPath(locale, entry.slug)} locale={locale} />)}
21
+ </div>
22
+ ) : <div className="empty-state">{english ? "No published articles yet." : "Még nincs publikált bejegyzés."}</div>}
23
+ </div>
24
+ )
25
+ }
@@ -0,0 +1,25 @@
1
+ import { LeadForm } from "@/components/lead-form"
2
+ import { leadFormConfig } from "@/lib/core/leads"
3
+ import { requestStorefrontLocale } from "@/lib/storefront-locale-server"
4
+
5
+ export default async function ContactPage() {
6
+ const locale = await requestStorefrontLocale()
7
+ const english = locale === "en"
8
+ const config = await leadFormConfig("contact").catch(() => ({ forms: [], spam_protection: { honeypot_field: "website", turnstile: { enabled: false, site_key: null } } }))
9
+ const form = config.forms.find((item) => item.enabled) || null
10
+
11
+ return (
12
+ <div className="stack page-section narrow-page">
13
+ <header className="stack-sm">
14
+ <p className="eyebrow">{english ? "Contact" : "Kapcsolat"}</p>
15
+ <h1>{form?.label || (english ? "Send us a message" : "Írj nekünk")}</h1>
16
+ <p className="muted">{english ? "Use the form below and the team will get back to you." : "Töltsd ki az űrlapot, és a csapat felveszi veled a kapcsolatot."}</p>
17
+ </header>
18
+ {form ? (
19
+ <LeadForm locale={locale} form={form} spamProtection={config.spam_protection} />
20
+ ) : (
21
+ <div className="empty-state">{english ? "The contact form is currently unavailable." : "A kapcsolatfelvételi űrlap jelenleg nem elérhető."}</div>
22
+ )}
23
+ </div>
24
+ )
25
+ }
@@ -0,0 +1,244 @@
1
+ /* HSZRDM Commerce generic storefront UX/accessibility layer.
2
+ * Brand colors remain storefront-owned; these rules define behavior and states.
3
+ */
4
+
5
+ .skip-link {
6
+ position: fixed;
7
+ z-index: 1000;
8
+ top: 10px;
9
+ left: 10px;
10
+ transform: translateY(-160%);
11
+ border-radius: 8px;
12
+ background: var(--text);
13
+ color: var(--surface);
14
+ padding: 10px 14px;
15
+ font-weight: 800;
16
+ }
17
+ .skip-link:focus { transform: translateY(0); }
18
+
19
+ :where(a, button, input, select, textarea, [tabindex]):focus-visible {
20
+ outline: 3px solid #2563eb;
21
+ outline-offset: 3px;
22
+ }
23
+ :where(button, [role="button"], .text-button, .chip, .category-chip) { min-width: 24px; min-height: 24px; }
24
+ [aria-invalid="true"] { border-color: var(--danger) !important; }
25
+ [aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
26
+
27
+ .field-label { display: block; margin-bottom: 7px; color: #384152; font-size: .88rem; font-weight: 700; }
28
+ .field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: .78rem; }
29
+ .field-error { margin: 5px 0 0; color: var(--danger); font-size: .82rem; }
30
+ .required-mark { margin-left: 3px; color: var(--danger); }
31
+
32
+ .quantity-stepper {
33
+ display: grid;
34
+ grid-template-columns: 38px minmax(52px, 64px) 38px;
35
+ width: fit-content;
36
+ overflow: hidden;
37
+ border: 1px solid var(--line);
38
+ border-radius: 10px;
39
+ background: var(--surface);
40
+ }
41
+ .quantity-stepper button {
42
+ min-width: 38px;
43
+ min-height: 42px;
44
+ border: 0;
45
+ background: var(--surface-soft);
46
+ color: var(--text);
47
+ cursor: pointer;
48
+ font-size: 1.1rem;
49
+ font-weight: 800;
50
+ }
51
+ .quantity-stepper input {
52
+ min-height: 42px;
53
+ border: 0;
54
+ border-inline: 1px solid var(--line);
55
+ border-radius: 0;
56
+ padding: 5px;
57
+ text-align: center;
58
+ font-weight: 750;
59
+ appearance: textfield;
60
+ }
61
+ .quantity-stepper input::-webkit-inner-spin-button,
62
+ .quantity-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
63
+
64
+ .stock-status { width: fit-content; border-radius: 999px; padding: 6px 10px; font-size: .82rem; font-weight: 800; }
65
+ .stock-status.is-available { background: #e7f8ef; color: var(--success); }
66
+ .stock-status.is-unavailable { background: #fff1f0; color: var(--danger); }
67
+ .sku-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: .86rem; }
68
+ .sku-row code { user-select: all; }
69
+ .tier-progress-hint { margin: 0; color: var(--muted); font-size: .86rem; }
70
+
71
+ .thumbnail-button {
72
+ flex: 0 0 auto;
73
+ width: 76px;
74
+ height: 76px;
75
+ overflow: hidden;
76
+ border: 1px solid var(--line);
77
+ border-radius: 10px;
78
+ background: var(--surface);
79
+ padding: 0;
80
+ cursor: pointer;
81
+ }
82
+ .thumbnail-button img { width: 100%; height: 100%; object-fit: cover; }
83
+ .thumbnail-button.is-active { box-shadow: inset 0 0 0 2px var(--text); }
84
+
85
+ .product-secondary-actions { align-items: flex-start; }
86
+ .wishlist-button { gap: 8px; }
87
+ .wishlist-button > span[aria-hidden="true"] { font-size: 1.15em; line-height: 1; }
88
+ .wishlist-button.is-saved { border-color: var(--danger); }
89
+ .wishlist-button.is-saved > span[aria-hidden="true"] { color: var(--danger); }
90
+
91
+ .share-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
92
+ .share-links { display: flex; flex-wrap: wrap; gap: 10px; flex-basis: 100%; font-size: .88rem; }
93
+ .share-links a { text-decoration: underline; text-underline-offset: 3px; }
94
+
95
+ .breadcrumbs { color: var(--muted); font-size: .86rem; }
96
+ .breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
97
+ .breadcrumbs li { display: inline-flex; gap: 7px; align-items: center; }
98
+ .breadcrumbs li:not(:last-child)::after { content: "/"; color: #9aa1ab; }
99
+ .breadcrumbs a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
100
+ .breadcrumbs a:hover { text-decoration-color: currentColor; }
101
+
102
+ .toast-region {
103
+ position: fixed;
104
+ z-index: 180;
105
+ right: 18px;
106
+ bottom: 18px;
107
+ display: flex;
108
+ width: min(420px, calc(100vw - 36px));
109
+ flex-direction: column;
110
+ gap: 9px;
111
+ pointer-events: none;
112
+ }
113
+ .toast {
114
+ display: grid;
115
+ grid-template-columns: minmax(0, 1fr) auto auto;
116
+ gap: 12px;
117
+ align-items: center;
118
+ border: 1px solid var(--line);
119
+ border-radius: 13px;
120
+ background: var(--surface);
121
+ color: var(--text);
122
+ padding: 12px 13px;
123
+ box-shadow: 0 14px 44px rgba(16, 24, 40, .18);
124
+ pointer-events: auto;
125
+ }
126
+ .toast-success { border-color: #a6dfc1; }
127
+ .toast-error { border-color: #efb5ae; }
128
+ .toast-action { border: 0; background: none; color: var(--text); cursor: pointer; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
129
+ .toast-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-soft); cursor: pointer; font-size: 1.1rem; }
130
+
131
+ .accessibility-control { position: relative; }
132
+ .accessibility-panel {
133
+ position: absolute;
134
+ z-index: 50;
135
+ right: 0;
136
+ bottom: calc(100% + 10px);
137
+ width: min(310px, calc(100vw - 32px));
138
+ border: 1px solid var(--line);
139
+ border-radius: 14px;
140
+ background: var(--surface);
141
+ padding: 16px;
142
+ box-shadow: var(--shadow);
143
+ }
144
+
145
+ .mobile-menu-trigger { display: none; }
146
+ .mobile-menu-drawer {
147
+ position: absolute;
148
+ top: 0;
149
+ bottom: 0;
150
+ left: 0;
151
+ width: min(420px, 92vw);
152
+ overflow-y: auto;
153
+ background: var(--surface);
154
+ padding: 24px;
155
+ box-shadow: 20px 0 60px rgba(15, 23, 42, .16);
156
+ }
157
+ .mobile-nav-links { display: flex; flex-direction: column; gap: 4px; }
158
+ .mobile-nav-links a,
159
+ .mobile-locale-switch a { min-height: 46px; display: flex; align-items: center; border-radius: 10px; padding: 10px 12px; font-weight: 750; }
160
+ .mobile-nav-links a:hover,
161
+ .mobile-locale-switch a:hover { background: var(--surface-soft); }
162
+ .mobile-locale-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
163
+
164
+ .shipping-progress { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
165
+ .shipping-progress-copy { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; }
166
+ .shipping-progress-copy span { color: var(--muted); white-space: nowrap; }
167
+ .progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
168
+ .progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .2s ease; }
169
+
170
+ .back-to-top {
171
+ position: fixed;
172
+ z-index: 70;
173
+ right: 16px;
174
+ bottom: 16px;
175
+ min-height: 40px;
176
+ border: 1px solid var(--line);
177
+ border-radius: 999px;
178
+ background: var(--surface);
179
+ color: var(--text);
180
+ padding: 8px 12px;
181
+ box-shadow: 0 6px 24px rgba(16, 24, 40, .12);
182
+ cursor: pointer;
183
+ font-weight: 750;
184
+ }
185
+
186
+ html[data-font-scale="large"] { font-size: 112.5%; }
187
+
188
+ html[data-contrast="high"] {
189
+ --bg: #fff;
190
+ --surface: #fff;
191
+ --surface-soft: #f1f1f1;
192
+ --text: #000;
193
+ --muted: #343434;
194
+ --line: #565656;
195
+ --brand: #000;
196
+ --brand-contrast: #fff;
197
+ --success: #006b32;
198
+ --danger: #9b0000;
199
+ --warning: #714c00;
200
+ }
201
+ html[data-contrast="high"] :where(input, select, textarea, .panel, .card, .product-card, .quantity-stepper) { border-color: #565656; }
202
+ html[data-contrast="high"] :where(a, button, input, select, textarea, [tabindex]):focus-visible {
203
+ outline-color: #005fcc;
204
+ outline-width: 4px;
205
+ }
206
+
207
+ @media (prefers-reduced-motion: reduce) {
208
+ html:not([data-motion="full"]) { scroll-behavior: auto; }
209
+ html:not([data-motion="full"]) *,
210
+ html:not([data-motion="full"]) *::before,
211
+ html:not([data-motion="full"]) *::after {
212
+ animation-duration: .01ms !important;
213
+ animation-iteration-count: 1 !important;
214
+ scroll-behavior: auto !important;
215
+ transition-duration: .01ms !important;
216
+ }
217
+ }
218
+ html[data-motion="reduced"] { scroll-behavior: auto; }
219
+ html[data-motion="reduced"] *,
220
+ html[data-motion="reduced"] *::before,
221
+ html[data-motion="reduced"] *::after {
222
+ animation-duration: .01ms !important;
223
+ animation-iteration-count: 1 !important;
224
+ scroll-behavior: auto !important;
225
+ transition-duration: .01ms !important;
226
+ }
227
+
228
+ @media (max-width: 760px) {
229
+ .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
230
+ .accessibility-control { width: 100%; }
231
+ .accessibility-panel { right: auto; left: 0; }
232
+ .mobile-menu-trigger { display: inline-grid; place-items: center; }
233
+ .locale-switch { display: none; }
234
+ .sticky-mobile-cta {
235
+ position: sticky;
236
+ z-index: 20;
237
+ bottom: 10px;
238
+ width: 100%;
239
+ box-shadow: 0 8px 30px rgba(16, 24, 40, .18);
240
+ }
241
+ .shipping-progress-copy { flex-direction: column; }
242
+ .product-secondary-actions { flex-direction: column; align-items: stretch; }
243
+ .product-secondary-actions > * { width: 100%; }
244
+ }
@@ -0,0 +1,60 @@
1
+ /* Customer-facing Core capability reference UI. Brand tokens remain storefront-owned. */
2
+
3
+ .cms-grid,
4
+ .review-list {
5
+ display: grid;
6
+ gap: 18px;
7
+ }
8
+ .cms-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
9
+ .cms-card { overflow: hidden; }
10
+ .cms-card-image,
11
+ .cms-hero-image {
12
+ width: 100%;
13
+ border-radius: 14px;
14
+ object-fit: cover;
15
+ }
16
+ .cms-card-image { aspect-ratio: 16 / 9; }
17
+ .cms-hero-image { max-height: 520px; }
18
+ .cms-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; }
19
+ .cms-body { max-width: 78ch; line-height: 1.75; }
20
+ .cms-body img { max-width: 100%; height: auto; border-radius: 12px; }
21
+ .cms-body blockquote { margin: 0; border-left: 4px solid var(--line); padding-left: 18px; color: var(--muted); }
22
+ .cms-detail { max-width: 900px; margin-inline: auto; }
23
+
24
+ .product-reviews { border-top: 1px solid var(--line); padding-top: 28px; }
25
+ .review-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
26
+ .review-summary strong { font-size: 1.35rem; }
27
+ .review-card { display: grid; gap: 10px; }
28
+ .review-card-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
29
+ .review-card-heading > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
30
+ .verified-badge { border-radius: 999px; background: var(--surface-soft); padding: 4px 8px; font-size: .75rem; font-weight: 800; }
31
+ .review-form select,
32
+ .review-form textarea,
33
+ .newsletter-form input,
34
+ .quote-request-form input,
35
+ .quote-request-form select,
36
+ .quote-request-form textarea,
37
+ .lead-form input,
38
+ .lead-form select,
39
+ .lead-form textarea {
40
+ width: 100%;
41
+ }
42
+
43
+ .footer-newsletter-shell { padding-top: 28px; }
44
+ .footer-newsletter { border-bottom: 1px solid var(--line); padding-bottom: 28px; }
45
+ .newsletter-form { display: grid; gap: 10px; max-width: 760px; }
46
+ .newsletter-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
47
+ .checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
48
+ .checkbox-row input { width: auto; margin-top: 3px; }
49
+
50
+ .narrow-page { max-width: 920px; margin-inline: auto; }
51
+ .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
52
+ .form-fieldset { margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
53
+ .form-fieldset legend { padding-inline: 6px; font-weight: 850; }
54
+ .honeypot-field { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
55
+
56
+ @media (max-width: 760px) {
57
+ .form-grid,
58
+ .newsletter-form-row { grid-template-columns: 1fr; }
59
+ .review-summary { align-items: flex-start; }
60
+ }