@sonic-equipment/ui 213.0.0 → 215.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.
Files changed (94) hide show
  1. package/dist/address-info-display/address-info-display.js +1 -1
  2. package/dist/algolia/algolia-insights-provider.d.ts +1 -1
  3. package/dist/buttons/button/button.d.ts +1 -1
  4. package/dist/buttons/link/link.d.ts +1 -1
  5. package/dist/buttons/print-button/print-button.d.ts +2 -1
  6. package/dist/buttons/print-button/print-button.js +2 -2
  7. package/dist/cards/product-card/product-card.js +1 -1
  8. package/dist/cards/table-card/table-card.d.ts +1 -1
  9. package/dist/cards/table-card/table-card.js +5 -3
  10. package/dist/carousel/carousel-navigation-button.d.ts +1 -1
  11. package/dist/cart-totals/cart-totals.js +1 -1
  12. package/dist/collapsables/accordion/accordion-item.js +3 -1
  13. package/dist/collapsables/cascading-component/cascading-component-container-context.d.ts +1 -1
  14. package/dist/collapsables/show-all/show-all.js +4 -2
  15. package/dist/collapsables/unmounter/unmounter.d.ts +1 -1
  16. package/dist/cookies/cookie-context.d.ts +1 -1
  17. package/dist/country-select/country-select.js +3 -1
  18. package/dist/country-selector/country-selector-trigger/country-selector-trigger.js +3 -1
  19. package/dist/exports.d.ts +13 -1
  20. package/dist/filters/active-filters/active-filters.js +1 -1
  21. package/dist/forms/elements/field-error/field-error.js +3 -1
  22. package/dist/forms/fields/number-field/number-field.d.ts +1 -1
  23. package/dist/forms/partials/address-form/address-form.js +6 -2
  24. package/dist/index.js +15 -3
  25. package/dist/intl/formatted-message.d.ts +3 -2
  26. package/dist/intl/formatted-message.js +25 -5
  27. package/dist/intl/intl-context.d.ts +1 -1
  28. package/dist/intl/intl-context.js +1 -10
  29. package/dist/intl/translation-id.d.ts +1 -1
  30. package/dist/intl/types.d.ts +27 -15
  31. package/dist/intl/types.js +7 -1
  32. package/dist/intl/use-formatted-message.d.ts +2 -2
  33. package/dist/intl/use-formatted-message.js +5 -5
  34. package/dist/intl/use-intl.js +4 -1
  35. package/dist/intl/utils.js +1 -1
  36. package/dist/lists/menu-list/menu-list-provider.d.ts +1 -1
  37. package/dist/modals/confirmation/confirmation-dialog.d.ts +3 -2
  38. package/dist/modals/dialog/dialog.js +1 -1
  39. package/dist/notifications/announcements/announcement.d.ts +1 -1
  40. package/dist/observers/intersection-observer.js +1 -1
  41. package/dist/pages/my-sonic/actions/change-password/change-password.js +1 -1
  42. package/dist/pages/my-sonic/actions/edit-bill-to-address/connected-edit-bill-to-address-form.js +1 -1
  43. package/dist/pages/my-sonic/actions/edit-ship-to-address/connected-edit-ship-to-address-form.js +1 -1
  44. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-breadcrumb.d.ts +4 -0
  45. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js +9 -0
  46. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.module.css.js +1 -1
  47. package/dist/pages/my-sonic/pages/create-ship-to-address-details-page/create-ship-to-address-details-page.d.ts +7 -0
  48. package/dist/pages/my-sonic/pages/create-ship-to-address-details-page/create-ship-to-address-details-page.js +29 -0
  49. package/dist/pages/my-sonic/pages/edit-bill-to-address-details-page/edit-bill-to-address-details-page.d.ts +7 -0
  50. package/dist/pages/my-sonic/pages/edit-bill-to-address-details-page/edit-bill-to-address-details-page.js +29 -0
  51. package/dist/pages/my-sonic/pages/edit-ship-to-address-details-page/edit-ship-to-address-details-page.d.ts +9 -0
  52. package/dist/pages/my-sonic/pages/edit-ship-to-address-details-page/edit-ship-to-address-details-page.js +29 -0
  53. package/dist/pages/my-sonic/pages/favorites/favorites-page.d.ts +2 -0
  54. package/dist/pages/my-sonic/pages/favorites/favorites-page.js +23 -0
  55. package/dist/pages/my-sonic/pages/my-account/my-account-page.d.ts +2 -0
  56. package/dist/pages/my-sonic/pages/my-account/my-account-page.js +30 -0
  57. package/dist/pages/my-sonic/pages/order-details/order-details-content.d.ts +8 -0
  58. package/dist/pages/my-sonic/pages/order-details/order-details-content.js +69 -0
  59. package/dist/pages/my-sonic/pages/order-details/order-details-content.module.css.js +3 -0
  60. package/dist/pages/my-sonic/pages/order-details/order-details-page.d.ts +5 -0
  61. package/dist/pages/my-sonic/pages/order-details/order-details-page.js +22 -0
  62. package/dist/pages/my-sonic/pages/order-history/order-history-page.d.ts +2 -0
  63. package/dist/pages/my-sonic/pages/order-history/{order-history.js → order-history-page.js} +26 -8
  64. package/dist/pages/my-sonic/pages/order-history/order-history-page.module.css.js +3 -0
  65. package/dist/pages/my-sonic/widgets/connected-address-book-widget.js +8 -6
  66. package/dist/pages/product/product-listing-page/product-listing-page-provider/product-listing-page-context.d.ts +1 -1
  67. package/dist/shared/api/storefront/hooks/orders/use-fetch-order-by-id.d.ts +1 -0
  68. package/dist/shared/api/storefront/hooks/orders/use-fetch-order-by-id.js +14 -0
  69. package/dist/shared/api/storefront/model/storefront.model.d.ts +2 -1
  70. package/dist/shared/api/storefront/services/order-service.d.ts +3 -1
  71. package/dist/shared/api/storefront/services/order-service.js +12 -1
  72. package/dist/shared/data/order.d.ts +2 -0
  73. package/dist/shared/data/order.js +41 -0
  74. package/dist/shared/hooks/use-inert.d.ts +3 -0
  75. package/dist/shared/hooks/use-inert.js +16 -0
  76. package/dist/shared/model/address.d.ts +1 -1
  77. package/dist/shared/providers/global-state-provider.d.ts +1 -1
  78. package/dist/shared/routing/route-context.d.ts +1 -1
  79. package/dist/shared/routing/use-route-link-element.d.ts +1 -1
  80. package/dist/shared/routing/use-route-link.d.ts +1 -1
  81. package/dist/shared/routing/with-routing.d.ts +2 -2
  82. package/dist/sidebar/sidebar.js +4 -2
  83. package/dist/styles.css +129 -49
  84. package/dist/table/elements/table-context.d.ts +1 -1
  85. package/dist/table/elements/table-row-context.d.ts +1 -1
  86. package/dist/table/elements/types.d.ts +1 -0
  87. package/dist/text/status-text/status-text.d.ts +6 -0
  88. package/dist/text/status-text/status-text.js +8 -0
  89. package/dist/text/status-text/status-text.module.css.js +3 -0
  90. package/dist/toast/toast.d.ts +1 -1
  91. package/dist/typography/heading/heading.d.ts +2 -2
  92. package/package.json +7 -7
  93. package/dist/pages/my-sonic/pages/order-history/order-history.d.ts +0 -1
  94. package/dist/pages/my-sonic/pages/order-history/order-history.module.css.js +0 -3
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useRef, useState, useEffect } from 'react';
4
+ import { Breadcrumb } from '../../../../breadcrumbs/breadcrumb.js';
4
5
  import { Link } from '../../../../buttons/link/link.js';
