@promakeai/cli 0.5.7 → 0.6.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 (135) hide show
  1. package/README.md +71 -71
  2. package/dist/index.js +259 -254
  3. package/dist/registry/about-page.json +3 -3
  4. package/dist/registry/about-section.json +4 -4
  5. package/dist/registry/animations.json +2 -2
  6. package/dist/registry/announcement-bar.json +4 -4
  7. package/dist/registry/api.json +1 -1
  8. package/dist/registry/auth-core.json +3 -3
  9. package/dist/registry/bento-grid-section.json +4 -4
  10. package/dist/registry/blog-core.json +5 -5
  11. package/dist/registry/blog-list-page.json +4 -4
  12. package/dist/registry/blog-section.json +4 -4
  13. package/dist/registry/cards-carousel-section.json +4 -4
  14. package/dist/registry/cart-drawer.json +4 -4
  15. package/dist/registry/cart-page.json +4 -4
  16. package/dist/registry/case-study-page.json +3 -3
  17. package/dist/registry/category-section.json +4 -4
  18. package/dist/registry/checkout-page.json +4 -4
  19. package/dist/registry/coming-soon-page-minimal.json +4 -4
  20. package/dist/registry/coming-soon-page.json +4 -4
  21. package/dist/registry/contact-info-grid.json +4 -4
  22. package/dist/registry/contact-page-centered.json +4 -4
  23. package/dist/registry/contact-page-map-overlay.json +3 -3
  24. package/dist/registry/contact-page-map-split.json +3 -3
  25. package/dist/registry/contact-page-split.json +4 -4
  26. package/dist/registry/contact-page.json +4 -4
  27. package/dist/registry/content-section.json +4 -4
  28. package/dist/registry/cookie-consent.json +4 -4
  29. package/dist/registry/cookies-page.json +3 -3
  30. package/dist/registry/cta-section.json +3 -3
  31. package/dist/registry/ecommerce-core.json +8 -8
  32. package/dist/registry/empty-page.json +3 -3
  33. package/dist/registry/faq-categorized.json +4 -4
  34. package/dist/registry/faq-simple.json +4 -4
  35. package/dist/registry/favorites-blog-block.json +1 -1
  36. package/dist/registry/favorites-blog-page.json +4 -4
  37. package/dist/registry/favorites-ecommerce-block.json +1 -1
  38. package/dist/registry/favorites-ecommerce-page.json +4 -4
  39. package/dist/registry/feature-section.json +3 -3
  40. package/dist/registry/featured-products.json +4 -4
  41. package/dist/registry/footer-detailed.json +4 -4
  42. package/dist/registry/footer-minimal.json +3 -3
  43. package/dist/registry/footer.json +3 -3
  44. package/dist/registry/forgot-password-page-split.json +4 -4
  45. package/dist/registry/forgot-password-page.json +4 -4
  46. package/dist/registry/google-adsense.json +4 -4
  47. package/dist/registry/google-map.json +2 -2
  48. package/dist/registry/header-centered-pill.json +4 -4
  49. package/dist/registry/header-ecommerce.json +4 -4
  50. package/dist/registry/header-mega.json +4 -4
  51. package/dist/registry/header-minimal.json +4 -4
  52. package/dist/registry/header-simple.json +3 -3
  53. package/dist/registry/hero-carousel.json +3 -3
  54. package/dist/registry/hero-cta.json +4 -4
  55. package/dist/registry/hero-gradient.json +4 -4
  56. package/dist/registry/hero-grid.json +4 -4
  57. package/dist/registry/hero-profile.json +3 -3
  58. package/dist/registry/hero.json +3 -3
  59. package/dist/registry/index.json +103 -103
  60. package/dist/registry/landing-page-app.json +3 -3
  61. package/dist/registry/landing-page-saas.json +3 -3
  62. package/dist/registry/login-page-split.json +4 -4
  63. package/dist/registry/login-page.json +4 -4
  64. package/dist/registry/logo-cloud.json +4 -4
  65. package/dist/registry/masonry-grid.json +3 -3
  66. package/dist/registry/my-orders-page.json +4 -4
  67. package/dist/registry/newsletter-section.json +4 -4
  68. package/dist/registry/order-card-compact.json +1 -1
  69. package/dist/registry/order-confirmation-page.json +4 -4
  70. package/dist/registry/order-detail-block.json +1 -1
  71. package/dist/registry/orders-list-block.json +1 -1
  72. package/dist/registry/payment-success-block.json +2 -2
  73. package/dist/registry/portfolio-page.json +4 -4
  74. package/dist/registry/post-card.json +4 -4
  75. package/dist/registry/post-detail-block.json +2 -2
  76. package/dist/registry/post-detail-page.json +4 -4
  77. package/dist/registry/pricing-card.json +3 -3
  78. package/dist/registry/pricing-page.json +4 -4
  79. package/dist/registry/pricing-section.json +4 -4
  80. package/dist/registry/privacy-page.json +3 -3
  81. package/dist/registry/product-card-detailed.json +4 -4
  82. package/dist/registry/product-card-hover.json +4 -4
  83. package/dist/registry/product-card.json +4 -4
  84. package/dist/registry/product-detail-block.json +2 -2
  85. package/dist/registry/product-detail-page.json +4 -4
  86. package/dist/registry/product-detail-section.json +4 -4
  87. package/dist/registry/product-quick-view.json +4 -4
  88. package/dist/registry/products-page.json +4 -4
  89. package/dist/registry/reading-progress.json +4 -4
  90. package/dist/registry/register-page-split.json +4 -4
  91. package/dist/registry/register-page.json +4 -4
  92. package/dist/registry/related-posts-block.json +1 -1
  93. package/dist/registry/related-products-block.json +2 -2
  94. package/dist/registry/reset-password-page-split.json +4 -4
  95. package/dist/registry/reset-password-page.json +4 -4
  96. package/dist/registry/service-card.json +1 -1
  97. package/dist/registry/share-buttons.json +4 -4
  98. package/dist/registry/skill-card.json +1 -1
  99. package/dist/registry/team-page.json +4 -4
  100. package/dist/registry/terms-page.json +3 -3
  101. package/dist/registry/testimonials-carousel.json +4 -4
  102. package/dist/registry/testimonials-grid.json +4 -4
  103. package/dist/registry/timeline-section.json +4 -4
  104. package/dist/registry/video-hero.json +4 -4
  105. package/dist/registry/youtube-embed.json +4 -4
  106. package/package.json +59 -56
  107. package/template/.env +6 -6
  108. package/template/README.md +54 -54
  109. package/template/eslint.config.js +41 -41
  110. package/template/package.json +95 -95
  111. package/template/public/_redirects +1 -1
  112. package/template/public/robots.txt +14 -14
  113. package/template/scripts/init-db.ts +18 -18
  114. package/template/src/App.tsx +19 -19
  115. package/template/src/components/FormField.tsx +48 -48
  116. package/template/src/components/FormFileInput.tsx +75 -75
  117. package/template/src/components/GoogleAnalytics.tsx +34 -34
  118. package/template/src/components/LanguageSwitcher.tsx +53 -53
  119. package/template/src/components/PasswordInput.tsx +60 -60
  120. package/template/src/components/ScriptInjector.tsx +62 -62
  121. package/template/src/components/Stack.tsx +39 -39
  122. package/template/src/constants/constants.json +67 -67
  123. package/template/src/db/index.ts +20 -20
  124. package/template/src/db/provider.tsx +78 -78
  125. package/template/src/db/schema.json +258 -258
  126. package/template/src/db/types.ts +195 -195
  127. package/template/src/hooks/use-debounced-value.ts +12 -12
  128. package/template/src/lang/index.ts +90 -90
  129. package/template/src/lib/api.ts +345 -345
  130. package/template/src/lib/env.ts +19 -19
  131. package/template/src/router.tsx +14 -14
  132. package/template/src/vite-env.d.ts +1 -1
  133. package/template/vite.config.ts +68 -64
  134. package/template/public/data/database.db-shm +0 -0
  135. package/template/public/data/database.db-wal +0 -0
@@ -15,25 +15,25 @@
15
15
  "path": "blog-section/index.ts",
16
16
  "type": "registry:index",
17
17
  "target": "$modules$/blog-section/index.ts",
18
- "content": "export * from './blog-section';\n"
18
+ "content": "export * from './blog-section';\r\n"
19
19
  },
