@gusto/embedded-react-sdk 0.56.5 → 0.56.7-rc.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 (131) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -6
  3. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -6
  5. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -8
  7. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  8. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -6
  9. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  10. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  11. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  12. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -11
  13. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  14. package/dist/components/Company/Industry/Context.js +6 -9
  15. package/dist/components/Company/Industry/Context.js.map +1 -1
  16. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -6
  17. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  18. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -6
  19. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  20. package/dist/components/Company/OnboardingOverview/context.js +3 -6
  21. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  22. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js +39 -0
  23. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js.map +1 -0
  24. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js +54 -0
  25. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js.map +1 -0
  26. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js +56 -0
  27. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js.map +1 -0
  28. package/dist/components/Company/PaySchedule/management/PaySchedule.js +54 -39
  29. package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -1
  30. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js +70 -0
  31. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js.map +1 -0
  32. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +30 -32
  33. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -1
  34. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +35 -27
  35. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -1
  36. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +52 -31
  37. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -1
  38. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +106 -66
  39. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
  40. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +36 -30
  41. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -1
  42. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js +7 -0
  43. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js.map +1 -0
  44. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js +81 -0
  45. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -0
  46. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +48 -32
  47. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
  48. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +47 -19
  49. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
  50. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +74 -32
  51. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -1
  52. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -6
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -6
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  56. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -6
  57. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  58. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +17 -14
  59. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  60. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  61. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  62. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +27 -16
  63. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
  64. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +25 -17
  65. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
  66. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +13 -13
  67. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
  68. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +6 -5
  69. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  70. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  71. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  72. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +49 -48
  73. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  74. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +55 -57
  75. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  76. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +25 -18
  77. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  78. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +49 -47
  79. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -1
  80. package/dist/components/Payroll/usePreparedPayrollData.js +7 -10
  81. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  82. package/dist/contexts/ApiProvider/ApiProvider.js +13 -12
  83. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  84. package/dist/contexts/ApiProvider/createSdkQueryClient.js +4 -3
  85. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
  86. package/dist/contexts/ApiProvider/payrollDeductionAmountHook.js +36 -0
  87. package/dist/contexts/ApiProvider/payrollDeductionAmountHook.js.map +1 -0
  88. package/dist/helpers/validations.js +1 -1
  89. package/dist/helpers/validations.js.map +1 -1
  90. package/dist/i18n/I18n.js +1 -0
  91. package/dist/i18n/I18n.js.map +1 -1
  92. package/dist/i18n/en/Company.AssignSignatory.json.js +1 -1
  93. package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js +22 -0
  94. package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js.map +1 -0
  95. package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -14
  96. package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
  97. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +12 -10
  98. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -1
  99. package/dist/package.json.js +1 -1
  100. package/dist/shared/constants.js +18 -15
  101. package/dist/shared/constants.js.map +1 -1
  102. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.d.ts +11 -0
  103. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.d.ts +17 -0
  104. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/index.d.ts +1 -0
  105. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.d.ts +22 -0
  106. package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +17 -1
  107. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.d.ts +15 -0
  108. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +3 -3
  109. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +7 -3
  110. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +20 -4
  111. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.d.ts +3 -0
  112. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +10 -1
  113. package/dist/src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.d.ts +25 -0
  114. package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +2 -0
  115. package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -1
  116. package/dist/src/components/Company/exports/companyManagement.d.ts +1 -1
  117. package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
  118. package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +6 -0
  119. package/dist/src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.test.d.ts +1 -0
  120. package/dist/src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.test.d.ts +1 -0
  121. package/dist/src/components/Payroll/PayrollList/__fixtures__/payrollListMocks.d.ts +67 -0
  122. package/dist/src/contexts/ApiProvider/createSdkQueryClient.d.ts +2 -0
  123. package/dist/src/contexts/ApiProvider/createSdkQueryClient.test.d.ts +1 -0
  124. package/dist/src/contexts/ApiProvider/payrollDeductionAmountHook.d.ts +12 -0
  125. package/dist/src/contexts/ApiProvider/payrollDeductionAmountHook.test.d.ts +1 -0
  126. package/dist/src/helpers/validations.test.d.ts +1 -0
  127. package/dist/src/i18n/types.d.ts +119 -2
  128. package/dist/src/models/external.d.ts +7 -6
  129. package/dist/src/shared/constants.d.ts +6 -0
  130. package/docs/guides/endpoint-inventory.json +27 -1
  131. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"paymentStateMachine.js","sources":["../../../../../src/components/Contractor/Payments/PaymentFlow/paymentStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport {\n CreatePaymentFlowContextual,\n HistoricalPaymentFlowContextual,\n InformationRequestsContextual,\n PaymentListContextual,\n type PaymentFlowContextInterface,\n ViewPaymentFlowContextual,\n} from './PaymentFlowComponents'\nimport { componentEvents, informationRequestEvents, payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { patchBreadcrumbsHeader } from '@/helpers/breadcrumbHelpers'\nimport type { BreadcrumbNodes } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype EventPayloads = {\n [componentEvents.CONTRACTOR_PAYMENT_CREATE]: undefined\n [componentEvents.CONTRACTOR_PAYMENT_EXIT]: { uuid?: string | null }\n [componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE]: undefined\n [componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_EXIT]: undefined\n [componentEvents.CONTRACTOR_PAYMENT_VIEW]: { paymentId: string }\n [componentEvents.CONTRACTOR_PAYMENT_CANCEL]: { paymentId: string }\n [componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND]: undefined\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PaymentFlowContextInterface) => PaymentFlowContextInterface\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n wireInRequest: WireInRequest\n confirmationAlert: {\n title: string\n content?: string\n }\n }\n}\n\n/**\n * Hub-level breadcrumb nodes for {@link PaymentFlow}.\n *\n * @remarks\n * Only `landing` is defined here — the `createPayment`, `historicalPayment`, and `history` spokes\n * own and render their own breadcrumb trails (via `CreatePaymentFlow`/`HistoricalPaymentFlow`/\n * `ViewPaymentFlow`), prefixed with this `landing` item so the trail reads continuously across the\n * hub/spoke boundary.\n *\n * @internal\n */\nexport const paymentFlowBreadcrumbsNodes: BreadcrumbNodes = {\n landing: {\n parent: null,\n item: {\n id: 'landing',\n label: 'breadcrumbLabel',\n namespace: 'Contractor.Payments.PaymentsList',\n onNavigate: ((ctx: PaymentFlowContextInterface) => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n })) as (context: unknown) => unknown,\n },\n },\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PaymentFlowContextInterface>()\n\n/**\n * Hub machine for {@link PaymentFlow}.\n *\n * @remarks\n * `createPayment`, `historicalPayment`, and `history` each stay active for the full lifetime of\n * their respective spoke (`CreatePaymentFlow`, `HistoricalPaymentFlow`, `ViewPaymentFlow`) rather\n * than tracking the spoke's internal screen. The spoke's own machine drives its internal steps and\n * breadcrumb trail; events it can't handle locally (e.g. the `landing` breadcrumb, or a terminal\n * exit/cancel event) bubble up here to transition the hub back to `landing`.\n *\n * @internal\n */\nexport const paymentMachine = {\n landing: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_CREATE,\n 'createPayment',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: CreatePaymentFlowContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE,\n 'historicalPayment',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: HistoricalPaymentFlowContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n componentEvents.CONTRACTOR_PAYMENT_VIEW,\n 'history',\n reduce(\n (\n ctx: PaymentFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.CONTRACTOR_PAYMENT_VIEW>,\n ): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: ViewPaymentFlowContextual,\n currentPaymentId: ev.payload.paymentId,\n alerts: undefined,\n }\n },\n ),\n ),\n transition(\n componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND,\n 'informationRequests',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: InformationRequestsContextual,\n }\n }),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'landing',\n reduce(\n (\n ctx: PaymentFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): PaymentFlowContextInterface => {\n return {\n ...ctx,\n alerts: [\n {\n type: 'success',\n title: 'wireDetailsSubmitted',\n content: ev.payload.confirmationAlert.content,\n },\n ],\n }\n },\n ),\n ),\n ),\n createPayment: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_EXIT,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n historicalPayment: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_EXIT,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n history: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_CANCEL,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: [\n {\n type: 'success',\n title: 'paymentCancelledSuccessfully',\n },\n ],\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n informationRequests: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n }\n }),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n }\n }),\n ),\n ),\n}\n"],"names":["paymentFlowBreadcrumbsNodes","ctx","patchBreadcrumbsHeader","PaymentListContextual","breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","paymentMachine","state","transition","componentEvents","reduce","CreatePaymentFlowContextual","HistoricalPaymentFlowContextual","ev","ViewPaymentFlowContextual","InformationRequestsContextual","payrollWireEvents","informationRequestEvents"],"mappings":";;;;;AAkDO,MAAMA,IAA+C;AAAA,EAC1D,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,CAACC,OAAsC;AAAA,QAClD,GAAGC,EAAuBD,GAAK,EAAE,qBAAqB,QAAW;AAAA,QACjE,WAAWE;AAAA,MAAA;AAAA,IACb;AAAA,EACF;AAEJ,GAEMC,IACJC,EAAA,GAcWC,IAAiB;AAAA,EAC5B,SAASC;AAAA,IACPC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACT,OACC;AAAA,QACL,GAAGA;AAAA,QACH,WAAWU;AAAA,QACX,QAAQ;AAAA,MAAA,EAEX;AAAA,IAAA;AAAA,IAEHH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACT,OACC;AAAA,QACL,GAAGA;AAAA,QACH,WAAWW;AAAA,QACX,QAAQ;AAAA,MAAA,EAEX;AAAA,IAAA;AAAA,IAEHJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACET,GACAY,OAEO;AAAA,UACL,GAAGZ;AAAA,UACH,WAAWa;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,UAC7B,QAAQ;AAAA,QAAA;AAAA,MAEZ;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACT,OACC;AAAA,QACL,GAAGC,EAAuBD,GAA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AAAA,MACAP,EAAO,CAACT,OACC;AAAA,QACL,GAAGC,EAAuBD,GAAK,EAAE,qBAAqB,QAAW;AAAA,QACjE,WAAWE;AAAA,MAAA,EAEd;AAAA,IAAA;AAAA,IAEHK;AAAA,MACES,EAAyB;AAAA,MACzB;AAAA,MACAP,EAAO,CAACT,OACC;AAAA,QACL,GAAGC,EAAuBD,GAAK,EAAE,qBAAqB,QAAW;AAAA,QACjE,WAAWE;AAAA,MAAA,EAEd;AAAA,IAAA;AAAA,EACH;AAEJ;"}
