@gusto/embedded-react-sdk 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Base/Base.js +57 -51
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  5. package/dist/components/Common/UI/ComboBox/ComboBox.js +31 -33
  6. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  7. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  8. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  12. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  14. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  15. package/dist/components/Company/BankAccount/BankAccount.d.ts +2 -2
  16. package/dist/components/Company/BankAccount/BankAccount.js +25 -20
  17. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  18. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +30 -28
  19. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  20. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  21. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  22. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  23. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  24. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +5 -7
  25. package/dist/components/Company/DocumentSigner/DocumentSigner.js +24 -24
  26. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  27. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  28. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  29. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  30. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  31. package/dist/components/Company/Industry/Context.js +7 -6
  32. package/dist/components/Company/Industry/Context.js.map +1 -1
  33. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  34. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  35. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  36. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  37. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  38. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  39. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  40. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  41. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  42. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  43. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  44. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  45. package/dist/components/Contractor/Address/useAddress.js +6 -5
  46. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  47. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  48. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  49. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  50. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  51. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  52. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  53. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  54. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  55. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  56. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  57. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  58. package/dist/components/Employee/Profile/useProfile.js +4 -3
  59. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  60. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  61. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  62. package/dist/style.css +1 -1
  63. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAiBa,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
1
+ {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAiBa,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentMethod.js","sources":["../../../../src/components/Contractor/PaymentMethod/PaymentMethod.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useContractorPaymentMethodGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentMethodGet'\nimport { useContractorPaymentMethodGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/contractorPaymentMethodGetBankAccounts'\nimport { useContractorPaymentMethodsCreateBankAccountMutation } from '@gusto/embedded-api/react-query/contractorPaymentMethodsCreateBankAccount'\nimport { useMemo } from 'react'\nimport z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useContractorPaymentMethodUpdateMutation } from '@gusto/embedded-api/react-query/contractorPaymentMethodUpdate'\nimport type { PaymentMethodProps } from './types'\nimport { BankAccountForm } from './BankAccountForm'\nimport { PaymentTypeForm } from './PaymentTypeForm'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { componentEvents, PAYMENT_METHODS } from '@/shared/constants'\nimport { ActionsLayout } from '@/components/Common/ActionsLayout'\nimport { Flex } from '@/components/Common'\nimport { accountNumberValidation, routingNumberValidation } from '@/helpers/validations'\n\nconst PaymentMethodSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('Direct Deposit'),\n name: z.string().min(1),\n routingNumber: routingNumberValidation,\n accountNumber: z.any(), //Explicitely setting account number as most permissive\n accountType: z.enum(['Checking', 'Savings']),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n])\n\nexport type PaymentMethodSchemaInputs = z.input<typeof PaymentMethodSchema>\nexport type PaymentMethodSchemaOutputs = z.output<typeof PaymentMethodSchema>\n\nexport function PaymentMethod(props: PaymentMethodProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, className, dictionary }: PaymentMethodProps) {\n useComponentDictionary('Contractor.PaymentMethod', dictionary)\n useI18n('Contractor.PaymentMethod')\n const { t } = useTranslation('Contractor.PaymentMethod')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { contractorPaymentMethod },\n } = useContractorPaymentMethodGetSuspense({ contractorUuid: contractorId })\n const paymentMethod = contractorPaymentMethod!\n\n const {\n data: { contractorBankAccountList },\n } = useContractorPaymentMethodGetBankAccountsSuspense({\n contractorUuid: contractorId,\n })\n const bankAccount = contractorBankAccountList?.[0] || undefined\n\n const { mutateAsync: updatePaymentMethod, isPending: paymentMethodPending } =\n useContractorPaymentMethodUpdateMutation()\n const { mutateAsync: createBankAccount, isPending: bankAccountPending } =\n useContractorPaymentMethodsCreateBankAccountMutation()\n\n const defaultValues = useMemo(\n () => ({\n type: paymentMethod.type || PAYMENT_METHODS.check,\n name: bankAccount?.name || '',\n routingNumber: bankAccount?.routingNumber || '',\n accountNumber: bankAccount?.hiddenAccountNumber || '',\n accountType: bankAccount?.accountType || 'Checking',\n }),\n [paymentMethod, bankAccount],\n )\n\n const formMethods = useForm({\n resolver: zodResolver(PaymentMethodSchema),\n defaultValues: defaultValues,\n })\n\n const watchedType = useWatch({ control: formMethods.control, name: 'type' })\n\n const onSubmit: SubmitHandler<PaymentMethodSchemaInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n let permitBankSubmission = true\n if (payload.type === PAYMENT_METHODS.directDeposit) {\n /** Custom validation logic for accountNumber - because masked account value is used as default value, it is only validated when any of the bank-related fields are modified*/\n const { name, accountNumber, routingNumber, accountType } = payload\n if (\n name !== bankAccount?.name ||\n routingNumber !== bankAccount.routingNumber ||\n accountType !== bankAccount.accountType ||\n accountNumber !== bankAccount.hiddenAccountNumber\n ) {\n const res = accountNumberValidation.safeParse(payload.accountNumber)\n if (!res.success) {\n formMethods.setError('accountNumber', { type: 'validate' })\n return\n }\n } else {\n //Edgecase: bank fields are untouched, but we don't want to resubmit with masked account number\n permitBankSubmission = false\n }\n }\n const paymentMethodResponse = await updatePaymentMethod({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n type: payload.type,\n\n version: paymentMethod.version as string,\n },\n },\n })\n onEvent(componentEvents.CONTRACTOR_PAYMENT_METHOD_UPDATED, paymentMethodResponse)\n\n //This update has to follow payment method update because it changes version of paymentMethod\n if (payload.type === PAYMENT_METHODS.directDeposit && permitBankSubmission) {\n const bankAccountResponse = await createBankAccount({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n name: payload.name,\n routingNumber: payload.routingNumber,\n accountNumber: payload.accountNumber,\n accountType: payload.accountType,\n },\n },\n })\n onEvent(componentEvents.CONTRACTOR_BANK_ACCOUNT_CREATED, bankAccountResponse)\n }\n onEvent(componentEvents.CONTRACTOR_PAYMENT_METHOD_DONE)\n })\n }\n\n const showBankAccountForm = watchedType === PAYMENT_METHODS.directDeposit\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex gap={32} flexDirection={'column'}>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <PaymentTypeForm />\n <hr />\n {showBankAccountForm && <BankAccountForm bankAccount={bankAccount} />}\n <ActionsLayout>\n <Components.Button\n type=\"submit\"\n variant=\"primary\"\n isDisabled={paymentMethodPending || bankAccountPending}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["PaymentMethodSchema","z","routingNumberValidation","PaymentMethod","props","jsx","BaseComponent","Root","contractorId","className","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","contractorPaymentMethod","useContractorPaymentMethodGetSuspense","paymentMethod","contractorBankAccountList","useContractorPaymentMethodGetBankAccountsSuspense","bankAccount","updatePaymentMethod","paymentMethodPending","useContractorPaymentMethodUpdateMutation","createBankAccount","bankAccountPending","useContractorPaymentMethodsCreateBankAccountMutation","defaultValues","useMemo","PAYMENT_METHODS","formMethods","useForm","zodResolver","watchedType","useWatch","onSubmit","data","payload","permitBankSubmission","name","accountNumber","routingNumber","accountType","accountNumberValidation","paymentMethodResponse","componentEvents","bankAccountResponse","showBankAccountForm","FormProvider","Form","jsxs","Flex","PaymentTypeForm","BankAccountForm","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,KAAsBC,EAAE,mBAAmB,QAAQ;AAAA,EACvDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,IACtB,eAAeC;AAAA,IACf,eAAeD,EAAE,IAAI;AAAA;AAAA,IACrB,aAAaA,EAAE,KAAK,CAAC,YAAY,SAAS,CAAC;AAAA,EAAA,CAC5C;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EACxB,CAAA;AACH,CAAC;AAKM,SAASE,GAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,GAAK,EAAE,cAAAC,GAAc,WAAAC,GAAW,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,4BAA4BD,CAAU,GAC7DE,EAAQ,0BAA0B;AAClC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,MAAM,EAAE,yBAAAC,EAAwB;AAAA,EAC9B,IAAAC,EAAsC,EAAE,gBAAgBb,GAA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A,EAAA,GACF,EAAA,CACF,EACF,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PaymentMethod.js","sources":["../../../../src/components/Contractor/PaymentMethod/PaymentMethod.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useContractorPaymentMethodGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentMethodGet'\nimport { useContractorPaymentMethodGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/contractorPaymentMethodGetBankAccounts'\nimport { useContractorPaymentMethodsCreateBankAccountMutation } from '@gusto/embedded-api/react-query/contractorPaymentMethodsCreateBankAccount'\nimport { useMemo } from 'react'\nimport z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useContractorPaymentMethodUpdateMutation } from '@gusto/embedded-api/react-query/contractorPaymentMethodUpdate'\nimport type { PaymentMethodProps } from './types'\nimport { BankAccountForm } from './BankAccountForm'\nimport { PaymentTypeForm } from './PaymentTypeForm'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { componentEvents, PAYMENT_METHODS } from '@/shared/constants'\nimport { ActionsLayout } from '@/components/Common/ActionsLayout'\nimport { Flex } from '@/components/Common'\nimport { accountNumberValidation, routingNumberValidation } from '@/helpers/validations'\n\nconst PaymentMethodSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('Direct Deposit'),\n name: z.string().min(1),\n routingNumber: routingNumberValidation,\n accountNumber: z.any(), //Explicitely setting account number as most permissive\n accountType: z.enum(['Checking', 'Savings']),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n])\n\nexport type PaymentMethodSchemaInputs = z.input<typeof PaymentMethodSchema>\nexport type PaymentMethodSchemaOutputs = z.output<typeof PaymentMethodSchema>\n\nexport function PaymentMethod(props: PaymentMethodProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, className, dictionary }: PaymentMethodProps) {\n useComponentDictionary('Contractor.PaymentMethod', dictionary)\n useI18n('Contractor.PaymentMethod')\n const { t } = useTranslation('Contractor.PaymentMethod')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { contractorPaymentMethod },\n } = useContractorPaymentMethodGetSuspense({ contractorUuid: contractorId })\n const paymentMethod = contractorPaymentMethod!\n\n const {\n data: { contractorBankAccountList },\n } = useContractorPaymentMethodGetBankAccountsSuspense({\n contractorUuid: contractorId,\n })\n const bankAccount = contractorBankAccountList?.[0] || undefined\n\n const { mutateAsync: updatePaymentMethod, isPending: paymentMethodPending } =\n useContractorPaymentMethodUpdateMutation()\n const { mutateAsync: createBankAccount, isPending: bankAccountPending } =\n useContractorPaymentMethodsCreateBankAccountMutation()\n\n const defaultValues = useMemo(\n () => ({\n type: paymentMethod.type || PAYMENT_METHODS.check,\n name: bankAccount?.name || '',\n routingNumber: bankAccount?.routingNumber || '',\n accountNumber: bankAccount?.hiddenAccountNumber || '',\n accountType: bankAccount?.accountType || 'Checking',\n }),\n [paymentMethod, bankAccount],\n )\n\n const formMethods = useForm({\n resolver: zodResolver(PaymentMethodSchema),\n defaultValues: defaultValues,\n })\n\n const watchedType = useWatch({ control: formMethods.control, name: 'type' })\n const onSubmit: SubmitHandler<PaymentMethodSchemaInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n let permitBankSubmission = true\n\n if (payload.type === PAYMENT_METHODS.directDeposit) {\n /** Custom validation logic for accountNumber - because masked account value is used as default value, it is only validated when any of the bank-related fields are modified*/\n const { name, accountNumber, routingNumber, accountType } = payload\n if (\n name !== bankAccount?.name ||\n routingNumber !== bankAccount.routingNumber ||\n accountType !== bankAccount.accountType ||\n accountNumber !== bankAccount.hiddenAccountNumber\n ) {\n const res = accountNumberValidation.safeParse(payload.accountNumber)\n if (!res.success) {\n formMethods.setError('accountNumber', { type: 'validate' })\n return\n }\n } else {\n //Edgecase: bank fields are untouched, but we don't want to resubmit with masked account number\n permitBankSubmission = false\n }\n }\n const paymentMethodResponse = await updatePaymentMethod({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n type: payload.type,\n\n version: paymentMethod.version as string,\n },\n },\n })\n onEvent(componentEvents.CONTRACTOR_PAYMENT_METHOD_UPDATED, paymentMethodResponse)\n\n //This update has to follow payment method update because it changes version of paymentMethod\n if (payload.type === PAYMENT_METHODS.directDeposit && permitBankSubmission) {\n const bankAccountResponse = await createBankAccount({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n name: payload.name,\n routingNumber: payload.routingNumber,\n accountNumber: payload.accountNumber,\n accountType: payload.accountType,\n },\n },\n })\n onEvent(componentEvents.CONTRACTOR_BANK_ACCOUNT_CREATED, bankAccountResponse)\n }\n onEvent(componentEvents.CONTRACTOR_PAYMENT_METHOD_DONE)\n })\n }\n\n const showBankAccountForm = watchedType === PAYMENT_METHODS.directDeposit\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex gap={32} flexDirection={'column'}>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <PaymentTypeForm />\n <hr />\n {showBankAccountForm && <BankAccountForm bankAccount={bankAccount} />}\n <ActionsLayout>\n <Components.Button\n type=\"submit\"\n variant=\"primary\"\n isDisabled={paymentMethodPending || bankAccountPending}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["PaymentMethodSchema","z","routingNumberValidation","PaymentMethod","props","jsx","BaseComponent","Root","contractorId","className","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","contractorPaymentMethod","useContractorPaymentMethodGetSuspense","paymentMethod","contractorBankAccountList","useContractorPaymentMethodGetBankAccountsSuspense","bankAccount","updatePaymentMethod","paymentMethodPending","useContractorPaymentMethodUpdateMutation","createBankAccount","bankAccountPending","useContractorPaymentMethodsCreateBankAccountMutation","defaultValues","useMemo","PAYMENT_METHODS","formMethods","useForm","zodResolver","watchedType","useWatch","onSubmit","data","payload","permitBankSubmission","name","accountNumber","routingNumber","accountType","accountNumberValidation","paymentMethodResponse","componentEvents","bankAccountResponse","showBankAccountForm","FormProvider","Form","jsxs","Flex","PaymentTypeForm","BankAccountForm","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,KAAsBC,EAAE,mBAAmB,QAAQ;AAAA,EACvDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,IACtB,eAAeC;AAAA,IACf,eAAeD,EAAE,IAAI;AAAA;AAAA,IACrB,aAAaA,EAAE,KAAK,CAAC,YAAY,SAAS,CAAC;AAAA,EAAA,CAC5C;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EACxB,CAAA;AACH,CAAC;AAKM,SAASE,GAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,GAAK,EAAE,cAAAC,GAAc,WAAAC,GAAW,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,4BAA4BD,CAAU,GAC7DE,EAAQ,0BAA0B;AAClC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,MAAM,EAAE,yBAAAC,EAAwB;AAAA,EA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AAA,MAAA;AAAA,IAAA,EAEpB,CAAA;AAAA,EAAA,GACF,EAAA,CACF,EACF,CAAA,GACF;AAEJ;"}
@@ -6,12 +6,13 @@ import "react-i18next";
6
6
  import "@gusto/embedded-api/models/errors/apierror";
