@gusto/embedded-react-sdk 0.55.3 → 0.55.4

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 (130) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
  6. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  8. package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
  9. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  10. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
  11. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.js +18 -17
  13. package/dist/components/Common/DataView/DataView.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -6
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -6
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -8
  19. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  20. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -6
  21. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  22. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  23. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  24. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -11
  25. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  26. package/dist/components/Company/Industry/Context.js +6 -9
  27. package/dist/components/Company/Industry/Context.js.map +1 -1
  28. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -6
  29. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  30. package/dist/components/Company/Locations/LocationsList/List.js +27 -25
  31. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  32. package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
  33. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  34. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  35. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -6
  36. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  37. package/dist/components/Company/OnboardingOverview/context.js +3 -6
  38. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  39. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
  40. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
  41. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  42. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
  43. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  44. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -6
  45. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  46. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -6
  47. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  48. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
  49. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
  50. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -6
  51. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  52. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
  53. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
  55. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
  56. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
  57. package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
  58. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
  59. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
  60. package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
  61. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
  62. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  63. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
  64. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  65. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  66. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  67. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
  68. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  69. package/dist/components/Flow/Flow.js +22 -22
  70. package/dist/components/Flow/Flow.js.map +1 -1
  71. package/dist/components/Flow/useFlow.js +3 -3
  72. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
  73. package/dist/components/InformationRequests/InformationRequests.js +68 -53
  74. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  75. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  76. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  77. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +52 -50
  78. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  79. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  80. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
  81. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  82. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
  83. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
  84. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
  85. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
  86. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
  87. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
  88. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  89. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
  90. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
  91. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
  92. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
  93. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
  94. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  95. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +193 -191
  96. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  97. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
  98. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +31 -31
  99. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  100. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
  101. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  102. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
  103. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  104. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
  105. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  106. package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
  107. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  108. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
  109. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  110. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +176 -167
  111. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  112. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  113. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -164
  114. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  115. package/dist/components/Payroll/usePreparedPayrollData.js +12 -15
  116. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  117. package/dist/helpers/openPdfInNewTab.d.ts +15 -0
  118. package/dist/helpers/openPdfInNewTab.js +28 -0
  119. package/dist/helpers/openPdfInNewTab.js.map +1 -0
  120. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  121. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
  122. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  123. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
  124. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
  125. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  126. package/dist/i18n/en/Payroll.PayrollOverview.json.js +43 -41
  127. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  128. package/dist/i18n/types.d.ts +20 -0
  129. package/dist/style.css +1 -1
  130. package/package.json +17 -17
@@ -1,49 +1,59 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { useState as b, useMemo as i, useCallback as k } from "react";
3
- import { useContractorPaymentGroupsGetListSuspense as E } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGetList";
4
- import { useInformationRequestsGetInformationRequestsSuspense as B } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useState as b, useMemo as a, useCallback as B } from "react";
3
+ import { keepPreviousData as G } from "@tanstack/react-query";
4
+ import { useContractorPaymentGroupsGetList as Y } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGetList";
5
+ import { useInformationRequestsGetInformationRequestsSuspense as v } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
5
6
  import { InformationRequestStatus as g } from "@gusto/embedded-api/models/components/informationrequest";
6
- import { PaymentsListPresentation as G } from "./PaymentsListPresentation.js";
7
- import { useComponentDictionary as Y } from "../../../../i18n/I18n.js";
8
- import { BaseComponent as U } from "../../../Base/Base.js";
7
+ import { PaymentsListPresentation as U } from "./PaymentsListPresentation.js";
8
+ import { useComponentDictionary as W } from "../../../../i18n/I18n.js";
9
+ import { BaseComponent as x, BaseLayout as F } from "../../../Base/Base.js";
9
10
  import "../../../Base/useBase.js";
