create-nymbal-app 0.4.0 → 0.5.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 (163) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +7 -4
  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 +113 -21
  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/account/addresses.astro +5 -97
  19. package/scaffold/templates/astro/src/pages/account/login.astro +7 -34
  20. package/scaffold/templates/astro/src/pages/account/profile.astro +6 -56
  21. package/scaffold/templates/astro/src/pages/account/register.astro +7 -73
  22. package/scaffold/templates/astro/src/pages/cart.astro +14 -7
  23. package/scaffold/templates/astro/src/pages/category/[slug].astro +17 -21
  24. package/scaffold/templates/astro/src/pages/checkout.astro +30 -94
  25. package/scaffold/templates/astro/src/pages/fragments/footer.astro +5 -2
  26. package/scaffold/templates/astro/src/pages/fragments/header.astro +12 -2
  27. package/scaffold/templates/astro/src/pages/fragments/nav.astro +8 -5
  28. package/scaffold/templates/astro/src/pages/fragments/product/[slug].astro +9 -10
  29. package/scaffold/templates/astro/src/pages/index.astro +18 -15
  30. package/scaffold/templates/astro/src/pages/order/[orderNumber].astro +22 -44
  31. package/scaffold/templates/astro/src/pages/product/[slug].astro +44 -30
  32. package/scaffold/templates/astro/src/pages/products/index.astro +16 -21
  33. package/scaffold/templates/astro/src/pages/search.astro +10 -11
  34. package/scaffold/templates/astro/src/scripts/init-client.ts +14 -0
  35. package/scaffold/templates/astro/src/scripts/pdp.ts +24 -21
  36. package/scaffold/templates/astro/src/scripts/plp.ts +15 -93
  37. package/scaffold/templates/astro/src/scripts/search.ts +7 -132
  38. package/scaffold/templates/astro/src/scripts/signed-in-redirect.ts +4 -0
  39. package/scaffold/templates/astro/src/styles/global.css +49 -45
  40. package/scaffold/templates/astro/src/styles/pages/account.css +0 -90
  41. package/scaffold/templates/astro/src/styles/pages/confirmation.css +6 -0
  42. package/scaffold/templates/astro/src/styles/pages/home.css +9 -100
  43. package/scaffold/templates/astro/src/styles/pages/pdp.css +5 -171
  44. package/scaffold/templates/astro/src/styles/pages/plp.css +3 -42
  45. package/scaffold/templates/astro/src/styles/pages/search.css +4 -110
  46. package/scaffold/templates/astro/src/styles/tokens.css +56 -0
  47. package/scaffold/templates/nextjs/_dot.node-version +1 -1
  48. package/scaffold/templates/nextjs/app/(catalog)/category/[slug]/page.tsx +74 -0
  49. package/scaffold/templates/nextjs/app/(catalog)/home/[key]/page.tsx +80 -0
  50. package/scaffold/templates/nextjs/app/(catalog)/layout.tsx +13 -0
  51. package/scaffold/templates/nextjs/app/(catalog)/not-found.tsx +7 -0
  52. package/scaffold/templates/nextjs/app/(catalog)/product/[slug]/page.tsx +182 -0
  53. package/scaffold/templates/nextjs/app/(catalog)/products/page.tsx +62 -0
  54. package/scaffold/templates/nextjs/app/(catalog)/search/SearchView.tsx +90 -0
  55. package/scaffold/templates/nextjs/app/(catalog)/search/page.tsx +46 -0
  56. package/scaffold/templates/nextjs/app/(shopper)/account/addresses/AddressesView.tsx +5 -0
  57. package/scaffold/templates/nextjs/app/(shopper)/account/addresses/page.tsx +17 -0
  58. package/scaffold/templates/nextjs/app/(shopper)/account/login/LoginView.tsx +28 -0
  59. package/scaffold/templates/nextjs/app/(shopper)/account/login/page.tsx +23 -0
  60. package/scaffold/templates/nextjs/app/(shopper)/account/profile/ProfileView.tsx +5 -0
  61. package/scaffold/templates/nextjs/app/(shopper)/account/profile/page.tsx +20 -0
  62. package/scaffold/templates/nextjs/app/(shopper)/account/register/RegisterView.tsx +26 -0
  63. package/scaffold/templates/nextjs/app/(shopper)/account/register/page.tsx +11 -0
  64. package/scaffold/templates/nextjs/app/(shopper)/cart/CartView.tsx +5 -0
  65. package/scaffold/templates/nextjs/app/(shopper)/cart/page.tsx +22 -0
  66. package/scaffold/templates/nextjs/app/(shopper)/checkout/CheckoutView.tsx +27 -0
  67. package/scaffold/templates/nextjs/app/(shopper)/checkout/page.tsx +39 -0
  68. package/scaffold/templates/nextjs/app/(shopper)/layout.tsx +12 -0
  69. package/scaffold/templates/nextjs/app/{order → (shopper)/order}/[orderNumber]/page.tsx +24 -5
  70. package/scaffold/templates/nextjs/app/error.tsx +3 -7
  71. package/scaffold/templates/nextjs/app/fragments/footer/route.ts +13 -0
  72. package/scaffold/templates/nextjs/app/fragments/header/[key]/route.ts +18 -0
  73. package/scaffold/templates/nextjs/app/fragments/nav/[key]/route.ts +23 -0
  74. package/scaffold/templates/nextjs/app/fragments/product/[slug]/route.ts +22 -0
  75. package/scaffold/templates/nextjs/app/globals.css +5 -23
  76. package/scaffold/templates/nextjs/app/layout.tsx +8 -5
  77. package/scaffold/templates/nextjs/app/not-found.tsx +9 -33
  78. package/scaffold/templates/nextjs/app/tokens.css +56 -0
  79. package/scaffold/templates/nextjs/components/client/ListingControls.tsx +87 -0
  80. package/scaffold/templates/nextjs/components/client/NymbalSetup.tsx +48 -6
  81. package/scaffold/templates/nextjs/components/client/ProductInteractive.tsx +30 -15
  82. package/scaffold/templates/nextjs/components/client/elements.tsx +15 -0
  83. package/scaffold/templates/nextjs/components/server/Header.tsx +33 -102
  84. package/scaffold/templates/nextjs/components/server/NotFoundView.tsx +39 -0
  85. package/scaffold/templates/nextjs/components/server/SkipNav.tsx +7 -3
  86. package/scaffold/templates/nextjs/elements/index.ts +12 -0
  87. package/scaffold/templates/nextjs/lib/api.ts +151 -55
  88. package/scaffold/templates/nextjs/lib/chrome.ts +40 -0
  89. package/scaffold/templates/nextjs/lib/fragments.ts +16 -0
  90. package/scaffold/templates/nextjs/lib/header.ts +39 -0
  91. package/scaffold/templates/nextjs/lib/render.ts +14 -0
  92. package/scaffold/templates/nextjs/next.config.mjs +32 -0
  93. package/scaffold/templates/nextjs/package.json +28 -27
  94. package/scaffold/templates/nextjs/styles/pages/account.module.css +0 -70
  95. package/scaffold/templates/nextjs/styles/pages/confirmation.module.css +6 -85
  96. package/scaffold/templates/nextjs/styles/pages/home.module.css +2 -103
  97. package/scaffold/templates/nextjs/styles/pages/pdp.module.css +3 -183
  98. package/scaffold/templates/nextjs/styles/pages/plp.module.css +9 -143
  99. package/scaffold/templates/nextjs/styles/pages/search.module.css +1 -145
  100. package/scaffold/templates/nextjs/tsconfig.dist.json +5 -0
  101. package/scaffold/templates/astro/src/components/AddressForm.astro +0 -107
  102. package/scaffold/templates/astro/src/components/Breadcrumb.astro +0 -20
  103. package/scaffold/templates/astro/src/components/CategoryNav.astro +0 -27
  104. package/scaffold/templates/astro/src/components/CheckoutSteps.astro +0 -29
  105. package/scaffold/templates/astro/src/components/Footer.astro +0 -108
  106. package/scaffold/templates/astro/src/components/Header.astro +0 -198
  107. package/scaffold/templates/astro/src/components/ImageGallery.astro +0 -42
  108. package/scaffold/templates/astro/src/components/OrderSummary.astro +0 -53
  109. package/scaffold/templates/astro/src/components/Pagination.astro +0 -13
  110. package/scaffold/templates/astro/src/components/PriceDisplay.astro +0 -25
  111. package/scaffold/templates/astro/src/components/ProductCard.astro +0 -44
  112. package/scaffold/templates/astro/src/components/RelatedProducts.astro +0 -28
  113. package/scaffold/templates/astro/src/components/ReviewForm.astro +0 -74
  114. package/scaffold/templates/astro/src/components/ReviewList.astro +0 -41
  115. package/scaffold/templates/astro/src/components/StockBadge.astro +0 -15
  116. package/scaffold/templates/astro/src/scripts/auth-forms.ts +0 -82
  117. package/scaffold/templates/astro/src/scripts/cart-page.ts +0 -118
  118. package/scaffold/templates/astro/src/scripts/checkout.ts +0 -271
  119. package/scaffold/templates/astro/src/scripts/image-gallery.ts +0 -22
  120. package/scaffold/templates/astro/src/scripts/profile-form.ts +0 -57
  121. package/scaffold/templates/astro/src/scripts/review-form.ts +0 -27
  122. package/scaffold/templates/astro/src/styles/pages/cart.css +0 -215
  123. package/scaffold/templates/astro/src/styles/pages/checkout.css +0 -270
  124. package/scaffold/templates/nextjs/app/account/addresses/page.tsx +0 -10
  125. package/scaffold/templates/nextjs/app/account/login/page.tsx +0 -23
  126. package/scaffold/templates/nextjs/app/account/profile/page.tsx +0 -10
  127. package/scaffold/templates/nextjs/app/account/register/page.tsx +0 -10
  128. package/scaffold/templates/nextjs/app/cart/page.tsx +0 -10
  129. package/scaffold/templates/nextjs/app/category/[slug]/page.tsx +0 -61
  130. package/scaffold/templates/nextjs/app/checkout/page.tsx +0 -17
  131. package/scaffold/templates/nextjs/app/page.tsx +0 -63
  132. package/scaffold/templates/nextjs/app/product/[slug]/page.tsx +0 -111
  133. package/scaffold/templates/nextjs/app/products/page.tsx +0 -40
  134. package/scaffold/templates/nextjs/app/search/page.tsx +0 -24
  135. package/scaffold/templates/nextjs/components/client/AddressManager.tsx +0 -181
  136. package/scaffold/templates/nextjs/components/client/CartPage.tsx +0 -121
  137. package/scaffold/templates/nextjs/components/client/CheckoutForm.tsx +0 -482
  138. package/scaffold/templates/nextjs/components/client/ImageGallery.tsx +0 -68
  139. package/scaffold/templates/nextjs/components/client/LoginForm.tsx +0 -89
  140. package/scaffold/templates/nextjs/components/client/MiniCartWrapper.tsx +0 -12
  141. package/scaffold/templates/nextjs/components/client/ProductGrid.tsx +0 -137
  142. package/scaffold/templates/nextjs/components/client/ProfileForm.tsx +0 -112
  143. package/scaffold/templates/nextjs/components/client/RegisterForm.tsx +0 -131
  144. package/scaffold/templates/nextjs/components/client/ReviewForm.tsx +0 -116
  145. package/scaffold/templates/nextjs/components/client/SearchBarWrapper.tsx +0 -27
  146. package/scaffold/templates/nextjs/components/client/SearchResults.tsx +0 -181
  147. package/scaffold/templates/nextjs/components/server/Breadcrumb.tsx +0 -36
  148. package/scaffold/templates/nextjs/components/server/CategoryNav.tsx +0 -29
  149. package/scaffold/templates/nextjs/components/server/CheckoutSteps.tsx +0 -60
  150. package/scaffold/templates/nextjs/components/server/Footer.module.css +0 -64
  151. package/scaffold/templates/nextjs/components/server/Footer.tsx +0 -79
  152. package/scaffold/templates/nextjs/components/server/Header.module.css +0 -147
  153. package/scaffold/templates/nextjs/components/server/OrderSummary.tsx +0 -79
  154. package/scaffold/templates/nextjs/components/server/PriceDisplay.tsx +0 -31
  155. package/scaffold/templates/nextjs/components/server/ProductCard.tsx +0 -59
  156. package/scaffold/templates/nextjs/components/server/RelatedProducts.tsx +0 -31
  157. package/scaffold/templates/nextjs/components/server/ReviewList.tsx +0 -62
  158. package/scaffold/templates/nextjs/styles/pages/cart.module.css +0 -240
  159. package/scaffold/templates/nextjs/styles/pages/checkout.module.css +0 -404
  160. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/layout.tsx +0 -0
  161. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/[orderNumber]/page.tsx +0 -0
  162. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/page.tsx +0 -0
  163. /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/page.tsx +0 -0