5
6
  import { Price } from '../../../../display/price/price.js';
6
7
  import { Pagination } from '../../../../filters/pagination/pagination.js';
@@ -13,20 +14,24 @@ import { useIntl } from '../../../../intl/use-intl.js';
13
14
  import { DynamicLoadingOverlay } from '../../../../loading/dynamic-loading-overlay.js';
14
15
  import { useFetchOrders } from '../../../../shared/api/storefront/hooks/orders/use-fetch-orders.js';
15
16
  import { orderStatuses } from '../../../../shared/api/storefront/model/storefront.model.js';
17
+ import { usePaths } from '../../../../shared/routing/use-paths.js';
16
18
  import { scrollIntoViewRef } from '../../../../shared/utils/scrolling.js';
17
19
  import { DataTable } from '../../../../table/data-table.js';
18
20
  import { ErrorPage } from '../../../error-page/error-page.js';
19
- import styles from './order-history.module.css.js';
21
+ import { MySonicLayoutBreadcrumb } from '../../layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js';
22
+ import { MySonicLayoutPage } from '../../layouts/my-sonic-layout/my-sonic-layout-page.js';
23
+ import styles from './order-history-page.module.css.js';
20
24
 
21
25
  const dateOptions = {
22
26
  day: 'numeric',
23
27
  month: 'numeric',
24
28
  year: 'numeric',
25
29
  };
