@vendure-platform/create 0.5.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 (325) hide show
  1. package/CHANGELOG.md +4 -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/next.config.ts +5 -4
  9. package/dist/assets/storefront/package.json +1 -1
  10. package/dist/assets/storefront/postcss.config.mjs +1 -1
  11. package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
  12. package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
  13. package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
  14. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
  15. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +64 -38
  16. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
  17. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
  18. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
  19. package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
  20. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
  21. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
  22. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
  23. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
  24. package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
  25. package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
  26. package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
  27. package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
  28. package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +16 -18
  29. package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
  30. package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +77 -69
  31. package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
  32. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
  33. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
  34. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
  35. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
  36. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
  37. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
  38. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
  39. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +24 -24
  40. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
  41. package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
  42. package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +23 -28
  43. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +24 -24
  44. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
  45. package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +22 -25
  46. package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
  47. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
  48. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
  49. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
  50. package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
  51. package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
  52. package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
  53. package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +32 -29
  54. package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
  55. package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
  56. package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
  57. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
  58. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
  59. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
  60. package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
  61. package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
  62. package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
  63. package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
  64. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
  65. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
  66. package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
  67. package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +15 -15
  68. package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
  69. package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
  70. package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +3 -6
  71. package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
  72. package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
  73. package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
  74. package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
  75. package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +86 -59
  76. package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
  77. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
  78. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
  79. package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
  80. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +11 -9
  81. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +31 -15
  82. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +52 -33
  83. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +22 -14
  84. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +34 -13
  85. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +117 -72
  86. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +21 -14
  87. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +10 -10
  88. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +54 -41
  89. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
  90. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
  91. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
  92. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
  93. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
  94. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
  95. package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
  96. package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
  97. package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
  98. package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
  99. package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
  100. package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
  101. package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
  102. package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
  103. package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
  104. package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
  105. package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
  106. package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
  107. package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +50 -32
  108. package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
  109. package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +48 -42
  110. package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
  111. package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
  112. package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
  113. package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
  114. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
  115. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
  116. package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
  117. package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +56 -47
  118. package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
  119. package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
  120. package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
  121. package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
  122. package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
  123. package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
  124. package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
  125. package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
  126. package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
  127. package/dist/assets/storefront/src/app/[locale]/layout.tsx +53 -47
  128. package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
  129. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -44
  130. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
  131. package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
  132. package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
  133. package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
  134. package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
  135. package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
  136. package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
  137. package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
  138. package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
  139. package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
  140. package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
  141. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
  142. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
  143. package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
  144. package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
  145. package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
  146. package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
  147. package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
  148. package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
  149. package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
  150. package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
  151. package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
  152. package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
  153. package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +43 -18
  154. package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
  155. package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
  156. package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +49 -27
  157. package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
  158. package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
  159. package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
  160. package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
  161. package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
  162. package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
  163. package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
  164. package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
  165. package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
  166. package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
  167. package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
  168. package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
  169. package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
  170. package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
  171. package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
  172. package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
  173. package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
  174. package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
  175. package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
  176. package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
  177. package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +35 -14
  178. package/dist/assets/storefront/src/components/commerce/product-card.tsx +31 -16
  179. package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
  180. package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
  181. package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
  182. package/dist/assets/storefront/src/components/commerce/product-info.tsx +118 -74
  183. package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
  184. package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
  185. package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
  186. package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
  187. package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +54 -36
  188. package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
  189. package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
  190. package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
  191. package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
  192. package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
  193. package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
  194. package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
  195. package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
  196. package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
  197. package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +12 -8
  198. package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
  199. package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
  200. package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
  201. package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
  202. package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
  203. package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
  204. package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
  205. package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
  206. package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
  207. package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
  208. package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
  209. package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
  210. package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
  211. package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
  212. package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
  213. package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
  214. package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
  215. package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
  216. package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
  217. package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
  218. package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
  219. package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
  220. package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
  221. package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
  222. package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
  223. package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
  224. package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
  225. package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
  226. package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
  227. package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
  228. package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
  229. package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
  230. package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
  231. package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
  232. package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
  233. package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
  234. package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
  235. package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
  236. package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
  237. package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
  238. package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
  239. package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
  240. package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
  241. package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
  242. package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
  243. package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
  244. package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
  245. package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
  246. package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
  247. package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
  248. package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
  249. package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
  250. package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
  251. package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
  252. package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
  253. package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
  254. package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
  255. package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
  256. package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
  257. package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
  258. package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
  259. package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
  260. package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
  261. package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
  262. package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
  263. package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
  264. package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
  265. package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
  266. package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
  267. package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
  268. package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
  269. package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
  270. package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
  271. package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
  272. package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
  273. package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
  274. package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
  275. package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
  276. package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
  277. package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
  278. package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
  279. package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
  280. package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
  281. package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
  282. package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
  283. package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
  284. package/dist/assets/storefront/src/config/scenario.ts +14 -16
  285. package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
  286. package/dist/assets/storefront/src/graphql.ts +5 -5
  287. package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
  288. package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
  289. package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
  290. package/dist/assets/storefront/src/i18n/request.ts +4 -4
  291. package/dist/assets/storefront/src/i18n/routing.ts +5 -5
  292. package/dist/assets/storefront/src/i18n/server.ts +3 -3
  293. package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
  294. package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
  295. package/dist/assets/storefront/src/lib/auth.ts +1 -1
  296. package/dist/assets/storefront/src/lib/backend-health.ts +3 -3
  297. package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
  298. package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
  299. package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
  300. package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
  301. package/dist/assets/storefront/src/lib/company-context.ts +1 -1
  302. package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
  303. package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
  304. package/dist/assets/storefront/src/lib/format.ts +16 -7
  305. package/dist/assets/storefront/src/lib/metadata.ts +39 -44
  306. package/dist/assets/storefront/src/lib/quantity.ts +2 -4
  307. package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
  308. package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
  309. package/dist/assets/storefront/src/lib/utils.ts +3 -3
  310. package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
  311. package/dist/assets/storefront/src/lib/vendure/api.ts +36 -23
  312. package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
  313. package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
  314. package/dist/assets/storefront/src/lib/vendure/queries.ts +15 -5
  315. package/dist/assets/storefront/src/middleware.ts +1 -1
  316. package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
  317. package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
  318. package/dist/bin/run.js +1 -1
  319. package/dist/cli.d.ts +1 -1
  320. package/dist/index.d.ts +5 -5
  321. package/dist/index.js +1 -1
  322. package/dist/scaffold-storefront-only.js +1 -1
  323. package/dist/scaffolder.js +1 -1
  324. package/dist/template-renderer.js +1 -1
  325. package/package.json +2 -2