@@ -1,215 +0,0 @@
1
- /* ----------------------------------------------------------------
2
- Cart page styles
3
- ---------------------------------------------------------------- */
4
-
5
- /* ---- Layout ---- */
6
-
7
- .cart-layout {
8
- display: grid;
9
- grid-template-columns: 1fr;
10
- gap: var(--nymbal-spacing-xl, 2rem);
11
- }
12
-
13
- @media (min-width: 769px) {
14
- .cart-layout {
15
- grid-template-columns: 1fr 360px;
16
- align-items: start;
17
- }
18
- }
19
-
20
- /* ---- Cart header ---- */
21
-
22
- .cart-header {
23
- display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
- margin-bottom: var(--nymbal-spacing-lg, 1.5rem);
27
- }
28
-
29
- .cart-title {
30
- font-size: 1.5rem;
31
- font-weight: var(--nymbal-font-weight-bold, 700);
32
- color: var(--nymbal-color-primary, #18181b);
33
- }
34
-
35
- .cart-item-count {
36
- font-size: var(--nymbal-font-size-sm, 0.875rem);
37
- color: var(--nymbal-color-text-muted, #71717a);
38
- font-weight: var(--nymbal-font-weight-normal, 400);
39
- }
40
-
41
- /* ---- Cart items list ---- */
42
-
43
- .cart-items {
44
- display: flex;
45
- flex-direction: column;
46
- }
47
-
48
- /* ---- Line item ---- */
49
-
50
- .cart-line-item {
51
- display: grid;
52
- grid-template-columns: 80px 1fr auto;
53
- gap: var(--nymbal-spacing-md, 1rem);
54
- padding: var(--nymbal-spacing-md, 1rem) 0;
55
- border-bottom: 1px solid var(--nymbal-color-border, #e4e4e7);
56
- align-items: start;
57
- }
58
-
59
- @media (min-width: 641px) {
60
- .cart-line-item {
61
- grid-template-columns: 100px 1fr auto auto;
62
- gap: var(--nymbal-spacing-lg, 1.5rem);
63
- align-items: center;
64
- }
65
- }
66
-
67
- .cart-line-item:first-child {
68
- border-top: 1px solid var(--nymbal-color-border, #e4e4e7);
69
- }
70
-
71
- .cart-line-image {
72
- width: 100%;
73
- aspect-ratio: 1 / 1;
74
- object-fit: cover;
75
- border-radius: var(--nymbal-radius-md, 0.5rem);
76
- background-color: #f4f4f5;
77
- }
78
-
79
- .cart-line-info {
80
- display: flex;
81
- flex-direction: column;
82
- gap: var(--nymbal-spacing-xs, 0.25rem);
83
- min-width: 0;
84
- }
85
-
86
- .cart-line-name {
87
- font-size: var(--nymbal-font-size-sm, 0.875rem);
88
- font-weight: var(--nymbal-font-weight-medium, 500);
89
- color: var(--nymbal-color-text, #18181b);
90
- text-decoration: none;
91
- }
92
-
93
- .cart-line-name:hover {
94
- color: var(--nymbal-color-accent, #2563eb);
95
- }
96
-
97
- .cart-line-variant {
98
- font-size: var(--nymbal-font-size-xs, 0.75rem);
99
- color: var(--nymbal-color-text-muted, #71717a);
100
- }
101
-
102
- .cart-line-price-each {
103
- font-size: var(--nymbal-font-size-xs, 0.75rem);
104
- color: var(--nymbal-color-text-muted, #71717a);
105
- }
106
-
107
- .cart-line-quantity {
108
- display: flex;
109
- align-items: center;
110
- gap: var(--nymbal-spacing-sm, 0.5rem);
111
- }
112
-
113
- .cart-line-total {
114
- font-size: var(--nymbal-font-size-sm, 0.875rem);
115
- font-weight: var(--nymbal-font-weight-bold, 700);
116
- color: var(--nymbal-color-primary, #18181b);
117
- text-align: right;
118
- white-space: nowrap;
119
- }
120
-
121
- .cart-line-remove {
122
- font-size: var(--nymbal-font-size-xs, 0.75rem);
123
- color: var(--nymbal-color-text-muted, #71717a);
124
- background: none;
125
- border: none;
126
- cursor: pointer;
127
- text-decoration: underline;
128
- padding: 0;
129
- transition: color var(--nymbal-transition-fast, 150ms) ease;
130
- }
131
-
132
- .cart-line-remove:hover {
133
- color: var(--nymbal-color-error, #dc2626);
134
- }
135
-
136
- /* ---- Order summary sidebar ---- */
137
-
138
- .cart-summary {
139
- background-color: #fafafa;
140
- border: 1px solid var(--nymbal-color-border, #e4e4e7);
141
- border-radius: var(--nymbal-radius-lg, 0.75rem);
142
- padding: var(--nymbal-spacing-lg, 1.5rem);
143
- position: sticky;
144
- top: 80px;
145
- }
146
-
147
- .cart-summary-title {
148
- font-size: var(--nymbal-font-size-lg, 1.125rem);
149
- font-weight: var(--nymbal-font-weight-bold, 700);
150
- color: var(--nymbal-color-primary, #18181b);
151
- margin-bottom: var(--nymbal-spacing-md, 1rem);
152
- padding-bottom: var(--nymbal-spacing-md, 1rem);
153
- border-bottom: 1px solid var(--nymbal-color-border, #e4e4e7);
154
- }
155
-
156
- .cart-summary-row {
157
- display: flex;
158
- justify-content: space-between;
159
- align-items: center;
160
- padding: var(--nymbal-spacing-xs, 0.25rem) 0;
161
- font-size: var(--nymbal-font-size-sm, 0.875rem);
162
- }
163
-
164
- .cart-summary-row dt {
165
- color: var(--nymbal-color-text-muted, #71717a);
166
- }
167
-
168
- .cart-summary-row dd {
169
- font-weight: var(--nymbal-font-weight-medium, 500);
170
- color: var(--nymbal-color-text, #18181b);
171
- }
172
-
173
- .cart-summary-total {
174
- display: flex;
175
- justify-content: space-between;
176
- align-items: center;
177
- padding-top: var(--nymbal-spacing-md, 1rem);
178
- margin-top: var(--nymbal-spacing-md, 1rem);
179
- border-top: 1px solid var(--nymbal-color-border, #e4e4e7);
180
- font-size: var(--nymbal-font-size-lg, 1.125rem);
181
- font-weight: var(--nymbal-font-weight-bold, 700);
182
- color: var(--nymbal-color-primary, #18181b);
183
- }
184
-
185
- .cart-summary-actions {
186
- margin-top: var(--nymbal-spacing-lg, 1.5rem);
187
- display: flex;
188
- flex-direction: column;
189
- gap: var(--nymbal-spacing-sm, 0.5rem);
190
- }
191
-
192
- .cart-summary-actions .btn {
193
- width: 100%;
194
- justify-content: center;
195
- }
196
-
197
- /* ---- Empty cart ---- */
198
-
199
- .cart-empty {
200
- text-align: center;
201
- padding: 4rem var(--nymbal-spacing-md, 1rem);
202
- }
203
-
204
- .cart-empty-title {
205
- font-size: var(--nymbal-font-size-lg, 1.125rem);
206
- font-weight: var(--nymbal-font-weight-medium, 500);
207
- color: var(--nymbal-color-text, #18181b);
208
- margin-bottom: var(--nymbal-spacing-xs, 0.25rem);
209
- }
210
-
211
- .cart-empty-text {
212
- font-size: var(--nymbal-font-size-sm, 0.875rem);
213
- color: var(--nymbal-color-text-muted, #71717a);
214
- margin-bottom: var(--nymbal-spacing-lg, 1.5rem);
215
- }
@@ -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
- }