create-brainerce-store 1.62.0 → 1.64.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.
- package/LICENSE +21 -21
- package/README.md +71 -71
- package/dist/index.js +26 -3
- package/messages/en.json +502 -502
- package/messages/he.json +502 -502
- package/package.json +1 -1
- package/templates/nextjs/base/.claude/commands/design.md +60 -60
- package/templates/nextjs/base/.env.local.ejs +24 -24
- package/templates/nextjs/base/.eslintrc.json +57 -57
- package/templates/nextjs/base/.mcp.json +8 -8
- package/templates/nextjs/base/AI-GUIDE.md +174 -174
- package/templates/nextjs/base/TRANSLATIONS.md +200 -200
- package/templates/nextjs/base/package.json.ejs +52 -52
- package/templates/nextjs/base/src/app/agents.md/route.ts +87 -0
- package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +308 -262
- package/templates/nextjs/base/src/app/blog/page.tsx.ejs +276 -276
- package/templates/nextjs/base/src/app/blog/rss.xml/route.ts +70 -0
- package/templates/nextjs/base/src/app/cart/page.tsx +7 -7
- package/templates/nextjs/base/src/app/category/[slug]/page.tsx +29 -3
- package/templates/nextjs/base/src/app/checkout/page.tsx +12 -0
- package/templates/nextjs/base/src/app/contact/layout.tsx.ejs +14 -0
- package/templates/nextjs/base/src/app/globals.css +36 -36
- package/templates/nextjs/base/src/app/indexnow-key.txt/route.ts +26 -26
- package/templates/nextjs/base/src/app/layout.tsx.ejs +30 -0
- package/templates/nextjs/base/src/app/llms.txt/route.ts +28 -5
- package/templates/nextjs/base/src/app/not-found.tsx.ejs +35 -0
- package/templates/nextjs/base/src/app/opengraph-image.tsx +109 -0
- package/templates/nextjs/base/src/app/order-confirmation/page.tsx +295 -278
- package/templates/nextjs/base/src/app/order-status/page.tsx +121 -121
- package/templates/nextjs/base/src/app/page.tsx +64 -64
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +14 -2
- package/templates/nextjs/base/src/app/products/page.tsx +19 -19
- package/templates/nextjs/base/src/app/robots.ts +73 -14
- package/templates/nextjs/base/src/app/sitemap.ts +89 -66
- package/templates/nextjs/base/src/components/account/order-history.tsx +385 -385
- package/templates/nextjs/base/src/components/brainerce-bot.tsx +70 -70
- package/templates/nextjs/base/src/components/checkout/checkout-form.tsx +612 -612
- package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +292 -292
- package/templates/nextjs/base/src/components/checkout/date-picker.tsx +309 -309
- package/templates/nextjs/base/src/components/checkout/datetime-picker.tsx +144 -144
- package/templates/nextjs/base/src/components/checkout/order-bump-card.tsx +242 -242
- package/templates/nextjs/base/src/components/checkout/pickup-step.tsx +198 -198
- package/templates/nextjs/base/src/components/checkout/shipping-step.tsx +125 -125
- package/templates/nextjs/base/src/components/checkout/tax-display.tsx +74 -74
- package/templates/nextjs/base/src/components/seo/article-json-ld.tsx +59 -59
- package/templates/nextjs/base/src/components/seo/breadcrumbs.tsx +37 -37
- package/templates/nextjs/base/src/components/seo/category-json-ld.tsx +61 -61
- package/templates/nextjs/base/src/components/seo/organization-json-ld.tsx +97 -97
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +23 -131
- package/templates/nextjs/base/src/components/tracking-bootstrap.tsx +62 -0
- package/templates/nextjs/base/src/components/ui/accordion.tsx +53 -53
- package/templates/nextjs/base/src/components/ui/badge.tsx +32 -32
- package/templates/nextjs/base/src/components/ui/button.tsx +49 -49
- package/templates/nextjs/base/src/components/ui/card.tsx +55 -55
- package/templates/nextjs/base/src/components/ui/checkbox.tsx +28 -28
- package/templates/nextjs/base/src/components/ui/dialog.tsx +107 -107
- package/templates/nextjs/base/src/components/ui/input.tsx +22 -22
- package/templates/nextjs/base/src/components/ui/label.tsx +21 -21
- package/templates/nextjs/base/src/components/ui/radio-group.tsx +38 -38
- package/templates/nextjs/base/src/components/ui/select.tsx +153 -153
- package/templates/nextjs/base/src/components/ui/separator.tsx +26 -26
- package/templates/nextjs/base/src/components/ui/sheet.tsx +125 -125
- package/templates/nextjs/base/src/components/ui/skeleton.tsx +7 -7
- package/templates/nextjs/base/src/components/ui/tabs.tsx +55 -55
- package/templates/nextjs/base/src/components/ui/textarea.tsx +21 -21
- package/templates/nextjs/base/src/components/ui/tooltip.tsx +32 -32
- package/templates/nextjs/base/src/core/hooks/use-cart-page.ts +58 -58
- package/templates/nextjs/base/src/core/hooks/use-home-data.ts +51 -51
- package/templates/nextjs/base/src/core/hooks/use-product-listing.ts +295 -295
- package/templates/nextjs/base/src/core/hooks/use-product-page.ts +20 -2
- package/templates/nextjs/base/src/core/lib/image-hosts.ts +7 -7
- package/templates/nextjs/base/src/core/lib/product-options.ts +121 -121
- package/templates/nextjs/base/src/core/lib/resolve-currency.ts +20 -20
- package/templates/nextjs/base/src/core/lib/safe-redirect.ts +38 -38
- package/templates/nextjs/base/src/core/lib/seo.ts +46 -46
- package/templates/nextjs/base/src/core/lib/store-info.ts +17 -0
- package/templates/nextjs/base/src/core/lib/tracking.ts +171 -0
- package/templates/nextjs/base/src/core/lib/use-currency.ts +19 -19
- package/templates/nextjs/base/src/core/lib/utils.ts +21 -21
- package/templates/nextjs/base/src/middleware.ts.ejs +54 -2
- package/templates/nextjs/base/src/ui/cart/cart-bundle-offer.tsx +117 -117
- package/templates/nextjs/base/src/ui/cart/cart-item.tsx +146 -146
- package/templates/nextjs/base/src/ui/cart/cart-nudges.tsx +28 -28
- package/templates/nextjs/base/src/ui/cart/cart-summary.tsx +110 -110
- package/templates/nextjs/base/src/ui/cart/cart-upgrade-banner.tsx +126 -126
- package/templates/nextjs/base/src/ui/cart/cart-view.tsx +140 -140
- package/templates/nextjs/base/src/ui/cart/coupon-input.tsx +134 -134
- package/templates/nextjs/base/src/ui/cart/free-shipping-bar.tsx +61 -61
- package/templates/nextjs/base/src/ui/cart/reservation-countdown.tsx +95 -95
- package/templates/nextjs/base/src/ui/home/discount-banner-strip.tsx +22 -20
- package/templates/nextjs/base/src/ui/home/featured-products-section.tsx +24 -24
- package/templates/nextjs/base/src/ui/home/hero-section.tsx +27 -27
- package/templates/nextjs/base/src/ui/home/home-client.tsx +29 -29
- package/templates/nextjs/base/src/ui/layout/announcement-bar.tsx.ejs +116 -116
- package/templates/nextjs/base/src/ui/layout/faq-section.tsx.ejs +90 -90
- package/templates/nextjs/base/src/ui/layout/header-account.tsx +40 -40
- package/templates/nextjs/base/src/ui/layout/language-switcher.tsx.ejs +80 -80
- package/templates/nextjs/base/src/ui/layout/site-footer.tsx.ejs +144 -144
- package/templates/nextjs/base/src/ui/layout/site-header.tsx.ejs +152 -152
- package/templates/nextjs/base/src/ui/product/customization-fields.tsx +457 -457
- package/templates/nextjs/base/src/ui/product/discount-badge.tsx +18 -18
- package/templates/nextjs/base/src/ui/product/frequently-bought-together.tsx +191 -191
- package/templates/nextjs/base/src/ui/product/modifier-group-selector.tsx +206 -206
- package/templates/nextjs/base/src/ui/product/price-display.tsx +62 -62
- package/templates/nextjs/base/src/ui/product/product-card.tsx +7 -2
- package/templates/nextjs/base/src/ui/product/product-client-section.tsx +455 -455
- package/templates/nextjs/base/src/ui/product/product-listing.tsx +446 -446
- package/templates/nextjs/base/src/ui/product/recommendation-section.tsx +102 -102
- package/templates/nextjs/base/src/ui/product/review-form.tsx +294 -294
- package/templates/nextjs/base/src/ui/product/reviews-section.tsx.ejs +108 -108
- package/templates/nextjs/base/src/ui/product/stock-badge.tsx +61 -61
- package/templates/nextjs/base/src/ui/product/variant-selector.tsx +291 -291
- package/templates/nextjs/base/src/ui/shared/cdn-image.tsx +26 -26
- package/templates/nextjs/base/tailwind.config.ts +69 -69
- package/templates/nextjs/designs/atelier/app-overlay/layout.tsx.ejs +30 -0
- package/templates/nextjs/designs/atelier/globals.css +402 -402
- package/templates/nextjs/designs/atelier/messages-patch/en.json +100 -100
- package/templates/nextjs/designs/atelier/messages-patch/he.json +100 -100
- package/templates/nextjs/designs/atelier/ui/cart/cart-bundle-offer.tsx +110 -110
- package/templates/nextjs/designs/atelier/ui/cart/cart-drawer.tsx +163 -163
- package/templates/nextjs/designs/atelier/ui/cart/cart-item.tsx +140 -140
- package/templates/nextjs/designs/atelier/ui/cart/cart-nudges.tsx +34 -34
- package/templates/nextjs/designs/atelier/ui/cart/cart-summary.tsx +107 -107
- package/templates/nextjs/designs/atelier/ui/cart/cart-upgrade-banner.tsx +123 -123
- package/templates/nextjs/designs/atelier/ui/cart/cart-view.tsx +147 -147
- package/templates/nextjs/designs/atelier/ui/cart/coupon-input.tsx +142 -142
- package/templates/nextjs/designs/atelier/ui/cart/free-shipping-bar.tsx +77 -77
- package/templates/nextjs/designs/atelier/ui/cart/reservation-countdown.tsx +89 -89
- package/templates/nextjs/designs/atelier/ui/home/benefits-band.tsx +34 -34
- package/templates/nextjs/designs/atelier/ui/home/category-tiles.tsx +151 -151
- package/templates/nextjs/designs/atelier/ui/home/discount-banner-strip.tsx +27 -27
- package/templates/nextjs/designs/atelier/ui/home/editorial-band.tsx +75 -75
- package/templates/nextjs/designs/atelier/ui/home/featured-products-section.tsx +36 -36
- package/templates/nextjs/designs/atelier/ui/home/hero-section.tsx +174 -174
- package/templates/nextjs/designs/atelier/ui/home/home-client.tsx +54 -54
- package/templates/nextjs/designs/atelier/ui/home/newsletter-section.tsx +78 -78
- package/templates/nextjs/designs/atelier/ui/home/testimonials-band.tsx +46 -46
- package/templates/nextjs/designs/atelier/ui/layout/announcement-bar.tsx +118 -118
- package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +96 -96
- package/templates/nextjs/designs/atelier/ui/layout/header-account.tsx +36 -36
- package/templates/nextjs/designs/atelier/ui/layout/header-cart.tsx +36 -36
- package/templates/nextjs/designs/atelier/ui/layout/language-switcher.tsx.ejs +137 -137
- package/templates/nextjs/designs/atelier/ui/layout/nav-url.ts +14 -14
- package/templates/nextjs/designs/atelier/ui/layout/rich-text-block.tsx +34 -34
- package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +141 -141
- package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +138 -138
- package/templates/nextjs/designs/atelier/ui/product/customization-fields.tsx +466 -466
- package/templates/nextjs/designs/atelier/ui/product/discount-badge.tsx +17 -17
- package/templates/nextjs/designs/atelier/ui/product/frequently-bought-together.tsx +196 -196
- package/templates/nextjs/designs/atelier/ui/product/modifier-group-selector.tsx +193 -193
- package/templates/nextjs/designs/atelier/ui/product/price-display.tsx +69 -69
- package/templates/nextjs/designs/atelier/ui/product/product-card.tsx +13 -11
- package/templates/nextjs/designs/atelier/ui/product/product-client-section.tsx +477 -477
- package/templates/nextjs/designs/atelier/ui/product/product-grid.tsx +42 -42
- package/templates/nextjs/designs/atelier/ui/product/product-listing.tsx +260 -260
- package/templates/nextjs/designs/atelier/ui/product/recommendation-section.tsx +95 -95
- package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +267 -267
- package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -148
- package/templates/nextjs/designs/atelier/ui/product/stock-badge.tsx +66 -66
- package/templates/nextjs/designs/atelier/ui/product/variant-selector.tsx +206 -206
- package/templates/nextjs/designs/atelier/ui/shared/cdn-image.tsx +29 -29
- package/templates/nextjs/designs/atelier/ui/shared/fly-to-cart.ts +86 -86
- package/templates/nextjs/designs/atelier/ui/shared/icons.tsx +276 -276
- package/templates/nextjs/designs/atelier/ui/shared/loading-spinner.tsx +63 -63
- package/templates/nextjs/designs/atelier/ui/shared/reveal.tsx +71 -71
- package/templates/nextjs/designs/atelier/ui/shared/select-menu.tsx +125 -125
- package/templates/nextjs/ui-canvas/cart/cart-bundle-offer.tsx +89 -89
- package/templates/nextjs/ui-canvas/cart/cart-item.tsx +123 -123
- package/templates/nextjs/ui-canvas/cart/cart-nudges.tsx +29 -27
- package/templates/nextjs/ui-canvas/cart/cart-summary.tsx +99 -99
- package/templates/nextjs/ui-canvas/cart/cart-upgrade-banner.tsx +105 -105
- package/templates/nextjs/ui-canvas/cart/cart-view.tsx +106 -106
- package/templates/nextjs/ui-canvas/cart/coupon-input.tsx +119 -119
- package/templates/nextjs/ui-canvas/cart/free-shipping-bar.tsx +54 -54
- package/templates/nextjs/ui-canvas/cart/reservation-countdown.tsx +81 -81
- package/templates/nextjs/ui-canvas/home/discount-banner-strip.tsx +21 -19
- package/templates/nextjs/ui-canvas/home/featured-products-section.tsx +23 -23
- package/templates/nextjs/ui-canvas/home/hero-section.tsx +21 -21
- package/templates/nextjs/ui-canvas/home/home-client.tsx +26 -26
- package/templates/nextjs/ui-canvas/layout/announcement-bar.tsx.ejs +101 -101
- package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +71 -71
- package/templates/nextjs/ui-canvas/layout/header-account.tsx +31 -31
- package/templates/nextjs/ui-canvas/layout/language-switcher.tsx.ejs +76 -76
- package/templates/nextjs/ui-canvas/layout/rich-text-block.tsx.ejs +36 -36
- package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +82 -82
- package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +119 -119
- package/templates/nextjs/ui-canvas/product/customization-fields.tsx +445 -445
- package/templates/nextjs/ui-canvas/product/discount-badge.tsx +19 -19
- package/templates/nextjs/ui-canvas/product/frequently-bought-together.tsx +168 -168
- package/templates/nextjs/ui-canvas/product/modifier-group-selector.tsx +165 -165
- package/templates/nextjs/ui-canvas/product/price-display.tsx +52 -52
- package/templates/nextjs/ui-canvas/product/product-card.tsx +7 -2
- package/templates/nextjs/ui-canvas/product/product-client-section.tsx +352 -352
- package/templates/nextjs/ui-canvas/product/product-grid.tsx +27 -27
- package/templates/nextjs/ui-canvas/product/product-listing.tsx +224 -224
- package/templates/nextjs/ui-canvas/product/recommendation-section.tsx +99 -99
- package/templates/nextjs/ui-canvas/product/review-form.tsx +266 -266
- package/templates/nextjs/ui-canvas/product/reviews-section.tsx.ejs +96 -96
- package/templates/nextjs/ui-canvas/product/stock-badge.tsx +45 -45
- package/templates/nextjs/ui-canvas/product/variant-selector.tsx +212 -212
- package/templates/nextjs/ui-canvas/shared/cdn-image.tsx +31 -31
- package/templates/nextjs/ui-canvas/shared/loading-spinner.tsx +27 -27
- package/templates/nextjs/base/tsconfig.tsbuildinfo +0 -1
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
# AI-GUIDE — designing this store safely
|
|
2
|
-
|
|
3
|
-
You (an AI coding assistant, or a human designer) have been asked to redesign
|
|
4
|
-
this storefront. This guide is the contract that lets you go as bold as you
|
|
5
|
-
want without breaking commerce. It was distilled from real agency builds.
|
|
6
|
-
|
|
7
|
-
## The one rule
|
|
8
|
-
|
|
9
|
-
**`src/core/` is the platform's. `src/ui/` is yours.**
|
|
10
|
-
|
|
11
|
-
Everything under `src/ui/` may be rewritten from scratch — layouts, markup,
|
|
12
|
-
classes, animations, entire visual languages. (Canvas-mode stores —
|
|
13
|
-
scaffolded with `--canvas` — ship `src/ui/` as bare unstyled skeletons with
|
|
14
|
-
`DESIGN ME` markers; same rules apply, you're just starting from zero.) Everything under `src/core/`
|
|
15
|
-
(and `src/app/api/`) keeps the store working: cart, checkout, variants,
|
|
16
|
-
inventory, auth, SEO, i18n. Never modify it. If a redesign seems to require a
|
|
17
|
-
core change, stop and say so instead.
|
|
18
|
-
|
|
19
|
-
## File map
|
|
20
|
-
|
|
21
|
-
| Path | Owner | Notes |
|
|
22
|
-
|------|-------|-------|
|
|
23
|
-
| `src/ui/layout/` | you | header, footer, announcement bar |
|
|
24
|
-
| `src/ui/home/` | you | homepage sections |
|
|
25
|
-
| `src/ui/product/` | you | card, grid, listing, product page, price, badges, selectors |
|
|
26
|
-
| `src/ui/cart/` | you | cart page pieces |
|
|
27
|
-
| `src/ui/shared/` | you | loader, image wrapper |
|
|
28
|
-
| `src/app/globals.css` | you | tokens + global styles |
|
|
29
|
-
| `src/components/ui/` | shared | shadcn/ui primitives — compose them, extend via variants |
|
|
30
|
-
| `src/core/**` | platform | hooks, lib, providers — read, never edit |
|
|
31
|
-
| `src/components/{checkout,auth,account,seo}` | platform | core-styled in v1; they inherit your tokens |
|
|
32
|
-
| `src/app/**` | platform | thin routes; edit only to wire new ui components |
|
|
33
|
-
|
|
34
|
-
## The dialect (shadcn/ui + lucide + cn)
|
|
35
|
-
|
|
36
|
-
This store speaks the same component dialect as Lovable / v0 / Bolt output:
|
|
37
|
-
|
|
38
|
-
- **`src/components/ui/` holds official shadcn/ui primitives** (button, card,
|
|
39
|
-
badge, input, label, textarea, select, checkbox, radio-group, separator,
|
|
40
|
-
accordion, dialog, sheet, skeleton, tabs, tooltip). Compose them in `src/ui/`
|
|
41
|
-
instead of hand-rolling controls. Need a new look? **Extend via CVA
|
|
42
|
-
variants** (add a variant to `buttonVariants`/`badgeVariants`), never by
|
|
43
|
-
inline-overriding the same styles in twenty call sites.
|
|
44
|
-
- **Icons: lucide-react only.** No inline `<svg>` paths, no emoji-as-icons,
|
|
45
|
-
no second icon set. Consistent 16/20/24px sizes.
|
|
46
|
-
- **Class merging: `cn()`** from `@/core/lib/utils` (clsx + tailwind-merge) —
|
|
47
|
-
it's the same helper shadcn expects, already wired into every primitive.
|
|
48
|
-
- **Tokens drive everything**: primitives read `--primary`, `--card`,
|
|
49
|
-
`--input`, `--ring`, `--radius`, etc. from `globals.css`. Restyle the store
|
|
50
|
-
by changing tokens (and variants), not by scattering literal colors.
|
|
51
|
-
- `rounded`, `rounded-md`, `rounded-lg` all derive from `--radius`
|
|
52
|
-
(shadcn convention), so corner radius follows the theme automatically.
|
|
53
|
-
|
|
54
|
-
## The hook contract (your data supply)
|
|
55
|
-
|
|
56
|
-
UI components get *everything* from `@/core/hooks/*` and
|
|
57
|
-
`@/core/providers/store-provider` — never from `@/core/lib` directly:
|
|
58
|
-
|
|
59
|
-
- `useHomeData()` → `{ products, banners, loading }`
|
|
60
|
-
- `useProductListing()` → products + filters/sort/facets/pagination + handlers
|
|
61
|
-
- `useProductPage(product)` → variant/image selection, `priceInfo`, `inventory`,
|
|
62
|
-
`quantity`, `handleAddToCart`, `addingToCart`, `addedMessage`, customization
|
|
63
|
-
+ modifier state and errors
|
|
64
|
-
- `useCartPage()` / `useCart()` → `{ cart, itemCount, totals, refreshCart }`
|
|
65
|
-
|
|
66
|
-
Hooks return data and handlers, never JSX. All catalog content (names, prices,
|
|
67
|
-
images, stock) comes from them — **never hardcode products**.
|
|
68
|
-
|
|
69
|
-
## Verification loop (before you declare anything done)
|
|
70
|
-
|
|
71
|
-
1. `pnpm exec tsc --noEmit` → must be 0.
|
|
72
|
-
2. `pnpm dev` → drive the real flow you changed: home → listing → product →
|
|
73
|
-
add to cart → cart → checkout page renders.
|
|
74
|
-
3. Screenshot desktop (1440) AND mobile (390), in the store's language.
|
|
75
|
-
4. If the store is RTL: check nothing is left-anchored that should be
|
|
76
|
-
right-anchored, and directional arrows point with the reading direction.
|
|
77
|
-
|
|
78
|
-
## The quality bar (distilled from Lovable / v0 / Bolt system prompts)
|
|
79
|
-
|
|
80
|
-
Beautiful is the top priority — the first render must wow. Hard rules:
|
|
81
|
-
|
|
82
|
-
1. **Design system first**: define all HSL semantic tokens in globals.css
|
|
83
|
-
BEFORE styling any component. Never direct colors (`text-white`,
|
|
84
|
-
`bg-black`) in classNames — tokens only.
|
|
85
|
-
2. **Color budget: exactly 3-5 colors.** 1 brand color, 2-3 neutrals, 1-2
|
|
86
|
-
accents. Never purple/violet unless the merchant asked. No gradients by
|
|
87
|
-
default — solid colors; gradients only as subtle accents if requested.
|
|
88
|
-
3. **Max 2 font families** (1 display + 1 body, both with the store's
|
|
89
|
-
script). Body line-height 1.4-1.6. Nothing below 14px.
|
|
90
|
-
4. **Mobile-first**; flexbox by default, grid for true 2D; no absolute
|
|
91
|
-
positioning unless necessary.
|
|
92
|
-
5. **Tailwind discipline**: spacing scale only (`p-4`, never `p-[16px]`),
|
|
93
|
-
`gap-*` over margins between siblings, `text-balance` on headlines.
|
|
94
|
-
6. **Real imagery everywhere** — product photos from the catalog do the
|
|
95
|
-
heavy lifting; free stock hotlinks (Pexels/Unsplash) for editorial
|
|
96
|
-
sections. NEVER abstract filler shapes (gradient circles, blobs).
|
|
97
|
-
NEVER emojis as icons — one icon set, consistent 16/20/24px sizes.
|
|
98
|
-
7. **Content-rich**: no section may render empty or thin. Empty states are
|
|
99
|
-
designed states with copy and structure, not blank space.
|
|
100
|
-
8. Component variants in the design system, not inline overrides.
|
|
101
|
-
9. Semantic HTML + ARIA + alt text + `sr-only` labels — always.
|
|
102
|
-
10. **Verify with your eyes**: screenshot after each major surface, critique
|
|
103
|
-
it ("would a Lovable user accept this?"), fix, and only then move on.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## Motion language (CSS-first)
|
|
107
|
-
|
|
108
|
-
The store should feel alive, premium and intentional — every animation guides
|
|
109
|
-
attention, confirms an action, or rewards exploration. Rules:
|
|
110
|
-
|
|
111
|
-
- **Timing tokens** (use these, never ad-hoc numbers): 80ms instant feedback ·
|
|
112
|
-
180ms hover · 300ms UI state change · 500-600ms section entrance · 900ms
|
|
113
|
-
hero only. Stagger siblings 40-80ms.
|
|
114
|
-
- **Easing**: entrances `cubic-bezier(0.16, 1, 0.3, 1)` (out-expo); springy
|
|
115
|
-
pops `cubic-bezier(0.34, 1.56, 0.64, 1)` (out-back); loops and hovers
|
|
116
|
-
ease-in-out. Exits faster than entrances.
|
|
117
|
-
- **Reveals**: below-the-fold sections animate on viewport entry
|
|
118
|
-
(IntersectionObserver — see `src/ui/shared/reveal.tsx`), never tied to
|
|
119
|
-
scroll distance. One orchestrated reveal per section beats scattered
|
|
120
|
-
effects; `viewport once` — do not re-animate on every scroll.
|
|
121
|
-
- **Micro-interactions**: CSS/WAAPI first (see `src/ui/shared/fly-to-cart.ts`
|
|
122
|
-
for the pattern) — ripple, bump, image zoom, quick-add slide-up are all
|
|
123
|
-
achievable without a library.
|
|
124
|
-
- **Pointer effects** (magnetic buttons, tilt cards, custom cursor, mouse
|
|
125
|
-
parallax): desktop only — gate on `(pointer: fine)` and no-op under
|
|
126
|
-
`prefers-reduced-motion`. `will-change: transform` ONLY on elements animated
|
|
127
|
-
per-frame; never sprinkle it broadly.
|
|
128
|
-
- **Never `transition-all`** — always name the property
|
|
129
|
-
(`transition-transform`, `transition-opacity`). Animate only compositor
|
|
130
|
-
properties (`transform`, `opacity`) — never layout properties
|
|
131
|
-
(width/height/top/margin). 60fps is non-negotiable.
|
|
132
|
-
- **Ambient effects** (gradient blobs, particles): maximum one per page, hero
|
|
133
|
-
only — never on inner pages.
|
|
134
|
-
- **framer-motion / GSAP are not installed.** They are allowed, but they are
|
|
135
|
-
new runtime dependencies — flag it to the user before adding.
|
|
136
|
-
|
|
137
|
-
## Hard-won gotchas (each one cost a real debugging session)
|
|
138
|
-
|
|
139
|
-
- **RTL + cloned images**: `next/image` renders its `<img>` with `inset: 0`.
|
|
140
|
-
If you clone one for an animation and set `left`, the leftover `right: 0`
|
|
141
|
-
wins in RTL documents (over-constrained boxes resolve to the RIGHT).
|
|
142
|
-
Set `inset: 'auto'` before positioning.
|
|
143
|
-
- **Never name a custom class `overline`** — it is a Tailwind utility
|
|
144
|
-
(`text-decoration-line: overline`) and will draw a line above your text.
|
|
145
|
-
- **`rounded` / `rounded-md` / `rounded-lg` all follow `--radius`** (shadcn
|
|
146
|
-
convention, wired in tailwind.config.ts) — change the token, not the
|
|
147
|
-
classes, when you want sharper or softer corners.
|
|
148
|
-
- **Hebrew has no uppercase** — remove `text-transform: uppercase` and wide
|
|
149
|
-
`letter-spacing` from heading styles; they are Latin idioms that distort
|
|
150
|
-
Hebrew (tracking is acceptable only at caption sizes).
|
|
151
|
-
- **Logical properties only**: `ms-/me-`, `ps-/pe-`, `start-/end-`,
|
|
152
|
-
`text-start/end`. Never `ml-/mr-`, `left-/right-`, `text-left/right`,
|
|
153
|
-
`flex-row-reverse`.
|
|
154
|
-
- **Motion**: wrap every animation in a `prefers-reduced-motion: reduce`
|
|
155
|
-
guard. One well-orchestrated reveal beats scattered effects.
|
|
156
|
-
- **Fonts**: any face used for body or headlines must include the store's
|
|
157
|
-
script (e.g. Google Fonts `hebrew` subset). Latin-only display faces are
|
|
158
|
-
accent-only.
|
|
159
|
-
|
|
160
|
-
## Never do
|
|
161
|
-
|
|
162
|
-
- Modify `src/core/`, `src/app/api/`, or checkout/auth/account internals.
|
|
163
|
-
- Remove accessibility attributes (`aria-*`, `role`, `alt`, focus styles).
|
|
164
|
-
- Hardcode catalog content, prices, or currency symbols.
|
|
165
|
-
- Swallow the add-to-cart / checkout error states — restyle them, keep them.
|
|
166
|
-
- Introduce new runtime dependencies without flagging it.
|
|
167
|
-
|
|
168
|
-
## Adding things
|
|
169
|
-
|
|
170
|
-
- New homepage section → new component in `src/ui/home/`, composed in
|
|
171
|
-
`home-client.tsx`, data via existing hooks only.
|
|
172
|
-
- New UI copy → add keys to **both** `messages/he.json` and
|
|
173
|
-
`messages/en.json` (or all supported locales), use `useTranslations()`.
|
|
174
|
-
- New microinteraction → CSS-first; JS only for things CSS cannot do.
|
|
1
|
+
# AI-GUIDE — designing this store safely
|
|
2
|
+
|
|
3
|
+
You (an AI coding assistant, or a human designer) have been asked to redesign
|
|
4
|
+
this storefront. This guide is the contract that lets you go as bold as you
|
|
5
|
+
want without breaking commerce. It was distilled from real agency builds.
|
|
6
|
+
|
|
7
|
+
## The one rule
|
|
8
|
+
|
|
9
|
+
**`src/core/` is the platform's. `src/ui/` is yours.**
|
|
10
|
+
|
|
11
|
+
Everything under `src/ui/` may be rewritten from scratch — layouts, markup,
|
|
12
|
+
classes, animations, entire visual languages. (Canvas-mode stores —
|
|
13
|
+
scaffolded with `--canvas` — ship `src/ui/` as bare unstyled skeletons with
|
|
14
|
+
`DESIGN ME` markers; same rules apply, you're just starting from zero.) Everything under `src/core/`
|
|
15
|
+
(and `src/app/api/`) keeps the store working: cart, checkout, variants,
|
|
16
|
+
inventory, auth, SEO, i18n. Never modify it. If a redesign seems to require a
|
|
17
|
+
core change, stop and say so instead.
|
|
18
|
+
|
|
19
|
+
## File map
|
|
20
|
+
|
|
21
|
+
| Path | Owner | Notes |
|
|
22
|
+
|------|-------|-------|
|
|
23
|
+
| `src/ui/layout/` | you | header, footer, announcement bar |
|
|
24
|
+
| `src/ui/home/` | you | homepage sections |
|
|
25
|
+
| `src/ui/product/` | you | card, grid, listing, product page, price, badges, selectors |
|
|
26
|
+
| `src/ui/cart/` | you | cart page pieces |
|
|
27
|
+
| `src/ui/shared/` | you | loader, image wrapper |
|
|
28
|
+
| `src/app/globals.css` | you | tokens + global styles |
|
|
29
|
+
| `src/components/ui/` | shared | shadcn/ui primitives — compose them, extend via variants |
|
|
30
|
+
| `src/core/**` | platform | hooks, lib, providers — read, never edit |
|
|
31
|
+
| `src/components/{checkout,auth,account,seo}` | platform | core-styled in v1; they inherit your tokens |
|
|
32
|
+
| `src/app/**` | platform | thin routes; edit only to wire new ui components |
|
|
33
|
+
|
|
34
|
+
## The dialect (shadcn/ui + lucide + cn)
|
|
35
|
+
|
|
36
|
+
This store speaks the same component dialect as Lovable / v0 / Bolt output:
|
|
37
|
+
|
|
38
|
+
- **`src/components/ui/` holds official shadcn/ui primitives** (button, card,
|
|
39
|
+
badge, input, label, textarea, select, checkbox, radio-group, separator,
|
|
40
|
+
accordion, dialog, sheet, skeleton, tabs, tooltip). Compose them in `src/ui/`
|
|
41
|
+
instead of hand-rolling controls. Need a new look? **Extend via CVA
|
|
42
|
+
variants** (add a variant to `buttonVariants`/`badgeVariants`), never by
|
|
43
|
+
inline-overriding the same styles in twenty call sites.
|
|
44
|
+
- **Icons: lucide-react only.** No inline `<svg>` paths, no emoji-as-icons,
|
|
45
|
+
no second icon set. Consistent 16/20/24px sizes.
|
|
46
|
+
- **Class merging: `cn()`** from `@/core/lib/utils` (clsx + tailwind-merge) —
|
|
47
|
+
it's the same helper shadcn expects, already wired into every primitive.
|
|
48
|
+
- **Tokens drive everything**: primitives read `--primary`, `--card`,
|
|
49
|
+
`--input`, `--ring`, `--radius`, etc. from `globals.css`. Restyle the store
|
|
50
|
+
by changing tokens (and variants), not by scattering literal colors.
|
|
51
|
+
- `rounded`, `rounded-md`, `rounded-lg` all derive from `--radius`
|
|
52
|
+
(shadcn convention), so corner radius follows the theme automatically.
|
|
53
|
+
|
|
54
|
+
## The hook contract (your data supply)
|
|
55
|
+
|
|
56
|
+
UI components get *everything* from `@/core/hooks/*` and
|
|
57
|
+
`@/core/providers/store-provider` — never from `@/core/lib` directly:
|
|
58
|
+
|
|
59
|
+
- `useHomeData()` → `{ products, banners, loading }`
|
|
60
|
+
- `useProductListing()` → products + filters/sort/facets/pagination + handlers
|
|
61
|
+
- `useProductPage(product)` → variant/image selection, `priceInfo`, `inventory`,
|
|
62
|
+
`quantity`, `handleAddToCart`, `addingToCart`, `addedMessage`, customization
|
|
63
|
+
+ modifier state and errors
|
|
64
|
+
- `useCartPage()` / `useCart()` → `{ cart, itemCount, totals, refreshCart }`
|
|
65
|
+
|
|
66
|
+
Hooks return data and handlers, never JSX. All catalog content (names, prices,
|
|
67
|
+
images, stock) comes from them — **never hardcode products**.
|
|
68
|
+
|
|
69
|
+
## Verification loop (before you declare anything done)
|
|
70
|
+
|
|
71
|
+
1. `pnpm exec tsc --noEmit` → must be 0.
|
|
72
|
+
2. `pnpm dev` → drive the real flow you changed: home → listing → product →
|
|
73
|
+
add to cart → cart → checkout page renders.
|
|
74
|
+
3. Screenshot desktop (1440) AND mobile (390), in the store's language.
|
|
75
|
+
4. If the store is RTL: check nothing is left-anchored that should be
|
|
76
|
+
right-anchored, and directional arrows point with the reading direction.
|
|
77
|
+
|
|
78
|
+
## The quality bar (distilled from Lovable / v0 / Bolt system prompts)
|
|
79
|
+
|
|
80
|
+
Beautiful is the top priority — the first render must wow. Hard rules:
|
|
81
|
+
|
|
82
|
+
1. **Design system first**: define all HSL semantic tokens in globals.css
|
|
83
|
+
BEFORE styling any component. Never direct colors (`text-white`,
|
|
84
|
+
`bg-black`) in classNames — tokens only.
|
|
85
|
+
2. **Color budget: exactly 3-5 colors.** 1 brand color, 2-3 neutrals, 1-2
|
|
86
|
+
accents. Never purple/violet unless the merchant asked. No gradients by
|
|
87
|
+
default — solid colors; gradients only as subtle accents if requested.
|
|
88
|
+
3. **Max 2 font families** (1 display + 1 body, both with the store's
|
|
89
|
+
script). Body line-height 1.4-1.6. Nothing below 14px.
|
|
90
|
+
4. **Mobile-first**; flexbox by default, grid for true 2D; no absolute
|
|
91
|
+
positioning unless necessary.
|
|
92
|
+
5. **Tailwind discipline**: spacing scale only (`p-4`, never `p-[16px]`),
|
|
93
|
+
`gap-*` over margins between siblings, `text-balance` on headlines.
|
|
94
|
+
6. **Real imagery everywhere** — product photos from the catalog do the
|
|
95
|
+
heavy lifting; free stock hotlinks (Pexels/Unsplash) for editorial
|
|
96
|
+
sections. NEVER abstract filler shapes (gradient circles, blobs).
|
|
97
|
+
NEVER emojis as icons — one icon set, consistent 16/20/24px sizes.
|
|
98
|
+
7. **Content-rich**: no section may render empty or thin. Empty states are
|
|
99
|
+
designed states with copy and structure, not blank space.
|
|
100
|
+
8. Component variants in the design system, not inline overrides.
|
|
101
|
+
9. Semantic HTML + ARIA + alt text + `sr-only` labels — always.
|
|
102
|
+
10. **Verify with your eyes**: screenshot after each major surface, critique
|
|
103
|
+
it ("would a Lovable user accept this?"), fix, and only then move on.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Motion language (CSS-first)
|
|
107
|
+
|
|
108
|
+
The store should feel alive, premium and intentional — every animation guides
|
|
109
|
+
attention, confirms an action, or rewards exploration. Rules:
|
|
110
|
+
|
|
111
|
+
- **Timing tokens** (use these, never ad-hoc numbers): 80ms instant feedback ·
|
|
112
|
+
180ms hover · 300ms UI state change · 500-600ms section entrance · 900ms
|
|
113
|
+
hero only. Stagger siblings 40-80ms.
|
|
114
|
+
- **Easing**: entrances `cubic-bezier(0.16, 1, 0.3, 1)` (out-expo); springy
|
|
115
|
+
pops `cubic-bezier(0.34, 1.56, 0.64, 1)` (out-back); loops and hovers
|
|
116
|
+
ease-in-out. Exits faster than entrances.
|
|
117
|
+
- **Reveals**: below-the-fold sections animate on viewport entry
|
|
118
|
+
(IntersectionObserver — see `src/ui/shared/reveal.tsx`), never tied to
|
|
119
|
+
scroll distance. One orchestrated reveal per section beats scattered
|
|
120
|
+
effects; `viewport once` — do not re-animate on every scroll.
|
|
121
|
+
- **Micro-interactions**: CSS/WAAPI first (see `src/ui/shared/fly-to-cart.ts`
|
|
122
|
+
for the pattern) — ripple, bump, image zoom, quick-add slide-up are all
|
|
123
|
+
achievable without a library.
|
|
124
|
+
- **Pointer effects** (magnetic buttons, tilt cards, custom cursor, mouse
|
|
125
|
+
parallax): desktop only — gate on `(pointer: fine)` and no-op under
|
|
126
|
+
`prefers-reduced-motion`. `will-change: transform` ONLY on elements animated
|
|
127
|
+
per-frame; never sprinkle it broadly.
|
|
128
|
+
- **Never `transition-all`** — always name the property
|
|
129
|
+
(`transition-transform`, `transition-opacity`). Animate only compositor
|
|
130
|
+
properties (`transform`, `opacity`) — never layout properties
|
|
131
|
+
(width/height/top/margin). 60fps is non-negotiable.
|
|
132
|
+
- **Ambient effects** (gradient blobs, particles): maximum one per page, hero
|
|
133
|
+
only — never on inner pages.
|
|
134
|
+
- **framer-motion / GSAP are not installed.** They are allowed, but they are
|
|
135
|
+
new runtime dependencies — flag it to the user before adding.
|
|
136
|
+
|
|
137
|
+
## Hard-won gotchas (each one cost a real debugging session)
|
|
138
|
+
|
|
139
|
+
- **RTL + cloned images**: `next/image` renders its `<img>` with `inset: 0`.
|
|
140
|
+
If you clone one for an animation and set `left`, the leftover `right: 0`
|
|
141
|
+
wins in RTL documents (over-constrained boxes resolve to the RIGHT).
|
|
142
|
+
Set `inset: 'auto'` before positioning.
|
|
143
|
+
- **Never name a custom class `overline`** — it is a Tailwind utility
|
|
144
|
+
(`text-decoration-line: overline`) and will draw a line above your text.
|
|
145
|
+
- **`rounded` / `rounded-md` / `rounded-lg` all follow `--radius`** (shadcn
|
|
146
|
+
convention, wired in tailwind.config.ts) — change the token, not the
|
|
147
|
+
classes, when you want sharper or softer corners.
|
|
148
|
+
- **Hebrew has no uppercase** — remove `text-transform: uppercase` and wide
|
|
149
|
+
`letter-spacing` from heading styles; they are Latin idioms that distort
|
|
150
|
+
Hebrew (tracking is acceptable only at caption sizes).
|
|
151
|
+
- **Logical properties only**: `ms-/me-`, `ps-/pe-`, `start-/end-`,
|
|
152
|
+
`text-start/end`. Never `ml-/mr-`, `left-/right-`, `text-left/right`,
|
|
153
|
+
`flex-row-reverse`.
|
|
154
|
+
- **Motion**: wrap every animation in a `prefers-reduced-motion: reduce`
|
|
155
|
+
guard. One well-orchestrated reveal beats scattered effects.
|
|
156
|
+
- **Fonts**: any face used for body or headlines must include the store's
|
|
157
|
+
script (e.g. Google Fonts `hebrew` subset). Latin-only display faces are
|
|
158
|
+
accent-only.
|
|
159
|
+
|
|
160
|
+
## Never do
|
|
161
|
+
|
|
162
|
+
- Modify `src/core/`, `src/app/api/`, or checkout/auth/account internals.
|
|
163
|
+
- Remove accessibility attributes (`aria-*`, `role`, `alt`, focus styles).
|
|
164
|
+
- Hardcode catalog content, prices, or currency symbols.
|
|
165
|
+
- Swallow the add-to-cart / checkout error states — restyle them, keep them.
|
|
166
|
+
- Introduce new runtime dependencies without flagging it.
|
|
167
|
+
|
|
168
|
+
## Adding things
|
|
169
|
+
|
|
170
|
+
- New homepage section → new component in `src/ui/home/`, composed in
|
|
171
|
+
`home-client.tsx`, data via existing hooks only.
|
|
172
|
+
- New UI copy → add keys to **both** `messages/he.json` and
|
|
173
|
+
`messages/en.json` (or all supported locales), use `useTranslations()`.
|
|
174
|
+
- New microinteraction → CSS-first; JS only for things CSS cannot do.
|