create-nymbal-app 0.4.0 → 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 (175) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +14 -5
  3. package/dist/index.js.map +1 -1
  4. package/package.json +5 -4
  5. package/scaffold/project/astro/src/pages/index.astro +13 -15
  6. package/scaffold/templates/astro/_dot.node-version +1 -1
  7. package/scaffold/templates/astro/astro.config.mjs +23 -0
  8. package/scaffold/templates/astro/package.json +26 -26
  9. package/scaffold/templates/astro/src/components/SkipNav.astro +3 -1
  10. package/scaffold/templates/astro/src/elements/index.ts +11 -0
  11. package/scaffold/templates/astro/src/layouts/BaseLayout.astro +15 -4
  12. package/scaffold/templates/astro/src/lib/api.ts +162 -38
  13. package/scaffold/templates/astro/src/lib/chrome.ts +59 -0
  14. package/scaffold/templates/astro/src/lib/client.ts +4 -4
  15. package/scaffold/templates/astro/src/lib/fragments.ts +48 -0
  16. package/scaffold/templates/astro/src/lib/server-elements.ts +5 -0
  17. package/scaffold/templates/astro/src/middleware.ts +37 -0
  18. package/scaffold/templates/astro/src/pages/404.astro +3 -0
  19. package/scaffold/templates/astro/src/pages/account/addresses.astro +5 -97
  20. package/scaffold/templates/astro/src/pages/account/login.astro +7 -34
  21. package/scaffold/templates/astro/src/pages/account/orders/[orderNumber].astro +11 -3
  22. package/scaffold/templates/astro/src/pages/account/profile.astro +6 -56
  23. package/scaffold/templates/astro/src/pages/account/register.astro +7 -73
  24. package/scaffold/templates/astro/src/pages/alerts/confirm.astro +59 -0
  25. package/scaffold/templates/astro/src/pages/alerts/unsubscribe.astro +53 -0
  26. package/scaffold/templates/astro/src/pages/cart.astro +14 -7
  27. package/scaffold/templates/astro/src/pages/category/[slug].astro +25 -27
  28. package/scaffold/templates/astro/src/pages/checkout.astro +30 -94
  29. package/scaffold/templates/astro/src/pages/fragments/footer.astro +5 -2
  30. package/scaffold/templates/astro/src/pages/fragments/header.astro +12 -2
  31. package/scaffold/templates/astro/src/pages/fragments/nav.astro +8 -5
  32. package/scaffold/templates/astro/src/pages/fragments/product/[slug].astro +9 -10
  33. package/scaffold/templates/astro/src/pages/index.astro +25 -15
  34. package/scaffold/templates/astro/src/pages/order/[orderNumber].astro +34 -45
  35. package/scaffold/templates/astro/src/pages/product/[slug].astro +64 -34
  36. package/scaffold/templates/astro/src/pages/products/index.astro +16 -21
  37. package/scaffold/templates/astro/src/pages/search.astro +10 -11
  38. package/scaffold/templates/astro/src/scripts/init-client.ts +14 -0
  39. package/scaffold/templates/astro/src/scripts/order-status.ts +3 -1
  40. package/scaffold/templates/astro/src/scripts/pdp.ts +29 -21
  41. package/scaffold/templates/astro/src/scripts/plp.ts +15 -93
  42. package/scaffold/templates/astro/src/scripts/search.ts +7 -132
  43. package/scaffold/templates/astro/src/scripts/signed-in-redirect.ts +4 -0
  44. package/scaffold/templates/astro/src/styles/global.css +49 -45
  45. package/scaffold/templates/astro/src/styles/pages/account.css +4 -90
  46. package/scaffold/templates/astro/src/styles/pages/confirmation.css +6 -0
  47. package/scaffold/templates/astro/src/styles/pages/home.css +9 -100
  48. package/scaffold/templates/astro/src/styles/pages/pdp.css +5 -171
  49. package/scaffold/templates/astro/src/styles/pages/plp.css +3 -42
  50. package/scaffold/templates/astro/src/styles/pages/search.css +4 -110
  51. package/scaffold/templates/astro/src/styles/tokens.css +56 -0
  52. package/scaffold/templates/nextjs/_dot.node-version +1 -1
  53. package/scaffold/templates/nextjs/app/(catalog)/category/[slug]/page.tsx +74 -0
  54. package/scaffold/templates/nextjs/app/(catalog)/home/[key]/page.tsx +85 -0
  55. package/scaffold/templates/nextjs/app/(catalog)/layout.tsx +13 -0
  56. package/scaffold/templates/nextjs/app/(catalog)/not-found.tsx +7 -0
  57. package/scaffold/templates/nextjs/app/(catalog)/product/[slug]/page.tsx +201 -0
  58. package/scaffold/templates/nextjs/app/(catalog)/products/page.tsx +62 -0
  59. package/scaffold/templates/nextjs/app/(catalog)/search/SearchView.tsx +90 -0
  60. package/scaffold/templates/nextjs/app/(catalog)/search/page.tsx +46 -0
  61. package/scaffold/templates/nextjs/app/(shopper)/account/addresses/AddressesView.tsx +5 -0
  62. package/scaffold/templates/nextjs/app/(shopper)/account/addresses/page.tsx +17 -0
  63. package/scaffold/templates/nextjs/app/(shopper)/account/login/LoginView.tsx +28 -0
  64. package/scaffold/templates/nextjs/app/(shopper)/account/login/page.tsx +23 -0
  65. package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/[orderNumber]/page.tsx +10 -3
  66. package/scaffold/templates/nextjs/app/(shopper)/account/profile/ProfileView.tsx +5 -0
  67. package/scaffold/templates/nextjs/app/(shopper)/account/profile/page.tsx +20 -0
  68. package/scaffold/templates/nextjs/app/(shopper)/account/register/RegisterView.tsx +26 -0
  69. package/scaffold/templates/nextjs/app/(shopper)/account/register/page.tsx +11 -0
  70. package/scaffold/templates/nextjs/app/(shopper)/alerts/AlertLinkForm.tsx +90 -0
  71. package/scaffold/templates/nextjs/app/(shopper)/alerts/LinkInvalid.tsx +19 -0
  72. package/scaffold/templates/nextjs/app/(shopper)/alerts/actions.ts +33 -0
  73. package/scaffold/templates/nextjs/app/(shopper)/alerts/confirm/page.tsx +19 -0
  74. package/scaffold/templates/nextjs/app/(shopper)/alerts/unsubscribe/page.tsx +17 -0
  75. package/scaffold/templates/nextjs/app/(shopper)/cart/CartView.tsx +5 -0
  76. package/scaffold/templates/nextjs/app/(shopper)/cart/page.tsx +22 -0
  77. package/scaffold/templates/nextjs/app/(shopper)/checkout/CheckoutView.tsx +34 -0
  78. package/scaffold/templates/nextjs/app/(shopper)/checkout/page.tsx +39 -0
  79. package/scaffold/templates/nextjs/app/(shopper)/layout.tsx +12 -0
  80. package/scaffold/templates/nextjs/app/(shopper)/not-found.tsx +6 -0
  81. package/scaffold/templates/nextjs/app/{order → (shopper)/order}/[orderNumber]/page.tsx +44 -9
  82. package/scaffold/templates/nextjs/app/error.tsx +3 -7
  83. package/scaffold/templates/nextjs/app/fragments/footer/route.ts +13 -0
  84. package/scaffold/templates/nextjs/app/fragments/header/[key]/route.ts +18 -0
  85. package/scaffold/templates/nextjs/app/fragments/nav/[key]/route.ts +23 -0
  86. package/scaffold/templates/nextjs/app/fragments/product/[slug]/route.ts +22 -0
  87. package/scaffold/templates/nextjs/app/globals.css +5 -23
  88. package/scaffold/templates/nextjs/app/layout.tsx +8 -5
  89. package/scaffold/templates/nextjs/app/not-found.tsx +9 -33
  90. package/scaffold/templates/nextjs/app/tokens.css +56 -0
  91. package/scaffold/templates/nextjs/components/client/ListingControls.tsx +87 -0
  92. package/scaffold/templates/nextjs/components/client/NymbalSetup.tsx +48 -6
  93. package/scaffold/templates/nextjs/components/client/OrderStatusRefresh.tsx +8 -2
  94. package/scaffold/templates/nextjs/components/client/ProductInteractive.tsx +47 -15
  95. package/scaffold/templates/nextjs/components/client/elements.tsx +17 -0
  96. package/scaffold/templates/nextjs/components/server/Header.tsx +33 -102
  97. package/scaffold/templates/nextjs/components/server/NotFoundView.tsx +39 -0
  98. package/scaffold/templates/nextjs/components/server/SkipNav.tsx +7 -3
  99. package/scaffold/templates/nextjs/elements/index.ts +12 -0
  100. package/scaffold/templates/nextjs/lib/api.ts +198 -62
  101. package/scaffold/templates/nextjs/lib/chrome.ts +40 -0
  102. package/scaffold/templates/nextjs/lib/fragments.ts +16 -0
  103. package/scaffold/templates/nextjs/lib/header.ts +39 -0
  104. package/scaffold/templates/nextjs/lib/render.ts +14 -0
  105. package/scaffold/templates/nextjs/next.config.mjs +41 -0
  106. package/scaffold/templates/nextjs/package.json +28 -27
  107. package/scaffold/templates/nextjs/styles/pages/account.module.css +0 -70
  108. package/scaffold/templates/nextjs/styles/pages/confirmation.module.css +6 -85
  109. package/scaffold/templates/nextjs/styles/pages/home.module.css +2 -103
  110. package/scaffold/templates/nextjs/styles/pages/pdp.module.css +3 -183
  111. package/scaffold/templates/nextjs/styles/pages/plp.module.css +9 -143
  112. package/scaffold/templates/nextjs/styles/pages/search.module.css +1 -145
  113. package/scaffold/templates/nextjs/tsconfig.dist.json +5 -0
  114. package/scaffold/templates/astro/src/components/AddressForm.astro +0 -107
  115. package/scaffold/templates/astro/src/components/Breadcrumb.astro +0 -20
  116. package/scaffold/templates/astro/src/components/CategoryNav.astro +0 -27
  117. package/scaffold/templates/astro/src/components/CheckoutSteps.astro +0 -29
  118. package/scaffold/templates/astro/src/components/Footer.astro +0 -108
  119. package/scaffold/templates/astro/src/components/Header.astro +0 -198
  120. package/scaffold/templates/astro/src/components/ImageGallery.astro +0 -42
  121. package/scaffold/templates/astro/src/components/OrderSummary.astro +0 -53
  122. package/scaffold/templates/astro/src/components/Pagination.astro +0 -13
  123. package/scaffold/templates/astro/src/components/PriceDisplay.astro +0 -25
  124. package/scaffold/templates/astro/src/components/ProductCard.astro +0 -44
  125. package/scaffold/templates/astro/src/components/RelatedProducts.astro +0 -28
  126. package/scaffold/templates/astro/src/components/ReviewForm.astro +0 -74
  127. package/scaffold/templates/astro/src/components/ReviewList.astro +0 -41
  128. package/scaffold/templates/astro/src/components/StockBadge.astro +0 -15
  129. package/scaffold/templates/astro/src/scripts/auth-forms.ts +0 -82
  130. package/scaffold/templates/astro/src/scripts/cart-page.ts +0 -118
  131. package/scaffold/templates/astro/src/scripts/checkout.ts +0 -271
  132. package/scaffold/templates/astro/src/scripts/image-gallery.ts +0 -22
  133. package/scaffold/templates/astro/src/scripts/profile-form.ts +0 -57
  134. package/scaffold/templates/astro/src/scripts/review-form.ts +0 -27
  135. package/scaffold/templates/astro/src/styles/pages/cart.css +0 -215
  136. package/scaffold/templates/astro/src/styles/pages/checkout.css +0 -270
  137. package/scaffold/templates/nextjs/app/account/addresses/page.tsx +0 -10
  138. package/scaffold/templates/nextjs/app/account/login/page.tsx +0 -23
  139. package/scaffold/templates/nextjs/app/account/profile/page.tsx +0 -10
  140. package/scaffold/templates/nextjs/app/account/register/page.tsx +0 -10
  141. package/scaffold/templates/nextjs/app/cart/page.tsx +0 -10
  142. package/scaffold/templates/nextjs/app/category/[slug]/page.tsx +0 -61
  143. package/scaffold/templates/nextjs/app/checkout/page.tsx +0 -17
  144. package/scaffold/templates/nextjs/app/page.tsx +0 -63
  145. package/scaffold/templates/nextjs/app/product/[slug]/page.tsx +0 -111
  146. package/scaffold/templates/nextjs/app/products/page.tsx +0 -40
  147. package/scaffold/templates/nextjs/app/search/page.tsx +0 -24
  148. package/scaffold/templates/nextjs/components/client/AddressManager.tsx +0 -181
  149. package/scaffold/templates/nextjs/components/client/CartPage.tsx +0 -121
  150. package/scaffold/templates/nextjs/components/client/CheckoutForm.tsx +0 -482
  151. package/scaffold/templates/nextjs/components/client/ImageGallery.tsx +0 -68
  152. package/scaffold/templates/nextjs/components/client/LoginForm.tsx +0 -89
  153. package/scaffold/templates/nextjs/components/client/MiniCartWrapper.tsx +0 -12
  154. package/scaffold/templates/nextjs/components/client/ProductGrid.tsx +0 -137
  155. package/scaffold/templates/nextjs/components/client/ProfileForm.tsx +0 -112
  156. package/scaffold/templates/nextjs/components/client/RegisterForm.tsx +0 -131
  157. package/scaffold/templates/nextjs/components/client/ReviewForm.tsx +0 -116
  158. package/scaffold/templates/nextjs/components/client/SearchBarWrapper.tsx +0 -27
  159. package/scaffold/templates/nextjs/components/client/SearchResults.tsx +0 -181
  160. package/scaffold/templates/nextjs/components/server/Breadcrumb.tsx +0 -36
  161. package/scaffold/templates/nextjs/components/server/CategoryNav.tsx +0 -29
  162. package/scaffold/templates/nextjs/components/server/CheckoutSteps.tsx +0 -60
  163. package/scaffold/templates/nextjs/components/server/Footer.module.css +0 -64
  164. package/scaffold/templates/nextjs/components/server/Footer.tsx +0 -79
  165. package/scaffold/templates/nextjs/components/server/Header.module.css +0 -147
  166. package/scaffold/templates/nextjs/components/server/OrderSummary.tsx +0 -79
  167. package/scaffold/templates/nextjs/components/server/PriceDisplay.tsx +0 -31
  168. package/scaffold/templates/nextjs/components/server/ProductCard.tsx +0 -59
  169. package/scaffold/templates/nextjs/components/server/RelatedProducts.tsx +0 -31
  170. package/scaffold/templates/nextjs/components/server/ReviewList.tsx +0 -62
  171. package/scaffold/templates/nextjs/styles/pages/cart.module.css +0 -240
  172. package/scaffold/templates/nextjs/styles/pages/checkout.module.css +0 -404
  173. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/layout.tsx +0 -0
  174. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/page.tsx +0 -0
  175. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/page.tsx +0 -0
