@sonic-equipment/ui 162.0.0 → 164.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/buttons/link/link.d.ts +2 -1
- package/dist/buttons/link/link.js +3 -3
- package/dist/cards/orderline-card/orderline-card.js +1 -1
- package/dist/collapsables/cascading-component/cascading-component-container-context.d.ts +2 -0
- package/dist/collapsables/cascading-component/cascading-component-container-context.js +5 -0
- package/dist/collapsables/cascading-component/cascading-component-container-provider.d.ts +7 -0
- package/dist/collapsables/cascading-component/cascading-component-container-provider.js +28 -0
- package/dist/collapsables/cascading-component/cascading-component-container.d.ts +8 -0
- package/dist/collapsables/cascading-component/cascading-component-container.js +8 -0
- package/dist/collapsables/cascading-component/cascading-component.d.ts +13 -0
- package/dist/collapsables/cascading-component/cascading-component.js +44 -0
- package/dist/collapsables/cascading-component/types.d.ts +11 -0
- package/dist/collapsables/cascading-component/use-cascading-component-container.d.ts +2 -0
- package/dist/collapsables/cascading-component/use-cascading-component-container.js +8 -0
- package/dist/collapsables/cascading-component/use-cascading-component.d.ts +2 -0
- package/dist/collapsables/cascading-component/use-cascading-component.js +14 -0
- package/dist/collapsables/cascading-component/use-has-cascading-component-container.d.ts +1 -0
- package/dist/collapsables/cascading-component/use-has-cascading-component-container.js +7 -0
- package/dist/collapsables/unmounter/unmounter.d.ts +14 -0
- package/dist/collapsables/unmounter/unmounter.js +43 -0
- package/dist/collapsables/unmounter/utils.d.ts +2 -0
- package/dist/collapsables/unmounter/utils.js +18 -0
- package/dist/country-select/country-select.js +1 -1
- package/dist/country-selector/connected-country-selector.js +20 -2
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +1 -1
- package/dist/country-selector/use-countries-languages.d.ts +17 -1
- package/dist/country-selector/use-countries-languages.js +58 -29
- package/dist/delivery-time/delivery-time.d.ts +1 -1
- package/dist/delivery-time/delivery-time.js +20 -8
- package/dist/delivery-time/delivery-time.module.css.js +1 -1
- package/dist/exports.d.ts +15 -1
- package/dist/icons/glyph/glyphs-arrow-blackcaps-right-icon.js +7 -0
- package/dist/index.js +15 -2
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/lists/icon-list/icon-list.d.ts +10 -0
- package/dist/lists/icon-list/icon-list.js +11 -0
- package/dist/lists/icon-list/icon-list.module.css.js +3 -0
- package/dist/lists/menu-list/menu-list-back-button.d.ts +7 -0
- package/dist/lists/menu-list/menu-list-back-button.js +9 -0
- package/dist/lists/menu-list/menu-list-header.d.ts +7 -0
- package/dist/lists/menu-list/menu-list-header.js +10 -0
- package/dist/lists/menu-list/menu-list-item.d.ts +26 -0
- package/dist/lists/menu-list/menu-list-item.js +20 -0
- package/dist/lists/menu-list/menu-list.d.ts +14 -0
- package/dist/lists/menu-list/menu-list.js +13 -0
- package/dist/lists/menu-list/menu-list.module.css.js +3 -0
- package/dist/modals/signin/sign-in-dialog.js +2 -2
- package/dist/pages/checkout/cart-page/cart-page.js +1 -1
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
- package/dist/pages/checkout/payment-page/components/adyen-payment.js +1 -1
- package/dist/pages/checkout/payment-page/components/payment.js +9 -9
- package/dist/pages/checkout/payment-page/payment-page-content.js +1 -1
- package/dist/shared/utils/date.d.ts +1 -12
- package/dist/shared/utils/date.js +8 -64
- package/dist/styles.css +333 -6
- package/package.json +1 -1
- package/dist/lists/ul/list.d.ts +0 -10
- package/dist/lists/ul/list.js +0 -11
- package/dist/lists/ul/list.module.css.js +0 -3
- package/dist/shared/utils/date.test.d.ts +0 -1
package/dist/exports.d.ts
CHANGED
|
@@ -58,7 +58,17 @@ export * from './cart-totals/cart-totals';
|
|
|
58
58
|
export * from './cart-totals/cart-totals-summary';
|
|
59
59
|
export * from './collapsables/accordion/accordion';
|
|
60
60
|
export * from './collapsables/accordion/accordion-item';
|
|
61
|
+
export * from './collapsables/cascading-component/cascading-component';
|
|
62
|
+
export * from './collapsables/cascading-component/cascading-component-container';
|
|
63
|
+
export * from './collapsables/cascading-component/cascading-component-container-context';
|
|
64
|
+
export * from './collapsables/cascading-component/cascading-component-container-provider';
|
|
65
|
+
export * from './collapsables/cascading-component/types';
|
|
66
|
+
export * from './collapsables/cascading-component/use-cascading-component';
|
|
67
|
+
export * from './collapsables/cascading-component/use-cascading-component-container';
|
|
68
|
+
export * from './collapsables/cascading-component/use-has-cascading-component-container';
|
|
61
69
|
export * from './collapsables/show-all/show-all';
|
|
70
|
+
export * from './collapsables/unmounter/unmounter';
|
|
71
|
+
export * from './collapsables/unmounter/utils';
|
|
62
72
|
export * from './config';
|
|
63
73
|
export * from './country-select/country-select';
|
|
64
74
|
export * from './country-select/hooks/use-countries';
|
|
@@ -138,9 +148,13 @@ export * from './intl/use-language-code';
|
|
|
138
148
|
export * from './intl/utils';
|
|
139
149
|
export * from './lists/download-document-list/download-document-list';
|
|
140
150
|
export * from './lists/feature-list/feature-list';
|
|
151
|
+
export * from './lists/icon-list/icon-list';
|
|
152
|
+
export * from './lists/menu-list/menu-list';
|
|
153
|
+
export * from './lists/menu-list/menu-list-back-button';
|
|
154
|
+
export * from './lists/menu-list/menu-list-header';
|
|
155
|
+
export * from './lists/menu-list/menu-list-item';
|
|
141
156
|
export * from './lists/orderline-list/orderline-list';
|
|
142
157
|
export * from './lists/product-overview-grid/product-overview-grid';
|
|
143
|
-
export * from './lists/ul/list';
|
|
144
158
|
export * from './loading/blank-page-spacer';
|
|
145
159
|
export * from './loading/loading-overlay';
|
|
146
160
|
export * from './loading/progress-circle';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function GlyphsArrowBlackCapsRightIcon(props) {
|
|
4
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "11", viewBox: "0 0 11 11", width: "11", children: jsx("path", { d: "M2.31976777,11 C2.06899066,11 1.91614593,10.7405883 2.04903704,10.5406252 L5.82841248,4.85263431 C5.99833751,4.59667547 5.97375465,4.27015906 5.76703514,4.04017141 L2.58259687,0.493978041 C2.40732426,0.298743748 2.55482143,0 2.82650993,0 L5.99283031,0.000300244973 C6.08685178,0.000300244973 6.17600455,0.0392570302 6.23666356,0.106812149 L8.10264638,2.18458242 C9.16944677,3.37250165 9.29722976,5.05702607 8.4207071,6.37630248 L5.44211038,10.8588849 C5.38376599,10.9466315 5.28144382,11 5.17137965,11 L2.31976777,11 Z", fillRule: "evenodd" }) }));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { GlyphsArrowBlackCapsRightIcon };
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,16 @@ export { CartTotals, formatDisplayPriceToSymbolSpaceValue } from './cart-totals/
|
|
|
63
63
|
export { CartTotalsSummary } from './cart-totals/cart-totals-summary.js';
|
|
64
64
|
export { Accordion } from './collapsables/accordion/accordion.js';
|
|
65
65
|
export { AccordionItem } from './collapsables/accordion/accordion-item.js';
|
|
66
|
+
export { CascadingComponent, InternalCascadingComponent } from './collapsables/cascading-component/cascading-component.js';
|
|
67
|
+
export { CascadingComponentContainer } from './collapsables/cascading-component/cascading-component-container.js';
|
|
68
|
+
export { CascadingComponentContainerContext } from './collapsables/cascading-component/cascading-component-container-context.js';
|
|
69
|
+
export { CascadingComponentContainerProvider } from './collapsables/cascading-component/cascading-component-container-provider.js';
|
|
70
|
+
export { useCascadingComponent } from './collapsables/cascading-component/use-cascading-component.js';
|
|
71
|
+
export { useCascadingComponentContainer } from './collapsables/cascading-component/use-cascading-component-container.js';
|
|
72
|
+
export { useHasCascadingComponentContainer } from './collapsables/cascading-component/use-has-cascading-component-container.js';
|
|
66
73
|
export { ShowAll } from './collapsables/show-all/show-all.js';
|
|
74
|
+
export { Unmounter, UnmounterContext, useUnmount } from './collapsables/unmounter/unmounter.js';
|
|
75
|
+
export { createAddEndListener } from './collapsables/unmounter/utils.js';
|
|
67
76
|
export { config, configPerEnvironment } from './config.js';
|
|
68
77
|
export { CountrySelect } from './country-select/country-select.js';
|
|
69
78
|
export { useCountries } from './country-select/hooks/use-countries.js';
|
|
@@ -141,9 +150,13 @@ export { useLanguageCode } from './intl/use-language-code.js';
|
|
|
141
150
|
export { getLanguageCodeFromCultureCode, spireTranslateAdapter } from './intl/utils.js';
|
|
142
151
|
export { DownloadDocumentList } from './lists/download-document-list/download-document-list.js';
|
|
143
152
|
export { FeatureList } from './lists/feature-list/feature-list.js';
|
|
153
|
+
export { IconList, IconListItem } from './lists/icon-list/icon-list.js';
|
|
154
|
+
export { MenuList } from './lists/menu-list/menu-list.js';
|
|
155
|
+
export { MenuListBackButton } from './lists/menu-list/menu-list-back-button.js';
|
|
156
|
+
export { MenuListHeader } from './lists/menu-list/menu-list-header.js';
|
|
157
|
+
export { MenuListItem } from './lists/menu-list/menu-list-item.js';
|
|
144
158
|
export { OrderLineList } from './lists/orderline-list/orderline-list.js';
|
|
145
159
|
export { ProductOverviewGrid } from './lists/product-overview-grid/product-overview-grid.js';
|
|
146
|
-
export { List, ListItem } from './lists/ul/list.js';
|
|
147
160
|
export { BlankPageSpacer } from './loading/blank-page-spacer.js';
|
|
148
161
|
export { LoadingOverlay } from './loading/loading-overlay.js';
|
|
149
162
|
export { ProgressCircle } from './loading/progress-circle.js';
|
|
@@ -325,7 +338,7 @@ export { useOnNavigate } from './shared/routing/use-on-navigate.js';
|
|
|
325
338
|
export { withRouting } from './shared/routing/with-routing.js';
|
|
326
339
|
export { ensureArray } from './shared/utils/array.js';
|
|
327
340
|
export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
|
|
328
|
-
export {
|
|
341
|
+
export { formatDateToLocaleString } from './shared/utils/date.js';
|
|
329
342
|
export { trackPropertyChange } from './shared/utils/debug.js';
|
|
330
343
|
export { environment, environments } from './shared/utils/environment.js';
|
|
331
344
|
export { EventEmitter } from './shared/utils/event-emitter.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.' | '
|
|
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.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | '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' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Close' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Delivery date' | 'Delivery expected on {0}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | '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' | 'Features' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | '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' | 'Industry' | 'industry.PP' | 'industry.AU' | 'industry.MC' | 'industry.BC' | 'industry.TR' | 'industry.AG' | 'industry.AV' | 'industry.MA' | 'industry.OT' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'More than {0} articles' | 'New list name' | 'New user?' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order number' | 'Order' | 'Order' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | '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' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove all' | 'Requested delivery date' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | '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' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signing in…' | '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' | 'Specifications' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | '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 product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product 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' | 'Use billing address' | 'Use fewer keywords' | '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 could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | '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 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';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface IconListProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function IconList({ children }: IconListProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface IconListItemProps {
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
text: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function IconListItem({ icon, text }: IconListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './icon-list.module.css.js';
|
|
3
|
+
|
|
4
|
+
function IconList({ children }) {
|
|
5
|
+
return jsx("ul", { className: styles['icon-list'], children: children });
|
|
6
|
+
}
|
|
7
|
+
function IconListItem({ icon, text }) {
|
|
8
|
+
return (jsxs("li", { className: styles['icon-list-item'], children: [icon && jsx("span", { className: styles.icon, children: icon }), text] }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { IconList, IconListItem };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface MenuListBackButtonProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onClick: VoidFunction;
|
|
5
|
+
}
|
|
6
|
+
export declare function MenuListBackButton({ children, onClick, }: MenuListBackButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { GlyphsChevronsSlimLeftIcon } from '../../icons/glyph/glyphs-chevrons-slim-left-icon.js';
|
|
3
|
+
import styles from './menu-list.module.css.js';
|
|
4
|
+
|
|
5
|
+
function MenuListBackButton({ children, onClick, }) {
|
|
6
|
+
return (jsxs("button", { className: styles['menu-list-back-button'], onClick: onClick, type: "button", children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles['icon'], role: "presentation" }), children] }));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { MenuListBackButton };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { GlyphsArrowBlackCapsRightIcon } from '../../icons/glyph/glyphs-arrow-blackcaps-right-icon.js';
|
|
3
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
4
|
+
import styles from './menu-list.module.css.js';
|
|
5
|
+
|
|
6
|
+
function MenuListHeader({ children, href }) {
|
|
7
|
+
return (jsxs("h2", { className: styles['menu-list-header'], children: [href && (jsxs(RouteLink, { href: href, children: [children, jsx(GlyphsArrowBlackCapsRightIcon, { className: styles['icon'], role: "presentation" })] })), !href && children] }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MenuListHeader };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ImageType } from '../../shared/model/image';
|
|
3
|
+
interface MenuListItemPropsBase {
|
|
4
|
+
children: ReactNode | string;
|
|
5
|
+
onClick?: VoidFunction;
|
|
6
|
+
}
|
|
7
|
+
interface MenuListItemNoChildrenProps {
|
|
8
|
+
hasChildren?: false;
|
|
9
|
+
href: string;
|
|
10
|
+
}
|
|
11
|
+
interface MenuListItemWithChildrenProps {
|
|
12
|
+
'aria-controls'?: string;
|
|
13
|
+
hasChildren: true;
|
|
14
|
+
isSelected?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface MenuListItemWithImageProps {
|
|
17
|
+
badge?: never;
|
|
18
|
+
image?: ImageType;
|
|
19
|
+
}
|
|
20
|
+
interface MenuListItemWithBadgeProps {
|
|
21
|
+
badge?: ReactNode;
|
|
22
|
+
image?: never;
|
|
23
|
+
}
|
|
24
|
+
export type MenuListItemProps = MenuListItemPropsBase & (MenuListItemNoChildrenProps | MenuListItemWithChildrenProps) & (MenuListItemWithImageProps | MenuListItemWithBadgeProps);
|
|
25
|
+
export declare function MenuListItem(props: MenuListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { GlyphsChevronsSlimRightIcon } from '../../icons/glyph/glyphs-chevrons-slim-right-icon.js';
|
|
4
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
5
|
+
import { Image } from '../../media/image/image.js';
|
|
6
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
7
|
+
import styles from './menu-list.module.css.js';
|
|
8
|
+
|
|
9
|
+
function MenuListItem(props) {
|
|
10
|
+
const { children, hasChildren, onClick } = props;
|
|
11
|
+
const href = 'href' in props ? props.href : undefined;
|
|
12
|
+
const isSelected = 'isSelected' in props ? props.isSelected : false;
|
|
13
|
+
const badge = 'badge' in props ? props.badge : undefined;
|
|
14
|
+
const image = 'image' in props ? props.image : undefined;
|
|
15
|
+
const ariaControls = 'aria-controls' in props ? props['aria-controls'] : undefined;
|
|
16
|
+
const t = useFormattedMessage();
|
|
17
|
+
return (jsxs("li", { "aria-owns": ariaControls, className: clsx(styles['menu-list-item'], isSelected && styles['selected'], hasChildren && styles['has-children']), children: [image && (jsx("span", { className: styles['image'], role: "presentation", children: jsx(Image, { fit: "contain", image: image, title: "" }) })), badge && jsx("span", { className: styles['badge'], children: badge }), jsx(RouteLink, { "aria-controls": ariaControls, "aria-expanded": ariaControls && isSelected, "aria-haspopup": hasChildren ? 'true' : undefined, className: styles['label'], href: href, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, children: children }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { MenuListItem };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MenuListProps {
|
|
3
|
+
back?: {
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
header?: string | {
|
|
9
|
+
href: string;
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
variant?: 'default' | 'primary';
|
|
13
|
+
}
|
|
14
|
+
export declare function MenuList({ back, children, header, variant, }: MenuListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { MenuListBackButton } from './menu-list-back-button.js';
|
|
4
|
+
import { MenuListHeader } from './menu-list-header.js';
|
|
5
|
+
import styles from './menu-list.module.css.js';
|
|
6
|
+
|
|
7
|
+
function MenuList({ back, children, header, variant = 'default', }) {
|
|
8
|
+
const headerTitle = typeof header === 'string' ? header : header?.title;
|
|
9
|
+
const headerHref = typeof header === 'string' ? undefined : header?.href;
|
|
10
|
+
return (jsxs("section", { className: clsx(styles['menu-list'], styles[variant]), role: "menu", children: [back && (jsx(MenuListBackButton, { onClick: back.onClick, children: back.title })), jsxs("div", { className: styles['scroll-area'], children: [header && (jsx(MenuListHeader, { href: headerHref, children: headerTitle })), jsx("ul", { className: styles['list'], children: children })] })] }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { MenuList };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"menu-list":"menu-list-module-TloB9","primary":"menu-list-module-xUg6i","scroll-area":"menu-list-module-x3D-V","list":"menu-list-module-m3rpo","menu-list-back-button":"menu-list-module-eKDL9","icon":"menu-list-module-syyw9","menu-list-header":"menu-list-module-S08LI","menu-list-item":"menu-list-module-4QhF4","label":"menu-list-module-xFYyo","image":"menu-list-module-ELekn","badge":"menu-list-module-4PbP-","selected":"menu-list-module-hiMca","has-children":"menu-list-module-61uJb"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { SolidOkayIcon } from '../../icons/solid/solid-okay-icon.js';
|
|
4
4
|
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
5
5
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
6
|
-
import {
|
|
6
|
+
import { IconList, IconListItem } from '../../lists/icon-list/icon-list.js';
|
|
7
7
|
import { useFavorite } from '../../shared/providers/favorite-provider.js';
|
|
8
8
|
import { RouteButton } from '../../shared/routing/route-button.js';
|
|
9
9
|
import { Dialog } from '../dialog/dialog.js';
|
|
@@ -15,7 +15,7 @@ function SignInDialog({ isOpen, onOpenChange }) {
|
|
|
15
15
|
const location = getLocation();
|
|
16
16
|
if (!location)
|
|
17
17
|
return null;
|
|
18
|
-
return (jsx(Dialog, { isDismissable: true, footer: jsxs(Fragment, { children: [jsx(RouteButton, { withArrow: true, color: "primary", href: `${signInUrl}?returnUrl=${encodeURIComponent(location.pathname + location.search)}`, onClick: () => onOpenChange(false), variant: "solid", children: jsx(FormattedMessage, { id: "sign in" }) }), jsx(RouteButton, { color: "secondary", href: `${signInUrl}?returnUrl=${encodeURIComponent(location.pathname + location.search)}`, onClick: () => onOpenChange(false), variant: "outline", children: jsx(FormattedMessage, { id: "create account" }) })] }), isOpen: isOpen, onOpenChange: onOpenChange, title: t('Shop more efficiently and quicker with a favorites list'), children: jsxs(
|
|
18
|
+
return (jsx(Dialog, { isDismissable: true, footer: jsxs(Fragment, { children: [jsx(RouteButton, { withArrow: true, color: "primary", href: `${signInUrl}?returnUrl=${encodeURIComponent(location.pathname + location.search)}`, onClick: () => onOpenChange(false), variant: "solid", children: jsx(FormattedMessage, { id: "sign in" }) }), jsx(RouteButton, { color: "secondary", href: `${signInUrl}?returnUrl=${encodeURIComponent(location.pathname + location.search)}`, onClick: () => onOpenChange(false), variant: "outline", children: jsx(FormattedMessage, { id: "create account" }) })] }), isOpen: isOpen, onOpenChange: onOpenChange, title: t('Shop more efficiently and quicker with a favorites list'), children: jsxs(IconList, { children: [jsx(IconListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Easily add your favorite products') }), jsx(IconListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Your favorites are available on multiple devices') }), jsx(IconListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Share your favorite list with others') })] }) }));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export { SignInDialog };
|
|
@@ -100,7 +100,7 @@ function CartContent({ cartLines }) {
|
|
|
100
100
|
originalTotalPrice: ensureNumber(cartLine.properties.totalListPrice),
|
|
101
101
|
pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
|
|
102
102
|
totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
103
|
-
}, productId: cartLine.productId || '', sku: cartLine.erpNumber || '', tags: [], title: cartLine.
|
|
103
|
+
}, productId: cartLine.productId || '', sku: cartLine.erpNumber || '', tags: [], title: cartLine.shortDescription }, cartLine.id))) }) }));
|
|
104
104
|
}
|
|
105
105
|
function CartPage() {
|
|
106
106
|
const t = useFormattedMessage();
|
|
@@ -89,7 +89,7 @@ function OrderConfirmationPageContent({ cart, }) {
|
|
|
89
89
|
originalTotalPrice: ensureNumber(cartLine.properties.totalListPrice),
|
|
90
90
|
pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
|
|
91
91
|
totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
92
|
-
}, productId: cartLine.productId || '', quantity: cartLine.qtyOrdered || 1, sku: cartLine.erpNumber || '', tags: [], title: cartLine.
|
|
92
|
+
}, productId: cartLine.productId || '', quantity: cartLine.qtyOrdered || 1, sku: cartLine.erpNumber || '', tags: [], title: cartLine.shortDescription }, cartLine.id))) }) }) })] }) }) }));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export { OrderConfirmationPageContent };
|
|
@@ -47,7 +47,7 @@ function AdyenPayment({ amount, cartId, countryCode, currencyCode, customerId, d
|
|
|
47
47
|
redirectResult: state.details.redirectResult,
|
|
48
48
|
});
|
|
49
49
|
if (amount.toFixed(2).replaceAll(/[,.]/gi, '') !== adyenAmount)
|
|
50
|
-
return onError(new Error(
|
|
50
|
+
return onError(new Error(`Invalid amount submitted '${amount.toFixed(2).replaceAll(/[,.]/gi, '')}' vs received '${adyenAmount}'`), result);
|
|
51
51
|
if (customerId !== adyenCustomerId)
|
|
52
52
|
return onError(new Error('Invalid customer'), result);
|
|
53
53
|
return handlePaymentResponse(result, onComplete, onError);
|
|
@@ -306,15 +306,15 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
306
306
|
setDeliveryDate('');
|
|
307
307
|
}, children: t('As soon as possible') }), jsx(InfoIconTooltip, { variant: "stroke", children: t('Selecting As Soon As Possible will enable us to send the products to you as they become available.') })] })] })), jsx(Select, { isRequired: true, "data-test-selector": "industrySelect", defaultSelectedOption: cart.properties.industry, isDisabled: isDisabled, label: t('Industry'), name: "industry", options: {
|
|
308
308
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
309
|
-
PP: '
|
|
310
|
-
AU: '
|
|
311
|
-
MC: '
|
|
312
|
-
BC: '
|
|
313
|
-
TR: '
|
|
314
|
-
AG: '
|
|
315
|
-
AV: '
|
|
316
|
-
MA: '
|
|
317
|
-
OT: '
|
|
309
|
+
PP: t('industry.PP'),
|
|
310
|
+
AU: t('industry.AU'),
|
|
311
|
+
MC: t('industry.MC'),
|
|
312
|
+
BC: t('industry.BC'),
|
|
313
|
+
TR: t('industry.TR'),
|
|
314
|
+
AG: t('industry.AG'),
|
|
315
|
+
AV: t('industry.AV'),
|
|
316
|
+
MA: t('industry.MA'),
|
|
317
|
+
OT: t('industry.OT'),
|
|
318
318
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
319
319
|
}, placeholder: t('Select an industry'), variant: "solid" }), jsx(TextField, { showLabel: true, isDisabled: isDisabled, label: t('VAT Number'), name: "customerVatNumber", onBlur: e => validateVAT(e.target.value), onChange: setCustomerVatNumber, validate: () => validationErrors.customerVatNumber ?? true, value: customerVatNumber }, `vat${Boolean(validationErrors.customerVatNumber)}`), jsx(TextField, { showLabel: true, defaultValue: cart.poNumber, isDisabled: isDisabled, isRequired: cart.requiresPoNumber, label: t('PO Number'), name: "poNumber" }), paymentMethodOptions && Object.keys(paymentMethodOptions).length > 1 && (jsx(Select, { "data-test-selector": "paymentMethodSelect", defaultSelectedOption: cart.paymentOptions?.paymentMethods?.[0]?.name || 'ADY', isDisabled: isDisabled, label: t('Payment method'), name: "paymentMethod", onChange: setSelectedPaymentMethod, options: paymentMethodOptions, selectedOption: selectedPaymentMethod, variant: "solid" })), isAdyenPayment && cart.billTo && (jsx(AdyenPayment, { amount: cart.orderGrandTotal, cartId: cart.trackId, countryCode: countryCode, currencyCode: currencyCode, customerId: cart.billTo.id, dropinRef: dropinRef, environment: environment === 'production' ? 'live' : 'test', isDisabled: isDisabled, onComplete: onComplete, onError: onError, orderAmount: cart.orderGrandTotal, returnUrl:
|
|
320
320
|
/* eslint-disable ssr-friendly/no-dom-globals-in-react-fc */
|
|
@@ -43,7 +43,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, isValidat
|
|
|
43
43
|
originalTotalPrice: ensureNumber(cartLine.properties.totalListPrice),
|
|
44
44
|
pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
|
|
45
45
|
totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
46
|
-
}, productId: cartLine.productId || '', quantity: cartLine.qtyOrdered || 1, sku: cartLine.erpNumber || '', tags: [], title: cartLine.
|
|
46
|
+
}, productId: cartLine.productId || '', quantity: cartLine.qtyOrdered || 1, sku: cartLine.erpNumber || '', tags: [], title: cartLine.shortDescription }, cartLine.id))) }) }) })] }) }));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export { PaymentPageContent };
|
|
@@ -1,13 +1,2 @@
|
|
|
1
1
|
import { CultureCode } from '../../intl/types';
|
|
2
|
-
export
|
|
3
|
-
export type DateUnitObject = {
|
|
4
|
-
number: number;
|
|
5
|
-
unit: DateUnit;
|
|
6
|
-
};
|
|
7
|
-
export type DateThreshold = {
|
|
8
|
-
dateUnitObject: DateUnitObject;
|
|
9
|
-
numberOfDays: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function getDateUnitObject(date: Date): DateUnitObject;
|
|
12
|
-
export declare function convertDateUnitToPluralOrSingle(unit: DateUnit, number: number): 'day' | 'days' | 'week' | 'weeks' | 'month' | 'months';
|
|
13
|
-
export declare function formatDateToLocaleString(date?: Date, cultureCode?: CultureCode): string;
|
|
2
|
+
export declare function formatDateToLocaleString(date?: Date, cultureCode?: CultureCode, options?: Intl.DateTimeFormatOptions): string;
|
|
@@ -1,68 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
const dateThresholds = [
|
|
8
|
-
{
|
|
9
|
-
dateUnitObject: { number: 1, unit: 'week' },
|
|
10
|
-
numberOfDays: 4,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
dateUnitObject: { number: 2, unit: 'week' },
|
|
14
|
-
numberOfDays: 11,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
dateUnitObject: { number: 3, unit: 'week' },
|
|
18
|
-
numberOfDays: 18,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
dateUnitObject: { number: 4, unit: 'week' },
|
|
22
|
-
numberOfDays: 27,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
dateUnitObject: { number: 2, unit: 'month' },
|
|
26
|
-
numberOfDays: 60,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
dateUnitObject: { number: 3, unit: 'month' },
|
|
30
|
-
numberOfDays: 90,
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
function getDateUnitObject(date) {
|
|
34
|
-
const fallbackDateUnitObject = { number: 6, unit: 'month' };
|
|
35
|
-
const days = getDaysDifference(date, new Date());
|
|
36
|
-
if (days < 1)
|
|
37
|
-
return fallbackDateUnitObject;
|
|
38
|
-
for (const threshold of dateThresholds) {
|
|
39
|
-
if (days <= threshold.numberOfDays) {
|
|
40
|
-
return threshold.dateUnitObject;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return fallbackDateUnitObject;
|
|
44
|
-
}
|
|
45
|
-
function convertDateUnitToPluralOrSingle(unit, number) {
|
|
46
|
-
if (number === 1)
|
|
47
|
-
return unit;
|
|
48
|
-
switch (unit) {
|
|
49
|
-
case 'day':
|
|
50
|
-
return 'days';
|
|
51
|
-
case 'week':
|
|
52
|
-
return 'weeks';
|
|
53
|
-
case 'month':
|
|
54
|
-
return 'months';
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function formatDateToLocaleString(date, cultureCode) {
|
|
1
|
+
function formatDateToLocaleString(date, cultureCode, options = {
|
|
2
|
+
day: 'numeric',
|
|
3
|
+
month: 'long',
|
|
4
|
+
weekday: 'long',
|
|
5
|
+
year: 'numeric',
|
|
6
|
+
}) {
|
|
58
7
|
if (!date || !cultureCode)
|
|
59
8
|
return '';
|
|
60
|
-
return date.toLocaleDateString(cultureCode,
|
|
61
|
-
day: 'numeric',
|
|
62
|
-
month: 'long',
|
|
63
|
-
weekday: 'long',
|
|
64
|
-
year: 'numeric',
|
|
65
|
-
});
|
|
9
|
+
return date.toLocaleDateString(cultureCode, options);
|
|
66
10
|
}
|
|
67
11
|
|
|
68
|
-
export {
|
|
12
|
+
export { formatDateToLocaleString };
|