@gusto/embedded-react-sdk 0.10.7-rc.2 → 0.11.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 (272) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Base/Base.js +19 -18
  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 +6 -4
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  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 +40 -42
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  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 -53
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -42
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  37. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  38. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  41. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  42. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  43. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  47. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  53. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  55. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  56. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  58. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  60. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  61. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  65. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  67. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -41
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  69. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  70. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  71. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  74. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  77. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  78. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  79. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  80. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  82. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  84. package/dist/components/Company/Industry/Actions.js +7 -5
  85. package/dist/components/Company/Industry/Actions.js.map +1 -1
  86. package/dist/components/Company/Industry/Context.js +1 -1
  87. package/dist/components/Company/Industry/Edit.js +12 -10
  88. package/dist/components/Company/Industry/Edit.js.map +1 -1
  89. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  90. package/dist/components/Company/Industry/Industry.js +23 -29
  91. package/dist/components/Company/Industry/Industry.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  93. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  95. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  96. package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -45
  97. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  99. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  100. package/dist/components/Company/Locations/Locations.js +14 -18
  101. package/dist/components/Company/Locations/Locations.js.map +1 -1
  102. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  103. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  104. package/dist/components/Company/Locations/LocationsList/List.js +4 -2
  105. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +33 -35
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  110. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  111. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  116. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  117. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  118. package/dist/components/Company/PaySchedule/PaySchedule.js +68 -71
  119. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  123. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  124. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  126. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  129. package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
  130. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  142. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  143. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  145. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  146. package/dist/components/Contractor/Address/Address.js +36 -38
  147. package/dist/components/Contractor/Address/Address.js.map +1 -1
  148. package/dist/components/Contractor/Address/Form.js +1 -1
  149. package/dist/components/Contractor/Address/useAddress.js +1 -1
  150. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  158. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  159. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  160. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  161. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  162. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  163. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  164. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  165. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  166. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  167. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  168. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  169. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  170. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  171. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  172. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  173. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  174. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  175. package/dist/components/Contractor/Submit/index.js +20 -0
  176. package/dist/components/Contractor/Submit/index.js.map +1 -0
  177. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  178. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  179. package/dist/components/Contractor/index.d.ts +2 -0
  180. package/dist/components/Contractor/index.js +10 -6
  181. package/dist/components/Contractor/index.js.map +1 -1
  182. package/dist/components/Employee/Compensation/Actions.js +6 -5
  183. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  185. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +15 -14
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/List.js +25 -23
  190. package/dist/components/Employee/Compensation/List.js.map +1 -1
  191. package/dist/components/Employee/Deductions/Actions.js +12 -10
  192. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionForm.js +12 -10
  194. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsList.js +7 -5
  196. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  197. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +12 -10
  198. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  200. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  201. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  203. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +26 -28
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  205. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  207. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  209. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  210. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  212. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  213. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  215. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  216. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  217. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  218. package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -59
  219. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  221. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/List.js +15 -14
  223. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  225. package/dist/components/Employee/Landing/Landing.js +13 -12
  226. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  227. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  228. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  229. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  230. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -3
  231. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  232. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  233. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  234. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  235. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  236. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  237. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  239. package/dist/components/Employee/Profile/Actions.js +9 -7
  240. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  241. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  242. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  243. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  244. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  245. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  246. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  247. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  248. package/dist/components/Employee/Profile/Profile.js +131 -138
  249. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  250. package/dist/components/Employee/Profile/useProfile.js +1 -1
  251. package/dist/components/Employee/Taxes/Actions.js +10 -8
  252. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  253. package/dist/components/Employee/Taxes/FederalForm.js +12 -10
  254. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  255. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  256. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  257. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  258. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  259. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +4 -2
  260. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  261. package/dist/i18n/I18n.js +1 -1
  262. package/dist/i18n/I18n.js.map +1 -1
  263. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  264. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  265. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  266. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  267. package/dist/shared/constants.d.ts +14 -0
  268. package/dist/shared/constants.js +33 -26
  269. package/dist/shared/constants.js.map +1 -1
  270. package/dist/style.css +1 -1
  271. package/dist/types/i18next.d.ts +77 -1
  272. package/package.json +2 -2
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,39 +10,40 @@ 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";
13
14
  import { InternalError as P } from "../Common/InternalError/InternalError.js";