@@ -1,32 +1,32 @@
1
- import {useTranslations} from 'next-intl';
2
- import {getTopCollections} from '@/lib/vendure/cached';
3
- import {getActiveChannelToken} from '@/lib/channel-server';
4
- import {getRouteLocale} from '@/i18n/server';
1
+ import { NavbarLink } from '@/components/layout/navbar/navbar-link';
5
2
  import {
6
3
  NavigationMenu,
7
- NavigationMenuList,
8
- NavigationMenuItem,
9
- NavigationMenuTrigger,
10
4
  NavigationMenuContent,
5
+ NavigationMenuItem,
11
6
  NavigationMenuLink,
7
+ NavigationMenuList,
8
+ NavigationMenuTrigger,
12
9
  } from '@/components/ui/navigation-menu';
13
- import {NavbarLink} from '@/components/layout/navbar/navbar-link';
14
- import {Link} from '@/i18n/navigation';
15
- import {cn} from '@/lib/utils';
16
- import {ResultOf} from '@/graphql';
17
- import {GetTopCollectionsQuery} from '@/lib/vendure/queries';
10
+ import { ResultOf } from '@/graphql';
11
+ import { Link } from '@/i18n/navigation';
12
+ import { getRouteLocale } from '@/i18n/server';
13
+ import { getActiveChannelToken } from '@/lib/channel-server';
14
+ import { cn } from '@/lib/utils';
15
+ import { getTopCollections } from '@/lib/vendure/cached';
16
+ import { GetTopCollectionsQuery } from '@/lib/vendure/queries';
17
+ import { useTranslations } from 'next-intl';
18
18
 
19
19
  type Collection = ResultOf<typeof GetTopCollectionsQuery>['collections']['items'][number];
20
20
 
21
21
  const MAX_VISIBLE_GRANDCHILDREN = 5;
22
22
 