7
7
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
8
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
+ import "@tanstack/react-query";
9
10
  import "../../Base/useBase.js";
10
11
  import "../../../shared/constants.js";
11
12
  import "dompurify";
12
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
14
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
14
- const f = r.object({
15
+ const x = r.object({
15
16
  active: r.boolean(),
16
17
  amount: r.number().min(0).transform(String),
17
18
  description: r.string().min(1),
@@ -22,10 +23,10 @@ const f = r.object({
22
23
  annualMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
23
24
  payPeriodMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
24
25
  deductAsPercentage: r.string().transform((t) => t === "true")
25
- }), [x, D] = o("DeductionsContext");
26
+ }), [D, S] = o("DeductionsContext");
26
27
  export {
27
- f as DeductionSchema,
28
- D as DeductionsProvider,
29
- x as useDeductions
28
+ x as DeductionSchema,
29
+ S as DeductionsProvider,
30
+ D as useDeductions
30
31
  };
31
32
  //# sourceMappingURL=useDeductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
1
+ {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
@@ -5,14 +5,15 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
13
- const [D, L] = t("DocumentListContext");
14
+ const [L, d] = t("DocumentListContext");
14
15
  export {
15
- L as DocumentListProvider,
16
- D as useDocumentList
16
+ d as DocumentListProvider,
17
+ L as useDocumentList
17
18
  };
18
19
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -5,14 +5,15 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
13
- const [F, S] = o("SignatureFormContext");
14
+ const [S, c] = o("SignatureFormContext");
14
15
  export {
15
- S as SignatureFormProvider,
16
- F as useSignatureForm
16
+ c as SignatureFormProvider,
17
+ S as useSignatureForm
17
18
  };
18
19
  //# sourceMappingURL=useSignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
@@ -5,14 +5,15 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../Base/useBase.js";
9
10
  import "../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
13
- const [E, L] = o("EmployeeListContext");
14
+ const [L, c] = o("EmployeeListContext");
14
15
  export {
15
- L as EmployeeListProvider,
16
- E as useEmployeeList
16
+ c as EmployeeListProvider,
17
+ L as useEmployeeList
17
18
  };
18
19
  //# sourceMappingURL=useEmployeeList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -7,12 +7,13 @@ import "react-i18next";
7
7
  import "@gusto/embedded-api/models/errors/apierror";
8
8
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
9
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
+ import "@tanstack/react-query";
10
11
  import "../../Base/useBase.js";
11
12
  import "../../../shared/constants.js";
12
13
  import "dompurify";
13
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
15
  import { createCompoundContext as a } from "../../Base/createCompoundContext.js";
15
- const j = t.union([
16
+ const B = t.union([
16
17
  l.extend({
17
18
  type: t.literal("Direct Deposit"),
18
19
  isSplit: t.literal(!1)
@@ -52,10 +53,10 @@ const j = t.union([
52
53
  remainder: t.string()
53
54
  })
54
55
  ])
55
- ]), [B, x] = a("PaymentMethodContext");
56
+ ]), [x, S] = a("PaymentMethodContext");
56
57
  export {
57
- j as CombinedSchema,
58
- x as PaymentMethodProvider,
59
- B as usePaymentMethod
58
+ B as CombinedSchema,
59
+ S as PaymentMethodProvider,
60
+ x as usePaymentMethod
60
61
  };
61
62
  //# sourceMappingURL=usePaymentMethod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAMa,MAAAA,IAAiBC,EAAE,MAAM;AAAA,EACpCC,EAAkB,OAAO;AAAA,IACvB,MAAMD,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,EAAA,CACzB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,IACxB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,EAAA,CAChC;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EAAA,CACxB;AAAA,EACDA,EAAE,mBAAmB,WAAW;AAAA,IAC9BA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,YAAY;AAAA,MAC/B,aAAaA,EAAE,OAAOA,EAAE,OAAU,GAAAA,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE;AAAA,QAC5D,CAASE,MAAA,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,MAAM;AAAA,QACvE,CAASF,OAEA;AAAA,UACL,SAAS,gCAFG,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,CAEtB;AAAA,QAChD;AAAA,MAEJ;AAAA,MACA,UAAUJ,EAAE,OAAOA,EAAE,OAAU,GAAAA,EAAE,OAAQ,CAAA;AAAA,IAAA,CAC1C;AAAA,IACDA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,QAAQ;AAAA,MAC3B,UAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAQ,CAAA,EAAE,OAAO,CAASE,MAAA;AACnD,cAAAG,IAAM,OAAO,OAAOH,CAAK;AACxB,eAAAG,EAAI,OAAO,CAACC,GAAMC,MAAUF,EAAI,QAAQC,CAAI,MAAMC,CAAK,EAAE,WAAW;AAAA,MAAA,CAC5E;AAAA,MACD,aAAaP,EAAE,OAAOA,EAAE,OAAO,GAAGA,EAAE,OAAS,EAAA,IAAI,CAAC,EAAE,UAAU;AAAA,MAC9D,WAAWA,EAAE,OAAO;AAAA,IACrB,CAAA;AAAA,EACF,CAAA;AACH,CAAC,GAmBK,CAACQ,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMa,MAAAA,IAAiBC,EAAE,MAAM;AAAA,EACpCC,EAAkB,OAAO;AAAA,IACvB,MAAMD,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,EAAA,CACzB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,IACxB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,EAAA,CAChC;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EAAA,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,IACrB,CAAA;AAAA,EACF,CAAA;AACH,CAAC,GAmBK,CAACQ,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
@@ -5,14 +5,15 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../Base/useBase.js";
9
10
  import "../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
13
- const [c, d] = o("ProfileContext");
14
+ const [d, s] = o("ProfileContext");
14
15
  export {
15
- d as ProfileProvider,
16
- c as useProfile
16
+ s as ProfileProvider,
17
+ d as useProfile
17
18
  };
18
19
  //# sourceMappingURL=useProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
1
+ {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
@@ -5,14 +5,15 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../Base/useBase.js";
9
10
  import "../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
13
- const [c, d] = o("TaxesContext");
14
+ const [d, u] = o("TaxesContext");
14
15
  export {
15
- d as TaxesProvider,
16
- c as useTaxes
16
+ u as TaxesProvider,
17
+ d as useTaxes
17
18
  };
18
19
  //# sourceMappingURL=useTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}
1
+ {"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}