20
20
  {
21
21
  "path": "blog-section/blog-section.tsx",
22
22
  "type": "registry:component",
23
23
  "target": "$modules$/blog-section/blog-section.tsx",
24
- "content": "import { useMemo } from \"react\";\nimport { Link } from \"react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { cn } from \"@/lib/utils\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n} from \"@/components/ui/card\";\nimport { useDbList } from \"@/db\";\nimport type { Post, BlogCategory } from \"@/modules/blog-core/types\";\n\ninterface BlogSectionProps {\n posts?: Post[];\n loading?: boolean;\n className?: string;\n}\n\nexport function BlogSection({\n posts: propPosts,\n loading: propLoading,\n className,\n}: BlogSectionProps) {\n const { t } = useTranslation(\"blog-section\");\n const { data: blogCategories = [] } = useDbList<BlogCategory>(\"blog_categories\");\n const categoryMap = useMemo(() => new Map(blogCategories.map(c => [c.id, c])), [blogCategories]);\n const { data: hookPosts = [], isLoading: hookLoading } = useDbList<Post>(\"posts\", {\n where: { published: 1 },\n orderBy: [{ field: \"published_at\", direction: \"DESC\" }],\n limit: 3,\n });\n\n const posts = propPosts ?? hookPosts;\n const loading = propLoading ?? hookLoading;\n\n return (\n <section className={cn(\"py-16 md:py-24\", className)}>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n {/* Header */}\n <div className=\"text-center mb-12\">\n <Badge variant=\"secondary\" className=\"mb-4\">\n {t(\"tagline\", \"Latest Updates\")}\n </Badge>\n <h2 className=\"text-3xl font-bold md:text-4xl lg:text-5xl mb-4\">\n {t(\"title\", \"From Our Blog\")}\n </h2>\n <p className=\"text-muted-foreground max-w-2xl mx-auto mb-6\">\n {t(\n \"subtitle\",\n \"Discover the latest trends, tips, and insights from our team of experts.\"\n )}\n </p>\n <Button variant=\"link\" asChild>\n <Link to=\"/blog\">\n {t(\"viewAll\", \"View all articles\")}\n <ArrowRight className=\"ml-2 h-4 w-4\" />\n </Link>\n </Button>\n </div>\n\n {/* Posts Grid */}\n <div className=\"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto\">\n {loading ? (\n [...Array(3)].map((_, i) => (\n <Card key={i} className=\"overflow-hidden p-0 animate-pulse\">\n <div className=\"aspect-video bg-muted\"></div>\n <CardHeader className=\"pt-6 pb-2\">\n <div className=\"flex items-center gap-2 mb-2\">\n <div className=\"h-5 w-16 bg-muted rounded\"></div>\n <div className=\"h-4 w-20 bg-muted rounded\"></div>\n </div>\n <div className=\"h-6 w-3/4 bg-muted rounded\"></div>\n </CardHeader>\n <CardContent className=\"py-0\">\n <div className=\"h-4 w-full bg-muted rounded mb-2\"></div>\n <div className=\"h-4 w-2/3 bg-muted rounded\"></div>\n </CardContent>\n <CardFooter className=\"pb-2\">\n <div className=\"h-4 w-24 bg-muted rounded\"></div>\n </CardFooter>\n </Card>\n ))\n ) : (\n posts.map((post) => (\n <div key={post.id} className=\"contents\" data-db-table=\"posts\" data-db-id={post.id}>\n <Card className=\"overflow-hidden group p-0\">\n <div className=\"aspect-video overflow-hidden\">\n <Link to={`/blog/${post.slug}`}>\n <img\n src={post.featured_image || \"/images/placeholder.png\"}\n alt={post.title}\n className=\"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105\"\n onError={(e) => {\n e.currentTarget.style.display = \"none\";\n }}\n />\n </Link>\n </div>\n <CardHeader className=\"pt-6 pb-2\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Badge variant=\"outline\" className=\"text-xs\">\n {categoryMap.get(post.categories?.[0] as number)?.name}\n </Badge>\n <span className=\"text-xs text-muted-foreground\">\n {new Date(post.published_at).toLocaleDateString()}\n </span>\n </div>\n <Link to={`/blog/${post.slug}`}>\n <h3 className=\"text-lg font-semibold hover:text-primary transition-colors line-clamp-2\">\n {post.title}\n </h3>\n </Link>\n </CardHeader>\n <CardContent className=\"py-0\">\n <p className=\"text-sm text-muted-foreground line-clamp-2\">\n {post.excerpt}\n </p>\n </CardContent>\n <CardFooter className=\"pb-2\">\n <Link\n to={`/blog/${post.slug}`}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center whitespace-nowrap\"\n >\n {t(\"readMore\", \"Read more\")}\n <ArrowRight className=\"ml-1 h-3 w-3 shrink-0\" />\n </Link>\n </CardFooter>\n </Card>\n </div>\n ))\n )}\n </div>\n </div>\n </section>\n );\n}\n"
24
+ "content": "import { useMemo } from \"react\";\r\nimport { Link } from \"react-router\";\r\nimport { ArrowRight } from \"lucide-react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { Badge } from \"@/components/ui/badge\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport {\r\n Card,\r\n CardContent,\r\n CardFooter,\r\n CardHeader,\r\n} from \"@/components/ui/card\";\r\nimport { useDbList } from \"@/db\";\r\nimport type { Post, BlogCategory } from \"@/modules/blog-core/types\";\r\n\r\ninterface BlogSectionProps {\r\n posts?: Post[];\r\n loading?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function BlogSection({\r\n posts: propPosts,\r\n loading: propLoading,\r\n className,\r\n}: BlogSectionProps) {\r\n const { t } = useTranslation(\"blog-section\");\r\n const { data: blogCategories = [] } = useDbList<BlogCategory>(\"blog_categories\");\r\n const categoryMap = useMemo(() => new Map(blogCategories.map(c => [c.id, c])), [blogCategories]);\r\n const { data: hookPosts = [], isLoading: hookLoading } = useDbList<Post>(\"posts\", {\r\n where: { published: 1 },\r\n orderBy: [{ field: \"published_at\", direction: \"DESC\" }],\r\n limit: 3,\r\n });\r\n\r\n const posts = propPosts ?? hookPosts;\r\n const loading = propLoading ?? hookLoading;\r\n\r\n return (\r\n <section className={cn(\"py-16 md:py-24\", className)}>\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\r\n {/* Header */}\r\n <div className=\"text-center mb-12\">\r\n <Badge variant=\"secondary\" className=\"mb-4\">\r\n {t(\"tagline\", \"Latest Updates\")}\r\n </Badge>\r\n <h2 className=\"text-3xl font-bold md:text-4xl lg:text-5xl mb-4\">\r\n {t(\"title\", \"From Our Blog\")}\r\n </h2>\r\n <p className=\"text-muted-foreground max-w-2xl mx-auto mb-6\">\r\n {t(\r\n \"subtitle\",\r\n \"Discover the latest trends, tips, and insights from our team of experts.\"\r\n )}\r\n </p>\r\n <Button variant=\"link\" asChild>\r\n <Link to=\"/blog\">\r\n {t(\"viewAll\", \"View all articles\")}\r\n <ArrowRight className=\"ml-2 h-4 w-4\" />\r\n </Link>\r\n </Button>\r\n </div>\r\n\r\n {/* Posts Grid */}\r\n <div className=\"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto\">\r\n {loading ? (\r\n [...Array(3)].map((_, i) => (\r\n <Card key={i} className=\"overflow-hidden p-0 animate-pulse\">\r\n <div className=\"aspect-video bg-muted\"></div>\r\n <CardHeader className=\"pt-6 pb-2\">\r\n <div className=\"flex items-center gap-2 mb-2\">\r\n <div className=\"h-5 w-16 bg-muted rounded\"></div>\r\n <div className=\"h-4 w-20 bg-muted rounded\"></div>\r\n </div>\r\n <div className=\"h-6 w-3/4 bg-muted rounded\"></div>\r\n </CardHeader>\r\n <CardContent className=\"py-0\">\r\n <div className=\"h-4 w-full bg-muted rounded mb-2\"></div>\r\n <div className=\"h-4 w-2/3 bg-muted rounded\"></div>\r\n </CardContent>\r\n <CardFooter className=\"pb-2\">\r\n <div className=\"h-4 w-24 bg-muted rounded\"></div>\r\n </CardFooter>\r\n </Card>\r\n ))\r\n ) : (\r\n posts.map((post) => (\r\n <div key={post.id} className=\"contents\" data-db-table=\"posts\" data-db-id={post.id}>\r\n <Card className=\"overflow-hidden group p-0\">\r\n <div className=\"aspect-video overflow-hidden\">\r\n <Link to={`/blog/${post.slug}`}>\r\n <img\r\n src={post.featured_image || \"/images/placeholder.png\"}\r\n alt={post.title}\r\n className=\"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105\"\r\n onError={(e) => {\r\n e.currentTarget.style.display = \"none\";\r\n }}\r\n />\r\n </Link>\r\n </div>\r\n <CardHeader className=\"pt-6 pb-2\">\r\n <div className=\"flex items-center gap-2 mb-2\">\r\n <Badge variant=\"outline\" className=\"text-xs\">\r\n {categoryMap.get(post.categories?.[0] as number)?.name}\r\n </Badge>\r\n <span className=\"text-xs text-muted-foreground\">\r\n {new Date(post.published_at).toLocaleDateString()}\r\n </span>\r\n </div>\r\n <Link to={`/blog/${post.slug}`}>\r\n <h3 className=\"text-lg font-semibold hover:text-primary transition-colors line-clamp-2\">\r\n {post.title}\r\n </h3>\r\n </Link>\r\n </CardHeader>\r\n <CardContent className=\"py-0\">\r\n <p className=\"text-sm text-muted-foreground line-clamp-2\">\r\n {post.excerpt}\r\n </p>\r\n </CardContent>\r\n <CardFooter className=\"pb-2\">\r\n <Link\r\n to={`/blog/${post.slug}`}\r\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center whitespace-nowrap\"\r\n >\r\n {t(\"readMore\", \"Read more\")}\r\n <ArrowRight className=\"ml-1 h-3 w-3 shrink-0\" />\r\n </Link>\r\n </CardFooter>\r\n </Card>\r\n </div>\r\n ))\r\n )}\r\n </div>\r\n </div>\r\n </section>\r\n );\r\n}\r\n"
25
25
  },
26
26
  {
27
27
  "path": "blog-section/lang/en.json",
28
28
  "type": "registry:lang",
29
29
  "target": "$modules$/blog-section/lang/en.json",
30
- "content": "{\n \"tagline\": \"Latest Updates\",\n \"title\": \"From Our Blog\",\n \"subtitle\": \"Insights, tutorials, and stories to help you succeed.\",\n \"viewAll\": \"View all articles\",\n \"readMore\": \"Read more\",\n \"post1Title\": \"Getting Started: A Complete Guide\",\n \"post1Summary\": \"Learn the essential steps to launch your project successfully and avoid common pitfalls.\",\n \"post1Category\": \"Tutorial\",\n \"post1Author\": \"Sarah Chen\",\n \"post1Date\": \"Jan 15, 2024\",\n \"post2Title\": \"10 Best Practices You Need to Know\",\n \"post2Summary\": \"Discover proven strategies that will help you work smarter and achieve better results.\",\n \"post2Category\": \"Best Practices\",\n \"post2Author\": \"Michael Park\",\n \"post2Date\": \"Jan 10, 2024\",\n \"post3Title\": \"Design Trends That Matter in 2024\",\n \"post3Summary\": \"Stay ahead of the curve with these emerging design trends shaping the industry.\",\n \"post3Category\": \"Design\",\n \"post3Author\": \"Emily Davis\",\n \"post3Date\": \"Jan 5, 2024\"\n}"
30
+ "content": "{\r\n \"tagline\": \"Latest Updates\",\r\n \"title\": \"From Our Blog\",\r\n \"subtitle\": \"Insights, tutorials, and stories to help you succeed.\",\r\n \"viewAll\": \"View all articles\",\r\n \"readMore\": \"Read more\",\r\n \"post1Title\": \"Getting Started: A Complete Guide\",\r\n \"post1Summary\": \"Learn the essential steps to launch your project successfully and avoid common pitfalls.\",\r\n \"post1Category\": \"Tutorial\",\r\n \"post1Author\": \"Sarah Chen\",\r\n \"post1Date\": \"Jan 15, 2024\",\r\n \"post2Title\": \"10 Best Practices You Need to Know\",\r\n \"post2Summary\": \"Discover proven strategies that will help you work smarter and achieve better results.\",\r\n \"post2Category\": \"Best Practices\",\r\n \"post2Author\": \"Michael Park\",\r\n \"post2Date\": \"Jan 10, 2024\",\r\n \"post3Title\": \"Design Trends That Matter in 2024\",\r\n \"post3Summary\": \"Stay ahead of the curve with these emerging design trends shaping the industry.\",\r\n \"post3Category\": \"Design\",\r\n \"post3Author\": \"Emily Davis\",\r\n \"post3Date\": \"Jan 5, 2024\"\r\n}"
31
31
  },
32
32
  {
33
33
  "path": "blog-section/lang/tr.json",
34
34
  "type": "registry:lang",
35
35
  "target": "$modules$/blog-section/lang/tr.json",
36
- "content": "{\n \"tagline\": \"Son Güncellemeler\",\n \"title\": \"Blogumuzdan\",\n \"subtitle\": \"Ekibimizden içgörüler, ipuçları ve hikayeleri keşfedin.\",\n \"viewAll\": \"Tüm makaleleri görüntüle\",\n \"readMore\": \"Devamını oku\",\n \"post1Title\": \"Başlangıç Rehberi\",\n \"post1Summary\": \"Kapsamlı rehberimizle hızlı bir şekilde başlamak için temel adımları öğrenin.\",\n \"post1Category\": \"Eğitim\",\n \"post1Author\": \"Sarah Chen\",\n \"post1Date\": \"15 Ocak 2024\",\n \"post2Title\": \"Başarı İçin En İyi Uygulamalar\",\n \"post2Summary\": \"Daha iyi sonuçlar elde etmenize yardımcı olan kanıtlanmış stratejileri keşfedin.\",\n \"post2Category\": \"En İyi Uygulamalar\",\n \"post2Author\": \"Michael Park\",\n \"post2Date\": \"10 Ocak 2024\",\n \"post3Title\": \"2024 Tasarım Trendleri\",\n \"post3Summary\": \"En son tasarım trendlerini ve projelerinizde nasıl uygulayacağınızı keşfedin.\",\n \"post3Category\": \"Tasarım\",\n \"post3Author\": \"Emily Davis\",\n \"post3Date\": \"5 Ocak 2024\"\n}"
36
+ "content": "{\r\n \"tagline\": \"Son Güncellemeler\",\r\n \"title\": \"Blogumuzdan\",\r\n \"subtitle\": \"Ekibimizden içgörüler, ipuçları ve hikayeleri keşfedin.\",\r\n \"viewAll\": \"Tüm makaleleri görüntüle\",\r\n \"readMore\": \"Devamını oku\",\r\n \"post1Title\": \"Başlangıç Rehberi\",\r\n \"post1Summary\": \"Kapsamlı rehberimizle hızlı bir şekilde başlamak için temel adımları öğrenin.\",\r\n \"post1Category\": \"Eğitim\",\r\n \"post1Author\": \"Sarah Chen\",\r\n \"post1Date\": \"15 Ocak 2024\",\r\n \"post2Title\": \"Başarı İçin En İyi Uygulamalar\",\r\n \"post2Summary\": \"Daha iyi sonuçlar elde etmenize yardımcı olan kanıtlanmış stratejileri keşfedin.\",\r\n \"post2Category\": \"En İyi Uygulamalar\",\r\n \"post2Author\": \"Michael Park\",\r\n \"post2Date\": \"10 Ocak 2024\",\r\n \"post3Title\": \"2024 Tasarım Trendleri\",\r\n \"post3Summary\": \"En son tasarım trendlerini ve projelerinizde nasıl uygulayacağınızı keşfedin.\",\r\n \"post3Category\": \"Tasarım\",\r\n \"post3Author\": \"Emily Davis\",\r\n \"post3Date\": \"5 Ocak 2024\"\r\n}"
37
37
  }
38
38
  ],
