@gusto/embedded-react-sdk 0.28.0 → 0.29.0

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 (282) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/Common/Fields/PercentageField/PercentageField.d.ts +8 -0
  3. package/dist/components/Common/Fields/PercentageField/PercentageField.js +58 -0
  4. package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -0
  5. package/dist/components/Common/Fields/PercentageField/index.d.ts +2 -0
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  7. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -8
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  12. package/dist/components/Common/TaxInputs/TaxInputs.js +125 -98
  13. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  14. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
  15. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  16. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -4
  17. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +17 -16
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -5
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/TitleSelect.js +1 -1
  33. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  34. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  35. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  36. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  37. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  38. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  39. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  41. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  43. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  45. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  46. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  47. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  49. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  50. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  51. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  52. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  53. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  54. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  55. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  56. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  57. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  58. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  59. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  60. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  61. package/dist/components/Company/Industry/Actions.js +7 -8
  62. package/dist/components/Company/Industry/Actions.js.map +1 -1
  63. package/dist/components/Company/Industry/Context.js +6 -8
  64. package/dist/components/Company/Industry/Context.js.map +1 -1
  65. package/dist/components/Company/Industry/Edit.js +2 -3
  66. package/dist/components/Company/Industry/Edit.js.map +1 -1
  67. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  68. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  69. package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
  70. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  71. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  72. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  73. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  74. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  75. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  76. package/dist/components/Company/Locations/LocationsList/List.js +6 -7
  77. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  78. package/dist/components/Company/Locations/LocationsList/LocationsList.js +39 -56
  79. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  81. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  82. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  83. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  84. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  85. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  86. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  87. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  88. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  89. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  90. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  91. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  92. package/dist/components/Company/PaySchedule/_parts/Edit.js +24 -23
  93. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  94. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  95. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  96. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  97. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  98. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
  99. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  100. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  101. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  102. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +60 -67
  103. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  104. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  105. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  106. package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +2 -0
  107. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  108. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  109. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  110. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  111. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  112. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  113. package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +2 -0
  114. package/dist/components/Company/index.d.ts +2 -0
  115. package/dist/components/Company/index.js +21 -17
  116. package/dist/components/Company/index.js.map +1 -1
  117. package/dist/components/Contractor/Address/Address.js +2 -2
  118. package/dist/components/Contractor/Address/Form.js +11 -10
  119. package/dist/components/Contractor/Address/Form.js.map +1 -1
  120. package/dist/components/Contractor/Address/useAddress.js +5 -7
  121. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  122. package/dist/components/Contractor/ContractorList/index.js +17 -17
  123. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +8 -8
  124. package/dist/components/Contractor/ContractorList/useContractorList.js +9 -25
  125. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  126. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -12
  127. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  128. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -2
  129. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -3
  130. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  131. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +23 -22
  132. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  133. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -8
  134. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  135. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
  136. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +1 -0
  137. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +38 -24
  138. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  139. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
  140. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +95 -60
  141. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  142. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  143. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  144. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -7
  145. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  146. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
  147. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  148. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +67 -42
  149. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  150. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +3 -1
  151. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +40 -36
  152. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  153. package/dist/components/Contractor/Payments/types.d.ts +2 -0
  154. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  155. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  156. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  157. package/dist/components/Contractor/Submit/Submit.js +1 -1
  158. package/dist/components/Employee/Compensation/Actions.js +1 -1
  159. package/dist/components/Employee/Compensation/Edit.js +14 -14
  160. package/dist/components/Employee/Compensation/List.js +22 -23
  161. package/dist/components/Employee/Compensation/List.js.map +1 -1
  162. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
  163. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  164. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -13
  165. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  166. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -13
  167. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  168. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  169. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  170. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  171. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  172. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  173. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  174. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  175. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  176. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  177. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  178. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  179. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  180. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  181. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  182. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  183. package/dist/components/Employee/EmployeeList/EmployeeList.js +77 -95
  184. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  185. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  186. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  187. package/dist/components/Employee/EmployeeList/List.js +12 -12
  188. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -5
  189. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  190. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  191. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  192. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -12
  193. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  194. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
  195. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  196. package/dist/components/Employee/Landing/Landing.js +8 -8
  197. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  198. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  199. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  200. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -3
  201. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -6
  202. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -2
  203. package/dist/components/Employee/PaymentMethod/Split.js +9 -9
  204. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
  205. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  206. package/dist/components/Employee/Profile/Actions.js +5 -6
  207. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  208. package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -6
  209. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  210. package/dist/components/Employee/Profile/HomeAddress.js +10 -9
  211. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  212. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +3 -3
  213. package/dist/components/Employee/Profile/useProfile.js +3 -5
  214. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  215. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  216. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  217. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
  218. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  219. package/dist/components/Employee/Taxes/Actions.js +6 -7
  220. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  221. package/dist/components/Employee/Taxes/FederalForm.js +13 -14
  222. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  223. package/dist/components/Employee/Taxes/useTaxes.js +3 -5
  224. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  225. package/dist/components/Flow/Flow.js +2 -3
  226. package/dist/components/Flow/Flow.js.map +1 -1
  227. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -16
  228. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  229. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +4 -4
  230. package/dist/components/InformationRequests/InformationRequests.js +1 -1
  231. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  232. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +11 -12
  233. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -1
  234. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +2 -3
  235. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  236. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
  237. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +3 -2
  238. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  239. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +50 -68
  240. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  241. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +39 -38
  242. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  243. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +17 -18
  244. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  245. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
  246. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  247. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +2 -3
  248. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  249. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  250. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  251. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  252. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  253. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
  254. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  255. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
  256. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -6
  257. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
  258. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  259. package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
  260. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  261. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
  262. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  263. package/dist/helpers/formattedStrings.js +11 -12
  264. package/dist/helpers/formattedStrings.js.map +1 -1
  265. package/dist/helpers/percentageConversion.d.ts +3 -0
  266. package/dist/helpers/percentageConversion.js +27 -0
  267. package/dist/helpers/percentageConversion.js.map +1 -0
  268. package/dist/helpers/percentageConversion.test.d.ts +1 -0
  269. package/dist/hooks/usePagination/usePagination.d.ts +15 -0
  270. package/dist/hooks/usePagination/usePagination.js +37 -0
  271. package/dist/hooks/usePagination/usePagination.js.map +1 -0
  272. package/dist/hooks/usePagination/usePagination.test.d.ts +1 -0
  273. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  274. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +28 -28
  275. package/dist/i18n/en/common.json.d.ts +3 -1
  276. package/dist/i18n/en/common.json.js +1 -1
  277. package/dist/shared/constants.d.ts +2 -0
  278. package/dist/shared/constants.js +11 -10
  279. package/dist/shared/constants.js.map +1 -1
  280. package/dist/style.css +1 -1
  281. package/dist/types/i18next.d.ts +7 -0
  282. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0