@@ -1,270 +0,0 @@
1
- /* ----------------------------------------------------------------
2
- Checkout page styles
3
- ---------------------------------------------------------------- */
4
-
5
- /* ---- Layout ---- */
6
-
7
- .checkout-layout {
8
- display: grid;
9
- grid-template-columns: 1fr;
10
- gap: var(--nymbal-spacing-xl, 2rem);
11
- }
12
-
13
- @media (min-width: 769px) {
14
- .checkout-layout {
15
- grid-template-columns: 1fr 380px;
16
- align-items: start;
17
- }
18
- }
19
-
20
- /* ---- Step indicator ---- */
21
-
22
- .checkout-steps {
23
- display: flex;
24
- align-items: center;
25
- justify-content: center;
26
- gap: 0;
27
- margin-bottom: var(--nymbal-spacing-xl, 2rem);
28
- padding: var(--nymbal-spacing-md, 1rem) 0;
29
- counter-reset: step;
30
- }
31
-
32
- .checkout-step {
33
- display: flex;
34
- align-items: center;
35
- gap: var(--nymbal-spacing-sm, 0.5rem);
36
- font-size: var(--nymbal-font-size-sm, 0.875rem);
37
- color: var(--nymbal-color-text-muted, #71717a);
38
- white-space: nowrap;
39
- }
40
-
41
- .checkout-step::before {
42
- counter-increment: step;
43
- content: counter(step);
44
- display: flex;
45
- align-items: center;
46
- justify-content: center;
47
- width: 28px;
48
- height: 28px;
49
- border-radius: var(--nymbal-radius-full, 9999px);
50
- border: 2px solid var(--nymbal-color-border, #e4e4e7);
51
- font-size: var(--nymbal-font-size-xs, 0.75rem);
52
- font-weight: var(--nymbal-font-weight-bold, 700);
53
- flex-shrink: 0;
54
- }
55
-
56
- .checkout-step.active {
57
- color: var(--nymbal-color-primary, #18181b);
58
- font-weight: var(--nymbal-font-weight-medium, 500);
59
- }
60
-
61
- .checkout-step.active::before {
62
- background-color: var(--nymbal-color-primary, #18181b);
63
- color: var(--nymbal-color-text-inverse, #fff);
64
- border-color: var(--nymbal-color-primary, #18181b);
65
- }
66
-
67
- .checkout-step.completed::before {
68
- background-color: var(--nymbal-color-success, #16a34a);
69
- color: var(--nymbal-color-text-inverse, #fff);
70
- border-color: var(--nymbal-color-success, #16a34a);
71
- content: '\2713';
72
- }
73
-
74
- .checkout-step-divider {
75
- width: 40px;
76
- height: 2px;
77
- background-color: var(--nymbal-color-border, #e4e4e7);
78
- margin: 0 var(--nymbal-spacing-sm, 0.5rem);
79
- flex-shrink: 0;
80
- }
81
-
82
- .checkout-step-divider.completed {
83
- background-color: var(--nymbal-color-success, #16a34a);
84
- }
85
-
86
- @media (max-width: 640px) {
87
- .checkout-step span {
88
- display: none;
89
- }
90
-
91
- .checkout-step-divider {
92
- width: 24px;
93
- }
94
- }
95
-
96
- /* ---- Form sections ---- */
97
-
98
- .checkout-form {
99
- display: flex;
100
- flex-direction: column;
101
- gap: var(--nymbal-spacing-xl, 2rem);
102
- }
103
-
104
- .checkout-section {
105
- padding-bottom: var(--nymbal-spacing-xl, 2rem);
106
- border-bottom: 1px solid var(--nymbal-color-border, #e4e4e7);
107
- }
108
-
109
- .checkout-section:last-child {
110
- border-bottom: none;
111
- padding-bottom: 0;
112
- }
113
-
114
- .checkout-section-title {
115
- font-size: var(--nymbal-font-size-lg, 1.125rem);
116
- font-weight: var(--nymbal-font-weight-bold, 700);
117
- color: var(--nymbal-color-primary, #18181b);
118
- margin-bottom: var(--nymbal-spacing-md, 1rem);
119
- }
120
-
121
- /* ---- Address form grid ---- */
122
-
123
- .address-grid {
124
- display: grid;
125
- grid-template-columns: 1fr;
126
- gap: var(--nymbal-spacing-md, 1rem);
127
- }
128
-
129
- @media (min-width: 641px) {
130
- .address-grid {
131
- grid-template-columns: 1fr 1fr;
132
- }
133
- }
134
-
135
- .address-grid .full-width {
136
- grid-column: 1 / -1;
137
- }
138
-
139
- /* ---- Payment section ---- */
140
-
141
- .payment-section {
142
- background-color: #fafafa;
143
- border: 1px solid var(--nymbal-color-border, #e4e4e7);
144
- border-radius: var(--nymbal-radius-lg, 0.75rem);
145
- padding: var(--nymbal-spacing-lg, 1.5rem);
146
- }
147
-
148
- .payment-grid {
149
- display: grid;
150
- grid-template-columns: 1fr;
151
- gap: var(--nymbal-spacing-md, 1rem);
152
- }
153
-
154
- @media (min-width: 641px) {
155
- .payment-grid {
156
- grid-template-columns: 1fr 1fr;
157
- }
158
- }
159
-
160
- .payment-grid .card-number {
161
- grid-column: 1 / -1;
162
- }
163
-
164
- /* ---- Order summary sidebar (checkout variant) ---- */
165
-
166
- .checkout-summary {
167
- background-color: #fafafa;
168
- border: 1px solid var(--nymbal-color-border, #e4e4e7);
169
- border-radius: var(--nymbal-radius-lg, 0.75rem);
170
- padding: var(--nymbal-spacing-lg, 1.5rem);
171
- position: sticky;
172
- top: 80px;
173
- }
174
-
175
- .checkout-summary-title {
176
- font-size: var(--nymbal-font-size-lg, 1.125rem);
177
- font-weight: var(--nymbal-font-weight-bold, 700);
178
- color: var(--nymbal-color-primary, #18181b);
179
- margin-bottom: var(--nymbal-spacing-md, 1rem);
180
- padding-bottom: var(--nymbal-spacing-md, 1rem);
181
- border-bottom: 1px solid var(--nymbal-color-border, #e4e4e7);
182
- }
183
-
184
- .checkout-summary-items {
185
- display: flex;
186
- flex-direction: column;
187
- gap: var(--nymbal-spacing-sm, 0.5rem);
188
- margin-bottom: var(--nymbal-spacing-md, 1rem);
189
- }
190
-
191
- .checkout-summary-item {
192
- display: flex;
193
- justify-content: space-between;
194
- align-items: start;
195
- gap: var(--nymbal-spacing-sm, 0.5rem);
196
- font-size: var(--nymbal-font-size-sm, 0.875rem);
197
- }
198
-
199
- .checkout-summary-item-name {
200
- color: var(--nymbal-color-text, #18181b);
201
- flex: 1;
202
- min-width: 0;
203
- }
204
-
205
- .checkout-summary-item-qty {
206
- color: var(--nymbal-color-text-muted, #71717a);
207
- flex-shrink: 0;
208
- }
209
-
210
- .checkout-summary-item-price {
211
- font-weight: var(--nymbal-font-weight-medium, 500);
212
- flex-shrink: 0;
213
- }
214
-
215
- .checkout-summary-row {
216
- display: flex;
217
- justify-content: space-between;
218
- padding: var(--nymbal-spacing-xs, 0.25rem) 0;
219
- font-size: var(--nymbal-font-size-sm, 0.875rem);
220
- }
221
-
222
- .checkout-summary-row dt {
223
- color: var(--nymbal-color-text-muted, #71717a);
224
- }
225
-
226
- .checkout-summary-row dd {
227
- font-weight: var(--nymbal-font-weight-medium, 500);
228
- }
229
-
230
- .checkout-summary-total {
231
- display: flex;
232
- justify-content: space-between;
233
- padding-top: var(--nymbal-spacing-md, 1rem);
234
- margin-top: var(--nymbal-spacing-sm, 0.5rem);
235
- border-top: 1px solid var(--nymbal-color-border, #e4e4e7);
236
- font-size: var(--nymbal-font-size-lg, 1.125rem);
237
- font-weight: var(--nymbal-font-weight-bold, 700);
238
- color: var(--nymbal-color-primary, #18181b);
239
- }
240
-
241
- /* ---- Submit area ---- */
242
-
243
- .checkout-submit {
244
- margin-top: var(--nymbal-spacing-lg, 1.5rem);
245
- }
246
-
247
- .checkout-submit .btn {
248
- width: 100%;
249
- justify-content: center;
250
- padding: var(--nymbal-spacing-md, 1rem);
251
- font-size: var(--nymbal-font-size-base, 1rem);
252
- }
253
-
254
- .checkout-terms {
255
- font-size: var(--nymbal-font-size-xs, 0.75rem);
256
- color: var(--nymbal-color-text-muted, #71717a);
257
- text-align: center;
258
- margin-top: var(--nymbal-spacing-sm, 0.5rem);
259
- }
260
-
261
- /* ---- Error message ---- */
262
-
263
- .checkout-error {
264
- padding: var(--nymbal-spacing-sm, 0.5rem) var(--nymbal-spacing-md, 1rem);
265
- background-color: rgba(220, 38, 38, 0.06);
266
- border: 1px solid rgba(220, 38, 38, 0.2);
267
- border-radius: var(--nymbal-radius-md, 0.5rem);
268
- color: var(--nymbal-color-error, #dc2626);
269
- font-size: var(--nymbal-font-size-sm, 0.875rem);
270
- }
@@ -1,10 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { AddressManager } from '@/components/client/AddressManager'
3
-
4
- export const metadata: Metadata = {
5
- title: 'Addresses',
6
- }
7
-
8
- export default function AddressesPage() {
9
- return <AddressManager />
10
- }
@@ -1,23 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { Suspense } from 'react'
3
- import { LoginForm } from '@/components/client/LoginForm'
4
-
5
- export const metadata: Metadata = {
6
- title: 'Sign In',
7
- }
8
-
9
- export default function LoginPage() {
10
- return (
11
- <Suspense
12
- fallback={
13
- <div className="loading-center">
14
- <div className="spinner spinner-lg" role="status">
15
- <span className="visually-hidden">Loading...</span>
16
- </div>
17
- </div>
18
- }
19
- >
20
- <LoginForm />
21
- </Suspense>
22
- )
23
- }
@@ -1,10 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { ProfileForm } from '@/components/client/ProfileForm'
3
-
4
- export const metadata: Metadata = {
5
- title: 'Profile',
6
- }
7
-
8
- export default function ProfilePage() {
9
- return <ProfileForm />
10
- }
@@ -1,10 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { RegisterForm } from '@/components/client/RegisterForm'
3
-
4
- export const metadata: Metadata = {
5
- title: 'Create Account',
6
- }
7
-
8
- export default function RegisterPage() {
9
- return <RegisterForm />
10
- }
@@ -1,10 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { CartPage } from '@/components/client/CartPage'
3
-
4
- export const metadata: Metadata = {
5
- title: 'Shopping Cart',
6
- }
7
-
8
- export default function CartRoute() {
9
- return <CartPage />
10
- }
@@ -1,61 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { notFound } from 'next/navigation'
3
- import { fetchProducts, fetchCategories, fetchCapabilities, sortFromSearchParams } from '@/lib/api'
4
- import { Breadcrumb } from '@/components/server/Breadcrumb'
5
- import { ProductGrid } from '@/components/client/ProductGrid'
6
- import styles from '@/styles/pages/plp.module.css'
7
-
8
- interface CategoryPageProps {
9
- params: Promise<{ slug: string }>
10
- searchParams: Promise<{ sort?: string | string[] }>
11
- }
12
-
13
- export async function generateMetadata({
14
- params,
15
- }: CategoryPageProps): Promise<Metadata> {
16
- const { slug } = await params
17
- const categories = await fetchCategories()
18
- const category = categories.find((c) => c.slug === slug)
19
-
20
- return {
21
- title: category?.name ?? slug,
22
- description: category?.description ?? `Browse products in ${slug}.`,
23
- }
24
- }
25
-
26
- export default async function CategoryPage({ params, searchParams }: CategoryPageProps) {
27
- const { slug } = await params
28
- const capabilities = await fetchCapabilities()
29
- const sort = sortFromSearchParams(await searchParams, capabilities?.catalog)
30
- const [{ items, nextCursor, facets }, categories] = await Promise.all([
31
- fetchProducts({ limit: 24, category: slug, sort }),
32
- fetchCategories(),
33
- ])
34
-
35
- const category = categories.find((c) => c.slug === slug)
36
- if (!category) notFound()
37
-
38
- return (
39
- <div className={`container ${styles.page}`}>
40
- <Breadcrumb
41
- items={[
42
- { label: 'Home', href: '/' },
43
- { label: category.name },
44
- ]}
45
- />
46
- <h1 className={styles.pageTitle}>{category.name}</h1>
47
- {category.description && (
48
- <p className="text-muted mb-lg">{category.description}</p>
49
- )}
50
- <ProductGrid
51
- initialProducts={items}
52
- initialCursor={nextCursor}
53
- initialSort={sort}
54
- initialFacets={facets ?? []}
55
- sortKeys={capabilities?.catalog.sortKeys ?? []}
56
- defaultSort={capabilities?.catalog.defaultSort}
57
- categorySlug={slug}
58
- />
59
- </div>
60
- )
61
- }
@@ -1,17 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { CheckoutForm } from '@/components/client/CheckoutForm'
3
- import { fetchCapabilities } from '@/lib/api'
4
-
5
- export const metadata: Metadata = {
6
- title: 'Checkout',
7
- }
8
-
9
- export default async function CheckoutRoute() {
10
- const capabilities = await fetchCapabilities()
11
- if (capabilities === null) {
12
- throw new Error(
13
- 'The store did not answer GET /api/capabilities, so checkout cannot tell how to take a payment.',
14
- )
15
- }
16
- return <CheckoutForm capabilities={capabilities} />
17
- }
@@ -1,63 +0,0 @@
1
- import Link from 'next/link'
2
- import { fetchProducts, fetchCategories } from '@/lib/api'
3
- import { organizationJsonLd } from '@/lib/seo'
4
- import { HeroSection } from '@/components/server/HeroSection'
5
- import { CategoryNav } from '@/components/server/CategoryNav'
6
- import { ProductCard } from '@/components/server/ProductCard'
7
- import { NewsletterSignup } from '@/components/client/NewsletterSignup'
8
- import styles from '@/styles/pages/home.module.css'
9
-
10
- export default async function HomePage() {
11
- const [{ items: products }, categories] = await Promise.all([
12
- fetchProducts({ limit: 8 }),
13
- fetchCategories(),
14
- ])
15
-
16
- const jsonLd = organizationJsonLd(
17
- 'Nymbal Store',
18
- process.env.NEXT_PUBLIC_SITE_URL ?? 'http://localhost:3000',
19
- )
20
-
21
- return (
22
- <>
23
- <script
24
- type="application/ld+json"
25
- dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
26
- />
27
-
28
- <HeroSection />
29
-
30
- <CategoryNav categories={categories} />
31
-
32
- <section className={`container ${styles.featuredSection}`}>
33
- <div className={styles.featuredHeader}>
34
- <h2 className={styles.featuredTitle}>Featured Products</h2>
35
- <Link href="/products" className={styles.featuredViewAll}>
36
- View All
37
- </Link>
38
- </div>
39
- {products.length > 0 ? (
40
- <div className="product-grid">
41
- {products.map((product) => (
42
- <ProductCard
43
- key={product.id}
44
- product={{
45
- slug: product.slug,
46
- name: product.name,
47
- priceMinor: product.priceMinor ?? null,
48
- priceRange: product.priceRange ?? null,
49
- currency: product.currency ?? null,
50
- media: product.media,
51
- }}
52
- />
53
- ))}
54
- </div>
55
- ) : (
56
- <p className="text-muted text-center">No products available yet. Check back soon.</p>
57
- )}
58
- </section>
59
-
60
- <NewsletterSignup />
61
- </>
62
- )
63
- }
@@ -1,111 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { notFound } from 'next/navigation'
3
- import { fetchProduct, fetchProducts, fetchReviews } from '@/lib/api'
4
- import { productJsonLd } from '@/lib/seo'
5
- import { Breadcrumb } from '@/components/server/Breadcrumb'
6
- import { ReviewList } from '@/components/server/ReviewList'
7
- import { RelatedProducts } from '@/components/server/RelatedProducts'
8
- import { ImageGallery } from '@/components/client/ImageGallery'
9
- import { ProductInteractive } from '@/components/client/ProductInteractive'
10
- import { ReviewForm } from '@/components/client/ReviewForm'
11
- import styles from '@/styles/pages/pdp.module.css'
12
-
13
- interface ProductPageProps {
14
- params: Promise<{ slug: string }>
15
- }
16
-
17
- export async function generateMetadata({
18
- params,
19
- }: ProductPageProps): Promise<Metadata> {
20
- const { slug } = await params
21
- const product = await fetchProduct(slug)
22
-
23
- if (!product) {
24
- return { title: 'Product Not Found' }
25
- }
26
-
27
- return {
28
- title: product.name,
29
- description: product.shortDescription ?? product.description ?? `Buy ${product.name}.`,
30
- }
31
- }
32
-
33
- export default async function ProductPage({ params }: ProductPageProps) {
34
- const { slug } = await params
35
- const product = await fetchProduct(slug)
36
-
37
- if (!product) notFound()
38
-
39
- const [{ items: reviews }, { items: relatedProducts }] = await Promise.all([
40
- fetchReviews(product.id),
41
- fetchProducts({ limit: 4 }),
42
- ])
43
-
44
- const related = relatedProducts.filter((p) => p.id !== product.id).slice(0, 4)
45
-
46
- const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ?? 'http://localhost:3000'
47
- const jsonLd = productJsonLd(product, baseUrl)
48
-
49
- const mediaArray = Array.isArray(product.media) ? product.media : []
50
- const images = mediaArray.length > 0
51
- ? mediaArray.map((m: Record<string, string>) => ({
52
- url: m.url,
53
- alt: m.alt ?? product.name,
54
- }))
55
- : [{ url: `https://picsum.photos/seed/${product.slug}/600/600`, alt: product.name }]
56
-
57
- return (
58
- <>
59
- <script
60
- type="application/ld+json"
61
- dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
62
- />
63
-
64
- <div className={`container ${styles.page}`}>
65
- <Breadcrumb
66
- items={[
67
- { label: 'Home', href: '/' },
68
- { label: 'Products', href: '/products' },
69
- { label: product.name },
70
- ]}
71
- />
72
-
73
- <div className={styles.productLayout}>
74
- <ImageGallery images={images} />
75
-
76
- <div className={styles.info}>
77
- <ProductInteractive product={product} />
78
-
79
- {product.description && (
80
- <div className={styles.description}>
81
- <p>{product.description}</p>
82
- </div>
83
- )}
84
-
85
- <div className={styles.detailsSection}>
86
- <details className={styles.detailsItem}>
87
- <summary className={styles.detailsSummary}>Details</summary>
88
- <div className={styles.detailsContent}>
89
- {product.description ?? 'No additional details available.'}
90
- </div>
91
- </details>
92
- <details className={styles.detailsItem}>
93
- <summary className={styles.detailsSummary}>
94
- Shipping & Returns
95
- </summary>
96
- <div className={styles.detailsContent}>
97
- Free standard shipping on orders over $50. Returns accepted within
98
- 30 days of purchase.
99
- </div>
100
- </details>
101
- </div>
102
- </div>
103
- </div>
104
-
105
- <ReviewList reviews={reviews} />
106
- <ReviewForm productId={product.id} />
107
- <RelatedProducts products={related} />
108
- </div>
109
- </>
110
- )
111
- }
@@ -1,40 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { fetchProducts, fetchCapabilities, sortFromSearchParams } from '@/lib/api'
3
- import { Breadcrumb } from '@/components/server/Breadcrumb'
4
- import { ProductGrid } from '@/components/client/ProductGrid'
5
- import styles from '@/styles/pages/plp.module.css'
6
-
7
- export const metadata: Metadata = {
8
- title: 'All Products',
9
- description: 'Browse our full collection of products.',
10
- }
11
-
12
- interface ProductsPageProps {
13
- searchParams: Promise<{ sort?: string | string[] }>
14
- }
15
-
16
- export default async function ProductsPage({ searchParams }: ProductsPageProps) {
17
- const capabilities = await fetchCapabilities()
18
- const sort = sortFromSearchParams(await searchParams, capabilities?.catalog)
19
- const { items, nextCursor, facets } = await fetchProducts({ limit: 24, sort })
20
-
21
- return (
22
- <div className={`container ${styles.page}`}>
23
- <Breadcrumb
24
- items={[
25
- { label: 'Home', href: '/' },
26
- { label: 'Products' },
27
- ]}
28
- />
29
- <h1 className={styles.pageTitle}>All Products</h1>
30
- <ProductGrid
31
- initialProducts={items}
32
- initialCursor={nextCursor}
33
- initialSort={sort}
34
- initialFacets={facets ?? []}
35
- sortKeys={capabilities?.catalog.sortKeys ?? []}
36
- defaultSort={capabilities?.catalog.defaultSort}
37
- />
38
- </div>
39
- )
40
- }
@@ -1,24 +0,0 @@
1
- import type { Metadata } from 'next'
2
- import { Suspense } from 'react'
3
- import { SearchResults } from '@/components/client/SearchResults'
4
-
5
- export const metadata: Metadata = {
6
- title: 'Search',
7
- description: 'Search our product catalog.',
8
- }
9
-
10
- export default function SearchPage() {
11
- return (
12
- <Suspense
13
- fallback={
14
- <div className="loading-center">
15
- <div className="spinner spinner-lg" role="status">
16
- <span className="visually-hidden">Loading...</span>
17
- </div>
18
- </div>
19
- }
20
- >
21
- <SearchResults />
22
- </Suspense>
23
- )
24
- }