14
15
  import { snakeCaseToCamelCase as w } from "../../helpers/formattedStrings.js";
15
16
  import { useComponentContext as M } from "../../contexts/ComponentAdapter/useComponentContext.js";
16
17
  import { useLoadingIndicator as O } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
- const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), k = (e, n) => {
18
+ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), k = (t, n) => {
18
19
  const m = n ? n + "." : "";
19
- if (e.category === "invalid_attribute_value" || e.category === "invalid_operation")
20
+ if (t.category === "invalid_attribute_value" || t.category === "invalid_operation")
20
21
  return [
21
22
  {
22
- key: w(m + e.errorKey),
23
- message: e.message ?? ""
23
+ key: w(m + t.errorKey),
24
+ message: t.message ?? ""
24
25
  }
25
26
  ];
26
- if (e.category === "nested_errors" && e.errors !== void 0) {
27
+ if (t.category === "nested_errors" && t.errors !== void 0) {
27
28
  let 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));
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));
29
30
  }
30
31
  return [];
31
- }, re = ({
32
- children: e,
32
+ }, ot = ({
33
+ children: t,
33
34
  FallbackComponent: n = P,
34
35
  LoaderComponent: m,
35
36
  onEvent: s
36
37
  }) => {
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)));
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)));
41
42
  }, L = E(
42
- async (t, a) => {
43
+ async (e, a) => {
43
44
  l(null), f(null);
44
45
  try {
45
- await a(t);
46
+ await a(e);
46
47
  } catch (i) {
47
48
  i instanceof g || i instanceof C || i instanceof h ? A(i) : p(i);
48
49
  }
@@ -59,11 +60,11 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
59
60
  throwError: p,
60
61
  baseSubmitHandler: L
61
62
  },
62
- children: /* @__PURE__ */ o(T, { children: ({ reset: t }) => /* @__PURE__ */ u(
63
+ children: /* @__PURE__ */ o(T, { children: ({ reset: e }) => /* @__PURE__ */ u(
63
64
  S,
64
65
  {
65
66
  FallbackComponent: n,
66
- onReset: t,
67
+ onReset: e,
67
68
  onError: (a) => {
68
69
  s(F.ERROR, a);
69
70
  },
@@ -73,7 +74,7 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
73
74
  r && r instanceof g && /* @__PURE__ */ o(d.Text, { children: r.message }),
74
75
  r && r instanceof C && /* @__PURE__ */ o(d.Text, { as: "pre", children: r.pretty() })
75
76
  ] }),
76
- /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children: e }) })
77
+ /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children: t }) })
77
78
  ]
78
79
  }
79
80
  ) })
@@ -81,6 +82,6 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
81
82
  );
82
83
  };
83
84
  export {
84
- re as BaseComponent
85
+ ot as BaseComponent
85
86
  };
86
87
  //# 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":";;;;;;;;;;;;;;;;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,IAAYE,CAAS,CAAC;AAAA,EAAA;AAE/E,SAAO,CAAC;A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ACC;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