10
- import { componentEvents as a } from "../../../../shared/constants.js";
11
- import { usePagination as W } from "../../../../hooks/usePagination/usePagination.js";
12
- function et(t) {
13
- return /* @__PURE__ */ c(v, { ...t });
11
+ import { componentEvents as c } from "../../../../shared/constants.js";
12
+ import { usePagination as H } from "../../../../hooks/usePagination/usePagination.js";
13
+ function it(t) {
14
+ return /* @__PURE__ */ r(V, { ...t });
14
15
  }
15
- function v(t) {
16
- return /* @__PURE__ */ c(U, { ...t, children: /* @__PURE__ */ c(H, { ...t, children: t.children }) });
16
+ function V(t) {
17
+ return /* @__PURE__ */ r(x, { ...t, children: /* @__PURE__ */ r(z, { ...t, children: t.children }) });
17
18
  }
18
- const x = (t = 3) => {
19
- const o = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
20
- return e.setMonth(e.getMonth() - t), o.setMonth(o.getMonth() + (12 - t)), {
19
+ const j = (t = 3) => {
20
+ const s = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
21
+ return e.setMonth(e.getMonth() - t), s.setMonth(s.getMonth() + (12 - t)), {
21
22
  startDate: e.toISOString().split("T")[0] || "",
22
- endDate: o.toISOString().split("T")[0] || ""
23
+ endDate: s.toISOString().split("T")[0] || ""
23
24
  };
24
- }, H = ({ companyId: t, dictionary: o, onEvent: e, alerts: R }) => {
25
- Y("Contractor.Payments.PaymentsList", o);
26
- const [m, C] = b(3), { currentPage: T, itemsPerPage: h, getPaginationProps: A } = W(), { startDate: D, endDate: O } = i(() => x(m), [m]), { data: f } = E({
27
- companyId: t,
28
- startDate: D,
29
- endDate: O,
30
- page: T,
31
- per: h
32
- }), u = f.contractorPaymentGroupWithBlockers || [], y = A(f.httpMeta.response.headers), { data: M } = B({
25
+ }, z = ({
26
+ companyId: t,
27
+ dictionary: s,
28
+ onEvent: e,
29
+ alerts: R,
30
+ LoaderComponent: h
31
+ }) => {
32
+ W("Contractor.Payments.PaymentsList", s);
33
+ const [m, C] = b(3), { currentPage: T, itemsPerPage: D, getPaginationProps: O } = H(), { startDate: y, endDate: A } = a(() => j(m), [m]), { data: u, isFetching: M } = Y(
34
+ {
35
+ companyId: t,
36
+ startDate: y,
37
+ endDate: A,
38
+ page: T,
39
+ per: D
40
+ },
41
+ { placeholderData: G, throwOnError: !0 }
42
+ ), p = u?.contractorPaymentGroupWithBlockers || [], { data: w } = v({
33
43
  companyUuid: t
34
- }), p = M.informationRequests ?? [], _ = i(() => u.some((n) => (n.creditBlockers || []).some((r) => {
35
- if (r.status !== "unresolved") return !1;
36
- const s = r.unblockOptions?.find(
37
- (L) => L.unblockType === "submit_wire"
44
+ }), f = w.informationRequests ?? [], _ = a(() => p.some((n) => (n.creditBlockers || []).some((i) => {
45
+ if (i.status !== "unresolved") return !1;
46
+ const o = i.unblockOptions?.find(
47
+ (E) => E.unblockType === "submit_wire"
38
48
  );
39
- return s && "metadata" in s && s.metadata.wireInRequestUuid;
40
- })), [u]), l = k(() => {
41
- e(a.CONTRACTOR_PAYMENT_RFI_RESPOND);
42
- }, [e]), P = i(() => {
43
- const n = [], d = p.some(
44
- (s) => s.status === g.PendingResponse
45
- ), r = p.some(
46
- (s) => s.status === g.PendingReview
49
+ return o && "metadata" in o && o.metadata.wireInRequestUuid;
50
+ })), [p]), l = B(() => {
51
+ e(c.CONTRACTOR_PAYMENT_RFI_RESPOND);
52
+ }, [e]), P = a(() => {
53
+ const n = [], d = f.some(
54
+ (o) => o.status === g.PendingResponse
55
+ ), i = f.some(
56
+ (o) => o.status === g.PendingReview
47
57
  );
48
58
  return d ? n.push({
49
59
  type: "error",
@@ -51,39 +61,42 @@ const x = (t = 3) => {
51
61
  content: "rfiPendingResponseDescription",
52
62
  onAction: l,
53
63
  actionLabel: "rfiRespondCta"
54
- }) : r && n.push({
64
+ }) : i && n.push({
55
65
  type: "info",
56
66
  title: "rfiPendingReviewTitle",
57
67
  content: "rfiPendingReviewDescription"
58
68
  }), n;
59
- }, [p, l]), w = () => {
60
- e(a.CONTRACTOR_PAYMENT_CREATE);
61
- }, I = () => {
62
- e(a.CONTRACTOR_HISTORICAL_PAYMENT_CREATE);
63
- }, N = (n) => {
69
+ }, [f, l]), I = () => {
70
+ e(c.CONTRACTOR_PAYMENT_CREATE);
71
+ }, N = () => {
72
+ e(c.CONTRACTOR_HISTORICAL_PAYMENT_CREATE);
73
+ }, L = (n) => {
64
74
  C(n);
65
75
  }, S = (n) => {
66
- e(a.CONTRACTOR_PAYMENT_VIEW, { paymentId: n });
67
- }, q = i(() => [...P, ...R || []], [P, R]);
68
- return /* @__PURE__ */ c(
69
- G,
76
+ e(c.CONTRACTOR_PAYMENT_VIEW, { paymentId: n });
77
+ }, q = a(() => [...P, ...R || []], [P, R]);
78
+ if (!u)
79
+ return /* @__PURE__ */ r(F, { isLoading: !0, LoaderComponent: h });
80
+ const k = O(u.httpMeta.response.headers, M);
81
+ return /* @__PURE__ */ r(
82
+ U,
70
83
  {
71
- contractorPayments: u,
84
+ contractorPayments: p,
72
85
  numberOfMonths: m,
73
- onCreatePayment: w,
74
- onCreateHistoricalPayment: I,
75
- onDateRangeChange: N,
86
+ onCreatePayment: I,
87
+ onCreateHistoricalPayment: N,
88
+ onDateRangeChange: L,
76
89
  onViewPayment: S,
77
90
  alerts: q,
78
91
  companyId: t,
79
92
  hasUnresolvedWireInRequests: _,
80
93
  onEvent: e,
81
- paginationProps: y
94
+ paginationProps: k
82
95
  }
83
96
  );
84
97
  };
85
98
  export {
86
- et as PaymentsList,
87
- v as PaymentsListInternal
99
+ it as PaymentsList,
100
+ V as PaymentsListInternal
88
101
  };
89
102
  //# sourceMappingURL=PaymentsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentsList.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsList.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react'\nimport { useContractorPaymentGroupsGetListSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGetList'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport type { InternalAlert } from '../types'\nimport { PaymentsListPresentation } from './PaymentsListPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\n/**\n * Props for {@link PaymentsList}.\n *\n * @public\n */\nexport interface PaymentsListProps extends BaseComponentInterface<'Contractor.Payments.PaymentsList'> {\n /** UUID of the company whose contractor payment groups should be listed. */\n companyId: string\n}\n\n/**\n * Props for the flow-internal {@link PaymentsListInternal}, which layers\n * flow-injected alerts on top of the public {@link PaymentsListProps}.\n *\n * @internal\n */\nexport interface PaymentsListInternalProps extends PaymentsListProps {\n /** Flow-injected alerts (e.g. wire-transfer confirmation, payment cancellation). */\n alerts?: InternalAlert[]\n}\n\n/**\n * Displays a list of contractor payment groups for a company.\n *\n * Supports viewing payment history, creating new payments, and filtering by date range.\n * Surfaces alerts for pending information requests and wire transfer requirements.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/payments/create` | User chooses to create a new payment | — |\n * | `contractor/payments/view` | User selects a payment group to view | `{ paymentId: string }` |\n * | `contractor/payments/rfi/respond` | User clicks to respond to an information request alert | — |\n *\n * @param props - Component props.\n * @returns The rendered payments list.\n * @public\n */\nexport function PaymentsList(props: PaymentsListProps) {\n return <PaymentsListInternal {...props} />\n}\n\n/**\n * Flow-internal entry point for {@link PaymentsList} that accepts flow-injected\n * alerts. Partners use {@link PaymentsList}; flows render this directly.\n *\n * @internal\n */\nexport function PaymentsListInternal(props: PaymentsListInternalProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst calculateDateRange = (months: number = 3) => {\n const endDate = new Date()\n const startDate = new Date()\n\n startDate.setMonth(startDate.getMonth() - months)\n //Max range allowed by the API is 12 months\n endDate.setMonth(endDate.getMonth() + (12 - months))\n\n return {\n startDate: startDate.toISOString().split('T')[0] || '',\n endDate: endDate.toISOString().split('T')[0] || '',\n }\n}\n\nconst Root = ({ companyId, dictionary, onEvent, alerts }: PaymentsListInternalProps) => {\n useComponentDictionary('Contractor.Payments.PaymentsList', dictionary)\n\n const [numberOfMonths, setNumberOfMonths] = useState(3)\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination()\n\n const { startDate, endDate } = useMemo(() => calculateDateRange(numberOfMonths), [numberOfMonths])\n\n const { data } = useContractorPaymentGroupsGetListSuspense({\n companyId,\n startDate,\n endDate,\n page: currentPage,\n per: itemsPerPage,\n })\n const contractorPayments = data.contractorPaymentGroupWithBlockers || []\n const paginationProps = getPaginationProps(data.httpMeta.response.headers)\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n const informationRequests = informationRequestsData.informationRequests ?? []\n\n const hasUnresolvedWireInRequests = useMemo(() => {\n return contractorPayments.some(payment => {\n const creditBlockers = payment.creditBlockers || []\n return creditBlockers.some(blocker => {\n if (blocker.status !== 'unresolved') return false\n const wireOption = blocker.unblockOptions?.find(\n option => option.unblockType === 'submit_wire',\n )\n return wireOption && 'metadata' in wireOption && wireOption.metadata.wireInRequestUuid\n })\n })\n }, [contractorPayments])\n\n const handleRespondToRfi = useCallback(() => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND)\n }, [onEvent])\n\n const rfiAlerts = useMemo(() => {\n const rfiAlertsArray: InternalAlert[] = []\n\n const hasPendingResponseRfis = informationRequests.some(\n request => request.status === InformationRequestStatus.PendingResponse,\n )\n const hasPendingReviewRfis = informationRequests.some(\n request => request.status === InformationRequestStatus.PendingReview,\n )\n\n if (hasPendingResponseRfis) {\n rfiAlertsArray.push({\n type: 'error',\n title: 'rfiPendingResponseTitle',\n content: 'rfiPendingResponseDescription',\n onAction: handleRespondToRfi,\n actionLabel: 'rfiRespondCta',\n })\n } else if (hasPendingReviewRfis) {\n rfiAlertsArray.push({\n type: 'info',\n title: 'rfiPendingReviewTitle',\n content: 'rfiPendingReviewDescription',\n })\n }\n\n return rfiAlertsArray\n }, [informationRequests, handleRespondToRfi])\n\n const onCreatePayment = () => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_CREATE)\n }\n\n const onCreateHistoricalPayment = () => {\n onEvent(componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE)\n }\n\n const handleDateRangeChange = (numberOfMonths: number) => {\n setNumberOfMonths(numberOfMonths)\n }\n\n const onViewPayment = (paymentId: string) => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_VIEW, { paymentId })\n }\n\n const allAlerts = useMemo(() => {\n return [...rfiAlerts, ...(alerts || [])]\n }, [rfiAlerts, alerts])\n\n return (\n <PaymentsListPresentation\n contractorPayments={contractorPayments}\n numberOfMonths={numberOfMonths}\n onCreatePayment={onCreatePayment}\n onCreateHistoricalPayment={onCreateHistoricalPayment}\n onDateRangeChange={handleDateRangeChange}\n onViewPayment={onViewPayment}\n alerts={allAlerts}\n companyId={companyId}\n hasUnresolvedWireInRequests={hasUnresolvedWireInRequests}\n onEvent={onEvent}\n paginationProps={paginationProps}\n />\n )\n}\n"],"names":["PaymentsList","props","jsx","PaymentsListInternal","BaseComponent","Root","calculateDateRange","months","endDate","startDate","companyId","dictionary","onEvent","alerts","useComponentDictionary","numberOfMonths","setNumberOfMonths","useState","currentPage","itemsPerPage","getPaginationProps","usePagination","useMemo","data","useContractorPaymentGroupsGetListSuspense","contractorPayments","paginationProps","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","informationRequests","hasUnresolvedWireInRequests","payment","blocker","wireOption","option","handleRespondToRfi","useCallback","componentEvents","rfiAlerts","rfiAlertsArray","hasPendingResponseRfis","request","InformationRequestStatus","hasPendingReviewRfis","onCreatePayment","onCreateHistoricalPayment","handleDateRangeChange","onViewPayment","paymentId","allAlerts","PaymentsListPresentation"],"mappings":";;;;;;;;;;;AAiDO,SAASA,GAAaC,GAA0B;AACrD,SAAO,gBAAAC,EAACC,GAAA,EAAsB,GAAGF,EAAA,CAAO;AAC1C;AAQO,SAASE,EAAqBF,GAAkC;AACrE,SACE,gBAAAC,EA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GAAW,GAAIzB,KAAU,CAAA,CAAG,GACtC,CAACyB,GAAWzB,CAAM,CAAC;AAEtB,SACE,gBAAAX;AAAA,IAACgD;AAAA,IAAA;AAAA,MACC,oBAAAzB;AAAA,MACA,gBAAAV;AAAA,MACA,iBAAA6B;AAAA,MACA,2BAAAC;AAAA,MACA,mBAAmBC;AAAA,MACnB,eAAAC;AAAA,MACA,QAAQE;AAAA,MACR,WAAAvC;AAAA,MACA,6BAAAoB;AAAA,MACA,SAAAlB;AAAA,MACA,iBAAAc;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PaymentsList.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsList.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react'\nimport { keepPreviousData } from '@tanstack/react-query'\nimport { useContractorPaymentGroupsGetList } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGetList'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport type { InternalAlert } from '../types'\nimport { PaymentsListPresentation } from './PaymentsListPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, BaseLayout, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\n/**\n * Props for {@link PaymentsList}.\n *\n * @public\n */\nexport interface PaymentsListProps extends BaseComponentInterface<'Contractor.Payments.PaymentsList'> {\n /** UUID of the company whose contractor payment groups should be listed. */\n companyId: string\n}\n\n/**\n * Props for the flow-internal {@link PaymentsListInternal}, which layers\n * flow-injected alerts on top of the public {@link PaymentsListProps}.\n *\n * @internal\n */\nexport interface PaymentsListInternalProps extends PaymentsListProps {\n /** Flow-injected alerts (e.g. wire-transfer confirmation, payment cancellation). */\n alerts?: InternalAlert[]\n}\n\n/**\n * Displays a list of contractor payment groups for a company.\n *\n * Supports viewing payment history, creating new payments, and filtering by date range.\n * Surfaces alerts for pending information requests and wire transfer requirements.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/payments/create` | User chooses to create a new payment | — |\n * | `contractor/payments/view` | User selects a payment group to view | `{ paymentId: string }` |\n * | `contractor/payments/rfi/respond` | User clicks to respond to an information request alert | — |\n *\n * @param props - Component props.\n * @returns The rendered payments list.\n * @public\n */\nexport function PaymentsList(props: PaymentsListProps) {\n return <PaymentsListInternal {...props} />\n}\n\n/**\n * Flow-internal entry point for {@link PaymentsList} that accepts flow-injected\n * alerts. Partners use {@link PaymentsList}; flows render this directly.\n *\n * @internal\n */\nexport function PaymentsListInternal(props: PaymentsListInternalProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst calculateDateRange = (months: number = 3) => {\n const endDate = new Date()\n const startDate = new Date()\n\n startDate.setMonth(startDate.getMonth() - months)\n //Max range allowed by the API is 12 months\n endDate.setMonth(endDate.getMonth() + (12 - months))\n\n return {\n startDate: startDate.toISOString().split('T')[0] || '',\n endDate: endDate.toISOString().split('T')[0] || '',\n }\n}\n\nconst Root = ({\n companyId,\n dictionary,\n onEvent,\n alerts,\n LoaderComponent,\n}: PaymentsListInternalProps) => {\n useComponentDictionary('Contractor.Payments.PaymentsList', dictionary)\n\n const [numberOfMonths, setNumberOfMonths] = useState(3)\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination()\n\n const { startDate, endDate } = useMemo(() => calculateDateRange(numberOfMonths), [numberOfMonths])\n\n const { data, isFetching } = useContractorPaymentGroupsGetList(\n {\n companyId,\n startDate,\n endDate,\n page: currentPage,\n per: itemsPerPage,\n },\n { placeholderData: keepPreviousData, throwOnError: true },\n )\n const contractorPayments = data?.contractorPaymentGroupWithBlockers || []\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n const informationRequests = informationRequestsData.informationRequests ?? []\n\n const hasUnresolvedWireInRequests = useMemo(() => {\n return contractorPayments.some(payment => {\n const creditBlockers = payment.creditBlockers || []\n return creditBlockers.some(blocker => {\n if (blocker.status !== 'unresolved') return false\n const wireOption = blocker.unblockOptions?.find(\n option => option.unblockType === 'submit_wire',\n )\n return wireOption && 'metadata' in wireOption && wireOption.metadata.wireInRequestUuid\n })\n })\n }, [contractorPayments])\n\n const handleRespondToRfi = useCallback(() => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND)\n }, [onEvent])\n\n const rfiAlerts = useMemo(() => {\n const rfiAlertsArray: InternalAlert[] = []\n\n const hasPendingResponseRfis = informationRequests.some(\n request => request.status === InformationRequestStatus.PendingResponse,\n )\n const hasPendingReviewRfis = informationRequests.some(\n request => request.status === InformationRequestStatus.PendingReview,\n )\n\n if (hasPendingResponseRfis) {\n rfiAlertsArray.push({\n type: 'error',\n title: 'rfiPendingResponseTitle',\n content: 'rfiPendingResponseDescription',\n onAction: handleRespondToRfi,\n actionLabel: 'rfiRespondCta',\n })\n } else if (hasPendingReviewRfis) {\n rfiAlertsArray.push({\n type: 'info',\n title: 'rfiPendingReviewTitle',\n content: 'rfiPendingReviewDescription',\n })\n }\n\n return rfiAlertsArray\n }, [informationRequests, handleRespondToRfi])\n\n const onCreatePayment = () => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_CREATE)\n }\n\n const onCreateHistoricalPayment = () => {\n onEvent(componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE)\n }\n\n const handleDateRangeChange = (numberOfMonths: number) => {\n setNumberOfMonths(numberOfMonths)\n }\n\n const onViewPayment = (paymentId: string) => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_VIEW, { paymentId })\n }\n\n const allAlerts = useMemo(() => {\n return [...rfiAlerts, ...(alerts || [])]\n }, [rfiAlerts, alerts])\n\n if (!data) {\n return <BaseLayout isLoading LoaderComponent={LoaderComponent} />\n }\n\n const paginationProps = getPaginationProps(data.httpMeta.response.headers, isFetching)\n\n return (\n <PaymentsListPresentation\n contractorPayments={contractorPayments}\n numberOfMonths={numberOfMonths}\n onCreatePayment={onCreatePayment}\n onCreateHistoricalPayment={onCreateHistoricalPayment}\n onDateRangeChange={handleDateRangeChange}\n onViewPayment={onViewPayment}\n alerts={allAlerts}\n companyId={companyId}\n hasUnresolvedWireInRequests={hasUnresolvedWireInRequests}\n onEvent={onEvent}\n paginationProps={paginationProps}\n />\n )\n}\n"],"names":["PaymentsList","props","jsx","PaymentsListInternal","BaseComponent","Root","calculateDateRange","months","endDate","startDate","companyId","dictionary","onEvent","alerts","LoaderComponent","useComponentDictionary","numberOfMonths","setNumberOfMonths","useState","currentPage","itemsPerPage","getPaginationProps","usePagination","useMemo","data","isFetching","useContractorPaymentGroupsGetList","keepPreviousData","contractorPayments","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","informationRequests","hasUnresolvedWireInRequests","payment","blocker","wireOption","option","handleRespondToRfi","useCallback","componentEvents","rfiAlerts","rfiAlertsArray","hasPendingResponseRfis","request","InformationRequestStatus","hasPendingReviewRfis","onCreatePayment","onCreateHistoricalPayment","handleDateRangeChange","onViewPayment","paymentId","allAlerts","BaseLayout","paginationProps","PaymentsListPresentation"],"mappings":";;;;;;;;;;;;AAkDO,SAASA,GAAaC,GAA0B;AACrD,SAAO,gBAAAC,EAACC,GAAA,EAAsB,GAAGF,EAAA,CAAO;AAC1C;AAQO,SAASE,EAAqBF,GAAkC;AACrE,SACE,gBAAAC,EAACE,GAAA,EAAe,GAAGH,GACjB,UAAA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAqB,CAACC,IAAiB,MAAM;AACjD,QAAMC,wBAAc,KAAA,GACdC,wBAAgB,KAAA;AAEtB,SAAAA,EAAU,SAASA,EAAU,SAAA,IAAaF,CAAM,GAEhDC,EAAQ,SAASA,EAAQ,SAAA,KAAc,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SAASC,CAAU;AAErF,SACE,gBAAAvB;AAAA,IAACoD;AAAA,IAAA;AAAA,MACC,oBAAA1B;AAAA,MACA,gBAAAZ;AAAA,MACA,iBAAA8B;AAAA,MACA,2BAAAC;AAAA,MACA,mBAAmBC;AAAA,MACnB,eAAAC;AAAA,MACA,QAAQE;AAAA,MACR,WAAAzC;AAAA,MACA,6BAAAsB;AAAA,MACA,SAAApB;AAAA,MACA,iBAAAyC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -8,32 +8,32 @@ import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/
8
8
  import { useI18n as T } from "../../../../i18n/I18n.js";
9
9
  import V from "../../../../hooks/useNumberFormatter.js";
10
10
  import B from "../../../../assets/icons/eye.svg.js";
11
- import h from "../../../../assets/icons/plus-circle.svg.js";
11
+ import p from "../../../../assets/icons/plus-circle.svg.js";
12
12
  import { useDateFormatter as I } from "../../../../hooks/useDateFormatter.js";
13
13
  import { ConfirmWireDetails as M } from "../../../Payroll/ConfirmWireDetails/ConfirmWireDetails.js";
14
14
  import { WithUnstableFeature as W } from "../../../../contexts/UnstableFeaturesProvider/WithUnstableFeature.js";
15
15
  import { useDataView as E } from "../../../Common/DataView/useDataView.js";
16
16
  import { DataView as H } from "../../../Common/DataView/DataView.js";
17
17
  const at = ({
18
- contractorPayments: l,
19
- numberOfMonths: p,
20
- onCreatePayment: s,
21
- onCreateHistoricalPayment: y,
22
- onDateRangeChange: f,
23
- onViewPayment: b,
18
+ contractorPayments: s,
19
+ numberOfMonths: y,
20
+ onCreatePayment: l,
21
+ onCreateHistoricalPayment: f,
22
+ onDateRangeChange: b,
23
+ onViewPayment: g,
24
24
  alerts: c = [],
25
- companyId: g,
26
- hasUnresolvedWireInRequests: C,
25
+ companyId: C,
26
+ hasUnresolvedWireInRequests: D,
27
27
  onEvent: P,
28
- paginationProps: D
28
+ paginationProps: m
29
29
  }) => {
30
- const { Box: v, Button: r, Heading: m, Text: d, Select: x, ButtonIcon: L, Alert: w } = R();
30
+ const { Box: v, Button: r, Heading: d, Text: u, Select: x, ButtonIcon: L, Alert: w } = R();
31
31
  T("Contractor.Payments.PaymentsList");
32
- const { t: n } = $("Contractor.Payments.PaymentsList"), u = V("currency"), { formatLongWithYear: A } = I(), N = [
32
+ const { t: n } = $("Contractor.Payments.PaymentsList"), h = V("currency"), { formatLongWithYear: A } = I(), F = [
33
33
  { value: "3", label: n("dateRanges.last3Months") },
34
34
  { value: "6", label: n("dateRanges.last6Months") }
35
- ], { ...j } = E({
36
- data: l,
35
+ ], { ...N } = E({
36
+ data: s,
37
37
  columns: [
38
38
  {
39
39
  title: n("paymentDateColumnLabel"),
@@ -42,12 +42,12 @@ const at = ({
42
42
  {
43
43
  title: n("wageTotalColumnLabel"),
44
44
  justify: "end",
45
- render: ({ totals: e }) => u(Number(e?.wageAmount || 0))
45
+ render: ({ totals: e }) => h(Number(e?.wageAmount || 0))
46
46
  },
47
47
  {
48
48
  title: n("reimbursementTotalColumnLabel"),
49
49
  justify: "end",
50
- render: ({ totals: e }) => u(Number(e?.reimbursementAmount) || 0)
50
+ render: ({ totals: e }) => h(Number(e?.reimbursementAmount) || 0)
51
51
  }
52
52
  ],
53
53
  itemMenu: ({ uuid: e }) => /* @__PURE__ */ t(
@@ -56,7 +56,7 @@ const at = ({
56
56
  "aria-label": n("viewPaymentCta"),
57
57
  variant: "tertiary",
58
58
  onClick: () => {
59
- b(e || "");
59
+ g(e || "");
60
60
  },
61
61
  children: /* @__PURE__ */ t(B, { "aria-hidden": !0 })
62
62
  }
@@ -65,17 +65,18 @@ const at = ({
65
65
  r,
66
66
  {
67
67
  variant: "secondary",
68
- icon: /* @__PURE__ */ t(h, { "aria-hidden": !0 }),
69
- onClick: s,
68
+ icon: /* @__PURE__ */ t(p, { "aria-hidden": !0 }),
69
+ onClick: l,
70
70
  children: n("createPaymentCta")
71
71
  }
72
72
  ) }) }),
73
- pagination: D
73
+ pagination: m,
74
+ isFetching: m?.isFetching
74
75
  });
75
76
  return /* @__PURE__ */ a(i, { flexDirection: "column", gap: 24, children: [
76
- /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ t(m, { as: "h1", styledAs: "h2", children: n("title") }) }),
77
- C && /* @__PURE__ */ t(M, { companyId: g, onEvent: P }),
78
- c.length > 0 && /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: c.map((e, F) => /* @__PURE__ */ t(
77
+ /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ t(d, { as: "h1", styledAs: "h2", children: n("title") }) }),
78
+ D && /* @__PURE__ */ t(M, { companyId: C, onEvent: P }),
79
+ c.length > 0 && /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: c.map((e, j) => /* @__PURE__ */ t(
79
80
  w,
80
81
  {
81
82
  label: n(`alerts.${e.title}`, e.translationParams),
@@ -86,7 +87,7 @@ const at = ({
86
87
  e.onAction && e.actionLabel && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(r, { variant: "secondary", onClick: e.onAction, children: n(`alerts.${e.actionLabel}`) }) })
87
88
  ] })
88
89
  },
89
- `${e.type}-${e.title}-${F}`
90
+ `${e.type}-${e.title}-${j}`
90
91
  )) }),
91
92
  /* @__PURE__ */ a(
92
93
  i,
@@ -102,29 +103,29 @@ const at = ({
102
103
  },
103
104
  justifyContent: "space-between",
104
105
  children: [
105
- /* @__PURE__ */ t(m, { as: "h2", styledAs: "h4", children: n("subtitle") }),
106
+ /* @__PURE__ */ t(d, { as: "h2", styledAs: "h4", children: n("subtitle") }),
106
107
  /* @__PURE__ */ a("div", { className: o.actionsContainer, children: [
107
108
  /* @__PURE__ */ t(
108
109
  x,
109
110
  {
110
111
  id: "date-range-select",
111
- value: p.toString(),
112
+ value: y.toString(),
112
113
  onChange: (e) => {
113
- f(Number(e));
114
+ b(Number(e));
114
115
  },
115
- options: N,
116
+ options: F,
116
117
  isRequired: !0,
117
118
  label: n("startDate"),
118
119
  placeholder: "",
119
120
  shouldVisuallyHideLabel: !0
120
121
  }
121
122
  ),
122
- l.length > 0 && /* @__PURE__ */ t(
123
+ s.length > 0 && /* @__PURE__ */ t(
123
124
  r,
124
125
  {
125
- onClick: s,
126
+ onClick: l,
126
127
  variant: "secondary",
127
- icon: /* @__PURE__ */ t(h, { "aria-hidden": !0 }),
128
+ icon: /* @__PURE__ */ t(p, { "aria-hidden": !0 }),
128
129
  className: o.nowrap,
129
130
  children: n("createPaymentCta")
130
131
  }
@@ -133,15 +134,15 @@ const at = ({
133
134
  ]
134
135
  }
135
136
  ),
136
- /* @__PURE__ */ t(H, { label: n("subtitle"), ...j }),
137
+ /* @__PURE__ */ t(H, { label: n("subtitle"), ...N }),
137
138
  /* @__PURE__ */ t(W, { feature: "historicalPayments", children: /* @__PURE__ */ t("div", { className: o.historicalPaymentCta, children: /* @__PURE__ */ t(
138
139
  v,
139
140
  {
140
141
  header: /* @__PURE__ */ a(i, { flexDirection: "column", gap: 4, children: [
141
- /* @__PURE__ */ t(d, { weight: "semibold", children: n("historicalPaymentCta.title") }),
142
- /* @__PURE__ */ t(d, { variant: "supporting", children: n("historicalPaymentCta.description") })
142
+ /* @__PURE__ */ t(u, { weight: "semibold", children: n("historicalPaymentCta.title") }),
143
+ /* @__PURE__ */ t(u, { variant: "supporting", children: n("historicalPaymentCta.description") })
143
144
  ] }),
144
- footer: /* @__PURE__ */ t(r, { variant: "secondary", onClick: y, children: n("historicalPaymentCta.button") })
145
+ footer: /* @__PURE__ */ t(r, { variant: "secondary", onClick: f, children: n("historicalPaymentCta.button") })
145
146
  }
146
147
  ) }) })
147
148
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentsListPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroupWithBlockers } from '@gusto/embedded-api/models/components/contractorpaymentgroupwithblockers'\nimport type { InternalAlert } from '../types'\nimport styles from './PaymentsListPresentation.module.scss'\nimport { DataView, Flex, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { WithUnstableFeature } from '@/contexts/UnstableFeaturesProvider/WithUnstableFeature'\n\ninterface ContractorPaymentPaymentsListPresentationProps {\n numberOfMonths: number\n contractorPayments: ContractorPaymentGroupWithBlockers[]\n onCreatePayment: () => void\n onCreateHistoricalPayment: () => void\n onDateRangeChange: (numberOfMonths: number) => void\n onViewPayment: (paymentId: string) => void\n alerts?: InternalAlert[]\n companyId: string\n hasUnresolvedWireInRequests: boolean\n onEvent: (type: EventType, data?: unknown) => void\n paginationProps?: PaginationControlProps\n}\n\n/** @internal */\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onCreateHistoricalPayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n companyId,\n hasUnresolvedWireInRequests,\n onEvent,\n paginationProps,\n}: ContractorPaymentPaymentsListPresentationProps) => {\n const { Box, Button, Heading, Text, Select, ButtonIcon, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentsList')\n const { t } = useTranslation('Contractor.Payments.PaymentsList')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const dateRangeOptions = [\n { value: '3', label: t('dateRanges.last3Months') },\n { value: '6', label: t('dateRanges.last6Months') },\n ]\n const { ...dataViewProps } = useDataView({\n data: contractorPayments,\n columns: [\n {\n title: t('paymentDateColumnLabel'),\n render: ({ checkDate }) => formatLongWithYear(checkDate) || 'N/A',\n },\n {\n title: t('wageTotalColumnLabel'),\n justify: 'end',\n render: ({ totals }) => currencyFormatter(Number(totals?.wageAmount || 0)),\n },\n {\n title: t('reimbursementTotalColumnLabel'),\n justify: 'end',\n render: ({ totals }) => currencyFormatter(Number(totals?.reimbursementAmount) || 0),\n },\n ],\n itemMenu: ({ uuid }) => (\n <ButtonIcon\n aria-label={t('viewPaymentCta')}\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(uuid || '')\n }}\n >\n <EyeIcon aria-hidden />\n </ButtonIcon>\n ),\n emptyState: () => (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={onCreatePayment}\n >\n {t('createPaymentCta')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ),\n pagination: paginationProps,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Heading>\n </Flex>\n\n {hasUnresolvedWireInRequests && (\n <ConfirmWireDetails companyId={companyId} onEvent={onEvent} />\n )}\n\n {alerts.length > 0 && (\n <Flex flexDirection=\"column\" gap={16}>\n {alerts.map((alert, index) => (\n <Alert\n key={`${alert.type}-${alert.title}-${index}`}\n label={t(`alerts.${alert.title}` as never, alert.translationParams)}\n status={alert.type}\n onDismiss={alert.onDismiss}\n >\n <Flex flexDirection=\"column\" gap={12}>\n {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n {alert.onAction && alert.actionLabel && (\n <div>\n <Button variant=\"secondary\" onClick={alert.onAction}>\n {t(`alerts.${alert.actionLabel}` as never)}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n ))}\n </Flex>\n )}\n\n <Flex\n flexDirection={{\n base: 'column',\n small: 'row',\n }}\n gap={16}\n alignItems={{\n base: 'stretch',\n small: 'center',\n }}\n justifyContent=\"space-between\"\n >\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('subtitle')}\n </Heading>\n <div className={styles.actionsContainer}>\n <Select\n id=\"date-range-select\"\n value={numberOfMonths.toString()}\n onChange={value => {\n onDateRangeChange(Number(value))\n }}\n options={dateRangeOptions}\n isRequired\n label={t('startDate')}\n placeholder=\"\"\n shouldVisuallyHideLabel\n />\n {contractorPayments.length > 0 && (\n <Button\n onClick={onCreatePayment}\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n className={styles.nowrap}\n >\n {t('createPaymentCta')}\n </Button>\n )}\n </div>\n </Flex>\n\n <DataView label={t('subtitle')} {...dataViewProps} />\n\n <WithUnstableFeature feature=\"historicalPayments\">\n <div className={styles.historicalPaymentCta}>\n <Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Text weight=\"semibold\">{t('historicalPaymentCta.title')}</Text>\n <Text variant=\"supporting\">{t('historicalPaymentCta.description')}</Text>\n </Flex>\n }\n footer={\n <Button variant=\"secondary\" onClick={onCreateHistoricalPayment}>\n {t('historicalPaymentCta.button')}\n </Button>\n }\n />\n </div>\n </WithUnstableFeature>\n </Flex>\n )\n}\n"],"names":["PaymentsListPresentation","contractorPayments","numberOfMonths","onCreatePayment","onCreateHistoricalPayment","onDateRangeChange","onViewPayment","alerts","companyId","hasUnresolvedWireInRequests","onEvent","paginationProps","Box","Button","Heading","Text","Select","ButtonIcon","Alert","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","dateRangeOptions","dataViewProps","useDataView","checkDate","totals","uuid","jsx","EyeIcon","EmptyData","ActionsLayout","PlusCircleIcon","jsxs","Flex","ConfirmWireDetails","alert","index","styles","value","DataView","WithUnstableFeature"],"mappings":";;;;;;;;;;;;;;;;AA+BO,MAAMA,KAA2B,CAAC;AAAA,EACvC,oBAAAC;AAAA,EACA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Q;AAAA,gBACR,MAAM,gBAAA8B,EAACI,GAAA,EAAe,eAAW,GAAA,CAAC;AAAA,gBAClC,WAAWM,EAAO;AAAA,gBAEjB,YAAE,kBAAkB;AAAA,cAAA;AAAA,YAAA;AAAA,UACvB,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGDE,GAAA,EAAS,OAAOxB,EAAE,UAAU,GAAI,GAAGO,GAAe;AAAA,IAEnD,gBAAAK,EAACa,KAAoB,SAAQ,sBAC3B,4BAAC,OAAA,EAAI,WAAWH,EAAO,sBACrB,UAAA,gBAAAV;AAAA,MAACrB;AAAA,MAAA;AAAA,QACC,QACE,gBAAA0B,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAN,EAAClB,GAAA,EAAK,QAAO,YAAY,UAAAM,EAAE,4BAA4B,GAAE;AAAA,4BACxDN,GAAA,EAAK,SAAQ,cAAc,UAAAM,EAAE,kCAAkC,EAAA,CAAE;AAAA,QAAA,GACpE;AAAA,QAEF,0BACGR,GAAA,EAAO,SAAQ,aAAY,SAAST,GAClC,UAAAiB,EAAE,6BAA6B,EAAA,CAClC;AAAA,MAAA;AAAA,IAAA,GAGN,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PaymentsListPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroupWithBlockers } from '@gusto/embedded-api/models/components/contractorpaymentgroupwithblockers'\nimport type { InternalAlert } from '../types'\nimport styles from './PaymentsListPresentation.module.scss'\nimport { DataView, Flex, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { WithUnstableFeature } from '@/contexts/UnstableFeaturesProvider/WithUnstableFeature'\n\ninterface ContractorPaymentPaymentsListPresentationProps {\n numberOfMonths: number\n contractorPayments: ContractorPaymentGroupWithBlockers[]\n onCreatePayment: () => void\n onCreateHistoricalPayment: () => void\n onDateRangeChange: (numberOfMonths: number) => void\n onViewPayment: (paymentId: string) => void\n alerts?: InternalAlert[]\n companyId: string\n hasUnresolvedWireInRequests: boolean\n onEvent: (type: EventType, data?: unknown) => void\n paginationProps?: PaginationControlProps\n}\n\n/** @internal */\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onCreateHistoricalPayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n companyId,\n hasUnresolvedWireInRequests,\n onEvent,\n paginationProps,\n}: ContractorPaymentPaymentsListPresentationProps) => {\n const { Box, Button, Heading, Text, Select, ButtonIcon, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentsList')\n const { t } = useTranslation('Contractor.Payments.PaymentsList')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const dateRangeOptions = [\n { value: '3', label: t('dateRanges.last3Months') },\n { value: '6', label: t('dateRanges.last6Months') },\n ]\n const { ...dataViewProps } = useDataView({\n data: contractorPayments,\n columns: [\n {\n title: t('paymentDateColumnLabel'),\n render: ({ checkDate }) => formatLongWithYear(checkDate) || 'N/A',\n },\n {\n title: t('wageTotalColumnLabel'),\n justify: 'end',\n render: ({ totals }) => currencyFormatter(Number(totals?.wageAmount || 0)),\n },\n {\n title: t('reimbursementTotalColumnLabel'),\n justify: 'end',\n render: ({ totals }) => currencyFormatter(Number(totals?.reimbursementAmount) || 0),\n },\n ],\n itemMenu: ({ uuid }) => (\n <ButtonIcon\n aria-label={t('viewPaymentCta')}\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(uuid || '')\n }}\n >\n <EyeIcon aria-hidden />\n </ButtonIcon>\n ),\n emptyState: () => (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={onCreatePayment}\n >\n {t('createPaymentCta')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ),\n pagination: paginationProps,\n isFetching: paginationProps?.isFetching,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Heading>\n </Flex>\n\n {hasUnresolvedWireInRequests && (\n <ConfirmWireDetails companyId={companyId} onEvent={onEvent} />\n )}\n\n {alerts.length > 0 && (\n <Flex flexDirection=\"column\" gap={16}>\n {alerts.map((alert, index) => (\n <Alert\n key={`${alert.type}-${alert.title}-${index}`}\n label={t(`alerts.${alert.title}` as never, alert.translationParams)}\n status={alert.type}\n onDismiss={alert.onDismiss}\n >\n <Flex flexDirection=\"column\" gap={12}>\n {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n {alert.onAction && alert.actionLabel && (\n <div>\n <Button variant=\"secondary\" onClick={alert.onAction}>\n {t(`alerts.${alert.actionLabel}` as never)}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n ))}\n </Flex>\n )}\n\n <Flex\n flexDirection={{\n base: 'column',\n small: 'row',\n }}\n gap={16}\n alignItems={{\n base: 'stretch',\n small: 'center',\n }}\n justifyContent=\"space-between\"\n >\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('subtitle')}\n </Heading>\n <div className={styles.actionsContainer}>\n <Select\n id=\"date-range-select\"\n value={numberOfMonths.toString()}\n onChange={value => {\n onDateRangeChange(Number(value))\n }}\n options={dateRangeOptions}\n isRequired\n label={t('startDate')}\n placeholder=\"\"\n shouldVisuallyHideLabel\n />\n {contractorPayments.length > 0 && (\n <Button\n onClick={onCreatePayment}\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n className={styles.nowrap}\n >\n {t('createPaymentCta')}\n </Button>\n )}\n </div>\n </Flex>\n\n <DataView label={t('subtitle')} {...dataViewProps} />\n\n <WithUnstableFeature feature=\"historicalPayments\">\n <div className={styles.historicalPaymentCta}>\n <Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Text weight=\"semibold\">{t('historicalPaymentCta.title')}</Text>\n <Text variant=\"supporting\">{t('historicalPaymentCta.description')}</Text>\n </Flex>\n }\n footer={\n <Button variant=\"secondary\" onClick={onCreateHistoricalPayment}>\n {t('historicalPaymentCta.button')}\n </Button>\n }\n />\n </div>\n </WithUnstableFeature>\n </Flex>\n )\n}\n"],"names":["PaymentsListPresentation","contractorPayments","numberOfMonths","onCreatePayment","onCreateHistoricalPayment","onDateRangeChange","onViewPayment","alerts","companyId","hasUnresolvedWireInRequests","onEvent","paginationProps","Box","Button","Heading","Text","Select","ButtonIcon","Alert","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","dateRangeOptions","dataViewProps","useDataView","checkDate","totals","uuid","jsx","EyeIcon","EmptyData","ActionsLayout","PlusCircleIcon","jsxs","Flex","ConfirmWireDetails","alert","index","styles","value","DataView","WithUnstableFeature"],"mappings":";;;;;;;;;;;;;;;;AA+BO,MAAMA,KAA2B,CAAC;AAAA,EACvC,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AAAA,EACT,WAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,SAAAC;AAAA,EACA,i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ACvB,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGDE,GAAA,EAAS,OAAOxB,EAAE,UAAU,GAAI,GAAGO,GAAe;AAAA,IAEnD,gBAAAK,EAACa,KAAoB,SAAQ,sBAC3B,4BAAC,OAAA,EAAI,WAAWH,EAAO,sBACrB,UAAA,gBAAAV;AAAA,MAACrB;AAAA,MAAA;AAAA,QACC,QACE,gBAAA0B,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAN,EAAClB,GAAA,EAAK,QAAO,YAAY,UAAAM,EAAE,4BAA4B,GAAE;AAAA,4BACxDN,GAAA,EAAK,SAAQ,cAAc,UAAAM,EAAE,kCAAkC,EAAA,CAAE;AAAA,QAAA,GACpE;AAAA,QAEF,0BACGR,GAAA,EAAO,SAAQ,aAAY,SAAST,GAClC,UAAAiB,EAAE,6BAA6B,EAAA,CAClC;AAAA,MAAA;AAAA,IAAA,GAGN,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -9,15 +9,12 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../../../shared/constants.js";
15
13
  import "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import "../../../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
14
  import { createCompoundContext as t } from "../../../../../Base/createCompoundContext.js";
18
- const [v, P] = t("DocumentListContext");
15
+ const [d, a] = t("DocumentListContext");
19
16
  export {
20
- P as DocumentListProvider,
21
- v as useDocumentList
17
+ a as DocumentListProvider,
18
+ d as useDocumentList
22
19
  };
23
20
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}