@gusto/embedded-react-sdk 0.57.1 → 0.57.2

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 (160) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Base/Base.js +2 -3
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  5. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
  7. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  8. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -6
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -6
  13. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -11
  15. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -8
  17. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  18. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  19. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  20. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -6
  21. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  22. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
  23. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  24. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
  25. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  26. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
  27. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  28. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  29. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  30. package/dist/components/Company/FederalTaxes/Actions.js +7 -9
  31. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  32. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -11
  33. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  34. package/dist/components/Company/Industry/Actions.js +5 -7
  35. package/dist/components/Company/Industry/Actions.js.map +1 -1
  36. package/dist/components/Company/Industry/Context.js +6 -9
  37. package/dist/components/Company/Industry/Context.js.map +1 -1
  38. package/dist/components/Company/Industry/Edit.js +10 -12
  39. package/dist/components/Company/Industry/Edit.js.map +1 -1
  40. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -10
  41. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  42. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -6
  43. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
  45. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  46. package/dist/components/Company/Locations/LocationsList/List.js +11 -13
  47. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  48. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -6
  49. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  50. package/dist/components/Company/OnboardingOverview/context.js +3 -6
  51. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  52. package/dist/components/Company/PaySchedule/PayScheduleForm.js +66 -62
  53. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  54. package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js +2 -2
  55. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +80 -68
  56. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
  57. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js +11 -13
  58. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -1
  59. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +49 -44
  60. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
  61. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
  62. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  63. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -6
  64. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  65. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
  66. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  67. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -6
  68. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -6
  70. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  71. package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js +16 -17
  72. package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
  73. package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js +8 -9
  74. package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  75. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js +6 -8
  76. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js.map +1 -1
  77. package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js +26 -27
  78. package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  79. package/dist/components/Contractor/Profile/management/ProfileEditForm.js +11 -11
  80. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +12 -13
  81. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  82. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +12 -13
  83. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  84. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +6 -8
  85. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
  86. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -6
  87. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  88. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +3 -4
  89. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
  90. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +3 -4
  91. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
  92. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +22 -24
  93. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  94. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +8 -9
  95. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  96. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +14 -15
  97. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  98. package/dist/components/Employee/Profile/management/ProfileEditForm.js +1 -1
  99. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
  100. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +7 -8
  101. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
  102. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +7 -8
  103. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
  104. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +56 -54
  105. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  106. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +14 -16
  107. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  108. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
  109. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  110. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +9 -11
  111. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  112. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +74 -88
  113. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  114. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +44 -46
  115. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  116. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +63 -61
  117. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  118. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +14 -13
  119. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +1 -1
  120. package/dist/components/Payroll/helpers.js +52 -48
  121. package/dist/components/Payroll/helpers.js.map +1 -1
  122. package/dist/components/Payroll/usePreparedPayrollData.js +13 -16
  123. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  124. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +2 -2
  125. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
  126. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -4
  127. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  128. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +6 -8
  129. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  130. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +28 -30
  131. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  132. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
  133. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  134. package/dist/helpers/dateFormatting.js +47 -40
  135. package/dist/helpers/dateFormatting.js.map +1 -1
  136. package/dist/i18n/en/Company.Management.PaySchedule.json.js +20 -18
  137. package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
  138. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +6 -4
  139. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -1
  140. package/dist/i18n/en/Payroll.PayrollHistory.json.js +5 -5
  141. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  142. package/dist/package.json.js +1 -1
  143. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +8 -10
  144. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  145. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +12 -14
  146. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  147. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -15
  148. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  149. package/dist/partner-hook-utils/form/fields/SelectHookField.js +10 -12
  150. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  151. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +14 -16
  152. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  153. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +8 -10
  154. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  155. package/dist/src/components/Company/PaySchedule/PayScheduleForm.d.ts +6 -0
  156. package/dist/src/components/Payroll/helpers.d.ts +20 -0
  157. package/dist/src/helpers/dateFormatting.d.ts +13 -0
  158. package/dist/src/i18n/types.d.ts +14 -2
  159. package/dist/style.css +1 -1
  160. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleAssignmentComponents.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesPreviewAssignmentMutation } from '@gusto/embedded-api/react-query/paySchedulesPreviewAssignment'\nimport { usePaySchedulesAssignMutation } from '@gusto/embedded-api/react-query/paySchedulesAssign'\nimport { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody'\nimport type { PayScheduleAssignmentEmployeeChange } from '@gusto/embedded-api/models/components/payscheduleassignmentemployeechange'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { AssignmentTypeStepPresentation } from './AssignmentTypeStepPresentation'\nimport { AssignmentScheduleStepPresentation } from './AssignmentScheduleStepPresentation'\nimport { AssignmentCompensationStepPresentation } from './AssignmentCompensationStepPresentation'\nimport { AssignmentReviewStepPresentation } from './AssignmentReviewStepPresentation'\nimport type {\n PayScheduleAssignmentContextInterface,\n SupportedAssignmentType,\n} from './usePayScheduleAssignment'\nimport { PayScheduleForm } from '@/components/Company/PaySchedule/PayScheduleForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useBase, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The assignment the user built, already collapsed to the type that actually gets submitted.\n * Doubles as the request body and as the `assigned` event payload.\n *\n * @internal\n */\nexport type AssignmentSelection =\n | {\n type: typeof PayScheduleAssignmentBodyType.Single\n defaultPayScheduleUuid: string\n }\n | {\n type: typeof PayScheduleAssignmentBodyType.HourlySalaried\n hourlyPayScheduleUuid: string\n salariedPayScheduleUuid: string\n }\n\n/** @internal */\nexport type EventPayloads = {\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED]: { type: SupportedAssignmentType }\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED]:\n | { defaultPayScheduleUuid: string }\n | { hourlyPayScheduleUuid: string; salariedPayScheduleUuid: string }\n [componentEvents.PAY_SCHEDULE_CREATED]: { paySchedule: PayScheduleShow }\n [componentEvents.PAY_SCHEDULE_ASSIGNED]: AssignmentSelection & {\n employeeChanges: PayScheduleAssignmentEmployeeChange[]\n }\n}\n\n/** @internal */\nexport function AssignmentTypeStep() {\n const { assignmentType, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return (\n <AssignmentTypeStepPresentation\n defaultType={assignmentType}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_CANCEL)\n }}\n onContinue={type => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED, { type })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentScheduleStep() {\n const {\n companyId,\n assignmentType,\n defaultPayScheduleUuid,\n hourlyPayScheduleUuid,\n salariedPayScheduleUuid,\n onEvent,\n } = useFlow<PayScheduleAssignmentContextInterface>()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId: ensureRequired(companyId),\n })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n const activeSchedule = schedules.find(s => s.active)\n /**\n * A uuid carried in from the company's existing assignment has no option to select if the\n * schedule is no longer in the company's list, which would leave the dropdown blank.\n */\n const preselect = (uuid: string | undefined) =>\n schedules.some(s => s.uuid === uuid) ? uuid : activeSchedule?.uuid\n\n if (assignmentType === PayScheduleAssignmentBodyType.HourlySalaried) {\n return (\n <AssignmentCompensationStepPresentation\n schedules={schedules}\n hourlyPayScheduleUuid={preselect(hourlyPayScheduleUuid)}\n salariedPayScheduleUuid={preselect(salariedPayScheduleUuid)}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onAddPaySchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_CREATE)\n }}\n onContinue={selection => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, selection)\n }}\n />\n )\n }\n\n return (\n <AssignmentScheduleStepPresentation\n schedules={schedules}\n defaultPayScheduleUuid={preselect(defaultPayScheduleUuid)}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onAddPaySchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_CREATE)\n }}\n onContinue={uuid => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, {\n defaultPayScheduleUuid: uuid,\n })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentCreateScheduleStep() {\n const { companyId, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return <PayScheduleForm companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function AssignmentReviewStep() {\n const {\n companyId,\n assignmentType,\n defaultPayScheduleUuid,\n hourlyPayScheduleUuid,\n salariedPayScheduleUuid,\n onEvent,\n } = useFlow<PayScheduleAssignmentContextInterface>()\n const { baseSubmitHandler, error } = useBase()\n const [employeeChanges, setEmployeeChanges] = useState<\n PayScheduleAssignmentEmployeeChange[] | null\n >(null)\n const { mutateAsync: previewAssignment, isPending: isPreviewLoading } =\n usePaySchedulesPreviewAssignmentMutation()\n const { mutateAsync: assignSchedules, isPending: isAssigning } = usePaySchedulesAssignMutation()\n\n const assignment: AssignmentSelection = useMemo(() => {\n if (assignmentType === PayScheduleAssignmentBodyType.HourlySalaried) {\n const hourly = ensureRequired(hourlyPayScheduleUuid)\n const salaried = ensureRequired(salariedPayScheduleUuid)\n\n // One schedule for both compensation types is a single-schedule assignment. Collapsing\n // here rather than at submit keeps the previewed changes identical to what gets sent.\n if (hourly === salaried) {\n return {\n type: PayScheduleAssignmentBodyType.Single,\n defaultPayScheduleUuid: hourly,\n }\n }\n\n return {\n type: PayScheduleAssignmentBodyType.HourlySalaried,\n hourlyPayScheduleUuid: hourly,\n salariedPayScheduleUuid: salaried,\n }\n }\n\n return {\n type: PayScheduleAssignmentBodyType.Single,\n defaultPayScheduleUuid: ensureRequired(defaultPayScheduleUuid),\n }\n }, [assignmentType, defaultPayScheduleUuid, hourlyPayScheduleUuid, salariedPayScheduleUuid])\n\n useEffect(() => {\n void baseSubmitHandler(undefined, async () => {\n const response = await previewAssignment({\n request: { companyId: ensureRequired(companyId), payScheduleAssignmentBody: assignment },\n })\n setEmployeeChanges(response.payScheduleAssignmentPreview?.employeeChanges ?? [])\n })\n }, [companyId, assignment, previewAssignment, baseSubmitHandler])\n\n // The enclosing BaseComponent's own BaseLayout already renders `error` for this whole\n // component tree, so surface only the loading state here to avoid rendering it twice.\n if (error) {\n return null\n }\n if (isPreviewLoading || !employeeChanges) {\n return <BaseLayout isLoading />\n }\n\n return (\n <AssignmentReviewStepPresentation\n employeeChanges={employeeChanges}\n isSubmitting={isAssigning}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onSubmit={() => {\n void baseSubmitHandler(undefined, async () => {\n await assignSchedules({\n request: {\n companyId: ensureRequired(companyId),\n payScheduleAssignmentBody: assignment,\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNED, { ...assignment, employeeChanges })\n })\n }}\n />\n )\n}\n"],"names":["AssignmentTypeStep","assignmentType","onEvent","useFlow","jsx","AssignmentTypeStepPresentation","componentEvents","type","AssignmentScheduleStep","companyId","defaultPayScheduleUuid","hourlyPayScheduleUuid","salariedPayScheduleUuid","paySchedules","usePaySchedulesGetAllSuspense","ensureRequired","schedules","activeSchedule","s","preselect","uuid","PayScheduleAssignmentBodyType","AssignmentCompensationStepPresentation","selection","AssignmentScheduleStepPresentation","AssignmentCreateScheduleStep","PayScheduleForm","AssignmentReviewStep","baseSubmitHandler","error","useBase","employeeChanges","setEmployeeChanges","useState","previewAssignment","isPreviewLoading","usePaySchedulesPreviewAssignmentMutation","assignSchedules","isAssigning","usePaySchedulesAssignMutation","assignment","useMemo","hourly","salaried","useEffect","response","BaseLayout","AssignmentReviewStepPresentation"],"mappings":";;;;;;;;;;;;;;;;AAmDO,SAASA,IAAqB;AACnC,QAAM,EAAE,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA;AAEpC,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAaJ;AAAA,MACb,QAAQ,MAAM;AACZ,QAAAC,EAAQI,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,YAAY,CAAAC,MAAQ;AAClB,QAAAL,EAAQI,EAAgB,uCAAuC,EAAE,MAAAC,EAAA,CAAM;AAAA,MACzE;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASC,IAAyB;AACvC,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,gBAAAR;AAAA,IACA,wBAAAS;AAAA,IACA,uBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,SAAAV;AAAA,EAAA,IACEC,EAAA,GACE,EAAE,MAAMU,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAWC,EAAeN,CAAS;AAAA,EAAA,CACpC,GACKO,IAAYH,EAA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MACC,iBAAAhB;AAAA,MACA,cAAcO;AAAA,MACd,QAAQ,MAAM;AACZ,QAAApC,EAAQI,EAAgB,4BAA4B;AAAA,MACtD;AAAA,MACA,UAAU,MAAM;AACd,QAAKsB,EAAkB,QAAW,YAAY;AAC5C,gBAAMS,EAAgB;AAAA,YACpB,SAAS;AAAA,cACP,WAAWtB,EAAeN,CAAS;AAAA,cACnC,2BAA2B+B;AAAA,YAAA;AAAA,UAC7B,CACD,GACDtC,EAAQI,EAAgB,uBAAuB,EAAE,GAAGkC,GAAY,iBAAAT,GAAiB;AAAA,QACnF,CAAC;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayScheduleAssignmentComponents.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesPreviewAssignmentMutation } from '@gusto/embedded-api/react-query/paySchedulesPreviewAssignment'\nimport { usePaySchedulesAssignMutation } from '@gusto/embedded-api/react-query/paySchedulesAssign'\nimport { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody'\nimport type { PayScheduleAssignmentEmployeeChange } from '@gusto/embedded-api/models/components/payscheduleassignmentemployeechange'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { AssignmentTypeStepPresentation } from './AssignmentTypeStepPresentation'\nimport { AssignmentScheduleStepPresentation } from './AssignmentScheduleStepPresentation'\nimport { AssignmentCompensationStepPresentation } from './AssignmentCompensationStepPresentation'\nimport { AssignmentReviewStepPresentation } from './AssignmentReviewStepPresentation'\nimport type {\n PayScheduleAssignmentContextInterface,\n SupportedAssignmentType,\n} from './usePayScheduleAssignment'\nimport { PayScheduleForm } from '@/components/Company/PaySchedule/PayScheduleForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useBase, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The assignment the user built, already collapsed to the type that actually gets submitted.\n * Doubles as the request body and as the `assigned` event payload.\n *\n * @internal\n */\nexport type AssignmentSelection =\n | {\n type: typeof PayScheduleAssignmentBodyType.Single\n defaultPayScheduleUuid: string\n }\n | {\n type: typeof PayScheduleAssignmentBodyType.HourlySalaried\n hourlyPayScheduleUuid: string\n salariedPayScheduleUuid: string\n }\n\n/** @internal */\nexport type EventPayloads = {\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED]: { type: SupportedAssignmentType }\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED]:\n | { defaultPayScheduleUuid: string }\n | { hourlyPayScheduleUuid: string; salariedPayScheduleUuid: string }\n [componentEvents.PAY_SCHEDULE_CREATED]: { paySchedule: PayScheduleShow }\n [componentEvents.PAY_SCHEDULE_ASSIGNED]: AssignmentSelection & {\n employeeChanges: PayScheduleAssignmentEmployeeChange[]\n }\n}\n\n/** @internal */\nexport function AssignmentTypeStep() {\n const { assignmentType, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return (\n <AssignmentTypeStepPresentation\n defaultType={assignmentType}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_CANCEL)\n }}\n onContinue={type => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED, { type })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentScheduleStep() {\n const {\n companyId,\n assignmentType,\n defaultPayScheduleUuid,\n hourlyPayScheduleUuid,\n salariedPayScheduleUuid,\n onEvent,\n } = useFlow<PayScheduleAssignmentContextInterface>()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId: ensureRequired(companyId),\n })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n const activeSchedule = schedules.find(s => s.active)\n /**\n * A uuid carried in from the company's existing assignment has no option to select if the\n * schedule is no longer in the company's list, which would leave the dropdown blank.\n */\n const preselect = (uuid: string | undefined) =>\n schedules.some(s => s.uuid === uuid) ? uuid : activeSchedule?.uuid\n\n if (assignmentType === PayScheduleAssignmentBodyType.HourlySalaried) {\n return (\n <AssignmentCompensationStepPresentation\n schedules={schedules}\n hourlyPayScheduleUuid={preselect(hourlyPayScheduleUuid)}\n salariedPayScheduleUuid={preselect(salariedPayScheduleUuid)}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onAddPaySchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_CREATE)\n }}\n onContinue={selection => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, selection)\n }}\n />\n )\n }\n\n return (\n <AssignmentScheduleStepPresentation\n schedules={schedules}\n defaultPayScheduleUuid={preselect(defaultPayScheduleUuid)}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onAddPaySchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_CREATE)\n }}\n onContinue={uuid => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, {\n defaultPayScheduleUuid: uuid,\n })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentCreateScheduleStep() {\n const { t } = useTranslation('Company.Management.PayScheduleAssignment')\n const { companyId, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return (\n <PayScheduleForm\n variant=\"management\"\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n copy={{\n anchorEndOfPayPeriodDescription: t('scheduleForm.anchorEndOfPayPeriodDescription'),\n payrollDeadline: t('scheduleForm.payrollDeadline'),\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentReviewStep() {\n const {\n companyId,\n assignmentType,\n defaultPayScheduleUuid,\n hourlyPayScheduleUuid,\n salariedPayScheduleUuid,\n onEvent,\n } = useFlow<PayScheduleAssignmentContextInterface>()\n const { baseSubmitHandler, error } = useBase()\n const [employeeChanges, setEmployeeChanges] = useState<\n PayScheduleAssignmentEmployeeChange[] | null\n >(null)\n const { mutateAsync: previewAssignment, isPending: isPreviewLoading } =\n usePaySchedulesPreviewAssignmentMutation()\n const { mutateAsync: assignSchedules, isPending: isAssigning } = usePaySchedulesAssignMutation()\n\n const assignment: AssignmentSelection = useMemo(() => {\n if (assignmentType === PayScheduleAssignmentBodyType.HourlySalaried) {\n const hourly = ensureRequired(hourlyPayScheduleUuid)\n const salaried = ensureRequired(salariedPayScheduleUuid)\n\n // One schedule for both compensation types is a single-schedule assignment. Collapsing\n // here rather than at submit keeps the previewed changes identical to what gets sent.\n if (hourly === salaried) {\n return {\n type: PayScheduleAssignmentBodyType.Single,\n defaultPayScheduleUuid: hourly,\n }\n }\n\n return {\n type: PayScheduleAssignmentBodyType.HourlySalaried,\n hourlyPayScheduleUuid: hourly,\n salariedPayScheduleUuid: salaried,\n }\n }\n\n return {\n type: PayScheduleAssignmentBodyType.Single,\n defaultPayScheduleUuid: ensureRequired(defaultPayScheduleUuid),\n }\n }, [assignmentType, defaultPayScheduleUuid, hourlyPayScheduleUuid, salariedPayScheduleUuid])\n\n useEffect(() => {\n void baseSubmitHandler(undefined, async () => {\n const response = await previewAssignment({\n request: { companyId: ensureRequired(companyId), payScheduleAssignmentBody: assignment },\n })\n setEmployeeChanges(response.payScheduleAssignmentPreview?.employeeChanges ?? [])\n })\n }, [companyId, assignment, previewAssignment, baseSubmitHandler])\n\n // The enclosing BaseComponent's own BaseLayout already renders `error` for this whole\n // component tree, so surface only the loading state here to avoid rendering it twice.\n if (error) {\n return null\n }\n if (isPreviewLoading || !employeeChanges) {\n return <BaseLayout isLoading />\n }\n\n return (\n <AssignmentReviewStepPresentation\n employeeChanges={employeeChanges}\n isSubmitting={isAssigning}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onSubmit={() => {\n void baseSubmitHandler(undefined, async () => {\n await assignSchedules({\n request: {\n companyId: ensureRequired(companyId),\n payScheduleAssignmentBody: assignment,\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNED, { ...assignment, employeeChanges })\n })\n }}\n />\n )\n}\n"],"names":["AssignmentTypeStep","assignmentType","onEvent","useFlow","jsx","AssignmentTypeStepPresentation","componentEvents","type","AssignmentScheduleStep","companyId","defaultPayScheduleUuid","hourlyPayScheduleUuid","salariedPayScheduleUuid","paySchedules","usePaySchedulesGetAllSuspense","ensureRequired","schedules","activeSchedule","s","preselect","uuid","PayScheduleAssignmentBodyType","AssignmentCompensationStepPresentation","selection","AssignmentScheduleStepPresentation","AssignmentCreateScheduleStep","t","useTranslation","PayScheduleForm","AssignmentReviewStep","baseSubmitHandler","error","useBase","employeeChanges","setEmployeeChanges","useState","previewAssignment","isPreviewLoading","usePaySchedulesPreviewAssignmentMutation","assignSchedules","isAssigning","usePaySchedulesAssignMutation","assignment","useMemo","hourly","salaried","useEffect","response","BaseLayout","AssignmentReviewStepPresentation"],"mappings":";;;;;;;;;;;;;;;;;AAoDO,SAASA,IAAqB;AACnC,QAAM,EAAE,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA;AAEpC,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAaJ;AAAA,MACb,QAAQ,MAAM;AACZ,QAAAC,EAAQI,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,YAAY,CAAAC,MAAQ;AAClB,QAAAL,EAAQI,EAAgB,uCAAuC,EAAE,MAAAC,EAAA,CAAM;AAAA,MACzE;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASC,KAAyB;AACvC,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,gBAAAR;AAAA,IACA,wBAAAS;AAAA,IACA,uBAAAC;AAAA,IACA,yB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AMX,EAAkB;AAAA,QACvC,SAAS,EAAE,WAAWrB,EAAeN,CAAS,GAAG,2BAA2BiC,EAAA;AAAA,MAAW,CACxF;AACD,MAAAR,EAAmBa,EAAS,8BAA8B,mBAAmB,CAAA,CAAE;AAAA,IACjF,CAAC;AAAA,EACH,GAAG,CAACtC,GAAWiC,GAAYN,GAAmBN,CAAiB,CAAC,GAI5DC,IACK,OAELM,KAAoB,CAACJ,IAChB,gBAAA7B,EAAC4C,GAAA,EAAW,WAAS,GAAA,CAAC,IAI7B,gBAAA5C;AAAA,IAAC6C;AAAA,IAAA;AAAA,MACC,iBAAAhB;AAAA,MACA,cAAcO;AAAA,MACd,QAAQ,MAAM;AACZ,QAAAtC,EAAQI,EAAgB,4BAA4B;AAAA,MACtD;AAAA,MACA,UAAU,MAAM;AACd,QAAKwB,EAAkB,QAAW,YAAY;AAC5C,gBAAMS,EAAgB;AAAA,YACpB,SAAS;AAAA,cACP,WAAWxB,EAAeN,CAAS;AAAA,cACnC,2BAA2BiC;AAAA,YAAA;AAAA,UAC7B,CACD,GACDxC,EAAQI,EAAgB,uBAAuB,EAAE,GAAGoC,GAAY,iBAAAT,GAAiB;AAAA,QACnF,CAAC;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,21 +1,19 @@
1
1
  import { jsxs as d, Fragment as p, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as b } from "react-i18next";
3
- import "classnames";
4
- import "../../../../shared/constants.js";
5
3
  import { HamburgerMenu as y } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
6
4
  import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
5
  import { useDataView as g } from "../../../Common/DataView/useDataView.js";
8
6
  import { DataView as h } from "../../../Common/DataView/DataView.js";
9
- function M({
10
- rows: n,
11
- enableAutoPilot: i,
7
+ function B({
8
+ rows: i,
9
+ enableAutoPilot: n,
12
10
  enableMultipleSchedules: r,
13
11
  onEditSchedule: l,
14
12
  onManageAssignment: s,
15
- onEditAutoPilot: m
13
+ onEditAutoPilot: c
16
14
  }) {
17
- const { t: e } = b("Company.Management.PaySchedule"), a = f(), c = g({
18
- data: n,
15
+ const { t: e } = b("Company.Management.PaySchedule"), a = f(), m = g({
16
+ data: i,
19
17
  columns: [
20
18
  {
21
19
  key: "schedule",
@@ -30,7 +28,7 @@ function M({
30
28
  title: e("labels.frequency"),
31
29
  render: ({ schedule: t }) => t.frequency
32
30
  },
33
- ...i ? [
31
+ ...n ? [
34
32
  {
35
33
  key: "autoPilot",
36
34
  title: e("autoPilot.label"),
@@ -48,11 +46,11 @@ function M({
48
46
  l(t);
49
47
  }
50
48
  },
51
- ...i ? [
49
+ ...n ? [
52
50
  {
53
51
  label: e("autoPilot.label"),
54
52
  onClick: () => {
55
- m(t);
53
+ c(t);
56
54
  }
57
55
  }
58
56
  ] : []
@@ -73,11 +71,11 @@ function M({
73
71
  action: r ? /* @__PURE__ */ o(a.Button, { variant: "secondary", onClick: s, children: e("manageCta") }) : void 0
74
72
  }
75
73
  ),
76
- children: /* @__PURE__ */ o(h, { label: e("compensationTableLabel"), isWithinBox: !0, ...c })
74
+ children: /* @__PURE__ */ o(h, { label: e("compensationTableLabel"), isWithinBox: !0, ...m })
77
75
  }
78
76
  );
79
77
  }
80
78
  export {
81
- M as PayScheduleCompensationOverviewPresentation
79
+ B as PayScheduleCompensationOverviewPresentation
82
80
  };
83
81
  //# sourceMappingURL=PayScheduleCompensationOverviewPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleCompensationOverviewPresentation.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport type CompensationType = 'hourly' | 'salaried'\n\n/** @internal */\nexport interface PayScheduleCompensationRow {\n compensationType: CompensationType\n schedule: PayScheduleShow\n}\n\n/** @internal */\nexport interface PayScheduleCompensationOverviewPresentationProps {\n /** One row per compensation type, in display order. */\n rows: PayScheduleCompensationRow[]\n /** Shows the AutoPilot column and its row action when `true`. */\n enableAutoPilot?: boolean\n /** Shows the Manage action when `true`. */\n enableMultipleSchedules?: boolean\n /** Fired when the user chooses Edit schedule from a row menu. */\n onEditSchedule: (schedule: PayScheduleShow) => void\n /** Fired when the user clicks Manage. */\n onManageAssignment: () => void\n /** Fired when the user chooses AutoPilot from a row menu. */\n onEditAutoPilot: (schedule: PayScheduleShow) => void\n}\n\n/** @internal */\nexport function PayScheduleCompensationOverviewPresentation({\n rows,\n enableAutoPilot,\n enableMultipleSchedules,\n onEditSchedule,\n onManageAssignment,\n onEditAutoPilot,\n}: PayScheduleCompensationOverviewPresentationProps) {\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n const dataViewProps = useDataView<PayScheduleCompensationRow>({\n data: rows,\n columns: [\n {\n key: 'schedule',\n title: t('labels.schedule'),\n render: ({ compensationType, schedule }) => (\n <>\n {t(`compensationTypes.${compensationType}`)}\n <Components.Text variant=\"supporting\" size=\"sm\">\n {schedule.customName}\n </Components.Text>\n </>\n ),\n },\n {\n key: 'frequency',\n title: t('labels.frequency'),\n render: ({ schedule }) => schedule.frequency,\n },\n ...(enableAutoPilot\n ? [\n {\n key: 'autoPilot',\n title: t('autoPilot.label'),\n render: ({ schedule }: PayScheduleCompensationRow) => (\n <Components.Badge status={schedule.autoPayroll ? 'success' : 'info'}>\n {schedule.autoPayroll ? t('autoPilot.enabled') : t('autoPilot.disabled')}\n </Components.Badge>\n ),\n },\n ]\n : []),\n ],\n itemMenu: ({ schedule }) => (\n <HamburgerMenu\n items={[\n {\n label: t('editScheduleCta'),\n onClick: () => {\n onEditSchedule(schedule)\n },\n },\n ...(enableAutoPilot\n ? [\n {\n label: t('autoPilot.label'),\n onClick: () => {\n onEditAutoPilot(schedule)\n },\n },\n ]\n : []),\n ]}\n triggerLabel={t('rowMenuTriggerLabel')}\n />\n ),\n })\n\n return (\n <Components.Box\n withPadding={false}\n header={\n <Components.BoxHeader\n title={t('title')}\n description={t('compensationDescription')}\n action={\n enableMultipleSchedules ? (\n <Components.Button variant=\"secondary\" onClick={onManageAssignment}>\n {t('manageCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n >\n <DataView label={t('compensationTableLabel')} isWithinBox {...dataViewProps} />\n </Components.Box>\n )\n}\n"],"names":["PayScheduleCompensationOverviewPresentation","rows","enableAutoPilot","enableMultipleSchedules","onEditSchedule","onManageAssignment","onEditAutoPilot","t","useTranslation","Components","useComponentContext","dataViewProps","useDataView","compensationType","schedule","jsxs","Fragment","jsx","HamburgerMenu","DataView"],"mappings":";;;;;;;;AAgCO,SAASA,EAA4C;AAAA,EAC1D,MAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AACF,GAAqD;AACnD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAwC;AAAA,IAC5D,MAAMX;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOM,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAC,EAAE,kBAAAM,GAAkB,UAAAC,EAAA,MAC3B,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAT,EAAE,qBAAqBM,CAAgB,EAAE;AAAA,UAC1C,gBAAAI,EAACR,EAAW,MAAX,EAAgB,SAAQ,cAAa,MAAK,MACxC,UAAAK,EAAS,WAAA,CACZ;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOP,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KAAS,OAAOZ,EAAE,wBAAwB,GAAG,aAAW,IAAE,GAAGI,EAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAGnF;"}
1
+ {"version":3,"file":"PayScheduleCompensationOverviewPresentation.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport type CompensationType = 'hourly' | 'salaried'\n\n/** @internal */\nexport interface PayScheduleCompensationRow {\n compensationType: CompensationType\n schedule: PayScheduleShow\n}\n\n/** @internal */\nexport interface PayScheduleCompensationOverviewPresentationProps {\n /** One row per compensation type, in display order. */\n rows: PayScheduleCompensationRow[]\n /** Shows the AutoPilot column and its row action when `true`. */\n enableAutoPilot?: boolean\n /** Shows the Manage action when `true`. */\n enableMultipleSchedules?: boolean\n /** Fired when the user chooses Edit schedule from a row menu. */\n onEditSchedule: (schedule: PayScheduleShow) => void\n /** Fired when the user clicks Manage. */\n onManageAssignment: () => void\n /** Fired when the user chooses AutoPilot from a row menu. */\n onEditAutoPilot: (schedule: PayScheduleShow) => void\n}\n\n/** @internal */\nexport function PayScheduleCompensationOverviewPresentation({\n rows,\n enableAutoPilot,\n enableMultipleSchedules,\n onEditSchedule,\n onManageAssignment,\n onEditAutoPilot,\n}: PayScheduleCompensationOverviewPresentationProps) {\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n const dataViewProps = useDataView<PayScheduleCompensationRow>({\n data: rows,\n columns: [\n {\n key: 'schedule',\n title: t('labels.schedule'),\n render: ({ compensationType, schedule }) => (\n <>\n {t(`compensationTypes.${compensationType}`)}\n <Components.Text variant=\"supporting\" size=\"sm\">\n {schedule.customName}\n </Components.Text>\n </>\n ),\n },\n {\n key: 'frequency',\n title: t('labels.frequency'),\n render: ({ schedule }) => schedule.frequency,\n },\n ...(enableAutoPilot\n ? [\n {\n key: 'autoPilot',\n title: t('autoPilot.label'),\n render: ({ schedule }: PayScheduleCompensationRow) => (\n <Components.Badge status={schedule.autoPayroll ? 'success' : 'info'}>\n {schedule.autoPayroll ? t('autoPilot.enabled') : t('autoPilot.disabled')}\n </Components.Badge>\n ),\n },\n ]\n : []),\n ],\n itemMenu: ({ schedule }) => (\n <HamburgerMenu\n items={[\n {\n label: t('editScheduleCta'),\n onClick: () => {\n onEditSchedule(schedule)\n },\n },\n ...(enableAutoPilot\n ? [\n {\n label: t('autoPilot.label'),\n onClick: () => {\n onEditAutoPilot(schedule)\n },\n },\n ]\n : []),\n ]}\n triggerLabel={t('rowMenuTriggerLabel')}\n />\n ),\n })\n\n return (\n <Components.Box\n withPadding={false}\n header={\n <Components.BoxHeader\n title={t('title')}\n description={t('compensationDescription')}\n action={\n enableMultipleSchedules ? (\n <Components.Button variant=\"secondary\" onClick={onManageAssignment}>\n {t('manageCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n >\n <DataView label={t('compensationTableLabel')} isWithinBox {...dataViewProps} />\n </Components.Box>\n )\n}\n"],"names":["PayScheduleCompensationOverviewPresentation","rows","enableAutoPilot","enableMultipleSchedules","onEditSchedule","onManageAssignment","onEditAutoPilot","t","useTranslation","Components","useComponentContext","dataViewProps","useDataView","compensationType","schedule","jsxs","Fragment","jsx","HamburgerMenu","DataView"],"mappings":";;;;;;AAgCO,SAASA,EAA4C;AAAA,EAC1D,MAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AACF,GAAqD;AACnD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAwC;AAAA,IAC5D,MAAMX;AAAA,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A,MAAA;AAAA,IAAA;AAAA,EACvC,CAEH;AAED,SACE,gBAAAU;AAAA,IAACR,EAAW;AAAA,IAAX;AAAA,MACC,aAAa;AAAA,MACb,QACE,gBAAAQ;AAAA,QAACR,EAAW;AAAA,QAAX;AAAA,UACC,OAAOF,EAAE,OAAO;AAAA,UAChB,aAAaA,EAAE,yBAAyB;AAAA,UACxC,QACEJ,IACE,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAAE,EAAE,WAAW,GAChB,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,MAKV,UAAA,gBAAAU,EAACE,KAAS,OAAOZ,EAAE,wBAAwB,GAAG,aAAW,IAAE,GAAGI,EAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAGnF;"}
@@ -1,72 +1,77 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as p } from "react-i18next";
3
- import { PayScheduleForm as d } from "../PayScheduleForm.js";
4
- import { PayScheduleOverview as f } from "./PayScheduleOverview.js";
5
- import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useTranslation as u } from "react-i18next";
3
+ import { PayScheduleForm as p } from "../PayScheduleForm.js";
4
+ import { PayScheduleOverview as y } from "./PayScheduleOverview.js";
5
+ import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
6
  import { useFlow as m } from "../../../Flow/useFlow.js";
7
- import { ensureRequired as n } from "../../../../helpers/ensureRequired.js";
8
- import { componentEvents as S } from "../../../../shared/constants.js";
9
- import { Flex as h } from "../../../Common/Flex/Flex.js";
10
- import { AutoPilotDialog as E } from "./AutoPilotDialog/AutoPilotDialog.js";
11
- import { PayScheduleAssignment as P } from "./PayScheduleAssignment/PayScheduleAssignment.js";
12
- function w() {
7
+ import { ensureRequired as r } from "../../../../helpers/ensureRequired.js";
8
+ import { componentEvents as h } from "../../../../shared/constants.js";
9
+ import { Flex as P } from "../../../Common/Flex/Flex.js";
10
+ import { AutoPilotDialog as S } from "./AutoPilotDialog/AutoPilotDialog.js";
11
+ import { PayScheduleAssignment as E } from "./PayScheduleAssignment/PayScheduleAssignment.js";
12
+ function b() {
13
13
  const {
14
- companyId: o,
15
- onEvent: e,
14
+ companyId: e,
15
+ onEvent: o,
16
16
  enableAutoPilot: l,
17
- enableMultipleSchedules: r,
18
- successAlert: u,
17
+ enableMultipleSchedules: a,
18
+ successAlert: t,
19
19
  autoPilotSchedule: c
20
- } = m(), { t: s } = p("Company.Management.PaySchedule"), a = y();
21
- return /* @__PURE__ */ i(h, { flexDirection: "column", gap: 16, children: [
22
- u ? /* @__PURE__ */ t(
23
- a.Alert,
20
+ } = m(), { t: i } = u("Company.Management.PaySchedule"), s = f();
21
+ return /* @__PURE__ */ d(P, { flexDirection: "column", gap: 16, children: [
22
+ t ? /* @__PURE__ */ n(
23
+ s.Alert,
24
24
  {
25
25
  status: "success",
26
- label: s(`alerts.${u}`),
26
+ label: i(`alerts.${t}`),
27
27
  onDismiss: () => {
28
- e(S.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null);
28
+ o(h.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null);
29
29
  }
30
30
  }
31
31
  ) : null,
32
- /* @__PURE__ */ t(
33
- f,
32
+ /* @__PURE__ */ n(
33
+ y,
34
34
  {
35
- companyId: n(o),
36
- onEvent: e,
35
+ companyId: r(e),
36
+ onEvent: o,
37
37
  enableAutoPilot: l,
38
- enableMultipleSchedules: r
38
+ enableMultipleSchedules: a
39
39
  }
40
40
  ),
41
- c ? /* @__PURE__ */ t(
42
- E,
41
+ c ? /* @__PURE__ */ n(
42
+ S,
43
43
  {
44
- companyId: n(o),
44
+ companyId: r(e),
45
45
  schedule: c,
46
- onEvent: e
46
+ onEvent: o
47
47
  }
48
48
  ) : null
49
49
  ] });
50
50
  }
51
- function T() {
52
- const { companyId: o, onEvent: e } = m();
53
- return /* @__PURE__ */ t(P, { companyId: n(o), onEvent: e });
51
+ function w() {
52
+ const { companyId: e, onEvent: o } = m();
53
+ return /* @__PURE__ */ n(E, { companyId: r(e), onEvent: o });
54
54
  }
55
- function j() {
56
- const { companyId: o, payScheduleId: e, defaultValues: l, onEvent: r } = m();
57
- return /* @__PURE__ */ t(
58
- d,
55
+ function T() {
56
+ const { t: e } = u("Company.Management.PaySchedule"), { companyId: o, payScheduleId: l, defaultValues: a, onEvent: t } = m();
57
+ return /* @__PURE__ */ n(
58
+ p,
59
59
  {
60
- companyId: n(o),
61
- payScheduleId: e,
62
- defaultValues: l,
63
- onEvent: r
60
+ variant: "management",
61
+ copy: {
62
+ anchorEndOfPayPeriodDescription: e("scheduleForm.anchorEndOfPayPeriodDescription"),
63
+ payrollDeadline: e("scheduleForm.payrollDeadline")
64
+ },
65
+ companyId: r(o),
66
+ payScheduleId: l,
67
+ defaultValues: a,
68
+ onEvent: t
64
69
  }
65
70
  );
66
71
  }
67
72
  export {
68
- T as PayScheduleAssignmentContextual,
69
- j as PayScheduleEditFormContextual,
70
- w as PayScheduleOverviewContextual
73
+ w as PayScheduleAssignmentContextual,
74
+ T as PayScheduleEditFormContextual,
75
+ b as PayScheduleOverviewContextual
71
76
  };
72
77
  //# sourceMappingURL=PayScheduleManagementComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleManagementComponents.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleManagementComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { PayScheduleForm } from '../PayScheduleForm'\nimport type { PayScheduleDefaultValues } from '../PaySchedule'\nimport { PayScheduleOverview } from './PayScheduleOverview'\nimport { PayScheduleAssignment } from './PayScheduleAssignment'\nimport { AutoPilotDialog } from './AutoPilotDialog'\nimport { Flex } from '@/components/Common/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport type PayScheduleManagementSuccessAlertCode = 'assignmentUpdated'\n\n/** @internal */\nexport interface PayScheduleManagementContextInterface extends FlowContextInterface {\n companyId: string\n payScheduleId?: string\n defaultValues?: PayScheduleDefaultValues\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n successAlert?: PayScheduleManagementSuccessAlertCode | null\n autoPilotSchedule?: PayScheduleShow\n component: React.ComponentType | null\n}\n\n/** @internal */\nexport function PayScheduleOverviewContextual() {\n const {\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert,\n autoPilotSchedule,\n } = useFlow<PayScheduleManagementContextInterface>()\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {successAlert ? (\n <Components.Alert\n status=\"success\"\n label={t(`alerts.${successAlert}`)}\n onDismiss={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null)\n }}\n />\n ) : null}\n <PayScheduleOverview\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n />\n {autoPilotSchedule ? (\n <AutoPilotDialog\n companyId={ensureRequired(companyId)}\n schedule={autoPilotSchedule}\n onEvent={onEvent}\n />\n ) : null}\n </Flex>\n )\n}\n\n/** @internal */\nexport function PayScheduleAssignmentContextual() {\n const { companyId, onEvent } = useFlow<PayScheduleManagementContextInterface>()\n\n return <PayScheduleAssignment companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function PayScheduleEditFormContextual() {\n const { companyId, payScheduleId, defaultValues, onEvent } =\n useFlow<PayScheduleManagementContextInterface>()\n\n return (\n <PayScheduleForm\n companyId={ensureRequired(companyId)}\n payScheduleId={payScheduleId}\n defaultValues={defaultValues}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["PayScheduleOverviewContextual","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","successAlert","autoPilotSchedule","useFlow","t","useTranslation","Components","useComponentContext","jsxs","Flex","jsx","componentEvents","PayScheduleOverview","ensureRequired","AutoPilotDialog","PayScheduleAssignmentContextual","PayScheduleAssignment","PayScheduleEditFormContextual","payScheduleId","defaultValues","PayScheduleForm"],"mappings":";;;;;;;;;;;AA6BO,SAASA,IAAgC;AAC9C,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,IACEC,EAAA,GACE,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAR,IACC,gBAAAS;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOF,EAAE,UAAUH,CAAY,EAAE;AAAA,QACjC,WAAW,MAAM;AACf,UAAAH,EAAQa,EAAgB,yCAAyC,IAAI;AAAA,QACvE;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,IACJ,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC,EAAehB,CAAS;AAAA,QACnC,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDE,IACC,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,WAAWD,EAAehB,CAAS;AAAA,QACnC,UAAUK;AAAA,QACV,SAAAJ;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,EAAA,GACN;AAEJ;AAGO,SAASiB,IAAkC;AAChD,QAAM,EAAE,WAAAlB,GAAW,SAAAC,EAAA,IAAYK,EAAA;AAE/B,2BAAQa,GAAA,EAAsB,WAAWH,EAAehB,CAAS,GAAG,SAAAC,GAAkB;AACxF;AAGO,SAASmB,IAAgC;AAC9C,QAAM,EAAE,WAAApB,GAAW,eAAAqB,GAAe,eAAAC,GAAe,SAAArB,EAAA,IAC/CK,EAAA;AAEF,SACE,gBAAAO;AAAA,IAACU;AAAA,IAAA;AAAA,MACC,WAAWP,EAAehB,CAAS;AAAA,MACnC,eAAAqB;AAAA,MACA,eAAAC;AAAA,MACA,SAAArB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayScheduleManagementComponents.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleManagementComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { PayScheduleForm } from '../PayScheduleForm'\nimport type { PayScheduleDefaultValues } from '../PaySchedule'\nimport { PayScheduleOverview } from './PayScheduleOverview'\nimport { PayScheduleAssignment } from './PayScheduleAssignment'\nimport { AutoPilotDialog } from './AutoPilotDialog'\nimport { Flex } from '@/components/Common/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport type PayScheduleManagementSuccessAlertCode = 'assignmentUpdated'\n\n/** @internal */\nexport interface PayScheduleManagementContextInterface extends FlowContextInterface {\n companyId: string\n payScheduleId?: string\n defaultValues?: PayScheduleDefaultValues\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n successAlert?: PayScheduleManagementSuccessAlertCode | null\n autoPilotSchedule?: PayScheduleShow\n component: React.ComponentType | null\n}\n\n/** @internal */\nexport function PayScheduleOverviewContextual() {\n const {\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert,\n autoPilotSchedule,\n } = useFlow<PayScheduleManagementContextInterface>()\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {successAlert ? (\n <Components.Alert\n status=\"success\"\n label={t(`alerts.${successAlert}`)}\n onDismiss={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null)\n }}\n />\n ) : null}\n <PayScheduleOverview\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n />\n {autoPilotSchedule ? (\n <AutoPilotDialog\n companyId={ensureRequired(companyId)}\n schedule={autoPilotSchedule}\n onEvent={onEvent}\n />\n ) : null}\n </Flex>\n )\n}\n\n/** @internal */\nexport function PayScheduleAssignmentContextual() {\n const { companyId, onEvent } = useFlow<PayScheduleManagementContextInterface>()\n\n return <PayScheduleAssignment companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function PayScheduleEditFormContextual() {\n const { t } = useTranslation('Company.Management.PaySchedule')\n const { companyId, payScheduleId, defaultValues, onEvent } =\n useFlow<PayScheduleManagementContextInterface>()\n\n return (\n <PayScheduleForm\n variant=\"management\"\n copy={{\n anchorEndOfPayPeriodDescription: t('scheduleForm.anchorEndOfPayPeriodDescription'),\n payrollDeadline: t('scheduleForm.payrollDeadline'),\n }}\n companyId={ensureRequired(companyId)}\n payScheduleId={payScheduleId}\n defaultValues={defaultValues}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["PayScheduleOverviewContextual","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","successAlert","autoPilotSchedule","useFlow","t","useTranslation","Components","useComponentContext","jsxs","Flex","jsx","componentEvents","PayScheduleOverview","ensureRequired","AutoPilotDialog","PayScheduleAssignmentContextual","PayScheduleAssignment","PayScheduleEditFormContextual","payScheduleId","defaultValues","PayScheduleForm"],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IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAM;AAAA,QACJ,iCAAiChB,EAAE,8CAA8C;AAAA,QACjF,iBAAiBA,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAEnD,WAAWS,EAAehB,CAAS;AAAA,MACnC,eAAAqB;AAAA,MACA,eAAAC;AAAA,MACA,SAAArB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,18 +1,16 @@
1
1
  import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useStateTaxesForm as s } from "./context.js";
4
- import "classnames";
5
- import "../../../../shared/constants.js";
6
4
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
5
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- function y() {
9
- const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
6
+ function d() {
7
+ const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: e, isPending: r } = s(), o = c();
10
8
  return /* @__PURE__ */ i(m, { children: [
11
- /* @__PURE__ */ n(o.Button, { type: "button", variant: "secondary", onClick: r, children: t("cancelCta") }),
12
- /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: e, children: t("saveCta") })
9
+ /* @__PURE__ */ n(o.Button, { type: "button", variant: "secondary", onClick: e, children: t("cancelCta") }),
10
+ /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: r, children: t("saveCta") })
13
11
  ] });
14
12
  }
15
13
  export {
16
- y as Actions
14
+ d as Actions
17
15
  };
18
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"button\" variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,aAAY,SAASH,GAC3D,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"button\" variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,aAAY,SAASH,GAC3D,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
@@ -9,16 +9,13 @@ 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
- import "classnames";
16
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
19
- const [v, P] = t("StateTaxesFormContext");
16
+ const [d, u] = t("StateTaxesFormContext");
20
17
  export {
21
- P as StateTaxesFormProvider,
22
- v as useStateTaxesForm
18
+ u as StateTaxesFormProvider,
19
+ d as useStateTaxesForm
23
20
  };
24
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -1,15 +1,13 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { useStateTaxesList as e } from "./context.js";
4
- import "classnames";
5
- import "../../../../shared/constants.js";
6
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- function x() {
9
- const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
10
- return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
4
+ import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ function f() {
7
+ const { t: o } = i("Company.StateTaxes"), n = m(), { handleContinue: r } = e();
8
+ return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
11
9
  }
12
10
  export {
13
- x as Actions
11
+ f as Actions
14
12
  };
15
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
@@ -9,16 +9,13 @@ 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
- import "classnames";
16
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
19
- const [v, P] = t("StateTaxesListContext");
16
+ const [d, u] = t("StateTaxesListContext");
20
17
  export {
21
- P as StateTaxesListProvider,
22
- v as useStateTaxesList
18
+ u as StateTaxesListProvider,
19
+ d as useStateTaxesList
23
20
  };
24
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -9,16 +9,13 @@ 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
- import "classnames";
16
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
19
- const [f, v] = t("TaxRateManagementContext");
16
+ const [d, s] = t("TaxRateManagementContext");
20
17
  export {
21
- v as TaxRateManagementProvider,
22
- f as useTaxRateManagement
18
+ s as TaxRateManagementProvider,
19
+ d as useTaxRateManagement
23
20
  };
24
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}
@@ -1,16 +1,15 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as u } from "react-i18next";
3
3
  import { WageType as C } from "../../shared/useContractorPayForm/contractorPaySchema.js";
4
- import "classnames";
5
- import { componentEvents as y } from "../../../../../shared/constants.js";
6
- import { Loading as h } from "../../../../Common/Loading/Loading.js";
7
- import { BaseBoundaries as f, BaseLayout as g } from "../../../../Base/Base.js";
8
- import { useComponentContext as T } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { useI18n as E } from "../../../../../i18n/I18n.js";
4
+ import { Loading as y } from "../../../../Common/Loading/Loading.js";
5
+ import { BaseBoundaries as h, BaseLayout as f } from "../../../../Base/Base.js";
6
+ import { useComponentContext as g } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import { useI18n as T } from "../../../../../i18n/I18n.js";
8
+ import { componentEvents as E } from "../../../../../shared/constants.js";
10
9
  import { useContractorCompensationSummary as L } from "../../shared/useContractorCompensationSummary/useContractorCompensationSummary.js";
11
- function v({ LoaderComponent: n, ...i }) {
10
+ function _({ LoaderComponent: n, ...i }) {
12
11
  return /* @__PURE__ */ o(
13
- f,
12
+ h,
14
13
  {
15
14
  componentName: "Contractor.Management.Compensation",
16
15
  LoaderComponent: n,
@@ -23,36 +22,36 @@ function b({
23
22
  onEvent: i,
24
23
  LoaderComponent: l
25
24
  }) {
26
- E("Contractor.Management.Compensation");
27
- const { t } = u("Contractor.Management.Compensation"), r = T(), a = L({ contractorId: n }), m = a.isLoading, e = a.isLoading ? void 0 : a.data.contractor, s = e?.wageType === C.Hourly, c = /* @__PURE__ */ o("span", { "aria-label": t("emptyPlaceholder"), children: "–" }), p = e ? [
25
+ T("Contractor.Management.Compensation");
26
+ const { t } = u("Contractor.Management.Compensation"), r = g(), a = L({ contractorId: n }), s = a.isLoading, e = a.isLoading ? void 0 : a.data.contractor, m = e?.wageType === C.Hourly, c = /* @__PURE__ */ o("span", { "aria-label": t("emptyPlaceholder"), children: "–" }), p = e ? [
28
27
  {
29
28
  term: t("typeLabel"),
30
- description: e.wageType ? t(s ? "hourlyLabel" : "fixedLabel") : c
29
+ description: e.wageType ? t(m ? "hourlyLabel" : "fixedLabel") : c
31
30
  },
32
- ...s ? [
31
+ ...m ? [
33
32
  {
34
33
  term: t("wageLabel"),
35
34
  description: e.hourlyRate ? t("hourlyRateValue", { rate: e.hourlyRate }) : c
36
35
  }
37
36
  ] : []
38
37
  ] : [], d = () => {
39
- i(y.CONTRACTOR_MANAGEMENT_COMPENSATION_EDIT_REQUESTED, { contractorId: n });
38
+ i(E.CONTRACTOR_MANAGEMENT_COMPENSATION_EDIT_REQUESTED, { contractorId: n });
40
39
  };
41
- return /* @__PURE__ */ o(g, { error: a.errorHandling.errors, LoaderComponent: l, children: /* @__PURE__ */ o(
40
+ return /* @__PURE__ */ o(f, { error: a.errorHandling.errors, LoaderComponent: l, children: /* @__PURE__ */ o(
42
41
  r.Box,
43
42
  {
44
43
  header: /* @__PURE__ */ o(
45
44
  r.BoxHeader,
46
45
  {
47
46
  title: t("title"),
48
- action: /* @__PURE__ */ o(r.Button, { variant: "secondary", onClick: d, isDisabled: m, children: t("editCta") })
47
+ action: /* @__PURE__ */ o(r.Button, { variant: "secondary", onClick: d, isDisabled: s, children: t("editCta") })
49
48
  }
50
49
  ),
51
- children: m ? /* @__PURE__ */ o(h, {}) : e ? /* @__PURE__ */ o(r.DescriptionList, { items: p }) : null
50
+ children: s ? /* @__PURE__ */ o(y, {}) : e ? /* @__PURE__ */ o(r.DescriptionList, { items: p }) : null
52
51
  }
53
52
  ) });
54
53
  }
55
54
  export {
56
- v as CompensationCard
55
+ _ as CompensationCard
57
56
  };
58
57
  //# sourceMappingURL=CompensationCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompensationCard.js","sources":["../../../../../../src/components/Contractor/Compensation/management/CompensationCard/CompensationCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorCompensationSummary } from '../../shared/useContractorCompensationSummary'\nimport { WageType } from '../../shared/useContractorPayForm'\nimport { Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { LoaderComponentType } from '@/components/Base'\n\n/**\n * Props for {@link CompensationCard}.\n *\n * @public\n */\nexport interface CompensationCardProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Event handler fired when the user requests to edit compensation. */\n onEvent: OnEventType<EventType, unknown>\n /** Custom loading indicator rendered while this component's async data is fetching. Overrides the indicator configured on `GustoProvider` for this instance only. */\n LoaderComponent?: LoaderComponentType\n}\n\n/**\n * Read-only card showing a contractor's compensation type and rate with an Edit action.\n *\n * @remarks\n * Standalone card that fetches its own data. Emits an event when the user\n * clicks Edit so the parent can switch to the edit form. The card does not\n * render success or error alerts itself — alert presentation is the\n * surrounding surface's responsibility.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/management/compensation/editRequested` | Fired when the user clicks the Edit button | `{ contractorId: string }` |\n *\n * @param props - See {@link CompensationCardProps}.\n * @returns The contractor compensation card.\n * @public\n */\nexport function CompensationCard({ LoaderComponent, ...props }: CompensationCardProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.Management.Compensation\"\n LoaderComponent={LoaderComponent}\n >\n <CompensationCardContent LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction CompensationCardContent({\n contractorId,\n onEvent,\n LoaderComponent,\n}: CompensationCardProps) {\n useI18n('Contractor.Management.Compensation')\n const { t } = useTranslation('Contractor.Management.Compensation')\n const Components = useComponentContext()\n\n const summary = useContractorCompensationSummary({ contractorId })\n\n const isLoading = summary.isLoading\n const contractor = summary.isLoading ? undefined : summary.data.contractor\n const isHourly = contractor?.wageType === WageType.Hourly\n\n const emptyPlaceholder = <span aria-label={t('emptyPlaceholder')}>–</span>\n const compensationItems = contractor\n ? [\n {\n term: t('typeLabel'),\n description: contractor.wageType\n ? t(isHourly ? 'hourlyLabel' : 'fixedLabel')\n : emptyPlaceholder,\n },\n ...(isHourly\n ? [\n {\n term: t('wageLabel'),\n description: contractor.hourlyRate\n ? t('hourlyRateValue', { rate: contractor.hourlyRate })\n : emptyPlaceholder,\n },\n ]\n : []),\n ]\n : []\n\n const handleEdit = () => {\n onEvent(componentEvents.CONTRACTOR_MANAGEMENT_COMPENSATION_EDIT_REQUESTED, { contractorId })\n }\n\n return (\n <BaseLayout error={summary.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('title')}\n action={\n <Components.Button variant=\"secondary\" onClick={handleEdit} isDisabled={isLoading}>\n {t('editCta')}\n </Components.Button>\n }\n />\n }\n >\n {isLoading ? (\n <Loading />\n ) : contractor ? (\n <Components.DescriptionList items={compensationItems} />\n ) : null}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["CompensationCard","LoaderComponent","props","jsx","BaseBoundaries","CompensationCardContent","contractorId","onEvent","useI18n","useTranslation","Components","useComponentContext","summary","useContractorCompensationSummary","isLoading","contractor","isHourly","WageType","emptyPlaceholder","compensationItems","handleEdit","componentEvents","BaseLayout","Loading"],"mappings":";;;;;;;;;;AA2CO,SAASA,EAAiB,EAAE,iBAAAC,GAAiB,GAAGC,KAAgC;AACrF,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,iBAAAH;AAAA,MAEA,UAAA,gBAAAE,EAACE,GAAA,EAAwB,iBAAAJ,GAAmC,GAAGC,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAG5E;AAEA,SAASG,EAAwB;AAAA,EAC/B,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAN;AACF,GAA0B;AACxB,EAAAO,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAaC,EAAA,GAEbC,IAAUC,EAAiC,EAAE,cAAAP,GAAc,GAE3DQ,IAAYF,EAAQ,WACpBG,IAAaH,EAAQ,YAAY,SAAYA,EAAQ,KAAK,YAC1DI,IAAWD,GAAY,aAAaE,EAAS,QAE7CC,IAAmB,gBAAAf,EAAC,QAAA,EAAK,cAAY,EAAE,kBAAkB,GAAG,UAAA,KAAC,GAC7DgB,IAAoBJ,IACtB;AAAA,IACE;AAAA,MACE,MAAM,EAAE,WAAW;AAAA,MACnB,aAAaA,EAAW,WACpB,EAAEC,IAAW,gBAAgB,YAAY,IACzCE;AAAA,IAAA;AAAA,IAEN,GAAIF,IACA;AAAA,MACE;AAAA,QACE,MAAM,EAAE,WAAW;AAAA,QACnB,aAAaD,EAAW,aACpB,EAAE,mBAAmB,EAAE,MAAMA,EAAW,WAAA,CAAY,IACpDG;AAAA,MAAA;AAAA,IACN,IAEF,CAAA;AAAA,EAAC,IAEP,CAAA,GAEEE,IAAa,MAAM;AACvB,IAAAb,EAAQc,EAAgB,mDAAmD,EAAE,cAAAf,EAAA,CAAc;AAAA,EAC7F;AAEA,2BACGgB,GAAA,EAAW,OAAOV,EAAQ,cAAc,QAAQ,iBAAAX,GAC/C,UAAA,gBAAAE;AAAA,IAACO,EAAW;AAAA,IAAX;AAAA,MACC,QACE,gBAAAP;AAAA,QAACO,EAAW;AAAA,QAAX;AAAA,UACC,OAAO,EAAE,OAAO;AAAA,UAChB,QACE,gBAAAP,EAACO,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASU,GAAY,YAAYN,GACrE,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,QAAA;AAAA,MAAA;AAAA,MAKL,UAAAA,IACC,gBAAAX,EAACoB,GAAA,CAAA,CAAQ,IACPR,IACF,gBAAAZ,EAACO,EAAW,iBAAX,EAA2B,OAAOS,EAAA,CAAmB,IACpD;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ;"}
1
+ {"version":3,"file":"CompensationCard.js","sources":["../../../../../../src/components/Contractor/Compensation/management/CompensationCard/CompensationCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorCompensationSummary } from '../../shared/useContractorCompensationSummary'\nimport { WageType } from '../../shared/useContractorPayForm'\nimport { Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { LoaderComponentType } from '@/components/Base'\n\n/**\n * Props for {@link CompensationCard}.\n *\n * @public\n */\nexport interface CompensationCardProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Event handler fired when the user requests to edit compensation. */\n onEvent: OnEventType<EventType, unknown>\n /** Custom loading indicator rendered while this component's async data is fetching. Overrides the indicator configured on `GustoProvider` for this instance only. */\n LoaderComponent?: LoaderComponentType\n}\n\n/**\n * Read-only card showing a contractor's compensation type and rate with an Edit action.\n *\n * @remarks\n * Standalone card that fetches its own data. Emits an event when the user\n * clicks Edit so the parent can switch to the edit form. The card does not\n * render success or error alerts itself — alert presentation is the\n * surrounding surface's responsibility.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/management/compensation/editRequested` | Fired when the user clicks the Edit button | `{ contractorId: string }` |\n *\n * @param props - See {@link CompensationCardProps}.\n * @returns The contractor compensation card.\n * @public\n */\nexport function CompensationCard({ LoaderComponent, ...props }: CompensationCardProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.Management.Compensation\"\n LoaderComponent={LoaderComponent}\n >\n <CompensationCardContent LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction CompensationCardContent({\n contractorId,\n onEvent,\n LoaderComponent,\n}: CompensationCardProps) {\n useI18n('Contractor.Management.Compensation')\n const { t } = useTranslation('Contractor.Management.Compensation')\n const Components = useComponentContext()\n\n const summary = useContractorCompensationSummary({ contractorId })\n\n const isLoading = summary.isLoading\n const contractor = summary.isLoading ? undefined : summary.data.contractor\n const isHourly = contractor?.wageType === WageType.Hourly\n\n const emptyPlaceholder = <span aria-label={t('emptyPlaceholder')}>–</span>\n const compensationItems = contractor\n ? [\n {\n term: t('typeLabel'),\n description: contractor.wageType\n ? t(isHourly ? 'hourlyLabel' : 'fixedLabel')\n : emptyPlaceholder,\n },\n ...(isHourly\n ? [\n {\n term: t('wageLabel'),\n description: contractor.hourlyRate\n ? t('hourlyRateValue', { rate: contractor.hourlyRate })\n : emptyPlaceholder,\n },\n ]\n : []),\n ]\n : []\n\n const handleEdit = () => {\n onEvent(componentEvents.CONTRACTOR_MANAGEMENT_COMPENSATION_EDIT_REQUESTED, { contractorId })\n }\n\n return (\n <BaseLayout error={summary.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('title')}\n action={\n <Components.Button variant=\"secondary\" onClick={handleEdit} isDisabled={isLoading}>\n {t('editCta')}\n </Components.Button>\n }\n />\n }\n >\n {isLoading ? (\n <Loading />\n ) : contractor ? (\n <Components.DescriptionList items={compensationItems} />\n ) : null}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["CompensationCard","LoaderComponent","props","jsx","BaseBoundaries","CompensationCardContent","contractorId","onEvent","useI18n","useTranslation","Components","useComponentContext","summary","useContractorCompensationSummary","isLoading","contractor","isHourly","WageType","emptyPlaceholder","compensationItems","handleEdit","componentEvents","BaseLayout","Loading"],"mappings":";;;;;;;;;AA2CO,SAASA,EAAiB,EAAE,iBAAAC,GAAiB,GAAGC,KAAgC;AACrF,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,iBAAAH;AAAA,MAEA,UAAA,gBAAAE,EAACE,GAAA,EAAwB,iBAAAJ,GAAmC,GAAGC,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAG5E;AAEA,SAASG,EAAwB;AAAA,EAC/B,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAN;AACF,GAA0B;AACxB,EAAAO,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAaC,EAAA,GAEbC,IAAUC,EAAiC,EAAE,cAAAP,GAAc,GAE3DQ,IAAYF,EAAQ,WACpBG,IAAaH,EAAQ,YAAY,SAAYA,EAAQ,KAAK,YAC1DI,IAAWD,GAAY,aAAaE,EAAS,QAE7CC,IAAmB,gBAAAf,EAAC,QAAA,EAAK,cAAY,EAAE,kBAAkB,GAAG,UAAA,KAAC,GAC7DgB,IAAoBJ,IACtB;AAAA,IACE;AAAA,MACE,MAAM,EAAE,WAAW;AAAA,MACnB,aAAaA,EAAW,WACpB,EAAEC,IAAW,gBAAgB,YAAY,IACzCE;AAAA,IAAA;AAAA,IAEN,GAAIF,IACA;AAAA,MACE;AA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