@gusto/embedded-react-sdk 0.10.7 → 0.11.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Base/Base.js +18 -19
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
  5. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  6. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  7. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  13. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  14. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  15. package/dist/components/Common/UI/Button/Button.js +4 -4
  16. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  17. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
  18. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
  19. package/dist/components/Company/AssignSignatory/AssignSignatory.js +34 -39
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -54
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -43
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  39. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  40. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  41. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  42. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  43. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  44. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  45. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  47. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  49. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  50. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
  52. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  53. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  55. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  57. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  58. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  60. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  62. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  63. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  65. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  67. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  69. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -44
  70. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  71. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  73. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  74. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -47
  77. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  79. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  80. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  84. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  86. package/dist/components/Company/Industry/Actions.js +5 -6
  87. package/dist/components/Company/Industry/Actions.js.map +1 -1
  88. package/dist/components/Company/Industry/Context.js +1 -1
  89. package/dist/components/Company/Industry/Edit.js +10 -11
  90. package/dist/components/Company/Industry/Edit.js.map +1 -1
  91. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  92. package/dist/components/Company/Industry/Industry.js +23 -29
  93. package/dist/components/Company/Industry/Industry.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  95. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  97. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -48
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  102. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  103. package/dist/components/Company/Locations/Locations.js +14 -18
  104. package/dist/components/Company/Locations/Locations.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  106. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  108. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  110. package/dist/components/Company/Locations/LocationsList/LocationsList.js +32 -37
  111. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  113. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  114. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  116. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  118. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  119. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  120. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  121. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -78
  122. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
  124. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/Edit.js +25 -26
  126. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/_parts/Head.js +2 -3
  128. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  129. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  130. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  133. package/dist/components/Company/StateTaxes/StateTaxes.js +39 -22
  134. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  135. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +8 -6
  136. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +16 -15
  137. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  139. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  140. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  141. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  142. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  145. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
  147. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  149. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  150. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  152. package/dist/components/Company/StateTaxes/stateTaxesReducer.d.ts +20 -0
  153. package/dist/components/Company/StateTaxes/stateTaxesReducer.js +40 -0
  154. package/dist/components/Company/StateTaxes/stateTaxesReducer.js.map +1 -0
  155. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  156. package/dist/components/Contractor/Address/Address.js +35 -40
  157. package/dist/components/Contractor/Address/Address.js.map +1 -1
  158. package/dist/components/Contractor/Address/Form.js +2 -3
  159. package/dist/components/Contractor/Address/Form.js.map +1 -1
  160. package/dist/components/Contractor/Address/useAddress.js +1 -1
  161. package/dist/components/Contractor/List/index.js +2 -3
  162. package/dist/components/Contractor/List/index.js.map +1 -1
  163. package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
  164. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  165. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
  166. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  167. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  168. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  169. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  170. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  171. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  172. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  173. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  174. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  175. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  176. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  177. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  178. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  179. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  180. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  181. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  182. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  183. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  184. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  185. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  186. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  187. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  188. package/dist/components/Contractor/Submit/index.js +18 -0
  189. package/dist/components/Contractor/Submit/index.js.map +1 -0
  190. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  191. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  192. package/dist/components/Contractor/index.d.ts +2 -0
  193. package/dist/components/Contractor/index.js +10 -6
  194. package/dist/components/Contractor/index.js.map +1 -1
  195. package/dist/components/Employee/Compensation/Actions.js +4 -5
  196. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  197. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  198. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  199. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  200. package/dist/components/Employee/Compensation/Edit.js +2 -3
  201. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  202. package/dist/components/Employee/Compensation/List.js +5 -6
  203. package/dist/components/Employee/Compensation/List.js.map +1 -1
  204. package/dist/components/Employee/Deductions/Actions.js +8 -9
  205. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  206. package/dist/components/Employee/Deductions/DeductionForm.js +2 -3
  207. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  208. package/dist/components/Employee/Deductions/DeductionsList.js +2 -3
  209. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  210. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +2 -3
  211. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  212. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  213. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
  214. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  216. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -30
  217. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  218. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  219. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  220. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  221. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  222. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  223. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  224. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  225. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -46
  226. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  227. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  228. package/dist/components/Employee/EmployeeList/Actions.js +4 -5
  229. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  230. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  231. package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -61
  232. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  234. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  235. package/dist/components/Employee/EmployeeList/List.js +2 -3
  236. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  237. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  238. package/dist/components/Employee/Landing/Landing.js +6 -7
  239. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  241. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
  243. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  244. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  245. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  246. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
  247. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  248. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  249. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  251. package/dist/components/Employee/Profile/Actions.js +6 -7
  252. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  253. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  254. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
  255. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  256. package/dist/components/Employee/Profile/HomeAddress.js +4 -5
  257. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  258. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  259. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
  260. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  261. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  262. package/dist/components/Employee/Profile/Profile.js +131 -138
  263. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  264. package/dist/components/Employee/Profile/useProfile.js +1 -1
  265. package/dist/components/Employee/Taxes/Actions.js +7 -8
  266. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  267. package/dist/components/Employee/Taxes/FederalForm.js +4 -5
  268. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  269. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  270. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  271. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  272. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  273. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  274. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  275. package/dist/i18n/I18n.js +1 -1
  276. package/dist/i18n/I18n.js.map +1 -1
  277. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  278. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  279. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  280. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  281. package/dist/shared/constants.d.ts +14 -0
  282. package/dist/shared/constants.js +33 -26
  283. package/dist/shared/constants.js.map +1 -1
  284. package/dist/style.css +1 -1
  285. package/dist/types/i18next.d.ts +77 -1
  286. package/package.json +3 -3
  287. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -5
  288. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +0 -48
  289. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0
