@gusto/embedded-react-sdk 0.52.1 → 0.53.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 (471) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/Base/Base.d.ts +2 -2
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -2
  5. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +42 -43
  6. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  7. package/dist/components/Common/Fields/PercentageField/PercentageField.js +44 -42
  8. package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -1
  9. package/dist/components/Common/UI/Box/Box.js +6 -6
  10. package/dist/components/Common/UI/Box/Box.js.map +1 -1
  11. package/dist/components/Common/UI/Box/Box.module.scss.js +8 -8
  12. package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -1
  13. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  14. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +16 -14
  15. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
  16. package/dist/components/Common/UI/Dialog/Dialog.js +29 -28
  17. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
  18. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  19. package/dist/components/Common/UI/FormBox/FormBox.d.ts +1 -1
  20. package/dist/components/Common/UI/FormBox/FormBox.js +9 -8
  21. package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -1
  22. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +8 -6
  23. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -1
  24. package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +5 -1
  25. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  26. package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -10
  27. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  29. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +18 -21
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -12
  35. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  37. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/Head.js +8 -9
  39. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  41. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
  43. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +20 -21
  45. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  47. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  48. package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -12
  49. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  51. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  53. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
  55. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountForm/Head.js +2 -3
  57. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  58. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  59. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  60. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  61. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  65. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  66. package/dist/components/Company/BankAccount/stateMachine.d.ts +0 -1
  67. package/dist/components/Company/BankAccount/stateMachine.js +33 -35
  68. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  69. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  70. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  71. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -14
  72. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  74. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/stateMachine.d.ts +0 -1
  78. package/dist/components/Company/DocumentSigner/stateMachine.js +27 -29
  79. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  80. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  81. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -10
  83. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  84. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  86. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  87. package/dist/components/Company/Industry/Actions.js +5 -6
  88. package/dist/components/Company/Industry/Actions.js.map +1 -1
  89. package/dist/components/Company/Industry/Context.js +6 -7
  90. package/dist/components/Company/Industry/Context.js.map +1 -1
  91. package/dist/components/Company/Industry/Edit.js +10 -12
  92. package/dist/components/Company/Industry/Edit.js.map +1 -1
  93. package/dist/components/Company/Industry/IndustrySelect.js +6 -8
  94. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  96. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Form.js +4 -6
  98. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -14
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -12
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  108. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  109. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  110. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  111. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -10
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -5
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  116. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  117. package/dist/components/Company/PaySchedule/PayScheduleForm.js +47 -51
  118. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +0 -1
  120. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +26 -28
  121. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +2 -1
  123. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
  125. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +29 -16
  126. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  127. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  128. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  129. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +21 -32
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +67 -75
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +62 -47
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  140. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -0
  141. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -23
  142. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -0
  144. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  145. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +12 -0
  147. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js +36 -0
  148. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js.map +1 -0
  149. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +10 -0
  150. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +110 -0
  151. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -0
  152. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +18 -0
  153. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +55 -0
  154. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -0
  155. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +47 -0
  156. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js +108 -0
  157. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js.map +1 -0
  158. package/dist/components/Company/StateTaxes/TaxRateManagement/context.d.ts +25 -0
  159. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +22 -0
  160. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -0
  161. package/dist/components/Company/StateTaxes/TaxRateManagement/index.d.ts +1 -0
  162. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.d.ts +29 -0
  163. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +34 -0
  164. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -0
  165. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +17 -0
  166. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +24 -0
  167. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -0
  168. package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.d.ts +1 -1
  169. package/dist/components/Company/StateTaxes/shared/applicableIf.js.map +1 -0
  170. package/dist/components/Company/StateTaxes/shared/applicableIf.test.d.ts +1 -0
  171. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.d.ts +19 -0
  172. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js +38 -0
  173. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js.map +1 -0
  174. package/dist/components/Company/StateTaxes/shared/requirementValue.d.ts +2 -0
  175. package/dist/components/Company/StateTaxes/shared/requirementValue.js +7 -0
  176. package/dist/components/Company/StateTaxes/shared/requirementValue.js.map +1 -0
  177. package/dist/components/Company/StateTaxes/shared/rhfKey.d.ts +23 -0
  178. package/dist/components/Company/StateTaxes/shared/rhfKey.js +13 -0
  179. package/dist/components/Company/StateTaxes/shared/rhfKey.js.map +1 -0
  180. package/dist/components/Company/StateTaxes/shared/rhfKey.test.d.ts +1 -0
  181. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -1
  182. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +40 -20
  183. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  184. package/dist/components/Company/exports/companyOnboarding.d.ts +1 -0
  185. package/dist/components/Company/exports/companyOnboarding.js +12 -10
  186. package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
  187. package/dist/components/Contractor/Address/Address.js +83 -76
  188. package/dist/components/Contractor/Address/Address.js.map +1 -1
  189. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +39 -0
  190. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +90 -0
  191. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -0
  192. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +22 -0
  193. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +247 -0
  194. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -0
  195. package/dist/components/Contractor/ContractorList/{index.d.ts → onboarding/ContractorList.d.ts} +3 -3
  196. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js +51 -0
  197. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js.map +1 -0
  198. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +16 -0
  199. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +113 -0
  200. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js.map +1 -0
  201. package/dist/components/Contractor/ContractorList/shared/index.d.ts +1 -0
  202. package/dist/components/Contractor/ContractorList/shared/useContractorList.d.ts +87 -0
  203. package/dist/components/Contractor/ContractorList/shared/useContractorList.js +110 -0
  204. package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -0
  205. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.d.ts +0 -1
  206. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +18 -20
  207. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +1 -1
  208. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +2 -3
  209. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
  210. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +170 -123
  211. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  212. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js +12 -0
  213. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js.map +1 -0
  214. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +40 -39
  215. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -1
  216. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +91 -88
  217. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
  218. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +0 -33
  219. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +77 -86
  220. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
  221. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +1 -1
  222. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  223. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +9 -10
  224. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -1
  225. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  226. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  227. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +162 -251
  228. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  229. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -1
  230. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +2 -2
  231. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -1
  232. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +45 -44
  233. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  234. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
  235. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  236. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
  237. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  238. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +32 -0
  239. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +107 -0
  240. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -0
  241. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.test.d.ts +1 -0
  242. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +6 -7
  243. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
  244. package/dist/components/Contractor/Profile/ContractorProfile.js +63 -57
  245. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  246. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +18 -19
  247. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
  248. package/dist/components/Contractor/Submit/Submit.js +118 -102
  249. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  250. package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
  251. package/dist/components/Contractor/exports/contractorManagement.js +12 -10
  252. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  253. package/dist/components/Contractor/exports/contractorOnboarding.d.ts +1 -1
  254. package/dist/components/Contractor/exports/contractorOnboarding.js +1 -1
  255. package/dist/components/Contractor/shared/useContractorHasSignedW9.d.ts +8 -0
  256. package/dist/components/Contractor/shared/useContractorHasSignedW9.js +10 -0
  257. package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -0
  258. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +32 -33
  259. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
  260. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +2 -3
  261. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
  262. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +6 -7
  263. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  264. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +14 -15
  265. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  266. package/dist/components/Employee/Documents/management/DocumentManager.js +6 -7
  267. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  268. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +6 -7
  269. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  270. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +4 -5
  271. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
  272. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +10 -13
  273. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  274. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +5 -6
  275. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  276. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js +8 -0
  277. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js.map +1 -0
  278. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  279. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  280. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -21
  281. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  282. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
  283. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +5 -4
  284. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  285. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -4
  286. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  287. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -7
  288. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  289. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -12
  290. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
  291. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +15 -16
  292. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
  293. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +6 -7
  294. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
  295. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +11 -12
  296. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
  297. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  298. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +7 -8
  299. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
  300. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
  301. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +29 -23
  302. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
  303. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +26 -20
  304. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
  305. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +133 -99
  306. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
  307. package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js +8 -0
  308. package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js.map +1 -0
  309. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
  310. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +19 -20
  311. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  312. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +92 -86
  313. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  314. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +65 -64
  315. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  316. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +7 -8
  317. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  318. package/dist/components/Employee/Profile/management/ProfileEditForm.js +7 -7
  319. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
  320. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +6 -6
  321. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +1 -0
  322. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  323. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +1 -0
  324. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  325. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +11 -12
  326. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  327. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +9 -10
  328. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
  329. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +6 -7
  330. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
  331. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +44 -45
  332. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
  333. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +23 -22
  334. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  335. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +27 -27
  336. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  337. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -10
  338. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
  339. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
  340. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
  341. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +16 -17
  342. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
  343. package/dist/components/Flow/Flow.js +1 -1
  344. package/dist/components/Flow/FlowHeader.js +3 -4
  345. package/dist/components/Flow/FlowHeader.js.map +1 -1
  346. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +8 -9
  347. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  348. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
  349. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  350. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +37 -37
  351. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  352. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
  353. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  354. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +7 -8
  355. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  356. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
  357. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  358. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
  359. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  360. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
  361. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  362. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +3 -3
  363. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +54 -50
  364. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  365. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +80 -69
  366. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  367. package/dist/components/Payroll/PayrollList/PayrollList.js +20 -18
  368. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  369. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +138 -136
  370. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  371. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -12
  372. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  373. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
  374. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  375. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  376. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
  377. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  378. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -2
  379. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  380. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
  381. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  382. package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
  383. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  384. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -3
  385. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  386. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
  387. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
  388. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +34 -36
  389. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  390. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
  391. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +24 -25
  392. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  393. package/dist/components/index.d.ts +40 -0
  394. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
  395. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +29 -28
  396. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  397. package/dist/contexts/LocaleProvider/useLocale.d.ts +1 -9
  398. package/dist/contexts/LocaleProvider/useLocale.js +5 -15
  399. package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
  400. package/dist/contexts/NonceProvider/index.d.ts +1 -0
  401. package/dist/contexts/NonceProvider/useNonce.d.ts +37 -0
  402. package/dist/contexts/NonceProvider/useNonce.js +7 -0
  403. package/dist/contexts/NonceProvider/useNonce.js.map +1 -0
  404. package/dist/contexts/ThemeProvider/ThemeProvider.js +25 -24
  405. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  406. package/dist/contexts/index.d.ts +1 -0
  407. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +12 -7
  408. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +25 -21
  409. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -1
  410. package/dist/i18n/I18n.js +1 -0
  411. package/dist/i18n/I18n.js.map +1 -1
  412. package/dist/i18n/en/Company.StateTaxes.json.js +6 -4
  413. package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
  414. package/dist/i18n/en/Contractor.Address.json.js +22 -20
  415. package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
  416. package/dist/i18n/en/Contractor.ContractorList.json.js +14 -12
  417. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  418. package/dist/i18n/en/Contractor.ManagementContractorList.json.js +60 -0
  419. package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -0
  420. package/dist/i18n/en/Contractor.Profile.json.js +13 -11
  421. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
  422. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  423. package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js +18 -16
  424. package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js.map +1 -1
  425. package/dist/i18n/en/Employee.Management.PaymentMethodSplitForm.json.js +2 -2
  426. package/dist/i18n/en/Employee.PaymentMethod.json.js +74 -72
  427. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  428. package/dist/i18n/en/Employee.SplitPaymentsFormBody.json.js +2 -2
  429. package/dist/i18n/en/Payroll.PayrollHistory.json.js +8 -8
  430. package/dist/i18n/en/Payroll.PayrollList.json.js +23 -23
  431. package/dist/i18n/types.d.ts +215 -17
  432. package/dist/index.d.ts +6 -3
  433. package/dist/index.js +15 -13
  434. package/dist/index.js.map +1 -1
  435. package/dist/models/external.d.ts +4 -0
  436. package/dist/partner-hook-utils/form/SDKFormProvider.js +39 -24
  437. package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
  438. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +12 -15
  439. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  440. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +16 -19
  441. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  442. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -16
  443. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  444. package/dist/partner-hook-utils/form/fields/SelectHookField.js +12 -15
  445. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  446. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +18 -21
  447. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  448. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +9 -12
  449. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  450. package/dist/partner-hook-utils/form/preprocessors.d.ts +2 -2
  451. package/dist/partner-hook-utils/form/preprocessors.js +8 -7
  452. package/dist/partner-hook-utils/form/preprocessors.js.map +1 -1
  453. package/dist/partner-hook-utils/form/preprocessors.test.d.ts +1 -0
  454. package/dist/shared/constants.d.ts +12 -0
  455. package/dist/shared/constants.js +23 -17
  456. package/dist/shared/constants.js.map +1 -1
  457. package/dist/style.css +1 -1
  458. package/dist/types/Helpers.d.ts +1 -1
  459. package/docs/guides/endpoint-inventory.json +61 -27
  460. package/package.json +19 -17
  461. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +0 -1
  462. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +0 -4
  463. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +0 -5
  464. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +0 -1
  465. package/dist/components/Contractor/ContractorList/index.js +0 -150
  466. package/dist/components/Contractor/ContractorList/index.js.map +0 -1
  467. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +0 -18
  468. package/dist/components/Contractor/ContractorList/useContractorList.js +0 -15
  469. package/dist/components/Contractor/ContractorList/useContractorList.js.map +0 -1
  470. /package/dist/components/Company/StateTaxes/{StateTaxesForm/applicableIf.test.d.ts → TaxRateManagement/toHistoryRows.test.d.ts} +0 -0
  471. /package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.js +0 -0
