@faststore/core 4.4.0-dev.0 → 4.4.0-dev.1

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 (207) hide show
  1. package/.turbo/turbo-generate.log +3 -3
  2. package/.turbo/turbo-test.log +48 -48
  3. package/CHANGELOG.md +6 -0
  4. package/README.md +2 -1
  5. package/cms/faststore/my-account/README.md +36 -0
  6. package/cms/faststore/my-account/components/cms_component__accountnavigation.jsonc +59 -0
  7. package/cms/faststore/my-account/components/cms_component__accountorderbudgets.jsonc +39 -0
  8. package/cms/faststore/my-account/components/cms_component__accountorderdelivery.jsonc +69 -0
  9. package/cms/faststore/my-account/components/cms_component__accountorderdetails.jsonc +79 -0
  10. package/cms/faststore/my-account/components/cms_component__accountordermoreinfo.jsonc +19 -0
  11. package/cms/faststore/my-account/components/cms_component__accountorderorderedby.jsonc +19 -0
  12. package/cms/faststore/my-account/components/cms_component__accountorderpayment.jsonc +69 -0
  13. package/cms/faststore/my-account/components/cms_component__accountorderslist.jsonc +154 -0
  14. package/cms/faststore/my-account/components/cms_component__accountorderstatus.jsonc +44 -0
  15. package/cms/faststore/my-account/components/cms_component__accountordersummary.jsonc +29 -0
  16. package/cms/faststore/my-account/components/cms_component__accountprofile.jsonc +39 -0
  17. package/cms/faststore/my-account/components/cms_component__accountsecurity.jsonc +104 -0
  18. package/cms/faststore/my-account/components/cms_component__accountunauthorized.jsonc +29 -0
  19. package/cms/faststore/my-account/components/cms_component__accountuserdetails.jsonc +49 -0
  20. package/cms/faststore/my-account/pages/cms_content_type__myaccountorderdetails.jsonc +18 -0
  21. package/cms/faststore/my-account/pages/cms_content_type__myaccountorders.jsonc +18 -0
  22. package/cms/faststore/my-account/pages/cms_content_type__myaccountprofile.jsonc +18 -0
  23. package/cms/faststore/my-account/pages/cms_content_type__myaccountsecurity.jsonc +18 -0
  24. package/cms/faststore/my-account/pages/cms_content_type__myaccountunauthorized.jsonc +18 -0
  25. package/cms/faststore/my-account/pages/cms_content_type__myaccountuserdetails.jsonc +18 -0
  26. package/package.json +6 -6
  27. package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawerBody.tsx +15 -3
  28. package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationSignInButton/OrganizationSignInButton.tsx +5 -1
  29. package/src/components/account/{MyAccountDrawer → Drawer}/ProfileSummary/ProfileSummary.tsx +12 -2
  30. package/src/components/account/Layout/Layout.tsx +46 -0
  31. package/src/components/account/Layout/index.ts +1 -0
  32. package/src/components/account/{MyAccountLayout → Layout}/styles.scss +2 -2
  33. package/src/components/account/{MyAccountMenu/MyAccountMenu.tsx → Menu/Menu.tsx} +8 -10
  34. package/src/components/account/Menu/index.ts +1 -0
  35. package/src/components/account/UserDetails/UserDetails.tsx +54 -0
  36. package/src/components/account/UserDetails/index.ts +1 -0
  37. package/src/components/account/{MyAccountUserDetails → UserDetails}/styles.module.scss +2 -2
  38. package/src/components/account/UserDetails/userDetailsLabels.ts +25 -0
  39. package/src/components/account/components/{MyAccountAccordion/MyAccountAccordion.tsx → Accordion/Accordion.tsx} +2 -4
  40. package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionButton.tsx → Accordion/AccordionButton.tsx} +3 -7
  41. package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionItem.tsx → Accordion/AccordionItem.tsx} +3 -7
  42. package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionPanel.tsx → Accordion/AccordionPanel.tsx} +3 -3
  43. package/src/components/account/components/Accordion/index.ts +4 -0
  44. package/src/components/account/components/{MyAccountCard/MyAccountCard.tsx → Card/Card.tsx} +2 -4
  45. package/src/components/account/components/Card/index.ts +1 -0
  46. package/src/components/account/components/{MyAccountHeader/MyAccountHeader.tsx → Header/Header.tsx} +3 -3
  47. package/src/components/account/components/Header/index.ts +1 -0
  48. package/src/components/account/components/StatusBadge/StatusBadge.tsx +43 -0
  49. package/src/components/account/components/StatusBadge/index.ts +1 -0
  50. package/src/components/account/components/{MyAccountTable/MyAccountTable.tsx → Table/Table.tsx} +3 -3
  51. package/src/components/account/components/Table/index.ts +1 -0
  52. package/src/components/account/components/Tag/index.ts +1 -0
  53. package/src/components/account/index.ts +2 -2
  54. package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetDateRange/FilterFacetDateRange.tsx +128 -0
  55. package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetDateRange/index.ts +2 -0
  56. package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval/MyAccountFilterFacetPendingApproval.tsx → ListOrders/FilterSlider/FilterFacetPendingApproval/FilterFacetPendingApproval.tsx} +4 -4
  57. package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetPendingApproval/index.ts +2 -0
  58. package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterSlider.tsx → ListOrders/FilterSlider/FilterSlider.tsx} +13 -4
  59. package/src/components/account/orders/ListOrders/FilterSlider/index.ts +1 -0
  60. package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider → ListOrders/FilterSlider}/section.module.scss +2 -2
  61. package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrders.tsx → ListOrders/ListOrders.tsx} +53 -30
  62. package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable → ListOrders/ListOrdersTable}/ExpandButton/ExpandButton.tsx +5 -1
  63. package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx → ListOrders/ListOrdersTable/ListOrdersTable.tsx} +35 -12
  64. package/src/components/account/orders/ListOrders/ListOrdersTable/index.ts +1 -0
  65. package/src/components/account/orders/{MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx → ListOrders/SelectedTags/SelectedTags.tsx} +24 -14
  66. package/src/components/account/orders/ListOrders/SelectedTags/index.ts +1 -0
  67. package/src/components/account/orders/ListOrders/index.ts +1 -0
  68. package/src/components/account/orders/ListOrders/listOrdersLabels.ts +112 -0
  69. package/src/components/account/orders/{MyAccountListOrders → ListOrders}/styles.module.scss +3 -3
  70. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBudgetsCard/MyAccountBudgetsCard.tsx → OrderDetails/BudgetsCard/BudgetsCard.tsx} +18 -11
  71. package/src/components/account/orders/OrderDetails/BudgetsCard/index.ts +1 -0
  72. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBuyingPolicyAlert/MyAccountBuyingPolicyAlert.tsx → OrderDetails/BuyingPolicyAlert/BuyingPolicyAlert.tsx} +46 -20
  73. package/src/components/account/orders/OrderDetails/BuyingPolicyAlert/index.ts +1 -0
  74. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryCard/MyAccountDeliveryCard.tsx → OrderDetails/DeliveryCard/DeliveryCard.tsx} +16 -15
  75. package/src/components/account/orders/OrderDetails/DeliveryCard/index.ts +1 -0
  76. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordion.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordion.tsx} +38 -25
  77. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionDeliveryInfo.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordionDeliveryInfo.tsx} +4 -4
  78. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionProducts.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordionProducts.tsx} +7 -10
  79. package/src/components/account/orders/OrderDetails/DeliveryOptionAccordion/index.ts +6 -0
  80. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountMoreInformationCard/MyAccountMoreInformationCard.tsx → OrderDetails/MoreInformationCard/MoreInformationCard.tsx} +10 -7
  81. package/src/components/account/orders/OrderDetails/MoreInformationCard/index.ts +1 -0
  82. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActionModal/MyAccountOrderActionModal.tsx → OrderDetails/OrderActionModal/OrderActionModal.tsx} +3 -3
  83. package/src/components/account/orders/OrderDetails/OrderActionModal/index.ts +1 -0
  84. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActions/MyAccountOrderActions.tsx → OrderDetails/OrderActions/OrderActions.tsx} +19 -12
  85. package/src/components/account/orders/OrderDetails/OrderActions/index.ts +1 -0
  86. package/src/components/account/orders/OrderDetails/OrderDetails.tsx +92 -0
  87. package/src/components/account/orders/OrderDetails/OrderDetailsHeader.tsx +89 -0
  88. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderedByCard/MyAccountOrderedByCard.tsx → OrderDetails/OrderedByCard/OrderedByCard.tsx} +9 -7
  89. package/src/components/account/orders/OrderDetails/OrderedByCard/index.ts +1 -0
  90. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentCard.tsx → OrderDetails/PaymentCard/PaymentCard.tsx} +42 -27
  91. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentFlagsIcon.tsx → OrderDetails/PaymentCard/PaymentFlagsIcon.tsx} +3 -3
  92. package/src/components/account/orders/OrderDetails/PaymentCard/index.ts +1 -0
  93. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountReorderButton/MyAccountReorderButton.tsx → OrderDetails/ReorderButton/ReorderButton.tsx} +6 -4
  94. package/src/components/account/orders/OrderDetails/ReorderButton/index.ts +2 -0
  95. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard/MyAccountStatusCard.tsx → OrderDetails/StatusCard/StatusCard.tsx} +29 -8
  96. package/src/components/account/orders/OrderDetails/StatusCard/index.ts +1 -0
  97. package/src/components/account/orders/{MyAccountOrderDetails/MyAccountSummaryCard/MyAccountSummaryCard.tsx → OrderDetails/SummaryCard/SummaryCard.tsx} +16 -9
  98. package/src/components/account/orders/OrderDetails/SummaryCard/index.ts +1 -0
  99. package/src/components/account/orders/OrderDetails/index.ts +10 -0
  100. package/src/components/account/orders/OrderDetails/orderDetailsLabels.ts +204 -0
  101. package/src/components/account/orders/{MyAccountOrderDetails → OrderDetails}/section.module.scss +14 -14
  102. package/src/components/account/profile/profile.module.scss +1 -1
  103. package/src/components/account/profile/profile.tsx +31 -8
  104. package/src/components/account/section.module.scss +1 -1
  105. package/src/components/account/security/SecurityDrawer.tsx +29 -20
  106. package/src/components/account/security/SecuritySection.tsx +17 -6
  107. package/src/components/account/security/securityLabels.ts +47 -0
  108. package/src/components/account/security/styles.module.scss +1 -1
  109. package/src/components/cms/account/Components.ts +53 -0
  110. package/src/components/navigation/Navbar/Navbar.tsx +1 -1
  111. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +1 -1
  112. package/src/components/sections/Account/AccountNavigation.tsx +5 -0
  113. package/src/components/sections/Account/AccountOrderBudgets.tsx +35 -0
  114. package/src/components/sections/Account/AccountOrderDelivery.tsx +57 -0
  115. package/src/components/sections/Account/AccountOrderDetails.tsx +57 -0
  116. package/src/components/sections/Account/AccountOrderMoreInfo.tsx +39 -0
  117. package/src/components/sections/Account/AccountOrderOrderedBy.tsx +36 -0
  118. package/src/components/sections/Account/AccountOrderPayment.tsx +36 -0
  119. package/src/components/sections/Account/AccountOrderStatus.tsx +49 -0
  120. package/src/components/sections/Account/AccountOrderSummary.tsx +36 -0
  121. package/src/components/sections/Account/AccountOrdersList.tsx +89 -0
  122. package/src/components/sections/Account/AccountProfile.tsx +46 -0
  123. package/src/components/sections/Account/AccountSecurity.tsx +65 -0
  124. package/src/components/sections/Account/AccountUnauthorized.tsx +40 -0
  125. package/src/components/sections/Account/AccountUserDetails.tsx +43 -0
  126. package/src/experimental/index.ts +1 -1
  127. package/src/pages/_app.tsx +1 -1
  128. package/src/pages/pvt/account/403.tsx +43 -50
  129. package/src/pages/pvt/account/404.tsx +3 -3
  130. package/src/pages/pvt/account/orders/[id].tsx +58 -13
  131. package/src/pages/pvt/account/orders/index.tsx +59 -48
  132. package/src/pages/pvt/account/profile.tsx +64 -33
  133. package/src/pages/pvt/account/security.tsx +66 -32
  134. package/src/pages/pvt/account/user-details.tsx +67 -37
  135. package/src/sdk/account/accountPageContext.ts +73 -0
  136. package/src/sdk/account/getMyAccountRoutes.ts +48 -3
  137. package/src/sdk/overrides/PageProvider.tsx +3 -1
  138. package/src/server/cms/fetchMyAccountPageContent.ts +45 -0
  139. package/src/server/cms/myAccountDefaultSections.ts +73 -0
  140. package/src/utils/userOrderStatus.ts +129 -0
  141. package/test/utils/userOrderStatus.test.ts +36 -0
  142. package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +0 -32
  143. package/src/components/account/MyAccountLayout/index.ts +0 -1
  144. package/src/components/account/MyAccountMenu/index.ts +0 -1
  145. package/src/components/account/MyAccountUserDetails/MyAccountUserDetails.tsx +0 -46
  146. package/src/components/account/MyAccountUserDetails/index.ts +0 -1
  147. package/src/components/account/components/MyAccountAccordion/index.ts +0 -4
  148. package/src/components/account/components/MyAccountCard/index.ts +0 -1
  149. package/src/components/account/components/MyAccountHeader/index.ts +0 -1
  150. package/src/components/account/components/MyAccountStatusBadge/MyAccountStatusBadge.tsx +0 -28
  151. package/src/components/account/components/MyAccountStatusBadge/index.ts +0 -1
  152. package/src/components/account/components/MyAccountTable/index.ts +0 -1
  153. package/src/components/account/components/MyAccountTag/index.ts +0 -1
  154. package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/MyAccountFilterFacetDateRange.tsx +0 -113
  155. package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/index.ts +0 -2
  156. package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval/index.ts +0 -2
  157. package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/index.ts +0 -1
  158. package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/index.ts +0 -1
  159. package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/index.ts +0 -1
  160. package/src/components/account/orders/MyAccountListOrders/index.ts +0 -1
  161. package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/index.ts +0 -1
  162. package/src/components/account/orders/MyAccountOrderDetails/MyAccountBuyingPolicyAlert/index.ts +0 -1
  163. package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryCard/index.ts +0 -1
  164. package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/index.ts +0 -6
  165. package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/index.ts +0 -1
  166. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/index.ts +0 -1
  167. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/index.ts +0 -1
  168. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderDetails.tsx +0 -136
  169. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/index.ts +0 -1
  170. package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/index.ts +0 -1
  171. package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/index.ts +0 -2
  172. package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/index.ts +0 -1
  173. package/src/components/account/orders/MyAccountOrderDetails/MyAccountSummaryCard/index.ts +0 -1
  174. package/src/components/account/orders/MyAccountOrderDetails/index.ts +0 -1
  175. package/src/components/account/profile/i18n.ts +0 -7
  176. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawer.tsx +0 -0
  177. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawerHeader.tsx +0 -0
  178. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/index.ts +0 -0
  179. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/section.module.scss +0 -0
  180. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/useReloadAfterLogoutReturn.ts +0 -0
  181. /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationSignInButton/index.ts +0 -0
  182. /package/src/components/account/{MyAccountDrawer → Drawer}/ProfileSummary/profile-summary.scss +0 -0
  183. /package/src/components/account/{MyAccountMenu → Menu}/styles.scss +0 -0
  184. /package/src/components/account/components/{MyAccountAccordion → Accordion}/styles.scss +0 -0
  185. /package/src/components/account/components/{MyAccountCard → Card}/styles.scss +0 -0
  186. /package/src/components/account/components/{MyAccountHeader → Header}/styles.scss +0 -0
  187. /package/src/components/account/components/{MyAccountStatusBadge → StatusBadge}/styles.scss +0 -0
  188. /package/src/components/account/components/{MyAccountTable → Table}/styles.scss +0 -0
  189. /package/src/components/account/components/{MyAccountTag/MyAccountTag.tsx → Tag/Tag.tsx} +0 -0
  190. /package/src/components/account/components/{MyAccountTag → Tag}/styles.scss +0 -0
  191. /package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange → ListOrders/FilterSlider/FilterFacetDateRange}/styles.scss +0 -0
  192. /package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval → ListOrders/FilterSlider/FilterFacetPendingApproval}/styles.scss +0 -0
  193. /package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable → ListOrders/ListOrdersTable}/styles.scss +0 -0
  194. /package/src/components/account/orders/{MyAccountListOrders/MyAccountSelectedTags → ListOrders/SelectedTags}/styles.scss +0 -0
  195. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBudgetsCard → OrderDetails/BudgetsCard}/styles.scss +0 -0
  196. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBuyingPolicyAlert → OrderDetails/BuyingPolicyAlert}/styles.scss +0 -0
  197. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryCard → OrderDetails/DeliveryCard}/styles.scss +0 -0
  198. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion → OrderDetails/DeliveryOptionAccordion}/styles.scss +0 -0
  199. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountMoreInformationCard → OrderDetails/MoreInformationCard}/styles.scss +0 -0
  200. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActionModal → OrderDetails/OrderActionModal}/styles.module.scss +0 -0
  201. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActions → OrderDetails/OrderActions}/styles.scss +0 -0
  202. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderedByCard → OrderDetails/OrderedByCard}/styles.scss +0 -0
  203. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard → OrderDetails/PaymentCard}/styles.scss +0 -0
  204. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountReorderButton → OrderDetails/ReorderButton}/styles.scss +0 -0
  205. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard → OrderDetails/StatusCard}/styles.scss +0 -0
  206. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard → OrderDetails/StatusCard}/useConnectorPositioning.ts +0 -0
  207. /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountSummaryCard → OrderDetails/SummaryCard}/styles.scss +0 -0
