@vendure-platform/create 0.4.0 → 0.5.1

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 (334) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +39 -39
  3. package/dist/add-to-existing.js +1 -1
  4. package/dist/assets/demo-data/initial-data.json +663 -663
  5. package/dist/assets/storefront/components.json +20 -20
  6. package/dist/assets/storefront/eslint.config.mjs +10 -10
  7. package/dist/assets/storefront/graphql.config.yml +1 -1
  8. package/dist/assets/storefront/messages/de.json +2 -0
  9. package/dist/assets/storefront/messages/en.json +2 -0
  10. package/dist/assets/storefront/next.config.ts +5 -4
  11. package/dist/assets/storefront/package.json +1 -1
  12. package/dist/assets/storefront/postcss.config.mjs +1 -1
  13. package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
  14. package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
  15. package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
  16. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
  17. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +68 -37
  18. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
  19. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
  20. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
  21. package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
  22. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
  23. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
  24. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
  25. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
  26. package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
  27. package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
  28. package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
  29. package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
  30. package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +16 -18
  31. package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
  32. package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +77 -69
  33. package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
  34. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
  35. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
  36. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
  37. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
  38. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
  39. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
  40. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
  41. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +24 -24
  42. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
  43. package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
  44. package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +23 -28
  45. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +24 -24
  46. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
  47. package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +22 -25
  48. package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
  49. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
  50. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
  51. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
  52. package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
  53. package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
  54. package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
  55. package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +32 -29
  56. package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
  57. package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
  58. package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
  59. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
  60. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
  61. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
  62. package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
  63. package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
  64. package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
  65. package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
  66. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
  67. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
  68. package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
  69. package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +15 -15
  70. package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
  71. package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
  72. package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +3 -6
  73. package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
  74. package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
  75. package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
  76. package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
  77. package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +86 -59
  78. package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
  79. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
  80. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
  81. package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
  82. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/activity-feed.tsx +152 -0
  83. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +132 -0
  84. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +140 -0
  85. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +259 -0
  86. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +55 -0
  87. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +117 -0
  88. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/shared-cart-detail-client.tsx +555 -0
  89. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +305 -0
  90. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +84 -0
  91. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +47 -0
  92. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +276 -0
  93. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
  94. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
  95. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
  96. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
  97. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
  98. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
  99. package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
  100. package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
  101. package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
  102. package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
  103. package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
  104. package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
  105. package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
  106. package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
  107. package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
  108. package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
  109. package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
  110. package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
  111. package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +70 -29
  112. package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
  113. package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +48 -42
  114. package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
  115. package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
  116. package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
  117. package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
  118. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
  119. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
  120. package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
  121. package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +56 -47
  122. package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
  123. package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
  124. package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
  125. package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
  126. package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
  127. package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
  128. package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
  129. package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
  130. package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
  131. package/dist/assets/storefront/src/app/[locale]/layout.tsx +53 -47
  132. package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
  133. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -44
  134. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
  135. package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
  136. package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
  137. package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
  138. package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
  139. package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
  140. package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
  141. package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
  142. package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
  143. package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
  144. package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
  145. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
  146. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
  147. package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
  148. package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
  149. package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
  150. package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
  151. package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
  152. package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
  153. package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
  154. package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
  155. package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
  156. package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
  157. package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +44 -17
  158. package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
  159. package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
  160. package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +247 -0
  161. package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
  162. package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
  163. package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
  164. package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
  165. package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
  166. package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
  167. package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
  168. package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
  169. package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
  170. package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
  171. package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
  172. package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
  173. package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
  174. package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
  175. package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
  176. package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
  177. package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
  178. package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
  179. package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
  180. package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
  181. package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +35 -14
  182. package/dist/assets/storefront/src/components/commerce/product-card.tsx +31 -16
  183. package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
  184. package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
  185. package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
  186. package/dist/assets/storefront/src/components/commerce/product-info.tsx +129 -72
  187. package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
  188. package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
  189. package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
  190. package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
  191. package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +54 -36
  192. package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
  193. package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
  194. package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
  195. package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
  196. package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
  197. package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
  198. package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
  199. package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
  200. package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
  201. package/dist/assets/storefront/src/components/commerce/shared-cart-role.ts +39 -0
  202. package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +28 -0
  203. package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
  204. package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
  205. package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
  206. package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
  207. package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
  208. package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
  209. package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
  210. package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
  211. package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
  212. package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
  213. package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
  214. package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
  215. package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
  216. package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
  217. package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
  218. package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
  219. package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
  220. package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
  221. package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
  222. package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
  223. package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
  224. package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
  225. package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
  226. package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
  227. package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
  228. package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
  229. package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
  230. package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
  231. package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
  232. package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
  233. package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
  234. package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
  235. package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
  236. package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
  237. package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
  238. package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
  239. package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
  240. package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
  241. package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
  242. package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
  243. package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
  244. package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
  245. package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
  246. package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
  247. package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
  248. package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
  249. package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
  250. package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
  251. package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
  252. package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
  253. package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
  254. package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
  255. package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
  256. package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
  257. package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
  258. package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
  259. package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
  260. package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
  261. package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
  262. package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
  263. package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
  264. package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
  265. package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
  266. package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
  267. package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
  268. package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
  269. package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
  270. package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
  271. package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
  272. package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
  273. package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
  274. package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
  275. package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
  276. package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
  277. package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
  278. package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
  279. package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
  280. package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
  281. package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
  282. package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
  283. package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
  284. package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
  285. package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
  286. package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
  287. package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
  288. package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
  289. package/dist/assets/storefront/src/config/scenario.ts +14 -16
  290. package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
  291. package/dist/assets/storefront/src/graphql-env.d.ts +18 -5
  292. package/dist/assets/storefront/src/graphql.ts +5 -5
  293. package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
  294. package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
  295. package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
  296. package/dist/assets/storefront/src/i18n/request.ts +4 -4
  297. package/dist/assets/storefront/src/i18n/routing.ts +5 -5
  298. package/dist/assets/storefront/src/i18n/server.ts +3 -3
  299. package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
  300. package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
  301. package/dist/assets/storefront/src/lib/auth.ts +1 -1
  302. package/dist/assets/storefront/src/lib/backend-health.ts +3 -3
  303. package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
  304. package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
  305. package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
  306. package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
  307. package/dist/assets/storefront/src/lib/company-context.ts +1 -1
  308. package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
  309. package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
  310. package/dist/assets/storefront/src/lib/format.ts +16 -7
  311. package/dist/assets/storefront/src/lib/metadata.ts +39 -44
  312. package/dist/assets/storefront/src/lib/quantity.ts +2 -4
  313. package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
  314. package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
  315. package/dist/assets/storefront/src/lib/utils.ts +3 -3
  316. package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
  317. package/dist/assets/storefront/src/lib/vendure/api.ts +44 -27
  318. package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
  319. package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
  320. package/dist/assets/storefront/src/lib/vendure/mutations.ts +96 -0
  321. package/dist/assets/storefront/src/lib/vendure/queries.ts +157 -5
  322. package/dist/assets/storefront/src/middleware.ts +1 -1
  323. package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
  324. package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
  325. package/dist/assets/storefront/src/schema.graphql +134 -0
  326. package/dist/bin/run.js +1 -1
  327. package/dist/cli.d.ts +1 -1
  328. package/dist/index.d.ts +5 -5
  329. package/dist/index.js +1 -1
  330. package/dist/plugin-registry.js +1 -1
  331. package/dist/scaffold-storefront-only.js +1 -1
  332. package/dist/scaffolder.js +1 -1
  333. package/dist/template-renderer.js +1 -1
  334. package/package.json +2 -2
