create-brainerce-store 1.50.5 → 1.52.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/README.md +72 -0
- package/dist/index.js +146 -100
- package/messages/en.json +36 -1
- package/messages/he.json +36 -1
- package/package.json +1 -1
- package/templates/nextjs/base/.claude/commands/design.md +60 -0
- package/templates/nextjs/base/.env.local.ejs +5 -0
- package/templates/nextjs/base/.eslintrc.json +57 -3
- package/templates/nextjs/base/AGENTS.md +41 -0
- package/templates/nextjs/base/AI-GUIDE.md +143 -0
- package/templates/nextjs/base/CLAUDE.md +52 -0
- package/templates/nextjs/base/TRANSLATIONS.md +1 -1
- package/templates/nextjs/base/next.config.ts +2 -2
- package/templates/nextjs/base/package.json.ejs +52 -39
- package/templates/nextjs/base/src/app/account/page.tsx +5 -5
- package/templates/nextjs/base/src/app/api/auth/logout/route.ts +1 -1
- package/templates/nextjs/base/src/app/api/auth/reset-password/route.ts +2 -2
- package/templates/nextjs/base/src/app/api/store/[...path]/route.ts +1 -1
- package/templates/nextjs/base/src/app/auth/callback/page.tsx +4 -4
- package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +4 -4
- package/templates/nextjs/base/src/app/blog/page.tsx.ejs +2 -2
- package/templates/nextjs/base/src/app/cart/page.tsx +2 -173
- package/templates/nextjs/base/src/app/checkout/page.tsx +12 -11
- package/templates/nextjs/base/src/app/contact/page.tsx +3 -3
- package/templates/nextjs/base/src/app/faq/page.tsx.ejs +2 -2
- package/templates/nextjs/base/src/app/forgot-password/page.tsx +4 -4
- package/templates/nextjs/base/src/app/globals.css +36 -30
- package/templates/nextjs/base/src/app/layout.tsx.ejs +12 -12
- package/templates/nextjs/base/src/app/login/page.tsx +4 -4
- package/templates/nextjs/base/src/app/order-confirmation/page.tsx +19 -12
- package/templates/nextjs/base/src/app/page.tsx +4 -4
- package/templates/nextjs/base/src/app/pages/[slug]/page.tsx.ejs +3 -3
- package/templates/nextjs/base/src/app/payment-complete/page.tsx +1 -1
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +6 -6
- package/templates/nextjs/base/src/app/products/page.tsx +4 -623
- package/templates/nextjs/base/src/app/register/page.tsx +4 -4
- package/templates/nextjs/base/src/app/reset-password/page.tsx +5 -5
- package/templates/nextjs/base/src/app/sitemap.ts +1 -1
- package/templates/nextjs/base/src/app/verify-email/page.tsx +5 -5
- package/templates/nextjs/base/src/components/account/address-book.tsx +3 -3
- package/templates/nextjs/base/src/components/account/order-customizations.tsx +3 -3
- package/templates/nextjs/base/src/components/account/order-history.tsx +13 -5
- package/templates/nextjs/base/src/components/account/order-payment-block.tsx +2 -2
- package/templates/nextjs/base/src/components/account/order-shipping-block.tsx +2 -2
- package/templates/nextjs/base/src/components/account/order-status-timeline.tsx +2 -2
- package/templates/nextjs/base/src/components/account/profile-section.tsx +3 -3
- package/templates/nextjs/base/src/components/auth/login-form.tsx +4 -4
- package/templates/nextjs/base/src/components/auth/oauth-buttons.tsx +4 -4
- package/templates/nextjs/base/src/components/auth/register-form.tsx +4 -4
- package/templates/nextjs/base/src/components/brainerce-bot.tsx +2 -2
- package/templates/nextjs/base/src/components/checkout/checkout-form.tsx +24 -3
- package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +2 -2
- package/templates/nextjs/base/src/components/checkout/delivery-method-step.tsx +2 -2
- package/templates/nextjs/base/src/components/checkout/order-bump-card.tsx +4 -4
- package/templates/nextjs/base/src/components/checkout/payment-step.tsx +20 -16
- package/templates/nextjs/base/src/components/checkout/pickup-step.tsx +3 -3
- package/templates/nextjs/base/src/components/checkout/shipping-step.tsx +3 -3
- package/templates/nextjs/base/src/components/checkout/tax-display.tsx +3 -3
- package/templates/nextjs/base/src/components/seo/organization-json-ld.tsx +2 -2
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +3 -3
- package/templates/nextjs/base/src/components/ui/accordion.tsx +53 -0
- package/templates/nextjs/base/src/components/ui/badge.tsx +32 -0
- package/templates/nextjs/base/src/components/ui/button.tsx +49 -0
- package/templates/nextjs/base/src/components/ui/card.tsx +55 -0
- package/templates/nextjs/base/src/components/ui/checkbox.tsx +28 -0
- package/templates/nextjs/base/src/components/ui/dialog.tsx +107 -0
- package/templates/nextjs/base/src/components/ui/input.tsx +22 -0
- package/templates/nextjs/base/src/components/ui/label.tsx +21 -0
- package/templates/nextjs/base/src/components/ui/radio-group.tsx +38 -0
- package/templates/nextjs/base/src/components/ui/select.tsx +153 -0
- package/templates/nextjs/base/src/components/ui/separator.tsx +26 -0
- package/templates/nextjs/base/src/components/ui/sheet.tsx +125 -0
- package/templates/nextjs/base/src/components/ui/skeleton.tsx +7 -0
- package/templates/nextjs/base/src/components/ui/tabs.tsx +55 -0
- package/templates/nextjs/base/src/components/ui/textarea.tsx +21 -0
- package/templates/nextjs/base/src/components/ui/tooltip.tsx +32 -0
- package/templates/nextjs/base/src/core/hooks/use-cart-page.ts +58 -0
- package/templates/nextjs/base/src/core/hooks/use-home-data.ts +51 -0
- package/templates/nextjs/base/src/core/hooks/use-product-listing.ts +295 -0
- package/templates/nextjs/base/src/core/hooks/use-product-page.ts +278 -0
- package/templates/nextjs/base/src/{hooks → core/hooks}/use-search.ts +1 -1
- package/templates/nextjs/base/src/{lib → core/lib}/brainerce.ts.ejs +1 -1
- package/templates/nextjs/base/src/core/lib/product-options.ts +121 -0
- package/templates/nextjs/base/src/{lib → core/lib}/resolve-currency.ts +1 -1
- package/templates/nextjs/base/src/{lib → core/lib}/safe-redirect.ts +1 -1
- package/templates/nextjs/base/src/{lib → core/lib}/sanitize.ts.ejs +1 -1
- package/templates/nextjs/base/src/{lib → core/lib}/use-currency.ts +1 -1
- package/templates/nextjs/base/src/{providers → core/providers}/store-provider.tsx.ejs +4 -4
- package/templates/nextjs/base/src/{components → ui}/cart/cart-bundle-offer.tsx +22 -16
- package/templates/nextjs/base/src/{components → ui}/cart/cart-item.tsx +8 -14
- package/templates/nextjs/base/src/{components → ui}/cart/cart-nudges.tsx +28 -39
- package/templates/nextjs/base/src/{components → ui}/cart/cart-summary.tsx +7 -5
- package/templates/nextjs/base/src/{components → ui}/cart/cart-upgrade-banner.tsx +13 -28
- package/templates/nextjs/base/src/ui/cart/cart-view.tsx +140 -0
- package/templates/nextjs/base/src/{components → ui}/cart/coupon-input.tsx +14 -25
- package/templates/nextjs/base/src/{components → ui}/cart/free-shipping-bar.tsx +6 -7
- package/templates/nextjs/base/src/{components → ui}/cart/reservation-countdown.tsx +95 -103
- package/templates/nextjs/base/src/ui/home/discount-banner-strip.tsx +20 -0
- package/templates/nextjs/base/src/ui/home/featured-products-section.tsx +24 -0
- package/templates/nextjs/base/src/ui/home/hero-section.tsx +27 -0
- package/templates/nextjs/base/src/ui/home/home-client.tsx +29 -0
- package/templates/nextjs/base/src/{components/content → ui/layout}/announcement-bar.tsx.ejs +116 -125
- package/templates/nextjs/base/src/ui/layout/faq-section.tsx.ejs +90 -0
- package/templates/nextjs/base/src/{components/content → ui/layout}/header-account.tsx +5 -20
- package/templates/nextjs/base/src/ui/layout/language-switcher.tsx.ejs +80 -0
- package/templates/nextjs/base/src/{components/content → ui/layout}/rich-text-block.tsx.ejs +1 -1
- package/templates/nextjs/base/src/{components/content → ui/layout}/site-footer.tsx.ejs +144 -164
- package/templates/nextjs/base/src/{components/content → ui/layout}/site-header.tsx.ejs +152 -182
- package/templates/nextjs/base/src/{components/products → ui/product}/customization-fields.tsx +457 -478
- package/templates/nextjs/base/src/{components/products → ui/product}/discount-badge.tsx +18 -22
- package/templates/nextjs/base/src/{components/products → ui/product}/frequently-bought-together.tsx +21 -33
- package/templates/nextjs/base/src/ui/product/modifier-group-selector.tsx +206 -0
- package/templates/nextjs/base/src/{components/shared → ui/product}/price-display.tsx +5 -4
- package/templates/nextjs/base/src/{components/products → ui/product}/product-card.tsx +238 -271
- package/templates/nextjs/base/src/{app/products/[slug] → ui/product}/product-client-section.tsx +455 -631
- package/templates/nextjs/base/src/{components/products → ui/product}/product-grid.tsx +3 -3
- package/templates/nextjs/base/src/ui/product/product-listing.tsx +446 -0
- package/templates/nextjs/base/src/{components/products → ui/product}/recommendation-section.tsx +102 -107
- package/templates/nextjs/base/src/{components/reviews → ui/product}/review-form.tsx +46 -45
- package/templates/nextjs/base/src/{components/reviews/reviews-section.tsx → ui/product/reviews-section.tsx.ejs} +38 -15
- package/templates/nextjs/base/src/{components/products → ui/product}/stock-badge.tsx +61 -63
- package/templates/nextjs/base/src/{components/products → ui/product}/variant-selector.tsx +3 -3
- package/templates/nextjs/base/src/{components → ui}/shared/cdn-image.tsx +1 -1
- package/templates/nextjs/base/src/{components → ui}/shared/loading-spinner.tsx +2 -2
- package/templates/nextjs/base/tailwind.config.ts +69 -30
- package/templates/nextjs/designs/atelier/app-overlay/layout.tsx.ejs +251 -0
- package/templates/nextjs/designs/atelier/globals.css +396 -0
- package/templates/nextjs/designs/atelier/messages-patch/en.json +99 -0
- package/templates/nextjs/designs/atelier/messages-patch/he.json +99 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-bundle-offer.tsx +110 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-drawer.tsx +163 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-item.tsx +140 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-nudges.tsx +34 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-summary.tsx +107 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-upgrade-banner.tsx +123 -0
- package/templates/nextjs/designs/atelier/ui/cart/cart-view.tsx +147 -0
- package/templates/nextjs/designs/atelier/ui/cart/coupon-input.tsx +142 -0
- package/templates/nextjs/designs/atelier/ui/cart/free-shipping-bar.tsx +77 -0
- package/templates/nextjs/designs/atelier/ui/cart/reservation-countdown.tsx +89 -0
- package/templates/nextjs/designs/atelier/ui/home/benefits-band.tsx +34 -0
- package/templates/nextjs/designs/atelier/ui/home/category-tiles.tsx +148 -0
- package/templates/nextjs/designs/atelier/ui/home/discount-banner-strip.tsx +27 -0
- package/templates/nextjs/designs/atelier/ui/home/editorial-band.tsx +73 -0
- package/templates/nextjs/designs/atelier/ui/home/featured-products-section.tsx +36 -0
- package/templates/nextjs/designs/atelier/ui/home/hero-section.tsx +148 -0
- package/templates/nextjs/designs/atelier/ui/home/home-client.tsx +54 -0
- package/templates/nextjs/designs/atelier/ui/home/newsletter-section.tsx +78 -0
- package/templates/nextjs/designs/atelier/ui/home/testimonials-band.tsx +46 -0
- package/templates/nextjs/designs/atelier/ui/layout/announcement-bar.tsx +118 -0
- package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +96 -0
- package/templates/nextjs/designs/atelier/ui/layout/header-account.tsx +36 -0
- package/templates/nextjs/designs/atelier/ui/layout/header-cart.tsx +36 -0
- package/templates/nextjs/designs/atelier/ui/layout/language-switcher.tsx.ejs +137 -0
- package/templates/nextjs/designs/atelier/ui/layout/nav-url.ts +14 -0
- package/templates/nextjs/designs/atelier/ui/layout/rich-text-block.tsx +34 -0
- package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +141 -0
- package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +138 -0
- package/templates/nextjs/designs/atelier/ui/product/customization-fields.tsx +466 -0
- package/templates/nextjs/designs/atelier/ui/product/discount-badge.tsx +17 -0
- package/templates/nextjs/designs/atelier/ui/product/frequently-bought-together.tsx +196 -0
- package/templates/nextjs/designs/atelier/ui/product/modifier-group-selector.tsx +193 -0
- package/templates/nextjs/designs/atelier/ui/product/price-display.tsx +69 -0
- package/templates/nextjs/designs/atelier/ui/product/product-card.tsx +260 -0
- package/templates/nextjs/designs/atelier/ui/product/product-client-section.tsx +471 -0
- package/templates/nextjs/designs/atelier/ui/product/product-grid.tsx +47 -0
- package/templates/nextjs/designs/atelier/ui/product/product-listing.tsx +260 -0
- package/templates/nextjs/designs/atelier/ui/product/recommendation-section.tsx +95 -0
- package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +267 -0
- package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -0
- package/templates/nextjs/designs/atelier/ui/product/stock-badge.tsx +66 -0
- package/templates/nextjs/designs/atelier/ui/product/variant-selector.tsx +206 -0
- package/templates/nextjs/designs/atelier/ui/shared/cdn-image.tsx +29 -0
- package/templates/nextjs/designs/atelier/ui/shared/fly-to-cart.ts +86 -0
- package/templates/nextjs/designs/atelier/ui/shared/icons.tsx +269 -0
- package/templates/nextjs/designs/atelier/ui/shared/loading-spinner.tsx +64 -0
- package/templates/nextjs/designs/atelier/ui/shared/reveal.tsx +71 -0
- package/templates/nextjs/designs/atelier/ui/shared/select-menu.tsx +125 -0
- package/templates/nextjs/themes/luxury/globals.css +405 -399
- package/templates/nextjs/themes/minimal/globals.css +36 -30
- package/templates/nextjs/themes/playful/globals.css +406 -400
- package/templates/nextjs/ui-canvas/cart/cart-bundle-offer.tsx +89 -0
- package/templates/nextjs/ui-canvas/cart/cart-item.tsx +123 -0
- package/templates/nextjs/ui-canvas/cart/cart-nudges.tsx +27 -0
- package/templates/nextjs/ui-canvas/cart/cart-summary.tsx +99 -0
- package/templates/nextjs/ui-canvas/cart/cart-upgrade-banner.tsx +105 -0
- package/templates/nextjs/ui-canvas/cart/cart-view.tsx +106 -0
- package/templates/nextjs/ui-canvas/cart/coupon-input.tsx +119 -0
- package/templates/nextjs/ui-canvas/cart/free-shipping-bar.tsx +54 -0
- package/templates/nextjs/ui-canvas/cart/reservation-countdown.tsx +81 -0
- package/templates/nextjs/ui-canvas/home/discount-banner-strip.tsx +19 -0
- package/templates/nextjs/ui-canvas/home/featured-products-section.tsx +23 -0
- package/templates/nextjs/ui-canvas/home/hero-section.tsx +21 -0
- package/templates/nextjs/ui-canvas/home/home-client.tsx +26 -0
- package/templates/nextjs/ui-canvas/layout/announcement-bar.tsx.ejs +101 -0
- package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +71 -0
- package/templates/nextjs/ui-canvas/layout/header-account.tsx +31 -0
- package/templates/nextjs/{base/src/components → ui-canvas}/layout/language-switcher.tsx.ejs +76 -70
- package/templates/nextjs/ui-canvas/layout/rich-text-block.tsx.ejs +36 -0
- package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +82 -0
- package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +119 -0
- package/templates/nextjs/ui-canvas/product/customization-fields.tsx +445 -0
- package/templates/nextjs/ui-canvas/product/discount-badge.tsx +19 -0
- package/templates/nextjs/ui-canvas/product/frequently-bought-together.tsx +168 -0
- package/templates/nextjs/ui-canvas/product/modifier-group-selector.tsx +165 -0
- package/templates/nextjs/ui-canvas/product/price-display.tsx +52 -0
- package/templates/nextjs/ui-canvas/product/product-card.tsx +197 -0
- package/templates/nextjs/ui-canvas/product/product-client-section.tsx +352 -0
- package/templates/nextjs/ui-canvas/product/product-grid.tsx +27 -0
- package/templates/nextjs/ui-canvas/product/product-listing.tsx +224 -0
- package/templates/nextjs/ui-canvas/product/recommendation-section.tsx +99 -0
- package/templates/nextjs/ui-canvas/product/review-form.tsx +266 -0
- package/templates/nextjs/ui-canvas/product/reviews-section.tsx.ejs +96 -0
- package/templates/nextjs/ui-canvas/product/stock-badge.tsx +45 -0
- package/templates/nextjs/ui-canvas/product/variant-selector.tsx +212 -0
- package/templates/nextjs/ui-canvas/shared/cdn-image.tsx +31 -0
- package/templates/nextjs/ui-canvas/shared/loading-spinner.tsx +27 -0
- package/templates/nextjs/base/src/app/home-client.tsx +0 -98
- package/templates/nextjs/base/src/components/content/faq-section.tsx.ejs +0 -103
- package/templates/nextjs/base/src/components/products/modifier-group-selector.tsx +0 -238
- /package/templates/nextjs/base/src/{lib → core/lib}/auth.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/csrf.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/image-hosts.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/navigation.tsx.ejs +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/nonce.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/sanitize-html.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/seo.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/store-info.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/translations.ts.ejs +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/utils.ts +0 -0
- /package/templates/nextjs/base/src/{lib → core/lib}/validation.ts +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline icon set — minimal 24px-grid stroke icons (lucide-style).
|
|
3
|
+
* The project ships no icon dependency; every icon in the storefront comes
|
|
4
|
+
* from here so sizing (16/20/24) and stroke weight stay consistent.
|
|
5
|
+
* All icons are decorative by default (aria-hidden) — pair with sr-only text.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
export type IconProps = {
|
|
10
|
+
size?: 16 | 18 | 20 | 24 | 28 | 32;
|
|
11
|
+
className?: string;
|
|
12
|
+
/** stroke width — 1.75 default matches the light, jewelry-grade look */
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function Base({
|
|
17
|
+
size = 20,
|
|
18
|
+
className,
|
|
19
|
+
strokeWidth = 1.75,
|
|
20
|
+
children,
|
|
21
|
+
fill = 'none',
|
|
22
|
+
}: IconProps & { children: React.ReactNode; fill?: string }) {
|
|
23
|
+
return (
|
|
24
|
+
<svg
|
|
25
|
+
width={size}
|
|
26
|
+
height={size}
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
fill={fill}
|
|
29
|
+
stroke="currentColor"
|
|
30
|
+
strokeWidth={strokeWidth}
|
|
31
|
+
strokeLinecap="round"
|
|
32
|
+
strokeLinejoin="round"
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
className={className}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</svg>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function IconBag(p: IconProps) {
|
|
42
|
+
return (
|
|
43
|
+
<Base {...p}>
|
|
44
|
+
<path d="M6 7h12l1.2 12.2a1.8 1.8 0 0 1-1.8 1.8H6.6a1.8 1.8 0 0 1-1.8-1.8L6 7Z" />
|
|
45
|
+
<path d="M9 10V6a3 3 0 0 1 6 0v4" />
|
|
46
|
+
</Base>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function IconUser(p: IconProps) {
|
|
51
|
+
return (
|
|
52
|
+
<Base {...p}>
|
|
53
|
+
<circle cx="12" cy="8" r="3.5" />
|
|
54
|
+
<path d="M5 20c1.4-3 4-4.5 7-4.5s5.6 1.5 7 4.5" />
|
|
55
|
+
</Base>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function IconMenu(p: IconProps) {
|
|
60
|
+
return (
|
|
61
|
+
<Base {...p}>
|
|
62
|
+
<path d="M4 7h16M4 12h16M4 17h16" />
|
|
63
|
+
</Base>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function IconX(p: IconProps) {
|
|
68
|
+
return (
|
|
69
|
+
<Base {...p}>
|
|
70
|
+
<path d="M6 6l12 12M18 6L6 18" />
|
|
71
|
+
</Base>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function IconPlus(p: IconProps) {
|
|
76
|
+
return (
|
|
77
|
+
<Base {...p}>
|
|
78
|
+
<path d="M12 5v14M5 12h14" />
|
|
79
|
+
</Base>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function IconMinus(p: IconProps) {
|
|
84
|
+
return (
|
|
85
|
+
<Base {...p}>
|
|
86
|
+
<path d="M5 12h14" />
|
|
87
|
+
</Base>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function IconTrash(p: IconProps) {
|
|
92
|
+
return (
|
|
93
|
+
<Base {...p}>
|
|
94
|
+
<path d="M4 7h16M10 11v6M14 11v6M6 7l1 13a1.5 1.5 0 0 0 1.5 1.3h7A1.5 1.5 0 0 0 17 20l1-13M9 7V5a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 15 5v2" />
|
|
95
|
+
</Base>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function IconCheck(p: IconProps) {
|
|
100
|
+
return (
|
|
101
|
+
<Base {...p}>
|
|
102
|
+
<path d="M5 12.5 10 17.5 19 7" />
|
|
103
|
+
</Base>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function IconStar({ filled = true, ...p }: IconProps & { filled?: boolean }) {
|
|
108
|
+
return (
|
|
109
|
+
<Base {...p} fill={filled ? 'currentColor' : 'none'} strokeWidth={filled ? 0 : 1.5}>
|
|
110
|
+
<path d="M12 3.2 14.7 8.7 20.8 9.6 16.4 13.9 17.4 20 12 17.1 6.6 20 7.6 13.9 3.2 9.6 9.3 8.7 12 3.2Z" />
|
|
111
|
+
</Base>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function IconTruck(p: IconProps) {
|
|
116
|
+
return (
|
|
117
|
+
<Base {...p}>
|
|
118
|
+
<path d="M3 6.5h11v10H3zM14 10h3.5l3 3v3.5h-3" />
|
|
119
|
+
<circle cx="7" cy="17.5" r="1.8" />
|
|
120
|
+
<circle cx="17" cy="17.5" r="1.8" />
|
|
121
|
+
</Base>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function IconShield(p: IconProps) {
|
|
126
|
+
return (
|
|
127
|
+
<Base {...p}>
|
|
128
|
+
<path d="M12 3.5 19 6v5.5c0 4.5-3 7.7-7 9-4-1.3-7-4.5-7-9V6l7-2.5Z" />
|
|
129
|
+
<path d="m9 11.8 2.2 2.2L15.5 9.5" />
|
|
130
|
+
</Base>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function IconGem(p: IconProps) {
|
|
135
|
+
return (
|
|
136
|
+
<Base {...p}>
|
|
137
|
+
<path d="M7 4h10l3.5 5L12 20.5 1.5 9 5 4Z M1.5 9h21M9.5 4 12 9l2.5-5M12 20.5 9.5 9M12 20.5 14.5 9" strokeWidth={1.4} />
|
|
138
|
+
</Base>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function IconReturn(p: IconProps) {
|
|
143
|
+
return (
|
|
144
|
+
<Base {...p}>
|
|
145
|
+
<path d="M4 9h11a5 5 0 0 1 0 10H8" />
|
|
146
|
+
<path d="M8 5 4 9l4 4" />
|
|
147
|
+
</Base>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function IconChevronDown(p: IconProps) {
|
|
152
|
+
return (
|
|
153
|
+
<Base {...p}>
|
|
154
|
+
<path d="m6 9 6 6 6-6" />
|
|
155
|
+
</Base>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Points toward the inline-end (reading direction). Add className="rtl-flip". */
|
|
160
|
+
export function IconArrowEnd(p: IconProps) {
|
|
161
|
+
return (
|
|
162
|
+
<Base {...p}>
|
|
163
|
+
<path d="M4 12h16M14 6l6 6-6 6" />
|
|
164
|
+
</Base>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function IconSparkle(p: IconProps) {
|
|
169
|
+
return (
|
|
170
|
+
<Base {...p}>
|
|
171
|
+
<path d="M12 4c.7 3.6 2.4 5.3 6 6-3.6.7-5.3 2.4-6 6-.7-3.6-2.4-5.3-6-6 3.6-.7 5.3-2.4 6-6Z" />
|
|
172
|
+
<path d="M19 15.5c.3 1.5 1 2.2 2.5 2.5-1.5.3-2.2 1-2.5 2.5-.3-1.5-1-2.2-2.5-2.5 1.5-.3 2.2-1 2.5-2.5Z" strokeWidth={1.4} />
|
|
173
|
+
</Base>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function IconQuote(p: IconProps) {
|
|
178
|
+
return (
|
|
179
|
+
<Base {...p} fill="currentColor" strokeWidth={0}>
|
|
180
|
+
<path d="M5 6.5A4.5 4.5 0 0 0 3 11v6.5h6.5V11H6a3 3 0 0 1 2.5-3V6.5H5Zm10 0A4.5 4.5 0 0 0 13 11v6.5h6.5V11H16a3 3 0 0 1 2.5-3V6.5H15Z" />
|
|
181
|
+
</Base>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function IconMail(p: IconProps) {
|
|
186
|
+
return (
|
|
187
|
+
<Base {...p}>
|
|
188
|
+
<rect x="3" y="5.5" width="18" height="13" rx="2" />
|
|
189
|
+
<path d="m4 7.5 8 6 8-6" />
|
|
190
|
+
</Base>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function IconClock(p: IconProps) {
|
|
195
|
+
return (
|
|
196
|
+
<Base {...p}>
|
|
197
|
+
<circle cx="12" cy="12" r="8.5" />
|
|
198
|
+
<path d="M12 7.5V12l3 2" />
|
|
199
|
+
</Base>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function IconTag(p: IconProps) {
|
|
204
|
+
return (
|
|
205
|
+
<Base {...p}>
|
|
206
|
+
<path d="m3.5 12.5 8-8H20v8.5l-8 8a1.7 1.7 0 0 1-2.4 0l-6.1-6.1a1.7 1.7 0 0 1 0-2.4Z" />
|
|
207
|
+
<circle cx="15.5" cy="8.5" r="1.4" />
|
|
208
|
+
</Base>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function IconDownload(p: IconProps) {
|
|
213
|
+
return (
|
|
214
|
+
<Base {...p}>
|
|
215
|
+
<path d="M12 4v11M7 10.5 12 15.5l5-5M5 19.5h14" />
|
|
216
|
+
</Base>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Social glyphs for the footer (filled, single-color). */
|
|
221
|
+
export function IconSocial({ platform, ...p }: IconProps & { platform: string }) {
|
|
222
|
+
const key = platform.toLowerCase();
|
|
223
|
+
if (key.includes('instagram')) {
|
|
224
|
+
return (
|
|
225
|
+
<Base {...p} strokeWidth={1.6}>
|
|
226
|
+
<rect x="3.5" y="3.5" width="17" height="17" rx="4.5" />
|
|
227
|
+
<circle cx="12" cy="12" r="4" />
|
|
228
|
+
<circle cx="17.2" cy="6.8" r="0.6" fill="currentColor" stroke="none" />
|
|
229
|
+
</Base>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (key.includes('facebook')) {
|
|
233
|
+
return (
|
|
234
|
+
<Base {...p} fill="currentColor" strokeWidth={0}>
|
|
235
|
+
<path d="M13.5 21v-7h2.4l.4-3h-2.8V9.1c0-.9.3-1.5 1.6-1.5h1.3V4.9c-.2 0-1-.1-1.9-.1-1.9 0-3.3 1.2-3.3 3.4V11H8.5v3h2.7v7h2.3Z" />
|
|
236
|
+
</Base>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
if (key.includes('tiktok')) {
|
|
240
|
+
return (
|
|
241
|
+
<Base {...p} fill="currentColor" strokeWidth={0}>
|
|
242
|
+
<path d="M16.6 3c.3 2 1.5 3.3 3.4 3.6v2.8c-1.3 0-2.5-.4-3.4-1.1v5.9a5.6 5.6 0 1 1-5.6-5.6c.3 0 .6 0 .9.1v2.9a2.7 2.7 0 1 0 1.9 2.6V3h2.8Z" />
|
|
243
|
+
</Base>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
if (key.includes('whatsapp')) {
|
|
247
|
+
return (
|
|
248
|
+
<Base {...p} strokeWidth={1.6}>
|
|
249
|
+
<path d="M12 3.5a8.5 8.5 0 0 0-7.3 12.8L3.5 20.5l4.3-1.1A8.5 8.5 0 1 0 12 3.5Z" />
|
|
250
|
+
<path d="M9 8.8c-.3 2.5 3.7 6.5 6.2 6.2l.6-1.5-2-1-.8.6c-.8-.4-1.7-1.3-2.1-2.1l.6-.8-1-2-1.5.6Z" strokeWidth={1.3} />
|
|
251
|
+
</Base>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
if (key.includes('youtube')) {
|
|
255
|
+
return (
|
|
256
|
+
<Base {...p} strokeWidth={1.6}>
|
|
257
|
+
<rect x="2.5" y="6" width="19" height="12" rx="3" />
|
|
258
|
+
<path d="m10 9.5 5 2.5-5 2.5v-5Z" fill="currentColor" stroke="none" />
|
|
259
|
+
</Base>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
// Fallback: globe
|
|
263
|
+
return (
|
|
264
|
+
<Base {...p} strokeWidth={1.6}>
|
|
265
|
+
<circle cx="12" cy="12" r="8.5" />
|
|
266
|
+
<path d="M3.5 12h17M12 3.5c-4.7 4.7-4.7 12.3 0 17 4.7-4.7 4.7-12.3 0-17Z" />
|
|
267
|
+
</Base>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from '@/core/lib/translations';
|
|
4
|
+
import { cn } from '@/core/lib/utils';
|
|
5
|
+
import { IconGem } from '@/ui/shared/icons';
|
|
6
|
+
|
|
7
|
+
interface LoadingSpinnerProps {
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RING_SIZE: Record<'sm' | 'md', string> = {
|
|
13
|
+
sm: 'h-4 w-4 border-2',
|
|
14
|
+
md: 'h-7 w-7 border-2',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Loading indicator. `sm`/`md` stay quiet ring spinners for buttons and
|
|
19
|
+
* inline waits; `lg` (the full-page state) is the Atelier "polishing" mark —
|
|
20
|
+
* a gem resting inside a ring band with a light orbiting around it, plus the
|
|
21
|
+
* visible loading line. Static under prefers-reduced-motion.
|
|
22
|
+
* Keeps `role="status"` and the sm/md/lg `size` contract.
|
|
23
|
+
*/
|
|
24
|
+
export function LoadingSpinner({ size = 'md', className }: LoadingSpinnerProps) {
|
|
25
|
+
const t = useTranslations('common');
|
|
26
|
+
|
|
27
|
+
if (size === 'lg') {
|
|
28
|
+
return (
|
|
29
|
+
<span
|
|
30
|
+
role="status"
|
|
31
|
+
data-size={size}
|
|
32
|
+
className={cn(
|
|
33
|
+
'flex min-h-[40vh] w-full flex-col items-center justify-center gap-4',
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
<span aria-hidden="true" className="loader-orbit">
|
|
38
|
+
<span className="loader-orbit-dot" />
|
|
39
|
+
<IconGem size={20} className="text-primary/80" />
|
|
40
|
+
</span>
|
|
41
|
+
<span className="loader-text font-display text-sm italic text-muted-foreground">
|
|
42
|
+
{t('loading')}
|
|
43
|
+
</span>
|
|
44
|
+
</span>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<span
|
|
50
|
+
role="status"
|
|
51
|
+
data-size={size}
|
|
52
|
+
className={cn('inline-flex items-center justify-center', className)}
|
|
53
|
+
>
|
|
54
|
+
<span
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
className={cn(
|
|
57
|
+
'spin inline-block rounded-full border-primary/25 border-t-primary',
|
|
58
|
+
RING_SIZE[size]
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
<span className="sr-only">{t('loading')}</span>
|
|
62
|
+
</span>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Scroll-reveal wrapper — adds `.is-visible` when the block enters the
|
|
5
|
+
* viewport. The animation itself lives in globals.css strictly inside a
|
|
6
|
+
* `prefers-reduced-motion: no-preference` guard, so with reduced motion the
|
|
7
|
+
* content is simply visible (the base .reveal-scroll styles are also inside
|
|
8
|
+
* the guard — no hidden content ever).
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import { cn } from '@/core/lib/utils';
|
|
12
|
+
|
|
13
|
+
export function Reveal({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
/** transition-delay in ms for stagger */
|
|
17
|
+
delay = 0,
|
|
18
|
+
as: Tag = 'div',
|
|
19
|
+
}: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
delay?: number;
|
|
23
|
+
as?: 'div' | 'section' | 'li' | 'span';
|
|
24
|
+
}) {
|
|
25
|
+
const ref = React.useRef<HTMLElement | null>(null);
|
|
26
|
+
const [visible, setVisible] = React.useState(false);
|
|
27
|
+
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
const el = ref.current;
|
|
30
|
+
if (!el) return;
|
|
31
|
+
if (
|
|
32
|
+
typeof window === 'undefined' ||
|
|
33
|
+
!('IntersectionObserver' in window) ||
|
|
34
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
35
|
+
) {
|
|
36
|
+
setVisible(true);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const io = new IntersectionObserver(
|
|
40
|
+
(entries) => {
|
|
41
|
+
for (const entry of entries) {
|
|
42
|
+
if (entry.isIntersecting) {
|
|
43
|
+
setVisible(true);
|
|
44
|
+
io.disconnect();
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{ rootMargin: '0px 0px -10% 0px', threshold: 0.08 }
|
|
50
|
+
);
|
|
51
|
+
io.observe(el);
|
|
52
|
+
// Safety net: never leave content hidden if the observer misfires
|
|
53
|
+
// (embedded webviews, print, prerender snapshots).
|
|
54
|
+
const failSafe = window.setTimeout(() => setVisible(true), 2000);
|
|
55
|
+
return () => {
|
|
56
|
+
io.disconnect();
|
|
57
|
+
window.clearTimeout(failSafe);
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
|
|
61
|
+
const Comp = Tag as React.ElementType;
|
|
62
|
+
return (
|
|
63
|
+
<Comp
|
|
64
|
+
ref={ref}
|
|
65
|
+
className={cn('reveal-scroll', visible && 'is-visible', className)}
|
|
66
|
+
style={delay ? { transitionDelay: `${delay}ms` } : undefined}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</Comp>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Styled replacement for toolbar `<select>`s — same popover language as the
|
|
5
|
+
* header's language switcher (pill trigger, rotating chevron, rounded menu,
|
|
6
|
+
* check on the selected row) so every dropdown in the store speaks one
|
|
7
|
+
* dialect. Closes on outside click / Escape; arrows move focus in the list.
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { cn } from '@/core/lib/utils';
|
|
11
|
+
import { IconCheck, IconChevronDown } from '@/ui/shared/icons';
|
|
12
|
+
|
|
13
|
+
export interface SelectMenuOption {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface SelectMenuProps {
|
|
19
|
+
value: string;
|
|
20
|
+
options: SelectMenuOption[];
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
ariaLabel: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SelectMenu({ value, options, onChange, ariaLabel, className }: SelectMenuProps) {
|
|
27
|
+
const [open, setOpen] = useState(false);
|
|
28
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
const listRef = useRef<HTMLUListElement>(null);
|
|
30
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!open) return;
|
|
34
|
+
function onDown(e: MouseEvent) {
|
|
35
|
+
if (rootRef.current && !rootRef.current.contains(e.target as Node)) setOpen(false);
|
|
36
|
+
}
|
|
37
|
+
function onKey(e: KeyboardEvent) {
|
|
38
|
+
if (e.key === 'Escape') {
|
|
39
|
+
setOpen(false);
|
|
40
|
+
triggerRef.current?.focus();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener('mousedown', onDown);
|
|
44
|
+
document.addEventListener('keydown', onKey);
|
|
45
|
+
return () => {
|
|
46
|
+
document.removeEventListener('mousedown', onDown);
|
|
47
|
+
document.removeEventListener('keydown', onKey);
|
|
48
|
+
};
|
|
49
|
+
}, [open]);
|
|
50
|
+
|
|
51
|
+
// Focus the selected row when the menu opens so keyboard users land in place.
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!open) return;
|
|
54
|
+
const el =
|
|
55
|
+
listRef.current?.querySelector<HTMLButtonElement>('[aria-selected="true"]') ??
|
|
56
|
+
listRef.current?.querySelector('button');
|
|
57
|
+
el?.focus();
|
|
58
|
+
}, [open]);
|
|
59
|
+
|
|
60
|
+
const selected = options.find((o) => o.value === value);
|
|
61
|
+
|
|
62
|
+
function onListKeyDown(e: React.KeyboardEvent) {
|
|
63
|
+
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
const items = Array.from(listRef.current?.querySelectorAll('button') ?? []);
|
|
66
|
+
const idx = items.indexOf(document.activeElement as HTMLButtonElement);
|
|
67
|
+
const next = e.key === 'ArrowDown' ? Math.min(items.length - 1, idx + 1) : Math.max(0, idx - 1);
|
|
68
|
+
items[next]?.focus();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<div ref={rootRef} className={cn('relative', className)}>
|
|
73
|
+
<button
|
|
74
|
+
ref={triggerRef}
|
|
75
|
+
type="button"
|
|
76
|
+
aria-label={ariaLabel}
|
|
77
|
+
aria-expanded={open}
|
|
78
|
+
aria-haspopup="listbox"
|
|
79
|
+
onClick={() => setOpen((v) => !v)}
|
|
80
|
+
className="inline-flex h-10 items-center gap-2 rounded-full border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-secondary/60"
|
|
81
|
+
>
|
|
82
|
+
{selected?.label ?? ariaLabel}
|
|
83
|
+
<IconChevronDown
|
|
84
|
+
size={16}
|
|
85
|
+
className={cn('shrink-0 text-foreground/60 transition-transform', open && 'rotate-180')}
|
|
86
|
+
/>
|
|
87
|
+
</button>
|
|
88
|
+
|
|
89
|
+
{open && (
|
|
90
|
+
<ul
|
|
91
|
+
ref={listRef}
|
|
92
|
+
role="listbox"
|
|
93
|
+
aria-label={ariaLabel}
|
|
94
|
+
onKeyDown={onListKeyDown}
|
|
95
|
+
className="absolute start-0 top-full z-50 mt-2 max-h-72 min-w-full overflow-y-auto rounded-xl border border-border/60 bg-background py-1 shadow-lg"
|
|
96
|
+
>
|
|
97
|
+
{options.map((opt) => {
|
|
98
|
+
const isSelected = opt.value === value;
|
|
99
|
+
return (
|
|
100
|
+
<li key={opt.value}>
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
role="option"
|
|
104
|
+
aria-selected={isSelected}
|
|
105
|
+
onClick={() => {
|
|
106
|
+
setOpen(false);
|
|
107
|
+
triggerRef.current?.focus();
|
|
108
|
+
if (!isSelected) onChange(opt.value);
|
|
109
|
+
}}
|
|
110
|
+
className={cn(
|
|
111
|
+
'flex w-full items-center justify-between gap-3 whitespace-nowrap px-4 py-2 text-sm transition-colors hover:bg-secondary/70',
|
|
112
|
+
isSelected ? 'font-semibold text-primary' : 'text-foreground/80'
|
|
113
|
+
)}
|
|
114
|
+
>
|
|
115
|
+
{opt.label}
|
|
116
|
+
{isSelected && <IconCheck size={16} />}
|
|
117
|
+
</button>
|
|
118
|
+
</li>
|
|
119
|
+
);
|
|
120
|
+
})}
|
|
121
|
+
</ul>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
}
|