@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.
- package/CHANGELOG.md +8 -0
- package/README.md +39 -39
- package/dist/add-to-existing.js +1 -1
- package/dist/assets/demo-data/initial-data.json +663 -663
- package/dist/assets/storefront/components.json +20 -20
- package/dist/assets/storefront/eslint.config.mjs +10 -10
- package/dist/assets/storefront/graphql.config.yml +1 -1
- package/dist/assets/storefront/messages/de.json +2 -0
- package/dist/assets/storefront/messages/en.json +2 -0
- package/dist/assets/storefront/next.config.ts +5 -4
- package/dist/assets/storefront/package.json +1 -1
- package/dist/assets/storefront/postcss.config.mjs +1 -1
- package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
- package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +68 -37
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
- package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
- package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
- package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
- package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +16 -18
- package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +77 -69
- package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +24 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
- package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
- package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +23 -28
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +24 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +22 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
- package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
- package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +32 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
- package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
- package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
- package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
- package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
- package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +15 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +3 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
- package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +86 -59
- package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/activity-feed.tsx +152 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +132 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +140 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +259 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +55 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +117 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/shared-cart-detail-client.tsx +555 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +305 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +84 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +47 -0
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +276 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
- package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
- package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
- package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
- package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
- package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
- package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +70 -29
- package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
- package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +48 -42
- package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
- package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
- package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
- package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
- package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
- package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +56 -47
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
- package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
- package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
- package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +53 -47
- package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -44
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
- package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
- package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
- package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
- package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
- package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
- package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
- package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
- package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
- package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
- package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
- package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
- package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
- package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
- package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
- package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
- package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
- package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +44 -17
- package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
- package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +247 -0
- package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
- package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
- package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
- package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
- package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
- package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
- package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
- package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
- package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
- package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
- package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
- package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
- package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
- package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
- package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
- package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
- package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +35 -14
- package/dist/assets/storefront/src/components/commerce/product-card.tsx +31 -16
- package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
- package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
- package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +129 -72
- package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
- package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
- package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
- package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +54 -36
- package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
- package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
- package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
- package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
- package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
- package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
- package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
- package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
- package/dist/assets/storefront/src/components/commerce/shared-cart-role.ts +39 -0
- package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +28 -0
- package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
- package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
- package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
- package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
- package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
- package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
- package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
- package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
- package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
- package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
- package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
- package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
- package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
- package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
- package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
- package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
- package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
- package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
- package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
- package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
- package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
- package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
- package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
- package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
- package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
- package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
- package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
- package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
- package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
- package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
- package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
- package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
- package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
- package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
- package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
- package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
- package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
- package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
- package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
- package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
- package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
- package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
- package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
- package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
- package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
- package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
- package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
- package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
- package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
- package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
- package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
- package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
- package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
- package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
- package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
- package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
- package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
- package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
- package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
- package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
- package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
- package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
- package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
- package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
- package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
- package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
- package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
- package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
- package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
- package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
- package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
- package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
- package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
- package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
- package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
- package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
- package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
- package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
- package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
- package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
- package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
- package/dist/assets/storefront/src/config/scenario.ts +14 -16
- package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
- package/dist/assets/storefront/src/graphql-env.d.ts +18 -5
- package/dist/assets/storefront/src/graphql.ts +5 -5
- package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
- package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
- package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
- package/dist/assets/storefront/src/i18n/request.ts +4 -4
- package/dist/assets/storefront/src/i18n/routing.ts +5 -5
- package/dist/assets/storefront/src/i18n/server.ts +3 -3
- package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
- package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
- package/dist/assets/storefront/src/lib/auth.ts +1 -1
- package/dist/assets/storefront/src/lib/backend-health.ts +3 -3
- package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
- package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
- package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
- package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
- package/dist/assets/storefront/src/lib/company-context.ts +1 -1
- package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
- package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
- package/dist/assets/storefront/src/lib/format.ts +16 -7
- package/dist/assets/storefront/src/lib/metadata.ts +39 -44
- package/dist/assets/storefront/src/lib/quantity.ts +2 -4
- package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
- package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
- package/dist/assets/storefront/src/lib/utils.ts +3 -3
- package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
- package/dist/assets/storefront/src/lib/vendure/api.ts +44 -27
- package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
- package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
- package/dist/assets/storefront/src/lib/vendure/mutations.ts +96 -0
- package/dist/assets/storefront/src/lib/vendure/queries.ts +157 -5
- package/dist/assets/storefront/src/middleware.ts +1 -1
- package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
- package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
- package/dist/assets/storefront/src/schema.graphql +134 -0
- package/dist/bin/run.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/plugin-registry.js +1 -1
- package/dist/scaffold-storefront-only.js +1 -1
- package/dist/scaffolder.js +1 -1
- package/dist/template-renderer.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useActionState, useEffect } from 'react';
|
|
4
|
-
import { updatePasswordAction } from './actions';
|
|
5
3
|
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
6
5
|
import { Input } from '@/components/ui/input';
|
|
7
6
|
import { Label } from '@/components/ui/label';
|
|
8
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
9
7
|
import { useTranslations } from 'next-intl';
|
|
8
|
+
import { useActionState, useEffect } from 'react';
|
|
9
|
+
import { updatePasswordAction } from './actions';
|
|
10
10
|
|
|
11
11
|
export function ChangePasswordForm() {
|
|
12
12
|
const t = useTranslations('Account');
|
|
@@ -23,9 +23,7 @@ export function ChangePasswordForm() {
|
|
|
23
23
|
<Card>
|
|
24
24
|
<CardHeader>
|
|
25
25
|
<CardTitle>{t('changePassword')}</CardTitle>
|
|
26
|
-
<CardDescription>
|
|
27
|
-
{t('changePasswordDescription')}
|
|
28
|
-
</CardDescription>
|
|
26
|
+
<CardDescription>{t('changePasswordDescription')}</CardDescription>
|
|
29
27
|
</CardHeader>
|
|
30
28
|
<form id="change-password-form" action={formAction}>
|
|
31
29
|
<CardContent className="space-y-4">
|
|
@@ -62,16 +60,8 @@ export function ChangePasswordForm() {
|
|
|
62
60
|
disabled={isPending}
|
|
63
61
|
/>
|
|
64
62
|
</div>
|
|
65
|
-
{state?.error &&
|
|
66
|
-
|
|
67
|
-
{state.error}
|
|
68
|
-
</div>
|
|
69
|
-
)}
|
|
70
|
-
{state?.success && (
|
|
71
|
-
<div className="text-sm text-green-600">
|
|
72
|
-
{t('passwordUpdated')}
|
|
73
|
-
</div>
|
|
74
|
-
)}
|
|
63
|
+
{state?.error && <div className="text-sm text-destructive">{state.error}</div>}
|
|
64
|
+
{state?.success && <div className="text-sm text-green-600">{t('passwordUpdated')}</div>}
|
|
75
65
|
<Button type="submit" disabled={isPending}>
|
|
76
66
|
{isPending ? t('updating') : t('updatePassword')}
|
|
77
67
|
</Button>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useActionState, useEffect } from 'react';
|
|
4
|
-
import { requestEmailUpdateAction } from './actions';
|
|
5
3
|
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
6
5
|
import { Input } from '@/components/ui/input';
|
|
7
6
|
import { Label } from '@/components/ui/label';
|
|
8
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
9
7
|
import { useTranslations } from 'next-intl';
|
|
8
|
+
import { useActionState, useEffect } from 'react';
|
|
9
|
+
import { requestEmailUpdateAction } from './actions';
|
|
10
10
|
|
|
11
11
|
interface EditEmailFormProps {
|
|
12
12
|
currentEmail: string;
|
|
@@ -27,9 +27,7 @@ export function EditEmailForm({ currentEmail }: EditEmailFormProps) {
|
|
|
27
27
|
<Card>
|
|
28
28
|
<CardHeader>
|
|
29
29
|
<CardTitle>{t('emailAddress')}</CardTitle>
|
|
30
|
-
<CardDescription>
|
|
31
|
-
{t('updateEmailDescription')}
|
|
32
|
-
</CardDescription>
|
|
30
|
+
<CardDescription>{t('updateEmailDescription')}</CardDescription>
|
|
33
31
|
</CardHeader>
|
|
34
32
|
<form id="edit-email-form" action={formAction}>
|
|
35
33
|
<CardContent className="space-y-4">
|
|
@@ -64,19 +62,11 @@ export function EditEmailForm({ currentEmail }: EditEmailFormProps) {
|
|
|
64
62
|
required
|
|
65
63
|
disabled={isPending}
|
|
66
64
|
/>
|
|
67
|
-
<p className="text-xs text-muted-foreground">
|
|
68
|
-
{t('confirmPasswordChange')}
|
|
69
|
-
</p>
|
|
65
|
+
<p className="text-xs text-muted-foreground">{t('confirmPasswordChange')}</p>
|
|
70
66
|
</div>
|
|
71
|
-
{state?.error &&
|
|
72
|
-
<div className="text-sm text-destructive">
|
|
73
|
-
{state.error}
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
67
|
+
{state?.error && <div className="text-sm text-destructive">{state.error}</div>}
|
|
76
68
|
{state?.success && (
|
|
77
|
-
<div className="text-sm text-green-600">
|
|
78
|
-
{t('verificationEmailSent')}
|
|
79
|
-
</div>
|
|
69
|
+
<div className="text-sm text-green-600">{t('verificationEmailSent')}</div>
|
|
80
70
|
)}
|
|
81
71
|
<Button type="submit" disabled={isPending}>
|
|
82
72
|
{isPending ? t('updating') : t('updateEmail')}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useActionState, useEffect, useRef } from 'react';
|
|
4
|
-
import { updateCustomerAction } from './actions';
|
|
5
3
|
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
6
5
|
import { Input } from '@/components/ui/input';
|
|
7
6
|
import { Label } from '@/components/ui/label';
|
|
8
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
9
7
|
import { useTranslations } from 'next-intl';
|
|
8
|
+
import { useActionState, useEffect, useRef } from 'react';
|
|
9
|
+
import { updateCustomerAction } from './actions';
|
|
10
10
|
|
|
11
11
|
interface EditProfileFormProps {
|
|
12
12
|
customer: {
|
|
@@ -30,9 +30,7 @@ export function EditProfileForm({ customer }: EditProfileFormProps) {
|
|
|
30
30
|
<Card>
|
|
31
31
|
<CardHeader>
|
|
32
32
|
<CardTitle>{t('personalInformation')}</CardTitle>
|
|
33
|
-
<CardDescription>
|
|
34
|
-
{t('updatePersonalDetails')}
|
|
35
|
-
</CardDescription>
|
|
33
|
+
<CardDescription>{t('updatePersonalDetails')}</CardDescription>
|
|
36
34
|
</CardHeader>
|
|
37
35
|
<form ref={formRef} action={formAction}>
|
|
38
36
|
<CardContent className="space-y-4">
|
|
@@ -60,16 +58,8 @@ export function EditProfileForm({ customer }: EditProfileFormProps) {
|
|
|
60
58
|
disabled={isPending}
|
|
61
59
|
/>
|
|
62
60
|
</div>
|
|
63
|
-
{state?.error &&
|
|
64
|
-
|
|
65
|
-
{state.error}
|
|
66
|
-
</div>
|
|
67
|
-
)}
|
|
68
|
-
{state?.success && (
|
|
69
|
-
<div className="text-sm text-green-600">
|
|
70
|
-
{t('profileUpdated')}
|
|
71
|
-
</div>
|
|
72
|
-
)}
|
|
61
|
+
{state?.error && <div className="text-sm text-destructive">{state.error}</div>}
|
|
62
|
+
{state?.success && <div className="text-sm text-green-600">{t('profileUpdated')}</div>}
|
|
73
63
|
<Button type="submit" disabled={isPending}>
|
|
74
64
|
{isPending ? t('updating') : t('updateProfile')}
|
|
75
65
|
</Button>
|
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from '@/components/ui/card';
|
|
2
|
-
import {Skeleton} from '@/components/ui/skeleton';
|
|
1
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
2
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
3
3
|
|
|
4
4
|
export default function ProfileLoading() {
|
|
5
5
|
return (
|
|
6
6
|
<div className="space-y-6">
|
|
7
7
|
<div>
|
|
8
8
|
<h1 className="text-3xl font-bold">Profile</h1>
|
|
9
|
-
<p className="text-muted-foreground mt-2">
|
|
10
|
-
Manage your account information
|
|
11
|
-
</p>
|
|
9
|
+
<p className="text-muted-foreground mt-2">Manage your account information</p>
|
|
12
10
|
</div>
|
|
13
11
|
|
|
14
12
|
<Card>
|
|
15
13
|
<CardHeader>
|
|
16
14
|
<CardTitle>Account Information</CardTitle>
|
|
17
|
-
<CardDescription>
|
|
18
|
-
Your personal details
|
|
19
|
-
</CardDescription>
|
|
15
|
+
<CardDescription>Your personal details</CardDescription>
|
|
20
16
|
</CardHeader>
|
|
21
17
|
<CardContent className="space-y-4">
|
|
22
18
|
<div>
|
|
23
19
|
<p className="text-sm font-medium">Email</p>
|
|
24
|
-
<Skeleton className="h-4 w-48 mt-1"/>
|
|
20
|
+
<Skeleton className="h-4 w-48 mt-1" />
|
|
25
21
|
</div>
|
|
26
22
|
<div>
|
|
27
23
|
<p className="text-sm font-medium">Name</p>
|
|
28
|
-
<Skeleton className="h-4 w-32 mt-1"/>
|
|
24
|
+
<Skeleton className="h-4 w-32 mt-1" />
|
|
29
25
|
</div>
|
|
30
26
|
</CardContent>
|
|
31
27
|
</Card>
|
|
@@ -33,20 +29,18 @@ export default function ProfileLoading() {
|
|
|
33
29
|
<Card>
|
|
34
30
|
<CardHeader>
|
|
35
31
|
<CardTitle>Change Password</CardTitle>
|
|
36
|
-
<CardDescription>
|
|
37
|
-
Update your password
|
|
38
|
-
</CardDescription>
|
|
32
|
+
<CardDescription>Update your password</CardDescription>
|
|
39
33
|
</CardHeader>
|
|
40
34
|
<CardContent className="space-y-4">
|
|
41
35
|
<div className="space-y-2">
|
|
42
|
-
<Skeleton className="h-4 w-32"/>
|
|
43
|
-
<Skeleton className="h-10 w-full"/>
|
|
36
|
+
<Skeleton className="h-4 w-32" />
|
|
37
|
+
<Skeleton className="h-10 w-full" />
|
|
44
38
|
</div>
|
|
45
39
|
<div className="space-y-2">
|
|
46
|
-
<Skeleton className="h-4 w-32"/>
|
|
47
|
-
<Skeleton className="h-10 w-full"/>
|
|
40
|
+
<Skeleton className="h-4 w-32" />
|
|
41
|
+
<Skeleton className="h-10 w-full" />
|
|
48
42
|
</div>
|
|
49
|
-
<Skeleton className="h-10 w-32"/>
|
|
43
|
+
<Skeleton className="h-10 w-32" />
|
|
50
44
|
</CardContent>
|
|
51
45
|
</Card>
|
|
52
46
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {EditEmailForm} from './edit-email-form';
|
|
7
|
-
import {
|
|
1
|
+
import { getActiveCustomer } from '@/lib/vendure/actions';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
import { getTranslations } from 'next-intl/server';
|
|
4
|
+
import { Suspense } from 'react';
|
|
5
|
+
import { ChangePasswordForm } from './change-password-form';
|
|
6
|
+
import { EditEmailForm } from './edit-email-form';
|
|
7
|
+
import { EditProfileForm } from './edit-profile-form';
|
|
8
8
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
title: 'Profile',
|
|
@@ -17,9 +17,7 @@ async function ProfileContent() {
|
|
|
17
17
|
<div className="space-y-6">
|
|
18
18
|
<div>
|
|
19
19
|
<h1 className="text-3xl font-bold">{t('profile')}</h1>
|
|
20
|
-
<p className="text-muted-foreground mt-2">
|
|
21
|
-
{t('manageAccountInfo')}
|
|
22
|
-
</p>
|
|
20
|
+
<p className="text-muted-foreground mt-2">{t('manageAccountInfo')}</p>
|
|
23
21
|
</div>
|
|
24
22
|
|
|
25
23
|
<EditProfileForm customer={customer} />
|
|
@@ -33,11 +31,13 @@ async function ProfileContent() {
|
|
|
33
31
|
|
|
34
32
|
export default function ProfilePage() {
|
|
35
33
|
return (
|
|
36
|
-
<Suspense
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
<Suspense
|
|
35
|
+
fallback={
|
|
36
|
+
<div className="text-center py-12">
|
|
37
|
+
<p className="text-sm text-muted-foreground">Loading...</p>
|
|
38
|
+
</div>
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
41
|
<ProfileContent />
|
|
42
42
|
</Suspense>
|
|
43
43
|
);
|
|
@@ -133,12 +133,8 @@ export function FileUploadTab({ onValidate, isValidating }: FileUploadTabProps)
|
|
|
133
133
|
>
|
|
134
134
|
<Upload className="h-8 w-8 text-muted-foreground" />
|
|
135
135
|
<div className="text-center">
|
|
136
|
-
<p className="text-sm font-medium">
|
|
137
|
-
|
|
138
|
-
</p>
|
|
139
|
-
<p className="text-xs text-muted-foreground mt-1">
|
|
140
|
-
{t('supportedFormats')}
|
|
141
|
-
</p>
|
|
136
|
+
<p className="text-sm font-medium">{isDragging ? t('dropHere') : t('dragDrop')}</p>
|
|
137
|
+
<p className="text-xs text-muted-foreground mt-1">{t('supportedFormats')}</p>
|
|
142
138
|
</div>
|
|
143
139
|
</div>
|
|
144
140
|
)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from 'react';
|
|
2
1
|
import { Button } from '@/components/ui/button';
|
|
3
2
|
import { Input } from '@/components/ui/input';
|
|
4
3
|
import { Plus, X } from 'lucide-react';
|
|
5
4
|
import { useTranslations } from 'next-intl';
|
|
6
|
-
import {
|
|
5
|
+
import { useCallback, useRef, useState } from 'react';
|
|
7
6
|
import type { QuickOrderInput } from './actions';
|
|
7
|
+
import { SkuAutocomplete, type SearchResult } from './sku-autocomplete';
|
|
8
8
|
|
|
9
9
|
interface ManualRow {
|
|
10
10
|
id: string;
|
|
@@ -32,21 +32,24 @@ export function ManualEntryTab({ onValidate, isValidating }: ManualEntryTabProps
|
|
|
32
32
|
]);
|
|
33
33
|
|
|
34
34
|
const updateRow = useCallback((id: string, updates: Partial<ManualRow>) => {
|
|
35
|
-
setRows(prev => prev.map(r => r.id === id ? { ...r, ...updates } : r));
|
|
35
|
+
setRows((prev) => prev.map((r) => (r.id === id ? { ...r, ...updates } : r)));
|
|
36
36
|
}, []);
|
|
37
37
|
|
|
38
38
|
const removeRow = useCallback((id: string) => {
|
|
39
|
-
setRows(prev => prev.length > 1 ? prev.filter(r => r.id !== id) : prev);
|
|
39
|
+
setRows((prev) => (prev.length > 1 ? prev.filter((r) => r.id !== id) : prev));
|
|
40
40
|
}, []);
|
|
41
41
|
|
|
42
|
-
const handleSelect = useCallback(
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const handleSelect = useCallback(
|
|
43
|
+
(rowId: string, result: SearchResult) => {
|
|
44
|
+
updateRow(rowId, { sku: result.sku, variant: result });
|
|
45
|
+
},
|
|
46
|
+
[updateRow],
|
|
47
|
+
);
|
|
45
48
|
|
|
46
49
|
const handleValidate = () => {
|
|
47
50
|
const items = rows
|
|
48
|
-
.filter(r => r.sku.trim())
|
|
49
|
-
.map(r => ({ sku: r.sku.trim(), quantity: Math.max(1, r.quantity) }));
|
|
51
|
+
.filter((r) => r.sku.trim())
|
|
52
|
+
.map((r) => ({ sku: r.sku.trim(), quantity: Math.max(1, r.quantity) }));
|
|
50
53
|
if (items.length === 0) return;
|
|
51
54
|
onValidate({ items });
|
|
52
55
|
};
|
|
@@ -58,13 +61,13 @@ export function ManualEntryTab({ onValidate, isValidating }: ManualEntryTabProps
|
|
|
58
61
|
<div className="w-24">{t('table.qty')}</div>
|
|
59
62
|
<div className="w-9" />
|
|
60
63
|
</div>
|
|
61
|
-
{rows.map(row => (
|
|
64
|
+
{rows.map((row) => (
|
|
62
65
|
<div key={row.id} className="flex items-center gap-2">
|
|
63
66
|
<div className="flex-1">
|
|
64
67
|
<SkuAutocomplete
|
|
65
68
|
value={row.sku}
|
|
66
|
-
onChange={val => updateRow(row.id, { sku: val, variant: undefined })}
|
|
67
|
-
onSelect={result => handleSelect(row.id, result)}
|
|
69
|
+
onChange={(val) => updateRow(row.id, { sku: val, variant: undefined })}
|
|
70
|
+
onSelect={(result) => handleSelect(row.id, result)}
|
|
68
71
|
placeholder={t('manual.skuPlaceholder')}
|
|
69
72
|
/>
|
|
70
73
|
</div>
|
|
@@ -72,7 +75,7 @@ export function ManualEntryTab({ onValidate, isValidating }: ManualEntryTabProps
|
|
|
72
75
|
type="number"
|
|
73
76
|
min={1}
|
|
74
77
|
value={row.quantity}
|
|
75
|
-
onChange={e => updateRow(row.id, { quantity: parseInt(e.target.value) || 1 })}
|
|
78
|
+
onChange={(e) => updateRow(row.id, { quantity: parseInt(e.target.value) || 1 })}
|
|
76
79
|
className="w-24"
|
|
77
80
|
placeholder={t('manual.qtyPlaceholder')}
|
|
78
81
|
/>
|
|
@@ -93,7 +96,7 @@ export function ManualEntryTab({ onValidate, isValidating }: ManualEntryTabProps
|
|
|
93
96
|
type="button"
|
|
94
97
|
variant="outline"
|
|
95
98
|
size="sm"
|
|
96
|
-
onClick={() => setRows(prev => [...prev, createRow()])}
|
|
99
|
+
onClick={() => setRows((prev) => [...prev, createRow()])}
|
|
97
100
|
>
|
|
98
101
|
<Plus className="h-4 w-4 mr-1" />
|
|
99
102
|
{t('actions.addRow')}
|
|
@@ -102,7 +105,7 @@ export function ManualEntryTab({ onValidate, isValidating }: ManualEntryTabProps
|
|
|
102
105
|
type="button"
|
|
103
106
|
size="sm"
|
|
104
107
|
onClick={handleValidate}
|
|
105
|
-
disabled={isValidating || rows.every(r => !r.sku.trim())}
|
|
108
|
+
disabled={isValidating || rows.every((r) => !r.sku.trim())}
|
|
106
109
|
>
|
|
107
110
|
{t('actions.validate')}
|
|
108
111
|
</Button>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { getActiveCustomer } from '@/lib/vendure/actions';
|
|
3
1
|
import { redirect } from '@/i18n/navigation';
|
|
2
|
+
import { getActiveCustomer } from '@/lib/vendure/actions';
|
|
3
|
+
import type { Metadata } from 'next';
|
|
4
4
|
import { getTranslations } from 'next-intl/server';
|
|
5
5
|
import { QuickOrderForm } from './quick-order-form';
|
|
6
6
|
|
|
@@ -9,10 +9,7 @@ export const metadata: Metadata = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default async function QuickOrderPage() {
|
|
12
|
-
const [customer, t] = await Promise.all([
|
|
13
|
-
getActiveCustomer(),
|
|
14
|
-
getTranslations('QuickOrder'),
|
|
15
|
-
]);
|
|
12
|
+
const [customer, t] = await Promise.all([getActiveCustomer(), getTranslations('QuickOrder')]);
|
|
16
13
|
if (!customer) {
|
|
17
14
|
return await redirect('/sign-in');
|
|
18
15
|
}
|
|
@@ -136,14 +136,22 @@ export function PreviewTable({ items, parseErrors, onUpdateQuantity, onRemoveIte
|
|
|
136
136
|
</TableCell>
|
|
137
137
|
<TableCell className="text-right">
|
|
138
138
|
{item.unitPriceWithTax != null ? (
|
|
139
|
-
formatPrice(
|
|
139
|
+
formatPrice(
|
|
140
|
+
item.unitPriceWithTax,
|
|
141
|
+
locale,
|
|
142
|
+
item.currencyCode ?? undefined,
|
|
143
|
+
)
|
|
140
144
|
) : (
|
|
141
145
|
<span className="text-muted-foreground">—</span>
|
|
142
146
|
)}
|
|
143
147
|
</TableCell>
|
|
144
148
|
<TableCell className="text-right">
|
|
145
149
|
{item.lineTotalWithTax != null ? (
|
|
146
|
-
formatPrice(
|
|
150
|
+
formatPrice(
|
|
151
|
+
item.lineTotalWithTax,
|
|
152
|
+
locale,
|
|
153
|
+
item.currencyCode ?? undefined,
|
|
154
|
+
)
|
|
147
155
|
) : (
|
|
148
156
|
<span className="text-muted-foreground">—</span>
|
|
149
157
|
)}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getActiveUserShoppingLists } from '@/app/[locale]/account/shopping-lists/actions';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
2
3
|
import {
|
|
3
4
|
Dialog,
|
|
5
|
+
DialogClose,
|
|
4
6
|
DialogContent,
|
|
5
|
-
DialogHeader,
|
|
6
|
-
DialogTitle,
|
|
7
7
|
DialogDescription,
|
|
8
8
|
DialogFooter,
|
|
9
|
-
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
10
11
|
} from '@/components/ui/dialog';
|
|
11
|
-
import { Button } from '@/components/ui/button';
|
|
12
12
|
import { Input } from '@/components/ui/input';
|
|
13
13
|
import { Label } from '@/components/ui/label';
|
|
14
14
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
|
15
|
-
import { toast } from 'sonner';
|
|
16
15
|
import { useTranslations } from 'next-intl';
|
|
17
|
-
import {
|
|
16
|
+
import { useEffect, useState, useTransition } from 'react';
|
|
17
|
+
import { toast } from 'sonner';
|
|
18
18
|
import { saveToShoppingList } from './actions';
|
|
19
19
|
|
|
20
20
|
interface ShoppingList {
|
|
@@ -41,14 +41,16 @@ export function SaveToListDialog({ open, onOpenChange, validItems }: SaveToListD
|
|
|
41
41
|
if (!open) return;
|
|
42
42
|
setMode('new');
|
|
43
43
|
setSelectedListId('');
|
|
44
|
-
getActiveUserShoppingLists()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
getActiveUserShoppingLists()
|
|
45
|
+
.then((data) => {
|
|
46
|
+
if (data) {
|
|
47
|
+
setLists(data.map((l) => ({ id: l.id, name: l.name })));
|
|
48
|
+
if (data.length > 0) setSelectedListId(data[0].id);
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
.catch(() => {
|
|
52
|
+
setLists([]);
|
|
53
|
+
});
|
|
52
54
|
}, [open]);
|
|
53
55
|
|
|
54
56
|
const handleSave = () => {
|
|
@@ -82,9 +84,7 @@ export function SaveToListDialog({ open, onOpenChange, validItems }: SaveToListD
|
|
|
82
84
|
<DialogContent>
|
|
83
85
|
<DialogHeader>
|
|
84
86
|
<DialogTitle>{t('title')}</DialogTitle>
|
|
85
|
-
<DialogDescription>
|
|
86
|
-
{t('description', { count: validItems.length })}
|
|
87
|
-
</DialogDescription>
|
|
87
|
+
<DialogDescription>{t('description', { count: validItems.length })}</DialogDescription>
|
|
88
88
|
</DialogHeader>
|
|
89
89
|
<div className="space-y-4 py-2">
|
|
90
90
|
{lists.length > 0 && (
|
|
@@ -113,7 +113,7 @@ export function SaveToListDialog({ open, onOpenChange, validItems }: SaveToListD
|
|
|
113
113
|
<Input
|
|
114
114
|
id="list-name"
|
|
115
115
|
value={newListName}
|
|
116
|
-
onChange={e => setNewListName(e.target.value)}
|
|
116
|
+
onChange={(e) => setNewListName(e.target.value)}
|
|
117
117
|
placeholder={t('listNamePlaceholder')}
|
|
118
118
|
/>
|
|
119
119
|
</div>
|
|
@@ -125,7 +125,7 @@ export function SaveToListDialog({ open, onOpenChange, validItems }: SaveToListD
|
|
|
125
125
|
<SelectValue placeholder={t('selectListPlaceholder')} />
|
|
126
126
|
</SelectTrigger>
|
|
127
127
|
<SelectContent>
|
|
128
|
-
{lists.map(list => (
|
|
128
|
+
{lists.map((list) => (
|
|
129
129
|
<SelectItem key={list.id} value={list.id}>
|
|
130
130
|
{list.name}
|
|
131
131
|
</SelectItem>
|
|
@@ -137,13 +137,11 @@ export function SaveToListDialog({ open, onOpenChange, validItems }: SaveToListD
|
|
|
137
137
|
</div>
|
|
138
138
|
<DialogFooter>
|
|
139
139
|
<DialogClose asChild>
|
|
140
|
-
<Button type="button" variant="outline">
|
|
140
|
+
<Button type="button" variant="outline">
|
|
141
|
+
{t('cancel')}
|
|
142
|
+
</Button>
|
|
141
143
|
</DialogClose>
|
|
142
|
-
<Button
|
|
143
|
-
type="button"
|
|
144
|
-
onClick={handleSave}
|
|
145
|
-
disabled={isSaving || validItems.length === 0}
|
|
146
|
-
>
|
|
144
|
+
<Button type="button" onClick={handleSave} disabled={isSaving || validItems.length === 0}>
|
|
147
145
|
{isSaving ? t('saving') : t('save')}
|
|
148
146
|
</Button>
|
|
149
147
|
</DialogFooter>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Input } from '@/components/ui/input';
|
|
2
2
|
import type { ResultOf } from '@/graphql';
|
|
3
|
+
import { formatPrice } from '@/lib/format';
|
|
3
4
|
import type { QuickOrderSearchQuery } from '@/lib/vendure/queries';
|
|
4
|
-
import {
|
|
5
|
-
import { Search, Loader2 } from 'lucide-react';
|
|
5
|
+
import { Loader2, Search } from 'lucide-react';
|
|
6
6
|
import { useLocale, useTranslations } from 'next-intl';
|
|
7
|
+
import { useCallback, useEffect, useRef, useState, useTransition } from 'react';
|
|
7
8
|
import { searchQuickOrderProducts } from './actions';
|
|
8
|
-
import { formatPrice } from '@/lib/format';
|
|
9
9
|
|
|
10
10
|
export type SearchResult = ResultOf<typeof QuickOrderSearchQuery>['quickOrderSearch'][number];
|
|
11
11
|
|
|
@@ -77,8 +77,10 @@ export function SkuAutocomplete({ value, onChange, onSelect, placeholder }: SkuA
|
|
|
77
77
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
78
78
|
<Input
|
|
79
79
|
value={value}
|
|
80
|
-
onChange={e => handleChange(e.target.value)}
|
|
81
|
-
onKeyDown={e => {
|
|
80
|
+
onChange={(e) => handleChange(e.target.value)}
|
|
81
|
+
onKeyDown={(e) => {
|
|
82
|
+
if (e.key === 'Escape') setIsOpen(false);
|
|
83
|
+
}}
|
|
82
84
|
placeholder={placeholder ?? t('manual.skuPlaceholder')}
|
|
83
85
|
className="pl-10"
|
|
84
86
|
/>
|
|
@@ -88,7 +90,7 @@ export function SkuAutocomplete({ value, onChange, onSelect, placeholder }: SkuA
|
|
|
88
90
|
</div>
|
|
89
91
|
{isOpen && results.length > 0 && (
|
|
90
92
|
<div className="absolute z-10 mt-1 w-full rounded-lg border bg-background shadow-lg max-h-64 overflow-y-auto">
|
|
91
|
-
{results.map(item => (
|
|
93
|
+
{results.map((item) => (
|
|
92
94
|
<button
|
|
93
95
|
key={item.variantId}
|
|
94
96
|
type="button"
|
|
@@ -99,15 +101,22 @@ export function SkuAutocomplete({ value, onChange, onSelect, placeholder }: SkuA
|
|
|
99
101
|
<div className="flex items-center gap-1.5">
|
|
100
102
|
<p className="text-sm font-medium truncate">{item.productName}</p>
|
|
101
103
|
{item.variantName && item.variantName !== item.productName && (
|
|
102
|
-
<span className="text-xs text-muted-foreground">
|
|
104
|
+
<span className="text-xs text-muted-foreground">
|
|
105
|
+
({item.variantName})
|
|
106
|
+
</span>
|
|
103
107
|
)}
|
|
104
108
|
{!item.inStock && (
|
|
105
|
-
<span
|
|
109
|
+
<span
|
|
110
|
+
className={`shrink-0 text-[10px] font-medium px-1 py-0.5 rounded ${OUT_OF_STOCK_BADGE}`}
|
|
111
|
+
>
|
|
106
112
|
{t('status.outOfStock')}
|
|
107
113
|
</span>
|
|
108
114
|
)}
|
|
109
115
|
</div>
|
|
110
|
-
<p className="text-xs text-muted-foreground">
|
|
116
|
+
<p className="text-xs text-muted-foreground">
|
|
117
|
+
{item.sku} ·{' '}
|
|
118
|
+
{formatPrice(item.priceWithTax, locale, item.currencyCode)}
|
|
119
|
+
</p>
|
|
111
120
|
</div>
|
|
112
121
|
</button>
|
|
113
122
|
))}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
1
|
import { Button } from '@/components/ui/button';
|
|
3
2
|
import { Textarea } from '@/components/ui/textarea';
|
|
4
3
|
import { useTranslations } from 'next-intl';
|
|
4
|
+
import { useState } from 'react';
|
|
5
5
|
import type { QuickOrderInput } from './actions';
|
|
6
6
|
|
|
7
7
|
interface TextInputTabProps {
|
|
@@ -22,17 +22,12 @@ export function TextInputTab({ onValidate, isValidating }: TextInputTabProps) {
|
|
|
22
22
|
<div className="space-y-3">
|
|
23
23
|
<Textarea
|
|
24
24
|
value={text}
|
|
25
|
-
onChange={e => setText(e.target.value)}
|
|
25
|
+
onChange={(e) => setText(e.target.value)}
|
|
26
26
|
placeholder={t('textInput.placeholder')}
|
|
27
27
|
rows={10}
|
|
28
28
|
className="font-mono text-sm"
|
|
29
29
|
/>
|
|
30
|
-
<Button
|
|
31
|
-
type="button"
|
|
32
|
-
size="sm"
|
|
33
|
-
onClick={handleValidate}
|
|
34
|
-
disabled={isValidating || !text.trim()}
|
|
35
|
-
>
|
|
30
|
+
<Button type="button" size="sm" onClick={handleValidate} disabled={isValidating || !text.trim()}>
|
|
36
31
|
{t('actions.validate')}
|
|
37
32
|
</Button>
|
|
38
33
|
</div>
|