26
- function OrderHistory() {
30
+ function OrderHistoryPage() {
27
31
  const t = useFormattedMessage();
28
32
  const { cultureCode } = useIntl();
29
33
  const orderHistoryRef = useRef(null);
34
+ const paths = usePaths();
30
35
  const [status, setStatus] = useState();
31
36
  const [search, setSearch] = useState('');
32
37
  const [sort, setSort] = useState({
@@ -66,7 +71,7 @@ function OrderHistory() {
66
71
  ...options,
67
72
  [status]: t(`orderStatus.${status}`),
68
73
  }), { any: t('orderStatus.Any') });
69
- return (jsx(Fragment, { children: jsxs("section", { ref: orderHistoryRef, className: styles['order-history'], "data-test-selector": "order-history", children: [jsx("div", { className: styles['search'], children: jsx(SearchField, { isDebounced: true, "data-test-selector": "order-history-search", label: t('Search orders'), onChange: searchOrders, placeholder: t('Search orders'), showLabel: false, variant: "outline" }) }), jsx("div", { className: styles['filter'], children: jsx(SelectField, { "data-test-selector": "order-history-filter", label: t('Filter order status'), onChange: filterOrders, options: filterOptions, selectedOption: status, showLabel: false }) }), jsx("div", { "aria-label": t('Results'), "aria-live": "polite", className: styles['results'], children: jsx(DynamicLoadingOverlay, { isLoading: isFetching, children: orders && orders.length > 0 ? (jsx(DataTable, { actions: [
74
+ return (jsx(MySonicLayoutPage, { "data-test-selector": "order-history", title: t('Order history'), children: jsxs("section", { ref: orderHistoryRef, className: styles['order-history'], children: [jsx("div", { className: styles['search'], children: jsx(SearchField, { isDebounced: true, "data-test-selector": "order-history-search", label: t('Search orders'), onChange: searchOrders, placeholder: t('Search orders'), showLabel: false, variant: "outline" }) }), jsx("div", { className: styles['filter'], children: jsx(SelectField, { "data-test-selector": "order-history-filter", label: t('Filter order status'), onChange: filterOrders, options: filterOptions, selectedOption: status, showLabel: false }) }), jsx("div", { "aria-label": t('Results'), "aria-live": "polite", className: styles['results'], children: jsx(DynamicLoadingOverlay, { isLoading: isFetching, children: orders && orders.length > 0 ? (jsx(DataTable, { actions: [
70
75
  {
71
76
  'data-test-selector': 'order-history-reorder',
72
77
  isPrimary: false,
@@ -87,7 +92,7 @@ function OrderHistory() {
87
92
  },
88
93
  sort: { direction: 'DESC', isEnabled: true },
89
94
  value: {
90
- render: order => (jsx(Link, { hasUnderline: true, color: "secondary", "data-test-selector": "order-history-order-link", href: `/my-sonic/order-history/${order.id}`, onClick: () => window?.alert(`open ${order.id}`), children: order.webOrderNumber })),
95
+ render: order => (jsx(Link, { hasUnderline: true, color: "secondary", "data-test-selector": "order-history-order-link", href: `${paths.ACCOUNT_ORDERS}/${order.webOrderNumber}?returnUrl=${encodeURIComponent(`${paths.ACCOUNT_ORDERS}`)}`, children: order.webOrderNumber })),
91
96
  },
92
97
  },
93
98
  {
@@ -154,7 +159,11 @@ function OrderHistory() {
154
159
  label: 'Reorder',
155
160
  },
156
161
  key: 'reorder',
157
- props: { align: 'center', nowrap: true },
162
+ props: {
163
+ align: 'center',
164
+ 'data-test-selector': 'reorderButton',
165
+ nowrap: true,
166
+ },
158
167
  value: { action: 'reorder' },
159
168
  },
160
169
  ], data: orders, onSort: (key, direction) => {
@@ -165,8 +174,17 @@ function OrderHistory() {
165
174
  order: direction,
166
175
  });
167
176
  }, row: {
168
- 'data-test-selector': (order, _) => `tr-${order.id}`,
177
+ 'data-test-selector': (order, _) => `order-${order.id}`,
169
178
  } })) : (!isFetching && (jsx("p", { className: styles['no-results'], children: t('No orders found.') }))) }) }), orders && orders.length > 0 && (jsx("nav", { className: styles['paging'], children: jsx(Pagination, { currentPage: pagination?.currentPage || 1, "data-test-selector": "order-history-pagination", onChange: page => setPage(page), totalPages: pagination?.numberOfPages || 1 }) })), jsx("div", { className: styles['sticky-bar'], role: "presentation" })] }) }));
170
179
  }
180
+ function OrderHistoryPageBreadcrumb() {
181
+ const t = useFormattedMessage();
182
+ const paths = usePaths();
183
+ return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
184
+ { href: paths.HOME, label: t('Home') },
185
+ { href: paths.ACCOUNT, label: t('My Sonic') },
186
+ { href: paths.ACCOUNT_ORDERS, label: t('Orders') },
187
+ ] }) }));
188
+ }
171
189
 
172
- export { OrderHistory };
190
+ export { OrderHistoryPage, OrderHistoryPageBreadcrumb };
@@ -0,0 +1,3 @@
1
+ var styles = {"order-history":"order-history-page-module-A-YGB","search":"order-history-page-module-A-oqW","filter":"order-history-page-module--fnE1","results":"order-history-page-module-Gp4CJ","no-results":"order-history-page-module-ulch1","paging":"order-history-page-module-D35yK","sticky-bar":"order-history-page-module-xgntY"};
2
+
3
+ export { styles as default };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { useState, useRef, useEffect } from 'react';
3
+ import { useState, useRef } from 'react';
4
4
  import { Button } from '../../../buttons/button/button.js';
5
5
  import { TableCard } from '../../../cards/table-card/table-card.js';
6
6
  import { Pagination } from '../../../filters/pagination/pagination.js';
@@ -39,20 +39,21 @@ function ConnectedAddressBookWidget() {
39
39
  pagination: {},
40
40
  shipTos: [],
41
41
  };
42
- useEffect(() => {
43
- scrollIntoViewRef(addressBookRef);
44
- }, [page]);
45
42
  const searchAddresses = (value) => {
46
43
  if (value.length >= 3 || value.length === 0) {
47
44
  setPage(1);
48
45
  setSearch(value);
46
+ scrollIntoViewRef(addressBookRef);
49
47
  }
50
48
  };
51
- return (jsx(TableCard, { stickyHeader: true, actions: [
49
+ return (jsx(TableCard, { ref: addressBookRef, stickyHeader: true, actions: [
52
50
  jsx(SearchField, { isDebounced: true, className: styles['search-field'], "data-test-selector": "address-book-search", label: t('Search'), onChange: searchAddresses, placeholder: t('Search'), showLabel: false, size: "md", variant: "outline" }, "searchAddresses"),
53
51
  jsx(Button, { color: "secondary", "data-test-selector": "address-book-add-address", href: `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/current${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/new?returnUrl=${encodeURIComponent(`${href}#${addressBookId}`)}`, size: "sm", variant: "outline", children: t('Add address') }, "addAddress"),
54
52
  ], className: styles['address-book-widget'], "data-test-selector": "address-book", id: addressBookId, isLoading: isFetching, paging: addresses &&
55
- addresses.length > 0 && (jsx("nav", { className: styles['paging'], children: jsx(Pagination, { currentPage: pagination?.currentPage || 1, onChange: page => setPage(page), totalPages: pagination?.numberOfPages || 1 }) })), results: addresses ? addresses.length : 0, showError: error, title: "Address book", children: jsx("div", { ref: addressBookRef, "aria-label": "Results", "aria-live": "polite", className: styles['results'], children: jsx(DynamicLoadingOverlay, { isLoading: isFetching, children: jsx(DataTable, { actions: [
53
+ addresses.length > 0 && (jsx("nav", { className: styles['paging'], children: jsx(Pagination, { currentPage: pagination?.currentPage || 1, onChange: page => {
54
+ setPage(page);
55
+ scrollIntoViewRef(addressBookRef);
56
+ }, totalPages: pagination?.numberOfPages || 1 }) })), results: addresses ? addresses.length : 0, showError: error, title: "Address book", children: jsx("div", { "aria-label": "Results", "aria-live": "polite", className: styles['results'], children: jsx(DynamicLoadingOverlay, { isLoading: isFetching, children: jsx(DataTable, { actions: [
56
57
  {
57
58
  'data-test-selector': 'edit-address',
58
59
  href: address => `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/current${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/${address.id}?returnUrl=${encodeURIComponent(`${href}#${addressBookId}`)}`,
@@ -163,6 +164,7 @@ function ConnectedAddressBookWidget() {
163
164
  name: key,
164
165
  order: direction,
165
166
  });
167
+ scrollIntoViewRef(addressBookRef);
166
168
  }, row: {
167
169
  'data-test-selector': (address, _) => `address-${address.id}`,
168
170
  selected: (address, _) => address.isDefault,
@@ -5,4 +5,4 @@ export interface ProductListingPageContextType {
5
5
  isError?: boolean;
6
6
  isLoading?: boolean;
7
7
  }
8
- export declare const ProductListingPageContext: import("react").Context<ProductListingPageContextType>;
8
+ export declare const ProductListingPageContext: React.Context<ProductListingPageContextType>;
@@ -0,0 +1 @@
1
+ export declare function useFetchOrderById(id: string): import("@tanstack/react-query").UseQueryResult<import("../../model/storefront.model").OrderModel, Error>;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { useQuery } from '@tanstack/react-query';
3
+ import { fetchOrderById } from '../../services/order-service.js';
4
+
5
+ function useFetchOrderById(id) {
6
+ return useQuery({
7
+ enabled: Boolean(id),
8
+ placeholderData: prev => prev,
9
+ queryFn: () => fetchOrderById(id),
10
+ queryKey: ['order', id],
11
+ });
12
+ }
13
+
14
+ export { useFetchOrderById };
@@ -1,4 +1,5 @@
1
1
  import { JSX } from 'react';
2
+ import { CurrencyCode } from '../../../../intl/types';
2
3
  export interface BaseModel {
3
4
  properties: {
4
5
  [key: string]: string;
@@ -2219,7 +2220,7 @@ export interface OrderModel extends BaseModel {
2219
2220
  btCountry: string;
2220
2221
  canAddAllToCart: boolean;
2221
2222
  canAddToCart: boolean;
2222
- currencyCode: string;
2223
+ currencyCode: CurrencyCode;
2223
2224
  currencySymbol: string;
2224
2225
  customerNumber: string;
2225
2226
  customerPO: string;
@@ -1,4 +1,4 @@
1
- import { OrderCollectionModel, OrderStatus, SortOption } from '../model/storefront.model';
1
+ import { OrderCollectionModel, OrderModel, OrderStatus, SortOption } from '../model/storefront.model';
2
2
  export declare function fetchOrders({ page, pageSize, search, sort, status, }?: {
3
3
  page?: number;
4
4
  pageSize?: number;
@@ -6,3 +6,5 @@ export declare function fetchOrders({ page, pageSize, search, sort, status, }?:
6
6
  sort?: SortOption;
7
7
  status?: OrderStatus;
8
8
  }): Promise<OrderCollectionModel>;
9
+ export type ExpansionType = 'orderLines' | 'shipments' | 'vmidetails';
10
+ export declare function fetchOrderById(id: string, expand?: ExpansionType[]): Promise<OrderModel>;
@@ -25,5 +25,16 @@ async function fetchOrders({ page = 1, pageSize = 20, search, sort, status, } =
25
25
  body.orders?.forEach(order => (order.status = fromApiStatusToOrderStatus(order.status)));
26
26
  return body;
27
27
  }
28
+ async function fetchOrderById(id, expand = ['orderLines', 'shipments']) {
29
+ const { body } = await request({
30
+ credentials: 'include',
31
+ params: {
32
+ expand,
33
+ },
34
+ url: `${config.SHOP_API_URL}/api/v1/orders/${id}`,
35
+ });
36
+ body.status = fromApiStatusToOrderStatus(body.status);
37
+ return body;
38
+ }
28
39
 
29
- export { fetchOrders };
40
+ export { fetchOrderById, fetchOrders };
@@ -0,0 +1,2 @@
1
+ import { OrderModel } from '../api/storefront/model/storefront.model';
2
+ export declare const orderModel: OrderModel;
@@ -0,0 +1,41 @@
1
+ const orderModel = {
2
+ billToCity: 'Basel',
3
+ billToPostalCode: '4051',
4
+ btAddress1: '1 St. Alban-Graben',
5
+ btAddress2: '',
6
+ btAddress3: '',
7
+ btCompanyName: 'TestIt CYPRESSDIDIT StableCHFR',
8
+ btCountry: 'Switzerland',
9
+ currencyCode: 'CHF',
10
+ customerNumber: 'C002733',
11
+ id: 'bedcd4dd-cc40-4a96-aef9-b3440054ae76',
12
+ orderDate: new Date('2025-08-24T00:00:00'),
13
+ orderLines: [
14
+ {
15
+ altText: 'TEST Slotted screwdriver 10mm',
16
+ customerProductNumber: '',
17
+ id: '7199e7c5-a248-44a2-ad37-b3440054ae78',
18
+ lineTotal: 5000,
19
+ mediumImagePath: 'https://images.sonic-equipment.com/TEST13110/test-slotted-screwdriver-10mm_BaseProductImage_13355-002.webp',
20
+ productId: 'd9d13b6a-85c6-488d-8837-b259017ef5ab',
21
+ productUri: '/Product/TEST13110-Slotted-screwdriver-10mm',
22
+ qtyOrdered: 10,
23
+ shortDescription: 'TEST Slotted screwdriver 10mm',
24
+ unitPrice: 500,
25
+ },
26
+ ],
27
+ orderSubTotal: 5000,
28
+ orderTotal: 5405,
29
+ shipToCity: 'Basel',
30
+ shipToPostalCode: '4051',
31
+ shippingAndHandling: 0,
32
+ stAddress1: '1 St. Alban-Graben',
33
+ stAddress2: '',
34
+ stAddress3: '',
35
+ stCompanyName: 'TestIt CYPRESSDIDIT StableCHFR',
36
+ stCountry: 'Switzerland',
37
+ status: 'ForwardToReseller',
38
+ taxAmount: 405,
39
+ };
40
+
41
+ export { orderModel };
@@ -0,0 +1,3 @@
1
+ export declare const useInert: <T extends HTMLElement>(isEnabled: boolean | undefined | null) => {
2
+ ref: React.MutableRefObject<T | null>;
3
+ };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { useRef, useEffect } from 'react';
3
+
4
+ // TODO: when moving to React 19, we should simply set the inert attribute on the element (boolean value)
5
+ const useInert = (isEnabled) => {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ if (isEnabled)
9
+ ref.current?.removeAttribute('inert');
10
+ else
11
+ ref.current?.setAttribute('inert', '');
12
+ }, [isEnabled]);
13
+ return { ref };
14
+ };
15
+
16
+ export { useInert };
@@ -18,7 +18,7 @@ export interface Address {
18
18
  attention: string;
19
19
  city: string;
20
20
  companyName: string;
21
- country: AddressCountry | null | undefined;
21
+ country: AddressCountry | null | undefined | string;
22
22
  email: string;
23
23
  firstName: string;
24
24
  lastName: string;
@@ -15,7 +15,7 @@ declare class GlobalState {
15
15
  get<T>(key: string | symbol, initialState: T | undefined): State<T>;
16
16
  set<T>(key: string | symbol, state: State<T>): void;
17
17
  }
18
- export declare const GlobalStateProviderContext: import("react").Context<GlobalState>;
18
+ export declare const GlobalStateProviderContext: React.Context<GlobalState>;
19
19
  interface GlobalStateProviderProps {
20
20
  children: ReactNode;
21
21
  }
@@ -1,2 +1,2 @@
1
1
  import { RouteContextValue } from './types';
2
- export declare const RouteContext: import("react").Context<RouteContextValue | undefined>;
2
+ export declare const RouteContext: React.Context<RouteContextValue | undefined>;
@@ -1 +1 @@
1
- export declare function useRouteLinkElement(): import("react").ElementType<import("./types").RouteLinkElementProps>;
1
+ export declare function useRouteLinkElement(): React.ElementType<import("./types").RouteLinkElementProps>;
@@ -1,6 +1,6 @@
1
1
  import { NavigateOptions } from './types';
2
2
  export declare function useRouteLink(): {
3
- RouteLinkElement: import("react").ElementType<import("./types").RouteLinkElementProps>;
3
+ RouteLinkElement: React.ElementType<import("./types").RouteLinkElementProps>;
4
4
  getRouteLinkProps: (href: string, route?: NavigateOptions) => {
5
5
  href: string;
6
6
  onNavigate: () => void;
@@ -4,5 +4,5 @@ export interface WithRoutingProps {
4
4
  href?: string;
5
5
  route?: NavigateOptions;
6
6
  }
7
- export declare function withRouting(component: ElementType<RouteLinkElementProps>): import("react").FunctionComponent<RouteLinkElementProps>;
8
- export declare const FallbackRouteLink: import("react").FunctionComponent<RouteLinkElementProps>;
7
+ export declare function withRouting(component: ElementType<RouteLinkElementProps>): React.FunctionComponent<RouteLinkElementProps>;
8
+ export declare const FallbackRouteLink: React.FunctionComponent<RouteLinkElementProps>;
@@ -3,18 +3,20 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
4
  import { IconButton } from '../buttons/icon-button/icon-button.js';
5
5
  import { StrokeCloseboxIcon } from '../icons/stroke/stroke-closebox-icon.js';
6
+ import { useInert } from '../shared/hooks/use-inert.js';
6
7
  import { useSidebar } from './use-sidebar.js';
7
8
  import styles from './sidebar.module.css.js';
8
9
 
9
10
  function Sidebar({ children, className }) {
10
11
  const { isDocked, isOpen, toggle, transition } = useSidebar();
11
- return (jsxs("aside", { "aria-hidden": !isOpen, className: clsx(styles.sidebar, {
12
+ const { ref: sidebarRef } = useInert(isOpen);
13
+ return (jsxs("aside", { ref: sidebarRef, "aria-hidden": !isOpen.toString(), className: clsx(styles.sidebar, {
12
14
  [styles['transition']]: transition,
13
15
  [styles['is-open']]: isOpen,
14
16
  [styles['is-closed']]: !isOpen,
15
17
  [styles['is-docked']]: isDocked,
16
18
  [styles['is-not-docked']]: !isDocked,
17
- }, className), inert: isOpen ? undefined : true, children: [jsx(IconButton, { className: styles.close, color: "secondary", onClick: toggle, children: jsx(StrokeCloseboxIcon, {}) }), jsx("div", { className: styles['content'], children: children })] }));
19
+ }, className), children: [jsx(IconButton, { className: styles.close, color: "secondary", onClick: toggle, children: jsx(StrokeCloseboxIcon, {}) }), jsx("div", { className: styles['content'], children: children })] }));
18
20
  }
19
21
 
20
22
  export { Sidebar };
package/dist/styles.css CHANGED
@@ -4887,7 +4887,7 @@ button.swiper-pagination-bullet {
4887
4887
  cursor: pointer;
4888
4888
  gap: var(--space-2);
4889
4889
  grid-template-areas: 'icon label .';
4890
- grid-template-columns: (--space-24) 1fr var(--space-24);
4890
+ grid-template-columns: var(--space-24) 1fr var(--space-24);
4891
4891
  grid-template-rows: minmax(24px, min-content);
4892
4892
  line-height: 1;
4893
4893
  outline: none;
@@ -8104,6 +8104,7 @@ button.swiper-pagination-bullet {
8104
8104
  display: grid;
8105
8105
  gap: var(--gap) 0;
8106
8106
  grid-template-areas:
8107
+ 'breadcrumb'
8107
8108
  'pre-aside'
8108
8109
  'aside'
8109
8110
  'title'
@@ -8119,6 +8120,7 @@ button.swiper-pagination-bullet {
8119
8120
  --aside-sticky-top: calc(var(--header-bottom, 0) + var(--space-16));
8120
8121
 
8121
8122
  grid-template-areas:
8123
+ 'breadcrumb breadcrumb breadcrumb'
8122
8124
  '. . title'
8123
8125
  'aside . main';
8124
8126
  grid-template-columns: var(--aside-size) var(--gap) 1fr
@@ -8129,6 +8131,7 @@ button.swiper-pagination-bullet {
8129
8131
  --aside-size: clamp(56px, 22%, 308px);
8130
8132
 
8131
8133
  grid-template-areas:
8134
+ 'breadcrumb breadcrumb breadcrumb'
8132
8135
  'pre-aside . title'
8133
8136
  'aside . main';
8134
8137
  grid-template-columns: var(--aside-size) var(--gap) 1fr
@@ -8142,6 +8145,14 @@ button.swiper-pagination-bullet {
8142
8145
  }
8143
8146
  }
8144
8147
 
8148
+ /* pre aside */
8149
+
8150
+ .my-sonic-layout-module-ep0n3 .my-sonic-layout-module-QsEQM {
8151
+ align-self: last baseline;
8152
+ grid-area: breadcrumb;
8153
+ margin-block-end: var(--margin);
8154
+ }
8155
+
8145
8156
  /* title */
8146
8157
 
8147
8158
  .my-sonic-layout-module-ep0n3 .my-sonic-layout-module-yMdPQ {
@@ -8187,6 +8198,10 @@ button.swiper-pagination-bullet {
8187
8198
 
8188
8199
  @media (width >= 768px) {.connected-my-sonic-navigation-module-2iY0- {
8189
8200
  display: none
8201
+ }
8202
+ }
8203
+ @media print {.connected-my-sonic-navigation-module-2iY0- {
8204
+ display: none
8190
8205
  }
8191
8206
  }
8192
8207
 
@@ -8592,7 +8607,106 @@ button.swiper-pagination-bullet {
8592
8607
  inline-size: var(--space-20);
8593
8608
  }
8594
8609
 
8595
- .order-history-module-LrkiZ {
8610
+ .connected-address-book-widget-module-Xd9WN {
8611
+ --height-actions: 42px;
8612
+ --height-title: 22px;
8613
+ }
8614
+
8615
+ .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-9mOgI {
8616
+ --scroll-margin-block-start: calc(
8617
+ var(--header-bottom, 0px) + var(--space-12) * 3 + var(--height-actions) +
8618
+ var(--height-title)
8619
+ );
8620
+
8621
+ scroll-margin-block-start: var(--scroll-margin-block-start, 0);
8622
+ }
8623
+
8624
+ @container (min-width: 636px) {
8625
+
8626
+ .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-9mOgI {
8627
+ --scroll-margin-block-start: calc(
8628
+ var(--header-bottom, 0px) + var(--space-12) * 2 + var(--height-actions)
8629
+ )
8630
+ }
8631
+ }
8632
+
8633
+ .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-g9kHi {
8634
+ block-size: 1em;
8635
+ inline-size: 1em;
8636
+ margin-inline-end: -8px;
8637
+ vertical-align: -0.2em;
8638
+ }
8639
+
8640
+ .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-3ir-C {
8641
+ flex-grow: 1;
8642
+ }
8643
+
8644
+ .status-text-module-63aRD {
8645
+ font-weight: 600;
8646
+ }
8647
+
8648
+ .status-text-module-63aRD[data-status='success'] {
8649
+ color: var(--color-semantic-okay);
8650
+ }
8651
+
8652
+ .status-text-module-63aRD[data-status='critical'] {
8653
+ color: var(--color-semantic-stop);
8654
+ }
8655
+
8656
+ .status-text-module-63aRD[data-status='pending'] {
8657
+ color: var(--color-semantic-notify);
8658
+ }
8659
+
8660
+ .order-details-content-module-aU3VQ {
8661
+ display: grid;
8662
+ gap: var(--space-12);
8663
+ grid-template-columns: repeat(1, minmax(0, 1fr));
8664
+ }
8665
+
8666
+ .order-details-content-module-aU3VQ .order-details-content-module-q0QYm {
8667
+ display: flex;
8668
+ align-items: start;
8669
+ gap: var(--space-8);
8670
+ }
8671
+
8672
+ .order-details-content-module-aU3VQ .order-details-content-module-q0QYm .order-details-content-module-d9sC4 {
8673
+ flex: 1;
8674
+ }
8675
+
8676
+ .order-details-content-module-aU3VQ .order-details-content-module--1w7s dl {
8677
+ display: flex;
8678
+ }
8679
+
8680
+ .order-details-content-module-aU3VQ .order-details-content-module--1w7s dl dt {
8681
+ font-weight: var(--font-weight-bold);
8682
+ }
8683
+
8684
+ .order-details-content-module-aU3VQ .order-details-content-module-BO26h h3 {
8685
+ padding-bottom: var(--space-8);
8686
+ }
8687
+
8688
+ @media print {
8689
+
8690
+ .order-details-content-module-aU3VQ button {
8691
+ display: none
8692
+ }
8693
+ }
8694
+
8695
+ .order-details-content-module-aU3VQ .order-details-content-module-RkRvM,
8696
+ .order-details-content-module-aU3VQ .order-details-content-module-o62H3 {
8697
+ display: flex;
8698
+ justify-content: flex-end;
8699
+ }
8700
+
8701
+ @media print {
8702
+
8703
+ .order-details-content-module-aU3VQ .order-details-content-module-RkRvM,
8704
+ .order-details-content-module-aU3VQ .order-details-content-module-o62H3 {
8705
+ display: none
8706
+ }
8707
+ }
8708
+
8709
+ .order-history-page-module-A-YGB {
8596
8710
  --gap-col: var(--space-8);
8597
8711
  --gap-row: var(--space-8);
8598
8712
  --sticky-z-index: 10;
@@ -8611,7 +8725,7 @@ button.swiper-pagination-bullet {
8611
8725
  scroll-margin-block: calc(var(--sticky-top) + var(--gap-row));
8612
8726
  }
8613
8727
 
8614
- @media (width >= 768px) {.order-history-module-LrkiZ {
8728
+ @media (width >= 768px) {.order-history-page-module-A-YGB {
8615
8729
  --gap-row: var(--space-16);
8616
8730
 
8617
8731
  grid-template-areas:
@@ -8622,7 +8736,7 @@ button.swiper-pagination-bullet {
8622
8736
  }
8623
8737
  }
8624
8738
 
8625
- @media (width >= 1024px) {.order-history-module-LrkiZ {
8739
+ @media (width >= 1024px) {.order-history-page-module-A-YGB {
8626
8740
  grid-template-areas:
8627
8741
  '. search filter'
8628
8742
  'results results results'
@@ -8631,14 +8745,14 @@ button.swiper-pagination-bullet {
8631
8745
  }
8632
8746
  }
8633
8747
 
8634
- @media (width >= 1440px) {.order-history-module-LrkiZ {
8748
+ @media (width >= 1440px) {.order-history-page-module-A-YGB {
8635
8749
  --gap-row: var(--space-20)
8636
8750
  }
8637
8751
  }
8638
8752
 
8639
8753
  /* search */
8640
8754
 
8641
- .order-history-module-LrkiZ .order-history-module-Y18m7 {
8755
+ .order-history-page-module-A-YGB .order-history-page-module-A-oqW {
8642
8756
  position: sticky;
8643
8757
  z-index: var(--sticky-z-index);
8644
8758
  grid-area: search;
@@ -8647,13 +8761,13 @@ button.swiper-pagination-bullet {
8647
8761
 
8648
8762
  /* filter */
8649
8763
 
8650
- .order-history-module-LrkiZ .order-history-module-tBrZG {
8764
+ .order-history-page-module-A-YGB .order-history-page-module--fnE1 {
8651
8765
  grid-area: filter;
8652
8766
  }
8653
8767
 
8654
8768
  @media (width >= 768px) {
8655
8769
 
8656
- .order-history-module-LrkiZ .order-history-module-tBrZG {
8770
+ .order-history-page-module-A-YGB .order-history-page-module--fnE1 {
8657
8771
  position: sticky;
8658
8772
  z-index: var(--sticky-z-index);
8659
8773
  inset-block-start: calc(var(--sticky-top) + var(--gap-row))
@@ -8662,17 +8776,17 @@ button.swiper-pagination-bullet {
8662
8776
 
8663
8777
  /* results */
8664
8778
 
8665
- .order-history-module-LrkiZ .order-history-module-5mST2 {
8779
+ .order-history-page-module-A-YGB .order-history-page-module-Gp4CJ {
8666
8780
  grid-area: results;
8667
8781
  }
8668
8782
 
8669
- .order-history-module-LrkiZ .order-history-module-5mST2 .order-history-module-g-FzV {
8783
+ .order-history-page-module-A-YGB .order-history-page-module-Gp4CJ .order-history-page-module-ulch1 {
8670
8784
  margin-block: var(--space-8);
8671
8785
  }
8672
8786
 
8673
8787
  /* paging */
8674
8788
 
8675
- .order-history-module-LrkiZ .order-history-module-POsiS {
8789
+ .order-history-page-module-A-YGB .order-history-page-module-D35yK {
8676
8790
  grid-area: paging;
8677
8791
  justify-self: center;
8678
8792
  padding-block: var(--gap-row);
@@ -8680,7 +8794,7 @@ button.swiper-pagination-bullet {
8680
8794
 
8681
8795
  /* white bar behind sticky elements */
8682
8796
 
8683
- .order-history-module-LrkiZ .order-history-module-98Tvf {
8797
+ .order-history-page-module-A-YGB .order-history-page-module-xgntY {
8684
8798
  position: sticky;
8685
8799
  z-index: calc(var(--sticky-z-index) - 1);
8686
8800
  margin: calc(var(--gap-row) * -1)
@@ -8694,12 +8808,12 @@ button.swiper-pagination-bullet {
8694
8808
 
8695
8809
  @media (width >= 768px) {
8696
8810
 
8697
- .order-history-module-LrkiZ .order-history-module-98Tvf {
8811
+ .order-history-page-module-A-YGB .order-history-page-module-xgntY {
8698
8812
  margin-inline: 0
8699
8813
  }
8700
8814
  }
8701
8815
 
8702
- .order-history-module-LrkiZ .order-history-module-98Tvf::after {
8816
+ .order-history-page-module-A-YGB .order-history-page-module-xgntY::after {
8703
8817
  position: absolute;
8704
8818
  background: linear-gradient(180deg, var(--shadow) 0%, transparent 100%);
8705
8819
  block-size: var(--space-8);
@@ -8711,45 +8825,11 @@ button.swiper-pagination-bullet {
8711
8825
 
8712
8826
  @container scroll-state(stuck: block-start) {
8713
8827
 
8714
- .order-history-module-LrkiZ .order-history-module-98Tvf::after {
8828
+ .order-history-page-module-A-YGB .order-history-page-module-xgntY::after {
8715
8829
  opacity: 1
8716
8830
  }
8717
8831
  }
8718
8832
 
8719
- .connected-address-book-widget-module-Xd9WN {
8720
- --height-actions: 42px;
8721
- --height-title: 22px;
8722
- }
8723
-
8724
- .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-9mOgI {
8725
- --scroll-margin-block-start: calc(
8726
- var(--header-bottom, 0px) + var(--space-12) * 3 + var(--height-actions) +
8727
- var(--height-title)
8728
- );
8729
-
8730
- scroll-margin-block-start: var(--scroll-margin-block-start, 0);
8731
- }
8732
-
8733
- @container (min-width: 636px) {
8734
-
8735
- .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-9mOgI {
8736
- --scroll-margin-block-start: calc(
8737
- var(--header-bottom, 0px) + var(--space-12) * 2 + var(--height-actions)
8738
- )
8739
- }
8740
- }
8741
-
8742
- .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-g9kHi {
8743
- block-size: 1em;
8744
- inline-size: 1em;
8745
- margin-inline-end: -8px;
8746
- vertical-align: -0.2em;
8747
- }
8748
-
8749
- .connected-address-book-widget-module-Xd9WN .connected-address-book-widget-module-3ir-C {
8750
- flex-grow: 1;
8751
- }
8752
-
8753
8833
  .product-details-page-layout-module-pPtZX {
8754
8834
  display: flex;
8755
8835
  flex-direction: column;