4
+
5
+ - Update peer dependencies to support React 18
6
+ - Add contractor submit block
7
+ - Add contractor profile
8
+
9
+ ### Breaking changes
10
+
11
+ > Note: We are pre alpha and are regularly iterating on the SDK as we learn more about our consumers and their needs which sometimes involves breaking changes. [Read more about our current versioning strategy here](./docs/04/01/versioning.md).
12
+
13
+ #### Remove exports for compound components
14
+
15
+ Previously we were exporting subcomponents such as `Employee.EmployeeList.Head` and `Employee.Compensation.Form` etc. We have removed those exports in favor of only exporting the blocks. Ex. only exporting `Employee.EmployeeList` and `Employee.Compensation` etc.
16
+
3
17
  ## 0.10.7
4
18
 
5
19
  - Upgrade embedded api to fix state taxes validation issue
@@ -10,40 +10,39 @@ import { FadeIn as _ } from "../Common/FadeIn/FadeIn.js";
10
10
  import { BaseContext as j } from "./useBase.js";
11
11
  import { componentEvents as F } from "../../shared/constants.js";
12
12
  import { useAsyncError as K } from "../Common/hooks/useAsyncError.js";
13
- import "classnames";
14
13
  import { InternalError as P } from "../Common/InternalError/InternalError.js";
15
14
  import { snakeCaseToCamelCase as w } from "../../helpers/formattedStrings.js";
16
15
  import { useComponentContext as M } from "../../contexts/ComponentAdapter/useComponentContext.js";
17
16
  import { useLoadingIndicator as O } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
- const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), k = (t, n) => {
17
+ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), k = (e, n) => {
19
18
  const m = n ? n + "." : "";
20
- if (t.category === "invalid_attribute_value" || t.category === "invalid_operation")
19
+ if (e.category === "invalid_attribute_value" || e.category === "invalid_operation")
21
20
  return [
22
21
  {
23
- key: w(m + t.errorKey),
24
- message: t.message ?? ""
22
+ key: w(m + e.errorKey),
23
+ message: e.message ?? ""
25
24
  }
26
25
  ];
27
- if (t.category === "nested_errors" && t.errors !== void 0) {
26
+ if (e.category === "nested_errors" && e.errors !== void 0) {
28
27
  let s = "";
29
- return t.metadata?.key && typeof t.metadata.key == "string" ? s = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? s = t.metadata.state : t.errorKey && (s = t.errorKey), t.errors.flatMap((r) => k(r, m + s));
28
+ return e.metadata?.key && typeof e.metadata.key == "string" ? s = e.metadata.key : e.metadata?.state && typeof e.metadata.state == "string" ? s = e.metadata.state : e.errorKey && (s = e.errorKey), e.errors.flatMap((r) => k(r, m + s));
30
29
  }
31
30
  return [];
32
- }, ot = ({
33
- children: t,
31
+ }, re = ({
32
+ children: e,
34
33
  FallbackComponent: n = P,
35
34
  LoaderComponent: m,
36
35
  onEvent: s
37
36
  }) => {
38
- const [r, l] = y(null), [c, f] = y(null), p = K(), { t: x } = B(), d = M(), { LoadingIndicator: b } = O(), v = m ?? b, I = E((e) => {
39
- l(e), e || f(null);
40
- }, []), A = (e) => {
41
- l(e), e instanceof h && Array.isArray(e.errors) && f(e.errors.flatMap((a) => k(a)));
37
+ const [r, l] = y(null), [c, f] = y(null), p = K(), { t: x } = B(), d = M(), { LoadingIndicator: b } = O(), v = m ?? b, I = E((t) => {
38
+ l(t), t || f(null);
39
+ }, []), A = (t) => {
40
+ l(t), t instanceof h && Array.isArray(t.errors) && f(t.errors.flatMap((a) => k(a)));
42
41
  }, L = E(
43
- async (e, a) => {
42
+ async (t, a) => {
44
43
  l(null), f(null);
45
44
  try {
46
- await a(e);
45
+ await a(t);
47
46
  } catch (i) {
48
47
  i instanceof g || i instanceof C || i instanceof h ? A(i) : p(i);
49
48
  }
@@ -60,11 +59,11 @@ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
60
59
  throwError: p,
61
60
  baseSubmitHandler: L
62
61
  },
63
- children: /* @__PURE__ */ o(T, { children: ({ reset: e }) => /* @__PURE__ */ u(
62
+ children: /* @__PURE__ */ o(T, { children: ({ reset: t }) => /* @__PURE__ */ u(
64
63
  S,
65
64
  {
66
65
  FallbackComponent: n,
67
- onReset: e,
66
+ onReset: t,
68
67
  onError: (a) => {
69
68
  s(F.ERROR, a);
70
69
  },
@@ -74,7 +73,7 @@ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
74
73
  r && r instanceof g && /* @__PURE__ */ o(d.Text, { children: r.message }),
75
74
  r && r instanceof C && /* @__PURE__ */ o(d.Text, { as: "pre", children: r.pretty() })
76
75
  ] }),
77
- /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children: t }) })
76
+ /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children: e }) })
78
77
  ]
79
78
  }
80
79
  ) })
@@ -82,6 +81,6 @@ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
82
81
  );
83
82
  };
84
83
  export {
85
- ot as BaseComponent
84
+ re as BaseComponent
86
85
  };
