@sonic-equipment/ui 239.0.0 → 240.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/display/details/details.d.ts +7 -0
- package/dist/display/details/details.js +11 -0
- package/dist/display/details/details.module.css.js +3 -0
- package/dist/exports.d.ts +1 -0
- package/dist/header/buttons/account/connected-account-button.js +3 -1
- package/dist/icons/glyph/glyphs-chevrons-bold-right-icon.js +8 -0
- package/dist/index.js +1 -0
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/navigation/quick-access-menu/quick-access-menu.js +4 -1
- package/dist/pages/error-page/error-page.d.ts +2 -1
- package/dist/pages/error-page/error-page.js +2 -2
- package/dist/pages/my-sonic/actions/create-ship-to-address/connected-create-ship-to-address-form.js +1 -2
- package/dist/pages/my-sonic/actions/edit-bill-to-address/connected-edit-bill-to-address-form.js +1 -2
- package/dist/pages/my-sonic/actions/edit-ship-to-address/connected-edit-ship-to-address-form.js +1 -2
- package/dist/pages/my-sonic/pages/favorites/favorites-page.js +2 -2
- package/dist/pages/my-sonic/pages/order-details/order-details-content.js +1 -1
- package/dist/pages/my-sonic/pages/order-details/order-details-page.js +5 -5
- package/dist/pages/my-sonic/pages/order-history/order-history-page.js +2 -2
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out-mutation.d.ts +6 -2
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out-mutation.js +1 -1
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.d.ts +3 -1
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +4 -2
- package/dist/shared/error/basic-error-view.js +3 -10
- package/dist/shared/error/basic-error-view.module.css.js +3 -0
- package/dist/shared/error/default-error-view.d.ts +1 -1
- package/dist/shared/error/default-error-view.js +10 -28
- package/dist/shared/error/default-error-view.module.css.js +3 -0
- package/dist/shared/error/types.d.ts +3 -0
- package/dist/styles.css +170 -2
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { GlyphsChevronsBoldRightIcon } from '../../icons/glyph/glyphs-chevrons-bold-right-icon.js';
|
|
5
|
+
import styles from './details.module.css.js';
|
|
6
|
+
|
|
7
|
+
function Details({ children, className, lang, summary }) {
|
|
8
|
+
return (jsxs("details", { className: clsx(styles['details'], className), lang: lang, children: [jsxs("summary", { className: styles['summary'], children: [jsx(GlyphsChevronsBoldRightIcon, { className: styles['arrow'], role: "presentation" }), summary] }), jsx("div", { className: styles['content'], children: children })] }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Details };
|
package/dist/exports.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export * from './country-selector/country-selector-dialog/country-selector-dialo
|
|
|
89
89
|
export * from './country-selector/country-selector-trigger/country-selector-trigger';
|
|
90
90
|
export * from './country-selector/use-countries-languages';
|
|
91
91
|
export * from './delivery-time/delivery-time';
|
|
92
|
+
export * from './display/details/details';
|
|
92
93
|
export * from './display/info-display/info-display';
|
|
93
94
|
export * from './display/price/price';
|
|
94
95
|
export * from './display/product-sku/product-sku';
|
|
@@ -23,7 +23,9 @@ function ConnectedAccountButton({ className, 'data-test-selector': dataTestSelec
|
|
|
23
23
|
const lastName = data?.lastName ? data.lastName.trim() : undefined;
|
|
24
24
|
const customerName = firstName ? [firstName, lastName].join(' ') : undefined;
|
|
25
25
|
const customerCompany = data?.billTo?.companyName;
|
|
26
|
-
return (jsxs(Fragment, { children: [jsx(IconButton, { ref: triggerRef, className: className, "data-authenticated": data?.isAuthenticated ? true : false, "data-test-selector": dataTestSelector, isDisabled: isLoadingSession, onClick: toggle, children: jsx(AccountIcon, { "aria-label": t('My Sonic'), isAuthenticated: data?.isAuthenticated }) }), jsx(Popover, { className: styles['popover'], isOpen: isOpen, onOpenChange: state => (state ? open() : close()), placement: "bottom", triggerRef: triggerRef, children: jsx(QuickAccessMenu, { className: styles['quick-access-menu'], customerCompany: customerCompany, customerName: customerName, isAuthenticated: data?.isAuthenticated, isGuest: data?.isGuest, onSignOut: signOut
|
|
26
|
+
return (jsxs(Fragment, { children: [jsx(IconButton, { ref: triggerRef, className: className, "data-authenticated": data?.isAuthenticated ? true : false, "data-test-selector": dataTestSelector, isDisabled: isLoadingSession, onClick: toggle, children: jsx(AccountIcon, { "aria-label": t('My Sonic'), isAuthenticated: data?.isAuthenticated }) }), jsx(Popover, { className: styles['popover'], isOpen: isOpen, onOpenChange: state => (state ? open() : close()), placement: "bottom", triggerRef: triggerRef, children: jsx(QuickAccessMenu, { className: styles['quick-access-menu'], customerCompany: customerCompany, customerName: customerName, isAuthenticated: data?.isAuthenticated, isGuest: data?.isGuest, onSignOut: () => signOut(typeof window === 'undefined'
|
|
27
|
+
? undefined
|
|
28
|
+
: { returnUrl: window.location.href }) }) })] }));
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export { ConnectedAccountButton };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function GlyphsChevronsBoldRightIcon(props) {
|
|
5
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "12", viewBox: "0 0 12 12", width: "12", children: jsx("path", { d: "M10,5.98800959 L4.97931034,1 C4.65747126,1.17585931 4.2954023,1.4636291 3.89310345,1.86330935 C3.71609195,2.03916867 3.55517241,2.21502798 3.41034483,2.39088729 L3.25972414,2.58273381 C3.196,2.66906475 3.14965517,2.74100719 3.12068966,2.79856115 L3.02413793,2.94244604 L6.08965517,5.98800959 L3,9.05755396 C3.19310345,9.39328537 3.48275862,9.7529976 3.86896552,10.1366906 C4.04597701,10.31255 4.22298851,10.4724221 4.4,10.616307 L4.67517241,10.8321343 L4.81034483,10.9280576 L4.95517241,11 L10,5.98800959 Z", fillRule: "evenodd" }) }));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { GlyphsChevronsBoldRightIcon };
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,7 @@ export { CountrySelectorDialog } from './country-selector/country-selector-dialo
|
|
|
92
92
|
export { CountrySelectorTrigger } from './country-selector/country-selector-trigger/country-selector-trigger.js';
|
|
93
93
|
export { useCountriesLanguages } from './country-selector/use-countries-languages.js';
|
|
94
94
|
export { DeliveryTime } from './delivery-time/delivery-time.js';
|
|
95
|
+
export { Details } from './display/details/details.js';
|
|
95
96
|
export { InfoDisplay } from './display/info-display/info-display.js';
|
|
96
97
|
export { Price } from './display/price/price.js';
|
|
97
98
|
export { ProductSku } from './display/product-sku/product-sku.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'Account was activated successfully.' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing password…' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Column 1: Item number or customer part number' | 'Column 2: Quantity (optional)' | 'Column 3: Unit of measure (optional)' | 'Company name' | 'Conceal value' | 'Confirm new password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'Create a row for each product. The allowed maximum is 500 rows' | 'Create account' | 'Create new list' | 'Create or modify a spreadsheet' | 'Currency Change' | 'Current page' | 'Current password' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Download spreadsheet template' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Good day' | 'Good morning' | 'Good afternoon' | 'Good evening' | 'Goodnight' | 'Guest' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Instructions' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make sure the spreadsheet has 3 columns' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'My Sonic menu' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'No search results' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order details' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please contact Customer Support if you need assistance.' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Reordering...' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Save the file in XLS, XLSX or CSV format' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Select the file to upload in the form and click Upload order' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'Sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The link you used for resetting your password is invalid. Please, reset your password again, or contact Customer Support.' | 'The password could not be changed. Please, reset your password again, or contact Customer Support.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'The option to upload an Excel file with your order is temporarily unavailable.' | 'The order has been added to your cart.' | 'The user to change the password for could not be found. Please, reset your password again, or contact Customer Support.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the order to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Upload order' | 'Upload an Excel (XLS/XLSX) spreadsheet or CSV file to quickly add items to your cart.' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You are required to change your password and then sign in again, using your new credentials.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have no favorite products yet.' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your account is temporarily locked. Please try again later or contact Customer Support.' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'Account was activated successfully.' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing password…' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Column 1: Item number or customer part number' | 'Column 2: Quantity (optional)' | 'Column 3: Unit of measure (optional)' | 'Company name' | 'Conceal value' | 'Confirm new password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'Create a row for each product. The allowed maximum is 500 rows' | 'Create account' | 'Create new list' | 'Create or modify a spreadsheet' | 'Currency Change' | 'Current page' | 'Current password' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Download spreadsheet template' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Good day' | 'Good morning' | 'Good afternoon' | 'Good evening' | 'Goodnight' | 'Guest' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Instructions' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make sure the spreadsheet has 3 columns' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'My Sonic menu' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'No search results' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order details' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Page not found.' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please contact Customer Support if you need assistance.' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Reset' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Reordering...' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Save the file in XLS, XLSX or CSV format' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Select the file to upload in the form and click Upload order' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'Sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Something went wrong' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The link you used for resetting your password is invalid. Please, reset your password again, or contact Customer Support.' | 'The password could not be changed. Please, reset your password again, or contact Customer Support.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'The option to upload an Excel file with your order is temporarily unavailable.' | 'The order has been added to your cart.' | 'The user to change the password for could not be found. Please, reset your password again, or contact Customer Support.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the order to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Upload order' | 'Upload an Excel (XLS/XLSX) spreadsheet or CSV file to quickly add items to your cart.' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You are required to change your password and then sign in again, using your new credentials.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have no favorite products yet.' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your account is temporarily locked. Please try again later or contact Customer Support.' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
@@ -15,7 +15,10 @@ function QuickAccessMenu({ className, customerCompany, customerName, isAuthentic
|
|
|
15
15
|
const paths = usePaths();
|
|
16
16
|
const greeting = useGreeting();
|
|
17
17
|
const links = useMySonicNavigationItems().filter(item => isMySonicNavigationLink(item));
|
|
18
|
-
return (jsxs("section", { "aria-label": t('My Sonic menu'), className: clsx(styles['quick-access-menu'], className), "data-test-selector": "quickAccessMenu", children: [jsxs("header", { className: styles['header'], children: [jsx("h2", { className: styles['title'], "data-test-selector": "quickAccessMenuTitle", children: `${greeting}${customerName || customerCompany ? ',' : ''}` }), !isGuest && customerName && (jsx(Truncated, { className: styles['name'], "data-test-selector": "quickAccessMenuCustomerName", lines: 2, children: customerName })), !isGuest && customerCompany && (jsx(Truncated, { className: styles['company'], "data-test-selector": "quickAccessMenuCustomerCompany", lines: 2, children: customerCompany })), isGuest && t('Guest')] }), !isGuest && isAuthenticated && (jsx("nav", { className: styles['navigation'], children: jsx("ul", { children: links.map(link => (jsx("li", { className: styles['item'], children: jsx(Link, { className: styles['link'], "data-test-selector": link['data-test-selector'], href: link.path, children: t(link.label) }) }, link.path))) }) })), jsxs("div", { className: styles['actions'], children: [isAuthenticated && (jsx(Button, { withArrow: true, "data-test-selector": "logoutButton", onClick: onSignOut, size: "sm", children: t('Log out') })), !isAuthenticated && (jsxs(Fragment, { children: [jsx(Button, { withArrow: true, "data-test-selector": "signInButton", href: paths.SIGN_IN
|
|
18
|
+
return (jsxs("section", { "aria-label": t('My Sonic menu'), className: clsx(styles['quick-access-menu'], className), "data-test-selector": "quickAccessMenu", children: [jsxs("header", { className: styles['header'], children: [jsx("h2", { className: styles['title'], "data-test-selector": "quickAccessMenuTitle", children: `${greeting}${customerName || customerCompany ? ',' : ''}` }), !isGuest && customerName && (jsx(Truncated, { className: styles['name'], "data-test-selector": "quickAccessMenuCustomerName", lines: 2, children: customerName })), !isGuest && customerCompany && (jsx(Truncated, { className: styles['company'], "data-test-selector": "quickAccessMenuCustomerCompany", lines: 2, children: customerCompany })), isGuest && t('Guest')] }), !isGuest && isAuthenticated && (jsx("nav", { className: styles['navigation'], children: jsx("ul", { children: links.map(link => (jsx("li", { className: styles['item'], children: jsx(Link, { className: styles['link'], "data-test-selector": link['data-test-selector'], href: link.path, children: t(link.label) }) }, link.path))) }) })), jsxs("div", { className: styles['actions'], children: [isAuthenticated && (jsx(Button, { withArrow: true, "data-test-selector": "logoutButton", onClick: onSignOut, size: "sm", children: t('Log out') })), !isAuthenticated && (jsxs(Fragment, { children: [jsx(Button, { withArrow: true, "data-test-selector": "signInButton", href: `${paths.SIGN_IN}${typeof window === 'undefined'
|
|
19
|
+
? ''
|
|
20
|
+
: // eslint-disable-next-line ssr-friendly/no-dom-globals-in-react-fc
|
|
21
|
+
`?returnUrl=${encodeURIComponent(window.location.href)}`}`, size: "sm", children: t('Sign in') }), jsx(Button, { withArrow: true, color: "secondary", "data-test-selector": "createAccountButton", href: paths.ACCOUNT_CREATE, size: "sm", variant: "outline", children: t('Create account') })] }))] })] }));
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export { QuickAccessMenu };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface ErrorPageProps {
|
|
2
2
|
error: Error;
|
|
3
|
+
title?: string;
|
|
3
4
|
}
|
|
4
|
-
export declare function ErrorPage({ error }: ErrorPageProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function ErrorPage({ error, title, }: ErrorPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { DefaultErrorView } from '../../shared/error/default-error-view.js';
|
|
|
6
6
|
import { usePaths } from '../../shared/routing/use-paths.js';
|
|
7
7
|
import { Page } from '../components/page/page.js';
|
|
8
8
|
|
|
9
|
-
function ErrorPage({ error }) {
|
|
9
|
+
function ErrorPage({ error, title = 'Something went wrong', }) {
|
|
10
10
|
const paths = usePaths();
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
logger.error('ErrorPage error:', error);
|
|
@@ -14,7 +14,7 @@ function ErrorPage({ error }) {
|
|
|
14
14
|
return (jsx(Page, { breadcrumb: [
|
|
15
15
|
{ href: paths.HOME, label: 'Home' },
|
|
16
16
|
{ href: paths.HOME, label: 'Error' },
|
|
17
|
-
], "data-test-selector": "errorPage", title:
|
|
17
|
+
], "data-test-selector": "errorPage", title: title, children: jsx(DefaultErrorView, { error: error, title: "" }) }));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export { ErrorPage };
|
package/dist/pages/my-sonic/actions/create-ship-to-address/connected-create-ship-to-address-form.js
CHANGED
|
@@ -14,7 +14,6 @@ import { DefaultErrorView } from '../../../../shared/error/default-error-view.js
|
|
|
14
14
|
import { NotFoundRequestError } from '../../../../shared/fetch/request.js';
|
|
15
15
|
import { useNavigate } from '../../../../shared/routing/use-navigate.js';
|
|
16
16
|
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
17
|
-
import { Heading } from '../../../../typography/heading/heading.js';
|
|
18
17
|
import { LoadingPage } from '../../../loading-page/loading-page.js';
|
|
19
18
|
import formStyles from '../../../../forms/partials/address-form/address-form.module.css.js';
|
|
20
19
|
import styles from './create-ship-to-address.module.css.js';
|
|
@@ -30,7 +29,7 @@ function ConnectedCreateShipToAddressForm({ billToId, returnUrl, }) {
|
|
|
30
29
|
if (isLoadingCountries)
|
|
31
30
|
return jsx(LoadingPage, {});
|
|
32
31
|
if (errorShipToAddress && errorShipToAddress instanceof NotFoundRequestError)
|
|
33
|
-
return (jsx(
|
|
32
|
+
return (jsx(DefaultErrorView, { error: new NotFoundRequestError(new Error('Address not found')) }));
|
|
34
33
|
if (errorCountries)
|
|
35
34
|
return jsx(DefaultErrorView, { error: errorCountries });
|
|
36
35
|
if (!countries) {
|
package/dist/pages/my-sonic/actions/edit-bill-to-address/connected-edit-bill-to-address-form.js
CHANGED
|
@@ -12,7 +12,6 @@ import { usePatchBillToAddress } from '../../../../shared/api/storefront/hooks/c
|
|
|
12
12
|
import { DefaultErrorView } from '../../../../shared/error/default-error-view.js';
|
|
13
13
|
import { NotFoundRequestError } from '../../../../shared/fetch/request.js';
|
|
14
14
|
import { useNavigate } from '../../../../shared/routing/use-navigate.js';
|
|
15
|
-
import { Heading } from '../../../../typography/heading/heading.js';
|
|
16
15
|
import { LoadingPage } from '../../../loading-page/loading-page.js';
|
|
17
16
|
import formStyles from '../../../../forms/partials/address-form/address-form.module.css.js';
|
|
18
17
|
import styles from './edit-bill-to-address.module.css.js';
|
|
@@ -59,7 +58,7 @@ function ConnectedEditBillToAddressForm({ billToId, returnUrl, }) {
|
|
|
59
58
|
if (isLoadingBillToAddress || isLoadingCountries)
|
|
60
59
|
return jsx(LoadingPage, {});
|
|
61
60
|
if (errorBillToAddress && errorBillToAddress instanceof NotFoundRequestError)
|
|
62
|
-
return (jsx(
|
|
61
|
+
return (jsx(DefaultErrorView, { error: new NotFoundRequestError(new Error('Address not found')) }));
|
|
63
62
|
if (errorBillToAddress)
|
|
64
63
|
return jsx(DefaultErrorView, { error: errorBillToAddress });
|
|
65
64
|
if (errorCountries)
|
package/dist/pages/my-sonic/actions/edit-ship-to-address/connected-edit-ship-to-address-form.js
CHANGED
|
@@ -15,7 +15,6 @@ import { usePatchShipToAddress } from '../../../../shared/api/storefront/hooks/c
|
|
|
15
15
|
import { DefaultErrorView } from '../../../../shared/error/default-error-view.js';
|
|
16
16
|
import { NotFoundRequestError } from '../../../../shared/fetch/request.js';
|
|
17
17
|
import { useNavigate } from '../../../../shared/routing/use-navigate.js';
|
|
18
|
-
import { Heading } from '../../../../typography/heading/heading.js';
|
|
19
18
|
import { LoadingPage } from '../../../loading-page/loading-page.js';
|
|
20
19
|
import formStyles from '../../../../forms/partials/address-form/address-form.module.css.js';
|
|
21
20
|
import styles from './edit-ship-to-address.module.css.js';
|
|
@@ -64,7 +63,7 @@ function ConnectedEditShipToAddressForm({ billToId, returnUrl, shipToId, }) {
|
|
|
64
63
|
if (isLoadingShipToAddress || isLoadingCountries)
|
|
65
64
|
return jsx(LoadingPage, {});
|
|
66
65
|
if (errorShipToAddress && errorShipToAddress instanceof NotFoundRequestError)
|
|
67
|
-
return (jsx(
|
|
66
|
+
return (jsx(DefaultErrorView, { error: new NotFoundRequestError(new Error('Address not found')) }));
|
|
68
67
|
if (errorShipToAddress)
|
|
69
68
|
return jsx(DefaultErrorView, { error: errorShipToAddress });
|
|
70
69
|
if (errorCountries)
|
|
@@ -6,8 +6,8 @@ import { ConnectedProductCard } from '../../../../cards/product-card/connected-p
|
|
|
6
6
|
import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
|
|
7
7
|
import { ProductOverviewGrid } from '../../../../lists/product-overview-grid/product-overview-grid.js';
|
|
8
8
|
import { useFetchFavorites } from '../../../../shared/api/bff/hooks/use-fetch-favorites.js';
|
|
9
|
+
import { DefaultErrorView } from '../../../../shared/error/default-error-view.js';
|
|
9
10
|
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
10
|
-
import { ErrorPage } from '../../../error-page/error-page.js';
|
|
11
11
|
import { MySonicLayoutBreadcrumb } from '../../layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js';
|
|
12
12
|
import { MySonicLayoutPage } from '../../layouts/my-sonic-layout/my-sonic-layout-page.js';
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ function FavoritesPage() {
|
|
|
16
16
|
const { data: favorites, error, isFetching, isLoading } = useFetchFavorites();
|
|
17
17
|
const { sendAddToCartFromFavoritesPageEvent, sendProductClickFromFavoritesPageEvent, } = useAlgoliaInsights();
|
|
18
18
|
if (error)
|
|
19
|
-
return (jsx(MySonicLayoutPage, { children: jsx(
|
|
19
|
+
return (jsx(MySonicLayoutPage, { title: t('Favorites'), children: jsx(DefaultErrorView, { error: error, title: "" }) }));
|
|
20
20
|
return (jsx(MySonicLayoutPage, { title: t('Favorites'), children: (favorites && favorites.length > 0) || isFetching ? (jsx(ProductOverviewGrid, { isLoading: isLoading, children: favorites?.map(favorite => (jsx(ConnectedProductCard, { href: favorite.storefrontSlug, id: favorite.storefrontId, image: {
|
|
21
21
|
fit: 'contain',
|
|
22
22
|
image: favorite.image,
|
|
@@ -50,7 +50,7 @@ const getOrderShipToAddress = (order) => ({
|
|
|
50
50
|
function OrderDetailsContent({ order, reorderButton, returnUrl, }) {
|
|
51
51
|
const paths = usePaths();
|
|
52
52
|
const status = statusMap[order.status];
|
|
53
|
-
return (jsxs("div", { className: styles['order-details'], children: [jsxs("section", { className: styles['order-header'], children: [jsxs("div", { className: styles['order-header-info'], children: [jsxs(Heading, { size: "xxs", tag: "h2", children: [jsx(FormattedMessage, { id: "Order" }), "
|
|
53
|
+
return (jsxs("div", { className: styles['order-details'], children: [jsxs("section", { className: styles['order-header'], children: [jsxs("div", { className: styles['order-header-info'], children: [jsxs(Heading, { size: "xxs", tag: "h2", children: [jsx(FormattedMessage, { id: "Order" }), " ", order.webOrderNumber] }), jsxs("div", { children: [jsx(FormattedMessage, { id: "Status" }), ":", ' ', jsx(StatusText, { "data-test-selector": "order-status", status: status, children: jsx(FormattedMessage, { noTranslationId: true, id: `orderStatus.${order.status}` }) })] })] }), jsx(PrintButton, {}), reorderButton] }), jsx("section", { className: styles['order-additional-info'], children: jsxs("dl", { children: [jsx("dt", { children: jsx(FormattedMessage, { id: "orderProperty.Date" }) }), jsx("dd", { children: jsx(FormattedDate, { date: order.orderDate }) }), jsx("dt", { children: jsx(FormattedMessage, { id: "orderProperty.PO Number" }) }), jsx("dd", { children: order.customerPO })] }) }), jsx("section", { className: styles['order-billing-and-shipping'], children: jsx(BillingAndInvoiceInformation, { billToAddress: getOrderBillToAddress(order), shipToAddress: getOrderShipToAddress(order) }) }), jsx("section", { className: styles['order-top-button'], children: jsx(Button, { color: "secondary", href: returnUrl || paths.ACCOUNT_ORDERS, variant: "outline", children: jsx(FormattedMessage, { id: "Back" }) }) }), jsxs("section", { className: styles['order-line-list'], children: [jsx(Heading, { size: "xxs", tag: "h3", children: jsx(FormattedMessage, { id: "Products" }) }), jsx(OrderLineList, { children: order.orderLines?.map(line => (jsx(OrderLineCard, { isReadonly: true, href: line.productUri, image: {
|
|
54
54
|
fit: 'contain',
|
|
55
55
|
image: {
|
|
56
56
|
'1': line.mediumImagePath,
|
|
@@ -3,10 +3,10 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Breadcrumb } from '../../../../breadcrumbs/breadcrumb.js';
|
|
4
4
|
import { ConnectedReorderButton } from '../../../../buttons/reorder-button/connected-reorder-button.js';
|
|
5
5
|
import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
|
|
6
|
+
import { DynamicLoadingOverlay } from '../../../../loading/dynamic-loading-overlay.js';
|
|
6
7
|
import { useFetchOrderById } from '../../../../shared/api/storefront/hooks/orders/use-fetch-order-by-id.js';
|
|
8
|
+
import { DefaultErrorView } from '../../../../shared/error/default-error-view.js';
|
|
7
9
|
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
8
|
-
import { ErrorPage } from '../../../error-page/error-page.js';
|
|
9
|
-
import { LoadingPage } from '../../../loading-page/loading-page.js';
|
|
10
10
|
import { MySonicLayoutBreadcrumb } from '../../layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js';
|
|
11
11
|
import { MySonicLayoutPage } from '../../layouts/my-sonic-layout/my-sonic-layout-page.js';
|
|
12
12
|
import { OrderDetailsContent } from './order-details-content.js';
|
|
@@ -15,13 +15,13 @@ function OrderDetailsPage({ orderId, returnUrl }) {
|
|
|
15
15
|
const { data: order, error, isLoading } = useFetchOrderById(orderId);
|
|
16
16
|
const t = useFormattedMessage();
|
|
17
17
|
if (isLoading) {
|
|
18
|
-
return jsx(
|
|
18
|
+
return (jsx(MySonicLayoutPage, { title: t('Order details'), children: jsx(DynamicLoadingOverlay, { isLoading: isLoading }) }));
|
|
19
19
|
}
|
|
20
20
|
if (error) {
|
|
21
|
-
return jsx(
|
|
21
|
+
return (jsx(MySonicLayoutPage, { title: t('Order details'), children: jsx(DefaultErrorView, { error: error, title: "" }) }));
|
|
22
22
|
}
|
|
23
23
|
if (!order) {
|
|
24
|
-
return (jsx(
|
|
24
|
+
return (jsx(MySonicLayoutPage, { title: t('Order details'), children: jsx(DefaultErrorView, { error: new Error(`Order with ID ${orderId} not found. Please try again later.`), title: "" }) }));
|
|
25
25
|
}
|
|
26
26
|
return (jsx(MySonicLayoutPage, { "data-test-selector": "order-history", title: t('Order details'), children: jsx(OrderDetailsContent, { order: order, reorderButton: jsx(ConnectedReorderButton, { orderId: orderId }), returnUrl: returnUrl }) }));
|
|
27
27
|
}
|
|
@@ -15,10 +15,10 @@ import { useIntl } from '../../../../intl/use-intl.js';
|
|
|
15
15
|
import { DynamicLoadingOverlay } from '../../../../loading/dynamic-loading-overlay.js';
|
|
16
16
|
import { useFetchOrders } from '../../../../shared/api/storefront/hooks/orders/use-fetch-orders.js';
|
|
17
17
|
import { orderStatuses } from '../../../../shared/api/storefront/model/storefront.model.js';
|
|
18
|
+
import { DefaultErrorView } from '../../../../shared/error/default-error-view.js';
|
|
18
19
|
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
19
20
|
import { scrollIntoViewRef } from '../../../../shared/utils/scrolling.js';
|
|
20
21
|
import { DataTable } from '../../../../table/data-table.js';
|
|
21
|
-
import { ErrorPage } from '../../../error-page/error-page.js';
|
|
22
22
|
import { MySonicLayoutBreadcrumb } from '../../layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js';
|
|
23
23
|
import { MySonicLayoutPage } from '../../layouts/my-sonic-layout/my-sonic-layout-page.js';
|
|
24
24
|
import styles from './order-history-page.module.css.js';
|
|
@@ -51,7 +51,7 @@ function OrderHistoryPage() {
|
|
|
51
51
|
scrollIntoViewRef(orderHistoryRef);
|
|
52
52
|
}, [page]);
|
|
53
53
|
if (error)
|
|
54
|
-
return jsx(
|
|
54
|
+
return (jsx(MySonicLayoutPage, { "data-test-selector": "order-history", title: t('Order history'), children: jsx(DefaultErrorView, { error: error, title: "" }) }));
|
|
55
55
|
const { orders, pagination } = data ?? {
|
|
56
56
|
orders: [],
|
|
57
57
|
pagination: {},
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
type SignOutVariables = {
|
|
2
|
+
returnUrl?: string;
|
|
3
|
+
} | void;
|
|
1
4
|
export interface UseSignOutArgs {
|
|
2
5
|
onError?: (error: Error) => void;
|
|
3
|
-
onSuccess?:
|
|
6
|
+
onSuccess?: (data: void, variables: SignOutVariables) => void;
|
|
4
7
|
}
|
|
5
|
-
export declare function useSignOutMutation(options?: UseSignOutArgs): import("@tanstack/react-query").UseMutationResult<void, Error,
|
|
8
|
+
export declare function useSignOutMutation(options?: UseSignOutArgs): import("@tanstack/react-query").UseMutationResult<void, Error, SignOutVariables, unknown>;
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function useSignOut(options?: {
|
|
2
2
|
onSignOut?: VoidFunction;
|
|
3
|
-
}): import("@tanstack/react-query").UseMutateFunction<void, Error, void
|
|
3
|
+
}): import("@tanstack/react-query").UseMutateFunction<void, Error, void | {
|
|
4
|
+
returnUrl?: string;
|
|
5
|
+
}, unknown>;
|
|
@@ -10,10 +10,12 @@ function useSignOut(options = {}) {
|
|
|
10
10
|
const paths = usePaths();
|
|
11
11
|
const { mutate } = useSignOutMutation({
|
|
12
12
|
onError: logger.error,
|
|
13
|
-
onSuccess: () => {
|
|
13
|
+
onSuccess: (_data, variables) => {
|
|
14
14
|
// TODO: Remove when Spire is deprecated
|
|
15
15
|
Cookies.remove('NavigationMode');
|
|
16
|
-
navigate(paths.HOME, {
|
|
16
|
+
navigate((variables && variables.returnUrl) || paths.HOME, {
|
|
17
|
+
reload: true,
|
|
18
|
+
});
|
|
17
19
|
options.onSignOut?.();
|
|
18
20
|
},
|
|
19
21
|
});
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Heading } from '../../typography/heading/heading.js';
|
|
4
|
+
import styles from './basic-error-view.module.css.js';
|
|
4
5
|
|
|
5
6
|
function BasicErrorView() {
|
|
6
|
-
return (
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
display: 'flex',
|
|
9
|
-
flexDirection: 'column',
|
|
10
|
-
height: '100vh',
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
padding: '1rem',
|
|
13
|
-
textAlign: 'center',
|
|
14
|
-
}, children: [jsx(Heading, { size: "m", children: "Something went wrong" }), jsx("p", { children: "An unexpected error occurred. Please try refreshing the page, or come back later." }), jsx("a", { href: "/", children: "Go to homepage" })] }) }) }));
|
|
7
|
+
return (jsxs("html", { className: styles['basic-error-view'], lang: "en", children: [jsx("head", { children: jsx("title", { children: "Something went wrong" }) }), jsx("body", { children: jsxs("main", { "data-test-selector": "basicErrorView", children: [jsx(Heading, { className: styles['title'], size: "s", tag: "h1", children: "Something went wrong" }), jsx("p", { children: "An unexpected error occurred. Please try refreshing the page, or come back later." }), jsx("a", { href: "/", children: "Go to the homepage" })] }) })] }));
|
|
15
8
|
}
|
|
16
9
|
|
|
17
10
|
export { BasicErrorView };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ErrorViewProps } from './types';
|
|
2
|
-
export declare function DefaultErrorView({ error, errorInfo, resetError, showErrorDetails, showReset, }: ErrorViewProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DefaultErrorView({ className, error, errorInfo, resetError, resetLabel, showErrorDetails, showReset, title, }: ErrorViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { Button } from '../../buttons/button/button.js';
|
|
5
|
+
import { Details } from '../../display/details/details.js';
|
|
6
|
+
import { StrokeRecentIcon } from '../../icons/stroke/stroke-recent-icon.js';
|
|
7
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
8
|
+
import { Heading } from '../../typography/heading/heading.js';
|
|
3
9
|
import { environment } from '../utils/environment.js';
|
|
10
|
+
import styles from './default-error-view.module.css.js';
|
|
4
11
|
|
|
5
|
-
function DefaultErrorView({ error, errorInfo, resetError, showErrorDetails = environment !== 'production', showReset, }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border: '2px solid #ef4444',
|
|
9
|
-
borderRadius: '8px',
|
|
10
|
-
color: '#991b1b',
|
|
11
|
-
margin: '1rem',
|
|
12
|
-
padding: '2rem',
|
|
13
|
-
}, children: [jsx("h2", { style: { fontSize: '1.5rem', fontWeight: 'bold', marginTop: 0 }, children: "\u26A0\uFE0F Something went wrong" }), jsx("p", { style: { marginBottom: '1rem' }, children: error.message || 'An unexpected error occurred.' }), showErrorDetails && (jsxs("details", { style: { marginBottom: '1rem' }, children: [jsx("summary", { style: { cursor: 'pointer', fontWeight: 'bold' }, children: "Technical Details (only visible in development mode)" }), jsxs("div", { style: {
|
|
14
|
-
backgroundColor: '#fff',
|
|
15
|
-
border: '1px solid #fca5a5',
|
|
16
|
-
borderRadius: '4px',
|
|
17
|
-
fontFamily: 'monospace',
|
|
18
|
-
fontSize: '0.875rem',
|
|
19
|
-
marginTop: '0.5rem',
|
|
20
|
-
maxHeight: '300px',
|
|
21
|
-
overflow: 'auto',
|
|
22
|
-
padding: '1rem',
|
|
23
|
-
whiteSpace: 'pre-wrap',
|
|
24
|
-
}, children: [jsxs("div", { style: { marginBottom: '1rem' }, children: [jsx("strong", { children: "Error:" }), " ", error.toString()] }), error.stack && (jsxs("div", { style: { marginBottom: '1rem' }, children: [jsx("strong", { children: "Stack:" }), jsx("pre", { style: { margin: '0.5rem 0 0 0' }, children: error.stack })] })), errorInfo?.componentStack && (jsxs("div", { children: [jsx("strong", { children: "Component Stack:" }), jsx("pre", { style: { margin: '0.5rem 0 0 0' }, children: errorInfo.componentStack })] }))] })] })), jsx("div", { style: { display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }, children: showReset && resetError && (jsx("button", { onClick: resetError, style: {
|
|
25
|
-
backgroundColor: '#6b7280',
|
|
26
|
-
border: 'none',
|
|
27
|
-
borderRadius: '4px',
|
|
28
|
-
color: 'white',
|
|
29
|
-
cursor: 'pointer',
|
|
30
|
-
fontWeight: '500',
|
|
31
|
-
padding: '0.5rem 1rem',
|
|
32
|
-
}, type: "button", children: "\u21BA Reset" })) })] }));
|
|
12
|
+
function DefaultErrorView({ className, error, errorInfo, resetError, resetLabel, showErrorDetails = environment !== 'production', showReset, title, }) {
|
|
13
|
+
const t = useFormattedMessage();
|
|
14
|
+
return (jsxs("section", { className: clsx(styles['default-error-view'], className), children: [title && (jsx(Heading, { className: styles['title'], size: "s", tag: "h1", children: title || t('Something went wrong') })), jsx("p", { children: error.message || t('An unexpected error occured. Please try again.') }), showErrorDetails && (jsxs(Details, { className: styles['error-details'], lang: "en", summary: "Technical Details (only visible in development mode)", children: [jsx("output", { className: styles['error-kind'], children: error.toString() }), error.stack && (jsxs("div", { className: styles['error-info'], children: [jsx(Heading, { className: styles['error-info-title'], size: "xs", tag: "h2", children: "Stack:" }), jsx("pre", { className: styles['error-info-data'], children: error.stack })] })), errorInfo?.componentStack && (jsxs("div", { className: styles['component-info'], children: [jsx(Heading, { className: styles['error-info-title'], size: "xs", tag: "h2", children: "Component stack:" }), jsx("pre", { className: styles['error-info-data'], children: errorInfo.componentStack })] }))] })), showReset && resetError && (jsx(Button, { light: true, className: styles['reset-button'], color: "secondary", icon: jsx(StrokeRecentIcon, {}), onClick: resetError, size: "sm", type: "button", variant: "outline", children: resetLabel || t('Reset') }))] }));
|
|
33
15
|
}
|
|
34
16
|
|
|
35
17
|
export { DefaultErrorView };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"default-error-view":"default-error-view-module-IXKuf","title":"default-error-view-module-ZfydO","error-details":"default-error-view-module-pGbzW","error-kind":"default-error-view-module-LRchn","error-info":"default-error-view-module-Tz1Vb","error-info-title":"default-error-view-module-go6yg","error-info-data":"default-error-view-module--B3DB"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ErrorInfo } from 'react';
|
|
2
2
|
export interface ErrorViewProps {
|
|
3
|
+
className?: string;
|
|
3
4
|
context?: ErrorContext;
|
|
4
5
|
error: Error;
|
|
5
6
|
errorInfo?: ErrorInfo;
|
|
6
7
|
resetError?: () => void;
|
|
8
|
+
resetLabel?: string;
|
|
7
9
|
showErrorDetails?: boolean;
|
|
8
10
|
showReset?: boolean;
|
|
11
|
+
title?: string;
|
|
9
12
|
}
|
|
10
13
|
export interface ErrorContext {
|
|
11
14
|
[key: string]: unknown;
|
package/dist/styles.css
CHANGED
|
@@ -1178,6 +1178,11 @@ html {
|
|
|
1178
1178
|
text-transform: none;
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
|
+
.button-module-Pbwz7 .button-module-XaNWz svg {
|
|
1182
|
+
width: 18px;
|
|
1183
|
+
height: 18px;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1181
1186
|
.button-module-GVTEW {
|
|
1182
1187
|
min-width: 52px;
|
|
1183
1188
|
min-height: 40px;
|
|
@@ -2768,6 +2773,7 @@ html {
|
|
|
2768
2773
|
.data-card-module-24uin {
|
|
2769
2774
|
position: relative;
|
|
2770
2775
|
display: grid;
|
|
2776
|
+
padding: var(--space-16);
|
|
2771
2777
|
border: 1px solid var(--color-brand-medium-gray);
|
|
2772
2778
|
border-radius: var(--border-radius-32);
|
|
2773
2779
|
grid-area: card;
|
|
@@ -2801,7 +2807,6 @@ html {
|
|
|
2801
2807
|
.data-card-module-24uin .data-card-module-ZefqY {
|
|
2802
2808
|
display: grid;
|
|
2803
2809
|
align-items: start;
|
|
2804
|
-
padding: var(--space-16);
|
|
2805
2810
|
grid-template-rows: 1fr min-content;
|
|
2806
2811
|
}
|
|
2807
2812
|
|
|
@@ -4981,6 +4986,74 @@ button.swiper-pagination-bullet {
|
|
|
4981
4986
|
margin-inline: var(--space-4);
|
|
4982
4987
|
}
|
|
4983
4988
|
|
|
4989
|
+
.details-module-yz0rE {
|
|
4990
|
+
--duration: var(--transition-duration-short);
|
|
4991
|
+
--arrow-size: 12px;
|
|
4992
|
+
--arrow-space: 12px;
|
|
4993
|
+
|
|
4994
|
+
display: grid;
|
|
4995
|
+
gap: 0 var(--space-4);
|
|
4996
|
+
grid-template-columns: var(--arrow-space) minmax(0, 1fr);
|
|
4997
|
+
interpolate-size: allow-keywords;
|
|
4998
|
+
}
|
|
4999
|
+
|
|
5000
|
+
.details-module-yz0rE .details-module-mSgNu {
|
|
5001
|
+
display: grid;
|
|
5002
|
+
flex-direction: row;
|
|
5003
|
+
color: var(--color-brand-red);
|
|
5004
|
+
cursor: pointer;
|
|
5005
|
+
grid-column: 1 / -1;
|
|
5006
|
+
grid-template-areas: 'marker label';
|
|
5007
|
+
grid-template-columns: subgrid;
|
|
5008
|
+
-webkit-user-select: none;
|
|
5009
|
+
-moz-user-select: none;
|
|
5010
|
+
user-select: none;
|
|
5011
|
+
}
|
|
5012
|
+
|
|
5013
|
+
.details-module-yz0rE .details-module-mSgNu::marker {
|
|
5014
|
+
display: none;
|
|
5015
|
+
}
|
|
5016
|
+
|
|
5017
|
+
.details-module-yz0rE .details-module-mSgNu .details-module-2O7TR {
|
|
5018
|
+
block-size: var(--arrow-size);
|
|
5019
|
+
grid-area: marker;
|
|
5020
|
+
inline-size: var(--arrow-size);
|
|
5021
|
+
place-self: center;
|
|
5022
|
+
transition: all var(--duration) ease-in-out;
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
.details-module-yz0rE .details-module-mSgNu:hover {
|
|
5026
|
+
color: var(--color-brand-dark-red);
|
|
5027
|
+
}
|
|
5028
|
+
|
|
5029
|
+
.details-module-yz0rE .details-module-mSgNu:focus-visible {
|
|
5030
|
+
outline: var(--focus-outline);
|
|
5031
|
+
}
|
|
5032
|
+
|
|
5033
|
+
.details-module-yz0rE::details-content {
|
|
5034
|
+
display: grid;
|
|
5035
|
+
overflow: hidden;
|
|
5036
|
+
block-size: 0;
|
|
5037
|
+
grid-column: 1 / -1;
|
|
5038
|
+
grid-template-areas: '. content';
|
|
5039
|
+
grid-template-columns: subgrid;
|
|
5040
|
+
transition: all var(--duration) ease-in-out;
|
|
5041
|
+
transition-behavior: allow-discrete;
|
|
5042
|
+
}
|
|
5043
|
+
|
|
5044
|
+
.details-module-yz0rE .details-module-EJitZ {
|
|
5045
|
+
grid-area: content;
|
|
5046
|
+
padding-block-start: var(--space-8);
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
.details-module-yz0rE:open .details-module-mSgNu .details-module-2O7TR {
|
|
5050
|
+
rotate: 90deg;
|
|
5051
|
+
}
|
|
5052
|
+
|
|
5053
|
+
.details-module-yz0rE:open::details-content {
|
|
5054
|
+
block-size: auto;
|
|
5055
|
+
}
|
|
5056
|
+
|
|
4984
5057
|
.info-display-module-jsSU0 .info-display-module-aGbJV {
|
|
4985
5058
|
display: block;
|
|
4986
5059
|
margin-bottom: var(--space-8);
|
|
@@ -7852,6 +7925,41 @@ button.swiper-pagination-bullet {
|
|
|
7852
7925
|
padding-block-end: 0;
|
|
7853
7926
|
}
|
|
7854
7927
|
|
|
7928
|
+
.default-error-view-module-IXKuf > *:first-child {
|
|
7929
|
+
margin-block-start: 0;
|
|
7930
|
+
}
|
|
7931
|
+
.default-error-view-module-IXKuf > *:last-child {
|
|
7932
|
+
margin-block-end: 0;
|
|
7933
|
+
}
|
|
7934
|
+
.default-error-view-module-IXKuf .default-error-view-module-ZfydO {
|
|
7935
|
+
margin-block-end: var(--space-16);
|
|
7936
|
+
}
|
|
7937
|
+
.default-error-view-module-IXKuf p {
|
|
7938
|
+
margin-block: var(--space-16);
|
|
7939
|
+
}
|
|
7940
|
+
.default-error-view-module-IXKuf .default-error-view-module-pGbzW {
|
|
7941
|
+
margin-block: var(--space-16);
|
|
7942
|
+
}
|
|
7943
|
+
.default-error-view-module-IXKuf .default-error-view-module-LRchn {
|
|
7944
|
+
display: block;
|
|
7945
|
+
font-weight: bold;
|
|
7946
|
+
margin-block-end: var(--space-8);
|
|
7947
|
+
}
|
|
7948
|
+
.default-error-view-module-IXKuf .default-error-view-module-Tz1Vb .default-error-view-module-go6yg {
|
|
7949
|
+
font-size: var(--font-size-12);
|
|
7950
|
+
font-weight: bold;
|
|
7951
|
+
margin-block-end: 0;
|
|
7952
|
+
}
|
|
7953
|
+
.default-error-view-module-IXKuf .default-error-view-module-Tz1Vb .default-error-view-module--B3DB {
|
|
7954
|
+
overflow: auto;
|
|
7955
|
+
margin: 0;
|
|
7956
|
+
font: inherit;
|
|
7957
|
+
font-size: var(--font-size-12);
|
|
7958
|
+
}
|
|
7959
|
+
.default-error-view-module-IXKuf .default-error-view-module-Tz1Vb .default-error-view-module--B3DB:focus-visible {
|
|
7960
|
+
outline: var(--focus-outline-inset);
|
|
7961
|
+
}
|
|
7962
|
+
|
|
7855
7963
|
.no-results-module-HGe-Y {
|
|
7856
7964
|
margin-top: var(--space-24);
|
|
7857
7965
|
text-align: center;
|
|
@@ -8896,11 +9004,26 @@ button.swiper-pagination-bullet {
|
|
|
8896
9004
|
}
|
|
8897
9005
|
|
|
8898
9006
|
.order-details-content-module-aU3VQ .order-details-content-module--1w7s dl {
|
|
8899
|
-
display:
|
|
9007
|
+
display: grid;
|
|
9008
|
+
align-items: baseline;
|
|
9009
|
+
gap: var(--space-8) var(--space-16);
|
|
9010
|
+
grid-template-columns:
|
|
9011
|
+
[title-start] fit-content(25ch)
|
|
9012
|
+
[title-end data-start] 1fr [data-end];
|
|
8900
9013
|
}
|
|
8901
9014
|
|
|
8902
9015
|
.order-details-content-module-aU3VQ .order-details-content-module--1w7s dl dt {
|
|
8903
9016
|
font-weight: var(--font-weight-bold);
|
|
9017
|
+
grid-column: title;
|
|
9018
|
+
}
|
|
9019
|
+
|
|
9020
|
+
.order-details-content-module-aU3VQ .order-details-content-module--1w7s dl dt::after {
|
|
9021
|
+
content: ':';
|
|
9022
|
+
}
|
|
9023
|
+
|
|
9024
|
+
.order-details-content-module-aU3VQ .order-details-content-module--1w7s dl dd {
|
|
9025
|
+
margin: 0;
|
|
9026
|
+
grid-column: data;
|
|
8904
9027
|
}
|
|
8905
9028
|
|
|
8906
9029
|
.order-details-content-module-aU3VQ .order-details-content-module-BO26h h3 {
|
|
@@ -9478,6 +9601,51 @@ button.swiper-pagination-bullet {
|
|
|
9478
9601
|
}
|
|
9479
9602
|
}
|
|
9480
9603
|
|
|
9604
|
+
.basic-error-view-module-iKnnd {
|
|
9605
|
+
padding: 0;
|
|
9606
|
+
margin: 0;
|
|
9607
|
+
block-size: 100%;
|
|
9608
|
+
}
|
|
9609
|
+
|
|
9610
|
+
.basic-error-view-module-iKnnd body {
|
|
9611
|
+
position: relative;
|
|
9612
|
+
display: grid;
|
|
9613
|
+
grid-template-columns: 100%;
|
|
9614
|
+
min-block-size: 100%;
|
|
9615
|
+
}
|
|
9616
|
+
|
|
9617
|
+
.basic-error-view-module-iKnnd main {
|
|
9618
|
+
inline-size: -moz-fit-content;
|
|
9619
|
+
inline-size: fit-content;
|
|
9620
|
+
max-inline-size: min(calc(100% - 32px), 60ch);
|
|
9621
|
+
place-self: center;
|
|
9622
|
+
}
|
|
9623
|
+
|
|
9624
|
+
.basic-error-view-module-iKnnd main > *:last-child {
|
|
9625
|
+
margin-block-end: 0;
|
|
9626
|
+
}
|
|
9627
|
+
|
|
9628
|
+
.basic-error-view-module-iKnnd .basic-error-view-module-vyq6y {
|
|
9629
|
+
margin-block-end: var(--space-16);
|
|
9630
|
+
}
|
|
9631
|
+
|
|
9632
|
+
.basic-error-view-module-iKnnd p {
|
|
9633
|
+
margin-block: var(--space-16);
|
|
9634
|
+
}
|
|
9635
|
+
|
|
9636
|
+
.basic-error-view-module-iKnnd a {
|
|
9637
|
+
color: var(--color-brand-red);
|
|
9638
|
+
text-decoration: underline;
|
|
9639
|
+
}
|
|
9640
|
+
|
|
9641
|
+
.basic-error-view-module-iKnnd a:hover {
|
|
9642
|
+
color: var(--color-brand-dark-red);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9645
|
+
.basic-error-view-module-iKnnd a:focus-visible {
|
|
9646
|
+
outline: var(--focus-outline);
|
|
9647
|
+
}
|
|
9648
|
+
|
|
9481
9649
|
.sidebar-provider-module-rjeCL {
|
|
9482
9650
|
--transition-duration: 0;
|
|
9483
9651
|
}
|