@@ -1,6 +1,7 @@
1
1
  import { Button, Icon } from '@faststore/ui'
2
2
  import Link from 'next/link'
3
3
  import type { ReactNode } from 'react'
4
+ import { useAccountNavigationLabels } from 'src/sdk/account/accountPageContext'
4
5
  import { useSession } from 'src/sdk/session'
5
6
 
6
7
  export type ProfileSummaryProps = {
@@ -8,6 +9,8 @@ export type ProfileSummaryProps = {
8
9
  orgName: string
9
10
  bordered?: boolean
10
11
  showManageLink?: boolean
12
+ manageLabel?: string
13
+ logoutLabel?: string
11
14
  person: {
12
15
  image?: ReactNode
13
16
  name: string
@@ -21,9 +24,16 @@ export const ProfileSummary = ({
21
24
  orgName,
22
25
  bordered = false,
23
26
  showManageLink = false,
27
+ manageLabel: manageLabelProp,
28
+ logoutLabel: logoutLabelProp,
24
29
  ...otherProps
25
30
  }: ProfileSummaryProps) => {
26
31
  const { b2b } = useSession()
32
+ const navigationLabels = useAccountNavigationLabels()
33
+ const manageLabel =
34
+ manageLabelProp ?? navigationLabels?.manageLabel ?? 'Manage'
35
+ const logoutLabel =
36
+ logoutLabelProp ?? navigationLabels?.logoutLabel ?? 'Logout'
27
37
 
28
38
  return (
29
39
  <section
@@ -38,7 +48,7 @@ export const ProfileSummary = ({
38
48
  data-fs-profile-summary-org-link
39
49
  href={`/pvt/organization-account/org-unit/${b2b?.unitId}`}
40
50
  >
41
- Manage <Icon name="OpenInNew" width={23} height={23} />
51
+ {manageLabel} <Icon name="OpenInNew" width={23} height={23} />
42
52
  </Link>
43
53
  )}
44
54
  </div>
@@ -58,7 +68,7 @@ export const ProfileSummary = ({
58
68
  variant="tertiary"
59
69
  size="small"
60
70
  >
61
- Logout
71
+ {logoutLabel}
62
72
  </Button>
63
73
  </div>
64
74
  </section>
@@ -0,0 +1,46 @@
1
+ import type { PropsWithChildren } from 'react'
2
+ import menuRoutes from 'src/customizations/src/myAccount/navigation'
3
+ import {
4
+ type AccountNavigationLabels,
5
+ USER_DETAILS_ROUTE,
6
+ getExtraMyAccountRoutes,
7
+ getMyAccountRoutes,
8
+ } from 'src/sdk/account/getMyAccountRoutes'
9
+ import Menu from '../Menu'
10
+ import styles from '../section.module.scss'
11
+
12
+ export type LayoutProps = {
13
+ accountName: string
14
+ isRepresentative?: boolean
15
+ navigationLabels?: AccountNavigationLabels
16
+ }
17
+
18
+ const ROUTES_ONLY_FOR_REPRESENTATIVE = [USER_DETAILS_ROUTE]
19
+
20
+ const Layout = ({
21
+ children,
22
+ accountName,
23
+ isRepresentative = true,
24
+ navigationLabels,
25
+ }: PropsWithChildren<LayoutProps>) => {
26
+ const menuItems = navigationLabels
27
+ ? getMyAccountRoutes({
28
+ routes: getExtraMyAccountRoutes(menuRoutes),
29
+ labels: navigationLabels,
30
+ })
31
+ : menuRoutes
32
+
33
+ const routes = isRepresentative
34
+ ? menuItems
35
+ : menuItems.filter(
36
+ ({ route }) => !ROUTES_ONLY_FOR_REPRESENTATIVE.includes(route)
37
+ )
38
+
39
+ return (
40
+ <section className={styles.layout}>
41
+ <Menu accountName={accountName} items={routes} />
42
+ <div data-fs-account-layout-content>{children}</div>
43
+ </section>
44
+ )
45
+ }
46
+ export default Layout
@@ -0,0 +1 @@
1
+ export { default } from './Layout'
@@ -9,8 +9,8 @@
9
9
  @include meta.load-css("~@faststore/ui/src/components/atoms/Input/styles.scss");
10
10
  @include meta.load-css("~@faststore/ui/src/components/molecules/LinkButton/styles.scss");
11
11
  @include meta.load-css("~@faststore/ui/src/components/molecules/SearchInputField/styles.scss");
12
- @include meta.load-css("../MyAccountMenu/styles.scss");
13
- @include meta.load-css("../components/MyAccountHeader/styles.scss");
12
+ @include meta.load-css("../Menu/styles.scss");
13
+ @include meta.load-css("../components/Header/styles.scss");
14
14
 
15
15
  display: grid;
16
16
  grid-template-rows: auto 1fr;
@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
3
3
 
4
4
  import styles from '../section.module.scss'
5
5
 
6
+ import { useAccountNavigationLabels } from 'src/sdk/account/accountPageContext'
6
7
  import useScreenResize from 'src/sdk/ui/useScreenResize'
7
8
 
8
9
  interface NavItem {
@@ -10,14 +11,13 @@ interface NavItem {
10
11
  route: string
11
12
  }
12
13
 
13
- export interface MyAccountMenuProps
14
- extends React.HTMLAttributes<HTMLDivElement> {
14
+ export interface MenuProps extends React.HTMLAttributes<HTMLDivElement> {
15
15
  avatarImageUrl?: string
16
16
  accountName: string
17
17
  items: NavItem[]
18
18
  }
19
19
 
20
- const Nav = ({ items }: Pick<MyAccountMenuProps, 'items'>) => {
20
+ const Nav = ({ items }: Pick<MenuProps, 'items'>) => {
21
21
  const router = useRouter()
22
22
  const currentRoute = router.pathname
23
23
 
@@ -38,12 +38,10 @@ const Nav = ({ items }: Pick<MyAccountMenuProps, 'items'>) => {
38
38
  )
39
39
  }
40
40
 
41
- const MyAccountMenu = ({
42
- avatarImageUrl,
43
- accountName,
44
- items,
45
- }: MyAccountMenuProps) => {
41
+ const Menu = ({ avatarImageUrl, accountName, items }: MenuProps) => {
46
42
  const { isDesktop } = useScreenResize()
43
+ const navigationLabels = useAccountNavigationLabels()
44
+ const switchLabel = navigationLabels?.switchLabel ?? 'Switch'
47
45
 
48
46
  return (
49
47
  <div className={styles.menu}>
@@ -62,7 +60,7 @@ const MyAccountMenu = ({
62
60
  variant="secondary"
63
61
  size="small"
64
62
  >
65
- Switch
63
+ {switchLabel}
66
64
  </Button>
67
65
  </div>
68
66
  ) : null}
@@ -71,4 +69,4 @@ const MyAccountMenu = ({
71
69
  )
72
70
  }
73
71
 
74
- export default MyAccountMenu
72
+ export default Menu
@@ -0,0 +1 @@
1
+ export { default } from './Menu'
@@ -0,0 +1,54 @@
1
+ import Tag from '../components/Tag'
2
+ import AccountTable from '../components/Table'
3
+ import AccountHeader from '../components/Header'
4
+ import {
5
+ type UserDetailsSectionLabels,
6
+ resolveUserDetailsLabels,
7
+ } from './userDetailsLabels'
8
+ import styles from './styles.module.scss'
9
+
10
+ type UserDetailsProps = {
11
+ userDetails: {
12
+ username: string
13
+ name: string
14
+ email: string
15
+ phone: string
16
+ role: string[]
17
+ orgUnit: string
18
+ }
19
+ labels?: UserDetailsSectionLabels
20
+ }
21
+
22
+ export default function UserDetails({
23
+ userDetails: { username, name, email, phone, role, orgUnit },
24
+ labels: labelsProp,
25
+ }: UserDetailsProps) {
26
+ const labels = resolveUserDetailsLabels(labelsProp)
27
+
28
+ return (
29
+ <section className={styles.section}>
30
+ <AccountHeader pageTitle={labels.pageTitle} />
31
+ <div data-fs-user-details-container>
32
+ <AccountTable
33
+ rows={[
34
+ { heading: labels.nameLabel, data: name ? name : '–' },
35
+ { heading: labels.usernameLabel, data: username ? username : '–' },
36
+ { heading: labels.phoneLabel, data: phone ? phone : '–' },
37
+ { heading: labels.emailLabel, data: email },
38
+ {
39
+ heading: labels.roleLabel,
40
+ data: (
41
+ <span data-fs-user-details-row-tags>
42
+ {role.map((r) => (
43
+ <Tag key={r}>{r}</Tag>
44
+ ))}
45
+ </span>
46
+ ),
47
+ },
48
+ { heading: labels.orgUnitLabel, data: orgUnit },
49
+ ]}
50
+ />
51
+ </div>
52
+ </section>
53
+ )
54
+ }
@@ -0,0 +1 @@
1
+ export { default } from './UserDetails'
@@ -2,8 +2,8 @@
2
2
 
3
3
  @layer components {
4
4
  .section {
5
- @include meta.load-css("../components/MyAccountTag/styles.scss");
6
- @include meta.load-css("../components/MyAccountTable/styles.scss");
5
+ @include meta.load-css("../components/Tag/styles.scss");
6
+ @include meta.load-css("../components/Table/styles.scss");
7
7
 
8
8
  // --------------------------------------------------------
9
9
  // Design Tokens
@@ -0,0 +1,25 @@
1
+ export type UserDetailsSectionLabels = {
2
+ pageTitle?: string
3
+ nameLabel?: string
4
+ usernameLabel?: string
5
+ emailLabel?: string
6
+ phoneLabel?: string
7
+ roleLabel?: string
8
+ orgUnitLabel?: string
9
+ }
10
+
11
+ export const defaultUserDetailsLabels: Required<UserDetailsSectionLabels> = {
12
+ pageTitle: 'User details',
13
+ nameLabel: 'Name',
14
+ usernameLabel: 'Username',
15
+ emailLabel: 'Email',
16
+ phoneLabel: 'Phone number',
17
+ roleLabel: 'Role',
18
+ orgUnitLabel: 'Organizational unit',
19
+ }
20
+
21
+ export function resolveUserDetailsLabels(
22
+ labels?: UserDetailsSectionLabels
23
+ ): Required<UserDetailsSectionLabels> {
24
+ return { ...defaultUserDetailsLabels, ...labels }
25
+ }
@@ -1,8 +1,6 @@
1
1
  import { Accordion as UIAccordion, type AccordionProps } from '@faststore/ui'
2
2
 
3
- interface MyAccountAccordionProps extends AccordionProps {}
4
-
5
- function MyAccountAccordion({ children, ...props }: MyAccountAccordionProps) {
3
+ function Accordion({ children, ...props }: AccordionProps) {
6
4
  return (
7
5
  <UIAccordion {...props} data-fs-my-account-accordion>
8
6
  {children}
@@ -10,4 +8,4 @@ function MyAccountAccordion({ children, ...props }: MyAccountAccordionProps) {
10
8
  )
11
9
  }
12
10
 
13
- export default MyAccountAccordion
11
+ export default Accordion
@@ -4,17 +4,13 @@ import {
4
4
  } from '@faststore/ui'
5
5
  import type { ReactNode } from 'react'
6
6
 
7
- interface MyAccountAccordionButtonProps {
7
+ interface AccordionButtonProps {
8
8
  title: string
9
9
  summary: string
10
10
  children?: ReactNode
11
11
  }
12
12
 
13
- function MyAccountAccordionButton({
14
- title,
15
- summary,
16
- children,
17
- }: MyAccountAccordionButtonProps) {
13
+ function AccordionButton({ title, summary, children }: AccordionButtonProps) {
18
14
  return (
19
15
  <UIAccordionButton
20
16
  collapsedIcon={<UIIcon name="CaretDown" />}
@@ -32,4 +28,4 @@ function MyAccountAccordionButton({
32
28
  )
33
29
  }
34
30
 
35
- export default MyAccountAccordionButton
31
+ export default AccordionButton
@@ -1,16 +1,12 @@
1
1
  import { AccordionItem as UIAccordionItem } from '@faststore/ui'
2
2
  import type { ReactNode } from 'react'
3
3
 
4
- interface MyAccountAccordionItemProps {
4
+ interface AccordionItemProps {
5
5
  index: number
6
6
  children: ReactNode
7
7
  }
8
8
 
9
- function MyAccountAccordionItem({
10
- children,
11
- index,
12
- ...props
13
- }: MyAccountAccordionItemProps) {
9
+ function AccordionItem({ children, index, ...props }: AccordionItemProps) {
14
10
  return (
15
11
  <UIAccordionItem index={index} {...props} data-fs-my-account-accordion-item>
16
12
  {children}
@@ -18,4 +14,4 @@ function MyAccountAccordionItem({
18
14
  )
19
15
  }
20
16
 
21
- export default MyAccountAccordionItem
17
+ export default AccordionItem
@@ -1,11 +1,11 @@
1
1
  import { AccordionPanel as UIAccordionPanel } from '@faststore/ui'
2
2
  import type { ReactNode } from 'react'
3
3
 
4
- interface MyAccountAccordionPanelProps {
4
+ interface AccordionPanelProps {
5
5
  children: ReactNode
6
6
  }
7
7
 
8
- function MyAccountAccordionPanel({ children }: MyAccountAccordionPanelProps) {
8
+ function AccordionPanel({ children }: AccordionPanelProps) {
9
9
  return (
10
10
  <UIAccordionPanel>
11
11
  <div data-fs-my-account-accordion-content>{children}</div>
@@ -13,4 +13,4 @@ function MyAccountAccordionPanel({ children }: MyAccountAccordionPanelProps) {
13
13
  )
14
14
  }
15
15
 
16
- export default MyAccountAccordionPanel
16
+ export default AccordionPanel
@@ -0,0 +1,4 @@
1
+ export { default as Accordion } from './Accordion'
2
+ export { default as AccordionButton } from './AccordionButton'
3
+ export { default as AccordionItem } from './AccordionItem'
4
+ export { default as AccordionPanel } from './AccordionPanel'
@@ -1,8 +1,6 @@
1
1
  import { type CardProps, Card as UICard } from '@faststore/ui'
2
2
 
3
- interface MyAccountCardProps extends CardProps {}
4
-
5
- function MyAccountCard({ children, ...props }: MyAccountCardProps) {
3
+ function Card({ children, ...props }: CardProps) {
6
4
  return (
7
5
  <UICard {...props} data-fs-my-account-card>
8
6
  {children}
@@ -10,4 +8,4 @@ function MyAccountCard({ children, ...props }: MyAccountCardProps) {
10
8
  )
11
9
  }
12
10
 
13
- export default MyAccountCard
11
+ export default Card
@@ -0,0 +1 @@
1
+ export { default } from './Card'
@@ -1,8 +1,8 @@
1
- interface MyAccountHeaderProps {
1
+ interface HeaderProps {
2
2
  pageTitle: string
3
3
  }
4
4
 
5
- function MyAccountHeader({ pageTitle }: MyAccountHeaderProps) {
5
+ function Header({ pageTitle }: HeaderProps) {
6
6
  return (
7
7
  <header data-fs-account-header>
8
8
  <h1 data-fs-account-header-title>{pageTitle}</h1>
@@ -10,4 +10,4 @@ function MyAccountHeader({ pageTitle }: MyAccountHeaderProps) {
10
10
  )
11
11
  }
12
12
 
13
- export default MyAccountHeader
13
+ export default Header
@@ -0,0 +1 @@
1
+ export { default } from './Header'
@@ -0,0 +1,43 @@
1
+ import type { OrderStatusCmsLabels } from 'src/utils/userOrderStatus'
2
+ import {
3
+ getLocalizedOrderStatusMap,
4
+ getOrderStatusLabel,
5
+ type OrderStatusKey,
6
+ type OrderStatusMapValue,
7
+ } from 'src/utils/userOrderStatus'
8
+
9
+ function getStatusVariant({
10
+ status,
11
+ statusMap,
12
+ }: {
13
+ status: string
14
+ statusMap: Record<OrderStatusKey, OrderStatusMapValue>
15
+ }) {
16
+ return (
17
+ (statusMap[status as OrderStatusKey] as OrderStatusMapValue)?.variant ||
18
+ 'neutral'
19
+ )
20
+ }
21
+
22
+ function StatusBadge({
23
+ status,
24
+ statusFallback,
25
+ statusLabels,
26
+ }: {
27
+ status: string
28
+ statusFallback?: string
29
+ statusLabels?: OrderStatusCmsLabels
30
+ }) {
31
+ const statusMap = getLocalizedOrderStatusMap(statusLabels)
32
+
33
+ return (
34
+ <span
35
+ data-fs-my-account-badge
36
+ data-fs-my-account-badge-variant={getStatusVariant({ status, statusMap })}
37
+ >
38
+ {getOrderStatusLabel({ status, cmsLabels: statusLabels, statusFallback })}
39
+ </span>
40
+ )
41
+ }
42
+
43
+ export default StatusBadge
@@ -0,0 +1 @@
1
+ export { default } from './StatusBadge'
@@ -1,11 +1,11 @@
1
- interface MyAccountTableProps {
1
+ interface TableProps {
2
2
  rows?: Array<{
3
3
  heading: string
4
4
  data: React.ReactNode | string
5
5
  }>
6
6
  }
7
7
 
8
- function MyAccountTable({ rows, ...props }: MyAccountTableProps) {
8
+ function Table({ rows, ...props }: TableProps) {
9
9
  return (
10
10
  <table data-fs-account-table {...props}>
11
11
  <tbody data-fs-account-table-body>
@@ -20,4 +20,4 @@ function MyAccountTable({ rows, ...props }: MyAccountTableProps) {
20
20
  )
21
21
  }
22
22
 
23
- export default MyAccountTable
23
+ export default Table
@@ -0,0 +1 @@
1
+ export { default } from './Table'
@@ -0,0 +1 @@
1
+ export { default } from './Tag'
@@ -1,2 +1,2 @@
1
- export { default as MyAccountLayout } from './MyAccountLayout'
2
- export { default as MyAccountMenu } from './MyAccountMenu'
1
+ export { default as Layout } from './Layout'
2
+ export { default as Menu } from './Menu'
@@ -0,0 +1,128 @@
1
+ import { InputField } from '@faststore/ui'
2
+ import { forwardRef, useImperativeHandle, useRef, useState } from 'react'
3
+
4
+ export interface FilterFacetDateRangeProps {
5
+ /**
6
+ * The from value of the Range Facet
7
+ */
8
+ from: string
9
+ /**
10
+ * The to value of the Range Facet
11
+ */
12
+ to: string
13
+ /**
14
+ * The function to be called when the date range changes
15
+ */
16
+ setDisabled: (disabled: boolean) => void
17
+ fromLabel?: string
18
+ toLabel?: string
19
+ invalidDateRangeLabel?: string
20
+ }
21
+
22
+ const FilterFacetDateRange = forwardRef<
23
+ {
24
+ clear: () => void
25
+ getDataRangeFacet: () => {
26
+ key: string
27
+ value: { from: string; to: string }
28
+ }
29
+ },
30
+ FilterFacetDateRangeProps
31
+ >(
32
+ (
33
+ {
34
+ to,
35
+ from,
36
+ setDisabled,
37
+ fromLabel = 'From',
38
+ toLabel = 'To',
39
+ invalidDateRangeLabel = 'Invalid date range',
40
+ },
41
+ ref
42
+ ) => {
43
+ const inputFromRef = useRef<HTMLInputElement>(null)
44
+ const inputToRef = useRef<HTMLInputElement>(null)
45
+ const [inputFromError, setInputFromError] = useState<string>()
46
+ const [inputToError, setInputToError] = useState<string>()
47
+
48
+ const [dateRange, setDateRange] = useState<{ from: string; to: string }>({
49
+ from,
50
+ to,
51
+ })
52
+
53
+ function onEnd(value: { from: string; to: string }) {
54
+ if (!value.from || !value.to) {
55
+ setInputFromError(undefined)
56
+ setInputToError(undefined)
57
+ setDisabled(false)
58
+ return
59
+ }
60
+
61
+ if (new Date(value.from) > new Date(value.to)) {
62
+ setInputFromError(invalidDateRangeLabel)
63
+ setDisabled(true)
64
+ } else {
65
+ setInputFromError(undefined)
66
+ setInputToError(undefined)
67
+ setDisabled(false)
68
+ }
69
+ }
70
+
71
+ function onChangeInputFrom(value: string) {
72
+ setDateRange({ ...dateRange, from: String(value) })
73
+ onEnd?.({ ...dateRange, from: String(value) })
74
+ }
75
+
76
+ function onChangeInputTo(value: string) {
77
+ setDateRange({ ...dateRange, to: String(value) })
78
+ onEnd?.({ ...dateRange, to: String(value) })
79
+ }
80
+
81
+ useImperativeHandle(ref, () => ({
82
+ clear: () => {
83
+ setInputFromError(undefined)
84
+ setInputToError(undefined)
85
+ setDateRange({ from: '', to: '' })
86
+ if (inputFromRef.current) inputFromRef.current.value = ''
87
+ if (inputToRef.current) inputToRef.current.value = ''
88
+ },
89
+ getDataRangeFacet: () => {
90
+ return {
91
+ key: 'dateRange',
92
+ value: dateRange,
93
+ }
94
+ },
95
+ }))
96
+
97
+ return (
98
+ <div data-fs-list-orders-filters-date-range>
99
+ <div data-fs-list-orders-filters-date-range-inputs>
100
+ <InputField
101
+ id="date-range-from"
102
+ label={fromLabel}
103
+ type="date"
104
+ inputMode="text"
105
+ error={inputFromError}
106
+ inputRef={inputFromRef}
107
+ value={dateRange.from}
108
+ onChange={(e) => onChangeInputFrom(e.target.value)}
109
+ onBlur={() => !inputFromError && onEnd?.(dateRange)}
110
+ />
111
+ <InputField
112
+ id="date-range-to"
113
+ label={toLabel}
114
+ type="date"
115
+ inputMode="text"
116
+ error={inputToError}
117
+ inputRef={inputToRef}
118
+ value={dateRange.to}
119
+ onChange={(e) => onChangeInputTo(e.target.value)}
120
+ onBlur={() => !inputToError && onEnd?.(dateRange)}
121
+ />
122
+ </div>
123
+ </div>
124
+ )
125
+ }
126
+ )
127
+
128
+ export default FilterFacetDateRange
@@ -0,0 +1,2 @@
1
+ export { default } from './FilterFacetDateRange'
2
+ export type { FilterFacetDateRangeProps } from './FilterFacetDateRange'
@@ -2,7 +2,7 @@ import { Toggle } from '@faststore/ui'
2
2
  import { useMemo } from 'react'
3
3
  import type { SelectedFacet } from 'src/sdk/search/useMyAccountFilter'
4
4
 
5
- export interface MyAccountFilterFacetPendingApprovalProps {
5
+ export interface FilterFacetPendingApprovalProps {
6
6
  /**
7
7
  * Current selected facets from filter context
8
8
  */
@@ -13,10 +13,10 @@ export interface MyAccountFilterFacetPendingApprovalProps {
13
13
  dispatch: (action: { type: 'toggleFacet' | 'setFacet'; payload: any }) => void
14
14
  }
15
15
 
16
- function MyAccountFilterFacetPendingApproval({
16
+ function FilterFacetPendingApproval({
17
17
  selected,
18
18
  dispatch,
19
- }: MyAccountFilterFacetPendingApprovalProps) {
19
+ }: FilterFacetPendingApprovalProps) {
20
20
  const isSelected = useMemo(
21
21
  () =>
22
22
  selected.some((f) => f.key === 'pendingMyApproval' && f.value === 'true'),
@@ -59,4 +59,4 @@ function MyAccountFilterFacetPendingApproval({
59
59
  )
60
60
  }
61
61
 
62
- export default MyAccountFilterFacetPendingApproval
62
+ export default FilterFacetPendingApproval
@@ -0,0 +1,2 @@
1
+ export { default } from './FilterFacetPendingApproval'
2
+ export type { FilterFacetPendingApprovalProps } from './FilterFacetPendingApproval'