87
86
  //# sourceMappingURL=Base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX } from 'react'\nimport { Suspense, useState, useCallback } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type FieldError, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources>\n extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**Traverses errorList and finds items with message properties */\nconst renderErrorList = (errorList: FieldError[]): React.ReactNode[] => {\n return errorList.map(errorFromList => {\n if (errorFromList.message) {\n return <li key={errorFromList.key}>{errorFromList.message}</li>\n }\n return null\n })\n}\n/**Recuresively parses error list and constructs an array of objects containing attribute value error messages associated with form fields. Nested errors construct '.' separated keys\n * metadata.state is a special case for state taxes validation errors\n */\nconst getFieldErrors = (\n error: EntityErrorObject,\n parentKey?: string,\n): { key: string; message: string }[] => {\n const keyPrefix = parentKey ? parentKey + '.' : ''\n if (error.category === 'invalid_attribute_value' || error.category === 'invalid_operation') {\n return [\n {\n key: snakeCaseToCamelCase(keyPrefix + error.errorKey),\n message: error.message ?? '',\n },\n ]\n }\n if (error.category === 'nested_errors' && error.errors !== undefined) {\n //TODO: clean this up once Metadata type is fixed in openapi spec\n let keySuffix = ''\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n if (error.metadata?.key && typeof error.metadata.key === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.key as string\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n } else if (error.metadata?.state && typeof error.metadata.state === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.state as string\n } else if (error.errorKey) {\n keySuffix = error.errorKey\n }\n return error.errors.flatMap(err => getFieldErrors(err, keyPrefix + keySuffix))\n }\n return []\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n}: BaseComponentInterface<TResourceKey>) => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<FieldError[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n // Enhanced setError that also clears fieldErrors when error is cleared\n const setErrorWithFieldsClear = useCallback((error: KnownErrors | null) => {\n setError(error)\n if (!error) {\n setFieldErrors(null)\n }\n }, [])\n\n const processError = (error: KnownErrors) => {\n setError(error)\n //422\tapplication/json - content relaited error\n if (error instanceof UnprocessableEntityErrorObject && Array.isArray(error.errors)) {\n setFieldErrors(error.errors.flatMap(err => getFieldErrors(err)))\n }\n }\n\n const baseSubmitHandler = useCallback(\n async <T,>(data: T, componentHandler: SubmitHandler<T>) => {\n setError(null)\n setFieldErrors(null)\n try {\n await componentHandler(data)\n } catch (err) {\n if (\n err instanceof APIError ||\n err instanceof SDKValidationError ||\n err instanceof UnprocessableEntityErrorObject\n ) {\n processError(err)\n } else throwError(err)\n }\n },\n [setError, throwError],\n )\n\n return (\n <BaseContext.Provider\n value={{\n fieldErrors,\n setError: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;;AAoC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ACxB,gBAAAnC,EAAAsB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAMpB,EAAA,OAAA,EAAS,CAAA;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAF,EAAC0C,KAAS,UAAU,gBAAA1C,EAAC0B,KAAgB,GACnC,UAAA,gBAAA1B,EAAC2C,GAAQ,EAAA,UAAAlC,EAAS,CAAA,EACpB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EAGN,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX } from 'react'\nimport { Suspense, useState, useCallback } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type FieldError, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources>\n extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**Traverses errorList and finds items with message properties */\nconst renderErrorList = (errorList: FieldError[]): React.ReactNode[] => {\n return errorList.map(errorFromList => {\n if (errorFromList.message) {\n return <li key={errorFromList.key}>{errorFromList.message}</li>\n }\n return null\n })\n}\n/**Recuresively parses error list and constructs an array of objects containing attribute value error messages associated with form fields. Nested errors construct '.' separated keys\n * metadata.state is a special case for state taxes validation errors\n */\nconst getFieldErrors = (\n error: EntityErrorObject,\n parentKey?: string,\n): { key: string; message: string }[] => {\n const keyPrefix = parentKey ? parentKey + '.' : ''\n if (error.category === 'invalid_attribute_value' || error.category === 'invalid_operation') {\n return [\n {\n key: snakeCaseToCamelCase(keyPrefix + error.errorKey),\n message: error.message ?? '',\n },\n ]\n }\n if (error.category === 'nested_errors' && error.errors !== undefined) {\n //TODO: clean this up once Metadata type is fixed in openapi spec\n let keySuffix = ''\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n if (error.metadata?.key && typeof error.metadata.key === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.key as string\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n } else if (error.metadata?.state && typeof error.metadata.state === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.state as string\n } else if (error.errorKey) {\n keySuffix = error.errorKey\n }\n return error.errors.flatMap(err => getFieldErrors(err, keyPrefix + keySuffix))\n }\n return []\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n}: BaseComponentInterface<TResourceKey>) => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<FieldError[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n // Enhanced setError that also clears fieldErrors when error is cleared\n const setErrorWithFieldsClear = useCallback((error: KnownErrors | null) => {\n setError(error)\n if (!error) {\n setFieldErrors(null)\n }\n }, [])\n\n const processError = (error: KnownErrors) => {\n setError(error)\n //422\tapplication/json - content relaited error\n if (error instanceof UnprocessableEntityErrorObject && Array.isArray(error.errors)) {\n setFieldErrors(error.errors.flatMap(err => getFieldErrors(err)))\n }\n }\n\n const baseSubmitHandler = useCallback(\n async <T,>(data: T, componentHandler: SubmitHandler<T>) => {\n setError(null)\n setFieldErrors(null)\n try {\n await componentHandler(data)\n } catch (err) {\n if (\n err instanceof APIError ||\n err instanceof SDKValidationError ||\n err instanceof UnprocessableEntityErrorObject\n ) {\n processError(err)\n } else throwError(err)\n }\n },\n [setError, throwError],\n )\n\n return (\n <BaseContext.Provider\n value={{\n fieldErrors,\n setError: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAkB,CAACC,MAChBA,EAAU,IAAI,CAAiBC,MAChCA,EAAc,UACR,gBAAAC,EAAA,MAAA,EAA4B,UAAcD,EAAA,QAAA,GAAlCA,EAAc,GAA4B,IAErD,IACR,GAKGE,IAAiB,CACrBC,GACAC,MACuC;AACjC,QAAAC,IAAYD,IAAYA,IAAY,MAAM;AAChD,MAAID,EAAM,aAAa,6BAA6BA,EAAM,aAAa;AAC9D,WAAA;AAAA,MACL;AAAA,QACE,KAAKG,EAAqBD,IAAYF,EAAM,QAAQ;AAAA,QACpD,SAASA,EAAM,WAAW;AAAA,MAAA;AAAA,IAE9B;AAEF,MAAIA,EAAM,aAAa,mBAAmBA,EAAM,WAAW,QAAW;AAEpE,QAAII,IAAY;AAEhB,WAAIJ,EAAM,UAAU,OAAO,OAAOA,EAAM,SAAS,OAAQ,WAEvDI,IAAYJ,EAAM,SAAS,MAElBA,EAAM,UAAU,SAAS,OAAOA,EAAM,SAAS,SAAU,WAElEI,IAAYJ,EAAM,SAAS,QAClBA,EAAM,aACfI,IAAYJ,EAAM,WAEbA,EAAM,OAAO,QAAQ,CAAAK,MAAON,EAAeM,GAAKH,IA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A,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAA9B;AAAA,UACA,SAAS4B;AAAA,UACT,SAAS,CAAO/B,MAAA;AACN,YAAAM,EAAA4B,EAAgB,OAAOlC,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAASL,KAAAc,MACR,gBAAAuB,EAAAjB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,cAAAJ,uBAAgBM,EAAW,eAAX,EAAyB,OAAOzB,EAAgBmB,CAAW,GAAG;AAAA,cAC9Ed,KAASA,aAAiBgC,KACzB,gBAAAlC,EAACsB,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,cAEjCpB,KAASA,aAAiBiC,KACxB,gBAAAnC,EAAAsB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAMpB,EAAA,OAAA,EAAS,CAAA;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAF,EAAC0C,KAAS,UAAU,gBAAA1C,EAAC0B,KAAgB,GACnC,UAAA,gBAAA1B,EAAC2C,GAAQ,EAAA,UAAAlC,EAAS,CAAA,EACpB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EAGN,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1,40 +1,41 @@