39
39
  "exports": {
@@ -14,25 +14,25 @@
14
14
  "path": "cards-carousel-section/index.ts",
15
15
  "type": "registry:index",
16
16
  "target": "$modules$/cards-carousel-section/index.ts",
17
- "content": "export * from './cards-carousel-section';\n"
17
+ "content": "export * from './cards-carousel-section';\r\n"
18
18
  },
19
19
  {
20
20
  "path": "cards-carousel-section/cards-carousel-section.tsx",
21
21
  "type": "registry:component",
22
22
  "target": "$modules$/cards-carousel-section/cards-carousel-section.tsx",
23
- "content": "import { useEffect, useRef, useState, createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { X, ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\n// Context for outside click detection\nconst CarouselContext = createContext<{\n onCardClose: (index: number) => void;\n currentIndex: number;\n}>({\n onCardClose: () => {},\n currentIndex: 0,\n});\n\n// Card interface\ninterface CardData {\n category: string;\n title: string;\n src: string;\n content: ReactNode;\n}\n\n// Card Component\nexport function Card({\n card,\n index,\n layout = false,\n}: {\n card: CardData;\n index: number;\n layout?: boolean;\n}) {\n const [open, setOpen] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const { onCardClose } = useContext(CarouselContext);\n\n const handleOpen = () => setOpen(true);\n const handleClose = () => {\n setOpen(false);\n onCardClose(index);\n };\n\n useEffect(() => {\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === \"Escape\") {\n handleClose();\n }\n }\n\n if (open) {\n document.body.style.overflow = \"hidden\";\n window.addEventListener(\"keydown\", onKeyDown);\n } else {\n document.body.style.overflow = \"auto\";\n }\n\n return () => {\n window.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = \"auto\";\n };\n }, [open, handleClose]);\n\n return (\n <>\n <AnimatePresence>\n {open && (\n <div className=\"fixed inset-0 h-screen z-50 overflow-auto\">\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"bg-black/80 backdrop-blur-lg h-full w-full fixed inset-0\"\n onClick={handleClose}\n />\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n ref={containerRef}\n layoutId={layout ? `card-${card.title}` : undefined}\n className=\"max-w-5xl mx-auto bg-white dark:bg-neutral-900 h-fit z-[60] my-10 p-4 md:p-10 rounded-3xl relative\"\n >\n <button\n className=\"sticky top-4 h-8 w-8 right-0 ml-auto bg-black dark:bg-white rounded-full flex items-center justify-center\"\n onClick={handleClose}\n >\n <X className=\"h-6 w-6 text-neutral-100 dark:text-neutral-900\" />\n </button>\n <motion.p\n layoutId={layout ? `category-${card.title}` : undefined}\n className=\"text-base font-medium text-black dark:text-white\"\n >\n {card.category}\n </motion.p>\n <motion.p\n layoutId={layout ? `title-${card.title}` : undefined}\n className=\"text-2xl md:text-5xl font-semibold text-neutral-700 mt-4 dark:text-white\"\n >\n {card.title}\n </motion.p>\n <div className=\"py-10\">{card.content}</div>\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n <motion.button\n layoutId={layout ? `card-${card.title}` : undefined}\n onClick={handleOpen}\n className=\"rounded-3xl bg-gray-100 dark:bg-neutral-900 h-80 w-56 md:h-[40rem] md:w-96 overflow-hidden flex flex-col items-start justify-start relative z-10\"\n >\n <div className=\"absolute h-full top-0 inset-x-0 bg-gradient-to-b from-black/50 via-transparent to-transparent z-30 pointer-events-none\" />\n <div className=\"relative z-40 p-8\">\n <motion.p\n layoutId={layout ? `category-${card.title}` : undefined}\n className=\"text-white text-sm md:text-base font-medium text-left\"\n >\n {card.category}\n </motion.p>\n <motion.p\n layoutId={layout ? `title-${card.title}` : undefined}\n className=\"text-white text-xl md:text-3xl font-semibold max-w-xs text-left mt-2\"\n >\n {card.title}\n </motion.p>\n </div>\n <img\n src={card.src}\n alt={card.title}\n className=\"object-cover absolute z-10 inset-0 w-full h-full\"\n />\n </motion.button>\n </>\n );\n}\n\n// Carousel Component\nexport function Carousel({ items }: { items: ReactNode[] }) {\n const carouselRef = useRef<HTMLDivElement>(null);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const [currentIndex, setCurrentIndex] = useState(0);\n\n const checkScrollability = () => {\n if (carouselRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = carouselRef.current;\n setCanScrollLeft(scrollLeft > 0);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth);\n }\n };\n\n useEffect(() => {\n checkScrollability();\n }, []);\n\n const scrollLeft = () => {\n if (carouselRef.current) {\n carouselRef.current.scrollBy({ left: -300, behavior: \"smooth\" });\n }\n };\n\n const scrollRight = () => {\n if (carouselRef.current) {\n carouselRef.current.scrollBy({ left: 300, behavior: \"smooth\" });\n }\n };\n\n const handleCardClose = (index: number) => {\n if (carouselRef.current) {\n const cardWidth = isMobile() ? 230 : 384;\n const gap = isMobile() ? 4 : 8;\n const scrollPosition = (cardWidth + gap) * (index + 1);\n carouselRef.current.scrollTo({\n left: scrollPosition,\n behavior: \"smooth\",\n });\n setCurrentIndex(index);\n }\n };\n\n const isMobile = () => {\n return window && window.innerWidth < 768;\n };\n\n return (\n <CarouselContext.Provider value={{ onCardClose: handleCardClose, currentIndex }}>\n <div className=\"relative w-full\">\n <div\n className=\"flex w-full overflow-x-scroll overscroll-x-auto py-10 md:py-20 scroll-smooth [scrollbar-width:none]\"\n ref={carouselRef}\n onScroll={checkScrollability}\n >\n <div className=\"absolute right-0 z-[1000] h-auto w-[5%] overflow-hidden bg-gradient-to-l from-background to-transparent pointer-events-none\" />\n <div className=\"flex flex-row justify-start gap-4 pl-4 max-w-7xl mx-auto\">\n {items.map((item, index) => (\n <motion.div\n initial={{ opacity: 0, y: 20 }}\n animate={{\n opacity: 1,\n y: 0,\n transition: {\n duration: 0.5,\n delay: 0.2 * index,\n ease: \"easeOut\",\n },\n }}\n key={\"card\" + index}\n className=\"last:pr-[5%] md:last:pr-[33%] rounded-3xl\"\n >\n {item}\n </motion.div>\n ))}\n </div>\n </div>\n <div className=\"flex justify-end gap-2 mr-10\">\n <button\n className=\"relative z-40 h-10 w-10 rounded-full bg-gray-100 flex items-center justify-center disabled:opacity-50\"\n onClick={scrollLeft}\n disabled={!canScrollLeft}\n >\n <ChevronLeft className=\"h-6 w-6 text-gray-500\" />\n </button>\n <button\n className=\"relative z-40 h-10 w-10 rounded-full bg-gray-100 flex items-center justify-center disabled:opacity-50\"\n onClick={scrollRight}\n disabled={!canScrollRight}\n >\n <ChevronRight className=\"h-6 w-6 text-gray-500\" />\n </button>\n </div>\n </div>\n </CarouselContext.Provider>\n );\n}\n\n// Section Component\ninterface CardsCarouselSectionProps {\n title?: string;\n items: CardData[];\n className?: string;\n}\n\nexport function CardsCarouselSection({\n title,\n items,\n className,\n}: CardsCarouselSectionProps) {\n const cards = items.map((card, index) => (\n <Card key={card.src} card={card} index={index} />\n ));\n\n return (\n <section className={cn(\"w-full py-16 md:py-20\", className)}>\n {title && (\n <h2 className=\"max-w-7xl pl-4 mx-auto text-xl md:text-5xl font-bold text-neutral-800 dark:text-neutral-200\">\n {title}\n </h2>\n )}\n <Carousel items={cards} />\n </section>\n );\n}\n"
23
+ "content": "import { useEffect, useRef, useState, createContext, useContext } from \"react\";\r\nimport type { ReactNode } from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport { X, ChevronLeft, ChevronRight } from \"lucide-react\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\n// Context for outside click detection\r\nconst CarouselContext = createContext<{\r\n onCardClose: (index: number) => void;\r\n currentIndex: number;\r\n}>({\r\n onCardClose: () => {},\r\n currentIndex: 0,\r\n});\r\n\r\n// Card interface\r\ninterface CardData {\r\n category: string;\r\n title: string;\r\n src: string;\r\n content: ReactNode;\r\n}\r\n\r\n// Card Component\r\nexport function Card({\r\n card,\r\n index,\r\n layout = false,\r\n}: {\r\n card: CardData;\r\n index: number;\r\n layout?: boolean;\r\n}) {\r\n const [open, setOpen] = useState(false);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const { onCardClose } = useContext(CarouselContext);\r\n\r\n const handleOpen = () => setOpen(true);\r\n const handleClose = () => {\r\n setOpen(false);\r\n onCardClose(index);\r\n };\r\n\r\n useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\") {\r\n handleClose();\r\n }\r\n }\r\n\r\n if (open) {\r\n document.body.style.overflow = \"hidden\";\r\n window.addEventListener(\"keydown\", onKeyDown);\r\n } else {\r\n document.body.style.overflow = \"auto\";\r\n }\r\n\r\n return () => {\r\n window.removeEventListener(\"keydown\", onKeyDown);\r\n document.body.style.overflow = \"auto\";\r\n };\r\n }, [open, handleClose]);\r\n\r\n return (\r\n <>\r\n <AnimatePresence>\r\n {open && (\r\n <div className=\"fixed inset-0 h-screen z-50 overflow-auto\">\r\n <motion.div\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n exit={{ opacity: 0 }}\r\n className=\"bg-black/80 backdrop-blur-lg h-full w-full fixed inset-0\"\r\n onClick={handleClose}\r\n />\r\n <motion.div\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n exit={{ opacity: 0 }}\r\n ref={containerRef}\r\n layoutId={layout ? `card-${card.title}` : undefined}\r\n className=\"max-w-5xl mx-auto bg-white dark:bg-neutral-900 h-fit z-[60] my-10 p-4 md:p-10 rounded-3xl relative\"\r\n >\r\n <button\r\n className=\"sticky top-4 h-8 w-8 right-0 ml-auto bg-black dark:bg-white rounded-full flex items-center justify-center\"\r\n onClick={handleClose}\r\n >\r\n <X className=\"h-6 w-6 text-neutral-100 dark:text-neutral-900\" />\r\n </button>\r\n <motion.p\r\n layoutId={layout ? `category-${card.title}` : undefined}\r\n className=\"text-base font-medium text-black dark:text-white\"\r\n >\r\n {card.category}\r\n </motion.p>\r\n <motion.p\r\n layoutId={layout ? `title-${card.title}` : undefined}\r\n className=\"text-2xl md:text-5xl font-semibold text-neutral-700 mt-4 dark:text-white\"\r\n >\r\n {card.title}\r\n </motion.p>\r\n <div className=\"py-10\">{card.content}</div>\r\n </motion.div>\r\n </div>\r\n )}\r\n </AnimatePresence>\r\n <motion.button\r\n layoutId={layout ? `card-${card.title}` : undefined}\r\n onClick={handleOpen}\r\n className=\"rounded-3xl bg-gray-100 dark:bg-neutral-900 h-80 w-56 md:h-[40rem] md:w-96 overflow-hidden flex flex-col items-start justify-start relative z-10\"\r\n >\r\n <div className=\"absolute h-full top-0 inset-x-0 bg-gradient-to-b from-black/50 via-transparent to-transparent z-30 pointer-events-none\" />\r\n <div className=\"relative z-40 p-8\">\r\n <motion.p\r\n layoutId={layout ? `category-${card.title}` : undefined}\r\n className=\"text-white text-sm md:text-base font-medium text-left\"\r\n >\r\n {card.category}\r\n </motion.p>\r\n <motion.p\r\n layoutId={layout ? `title-${card.title}` : undefined}\r\n className=\"text-white text-xl md:text-3xl font-semibold max-w-xs text-left mt-2\"\r\n >\r\n {card.title}\r\n </motion.p>\r\n </div>\r\n <img\r\n src={card.src}\r\n alt={card.title}\r\n className=\"object-cover absolute z-10 inset-0 w-full h-full\"\r\n />\r\n </motion.button>\r\n </>\r\n );\r\n}\r\n\r\n// Carousel Component\r\nexport function Carousel({ items }: { items: ReactNode[] }) {\r\n const carouselRef = useRef<HTMLDivElement>(null);\r\n const [canScrollLeft, setCanScrollLeft] = useState(false);\r\n const [canScrollRight, setCanScrollRight] = useState(true);\r\n const [currentIndex, setCurrentIndex] = useState(0);\r\n\r\n const checkScrollability = () => {\r\n if (carouselRef.current) {\r\n const { scrollLeft, scrollWidth, clientWidth } = carouselRef.current;\r\n setCanScrollLeft(scrollLeft > 0);\r\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n checkScrollability();\r\n }, []);\r\n\r\n const scrollLeft = () => {\r\n if (carouselRef.current) {\r\n carouselRef.current.scrollBy({ left: -300, behavior: \"smooth\" });\r\n }\r\n };\r\n\r\n const scrollRight = () => {\r\n if (carouselRef.current) {\r\n carouselRef.current.scrollBy({ left: 300, behavior: \"smooth\" });\r\n }\r\n };\r\n\r\n const handleCardClose = (index: number) => {\r\n if (carouselRef.current) {\r\n const cardWidth = isMobile() ? 230 : 384;\r\n const gap = isMobile() ? 4 : 8;\r\n const scrollPosition = (cardWidth + gap) * (index + 1);\r\n carouselRef.current.scrollTo({\r\n left: scrollPosition,\r\n behavior: \"smooth\",\r\n });\r\n setCurrentIndex(index);\r\n }\r\n };\r\n\r\n const isMobile = () => {\r\n return window && window.innerWidth < 768;\r\n };\r\n\r\n return (\r\n <CarouselContext.Provider value={{ onCardClose: handleCardClose, currentIndex }}>\r\n <div className=\"relative w-full\">\r\n <div\r\n className=\"flex w-full overflow-x-scroll overscroll-x-auto py-10 md:py-20 scroll-smooth [scrollbar-width:none]\"\r\n ref={carouselRef}\r\n onScroll={checkScrollability}\r\n >\r\n <div className=\"absolute right-0 z-[1000] h-auto w-[5%] overflow-hidden bg-gradient-to-l from-background to-transparent pointer-events-none\" />\r\n <div className=\"flex flex-row justify-start gap-4 pl-4 max-w-7xl mx-auto\">\r\n {items.map((item, index) => (\r\n <motion.div\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{\r\n opacity: 1,\r\n y: 0,\r\n transition: {\r\n duration: 0.5,\r\n delay: 0.2 * index,\r\n ease: \"easeOut\",\r\n },\r\n }}\r\n key={\"card\" + index}\r\n className=\"last:pr-[5%] md:last:pr-[33%] rounded-3xl\"\r\n >\r\n {item}\r\n </motion.div>\r\n ))}\r\n </div>\r\n </div>\r\n <div className=\"flex justify-end gap-2 mr-10\">\r\n <button\r\n className=\"relative z-40 h-10 w-10 rounded-full bg-gray-100 flex items-center justify-center disabled:opacity-50\"\r\n onClick={scrollLeft}\r\n disabled={!canScrollLeft}\r\n >\r\n <ChevronLeft className=\"h-6 w-6 text-gray-500\" />\r\n </button>\r\n <button\r\n className=\"relative z-40 h-10 w-10 rounded-full bg-gray-100 flex items-center justify-center disabled:opacity-50\"\r\n onClick={scrollRight}\r\n disabled={!canScrollRight}\r\n >\r\n <ChevronRight className=\"h-6 w-6 text-gray-500\" />\r\n </button>\r\n </div>\r\n </div>\r\n </CarouselContext.Provider>\r\n );\r\n}\r\n\r\n// Section Component\r\ninterface CardsCarouselSectionProps {\r\n title?: string;\r\n items: CardData[];\r\n className?: string;\r\n}\r\n\r\nexport function CardsCarouselSection({\r\n title,\r\n items,\r\n className,\r\n}: CardsCarouselSectionProps) {\r\n const cards = items.map((card, index) => (\r\n <Card key={card.src} card={card} index={index} />\r\n ));\r\n\r\n return (\r\n <section className={cn(\"w-full py-16 md:py-20\", className)}>\r\n {title && (\r\n <h2 className=\"max-w-7xl pl-4 mx-auto text-xl md:text-5xl font-bold text-neutral-800 dark:text-neutral-200\">\r\n {title}\r\n </h2>\r\n )}\r\n <Carousel items={cards} />\r\n </section>\r\n );\r\n}\r\n"
24
24
  },