@@ -1,33 +1,34 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { ErrorBoundary as g } from "react-error-boundary";
3
- import { I18nextProvider as P } from "react-i18next";
4
- import { useEffect as k, useMemo as C } from "react";
5
- import { ComponentsProvider as S } from "../ComponentAdapter/ComponentsProvider.js";
2
+ import { ErrorBoundary as P } from "react-error-boundary";
3
+ import { I18nextProvider as k } from "react-i18next";
4
+ import { useEffect as C, useMemo as S } from "react";
5
+ import { ComponentsProvider as x } from "../ComponentAdapter/ComponentsProvider.js";
6
6
  import { ApiProvider as I } from "../ApiProvider/ApiProvider.js";
7
7
  import { LoadingIndicatorProvider as L } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
8
- import { sanitizeError as x } from "../ObservabilityProvider/sanitization.js";
8
+ import { sanitizeError as z } from "../ObservabilityProvider/sanitization.js";
9
9
  import { SDKI18next as m } from "./SDKI18next.js";
10
- import { InternalError as z } from "../../components/Common/InternalError/InternalError.js";
11
- import "../ComponentAdapter/useComponentContext.js";
12
- import { LocaleProvider as D } from "../LocaleProvider/LocaleProvider.js";
10
+ import { InternalError as D } from "../../components/Common/InternalError/InternalError.js";
11
+ import { LocaleProvider as U } from "../LocaleProvider/LocaleProvider.js";
13
12
  import "../LocaleProvider/useLocale.js";