@@ -1,33 +1,41 @@
1
- import type { Metadata } from 'next';
2
- import { Suspense } from 'react';
3
- import { getTranslations, setRequestLocale } from 'next-intl/server';
4
- import { publicClient, client, getVendureContext } from '@/lib/vendure/api';
5
- import type { VendureContext } from '@/lib/vendure/api';
6
- import { GetProductDetailQuery, GetGiftCardTemplatesQuery, GetDraftVariantQuery, GetConfiguratorSystemQuery, type ConfiguratorSystem } from '@/lib/vendure/queries';
7
- import { draftMode } from 'next/headers';
1
+ import { getShoppingListsWithMembership } from '@/app/[locale]/account/shopping-lists/actions';
2
+ import { ConfiguratorForm } from '@/components/commerce/configurator-form';
3
+ import { GiftCardPdp } from '@/components/commerce/gift-card-pdp';
8
4
  import { ProductImageCarousel } from '@/components/commerce/product-image-carousel';
9
5
  import { ProductInfo } from '@/components/commerce/product-info';
10
- import { GiftCardPdp } from '@/components/commerce/gift-card-pdp';
11
- import type { GiftCardTemplate } from '@/lib/vendure/queries';
12
- import { RelatedProducts } from '@/components/commerce/related-products';
13
6
  import { ProductSidebar } from '@/components/commerce/product-sidebar';
7
+ import { RelatedProducts } from '@/components/commerce/related-products';
8
+ import { canCreateSharedCarts } from '@/components/commerce/shared-cart-role';
14
9
  import { Breadcrumbs } from '@/components/shared/breadcrumbs';
