@gusto/embedded-react-sdk 0.48.0 → 0.48.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.
- package/CHANGELOG.md +11 -0
- package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -12
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -10
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +8 -7
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.js +8 -8
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +5 -3
- package/dist/components/Common/UI/Card/Card.module.scss.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -17
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -17
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -19
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +6 -7
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -17
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -17
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -26
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -20
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +6 -8
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -17
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -17
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -18
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +5 -4
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -17
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -17
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -19
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +2 -3
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +39 -48
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js +2 -3
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js +8 -9
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +2 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +2 -3
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
- package/dist/components/Employee/Deductions/management/Deductions.js +2 -3
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +2 -3
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +2 -2
- package/dist/components/Employee/Documents/management/Documents.js +2 -3
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -17
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +11 -12
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +16 -16
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +2 -2
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +9 -10
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +2 -3
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +8 -9
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +13 -14
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +2 -3
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/management/Profile.js +11 -12
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +12 -13
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +10 -11
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +2 -3
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.js +11 -12
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +6 -6
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +9 -10
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +6 -7
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +2 -3
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +2 -3
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +10 -10
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +6 -7
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +7 -8
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +16 -17
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -8
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +25 -34
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +6 -7
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +6 -7
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +10 -10
- package/dist/components/Payroll/usePreparedPayrollData.js +22 -33
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +2 -3
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +2 -3
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +2 -3
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +0 -1
- package/dist/i18n/en/common.json.js +2 -2
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js +1 -1
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js.map +1 -1
- package/dist/partner-hook-utils/composeErrorHandler.js +3 -1
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +0 -1
- package/package.json +19 -7
- package/dist/assets/icons/magnifyingGlass.png.js +0 -5
- package/dist/assets/icons/magnifyingGlass.png.js.map +0 -1
package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeductionsEditForm.js","sources":["../../../../../../src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.tsx"],"sourcesContent":["import { DeductionsForm } from '../../shared/DeductionsForm'\nimport { useDeductionsList } from '../../shared/useDeductionsList'\nimport { useManagementDeductionsFormDictionary } from './useFormDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DeductionsEditForm}.\n *\n * @public\n */\nexport interface DeductionsEditFormProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form opens in edit mode pre-populated with the\n * matching active deduction. Omit to open in add mode. */\n editingDeductionId?: string\n /** Callback invoked when the form emits an event. See the events table on {@link DeductionsEditForm} for the available event types and payloads. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone add/edit surface for a single employee deduction.\n *\n * @remarks\n * Renders the inline form for a post-tax custom deduction or court-ordered garnishment. Looks up the row to edit by `editingDeductionId`; omit it to open in add mode. Resolves its text against the `Employee.Management.Deductions` translation namespace so partner overrides on that namespace flow into the form. For an orchestrated card-plus-form flow, use {@link Deductions}.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the form | — |\n *\n * @param input - See {@link DeductionsEditFormProps}, plus a `FallbackComponent` override for the error boundary.\n * @returns The rendered add/edit form.\n * @public\n */\nexport function DeductionsEditForm({\n FallbackComponent,\n ...props\n}: DeductionsEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DeductionsEditFormRoot({\n employeeId,\n editingDeductionId,\n dictionary,\n onEvent,\n}: DeductionsEditFormProps) {\n useI18n('Employee.Management.Deductions')\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n\n // React Query dedupes against any sibling consumer of this list, so this\n // is just a typed handle on the loaded row used to seed edit mode.\n const list = useDeductionsList({ employeeId })\n const formDictionary = useManagementDeductionsFormDictionary()\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={employeeId}\n deduction={deduction}\n dictionary={formDictionary}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CREATED\n : componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CANCELLED)\n }}\n />\n </BaseLayout>\n )\n}\n"],"names":["DeductionsEditForm","FallbackComponent","props","jsx","BaseBoundaries","DeductionsEditFormRoot","employeeId","editingDeductionId","dictionary","onEvent","useI18n","useComponentDictionary","list","useDeductionsList","formDictionary","useManagementDeductionsFormDictionary","BaseLayout","deduction","d","DeductionsForm","saved","mode","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeductionsEditForm.js","sources":["../../../../../../src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.tsx"],"sourcesContent":["import { DeductionsForm } from '../../shared/DeductionsForm'\nimport { useDeductionsList } from '../../shared/useDeductionsList'\nimport { useManagementDeductionsFormDictionary } from './useFormDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DeductionsEditForm}.\n *\n * @public\n */\nexport interface DeductionsEditFormProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form opens in edit mode pre-populated with the\n * matching active deduction. Omit to open in add mode. */\n editingDeductionId?: string\n /** Callback invoked when the form emits an event. See the events table on {@link DeductionsEditForm} for the available event types and payloads. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone add/edit surface for a single employee deduction.\n *\n * @remarks\n * Renders the inline form for a post-tax custom deduction or court-ordered garnishment. Looks up the row to edit by `editingDeductionId`; omit it to open in add mode. Resolves its text against the `Employee.Management.Deductions` translation namespace so partner overrides on that namespace flow into the form. For an orchestrated card-plus-form flow, use {@link Deductions}.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the form | — |\n *\n * @param input - See {@link DeductionsEditFormProps}, plus a `FallbackComponent` override for the error boundary.\n * @returns The rendered add/edit form.\n * @public\n */\nexport function DeductionsEditForm({\n FallbackComponent,\n ...props\n}: DeductionsEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DeductionsEditFormRoot({\n employeeId,\n editingDeductionId,\n dictionary,\n onEvent,\n}: DeductionsEditFormProps) {\n useI18n('Employee.Management.Deductions')\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n\n // React Query dedupes against any sibling consumer of this list, so this\n // is just a typed handle on the loaded row used to seed edit mode.\n const list = useDeductionsList({ employeeId })\n const formDictionary = useManagementDeductionsFormDictionary()\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={employeeId}\n deduction={deduction}\n dictionary={formDictionary}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CREATED\n : componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CANCELLED)\n }}\n />\n </BaseLayout>\n )\n}\n"],"names":["DeductionsEditForm","FallbackComponent","props","jsx","BaseBoundaries","DeductionsEditFormRoot","employeeId","editingDeductionId","dictionary","onEvent","useI18n","useComponentDictionary","list","useDeductionsList","formDictionary","useManagementDeductionsFormDictionary","BaseLayout","deduction","d","DeductionsForm","saved","mode","componentEvents"],"mappings":";;;;;;;AA2CO,SAASA,EAAmB;AAAA,EACjC,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAgF;AAC9E,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAE,EAACE,GAAA,EAAwB,GAAGH,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGzC;AAEA,SAASG,EAAuB;AAAA,EAC9B,YAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAQ,gCAAgC,GACxCC,EAAuB,kCAAkCH,CAAU;AAInE,QAAMI,IAAOC,EAAkB,EAAE,YAAAP,GAAY,GACvCQ,IAAiBC,EAAA;AAEvB,MAAIH,EAAK;AACP,6BAAQI,GAAA,EAAW,WAAS,IAAC,OAAOJ,EAAK,cAAc,QAAQ;AAGjE,QAAMK,IAAYV,IACbK,EAAK,KAAK,WAAW,KAAK,CAAAM,MAAKA,EAAE,SAASX,CAAkB,KAAK,OAClE;AAEJ,SACE,gBAAAJ,EAACa,GAAA,EAAW,OAAOJ,EAAK,cAAc,QACpC,UAAA,gBAAAT;AAAA,IAACgB;AAAA,IAAA;AAAA,MACC,YAAAb;AAAA,MACA,WAAAW;AAAA,MACA,YAAYH;AAAA,MACZ,SAAS,CAACM,GAAOC,MAAS;AACxB,QAAAZ;AAAA,UACEY,MAAS,WACLC,EAAgB,mDAChBA,EAAgB;AAAA,UACpBF;AAAA,QAAA;AAAA,MAEJ;AAAA,MACA,UAAU,MAAM;AACd,QAAAX,EAAQa,EAAgB,kDAAkD;AAAA,MAC5E;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { TextInputHookField as n } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
3
|
-
import { NumberInputHookField as i } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
4
3
|
import { SelectHookField as t } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
4
|
+
import { NumberInputHookField as i } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
5
5
|
function d(e) {
|
|
6
6
|
return /* @__PURE__ */ r(t, { ...e, name: "state" });
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { NumberInputHookField as t } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
3
|
-
import { RadioGroupHookField as r } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
4
2
|
import { TextInputHookField as o } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
5
3
|
import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
4
|
+
import { NumberInputHookField as t } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
5
|
+
import { RadioGroupHookField as r } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
6
6
|
function l(n) {
|
|
7
7
|
return /* @__PURE__ */ e(o, { ...n, name: "description" });
|
|
8
8
|
}
|
|
@@ -5,7 +5,6 @@ import { DocumentsCardContextual as a } from "./DocumentsComponents.js";
|
|
|
5
5
|
import { documentsStateMachine as i } from "./documentsStateMachine.js";
|
|
6
6
|
import { Flow as u } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as p } from "../../../Base/Base.js";
|
|
8
|
-
import "../../../Base/useBase.js";
|
|
9
8
|
import { useComponentDictionary as s, useI18n as f } from "../../../../i18n/I18n.js";
|
|
10
9
|
function D({ employeeId: o, onEvent: e }) {
|
|
11
10
|
f("Employee.Management.Documents");
|
|
@@ -19,7 +18,7 @@ function D({ employeeId: o, onEvent: e }) {
|
|
|
19
18
|
);
|
|
20
19
|
return /* @__PURE__ */ n(u, { machine: m, onEvent: e });
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function E({
|
|
23
22
|
dictionary: o,
|
|
24
23
|
FallbackComponent: e,
|
|
25
24
|
...m
|
|
@@ -34,6 +33,6 @@ function w({
|
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
E as Documents
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=Documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Documents}.\n *\n * @public\n */\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee documents management flow.\n *\n * @remarks\n * Orchestrates the documents card and the per-form document manager. The flow\n * starts on the documents card and routes to the document manager when a row's\n * View CTA is selected; cancelling from the document manager returns to the\n * card.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |\n *\n * @param props - See {@link DocumentsProps}.\n * @returns The documents management flow.\n * @public\n */\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Documents}.\n *\n * @public\n */\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee documents management flow.\n *\n * @remarks\n * Orchestrates the documents card and the per-form document manager. The flow\n * starts on the documents card and routes to the document manager when a row's\n * View CTA is selected; cancelling from the document manager returns to the\n * card.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |\n *\n * @param props - See {@link DocumentsProps}.\n * @returns The documents management flow.\n * @public\n */\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;AA2BA,SAASA,EAAc,EAAE,YAAAC,GAAY,SAAAC,KAA2B;AAC9D,EAAAC,EAAQ,+BAA+B;AAEvC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAuB,CAACC,OAAoC;AAAA,MAChF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IAAA,EACA;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAmBO,SAASU,EAAU;AAAA,EACxB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAA6E;AAC3E,SAAAC,EAAuB,iCAAiCH,CAAU,GAEhE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAe,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhC;"}
|
package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-error-boundary";
|
|
4
|
-
import "react-i18next";
|
|
5
|
-
import "@tanstack/react-query";
|
|
6
|
-
import "../../../../../Base/useBase.js";
|
|
7
|
-
import "@gusto/embedded-api-v-2025-11-15/models/errors/apierror";
|
|
8
|
-
import "@gusto/embedded-api-v-2025-11-15/models/errors/gustoembeddederror";
|
|
9
|
-
import "@gusto/embedded-api-v-2025-11-15/models/errors/sdkvalidationerror";
|
|
10
|
-
import "@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror";
|
|
11
|
-
import "@gusto/embedded-api-v-2025-11-15/models/errors/httpclienterrors";
|
|
12
|
-
import "../../../../../../shared/constants.js";
|
|
13
|
-
import "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
1
|
import { createCompoundContext as t } from "../../../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
2
|
+
const [e, n] = t("DocumentListContext");
|
|
17
3
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
n as DocumentListProvider,
|
|
5
|
+
e as useDocumentList
|
|
20
6
|
};
|
|
21
7
|
//# 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-v-2025-11-15/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":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api-v-2025-11-15/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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { createMachine as
|
|
2
|
+
import { createMachine as p } from "robot3";
|
|
3
3
|
import { useMemo as l } from "react";
|
|
4
4
|
import { useEmployeesGetSuspense as g } from "@gusto/embedded-api-v-2025-11-15/react-query/employeesGet";
|
|
5
5
|
import { useEmployeeFormsListSuspense as D } from "@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsList";
|
|
@@ -7,30 +7,29 @@ import { EmploymentEligibilityContextual as d, DocumentListContextual as y } fro
|
|
|
7
7
|
import { documentSignerMachine as E } from "./stateMachine.js";
|
|
8
8
|
import { Flow as S } from "../../../../Flow/Flow.js";
|
|
9
9
|
import { BaseComponent as x } from "../../../../Base/Base.js";
|
|
10
|
-
import "../../../../Base/useBase.js";
|
|
11
10
|
import { useComponentDictionary as C } from "../../../../../i18n/I18n.js";
|
|
12
11
|
import { I9_FORM_NAME as F } from "../../../../../shared/constants.js";
|
|
13
|
-
function
|
|
12
|
+
function N(o) {
|
|
14
13
|
return /* @__PURE__ */ n(x, { ...o, children: /* @__PURE__ */ n(M, { ...o }) });
|
|
15
14
|
}
|
|
16
|
-
function M({ employeeId: o, onEvent: i, dictionary: s, withEmployeeI9:
|
|
15
|
+
function M({ employeeId: o, onEvent: i, dictionary: s, withEmployeeI9: e = !1 }) {
|
|
17
16
|
C("Employee.DocumentSigner", s);
|
|
18
|
-
const { data: a } = g({ employeeId: o }), { data: c } = D({ employeeId: o }), u = a.employee?.onboardingDocumentsConfig?.i9Document === !0, m = c.forms?.find((
|
|
19
|
-
() =>
|
|
17
|
+
const { data: a } = g({ employeeId: o }), { data: c } = D({ employeeId: o }), u = a.employee?.onboardingDocumentsConfig?.i9Document === !0, m = c.forms?.find((t) => t.name === F), r = e && u && (!m || m.requiresSigning === !0), f = l(
|
|
18
|
+
() => p(
|
|
20
19
|
r ? "employmentEligibility" : "index",
|
|
21
20
|
E,
|
|
22
|
-
(
|
|
23
|
-
...
|
|
21
|
+
(t) => ({
|
|
22
|
+
...t,
|
|
24
23
|
component: r ? d : y,
|
|
25
24
|
employeeId: o,
|
|
26
|
-
withEmployeeI9:
|
|
25
|
+
withEmployeeI9: e
|
|
27
26
|
})
|
|
28
27
|
),
|
|
29
|
-
[o,
|
|
28
|
+
[o, e]
|
|
30
29
|
);
|
|
31
|
-
return /* @__PURE__ */ n(S, { machine:
|
|
30
|
+
return /* @__PURE__ */ n(S, { machine: f, onEvent: i });
|
|
32
31
|
}
|
|
33
32
|
export {
|
|
34
|
-
|
|
33
|
+
N as DocumentSigner
|
|
35
34
|
};
|
|
36
35
|
//# sourceMappingURL=DocumentSigner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSigner.js","sources":["../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { useEmployeeFormsListSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsList'\nimport {\n DocumentListContextual,\n EmploymentEligibilityContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { I9_FORM_NAME } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentSigner}.\n *\n * @public\n */\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, the flow routes through I-9 employment eligibility before listing documents for signing. Defaults to `false`. */\n withEmployeeI9?: boolean\n}\n\n/**\n * Onboarding step for signing employee documents.\n *\n * @remarks\n * Lists the employee's pending forms and routes through the signing UI for each\n * one. When `withEmployeeI9` is `true` and the employee's I-9 has not been\n * signed, the flow starts on the I-9 employment eligibility step before\n * presenting the document list.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/employmentEligibility/done` | Fired after I-9 employment eligibility is captured | The updated I-9 authorization |\n * | `employee/forms/view` | Fired when a form's \"Sign\" action is selected from the document list | `{ uuid: string; name?: string }` |\n * | `employee/forms/sign` | Fired after a form is successfully signed | {@link Form} |\n * | `employee/employmentEligibility/change` | Fired when the user requests to change their I-9 eligibility status | — |\n * | `employee/forms/done` | Fired when all required forms have been signed and the parent flow can advance | — |\n * | `cancel` | Fired when the user cancels signing a form and returns to the document list | — |\n *\n * @param props - See {@link DocumentSignerProps}.\n * @returns The document signer flow.\n * @public\n */\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, onEvent, dictionary, withEmployeeI9 = false }: DocumentSignerProps) {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const { data: formsData } = useEmployeeFormsListSuspense({ employeeId })\n\n const employeeHasI9Enabled = employeeData.employee?.onboardingDocumentsConfig?.i9Document === true\n\n const i9Form = formsData.forms?.find(form => form.name === I9_FORM_NAME)\n const needsI9Form =\n withEmployeeI9 && employeeHasI9Enabled && (!i9Form || i9Form.requiresSigning === true)\n\n const machine = useMemo(\n () =>\n createMachine(\n needsI9Form ? 'employmentEligibility' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: needsI9Form ? EmploymentEligibilityContextual : DocumentListContextual,\n employeeId,\n withEmployeeI9,\n }),\n ),\n [employeeId, withEmployeeI9],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","props","jsx","BaseComponent","Root","employeeId","onEvent","dictionary","withEmployeeI9","useComponentDictionary","employeeData","useEmployeesGetSuspense","formsData","useEmployeeFormsListSuspense","employeeHasI9Enabled","i9Form","form","I9_FORM_NAME","needsI9Form","machine","useMemo","createMachine","documentSignerMachine","initialContext","EmploymentEligibilityContextual","DocumentListContextual","Flow"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentSigner.js","sources":["../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { useEmployeeFormsListSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsList'\nimport {\n DocumentListContextual,\n EmploymentEligibilityContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { I9_FORM_NAME } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentSigner}.\n *\n * @public\n */\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, the flow routes through I-9 employment eligibility before listing documents for signing. Defaults to `false`. */\n withEmployeeI9?: boolean\n}\n\n/**\n * Onboarding step for signing employee documents.\n *\n * @remarks\n * Lists the employee's pending forms and routes through the signing UI for each\n * one. When `withEmployeeI9` is `true` and the employee's I-9 has not been\n * signed, the flow starts on the I-9 employment eligibility step before\n * presenting the document list.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/employmentEligibility/done` | Fired after I-9 employment eligibility is captured | The updated I-9 authorization |\n * | `employee/forms/view` | Fired when a form's \"Sign\" action is selected from the document list | `{ uuid: string; name?: string }` |\n * | `employee/forms/sign` | Fired after a form is successfully signed | {@link Form} |\n * | `employee/employmentEligibility/change` | Fired when the user requests to change their I-9 eligibility status | — |\n * | `employee/forms/done` | Fired when all required forms have been signed and the parent flow can advance | — |\n * | `cancel` | Fired when the user cancels signing a form and returns to the document list | — |\n *\n * @param props - See {@link DocumentSignerProps}.\n * @returns The document signer flow.\n * @public\n */\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, onEvent, dictionary, withEmployeeI9 = false }: DocumentSignerProps) {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const { data: formsData } = useEmployeeFormsListSuspense({ employeeId })\n\n const employeeHasI9Enabled = employeeData.employee?.onboardingDocumentsConfig?.i9Document === true\n\n const i9Form = formsData.forms?.find(form => form.name === I9_FORM_NAME)\n const needsI9Form =\n withEmployeeI9 && employeeHasI9Enabled && (!i9Form || i9Form.requiresSigning === true)\n\n const machine = useMemo(\n () =>\n createMachine(\n needsI9Form ? 'employmentEligibility' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: needsI9Form ? EmploymentEligibilityContextual : DocumentListContextual,\n employeeId,\n withEmployeeI9,\n }),\n ),\n [employeeId, withEmployeeI9],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","props","jsx","BaseComponent","Root","employeeId","onEvent","dictionary","withEmployeeI9","useComponentDictionary","employeeData","useEmployeesGetSuspense","formsData","useEmployeeFormsListSuspense","employeeHasI9Enabled","i9Form","form","I9_FORM_NAME","needsI9Form","machine","useMemo","createMachine","documentSignerMachine","initialContext","EmploymentEligibilityContextual","DocumentListContextual","Flow"],"mappings":";;;;;;;;;;;AAiDO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,GAAY,gBAAAC,IAAiB,MAA8B;AAC9F,EAAAC,EAAuB,2BAA2BF,CAAU;AAE5D,QAAM,EAAE,MAAMG,EAAA,IAAiBC,EAAwB,EAAE,YAAAN,GAAY,GAC/D,EAAE,MAAMO,EAAA,IAAcC,EAA6B,EAAE,YAAAR,GAAY,GAEjES,IAAuBJ,EAAa,UAAU,2BAA2B,eAAe,IAExFK,IAASH,EAAU,OAAO,KAAK,CAAAI,MAAQA,EAAK,SAASC,CAAY,GACjEC,IACJV,KAAkBM,MAAyB,CAACC,KAAUA,EAAO,oBAAoB,KAE7EI,IAAUC;AAAA,IACd,MACEC;AAAA,MACEH,IAAc,0BAA0B;AAAA,MACxCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAcM,IAAkCC;AAAA,QAC3D,YAAApB;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACH,GAAYG,CAAc;AAAA,EAAA;AAG7B,SAAO,gBAAAN,EAACwB,GAAA,EAAK,SAAAP,GAAkB,SAAAb,EAAA,CAAkB;AACnD;"}
|
|
@@ -8,14 +8,14 @@ import { generateEmploymentEligibilitySchema as k } from "./EmploymentEligibilit
|
|
|
8
8
|
import { COUNTRIES as P } from "./countries.js";
|
|
9
9
|
import { Flex as b } from "../../../../../Common/Flex/Flex.js";
|
|
10
10
|
import { ActionsLayout as V } from "../../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import { DatePickerField as B } from "../../../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
12
|
+
import { useComponentContext as H } from "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { ComboBoxField as K } from "../../../../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
14
|
+
import { Form as M } from "../../../../../Common/Form/Form.js";
|
|
15
|
+
import { useI18n as G } from "../../../../../../i18n/I18n.js";
|
|
16
|
+
import { SelectField as U } from "../../../../../Common/Fields/SelectField/SelectField.js";
|
|
17
|
+
import { RadioGroupField as W } from "../../../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
18
|
+
import { TextInputField as J } from "../../../../../Common/Fields/TextInputField/TextInputField.js";
|
|
19
19
|
const Q = {
|
|
20
20
|
citizen: "statusDescriptions.citizen",
|
|
21
21
|
permanent_resident: "statusDescriptions.permanent_resident",
|
|
@@ -27,8 +27,8 @@ const Q = {
|
|
|
27
27
|
hasDocumentNumber: y,
|
|
28
28
|
isPending: g
|
|
29
29
|
}) => {
|
|
30
|
-
|
|
31
|
-
const { Heading: D, Text: x, Alert: E, Button: z, Link: N } =
|
|
30
|
+
G("Employee.EmploymentEligibility");
|
|
31
|
+
const { Heading: D, Text: x, Alert: E, Button: z, Link: N } = H(), { t: e } = L("Employee.EmploymentEligibility"), [m, a] = I(!!y), r = $({
|
|
32
32
|
resolver: q(k(m)),
|
|
33
33
|
defaultValues: f
|
|
34
34
|
}), { control: l, setValue: u, clearErrors: c } = r, o = d({ control: l, name: "authorizationStatus" }), s = d({ control: l, name: "documentType" }), _ = Object.values(w).map((i) => ({
|
|
@@ -45,7 +45,7 @@ const Q = {
|
|
|
45
45
|
uscis_alien_registration_number: 9,
|
|
46
46
|
form_i94: 11
|
|
47
47
|
};
|
|
48
|
-
return /* @__PURE__ */ t(j, { ...r, children: /* @__PURE__ */ t(
|
|
48
|
+
return /* @__PURE__ */ t(j, { ...r, children: /* @__PURE__ */ t(M, { onSubmit: r.handleSubmit(h), children: /* @__PURE__ */ p(b, { flexDirection: "column", gap: 16, children: [
|
|
49
49
|
/* @__PURE__ */ p(b, { flexDirection: "column", gap: 2, children: [
|
|
50
50
|
/* @__PURE__ */ t(D, { as: "h2", children: e("title") }),
|
|
51
51
|
/* @__PURE__ */ t(x, { variant: "supporting", children: /* @__PURE__ */ t(
|
|
@@ -60,7 +60,7 @@ const Q = {
|
|
|
60
60
|
) })
|
|
61
61
|
] }),
|
|
62
62
|
/* @__PURE__ */ t(
|
|
63
|
-
|
|
63
|
+
U,
|
|
64
64
|
{
|
|
65
65
|
name: "authorizationStatus",
|
|
66
66
|
label: e("select.label"),
|
|
@@ -79,9 +79,9 @@ const Q = {
|
|
|
79
79
|
disableScrollIntoView: !0
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
o === "alien" && /* @__PURE__ */ t(
|
|
82
|
+
o === "alien" && /* @__PURE__ */ t(B, { name: "expirationDate", label: e("expirationDate.label") }),
|
|
83
83
|
F && /* @__PURE__ */ t(
|
|
84
|
-
|
|
84
|
+
W,
|
|
85
85
|
{
|
|
86
86
|
name: "documentType",
|
|
87
87
|
label: e("authorizationDocument.label"),
|
|
@@ -91,7 +91,7 @@ const Q = {
|
|
|
91
91
|
}
|
|
92
92
|
),
|
|
93
93
|
R && n && /* @__PURE__ */ t(
|
|
94
|
-
|
|
94
|
+
J,
|
|
95
95
|
{
|
|
96
96
|
name: "documentNumber",
|
|
97
97
|
label: e(`documentNumber.${n}.label`),
|
|
@@ -102,7 +102,7 @@ const Q = {
|
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
104
|
s === "foreign_passport" && o === "alien" && /* @__PURE__ */ t(
|
|
105
|
-
|
|
105
|
+
K,
|
|
106
106
|
{
|
|
107
107
|
name: "country",
|
|
108
108
|
label: e("country.label"),
|
|
@@ -35,7 +35,9 @@ function P({ employeeId: i, formId: c, className: a }) {
|
|
|
35
35
|
l.Preparer3,
|
|
36
36
|
l.Preparer4
|
|
37
37
|
].filter((p) => p !== void 0);
|
|
38
|
-
return /* @__PURE__ */ e("section", { className: a, children: /* @__PURE__ */ e(C, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(B, { formHookResult: n, children: /* @__PURE__ */ e(w, { onSubmit: () =>
|
|
38
|
+
return /* @__PURE__ */ e("section", { className: a, children: /* @__PURE__ */ e(C, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(B, { formHookResult: n, children: /* @__PURE__ */ e(w, { onSubmit: () => {
|
|
39
|
+
_();
|
|
40
|
+
}, children: /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
39
41
|
/* @__PURE__ */ o("section", { children: [
|
|
40
42
|
/* @__PURE__ */ e(r.Heading, { as: "h2", children: t("title") }),
|
|
41
43
|
/* @__PURE__ */ e(r.Text, { children: /* @__PURE__ */ e(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I9SignatureForm.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.tsx"],"sourcesContent":["import { useTranslation, Trans } from 'react-i18next'\nimport type { AuthorizationStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/i9authorization'\nimport { useI9VerificationGetAuthorization } from '@gusto/embedded-api-v-2025-11-15/react-query/i9VerificationGetAuthorization'\nimport { useSignEmployeeForm, type PreparerFieldGroup } from '../../../shared/useSignEmployeeForm'\nimport styles from './I9SignatureForm.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface I9SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\n/** @internal */\nexport function I9SignatureForm(props: I9SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: I9SignatureFormProps) {\n useI18n('Employee.I9SignatureForm')\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useSignEmployeeForm({ employeeId, formId })\n\n const { data: i9AuthData } = useI9VerificationGetAuthorization({ employeeId })\n const authorizationStatus = i9AuthData?.i9Authorization?.authorizationStatus\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { form, pdfUrl } = hookResult.data\n const { isPending } = hookResult.status\n const { Fields, preparers } = hookResult.form\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleChangeEligibility = () => {\n onEvent(componentEvents.EMPLOYEE_CHANGE_ELIGIBILITY_STATUS)\n }\n\n const handleSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, result.data)\n }\n }\n\n const preparerFieldGroups = [\n Fields.Preparer1,\n Fields.Preparer2,\n Fields.Preparer3,\n Fields.Preparer4,\n ].filter(Group => Group !== undefined)\n\n return (\n <section className={className}>\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={20}>\n <section>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{\n viewFormLink: pdfUrl ? (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ) : (\n <span />\n ),\n }}\n />\n </Components.Text>\n </section>\n\n {authorizationStatus && (\n <EligibilityStatusAlert\n authorizationStatus={authorizationStatus}\n onChangeStatus={handleChangeEligibility}\n />\n )}\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Fields.Signature\n label={t('signatureLabel')}\n description={t('signatureDescription')}\n validationMessages={{ REQUIRED: t('signatureError') }}\n />\n <Fields.ConfirmSignature\n label={t('confirmationLabel')}\n validationMessages={{ REQUIRED: t('confirmationError') }}\n />\n </Flex>\n\n {Fields.UsedPreparer && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.UsedPreparer\n label={t('preparerQuestion')}\n validationMessages={{ REQUIRED: t('preparerQuestionError') }}\n />\n\n {preparerFieldGroups.map((PreparerFields, index) => {\n const isLast = index === preparerFieldGroups.length - 1\n return (\n <Flex flexDirection=\"column\" gap={0} key={index}>\n <div className={styles.preparerAlert}>\n <Components.Alert\n label={t('preparerNote')}\n status=\"info\"\n disableScrollIntoView\n />\n </div>\n <PreparerSection\n PreparerFields={PreparerFields}\n showAddButton={isLast && (preparers?.canAdd ?? false)}\n showRemoveButton={\n isLast &&\n (preparers?.canRemove ?? false) &&\n preparerFieldGroups.length > 1\n }\n onAdd={() => hookResult.actions.addPreparer?.()}\n onRemove={() => hookResult.actions.removePreparer?.()}\n />\n </Flex>\n )\n })}\n </Flex>\n )}\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n\ninterface EligibilityStatusAlertProps {\n authorizationStatus: AuthorizationStatus\n onChangeStatus: () => void\n}\n\nfunction EligibilityStatusAlert({\n authorizationStatus,\n onChangeStatus,\n}: EligibilityStatusAlertProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n\n const alertLabelKeys = {\n citizen: 'eligibilityAlertLabel_citizen',\n permanent_resident: 'eligibilityAlertLabel_permanent_resident',\n noncitizen: 'eligibilityAlertLabel_noncitizen',\n alien: 'eligibilityAlertLabel_alien',\n } as const satisfies Record<AuthorizationStatus, string>\n\n const alertDescriptionKeys = {\n citizen: 'eligibilityAlertDescription_citizen',\n permanent_resident: 'eligibilityAlertDescription_permanent_resident',\n noncitizen: 'eligibilityAlertDescription_noncitizen',\n alien: 'eligibilityAlertDescription_alien',\n } as const satisfies Record<AuthorizationStatus, string>\n\n return (\n <Components.Alert\n status=\"info\"\n label={t(alertLabelKeys[authorizationStatus])}\n disableScrollIntoView\n >\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Text>{t(alertDescriptionKeys[authorizationStatus])}</Components.Text>\n <div>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onChangeStatus}>\n {t('eligibilityAlertChangeStatusCta')}\n </Components.Button>\n </div>\n </Flex>\n </Components.Alert>\n )\n}\n\ninterface PreparerSectionProps {\n PreparerFields: PreparerFieldGroup\n showRemoveButton: boolean\n showAddButton: boolean\n onAdd: () => void\n onRemove: () => void\n}\n\nfunction PreparerSection({\n PreparerFields,\n showRemoveButton,\n showAddButton,\n onAdd,\n onRemove,\n}: PreparerSectionProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h3\">{t('preparerSectionTitle')}</Components.Heading>\n\n <PreparerFields.FirstName\n label={t('preparerFirstNameLabel')}\n validationMessages={{ REQUIRED: t('preparerFirstNameError') }}\n />\n <PreparerFields.LastName\n label={t('preparerLastNameLabel')}\n validationMessages={{ REQUIRED: t('preparerLastNameError') }}\n />\n <PreparerFields.Street1\n label={t('preparerStreet1Label')}\n validationMessages={{ REQUIRED: t('preparerStreet1Error') }}\n />\n <PreparerFields.Street2 label={t('preparerStreet2Label')} />\n <PreparerFields.City\n label={t('preparerCityLabel')}\n validationMessages={{ REQUIRED: t('preparerCityError') }}\n />\n <PreparerFields.State\n label={t('preparerStateLabel')}\n placeholder={t('preparerStatePlaceholder')}\n validationMessages={{ REQUIRED: t('preparerStateError') }}\n getOptionLabel={(abbr: string) => tCommon(`statesHash.${abbr}`, { defaultValue: abbr })}\n />\n <PreparerFields.Zip\n label={t('preparerZipLabel')}\n validationMessages={{ REQUIRED: t('preparerZipError') }}\n />\n <PreparerFields.Signature\n label={t('preparerSignatureLabel')}\n description={t('preparerSignatureDescription')}\n validationMessages={{ REQUIRED: t('preparerSignatureError') }}\n />\n <PreparerFields.ConfirmSignature\n label={t('preparerConfirmationLabel')}\n validationMessages={{ REQUIRED: t('preparerConfirmationError') }}\n />\n\n {(showAddButton || showRemoveButton) && (\n <div className={styles.preparerActions}>\n {showAddButton && (\n <Components.Button type=\"button\" variant=\"secondary\" onClick={onAdd}>\n {t('addPreparerCta')}\n </Components.Button>\n )}\n {showRemoveButton && (\n <Components.Button type=\"button\" variant=\"error\" onClick={onRemove}>\n {t('removePreparerCta')}\n </Components.Button>\n )}\n </div>\n )}\n </Flex>\n )\n}\n"],"names":["I9SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useSignEmployeeForm","i9AuthData","useI9VerificationGetAuthorization","authorizationStatus","BaseLayout","form","pdfUrl","isPending","Fields","preparers","handleBack","componentEvents","handleChangeEligibility","handleSubmit","result","preparerFieldGroups","Group","SDKFormProvider","Form","jsxs","Flex","Trans","EligibilityStatusAlert","DocumentViewer","PreparerFields","index","isLast","styles","PreparerSection","ActionsLayout","onChangeStatus","t","alertLabelKeys","alertDescriptionKeys","showRemoveButton","showAddButton","onAdd","onRemove","tCommon","abbr"],"mappings":";;;;;;;;;;;;;;;;AA0BO,SAASA,GAAgBC,GAAsD;AACpF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAA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A,IAExF,gBAAApD;AAAA,MAACqC,EAAe;AAAA,MAAf;AAAA,QACC,OAAOO,EAAE,kBAAkB;AAAA,QAC3B,oBAAoB,EAAE,UAAUA,EAAE,kBAAkB,EAAA;AAAA,MAAE;AAAA,IAAA;AAAA,IAExD,gBAAA5C;AAAA,MAACqC,EAAe;AAAA,MAAf;AAAA,QACC,OAAOO,EAAE,wBAAwB;AAAA,QACjC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,oBAAoB,EAAE,UAAUA,EAAE,wBAAwB,EAAA;AAAA,MAAE;AAAA,IAAA;AAAA,IAE9D,gBAAA5C;AAAA,MAACqC,EAAe;AAAA,MAAf;AAAA,QACC,OAAOO,EAAE,2BAA2B;AAAA,QACpC,oBAAoB,EAAE,UAAUA,EAAE,2BAA2B,EAAA;AAAA,MAAE;AAAA,IAAA;AAAA,KAG/DI,KAAiBD,MACjB,gBAAAf,EAAC,OAAA,EAAI,WAAWQ,EAAO,iBACpB,UAAA;AAAA,MAAAQ,KACC,gBAAAhD,EAACU,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,aAAY,SAASuC,GAC3D,UAAAL,EAAE,gBAAgB,EAAA,CACrB;AAAA,MAEDG,KACC,gBAAA/C,EAACU,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,SAAQ,SAASwC,GACvD,UAAAN,EAAE,mBAAmB,EAAA,CACxB;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"I9SignatureForm.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.tsx"],"sourcesContent":["import { useTranslation, Trans } from 'react-i18next'\nimport type { AuthorizationStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/i9authorization'\nimport { useI9VerificationGetAuthorization } from '@gusto/embedded-api-v-2025-11-15/react-query/i9VerificationGetAuthorization'\nimport { useSignEmployeeForm, type PreparerFieldGroup } from '../../../shared/useSignEmployeeForm'\nimport styles from './I9SignatureForm.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface I9SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\n/** @internal */\nexport function I9SignatureForm(props: I9SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: I9SignatureFormProps) {\n useI18n('Employee.I9SignatureForm')\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useSignEmployeeForm({ employeeId, formId })\n\n const { data: i9AuthData } = useI9VerificationGetAuthorization({ employeeId })\n const authorizationStatus = i9AuthData?.i9Authorization?.authorizationStatus\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { form, pdfUrl } = hookResult.data\n const { isPending } = hookResult.status\n const { Fields, preparers } = hookResult.form\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleChangeEligibility = () => {\n onEvent(componentEvents.EMPLOYEE_CHANGE_ELIGIBILITY_STATUS)\n }\n\n const handleSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, result.data)\n }\n }\n\n const preparerFieldGroups = [\n Fields.Preparer1,\n Fields.Preparer2,\n Fields.Preparer3,\n Fields.Preparer4,\n ].filter(Group => Group !== undefined)\n\n return (\n <section className={className}>\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={20}>\n <section>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{\n viewFormLink: pdfUrl ? (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ) : (\n <span />\n ),\n }}\n />\n </Components.Text>\n </section>\n\n {authorizationStatus && (\n <EligibilityStatusAlert\n authorizationStatus={authorizationStatus}\n onChangeStatus={handleChangeEligibility}\n />\n )}\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Fields.Signature\n label={t('signatureLabel')}\n description={t('signatureDescription')}\n validationMessages={{ REQUIRED: t('signatureError') }}\n />\n <Fields.ConfirmSignature\n label={t('confirmationLabel')}\n validationMessages={{ REQUIRED: t('confirmationError') }}\n />\n </Flex>\n\n {Fields.UsedPreparer && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.UsedPreparer\n label={t('preparerQuestion')}\n validationMessages={{ REQUIRED: t('preparerQuestionError') }}\n />\n\n {preparerFieldGroups.map((PreparerFields, index) => {\n const isLast = index === preparerFieldGroups.length - 1\n return (\n <Flex flexDirection=\"column\" gap={0} key={index}>\n <div className={styles.preparerAlert}>\n <Components.Alert\n label={t('preparerNote')}\n status=\"info\"\n disableScrollIntoView\n />\n </div>\n <PreparerSection\n PreparerFields={PreparerFields}\n showAddButton={isLast && (preparers?.canAdd ?? false)}\n showRemoveButton={\n isLast &&\n (preparers?.canRemove ?? false) &&\n preparerFieldGroups.length > 1\n }\n onAdd={() => hookResult.actions.addPreparer?.()}\n onRemove={() => hookResult.actions.removePreparer?.()}\n />\n </Flex>\n )\n })}\n </Flex>\n )}\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n\ninterface EligibilityStatusAlertProps {\n authorizationStatus: AuthorizationStatus\n onChangeStatus: () => void\n}\n\nfunction EligibilityStatusAlert({\n authorizationStatus,\n onChangeStatus,\n}: EligibilityStatusAlertProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n\n const alertLabelKeys = {\n citizen: 'eligibilityAlertLabel_citizen',\n permanent_resident: 'eligibilityAlertLabel_permanent_resident',\n noncitizen: 'eligibilityAlertLabel_noncitizen',\n alien: 'eligibilityAlertLabel_alien',\n } as const satisfies Record<AuthorizationStatus, string>\n\n const alertDescriptionKeys = {\n citizen: 'eligibilityAlertDescription_citizen',\n permanent_resident: 'eligibilityAlertDescription_permanent_resident',\n noncitizen: 'eligibilityAlertDescription_noncitizen',\n alien: 'eligibilityAlertDescription_alien',\n } as const satisfies Record<AuthorizationStatus, string>\n\n return (\n <Components.Alert\n status=\"info\"\n label={t(alertLabelKeys[authorizationStatus])}\n disableScrollIntoView\n >\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Text>{t(alertDescriptionKeys[authorizationStatus])}</Components.Text>\n <div>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onChangeStatus}>\n {t('eligibilityAlertChangeStatusCta')}\n </Components.Button>\n </div>\n </Flex>\n </Components.Alert>\n )\n}\n\ninterface PreparerSectionProps {\n PreparerFields: PreparerFieldGroup\n showRemoveButton: boolean\n showAddButton: boolean\n onAdd: () => void\n onRemove: () => void\n}\n\nfunction PreparerSection({\n PreparerFields,\n showRemoveButton,\n showAddButton,\n onAdd,\n onRemove,\n}: PreparerSectionProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h3\">{t('preparerSectionTitle')}</Components.Heading>\n\n <PreparerFields.FirstName\n label={t('preparerFirstNameLabel')}\n validationMessages={{ REQUIRED: t('preparerFirstNameError') }}\n />\n <PreparerFields.LastName\n label={t('preparerLastNameLabel')}\n validationMessages={{ REQUIRED: t('preparerLastNameError') }}\n />\n <PreparerFields.Street1\n label={t('preparerStreet1Label')}\n validationMessages={{ REQUIRED: t('preparerStreet1Error') }}\n />\n <PreparerFields.Street2 label={t('preparerStreet2Label')} />\n <PreparerFields.City\n label={t('preparerCityLabel')}\n validationMessages={{ REQUIRED: t('preparerCityError') }}\n />\n <PreparerFields.State\n label={t('preparerStateLabel')}\n placeholder={t('preparerStatePlaceholder')}\n validationMessages={{ REQUIRED: t('preparerStateError') }}\n getOptionLabel={(abbr: string) => tCommon(`statesHash.${abbr}`, { defaultValue: abbr })}\n />\n <PreparerFields.Zip\n label={t('preparerZipLabel')}\n validationMessages={{ REQUIRED: t('preparerZipError') }}\n />\n <PreparerFields.Signature\n label={t('preparerSignatureLabel')}\n description={t('preparerSignatureDescription')}\n validationMessages={{ REQUIRED: t('preparerSignatureError') }}\n />\n <PreparerFields.ConfirmSignature\n label={t('preparerConfirmationLabel')}\n validationMessages={{ REQUIRED: t('preparerConfirmationError') }}\n />\n\n {(showAddButton || showRemoveButton) && (\n <div className={styles.preparerActions}>\n {showAddButton && (\n <Components.Button type=\"button\" variant=\"secondary\" onClick={onAdd}>\n {t('addPreparerCta')}\n </Components.Button>\n )}\n {showRemoveButton && (\n <Components.Button type=\"button\" variant=\"error\" onClick={onRemove}>\n {t('removePreparerCta')}\n </Components.Button>\n )}\n </div>\n )}\n </Flex>\n )\n}\n"],"names":["I9SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useSignEmployeeForm","i9AuthData","useI9VerificationGetAuthorization","authorizationStatus","BaseLayout","form","pdfUrl","isPending","Fields","preparers","handleBack","componentEvents","handleChangeEligibility","handleSubmit","result","preparerFieldGroups","Group","SDKFormProvider","Form","jsxs","Flex","Trans","EligibilityStatusAlert","DocumentViewer","PreparerFields","index","isLast","styles","PreparerSection","ActionsLayout","onChangeStatus","t","alertLabelKeys","alertDescriptionKeys","showRemoveButton","showAddButton","onAdd","onRemove","tCommon","abbr"],"mappings":";;;;;;;;;;;;;;;;AA0BO,SAASA,GAAgBC,GAAsD;AACpF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,KAAmC;AACrE,EAAAC,EAAQ,0BAA0B;AAClC,QAAM,EAAE,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEbC,IAAaC,EAAoB,EAAE,YAAAV,GAAY,QAAAC,GAAQ,GAEvD,EAAE,MAAMU,EAAA,IAAeC,EAAkC,EAAE,YAAAZ,GAAY,GACvEa,IAAsBF,GAAY,iBAAiB;AAEzD,MAAIF,EAAW;AACb,6BAAQK,GAAA,EAAW,WAAS,IAAC,OAAOL,EAAW,cAAc,QAAQ;AAGvE,QAAM,EAAE,MAAAM,GAAM,QAAAC,EAAA,IAAWP,EAAW,MAC9B,EAAE,WAAAQ,MAAcR,EAAW,QAC3B,EAAE,QAAAS,GAAQ,WAAAC,EAAA,IAAcV,EAAW,MAEnCW,IAAa,MAAM;AACvB,IAAAf,EAAQgB,EAAgB,MAAM;AAAA,EAChC,GAEMC,IAA0B,MAAM;AACpC,IAAAjB,EAAQgB,EAAgB,kCAAkC;AAAA,EAC5D,GAEME,IAAe,YAAY;AAC/B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AW,QAAX,EAAkB,MAAK,UAAS,SAAQ,SAAQ,SAASwC,GACvD,UAAAN,EAAE,mBAAmB,EAAA,CACxB;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -26,7 +26,9 @@ function B({ employeeId: t, formId: f, className: g }) {
|
|
|
26
26
|
const c = await e.actions.onSubmit();
|
|
27
27
|
c && m(u.EMPLOYEE_SIGN_FORM, c.data);
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ o("section", { className: g, children: /* @__PURE__ */ o(d, { error: e.errorHandling.errors, children: /* @__PURE__ */ o(x, { formHookResult: e, children: /* @__PURE__ */ o(k, { onSubmit: () =>
|
|
29
|
+
return /* @__PURE__ */ o("section", { className: g, children: /* @__PURE__ */ o(d, { error: e.errorHandling.errors, children: /* @__PURE__ */ o(x, { formHookResult: e, children: /* @__PURE__ */ o(k, { onSubmit: () => {
|
|
30
|
+
b();
|
|
31
|
+
}, children: /* @__PURE__ */ s(p, { flexDirection: "column", children: [
|
|
30
32
|
/* @__PURE__ */ s("section", { children: [
|
|
31
33
|
/* @__PURE__ */ o(n.Heading, { as: "h2", children: r("signatureFormTitle", { formTitle: i.title }) }),
|
|
32
34
|
a && /* @__PURE__ */ o(n.Text, { children: /* @__PURE__ */ o(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../../src/components/Employee/Documents/shared/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useTranslation, Trans } from 'react-i18next'\nimport { useSignEmployeeForm } from '../useSignEmployeeForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\n/** @internal */\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { t } = useTranslation('Employee.DocumentSigner')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useSignEmployeeForm({ employeeId, formId })\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { form, pdfUrl } = hookResult.data\n const { isPending } = hookResult.status\n const { Fields } = hookResult.form\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, result.data)\n }\n }\n\n return (\n <section className={className}>\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\">\n <section>\n <Components.Heading as=\"h2\">\n {t('signatureFormTitle', { formTitle: form.title })}\n </Components.Heading>\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadPrompt\"\n values={{ description: form.description }}\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n </section>\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadAndReviewInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Fields.Signature\n label={t('signatureFieldLabel')}\n description={t('signatureFieldDescription')}\n validationMessages={{ REQUIRED: t('signatureFieldError') }}\n />\n <Fields.ConfirmSignature\n label={t('confirmSignatureCheckboxLabel')}\n validationMessages={{ REQUIRED: t('confirmSignatureError') }}\n />\n </Flex>\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signFormCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","t","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useSignEmployeeForm","BaseLayout","form","pdfUrl","isPending","Fields","handleBack","componentEvents","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","Trans","DocumentViewer","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAuBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,KAAiC;AACnE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEbC,IAAaC,EAAoB,EAAE,YAAAX,GAAY,QAAAC,GAAQ;AAE7D,MAAIS,EAAW;AACb,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAW,cAAc,QAAQ;AAGvE,QAAM,EAAE,MAAAG,GAAM,QAAAC,EAAA,IAAWJ,EAAW,MAC9B,EAAE,WAAAK,MAAcL,EAAW,QAC3B,EAAE,QAAAM,MAAWN,EAAW,MAExBO,IAAa,MAAM;AACvB,IAAAX,EAAQY,EAAgB,MAAM;AAAA,EAChC,GAEMC,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMV,EAAW,QAAQ,SAAA;AACxC,IAAIU,KACFd,EAAQY,EAAgB,oBAAoBE,EAAO,IAAI;AAAA,EAE3D;AAEA,SACE,gBAAAvB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACe,KAAW,OAAOF,EAAW,cAAc,QAC1C,UAAA,gBAAAb,EAACwB,GAAA,EAAgB,gBAAgBX,GAC/B,UAAA,gBAAAb,EAACyB,GAAA,EAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../../../src/components/Employee/Documents/shared/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useTranslation, Trans } from 'react-i18next'\nimport { useSignEmployeeForm } from '../useSignEmployeeForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\n/** @internal */\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { t } = useTranslation('Employee.DocumentSigner')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useSignEmployeeForm({ employeeId, formId })\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { form, pdfUrl } = hookResult.data\n const { isPending } = hookResult.status\n const { Fields } = hookResult.form\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, result.data)\n }\n }\n\n return (\n <section className={className}>\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\">\n <section>\n <Components.Heading as=\"h2\">\n {t('signatureFormTitle', { formTitle: form.title })}\n </Components.Heading>\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadPrompt\"\n values={{ description: form.description }}\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n </section>\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadAndReviewInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Fields.Signature\n label={t('signatureFieldLabel')}\n description={t('signatureFieldDescription')}\n validationMessages={{ REQUIRED: t('signatureFieldError') }}\n />\n <Fields.ConfirmSignature\n label={t('confirmSignatureCheckboxLabel')}\n validationMessages={{ REQUIRED: t('confirmSignatureError') }}\n />\n </Flex>\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signFormCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","t","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useSignEmployeeForm","BaseLayout","form","pdfUrl","isPending","Fields","handleBack","componentEvents","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","Trans","DocumentViewer","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAuBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,KAAiC;AACnE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEbC,IAAaC,EAAoB,EAAE,YAAAX,GAAY,QAAAC,GAAQ;AAE7D,MAAIS,EAAW;AACb,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAW,cAAc,QAAQ;AAGvE,QAAM,EAAE,MAAAG,GAAM,QAAAC,EAAA,IAAWJ,EAAW,MAC9B,EAAE,WAAAK,MAAcL,EAAW,QAC3B,EAAE,QAAAM,MAAWN,EAAW,MAExBO,IAAa,MAAM;AACvB,IAAAX,EAAQY,EAAgB,MAAM;AAAA,EAChC,GAEMC,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMV,EAAW,QAAQ,SAAA;AACxC,IAAIU,KACFd,EAAQY,EAAgB,oBAAoBE,EAAO,IAAI;AAAA,EAE3D;AAEA,SACE,gBAAAvB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACe,KAAW,OAAOF,EAAW,cAAc,QAC1C,UAAA,gBAAAb,EAACwB,GAAA,EAAgB,gBAAgBX,GAC/B,UAAA,gBAAAb,EAACyB,GAAA,EAAK,UAAU,MAAA;AAAM,IAAKH;KACzB,UAAA,gBAAAI,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAA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C7D,GACF;AAAA,sBAECuB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAA9B,EAACW,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASS,GAC3D,UAAAb,EAAE,SAAS,EAAA,CACd;AAAA,MACA,gBAAAP,EAACW,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWO,GACzC,UAAAX,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF,GACF,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { CheckboxHookField as t } from "../../../../../partner-hook-utils/form/fields/CheckboxHookField.js";
|
|
3
2
|
import { TextInputHookField as n } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
4
|
-
import { RadioGroupHookField as p } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
5
3
|
import { SelectHookField as a } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
4
|
+
import { CheckboxHookField as t } from "../../../../../partner-hook-utils/form/fields/CheckboxHookField.js";
|
|
5
|
+
import { RadioGroupHookField as p } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
6
6
|
function c(r) {
|
|
7
7
|
return /* @__PURE__ */ e(n, { ...r, name: "signature" });
|
|
8
8
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { createMachine as
|
|
2
|
+
import { createMachine as m } from "robot3";
|
|
3
3
|
import { useMemo as t } from "react";
|
|
4
4
|
import { FederalTaxesCardContextual as i } from "./FederalTaxesComponents.js";
|
|
5
5
|
import { federalTaxesStateMachine as s } from "./federalTaxesStateMachine.js";
|
|
6
6
|
import { Flow as l } from "../../../Flow/Flow.js";
|
|
7
|
-
import { BaseBoundaries as
|
|
8
|
-
import "
|
|
9
|
-
import { useComponentDictionary as c, useI18n as f } from "../../../../i18n/I18n.js";
|
|
7
|
+
import { BaseBoundaries as c } from "../../../Base/Base.js";
|
|
8
|
+
import { useComponentDictionary as p, useI18n as f } from "../../../../i18n/I18n.js";
|
|
10
9
|
function u({ employeeId: e, onEvent: r }) {
|
|
11
10
|
f("Employee.Management.FederalTaxes");
|
|
12
11
|
const o = t(
|
|
13
|
-
() =>
|
|
14
|
-
...
|
|
12
|
+
() => m("card", s, (n) => ({
|
|
13
|
+
...n,
|
|
15
14
|
component: i,
|
|
16
15
|
employeeId: e,
|
|
17
16
|
successAlert: null
|
|
@@ -20,13 +19,13 @@ function u({ employeeId: e, onEvent: r }) {
|
|
|
20
19
|
);
|
|
21
20
|
return /* @__PURE__ */ a(l, { machine: o, onEvent: r });
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function C({
|
|
24
23
|
dictionary: e,
|
|
25
24
|
FallbackComponent: r,
|
|
26
25
|
...o
|
|
27
26
|
}) {
|
|
28
|
-
return
|
|
29
|
-
|
|
27
|
+
return p("Employee.Management.FederalTaxes", e), /* @__PURE__ */ a(
|
|
28
|
+
c,
|
|
30
29
|
{
|
|
31
30
|
componentName: "Employee.Management.FederalTaxes",
|
|
32
31
|
FallbackComponent: r,
|
|
@@ -35,6 +34,6 @@ function E({
|
|
|
35
34
|
);
|
|
36
35
|
}
|
|
37
36
|
export {
|
|
38
|
-
|
|
37
|
+
C as FederalTaxes
|
|
39
38
|
};
|
|
40
39
|
//# sourceMappingURL=FederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalTaxes.js","sources":["../../../../../src/components/Employee/FederalTaxes/management/FederalTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n FederalTaxesCardContextual,\n type FederalTaxesContextInterface,\n} from './FederalTaxesComponents'\nimport { federalTaxesStateMachine } from './federalTaxesStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link FederalTaxes}.\n *\n * @public\n */\nexport interface FederalTaxesProps extends CommonComponentInterface<'Employee.Management.FederalTaxes'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Callback invoked when the block emits an event. See the events table on {@link FederalTaxes} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction FederalTaxesFlow({ employeeId, onEvent }: FederalTaxesProps) {\n useI18n('Employee.Management.FederalTaxes')\n\n const machine = useMemo(\n () =>\n createMachine('card', federalTaxesStateMachine, (ctx: FederalTaxesContextInterface) => ({\n ...ctx,\n component: FederalTaxesCardContextual,\n employeeId,\n successAlert: null,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and editing an employee's federal tax (W-4) withholdings — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a read-only card showing filing status, multiple-jobs flag, dependents, other income, deductions, and extra withholding, with an Edit CTA that swaps to the edit form. Submitting the form returns to the card; cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link FederalTaxesCard}, {@link FederalTaxesEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, when the card needs to appear read-only with no edit affordance, or when the swap is driven by a router. Using them directly means owning the swap and any cross-component state yourself.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/federalTaxes/card/editRequested` | Fired when the card's Edit CTA is clicked; the block opens the edit form | `{ employeeId: string }` |\n * | `employee/management/federalTaxes/editForm/submitted` | Fired after the edit form is saved; the block returns to the card view | The updated `EmployeeFederalTax` entity |\n * | `employee/management/federalTaxes/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/federalTaxes/alertDismissed` | Fired when the user dismisses an alert above the card | `null` |\n *\n * @param props - See {@link FederalTaxesProps}.\n * @returns The rendered federal taxes block.\n * @public\n * @group Block Components\n */\nexport function FederalTaxes({\n dictionary,\n FallbackComponent,\n ...props\n}: FederalTaxesProps & BaseComponentInterface<'Employee.Management.FederalTaxes'>) {\n useComponentDictionary('Employee.Management.FederalTaxes', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.FederalTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <FederalTaxesFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["FederalTaxesFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","federalTaxesStateMachine","ctx","FederalTaxesCardContextual","jsx","Flow","FederalTaxes","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FederalTaxes.js","sources":["../../../../../src/components/Employee/FederalTaxes/management/FederalTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n FederalTaxesCardContextual,\n type FederalTaxesContextInterface,\n} from './FederalTaxesComponents'\nimport { federalTaxesStateMachine } from './federalTaxesStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link FederalTaxes}.\n *\n * @public\n */\nexport interface FederalTaxesProps extends CommonComponentInterface<'Employee.Management.FederalTaxes'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Callback invoked when the block emits an event. See the events table on {@link FederalTaxes} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction FederalTaxesFlow({ employeeId, onEvent }: FederalTaxesProps) {\n useI18n('Employee.Management.FederalTaxes')\n\n const machine = useMemo(\n () =>\n createMachine('card', federalTaxesStateMachine, (ctx: FederalTaxesContextInterface) => ({\n ...ctx,\n component: FederalTaxesCardContextual,\n employeeId,\n successAlert: null,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and editing an employee's federal tax (W-4) withholdings — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a read-only card showing filing status, multiple-jobs flag, dependents, other income, deductions, and extra withholding, with an Edit CTA that swaps to the edit form. Submitting the form returns to the card; cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link FederalTaxesCard}, {@link FederalTaxesEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, when the card needs to appear read-only with no edit affordance, or when the swap is driven by a router. Using them directly means owning the swap and any cross-component state yourself.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/federalTaxes/card/editRequested` | Fired when the card's Edit CTA is clicked; the block opens the edit form | `{ employeeId: string }` |\n * | `employee/management/federalTaxes/editForm/submitted` | Fired after the edit form is saved; the block returns to the card view | The updated `EmployeeFederalTax` entity |\n * | `employee/management/federalTaxes/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/federalTaxes/alertDismissed` | Fired when the user dismisses an alert above the card | `null` |\n *\n * @param props - See {@link FederalTaxesProps}.\n * @returns The rendered federal taxes block.\n * @public\n * @group Block Components\n */\nexport function FederalTaxes({\n dictionary,\n FallbackComponent,\n ...props\n}: FederalTaxesProps & BaseComponentInterface<'Employee.Management.FederalTaxes'>) {\n useComponentDictionary('Employee.Management.FederalTaxes', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.FederalTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <FederalTaxesFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["FederalTaxesFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","federalTaxesStateMachine","ctx","FederalTaxesCardContextual","jsx","Flow","FederalTaxes","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;AA8BA,SAASA,EAAiB,EAAE,YAAAC,GAAY,SAAAC,KAA8B;AACpE,EAAAC,EAAQ,kCAAkC;AAE1C,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAA0B,CAACC,OAAuC;AAAA,MACtF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,MACA,cAAc;AAAA,IAAA,EACd;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAsBO,SAASU,EAAa;AAAA,EAC3B,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAmF;AACjF,SAAAC,EAAuB,oCAAoCH,CAAU,GAEnE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAkB,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGnC;"}
|
|
@@ -4,13 +4,12 @@ import { FederalTaxesView as f } from "../shared/FederalTaxesView.js";
|
|
|
4
4
|
import { useFederalTaxesForm as x } from "../shared/useFederalTaxesForm/useFederalTaxesForm.js";
|
|
5
5
|
import { useManagementFederalTaxesViewDictionary as M } from "./useViewDictionary.js";
|
|
6
6
|
import { BaseBoundaries as y, BaseLayout as _ } from "../../../Base/Base.js";
|
|
7
|
-
import "../../../Base/useBase.js";
|
|
8
7
|
import { ActionsLayout as g } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
8
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
9
|
import "react";
|
|
11
10
|
import { useI18n as L, useComponentDictionary as C } from "../../../../i18n/I18n.js";
|
|
12
11
|
import { componentEvents as m } from "../../../../shared/constants.js";
|
|
13
|
-
function
|
|
12
|
+
function j({
|
|
14
13
|
FallbackComponent: t,
|
|
15
14
|
...n
|
|
16
15
|
}) {
|
|
@@ -63,6 +62,6 @@ function h({
|
|
|
63
62
|
);
|
|
64
63
|
}
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
j as FederalTaxesEditForm
|
|
67
66
|
};
|
|
68
67
|
//# sourceMappingURL=FederalTaxesEditForm.js.map
|