@gusto/embedded-react-sdk 0.54.1 → 0.55.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 (135) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/Common/TaxInputs/TaxInputs.js +65 -64
  3. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  4. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  5. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  6. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  7. package/dist/components/Common/UI/Select/Select.module.scss.js +5 -5
  8. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  13. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  15. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  16. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  17. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  18. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  19. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  20. package/dist/components/Company/Industry/Context.js +6 -7
  21. package/dist/components/Company/Industry/Context.js.map +1 -1
  22. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  23. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  24. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  25. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  26. package/dist/components/Company/OnboardingFlow/OnboardingFlow.d.ts +1 -1
  27. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +21 -15
  28. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  29. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +8 -0
  30. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +12 -5
  31. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  32. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  33. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  34. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  35. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  36. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  37. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
  39. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  40. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.d.ts +4 -2
  41. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js +148 -117
  42. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js.map +1 -1
  43. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +56 -55
  44. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  45. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +1 -1
  46. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +15 -12
  47. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -1
  48. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.d.ts +69 -0
  49. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.js +48 -0
  50. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.js.map +1 -0
  51. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.d.ts +20 -0
  52. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.js +25 -0
  53. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.js.map +1 -0
  54. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.d.ts +20 -0
  55. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.js +24 -0
  56. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.js.map +1 -0
  57. package/dist/components/Contractor/Payments/HistoricalPaymentFlow/index.d.ts +2 -0
  58. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js +16 -15
  59. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js.map +1 -1
  60. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
  61. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +36 -23
  62. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  63. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +10 -8
  64. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +46 -25
  65. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  66. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +53 -52
  67. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  68. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +37 -47
  69. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  70. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +47 -44
  71. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  72. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +2 -1
  73. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +65 -53
  74. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  75. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +6 -4
  76. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -1
  77. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +1 -1
  78. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +22 -19
  79. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -1
  80. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.d.ts +2 -8
  81. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js +43 -42
  82. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js.map +1 -1
  83. package/dist/components/Contractor/Payments/shared/paymentAmounts.d.ts +32 -0
  84. package/dist/components/Contractor/Payments/shared/paymentAmounts.js +11 -0
  85. package/dist/components/Contractor/Payments/shared/paymentAmounts.js.map +1 -0
  86. package/dist/components/Contractor/Payments/shared/paymentAmounts.test.d.ts +1 -0
  87. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +13 -4
  88. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +43 -38
  89. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -1
  90. package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
  91. package/dist/components/Contractor/exports/contractorManagement.js +34 -32
  92. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  93. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +6 -1
  94. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js +13 -12
  95. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js.map +1 -1
  96. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.d.ts +5 -1
  97. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js +34 -32
  98. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js.map +1 -1
  99. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  100. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  101. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  102. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
  103. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
  104. package/dist/components/Flow/Flow.js +1 -1
  105. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  106. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  107. package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
  108. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  109. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
  110. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +36 -34
  111. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  112. package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.d.ts +22 -0
  113. package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.js +14 -0
  114. package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.js.map +1 -0
  115. package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.d.ts +19 -0
  116. package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.js +8 -0
  117. package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.js.map +1 -0
  118. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +41 -0
  119. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js +14 -0
  120. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -0
  121. package/dist/contexts/index.d.ts +1 -0
  122. package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js +34 -32
  123. package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js.map +1 -1
  124. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +20 -18
  125. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -1
  126. package/dist/i18n/en/common.json.d.ts +0 -21
  127. package/dist/i18n/types.d.ts +10 -2
  128. package/dist/shared/constants.d.ts +2 -0
  129. package/dist/shared/constants.js +1 -0
  130. package/dist/shared/constants.js.map +1 -1
  131. package/dist/style.css +1 -1
  132. package/dist/test-utils/renderWithProviders.d.ts +4 -1
  133. package/dist/test-utils/tableQueries.d.ts +9 -0
  134. package/docs/guides/endpoint-inventory.json +7 -0
  135. package/package.json +20 -20
