@sonic-equipment/ui 184.0.0 → 186.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 (196) hide show
  1. package/dist/address-info-display/address-info-display.d.ts +2 -2
  2. package/dist/address-info-display/address-info-display.js +1 -1
  3. package/dist/algolia/algolia-multi-select-filter-section.js +1 -1
  4. package/dist/algolia/algolia-sort-by.js +1 -1
  5. package/dist/buttons/add-to-cart-button/add-to-cart-button.js +1 -1
  6. package/dist/cards/data-card/data-card.js +37 -20
  7. package/dist/cards/data-card/data-card.module.css.js +1 -1
  8. package/dist/country-select/country-select.js +1 -1
  9. package/dist/country-select/hooks/use-countries.js +1 -0
  10. package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +2 -6
  11. package/dist/exports.d.ts +43 -23
  12. package/dist/filters/pagination/pagination.js +1 -1
  13. package/dist/forms/elements/checkbox/checkbox.module.css.js +3 -0
  14. package/dist/forms/{field-error → elements/field-error}/field-error.js +1 -1
  15. package/dist/forms/elements/field-error/field-error.module.css.js +3 -0
  16. package/dist/forms/elements/input/input.module.css.js +3 -0
  17. package/dist/forms/elements/label/label.module.css.js +3 -0
  18. package/dist/forms/{select → elements/select}/select.d.ts +2 -1
  19. package/dist/forms/{select → elements/select}/select.js +5 -5
  20. package/dist/forms/elements/select/select.module.css.js +3 -0
  21. package/dist/forms/elements/switch/switch.module.css.js +3 -0
  22. package/dist/forms/elements/textarea/textarea.module.css.js +3 -0
  23. package/dist/forms/{checkbox-field → fields/checkbox-field}/checkbox-field.d.ts +2 -2
  24. package/dist/forms/{checkbox-field → fields/checkbox-field}/checkbox-field.js +4 -4
  25. package/dist/forms/fields/checkbox-field/checkbox-field.module.css.js +3 -0
  26. package/dist/forms/{number-field → fields/number-field}/number-field.d.ts +1 -1
  27. package/dist/forms/{number-field → fields/number-field}/number-field.js +8 -8
  28. package/dist/forms/fields/number-field/number-field.module.css.js +3 -0
  29. package/dist/forms/{search-field → fields/search-field}/search-field.js +3 -3
  30. package/dist/forms/{select-field → fields/select-field}/select-field.d.ts +1 -1
  31. package/dist/forms/{select-field → fields/select-field}/select-field.js +7 -7
  32. package/dist/forms/fields/select-field/select-field.module.css.js +3 -0
  33. package/dist/forms/{switch-field → fields/switch-field}/switch-field.d.ts +2 -2
  34. package/dist/forms/{switch-field → fields/switch-field}/switch-field.js +4 -4
  35. package/dist/forms/fields/switch-field/switch-field.module.css.js +3 -0
  36. package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.js +3 -3
  37. package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.module.css.js +1 -1
  38. package/dist/forms/{text-field → fields/text-field}/text-field.d.ts +1 -1
  39. package/dist/forms/{text-field → fields/text-field}/text-field.js +6 -6
  40. package/dist/forms/fields/text-field/text-field.module.css.js +3 -0
  41. package/dist/forms/layout/form/form-field-layout.module.css.js +3 -0
  42. package/dist/forms/layout/form/form-segment-group.module.css.js +3 -0
  43. package/dist/forms/layout/form/form-segment.module.css.js +3 -0
  44. package/dist/forms/layout/form/form.d.ts +20 -0
  45. package/dist/forms/{form → layout/form}/form.js +4 -4
  46. package/dist/forms/layout/form/form.module.css.js +3 -0
  47. package/dist/forms/partials/edit-address-form/edit-address-form.d.ts +8 -0
  48. package/dist/forms/partials/edit-address-form/edit-address-form.js +35 -0
  49. package/dist/forms/partials/edit-address-form/edit-address-form.module.css.js +3 -0
  50. package/dist/forms/partials/password-validation/password-validation.d.ts +4 -0
  51. package/dist/forms/partials/password-validation/password-validation.js +32 -0
  52. package/dist/index.js +44 -24
  53. package/dist/intl/formatted-message.js +5 -1
  54. package/dist/intl/translation-id.d.ts +1 -1
  55. package/dist/intl/types.d.ts +6 -1
  56. package/dist/intl/use-formatted-message.js +2 -1
  57. package/dist/lists/menu-list/menu-list.d.ts +2 -1
  58. package/dist/lists/menu-list/menu-list.js +2 -2
  59. package/dist/lists/widget-grid/widget-grid.d.ts +5 -0
  60. package/dist/lists/widget-grid/widget-grid.js +9 -0
  61. package/dist/lists/widget-grid/widget-grid.module.css.js +3 -0
  62. package/dist/lists/widget-grid/widget.d.ts +6 -0
  63. package/dist/lists/widget-grid/widget.js +10 -0
  64. package/dist/modals/dialog/dialog.d.ts +5 -5
  65. package/dist/modals/dialog/dialog.js +18 -18
  66. package/dist/modals/dialog/dialog.module.css.js +1 -1
  67. package/dist/modals/favorite/add-to-favorite-dialog.js +2 -2
  68. package/dist/modals/recover-password/recover-password-dialog.js +2 -4
  69. package/dist/pages/account/components/create-account-form/create-account-form.js +8 -23
  70. package/dist/pages/account/components/sign-in-form/sign-in-form.js +6 -6
  71. package/dist/pages/account/create-account-page/create-account-page.js +4 -5
  72. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +1 -1
  73. package/dist/pages/account/sign-in-page/sign-in-page.js +2 -3
  74. package/dist/pages/checkout/components/billing-and-invoice-information.d.ts +3 -3
  75. package/dist/pages/checkout/components/billing-and-invoice-information.js +1 -1
  76. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +26 -20
  77. package/dist/pages/checkout/payment-page/components/payment.js +29 -23
  78. package/dist/pages/checkout/shipping-page/components/{edit-address-form.d.ts → edit-checkout-bill-to-address-form.d.ts} +3 -17
  79. package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.js +49 -0
  80. package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.module.css.js +3 -0
  81. package/dist/pages/checkout/shipping-page/components/readonly-address.js +7 -5
  82. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.d.ts +1 -0
  83. package/dist/pages/checkout/shipping-page/shipping-page-content.js +2 -2
  84. package/dist/pages/checkout/shipping-page/shipping-page.js +2 -2
  85. package/dist/pages/components/page-container/page-container.js +1 -1
  86. package/dist/pages/my-sonic/actions/change-customer/change-customer-dialog.d.ts +4 -3
  87. package/dist/pages/my-sonic/actions/change-customer/change-customer-dialog.js +10 -4
  88. package/dist/pages/my-sonic/actions/change-customer/change-customer.d.ts +5 -2
  89. package/dist/pages/my-sonic/actions/change-customer/change-customer.js +17 -8
  90. package/dist/pages/my-sonic/actions/change-customer/change-customer.module.css.js +1 -1
  91. package/dist/pages/my-sonic/actions/change-customer/connected-change-customer-dialog.d.ts +7 -2
  92. package/dist/pages/my-sonic/actions/change-customer/connected-change-customer-dialog.js +9 -6
  93. package/dist/pages/my-sonic/actions/change-password/change-password-dialog.d.ts +10 -0
  94. package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +24 -0
  95. package/dist/pages/my-sonic/actions/change-password/change-password.d.ts +7 -0
  96. package/dist/pages/my-sonic/actions/change-password/change-password.js +35 -0
  97. package/dist/pages/my-sonic/actions/change-password/change-password.module.css.js +3 -0
  98. package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.d.ts +5 -0
  99. package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +39 -0
  100. package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.d.ts +1 -0
  101. package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.js +8 -0
  102. package/dist/pages/my-sonic/actions/edit-user-info/connected-edit-user-info-dialog.d.ts +5 -0
  103. package/dist/pages/my-sonic/actions/edit-user-info/connected-edit-user-info-dialog.js +56 -0
  104. package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info-dialog.d.ts +10 -0
  105. package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info-dialog.js +15 -0
  106. package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.d.ts +11 -0
  107. package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.js +29 -0
  108. package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.module.css.js +3 -0
  109. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.d.ts +4 -0
  110. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.js +9 -0
  111. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.d.ts +4 -0
  112. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.js +9 -0
  113. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.d.ts +5 -0
  114. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.js +10 -0
  115. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.d.ts +4 -0
  116. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.js +9 -0
  117. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.d.ts +4 -0
  118. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.js +10 -0
  119. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.d.ts +5 -0
  120. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.js +10 -0
  121. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.module.css.js +3 -0
  122. package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.js +3 -4
  123. package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.module.css.js +3 -0
  124. package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.d.ts +2 -1
  125. package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +2 -2
  126. package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.d.ts +2 -1
  127. package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.js +3 -3
  128. package/dist/pages/my-sonic/widgets/connected-customer-information-widget.js +3 -3
  129. package/dist/pages/my-sonic/widgets/connected-user-account-widget.js +16 -5
  130. package/dist/shared/api/shared/hooks/use-awaitable-mutation.d.ts +1 -0
  131. package/dist/shared/api/shared/hooks/use-awaitable-mutation.js +6 -0
  132. package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-account.d.ts +1 -1
  133. package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-account.js +3 -1
  134. package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-guest-account.js +3 -1
  135. package/dist/shared/api/storefront/hooks/account/use-fetch-current-account.d.ts +3 -0
  136. package/dist/shared/api/storefront/hooks/account/use-fetch-current-account.js +13 -0
  137. package/dist/shared/api/storefront/hooks/account/use-patch-current-account.d.ts +11 -0
  138. package/dist/shared/api/storefront/hooks/account/use-patch-current-account.js +20 -0
  139. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.d.ts +1 -0
  140. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -1
  141. package/dist/shared/api/storefront/hooks/cart/use-patch-cart.d.ts +1 -0
  142. package/dist/shared/api/storefront/hooks/cart/use-place-order.d.ts +1 -0
  143. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.d.ts +1 -0
  144. package/dist/shared/api/storefront/services/account-service.d.ts +31 -0
  145. package/dist/shared/api/storefront/services/account-service.js +84 -0
  146. package/dist/shared/api/storefront/services/authentication-service.d.ts +7 -26
  147. package/dist/shared/api/storefront/services/authentication-service.js +38 -65
  148. package/dist/shared/data/countries-languages.data.js +4 -0
  149. package/dist/shared/model/address.d.ts +27 -12
  150. package/dist/shared/model/countries-languages.d.ts +1 -0
  151. package/dist/shared/utils/price.d.ts +1 -1
  152. package/dist/styles.css +751 -627
  153. package/package.json +1 -1
  154. package/dist/forms/checkbox/checkbox.module.css.js +0 -3
  155. package/dist/forms/checkbox-field/checkbox-field.module.css.js +0 -3
  156. package/dist/forms/field-error/field-error.module.css.js +0 -3
  157. package/dist/forms/form/form-field-layout.module.css.js +0 -3
  158. package/dist/forms/form/form-segment-group.module.css.js +0 -3
  159. package/dist/forms/form/form-segment.module.css.js +0 -3
  160. package/dist/forms/form/form.d.ts +0 -16
  161. package/dist/forms/form/form.module.css.js +0 -3
  162. package/dist/forms/input/input.module.css.js +0 -3
  163. package/dist/forms/label/label.module.css.js +0 -3
  164. package/dist/forms/number-field/number-field.module.css.js +0 -3
  165. package/dist/forms/select/select.module.css.js +0 -3
  166. package/dist/forms/select-field/select-field.module.css.js +0 -3
  167. package/dist/forms/switch/switch.module.css.js +0 -3
  168. package/dist/forms/switch-field/switch-field.module.css.js +0 -3
  169. package/dist/forms/text-field/text-field.module.css.js +0 -3
  170. package/dist/forms/textarea/textarea.module.css.js +0 -3
  171. package/dist/pages/checkout/shipping-page/components/edit-address-form.js +0 -68
  172. package/dist/pages/checkout/shipping-page/components/edit-address-form.module.css.js +0 -3
  173. /package/dist/forms/{checkbox → elements/checkbox}/checkbox.d.ts +0 -0
  174. /package/dist/forms/{checkbox → elements/checkbox}/checkbox.js +0 -0
  175. /package/dist/forms/{color-checkbox → elements/color-checkbox}/color-checkbox.d.ts +0 -0
  176. /package/dist/forms/{color-checkbox → elements/color-checkbox}/color-checkbox.js +0 -0
  177. /package/dist/forms/{field-error → elements/field-error}/field-error.d.ts +0 -0
  178. /package/dist/forms/{input → elements/input}/input.d.ts +0 -0
  179. /package/dist/forms/{input → elements/input}/input.js +0 -0
  180. /package/dist/forms/{label → elements/label}/label.d.ts +0 -0
  181. /package/dist/forms/{label → elements/label}/label.js +0 -0
  182. /package/dist/forms/{switch → elements/switch}/switch.d.ts +0 -0
  183. /package/dist/forms/{switch → elements/switch}/switch.js +0 -0
  184. /package/dist/forms/{textarea → elements/textarea}/textarea.d.ts +0 -0
  185. /package/dist/forms/{textarea → elements/textarea}/textarea.js +0 -0
  186. /package/dist/forms/{password-field → fields/password-field}/password-field.d.ts +0 -0
  187. /package/dist/forms/{password-field → fields/password-field}/password-field.js +0 -0
  188. /package/dist/forms/{search-field → fields/search-field}/search-field.d.ts +0 -0
  189. /package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.d.ts +0 -0
  190. /package/dist/forms/{form → layout/form}/form-field-layout.d.ts +0 -0
  191. /package/dist/forms/{form → layout/form}/form-field-layout.js +0 -0
  192. /package/dist/forms/{form → layout/form}/form-segment-group.d.ts +0 -0
  193. /package/dist/forms/{form → layout/form}/form-segment-group.js +0 -0
  194. /package/dist/forms/{form → layout/form}/form-segment.d.ts +0 -0
  195. /package/dist/forms/{form → layout/form}/form-segment.js +0 -0
  196. /package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-guest-account.d.ts +0 -0
