@vendure-platform/create 0.5.0 → 0.5.2
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/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 +64 -38
- 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]/add-item-search.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +31 -15
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +52 -33
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +22 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +34 -13
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +117 -72
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +21 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +10 -10
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +54 -41
- 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 +50 -32
- 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 +43 -18
- 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 +49 -27
- 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 +118 -74
- 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-status-badge.tsx +12 -8
- 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.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 +36 -23
- 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/queries.ts +15 -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/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/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,73 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
4
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { toggleVariants } from '@/components/ui/toggle';
|
|
8
|
+
import { cn } from '@/lib/utils';
|
|
9
9
|
|
|
10
|
-
const ToggleGroupContext = React.createContext<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
variant: "default",
|
|
15
|
-
})
|
|
10
|
+
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
|
|
11
|
+
size: 'default',
|
|
12
|
+
variant: 'default',
|
|
13
|
+
});
|
|
16
14
|
|
|
17
15
|
function ToggleGroup({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</ToggleGroupContext.Provider>
|
|
39
|
-
</ToggleGroupPrimitive.Root>
|
|
40
|
-
)
|
|
16
|
+
className,
|
|
17
|
+
variant,
|
|
18
|
+
size,
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
22
|
+
return (
|
|
23
|
+
<ToggleGroupPrimitive.Root
|
|
24
|
+
data-slot="toggle-group"
|
|
25
|
+
data-variant={variant}
|
|
26
|
+
data-size={size}
|
|
27
|
+
className={cn(
|
|
28
|
+
'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
|
|
34
|
+
</ToggleGroupPrimitive.Root>
|
|
35
|
+
);
|
|
41
36
|
}
|
|
42
37
|
|
|
43
38
|
function ToggleGroupItem({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
50
|
-
|
|
51
|
-
const context = React.useContext(ToggleGroupContext)
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
variant,
|
|
42
|
+
size,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
|
|
45
|
+
const context = React.useContext(ToggleGroupContext);
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
return (
|
|
48
|
+
<ToggleGroupPrimitive.Item
|
|
49
|
+
data-slot="toggle-group-item"
|
|
50
|
+
data-variant={context.variant || variant}
|
|
51
|
+
data-size={context.size || size}
|
|
52
|
+
className={cn(
|
|
53
|
+
toggleVariants({
|
|
54
|
+
variant: context.variant || variant,
|
|
55
|
+
size: context.size || size,
|
|
56
|
+
}),
|
|
57
|
+
'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</ToggleGroupPrimitive.Item>
|
|
64
|
+
);
|
|
71
65
|
}
|
|
72
66
|
|
|
73
|
-
export { ToggleGroup, ToggleGroupItem }
|
|
67
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
8
|
|
|
9
9
|
const toggleVariants = cva(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: 'bg-transparent',
|
|
15
|
+
outline:
|
|
16
|
+
'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: 'h-9 px-2 min-w-9',
|
|
20
|
+
sm: 'h-8 px-1.5 min-w-8',
|
|
21
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: 'default',
|
|
26
|
+
size: 'default',
|
|
27
|
+
},
|
|
23
28
|
},
|
|
24
|
-
|
|
25
|
-
variant: "default",
|
|
26
|
-
size: "default",
|
|
27
|
-
},
|
|
28
|
-
}
|
|
29
|
-
)
|
|
29
|
+
);
|
|
30
30
|
|
|
31
31
|
function Toggle({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
32
|
+
className,
|
|
33
|
+
variant,
|
|
34
|
+
size,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
37
|
+
return (
|
|
38
|
+
<TogglePrimitive.Root
|
|
39
|
+
data-slot="toggle"
|
|
40
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
export { Toggle, toggleVariants }
|
|
46
|
+
export { Toggle, toggleVariants };
|
|
@@ -1,61 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
7
|
|
|
8
8
|
function TooltipProvider({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
delayDuration = 0,
|
|
10
|
+
...props
|
|
11
11
|
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
delayDuration={delayDuration}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
12
|
+
return (
|
|
13
|
+
<TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props} />
|
|
14
|
+
);
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
function Tooltip({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</TooltipProvider>
|
|
28
|
-
)
|
|
17
|
+
function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
18
|
+
return (
|
|
19
|
+
<TooltipProvider>
|
|
20
|
+
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
21
|
+
</TooltipProvider>
|
|
22
|
+
);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
function TooltipTrigger({
|
|
32
|
-
|
|
33
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
34
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
25
|
+
function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
26
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
35
27
|
}
|
|
36
28
|
|
|
37
29
|
function TooltipContent({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
className,
|
|
31
|
+
sideOffset = 0,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
42
34
|
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
return (
|
|
36
|
+
<TooltipPrimitive.Portal>
|
|
37
|
+
<TooltipPrimitive.Content
|
|
38
|
+
data-slot="tooltip-content"
|
|
39
|
+
sideOffset={sideOffset}
|
|
40
|
+
className={cn(
|
|
41
|
+
'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
48
|
+
</TooltipPrimitive.Content>
|
|
49
|
+
</TooltipPrimitive.Portal>
|
|
50
|
+
);
|
|
59
51
|
}
|
|
60
52
|
|
|
61
|
-
export { Tooltip,
|
|
53
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { ConfiguratorSystem, ProductDetail } from '@/lib/vendure/queries';
|
|
3
1
|
import type { ShoppingListInfo } from '@/app/[locale]/account/shopping-lists/actions';
|
|
2
|
+
import type { ProductImageCarouselProps } from '@/components/commerce/product-image-carousel';
|
|
4
3
|
import type { ProductInfoProps } from '@/components/commerce/product-info';
|
|
5
4
|
import type { ProductSidebarProps } from '@/components/commerce/product-sidebar';
|
|
6
|
-
import type { ProductImageCarouselProps } from '@/components/commerce/product-image-carousel';
|
|
7
5
|
import type { RelatedProductsProps } from '@/components/commerce/related-products';
|
|
8
6
|
import type { ShopByCategoryProps } from '@/components/commerce/shop-by-category';
|
|
7
|
+
import type { ConfiguratorSystem, ProductDetail } from '@/lib/vendure/queries';
|
|
9
8
|
import { customerScenario } from '@/scenarios/customer';
|
|
9
|
+
import type { ReactElement } from 'react';
|
|
10
10
|
|
|
11
11
|
// =============================================================
|
|
12
12
|
// Branding — pure serializable data (no React components)
|
|
@@ -197,16 +197,12 @@ export interface ScenarioConfig {
|
|
|
197
197
|
* component returning a slot map), this guard breaks. Only add object-valued
|
|
198
198
|
* variants to the override unions.
|
|
199
199
|
*/
|
|
200
|
-
export function isFullPageOverride(
|
|
201
|
-
override: unknown,
|
|
202
|
-
): override is (...args: unknown[]) => unknown {
|
|
200
|
+
export function isFullPageOverride(override: unknown): override is (...args: unknown[]) => unknown {
|
|
203
201
|
return typeof override === 'function';
|
|
204
202
|
}
|
|
205
203
|
|
|
206
204
|
/** Type guard: is the override a conditional `{ shouldApply, component }` form? */
|
|
207
|
-
export function isConditionalPdpOverride(
|
|
208
|
-
override: unknown,
|
|
209
|
-
): override is ConditionalPdpOverride {
|
|
205
|
+
export function isConditionalPdpOverride(override: unknown): override is ConditionalPdpOverride {
|
|
210
206
|
return (
|
|
211
207
|
typeof override === 'object' &&
|
|
212
208
|
override !== null &&
|
|
@@ -233,7 +229,7 @@ export function getScenarioConfig(): ScenarioConfig {
|
|
|
233
229
|
if (!registry[scenario]) {
|
|
234
230
|
console.warn(
|
|
235
231
|
`[scenario] Unknown scenario "${scenario}" — falling back to "customer". ` +
|
|
236
|
-
|
|
232
|
+
`Did you register it in scenario.ts?`,
|
|
237
233
|
);
|
|
238
234
|
}
|
|
239
235
|
_cached = registry[scenario] ?? registry.customer;
|
|
@@ -250,12 +246,14 @@ export function getChannelsConfig(): ChannelsConfig | undefined {
|
|
|
250
246
|
|
|
251
247
|
const _brandingStyleTag = (() => {
|
|
252
248
|
const { colors, fonts } = getBranding();
|
|
253
|
-
const darkVars =
|
|
254
|
-
.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
.
|
|
249
|
+
const darkVars =
|
|
250
|
+
Object.entries(colors.dark)
|
|
251
|
+
.map(([k, v]) => `${k}: ${v}`)
|
|
252
|
+
.join('; ') + ';';
|
|
253
|
+
const lightVars =
|
|
254
|
+
Object.entries(colors.light)
|
|
255
|
+
.map(([k, v]) => `${k}: ${v}`)
|
|
256
|
+
.join('; ') + ';';
|
|
259
257
|
|
|
260
258
|
let base = `:root { ${darkVars} } .light { ${lightVars} }`;
|
|
261
259
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { ResultOf } from '@/graphql';
|
|
4
|
+
import { ActiveCustomerFragment } from '@/lib/vendure/fragments';
|
|
5
|
+
import { createContext, ReactNode, useContext } from 'react';
|
|
6
6
|
|
|
7
7
|
type ActiveCustomer = ResultOf<typeof ActiveCustomerFragment>;
|
|
8
8
|
|
|
@@ -17,10 +17,9 @@ interface AuthProviderProps {
|
|
|
17
17
|
initialActiveCustomerPromise: Promise<ActiveCustomer | null>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function AuthProvider({children, initialActiveCustomerPromise}: AuthProviderProps) {
|
|
21
|
-
|
|
20
|
+
export function AuthProvider({ children, initialActiveCustomerPromise }: AuthProviderProps) {
|
|
22
21
|
return (
|
|
23
|
-
<AuthContext.Provider value={{activeCustomer: initialActiveCustomerPromise}}>
|
|
22
|
+
<AuthContext.Provider value={{ activeCustomer: initialActiveCustomerPromise }}>
|
|
24
23
|
{children}
|
|
25
24
|
</AuthContext.Provider>
|
|
26
25
|
);
|
|
@@ -4,11 +4,11 @@ import type { introspection } from './graphql-env.d.ts';
|
|
|
4
4
|
export const graphql = initGraphQLTada<{
|
|
5
5
|
introspection: introspection;
|
|
6
6
|
scalars: {
|
|
7
|
-
DateTime: string
|
|
8
|
-
JSON: Record<string, unknown
|
|
9
|
-
Money: number
|
|
10
|
-
}
|
|
7
|
+
DateTime: string;
|
|
8
|
+
JSON: Record<string, unknown>;
|
|
9
|
+
Money: number;
|
|
10
|
+
};
|
|
11
11
|
}>();
|
|
12
12
|
|
|
13
|
+
export { readFragment } from 'gql.tada';
|
|
13
14
|
export type { FragmentOf, ResultOf, VariablesOf } from 'gql.tada';
|
|
14
|
-
export { readFragment } from 'gql.tada';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
const MOBILE_BREAKPOINT = 768
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
4
|
|
|
5
5
|
export function useIsMobile() {
|
|
6
|
-
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
10
|
+
const onChange = () => {
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
};
|
|
13
|
+
mql.addEventListener('change', onChange);
|
|
14
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
15
|
+
return () => mql.removeEventListener('change', onChange);
|
|
16
|
+
}, []);
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
return !!isMobile;
|
|
19
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {routing, type Locale} from './routing';
|
|
1
|
+
import { routing, type Locale } from './routing';
|
|
2
2
|
|
|
3
|
-
const INTL_LOCALE_MAP: Record<Locale, string> = {en: 'en-US', de: 'de-DE'};
|
|
4
|
-
const OG_LOCALE_MAP: Record<Locale, string> = {en: 'en_US', de: 'de_DE'};
|
|
3
|
+
const INTL_LOCALE_MAP: Record<Locale, string> = { en: 'en-US', de: 'de-DE' };
|
|
4
|
+
const OG_LOCALE_MAP: Record<Locale, string> = { en: 'en_US', de: 'de_DE' };
|
|
5
5
|
|
|
6
6
|
/** Map a routing locale to a full BCP-47 tag for Intl APIs. Falls back to the raw locale. */
|
|
7
7
|
export function toIntlLocale(locale: string): string {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {createNavigation} from 'next-intl/navigation';
|
|
2
|
-
import {routing} from './routing';
|
|
1
|
+
import { createNavigation } from 'next-intl/navigation';
|
|
2
|
+
import { routing } from './routing';
|
|
3
3
|
|
|
4
4
|
const nav = createNavigation(routing);
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ export const getPathname = nav.getPathname;
|
|
|
29
29
|
* bundling since this module also exports Link).
|
|
30
30
|
*/
|
|
31
31
|
export async function redirect(pathname: string, type?: 'push' | 'replace'): Promise<never> {
|
|
32
|
-
const {getLocale} = await import('next-intl/server');
|
|
32
|
+
const { getLocale } = await import('next-intl/server');
|
|
33
33
|
const locale = await getLocale();
|
|
34
|
-
return nav.redirect({href: pathname, locale}, type);
|
|
34
|
+
return nav.redirect({ href: pathname, locale }, type);
|
|
35
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {hasLocale} from 'next-intl';
|
|
2
|
-
import {getRequestConfig} from 'next-intl/server';
|
|
3
|
-
import {routing} from './routing';
|
|
1
|
+
import { hasLocale } from 'next-intl';
|
|
2
|
+
import { getRequestConfig } from 'next-intl/server';
|
|
3
|
+
import { routing } from './routing';
|
|
4
4
|
|
|
5
5
|
// Static per-locale imports. When adding a new locale to routing.locales,
|
|
6
6
|
// add a corresponding entry here.
|
|
@@ -9,7 +9,7 @@ const messageImports = {
|
|
|
9
9
|
de: () => import('../../messages/de.json'),
|
|
10
10
|
} as const;
|
|
11
11
|
|
|
12
|
-
export default getRequestConfig(async ({requestLocale}) => {
|
|
12
|
+
export default getRequestConfig(async ({ requestLocale }) => {
|
|
13
13
|
const requested = await requestLocale;
|
|
14
14
|
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale;
|
|
15
15
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {LOCALES, type Locale, localeNames} from './locales';
|
|
1
|
+
import { getScenarioMeta } from '@/config/scenario-meta';
|
|
2
|
+
import { defineRouting } from 'next-intl/routing';
|
|
3
|
+
import { LOCALES, type Locale, localeNames } from './locales';
|
|
4
4
|
|
|
5
5
|
// Scenarios declare their preferred default locale in their own
|
|
6
6
|
// `meta.ts` (a client-safe projection that never imports React or
|
|
@@ -15,5 +15,5 @@ export const routing = defineRouting({
|
|
|
15
15
|
defaultLocale: scenarioDefaultLocale,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
export
|
|
19
|
-
export {
|
|
18
|
+
export { localeNames };
|
|
19
|
+
export type { Locale };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {routing, type Locale} from './routing';
|
|
1
|
+
import { hasLocale } from 'next-intl';
|
|
2
|
+
import { getLocale } from 'next-intl/server';
|
|
3
|
+
import { routing, type Locale } from './routing';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Resolve the current locale from request context with validation.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { getChannelsConfig } from '@/config/scenario';
|
|
4
|
+
import { CHANNEL_COOKIE } from '@/lib/channel';
|
|
5
|
+
import { CURRENCY_COOKIE } from '@/lib/currency';
|
|
6
|
+
import { revalidatePath } from 'next/cache';
|
|
7
|
+
import { cookies } from 'next/headers';
|
|
8
8
|
|
|
9
9
|
export async function switchChannel(token: string) {
|
|
10
10
|
const channelsConfig = getChannelsConfig();
|
|
11
11
|
if (!channelsConfig) {
|
|
12
|
-
return {success: false, message: 'Channel switching not configured'};
|
|
12
|
+
return { success: false, message: 'Channel switching not configured' };
|
|
13
13
|
}
|
|
14
|
-
if (!channelsConfig.available.some(c => c.token === token)) {
|
|
15
|
-
return {success: false, message: 'Invalid channel token'};
|
|
14
|
+
if (!channelsConfig.available.some((c) => c.token === token)) {
|
|
15
|
+
return { success: false, message: 'Invalid channel token' };
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const jar = await cookies();
|
|
@@ -28,5 +28,5 @@ export async function switchChannel(token: string) {
|
|
|
28
28
|
jar.delete(CURRENCY_COOKIE);
|
|
29
29
|
|
|
30
30
|
revalidatePath('/', 'layout');
|
|
31
|
-
return {success: true};
|
|
31
|
+
return { success: true };
|
|
32
32
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { CURRENCY_COOKIE } from '@/lib/currency';
|
|
4
|
+
import { getActiveChannelCached } from '@/lib/vendure/cached';
|
|
5
|
+
import { revalidatePath } from 'next/cache';
|
|
6
|
+
import { cookies } from 'next/headers';
|
|
7
7
|
|
|
8
8
|
export async function switchCurrency(currencyCode: string) {
|
|
9
|
-
const {getActiveChannelToken} = await import('@/lib/channel-server');
|
|
9
|
+
const { getActiveChannelToken } = await import('@/lib/channel-server');
|
|
10
10
|
const channelToken = await getActiveChannelToken();
|
|
11
11
|
const channel = await getActiveChannelCached(channelToken);
|
|
12
12
|
if (!channel.availableCurrencyCodes.includes(currencyCode as never)) {
|
|
13
|
-
return {success: false, message: 'Invalid currency code'};
|
|
13
|
+
return { success: false, message: 'Invalid currency code' };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const jar = await cookies();
|
|
@@ -21,5 +21,5 @@ export async function switchCurrency(currencyCode: string) {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
revalidatePath('/', 'layout');
|
|
24
|
-
return {success: true};
|
|
24
|
+
return { success: true };
|
|
25
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {cacheLife} from 'next/cache';
|
|
1
|
+
import { cacheLife } from 'next/cache';
|
|
2
2
|
|
|
3
3
|
const HEALTH_CHECK_TIMEOUT_MS = 3000;
|
|
4
4
|
|
|
@@ -25,8 +25,8 @@ export async function isBackendReachable(): Promise<boolean> {
|
|
|
25
25
|
try {
|
|
26
26
|
const res = await fetch(apiUrl, {
|
|
27
27
|
method: 'POST',
|
|
28
|
-
headers: {'Content-Type': 'application/json'},
|
|
29
|
-
body: JSON.stringify({query: '{ __typename }'}),
|
|
28
|
+
headers: { 'Content-Type': 'application/json' },
|
|
29
|
+
body: JSON.stringify({ query: '{ __typename }' }),
|
|
30
30
|
signal: controller.signal,
|
|
31
31
|
});
|
|
32
32
|
return res.ok;
|