@sonic-equipment/ui 202.0.0 → 204.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/address-info-display/address-info-display.js +1 -0
- package/dist/algolia/filter-section.js +1 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.js +1 -0
- package/dist/badges/tag/tag.js +1 -0
- package/dist/breadcrumbs/breadcrumb.js +7 -16
- package/dist/breadcrumbs/breadcrumb.module.css.js +1 -1
- package/dist/buttons/add-to-cart-button/add-to-cart-button.d.ts +1 -1
- package/dist/buttons/add-to-cart-button/add-to-cart-button.js +12 -13
- package/dist/cards/data-card/data-card.js +1 -0
- package/dist/cards/orderline-card/orderline-card.js +1 -0
- package/dist/carousel/category-carousel/category-carousel.js +1 -0
- package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +1 -0
- package/dist/carousel/usp-carousel/product-usp-carousel.js +1 -0
- package/dist/cart-totals/cart-totals-summary.js +1 -0
- package/dist/collapsables/accordion/accordion-item.js +6 -5
- package/dist/collapsables/accordion/accordion.js +1 -0
- package/dist/collapsables/accordion/accordion.module.css.js +1 -1
- package/dist/cookies/client-cookie-context.d.ts +3 -0
- package/dist/cookies/client-cookie-context.js +30 -0
- package/dist/cookies/cookie-context.d.ts +2 -0
- package/dist/cookies/cookie-context.js +6 -0
- package/dist/cookies/cookie-provider.d.ts +6 -0
- package/dist/cookies/cookie-provider.js +10 -0
- package/dist/cookies/readonly-cookie-reader.d.ts +2 -0
- package/dist/cookies/readonly-cookie-reader.js +18 -0
- package/dist/cookies/types.d.ts +14 -0
- package/dist/cookies/types.js +7 -0
- package/dist/{shared/hooks → cookies}/use-cookie.d.ts +1 -2
- package/dist/cookies/use-cookie.js +30 -0
- package/dist/country-select/hooks/use-countries.js +2 -1
- package/dist/country-selector/connected-country-selector.js +1 -1
- package/dist/country-selector/use-countries-languages.js +3 -11
- package/dist/display/info-display/info-display.js +1 -0
- package/dist/display/product-sku/product-sku.js +1 -0
- package/dist/exports.d.ts +6 -1
- package/dist/forms/layout/form/form-segment-group.js +1 -0
- package/dist/forms/layout/form/form-segment.js +1 -0
- package/dist/forms/partials/password-validation/password-validation.js +1 -0
- package/dist/global-search/plugins/categories-plugin.js +1 -0
- package/dist/global-search/plugins/popular-categories-plugin.js +1 -0
- package/dist/global-search/plugins/popular-searches-plugin.js +1 -0
- package/dist/global-search/plugins/query-suggestions-plugin.js +1 -0
- package/dist/global-search/plugins/quick-access-plugin.js +1 -0
- package/dist/global-search/plugins/recent-searches-plugin.js +1 -0
- package/dist/global-search/search-highlight/highlight.js +1 -0
- package/dist/global-search/search-result-panel/sections/section-container.js +1 -0
- package/dist/global-search/search-section/search-list.js +1 -0
- package/dist/global-search/search-section/search-section.js +1 -0
- package/dist/header/buttons/account/connected-account-button.js +1 -8
- package/dist/header/drawers/search-drawer.js +1 -0
- package/dist/header/header-layout/header-layout.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-blackcaps-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-up-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +1 -0
- package/dist/icons/solid/solid-attention-icon.js +1 -0
- package/dist/icons/solid/solid-cart-icon.js +1 -0
- package/dist/icons/solid/solid-close-icon.js +1 -0
- package/dist/icons/solid/solid-favorite-icon.js +1 -0
- package/dist/icons/solid/solid-home-icon.js +1 -0
- package/dist/icons/solid/solid-information-icon.js +1 -0
- package/dist/icons/solid/solid-login-icon.js +1 -0
- package/dist/icons/solid/solid-logout-icon.js +1 -0
- package/dist/icons/solid/solid-news-icon.js +1 -0
- package/dist/icons/solid/solid-notice-icon.js +1 -0
- package/dist/icons/solid/solid-okay-icon.js +1 -0
- package/dist/icons/solid/solid-rating-icon.js +1 -0
- package/dist/icons/solid/solid-salecategory-icon.js +1 -0
- package/dist/icons/solid/solid-tag-icon.js +1 -0
- package/dist/icons/stroke/stroke-categories-icon.js +1 -0
- package/dist/icons/stroke/stroke-checkmark-icon.js +1 -0
- package/dist/icons/stroke/stroke-closebox-icon.js +1 -0
- package/dist/icons/stroke/stroke-dehashed-icon.js +1 -0
- package/dist/icons/stroke/stroke-download-icon.js +1 -0
- package/dist/icons/stroke/stroke-event-icon.js +1 -0
- package/dist/icons/stroke/stroke-favorite-icon.js +1 -0
- package/dist/icons/stroke/stroke-filter-icon.js +1 -0
- package/dist/icons/stroke/stroke-hashed-icon.js +1 -0
- package/dist/icons/stroke/stroke-information-icon.js +1 -0
- package/dist/icons/stroke/stroke-minus-icon.js +1 -0
- package/dist/icons/stroke/stroke-plus-icon.js +1 -0
- package/dist/icons/stroke/stroke-recent-icon.js +1 -0
- package/dist/icons/stroke/stroke-search-icon.js +1 -0
- package/dist/icons/stroke/stroke-trash-icon.js +1 -0
- package/dist/index.js +7 -2
- package/dist/intl/use-formatted-date.js +1 -0
- package/dist/layout/center.js +1 -0
- package/dist/lists/download-document-list/download-document-list.js +1 -0
- package/dist/lists/feature-list/feature-list.js +1 -0
- package/dist/lists/icon-list/icon-list.js +1 -0
- package/dist/lists/menu-list/menu-list-header.js +1 -0
- package/dist/lists/menu-list/use-menu-list-item.js +1 -0
- package/dist/lists/menu-list/use-menu-list.js +1 -0
- package/dist/lists/product-overview-grid/product-overview-grid.js +1 -0
- package/dist/loading/blank-page-spacer.js +1 -0
- package/dist/loading/dynamic-loading-overlay.js +1 -0
- package/dist/loading/loading-overlay.js +1 -0
- package/dist/loading/progress-circle.js +1 -0
- package/dist/media/image-grid/images-grid.d.ts +2 -1
- package/dist/media/image-grid/images-grid.js +2 -2
- package/dist/media/image-lightbox/image-lightbox.d.ts +2 -1
- package/dist/media/image-lightbox/image-lightbox.js +2 -2
- package/dist/message/message.js +1 -0
- package/dist/pages/account/components/create-account-form/create-account-form.js +1 -1
- package/dist/pages/account/create-account-page/create-account-page.js +5 -3
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.d.ts +2 -1
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +2 -4
- package/dist/pages/account/sign-in-page/sign-in-page.js +2 -2
- package/dist/pages/checkout/cart-page/cart-page.js +1 -1
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +1 -0
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
- package/dist/pages/checkout/payment-page/hooks/use-has-returned-from-adyen.js +1 -0
- package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +1 -0
- package/dist/pages/components/page-container/page-container.js +1 -0
- package/dist/pages/components/page-meta-data/page-meta-data.js +1 -0
- package/dist/pages/loading-page/loading-page.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/change-password.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +1 -0
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +1 -0
- package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.js +1 -0
- package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.js +2 -1
- package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.js +2 -1
- package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.js +1 -0
- package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.js +1 -3
- package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.module.css.js +1 -1
- package/dist/pages/product/product-details-page/product-details.js +5 -1
- package/dist/pages/product/product-listing-page/no-results/no-results.js +3 -1
- package/dist/promos/promo-banner/promo-banner.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-announcements.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-navigation-links.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-recently-viewed-products.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-recover-password.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +7 -4
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart-line-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-place-order.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-create-adyen-session.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-fetch-adyen-config.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -0
- package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.d.ts +5 -3
- package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +5 -8
- package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-country-models.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-update-locale.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +1 -1
- package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +1 -1
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +1 -0
- package/dist/shared/api/storefront/services/website-service.js +9 -0
- package/dist/shared/feature-flags/use-feature-flags.js +1 -0
- package/dist/shared/hooks/use-debounced-callback.d.ts +5 -1
- package/dist/shared/hooks/use-debounced-callback.js +10 -10
- package/dist/shared/providers/react-query-container.d.ts +8 -3
- package/dist/shared/providers/react-query-container.js +4 -4
- package/dist/shared/routing/route-provider.d.ts +1 -0
- package/dist/shared/routing/types.d.ts +1 -0
- package/dist/shared/routing/use-location.js +2 -2
- package/dist/sidebar/sidebar-provider.js +0 -2
- package/dist/styles.css +31 -1
- package/dist/table/elements/col.js +1 -0
- package/dist/table/elements/use-table-row.js +1 -0
- package/dist/table/elements/use-table.js +1 -0
- package/dist/table/elements/use-td.js +1 -0
- package/dist/table/elements/use-th.js +1 -0
- package/dist/text/highlight-text/highlight-text.js +1 -0
- package/dist/text/truncated/truncated.js +1 -0
- package/package.json +3 -3
- package/dist/shared/hooks/use-cookie.js +0 -34
package/dist/index.js
CHANGED
|
@@ -76,6 +76,12 @@ export { ShowAll } from './collapsables/show-all/show-all.js';
|
|
|
76
76
|
export { Unmounter, UnmounterContext, useUnmount } from './collapsables/unmounter/unmounter.js';
|
|
77
77
|
export { createAddEndListener } from './collapsables/unmounter/utils.js';
|
|
78
78
|
export { config, configPerEnvironment } from './config.js';
|
|
79
|
+
export { clientCookieContextValue, defaultCookieOptions } from './cookies/client-cookie-context.js';
|
|
80
|
+
export { CookieContext } from './cookies/cookie-context.js';
|
|
81
|
+
export { CookieProvider } from './cookies/cookie-provider.js';
|
|
82
|
+
export { createReadonlyCookieReader } from './cookies/readonly-cookie-reader.js';
|
|
83
|
+
export { isCookieGetterSetter } from './cookies/types.js';
|
|
84
|
+
export { useCookie } from './cookies/use-cookie.js';
|
|
79
85
|
export { CountrySelect } from './country-select/country-select.js';
|
|
80
86
|
export { useCountries } from './country-select/hooks/use-countries.js';
|
|
81
87
|
export { ConnectedCountrySelector } from './country-selector/connected-country-selector.js';
|
|
@@ -375,7 +381,6 @@ export { GoogleAnalyticsProvider, InitializeGoogleAnalyticsProvider, useGoogleAn
|
|
|
375
381
|
export { isGAEvent } from './shared/ga/types.js';
|
|
376
382
|
export { useDataLayer } from './shared/ga/use-data-layer.js';
|
|
377
383
|
export { useBreakpoint } from './shared/hooks/use-breakpoint.js';
|
|
378
|
-
export { defaultCookieOptions, useCookie } from './shared/hooks/use-cookie.js';
|
|
379
384
|
export { useCookiebot } from './shared/hooks/use-cookiebot.js';
|
|
380
385
|
export { useCSSLink } from './shared/hooks/use-css-link.js';
|
|
381
386
|
export { useDebouncedCallback } from './shared/hooks/use-debounced-callback.js';
|
|
@@ -403,7 +408,7 @@ export { isResponsiveImage } from './shared/model/image.js';
|
|
|
403
408
|
export { CartProvider, useCartEvents } from './shared/providers/cart-provider.js';
|
|
404
409
|
export { FavoriteProvider, useFavorite, useFavoriteProduct } from './shared/providers/favorite-provider.js';
|
|
405
410
|
export { GlobalStateProvider, GlobalStateProviderContext, useGlobalState } from './shared/providers/global-state-provider.js';
|
|
406
|
-
export { ReactQueryContainer } from './shared/providers/react-query-container.js';
|
|
411
|
+
export { ReactQueryContainer, globalQueryClient } from './shared/providers/react-query-container.js';
|
|
407
412
|
export { RouteContext } from './shared/routing/route-context.js';
|
|
408
413
|
export { RouteProvider } from './shared/routing/route-provider.js';
|
|
409
414
|
export { buildHref } from './shared/routing/route-utils.js';
|
package/dist/layout/center.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ImageType } from '../../shared/model/image';
|
|
2
2
|
interface ImagesGridProps {
|
|
3
|
+
className?: string;
|
|
3
4
|
images: ImageType[];
|
|
4
5
|
onSelectImage?: (image: ImageType, index: number) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare function ImagesGrid({ images, onSelectImage }: ImagesGridProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ImagesGrid({ className, images, onSelectImage, }: ImagesGridProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -11,7 +11,7 @@ const mainImagePosition = {
|
|
|
11
11
|
4: 0,
|
|
12
12
|
5: 2,
|
|
13
13
|
};
|
|
14
|
-
function ImagesGrid({ images, onSelectImage }) {
|
|
14
|
+
function ImagesGrid({ className, images, onSelectImage, }) {
|
|
15
15
|
const positionIndex = mainImagePosition[images.length] || 0;
|
|
16
16
|
const imageList = [
|
|
17
17
|
...images.slice(1, positionIndex + 1),
|
|
@@ -24,7 +24,7 @@ function ImagesGrid({ images, onSelectImage }) {
|
|
|
24
24
|
onSelectImage?.(image, images.indexOf(image));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
return (jsx("div", { className: styles['images-grid'], "data-count": images.length, children: imageList.map((image, index) => image && (jsx("div", { "aria-label": `Open image ${index}`, className: clsx(styles['grid-item'], {
|
|
27
|
+
return (jsx("div", { className: clsx(styles['images-grid'], className), "data-count": images.length, children: imageList.map((image, index) => image && (jsx("div", { "aria-label": `Open image ${index}`, className: clsx(styles['grid-item'], {
|
|
28
28
|
[styles.clickable]: Boolean(onSelectImage),
|
|
29
29
|
}), onClick: () => onSelectImage?.(image, index), onKeyDown: event => handleKeydown(event, image), role: "button", tabIndex: 0, children: jsx(Image, { className: styles.image, fit: "contain", image: image, title: image.altText }) }, index))) }));
|
|
30
30
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'swiper/css';
|
|
2
2
|
import { ImageType } from '../../shared/model/image';
|
|
3
3
|
export interface ImageLightboxProps {
|
|
4
|
+
className?: string;
|
|
4
5
|
images: ImageType[];
|
|
5
6
|
initialSelectedIndex?: number;
|
|
6
7
|
onZoom?: (args: {
|
|
@@ -9,4 +10,4 @@ export interface ImageLightboxProps {
|
|
|
9
10
|
}) => void;
|
|
10
11
|
variant?: 'sm' | 'lg';
|
|
11
12
|
}
|
|
12
|
-
export declare function ImageLightbox({ images, initialSelectedIndex, onZoom, variant, }: ImageLightboxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ImageLightbox({ className, images, initialSelectedIndex, onZoom, variant, }: ImageLightboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { CarouselPagination } from '../../carousel/pagination/pagination.js';
|
|
|
10
10
|
import { Image } from '../image/image.js';
|
|
11
11
|
import styles from './image-lightbox.module.css.js';
|
|
12
12
|
|
|
13
|
-
function ImageLightbox({ images, initialSelectedIndex = 0, onZoom, variant = 'sm', }) {
|
|
13
|
+
function ImageLightbox({ className, images, initialSelectedIndex = 0, onZoom, variant = 'sm', }) {
|
|
14
14
|
const [thumbsSwiper, setThumbsSwiper] = useState();
|
|
15
15
|
const [currentIndex, setCurrentIndex] = useState(initialSelectedIndex);
|
|
16
16
|
const nextEl = useRef(null);
|
|
@@ -26,7 +26,7 @@ function ImageLightbox({ images, initialSelectedIndex = 0, onZoom, variant = 'sm
|
|
|
26
26
|
const scrollPercentage = clientY / height;
|
|
27
27
|
onZoom?.({ index: currentIndex, scrollPercentage });
|
|
28
28
|
}
|
|
29
|
-
return (jsxs("div", { className: clsx(styles['image-lightbox'], styles[variant]), children: [jsx(Swiper, { watchSlidesProgress: true, className: styles['thumbs-swiper'], direction: variant === 'sm' ? 'horizontal' : 'vertical', modules: [Thumb], onSwiper: swiper => setThumbsSwiper(swiper), slidesPerView: "auto", spaceBetween: 8, children: images.map((image, index) => (
|
|
29
|
+
return (jsxs("div", { className: clsx(styles['image-lightbox'], styles[variant], className), children: [jsx(Swiper, { watchSlidesProgress: true, className: styles['thumbs-swiper'], direction: variant === 'sm' ? 'horizontal' : 'vertical', modules: [Thumb], onSwiper: swiper => setThumbsSwiper(swiper), slidesPerView: "auto", spaceBetween: 8, children: images.map((image, index) => (
|
|
30
30
|
// eslint-disable-next-line @eslint-react/no-array-index-key
|
|
31
31
|
jsx(SwiperSlide, { className: styles.slide, children: jsx("div", { className: styles.thumb, children: jsx(Image, { className: styles.image, fit: "contain", height: 80, image: {
|
|
32
32
|
1: image['1'],
|
package/dist/message/message.js
CHANGED
|
@@ -62,7 +62,7 @@ function CreateAccountForm({ errorType, isDisabled: _isDisabled = false, isPendi
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
// form header
|
|
65
|
-
const header = (jsx(Heading, { "data-test-selector": "
|
|
65
|
+
const header = (jsx(Heading, { "data-test-selector": "pageTitle", italic: true, size: "m", tag: "h1", uppercase: true, children: title }));
|
|
66
66
|
// form footer
|
|
67
67
|
const footer = (jsx(FormSegment, { children: jsx(Button, { "data-test-selector": "createAccount_createButton", isDisabled: isDisabled, isLoading: isPendingCreateAccount && 'Creating account...', type: "submit", withArrow: true, children: t('create account') }) }));
|
|
68
68
|
return (jsxs(Form, { "aria-label": title, autoComplete: true, className: styles['create-account-form'], errorMessage: errorType && errorMessages[errorType], footer: footer, header: header, onSubmit: handleSubmit, title: title, children: [jsxs(FormSegmentGroup, { children: [jsx(FormSegment, { children: jsx(TextField, { autoComplete: "username", "data-test-selector": "createAccount_email", inputMode: "email", isDisabled: isDisabled, isRequired: true, label: t('Email'), name: "email", type: "email", validate: value => {
|
|
@@ -20,8 +20,10 @@ function CreateAccountPage({ returnUrl } = {}) {
|
|
|
20
20
|
const { error: errorCreateAccount, isPending: isPendingCreateAccount, isSuccess, mutate: createAccount, } = useCreateAccount();
|
|
21
21
|
const isExistingAccount = errorCreateAccount instanceof ExistingAccountError;
|
|
22
22
|
const isDisabled = isSuccess || isExistingAccount;
|
|
23
|
-
const continuePath = returnUrl && returnUrl !== paths.ACCOUNT_CREATE
|
|
24
|
-
|
|
23
|
+
const continuePath = returnUrl && decodeURIComponent(returnUrl) !== paths.ACCOUNT_CREATE
|
|
24
|
+
? decodeURIComponent(returnUrl)
|
|
25
|
+
: paths.ACCOUNT;
|
|
26
|
+
const isReturnToShipping = returnUrl && decodeURIComponent(returnUrl) === paths.CHECKOUT_SHIPPING;
|
|
25
27
|
const onSubmit = ({ data }) => {
|
|
26
28
|
createAccount(data, {
|
|
27
29
|
onSuccess() {
|
|
@@ -40,7 +42,7 @@ function CreateAccountPage({ returnUrl } = {}) {
|
|
|
40
42
|
navigate(continuePath, { reload: true });
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
|
-
return (jsxs(Fragment, { children: [jsx(SignInPageLayout, { fullHeight: true, children: jsx(CreateAccountForm, { errorType: errorType, isDisabled: isDisabled, isPendingCreateAccount: isPendingCreateAccount, onSubmit: onSubmit }) }), jsx(Dialog, { footer: jsx(Button, { color: "primary", href: continuePath, route: { reload: true }, size: "md", withArrow: true, children: jsx(FormattedMessage, { id: "Continue" }) }), hasCloseButton: false, isDismissable: false, isKeyboardDismissDisabled: true, isOpen: isSuccess && !isReturnToShipping, title: "Account created", children: jsx("p", { children: jsx(FormattedMessage, { id: "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." }) }) }), jsx(Dialog, { footer: jsx(Button, { color: "primary", href: `${paths.SIGN_IN}${returnUrl ? `?returnUrl=${continuePath}` : ''}`, route: { reload: true }, size: "md", withArrow: true, children: jsx(FormattedMessage, { id: "Continue to sign in" }) }), hasCloseButton: false, isDismissable: false, isKeyboardDismissDisabled: true, isOpen: isExistingAccount, title: "Existing account", children: jsx("p", { children: jsx(FormattedMessage, { id: "The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support." }) }) })] }));
|
|
45
|
+
return (jsxs(Fragment, { children: [jsx(SignInPageLayout, { fullHeight: true, "data-test-selector": "create-account-page", children: jsx(CreateAccountForm, { errorType: errorType, isDisabled: isDisabled, isPendingCreateAccount: isPendingCreateAccount, onSubmit: onSubmit }) }), jsx(Dialog, { footer: jsx(Button, { color: "primary", href: continuePath, route: { reload: true }, size: "md", withArrow: true, children: jsx(FormattedMessage, { id: "Continue" }) }), hasCloseButton: false, isDismissable: false, isKeyboardDismissDisabled: true, isOpen: isSuccess && !isReturnToShipping, title: "Account created", children: jsx("p", { children: jsx(FormattedMessage, { id: "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." }) }) }), jsx(Dialog, { footer: jsx(Button, { color: "primary", href: `${paths.SIGN_IN}${returnUrl ? `?returnUrl=${continuePath}` : ''}`, route: { reload: true }, size: "md", withArrow: true, children: jsx(FormattedMessage, { id: "Continue to sign in" }) }), hasCloseButton: false, isDismissable: false, isKeyboardDismissDisabled: true, isOpen: isExistingAccount, title: "Existing account", children: jsx("p", { children: jsx(FormattedMessage, { id: "The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support." }) }) })] }));
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export { CreateAccountPage };
|
|
@@ -2,7 +2,8 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ImageType } from '../../../../shared/model/image';
|
|
3
3
|
export interface SignInPageLayoutProps {
|
|
4
4
|
children?: ReactNode;
|
|
5
|
+
'data-test-selector': string;
|
|
5
6
|
fullHeight?: boolean;
|
|
6
7
|
image?: ImageType;
|
|
7
8
|
}
|
|
8
|
-
export declare function SignInPageLayout({ children, fullHeight, image, }: SignInPageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function SignInPageLayout({ children, 'data-test-selector': dataTestSelector, fullHeight, image, }: SignInPageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { useIsBreakpoint } from '../../../../shared/hooks/use-is-breakpoint.js';
|
|
5
4
|
import { Image } from '../../../../media/image/image.js';
|
|
6
5
|
import { SIGN_IN_PAGE_BACKGROUND_IMAGE } from './sign-in-page-background-image.js';
|
|
7
6
|
import styles from './sign-in-page-layout.module.css.js';
|
|
8
7
|
|
|
9
|
-
function SignInPageLayout({ children, fullHeight, image = SIGN_IN_PAGE_BACKGROUND_IMAGE, }) {
|
|
10
|
-
|
|
11
|
-
return (jsxs("div", { className: clsx(styles['sign-in-page-layout'], fullHeight && styles['full-height']), children: [jsx("section", { className: styles.main, children: children }), isLg && (jsx("div", { className: styles.side, children: jsx("div", { className: styles.image, children: jsx(Image, { image: image, title: "" }) }) }))] }));
|
|
8
|
+
function SignInPageLayout({ children, 'data-test-selector': dataTestSelector, fullHeight, image = SIGN_IN_PAGE_BACKGROUND_IMAGE, }) {
|
|
9
|
+
return (jsxs("div", { className: clsx(styles['sign-in-page-layout'], fullHeight && styles['full-height']), "data-test-selector": dataTestSelector, children: [jsx("section", { className: styles.main, children: children }), jsx("div", { className: styles.side, children: jsx("div", { className: styles.image, children: jsx(Image, { image: image, title: "" }) }) })] }));
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export { SignInPageLayout };
|
|
@@ -37,7 +37,7 @@ function SignInPage({ returnUrl } = {}) {
|
|
|
37
37
|
navigate(returnUrl || paths.HOME, { reload: true });
|
|
38
38
|
};
|
|
39
39
|
const allowGuestSignIn = returnUrl === paths.CHECKOUT_SHIPPING;
|
|
40
|
-
const createAccountPath = `${paths.ACCOUNT_CREATE}${returnUrl ? `?returnUrl=${returnUrl}` : ''}`;
|
|
40
|
+
const createAccountPath = `${paths.ACCOUNT_CREATE}${returnUrl ? `?returnUrl=${encodeURIComponent(returnUrl)}` : ''}`;
|
|
41
41
|
const onSubmit = ({ data }) => {
|
|
42
42
|
resetSignIn();
|
|
43
43
|
resetCreateGuest();
|
|
@@ -57,7 +57,7 @@ function SignInPage({ returnUrl } = {}) {
|
|
|
57
57
|
const onRecoverPasswordDialogOpen = () => {
|
|
58
58
|
setRecoverPasswordDialogOpen(true);
|
|
59
59
|
};
|
|
60
|
-
return (jsxs(Fragment, { children: [jsx(SignInPageLayout, { fullHeight: true, children: jsx(SignInForm, { allowGuestSignIn: allowGuestSignIn, createAccountPath: createAccountPath, errorType: errorType, initialEmail: session?.isGuest ? '' : session?.email, initialRememberMe: session?.rememberMe, isDisabled: !session || isSuccess, isLoading: isLoading, isPendingGuestSignIn: isPendingCreateGuest, isPendingUserSignIn: isPendingSignIn, onRecoverPasswordDialogOpen: onRecoverPasswordDialogOpen, onSubmit: onSubmit }) }), jsx(RecoverPasswordDialog, { isOpen: isRecoverPasswordDialogOpen, onOpenChange: isOpen => setRecoverPasswordDialogOpen(isOpen) })] }));
|
|
60
|
+
return (jsxs(Fragment, { children: [jsx(SignInPageLayout, { fullHeight: true, "data-test-selector": "signInPage", children: jsx(SignInForm, { allowGuestSignIn: allowGuestSignIn, createAccountPath: createAccountPath, errorType: errorType, initialEmail: session?.isGuest ? '' : session?.email, initialRememberMe: session?.rememberMe, isDisabled: !session || isSuccess, isLoading: isLoading, isPendingGuestSignIn: isPendingCreateGuest, isPendingUserSignIn: isPendingSignIn, onRecoverPasswordDialogOpen: onRecoverPasswordDialogOpen, onSubmit: onSubmit }) }), jsx(RecoverPasswordDialog, { isOpen: isRecoverPasswordDialogOpen, onOpenChange: isOpen => setRecoverPasswordDialogOpen(isOpen) })] }));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export { SignInPage };
|
|
@@ -82,7 +82,7 @@ function CartContent({ cartLines }) {
|
|
|
82
82
|
if (!currencyCode)
|
|
83
83
|
throw new Error(`Currency code not found for symbol ${currentCart.currencySymbol}`);
|
|
84
84
|
return (jsx(CheckoutPageLayout, { actions: {
|
|
85
|
-
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", href:
|
|
85
|
+
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", href: paths.CHECKOUT_SHIPPING, children: jsx(FormattedMessage, { id: "Start checkout" }) })),
|
|
86
86
|
secondary: isAuthenticated ? (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", onClick: () => {
|
|
87
87
|
saveCartForLater.mutate({ cart: currentCart });
|
|
88
88
|
}, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })) : (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", href: paths.SIGN_IN, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })),
|
|
@@ -51,7 +51,7 @@ function OrderConfirmationPageContent({ cart, }) {
|
|
|
51
51
|
label: t('Order confirmation'),
|
|
52
52
|
},
|
|
53
53
|
], "data-test-selector": "orderConfirmationPage", title: t('Order confirmation'), children: jsx(CheckoutPageLayout, { actions: {
|
|
54
|
-
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_continueShopping", href:
|
|
54
|
+
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_continueShopping", href: paths.HOME, children: jsx(FormattedMessage, { id: "Continue shopping" }) })),
|
|
55
55
|
secondary: (jsxs(Fragment, { children: [cart.canSaveOrder && (jsx(Button, { color: "secondary", onClick: () => {
|
|
56
56
|
saveCartForLater.mutate({ cart });
|
|
57
57
|
}, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })), jsx(PrintButton, {})] })),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useAwaitableMutation } from '../../../../shared/api/shared/hooks/use-awaitable-mutation.js';
|
|
2
3
|
import { patchSession } from '../../../../shared/api/storefront/services/authentication-service.js';
|
|
3
4
|
import { patchCart } from '../../../../shared/api/storefront/services/cart-service.js';
|