25
25
  {
26
26
  "path": "cards-carousel-section/lang/en.json",
27
27
  "type": "registry:lang",
28
28
  "target": "$modules$/cards-carousel-section/lang/en.json",
29
- "content": "{\n \"title\": \"Explore\"\n}\n"
29
+ "content": "{\r\n \"title\": \"Explore\"\r\n}\r\n"
30
30
  },
31
31
  {
32
32
  "path": "cards-carousel-section/lang/tr.json",
33
33
  "type": "registry:lang",
34
34
  "target": "$modules$/cards-carousel-section/lang/tr.json",
35
- "content": "{\n \"title\": \"Keşfet\"\n}\n"
35
+ "content": "{\r\n \"title\": \"Keşfet\"\r\n}\r\n"
36
36
  }
37
37
  ],
38
38
  "exports": {
@@ -14,25 +14,25 @@
14
14
  "path": "cart-drawer/index.ts",
15
15
  "type": "registry:index",
16
16
  "target": "$modules$/cart-drawer/index.ts",
17
- "content": "export * from './cart-drawer';\n"
17
+ "content": "export * from './cart-drawer';\r\n"
18
18
  },
19
19
  {
20
20
  "path": "cart-drawer/cart-drawer.tsx",
21
21
  "type": "registry:component",
22
22
  "target": "$modules$/cart-drawer/cart-drawer.tsx",
23
- "content": "import { useMemo } from \"react\";\nimport { Link } from \"react-router\";\nimport { Minus, Plus } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n} from \"@/components/ui/sheet\";\nimport { useTranslation } from \"react-i18next\";\nimport { useCart, formatPrice } from \"@/modules/ecommerce-core\";\nimport type { Category } from \"@/modules/ecommerce-core/types\";\nimport { useDbList } from \"@/db\";\nimport constants from \"@/constants/constants.json\";\n\ninterface CartDrawerProps {\n checkoutHref?: string;\n className?: string;\n showTrigger?: boolean;\n}\n\nexport function CartDrawer({\n checkoutHref = \"/checkout\",\n className,\n showTrigger = true,\n}: CartDrawerProps) {\n const { t } = useTranslation(\"cart-drawer\");\n const {\n state,\n removeItem,\n updateQuantity,\n isDrawerOpen,\n setDrawerOpen,\n } = useCart();\n const { items, total } = state;\n const { data: productCategories = [] } = useDbList<Category>(\"product_categories\");\n const categoryMap = useMemo(() => new Map(productCategories.map(c => [c.id, c])), [productCategories]);\n const currency = (constants.site as any).currency || \"USD\";\n\n const getProductPrice = (product: {\n price: number;\n sale_price?: number;\n on_sale?: boolean;\n }) => {\n return product.on_sale && product.sale_price\n ? product.sale_price\n : product.price;\n };\n\n const handleQuantityChange = (id: string | number, newQuantity: number) => {\n if (newQuantity <= 0) {\n removeItem(id);\n } else {\n updateQuantity(id, newQuantity);\n }\n };\n\n return (\n <Sheet open={isDrawerOpen} onOpenChange={setDrawerOpen}>\n <SheetContent className=\"w-full sm:max-w-md flex flex-col px-6 pb-8\">\n <SheetHeader>\n <SheetTitle>{t(\"title\", \"Shopping cart\")}</SheetTitle>\n </SheetHeader>\n\n <div className=\"flex-1 overflow-y-auto mt-8\">\n {items.length === 0 ? (\n <p className=\"text-center text-muted-foreground py-8\">\n {t(\"empty\", \"Your cart is empty\")}\n </p>\n ) : (\n <ul className=\"-my-6 divide-y divide-border\">\n {items.map((item) => (\n <li key={item.id} className=\"flex py-6\">\n <div className=\"size-24 shrink-0 overflow-hidden rounded-md border border-border\">\n <img\n alt={item.product.name}\n src={item.product.images?.length ? item.product.images?.[0] : \"/images/placeholder.png\"}\n className=\"size-full object-cover\"\n />\n </div>\n\n <div className=\"ml-4 flex flex-1 flex-col\">\n <div>\n <div className=\"flex justify-between text-base font-medium\">\n <h3>\n <Link\n to={`/products/${item.product.slug}`}\n onClick={() => setDrawerOpen(false)}\n >\n {item.product.name}\n </Link>\n </h3>\n <p className=\"ml-4\">\n {formatPrice(getProductPrice(item.product), currency)}\n </p>\n </div>\n {categoryMap.get(item.product.categories?.[0] as number)?.name && (\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {categoryMap.get(item.product.categories?.[0] as number)?.name}\n </p>\n )}\n </div>\n <div className=\"flex flex-1 items-end justify-between text-sm\">\n <div className=\"flex items-center gap-1\">\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-6 w-6\"\n onClick={() =>\n handleQuantityChange(item.id, item.quantity - 1)\n }\n >\n <Minus className=\"h-3 w-3\" />\n </Button>\n <span className=\"w-8 text-center text-sm\">\n {item.quantity}\n </span>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-6 w-6\"\n onClick={() =>\n handleQuantityChange(item.id, item.quantity + 1)\n }\n >\n <Plus className=\"h-3 w-3\" />\n </Button>\n </div>\n\n <button\n type=\"button\"\n onClick={() => removeItem(item.id)}\n className=\"font-medium text-primary hover:text-primary/80\"\n >\n {t(\"remove\", \"Remove\")}\n </button>\n </div>\n </div>\n </li>\n ))}\n </ul>\n )}\n </div>\n\n <div className=\"border-t border-border pt-6 mt-6\">\n <div className=\"flex justify-between text-base font-medium\">\n <p>{t(\"subtotal\", \"Subtotal\")}</p>\n <p>{formatPrice(total, currency)}</p>\n </div>\n <p className=\"mt-0.5 text-sm text-muted-foreground\">\n {t(\"shippingNote\", \"Shipping and taxes calculated at checkout.\")}\n </p>\n <div className=\"mt-6\">\n <Button asChild className=\"w-full\" disabled={items.length === 0}>\n <Link to={checkoutHref} onClick={() => setDrawerOpen(false)}>\n {t(\"checkout\", \"Checkout\")}\n </Link>\n </Button>\n </div>\n </div>\n </SheetContent>\n </Sheet>\n );\n}\n"
23
+ "content": "import { useMemo } from \"react\";\r\nimport { Link } from \"react-router\";\r\nimport { Minus, Plus } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport {\r\n Sheet,\r\n SheetContent,\r\n SheetHeader,\r\n SheetTitle,\r\n} from \"@/components/ui/sheet\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { useCart, formatPrice } from \"@/modules/ecommerce-core\";\r\nimport type { Category } from \"@/modules/ecommerce-core/types\";\r\nimport { useDbList } from \"@/db\";\r\nimport constants from \"@/constants/constants.json\";\r\n\r\ninterface CartDrawerProps {\r\n checkoutHref?: string;\r\n className?: string;\r\n showTrigger?: boolean;\r\n}\r\n\r\nexport function CartDrawer({\r\n checkoutHref = \"/checkout\",\r\n className,\r\n showTrigger = true,\r\n}: CartDrawerProps) {\r\n const { t } = useTranslation(\"cart-drawer\");\r\n const {\r\n state,\r\n removeItem,\r\n updateQuantity,\r\n isDrawerOpen,\r\n setDrawerOpen,\r\n } = useCart();\r\n const { items, total } = state;\r\n const { data: productCategories = [] } = useDbList<Category>(\"product_categories\");\r\n const categoryMap = useMemo(() => new Map(productCategories.map(c => [c.id, c])), [productCategories]);\r\n const currency = (constants.site as any).currency || \"USD\";\r\n\r\n const getProductPrice = (product: {\r\n price: number;\r\n sale_price?: number;\r\n on_sale?: boolean;\r\n }) => {\r\n return product.on_sale && product.sale_price\r\n ? product.sale_price\r\n : product.price;\r\n };\r\n\r\n const handleQuantityChange = (id: string | number, newQuantity: number) => {\r\n if (newQuantity <= 0) {\r\n removeItem(id);\r\n } else {\r\n updateQuantity(id, newQuantity);\r\n }\r\n };\r\n\r\n return (\r\n <Sheet open={isDrawerOpen} onOpenChange={setDrawerOpen}>\r\n <SheetContent className=\"w-full sm:max-w-md flex flex-col px-6 pb-8\">\r\n <SheetHeader>\r\n <SheetTitle>{t(\"title\", \"Shopping cart\")}</SheetTitle>\r\n </SheetHeader>\r\n\r\n <div className=\"flex-1 overflow-y-auto mt-8\">\r\n {items.length === 0 ? (\r\n <p className=\"text-center text-muted-foreground py-8\">\r\n {t(\"empty\", \"Your cart is empty\")}\r\n </p>\r\n ) : (\r\n <ul className=\"-my-6 divide-y divide-border\">\r\n {items.map((item) => (\r\n <li key={item.id} className=\"flex py-6\">\r\n <div className=\"size-24 shrink-0 overflow-hidden rounded-md border border-border\">\r\n <img\r\n alt={item.product.name}\r\n src={item.product.images?.length ? item.product.images?.[0] : \"/images/placeholder.png\"}\r\n className=\"size-full object-cover\"\r\n />\r\n </div>\r\n\r\n <div className=\"ml-4 flex flex-1 flex-col\">\r\n <div>\r\n <div className=\"flex justify-between text-base font-medium\">\r\n <h3>\r\n <Link\r\n to={`/products/${item.product.slug}`}\r\n onClick={() => setDrawerOpen(false)}\r\n >\r\n {item.product.name}\r\n </Link>\r\n </h3>\r\n <p className=\"ml-4\">\r\n {formatPrice(getProductPrice(item.product), currency)}\r\n </p>\r\n </div>\r\n {categoryMap.get(item.product.categories?.[0] as number)?.name && (\r\n <p className=\"mt-1 text-sm text-muted-foreground\">\r\n {categoryMap.get(item.product.categories?.[0] as number)?.name}\r\n </p>\r\n )}\r\n </div>\r\n <div className=\"flex flex-1 items-end justify-between text-sm\">\r\n <div className=\"flex items-center gap-1\">\r\n <Button\r\n variant=\"outline\"\r\n size=\"icon\"\r\n className=\"h-6 w-6\"\r\n onClick={() =>\r\n handleQuantityChange(item.id, item.quantity - 1)\r\n }\r\n >\r\n <Minus className=\"h-3 w-3\" />\r\n </Button>\r\n <span className=\"w-8 text-center text-sm\">\r\n {item.quantity}\r\n </span>\r\n <Button\r\n variant=\"outline\"\r\n size=\"icon\"\r\n className=\"h-6 w-6\"\r\n onClick={() =>\r\n handleQuantityChange(item.id, item.quantity + 1)\r\n }\r\n >\r\n <Plus className=\"h-3 w-3\" />\r\n </Button>\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n onClick={() => removeItem(item.id)}\r\n className=\"font-medium text-primary hover:text-primary/80\"\r\n >\r\n {t(\"remove\", \"Remove\")}\r\n </button>\r\n </div>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </div>\r\n\r\n <div className=\"border-t border-border pt-6 mt-6\">\r\n <div className=\"flex justify-between text-base font-medium\">\r\n <p>{t(\"subtotal\", \"Subtotal\")}</p>\r\n <p>{formatPrice(total, currency)}</p>\r\n </div>\r\n <p className=\"mt-0.5 text-sm text-muted-foreground\">\r\n {t(\"shippingNote\", \"Shipping and taxes calculated at checkout.\")}\r\n </p>\r\n <div className=\"mt-6\">\r\n <Button asChild className=\"w-full\" disabled={items.length === 0}>\r\n <Link to={checkoutHref} onClick={() => setDrawerOpen(false)}>\r\n {t(\"checkout\", \"Checkout\")}\r\n </Link>\r\n </Button>\r\n </div>\r\n </div>\r\n </SheetContent>\r\n </Sheet>\r\n );\r\n}\r\n"
24
24
  },