15
- import { getScenarioConfig, isConditionalPdpOverride, isFullPageOverride } from '@/config/scenario';
16
10
  import type { PdpPageProps, PdpSlotOverrides, ServerComponent } from '@/config/scenario';
17
- import { notFound } from 'next/navigation';
18
- import { cacheLife, cacheTag } from 'next/cache';
11
+ import { getScenarioConfig, isConditionalPdpOverride, isFullPageOverride } from '@/config/scenario';
12
+ import { getActiveChannelToken } from '@/lib/channel-server';
19
13
  import {
20
- SITE_NAME,
21
- truncateDescription,
22
- buildCanonicalUrl,
23
14
  buildAlternates,
15
+ buildCanonicalUrl,
24
16
  buildOgImages,
17
+ SITE_NAME,
18
+ truncateDescription,
25
19
  } from '@/lib/metadata';
20
+ import { getCompanyAccount } from '@/lib/vendure/actions';
21
+ import type { VendureContext } from '@/lib/vendure/api';
22
+ import { client, getVendureContext, publicClient } from '@/lib/vendure/api';
26
23
  import { getActiveChannelCached } from '@/lib/vendure/cached';
27
- import { getActiveChannelToken } from '@/lib/channel-server';
28
- import { addGiftCardToCart, evaluateConfiguration, addConfigurationToOrder } from './actions';
29
- import { getShoppingListsWithMembership } from '@/app/[locale]/account/shopping-lists/actions';
30
- import { ConfiguratorForm } from '@/components/commerce/configurator-form';
24
+ import type { GiftCardTemplate } from '@/lib/vendure/queries';
25
+ import {
26
+ GetConfiguratorSystemQuery,
27
+ GetDraftVariantQuery,
28
+ GetGiftCardTemplatesQuery,
29
+ GetProductDetailQuery,
30
+ type ConfiguratorSystem,
31
+ } from '@/lib/vendure/queries';
32
+ import type { Metadata } from 'next';
33
+ import { getTranslations, setRequestLocale } from 'next-intl/server';
34
+ import { cacheLife, cacheTag } from 'next/cache';
35
+ import { draftMode } from 'next/headers';
36
+ import { notFound } from 'next/navigation';
37
+ import { Suspense } from 'react';
38
+ import { addConfigurationToOrder, addGiftCardToCart, evaluateConfiguration } from './actions';
31
39
 