@@ -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 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 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","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,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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AA,EAAA;AAGN;"}
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,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,KAAKD,EAAO,GAE5C;AAAA,IACL,WAAWE,EAAU,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,IACpD,SAASD,EAAQ,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EAAA;AAEpD,GAEMH,IAAO,CAAC,EAAE,WAAAK,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,QAAwC;AACtF,EAAAC,EAAuB,oCAAoCH,CAAU;AAErE,QAAM,CAACI,GAAgBC,CAAiB,IAAIC,EAAS,CAAC,GAChD,EAAE,aAAAC,GAAa,cAAAC,GAAc,oBAAAC,EAAA,IAAuBC,EAAA,GAEpD,EAAE,WAAAZ,GAAW,SAAAD,EAAA,IAAYc,EAAQ,MAAMhB,EAAmBS,CAAc,GAAG,CAACA,CAAc,CAAC,GAE3F,EAAE,MAAAQ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AA,EACT,GAAG,CAACV,GAAqBM,CAAkB,CAAC,GAEtCS,IAAkB,MAAM;AAC5B,IAAAhC,EAAQyB,EAAgB,yBAAyB;AAAA,EACnD,GAEMQ,IAA4B,MAAM;AACtC,IAAAjC,EAAQyB,EAAgB,oCAAoC;AAAA,EAC9D,GAEMS,IAAwB,CAAC/B,MAA2B;AACxD,IAAAC,EAAkBD,CAAc;AAAA,EAClC,GAEMgC,IAAgB,CAACC,MAAsB;AAC3C,IAAApC,EAAQyB,EAAgB,yBAAyB,EAAE,WAAAW,EAAA,CAAW;AAAA,EAChE,GAEMC,IAAY3B,EAAQ,MACjB,CAAC,GAAGgB,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;"}
@@ -6,6 +6,7 @@ interface ContractorPaymentPaymentsListPresentationProps {
6
6
  numberOfMonths: number;
7
7
  contractorPayments: ContractorPaymentGroupWithBlockers[];
8
8
  onCreatePayment: () => void;
9
+ onCreateHistoricalPayment: () => void;
9
10
  onDateRangeChange: (numberOfMonths: number) => void;
10
11
  onViewPayment: (paymentId: string) => void;
11
12
  alerts?: InternalAlert[];
@@ -15,5 +16,5 @@ interface ContractorPaymentPaymentsListPresentationProps {
15
16
  paginationProps?: PaginationControlProps;
16
17
  }
17
18
  /** @internal */
18
- export declare const PaymentsListPresentation: ({ contractorPayments, numberOfMonths, onCreatePayment, onDateRangeChange, onViewPayment, alerts, companyId, hasUnresolvedWireInRequests, onEvent, paginationProps, }: ContractorPaymentPaymentsListPresentationProps) => import("react").JSX.Element;
19
+ export declare const PaymentsListPresentation: ({ contractorPayments, numberOfMonths, onCreatePayment, onCreateHistoricalPayment, onDateRangeChange, onViewPayment, alerts, companyId, hasUnresolvedWireInRequests, onEvent, paginationProps, }: ContractorPaymentPaymentsListPresentationProps) => import("react").JSX.Element;
19
20
  export {};
@@ -1,92 +1,94 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
- import { useTranslation as N } from "react-i18next";
3
- import u from "./PaymentsListPresentation.module.scss.js";
1
+ import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
+ import { useTranslation as $ } from "react-i18next";
3
+ import o from "./PaymentsListPresentation.module.scss.js";
4
4
  import { Flex as i } from "../../../Common/Flex/Flex.js";
5
- import { EmptyData as j } from "../../../Common/EmptyData/EmptyData.js";
6
- import { ActionsLayout as $ } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import { useI18n as S } from "../../../../i18n/I18n.js";
9
- import k from "../../../../hooks/useNumberFormatter.js";
10
- import R from "../../../../assets/icons/eye.svg.js";
11
- import d from "../../../../assets/icons/plus-circle.svg.js";
12
- import { useDateFormatter as V } from "../../../../hooks/useDateFormatter.js";
13
- import { ConfirmWireDetails as I } from "../../../Payroll/ConfirmWireDetails/ConfirmWireDetails.js";
14
- import { useDataView as M } from "../../../Common/DataView/useDataView.js";
15
- import { DataView as T } from "../../../Common/DataView/DataView.js";
16
- const _ = ({
17
- contractorPayments: a,
5
+ import { EmptyData as k } from "../../../Common/EmptyData/EmptyData.js";
6
+ import { ActionsLayout as S } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import { useI18n as T } from "../../../../i18n/I18n.js";
9
+ import V from "../../../../hooks/useNumberFormatter.js";
10
+ import B from "../../../../assets/icons/eye.svg.js";
11
+ import h from "../../../../assets/icons/plus-circle.svg.js";
12
+ import { useDateFormatter as I } from "../../../../hooks/useDateFormatter.js";
13
+ import { ConfirmWireDetails as M } from "../../../Payroll/ConfirmWireDetails/ConfirmWireDetails.js";
14
+ import { WithUnstableFeature as W } from "../../../../contexts/UnstableFeaturesProvider/WithUnstableFeature.js";
15
+ import { useDataView as E } from "../../../Common/DataView/useDataView.js";
16
+ import { DataView as H } from "../../../Common/DataView/DataView.js";
17
+ const at = ({
18
+ contractorPayments: l,
18
19
  numberOfMonths: p,
19
20
  onCreatePayment: s,
20
- onDateRangeChange: h,
21
- onViewPayment: y,
22
- alerts: l = [],
23
- companyId: f,
24
- hasUnresolvedWireInRequests: b,
25
- onEvent: g,
26
- paginationProps: C
21
+ onCreateHistoricalPayment: y,
22
+ onDateRangeChange: f,
23
+ onViewPayment: b,
24
+ alerts: c = [],
25
+ companyId: g,
26
+ hasUnresolvedWireInRequests: C,
27
+ onEvent: P,
28
+ paginationProps: D
27
29
  }) => {
28
- const { Button: r, Heading: m, Select: D, ButtonIcon: v, Alert: P } = F();
29
- S("Contractor.Payments.PaymentsList");
30
- const { t: n } = N("Contractor.Payments.PaymentsList"), c = k("currency"), { formatLongWithYear: L } = V(), x = [
30
+ const { Box: v, Button: r, Heading: m, Text: d, Select: x, ButtonIcon: L, Alert: w } = R();
31
+ T("Contractor.Payments.PaymentsList");
32
+ const { t: n } = $("Contractor.Payments.PaymentsList"), u = V("currency"), { formatLongWithYear: A } = I(), N = [
31
33
  { value: "3", label: n("dateRanges.last3Months") },
32
34
  { value: "6", label: n("dateRanges.last6Months") }
33
- ], { ...w } = M({
34
- data: a,
35
+ ], { ...j } = E({
36
+ data: l,
35
37
  columns: [
36
38
  {
37
39
  title: n("paymentDateColumnLabel"),
38
- render: ({ checkDate: e }) => L(e) || "N/A"
40
+ render: ({ checkDate: e }) => A(e) || "N/A"
39
41
  },
40
42
  {
41
43
  title: n("wageTotalColumnLabel"),
42
44
  justify: "end",
43
- render: ({ totals: e }) => c(Number(e?.wageAmount || 0))
45
+ render: ({ totals: e }) => u(Number(e?.wageAmount || 0))
44
46
  },
45
47
  {
46
48
  title: n("reimbursementTotalColumnLabel"),
47
49
  justify: "end",
48
- render: ({ totals: e }) => c(Number(e?.reimbursementAmount) || 0)
50
+ render: ({ totals: e }) => u(Number(e?.reimbursementAmount) || 0)
49
51
  }
50
52
  ],
51
53
  itemMenu: ({ uuid: e }) => /* @__PURE__ */ t(
52
- v,
54
+ L,
53
55
  {
54
56
  "aria-label": n("viewPaymentCta"),
55
57
  variant: "tertiary",
56
58
  onClick: () => {
57
- y(e || "");
59
+ b(e || "");
58
60
  },
59
- children: /* @__PURE__ */ t(R, { "aria-hidden": !0 })
61
+ children: /* @__PURE__ */ t(B, { "aria-hidden": !0 })
60
62
  }
61
63
  ),
62
- emptyState: () => /* @__PURE__ */ t(j, { title: n("noPaymentsFound"), description: n("noPaymentsDescription"), children: /* @__PURE__ */ t($, { justifyContent: "center", children: /* @__PURE__ */ t(
64
+ emptyState: () => /* @__PURE__ */ t(k, { title: n("noPaymentsFound"), description: n("noPaymentsDescription"), children: /* @__PURE__ */ t(S, { justifyContent: "center", children: /* @__PURE__ */ t(
63
65
  r,
64
66
  {
65
67
  variant: "secondary",
66
- icon: /* @__PURE__ */ t(d, { "aria-hidden": !0 }),
68
+ icon: /* @__PURE__ */ t(h, { "aria-hidden": !0 }),
67
69
  onClick: s,
68
70
  children: n("createPaymentCta")
69
71
  }
70
72
  ) }) }),
71
- pagination: C
73
+ pagination: D
72
74
  });
73
- return /* @__PURE__ */ o(i, { flexDirection: "column", gap: 24, children: [
75
+ return /* @__PURE__ */ a(i, { flexDirection: "column", gap: 24, children: [
74
76
  /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ t(m, { as: "h1", styledAs: "h2", children: n("title") }) }),
75
- b && /* @__PURE__ */ t(I, { companyId: f, onEvent: g }),
76
- l.length > 0 && /* @__PURE__ */ t(i, { flexDirection: "column", gap: 16, children: l.map((e, A) => /* @__PURE__ */ t(
77
- P,
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(
79
+ w,
78
80
  {
79
81
  label: n(`alerts.${e.title}`, e.translationParams),
80
82
  status: e.type,
81
83
  onDismiss: e.onDismiss,
82
- children: /* @__PURE__ */ o(i, { flexDirection: "column", gap: 12, children: [
84
+ children: /* @__PURE__ */ a(i, { flexDirection: "column", gap: 12, children: [
83
85
  typeof e.content == "string" ? n(`alerts.${e.content}`) : e.content ?? null,
84
86
  e.onAction && e.actionLabel && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(r, { variant: "secondary", onClick: e.onAction, children: n(`alerts.${e.actionLabel}`) }) })
85
87
  ] })
86
88
  },
87
- `${e.type}-${e.title}-${A}`
89
+ `${e.type}-${e.title}-${F}`
88
90
  )) }),
89
- /* @__PURE__ */ o(
91
+ /* @__PURE__ */ a(
90
92
  i,
91
93
  {
92
94
  flexDirection: {
@@ -101,29 +103,29 @@ const _ = ({
101
103
  justifyContent: "space-between",
102
104
  children: [
103
105
  /* @__PURE__ */ t(m, { as: "h2", styledAs: "h4", children: n("subtitle") }),
104
- /* @__PURE__ */ o("div", { className: u.actionsContainer, children: [
106
+ /* @__PURE__ */ a("div", { className: o.actionsContainer, children: [
105
107
  /* @__PURE__ */ t(
106
- D,
108
+ x,
107
109
  {
108
110
  id: "date-range-select",
109
111
  value: p.toString(),
110
112
  onChange: (e) => {
111
- h(Number(e));
113
+ f(Number(e));
112
114
  },
113
- options: x,
115
+ options: N,
114
116
  isRequired: !0,
115
117
  label: n("startDate"),
116
118
  placeholder: "",
117
119
  shouldVisuallyHideLabel: !0
118
120
  }
119
121
  ),
120
- a.length > 0 && /* @__PURE__ */ t(
122
+ l.length > 0 && /* @__PURE__ */ t(
121
123
  r,
122
124
  {
123
125
  onClick: s,
124
126
  variant: "secondary",
125
- icon: /* @__PURE__ */ t(d, { "aria-hidden": !0 }),
126
- className: u.nowrap,
127
+ icon: /* @__PURE__ */ t(h, { "aria-hidden": !0 }),
128
+ className: o.nowrap,
127
129
  children: n("createPaymentCta")
128
130
  }
129
131
  )
@@ -131,10 +133,20 @@ const _ = ({
131
133
  ]
132
134
  }
133
135
  ),
134
- /* @__PURE__ */ t(T, { label: n("subtitle"), ...w })
136
+ /* @__PURE__ */ t(H, { label: n("subtitle"), ...j }),
137
+ /* @__PURE__ */ t(W, { feature: "historicalPayments", children: /* @__PURE__ */ t("div", { className: o.historicalPaymentCta, children: /* @__PURE__ */ t(
138
+ v,
139
+ {
140
+ 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") })
143
+ ] }),
144
+ footer: /* @__PURE__ */ t(r, { variant: "secondary", onClick: y, children: n("historicalPaymentCta.button") })
145
+ }
146
+ ) }) })
135
147
  ] });
136
148
  };
137
149
  export {
138
- _ as PaymentsListPresentation
150
+ at as PaymentsListPresentation
139
151
  };
140
152
  //# sourceMappingURL=PaymentsListPresentation.js.map
@@ -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'\n\ninterface ContractorPaymentPaymentsListPresentationProps {\n numberOfMonths: number\n contractorPayments: ContractorPaymentGroupWithBlockers[]\n onCreatePayment: () => 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 onDateRangeChange,\n onViewPayment,\n alerts = [],\n companyId,\n hasUnresolvedWireInRequests,\n onEvent,\n paginationProps,\n}: ContractorPaymentPaymentsListPresentationProps) => {\n const { Button, Heading, 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 </Flex>\n )\n}\n"],"names":["PaymentsListPresentation","contractorPayments","numberOfMonths","onCreatePayment","onDateRangeChange","onViewPayment","alerts","companyId","hasUnresolvedWireInRequests","onEvent","paginationProps","Button","Heading","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"],"mappings":";;;;;;;;;;;;;;;AA6BO,MAAMA,IAA2B,CAAC;AAAA,EACvC,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AAAA,EACT,WAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AACF,MAAsD;AACpD,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,QAAAC,GAAQ,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAA;AACvD,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAoBC,EAAmB,UAAU,GACjD,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzBC,IAAmB;AAAA,IACvB,EAAE,OAAO,KAAK,OAAON,EAAE,wBAAwB,EAAA;AAAA,IAC/C,EAAE,OAAO,KAAK,OAAOA,EAAE,wBAAwB,EAAA;AAAA,EAAE,GAE7C,EAAE,GAAGO,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMzB;AAAA,IACN,SAAS;A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AAK,UAAS,MACvB,UAAAM,EAAE,UAAU,GACf;AAAA,UACA,gBAAAiB,EAAC,OAAA,EAAI,WAAWK,EAAO,kBACrB,UAAA;AAAA,YAAA,gBAAAV;AAAA,cAACjB;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,OAAOX,EAAe,SAAA;AAAA,gBACtB,UAAU,CAAAuC,MAAS;AACjB,kBAAArC,EAAkB,OAAOqC,CAAK,CAAC;AAAA,gBACjC;AAAA,gBACA,SAASjB;AAAA,gBACT,YAAU;AAAA,gBACV,OAAON,EAAE,WAAW;AAAA,gBACpB,aAAY;AAAA,gBACZ,yBAAuB;AAAA,cAAA;AAAA,YAAA;AAAA,YAExBjB,EAAmB,SAAS,KAC3B,gBAAA6B;AAAA,cAACnB;AAAA,cAAA;AAAA,gBACC,SAASR;AAAA,gBACT,SAAQ;AAAA,gBACR,MAAM,gBAAA2B,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,EAAA,CAAe;AAAA,EAAA,GACrD;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 })\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,EAC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AAA;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,10 +1,12 @@
1
- const n = "_actionsContainer_1ygga_1", a = "_nowrap_1ygga_19", o = {
2
- actionsContainer: n,
3
- nowrap: a
1
+ const t = "_actionsContainer_1jhcs_1", a = "_nowrap_1jhcs_19", n = "_historicalPaymentCta_1jhcs_23", o = {
2
+ actionsContainer: t,
3
+ nowrap: a,
4
+ historicalPaymentCta: n
4
5
  };
5
6
  export {
6
- n as actionsContainer,
7
+ t as actionsContainer,
7
8
  o as default,
9
+ n as historicalPaymentCta,
8
10
  a as nowrap
9
11
  };
10
12
  //# sourceMappingURL=PaymentsListPresentation.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentsListPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"PaymentsListPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -60,4 +60,4 @@ export declare function ViewPaymentFlow(props: ViewPaymentFlowProps): import("re
60
60
  *
61
61
  * @internal
62
62
  */
63
- export declare function ViewPaymentInternalFlow({ paymentId, onEvent, prefixBreadcrumbs, }: ViewPaymentInternalFlowProps): import("react").JSX.Element;
63
+ export declare function ViewPaymentInternalFlow(props: ViewPaymentInternalFlowProps): import("react").JSX.Element;
@@ -1,24 +1,27 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { createMachine as u } from "robot3";
3
3
  import { useState as b } from "react";
4
- import { viewPaymentBreadcrumbsNodes as d, viewPaymentMachine as p } from "./viewPaymentMachine.js";
5
- import { PaymentHistoryContextual as y } from "./ViewPaymentFlowComponents.js";
6
- import { Flow as f } from "../../../Flow/Flow.js";
4
+ import { viewPaymentBreadcrumbsNodes as d, viewPaymentMachine as y } from "./viewPaymentMachine.js";
5
+ import { PaymentHistoryContextual as f } from "./ViewPaymentFlowComponents.js";
6
+ import { Flow as p } from "../../../Flow/Flow.js";
7
7
  import { buildBreadcrumbs as w, updateBreadcrumbs as l } from "../../../../helpers/breadcrumbHelpers.js";
8
8
  const P = [];
9
- function E(e) {
10
- return /* @__PURE__ */ t(B, { ...e });
9
+ function I(e) {
10
+ return /* @__PURE__ */ r(h, { ...e });
11
+ }
12
+ function h(e) {
13
+ return /* @__PURE__ */ r(B, { ...e }, e.paymentId);
11
14
  }
12
15
  function B({
13
16
  paymentId: e,
14
- onEvent: o,
15
- prefixBreadcrumbs: m = P
17
+ onEvent: n,
18
+ prefixBreadcrumbs: o = P
16
19
  }) {
17
- const [n] = b(() => {
20
+ const [m] = b(() => {
18
21
  const a = w(d), i = Object.fromEntries(
19
- Object.entries(a).map(([r, s]) => [
20
- r,
21
- [...m, ...s]
22
+ Object.entries(a).map(([t, s]) => [
23
+ t,
24
+ [...o, ...s]
22
25
  ])
23
26
  ), c = l("history", {
24
27
  header: {
@@ -28,19 +31,19 @@ function B({
28
31
  });
29
32
  return u(
30
33
  "history",
31
- p,
32
- (r) => ({
33
- ...r,
34
+ y,
35
+ (t) => ({
36
+ ...t,
34
37
  ...c,
35
- component: y,
38
+ component: f,
36
39
  currentPaymentId: e
37
40
  })
38
41
  );
39
42
  });
40
- return /* @__PURE__ */ t(f, { machine: n, onEvent: o });
43
+ return /* @__PURE__ */ r(p, { machine: m, onEvent: n });
41
44
  }
42
45
  export {
43
- E as ViewPaymentFlow,
44
- B as ViewPaymentInternalFlow
46
+ I as ViewPaymentFlow,
47
+ h as ViewPaymentInternalFlow
45
48
  };
46
49
  //# sourceMappingURL=ViewPaymentFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewPaymentFlow.js","sources":["../../../../../src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useState } from 'react'\nimport { viewPaymentBreadcrumbsNodes, viewPaymentMachine } from './viewPaymentMachine'\nimport {\n PaymentHistoryContextual,\n type ViewPaymentFlowContextInterface,\n type ViewPaymentFlowProps,\n} from './ViewPaymentFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { FlowBreadcrumb } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { buildBreadcrumbs, updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nconst EMPTY_BREADCRUMBS: FlowBreadcrumb[] = []\n\n/**\n * Props for the flow-internal {@link ViewPaymentInternalFlow}, which layers a parent flow's\n * prefix breadcrumbs on top of the public {@link ViewPaymentFlowProps}.\n *\n * @internal\n */\nexport interface ViewPaymentInternalFlowProps extends ViewPaymentFlowProps {\n /**\n * Breadcrumbs prepended to the flow's own breadcrumb trail. Set by a parent flow (e.g.\n * `PaymentFlow`) so the breadcrumb history remains coherent across the handoff.\n */\n prefixBreadcrumbs?: FlowBreadcrumb[]\n}\n\n/**\n * Guided flow to inspect a contractor payment group's history and drill into an individual\n * contractor's payment statement.\n *\n * @remarks\n * This is the inner flow that powers the view-payment spoke of `ContractorManagement.PaymentFlow`.\n * Render it directly when you have built your own payments landing page and want to hand the user\n * off to the standard payment-viewing experience without re-implementing it. The flow ships with\n * breadcrumb navigation and lets the user cancel an individual payment from the history screen.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/payments/view/details` | Fired when the user views a specific contractor payment | `{ contractor: Contractor, paymentGroupId: string }` |\n * | `contractor/payments/cancel` | Fired when a payment is cancelled | `{ paymentId: string }` |\n * | `breadcrumb/navigate` | Fired when the user clicks a breadcrumb to navigate back | `{ key: string, onNavigate: (ctx) => ctx }` |\n *\n * @components\n * - {@link PaymentHistory}\n * - {@link PaymentStatement}\n *\n * @param props - See {@link ViewPaymentFlowProps}.\n * @returns The composed view-payment flow.\n * @alpha\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { ContractorManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <ContractorManagement.ViewPaymentFlow\n * paymentId=\"0987fcea-7b59-4907-a301-f232b5aff508\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ViewPaymentFlow(props: ViewPaymentFlowProps) {\n return <ViewPaymentInternalFlow {...props} />\n}\n\n/**\n * Flow-internal entry point for {@link ViewPaymentFlow} that additionally accepts\n * flow-injected `prefixBreadcrumbs`. Partners use {@link ViewPaymentFlow}; `PaymentFlow` renders\n * this directly to prepend its own breadcrumb trail.\n *\n * @internal\n */\nexport function ViewPaymentInternalFlow({\n paymentId,\n onEvent,\n prefixBreadcrumbs = EMPTY_BREADCRUMBS,\n}: ViewPaymentInternalFlowProps) {\n // Built once via a lazy useState initializer, not useMemo -- see CreatePaymentFlow.tsx for why:\n // a useMemo keyed on `prefixBreadcrumbs` doesn't guarantee the machine's identity survives a\n // re-render triggered by a bubbled `onEvent` call.\n const [viewPaymentFlow] = useState(() => {\n const baseBreadcrumbs = buildBreadcrumbs(viewPaymentBreadcrumbsNodes)\n const breadcrumbs = Object.fromEntries(\n Object.entries(baseBreadcrumbs).map(([stateKey, trail]) => [\n stateKey,\n [...prefixBreadcrumbs, ...trail],\n ]),\n )\n\n const initialBreadcrumbContext = updateBreadcrumbs('history', {\n header: {\n type: 'breadcrumbs' as const,\n breadcrumbs,\n },\n })\n\n return createMachine(\n 'history',\n viewPaymentMachine,\n (initialContext: ViewPaymentFlowContextInterface) => ({\n ...initialContext,\n ...initialBreadcrumbContext,\n component: PaymentHistoryContextual,\n currentPaymentId: paymentId,\n }),\n )\n })\n\n return <Flow machine={viewPaymentFlow} onEvent={onEvent} />\n}\n"],"names":["EMPTY_BREADCRUMBS","ViewPaymentFlow","props","jsx","ViewPaymentInternalFlow","paymentId","onEvent","prefixBreadcrumbs","viewPaymentFlow","useState","baseBreadcrumbs","buildBreadcrumbs","viewPaymentBreadcrumbsNodes","breadcrumbs","stateKey","trail","initialBreadcrumbContext","updateBreadcrumbs","createMachine","viewPaymentMachine","initialContext","PaymentHistoryContextual","Flow"],"mappings":";;;;;;;AAYA,MAAMA,IAAsC,CAAA;AAuDrC,SAASC,EAAgBC,GAA6B;AAC3D,SAAO,gBAAAC,EAACC,GAAA,EAAyB,GAAGF,EAAA,CAAO;AAC7C;AASO,SAASE,EAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,mBAAAC,IAAoBP;AACtB,GAAiC;AAI/B,QAAM,CAACQ,CAAe,IAAIC,EAAS,MAAM;AACvC,UAAMC,IAAkBC,EAAiBC,CAA2B,GAC9DC,IAAc,OAAO;AAAA,MACzB,OAAO,QAAQH,CAAe,EAAE,IAAI,CAAC,CAACI,GAAUC,CAAK,MAAM;AAAA,QACzDD;AAAA,QACA,CAAC,GAAGP,GAAmB,GAAGQ,CAAK;AAAA,MAAA,CAChC;AAAA,IAAA,GAGGC,IAA2BC,EAAkB,WAAW;AAAA,MAC5D,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAAJ;AAAA,MAAA;AAAA,IACF,CACD;AAED,WAAOK;AAAA,MACL;AAAA,MACAC;AAAA,MACA,CAACC,OAAqD;AAAA,QACpD,GAAGA;AAAA,QACH,GAAGJ;AAAA,QACH,WAAWK;AAAA,QACX,kBAAkBhB;AAAA,MAAA;AAAA,IACpB;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAF,EAACmB,GAAA,EAAK,SAASd,GAAiB,SAAAF,EAAA,CAAkB;AAC3D;"}
1
+ {"version":3,"file":"ViewPaymentFlow.js","sources":["../../../../../src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useState } from 'react'\nimport { viewPaymentBreadcrumbsNodes, viewPaymentMachine } from './viewPaymentMachine'\nimport {\n PaymentHistoryContextual,\n type ViewPaymentFlowContextInterface,\n type ViewPaymentFlowProps,\n} from './ViewPaymentFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { FlowBreadcrumb } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { buildBreadcrumbs, updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nconst EMPTY_BREADCRUMBS: FlowBreadcrumb[] = []\n\n/**\n * Props for the flow-internal {@link ViewPaymentInternalFlow}, which layers a parent flow's\n * prefix breadcrumbs on top of the public {@link ViewPaymentFlowProps}.\n *\n * @internal\n */\nexport interface ViewPaymentInternalFlowProps extends ViewPaymentFlowProps {\n /**\n * Breadcrumbs prepended to the flow's own breadcrumb trail. Set by a parent flow (e.g.\n * `PaymentFlow`) so the breadcrumb history remains coherent across the handoff.\n */\n prefixBreadcrumbs?: FlowBreadcrumb[]\n}\n\n/**\n * Guided flow to inspect a contractor payment group's history and drill into an individual\n * contractor's payment statement.\n *\n * @remarks\n * This is the inner flow that powers the view-payment spoke of `ContractorManagement.PaymentFlow`.\n * Render it directly when you have built your own payments landing page and want to hand the user\n * off to the standard payment-viewing experience without re-implementing it. The flow ships with\n * breadcrumb navigation and lets the user cancel an individual payment from the history screen.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/payments/view/details` | Fired when the user views a specific contractor payment | `{ contractor: Contractor, paymentGroupId: string }` |\n * | `contractor/payments/cancel` | Fired when a payment is cancelled | `{ paymentId: string }` |\n * | `breadcrumb/navigate` | Fired when the user clicks a breadcrumb to navigate back | `{ key: string, onNavigate: (ctx) => ctx }` |\n *\n * @components\n * - {@link PaymentHistory}\n * - {@link PaymentStatement}\n *\n * @param props - See {@link ViewPaymentFlowProps}.\n * @returns The composed view-payment flow.\n * @alpha\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { ContractorManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <ContractorManagement.ViewPaymentFlow\n * paymentId=\"0987fcea-7b59-4907-a301-f232b5aff508\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ViewPaymentFlow(props: ViewPaymentFlowProps) {\n return <ViewPaymentInternalFlow {...props} />\n}\n\n/**\n * Flow-internal entry point for {@link ViewPaymentFlow} that additionally accepts\n * flow-injected `prefixBreadcrumbs`. Partners use {@link ViewPaymentFlow}; `PaymentFlow` renders\n * this directly to prepend its own breadcrumb trail.\n *\n * @internal\n */\nexport function ViewPaymentInternalFlow(props: ViewPaymentInternalFlowProps) {\n // Remount and reset all state if paymentId ever changes\n return <ViewPaymentFlowMachine key={props.paymentId} {...props} />\n}\n\nfunction ViewPaymentFlowMachine({\n paymentId,\n onEvent,\n prefixBreadcrumbs = EMPTY_BREADCRUMBS,\n}: ViewPaymentInternalFlowProps) {\n // Built once via a lazy useState initializer. If the paymentId ever changes,\n // remount the entire component to reset all state, not just the state machine.\n const [viewPaymentFlow] = useState(() => {\n const baseBreadcrumbs = buildBreadcrumbs(viewPaymentBreadcrumbsNodes)\n const breadcrumbs = Object.fromEntries(\n Object.entries(baseBreadcrumbs).map(([stateKey, trail]) => [\n stateKey,\n [...prefixBreadcrumbs, ...trail],\n ]),\n )\n\n const initialBreadcrumbContext = updateBreadcrumbs('history', {\n header: {\n type: 'breadcrumbs' as const,\n breadcrumbs,\n },\n })\n\n return createMachine(\n 'history',\n viewPaymentMachine,\n (initialContext: ViewPaymentFlowContextInterface) => ({\n ...initialContext,\n ...initialBreadcrumbContext,\n component: PaymentHistoryContextual,\n currentPaymentId: paymentId,\n }),\n )\n })\n\n return <Flow machine={viewPaymentFlow} onEvent={onEvent} />\n}\n"],"names":["EMPTY_BREADCRUMBS","ViewPaymentFlow","props","jsx","ViewPaymentInternalFlow","ViewPaymentFlowMachine","paymentId","onEvent","prefixBreadcrumbs","viewPaymentFlow","useState","baseBreadcrumbs","buildBreadcrumbs","viewPaymentBreadcrumbsNodes","breadcrumbs","stateKey","trail","initialBreadcrumbContext","updateBreadcrumbs","createMachine","viewPaymentMachine","initialContext","PaymentHistoryContextual","Flow"],"mappings":";;;;;;;AAYA,MAAMA,IAAsC,CAAA;AAuDrC,SAASC,EAAgBC,GAA6B;AAC3D,SAAO,gBAAAC,EAACC,GAAA,EAAyB,GAAGF,EAAA,CAAO;AAC7C;AASO,SAASE,EAAwBF,GAAqC;AAE3E,SAAO,gBAAAC,EAACE,GAAA,EAA8C,GAAGH,EAAA,GAArBA,EAAM,SAAsB;AAClE;AAEA,SAASG,EAAuB;AAAA,EAC9B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,mBAAAC,IAAoBR;AACtB,GAAiC;AAG/B,QAAM,CAACS,CAAe,IAAIC,EAAS,MAAM;AACvC,UAAMC,IAAkBC,EAAiBC,CAA2B,GAC9DC,IAAc,OAAO;AAAA,MACzB,OAAO,QAAQH,CAAe,EAAE,IAAI,CAAC,CAACI,GAAUC,CAAK,MAAM;AAAA,QACzDD;AAAA,QACA,CAAC,GAAGP,GAAmB,GAAGQ,CAAK;AAAA,MAAA,CAChC;AAAA,IAAA,GAGGC,IAA2BC,EAAkB,WAAW;AAAA,MAC5D,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAAJ;AAAA,MAAA;AAAA,IACF,CACD;AAED,WAAOK;AAAA,MACL;AAAA,MACAC;AAAA,MACA,CAACC,OAAqD;AAAA,QACpD,GAAGA;AAAA,QACH,GAAGJ;AAAA,QACH,WAAWK;AAAA,QACX,kBAAkBhB;AAAA,MAAA;AAAA,IACpB;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAH,EAACoB,GAAA,EAAK,SAASd,GAAiB,SAAAF,EAAA,CAAkB;AAC3D;"}
@@ -1,5 +1,6 @@
1
1
  import { Contractor } from '@gusto/embedded-api/models/components/contractor';
2
2
  import { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount';
3
+ import { ContractorPaymentAmountFields } from '../paymentAmounts';
3
4
  /**
4
5
  * The subset of a contractor payment record `PaymentSummaryBlock` renders. Both
5
6
  * `ContractorPaymentForGroup` (post-creation) and `ContractorPaymentForGroupPreview` (pre-creation)
@@ -8,16 +9,9 @@ import { CompanyBankAccount } from '@gusto/embedded-api/models/components/compan
8
9
  *
9
10
  * @internal
10
11
  */
11
- export interface PaymentSummaryBlockContractorPayment {
12
+ export interface PaymentSummaryBlockContractorPayment extends ContractorPaymentAmountFields {
12
13
  contractorUuid?: string;
13
- wageType?: string;
14
- hourlyRate?: string;
15
14
  paymentMethod?: string;
16
- hours?: string;
17
- wage?: string;
18
- bonus?: string;
19
- reimbursement?: string;
20
- wageTotal?: string;
21
15
  }
22
16
  /**
23
17
  * The subset of a contractor payment group `PaymentSummaryBlock` renders. Both