25
25
  {
26
26
  "path": "cart-drawer/lang/en.json",
27
27
  "type": "registry:lang",
28
28
  "target": "$modules$/cart-drawer/lang/en.json",
29
- "content": "{\n \"title\": \"Shopping cart\",\n \"empty\": \"Your cart is empty\",\n \"qty\": \"Qty\",\n \"remove\": \"Remove\",\n \"subtotal\": \"Subtotal\",\n \"shippingNote\": \"Shipping and taxes calculated at checkout.\",\n \"checkout\": \"Checkout\",\n \"or\": \"or\",\n \"continueShopping\": \"Continue Shopping\"\n}\n"
29
+ "content": "{\r\n \"title\": \"Shopping cart\",\r\n \"empty\": \"Your cart is empty\",\r\n \"qty\": \"Qty\",\r\n \"remove\": \"Remove\",\r\n \"subtotal\": \"Subtotal\",\r\n \"shippingNote\": \"Shipping and taxes calculated at checkout.\",\r\n \"checkout\": \"Checkout\",\r\n \"or\": \"or\",\r\n \"continueShopping\": \"Continue Shopping\"\r\n}\r\n"
30
30
  },
31
31
  {
32
32
  "path": "cart-drawer/lang/tr.json",
33
33
  "type": "registry:lang",
34
34
  "target": "$modules$/cart-drawer/lang/tr.json",
35
- "content": "{\n \"title\": \"Sepet\",\n \"empty\": \"Sepetiniz boş\",\n \"qty\": \"Adet\",\n \"remove\": \"Kaldır\",\n \"subtotal\": \"Ara Toplam\",\n \"shippingNote\": \"Kargo ve vergiler ödeme sırasında hesaplanır.\",\n \"checkout\": \"Ödemeye Geç\",\n \"or\": \"veya\",\n \"continueShopping\": \"Alışverişe Devam Et\"\n}\n"
35
+ "content": "{\r\n \"title\": \"Sepet\",\r\n \"empty\": \"Sepetiniz boş\",\r\n \"qty\": \"Adet\",\r\n \"remove\": \"Kaldır\",\r\n \"subtotal\": \"Ara Toplam\",\r\n \"shippingNote\": \"Kargo ve vergiler ödeme sırasında hesaplanır.\",\r\n \"checkout\": \"Ödemeye Geç\",\r\n \"or\": \"veya\",\r\n \"continueShopping\": \"Alışverişe Devam Et\"\r\n}\r\n"
36
36
  }
37
37
  ],
38
38
  "exports": {
@@ -17,25 +17,25 @@
17
17
  "path": "cart-page/index.ts",
18
18
  "type": "registry:index",
19
19
  "target": "$modules$/cart-page/index.ts",
20
- "content": "export * from './cart-page';\nexport { CartPage as default } from './cart-page';\n"
20
+ "content": "export * from './cart-page';\r\nexport { CartPage as default } from './cart-page';\r\n"
21
21
  },