@@ -1,13 +1,16 @@
1
1
  import { BillToCollectionModel } from '../../../../shared/api/storefront/model/storefront.model';
2
2
  export interface ChangeCustomerProps {
3
+ allowSetDefault?: boolean;
3
4
  className?: string;
4
5
  data?: BillToCollectionModel;
6
+ defaultCustomerId?: string;
5
7
  error?: Error | null | unknown;
6
8
  filter?: string;
7
9
  isLoading?: boolean;
8
10
  onCustomerSelected?: (id: string) => void;
9
11
  onCustomerSelectionChanged?: (id: string) => void;
10
12
  onFilterChanged?: (filter: string) => void;
11
- selectedId?: string;
13
+ onSetAsDefaultChange?: (setAsDefault: boolean) => void;
14
+ setAsDefault?: boolean;
12
15
  }
13
- export declare function ChangeCustomer({ className, data, error, filter, isLoading, onCustomerSelected, onCustomerSelectionChanged, onFilterChanged, selectedId, }: ChangeCustomerProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ChangeCustomer({ allowSetDefault, className, data, defaultCustomerId, error, filter, isLoading, onCustomerSelected, onCustomerSelectionChanged: _onCustomerSelectionChanged, onFilterChanged, onSetAsDefaultChange, setAsDefault, }: ChangeCustomerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useRef, useMemo } from 'react';
3
+ import { useRef, useState, useCallback, useMemo } from 'react';
4
4
  import { ListBox, ListBoxItem, Text } from 'react-aria-components';
5
5
  import clsx from 'clsx';
6
- import { SearchField } from '../../../../forms/search-field/search-field.js';
6
+ import { Checkbox } from '../../../../forms/elements/checkbox/checkbox.js';
7
+ import { SearchField } from '../../../../forms/fields/search-field/search-field.js';
7
8
  import { SolidRatingIcon } from '../../../../icons/solid/solid-rating-icon.js';
8
9
  import { FormattedMessage } from '../../../../intl/formatted-message.js';
9
10
  import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
@@ -13,13 +14,18 @@ import { HighlightText } from '../../../../text/highlight-text/highlight-text.js
13
14
  import styles from './change-customer.module.css.js';
14
15
 
15
16
  const DEFAULT_PAGE_SIZE = 20;
16
- function ChangeCustomer({ className, data, error, filter = '', isLoading = false, onCustomerSelected, onCustomerSelectionChanged, onFilterChanged, selectedId, }) {
17
+ function ChangeCustomer({ allowSetDefault = false, className, data, defaultCustomerId, error, filter = '', isLoading = false, onCustomerSelected, onCustomerSelectionChanged: _onCustomerSelectionChanged, onFilterChanged, onSetAsDefaultChange, setAsDefault = false, }) {
17
18
  const t = useFormattedMessage();
18
19
  const listBoxRef = useRef(null);
19
20
  const hasMoreResults = !isLoading &&
20
21
  data?.pagination &&
21
22
  data.pagination.totalItemCount > DEFAULT_PAGE_SIZE;
22
- const listBoxItems = useMemo(() => {
23
+ const [hasSelectedIdChanged, setHasSelectedIdChanged] = useState(false);
24
+ const onCustomerSelectionChanged = useCallback((key) => {
25
+ setHasSelectedIdChanged(true);
26
+ return _onCustomerSelectionChanged?.(String(key));
27
+ }, [_onCustomerSelectionChanged]);
28
+ const [listBoxItems, rerenderKey] = useMemo(() => {
23
29
  const listBoxItems = [...(data?.billTos || [])];
24
30
  if (error instanceof UnauthorizedRequestError) {
25
31
  listBoxItems.push({
@@ -42,13 +48,16 @@ function ChangeCustomer({ className, data, error, filter = '', isLoading = false
42
48
  type: 'warning',
43
49
  });
44
50
  }
45
- return listBoxItems;
46
- }, [data?.billTos, error, hasMoreResults, t]);
51
+ return [
52
+ listBoxItems,
53
+ Math.random().toString(36).slice(2, 15) + defaultCustomerId,
54
+ ];
55
+ }, [data?.billTos, error, hasMoreResults, t, defaultCustomerId]);
47
56
  return (jsxs("div", { className: clsx(styles['change-customer-container'], className), children: [jsx(SearchField, { autoFocus: true, isDebounced: true, "aria-controls": "filtered-customer-results-list", isLoading: isLoading, label: t('Search for a customer'), onChange: onFilterChanged, onKeyUp: ({ key }) => {
48
57
  if (key === 'ArrowDown') {
49
58
  listBoxRef.current?.focus();
50
59
  }
51
- }, placeholder: t('Search for a customer'), showLabel: false, size: "md", value: filter, variant: "outline" }), jsx(ListBox, { ref: listBoxRef, "aria-label": "List of customers", "aria-live": "polite", className: styles['list-box'], id: "filtered-customer-results-list", items: listBoxItems, onAction: key => onCustomerSelected?.(String(key)), onSelectionChange: keys => onCustomerSelectionChanged?.(String([...keys][0])), renderEmptyState: () => !isLoading && (jsx(Message, { type: "info", children: jsx(FormattedMessage, { id: "No results found. Please refine your search." }) })), selectionBehavior: "replace", selectionMode: "single", children: listBoxItem => 'type' in listBoxItem ? (jsx(ListBoxItem, { isDisabled: true, children: jsx(Message, { type: listBoxItem.type, children: listBoxItem.message }) }, "marker")) : (jsxs(ListBoxItem, { className: styles['list-box-item'], id: listBoxItem.id, children: [jsxs(Text, { slot: "label", children: [jsxs("div", { className: styles['company-name'], children: [jsx(HighlightText, { className: styles['company-name-text'], highlightText: filter, text: `${listBoxItem.companyName}` }), selectedId === listBoxItem.id && (jsx(SolidRatingIcon, { className: styles['selected-icon'] }))] }), jsx(HighlightText, { className: styles['customer-number'], highlightText: filter, text: `${listBoxItem.customerNumber}` })] }), jsxs(Text, { slot: "description", children: [jsx("div", { children: jsx(HighlightText, { highlightText: filter, text: [
60
+ }, placeholder: t('Search for a customer'), showLabel: false, size: "md", value: filter, variant: "outline" }), jsx(ListBox, { ref: listBoxRef, "aria-label": "List of customers", "aria-live": "polite", className: styles['list-box'], id: "filtered-customer-results-list", items: listBoxItems, onAction: key => onCustomerSelected?.(String(key)), onSelectionChange: keys => onCustomerSelectionChanged(String([...keys][0])), renderEmptyState: () => !isLoading && (jsx(Message, { type: "info", children: jsx(FormattedMessage, { id: "No results found. Please refine your search." }) })), selectionBehavior: "replace", selectionMode: "single", children: listBoxItem => 'type' in listBoxItem ? (jsx(ListBoxItem, { isDisabled: true, textValue: listBoxItem.id, children: jsx(Message, { type: listBoxItem.type, children: jsx(Text, { slot: "description", children: listBoxItem.message }) }) }, "marker")) : (jsxs(ListBoxItem, { className: styles['list-box-item'], id: listBoxItem.id, textValue: listBoxItem.id, children: [jsxs(Text, { slot: "label", children: [jsxs("div", { className: styles['company-name'], children: [jsx(HighlightText, { className: styles['company-name-text'], highlightText: filter, text: `${listBoxItem.companyName}` }), defaultCustomerId === listBoxItem.id && (jsx(SolidRatingIcon, { className: styles['selected-icon'] }))] }), jsx(HighlightText, { className: styles['customer-number'], highlightText: filter, text: `${listBoxItem.customerNumber}` })] }), jsxs(Text, { slot: "description", children: [jsx("div", { children: jsx(HighlightText, { highlightText: filter, text: [
52
61
  [listBoxItem.firstName, listBoxItem.lastName].join(' '),
53
62
  ]
54
63
  .filter(Boolean)
@@ -61,7 +70,7 @@ function ChangeCustomer({ className, data, error, filter = '', isLoading = false
61
70
  .filter(Boolean)
62
71
  .join(', ') }) }), jsx(HighlightText, { highlightText: filter, text: [listBoxItem.postalCode, listBoxItem.country?.name]
63
72
  .filter(Boolean)
64
- .join(', ') })] })] }, listBoxItem.id)) })] }));
73
+ .join(', ') })] })] }, `${listBoxItem.id}-${defaultCustomerId}`)) }, rerenderKey), allowSetDefault && (jsx(Checkbox, { isDisabled: !hasSelectedIdChanged, isSelected: setAsDefault, onChange: onSetAsDefaultChange, value: String(setAsDefault), children: jsx(FormattedMessage, { id: "Make this the default customer" }) }))] }));
65
74
  }
66
75
 
67
76
  export { ChangeCustomer };
@@ -1,3 +1,3 @@
1
- var styles = {"change-customer-container":"change-customer-module-2kOw4","list-box":"change-customer-module-StfiY","list-box-item":"change-customer-module-P7ouY","company-name":"change-customer-module-DSVPN","company-name-text":"change-customer-module-4KQoq","customer-number":"change-customer-module-4p6ab"};
1
+ var styles = {"change-customer-container":"change-customer-module-2kOw4","list-box":"change-customer-module-StfiY","list-box-item":"change-customer-module-P7ouY","selected-icon":"change-customer-module-lxmBJ","company-name":"change-customer-module-DSVPN","company-name-text":"change-customer-module-4KQoq","customer-number":"change-customer-module-4p6ab"};
2
2
 
3
3
  export { styles as default };
@@ -1,2 +1,7 @@
1
- import { ChangeCustomerDialogProps } from './change-customer-dialog';
2
- export declare function ConnectedChangeCustomerDialog({ currentlySelectedCustomerId, isOpen, onClose, onCustomerSelected, }: ChangeCustomerDialogProps): import("react/jsx-runtime").JSX.Element;
1
+ export interface ConnectedChangeCustomerDialogProps {
2
+ allowSetDefault?: boolean;
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onCustomerSelected: (id: string, setAsDefault: boolean) => void;
6
+ }
7
+ export declare function ConnectedChangeCustomerDialog({ allowSetDefault, isOpen, onClose, onCustomerSelected, }: ConnectedChangeCustomerDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -1,25 +1,28 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { useState } from 'react';
3
+ import { useState, useEffect } from 'react';
4
+ import { useFetchCurrentAccount } from '../../../../shared/api/storefront/hooks/account/use-fetch-current-account.js';
4
5
  import { usePatchSession } from '../../../../shared/api/storefront/hooks/authentication/use-patch-session.js';
5
6
  import { useFetchBillToAddresses } from '../../../../shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js';
6
7
  import { ChangeCustomerDialog } from './change-customer-dialog.js';
7
8
 
8
- function ConnectedChangeCustomerDialog({ currentlySelectedCustomerId, isOpen, onClose, onCustomerSelected, }) {
9
+ function ConnectedChangeCustomerDialog({ allowSetDefault = false, isOpen, onClose, onCustomerSelected, }) {
9
10
  const [filter, setFilter] = useState('');
10
- const { error: errorMutation, isLoading: isMutating, mutate, } = usePatchSession();
11
+ const { data: account } = useFetchCurrentAccount();
12
+ const { error: errorMutation, isLoading: isMutating, mutate, reset, } = usePatchSession();
11
13
  const { data, error, isFetching, isLoading } = useFetchBillToAddresses({
12
14
  filter,
13
15
  isEnabled: isOpen,
14
16
  });
15
- return (jsx(ChangeCustomerDialog, { currentlySelectedCustomerId: currentlySelectedCustomerId, data: data, error: error, filter: filter, hasErrorSubmitting: Boolean(errorMutation), isLoading: isLoading || isFetching, isOpen: isOpen, isUpdating: isMutating, onClose: onClose, onCustomerSelected: async (id) => {
17
+ useEffect(() => reset(), [isOpen, reset]);
18
+ return (jsx(ChangeCustomerDialog, { allowSetDefault: allowSetDefault, data: data, defaultCustomerId: account?.defaultCustomerId || undefined, error: error, filter: filter, hasErrorSubmitting: Boolean(errorMutation), isLoading: isLoading || isFetching, isOpen: isOpen, isUpdating: isMutating, onClose: onClose, onCustomerSelected: async (id, setAsDefault) => {
16
19
  id = `${id}`;
17
20
  try {
18
21
  await mutate({
19
22
  session: {
20
23
  billTo: {
21
24
  id,
22
- isDefault: false,
25
+ isDefault: setAsDefault,
23
26
  },
24
27
  billToId: id,
25
28
  customerWasUpdated: false,
@@ -29,7 +32,7 @@ function ConnectedChangeCustomerDialog({ currentlySelectedCustomerId, isOpen, on
29
32
  shipToId: id,
30
33
  },
31
34
  });
32
- onCustomerSelected(id);
35
+ onCustomerSelected(id, setAsDefault);
33
36
  }
34
37
  catch {
35
38
  // Handle error if needed
@@ -0,0 +1,10 @@
1
+ export interface ChangePasswordDialogProps {
2
+ error?: Error | null | unknown;
3
+ isLoading?: boolean;
4
+ isOpen: boolean;
5
+ isUpdating?: boolean;
6
+ onClose: () => void;
7
+ onPasswordChanged: (currentPassword: string, newPassword: string) => void;
8
+ username: string | undefined;
9
+ }
10
+ export declare function ChangePasswordDialog({ error, isLoading, isOpen, isUpdating, onClose, onPasswordChanged, username, }: ChangePasswordDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { FormSegmentGroup } from '../../../../forms/layout/form/form-segment-group.js';
3
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
4
+ import { Dialog } from '../../../../modals/dialog/dialog.js';
5
+ import { UnauthorizedRequestError } from '../../../../shared/fetch/request.js';
6
+ import { ChangePassword } from './change-password.js';
7
+
8
+ function ChangePasswordDialog({ error, isLoading = false, isOpen, isUpdating = false, onClose, onPasswordChanged, username, }) {
9
+ const t = useFormattedMessage();
10
+ return (jsx(Dialog, { allowSubmit: Boolean(username) &&
11
+ !isLoading &&
12
+ !isUpdating &&
13
+ !(error instanceof UnauthorizedRequestError), isOpen: isOpen, onOpenChange: isOpen => !isOpen && onClose(), onSubmit: ({ formData }) => {
14
+ const currentPassword = formData.get('current-password')?.toString();
15
+ const newPassword = formData.get('new-password')?.toString();
16
+ if (!currentPassword)
17
+ throw new Error('current password is required');
18
+ if (!newPassword)
19
+ throw new Error('New password is required');
20
+ onPasswordChanged(currentPassword, newPassword);
21
+ }, title: t('Change password'), children: jsx(FormSegmentGroup, { children: jsx(ChangePassword, { error: error, isLoading: isLoading, isUpdating: isUpdating, username: username }) }) }));
22
+ }
23
+
24
+ export { ChangePasswordDialog };
@@ -0,0 +1,7 @@
1
+ export interface ChangePasswordProps {
2
+ error?: Error | null | unknown;
3
+ isLoading?: boolean;
4
+ isUpdating?: boolean;
5
+ username: string | undefined;
6
+ }
7
+ export declare function ChangePassword({ error, isLoading, isUpdating, username, }: ChangePasswordProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { PasswordField } from '../../../../forms/fields/password-field/password-field.js';
3
+ import { FormSegment } from '../../../../forms/layout/form/form-segment.js';
4
+ import { PasswordValidation } from '../../../../forms/partials/password-validation/password-validation.js';
5
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
6
+ import { ProgressCircle } from '../../../../loading/progress-circle.js';
7
+ import { Message } from '../../../../message/message.js';
8
+ import { NonUniquePasswordError, InvalidPasswordError } from '../../../../shared/api/storefront/services/authentication-service.js';
9
+ import { UnauthorizedRequestError } from '../../../../shared/fetch/request.js';
10
+ import { validatePassword } from '../../../../shared/model/account.js';
11
+ import styles from './change-password.module.css.js';
12
+
13
+ function ChangePassword({ error, isLoading = false, isUpdating = false, username, }) {
14
+ const t = useFormattedMessage();
15
+ if (error instanceof UnauthorizedRequestError) {
16
+ return (jsx(FormSegment, { children: jsx(Message, { type: "danger", children: t('You are not authorized to perform this action') }) }));
17
+ }
18
+ if (isLoading) {
19
+ return (jsx("div", { className: styles['loading-panel'], children: jsx(ProgressCircle, { variant: "gray" }) }));
20
+ }
21
+ if (!username) {
22
+ return jsx(Message, { type: "danger", children: t('An unexpected error occured') });
23
+ }
24
+ return (jsxs(Fragment, { children: [jsxs(FormSegment, { children: [jsx("input", { autoComplete: "username", defaultValue: username, id: "username", name: "username", style: { display: 'none' }, type: "text" }), jsx(PasswordField, { autoComplete: "password", "data-test-selector": "current_password", isDisabled: isUpdating, isRequired: true, label: t('Password'), name: "current-password", validate: value => {
25
+ if (!value)
26
+ return;
27
+ return (validatePassword(value) ||
28
+ t('Password does not meet requirements'));
29
+ } })] }), jsx(PasswordValidation, { isDisabled: isUpdating }), error && (jsx(FormSegment, { children: jsx(Message, { className: styles['error-message'], type: "danger", children: error instanceof NonUniquePasswordError ||
30
+ error instanceof InvalidPasswordError
31
+ ? t(error.message)
32
+ : t('An unexpected error occured') }) }))] }));
33
+ }
34
+
35
+ export { ChangePassword };
@@ -0,0 +1,3 @@
1
+ var styles = {"loading-panel":"change-password-module-hSjXo","error-message":"change-password-module-HyPjt"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,5 @@
1
+ export interface ConnectedChangePasswordDialogProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ }
5
+ export declare function ConnectedChangePasswordDialog({ isOpen, onClose, }: ConnectedChangePasswordDialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,39 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { FormattedMessage } from '../../../../intl/formatted-message.js';
3
+ import { logger } from '../../../../logging/logger.js';
4
+ import { useFetchCurrentAccount } from '../../../../shared/api/storefront/hooks/account/use-fetch-current-account.js';
5
+ import { usePatchSession } from '../../../../shared/api/storefront/hooks/authentication/use-patch-session.js';
6
+ import { useNavigate } from '../../../../shared/routing/use-navigate.js';
7
+ import { useToast } from '../../../../toast/use-toast.js';
8
+ import { PATHS } from '../../../paths.js';
9
+ import { ChangePasswordDialog } from './change-password-dialog.js';
10
+
11
+ function ConnectedChangePasswordDialog({ isOpen, onClose, }) {
12
+ const { error: errorPatchSession, isLoading: isUpdating, mutate: patchSession, } = usePatchSession();
13
+ const { addToast } = useToast();
14
+ const { navigate } = useNavigate();
15
+ const { data: account, error: errorFetchCurrentAccount, isLoading, } = useFetchCurrentAccount({
16
+ isEnabled: isOpen,
17
+ });
18
+ if (!isOpen)
19
+ return null;
20
+ return (jsx(ChangePasswordDialog, { error: errorFetchCurrentAccount || errorPatchSession, isLoading: isLoading, isOpen: isOpen, isUpdating: isUpdating, onClose: onClose, onPasswordChanged: async (currentPassword, newPassword) => {
21
+ logger.info(currentPassword, newPassword);
22
+ await patchSession({
23
+ session: {
24
+ email: account?.email,
25
+ newPassword,
26
+ password: currentPassword,
27
+ },
28
+ });
29
+ addToast({
30
+ body: (jsx(FormattedMessage, { id: "Password changed. Please sign in again." })),
31
+ isUserDismissable: false,
32
+ messageType: 'success',
33
+ });
34
+ onClose();
35
+ navigate(`${PATHS.SIGN_IN}${location?.pathname ? `?returnUrl=${encodeURIComponent(location.pathname + location.search)}` : ''}`);
36
+ }, username: account?.email }));
37
+ }
38
+
39
+ export { ConnectedChangePasswordDialog };
@@ -0,0 +1 @@
1
+ export declare function EditBillToAddress(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { EditAddressForm } from '../../../../forms/partials/edit-address-form/edit-address-form.js';
3
+
4
+ function EditBillToAddress() {
5
+ return (jsx(EditAddressForm, { address: undefined, countries: [], isLoading: false }));
6
+ }
7
+
8
+ export { EditBillToAddress };
@@ -0,0 +1,5 @@
1
+ export interface ConnectedEditUserInfoDialogProps {
2
+ isOpen: boolean;
3
+ onClose?: () => void;
4
+ }
5
+ export declare function ConnectedEditUserInfoDialog({ isOpen, onClose, }: ConnectedEditUserInfoDialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useState, useEffect } from 'react';
4
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
5
+ import { useFetchCurrentAccount } from '../../../../shared/api/storefront/hooks/account/use-fetch-current-account.js';
6
+ import { usePatchCurrentAccount } from '../../../../shared/api/storefront/hooks/account/use-patch-current-account.js';
7
+ import { ExistingAccountError } from '../../../../shared/api/storefront/services/account-service.js';
8
+ import { EditUserInfoDialog } from './edit-user-info-dialog.js';
9
+
10
+ function ConnectedEditUserInfoDialog({ isOpen, onClose, }) {
11
+ const t = useFormattedMessage();
12
+ const [validationErrors, setValidationErrors] = useState({});
13
+ const { data: account, error, isLoading, } = useFetchCurrentAccount({
14
+ isEnabled: isOpen,
15
+ });
16
+ const { error: errorPatchCurrentAccount, isLoading: isMutating, mutate, reset, } = usePatchCurrentAccount();
17
+ useEffect(() => reset(), [isOpen, reset]);
18
+ if (!isOpen)
19
+ return null;
20
+ return (jsx(EditUserInfoDialog, { account: account, error: error || errorPatchCurrentAccount, isLoading: isLoading, isOpen: isOpen, isUpdating: isMutating, onOpenChange: isOpen => !isOpen && onClose?.(), onSubmit: async ({ formData }) => {
21
+ const email = formData.get('email')?.toString();
22
+ if (!email)
23
+ throw new Error('E-mail is required');
24
+ const lastName = formData.get('lastName')?.toString();
25
+ if (!lastName)
26
+ throw new Error('Last name is required');
27
+ const firstName = formData.get('firstName')?.toString();
28
+ if (!firstName)
29
+ throw new Error('First name is required');
30
+ try {
31
+ await mutate({
32
+ account: {
33
+ ...account,
34
+ email,
35
+ firstName,
36
+ lastName,
37
+ },
38
+ });
39
+ onClose?.();
40
+ }
41
+ catch (error) {
42
+ if (error instanceof ExistingAccountError) {
43
+ setValidationErrors(errors => ({
44
+ ...errors,
45
+ email: t('This email is already in use'),
46
+ }));
47
+ reset();
48
+ }
49
+ else {
50
+ throw error;
51
+ }
52
+ }
53
+ }, validationErrors: validationErrors }));
54
+ }
55
+
56
+ export { ConnectedEditUserInfoDialog };
@@ -0,0 +1,10 @@
1
+ import { OnSubmitHandler, ValidationErrors } from '../../../../forms/layout/form/form';
2
+ import { EditUserInfoProps } from './edit-user-info';
3
+ export interface EditUserInfoDialogProps extends EditUserInfoProps {
4
+ isOpen: boolean;
5
+ isUpdating?: boolean;
6
+ onOpenChange?: (isOpen: boolean) => void;
7
+ onSubmit?: OnSubmitHandler;
8
+ validationErrors?: ValidationErrors;
9
+ }
10
+ export declare function EditUserInfoDialog({ account, error, isLoading, isOpen, isUpdating, onOpenChange, onSubmit, validationErrors, }: EditUserInfoDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
4
+ import { Dialog } from '../../../../modals/dialog/dialog.js';
5
+ import { UnauthorizedRequestError } from '../../../../shared/fetch/request.js';
6
+ import { EditUserInfo } from './edit-user-info.js';
7
+
8
+ function EditUserInfoDialog({ account, error, isLoading, isOpen = false, isUpdating = false, onOpenChange, onSubmit, validationErrors, }) {
9
+ const t = useFormattedMessage();
10
+ return (jsx(Dialog, { allowSubmit: !isLoading &&
11
+ !isUpdating &&
12
+ !(error instanceof UnauthorizedRequestError), isOpen: isOpen, isSubmitting: isUpdating, onOpenChange: onOpenChange, onSubmit: onSubmit, title: t('Edit Sonic account'), validationErrors: validationErrors, children: jsx(EditUserInfo, { account: account, error: error, isLoading: isLoading }) }));
13
+ }
14
+
15
+ export { EditUserInfoDialog };
@@ -0,0 +1,11 @@
1
+ import { AccountModel } from '../../../../shared/api/storefront/model/storefront.model';
2
+ export interface EditUserInfoProps {
3
+ account: AccountModel | {
4
+ email: string;
5
+ firstName: string;
6
+ lastName: string;
7
+ } | undefined;
8
+ error?: Error | null | unknown;
9
+ isLoading?: boolean;
10
+ }
11
+ export declare function EditUserInfo({ account, error, isLoading, }: EditUserInfoProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { TextField } from '../../../../forms/fields/text-field/text-field.js';
4
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
5
+ import { ProgressCircle } from '../../../../loading/progress-circle.js';
6
+ import { Message } from '../../../../message/message.js';
7
+ import { UnauthorizedRequestError } from '../../../../shared/fetch/request.js';
8
+ import { validateEmail } from '../../../../shared/model/address.js';
9
+ import styles from './edit-user-info.module.css.js';
10
+
11
+ function EditUserInfo({ account, error, isLoading = false, }) {
12
+ const t = useFormattedMessage();
13
+ if (error instanceof UnauthorizedRequestError) {
14
+ return (jsx(Message, { type: "danger", children: t('You are not authorized to perform this action') }));
15
+ }
16
+ if (isLoading) {
17
+ return (jsx("div", { className: styles['loading-panel'], children: jsx(ProgressCircle, { variant: "gray" }) }));
18
+ }
19
+ if (!account) {
20
+ return jsx(Message, { type: "danger", children: t('An unexpected error occured') });
21
+ }
22
+ return (jsxs(Fragment, { children: [jsx(TextField, { autoComplete: "username", "data-test-selector": "email", defaultValue: account.email, inputMode: "email", isRequired: true, label: t('Email'), name: "email", type: "email", validate: value => {
23
+ if (!value)
24
+ return value;
25
+ return validateEmail(value) || t('Please enter a valid email address');
26
+ } }), jsx(TextField, { "data-test-selector": "firstName", defaultValue: account.firstName, isRequired: true, label: t('First name'), name: "firstName" }), jsx(TextField, { "data-test-selector": "lastName", defaultValue: account.lastName, isRequired: true, label: t('Last name'), name: "lastName" }), error && (jsx(Message, { className: styles['error-message'], type: "danger", children: t('An unexpected error occured') }))] }));
27
+ }
28
+
29
+ export { EditUserInfo };
@@ -0,0 +1,3 @@
1
+ var styles = {"loading-panel":"edit-user-info-module-yQOre","error-message":"edit-user-info-module-2CzVn"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function MySonicLayoutAside({ children }: {
3
+ children?: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import styles from './my-sonic-layout.module.css.js';
4
+
5
+ function MySonicLayoutAside({ children }) {
6
+ return jsx("aside", { className: styles.aside, children: children });
7
+ }
8
+
9
+ export { MySonicLayoutAside };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function MySonicLayoutMain({ children }: {
3
+ children?: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import styles from './my-sonic-layout.module.css.js';
4
+
5
+ function MySonicLayoutMain({ children }) {
6
+ return jsx("main", { className: styles.main, children: children });
7
+ }
8
+
9
+ export { MySonicLayoutMain };
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function MySonicLayoutPage({ children, title, }: {
3
+ children?: ReactNode;
4
+ title: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { MySonicLayoutMain } from './my-sonic-layout-main.js';
4
+ import { MySonicLayoutTitle } from './my-sonic-layout-title.js';
5
+
6
+ function MySonicLayoutPage({ children, title, }) {
7
+ return (jsxs(Fragment, { children: [jsx(MySonicLayoutTitle, { children: title }), jsx(MySonicLayoutMain, { children: children })] }));
8
+ }
9
+
10
+ export { MySonicLayoutPage };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function MySonicLayoutPreAside({ children }: {
3
+ children?: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import styles from './my-sonic-layout.module.css.js';
4
+
5
+ function MySonicLayoutPreAside({ children }) {
6
+ return jsx("div", { className: styles['pre-aside'], children: children });
7
+ }
8
+
9
+ export { MySonicLayoutPreAside };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function MySonicLayoutTitle({ children }: {
3
+ children?: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Heading } from '../../../../typography/heading/heading.js';
4
+ import styles from './my-sonic-layout.module.css.js';
5
+
6
+ function MySonicLayoutTitle({ children }) {
7
+ return (jsx(Heading, { italic: true, breakpoints: { lg: 'm' }, className: styles['title'], "data-test-selector": "pageTitle", size: "s", tag: "h1", children: children }));
8
+ }
9
+
10
+ export { MySonicLayoutTitle };
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export interface MySonicLayoutProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function MySonicLayout({ children }: MySonicLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import clsx from 'clsx';
4
+ import styles from './my-sonic-layout.module.css.js';
5
+
6
+ function MySonicLayout({ children }) {
7
+ return jsx("div", { className: clsx(styles['my-sonic-layout']), children: children });
8
+ }
9
+
10
+ export { MySonicLayout };
@@ -0,0 +1,3 @@
1
+ var styles = {"my-sonic-layout":"my-sonic-layout-module-ep0n3","title":"my-sonic-layout-module-yMdPQ","main":"my-sonic-layout-module-f0Bhf","pre-aside":"my-sonic-layout-module-6pWHC","aside":"my-sonic-layout-module--OEV-"};
2
+
3
+ export { styles as default };
@@ -1,17 +1,16 @@
1
1
  "use client";
2
- import { jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import Cookies from 'js-cookie';
4
4
  import { logger } from '../../../logging/logger.js';
5
5
  import { useSignOut } from '../../../shared/api/storefront/hooks/authentication/use-sign-out.js';
6
- import { useIsBreakpoint } from '../../../shared/hooks/use-is-breakpoint.js';
7
6
  import { useLocation } from '../../../shared/routing/use-location.js';
8
7
  import { useNavigate } from '../../../shared/routing/use-navigate.js';
9
8
  import { PATHS } from '../../paths.js';
10
9
  import { MySonicDesktopNavigation } from './my-sonic-desktop-navigation.js';
11
10
  import { MySonicMobileNavigation } from './my-sonic-mobile-navigation.js';
11
+ import styles from './connected-my-sonic-navigation.module.css.js';
12
12
 
13
13
  function ConnectedMySonicNavigation() {
14
- const isXl = useIsBreakpoint('xl');
15
14
  const { pathname } = useLocation();
16
15
  const { navigate } = useNavigate();
17
16
  const { mutate } = useSignOut({
@@ -22,7 +21,7 @@ function ConnectedMySonicNavigation() {
22
21
  navigate(PATHS.HOME, { reload: true });
23
22
  },
24
23
  });
25
- return (jsx("div", { style: { display: 'grid' }, children: isXl ? (jsx(MySonicDesktopNavigation, { currentPath: pathname, onLogout: mutate })) : (jsx(MySonicMobileNavigation, { currentPath: pathname, onLogout: mutate })) }));
24
+ return (jsxs("div", { style: { display: 'grid' }, children: [jsx(MySonicDesktopNavigation, { className: styles['large'], currentPath: pathname, onLogout: mutate }), jsx(MySonicMobileNavigation, { className: styles['small'], currentPath: pathname, onLogout: mutate })] }));
26
25
  }
27
26
 
28
27
  export { ConnectedMySonicNavigation };
@@ -0,0 +1,3 @@
1
+ var styles = {"small":"connected-my-sonic-navigation-module-2iY0-","large":"connected-my-sonic-navigation-module-MgsX2"};
2
+
3
+ export { styles as default };
@@ -1,6 +1,7 @@
1
1
  interface MySonicDesktopNavigationProps {
2
+ className?: string;
2
3
  currentPath?: string;
3
4
  onLogout?: VoidFunction;
4
5
  }
5
- export declare function MySonicDesktopNavigation({ currentPath, onLogout, }: MySonicDesktopNavigationProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function MySonicDesktopNavigation({ className, currentPath, onLogout, }: MySonicDesktopNavigationProps): import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -5,8 +5,8 @@ import { MenuListItem } from '../../../lists/menu-list/menu-list-item.js';
5
5
  import { mySonicNavigationItems } from './my-sonic-navigation-items.js';
6
6
  import styles from './my-sonic-desktop-navigation.module.css.js';
7
7
 
8
- function MySonicDesktopNavigation({ currentPath, onLogout, }) {
9
- return (jsx(MenuList, { children: mySonicNavigationItems.map(item => (jsx(MenuListItem, { hasChildren: true, badge: jsx(item.Icon, {}), ...(item.type === 'action'
8
+ function MySonicDesktopNavigation({ className, currentPath, onLogout, }) {
9
+ return (jsx(MenuList, { className: className, children: mySonicNavigationItems.map(item => (jsx(MenuListItem, { hasChildren: true, badge: jsx(item.Icon, {}), ...(item.type === 'action'
10
10
  ? item.action === 'logout'
11
11
  ? { onClick: onLogout }
12
12
  : {}