1
- import { jsxs as p, Fragment as c, jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as b } from "react-i18next";
3
- import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
4
- import g from "../../../assets/icons/hamburger.svg.js";
5
- import { useMenu as C } from "../hooks/useMenu.js";
6
- function H({
1
+ import { jsxs as f, Fragment as b, jsx as o } from "react/jsx-runtime";
2
+ import { useTranslation as g } from "react-i18next";
3
+ import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ import x from "../../../assets/icons/hamburger.svg.js";
5
+ import { useMenu as M } from "../hooks/useMenu.js";
6
+ function T({
7
7
  items: t,
8
- triggerLabel: m,
9
- menuLabel: s,
8
+ triggerLabel: s,
9
+ menuLabel: m,
10
10
  onClose: a,
11
11
  isLoading: l = !1,
12
12
  ...u
13
13
  }) {
14
- const { t: e } = b("common"), n = f(), { triggerProps: i, menuProps: r } = C();
15
- return /* @__PURE__ */ p(c, { children: [
14
+ const { t: e } = g("common"), r = C(), { triggerProps: i, menuProps: n } = M(), { ref: p, ...c } = i;
15
+ return /* @__PURE__ */ f(b, { children: [
16
16
  /* @__PURE__ */ o(
17
- n.ButtonIcon,
17
+ r.ButtonIcon,
18
18
  {
19
19
  isLoading: l,
20
- "aria-label": m || e("labels.openMenu"),
21
- ...i,
22
- children: /* @__PURE__ */ o(g, {})
20
+ "aria-label": s || e("labels.openMenu"),
21
+ buttonRef: p,
22
+ ...c,
23
+ children: /* @__PURE__ */ o(x, {})
23
24
  }
24
25
  ),
25
26
  /* @__PURE__ */ o(
26
- n.Menu,
27
+ r.Menu,
27
28
  {
28
- ...r,
29
+ ...n,
29
30
  items: t,
30
- "aria-label": s || e("labels.menuLabel"),
31
- onClose: a || r.onClose,
31
+ "aria-label": m || e("labels.menuLabel"),
32
+ onClose: a || n.onClose,
32
33
  ...u
33
34
  }
34
35
  )
35
36
  ] });
36
37
  }
37
38
  export {
38
- H as HamburgerMenu
39
+ T as HamburgerMenu
39
40
  };
40
41
  //# sourceMappingURL=HamburgerMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/components/Common/hooks/useMenu'\n\nexport function HamburgerMenu({\n items,\n triggerLabel,\n menuLabel,\n onClose,\n isLoading = false,\n ...props\n}: HamburgerMenuProps) {\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n const { triggerProps, menuProps } = useMenu()\n\n return (\n <>\n <Components.ButtonIcon\n isLoading={isLoading}\n aria-label={triggerLabel || t('labels.openMenu')}\n {...triggerProps}\n >\n <HamburgerIcon />\n </Components.ButtonIcon>\n <Components.Menu\n {...menuProps}\n items={items}\n aria-label={menuLabel || t('labels.menuLabel')}\n onClose={onClose || menuProps.onClose}\n {...props}\n />\n </>\n )\n}\n"],"names":["HamburgerMenu","items","triggerLabel","menuLabel","onClose","isLoading","props","t","useTranslation","Components","useComponentContext","triggerProps","menuProps","useMenu","jsxs","Fragment","jsx","HamburgerIcon"],"mappings":";;;;;AAMO,SAASA,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAuB;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAQ;AAE5C,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,WAAAJ;AAAA,QACA,cAAYH,KAAgBK,EAAE,iBAAiB;AAAA,QAC9C,GAAGI;AAAA,QAEJ,4BAACM,GAAc,CAAA,CAAA;AAAA,MAAA;AAAA,IACjB;AAAA,IACA,gBAAAD;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACE,GAAGG;AAAA,QACJ,OAAAX;AAAA,QACA,cAAYE,KAAaI,EAAE,kBAAkB;AAAA,QAC7C,SAASH,KAAWQ,EAAU;AAAA,QAC7B,GAAGN;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;"}
1
+ {"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/components/Common/hooks/useMenu'\n\nexport function HamburgerMenu({\n items,\n triggerLabel,\n menuLabel,\n onClose,\n isLoading = false,\n ...props\n}: HamburgerMenuProps) {\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n const { triggerProps, menuProps } = useMenu()\n\n const { ref, ...restTriggerProps } = triggerProps\n\n return (\n <>\n <Components.ButtonIcon\n isLoading={isLoading}\n aria-label={triggerLabel || t('labels.openMenu')}\n buttonRef={ref}\n {...restTriggerProps}\n >\n <HamburgerIcon />\n </Components.ButtonIcon>\n <Components.Menu\n {...menuProps}\n items={items}\n aria-label={menuLabel || t('labels.menuLabel')}\n onClose={onClose || menuProps.onClose}\n {...props}\n />\n </>\n )\n}\n"],"names":["HamburgerMenu","items","triggerLabel","menuLabel","onClose","isLoading","props","t","useTranslation","Components","useComponentContext","triggerProps","menuProps","useMenu","ref","restTriggerProps","jsxs","Fragment","jsx","HamburgerIcon"],"mappings":";;;;;AAMO,SAASA,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAuB;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAQ,GAEtC,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAqBJ;AAErC,SAEI,gBAAAK,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACC,WAAAJ;AAAA,QACA,cAAYH,KAAgBK,EAAE,iBAAiB;AAAA,QAC/C,WAAWO;AAAA,QACV,GAAGC;AAAA,QAEJ,4BAACI,GAAc,CAAA,CAAA;AAAA,MAAA;AAAA,IACjB;AAAA,IACA,gBAAAD;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACE,GAAGG;AAAA,QACJ,OAAAX;AAAA,QACA,cAAYE,KAAaI,EAAE,kBAAkB;AAAA,QAC7C,SAASH,KAAWQ,EAAU;AAAA,QAC7B,GAAGN;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;"}
@@ -122,7 +122,7 @@ const I = z(function({
122
122
  "aria-roledescription": f("reorderableList.draggableItem"),
123
123
  "aria-grabbed": b,
124
124
  onKeyDown: j,
125
- ref: (r) => {
125
+ buttonRef: (r) => {
126
126
  r && (l.current = r, P(r));
127
127
  },
128
128
  children: /* @__PURE__ */ o(Y, {})
@@ -1 +1 @@
1
- {"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source?: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/**\n * Component for an individual reorderable item\n */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: !!monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n ref={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAqCa,MAAAA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACjB,QAAAC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAoB,GAGjCC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACV,IAAAb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAM;AAAA,EAC1B,GACC,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,O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,gBAAgB,oBAAoB;AAAA,YACtD;AAAA,YACA,cACExB,IACIS,EAAE,wCAAwC;AAAA,cACxC,MAAMI;AAAA,YAAA,CACP,IACDJ,EAAE,kCAAkC;AAAA,cAClC,MAAMI;AAAA,YAAA,CACP;AAAA,YAEP,wBAAsBJ,EAAE,+BAA+B;AAAA,YACvD,gBAAcO;AAAA,YACd,WAAWM;AAAA,YACX,KAAK,CAAQU,MAAA;AACX,cAAIA,MACFxB,EAAU,UAAUwB,GACpBf,EAAKe,CAAI;AAAA,YAEb;AAAA,YAEA,4BAACC,GAAS,CAAA,CAAA;AAAA,UAAA;AAAA,QAAA,GAGhB;AAAA,0BACC,OAAI,EAAA,WAAWL,EAAO,kBAAmB,YAAK,QAAQ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACzD;AAEJ,CAAC;"}
1
+ {"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source?: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/**\n * Component for an individual reorderable item\n */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: !!monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n buttonRef={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAqCa,MAAAA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACjB,QAAAC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAoB,GAGjCC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACV,IAAAb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAM;AAAA,EAC1B,GACC,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,OAAO;AAAA,MACL,MAAMC;AAAA,MACN,MAAM,OACJN,EAAkB,U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AAE,wCAAwC;AAAA,cACxC,MAAMI;AAAA,YAAA,CACP,IACDJ,EAAE,kCAAkC;AAAA,cAClC,MAAMI;AAAA,YAAA,CACP;AAAA,YAEP,wBAAsBJ,EAAE,+BAA+B;AAAA,YACvD,gBAAcO;AAAA,YACd,WAAWM;AAAA,YACX,WAAW,CAAQU,MAAA;AACjB,cAAIA,MACFxB,EAAU,UAAUwB,GACpBf,EAAKe,CAAI;AAAA,YAEb;AAAA,YAEA,4BAACC,GAAS,CAAA,CAAA;AAAA,UAAA;AAAA,QAAA,GAGhB;AAAA,0BACC,OAAI,EAAA,WAAWL,EAAO,kBAAmB,YAAK,QAAQ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACzD;AAEJ,CAAC;"}
@@ -5,24 +5,22 @@ import { zodResolver as l } from "@hookform/resolvers/zod";
5
5
  import t from "./SignatureForm.module.scss.js";
6
6
  import { Form as u } from "../Form/Form.js";
7
7
  import { Flex as c } from "../Flex/Flex.js";
8
- import "react-i18next";
9
- import "classnames";
10
8
  const f = o.object({
11
9
  signature: o.string().min(1),
12
10
  confirmSignature: o.literal(!0)
13
- }), p = {
11
+ }), d = {
14
12
  signature: ""
15
13
  };
16
- function z({ onSubmit: m, children: i, formProps: n }) {
14
+ function b({ onSubmit: m, children: i, formProps: n }) {
17
15
  const e = s({
18
16
  resolver: l(f),
19
- defaultValues: p,
17
+ defaultValues: d,
20
18
  ...n
21
19
  });
22
20
  return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
23
21
  }
24
22
  export {
25
- z as SignatureForm,
23
+ b as SignatureForm,
26
24
  f as SignatureFormSchema
27
25
  };
28
26
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;AAOa,MAAAA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACG,gBAAAI,EAAAC,GAAA,EAAc,GAAGJ,GAChB,UAAC,gBAAAG,EAAAE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAC,gBAAAH,EAAA,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAK,EAAA,eAAc,UAAS,KAAK,IAC/B,UAAAT,EACH,CAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;AAOa,MAAAA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACG,gBAAAI,EAAAC,GAAA,EAAc,GAAGJ,GAChB,UAAC,gBAAAG,EAAAE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAC,gBAAAH,EAAA,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAK,EAAA,eAAc,UAAS,KAAK,IAC/B,UAAAT,EACH,CAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;"}
@@ -1,21 +1,19 @@
1
- import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import "react-i18next";
3
- import "classnames";
4
- import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d({
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { ActionsLayout as m } from "../ActionsLayout/ActionsLayout.js";
3
+ import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ function f({
7
5
  onBack: t,
8
6
  backLabel: r,
9
- submitLabel: i,
10
- isLoading: e = !1
7
+ submitLabel: e,
8
+ isLoading: i = !1
11
9
  }) {
12
- const o = p();
13
- return /* @__PURE__ */ m(s, { children: [
10
+ const o = u();
11
+ return /* @__PURE__ */ s(m, { children: [
14
12
  t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
15
- /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
13
+ /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
16
14
  ] });
17
15
  }
18
16
  export {
19
- d as SignatureFormActions
17
+ f as SignatureFormActions
20
18
  };
21
19
  //# sourceMappingURL=SignatureFormActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAoB;AAEvC,2BACGC,GACE,EAAA,UAAA;AAAA,IACCN,KAAA,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UACHC,EAAA,CAAA;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UACHD,EAAA,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAoB;AAEvC,2BACGC,GACE,EAAA,UAAA;AAAA,IACCN,KAAA,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UACHC,EAAA,CAAA;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UACHD,EAAA,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,16 +1,14 @@
1
- import { jsxs as n, Fragment as s, jsx as e } from "react/jsx-runtime";
2
- import "react-i18next";
3
- import "classnames";
1
+ import { jsxs as s, Fragment as m, jsx as e } from "react/jsx-runtime";
4
2
  import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
5
3
  import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
6
- function f({
4
+ function p({
7
5
  signatureLabel: r,
8
6
  signatureDescription: i = "",
9
7
  signatureError: t = "",
10
8
  confirmationLabel: o,
11
- confirmationError: m = ""
9
+ confirmationError: n = ""
12
10
  }) {
13
- return /* @__PURE__ */ n(s, { children: [
11
+ return /* @__PURE__ */ s(m, { children: [
14
12
  /* @__PURE__ */ e(
15
13
  a,
16
14
  {
@@ -27,12 +25,12 @@ function f({
27
25
  name: "confirmSignature",
28
26
  isRequired: !0,
29
27
  label: o,
30
- errorMessage: m
28
+ errorMessage: n
31
29
  }
32
30
  )
33
31
  ] });
34
32
  }
35
33
  export {
36
- f as SignatureFormFields
34
+ p as SignatureFormFields
37
35
  };
38
36
  //# sourceMappingURL=SignatureFormFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
1
  import { ButtonProps } from './ButtonTypes';
2
- export declare function Button({ isError, isLoading, isDisabled, variant, ref, className, children, onBlur, onFocus, onClick, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Button({ isError, isLoading, isDisabled, variant, buttonRef, className, children, onBlur, onFocus, onClick, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -7,19 +7,19 @@ function N({
7
7
  isLoading: r = !1,
8
8
  isDisabled: s = !1,
9
9
  variant: t = "primary",
10
- ref: e,
10
+ buttonRef: e,
11
11
  className: m,
12
12
  children: i,
13
13
  onBlur: n,
14
14
  onFocus: d,
15
15
  onClick: a,
16
- ...l
16
+ ...f
17
17
  }) {
18
18
  return /* @__PURE__ */ p(
19
19
  u,
20
20
  {
21
- ...l,
22
- className: ({ defaultClassName: f }) => v(c.root, f, m),
21
+ ...f,
22
+ className: ({ defaultClassName: l }) => v(c.root, l, m),
23
23
  ref: e,
24
24
  onBlur: n,
25
25
  onFocus: d,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../../src/components/Common/UI/Button/Button.tsx"],"sourcesContent":["import { Button as AriaButton } from 'react-aria-components'\nimport classNames from 'classnames'\nimport { type ButtonProps } from './ButtonTypes'\nimport styles from './Button.module.scss'\n\nexport function Button({\n isError = false,\n isLoading = false,\n isDisabled = false,\n variant = 'primary',\n ref,\n className,\n children,\n onBlur,\n onFocus,\n onClick,\n ...props\n}: ButtonProps) {\n const handlePress = onClick\n ? () => {\n onClick({} as React.MouseEvent<HTMLButtonElement>)\n }\n : undefined\n\n return (\n <AriaButton\n {...props}\n className={({ defaultClassName }) => classNames(styles.root, defaultClassName, className)}\n ref={ref}\n onBlur={onBlur}\n onFocus={onFocus}\n isDisabled={isDisabled || isLoading}\n data-variant={variant}\n data-loading={isLoading || undefined}\n data-error={isError || undefined}\n onPress={handlePress}\n >\n {children}\n </AriaButton>\n )\n}\n"],"names":["Button","isError","isLoading","isDisabled","variant","ref","className","children","onBlur","onFocus","onClick","props","jsx","AriaButton","defaultClassName","classNames","styles"],"mappings":";;;;AAKO,SAASA,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,KAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AAQZ,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,WAAW,CAAC,EAAE,kBAAAG,QAAuBC,EAAWC,EAAO,MAAMF,GAAkBR,CAAS;AAAA,MACxF,KAAAD;AAAA,MACA,QAAAG;AAAA,MACA,SAAAC;AAAA,MACA,YAAYN,KAAcD;AAAA,MAC1B,gBAAcE;AAAA,MACd,gBAAcF,KAAa;AAAA,MAC3B,cAAYD,KAAW;AAAA,MACvB,SAjBgBS,IAChB,MAAM;AACJ,QAAAA,EAAQ,CAAA,CAAyC;AAAA,MAAA,IAEnD;AAAA,MAeC,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../../src/components/Common/UI/Button/Button.tsx"],"sourcesContent":["import { Button as AriaButton } from 'react-aria-components'\nimport classNames from 'classnames'\nimport { type ButtonProps } from './ButtonTypes'\nimport styles from './Button.module.scss'\n\nexport function Button({\n isError = false,\n isLoading = false,\n isDisabled = false,\n variant = 'primary',\n buttonRef,\n className,\n children,\n onBlur,\n onFocus,\n onClick,\n ...props\n}: ButtonProps) {\n const handlePress = onClick\n ? () => {\n onClick({} as React.MouseEvent<HTMLButtonElement>)\n }\n : undefined\n\n return (\n <AriaButton\n {...props}\n className={({ defaultClassName }) => classNames(styles.root, defaultClassName, className)}\n ref={buttonRef}\n onBlur={onBlur}\n onFocus={onFocus}\n isDisabled={isDisabled || isLoading}\n data-variant={variant}\n data-loading={isLoading || undefined}\n data-error={isError || undefined}\n onPress={handlePress}\n >\n {children}\n </AriaButton>\n )\n}\n"],"names":["Button","isError","isLoading","isDisabled","variant","buttonRef","className","children","onBlur","onFocus","onClick","props","jsx","AriaButton","defaultClassName","classNames","styles"],"mappings":";;;;AAKO,SAASA,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AAQZ,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,WAAW,CAAC,EAAE,kBAAAG,QAAuBC,EAAWC,EAAO,MAAMF,GAAkBR,CAAS;AAAA,MACxF,KAAKD;AAAA,MACL,QAAAG;AAAA,MACA,SAAAC;AAAA,MACA,YAAYN,KAAcD;AAAA,MAC1B,gBAAcE;AAAA,MACd,gBAAcF,KAAa;AAAA,MAC3B,cAAYD,KAAW;AAAA,MACvB,SAjBgBS,IAChB,MAAM;AACJ,QAAAA,EAAQ,CAAA,CAAyC;AAAA,MAAA,IAEnD;AAAA,MAeC,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -3,7 +3,7 @@ export interface ButtonProps extends Pick<ButtonHTMLAttributes<HTMLButtonElement
3
3
  /**
4
4
  * React ref for the button element
5
5
  */
6
- ref?: Ref<HTMLButtonElement>;
6
+ buttonRef?: Ref<HTMLButtonElement>;
7
7
  /**
8
8
  * Visual style variant of the button
9
9
  */
@@ -6,9 +6,4 @@ interface AssignSignatoryProps extends BaseComponentInterface<'Company.AssignSig
6
6
  defaultValues?: AssignSignatoryDefaultValues;
7
7
  }
8
8
  export declare function AssignSignatory(props: AssignSignatoryProps): import("react/jsx-runtime").JSX.Element;
9
- export declare namespace AssignSignatory {
10
- var Head: () => import("react/jsx-runtime").JSX.Element;
11
- var Selection: () => import("react/jsx-runtime").JSX.Element;
12
- var Form: () => import("react/jsx-runtime").JSX.Element;
13
- }
14
9
  export {};
@@ -1,68 +1,63 @@
1
- import { jsx as o, jsxs as N, Fragment as _ } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as y, Fragment as f } from "react/jsx-runtime";
2
2
  import { z as e } from "zod";
3
- import { useForm as O, FormProvider as u } from "react-hook-form";
4
- import { zodResolver as E } from "@hookform/resolvers/zod";
5
- import { SignatoryForm as g } from "./SignatoryForm.js";
6
- import { Head as S } from "./Head.js";
7
- import { AssignSignatorySelection as c } from "./AssignSignatorySelection.js";
8
- import { SignatoryAssignmentMode as m, AssignSignatoryProvider as C } from "./useAssignSignatory.js";
3
+ import { useForm as d, FormProvider as N } from "react-hook-form";
4
+ import { zodResolver as p } from "@hookform/resolvers/zod";
5
+ import { SignatoryForm as _ } from "./SignatoryForm.js";
6
+ import { Head as O } from "./Head.js";
7
+ import { AssignSignatorySelection as u } from "./AssignSignatorySelection.js";
8
+ import { SignatoryAssignmentMode as m, AssignSignatoryProvider as E } from "./useAssignSignatory.js";
9
9
  import { companyEvents as i } from "../../../shared/constants.js";
10
- import { Flex as M } from "../../Common/Flex/Flex.js";
11
- import "react-i18next";
12
- import "classnames";
13
- import { BaseComponent as h } from "../../Base/Base.js";
14
- import { useBase as I } from "../../Base/useBase.js";
15
- import { useI18n as Y, useComponentDictionary as D } from "../../../i18n/I18n.js";
16
- function s(n) {
17
- return /* @__PURE__ */ o(h, { ...n, children: /* @__PURE__ */ o(F, { ...n, children: n.children }) });
10
+ import { Flex as C } from "../../Common/Flex/Flex.js";
11
+ import { BaseComponent as M } from "../../Base/Base.js";
12
+ import { useBase as h } from "../../Base/useBase.js";
13
+ import { useI18n as I, useComponentDictionary as Y } from "../../../i18n/I18n.js";
14
+ function w(n) {
15
+ return /* @__PURE__ */ o(M, { ...n, children: /* @__PURE__ */ o(v, { ...n, children: n.children }) });
18
16
  }
19
- const v = e.object({
17
+ const D = e.object({
20
18
  signatoryAssignmentMode: e.union([
21
19
  e.literal(m.createSignatory),
22
20
  e.literal(m.inviteSignatory)
23
21
  ])
24
22
  });
25
- function F({
23
+ function v({
26
24
  companyId: n,
27
- signatoryId: A,
28
- defaultValues: l,
29
- className: y,
30
- children: a,
31
- dictionary: f
25
+ signatoryId: a,
26
+ defaultValues: g,
27
+ className: S,
28
+ children: s,
29
+ dictionary: A
32
30
  }) {
33
- Y("Company.AssignSignatory"), D("Company.AssignSignatory", f);
34
- const { onEvent: t } = I(), d = O({
35
- resolver: E(v),
31
+ I("Company.AssignSignatory"), Y("Company.AssignSignatory", A);
32
+ const { onEvent: t } = h(), c = d({
33
+ resolver: p(D),
36
34
  defaultValues: {
37
35
  signatoryAssignmentMode: m.createSignatory
38
36
  }
39
37
  });
40
- return /* @__PURE__ */ o("section", { className: y, children: /* @__PURE__ */ o(
41
- C,
38
+ return /* @__PURE__ */ o("section", { className: S, children: /* @__PURE__ */ o(
39
+ E,
42
40
  {
43
41
  value: {
44
42
  companyId: n,
45
- signatoryId: A,
46
- defaultValues: l,
43
+ signatoryId: a,
44
+ defaultValues: g,
47
45
  onSignatoryAssignmentModeChange: (r) => {
48
46
  t(i.COMPANY_ASSIGN_SIGNATORY_MODE_UPDATED, r);
49
47
  },
50
- onSignatoryFormEvent: (r, p) => {
51
- r === i.COMPANY_CREATE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : r === i.COMPANY_INVITE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : t(r, p);
48
+ onSignatoryFormEvent: (r, l) => {
49
+ r === i.COMPANY_CREATE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : r === i.COMPANY_INVITE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : t(r, l);
52
50
  }
53
51
  },
54
- children: /* @__PURE__ */ o(M, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(u, { ...d, children: a || /* @__PURE__ */ N(_, { children: [
55
- /* @__PURE__ */ o(S, {}),
56
- /* @__PURE__ */ o(c, {}),
57
- /* @__PURE__ */ o(g, {})
52
+ children: /* @__PURE__ */ o(C, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(N, { ...c, children: s || /* @__PURE__ */ y(f, { children: [
53
+ /* @__PURE__ */ o(O, {}),
54
+ /* @__PURE__ */ o(u, {}),
55
+ /* @__PURE__ */ o(_, {})
58
56
  ] }) }) })
59
57
  }
60
58
  ) });
61
59
  }
62
- s.Head = S;
63
- s.Selection = c;
64
- s.Form = g;
65
60
  export {
66
- s as AssignSignatory
61
+ w as AssignSignatory
67
62
  };
68
63
  //# sourceMappingURL=AssignSignatory.js.map