22
22
  {
23
23
  "path": "cart-page/cart-page.tsx",
24
24
  "type": "registry:page",
25
25
  "target": "$modules$/cart-page/cart-page.tsx",
26
- "content": "import { useMemo } from \"react\";\nimport { Link } from \"react-router\";\nimport { Trash2, Plus, Minus, ArrowLeft, ShoppingBag } from \"lucide-react\";\nimport { Layout } from \"@/components/Layout\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { Input } from \"@/components/ui/input\";\nimport { useTranslation } from \"react-i18next\";\nimport { usePageTitle } from \"@/hooks/use-page-title\";\nimport { useCart, formatPrice } from \"@/modules/ecommerce-core\";\nimport type { Category } from \"@/modules/ecommerce-core/types\";\nimport { useDbList } from \"@/db\";\nimport constants from \"@/constants/constants.json\";\nimport { FadeIn } from \"@/modules/animations\";\n\nexport function CartPage() {\n const { t } = useTranslation(\"cart-page\");\n usePageTitle({ title: t(\"pageTitle\", \"Shopping Cart\") });\n const { state, removeItem, updateQuantity } = useCart();\n const { items, total } = state;\n const { data: productCategories = [] } = useDbList<Category>(\"product_categories\");\n const categoryMap = useMemo(() => new Map(productCategories.map(c => [c.id, c])), [productCategories]);\n\n const currency = constants.site.currency || \"USD\";\n const shipping = 0;\n const tax = 0;\n const freeShippingThreshold = 100;\n\n const getProductPrice = (product: { price: number; sale_price?: number; on_sale?: boolean }) => {\n return product.on_sale && product.sale_price ? product.sale_price : product.price;\n };\n\n const handleQuantityChange = (productId: number | string, newQuantity: number) => {\n if (newQuantity <= 0) {\n removeItem(productId);\n } else {\n updateQuantity(productId, newQuantity);\n }\n };\n\n const handleQuantityInputChange = (productId: number | string, value: string) => {\n const quantity = parseInt(value) || 1;\n handleQuantityChange(productId, quantity);\n };\n\n const itemCount = items.reduce((sum, item) => sum + item.quantity, 0);\n const finalTotal = total + shipping + tax;\n\n if (items.length === 0) {\n return (\n <Layout>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4 py-8\">\n <div className=\"max-w-2xl mx-auto text-center py-16\">\n <div className=\"mb-8\">\n <ShoppingBag className=\"h-24 w-24 mx-auto text-muted-foreground mb-4\" />\n <h1 className=\"text-3xl font-bold mb-4\">\n {t(\"empty\", \"Your Cart is Empty\")}\n </h1>\n <p className=\"text-muted-foreground mb-8\">\n {t(\"emptyDescription\", \"Looks like you haven't added any items to your cart yet.\")}\n </p>\n <Button asChild size=\"lg\">\n <Link to=\"/products\">\n <ArrowLeft className=\"w-4 h-4 mr-2\" />\n {t(\"continueShopping\", \"Continue Shopping\")}\n </Link>\n </Button>\n </div>\n </div>\n </div>\n </Layout>\n );\n }\n\n return (\n <Layout>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4 py-8\">\n <FadeIn className=\"flex items-center gap-4 mb-8\">\n <Button variant=\"ghost\" size=\"icon\" asChild>\n <Link to=\"/products\">\n <ArrowLeft className=\"h-4 w-4\" />\n </Link>\n </Button>\n <div>\n <h1 className=\"text-3xl font-bold\">{t(\"title\", \"Shopping Cart\")}</h1>\n <p className=\"text-muted-foreground\">\n {itemCount} {t(\"itemsInCart\", \"items in your cart\")}\n </p>\n </div>\n </FadeIn>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-8\">\n <div className=\"lg:col-span-2 space-y-4\">\n {items.map((item) => (\n <Card key={item.id}>\n <CardContent className=\"p-6\">\n <div className=\"flex gap-4\">\n <div className=\"w-24 h-24 flex-shrink-0\">\n <img\n src={item.product.images?.length ? item.product.images?.[0] : \"/images/placeholder.png\"}\n alt={item.product.name}\n className=\"w-full h-full object-cover rounded-lg\"\n />\n </div>\n\n <div className=\"flex-1 space-y-2\">\n <div className=\"flex items-start justify-between\">\n <div>\n <h3 className=\"font-semibold\">{item.product.name}</h3>\n <p className=\"text-sm text-muted-foreground\">\n {categoryMap.get(item.product.categories?.[0] as number)?.name}\n </p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => removeItem(item.id)}\n className=\"text-destructive hover:text-destructive\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-8 w-8\"\n onClick={() => handleQuantityChange(item.id, item.quantity - 1)}\n >\n <Minus className=\"h-3 w-3\" />\n </Button>\n <Input\n type=\"number\"\n value={item.quantity}\n onChange={(e) => handleQuantityInputChange(item.id, e.target.value)}\n className=\"w-16 text-center\"\n min=\"1\"\n />\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-8 w-8\"\n onClick={() => handleQuantityChange(item.id, item.quantity + 1)}\n >\n <Plus className=\"h-3 w-3\" />\n </Button>\n </div>\n\n <div className=\"text-right\">\n <p className=\"font-semibold\">\n {formatPrice(getProductPrice(item.product) * item.quantity, currency)}\n </p>\n {item.quantity > 1 && (\n <p className=\"text-sm text-muted-foreground\">\n {formatPrice(getProductPrice(item.product), currency)} {t(\"each\", \"each\")}\n </p>\n )}\n </div>\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle>{t(\"orderSummary\", \"Order Summary\")}</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex justify-between\">\n <span>\n {t(\"subtotal\", \"Subtotal\")} ({itemCount} {t(\"items\", \"items\")})\n </span>\n <span>{formatPrice(total, currency)}</span>\n </div>\n\n <div className=\"flex justify-between\">\n <span>{t(\"shipping\", \"Shipping\")}</span>\n <span>\n {shipping === 0 ? t(\"free\", \"Free\") : formatPrice(shipping, currency)}\n </span>\n </div>\n\n <div className=\"flex justify-between\">\n <span>{t(\"tax\", \"Tax\")}</span>\n <span>{formatPrice(tax, currency)}</span>\n </div>\n\n <Separator />\n\n <div className=\"flex justify-between text-lg font-semibold\">\n <span>{t(\"total\", \"Total\")}</span>\n <span>{formatPrice(finalTotal, currency)}</span>\n </div>\n\n {shipping > 0 && freeShippingThreshold && freeShippingThreshold > total && (\n <div className=\"text-sm text-muted-foreground bg-muted/50 p-3 rounded-lg\">\n {t(\"freeShippingMessage\", \"Add {{amount}} more for free shipping!\").replace(\n \"{{amount}}\",\n formatPrice(freeShippingThreshold - total, currency)\n )}\n </div>\n )}\n\n <Button asChild className=\"w-full\" size=\"lg\">\n <Link to=\"/checkout\">{t(\"proceedToCheckout\", \"Proceed to Checkout\")}</Link>\n </Button>\n\n <Button variant=\"outline\" asChild className=\"w-full\">\n <Link to=\"/products\">{t(\"continueShopping\", \"Continue Shopping\")}</Link>\n </Button>\n </CardContent>\n </Card>\n\n <Card>\n <CardContent className=\"p-4\">\n <div className=\"text-center space-y-2\">\n <div className=\"text-sm text-muted-foreground\">\n {t(\"secureCheckout\", \"Secure Checkout\")}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"secureCheckoutDescription\", \"Your payment information is encrypted and secure\")}\n </p>\n </div>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n </Layout>\n );\n}\n\nexport default CartPage;\n"
26
+ "content": "import { useMemo } from \"react\";\r\nimport { Link } from \"react-router\";\r\nimport { Trash2, Plus, Minus, ArrowLeft, ShoppingBag } from \"lucide-react\";\r\nimport { Layout } from \"@/components/Layout\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { Input } from \"@/components/ui/input\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { usePageTitle } from \"@/hooks/use-page-title\";\r\nimport { useCart, formatPrice } from \"@/modules/ecommerce-core\";\r\nimport type { Category } from \"@/modules/ecommerce-core/types\";\r\nimport { useDbList } from \"@/db\";\r\nimport constants from \"@/constants/constants.json\";\r\nimport { FadeIn } from \"@/modules/animations\";\r\n\r\nexport function CartPage() {\r\n const { t } = useTranslation(\"cart-page\");\r\n usePageTitle({ title: t(\"pageTitle\", \"Shopping Cart\") });\r\n const { state, removeItem, updateQuantity } = useCart();\r\n const { items, total } = state;\r\n const { data: productCategories = [] } = useDbList<Category>(\"product_categories\");\r\n const categoryMap = useMemo(() => new Map(productCategories.map(c => [c.id, c])), [productCategories]);\r\n\r\n const currency = constants.site.currency || \"USD\";\r\n const shipping = 0;\r\n const tax = 0;\r\n const freeShippingThreshold = 100;\r\n\r\n const getProductPrice = (product: { price: number; sale_price?: number; on_sale?: boolean }) => {\r\n return product.on_sale && product.sale_price ? product.sale_price : product.price;\r\n };\r\n\r\n const handleQuantityChange = (productId: number | string, newQuantity: number) => {\r\n if (newQuantity <= 0) {\r\n removeItem(productId);\r\n } else {\r\n updateQuantity(productId, newQuantity);\r\n }\r\n };\r\n\r\n const handleQuantityInputChange = (productId: number | string, value: string) => {\r\n const quantity = parseInt(value) || 1;\r\n handleQuantityChange(productId, quantity);\r\n };\r\n\r\n const itemCount = items.reduce((sum, item) => sum + item.quantity, 0);\r\n const finalTotal = total + shipping + tax;\r\n\r\n if (items.length === 0) {\r\n return (\r\n <Layout>\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4 py-8\">\r\n <div className=\"max-w-2xl mx-auto text-center py-16\">\r\n <div className=\"mb-8\">\r\n <ShoppingBag className=\"h-24 w-24 mx-auto text-muted-foreground mb-4\" />\r\n <h1 className=\"text-3xl font-bold mb-4\">\r\n {t(\"empty\", \"Your Cart is Empty\")}\r\n </h1>\r\n <p className=\"text-muted-foreground mb-8\">\r\n {t(\"emptyDescription\", \"Looks like you haven't added any items to your cart yet.\")}\r\n </p>\r\n <Button asChild size=\"lg\">\r\n <Link to=\"/products\">\r\n <ArrowLeft className=\"w-4 h-4 mr-2\" />\r\n {t(\"continueShopping\", \"Continue Shopping\")}\r\n </Link>\r\n </Button>\r\n </div>\r\n </div>\r\n </div>\r\n </Layout>\r\n );\r\n }\r\n\r\n return (\r\n <Layout>\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4 py-8\">\r\n <FadeIn className=\"flex items-center gap-4 mb-8\">\r\n <Button variant=\"ghost\" size=\"icon\" asChild>\r\n <Link to=\"/products\">\r\n <ArrowLeft className=\"h-4 w-4\" />\r\n </Link>\r\n </Button>\r\n <div>\r\n <h1 className=\"text-3xl font-bold\">{t(\"title\", \"Shopping Cart\")}</h1>\r\n <p className=\"text-muted-foreground\">\r\n {itemCount} {t(\"itemsInCart\", \"items in your cart\")}\r\n </p>\r\n </div>\r\n </FadeIn>\r\n\r\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-8\">\r\n <div className=\"lg:col-span-2 space-y-4\">\r\n {items.map((item) => (\r\n <Card key={item.id}>\r\n <CardContent className=\"p-6\">\r\n <div className=\"flex gap-4\">\r\n <div className=\"w-24 h-24 flex-shrink-0\">\r\n <img\r\n src={item.product.images?.length ? item.product.images?.[0] : \"/images/placeholder.png\"}\r\n alt={item.product.name}\r\n className=\"w-full h-full object-cover rounded-lg\"\r\n />\r\n </div>\r\n\r\n <div className=\"flex-1 space-y-2\">\r\n <div className=\"flex items-start justify-between\">\r\n <div>\r\n <h3 className=\"font-semibold\">{item.product.name}</h3>\r\n <p className=\"text-sm text-muted-foreground\">\r\n {categoryMap.get(item.product.categories?.[0] as number)?.name}\r\n </p>\r\n </div>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n onClick={() => removeItem(item.id)}\r\n className=\"text-destructive hover:text-destructive\"\r\n >\r\n <Trash2 className=\"h-4 w-4\" />\r\n </Button>\r\n </div>\r\n\r\n <div className=\"flex items-center justify-between\">\r\n <div className=\"flex items-center gap-2\">\r\n <Button\r\n variant=\"outline\"\r\n size=\"icon\"\r\n className=\"h-8 w-8\"\r\n onClick={() => handleQuantityChange(item.id, item.quantity - 1)}\r\n >\r\n <Minus className=\"h-3 w-3\" />\r\n </Button>\r\n <Input\r\n type=\"number\"\r\n value={item.quantity}\r\n onChange={(e) => handleQuantityInputChange(item.id, e.target.value)}\r\n className=\"w-16 text-center\"\r\n min=\"1\"\r\n />\r\n <Button\r\n variant=\"outline\"\r\n size=\"icon\"\r\n className=\"h-8 w-8\"\r\n onClick={() => handleQuantityChange(item.id, item.quantity + 1)}\r\n >\r\n <Plus className=\"h-3 w-3\" />\r\n </Button>\r\n </div>\r\n\r\n <div className=\"text-right\">\r\n <p className=\"font-semibold\">\r\n {formatPrice(getProductPrice(item.product) * item.quantity, currency)}\r\n </p>\r\n {item.quantity > 1 && (\r\n <p className=\"text-sm text-muted-foreground\">\r\n {formatPrice(getProductPrice(item.product), currency)} {t(\"each\", \"each\")}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </CardContent>\r\n </Card>\r\n ))}\r\n </div>\r\n\r\n <div className=\"space-y-6\">\r\n <Card>\r\n <CardHeader>\r\n <CardTitle>{t(\"orderSummary\", \"Order Summary\")}</CardTitle>\r\n </CardHeader>\r\n <CardContent className=\"space-y-4\">\r\n <div className=\"flex justify-between\">\r\n <span>\r\n {t(\"subtotal\", \"Subtotal\")} ({itemCount} {t(\"items\", \"items\")})\r\n </span>\r\n <span>{formatPrice(total, currency)}</span>\r\n </div>\r\n\r\n <div className=\"flex justify-between\">\r\n <span>{t(\"shipping\", \"Shipping\")}</span>\r\n <span>\r\n {shipping === 0 ? t(\"free\", \"Free\") : formatPrice(shipping, currency)}\r\n </span>\r\n </div>\r\n\r\n <div className=\"flex justify-between\">\r\n <span>{t(\"tax\", \"Tax\")}</span>\r\n <span>{formatPrice(tax, currency)}</span>\r\n </div>\r\n\r\n <Separator />\r\n\r\n <div className=\"flex justify-between text-lg font-semibold\">\r\n <span>{t(\"total\", \"Total\")}</span>\r\n <span>{formatPrice(finalTotal, currency)}</span>\r\n </div>\r\n\r\n {shipping > 0 && freeShippingThreshold && freeShippingThreshold > total && (\r\n <div className=\"text-sm text-muted-foreground bg-muted/50 p-3 rounded-lg\">\r\n {t(\"freeShippingMessage\", \"Add {{amount}} more for free shipping!\").replace(\r\n \"{{amount}}\",\r\n formatPrice(freeShippingThreshold - total, currency)\r\n )}\r\n </div>\r\n )}\r\n\r\n <Button asChild className=\"w-full\" size=\"lg\">\r\n <Link to=\"/checkout\">{t(\"proceedToCheckout\", \"Proceed to Checkout\")}</Link>\r\n </Button>\r\n\r\n <Button variant=\"outline\" asChild className=\"w-full\">\r\n <Link to=\"/products\">{t(\"continueShopping\", \"Continue Shopping\")}</Link>\r\n </Button>\r\n </CardContent>\r\n </Card>\r\n\r\n <Card>\r\n <CardContent className=\"p-4\">\r\n <div className=\"text-center space-y-2\">\r\n <div className=\"text-sm text-muted-foreground\">\r\n {t(\"secureCheckout\", \"Secure Checkout\")}\r\n </div>\r\n <p className=\"text-xs text-muted-foreground\">\r\n {t(\"secureCheckoutDescription\", \"Your payment information is encrypted and secure\")}\r\n </p>\r\n </div>\r\n </CardContent>\r\n </Card>\r\n </div>\r\n </div>\r\n </div>\r\n </Layout>\r\n );\r\n}\r\n\r\nexport default CartPage;\r\n"
27
27
  },