32
40
  async function getProductData(slug: string, locale: string, ctx?: VendureContext, channelToken?: string) {
33
41
  'use cache: private';
@@ -35,10 +43,14 @@ async function getProductData(slug: string, locale: string, ctx?: VendureContext
35
43
  const effectiveToken = ctx?.channelToken ?? channelToken;
36
44
  cacheTag(`product-${slug}-${locale}${effectiveToken ? `-${effectiveToken}` : ''}`, `products-${locale}`);
37
45
 
38
- const opts = {languageCode: locale};
46
+ const opts = { languageCode: locale };
39
47
  const [result, error] = ctx
40
- ? await client.query(GetProductDetailQuery, { slug }, {...ctx, ...opts})
41
- : await publicClient.query(GetProductDetailQuery, { slug }, {...opts, ...(channelToken ? {channelToken} : {})});
48
+ ? await client.query(GetProductDetailQuery, { slug }, { ...ctx, ...opts })
49
+ : await publicClient.query(
50
+ GetProductDetailQuery,
51
+ { slug },
52
+ { ...opts, ...(channelToken ? { channelToken } : {}) },
53
+ );
42
54
  if (error) return undefined;
43
55
  return result;
44
56
  }
@@ -48,19 +60,23 @@ async function getGiftCardTemplates(locale: string) {
48
60
  cacheLife('hours');
49
61
  cacheTag(`gift-card-templates-${locale}`);
50
62
 
51
- const [result, error] = await publicClient.query(GetGiftCardTemplatesQuery, undefined, {languageCode: locale});
63
+ const [result, error] = await publicClient.query(GetGiftCardTemplatesQuery, undefined, {
64
+ languageCode: locale,
65
+ });
52
66
  if (error) return undefined;
53
67
  return result;
54
68
  }
55
69
 
56
70
  export async function generateMetadata({
57
71
  params,
58
- }: { params: Promise<{ locale: string; slug: string }> }): Promise<Metadata> {
72
+ }: {
73
+ params: Promise<{ locale: string; slug: string }>;
74
+ }): Promise<Metadata> {
59
75
  const { locale, slug } = await params;
60
76
  const channelToken = await getActiveChannelToken();
61
77
  const [result, t] = await Promise.all([
62
78
  getProductData(slug, locale, undefined, channelToken),
63
- getTranslations({locale, namespace: 'Product'}),
79
+ getTranslations({ locale, namespace: 'Product' }),
64
80
  ]);
65
81
  if (!result) {
66
82
  return { title: t('notFound') };
@@ -163,7 +179,7 @@ async function ProductDetailContent({
163
179
  const draft = await draftMode();
164
180
  if (draft.isEnabled && product.variants?.length) {
165
181
  const draftVariants = await Promise.all(
166
- product.variants.map(v => client.query(GetDraftVariantQuery, { id: v.id })),
182
+ product.variants.map((v) => client.query(GetDraftVariantQuery, { id: v.id })),
167
183
  );
168
184
  for (let i = 0; i < product.variants.length; i++) {
169
185
  const [res] = draftVariants[i];
@@ -176,11 +192,14 @@ async function ProductDetailContent({
176
192
 
177
193
  const isGiftCard = product.customFields?.isGiftCard === true;
178
194
 
179
- const [channel, shoppingLists] = await Promise.all([
195
+ const [channel, shoppingLists, companyAccount] = await Promise.all([
180
196
  getActiveChannelCached(ctx.channelToken),
181
197
  getShoppingListsWithMembership(),
198
+ getCompanyAccount(),
182
199
  ]);
183
200
  const currencyCode = channel.defaultCurrencyCode;
201
+ const isCompanyUser = !!companyAccount;
202
+ const canCreateSharedCart = canCreateSharedCarts(companyAccount?.permissions);
184
203
 
185
204
  let giftCardTemplates: GiftCardTemplate[] = [];
186
205
  if (isGiftCard) {
@@ -190,9 +209,10 @@ async function ProductDetailContent({
190
209
 
191
210
  const primaryCollection = product.collections?.find((c) => c.parent?.id) ?? product.collections?.[0];
192
211
 
193
- const collectionCrumbs = primaryCollection?.breadcrumbs
194
- ?.filter((b) => b.slug !== '__root_collection__')
195
- .map((b) => ({ name: b.name, href: `/collection/${b.slug}` })) ?? [];
212
+ const collectionCrumbs =
213
+ primaryCollection?.breadcrumbs
214
+ ?.filter((b) => b.slug !== '__root_collection__')
215
+ .map((b) => ({ name: b.name, href: `/collection/${b.slug}` })) ?? [];
196
216
  const breadcrumbs = [...collectionCrumbs, { name: product.name }];
197
217
 
198
218
  // Gift cards have their own dedicated PDP — they bypass scenario overrides intentionally.
@@ -213,7 +233,11 @@ async function ProductDetailContent({
213
233
  const configuratorSystemCode = product.customFields?.configuratorSystemCode;
214
234
  let configuratorSystem: ConfiguratorSystem | null = null;
215
235
  if (configuratorSystemCode) {
216
- const [systemResult] = await client.query(GetConfiguratorSystemQuery, { code: configuratorSystemCode }, { languageCode: locale });
236
+ const [systemResult] = await client.query(
237
+ GetConfiguratorSystemQuery,
238
+ { code: configuratorSystemCode },
239
+ { languageCode: locale },
240
+ );
217
241
  configuratorSystem = systemResult?.data.configuratorSystem ?? null;
218
242
  }
219
243
 
@@ -224,8 +248,8 @@ async function ProductDetailContent({
224
248
  const fullPageComponent: ServerComponent<PdpPageProps> | null = isFullPageOverride(pdpOverride)
225
249
  ? (pdpOverride as ServerComponent<PdpPageProps>)
226
250
  : isConditionalPdpOverride(pdpOverride) && pdpOverride.shouldApply(product)
227
- ? pdpOverride.component
228
- : null;
251
+ ? pdpOverride.component
252
+ : null;
229
253
 
230
254
  if (fullPageComponent) {
231
255
  const PdpPage = fullPageComponent;
@@ -245,7 +269,7 @@ async function ProductDetailContent({
245
269
  );
246
270
  }
247
271
 
248
- const slots = (isConditionalPdpOverride(pdpOverride) ? {} : (pdpOverride ?? {})) as PdpSlotOverrides;
272
+ const slots = (isConditionalPdpOverride(pdpOverride) ? {} : pdpOverride ?? {}) as PdpSlotOverrides;
249
273
  const InfoComponent = slots.ProductInfo ?? ProductInfo;
250
274
  const SidebarComponent = slots.ProductSidebar ?? ProductSidebar;
251
275
  const CarouselComponent = slots.ProductImageCarousel ?? ProductImageCarousel;
@@ -253,7 +277,7 @@ async function ProductDetailContent({
253
277
 
254
278
  const productDescription = product.description ? (
255
279
  <div className="prose prose-sm max-w-none">
256
- <div dangerouslySetInnerHTML={{__html: product.description}}/>
280
+ <div dangerouslySetInnerHTML={{ __html: product.description }} />
257
281
  </div>
258
282
  ) : null;
259
283
 
@@ -309,7 +333,14 @@ async function ProductDetailContent({
309
333
  {productDescription && <div className="mt-6">{productDescription}</div>}
310
334
  </div>
311
335
  <div>
312
- <InfoComponent product={product} searchParams={searchParamsResolved} shoppingLists={shoppingLists} currencyCode={currencyCode} />
336
+ <InfoComponent
337
+ product={product}
338
+ searchParams={searchParamsResolved}
339
+ shoppingLists={shoppingLists}
340
+ currencyCode={currencyCode}
341
+ isCompanyUser={isCompanyUser}
342
+ canCreateSharedCart={canCreateSharedCart}
343
+ />
313
344
  </div>
314
345
  </div>
315
346
 
@@ -1,27 +1,27 @@
1
- import type { Metadata } from 'next';
2
- import { Suspense } from 'react';
3
- import { locale as rootLocale } from 'next/root-params';
4
- import { getTranslations } from 'next-intl/server';
5
1
  import { SearchResults } from '@/app/[locale]/(catalog)/search/search-results';
6
2
  import { Breadcrumbs } from '@/components/shared/breadcrumbs';
7
3
  import { CatalogSidebarSkeleton } from '@/components/shared/catalog-sidebar-skeleton';
8
4
  import { ProductGridSkeleton } from '@/components/shared/product-grid-skeleton';
9
- import { SITE_NAME, noIndexRobots } from '@/lib/metadata';
10
5
  import { type Locale } from '@/i18n/routing';
6
+ import { SITE_NAME, noIndexRobots } from '@/lib/metadata';
7
+ import type { Metadata } from 'next';
8
+ import { getTranslations } from 'next-intl/server';
9
+ import { locale as rootLocale } from 'next/root-params';
10
+ import { Suspense } from 'react';
11
11
 
12
12
  export async function generateMetadata({
13
13
  searchParams,
14
- }: { searchParams: Promise<{ q?: string }> }): Promise<Metadata> {
14
+ }: {
15
+ searchParams: Promise<{ q?: string }>;
16
+ }): Promise<Metadata> {
15
17
  const locale = (await rootLocale()) as Locale;
16
18
  const [resolvedParams, t] = await Promise.all([
17
19
  searchParams,
18
- getTranslations({locale, namespace: 'Search'}),
20
+ getTranslations({ locale, namespace: 'Search' }),
19
21
  ]);
20
22
  const searchQuery = resolvedParams.q as string | undefined;
21
23
 
22
- const title = searchQuery
23
- ? t('resultsFor', { query: searchQuery })
24
- : t('pageTitle');
24
+ const title = searchQuery ? t('resultsFor', { query: searchQuery }) : t('pageTitle');
25
25
 
26
26
  return {
27
27
  title,
@@ -49,30 +49,27 @@ async function SearchContent({
49
49
  }: {
50
50
  searchParamsPromise: Promise<{ [key: string]: string | string[] | undefined }>;
51
51
  }) {
52
- const [resolvedParams, t] = await Promise.all([
53
- searchParamsPromise,
54
- getTranslations('Search'),
55
- ]);
52
+ const [resolvedParams, t] = await Promise.all([searchParamsPromise, getTranslations('Search')]);
56
53
  const searchQuery = (resolvedParams.q as string) || '';
57
54
 
58
- const breadcrumbs = searchQuery
59
- ? [{ name: t('breadcrumbResults', { query: searchQuery }) }]
60
- : [];
55
+ const breadcrumbs = searchQuery ? [{ name: t('breadcrumbResults', { query: searchQuery }) }] : [];
61
56
 
62
57
  return (
63
58
  <>
64
59
  <Breadcrumbs items={breadcrumbs} />
65
60
  <div className="grid grid-cols-1 lg:grid-cols-4 gap-8 pb-8">
66
- <Suspense fallback={
67
- <>
68
- <aside className="lg:col-span-1">
69
- <CatalogSidebarSkeleton />
70
- </aside>
71
- <div className="lg:col-span-3">
72
- <ProductGridSkeleton />
73
- </div>
74
- </>
75
- }>
61
+ <Suspense
62
+ fallback={
63
+ <>
64
+ <aside className="lg:col-span-1">
65
+ <CatalogSidebarSkeleton />
66
+ </aside>
67
+ <div className="lg:col-span-3">
68
+ <ProductGridSkeleton />
69
+ </div>
70
+ </>
71
+ }
72
+ >
76
73
  <SearchResults searchParams={searchParamsPromise} />
77
74
  </Suspense>
78
75
  </div>
@@ -1,13 +1,13 @@
1
- import { Suspense } from 'react';
2
1
  import { CatalogSearchBar } from '@/components/commerce/catalog-search-bar';
3
2
  import { FacetFilters } from '@/components/commerce/facet-filters';
4
- import { ProductGridSkeleton } from '@/components/shared/product-grid-skeleton';
5
3
  import { ProductGrid } from '@/components/commerce/product-grid';
6
4
  import { CatalogSidebarSkeleton } from '@/components/shared/catalog-sidebar-skeleton';
7
- import { SearchAnalyticsTracker } from './search-analytics-tracker';
5
+ import { ProductGridSkeleton } from '@/components/shared/product-grid-skeleton';
8
6
  import { buildSearchInput, getCurrentPage } from '@/lib/search-helpers';
9
7
  import { client } from '@/lib/vendure/api';
10
8
  import { SearchProductsQuery } from '@/lib/vendure/queries';
9
+ import { Suspense } from 'react';
10
+ import { SearchAnalyticsTracker } from './search-analytics-tracker';
11
11
 
12
12
  interface SearchResultsProps {
13
13
  searchParams: Promise<{
@@ -19,12 +19,14 @@ export async function SearchResults({ searchParams }: SearchResultsProps) {
19
19
  const searchParamsResolved = await searchParams;
20
20
  const page = getCurrentPage(searchParamsResolved);
21
21
 
22
- const productDataPromise = client.query(SearchProductsQuery, {
23
- input: { ...buildSearchInput({ searchParams: searchParamsResolved }), logAnalytics: true },
24
- }).then(([result, error]) => {
25
- if (error) throw error;
26
- return result;
27
- });
22
+ const productDataPromise = client
23
+ .query(SearchProductsQuery, {
24
+ input: { ...buildSearchInput({ searchParams: searchParamsResolved }), logAnalytics: true },
25
+ })
26
+ .then(([result, error]) => {
27
+ if (error) throw error;
28
+ return result;
29
+ });
28
30
 
29
31
  return (
30
32
  <>
@@ -1,10 +1,10 @@
1
1
  interface SearchTermProps {
2
2
  searchParams: Promise<{
3
- q?: string
3
+ q?: string;
4
4
  }>;
5
5
  }
6
6
 
7
- export async function SearchTerm({searchParams}: SearchTermProps) {
7
+ export async function SearchTerm({ searchParams }: SearchTermProps) {
8
8
  const searchParamsResolved = await searchParams;
9
9
  const searchTerm = (searchParamsResolved.q as string) || '';
10
10
 
@@ -14,7 +14,7 @@ export async function SearchTerm({searchParams}: SearchTermProps) {
14
14
  {searchTerm ? `Search results for "${searchTerm}"` : 'Search'}
15
15
  </h1>
16
16
  </div>
17
- )
17
+ );
18
18
  }
19
19
 
20
20
  export function SearchTermSkeleton() {
@@ -22,5 +22,5 @@ export function SearchTermSkeleton() {
22
22
  <div className="mb-6">
23
23
  <div className="h-9 w-64 bg-gray-200 dark:bg-gray-700 rounded animate-pulse" />
24
24
  </div>
25
- )
25
+ );
26
26
  }
@@ -1,9 +1,9 @@
1
1
  // Catch-all for scenario-specific routes (e.g. /compliance).
2
2
  // Lives in a (scenario) route group so it doesn't shadow other top-level routes
3
3
  // like /cart, /checkout, etc. Returns 404 if the active scenario doesn't define the route.
4
- import { Suspense } from 'react';
5
4
  import { getScenarioConfig } from '@/config/scenario';
6
5
  import { notFound } from 'next/navigation';
6
+ import { Suspense } from 'react';
7
7
 
8
8
  export default async function ScenarioRoutePage({
9
9
  params,
@@ -1,18 +1,18 @@
1
1
  'use client';
2
2
 
3
- import {useState} from 'react';
4
- import {useTranslations} from 'next-intl';
5
- import {Button} from '@/components/ui/button';
6
- import {Alert, AlertDescription} from '@/components/ui/alert';
7
- import {Loader2, AlertCircle} from 'lucide-react';
8
- import {acceptInvitationAction} from './actions';
3
+ import { Alert, AlertDescription } from '@/components/ui/alert';
4
+ import { Button } from '@/components/ui/button';
5
+ import { AlertCircle, Loader2 } from 'lucide-react';
6
+ import { useTranslations } from 'next-intl';
7
+ import { useState } from 'react';
8
+ import { acceptInvitationAction } from './actions';
9
9
 
10
10
  interface AcceptInvitationClientProps {
11
11
  token: string;
12
12
  companyName: string;
13
13
  }
14
14
 
15
- export function AcceptInvitationClient({token, companyName}: AcceptInvitationClientProps) {
15
+ export function AcceptInvitationClient({ token, companyName }: AcceptInvitationClientProps) {
16
16
  const t = useTranslations('AcceptInvitation');
17
17
  const [isSubmitting, setIsSubmitting] = useState(false);
18
18
  const [error, setError] = useState<string | null>(null);
@@ -42,12 +42,7 @@ export function AcceptInvitationClient({token, companyName}: AcceptInvitationCli
42
42
  </Alert>
43
43
  )}
44
44
 
45
- <Button
46
- onClick={handleAccept}
47
- disabled={isSubmitting}
48
- size="lg"
49
- className="w-full"
50
- >
45
+ <Button onClick={handleAccept} disabled={isSubmitting} size="lg" className="w-full">
51
46
  {isSubmitting && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
52
47
  {t('acceptButton')}
53
48
  </Button>
@@ -1,24 +1,21 @@
1
1
  'use server';
2
2
 
3
- import {readFragment} from '@/graphql';
4
- import {client} from '@/lib/vendure/api';
5
- import {AcceptCompanyInvitationMutation} from '@/lib/vendure/mutations';
6
- import {CompanyFragment} from '@/lib/vendure/fragments';
7
- import {setCompanyId} from '@/lib/company-context';
8
- import {revalidatePath} from 'next/cache';
9
- import {redirect} from '@/i18n/navigation';
3
+ import { readFragment } from '@/graphql';
4
+ import { redirect } from '@/i18n/navigation';
5
+ import { setCompanyId } from '@/lib/company-context';
6
+ import { client } from '@/lib/vendure/api';
7
+ import { CompanyFragment } from '@/lib/vendure/fragments';
8
+ import { AcceptCompanyInvitationMutation } from '@/lib/vendure/mutations';
9
+ import { revalidatePath } from 'next/cache';
10
10
 
11
- export async function acceptInvitationAction(token: string): Promise<{error: string} | undefined> {
12
- const [result, error] = await client.mutate(
13
- AcceptCompanyInvitationMutation,
14
- {token},
15
- );
11
+ export async function acceptInvitationAction(token: string): Promise<{ error: string } | undefined> {
12
+ const [result, error] = await client.mutate(AcceptCompanyInvitationMutation, { token });
16
13
  if (error) throw error;
17
14
 
18
15
  const data = result.data.acceptCompanyInvitation;
19
16
 
20
17
  if (data.__typename === 'InvitationTokenError') {
21
- return {error: data.message};
18
+ return { error: data.message };
22
19
  }
23
20
 
24
21
  if (data.__typename === 'CompanyAccount') {
@@ -28,5 +25,5 @@ export async function acceptInvitationAction(token: string): Promise<{error: str
28
25
  await redirect('/account/company');
29
26
  }
30
27
 
31
- return {error: 'An unexpected error occurred.'};
28
+ return { error: 'An unexpected error occurred.' };
32
29
  }
@@ -1,26 +1,26 @@
1
- import type {Metadata} from 'next';
2
- import {Suspense} from 'react';
3
- import {getTranslations} from 'next-intl/server';
4
- import {locale as rootLocale} from 'next/root-params';
5
- import type {Locale} from '@/i18n/routing';
6
- import {redirect} from '@/i18n/navigation';
7
- import {readFragment} from '@/graphql';
8
- import {client} from '@/lib/vendure/api';
9
- import {getActiveCustomer} from '@/lib/vendure/actions';
10
- import {GetCompanyInvitationQuery} from '@/lib/vendure/queries';
11
- import {CompanyFragment} from '@/lib/vendure/fragments';
12
- import {AuthPageShell} from '@/components/layout/auth-page-shell';
13
- import {AcceptInvitationClient} from './accept-invitation-client';
14
- import {SignOutAndRetry} from './sign-out-and-retry';
1
+ import { AuthPageShell } from '@/components/layout/auth-page-shell';
2
+ import { readFragment } from '@/graphql';
3
+ import { redirect } from '@/i18n/navigation';
4
+ import type { Locale } from '@/i18n/routing';
5
+ import { getActiveCustomer } from '@/lib/vendure/actions';
6
+ import { client } from '@/lib/vendure/api';
7
+ import { CompanyFragment } from '@/lib/vendure/fragments';
8
+ import { GetCompanyInvitationQuery } from '@/lib/vendure/queries';
9
+ import type { Metadata } from 'next';
10
+ import { getTranslations } from 'next-intl/server';
11
+ import { locale as rootLocale } from 'next/root-params';
12
+ import { Suspense } from 'react';
13
+ import { AcceptInvitationClient } from './accept-invitation-client';
14
+ import { SignOutAndRetry } from './sign-out-and-retry';
15
15
 
16
16
  export async function generateMetadata(): Promise<Metadata> {
17
17
  const locale = (await rootLocale()) as Locale;
18
- const t = await getTranslations({locale, namespace: 'AcceptInvitation'});
19
- return {title: t('pageTitle')};
18
+ const t = await getTranslations({ locale, namespace: 'AcceptInvitation' });
19
+ return { title: t('pageTitle') };
20
20
  }
21
21
 
22
- async function AcceptInvitationContent({params}: {params: Promise<{locale: string; token: string}>}) {
23
- const {token} = await params;
22
+ async function AcceptInvitationContent({ params }: { params: Promise<{ locale: string; token: string }> }) {
23
+ const { token } = await params;
24
24
  const t = await getTranslations('AcceptInvitation');
25
25
  const activeCustomer = await getActiveCustomer();
26
26
  if (!activeCustomer) {
@@ -30,10 +30,7 @@ async function AcceptInvitationContent({params}: {params: Promise<{locale: strin
30
30
  let companyName: string | null = null;
31
31
  let error: string | null = null;
32
32
 
33
- const [result, queryError] = await client.query(
34
- GetCompanyInvitationQuery,
35
- {token},
36
- );
33
+ const [result, queryError] = await client.query(GetCompanyInvitationQuery, { token });
37
34
  if (queryError) {
38
35
  error = t('invalidOrExpired');
39
36
  } else {
@@ -47,7 +44,7 @@ async function AcceptInvitationContent({params}: {params: Promise<{locale: strin
47
44
  <div className="text-center space-y-6">
48
45
  <h1 className="text-3xl font-bold">{t('invalidTitle')}</h1>
49
46
  <p className="text-muted-foreground">
50
- {t('differentAccount', {email: activeCustomer?.emailAddress ?? ''})}
47
+ {t('differentAccount', { email: activeCustomer?.emailAddress ?? '' })}
51
48
  </p>
52
49
  <SignOutAndRetry token={token} />
53
50
  </div>
@@ -58,10 +55,8 @@ async function AcceptInvitationContent({params}: {params: Promise<{locale: strin
58
55
  return (
59
56
  <AuthPageShell>
60
57
  <div className="text-center space-y-6">
61
- <h1 className="text-3xl font-bold">{t('joinCompany', {companyName})}</h1>
62
- <p className="text-muted-foreground">
63
- {t('invitedToJoin', {companyName})}
64
- </p>
58
+ <h1 className="text-3xl font-bold">{t('joinCompany', { companyName })}</h1>
59
+ <p className="text-muted-foreground">{t('invitedToJoin', { companyName })}</p>
65
60
  <AcceptInvitationClient token={token} companyName={companyName} />
66
61
  </div>
67
62
  </AuthPageShell>
@@ -71,14 +66,16 @@ async function AcceptInvitationContent({params}: {params: Promise<{locale: strin
71
66
  export default function AcceptInvitationPage({
72
67
  params,
73
68
  }: {
74
- params: Promise<{locale: string; token: string}>;
69
+ params: Promise<{ locale: string; token: string }>;
75
70
  }) {
76
71
  return (
77
- <Suspense fallback={
78
- <AuthPageShell>
79
- <p className="text-sm text-muted-foreground">Loading...</p>
80
- </AuthPageShell>
81
- }>
72
+ <Suspense
73
+ fallback={
74
+ <AuthPageShell>
75
+ <p className="text-sm text-muted-foreground">Loading...</p>
76
+ </AuthPageShell>
77
+ }
78
+ >
82
79
  <AcceptInvitationContent params={params} />
83
80
  </Suspense>
84
81
  );
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
 
3
- import {useTransition} from 'react';
4
- import {useTranslations} from 'next-intl';
5
- import {useRouter} from '@/i18n/navigation';
6
- import {Button} from '@/components/ui/button';
7
- import {logoutAction} from '@/app/[locale]/sign-in/actions';
3
+ import { logoutAction } from '@/app/[locale]/sign-in/actions';
4
+ import { Button } from '@/components/ui/button';
5
+ import { useRouter } from '@/i18n/navigation';
6
+ import { useTranslations } from 'next-intl';
7
+ import { useTransition } from 'react';
8
8
 
9
- export function SignOutAndRetry({token}: {token: string}) {
9
+ export function SignOutAndRetry({ token }: { token: string }) {
10
10
  const t = useTranslations('AcceptInvitation');
11
11
  const router = useRouter();
12
12
  const [isPending, startTransition] = useTransition();