4
+
5
+ ### Features & Enhancements
6
+
7
+ - Export StateTaxesList and StateTaxesForm from Company API
8
+ - Add RFI alerts to contractor payment list
9
+
10
+ ### Fixes
11
+
12
+ - Convert state tax percentage inputs from decimal to human-readable format
13
+ - Improve UI of tab component
14
+
15
+ ### Chores & Maintenance
16
+
17
+ - Rewrite contractor onboarding documentation
18
+ - Implement semver-based PR title validation and auto-versioning
19
+ - Switch auto-version workflow to manual dispatch
20
+ - Add reusable pagination hook and refactor components
21
+ - Improve cursor commands for branch creation and PR defaults
22
+ - Bump @storybook/addon-a11y, addon-docs, addon-onboarding, react-vite from 10.2.8 to 10.2.9
23
+ - Bump typescript-eslint from 8.55.0 to 8.56.0
24
+ - Bump i18next from 25.8.5 to 25.8.8
25
+ - Bump react-error-boundary from 6.1.0 to 6.1.1
26
+ - Bump dotenv from 17.2.4 to 17.3.1
27
+
3
28
  ## 0.28.0
4
29
 
5
30
  ### Features & Enhancements
@@ -0,0 +1,8 @@
1
+ import { NumberInputProps } from '../../UI/NumberInput/NumberInputTypes';
2
+ export interface PercentageFieldProps extends Pick<NumberInputProps, 'isDisabled' | 'className' | 'label' | 'isRequired' | 'description' | 'errorMessage'> {
3
+ name: string;
4
+ decimalValue?: string | number | boolean | null;
5
+ decimalMin?: string;
6
+ decimalMax?: string;
7
+ }
8
+ export declare function PercentageField({ decimalValue, decimalMin, decimalMax, ...props }: PercentageFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { jsx as N } from "react/jsx-runtime";
2
+ import { useMemo as d } from "react";
3
+ import { useTranslation as C } from "react-i18next";
4
+ import { useField as F } from "../hooks/useField.js";
5
+ import { useComponentContext as b } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ import { decimalToPercent as u, percentToDecimal as h } from "../../../../helpers/percentageConversion.js";
7
+ function x(t) {
8
+ if (!(t == null || typeof t == "boolean"))
9
+ return String(t);
10
+ }
11
+ function I({
12
+ decimalValue: t,
13
+ decimalMin: o,
14
+ decimalMax: n,
15
+ ...a
16
+ }) {
17
+ const f = b(), { t: i } = C("common"), p = d(() => {
18
+ const r = {};
19
+ if (o !== void 0) {
20
+ const m = parseFloat(o);
21
+ r.min = (s) => {
22
+ const e = Number(s);
23
+ return isNaN(e) ? !0 : e >= m || i("validations.percentageMin", { min: u(o) });
24
+ };
25
+ }
26
+ if (n !== void 0) {
27
+ const m = parseFloat(n);
28
+ r.max = (s) => {
29
+ const e = Number(s);
30
+ return isNaN(e) ? !0 : e <= m || i("validations.percentageMax", { max: u(n) });
31
+ };
32
+ }
33
+ return r;
34
+ }, [o, n, i]), { value: c, onChange: l, ...g } = F({
35
+ ...a,
36
+ defaultValue: x(t),
37
+ rules: { validate: p }
38
+ }), v = (r) => {
39
+ l(h(r));
40
+ };
41
+ return /* @__PURE__ */ N(
42
+ f.NumberInput,
43
+ {
44
+ ...a,
45
+ ...g,
46
+ value: u(c),
47
+ onChange: v,
48
+ min: o ? u(o) : void 0,
49
+ max: n ? u(n) : void 0,
50
+ format: "percent",
51
+ maximumFractionDigits: 4
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ I as PercentageField
57
+ };
58
+ //# sourceMappingURL=PercentageField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PercentageField.js","sources":["../../../../../src/components/Common/Fields/PercentageField/PercentageField.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { useField } from '@/components/Common/Fields/hooks/useField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { decimalToPercent, percentToDecimal } from '@/helpers/percentageConversion'\n\nexport interface PercentageFieldProps extends Pick<\n NumberInputProps,\n 'isDisabled' | 'className' | 'label' | 'isRequired' | 'description' | 'errorMessage'\n> {\n name: string\n decimalValue?: string | number | boolean | null\n decimalMin?: string\n decimalMax?: string\n}\n\nfunction toDefaultString(value?: string | number | boolean | null): string | undefined {\n if (value === null || value === undefined || typeof value === 'boolean') return undefined\n return String(value)\n}\n\nexport function PercentageField({\n decimalValue,\n decimalMin,\n decimalMax,\n ...props\n}: PercentageFieldProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n\n const validationRules = useMemo(() => {\n const rules: Record<string, (value: string) => string | true> = {}\n\n if (decimalMin !== undefined) {\n const minNum = parseFloat(decimalMin)\n rules.min = (value: string) => {\n const num = Number(value)\n if (isNaN(num)) return true\n return (\n num >= minNum || t('validations.percentageMin', { min: decimalToPercent(decimalMin) })\n )\n }\n }\n\n if (decimalMax !== undefined) {\n const maxNum = parseFloat(decimalMax)\n rules.max = (value: string) => {\n const num = Number(value)\n if (isNaN(num)) return true\n return (\n num <= maxNum || t('validations.percentageMax', { max: decimalToPercent(decimalMax) })\n )\n }\n }\n\n return rules\n }, [decimalMin, decimalMax, t])\n\n const { value, onChange, ...fieldProps } = useField({\n ...props,\n defaultValue: toDefaultString(decimalValue),\n rules: { validate: validationRules },\n })\n\n const handleChange = (percentValue: number) => {\n onChange(percentToDecimal(percentValue))\n }\n\n return (\n <Components.NumberInput\n {...props}\n {...fieldProps}\n value={decimalToPercent(value)}\n onChange={handleChange}\n min={decimalMin ? decimalToPercent(decimalMin) : undefined}\n max={decimalMax ? decimalToPercent(decimalMax) : undefined}\n format=\"percent\"\n maximumFractionDigits={4}\n />\n )\n}\n"],"names":["toDefaultString","value","PercentageField","decimalValue","decimalMin","decimalMax","props","Components","useComponentContext","t","useTranslation","validationRules","useMemo","rules","minNum","num","decimalToPercent","maxNum","onChange","fieldProps","useField","handleChange","percentValue","percentToDecimal","jsx"],"mappings":";;;;;;AAiBA,SAASA,EAAgBC,GAA8D;AACrF,MAAI,EAAAA,KAAU,QAA+B,OAAOA,KAAU;AAC9D,WAAO,OAAOA,CAAK;AACrB;AAEO,SAASC,EAAgB;AAAA,EAC9B,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AACvB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAE/BC,IAAkBC,EAAQ,MAAM;AACpC,UAAMC,IAA0D,CAAA;AAEhE,QAAIT,MAAe,QAAW;AAC5B,YAAMU,IAAS,WAAWV,CAAU;AACpC,MAAAS,EAAM,MAAM,CAACZ,MAAkB;AAC7B,cAAMc,IAAM,OAAOd,CAAK;AACxB,eAAI,MAAMc,CAAG,IAAU,KAErBA,KAAOD,KAAUL,EAAE,6BAA6B,EAAE,KAAKO,EAAiBZ,CAAU,GAAG;AAAA,MAEzF;AAAA,IACF;AAEA,QAAIC,MAAe,QAAW;AAC5B,YAAMY,IAAS,WAAWZ,CAAU;AACpC,MAAAQ,EAAM,MAAM,CAACZ,MAAkB;AAC7B,cAAMc,IAAM,OAAOd,CAAK;AACxB,eAAI,MAAMc,CAAG,IAAU,KAErBA,KAAOE,KAAUR,EAAE,6BAA6B,EAAE,KAAKO,EAAiBX,CAAU,GAAG;AAAA,MAEzF;AAAA,IACF;AAEA,WAAOQ;AAAA,EACT,GAAG,CAACT,GAAYC,GAAYI,CAAC,CAAC,GAExB,EAAE,OAAAR,GAAO,UAAAiB,GAAU,GAAGC,EAAA,IAAeC,EAAS;AAAA,IAClD,GAAGd;AAAA,IACH,cAAcN,EAAgBG,CAAY;AAAA,IAC1C,OAAO,EAAE,UAAUQ,EAAA;AAAA,EAAgB,CACpC,GAEKU,IAAe,CAACC,MAAyB;AAC7C,IAAAJ,EAASK,EAAiBD,CAAY,CAAC;AAAA,EACzC;AAEA,SACE,gBAAAE;AAAA,IAACjB,EAAW;AAAA,IAAX;AAAA,MACE,GAAGD;AAAA,MACH,GAAGa;AAAA,MACJ,OAAOH,EAAiBf,CAAK;AAAA,MAC7B,UAAUoB;AAAA,MACV,KAAKjB,IAAaY,EAAiBZ,CAAU,IAAI;AAAA,MACjD,KAAKC,IAAaW,EAAiBX,CAAU,IAAI;AAAA,MACjD,QAAO;AAAA,MACP,uBAAuB;AAAA,IAAA;AAAA,EAAA;AAG7B;"}
@@ -0,0 +1,2 @@
1
+ import "./types/i18next.d.ts"
2
+ export { PercentageField, type PercentageFieldProps } from './PercentageField';
@@ -2,30 +2,29 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { z as o } from "zod";
3
3
  import { useForm as s, FormProvider as a } from "react-hook-form";
4
4
  import { zodResolver as l } from "@hookform/resolvers/zod";
5
- import e from "./SignatureForm.module.scss.js";
5
+ import t from "./SignatureForm.module.scss.js";
6
6
  import { Form as u } from "../Form/Form.js";
7
7
  import { Flex as c } from "../Flex/Flex.js";
8
- import "classnames";
9
- import "../../../shared/constants.js";
10
8
  import "react-i18next";
9
+ import "classnames";
11
10
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
11
  import "react";
13
- const p = o.object({
12
+ const f = o.object({
14
13
  signature: o.string().min(1),
15
14
  confirmSignature: o.literal(!0)
16
- }), f = {
15
+ }), p = {
17
16
  signature: ""
18
17
  };
19
- function V({ onSubmit: m, children: i, formProps: n }) {
20
- const t = s({
21
- resolver: l(p),
22
- defaultValues: f,
18
+ function N({ onSubmit: m, children: i, formProps: n }) {
19
+ const e = s({
20
+ resolver: l(f),
21
+ defaultValues: p,
23
22
  ...n
24
23
  });
25
- return /* @__PURE__ */ r(a, { ...t, children: /* @__PURE__ */ r(u, { onSubmit: t.handleSubmit(m), className: e.container, children: /* @__PURE__ */ r("div", { className: e.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
24
+ return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
26
25
  }
27
26
  export {
28
- V as SignatureForm,
29
- p as SignatureFormSchema
27
+ N as SignatureForm,
28
+ f as SignatureFormSchema
30
29
  };
31
30
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
@@ -1,11 +1,10 @@
1
1
  import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import "../../../shared/constants.js";
2
+ import "react-i18next";
3
3
  import "classnames";
4
4
  import { ActionsLayout as p } from "../ActionsLayout/ActionsLayout.js";
5
- import "react-i18next";
6
5
  import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
6
  import "react";
8
- function y({
7
+ function x({
9
8
  onBack: t,
10
9
  backLabel: r,
11
10
  submitLabel: i,
@@ -18,6 +17,6 @@ function y({
18
17
  ] });
19
18
  }
20
19
  export {
21
- y as SignatureFormActions
20
+ x as SignatureFormActions
22
21
  };
23
22
  //# sourceMappingURL=SignatureFormActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,12 +1,11 @@
1
1
  import { jsxs as n, Fragment as s, jsx as r } from "react/jsx-runtime";
2
- import "../../../shared/constants.js";
3
- import "classnames";
4
- import { TextInputField as p } from "../Fields/TextInputField/TextInputField.js";
5
2
  import "react-i18next";
3
+ import "classnames";
6
4
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
5
  import "react";
8
- import { CheckboxField as a } from "../Fields/CheckboxField/CheckboxField.js";
9
- function b({
6
+ import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
7
+ import { CheckboxField as p } from "../Fields/CheckboxField/CheckboxField.js";
8
+ function F({
10
9
  signatureLabel: e,
11
10
  signatureDescription: i = "",
12
11
  signatureError: t = "",
@@ -15,7 +14,7 @@ function b({
15
14
  }) {
16
15
  return /* @__PURE__ */ n(s, { children: [
17
16
  /* @__PURE__ */ r(
18
- p,
17
+ a,
19
18
  {
20
19
  name: "signature",
21
20
  label: e,
@@ -25,7 +24,7 @@ function b({
25
24
  }
26
25
  ),
27
26
  /* @__PURE__ */ r(
28
- a,
27
+ p,
29
28
  {
30
29
  name: "confirmSignature",
31
30
  isRequired: !0,
@@ -36,6 +35,6 @@ function b({
36
35
  ] });
37
36
  }
38
37
  export {
39
- b as SignatureFormFields
38
+ F as SignatureFormFields
40
39
  };
41
40
  //# sourceMappingURL=SignatureFormFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
@@ -1,178 +1,205 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import b from "dompurify";
3
- import { useTranslation as y } from "react-i18next";
4
- import { SelectField as p } from "../Fields/SelectField/SelectField.js";
5
- import { TextInputField as w } from "../Fields/TextInputField/TextInputField.js";
6
- import { NumberInputField as k } from "../Fields/NumberInputField/NumberInputField.js";
7
- import { RadioGroupField as R } from "../Fields/RadioGroupField/RadioGroupField.js";
8
- import { DatePickerField as _ } from "../Fields/DatePickerField/DatePickerField.js";
9
- import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { useMaskedTransform as D } from "../../../helpers/mask.js";
11
- const T = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
12
- function M({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import k from "dompurify";
3
+ import { useTranslation as D } from "react-i18next";
4
+ import { SelectField as w } from "../Fields/SelectField/SelectField.js";
5
+ import { TextInputField as R } from "../Fields/TextInputField/TextInputField.js";
6
+ import { NumberInputField as x } from "../Fields/NumberInputField/NumberInputField.js";
7
+ import { RadioGroupField as _ } from "../Fields/RadioGroupField/RadioGroupField.js";
8
+ import { DatePickerField as T } from "../Fields/DatePickerField/DatePickerField.js";
9
+ import { PercentageField as b } from "../Fields/PercentageField/PercentageField.js";
10
+ import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { useLocale as C } from "../../../contexts/LocaleProvider/useLocale.js";
12
+ import { useMaskedTransform as I } from "../../../helpers/mask.js";
13
+ import { formatPercentLabel as g } from "../../../helpers/percentageConversion.js";
14
+ const F = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
15
+ function B({
13
16
  questionType: e,
14
- ...t
17
+ ...a
15
18
  }) {
16
19
  switch (e.toLowerCase()) {
17
20
  case "date":
18
- return /* @__PURE__ */ a(I, { ...t });
21
+ return /* @__PURE__ */ t(N, { ...a });
19
22
  case "radio":
20
- return /* @__PURE__ */ a(C, { ...t });
23
+ return /* @__PURE__ */ t(L, { ...a });
21
24
  case "text":
22
25
  case "account_number":
23
- return /* @__PURE__ */ a(d, { ...t });
26
+ return /* @__PURE__ */ t(y, { ...a });
24
27
  case "select":
25
- return /* @__PURE__ */ a(h, { ...t });
28
+ return /* @__PURE__ */ t(E, { ...a });
26
29
  case "number":
27
- return /* @__PURE__ */ a(m, { ...t });
30
+ return /* @__PURE__ */ t(p, { ...a });
28
31
  case "workers_compensation_rate":
29
- return /* @__PURE__ */ a(m, { ...t, isPercent: t.requirement?.metadata?.rateType === "percent" });
32
+ return /* @__PURE__ */ t(p, { ...a, isPercent: a.requirement?.metadata?.rateType === "percent" });
30
33
  case "percent":
31
34
  case "tax_rate":
32
- return /* @__PURE__ */ a(g, { ...t });
35
+ return /* @__PURE__ */ t(S, { ...a });
33
36
  case "currency":
34
- return /* @__PURE__ */ a(m, { ...t, isCurrency: !0 });
37
+ return /* @__PURE__ */ t(p, { ...a, isCurrency: !0 });
35
38
  default:
36
- return /* @__PURE__ */ a(d, { ...t });
39
+ return /* @__PURE__ */ t(y, { ...a });
37
40
  }
38
41
  }
39
- function h({ question: e, requirement: t, isDisabled: l = !1 }) {
40
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, u = e ? e.inputQuestionFormat : t.metadata;
41
- if (!u?.options) throw new Error("Select input must have options");
42
- return r ? /* @__PURE__ */ a(
43
- p,
42
+ function E({ question: e, requirement: a, isDisabled: i = !1 }) {
43
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value, c = e ? e.inputQuestionFormat : a.metadata;
44
+ if (!c?.options) throw new Error("Select input must have options");
45
+ return r ? /* @__PURE__ */ t(
46
+ w,
44
47
  {
45
48
  isRequired: !0,
46
49
  name: r,
47
50
  defaultValue: n,
48
- label: s,
51
+ label: u,
49
52
  description: o,
50
- isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
51
- options: u.options.map((i, c) => ({
52
- value: i.value,
53
- label: i.label
53
+ isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : i,
54
+ options: c.options.map((s, l) => ({
55
+ value: s.value,
56
+ label: s.label
54
57
  }))
55
58
  }
56
59
  ) : null;
57
60
  }
58
- function d({
61
+ function y({
59
62
  question: e,
60
- requirement: t,
61
- isDisabled: l = !1,
63
+ requirement: a,
64
+ isDisabled: i = !1,
62
65
  type: r = "text",
63
- isPercent: s = !1
66
+ isPercent: u = !1
64
67
  }) {
65
- const { key: o, label: n, description: u } = e || t, i = e ? e.answers[0]?.value : t.value, c = t?.metadata?.mask ?? null, f = D(c);
66
- return o ? /* @__PURE__ */ a(
67
- w,
68
+ const { key: o, label: n, description: c } = e || a, s = e ? e.answers[0]?.value : a.value, l = a?.metadata?.mask ?? null, d = I(l);
69
+ return o ? /* @__PURE__ */ t(
70
+ R,
68
71
  {
69
72
  isRequired: !0,
70
73
  name: o,
71
74
  label: n,
72
- defaultValue: i,
73
- description: u,
74
- isDisabled: l,
75
- transform: c ? f : void 0,
76
- placeholder: c || void 0,
75
+ defaultValue: s,
76
+ description: c,
77
+ isDisabled: i,
78
+ transform: l ? d : void 0,
79
+ placeholder: l || void 0,
77
80
  type: r,
78
- adornmentEnd: s ? "%" : void 0
81
+ adornmentEnd: u ? "%" : void 0
79
82
  }
80
83
  ) : null;
81
84
  }
82
- function m({
85
+ function p({
83
86
  question: e,
84
- requirement: t,
85
- isCurrency: l,
87
+ requirement: a,
88
+ isCurrency: i,
86
89
  isPercent: r,
87
- isDisabled: s = !1
90
+ isDisabled: u = !1
88
91
  }) {
89
- const { t: o } = y("common"), { key: n, label: u, description: i } = e || t, c = e ? e.answers[0]?.value : t.value;
92
+ const { t: o } = D("common"), { key: n, label: c, description: s } = e || a, l = e ? e.answers[0]?.value : a.value;
90
93
  if (!n) return null;
91
- const f = t?.metadata?.type === "workers_compensation_rate" && t.metadata.riskClassCode !== void 0 ? `${t.metadata.riskClassCode}: ${t.metadata.riskClassDescription}` : null, v = t?.metadata?.rateType === "currency_per_hour" ? o("inputs.workersCompensationRatePerHourAdornment") : void 0;
92
- return /* @__PURE__ */ a(
93
- k,
94
+ const d = a?.metadata?.type === "workers_compensation_rate" && a.metadata.riskClassCode !== void 0 ? `${a.metadata.riskClassCode}: ${a.metadata.riskClassDescription}` : null, m = a?.metadata?.rateType === "currency_per_hour" ? o("inputs.workersCompensationRatePerHourAdornment") : void 0;
95
+ return /* @__PURE__ */ t(
96
+ x,
94
97
  {
95
98
  isRequired: !0,
96
99
  name: n,
97
- label: u,
98
- description: i ?? f,
99
- defaultValue: typeof c < "u" ? Number(c) : void 0,
100
- format: l ? "currency" : r ? "percent" : "decimal",
101
- isDisabled: s,
100
+ label: c,
101
+ description: s ?? d,
102
+ defaultValue: typeof l < "u" ? Number(l) : void 0,
103
+ format: i ? "currency" : r ? "percent" : "decimal",
104
+ isDisabled: u,
102
105
  maximumFractionDigits: r ? 4 : void 0,
103
- adornmentEnd: v
106
+ adornmentEnd: m
104
107
  }
105
108
  );
106
109
  }
107
- function C({ question: e, requirement: t, isDisabled: l = !1 }) {
108
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, { Text: u } = x(), i = e ? e.inputQuestionFormat : t.metadata;
109
- if (!i?.options) throw new Error(`RadioInput must have options:${JSON.stringify(e)}`);
110
- return r ? /* @__PURE__ */ a(
111
- R,
110
+ function L({ question: e, requirement: a, isDisabled: i = !1 }) {
111
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value, { Text: c } = h(), s = e ? e.inputQuestionFormat : a.metadata;
112
+ if (!s?.options) throw new Error(`RadioInput must have options:${JSON.stringify(e)}`);
113
+ return r ? /* @__PURE__ */ t(
114
+ _,
112
115
  {
113
116
  isRequired: !0,
114
117
  name: r,
115
- isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
116
- description: o && /* @__PURE__ */ a(u, { as: "span", children: /* @__PURE__ */ a(
118
+ isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : i,
119
+ description: o && /* @__PURE__ */ t(c, { as: "span", children: /* @__PURE__ */ t(
117
120
  "span",
118
121
  {
119
- dangerouslySetInnerHTML: { __html: b.sanitize(o, T) }
122
+ dangerouslySetInnerHTML: { __html: k.sanitize(o, F) }
120
123
  }
121
124
  ) }),
122
- label: s,
123
- options: i.options.map((c) => ({
124
- value: c.value,
125
- label: c.label
125
+ label: u,
126
+ options: s.options.map((l) => ({
127
+ value: l.value,
128
+ label: l.label
126
129
  }))
127
130
  }
128
131
  ) : null;
129
132
  }
130
- function I({
133
+ function N({
131
134
  question: e,
132
- requirement: t,
133
- isDisabled: l = !1
135
+ requirement: a,
136
+ isDisabled: i = !1
134
137
  }) {
135
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value;
138
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value;
136
139
  if (typeof n != "string" && typeof n < "u")
137
140
  throw new Error("Expecting value to be string for DateInput");
138
- return r ? /* @__PURE__ */ a(
139
- _,
141
+ return r ? /* @__PURE__ */ t(
142
+ T,
140
143
  {
141
144
  isRequired: !0,
142
145
  name: r,
143
146
  defaultValue: n ? new Date(n) : null,
144
- label: s,
147
+ label: u,
145
148
  description: o,
146
- isDisabled: l
149
+ isDisabled: i
147
150
  }
148
151
  ) : null;
149
152
  }
150
- function g({ requirement: e, question: t, ...l }) {
153
+ function S({ requirement: e, question: a, ...i }) {
154
+ const { locale: r } = C();
151
155
  if (e) {
152
- const { key: r, metadata: s, label: o, description: n } = e, { validation: u } = s || {};
153
- return u?.type === "one_of" ? /* @__PURE__ */ a(
154
- p,
156
+ const { key: s, metadata: l, label: d, description: m } = e, { validation: f } = l || {};
157
+ return f?.type === "one_of" ? /* @__PURE__ */ t(
158
+ w,
155
159
  {
156
160
  isRequired: !0,
157
- name: r || "",
158
- label: o || "",
159
- description: n,
160
- options: u.rates?.map((i) => ({
161
- value: i,
162
- label: i
161
+ name: s || "",
162
+ label: d || "",
163
+ description: m,
164
+ options: f.rates?.map((v) => ({
165
+ value: v,
166
+ label: g(v, r)
163
167
  })) || []
164
168
  }
165
- ) : /* @__PURE__ */ a(d, { requirement: e, ...l, type: "number", isPercent: !0 });
169
+ ) : /* @__PURE__ */ t(
170
+ b,
171
+ {
172
+ isRequired: !0,
173
+ name: s || "",
174
+ label: d || "",
175
+ description: m,
176
+ decimalValue: e.value,
177
+ decimalMin: f?.min,
178
+ decimalMax: f?.max,
179
+ isDisabled: i.isDisabled
180
+ }
181
+ );
166
182
  }
167
- return /* @__PURE__ */ a(d, { question: t, ...l, type: "number", isPercent: !0 });
183
+ const { key: u, label: o, description: n, answers: c } = a;
184
+ return /* @__PURE__ */ t(
185
+ b,
186
+ {
187
+ isRequired: !0,
188
+ name: u || "",
189
+ label: o || "",
190
+ description: n,
191
+ decimalValue: c[0]?.value,
192
+ isDisabled: i.isDisabled
193
+ }
194
+ );
168
195
  }
169
196
  export {
170
- I as DateField,
171
- m as NumberInput,
172
- M as QuestionInput,
173
- C as RadioInput,
174
- h as SelectInput,
175
- g as TaxRateInput,
176
- d as TextInput
197
+ N as DateField,
198
+ p as NumberInput,
199
+ B as QuestionInput,
200
+ L as RadioInput,
201
+ E as SelectInput,
202
+ S as TaxRateInput,
203
+ y as TextInput
177
204
  };
178
205
  //# sourceMappingURL=TaxInputs.js.map