28
28
  {
29
29
  "path": "cart-page/lang/en.json",
30
30
  "type": "registry:lang",
31
31
  "target": "$modules$/cart-page/lang/en.json",
32
- "content": "{\n \"pageTitle\": \"Shopping Cart\",\n \"title\": \"Shopping Cart\",\n \"empty\": \"Your Cart is Empty\",\n \"emptyDescription\": \"Looks like you haven't added any items to your cart yet.\",\n \"addToCart\": \"Add to Cart\",\n \"removeItem\": \"Remove Item\",\n \"quantity\": \"Quantity\",\n \"subtotal\": \"Subtotal\",\n \"shipping\": \"Shipping\",\n \"tax\": \"Tax\",\n \"total\": \"Total\",\n \"proceedToCheckout\": \"Proceed to Checkout\",\n \"secureCheckout\": \"Secure Checkout\",\n \"orderSummary\": \"Order Summary\",\n \"itemsInCart\": \"items in your cart\",\n \"items\": \"items\",\n \"variant\": \"Variant\",\n \"each\": \"each\",\n \"freeShippingMessage\": \"Add {{amount}} more for free shipping!\",\n \"continueShopping\": \"Continue Shopping\",\n \"secureCheckoutDescription\": \"Your payment information is encrypted and secure\",\n \"free\": \"Free\"\n}\n"
32
+ "content": "{\r\n \"pageTitle\": \"Shopping Cart\",\r\n \"title\": \"Shopping Cart\",\r\n \"empty\": \"Your Cart is Empty\",\r\n \"emptyDescription\": \"Looks like you haven't added any items to your cart yet.\",\r\n \"addToCart\": \"Add to Cart\",\r\n \"removeItem\": \"Remove Item\",\r\n \"quantity\": \"Quantity\",\r\n \"subtotal\": \"Subtotal\",\r\n \"shipping\": \"Shipping\",\r\n \"tax\": \"Tax\",\r\n \"total\": \"Total\",\r\n \"proceedToCheckout\": \"Proceed to Checkout\",\r\n \"secureCheckout\": \"Secure Checkout\",\r\n \"orderSummary\": \"Order Summary\",\r\n \"itemsInCart\": \"items in your cart\",\r\n \"items\": \"items\",\r\n \"variant\": \"Variant\",\r\n \"each\": \"each\",\r\n \"freeShippingMessage\": \"Add {{amount}} more for free shipping!\",\r\n \"continueShopping\": \"Continue Shopping\",\r\n \"secureCheckoutDescription\": \"Your payment information is encrypted and secure\",\r\n \"free\": \"Free\"\r\n}\r\n"
33
33
  },
34
34
  {
35
35
  "path": "cart-page/lang/tr.json",
36
36
  "type": "registry:lang",
37
37
  "target": "$modules$/cart-page/lang/tr.json",
38
- "content": "{\n \"pageTitle\": \"Alışveriş Sepeti\",\n \"title\": \"Alışveriş Sepeti\",\n \"empty\": \"Sepetiniz Boş\",\n \"emptyDescription\": \"Henüz sepetinize hiç ürün eklememişsiniz.\",\n \"addToCart\": \"Sepete Ekle\",\n \"removeItem\": \"Ürünü Kaldır\",\n \"quantity\": \"Adet\",\n \"subtotal\": \"Ara Toplam\",\n \"shipping\": \"Kargo\",\n \"tax\": \"Vergi\",\n \"total\": \"Toplam\",\n \"proceedToCheckout\": \"Ödemeye Geç\",\n \"secureCheckout\": \"Güvenli Ödeme\",\n \"orderSummary\": \"Sipariş Özeti\",\n \"itemsInCart\": \"sepetinizdeki ürün\",\n \"items\": \"ürün\",\n \"variant\": \"Varyant\",\n \"each\": \"adet\",\n \"freeShippingMessage\": \"Ücretsiz kargo için {{amount}} daha ekleyin!\",\n \"continueShopping\": \"Alışverişe Devam Et\",\n \"secureCheckoutDescription\": \"Ödeme bilgileriniz şifreli ve güvenlidir\",\n \"free\": \"Ücretsiz\"\n}\n"
38
+ "content": "{\r\n \"pageTitle\": \"Alışveriş Sepeti\",\r\n \"title\": \"Alışveriş Sepeti\",\r\n \"empty\": \"Sepetiniz Boş\",\r\n \"emptyDescription\": \"Henüz sepetinize hiç ürün eklememişsiniz.\",\r\n \"addToCart\": \"Sepete Ekle\",\r\n \"removeItem\": \"Ürünü Kaldır\",\r\n \"quantity\": \"Adet\",\r\n \"subtotal\": \"Ara Toplam\",\r\n \"shipping\": \"Kargo\",\r\n \"tax\": \"Vergi\",\r\n \"total\": \"Toplam\",\r\n \"proceedToCheckout\": \"Ödemeye Geç\",\r\n \"secureCheckout\": \"Güvenli Ödeme\",\r\n \"orderSummary\": \"Sipariş Özeti\",\r\n \"itemsInCart\": \"sepetinizdeki ürün\",\r\n \"items\": \"ürün\",\r\n \"variant\": \"Varyant\",\r\n \"each\": \"adet\",\r\n \"freeShippingMessage\": \"Ücretsiz kargo için {{amount}} daha ekleyin!\",\r\n \"continueShopping\": \"Alışverişe Devam Et\",\r\n \"secureCheckoutDescription\": \"Ödeme bilgileriniz şifreli ve güvenlidir\",\r\n \"free\": \"Ücretsiz\"\r\n}\r\n"
39
39
  }
40
40
  ],
41
41
  "exports": {
@@ -23,19 +23,19 @@
23
23
  "path": "case-study-page/index.ts",
24
24
  "type": "registry:index",
25
25
  "target": "$modules$/case-study-page/index.ts",
26
- "content": "export * from \"./case-study-page\";\nexport { CaseStudyPage as default } from \"./case-study-page\";\n"
26
+ "content": "export * from \"./case-study-page\";\r\nexport { CaseStudyPage as default } from \"./case-study-page\";\r\n"
27
27
  },
28
28
  {
29
29
  "path": "case-study-page/lang/en.json",
30
30
  "type": "registry:lang",
31
31
  "target": "$modules$/case-study-page/lang/en.json",
32
- "content": "{\n \"pageTitle\": \"Case Study\",\n \"title\": \"E-commerce Platform Redesign\",\n \"subtitle\": \"Let Promake tailor this case study to your actual project.\",\n \"sections\": {\n \"challenge\": {\n \"title\": \"The Challenge\",\n \"content\": \"The client needed a complete overhaul of their e-commerce platform to improve user experience, increase conversion rates, and modernize their brand presence. The existing platform was outdated, had poor mobile support, and suffered from slow load times that were affecting sales.\"\n },\n \"solution\": {\n \"title\": \"Our Solution\",\n \"content\": \"We designed and developed a modern, responsive e-commerce platform with a focus on performance and user experience. Key improvements included a streamlined checkout process, advanced product filtering, personalized recommendations, and a complete visual redesign that aligned with the client's evolved brand identity.\"\n },\n \"results\": {\n \"title\": \"The Results\",\n \"content\": \"After launch, the client saw a 45% increase in conversion rates, 60% improvement in page load times, and a 35% increase in mobile sales. Customer satisfaction scores improved by 28%, and the average order value increased by 22%.\"\n }\n },\n \"gallery\": \"Project Gallery\",\n \"projectDetails\": \"Project Details\",\n \"labels\": {\n \"client\": \"Client\",\n \"date\": \"Date\",\n \"category\": \"Category\",\n \"services\": \"Services\"\n },\n \"details\": {\n \"client\": \"Acme Corporation\",\n \"date\": \"January 2024\",\n \"category\": \"Web Design\",\n \"services\": [\"UX Design\", \"UI Design\", \"Development\"]\n },\n \"visitWebsite\": \"Visit Website\",\n \"share\": \"Share This Project\",\n \"navigation\": {\n \"prev\": \"Previous Project\",\n \"next\": \"Next Project\"\n },\n \"prev\": \"Prev\",\n \"next\": \"Next\",\n \"allProjects\": \"All Projects\"\n}\n"
32
+ "content": "{\r\n \"pageTitle\": \"Case Study\",\r\n \"title\": \"E-commerce Platform Redesign\",\r\n \"subtitle\": \"Let Promake tailor this case study to your actual project.\",\r\n \"sections\": {\r\n \"challenge\": {\r\n \"title\": \"The Challenge\",\r\n \"content\": \"The client needed a complete overhaul of their e-commerce platform to improve user experience, increase conversion rates, and modernize their brand presence. The existing platform was outdated, had poor mobile support, and suffered from slow load times that were affecting sales.\"\r\n },\r\n \"solution\": {\r\n \"title\": \"Our Solution\",\r\n \"content\": \"We designed and developed a modern, responsive e-commerce platform with a focus on performance and user experience. Key improvements included a streamlined checkout process, advanced product filtering, personalized recommendations, and a complete visual redesign that aligned with the client's evolved brand identity.\"\r\n },\r\n \"results\": {\r\n \"title\": \"The Results\",\r\n \"content\": \"After launch, the client saw a 45% increase in conversion rates, 60% improvement in page load times, and a 35% increase in mobile sales. Customer satisfaction scores improved by 28%, and the average order value increased by 22%.\"\r\n }\r\n },\r\n \"gallery\": \"Project Gallery\",\r\n \"projectDetails\": \"Project Details\",\r\n \"labels\": {\r\n \"client\": \"Client\",\r\n \"date\": \"Date\",\r\n \"category\": \"Category\",\r\n \"services\": \"Services\"\r\n },\r\n \"details\": {\r\n \"client\": \"Acme Corporation\",\r\n \"date\": \"January 2024\",\r\n \"category\": \"Web Design\",\r\n \"services\": [\"UX Design\", \"UI Design\", \"Development\"]\r\n },\r\n \"visitWebsite\": \"Visit Website\",\r\n \"share\": \"Share This Project\",\r\n \"navigation\": {\r\n \"prev\": \"Previous Project\",\r\n \"next\": \"Next Project\"\r\n },\r\n \"prev\": \"Prev\",\r\n \"next\": \"Next\",\r\n \"allProjects\": \"All Projects\"\r\n}\r\n"
33
33
  },
34
34
  {
35
35
  "path": "case-study-page/lang/tr.json",
36
36
  "type": "registry:lang",
37
37
  "target": "$modules$/case-study-page/lang/tr.json",
38
- "content": "{\n \"pageTitle\": \"Vaka Çalışması\",\n \"title\": \"E-ticaret Platformu Yenileme\",\n \"subtitle\": \"Promake ile bu vaka çalışmasını gerçek projenize göre uyarlayın.\",\n \"sections\": {\n \"challenge\": {\n \"title\": \"Zorluk\",\n \"content\": \"Müşteri, kullanıcı deneyimini iyileştirmek, dönüşüm oranlarını artırmak ve marka varlığını modernize etmek için e-ticaret platformunun tamamen yenilenmesini istedi. Mevcut platform eskimişti, mobil desteği zayıftı ve satışları etkileyen yavaş yükleme süreleri yaşıyordu.\"\n },\n \"solution\": {\n \"title\": \"Çözümümüz\",\n \"content\": \"Performans ve kullanıcı deneyimine odaklanan modern, duyarlı bir e-ticaret platformu tasarladık ve geliştirdik. Temel iyileştirmeler arasında basitleştirilmiş ödeme süreci, gelişmiş ürün filtreleme, kişiselleştirilmiş öneriler ve müşterinin gelişen marka kimliğiyle uyumlu tam bir görsel yenileme yer aldı.\"\n },\n \"results\": {\n \"title\": \"Sonuçlar\",\n \"content\": \"Lansmandan sonra müşteri, dönüşüm oranlarında %45 artış, sayfa yükleme sürelerinde %60 iyileşme ve mobil satışlarda %35 artış gördü. Müşteri memnuniyeti puanları %28 iyileşti ve ortalama sipariş değeri %22 arttı.\"\n }\n },\n \"gallery\": \"Proje Galerisi\",\n \"projectDetails\": \"Proje Detayları\",\n \"labels\": {\n \"client\": \"Müşteri\",\n \"date\": \"Tarih\",\n \"category\": \"Kategori\",\n \"services\": \"Hizmetler\"\n },\n \"details\": {\n \"client\": \"Acme Corporation\",\n \"date\": \"Ocak 2024\",\n \"category\": \"Web Tasarımı\",\n \"services\": [\"UX Tasarımı\", \"UI Tasarımı\", \"Geliştirme\"]\n },\n \"visitWebsite\": \"Web Sitesini Ziyaret Et\",\n \"share\": \"Bu Projeyi Paylaş\",\n \"navigation\": {\n \"prev\": \"Önceki Proje\",\n \"next\": \"Sonraki Proje\"\n },\n \"prev\": \"Önceki\",\n \"next\": \"Sonraki\",\n \"allProjects\": \"Tüm Projeler\"\n}\n"
38
+ "content": "{\r\n \"pageTitle\": \"Vaka Çalışması\",\r\n \"title\": \"E-ticaret Platformu Yenileme\",\r\n \"subtitle\": \"Promake ile bu vaka çalışmasını gerçek projenize göre uyarlayın.\",\r\n \"sections\": {\r\n \"challenge\": {\r\n \"title\": \"Zorluk\",\r\n \"content\": \"Müşteri, kullanıcı deneyimini iyileştirmek, dönüşüm oranlarını artırmak ve marka varlığını modernize etmek için e-ticaret platformunun tamamen yenilenmesini istedi. Mevcut platform eskimişti, mobil desteği zayıftı ve satışları etkileyen yavaş yükleme süreleri yaşıyordu.\"\r\n },\r\n \"solution\": {\r\n \"title\": \"Çözümümüz\",\r\n \"content\": \"Performans ve kullanıcı deneyimine odaklanan modern, duyarlı bir e-ticaret platformu tasarladık ve geliştirdik. Temel iyileştirmeler arasında basitleştirilmiş ödeme süreci, gelişmiş ürün filtreleme, kişiselleştirilmiş öneriler ve müşterinin gelişen marka kimliğiyle uyumlu tam bir görsel yenileme yer aldı.\"\r\n },\r\n \"results\": {\r\n \"title\": \"Sonuçlar\",\r\n \"content\": \"Lansmandan sonra müşteri, dönüşüm oranlarında %45 artış, sayfa yükleme sürelerinde %60 iyileşme ve mobil satışlarda %35 artış gördü. Müşteri memnuniyeti puanları %28 iyileşti ve ortalama sipariş değeri %22 arttı.\"\r\n }\r\n },\r\n \"gallery\": \"Proje Galerisi\",\r\n \"projectDetails\": \"Proje Detayları\",\r\n \"labels\": {\r\n \"client\": \"Müşteri\",\r\n \"date\": \"Tarih\",\r\n \"category\": \"Kategori\",\r\n \"services\": \"Hizmetler\"\r\n },\r\n \"details\": {\r\n \"client\": \"Acme Corporation\",\r\n \"date\": \"Ocak 2024\",\r\n \"category\": \"Web Tasarımı\",\r\n \"services\": [\"UX Tasarımı\", \"UI Tasarımı\", \"Geliştirme\"]\r\n },\r\n \"visitWebsite\": \"Web Sitesini Ziyaret Et\",\r\n \"share\": \"Bu Projeyi Paylaş\",\r\n \"navigation\": {\r\n \"prev\": \"Önceki Proje\",\r\n \"next\": \"Sonraki Proje\"\r\n },\r\n \"prev\": \"Önceki\",\r\n \"next\": \"Sonraki\",\r\n \"allProjects\": \"Tüm Projeler\"\r\n}\r\n"
39
39
  }