14
- import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
15
- import { normalizeToSDKError as T } from "../../types/sdkError.js";
16
- import { ObservabilityProvider as w } from "../ObservabilityProvider/ObservabilityProvider.js";
17
- function X(s) {
13
+ import { ThemeProvider as T } from "../ThemeProvider/ThemeProvider.js";
14
+ import { normalizeToSDKError as w } from "../../types/sdkError.js";
15
+ import { NonceContext as A } from "../NonceProvider/useNonce.js";
16
+ import { ObservabilityProvider as B } from "../ObservabilityProvider/ObservabilityProvider.js";
17
+ function Z(l) {
18
18
  const {
19
- children: l,
19
+ children: s,
20
20
  config: r,
21
21
  dictionary: i,
22
22
  lng: n = "en",
23
23
  locale: c = "en-US",
24
24
  currency: d = "USD",
25
25
  theme: p,
26
+ nonce: v,
26
27
  portalContainer: f,
27
- components: v,
28
- LoaderComponent: u,
29
- queryClient: b
30
- } = s;
28
+ components: u,
29
+ LoaderComponent: b,
30
+ queryClient: h
31
+ } = l;
31
32
  if (i)
32
33
  for (const t in i) {
33
34
  const e = t;
@@ -40,33 +41,33 @@ function X(s) {
40
41
  !0
41
42
  );
42
43
  }
43
- k(() => {
44
+ C(() => {
44
45
  (async () => await m.changeLanguage(n))();
45
46
  }, [n]);
46
- const h = C(() => {
47
+ const y = S(() => {
47
48
  if (r.observability?.onError)
48
49
  return (t, e) => {
49
50
  if (!r.observability?.onError) return;
50
- const y = {
51
- ...T(t),
51
+ const E = {
52
+ ...w(t),
52
53
  timestamp: Date.now(),
53
54
  componentStack: e.componentStack ?? void 0
54
- }, E = x(y, r.observability.sanitization);
55
- r.observability.onError(E);
55
+ }, g = z(E, r.observability.sanitization);
56
+ r.observability.onError(g);
56
57
  };
57
58
  }, [r.observability]);
58
- return /* @__PURE__ */ o(S, { value: v, children: /* @__PURE__ */ o(L, { value: u, children: /* @__PURE__ */ o(w, { observability: r.observability, children: /* @__PURE__ */ o(g, { FallbackComponent: z, onError: h, children: /* @__PURE__ */ o(U, { theme: p, portalContainer: f, children: /* @__PURE__ */ o(D, { locale: c, currency: d, children: /* @__PURE__ */ o(P, { i18n: m, children: /* @__PURE__ */ o(
59
+ return /* @__PURE__ */ o(A.Provider, { value: v, children: /* @__PURE__ */ o(x, { value: u, children: /* @__PURE__ */ o(L, { value: b, children: /* @__PURE__ */ o(B, { observability: r.observability, children: /* @__PURE__ */ o(P, { FallbackComponent: D, onError: y, children: /* @__PURE__ */ o(T, { theme: p, portalContainer: f, children: /* @__PURE__ */ o(U, { locale: c, currency: d, children: /* @__PURE__ */ o(k, { i18n: m, children: /* @__PURE__ */ o(
59
60
  I,
60
61
  {
61
62
  url: r.baseUrl,
62
63
  headers: r.headers,
63
64
  hooks: r.hooks,
64
- queryClient: b,
65
- children: l
65
+ queryClient: h,
66
+ children: s
66
67
  }
67
- ) }, n) }) }) }) }) }) });
68
+ ) }, n) }) }) }) }) }) }) });
68
69
  }
69
70
  export {
70
- X as GustoProviderCustomUIAdapter
71
+ Z as GustoProviderCustomUIAdapter
71
72
  };
72
73
  //# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /** Element to use as the portal container for SDK popovers and dropdowns. Useful when rendering inside a modal or shadow root. */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","portalContainer","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;;AA0FO,SAASA,EAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEX;AAEJ,MAAIG;AACF,eAAWS,KAAYT,GAAY;AACjC,YAAMU,IAAOD;AACb,iBAAWE,KAAMX,EAAWU,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCX,EAAWU,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAGF,EAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeX,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC;AAER,QAAMa,IAAsBC,EAAQ,MAAM;AACxC,QAAKhB,EAAO,eAAe;AAE3B,aAAO,CAACiB,GAAgBC,MAAyB;AAC/C,YAAI,CAAClB,EAAO,eAAe,QAAS;AAIpC,cAAMmB,IAAqB;AAAA,UACzB,GAHeC,EAAoBH,CAAK;AAAA,UAIxC,WAAW,KAAK,IAAA;AAAA,UAChB,gBAAgBC,EAAU,kBAAkB;AAAA,QAAA,GAGxCG,IAAiBC,EAAcH,GAAoBnB,EAAO,cAAc,YAAY;AAE1F,QAAAA,EAAO,cAAc,QAAQqB,CAAc;AAAA,MAC7C;AAAA,EACF,GAAG,CAACrB,EAAO,aAAa,CAAC;AACzB,SACE,gBAAAuB,EAACC,GAAA,EAAmB,OAAOjB,GACzB,UAAA,gBAAAgB,EAACE,GAAA,EAAyB,OAAOjB,GAC/B,UAAA,gBAAAe,EAACG,GAAA,EAAsB,eAAe1B,EAAO,eAC3C,UAAA,gBAAAuB,EAACI,GAAA,EAAc,mBAAmBC,GAAe,SAASb,GACxD,UAAA,gBAAAQ,EAACM,GAAA,EAAc,OAAAxB,GAAc,iBAAAC,GAC3B,UAAA,gBAAAiB,EAACO,GAAA,EAAe,QAAA3B,GAAgB,UAAAC,GAC9B,UAAA,gBAAAmB,EAACQ,GAAA,EAAgB,MAAMlB,GACrB,UAAA,gBAAAU;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,KAAKhC,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAS;AAAA,MAEC,UAAAV;AAAA,IAAA;AAAA,EAAA,KAPmCG,CASxC,GACF,GACF,EAAA,CACF,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { NonceContext } from '@/contexts/NonceProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /**\n * CSP nonce to apply to runtime-injected `<style>` elements (theming, PDF download window).\n * Pass the same per-request nonce your app uses in its `style-src 'nonce-…'` directive.\n * Also exposed to custom UI components via `useNonce`.\n */\n nonce?: string\n /** Element to use as the portal container for SDK popovers and dropdowns. Useful when rendering inside a modal or shadow root. */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n nonce,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <NonceContext.Provider value={nonce}>\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n </NonceContext.Provider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","nonce","portalContainer","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","NonceContext","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;;AAiGO,SAASA,EAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEZ;AAEJ,MAAIG;AACF,eAAWU,KAAYV,GAAY;AACjC,YAAMW,IAAOD;AACb,iBAAWE,KAAMZ,EAAWW,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCZ,EAAWW,CAAI,EAA8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
@@ -13,7 +13,7 @@ export interface LocaleProps {
13
13
  currency?: string;
14
14
  }
15
15
  /**
16
- * React context backing {@link useLocale} and {@link useLocaleDateFormatter}.
16
+ * React context backing {@link useLocale}.
17
17
  *
18
18
  * @internal
19
19
  */
@@ -39,11 +39,3 @@ export declare const useLocale: () => {
39
39
  locale: string;
40
40
  currency: string;
41
41
  };
42
- /**
43
- * Returns an `Intl.DateTimeFormat` configured with the active locale and a long-month, numeric-year, two-digit-day style.
44
- *
45
- * @returns An `Intl.DateTimeFormat` instance bound to the provider's locale (or `en-US` if unset).
46
- * @throws An `Error` when called outside a {@link LocaleProvider}.
47
- * @internal
48
- */
49
- export declare const useLocaleDateFormatter: () => Intl.DateTimeFormat;
@@ -1,25 +1,15 @@
1
- import { createContext as t, useContext as o } from "react";
2
- const r = t(null), a = () => {
3
- const e = o(r);
1
+ import { createContext as o, useContext as r } from "react";
2
+ const t = o(null), n = () => {
3
+ const e = r(t);
4
4
  if (!e)
5
5
  throw new Error("useLocal used outside provider");
6
6
  return {
7
7
  locale: e.locale ?? "en-US",
8
8
  currency: e.currency ?? "USD"
9
9
  };
10
- }, c = () => {
11
- const e = o(r);
12
- if (!e)
13
- throw new Error("useLocaleDateFormatter used outside provider");
14
- return new Intl.DateTimeFormat(e.locale ?? "en-US", {
15
- year: "numeric",
16
- month: "long",
17
- day: "2-digit"
18
- });
19
10
  };
20
11
  export {
21
- r as LocaleContext,
22
- a as useLocale,
23
- c as useLocaleDateFormatter
12
+ t as LocaleContext,
13
+ n as useLocale
24
14
  };
25
15
  //# sourceMappingURL=useLocale.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.js","sources":["../../../src/contexts/LocaleProvider/useLocale.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * Locale and currency settings supplied to {@link LocaleProvider}.\n *\n * @remarks\n * `locale` is a BCP 47 language tag (defaults to `en-US`) used for `Intl` formatting and the\n * rendered wrapper's `lang` attribute. `currency` is an ISO 4217 currency code (defaults to\n * `USD`) consumed by currency-aware inputs.\n *\n * @internal\n */\nexport interface LocaleProps {\n locale?: string\n currency?: string\n}\n\n/**\n * React context backing {@link useLocale} and {@link useLocaleDateFormatter}.\n *\n * @internal\n */\nexport const LocaleContext = createContext<LocaleProps | null>(null)\n\n/**\n * Returns the active locale and currency from the surrounding {@link LocaleProvider}.\n *\n * @returns An object with `locale` (defaulting to `en-US`) and `currency` (defaulting to `USD`).\n * @throws An `Error` when called outside a {@link LocaleProvider}.\n * @internal\n *\n * @example\n * ```tsx\n * import { useLocale } from '@gusto/embedded-react-sdk'\n *\n * function Amount({ value }: { value: number }) {\n * const { locale, currency } = useLocale()\n * return <span>{new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)}</span>\n * }\n * ```\n */\nexport const useLocale = () => {\n const values = useContext(LocaleContext)\n if (!values) {\n throw new Error('useLocal used outside provider')\n }\n return {\n locale: values.locale ?? 'en-US',\n currency: values.currency ?? 'USD',\n }\n}\n/**\n * Returns an `Intl.DateTimeFormat` configured with the active locale and a long-month, numeric-year, two-digit-day style.\n *\n * @returns An `Intl.DateTimeFormat` instance bound to the provider's locale (or `en-US` if unset).\n * @throws An `Error` when called outside a {@link LocaleProvider}.\n * @internal\n */\nexport const useLocaleDateFormatter = () => {\n const values = useContext(LocaleContext)\n if (!values) {\n throw new Error('useLocaleDateFormatter used outside provider')\n }\n return new Intl.DateTimeFormat(values.locale ?? 'en-US', {\n year: 'numeric',\n month: 'long',\n day: '2-digit',\n })\n}\n"],"names":["LocaleContext","createContext","useLocale","values","useContext","useLocaleDateFormatter"],"mappings":";AAsBO,MAAMA,IAAgBC,EAAkC,IAAI,GAmBtDC,IAAY,MAAM;AAC7B,QAAMC,IAASC,EAAWJ,CAAa;AACvC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,gCAAgC;AAElD,SAAO;AAAA,IACL,QAAQA,EAAO,UAAU;AAAA,IACzB,UAAUA,EAAO,YAAY;AAAA,EAAA;AAEjC,GAQaE,IAAyB,MAAM;AAC1C,QAAMF,IAASC,EAAWJ,CAAa;AACvC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8CAA8C;AAEhE,SAAO,IAAI,KAAK,eAAeA,EAAO,UAAU,SAAS;AAAA,IACvD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EAAA,CACN;AACH;"}
1
+ {"version":3,"file":"useLocale.js","sources":["../../../src/contexts/LocaleProvider/useLocale.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * Locale and currency settings supplied to {@link LocaleProvider}.\n *\n * @remarks\n * `locale` is a BCP 47 language tag (defaults to `en-US`) used for `Intl` formatting and the\n * rendered wrapper's `lang` attribute. `currency` is an ISO 4217 currency code (defaults to\n * `USD`) consumed by currency-aware inputs.\n *\n * @internal\n */\nexport interface LocaleProps {\n locale?: string\n currency?: string\n}\n\n/**\n * React context backing {@link useLocale}.\n *\n * @internal\n */\nexport const LocaleContext = createContext<LocaleProps | null>(null)\n\n/**\n * Returns the active locale and currency from the surrounding {@link LocaleProvider}.\n *\n * @returns An object with `locale` (defaulting to `en-US`) and `currency` (defaulting to `USD`).\n * @throws An `Error` when called outside a {@link LocaleProvider}.\n * @internal\n *\n * @example\n * ```tsx\n * import { useLocale } from '@gusto/embedded-react-sdk'\n *\n * function Amount({ value }: { value: number }) {\n * const { locale, currency } = useLocale()\n * return <span>{new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)}</span>\n * }\n * ```\n */\nexport const useLocale = () => {\n const values = useContext(LocaleContext)\n if (!values) {\n throw new Error('useLocal used outside provider')\n }\n return {\n locale: values.locale ?? 'en-US',\n currency: values.currency ?? 'USD',\n }\n}\n"],"names":["LocaleContext","createContext","useLocale","values","useContext"],"mappings":";AAsBO,MAAMA,IAAgBC,EAAkC,IAAI,GAmBtDC,IAAY,MAAM;AAC7B,QAAMC,IAASC,EAAWJ,CAAa;AACvC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,gCAAgC;AAElD,SAAO;AAAA,IACL,QAAQA,EAAO,UAAU;AAAA,IACzB,UAAUA,EAAO,YAAY;AAAA,EAAA;AAEjC;"}
@@ -0,0 +1 @@
1
+ export { NonceContext, useNonce } from './useNonce';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * React context backing {@link useNonce}.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const NonceContext: import('react').Context<string | undefined>;
7
+ /**
8
+ * Returns the CSP nonce supplied to {@link GustoProvider}, or `undefined` when none was provided.
9
+ *
10
+ * @remarks
11
+ * Use this when a custom UI component or partner-provided code injects a runtime `<style>` or
12
+ * `<script>` element and the integrating app serves a nonce-based Content Security Policy.
13
+ * Apply the returned value as the `nonce` property on the created element (e.g.
14
+ * `el.nonce = useNonce()`) before appending it to the document.
15
+ *
16
+ * @returns The active nonce, or `undefined` when {@link GustoProvider} was not given a `nonce`.
17
+ * @public
18
+ * @page providers
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * import { useNonce } from '@gusto/embedded-react-sdk'
23
+ *
24
+ * function InjectThemeStyles({ css }: { css: string }) {
25
+ * const nonce = useNonce()
26
+ * useEffect(() => {
27
+ * const el = document.createElement('style')
28
+ * if (nonce) el.nonce = nonce
29
+ * el.textContent = css
30
+ * document.head.appendChild(el)
31
+ * return () => el.remove()
32
+ * }, [css, nonce])
33
+ * return null
34
+ * }
35
+ * ```
36
+ */
37
+ export declare const useNonce: () => string | undefined;
@@ -0,0 +1,7 @@
1
+ import { useContext as o, createContext as t } from "react";
2
+ const e = t(void 0), c = () => o(e);
3
+ export {
4
+ e as NonceContext,
5
+ c as useNonce
6
+ };
7
+ //# sourceMappingURL=useNonce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNonce.js","sources":["../../../src/contexts/NonceProvider/useNonce.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * React context backing {@link useNonce}.\n *\n * @internal\n */\nexport const NonceContext = createContext<string | undefined>(undefined)\n\n/**\n * Returns the CSP nonce supplied to {@link GustoProvider}, or `undefined` when none was provided.\n *\n * @remarks\n * Use this when a custom UI component or partner-provided code injects a runtime `<style>` or\n * `<script>` element and the integrating app serves a nonce-based Content Security Policy.\n * Apply the returned value as the `nonce` property on the created element (e.g.\n * `el.nonce = useNonce()`) before appending it to the document.\n *\n * @returns The active nonce, or `undefined` when {@link GustoProvider} was not given a `nonce`.\n * @public\n * @page providers\n *\n * @example\n * ```tsx\n * import { useNonce } from '@gusto/embedded-react-sdk'\n *\n * function InjectThemeStyles({ css }: { css: string }) {\n * const nonce = useNonce()\n * useEffect(() => {\n * const el = document.createElement('style')\n * if (nonce) el.nonce = nonce\n * el.textContent = css\n * document.head.appendChild(el)\n * return () => el.remove()\n * }, [css, nonce])\n * return null\n * }\n * ```\n */\nexport const useNonce = (): string | undefined => useContext(NonceContext)\n"],"names":["NonceContext","createContext","useNonce","useContext"],"mappings":";AAOO,MAAMA,IAAeC,EAAkC,MAAS,GAgC1DC,IAAW,MAA0BC,EAAWH,CAAY;"}
@@ -1,38 +1,39 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as f, useMemo as a, useEffect as h } from "react";
3
- import { ThemeContext as p } from "./useTheme.js";
4
- import { mergePartnerTheme as C } from "./theme.js";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useRef as a, useCallback as h, useMemo as i, useEffect as p } from "react";
3
+ import { ThemeContext as C } from "./useTheme.js";
4
+ import { mergePartnerTheme as S } from "./theme.js";
5
5
  /* empty css */
6
- const D = ({
7
- theme: n = {},
8
- portalContainer: t,
9
- children: o
6
+ import { useNonce as T } from "../NonceProvider/useNonce.js";
7
+ const g = ({
8
+ theme: o = {},
9
+ portalContainer: r,
10
+ children: n
10
11
  }) => {
11
- const e = u(null), r = u(null), i = f(
12
+ const t = T(), e = a(null), c = a(null), f = h(
12
13
  (d) => {
13
- r.current = t ?? d;
14
+ c.current = r ?? d;
14
15
  },
15
- [t]
16
- ), s = a(
17
- () => C(n),
18
- [n]
19
- ), c = a(
16
+ [r]
17
+ ), s = i(
18
+ () => S(o),
19
+ [o]
20
+ ), m = i(
20
21
  () => `.GSDK{
21
22
  ${l(s).join(`
22
23
  `)}
23
24
  }`,
24
25
  [s]
25
26
  );
26
- return h(() => {
27
- e.current || (e.current = document.createElement("style"), e.current.setAttribute("data-testid", "GSDK"), document.head.appendChild(e.current)), e.current.textContent = c;
28
- }, [c]), /* @__PURE__ */ m(p.Provider, { value: { container: r }, children: /* @__PURE__ */ m("article", { className: "GSDK", "data-testid": "GSDK", ref: i, children: o }) });
29
- }, l = (n, t) => {
30
- const o = [];
31
- for (const [e, r] of Object.entries(n))
32
- typeof r == "object" ? o.push(...l(r, t ? t + "-" + e : e)) : o.push(`--g-${t ? t + "-" + e : e}: ${r};`);
33
- return o;
27
+ return p(() => {
28
+ e.current || (e.current = document.createElement("style"), e.current.setAttribute("data-testid", "GSDK"), t && (e.current.nonce = t), document.head.appendChild(e.current)), e.current.textContent = m;
29
+ }, [m, t]), /* @__PURE__ */ u(C.Provider, { value: { container: c }, children: /* @__PURE__ */ u("article", { className: "GSDK", "data-testid": "GSDK", ref: f, children: n }) });
30
+ }, l = (o, r) => {
31
+ const n = [];
32
+ for (const [t, e] of Object.entries(o))
33
+ typeof e == "object" ? n.push(...l(e, r ? r + "-" + t : t)) : n.push(`--g-${r ? r + "-" + t : t}: ${e};`);
34
+ return n;
34
35
  };
35
36
  export {
36
- D as ThemeProvider
37
+ g as ThemeProvider
37
38
  };
38
39
  //# sourceMappingURL=ThemeProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","sources":["../../../src/contexts/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["import type React from 'react'\nimport { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { ThemeContext } from './useTheme'\nimport { mergePartnerTheme, type GustoSDKTheme } from './theme'\nimport '@/styles/sdk.scss'\n\n/** @internal */\nexport interface ThemeProviderProps {\n /** Partial set of theme tokens that override the SDK defaults. */\n theme?: Partial<GustoSDKTheme>\n /**\n * Element to use as the portal container for all SDK overlays (Select, ComboBox,\n * DatePicker, Menu, etc.). Defaults to the SDK's root article element.\n *\n * Pass `document.body` (or another stable element outside the SDK's container)\n * when your app's scroll or clipping context interferes with overlay positioning.\n */\n portalContainer?: HTMLElement\n /** Subtree rendered inside the SDK's themed root element. */\n children?: React.ReactNode\n}\n\n/** @internal */\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n theme: partnerThemeOverrides = {},\n portalContainer,\n children,\n}) => {\n const GThemeVariables = useRef<HTMLStyleElement | null>(null)\n const portalContainerRef = useRef<HTMLElement | null>(null)\n\n const articleRef = useCallback(\n (el: HTMLElement | null) => {\n portalContainerRef.current = portalContainer ?? el\n },\n [portalContainer],\n )\n\n const mergedTheme = useMemo(\n () => mergePartnerTheme(partnerThemeOverrides),\n [partnerThemeOverrides],\n )\n\n const cssContent = useMemo(\n () => `.GSDK{\\n${parseThemeToCSS(mergedTheme).join('\\n')}\\n}`,\n [mergedTheme],\n )\n\n useEffect(() => {\n if (!GThemeVariables.current) {\n GThemeVariables.current = document.createElement('style')\n GThemeVariables.current.setAttribute('data-testid', 'GSDK')\n document.head.appendChild(GThemeVariables.current)\n }\n\n GThemeVariables.current.textContent = cssContent\n }, [cssContent])\n\n return (\n <ThemeContext.Provider value={{ container: portalContainerRef }}>\n <article className=\"GSDK\" data-testid=\"GSDK\" ref={articleRef}>\n {children}\n </article>\n </ThemeContext.Provider>\n )\n}\n\n/**\n * Recursive flattening of the theme object into css variable format\n */\nconst parseThemeToCSS = (theme: Partial<GustoSDKTheme>, prefix?: string): string[] => {\n const cssProps: string[] = []\n for (const [key, value] of Object.entries(theme)) {\n if (typeof value === 'object') {\n cssProps.push(...parseThemeToCSS(value, prefix ? prefix + '-' + key : key))\n } else {\n cssProps.push(`--g-${prefix ? prefix + '-' + key : key}: ${value};`)\n }\n }\n return cssProps\n}\n"],"names":["ThemeProvider","partnerThemeOverrides","portalContainer","children","GThemeVariables","useRef","portalContainerRef","articleRef","useCallback","el","mergedTheme","useMemo","mergePartnerTheme","cssContent","parseThemeToCSS","useEffect","ThemeContext","jsx","theme","prefix","cssProps","key","value"],"mappings":";;;;;AAuBO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAOC,IAAwB,CAAA;AAAA,EAC/B,iBAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAkBC,EAAgC,IAAI,GACtDC,IAAqBD,EAA2B,IAAI,GAEpDE,IAAaC;AAAA,IACjB,CAACC,MAA2B;AAC1B,MAAAH,EAAmB,UAAUJ,KAAmBO;AAAA,IAClD;AAAA,IACA,CAACP,CAAe;AAAA,EAAA,GAGZQ,IAAcC;AAAA,IAClB,MAAMC,EAAkBX,CAAqB;AAAA,IAC7C,CAACA,CAAqB;AAAA,EAAA,GAGlBY,IAAaF;AAAA,IACjB,MAAM;AAAA,EAAWG,EAAgBJ,CAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA;AAAA,IACxD,CAACA,CAAW;AAAA,EAAA;AAGd,SAAAK,EAAU,MAAM;AACd,IAAKX,EAAgB,YACnBA,EAAgB,UAAU,SAAS,cAAc,OAAO,GACxDA,EAAgB,QAAQ,aAAa,eAAe,MAAM,GAC1D,SAAS,KAAK,YAAYA,EAAgB,OAAO,IAGnDA,EAAgB,QAAQ,cAAcS;AAAA,EACxC,GAAG,CAACA,CAAU,CAAC,qBAGZG,EAAa,UAAb,EAAsB,OAAO,EAAE,WAAWV,EAAA,GACzC,UAAA,gBAAAW,EAAC,WAAA,EAAQ,WAAU,QAAO,eAAY,QAAO,KAAKV,GAC/C,UAAAJ,GACH,GACF;AAEJ,GAKMW,IAAkB,CAACI,GAA+BC,MAA8B;AACpF,QAAMC,IAAqB,CAAA;AAC3B,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQJ,CAAK;AAC7C,IAAI,OAAOI,KAAU,WACnBF,EAAS,KAAK,GAAGN,EAAgBQ,GAAOH,IAASA,IAAS,MAAME,IAAMA,CAAG,CAAC,IAE1ED,EAAS,KAAK,OAAOD,IAASA,IAAS,MAAME,IAAMA,CAAG,KAAKC,CAAK,GAAG;AAGvE,SAAOF;AACT;"}
1
+ {"version":3,"file":"ThemeProvider.js","sources":["../../../src/contexts/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["import type React from 'react'\nimport { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { ThemeContext } from './useTheme'\nimport { mergePartnerTheme, type GustoSDKTheme } from './theme'\nimport { useNonce } from '@/contexts/NonceProvider'\nimport '@/styles/sdk.scss'\n\n/** @internal */\nexport interface ThemeProviderProps {\n /** Partial set of theme tokens that override the SDK defaults. */\n theme?: Partial<GustoSDKTheme>\n /**\n * Element to use as the portal container for all SDK overlays (Select, ComboBox,\n * DatePicker, Menu, etc.). Defaults to the SDK's root article element.\n *\n * Pass `document.body` (or another stable element outside the SDK's container)\n * when your app's scroll or clipping context interferes with overlay positioning.\n */\n portalContainer?: HTMLElement\n /** Subtree rendered inside the SDK's themed root element. */\n children?: React.ReactNode\n}\n\n/** @internal */\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n theme: partnerThemeOverrides = {},\n portalContainer,\n children,\n}) => {\n const nonce = useNonce()\n const GThemeVariables = useRef<HTMLStyleElement | null>(null)\n const portalContainerRef = useRef<HTMLElement | null>(null)\n\n const articleRef = useCallback(\n (el: HTMLElement | null) => {\n portalContainerRef.current = portalContainer ?? el\n },\n [portalContainer],\n )\n\n const mergedTheme = useMemo(\n () => mergePartnerTheme(partnerThemeOverrides),\n [partnerThemeOverrides],\n )\n\n const cssContent = useMemo(\n () => `.GSDK{\\n${parseThemeToCSS(mergedTheme).join('\\n')}\\n}`,\n [mergedTheme],\n )\n\n useEffect(() => {\n if (!GThemeVariables.current) {\n GThemeVariables.current = document.createElement('style')\n GThemeVariables.current.setAttribute('data-testid', 'GSDK')\n if (nonce) GThemeVariables.current.nonce = nonce\n document.head.appendChild(GThemeVariables.current)\n }\n\n GThemeVariables.current.textContent = cssContent\n }, [cssContent, nonce])\n\n return (\n <ThemeContext.Provider value={{ container: portalContainerRef }}>\n <article className=\"GSDK\" data-testid=\"GSDK\" ref={articleRef}>\n {children}\n </article>\n </ThemeContext.Provider>\n )\n}\n\n/**\n * Recursive flattening of the theme object into css variable format\n */\nconst parseThemeToCSS = (theme: Partial<GustoSDKTheme>, prefix?: string): string[] => {\n const cssProps: string[] = []\n for (const [key, value] of Object.entries(theme)) {\n if (typeof value === 'object') {\n cssProps.push(...parseThemeToCSS(value, prefix ? prefix + '-' + key : key))\n } else {\n cssProps.push(`--g-${prefix ? prefix + '-' + key : key}: ${value};`)\n }\n }\n return cssProps\n}\n"],"names":["ThemeProvider","partnerThemeOverrides","portalContainer","children","nonce","useNonce","GThemeVariables","useRef","portalContainerRef","articleRef","useCallback","el","mergedTheme","useMemo","mergePartnerTheme","cssContent","parseThemeToCSS","useEffect","ThemeContext","jsx","theme","prefix","cssProps","key","value"],"mappings":";;;;;;AAwBO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAOC,IAAwB,CAAA;AAAA,EAC/B,iBAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAQC,EAAA,GACRC,IAAkBC,EAAgC,IAAI,GACtDC,IAAqBD,EAA2B,IAAI,GAEpDE,IAAaC;AAAA,IACjB,CAACC,MAA2B;AAC1B,MAAAH,EAAmB,UAAUN,KAAmBS;AAAA,IAClD;AAAA,IACA,CAACT,CAAe;AAAA,EAAA,GAGZU,IAAcC;AAAA,IAClB,MAAMC,EAAkBb,CAAqB;AAAA,IAC7C,CAACA,CAAqB;AAAA,EAAA,GAGlBc,IAAaF;AAAA,IACjB,MAAM;AAAA,EAAWG,EAAgBJ,CAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA;AAAA,IACxD,CAACA,CAAW;AAAA,EAAA;AAGd,SAAAK,EAAU,MAAM;AACd,IAAKX,EAAgB,YACnBA,EAAgB,UAAU,SAAS,cAAc,OAAO,GACxDA,EAAgB,QAAQ,aAAa,eAAe,MAAM,GACtDF,MAAOE,EAAgB,QAAQ,QAAQF,IAC3C,SAAS,KAAK,YAAYE,EAAgB,OAAO,IAGnDA,EAAgB,QAAQ,cAAcS;AAAA,EACxC,GAAG,CAACA,GAAYX,CAAK,CAAC,qBAGnBc,EAAa,UAAb,EAAsB,OAAO,EAAE,WAAWV,EAAA,GACzC,UAAA,gBAAAW,EAAC,WAAA,EAAQ,WAAU,QAAO,eAAY,QAAO,KAAKV,GAC/C,UAAAN,GACH,GACF;AAEJ,GAKMa,IAAkB,CAACI,GAA+BC,MAA8B;AACpF,QAAMC,IAAqB,CAAA;AAC3B,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQJ,CAAK;AAC7C,IAAI,OAAOI,KAAU,WACnBF,EAAS,KAAK,GAAGN,EAAgBQ,GAAOH,IAASA,IAAS,MAAME,IAAMA,CAAG,CAAC,IAE1ED,EAAS,KAAK,OAAOD,IAASA,IAAS,MAAME,IAAMA,CAAG,KAAKC,CAAK,GAAG;AAGvE,SAAOF;AACT;"}
@@ -4,3 +4,4 @@ export type { GustoProviderProps } from './GustoProvider';
4
4
  export type { ComponentsContextType } from './ComponentAdapter/useComponentContext';
5
5
  export * from './ComponentAdapter/componentAdapterTypes';
6
6
  export type { GustoSDKTheme, GustoSDKThemeColors } from './ThemeProvider/theme';
7
+ export { useNonce } from './NonceProvider';
@@ -1,5 +1,7 @@
1
1
  interface UseDateRangeFilterOptions {
2
2
  onFilterChange?: () => void;
3
+ initialStartDate?: Date | null;
4
+ initialEndDate?: Date | null;
3
5
  }
4
6
  interface DateRangeApiParams {
5
7
  startDate?: string;
@@ -12,9 +14,10 @@ interface DateRangeApiParams {
12
14
  * @internal
13
15
  */
14
16
  export interface UseDateRangeFilterResult {
15
- filterStartDate: Date | null;
16
- filterEndDate: Date | null;
17
- isFilterActive: boolean;
17
+ startDate: Date | null;
18
+ endDate: Date | null;
19
+ /** True when the current dates differ from the initial dates the hook was seeded with. */
20
+ isModified: boolean;
18
21
  handleStartDateChange: (date: Date | null) => void;
19
22
  handleEndDateChange: (date: Date | null) => void;
20
23
  handleClearFilter: () => void;
@@ -23,12 +26,14 @@ export interface UseDateRangeFilterResult {
23
26
  getMinStartDate: () => Date | undefined;
24
27
  }
25
28
  /**
26
- * Manages an optional start/end date range filter, capping the span at 12 months.
29
+ * Manages a start/end date range filter as a single source of truth, capping the span at 12 months.
27
30
  *
28
31
  * @remarks
29
- * `getMaxEndDate` and `getMinStartDate` return bounds for date pickers that keep the
30
- * selected range within 12 months of the opposite endpoint. `getApiDateParams` returns
31
- * only the dates that are set, formatted as `YYYY-MM-DD` strings for API requests.
32
+ * Seed the hook with `initialStartDate` / `initialEndDate` to render a default range on load;
33
+ * `handleClearFilter` returns to those initial values (not `null`). `getMaxEndDate` and
34
+ * `getMinStartDate` return bounds for date pickers that keep the selected range within
35
+ * 12 months of the opposite endpoint. `getApiDateParams` returns only the dates that are set,
36
+ * formatted as `YYYY-MM-DD` strings for API requests.
32
37
  *
33
38
  * @param options - Optional configuration; `onFilterChange` fires after any filter mutation.
34
39
  * @returns The current filter state and handlers — see {@link UseDateRangeFilterResult}.
@@ -1,38 +1,42 @@
1
- import { useState as s } from "react";
2
- const o = 12, D = (a) => a.toISOString().split("T")[0], c = (a, r) => {
3
- const t = new Date(a);
4
- return t.setMonth(t.getMonth() + r), t;
1
+ import { useRef as f, useState as c } from "react";
2
+ import { formatDateToStringDate as S } from "../../helpers/dateFormatting.js";
3
+ const D = 12, l = (r) => S(r) ?? "", u = (r, s) => {
4
+ const o = new Date(r);
5
+ return o.setMonth(o.getMonth() + s), o;
5
6
  };
6
- function C(a) {
7
- const { onFilterChange: r } = a ?? {}, [t, l] = s(null), [n, i] = s(null);
7
+ function x(r) {
8
+ const { onFilterChange: s, initialStartDate: o = null, initialEndDate: g = null } = r ?? {}, e = f({
9
+ start: o,
10
+ end: g
11
+ }), [n, i] = c(e.current.start), [a, d] = c(e.current.end), h = n !== e.current.start || a !== e.current.end;
8
12
  return {
9
- filterStartDate: t,
10
- filterEndDate: n,
11
- isFilterActive: t !== null || n !== null,
12
- handleStartDateChange: (e) => {
13
- l(e), r?.();
13
+ startDate: n,
14
+ endDate: a,
15
+ isModified: h,
16
+ handleStartDateChange: (t) => {
17
+ i(t), s?.();
14
18
  },
15
- handleEndDateChange: (e) => {
16
- i(e), r?.();
19
+ handleEndDateChange: (t) => {
20
+ d(t), s?.();
17
21
  },
18
22
  handleClearFilter: () => {
19
- l(null), i(null), r?.();
23
+ i(e.current.start), d(e.current.end), s?.();
20
24
  },
21
25
  getApiDateParams: () => {
22
- const e = {};
23
- return t && (e.startDate = D(t)), n && (e.endDate = D(n)), e;
26
+ const t = {};
27
+ return n && (t.startDate = l(n)), a && (t.endDate = l(a)), t;
24
28
  },
25
29
  getMaxEndDate: () => {
26
- if (t)
27
- return c(t, o);
30
+ if (n)
31
+ return u(n, D);
28
32
  },
29
33
  getMinStartDate: () => {
30
- if (n)
31
- return c(n, -o);
34
+ if (a)
35
+ return u(a, -D);
32
36
  }
33
37
  };
34
38
  }
35
39
  export {
36
- C as useDateRangeFilter
40
+ x as useDateRangeFilter
37
41
  };
38
42
  //# sourceMappingURL=useDateRangeFilter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDateRangeFilter.js","sources":["../../../src/hooks/useDateRangeFilter/useDateRangeFilter.ts"],"sourcesContent":["import { useState } from 'react'\n\nconst MAX_RANGE_MONTHS = 12\n\ninterface UseDateRangeFilterOptions {\n onFilterChange?: () => void\n}\n\ninterface DateRangeApiParams {\n startDate?: string\n endDate?: string\n}\n\n/**\n * Return shape of {@link useDateRangeFilter}, exposing the current filter dates,\n * change handlers, and helpers for date-picker bounds and API query params.\n *\n * @internal\n */\nexport interface UseDateRangeFilterResult {\n filterStartDate: Date | null\n filterEndDate: Date | null\n isFilterActive: boolean\n handleStartDateChange: (date: Date | null) => void\n handleEndDateChange: (date: Date | null) => void\n handleClearFilter: () => void\n getApiDateParams: () => DateRangeApiParams\n getMaxEndDate: () => Date | undefined\n getMinStartDate: () => Date | undefined\n}\n\nconst toISODateString = (date: Date): string => date.toISOString().split('T')[0]!\n\nconst addMonths = (date: Date, months: number): Date => {\n const result = new Date(date)\n result.setMonth(result.getMonth() + months)\n return result\n}\n\n/**\n * Manages an optional start/end date range filter, capping the span at 12 months.\n *\n * @remarks\n * `getMaxEndDate` and `getMinStartDate` return bounds for date pickers that keep the\n * selected range within 12 months of the opposite endpoint. `getApiDateParams` returns\n * only the dates that are set, formatted as `YYYY-MM-DD` strings for API requests.\n *\n * @param options - Optional configuration; `onFilterChange` fires after any filter mutation.\n * @returns The current filter state and handlers — see {@link UseDateRangeFilterResult}.\n * @internal\n */\nexport function useDateRangeFilter(options?: UseDateRangeFilterOptions): UseDateRangeFilterResult {\n const { onFilterChange } = options ?? {}\n\n const [filterStartDate, setFilterStartDate] = useState<Date | null>(null)\n const [filterEndDate, setFilterEndDate] = useState<Date | null>(null)\n\n const isFilterActive = filterStartDate !== null || filterEndDate !== null\n\n const handleStartDateChange = (date: Date | null) => {\n setFilterStartDate(date)\n onFilterChange?.()\n }\n\n const handleEndDateChange = (date: Date | null) => {\n setFilterEndDate(date)\n onFilterChange?.()\n }\n\n const handleClearFilter = () => {\n setFilterStartDate(null)\n setFilterEndDate(null)\n onFilterChange?.()\n }\n\n const getApiDateParams = (): DateRangeApiParams => {\n const params: DateRangeApiParams = {}\n if (filterStartDate) {\n params.startDate = toISODateString(filterStartDate)\n }\n if (filterEndDate) {\n params.endDate = toISODateString(filterEndDate)\n }\n return params\n }\n\n const getMaxEndDate = (): Date | undefined => {\n if (!filterStartDate) return undefined\n return addMonths(filterStartDate, MAX_RANGE_MONTHS)\n }\n\n const getMinStartDate = (): Date | undefined => {\n if (!filterEndDate) return undefined\n return addMonths(filterEndDate, -MAX_RANGE_MONTHS)\n }\n\n return {\n filterStartDate,\n filterEndDate,\n isFilterActive,\n handleStartDateChange,\n handleEndDateChange,\n handleClearFilter,\n getApiDateParams,\n getMaxEndDate,\n getMinStartDate,\n }\n}\n"],"names":["MAX_RANGE_MONTHS","toISODateString","date","addMonths","months","result","useDateRangeFilter","options","onFilterChange","filterStartDate","setFilterStartDate","useState","filterEndDate","setFilterEndDate","params"],"mappings":";AAEA,MAAMA,IAAmB,IA6BnBC,IAAkB,CAACC,MAAuBA,EAAK,cAAc,MAAM,GAAG,EAAE,CAAC,GAEzEC,IAAY,CAACD,GAAYE,MAAyB;AACtD,QAAMC,IAAS,IAAI,KAAKH,CAAI;AAC5B,SAAAG,EAAO,SAASA,EAAO,SAAA,IAAaD,CAAM,GACnCC;AACT;AAcO,SAASC,EAAmBC,GAA+D;AAChG,QAAM,EAAE,gBAAAC,MAAmBD,KAAW,CAAA,GAEhC,CAACE,GAAiBC,CAAkB,IAAIC,EAAsB,IAAI,GAClE,CAACC,GAAeC,CAAgB,IAAIF,EAAsB,IAAI;AAyCpE,SAAO;AAAA,IACL,iBAAAF;AAAA,IACA,eAAAG;AAAA,IACA,gBA1CqBH,MAAoB,QAAQG,MAAkB;AAAA,IA2CnE,uBAzC4B,CAACV,MAAsB;AACnD,MAAAQ,EAAmBR,CAAI,GACvBM,IAAA;AAAA,IACF;AAAA,IAuCE,qBArC0B,CAACN,MAAsB;AACjD,MAAAW,EAAiBX,CAAI,GACrBM,IAAA;AAAA,IACF;AAAA,IAmCE,mBAjCwB,MAAM;AAC9B,MAAAE,EAAmB,IAAI,GACvBG,EAAiB,IAAI,GACrBL,IAAA;AAAA,IACF;AAAA,IA8BE,kBA5BuB,MAA0B;AACjD,YAAMM,IAA6B,CAAA;AACnC,aAAIL,MACFK,EAAO,YAAYb,EAAgBQ,CAAe,IAEhDG,MACFE,EAAO,UAAUb,EAAgBW,CAAa,IAEzCE;AAAA,IACT;AAAA,IAoBE,eAlBoB,MAAwB;AAC5C,UAAKL;AACL,eAAON,EAAUM,GAAiBT,CAAgB;AAAA,IACpD;AAAA,IAgBE,iBAdsB,MAAwB;AAC9C,UAAKY;AACL,eAAOT,EAAUS,GAAe,CAACZ,CAAgB;AAAA,IACnD;AAAA,EAWE;AAEJ;"}
1
+ {"version":3,"file":"useDateRangeFilter.js","sources":["../../../src/hooks/useDateRangeFilter/useDateRangeFilter.ts"],"sourcesContent":["import { useRef, useState } from 'react'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\n\nconst MAX_RANGE_MONTHS = 12\n\ninterface UseDateRangeFilterOptions {\n onFilterChange?: () => void\n initialStartDate?: Date | null\n initialEndDate?: Date | null\n}\n\ninterface DateRangeApiParams {\n startDate?: string\n endDate?: string\n}\n\n/**\n * Return shape of {@link useDateRangeFilter}, exposing the current filter dates,\n * change handlers, and helpers for date-picker bounds and API query params.\n *\n * @internal\n */\nexport interface UseDateRangeFilterResult {\n startDate: Date | null\n endDate: Date | null\n /** True when the current dates differ from the initial dates the hook was seeded with. */\n isModified: boolean\n handleStartDateChange: (date: Date | null) => void\n handleEndDateChange: (date: Date | null) => void\n handleClearFilter: () => void\n getApiDateParams: () => DateRangeApiParams\n getMaxEndDate: () => Date | undefined\n getMinStartDate: () => Date | undefined\n}\n\nconst toISODateString = (date: Date): string => formatDateToStringDate(date) ?? ''\n\nconst addMonths = (date: Date, months: number): Date => {\n const result = new Date(date)\n result.setMonth(result.getMonth() + months)\n return result\n}\n\n/**\n * Manages a start/end date range filter as a single source of truth, capping the span at 12 months.\n *\n * @remarks\n * Seed the hook with `initialStartDate` / `initialEndDate` to render a default range on load;\n * `handleClearFilter` returns to those initial values (not `null`). `getMaxEndDate` and\n * `getMinStartDate` return bounds for date pickers that keep the selected range within\n * 12 months of the opposite endpoint. `getApiDateParams` returns only the dates that are set,\n * formatted as `YYYY-MM-DD` strings for API requests.\n *\n * @param options - Optional configuration; `onFilterChange` fires after any filter mutation.\n * @returns The current filter state and handlers — see {@link UseDateRangeFilterResult}.\n * @internal\n */\nexport function useDateRangeFilter(options?: UseDateRangeFilterOptions): UseDateRangeFilterResult {\n const { onFilterChange, initialStartDate = null, initialEndDate = null } = options ?? {}\n\n const initialRef = useRef<{ start: Date | null; end: Date | null }>({\n start: initialStartDate,\n end: initialEndDate,\n })\n\n const [startDate, setStartDate] = useState<Date | null>(initialRef.current.start)\n const [endDate, setEndDate] = useState<Date | null>(initialRef.current.end)\n\n const isModified = startDate !== initialRef.current.start || endDate !== initialRef.current.end\n\n const handleStartDateChange = (date: Date | null) => {\n setStartDate(date)\n onFilterChange?.()\n }\n\n const handleEndDateChange = (date: Date | null) => {\n setEndDate(date)\n onFilterChange?.()\n }\n\n const handleClearFilter = () => {\n setStartDate(initialRef.current.start)\n setEndDate(initialRef.current.end)\n onFilterChange?.()\n }\n\n const getApiDateParams = (): DateRangeApiParams => {\n const params: DateRangeApiParams = {}\n if (startDate) {\n params.startDate = toISODateString(startDate)\n }\n if (endDate) {\n params.endDate = toISODateString(endDate)\n }\n return params\n }\n\n const getMaxEndDate = (): Date | undefined => {\n if (!startDate) return undefined\n return addMonths(startDate, MAX_RANGE_MONTHS)\n }\n\n const getMinStartDate = (): Date | undefined => {\n if (!endDate) return undefined\n return addMonths(endDate, -MAX_RANGE_MONTHS)\n }\n\n return {\n startDate,\n endDate,\n isModified,\n handleStartDateChange,\n handleEndDateChange,\n handleClearFilter,\n getApiDateParams,\n getMaxEndDate,\n getMinStartDate,\n }\n}\n"],"names":["MAX_RANGE_MONTHS","toISODateString","date","formatDateToStringDate","addMonths","months","result","useDateRangeFilter","options","onFilterChange","initialStartDate","initialEndDate","initialRef","useRef","startDate","setStartDate","useState","endDate","setEndDate","isModified","params"],"mappings":";;AAGA,MAAMA,IAAmB,IAgCnBC,IAAkB,CAACC,MAAuBC,EAAuBD,CAAI,KAAK,IAE1EE,IAAY,CAACF,GAAYG,MAAyB;AACtD,QAAMC,IAAS,IAAI,KAAKJ,CAAI;AAC5B,SAAAI,EAAO,SAASA,EAAO,SAAA,IAAaD,CAAM,GACnCC;AACT;AAgBO,SAASC,EAAmBC,GAA+D;AAChG,QAAM,EAAE,gBAAAC,GAAgB,kBAAAC,IAAmB,MAAM,gBAAAC,IAAiB,KAAA,IAASH,KAAW,CAAA,GAEhFI,IAAaC,EAAiD;AAAA,IAClE,OAAOH;AAAA,IACP,KAAKC;AAAA,EAAA,CACN,GAEK,CAACG,GAAWC,CAAY,IAAIC,EAAsBJ,EAAW,QAAQ,KAAK,GAC1E,CAACK,GAASC,CAAU,IAAIF,EAAsBJ,EAAW,QAAQ,GAAG,GAEpEO,IAAaL,MAAcF,EAAW,QAAQ,SAASK,MAAYL,EAAW,QAAQ;AAuC5F,SAAO;AAAA,IACL,WAAAE;AAAA,IACA,SAAAG;AAAA,IACA,YAAAE;AAAA,IACA,uBAzC4B,CAACjB,MAAsB;AACnD,MAAAa,EAAab,CAAI,GACjBO,IAAA;AAAA,IACF;AAAA,IAuCE,qBArC0B,CAACP,MAAsB;AACjD,MAAAgB,EAAWhB,CAAI,GACfO,IAAA;AAAA,IACF;AAAA,IAmCE,mBAjCwB,MAAM;AAC9B,MAAAM,EAAaH,EAAW,QAAQ,KAAK,GACrCM,EAAWN,EAAW,QAAQ,GAAG,GACjCH,IAAA;AAAA,IACF;AAAA,IA8BE,kBA5BuB,MAA0B;AACjD,YAAMW,IAA6B,CAAA;AACnC,aAAIN,MACFM,EAAO,YAAYnB,EAAgBa,CAAS,IAE1CG,MACFG,EAAO,UAAUnB,EAAgBgB,CAAO,IAEnCG;AAAA,IACT;AAAA,IAoBE,eAlBoB,MAAwB;AAC5C,UAAKN;AACL,eAAOV,EAAUU,GAAWd,CAAgB;AAAA,IAC9C;AAAA,IAgBE,iBAdsB,MAAwB;AAC9C,UAAKiB;AACL,eAAOb,EAAUa,GAAS,CAACjB,CAAgB;AAAA,IAC7C;AAAA,EAWE;AAEJ;"}
package/dist/i18n/I18n.js CHANGED
@@ -25,6 +25,7 @@ const j = "common", s = /* @__PURE__ */ Object.assign({
25
25
  "./en/Contractor.ContractorList.json": () => import("./en/Contractor.ContractorList.json.js").then((e) => e.default),
26
26
  "./en/Contractor.DocumentsList.json": () => import("./en/Contractor.DocumentsList.json.js").then((e) => e.default),
27
27
  "./en/Contractor.Landing.json": () => import("./en/Contractor.Landing.json.js").then((e) => e.default),
28
+ "./en/Contractor.ManagementContractorList.json": () => import("./en/Contractor.ManagementContractorList.json.js").then((e) => e.default),
28
29
  "./en/Contractor.NewHireReport.json": () => import("./en/Contractor.NewHireReport.json.js").then((e) => e.default),
29
30
  "./en/Contractor.OnboardingSummary.json": () => import("./en/Contractor.OnboardingSummary.json.js").then((e) => e.default),
30
31
  "./en/Contractor.PaymentMethod.json": () => import("./en/Contractor.PaymentMethod.json.js").then((e) => e.default),
@@ -1 +1 @@
1
- {"version":3,"file":"I18n.js","sources":["../../src/i18n/I18n.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\nimport { useTranslation } from 'react-i18next'\nimport type { CustomTypeOptions } from 'i18next'\nimport type { Resources } from './types'\nimport { LRUCache } from '@/helpers/LRUCache'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/** @internal */\nexport const defaultNS = 'common'\n\nconst translationLoaders = import.meta.glob<Record<string, string>>('./*/*.json', {\n import: 'default',\n})\n\nfunction resolveTranslationLoader(lng: string | undefined, ns: string) {\n const language = lng ?? 'en'\n const primaryPath = `./${language}/${ns}.json`\n const load =\n translationLoaders[primaryPath as keyof typeof translationLoaders] ??\n translationLoaders[`./en/${ns}.json` as keyof typeof translationLoaders]\n return load\n}\n\n//LRU cache holding requested resources\nconst resourceCache = new LRUCache(50)\n/**\n * Dynamic loading of translation resources - works with Suspence to prevent early access to loadable strings\n *\n * @param lng - resource language\n * @param ns - Namespace/name of the component/resource\n * @returns translation resource\n */\nconst loadResource = ({ lng = 'en', ns }: { ns: string; lng?: string }) => {\n let isLoading = true\n let isError = false\n let resource: Record<string, string>\n\n const importResources = async () => {\n try {\n const load = resolveTranslationLoader(lng, ns)\n if (!load) {\n isError = true\n isLoading = false\n return\n }\n resource = await load()\n isLoading = false\n } catch {\n isError = true\n isLoading = false\n }\n }\n const promise = importResources()\n return () => {\n if (isLoading) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw promise // Throw the promise to indicate Suspense should suspend.\n } else if (isError) {\n throw new Error(`Error loading translation for component: ${ns}`) // Handle error\n } else {\n return resource // Return the resource when loading is complete\n }\n }\n}\n\n/**\n * Hook that allows component to load custom dictionary\n *\n * @param ns - Namespace - should match component name exactly - not exposed to consumers\n * @internal\n */\nexport const useI18n = (\n namespaces:\n keyof CustomTypeOptions['resources'] | Array<keyof CustomTypeOptions['resources']> | null,\n) => {\n //Getting our instance of i18n -> supplied by the provider set in GustoProvider\n const { i18n: i18nInstance } = useTranslation()\n //Abort when namespace is not provided\n if (!namespaces) return\n const nsMap = Array.isArray(namespaces) ? namespaces : [namespaces]\n for (const ns of nsMap) {\n const key = `${i18nInstance.resolvedLanguage}:${ns}`\n //Skip loading default resource if it is already in cache\n if (resourceCache.get(key) === null) {\n //If resource not in cache, initiate loading and add getter to cache\n resourceCache.put(key, loadResource({ lng: i18nInstance.resolvedLanguage, ns: ns }))\n }\n //Get resourceGetter from cache\n const resourceGetter = resourceCache.get(key)\n if (resourceGetter) {\n const resource = resourceGetter()\n i18nInstance.addResourceBundle(\n i18nInstance.resolvedLanguage ?? 'en',\n ns,\n resource,\n true,\n false,\n ) //Last argument is set to false to prevent override of keys provided by partners on GustoProvider level through dictionary prop\n }\n }\n}\n\n/**\n * Used by individual components to override their dictionaries with partner provided resources\n *\n * @internal\n */\nexport const useComponentDictionary = <K extends keyof Resources>(\n ns: K,\n resource?: ResourceDictionary<K> | null,\n) => {\n const { i18n: i18nInstance } = useTranslation()\n if (resource) {\n for (const lang in resource) {\n i18nInstance.addResourceBundle(lang, ns, resource[lang], true, true)\n }\n }\n}\n"],"names":["defaultNS","translationLoaders","m","resolveTranslationLoader","lng","ns","primaryPath","resourceCache","LRUCache","loadResource","isLoading","isError","resource","promise","load","useI18n","namespaces","i18nInstance","useTranslation","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BC,GAAKC,CAAE;AAC7C,UAAI,CAACS,GAAM;AACT,QAAAH,IAAU,IACVD,IAAY;AACZ;AAAA,MACF;AACA,MAAAE,IAAW,MAAME,EAAA,GACjBJ,IAAY;AAAA,IACd,QAAQ;AACN,MAAAC,IAAU,IACVD,IAAY;AAAA,IACd;AAAA,EACF,GACgB;AAChB,SAAO,MAAM;AACX,QAAIA;AAEF,YAAMG;QACGF;AACT,YAAM,IAAI,MAAM,4CAA4CN,CAAE,EAAE;AAEhE,WAAOO;AAAA,EAEX;AACF,GAQaG,IAAU,CACrBC,MAEG;AAEH,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAAA;AAE/B,MAAI,CAACF,EAAY;AACjB,QAAMG,IAAQ,MAAM,QAAQH,CAAU,IAAIA,IAAa,CAACA,CAAU;AAClE,aAAWX,KAAMc,GAAO;AACtB,UAAMC,IAAM,GAAGH,EAAa,gBAAgB,IAAIZ,CAAE;AAElD,IAAIE,EAAc,IAAIa,CAAG,MAAM,QAE7Bb,EAAc,IAAIa,GAAKX,EAAa,EAAE,KAAKQ,EAAa,kBAAkB,IAAAZ,EAAA,CAAQ,CAAC;AAGrF,UAAMgB,IAAiBd,EAAc,IAAIa,CAAG;AAC5C,QAAIC,GAAgB;AAClB,YAAMT,IAAWS,EAAA;AACjB,MAAAJ,EAAa;AAAA,QACXA,EAAa,oBAAoB;AAAA,QACjCZ;AAAA,QACAO;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AACF,GAOaU,IAAyB,CACpCjB,GACAO,MACG;AACH,QAAM,EAAE,MAAMK,EAAA,IAAiBC,EAAA;AAC/B,MAAIN;AACF,eAAWW,KAAQX;AACjB,MAAAK,EAAa,kBAAkBM,GAAMlB,GAAIO,EAASW,CAAI,GAAG,IAAM,EAAI;AAGzE;"}
1
+ {"version":3,"file":"I18n.js","sources":["../../src/i18n/I18n.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\nimport { useTranslation } from 'react-i18next'\nimport type { CustomTypeOptions } from 'i18next'\nimport type { Resources } from './types'\nimport { LRUCache } from '@/helpers/LRUCache'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/** @internal */\nexport const defaultNS = 'common'\n\nconst translationLoaders = import.meta.glob<Record<string, string>>('./*/*.json', {\n import: 'default',\n})\n\nfunction resolveTranslationLoader(lng: string | undefined, ns: string) {\n const language = lng ?? 'en'\n const primaryPath = `./${language}/${ns}.json`\n const load =\n translationLoaders[primaryPath as keyof typeof translationLoaders] ??\n translationLoaders[`./en/${ns}.json` as keyof typeof translationLoaders]\n return load\n}\n\n//LRU cache holding requested resources\nconst resourceCache = new LRUCache(50)\n/**\n * Dynamic loading of translation resources - works with Suspence to prevent early access to loadable strings\n *\n * @param lng - resource language\n * @param ns - Namespace/name of the component/resource\n * @returns translation resource\n */\nconst loadResource = ({ lng = 'en', ns }: { ns: string; lng?: string }) => {\n let isLoading = true\n let isError = false\n let resource: Record<string, string>\n\n const importResources = async () => {\n try {\n const load = resolveTranslationLoader(lng, ns)\n if (!load) {\n isError = true\n isLoading = false\n return\n }\n resource = await load()\n isLoading = false\n } catch {\n isError = true\n isLoading = false\n }\n }\n const promise = importResources()\n return () => {\n if (isLoading) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw promise // Throw the promise to indicate Suspense should suspend.\n } else if (isError) {\n throw new Error(`Error loading translation for component: ${ns}`) // Handle error\n } else {\n return resource // Return the resource when loading is complete\n }\n }\n}\n\n/**\n * Hook that allows component to load custom dictionary\n *\n * @param ns - Namespace - should match component name exactly - not exposed to consumers\n * @internal\n */\nexport const useI18n = (\n namespaces:\n keyof CustomTypeOptions['resources'] | Array<keyof CustomTypeOptions['resources']> | null,\n) => {\n //Getting our instance of i18n -> supplied by the provider set in GustoProvider\n const { i18n: i18nInstance } = useTranslation()\n //Abort when namespace is not provided\n if (!namespaces) return\n const nsMap = Array.isArray(namespaces) ? namespaces : [namespaces]\n for (const ns of nsMap) {\n const key = `${i18nInstance.resolvedLanguage}:${ns}`\n //Skip loading default resource if it is already in cache\n if (resourceCache.get(key) === null) {\n //If resource not in cache, initiate loading and add getter to cache\n resourceCache.put(key, loadResource({ lng: i18nInstance.resolvedLanguage, ns: ns }))\n }\n //Get resourceGetter from cache\n const resourceGetter = resourceCache.get(key)\n if (resourceGetter) {\n const resource = resourceGetter()\n i18nInstance.addResourceBundle(\n i18nInstance.resolvedLanguage ?? 'en',\n ns,\n resource,\n true,\n false,\n ) //Last argument is set to false to prevent override of keys provided by partners on GustoProvider level through dictionary prop\n }\n }\n}\n\n/**\n * Used by individual components to override their dictionaries with partner provided resources\n *\n * @internal\n */\nexport const useComponentDictionary = <K extends keyof Resources>(\n ns: K,\n resource?: ResourceDictionary<K> | null,\n) => {\n const { i18n: i18nInstance } = useTranslation()\n if (resource) {\n for (const lang in resource) {\n i18nInstance.addResourceBundle(lang, ns, resource[lang], true, true)\n }\n }\n}\n"],"names":["defaultNS","translationLoaders","m","resolveTranslationLoader","lng","ns","primaryPath","resourceCache","LRUCache","loadResource","isLoading","isError","resource","promise","load","useI18n","namespaces","i18nInstance","useTranslation","nsMap","key","resourceGetter","useComponentDictionary","lang"],"mappings":";;AAQO,MAAMA,IAAY,UAEnBC,IAAqB,uBAAA,OAAA;AAAA,EAAA,+BAAA,MAAA,OAAA,gCAAA,EAAA,KAAA,CAAAC,MAAAA,EAAA,OAAA;AAAA,EAAA,qCAAA,MAAA,OAAA,sCAAA,EAAA,KAAA,CAAAA,MAAAA,EAAA,OAAA;AAAA,EAAA,iCAAA,MAAA,OAAA,kCAAA,EAAA,KAAA,CAAAA,MAAAA,EAAA,OAAA;AAAA,EAAA,kCAAA,MAAA,OAAA,mCAAA,EAAA,KAAA,CAAAA,MAAAA,EAAA,OAAA;AAAA,EAAA,kCAAA,MAAA,OAAA,mCAAA,EAAA,KAAA,CAAAA,MAAAA,EAAA,OAAA;AAAA,EAAA,8BAAA,MAAA,OAAA,+BAAA,EAAA,KAAA,CAAAA,MAAA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AAQH,CAAU,IAAIA,IAAa,CAACA,CAAU;AAClE,aAAWX,KAAMc,GAAO;AACtB,UAAMC,IAAM,GAAGH,EAAa,gBAAgB,IAAIZ,CAAE;AAElD,IAAIE,EAAc,IAAIa,CAAG,MAAM,QAE7Bb,EAAc,IAAIa,GAAKX,EAAa,EAAE,KAAKQ,EAAa,kBAAkB,IAAAZ,EAAA,CAAQ,CAAC;AAGrF,UAAMgB,IAAiBd,EAAc,IAAIa,CAAG;AAC5C,QAAIC,GAAgB;AAClB,YAAMT,IAAWS,EAAA;AACjB,MAAAJ,EAAa;AAAA,QACXA,EAAa,oBAAoB;AAAA,QACjCZ;AAAA,QACAO;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AACF,GAOaU,IAAyB,CACpCjB,GACAO,MACG;AACH,QAAM,EAAE,MAAMK,EAAA,IAAiBC,EAAA;AAC/B,MAAIN;AACF,eAAWW,KAAQX;AACjB,MAAAK,EAAa,kBAAkBM,GAAMlB,GAAIO,EAASW,CAAI,GAAG,IAAM,EAAI;AAGzE;"}
@@ -1,10 +1,12 @@
1
- const e = { selfOnboardingWarningLabel: "Self-onboarding employees can change your company tax requirements", selfOnboardingWarningDescription: "If your employees are self-onboarding and enter details that change your company's state tax requirements (such as a home address in a new state), you may need to complete state tax setup again.", continueCta: "Continue", editStateTaxCta: "Edit", continueStateTaxSetupCta: "Continue setup", requirementsListCol1: "State", requirementsListCol2: "Status", completeBadge: "Complete", incompleteBadge: "Missing information", notStartedBadge: "Not started", inProgressBadge: "In progress", startStateTaxSetupCta: "Start setup", defaultRatesAppliedText: "Default tax rates applied", readyToRunPayrollBadge: "Ready to run payroll", requirementsListLabel: "State tax requirements", emptyTableTitle: "No state tax requirements", emptyTableDescription: "Add company location or an employee to get started." }, t = { saveCta: "Save", cancelCta: "Cancel", title: "{{state}} tax requirements", effectiveFromLabel: "Effective: {{date}}", validations: { minValue: "Minimum value is {{min}}%", maxValue: "Maximum value is {{max}}%", oneOf: "Value must be one of: {{values}}", required: "This field is required" } }, a = {
1
+ const e = { selfOnboardingWarningLabel: "Self-onboarding employees can change your company tax requirements", selfOnboardingWarningDescription: "If your employees are self-onboarding and enter details that change your company's state tax requirements (such as a home address in a new state), you may need to complete state tax setup again.", continueCta: "Continue", editStateTaxCta: "Edit tax settings", continueStateTaxSetupCta: "Continue setup", manageRatesCta: "Manage tax rates", hamburgerTitle: "Actions for {{state}}", requirementsListCol1: "State", requirementsListCol2: "Status", completeBadge: "Complete", incompleteBadge: "Missing information", notStartedBadge: "Not started", inProgressBadge: "In progress", startStateTaxSetupCta: "Start setup", defaultRatesAppliedText: "Default tax rates applied", readyToRunPayrollBadge: "Ready to run payroll", requirementsListLabel: "State tax requirements", emptyTableTitle: "No state tax requirements", emptyTableDescription: "Add company location or an employee to get started." }, t = { saveCta: "Save", cancelCta: "Cancel", title: "{{state}} tax requirements", effectiveFromLabel: "Effective: {{date}}", validations: { minValue: "Minimum value is {{min}}%", maxValue: "Maximum value is {{max}}%", oneOf: "Value must be one of: {{values}}", required: "This field is required" } }, a = { title: "Tax rates for {{state}}", subtitle: "Effective-dated tax rate history and scheduled future rates.", backCta: "Back to states", addRateCta: "Add tax rate", effectiveDateLabel: "Effective date", effectiveDatePlaceholder: "Select an effective date", effectiveDateColumnLabel: "Effective date", currentBadge: "Current", scheduledBadge: "Scheduled", historicalBadge: "Historical", emptyHistoryTitle: "No effective-dated rates yet", emptyHistoryDescription: "Add a tax rate to schedule a future-dated configuration.", addRateDialogTitle: "Add tax rate for {{state}}", addRateDialogDescription: "Schedule a new tax configuration to take effect on a future date.", saveRateCta: "Save tax rate", cancelCta: "Cancel", noEditableFieldsTitle: "No editable fields", noEditableFieldsDescription: "This state does not expose editable effective-dated tax requirements.", rateScheduledSuccess: "Tax rate scheduled to take effect on {{date}}." }, i = {
2
2
  list: e,
3
- form: t
3
+ form: t,
4
+ manageRates: a
4
5
  };
5
6
  export {
6
- a as default,
7
+ i as default,
7
8
  t as form,
8
- e as list
9
+ e as list,
10
+ a as manageRates
9
11
  };
10
12
  //# sourceMappingURL=Company.StateTaxes.json.js.map