1
+ {"version":3,"file":"paymentStateMachine.js","sources":["../../../../../src/components/Contractor/Payments/PaymentFlow/paymentStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport {\n CreatePaymentFlowContextual,\n HistoricalPaymentFlowContextual,\n InformationRequestsContextual,\n PaymentListContextual,\n type PaymentFlowContextInterface,\n ViewPaymentFlowContextual,\n} from './PaymentFlowComponents'\nimport { componentEvents, informationRequestEvents, payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { patchBreadcrumbsHeader } from '@/helpers/breadcrumbHelpers'\nimport type { BreadcrumbNodes } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype EventPayloads = {\n [componentEvents.CONTRACTOR_PAYMENT_CREATE]: undefined\n [componentEvents.CONTRACTOR_PAYMENT_EXIT]: { uuid?: string | null }\n [componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE]: undefined\n [componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_EXIT]: undefined\n [componentEvents.CONTRACTOR_PAYMENT_VIEW]: { paymentId: string }\n [componentEvents.CONTRACTOR_PAYMENT_CANCEL]: { paymentId: string }\n [componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND]: undefined\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PaymentFlowContextInterface) => PaymentFlowContextInterface\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n wireInRequest: WireInRequest\n confirmationAlert: {\n title: string\n content?: string\n }\n }\n}\n\n/**\n * Hub-level breadcrumb nodes for {@link PaymentFlow}.\n *\n * @remarks\n * Only `landing` is defined here — the `createPayment`, `historicalPayment`, and `history` spokes\n * own and render their own breadcrumb trails (via `CreatePaymentFlow`/`HistoricalPaymentFlow`/\n * `ViewPaymentFlow`), prefixed with this `landing` item so the trail reads continuously across the\n * hub/spoke boundary.\n *\n * @internal\n */\nexport const paymentFlowBreadcrumbsNodes: BreadcrumbNodes = {\n landing: {\n parent: null,\n item: {\n id: 'landing',\n label: 'breadcrumbLabel',\n namespace: 'Contractor.Payments.PaymentsList',\n onNavigate: ((ctx: PaymentFlowContextInterface) => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n })) as (context: unknown) => unknown,\n },\n },\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PaymentFlowContextInterface>()\n\n/**\n * Hub machine for {@link PaymentFlow}.\n *\n * @remarks\n * `createPayment`, `historicalPayment`, and `history` each stay active for the full lifetime of\n * their respective spoke (`CreatePaymentFlow`, `HistoricalPaymentFlow`, `ViewPaymentFlow`) rather\n * than tracking the spoke's internal screen. The spoke's own machine drives its internal steps and\n * breadcrumb trail; events it can't handle locally (e.g. the `landing` breadcrumb, or a terminal\n * exit/cancel event) bubble up here to transition the hub back to `landing`.\n *\n * @internal\n */\nexport const paymentMachine = {\n landing: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_CREATE,\n 'createPayment',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: CreatePaymentFlowContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_CREATE,\n 'historicalPayment',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: HistoricalPaymentFlowContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n componentEvents.CONTRACTOR_PAYMENT_VIEW,\n 'history',\n reduce(\n (\n ctx: PaymentFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.CONTRACTOR_PAYMENT_VIEW>,\n ): PaymentFlowContextInterface => {\n return {\n ...ctx,\n component: ViewPaymentFlowContextual,\n currentPaymentId: ev.payload.paymentId,\n alerts: undefined,\n }\n },\n ),\n ),\n transition(\n componentEvents.CONTRACTOR_PAYMENT_RFI_RESPOND,\n 'informationRequests',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: InformationRequestsContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'landing',\n reduce(\n (\n ctx: PaymentFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): PaymentFlowContextInterface => {\n return {\n ...ctx,\n alerts: [\n {\n type: 'success',\n title: 'wireDetailsSubmitted',\n content: ev.payload.confirmationAlert.content,\n },\n ],\n }\n },\n ),\n ),\n ),\n createPayment: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_EXIT,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n historicalPayment: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_HISTORICAL_PAYMENT_EXIT,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n history: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_CANCEL,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: [\n {\n type: 'success',\n title: 'paymentCancelledSuccessfully',\n },\n ],\n }\n }),\n ),\n breadcrumbNavigateTransition('landing'),\n ),\n informationRequests: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'landing',\n reduce((ctx: PaymentFlowContextInterface): PaymentFlowContextInterface => {\n return {\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: undefined }),\n component: PaymentListContextual,\n alerts: undefined,\n }\n }),\n ),\n ),\n}\n"],"names":["paymentFlowBreadcrumbsNodes","ctx","patchBreadcrumbsHeader","PaymentListContextual","breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","paymentMachine","state","transition","componentEvents","reduce","CreatePaymentFlowContextual","HistoricalPaymentFlowContextual","ev","ViewPaymentFlowContextual","InformationRequestsContextual","payrollWireEvents","informationRequestEvents"],"mappings":";;;;;AAkDO,MAAMA,IAA+C;AAAA,EAC1D,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA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AA;AAAA,EACH;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;"}
@@ -1,25 +1,36 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { createMachine as i } from "robot3";
3
- import { useMemo as p } from "react";
4
- import { employeeListStateMachine as n } from "./employeeListStateMachine.js";
5
- import { EmployeeListContextual as s } from "./EmployeeListFlowComponents.js";
6
- import { Flow as l } from "../../Flow/Flow.js";
7
- const L = ({ companyId: o, onEvent: t }) => {
8
- const e = p(
9
- () => i(
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { createMachine as n } from "robot3";
3
+ import { useMemo as s } from "react";
4
+ import { employeeListStateMachine as l } from "./employeeListStateMachine.js";
5
+ import { EmployeeListContextual as c } from "./EmployeeListFlowComponents.js";
6
+ import { Flow as f } from "../../Flow/Flow.js";
7
+ const w = ({
8
+ companyId: o,
9
+ onEvent: t,
10
+ isSelfOnboardingEnabled: e,
11
+ withEmployeeI9: m
12
+ }) => {
13
+ const r = s(
14
+ () => n(
10
15
  "list",
11
- n,
12
- (m) => ({
13
- ...m,
14
- component: s,
15
- companyId: o
16
+ l,
17
+ (i) => ({
18
+ ...i,
19
+ component: c,
20
+ companyId: o,
21
+ isSelfOnboardingEnabled: e,
22
+ withEmployeeI9: m
16
23
  })
17
24
  ),
25
+ // `isSelfOnboardingEnabled`/`withEmployeeI9` are intentionally omitted: they only
26
+ // seed the initial context once, and reacting to a later change would discard the
27
+ // machine's current navigation state (see Compensation.tsx for the same pattern).
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
18
29
  [o]
19
30
  );
20
- return /* @__PURE__ */ r(l, { machine: e, onEvent: t });
31
+ return /* @__PURE__ */ p(f, { machine: r, onEvent: t });
21
32
  };
22
33
  export {
23
- L as EmployeeListFlow
34
+ w as EmployeeListFlow
24
35
  };
25
36
  //# sourceMappingURL=EmployeeListFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmployeeListFlow.js","sources":["../../../../src/components/Employee/EmployeeListFlow/EmployeeListFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { employeeListStateMachine } from './employeeListStateMachine'\nimport {\n EmployeeListContextual,\n type EmployeeListFlowContextInterface,\n type EmployeeListFlowProps,\n} from './EmployeeListFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\n/**\n * Hub for viewing and managing all employees, including onboarding new ones.\n *\n * @remarks\n * Drop-in entry point for managing all employees in a company. Begins on the\n * management employee list and routes into {@link DashboardFlow},\n * {@link TerminationFlow}, or {@link EmployeeOnboarding.OnboardingExecutionFlow | OnboardingExecutionFlow} based on the\n * action the admin invokes on a row (or the \"Add employee\" CTA). A \"Back to\n * employees\" header is added to each sub-flow so the admin can return to the\n * list at any time.\n *\n * The flow forwards every event emitted by its blocks to `onEvent`;\n * see the events table on each block for the full set of events and\n * payloads observable from this flow.\n *\n * @components\n * - {@link EmployeeList}\n * - {@link DashboardFlow}\n * - {@link TerminationFlow}\n * - {@link EmployeeOnboarding.OnboardingExecutionFlow | OnboardingExecutionFlow}\n *\n * @param props - See {@link EmployeeListFlowProps}.\n * @returns The employee list workflow with internal navigation to the dashboard, termination, and onboarding flows.\n * @public\n * @group Flow components\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { EmployeeManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <EmployeeManagement.EmployeeListFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport const EmployeeListFlow = ({ companyId, onEvent }: EmployeeListFlowProps) => {\n const machine = useMemo(\n () =>\n createMachine(\n 'list',\n employeeListStateMachine,\n (initialContext: EmployeeListFlowContextInterface) => ({\n ...initialContext,\n component: EmployeeListContextual,\n companyId,\n }),\n ),\n [companyId],\n )\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["EmployeeListFlow","companyId","onEvent","machine","useMemo","createMachine","employeeListStateMachine","initialContext","EmployeeListContextual","jsx","Flow"],"mappings":";;;;;;AAkDO,MAAMA,IAAmB,CAAC,EAAE,WAAAC,GAAW,SAAAC,QAAqC;AACjF,QAAMC,IAAUC;AAAA,IACd,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAP;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAS;AAAA,EAAA;AAEZ,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAD,EAAA,CAAkB;AACnD;"}
1
+ {"version":3,"file":"EmployeeListFlow.js","sources":["../../../../src/components/Employee/EmployeeListFlow/EmployeeListFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { employeeListStateMachine } from './employeeListStateMachine'\nimport {\n EmployeeListContextual,\n type EmployeeListFlowContextInterface,\n type EmployeeListFlowProps,\n} from './EmployeeListFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\n/**\n * Hub for viewing and managing all employees, including onboarding new ones.\n *\n * @remarks\n * Drop-in entry point for managing all employees in a company. Begins on the\n * management employee list and routes into {@link DashboardFlow},\n * {@link TerminationFlow}, or {@link EmployeeOnboarding.OnboardingExecutionFlow | OnboardingExecutionFlow} based on the\n * action the admin invokes on a row (or the \"Add employee\" CTA). A \"Back to\n * employees\" header is added to each sub-flow so the admin can return to the\n * list at any time.\n *\n * The flow forwards every event emitted by its blocks to `onEvent`;\n * see the events table on each block for the full set of events and\n * payloads observable from this flow.\n *\n * @components\n * - {@link EmployeeList}\n * - {@link DashboardFlow}\n * - {@link TerminationFlow}\n * - {@link EmployeeOnboarding.OnboardingExecutionFlow | OnboardingExecutionFlow}\n *\n * @param props - See {@link EmployeeListFlowProps}.\n * @returns The employee list workflow with internal navigation to the dashboard, termination, and onboarding flows.\n * @public\n * @group Flow components\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { EmployeeManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <EmployeeManagement.EmployeeListFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport const EmployeeListFlow = ({\n companyId,\n onEvent,\n isSelfOnboardingEnabled,\n withEmployeeI9,\n}: EmployeeListFlowProps) => {\n const machine = useMemo(\n () =>\n createMachine(\n 'list',\n employeeListStateMachine,\n (initialContext: EmployeeListFlowContextInterface) => ({\n ...initialContext,\n component: EmployeeListContextual,\n companyId,\n isSelfOnboardingEnabled,\n withEmployeeI9,\n }),\n ),\n // `isSelfOnboardingEnabled`/`withEmployeeI9` are intentionally omitted: they only\n // seed the initial context once, and reacting to a later change would discard the\n // machine's current navigation state (see Compensation.tsx for the same pattern).\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [companyId],\n )\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["EmployeeListFlow","companyId","onEvent","isSelfOnboardingEnabled","withEmployeeI9","machine","useMemo","createMachine","employeeListStateMachine","initialContext","EmployeeListContextual","jsx","Flow"],"mappings":";;;;;;AAkDO,MAAMA,IAAmB,CAAC;AAAA,EAC/B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,gBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAUC;AAAA,IACd,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAT;AAAA,QACA,yBAAAE;AAAA,QACA,gBAAAC;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAMJ,CAACH,CAAS;AAAA,EAAA;AAEZ,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAH,EAAA,CAAkB;AACnD;"}
@@ -1,22 +1,22 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { ManagementEmployeeList as i } from "../EmployeeList/management/ManagementEmployeeList.js";
3
- import { TerminationFlow as a } from "../Terminations/TerminationFlow/TerminationFlow.js";
4
- import { OnboardingExecutionFlow as p } from "../OnboardingExecutionFlow/OnboardingExecutionFlow.js";
2
+ import { ManagementEmployeeList as a } from "../EmployeeList/management/ManagementEmployeeList.js";
3
+ import { TerminationFlow as p } from "../Terminations/TerminationFlow/TerminationFlow.js";
4
+ import { OnboardingExecutionFlow as l } from "../OnboardingExecutionFlow/OnboardingExecutionFlow.js";
5
5
  import { useFlow as r } from "../../Flow/useFlow.js";
6
6
  import { ensureRequired as e } from "../../../helpers/ensureRequired.js";
7
- import { DashboardFlow as l } from "../Dashboard/DashboardFlow.js";
8
- function x() {
7
+ import { DashboardFlow as d } from "../Dashboard/DashboardFlow.js";
8
+ function w() {
9
9
  const { companyId: o, onEvent: n } = r();
10
- return /* @__PURE__ */ t(i, { companyId: e(o), onEvent: n });
10
+ return /* @__PURE__ */ t(a, { companyId: e(o), onEvent: n });
11
11
  }
12
- function E() {
12
+ function x() {
13
13
  const { employeeId: o, onEvent: n } = r();
14
- return /* @__PURE__ */ t(l, { employeeId: e(o), onEvent: n });
14
+ return /* @__PURE__ */ t(d, { employeeId: e(o), onEvent: n });
15
15
  }
16
- function w() {
16
+ function F() {
17
17
  const { companyId: o, employeeId: n, onEvent: m } = r();
18
18
  return /* @__PURE__ */ t(
19
- a,
19
+ p,
20
20
  {
21
21
  companyId: e(o),
22
22
  employeeId: e(n),
@@ -24,14 +24,22 @@ function w() {
24
24
  }
25
25
  );
26
26
  }
27
- function F() {
28
- const { companyId: o, onEvent: n } = r();
29
- return /* @__PURE__ */ t(p, { companyId: e(o), onEvent: n });
27
+ function b() {
28
+ const { companyId: o, onEvent: n, isSelfOnboardingEnabled: m, withEmployeeI9: i } = r();
29
+ return /* @__PURE__ */ t(
30
+ l,
31
+ {
32
+ companyId: e(o),
33
+ onEvent: n,
34
+ isSelfOnboardingEnabled: m,
35
+ withEmployeeI9: i
36
+ }
37
+ );
30
38
  }
31
39
  export {
32
- E as DashboardFlowContextual,
33
- x as EmployeeListContextual,
34
- F as OnboardingExecutionFlowContextual,
35
- w as TerminationFlowContextual
40
+ x as DashboardFlowContextual,
41
+ w as EmployeeListContextual,
42
+ b as OnboardingExecutionFlowContextual,
43
+ F as TerminationFlowContextual
36
44
  };
37
45
  //# sourceMappingURL=EmployeeListFlowComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmployeeListFlowComponents.js","sources":["../../../../src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.tsx"],"sourcesContent":["import { ManagementEmployeeList } from '../EmployeeList/management/ManagementEmployeeList'\nimport { DashboardFlow } from '../Dashboard'\nimport { TerminationFlow } from '../Terminations/TerminationFlow/TerminationFlow'\nimport { OnboardingExecutionFlow } from '../OnboardingExecutionFlow/OnboardingExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Props for {@link EmployeeListFlow}.\n *\n * @public\n */\nexport interface EmployeeListFlowProps extends BaseComponentInterface<never> {\n /** The associated company identifier. */\n companyId: string\n}\n\n/** @internal */\nexport interface EmployeeListFlowContextInterface extends FlowContextInterface {\n companyId: string\n employeeId?: string\n}\n\n/** @internal */\nexport function EmployeeListContextual() {\n const { companyId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return <ManagementEmployeeList companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function DashboardFlowContextual() {\n const { employeeId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return <DashboardFlow employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function TerminationFlowContextual() {\n const { companyId, employeeId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return (\n <TerminationFlow\n companyId={ensureRequired(companyId)}\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function OnboardingExecutionFlowContextual() {\n const { companyId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return <OnboardingExecutionFlow companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n"],"names":["EmployeeListContextual","companyId","onEvent","useFlow","ManagementEmployeeList","ensureRequired","DashboardFlowContextual","employeeId","DashboardFlow","TerminationFlowContextual","jsx","TerminationFlow","OnboardingExecutionFlowContextual","OnboardingExecutionFlow"],"mappings":";;;;;;;AAyBO,SAASA,IAAyB;AACvC,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAuB,WAAWC,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACzF;AAGO,SAASI,IAA0B;AACxC,QAAM,EAAE,YAAAC,GAAY,SAAAL,EAAA,IAAYC,EAAA;AAChC,2BAAQK,GAAA,EAAc,YAAYH,EAAeE,CAAU,GAAG,SAAAL,GAAkB;AAClF;AAGO,SAASO,IAA4B;AAC1C,QAAM,EAAE,WAAAR,GAAW,YAAAM,GAAY,SAAAL,EAAA,IAAYC,EAAA;AAC3C,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWN,EAAeJ,CAAS;AAAA,MACnC,YAAYI,EAAeE,CAAU;AAAA,MACrC,SAAAL;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASU,IAAoC;AAClD,QAAM,EAAE,WAAAX,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQU,GAAA,EAAwB,WAAWR,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AAC1F;"}
1
+ {"version":3,"file":"EmployeeListFlowComponents.js","sources":["../../../../src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.tsx"],"sourcesContent":["import { ManagementEmployeeList } from '../EmployeeList/management/ManagementEmployeeList'\nimport { DashboardFlow } from '../Dashboard'\nimport { TerminationFlow } from '../Terminations/TerminationFlow/TerminationFlow'\nimport { OnboardingExecutionFlow } from '../OnboardingExecutionFlow/OnboardingExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Props for {@link EmployeeListFlow}.\n *\n * @public\n */\nexport interface EmployeeListFlowProps extends BaseComponentInterface<never> {\n /** The associated company identifier. */\n companyId: string\n /** When true, presents the self-onboarding toggle in the onboarding flow. Defaults to `true`. */\n isSelfOnboardingEnabled?: boolean\n /** When true, enables the Employee Documents step in the onboarding flow, allowing the admin to configure I-9 document requirements. Defaults to `false`. */\n withEmployeeI9?: boolean\n}\n\n/** @internal */\nexport interface EmployeeListFlowContextInterface extends FlowContextInterface {\n companyId: string\n employeeId?: string\n isSelfOnboardingEnabled?: boolean\n withEmployeeI9?: boolean\n}\n\n/** @internal */\nexport function EmployeeListContextual() {\n const { companyId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return <ManagementEmployeeList companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function DashboardFlowContextual() {\n const { employeeId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return <DashboardFlow employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function TerminationFlowContextual() {\n const { companyId, employeeId, onEvent } = useFlow<EmployeeListFlowContextInterface>()\n return (\n <TerminationFlow\n companyId={ensureRequired(companyId)}\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function OnboardingExecutionFlowContextual() {\n const { companyId, onEvent, isSelfOnboardingEnabled, withEmployeeI9 } =\n useFlow<EmployeeListFlowContextInterface>()\n return (\n <OnboardingExecutionFlow\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n withEmployeeI9={withEmployeeI9}\n />\n )\n}\n"],"names":["EmployeeListContextual","companyId","onEvent","useFlow","ManagementEmployeeList","ensureRequired","DashboardFlowContextual","employeeId","DashboardFlow","TerminationFlowContextual","jsx","TerminationFlow","OnboardingExecutionFlowContextual","isSelfOnboardingEnabled","withEmployeeI9","OnboardingExecutionFlow"],"mappings":";;;;;;;AA+BO,SAASA,IAAyB;AACvC,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAuB,WAAWC,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACzF;AAGO,SAASI,IAA0B;AACxC,QAAM,EAAE,YAAAC,GAAY,SAAAL,EAAA,IAAYC,EAAA;AAChC,2BAAQK,GAAA,EAAc,YAAYH,EAAeE,CAAU,GAAG,SAAAL,GAAkB;AAClF;AAGO,SAASO,IAA4B;AAC1C,QAAM,EAAE,WAAAR,GAAW,YAAAM,GAAY,SAAAL,EAAA,IAAYC,EAAA;AAC3C,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWN,EAAeJ,CAAS;AAAA,MACnC,YAAYI,EAAeE,CAAU;AAAA,MACrC,SAAAL;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASU,IAAoC;AAClD,QAAM,EAAE,WAAAX,GAAW,SAAAC,GAAS,yBAAAW,GAAyB,gBAAAC,EAAA,IACnDX,EAAA;AACF,SACE,gBAAAO;AAAA,IAACK;AAAA,IAAA;AAAA,MACC,WAAWV,EAAeJ,CAAS;AAAA,MACnC,SAAAC;AAAA,MACA,yBAAAW;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,36 +1,36 @@
1
1
  import { z as r } from "zod";
2
2
  import { buildFormSchema as I } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
3
- import { SSN_REGEX as n, NAME_REGEX as i } from "../../../../../helpers/validations.js";
3
+ import { SSN_REGEX as m, NAME_REGEX as s } from "../../../../../helpers/validations.js";
4
4
  const e = {
5
5
  REQUIRED: "REQUIRED",
6
6
  INVALID_NAME: "INVALID_NAME",
7
7
  INVALID_EMAIL: "INVALID_EMAIL",
8
8
  INVALID_SSN: "INVALID_SSN"
9
- }, E = {
10
- firstName: r.string().min(1, { message: e.REQUIRED }).regex(i, { message: e.INVALID_NAME }),
9
+ }, n = {
10
+ firstName: r.string().trim().min(1, { message: e.REQUIRED }).regex(s, { message: e.INVALID_NAME }),
11
11
  middleInitial: r.string(),
12
- lastName: r.string().min(1, { message: e.REQUIRED }).regex(i, { message: e.INVALID_NAME }),
12
+ lastName: r.string().trim().min(1, { message: e.REQUIRED }).regex(s, { message: e.INVALID_NAME }),
13
13
  email: r.email({ error: () => e.INVALID_EMAIL }),
14
14
  dateOfBirth: r.iso.date({ error: () => e.REQUIRED }),
15
- ssn: r.string({ error: () => e.REQUIRED }).refine((s) => n.test(s.replace(/\D/g, "")), {
15
+ ssn: r.string({ error: () => e.REQUIRED }).refine((i) => m.test(i.replace(/\D/g, "")), {
16
16
  message: e.INVALID_SSN
17
17
  }),
18
18
  selfOnboarding: r.boolean()
19
- }, m = {
19
+ }, E = {
20
20
  firstName: "create",
21
21
  lastName: "create",
22
22
  middleInitial: "never",
23
23
  dateOfBirth: "never",
24
24
  ssn: "never",
25
- email: (s) => s.selfOnboarding
25
+ email: (i) => i.selfOnboarding
26
26
  };
27
- function D(s = {}) {
28
- const { mode: a = "create", optionalFieldsToRequire: t, hasSsn: o = !1 } = s;
29
- return I(E, {
30
- requiredFieldsConfig: m,
27
+ function D(i = {}) {
28
+ const { mode: t = "create", optionalFieldsToRequire: a, hasSsn: o = !1 } = i;
29
+ return I(n, {
30
+ requiredFieldsConfig: E,
31
31
  requiredErrorCode: e.REQUIRED,
32
- mode: a,
33
- optionalFieldsToRequire: t,
32
+ mode: t,
33
+ optionalFieldsToRequire: a,
34
34
  fieldsWithRedactedValues: o ? ["ssn"] : []
35
35
  });
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"employeeDetailsSchema.js","sources":["../../../../../../src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { SSN_REGEX, NAME_REGEX } from '@/helpers/validations'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the employee details form schema. Map\n * these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const EmployeeDetailsErrorCodes = {\n REQUIRED: 'REQUIRED',\n INVALID_NAME: 'INVALID_NAME',\n INVALID_EMAIL: 'INVALID_EMAIL',\n INVALID_SSN: 'INVALID_SSN',\n} as const\n\n/**\n * Union of validation error code strings emitted by the employee details form\n * schema.\n *\n * @public\n */\nexport type EmployeeDetailsErrorCode =\n (typeof EmployeeDetailsErrorCodes)[keyof typeof EmployeeDetailsErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n firstName: z\n .string()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n middleInitial: z.string(),\n lastName: z\n .string()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n email: z.email({ error: () => EmployeeDetailsErrorCodes.INVALID_EMAIL }),\n dateOfBirth: z.iso.date({ error: () => EmployeeDetailsErrorCodes.REQUIRED }),\n ssn: z\n .string({ error: () => EmployeeDetailsErrorCodes.REQUIRED })\n .refine((v: string) => SSN_REGEX.test(v.replace(/\\D/g, '')), {\n message: EmployeeDetailsErrorCodes.INVALID_SSN,\n }),\n selfOnboarding: z.boolean(),\n}\n\n/**\n * Field names accepted by the employee details form.\n *\n * @public\n */\nexport type EmployeeDetailsField = Exclude<keyof typeof fieldValidators, 'selfOnboarding'>\n\n/**\n * Shape of the values managed by the employee details form.\n *\n * @public\n * @interface\n */\nexport type EmployeeDetailsFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n/** @internal */\nexport type EmployeeDetailsFormOutputs = EmployeeDetailsFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\n// Requiredness mirrors the employee create/update API contract: fields the API\n// requires on create are `'create'` (optional on update), and fields the API\n// treats as optional are `'never'`.\n//\n// `email` is value-conditional: it always applies but is only required when\n// self-onboarding is on (create and update), matching the API's \"if\n// self_onboarding is true, then email is required\" — the employee needs an\n// email to receive the invitation. A single-operand predicate keeps\n// `buildFormSchema`'s dependency-detecting Proxy accurate, and the predicate\n// drives both validation and `fieldsMetadata.isRequired` so the rendered label\n// and validation always agree. Consumers that need email required regardless of\n// self-onboarding promote it via `optionalFieldsToRequire`.\nconst requiredFieldsConfig = {\n firstName: 'create',\n lastName: 'create',\n middleInitial: 'never',\n dateOfBirth: 'never',\n ssn: 'never',\n email: data => data.selfOnboarding,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\n/**\n * Keys of optional employee details fields that can be promoted to required\n * via the hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type EmployeeDetailsOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface EmployeeDetailsSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: EmployeeDetailsOptionalFieldsToRequire\n hasSsn?: boolean\n}\n\n/** @internal */\nexport function createEmployeeDetailsSchema(options: EmployeeDetailsSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hasSsn = false } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: EmployeeDetailsErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n fieldsWithRedactedValues: hasSsn ? ['ssn'] : [],\n })\n}\n"],"names":["EmployeeDetailsErrorCodes","fieldValidators","z","NAME_REGEX","v","SSN_REGEX","requiredFieldsConfig","data","createEmployeeDetailsSchema","options","mode","optionalFieldsToRequire","hasSsn","buildFormSchema"],"mappings":";;;AAiBO,MAAMA,IAA4B;AAAA,EACvC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AACf,GAaMC,IAAkB;AAAA,EACtB,WAAWC,EACR,OAAA,EACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,eAAeE,EAAE,OAAA;AAAA,EACjB,UAAUA,EACP,OAAA,EACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,OAAOE,EAAE,MAAM,EAAE,OAAO,MAAMF,EAA0B,eAAe;AAAA,EACvE,aAAaE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAA0B,UAAU;AAAA,EAC3E,KAAKE,EACF,OAAO,EAAE,OAAO,MAAMF,EAA0B,UAAU,EAC1D,OAAO,CAACI,MAAcC,EAAU,KAAKD,EAAE,QAAQ,OAAO,EAAE,CAAC,GAAG;AAAA,IAC3D,SAASJ,EAA0B;AAAA,EAAA,CACpC;AAAA,EACH,gBAAgBE,EAAE,QAAA;AACpB,GAmCMI,IAAuB;AAAA,EAC3B,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,KAAK;AAAA,EACL,OAAO,OAAQC,EAAK;AACtB;AAsBO,SAASC,EAA4BC,IAAwC,IAAI;AACtF,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,GAAyB,QAAAC,IAAS,OAAUH;AAErE,SAAOI,EAAgBZ,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAA0B;AAAA,IAC7C,MAAAU;AAAA,IACA,yBAAAC;AAAA,IACA,0BAA0BC,IAAS,CAAC,KAAK,IAAI,CAAA;AAAA,EAAC,CAC/C;AACH;"}
1
+ {"version":3,"file":"employeeDetailsSchema.js","sources":["../../../../../../src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { SSN_REGEX, NAME_REGEX } from '@/helpers/validations'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the employee details form schema. Map\n * these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const EmployeeDetailsErrorCodes = {\n REQUIRED: 'REQUIRED',\n INVALID_NAME: 'INVALID_NAME',\n INVALID_EMAIL: 'INVALID_EMAIL',\n INVALID_SSN: 'INVALID_SSN',\n} as const\n\n/**\n * Union of validation error code strings emitted by the employee details form\n * schema.\n *\n * @public\n */\nexport type EmployeeDetailsErrorCode =\n (typeof EmployeeDetailsErrorCodes)[keyof typeof EmployeeDetailsErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n firstName: z\n .string()\n .trim()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n middleInitial: z.string(),\n lastName: z\n .string()\n .trim()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n email: z.email({ error: () => EmployeeDetailsErrorCodes.INVALID_EMAIL }),\n dateOfBirth: z.iso.date({ error: () => EmployeeDetailsErrorCodes.REQUIRED }),\n ssn: z\n .string({ error: () => EmployeeDetailsErrorCodes.REQUIRED })\n .refine((v: string) => SSN_REGEX.test(v.replace(/\\D/g, '')), {\n message: EmployeeDetailsErrorCodes.INVALID_SSN,\n }),\n selfOnboarding: z.boolean(),\n}\n\n/**\n * Field names accepted by the employee details form.\n *\n * @public\n */\nexport type EmployeeDetailsField = Exclude<keyof typeof fieldValidators, 'selfOnboarding'>\n\n/**\n * Shape of the values managed by the employee details form.\n *\n * @public\n * @interface\n */\nexport type EmployeeDetailsFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n/** @internal */\nexport type EmployeeDetailsFormOutputs = EmployeeDetailsFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\n// Requiredness mirrors the employee create/update API contract: fields the API\n// requires on create are `'create'` (optional on update), and fields the API\n// treats as optional are `'never'`.\n//\n// `email` is value-conditional: it always applies but is only required when\n// self-onboarding is on (create and update), matching the API's \"if\n// self_onboarding is true, then email is required\" — the employee needs an\n// email to receive the invitation. A single-operand predicate keeps\n// `buildFormSchema`'s dependency-detecting Proxy accurate, and the predicate\n// drives both validation and `fieldsMetadata.isRequired` so the rendered label\n// and validation always agree. Consumers that need email required regardless of\n// self-onboarding promote it via `optionalFieldsToRequire`.\nconst requiredFieldsConfig = {\n firstName: 'create',\n lastName: 'create',\n middleInitial: 'never',\n dateOfBirth: 'never',\n ssn: 'never',\n email: data => data.selfOnboarding,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\n/**\n * Keys of optional employee details fields that can be promoted to required\n * via the hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type EmployeeDetailsOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface EmployeeDetailsSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: EmployeeDetailsOptionalFieldsToRequire\n hasSsn?: boolean\n}\n\n/** @internal */\nexport function createEmployeeDetailsSchema(options: EmployeeDetailsSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hasSsn = false } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: EmployeeDetailsErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n fieldsWithRedactedValues: hasSsn ? ['ssn'] : [],\n })\n}\n"],"names":["EmployeeDetailsErrorCodes","fieldValidators","z","NAME_REGEX","v","SSN_REGEX","requiredFieldsConfig","data","createEmployeeDetailsSchema","options","mode","optionalFieldsToRequire","hasSsn","buildFormSchema"],"mappings":";;;AAiBO,MAAMA,IAA4B;AAAA,EACvC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AACf,GAaMC,IAAkB;AAAA,EACtB,WAAWC,EACR,OAAA,EACA,OACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,eAAeE,EAAE,OAAA;AAAA,EACjB,UAAUA,EACP,OAAA,EACA,OACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,OAAOE,EAAE,MAAM,EAAE,OAAO,MAAMF,EAA0B,eAAe;AAAA,EACvE,aAAaE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAA0B,UAAU;AAAA,EAC3E,KAAKE,EACF,OAAO,EAAE,OAAO,MAAMF,EAA0B,UAAU,EAC1D,OAAO,CAACI,MAAcC,EAAU,KAAKD,EAAE,QAAQ,OAAO,EAAE,CAAC,GAAG;AAAA,IAC3D,SAASJ,EAA0B;AAAA,EAAA,CACpC;AAAA,EACH,gBAAgBE,EAAE,QAAA;AACpB,GAmCMI,IAAuB;AAAA,EAC3B,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,KAAK;AAAA,EACL,OAAO,OAAQC,EAAK;AACtB;AAsBO,SAASC,EAA4BC,IAAwC,IAAI;AACtF,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,GAAyB,QAAAC,IAAS,OAAUH;AAErE,SAAOI,EAAgBZ,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAA0B;AAAA,IAC7C,MAAAU;AAAA,IACA,yBAAAC;AAAA,IACA,0BAA0BC,IAAS,CAAC,KAAK,IAAI,CAAA;AAAA,EAAC,CAC/C;AACH;"}
@@ -1,14 +1,15 @@
1
1
  import { state as i, transition as e, reduce as r } from "robot3";
2
- import { ConfirmWireDetailsFormContextual as I, WireInstructionsContextual as a } from "./ConfirmWireDetailsComponents.js";
2
+ import { ConfirmWireDetailsFormContextual as a, WireInstructionsContextual as I } from "./ConfirmWireDetailsComponents.js";
3
3
  import { payrollWireEvents as o } from "../../../shared/constants.js";
4
- const m = {
4
+ const R = {
5
5
  banner: i(
6
6
  e(
7
7
  o.PAYROLL_WIRE_START_TRANSFER,
8
8
  "wireInstructions",
9
9
  r((n) => ({
10
10
  ...n,
11
- component: a
11
+ component: I,
12
+ confirmationAlert: void 0
12
13
  }))
13
14
  )
14
15
  ),
@@ -29,7 +30,7 @@ const m = {
29
30
  r(
30
31
  (n, t) => ({
31
32
  ...n,
32
- component: I,
33
+ component: a,
33
34
  selectedWireInId: t.payload.selectedWireInId
34
35
  })
35
36
  )
@@ -66,6 +67,6 @@ const m = {
66
67
  final: i()
67
68
  };
68
69
  export {
69
- m as confirmWireDetailsMachine
70
+ R as confirmWireDetailsMachine
70
71
  };
71
72
  //# sourceMappingURL=confirmWireDetailsStateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ConfirmationAlert } from './types'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/**\n * Payload shapes for each wire-confirmation state machine event.\n *\n * @internal\n */\nexport type EventPayloads = {\n /** Wire-in request selected within the instructions screen. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {\n selectedWireInId: string\n }\n /** Banner button pressed to begin the wire transfer flow. */\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n /** Instructions screen completed; advances to the confirmation form. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {\n selectedWireInId: string\n }\n /** Confirmation form submitted; carries the alert to surface on the banner. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n confirmationAlert: ConfirmationAlert\n }\n /** Confirmation form cancelled. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined\n}\n\n/** @internal */\nexport const confirmWireDetailsMachine = {\n banner: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_START_TRANSFER,\n 'wireInstructions',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: WireInstructionsContextual,\n })),\n ),\n ),\n wireInstructions: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT,\n 'wireInstructions',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE,\n 'confirmForm',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: ConfirmWireDetailsFormContextual,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n })),\n ),\n ),\n confirmForm: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'banner',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n confirmationAlert: ev.payload.confirmationAlert,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["confirmWireDetailsMachine","state","transition","payrollWireEvents","reduce","ctx","WireInstructionsContextual","ev","ConfirmWireDetailsFormContextual"],"mappings":";;;AAmCO,MAAMA,IAA4B;AAAA,EACvC,QAAQC;AAAA,IACNC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAWC;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,kBAAkBL;AAAA,IAChBC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,kBAAkBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAWG;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,MAAA,EACH;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,aAAaJ;AAAA,IACXC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OACwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAW;AAAA,UACX,mBAAmBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAW;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
1
+ {"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ConfirmationAlert } from './types'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/**\n * Payload shapes for each wire-confirmation state machine event.\n *\n * @internal\n */\nexport type EventPayloads = {\n /** Wire-in request selected within the instructions screen. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {\n selectedWireInId: string\n }\n /** Banner button pressed to begin the wire transfer flow. */\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n /** Instructions screen completed; advances to the confirmation form. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {\n selectedWireInId: string\n }\n /** Confirmation form submitted; carries the alert to surface on the banner. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n confirmationAlert: ConfirmationAlert\n }\n /** Confirmation form cancelled. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined\n}\n\n/** @internal */\nexport const confirmWireDetailsMachine = {\n banner: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_START_TRANSFER,\n 'wireInstructions',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: WireInstructionsContextual,\n confirmationAlert: undefined,\n })),\n ),\n ),\n wireInstructions: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT,\n 'wireInstructions',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE,\n 'confirmForm',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: ConfirmWireDetailsFormContextual,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n })),\n ),\n ),\n confirmForm: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'banner',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n confirmationAlert: ev.payload.confirmationAlert,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["confirmWireDetailsMachine","state","transition","payrollWireEvents","reduce","ctx","WireInstructionsContextual","ev","ConfirmWireDetailsFormContextual"],"mappings":";;;AAmCO,MAAMA,IAA4B;AAAA,EACvC,QAAQC;AAAA,IACNC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,mBAAmB;AAAA,MAAA,EACnB;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,kBAAkBL;AAAA,IAChBC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,kBAAkBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAWG;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,MAAA,EACH;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,aAAaJ;AAAA,IACXC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OACwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAW;AAAA,UACX,mBAAmBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAW;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
@@ -18,13 +18,12 @@ import "@gusto/embedded-api/models/errors/httpclienterrors";
18
18
  import { formatNumberAsCurrency as B } from "../../../helpers/formattedStrings.js";
19
19
  import "../../../shared/constants.js";
20
20
  import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
21
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
22
21
  import { useI18n as D } from "../../../i18n/I18n.js";
23
22
  import { NumberInputField as E } from "../../Common/Fields/NumberInputField/NumberInputField.js";
24
23
  const T = C.object({
25
24
  netPay: C.number().positive()
26
25
  });
27
- function ue({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
26
+ function pe({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
28
27
  D("Payroll.GrossUpModal");
29
28
  const { t: r } = z("Payroll.GrossUpModal"), { Modal: x, Heading: u, Text: i, Button: c, Alert: f } = V(), { baseSubmitHandler: y } = k(), A = F(null), [l, m] = o(null), [h, d] = o(null), [M, g] = o(!1), [N, v] = o(!1), s = R({
30
29
  resolver: H(T),
@@ -114,6 +113,6 @@ function ue({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
114
113
  );
115
114
  }
116
115
  export {
117
- ue as GrossUpModal
116
+ pe as GrossUpModal
118
117
  };
119
118
  //# sourceMappingURL=GrossUpModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n // Start blank rather than 0: 0 is not a valid net amount, and a leading 0\n // in the field means typing an amount produces values like \"0350\".\n defaultValues: {},\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset()\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n {/* Bottom-align on the row itself: the .calculateButton align-self\n rule below only targets the default (react-aria) adapter, so in\n other adapters the button otherwise falls back to flex-start. */}\n <Flex flexDirection=\"row\" gap={8} alignItems=\"flex-end\">\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n adornmentStart=\"$\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n isLoading={isCalculating}\n onClick={formHandlers.handleSubmit(handleCalculate)}\n >\n {t('calculateCta')}\n </Button>\n </Flex>\n\n {calculatedGrossUp ? (\n <div className={styles.result}>\n <Text size=\"sm\" variant=\"supporting\" weight=\"semibold\">\n {t('grossPayResult')}\n </Text>\n <Heading as=\"h3\">{formatNumberAsCurrency(parseFloat(calculatedGrossUp))}</Heading>\n </div>\n ) : (\n <Text size=\"sm\" variant=\"supporting\">\n {t('applyHint')}\n </Text>\n )}\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["GrossUpFormSchema","z","GrossUpModal","isOpen","onCalculateGrossUp","onApply","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","Alert","useComponentContext","baseSubmitHandler","useBase","modalContainerRef","useRef","calculatedGrossUp","setCalculatedGrossUp","useState","errorMessage","setErrorMessage","isCalculating","setIsCalculating","isApplying","setIsApplying","formHandlers","useForm","zodResolver","useEffect","handleCalculate","data","result","jsx","ActionsLayout","jsxs","FormProvider","styles","Flex","NumberInputField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACjC,QAAQA,EAAE,OAAA,EAAS,SAAA;AACrB,CAAC;AAKM,SAASC,GAAa,EAAE,QAAAC,GAAQ,oBAAAC,GAAoB,SAAAC,GAAS,UAAAC,KAA+B;AACjG,EAAAC,EAAQ,sBAAsB;AAC9B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAC1C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAoBC,EAAuB,IAAI,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,SAAQ;AAAA,gBACR,WAAW2B,EAAO;AAAA,gBAClB,WAAWf;AAAA,gBACX,SAASI,EAAa,aAAaI,CAAe;AAAA,gBAEjD,YAAE,cAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UACnB,GACF;AAAA,UAECb,IACC,gBAAAkB,EAAC,OAAA,EAAI,WAAWE,EAAO,QACrB,UAAA;AAAA,YAAA,gBAAAJ,EAACxB,GAAA,EAAK,MAAK,MAAK,SAAQ,cAAa,QAAO,YACzC,UAAAJ,EAAE,gBAAgB,EAAA,CACrB;AAAA,YACA,gBAAA4B,EAACzB,KAAQ,IAAG,MAAM,YAAuB,WAAWS,CAAiB,CAAC,EAAA,CAAE;AAAA,UAAA,EAAA,CAC1E,sBAECR,GAAA,EAAK,MAAK,MAAK,SAAQ,cACrB,UAAAJ,EAAE,WAAW,EAAA,CAChB;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n // Start blank rather than 0: 0 is not a valid net amount, and a leading 0\n // in the field means typing an amount produces values like \"0350\".\n defaultValues: {},\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset()\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n {/* Bottom-align on the row itself: the .calculateButton align-self\n rule below only targets the default (react-aria) adapter, so in\n other adapters the button otherwise falls back to flex-start. */}\n <Flex flexDirection=\"row\" gap={8} alignItems=\"flex-end\">\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n adornmentStart=\"$\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n isLoading={isCalculating}\n onClick={formHandlers.handleSubmit(handleCalculate)}\n >\n {t('calculateCta')}\n </Button>\n </Flex>\n\n {calculatedGrossUp ? (\n <div className={styles.result}>\n <Text size=\"sm\" variant=\"supporting\" weight=\"semibold\">\n {t('grossPayResult')}\n </Text>\n <Heading as=\"h3\">{formatNumberAsCurrency(parseFloat(calculatedGrossUp))}</Heading>\n </div>\n ) : (\n <Text size=\"sm\" variant=\"supporting\">\n {t('applyHint')}\n </Text>\n )}\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["GrossUpFormSchema","z","GrossUpModal","isOpen","onCalculateGrossUp","onApply","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","Alert","useComponentContext","baseSubmitHandler","useBase","modalContainerRef","useRef","calculatedGrossUp","setCalculatedGrossUp","useState","errorMessage","setErrorMessage","isCalculating","setIsCalculating","isApplying","setIsApplying","formHandlers","useForm","zodResolver","useEffect","handleCalculate","data","result","jsx","ActionsLayout","jsxs","FormProvider","styles","Flex","NumberInputField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACjC,QAAQA,EAAE,OAAA,EAAS,SAAA;AACrB,CAAC;AAKM,SAASC,GAAa,EAAE,Q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