+ {"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,a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AA,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,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AAWiC,EAAO,YACrB,cACCxB,EAAiB;AAAA,UACf,IAAIZ,EAAK,MAAMC;AAAA,UACf,OAAOoB;AAAA,UACP,cAAcb;AAAA,UACd,YAAAgB;AAAA,QACD,CAAA,IAED,gBAAAc;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,cAAYlB;AAAA,YACZ,mBAAiBG;AAAA,YACjB,mBAAiBI,IAAqB,SAAS;AAAA,YAC/C,sBAAoB;AAAA,YACpB,eAAY;AAAA,YACZ,UAAU;AAAA,YACV,SAAS,CAAKwB,MAAA;AACV,cAAAA,EAAA,cAAc,aAAa,sBAAsB,MAAM;AAAA,YAC3D;AAAA,YACA,QAAQ,CAAKA,MAAA;AACT,cAAAA,EAAA,cAAc,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,E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AAK,MAAMC;AAAA,UACf,OAAOoB;AAAA,UACP,cAAcb;AAAA,UACd,YAAAgB;AAAA,QACD,CAAA,IAED,gBAAAc;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,cAAYlB;AAAA,YACZ,mBAAiBG;AAAA,YACjB,mBAAiBI,IAAqB,SAAS;AAAA,YAC/C,sBAAoB;AAAA,YACpB,eAAY;AAAA,YACZ,UAAU;AAAA,YACV,SAAS,CAAKwB,MAAA;AACV,cAAAA,EAAA,cAAc,aAAa,sBAAsB,MAAM;AAAA,YAC3D;AAAA,YACA,QAAQ,CAAKA,MAAA;AACT,cAAAA,EAAA,cAAc,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,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,22 +5,24 @@ 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 "classnames";
9
+ import "../../../shared/constants.js";
8
10
  const f = o.object({
9
11
  signature: o.string().min(1),
10
12
  confirmSignature: o.literal(!0)
11
- }), d = {
13
+ }), p = {
12
14
  signature: ""
13
15
  };
14
- function b({ onSubmit: m, children: i, formProps: n }) {
16
+ function z({ onSubmit: m, children: i, formProps: n }) {
15
17
  const e = s({
16
18
  resolver: l(f),
17
- defaultValues: d,
19
+ defaultValues: p,
18
20
  ...n
19
21
  });
20
22
  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 }) }) }) });
21
23
  }
22
24
  export {
23
- b as SignatureForm,
25
+ z as SignatureForm,
24
26
  f as SignatureFormSchema
25
27
  };
26
28
  //# 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,19 +1,21 @@
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({
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import "classnames";
3
+ import "../../../shared/constants.js";
4
+ import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ function d({
5
7
  onBack: t,
6
8
  backLabel: r,
7
- submitLabel: e,
8
- isLoading: i = !1
9
+ submitLabel: i,
10
+ isLoading: e = !1
9
11
  }) {
10
- const o = u();
11
- return /* @__PURE__ */ s(m, { children: [
12
+ const o = p();
13
+ return /* @__PURE__ */ m(s, { children: [
12
14
  t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
13
- /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
15
+ /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
14
16
  ] });
15
17
  }
16
18
  export {
17
- f as SignatureFormActions
19
+ d as SignatureFormActions
18
20
  };
19
21
  //# 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,14 +1,16 @@
1
- import { jsxs as s, Fragment as m, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as n, Fragment as s, jsx as e } from "react/jsx-runtime";
2
+ import "classnames";
3
+ import "../../../shared/constants.js";
2
4
  import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
3
5
  import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
4
- function p({
6
+ function f({
5
7
  signatureLabel: r,
6
8
  signatureDescription: i = "",
7
9
  signatureError: t = "",
8
10
  confirmationLabel: o,
9
- confirmationError: n = ""
11
+ confirmationError: m = ""
10
12
  }) {
11
- return /* @__PURE__ */ s(m, { children: [
13
+ return /* @__PURE__ */ n(s, { children: [
12
14
  /* @__PURE__ */ e(
13
15
  a,
14
16
  {
@@ -25,12 +27,12 @@ function p({
25
27
  name: "confirmSignature",
26
28
  isRequired: !0,
27
29
  label: o,
28
- errorMessage: n
30
+ errorMessage: m
29
31
  }
30
32
  )
31
33
  ] });
32
34
  }
33
35
  export {
34
- p as SignatureFormFields
36
+ f as SignatureFormFields
35
37
  };
36
38
  //# 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 {};