40
40
  ],
41
41
  "exports": {
@@ -10,25 +10,25 @@
10
10
  "path": "category-section/index.ts",
11
11
  "type": "registry:index",
12
12
  "target": "$modules$/category-section/index.ts",
13
- "content": "export * from './category-section';\n"
13
+ "content": "export * from './category-section';\r\n"
14
14
  },
15
15
  {
16
16
  "path": "category-section/category-section.tsx",
17
17
  "type": "registry:component",
18
18
  "target": "$modules$/category-section/category-section.tsx",
19
- "content": "import { Link } from \"react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Card } from \"@/components/ui/card\";\nimport { useTranslation } from \"react-i18next\";\nimport { useDbList, type DbProductCategory } from \"@/db\";\n\nexport interface CategoryItem {\n id: string | number;\n slug: string;\n name: string;\n description?: string;\n image: string;\n}\n\nexport interface CategorySectionProps {\n categories?: CategoryItem[];\n loading?: boolean;\n}\n\nexport function CategorySection({\n categories: propCategories,\n loading: propLoading,\n}: CategorySectionProps) {\n const { t } = useTranslation(\"category-section\");\n const { data: hookCategories = [], isLoading: hookLoading } = useDbList<DbProductCategory>(\"product_categories\");\n\n const categories = propCategories ?? hookCategories;\n const loading = propLoading ?? hookLoading;\n\n return (\n <section className=\"py-8 sm:py-12 md:py-16 lg:py-20 bg-gradient-to-b from-background to-muted/20 border-t border-border/20\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-3 sm:px-4 lg:px-8\">\n <div className=\"text-center mb-6 sm:mb-8 md:mb-12 lg:mb-16 px-2\">\n <h2 className=\"text-xl sm:text-2xl md:text-3xl lg:text-4xl xl:text-5xl font-bold mb-2 sm:mb-3 md:mb-4 bg-gradient-to-r from-primary to-primary/80 bg-clip-text text-transparent leading-normal pb-1\">\n {t(\"title\", \"Shop by Category\")}\n </h2>\n <div className=\"w-12 sm:w-16 h-1 bg-gradient-to-r from-primary/50 to-primary/20 mx-auto mb-3 sm:mb-4 md:mb-6 rounded-full\"></div>\n <p className=\"text-xs sm:text-sm md:text-base lg:text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed\">\n {t(\"subtitle\", \"Discover our carefully curated collections\")}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-6 lg:gap-8\">\n {loading\n ? [...Array(4)].map((_, i) => (\n <div key={i} className=\"animate-pulse\">\n <div className=\"aspect-[3/2] bg-muted rounded-xl mb-4\"></div>\n <div className=\"h-5 bg-muted rounded w-3/4 mb-2\"></div>\n <div className=\"h-4 bg-muted rounded w-1/2\"></div>\n </div>\n ))\n : categories.map((category) => (\n <div key={category.id} className=\"contents\" data-db-table=\"product_categories\" data-db-id={category.id}>\n <Link\n to={`/products?category=${category.slug}`}\n className=\"group block\"\n >\n <Card className=\"overflow-hidden border-0 p-0 shadow-lg hover:shadow-2xl transition-all duration-500 group-hover:-translate-y-2 rounded-2xl\">\n <div className=\"aspect-[4/3] relative overflow-hidden\">\n <img\n src={category.image}\n alt={category.name}\n className=\"absolute inset-0 w-full h-full object-cover group-hover:scale-110 transition-transform duration-700\"\n />\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent group-hover:from-black/70 transition-all duration-300\"></div>\n\n <div className=\"absolute bottom-0 left-0 right-0 p-4 sm:p-6\">\n <h3 className=\"text-lg sm:text-xl font-bold text-white mb-1 sm:mb-2 group-hover:text-primary-foreground transition-colors\">\n {category.name}\n </h3>\n {category.description && (\n <p className=\"text-xs sm:text-sm text-white/90 line-clamp-2 group-hover:text-white transition-colors\">\n {category.description}\n </p>\n )}\n\n <div className=\"flex items-center mt-2 sm:mt-3 text-white/80 group-hover:text-white transition-all duration-300 transform group-hover:translate-x-1\">\n <span className=\"text-xs sm:text-sm font-medium mr-2\">\n {t(\"explore\", \"Explore\")}\n </span>\n <ArrowRight className=\"w-3 h-3 sm:w-4 sm:h-4\" />\n </div>\n </div>\n </div>\n </Card>\n </Link>\n </div>\n ))}\n </div>\n </div>\n </section>\n );\n}\n"
19
+ "content": "import { Link } from \"react-router\";\r\nimport { ArrowRight } from \"lucide-react\";\r\nimport { Card } from \"@/components/ui/card\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { useDbList, type DbProductCategory } from \"@/db\";\r\n\r\nexport interface CategoryItem {\r\n id: string | number;\r\n slug: string;\r\n name: string;\r\n description?: string;\r\n image: string;\r\n}\r\n\r\nexport interface CategorySectionProps {\r\n categories?: CategoryItem[];\r\n loading?: boolean;\r\n}\r\n\r\nexport function CategorySection({\r\n categories: propCategories,\r\n loading: propLoading,\r\n}: CategorySectionProps) {\r\n const { t } = useTranslation(\"category-section\");\r\n const { data: hookCategories = [], isLoading: hookLoading } = useDbList<DbProductCategory>(\"product_categories\");\r\n\r\n const categories = propCategories ?? hookCategories;\r\n const loading = propLoading ?? hookLoading;\r\n\r\n return (\r\n <section className=\"py-8 sm:py-12 md:py-16 lg:py-20 bg-gradient-to-b from-background to-muted/20 border-t border-border/20\">\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-3 sm:px-4 lg:px-8\">\r\n <div className=\"text-center mb-6 sm:mb-8 md:mb-12 lg:mb-16 px-2\">\r\n <h2 className=\"text-xl sm:text-2xl md:text-3xl lg:text-4xl xl:text-5xl font-bold mb-2 sm:mb-3 md:mb-4 bg-gradient-to-r from-primary to-primary/80 bg-clip-text text-transparent leading-normal pb-1\">\r\n {t(\"title\", \"Shop by Category\")}\r\n </h2>\r\n <div className=\"w-12 sm:w-16 h-1 bg-gradient-to-r from-primary/50 to-primary/20 mx-auto mb-3 sm:mb-4 md:mb-6 rounded-full\"></div>\r\n <p className=\"text-xs sm:text-sm md:text-base lg:text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed\">\r\n {t(\"subtitle\", \"Discover our carefully curated collections\")}\r\n </p>\r\n </div>\r\n\r\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-6 lg:gap-8\">\r\n {loading\r\n ? [...Array(4)].map((_, i) => (\r\n <div key={i} className=\"animate-pulse\">\r\n <div className=\"aspect-[3/2] bg-muted rounded-xl mb-4\"></div>\r\n <div className=\"h-5 bg-muted rounded w-3/4 mb-2\"></div>\r\n <div className=\"h-4 bg-muted rounded w-1/2\"></div>\r\n </div>\r\n ))\r\n : categories.map((category) => (\r\n <div key={category.id} className=\"contents\" data-db-table=\"product_categories\" data-db-id={category.id}>\r\n <Link\r\n to={`/products?category=${category.slug}`}\r\n className=\"group block\"\r\n >\r\n <Card className=\"overflow-hidden border-0 p-0 shadow-lg hover:shadow-2xl transition-all duration-500 group-hover:-translate-y-2 rounded-2xl\">\r\n <div className=\"aspect-[4/3] relative overflow-hidden\">\r\n <img\r\n src={category.image}\r\n alt={category.name}\r\n className=\"absolute inset-0 w-full h-full object-cover group-hover:scale-110 transition-transform duration-700\"\r\n />\r\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent group-hover:from-black/70 transition-all duration-300\"></div>\r\n\r\n <div className=\"absolute bottom-0 left-0 right-0 p-4 sm:p-6\">\r\n <h3 className=\"text-lg sm:text-xl font-bold text-white mb-1 sm:mb-2 group-hover:text-primary-foreground transition-colors\">\r\n {category.name}\r\n </h3>\r\n {category.description && (\r\n <p className=\"text-xs sm:text-sm text-white/90 line-clamp-2 group-hover:text-white transition-colors\">\r\n {category.description}\r\n </p>\r\n )}\r\n\r\n <div className=\"flex items-center mt-2 sm:mt-3 text-white/80 group-hover:text-white transition-all duration-300 transform group-hover:translate-x-1\">\r\n <span className=\"text-xs sm:text-sm font-medium mr-2\">\r\n {t(\"explore\", \"Explore\")}\r\n </span>\r\n <ArrowRight className=\"w-3 h-3 sm:w-4 sm:h-4\" />\r\n </div>\r\n </div>\r\n </div>\r\n </Card>\r\n </Link>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </section>\r\n );\r\n}\r\n"
20
20
  },
21
21
  {
22
22
  "path": "category-section/lang/en.json",
23
23
  "type": "registry:lang",
24
24
  "target": "$modules$/category-section/lang/en.json",
25
- "content": "{\n \"title\": \"Shop by Category\",\n \"subtitle\": \"Discover our carefully curated collections\",\n \"explore\": \"Explore\"\n}\n"
25
+ "content": "{\r\n \"title\": \"Shop by Category\",\r\n \"subtitle\": \"Discover our carefully curated collections\",\r\n \"explore\": \"Explore\"\r\n}\r\n"
26
26
  },
27
27
  {
28
28
  "path": "category-section/lang/tr.json",
29
29
  "type": "registry:lang",
30
30
  "target": "$modules$/category-section/lang/tr.json",
31
- "content": "{\n \"title\": \"Kategorilere Göz Atın\",\n \"subtitle\": \"Özenle seçilmiş koleksiyonlarımızı keşfedin\",\n \"explore\": \"Keşfet\"\n}\n"
31
+ "content": "{\r\n \"title\": \"Kategorilere Göz Atın\",\r\n \"subtitle\": \"Özenle seçilmiş koleksiyonlarımızı keşfedin\",\r\n \"explore\": \"Keşfet\"\r\n}\r\n"
32
32
  }
33
33
  ],
34
34
  "exports": {