23
- function MegaMenuContent({collection}: { collection: Collection }) {
23
+ function MegaMenuContent({ collection }: { collection: Collection }) {
24
24
  const t = useTranslations('Navigation');
25
25
  const children = collection.children ?? [];
26
26
 
27
27
  // Group children by whether they have grandchildren
28
- const categoriesWithSubs = children.filter(c => c.children && c.children.length > 0);
29
- const simpleCategories = children.filter(c => !c.children || c.children.length === 0);
28
+ const categoriesWithSubs = children.filter((c) => c.children && c.children.length > 0);
29
+ const simpleCategories = children.filter((c) => !c.children || c.children.length === 0);
30
30
 
31
31
  return (
32
32
  <NavigationMenuContent>
@@ -37,16 +37,16 @@ function MegaMenuContent({collection}: { collection: Collection }) {
37
37
  href={`/collection/${collection.slug}`}
38
38
  prefetch={false}
39
39
  className={cn(
40
- "block select-none rounded-md p-3 leading-none no-underline outline-none transition-colors",
41
- "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
42
- "col-span-full border-b pb-3 mb-1"
40
+ 'block select-none rounded-md p-3 leading-none no-underline outline-none transition-colors',
41
+ 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
42
+ 'col-span-full border-b pb-3 mb-1',
43
43
  )}
44
44
  >
45
45
  <div className="text-sm font-medium leading-none">
46
- {t('viewAllCollection', {name: collection.name})}
46
+ {t('viewAllCollection', { name: collection.name })}
47
47
  </div>
48
48
  <p className="text-muted-foreground line-clamp-2 text-sm leading-snug mt-1">
49
- {t('browseAllCollection', {name: collection.name})}
49
+ {t('browseAllCollection', { name: collection.name })}
50
50
  </p>
51
51
  </Link>
52
52
  </NavigationMenuLink>
@@ -85,7 +85,9 @@ function MegaMenuContent({collection}: { collection: Collection }) {
85
85
  prefetch={false}
86
86
  className="text-muted-foreground text-sm hover:text-foreground hover:underline"
87
87
  >
88
- {t('moreGrandchildren', {count: child.children.length - MAX_VISIBLE_GRANDCHILDREN})}
88
+ {t('moreGrandchildren', {
89
+ count: child.children.length - MAX_VISIBLE_GRANDCHILDREN,
90
+ })}
89
91
  </Link>
90
92
  </NavigationMenuLink>
91
93
  </li>
@@ -96,10 +98,12 @@ function MegaMenuContent({collection}: { collection: Collection }) {
96
98
 
97
99
  {/* Simple categories without subcategories */}
98
100
  {simpleCategories.length > 0 && (
99
- <div className={cn(
100
- "space-y-1",
101
- categoriesWithSubs.length > 0 && "col-span-full border-t pt-3 mt-2"
102
- )}>
101
+ <div
102
+ className={cn(
103
+ 'space-y-1',
104
+ categoriesWithSubs.length > 0 && 'col-span-full border-t pt-3 mt-2',
105
+ )}
106
+ >
103
107
  <div className="flex flex-wrap gap-2">
104
108
  {simpleCategories.map((child) => (
105
109
  <NavigationMenuLink key={child.id} asChild>
@@ -107,8 +111,8 @@ function MegaMenuContent({collection}: { collection: Collection }) {
107
111
  href={`/collection/${child.slug}`}
108
112
  prefetch={false}
109
113
  className={cn(
110
- "inline-block rounded-md px-3 py-1.5 text-sm",
111
- "bg-muted hover:bg-accent hover:text-accent-foreground transition-colors"
114
+ 'inline-block rounded-md px-3 py-1.5 text-sm',
115
+ 'bg-muted hover:bg-accent hover:text-accent-foreground transition-colors',
112
116
  )}
113
117
  >
114
118
  {child.name}
@@ -123,7 +127,7 @@ function MegaMenuContent({collection}: { collection: Collection }) {
123
127
  );
124
128
  }
125
129
 
126
- function CollectionMenuItem({collection, className}: { collection: Collection; className?: string }) {
130
+ function CollectionMenuItem({ collection, className }: { collection: Collection; className?: string }) {
127
131
  const hasChildren = collection.children && collection.children.length > 0;
128
132
 
129
133
  if (hasChildren) {
@@ -139,9 +143,7 @@ function CollectionMenuItem({collection, className}: { collection: Collection; c
139
143
 
140
144
  return (
141
145
  <NavigationMenuItem className={className}>
142
- <NavbarLink href={`/collection/${collection.slug}`}>
143
- {collection.name}
144
- </NavbarLink>
146
+ <NavbarLink href={`/collection/${collection.slug}`}>{collection.name}</NavbarLink>
145
147
  </NavigationMenuItem>
146
148
  );
147
149
  }
@@ -162,7 +164,7 @@ export async function NavbarCollections() {
162
164
  return <NavbarCollectionsView collections={collections} />;
163
165
  }
164
166
 
165
- function NavbarCollectionsView({collections}: { collections: Collection[] }) {
167
+ function NavbarCollectionsView({ collections }: { collections: Collection[] }) {
166
168
  const t = useTranslations('Navigation');
167
169
 
168
170
  // Split collections into responsive groups
@@ -180,10 +182,7 @@ function NavbarCollectionsView({collections}: { collections: Collection[] }) {
180
182
  <NavigationMenuList>
181
183
  {/* Always visible at lg+ */}
182
184
  {alwaysVisible.map((collection) => (
183
- <CollectionMenuItem
184
- key={collection.id}
185
- collection={collection}
186
- />
185
+ <CollectionMenuItem key={collection.id} collection={collection} />
187
186
  ))}
188
187
 
189
188
  {/* Visible at xl+, hidden at lg */}
@@ -220,8 +219,8 @@ function NavbarCollectionsView({collections}: { collections: Collection[] }) {
220
219
  href={`/collection/${collection.slug}`}
221
220
  prefetch={false}
222
221
  className={cn(
223
- "block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors",
224
- "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
222
+ 'block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors',
223
+ 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
225
224
  )}
226
225
  >
227
226
  {collection.name}
@@ -245,8 +244,8 @@ function NavbarCollectionsView({collections}: { collections: Collection[] }) {
245
244
  <Link
246
245
  href={`/collection/${collection.slug}`}
247
246
  className={cn(
248
- "block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors",
249
- "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
247
+ 'block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors',
248
+ 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
250
249
  )}
251
250
  >
252
251
  {collection.name}
@@ -271,8 +270,8 @@ function NavbarCollectionsView({collections}: { collections: Collection[] }) {
271
270
  <Link
272
271
  href={`/collection/${collection.slug}`}
273
272
  className={cn(
274
- "block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors",
275
- "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
273
+ 'block select-none rounded-md p-2 text-sm leading-none no-underline outline-none transition-colors',
274
+ 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
276
275
  )}
277
276
  >
278
277
  {collection.name}
@@ -1,15 +1,12 @@
1
1
  'use client';
2
2
 
3
- import {useSelectedLayoutSegment} from 'next/navigation';
4
- import {ComponentProps} from 'react';
5
- import {Link} from '@/i18n/navigation';
6
- import {
7
- NavigationMenuLink,
8
- navigationMenuTriggerStyle,
9
- } from '@/components/ui/navigation-menu';
10
- import {cn} from '@/lib/utils';
3
+ import { NavigationMenuLink, navigationMenuTriggerStyle } from '@/components/ui/navigation-menu';
4
+ import { Link } from '@/i18n/navigation';
5
+ import { cn } from '@/lib/utils';
6
+ import { useSelectedLayoutSegment } from 'next/navigation';
7
+ import { ComponentProps } from 'react';
11
8
 
12
- export function NavbarLink({href, ...rest}: ComponentProps<typeof Link>) {
9
+ export function NavbarLink({ href, ...rest }: ComponentProps<typeof Link>) {
13
10
  const selectedLayoutSegment = useSelectedLayoutSegment();
14
11
  const pathname = selectedLayoutSegment ? `/${selectedLayoutSegment}` : '/';
15
12
  const isActive = pathname === href;
@@ -25,4 +22,4 @@ export function NavbarLink({href, ...rest}: ComponentProps<typeof Link>) {
25
22
  />
26
23
  </NavigationMenuLink>
27
24
  );
28
- }
25
+ }
@@ -1,7 +1,7 @@
1
1
  import { BusinessUnitSwitcher } from '@/components/commerce/business-unit-switcher';
2
2
  import { CompanySwitcher } from '@/components/commerce/company-switcher';
3
3
  import { LoginButton } from '@/components/layout/navbar/login-button';
4
- import { PersonalNavMenuItems, CompanyNavMenuItems } from '@/components/layout/navbar/nav-menu-items';
4
+ import { CompanyNavMenuItems, PersonalNavMenuItems } from '@/components/layout/navbar/nav-menu-items';
5
5
  import { Button, buttonVariants } from '@/components/ui/button';
6
6
  import {
7
7
  DropdownMenu,
@@ -12,6 +12,10 @@ import {
12
12
  DropdownMenuTrigger,
13
13
  } from '@/components/ui/dropdown-menu';
14
14
  import { readFragment } from '@/graphql';
15
+ import { cn } from '@/lib/utils';
16
+ import { getMyCompanies } from '@/lib/vendure/actions';
17
+ import type { VendureContext } from '@/lib/vendure/api';
18
+ import { client, getVendureContext } from '@/lib/vendure/api';
15
19
  import {
16
20
  ActiveCustomerFragment,
17
21
  CompanyBusinessUnitFragment,
@@ -20,14 +24,10 @@ import {
20
24
  CompanyRoleFragment,
21
25
  CompanyUserFragment,
22
26
  } from '@/lib/vendure/fragments';
23
- import { client, getVendureContext } from '@/lib/vendure/api';
24
- import type { VendureContext } from '@/lib/vendure/api';
25
- import { getMyCompanies } from '@/lib/vendure/actions';
26
27
  import { GetActiveCustomerQuery, GetCompanyAccountQuery } from '@/lib/vendure/queries';
27
- import { cacheLife, cacheTag } from 'next/cache';
28
- import {getTranslations} from 'next-intl/server';
29
28
  import { User } from 'lucide-react';
30
- import {cn} from '@/lib/utils';
29
+ import { getTranslations } from 'next-intl/server';
30
+ import { cacheLife, cacheTag } from 'next/cache';
31
31
 
32
32
  async function getNavbarUserData(ctx: VendureContext) {
33
33
  'use cache: private';
@@ -40,9 +40,7 @@ async function getNavbarUserData(ctx: VendureContext) {
40
40
  ]);
41
41
 
42
42
  const [custRes, custErr] = customerResult;
43
- const customer = custErr
44
- ? null
45
- : readFragment(ActiveCustomerFragment, custRes.data.activeCustomer);
43
+ const customer = custErr ? null : readFragment(ActiveCustomerFragment, custRes.data.activeCustomer);
46
44
 
47
45
  if (!customer) return { customer: null, companyAccount: null };
48
46
 
@@ -60,14 +58,16 @@ async function getNavbarUserData(ctx: VendureContext) {
60
58
  company,
61
59
  companyUser: {
62
60
  ...rawUser,
63
- companyRoles: rawUser.companyRoles.map(r => {
61
+ companyRoles: rawUser.companyRoles.map((r) => {
64
62
  const role = readFragment(CompanyRoleFragment, r);
65
63
  return {
66
64
  ...role,
67
- permissions: role.permissions.map(p => readFragment(CompanyPermissionFragment, p)),
65
+ permissions: role.permissions.map((p) => readFragment(CompanyPermissionFragment, p)),
68
66
  };
69
67
  }),
70
- businessUnits: rawUser.businessUnits.map(bu => readFragment(CompanyBusinessUnitFragment, bu)),
68
+ businessUnits: rawUser.businessUnits.map((bu) =>
69
+ readFragment(CompanyBusinessUnitFragment, bu),
70
+ ),
71
71
  },
72
72
  activeBusinessUnit,
73
73
  permissions: [...account.permissions],
@@ -78,10 +78,7 @@ async function getNavbarUserData(ctx: VendureContext) {
78
78
  }
79
79
 
80
80
  export async function NavbarUser() {
81
- const [ctx, t] = await Promise.all([
82
- getVendureContext(),
83
- getTranslations('Navigation'),
84
- ]);
81
+ const [ctx, t] = await Promise.all([getVendureContext(), getTranslations('Navigation')]);
85
82
  const [{ customer, companyAccount }, companies] = await Promise.all([
86
83
  getNavbarUserData(ctx),
87
84
  getMyCompanies(),
@@ -100,9 +97,9 @@ export async function NavbarUser() {
100
97
 
101
98
  return (
102
99
  <DropdownMenu>
103
- <DropdownMenuTrigger className={cn(buttonVariants({ variant: "ghost" }))}>
104
- <User className="h-5 w-5" />
105
- {t('greeting', {name: customer.firstName})}
100
+ <DropdownMenuTrigger className={cn(buttonVariants({ variant: 'ghost' }))}>
101
+ <User className="h-5 w-5" />
102
+ {t('greeting', { name: customer.firstName })}
106
103
  </DropdownMenuTrigger>
107
104
  <DropdownMenuContent align="end" className="w-56">
108
105
  {companies.length > 1 && companyAccount && (
@@ -134,9 +131,7 @@ export async function NavbarUser() {
134
131
  </>
135
132
  )}
136
133
  <PersonalNavMenuItems />
137
- {companyAccount && (
138
- <CompanyNavMenuItems permissions={companyAccount.permissions} />
139
- )}
134
+ {companyAccount && <CompanyNavMenuItems permissions={companyAccount.permissions} />}
140
135
  <DropdownMenuSeparator />
141
136
  <DropdownMenuItem asChild>
142
137
  <LoginButton isLoggedIn={true} />
@@ -1,13 +1,13 @@
1
- "use client";
1
+ 'use client';
2
2
 
3
- import {useTheme} from "next-themes";
4
- import {useEffect, useState} from "react";
5
- import {Moon, Sun} from "lucide-react";
6
- import {Button} from "@/components/ui/button";
3
+ import { Button } from '@/components/ui/button';
4
+ import { Moon, Sun } from 'lucide-react';
5
+ import { useTheme } from 'next-themes';
6
+ import { useEffect, useState } from 'react';
7
7
 
8
8
  export function ThemeSwitcher() {
9
9
  const [mounted, setMounted] = useState(false);
10
- const {theme, setTheme} = useTheme();
10
+ const { theme, setTheme } = useTheme();
11
11
 
12
12
  useEffect(() => {
13
13
  // eslint-disable-next-line react-hooks/set-state-in-effect -- intentional SSR hydration pattern
@@ -23,15 +23,15 @@ export function ThemeSwitcher() {
23
23
  );
24
24
  }
25
25
 
26
- const isDark = theme === "dark";
26
+ const isDark = theme === 'dark';
27
27
 
28
28
  return (
29
29
  <Button
30
30
  variant="ghost"
31
31
  size="icon"
32
32
  className="h-9 w-9"
33
- onClick={() => setTheme(isDark ? "light" : "dark")}
34
- aria-label={isDark ? "Switch to light mode" : "Switch to dark mode"}
33
+ onClick={() => setTheme(isDark ? 'light' : 'dark')}
34
+ aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
35
35
  >
36
36
  {isDark ? <Sun className="size-4" /> : <Moon className="size-4" />}
37
37
  </Button>
@@ -1,35 +1,32 @@
1
- import Image from "next/image";
2
- import {Link} from "@/i18n/navigation";
3
- import {NavbarCart} from '@/components/layout/navbar/navbar-cart';
4
- import {NavbarUser} from '@/components/layout/navbar/navbar-user';
5
- import {ThemeSwitcher} from '@/components/layout/navbar/theme-switcher';
6
- import {LanguagePicker} from '@/components/layout/navbar/language-picker';
7
- import {ChannelPickerWrapper} from '@/components/layout/navbar/channel-picker-wrapper';
8
- import {CurrencyPickerWrapper} from '@/components/layout/navbar/currency-picker-wrapper';
9
- import {SearchInput} from '@/components/layout/search-input';
10
- import {MobileNav} from '@/components/layout/navbar/mobile-nav';
11
- import {DraftModeBorderStyle, DraftModeIndicator} from '@/components/layout/draft-mode-indicator';
12
- import {AwaitingApprovalBanner} from '@/components/providers/awaiting-approval-banner';
13
- import {getHasCompany} from '@/lib/vendure/actions';
14
- import {getTranslations} from 'next-intl/server';
15
- import {Suspense} from "react";
16
- import {getBranding} from '@/config/branding';
1
+ import { DraftModeBorderStyle, DraftModeIndicator } from '@/components/layout/draft-mode-indicator';
2
+ import { ChannelPickerWrapper } from '@/components/layout/navbar/channel-picker-wrapper';
3
+ import { CurrencyPickerWrapper } from '@/components/layout/navbar/currency-picker-wrapper';
4
+ import { LanguagePicker } from '@/components/layout/navbar/language-picker';
5
+ import { MobileNav } from '@/components/layout/navbar/mobile-nav';
6
+ import { NavbarCart } from '@/components/layout/navbar/navbar-cart';
7
+ import { NavbarUser } from '@/components/layout/navbar/navbar-user';
8
+ import { ThemeSwitcher } from '@/components/layout/navbar/theme-switcher';
9
+ import { SearchInput } from '@/components/layout/search-input';
10
+ import { AwaitingApprovalBanner } from '@/components/providers/awaiting-approval-banner';
11
+ import { getBranding } from '@/config/branding';
12
+ import { Link } from '@/i18n/navigation';
13
+ import { getHasCompany } from '@/lib/vendure/actions';
14
+ import { getTranslations } from 'next-intl/server';
15
+ import Image from 'next/image';
16
+ import { Suspense } from 'react';
17
17
 
18
18
  // Groups all async navbar children so they stream as a single chunk.
19
19
  // Without this, each async component gets its own implicit Suspense
20
20
  // boundary, causing staggered rendering and CLS within the fixed header.
21
21
  async function AsyncNavbarContent() {
22
- const [hasCompany, t] = await Promise.all([
23
- getHasCompany(),
24
- getTranslations('Navigation'),
25
- ]);
22
+ const [hasCompany, t] = await Promise.all([getHasCompany(), getTranslations('Navigation')]);
26
23
  const defaultNavLinks = [
27
- {href: '/catalog', label: t('catalog')},
28
- {href: '/account/quick-order', label: t('quickOrder')},
29
- {href: '/account/orders', label: t('orders')},
30
- {href: '/account/quotes', label: t('quotes')},
24
+ { href: '/catalog', label: t('catalog') },
25
+ { href: '/account/quick-order', label: t('quickOrder') },
26
+ { href: '/account/orders', label: t('orders') },
27
+ { href: '/account/quotes', label: t('quotes') },
31
28
  ];
32
- const companyNavLink = {href: '/account/company', label: t('company')};
29
+ const companyNavLink = { href: '/account/company', label: t('company') };
33
30
  const branding = getBranding();
34
31
  const navLinks = branding.navLinks ?? defaultNavLinks;
35
32
  const appendCompany = hasCompany && !branding.hideCompanyNavLink;
@@ -41,7 +38,7 @@ async function AsyncNavbarContent() {
41
38
  </div>
42
39
  <div className="flex items-center justify-between flex-1 ml-4">
43
40
  <nav className="hidden lg:flex items-center gap-1">
44
- {allLinks.map(({href, label}) => (
41
+ {allLinks.map(({ href, label }) => (
45
42
  <Link
46
43
  key={href}
47
44
  href={href}
@@ -54,14 +51,14 @@ async function AsyncNavbarContent() {
54
51
  </nav>
55
52
  <div className="flex items-center gap-2">
56
53
  <div className="hidden lg:flex">
57
- <SearchInput/>
54
+ <SearchInput />
58
55
  </div>
59
56
  <ChannelPickerWrapper />
60
57
  <CurrencyPickerWrapper />
61
58
  {!branding.hideLanguagePicker && <LanguagePicker />}
62
59
  <ThemeSwitcher />
63
- <NavbarCart/>
64
- <NavbarUser/>
60
+ <NavbarCart />
61
+ <NavbarUser />
65
62
  <DraftModeIndicator />
66
63
  </div>
67
64
  </div>
@@ -103,8 +100,16 @@ export function Navbar() {
103
100
  <div className="flex items-center h-14">
104
101
  <div className="flex items-center gap-4 flex-shrink-0">
105
102
  <Link href="/" prefetch={false} className="flex-shrink-0 flex items-center gap-3">
106
- <Image src={logo.src} alt={logo.alt} width={logo.width} height={logo.height} className="h-5 w-auto" />
107
- <span className="hidden sm:inline text-sm font-bold text-foreground tracking-tight">{siteName}</span>
103
+ <Image
104
+ src={logo.src}
105
+ alt={logo.alt}
106
+ width={logo.width}
107
+ height={logo.height}
108
+ className="h-5 w-auto"
109
+ />
110
+ <span className="hidden sm:inline text-sm font-bold text-foreground tracking-tight">
111
+ {siteName}
112
+ </span>
108
113
  </Link>
109
114
  </div>
110
115
  <Suspense fallback={<AsyncNavbarSkeleton />}>
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
 
3
- import { useState, useEffect, useRef, useCallback } from 'react';
4
- import { useSearchParams } from 'next/navigation';
5
- import { useTranslations } from 'next-intl';
6
- import { useRouter } from '@/i18n/navigation';
7
- import { Search } from 'lucide-react';
3
+ import { InstantSearchDropdown } from '@/components/commerce/instant-search-dropdown';
8
4
  import { Input } from '@/components/ui/input';
9
- import { useSearchBar } from '@/lib/search-bar-context';
10
5
  import { KbdShortcut } from '@/components/ui/kbd-shortcut';
11
- import { InstantSearchDropdown } from '@/components/commerce/instant-search-dropdown';
6
+ import { useRouter } from '@/i18n/navigation';
7
+ import { useSearchBar } from '@/lib/search-bar-context';
8
+ import { Search } from 'lucide-react';
9
+ import { useTranslations } from 'next-intl';
10
+ import { useSearchParams } from 'next/navigation';
11
+ import { useCallback, useEffect, useRef, useState } from 'react';
12
12
 
13
13
  export function SearchInput() {
14
14
  const t = useTranslations('Navigation');
@@ -33,10 +33,13 @@ export function SearchInput() {
33
33
  setSearchValue(searchParams.get('q') || '');
34
34
  }, [searchParams]);
35
35
 
36
- const handleSubmit = useCallback((term: string) => {
37
- if (!term.trim()) return;
38
- router.push(`/search?q=${encodeURIComponent(term.trim())}`);
39
- }, [router]);
36
+ const handleSubmit = useCallback(
37
+ (term: string) => {
38
+ if (!term.trim()) return;
39
+ router.push(`/search?q=${encodeURIComponent(term.trim())}`);
40
+ },
41
+ [router],
42
+ );
40
43
 
41
44
  const handleFormSubmit = (e: React.FormEvent) => {
42
45
  e.preventDefault();
@@ -45,27 +48,27 @@ export function SearchInput() {
45
48
 
46
49
  return (
47
50
  <div className={hasInlineSearch ? 'hidden' : ''}>
48
- <InstantSearchDropdown
49
- inputRef={inputRef}
50
- searchValue={searchValue}
51
- onSearchValueChange={setSearchValue}
52
- onSubmit={handleSubmit}
53
- dropdownClassName="w-[32rem] right-0 left-auto"
54
- >
55
- <form onSubmit={handleFormSubmit} className="relative">
56
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
57
- <Input
58
- ref={setRef}
59
- type="search"
60
- placeholder={t('searchByNameSkuKeyword')}
61
- className="pl-9 pr-16 w-64"
62
- value={searchValue}
63
- onChange={(e) => setSearchValue(e.target.value)}
64
- autoComplete="off"
65
- />
66
- <KbdShortcut className="absolute right-3 top-1/2 -translate-y-1/2" />
67
- </form>
68
- </InstantSearchDropdown>
51
+ <InstantSearchDropdown
52
+ inputRef={inputRef}
53
+ searchValue={searchValue}
54
+ onSearchValueChange={setSearchValue}
55
+ onSubmit={handleSubmit}
56
+ dropdownClassName="w-[32rem] right-0 left-auto"
57
+ >
58
+ <form onSubmit={handleFormSubmit} className="relative">
59
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
60
+ <Input
61
+ ref={setRef}
62
+ type="search"
63
+ placeholder={t('searchByNameSkuKeyword')}
64
+ className="pl-9 pr-16 w-64"
65
+ value={searchValue}
66
+ onChange={(e) => setSearchValue(e.target.value)}
67
+ autoComplete="off"
68
+ />
69
+ <KbdShortcut className="absolute right-3 top-1/2 -translate-y-1/2" />
70
+ </form>
71
+ </InstantSearchDropdown>
69
72
  </div>
70
73
  );
71
74
  }
@@ -1,10 +1,10 @@
1
- import {cacheLife, cacheTag} from 'next/cache';
2
- import {ClipboardCheck, ArrowRight} from 'lucide-react';
3
- import {getTranslations} from 'next-intl/server';
4
- import {Link} from '@/i18n/navigation';
5
- import {client, getVendureContext} from '@/lib/vendure/api';
6
- import type {VendureContext} from '@/lib/vendure/api';
7
- import {GetActiveOrderQuery} from '@/lib/vendure/queries';
1
+ import { Link } from '@/i18n/navigation';
2
+ import type { VendureContext } from '@/lib/vendure/api';
3
+ import { client, getVendureContext } from '@/lib/vendure/api';
4
+ import { GetActiveOrderQuery } from '@/lib/vendure/queries';
5
+ import { ArrowRight, ClipboardCheck } from 'lucide-react';
6
+ import { getTranslations } from 'next-intl/server';
7
+ import { cacheLife, cacheTag } from 'next/cache';
8
8
 
9
9
  async function getAwaitingApprovalOrderCode(ctx: VendureContext): Promise<string | null> {
10
10
  'use cache: private';
@@ -37,18 +37,20 @@ export async function AwaitingApprovalBanner() {
37
37
  >
38
38
  <div className="container mx-auto px-4 py-2 flex items-center justify-between gap-4 flex-wrap">
39
39
  <div className="flex items-center gap-3 min-w-0">
40
- <ClipboardCheck className="h-5 w-5 flex-shrink-0 text-amber-600 dark:text-amber-400"/>
40
+ <ClipboardCheck className="h-5 w-5 flex-shrink-0 text-amber-600 dark:text-amber-400" />
41
41
  <p className="text-sm">
42
42
  <span className="font-semibold">{t('orderPendingApproval')}:</span>{' '}
43
43
  <code className="font-mono font-semibold px-1.5 py-0.5 rounded bg-amber-500/20">
44
44
  {code}
45
45
  </code>{' '}
46
- <span className="text-muted-foreground">{t('awaitingApprovalBannerBody')}</span>
46
+ <span className="text-muted-foreground">
47
+ {t('awaitingApprovalBannerBody')}
48
+ </span>
47
49
  </p>
48
50
  </div>
49
51
  <span className="text-sm font-semibold inline-flex items-center gap-1.5 flex-shrink-0 text-amber-600 dark:text-amber-400">
50
52
  {t('viewRequest')}
51
- <ArrowRight className="h-4 w-4"/>
53
+ <ArrowRight className="h-4 w-4" />
52
54
  </span>
53
55
  </div>
54
56
  </Link>
@@ -1,31 +1,33 @@
1
- import {cacheLife, cacheTag} from 'next/cache';
2
- import {CartStatusSync} from '@/lib/cart-count-context';
3
- import {client, getVendureContext} from '@/lib/vendure/api';
4
- import type {VendureContext} from '@/lib/vendure/api';
5
- import {GetActiveOrderQuery} from '@/lib/vendure/queries';
1
+ import { CartStatusSync } from '@/lib/cart-count-context';
2
+ import type { VendureContext } from '@/lib/vendure/api';
3
+ import { client, getVendureContext } from '@/lib/vendure/api';
4
+ import { GetActiveOrderQuery } from '@/lib/vendure/queries';
5
+ import { cacheLife, cacheTag } from 'next/cache';
6
6
 
7
- async function getCartStatus(ctx: VendureContext): Promise<{count: number; awaitingApprovalOrderCode: string | null}> {
7
+ async function getCartStatus(
8
+ ctx: VendureContext,
9
+ ): Promise<{ count: number; awaitingApprovalOrderCode: string | null }> {
8
10
  'use cache: private';
9
11
  cacheLife('minutes');
10
12
  cacheTag('cart');
11
13
  cacheTag('active-order');
12
14
 
13
15
  const [result, error] = await client.query(GetActiveOrderQuery, undefined, ctx);
14
- if (error) return {count: 0, awaitingApprovalOrderCode: null};
16
+ if (error) return { count: 0, awaitingApprovalOrderCode: null };
15
17
 
16
18
  const order = result.data.activeOrder;
17
- if (!order) return {count: 0, awaitingApprovalOrderCode: null};
19
+ if (!order) return { count: 0, awaitingApprovalOrderCode: null };
18
20
  if (order.state === 'AwaitingApproval') {
19
- return {count: 0, awaitingApprovalOrderCode: order.code};
21
+ return { count: 0, awaitingApprovalOrderCode: order.code };
20
22
  }
21
23
  // Only count lines when the order is in AddingItems (editable cart).
22
- if (order.state !== 'AddingItems') return {count: 0, awaitingApprovalOrderCode: null};
24
+ if (order.state !== 'AddingItems') return { count: 0, awaitingApprovalOrderCode: null };
23
25
 
24
- return {count: order.lines.length, awaitingApprovalOrderCode: null};
26
+ return { count: order.lines.length, awaitingApprovalOrderCode: null };
25
27
  }
26
28
 
27
29
  export async function CartCountServer() {
28
30
  const ctx = await getVendureContext();
29
- const {count, awaitingApprovalOrderCode} = await getCartStatus(ctx);
31
+ const { count, awaitingApprovalOrderCode } = await getCartStatus(ctx);
30
32
  return <CartStatusSync count={count} awaitingApprovalOrderCode={awaitingApprovalOrderCode} />;
31
33
  }