@remoteoss/remote-flows 0.4.0-alpha.1 → 0.4.0-alpha.10

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 (336) hide show
  1. package/README.md +63 -1
  2. package/dist/chunk-2Y22JKVE.js +2 -0
  3. package/dist/{chunk-QOMUXX6W.js → chunk-3PH5E6CZ.js} +2 -2
  4. package/dist/chunk-4A6ZQNMB.js +2 -0
  5. package/dist/chunk-4A6ZQNMB.js.map +1 -0
  6. package/dist/chunk-4YNOSVYQ.js +2 -0
  7. package/dist/chunk-4YNOSVYQ.js.map +1 -0
  8. package/dist/chunk-55SA3TEF.js +2 -0
  9. package/dist/chunk-55SA3TEF.js.map +1 -0
  10. package/dist/chunk-6I6RMJXC.js +2 -0
  11. package/dist/chunk-6I6RMJXC.js.map +1 -0
  12. package/dist/chunk-6T3A6GWH.js +2 -0
  13. package/dist/chunk-6T3A6GWH.js.map +1 -0
  14. package/dist/chunk-7KUKFRKC.js +2 -0
  15. package/dist/chunk-7KUKFRKC.js.map +1 -0
  16. package/dist/chunk-B4SVITZI.js +2 -0
  17. package/dist/chunk-B4SVITZI.js.map +1 -0
  18. package/dist/chunk-DBIPVIBO.js +2 -0
  19. package/dist/{chunk-DE5FSFYL.js.map → chunk-DBIPVIBO.js.map} +1 -1
  20. package/dist/chunk-DP4SIYAC.js +2 -0
  21. package/dist/chunk-DP4SIYAC.js.map +1 -0
  22. package/dist/chunk-EGDD73PU.js +2 -0
  23. package/dist/chunk-EGDD73PU.js.map +1 -0
  24. package/dist/chunk-EMVYCKDC.js +2 -0
  25. package/dist/{chunk-56BNVYTD.js.map → chunk-EMVYCKDC.js.map} +1 -1
  26. package/dist/chunk-FB4QOGWE.js +2 -0
  27. package/dist/chunk-FB4QOGWE.js.map +1 -0
  28. package/dist/chunk-G7BISHWK.js +2 -0
  29. package/dist/chunk-G7BISHWK.js.map +1 -0
  30. package/dist/chunk-GFWQG4ZT.js +2 -0
  31. package/dist/chunk-GFWQG4ZT.js.map +1 -0
  32. package/dist/chunk-GMU3QGAR.js +2 -0
  33. package/dist/chunk-GMU3QGAR.js.map +1 -0
  34. package/dist/chunk-HBH2PSYQ.js +2 -0
  35. package/dist/chunk-HBH2PSYQ.js.map +1 -0
  36. package/dist/chunk-HJBXUPHM.js +2 -0
  37. package/dist/chunk-HJBXUPHM.js.map +1 -0
  38. package/dist/chunk-HSY5OO7D.js +2 -0
  39. package/dist/chunk-HSY5OO7D.js.map +1 -0
  40. package/dist/chunk-IAHI4OUM.js +2 -0
  41. package/dist/chunk-IAHI4OUM.js.map +1 -0
  42. package/dist/chunk-IKQ25VV5.js +2 -0
  43. package/dist/chunk-IKQ25VV5.js.map +1 -0
  44. package/dist/chunk-INAXCFVC.js +2 -0
  45. package/dist/chunk-INAXCFVC.js.map +1 -0
  46. package/dist/chunk-JJPI2YDM.js +2 -0
  47. package/dist/chunk-JJPI2YDM.js.map +1 -0
  48. package/dist/chunk-L5OIK2ZJ.js +2 -0
  49. package/dist/chunk-L5OIK2ZJ.js.map +1 -0
  50. package/dist/chunk-LJRUD43L.js +2 -0
  51. package/dist/chunk-LJRUD43L.js.map +1 -0
  52. package/dist/chunk-LTDDSH45.js +2 -0
  53. package/dist/chunk-LTDDSH45.js.map +1 -0
  54. package/dist/chunk-MGUDZTTV.js +2 -0
  55. package/dist/chunk-MGUDZTTV.js.map +1 -0
  56. package/dist/chunk-NEFNFYRS.js +2 -0
  57. package/dist/{chunk-GFBF55NR.js.map → chunk-NEFNFYRS.js.map} +1 -1
  58. package/dist/chunk-NF5IMQEW.js +2 -0
  59. package/dist/chunk-NF5IMQEW.js.map +1 -0
  60. package/dist/{chunk-UECSVYQ5.js → chunk-O3QLBSMV.js} +2 -2
  61. package/dist/chunk-O3QLBSMV.js.map +1 -0
  62. package/dist/chunk-O562EWKG.js +2 -0
  63. package/dist/chunk-O562EWKG.js.map +1 -0
  64. package/dist/chunk-OIXUBXFU.js +2 -0
  65. package/dist/{chunk-GMGKIQLI.js.map → chunk-OIXUBXFU.js.map} +1 -1
  66. package/dist/chunk-OKAOH4ER.js +2 -0
  67. package/dist/chunk-OKAOH4ER.js.map +1 -0
  68. package/dist/chunk-ONZPO4GN.js +2 -0
  69. package/dist/{chunk-IDSJI7KQ.js.map → chunk-ONZPO4GN.js.map} +1 -1
  70. package/dist/chunk-P5VTRXW3.js +2 -0
  71. package/dist/chunk-P5VTRXW3.js.map +1 -0
  72. package/dist/chunk-PH5CQN7X.js +2 -0
  73. package/dist/{chunk-MESREYTZ.js.map → chunk-PH5CQN7X.js.map} +1 -1
  74. package/dist/chunk-PJMKZ3HR.js +2 -0
  75. package/dist/chunk-PJMKZ3HR.js.map +1 -0
  76. package/dist/chunk-PMLMQNSO.js +2 -0
  77. package/dist/chunk-PMLMQNSO.js.map +1 -0
  78. package/dist/chunk-QHN4PPHD.js +2 -0
  79. package/dist/{chunk-3FVI5JIC.js.map → chunk-QHN4PPHD.js.map} +1 -1
  80. package/dist/chunk-RYEOLQIL.js +2 -0
  81. package/dist/chunk-RYEOLQIL.js.map +1 -0
  82. package/dist/{chunk-FZ2HS6G7.js → chunk-S4XU4SE7.js} +1 -1
  83. package/dist/chunk-S4XU4SE7.js.map +1 -0
  84. package/dist/chunk-SIJ5SUY6.js +2 -0
  85. package/dist/chunk-SIJ5SUY6.js.map +1 -0
  86. package/dist/chunk-SJPBIRXM.js +2 -0
  87. package/dist/chunk-SJPBIRXM.js.map +1 -0
  88. package/dist/chunk-T5NPHXFC.js +2 -0
  89. package/dist/chunk-T5NPHXFC.js.map +1 -0
  90. package/dist/chunk-TPRGCMIZ.js +2 -0
  91. package/dist/chunk-TPRGCMIZ.js.map +1 -0
  92. package/dist/chunk-TZFGLE7X.js +2 -0
  93. package/dist/chunk-TZFGLE7X.js.map +1 -0
  94. package/dist/chunk-U4M5QBBG.js +2 -0
  95. package/dist/chunk-U4M5QBBG.js.map +1 -0
  96. package/dist/chunk-UEKXODGJ.js +2 -0
  97. package/dist/chunk-UEKXODGJ.js.map +1 -0
  98. package/dist/chunk-V2NCE4LO.js +2 -0
  99. package/dist/chunk-V2NCE4LO.js.map +1 -0
  100. package/dist/chunk-VI7WS34A.js +2 -0
  101. package/dist/chunk-VI7WS34A.js.map +1 -0
  102. package/dist/chunk-W5DS5Q4J.js +2 -0
  103. package/dist/chunk-W5DS5Q4J.js.map +1 -0
  104. package/dist/{chunk-D3SD6MMV.js → chunk-WEIRXEXU.js} +2 -2
  105. package/dist/chunk-WU77JQYU.js +2 -0
  106. package/dist/chunk-WU77JQYU.js.map +1 -0
  107. package/dist/chunk-WVJDCDGZ.js +2 -0
  108. package/dist/chunk-WVJDCDGZ.js.map +1 -0
  109. package/dist/{chunk-OLJ2S6A6.js → chunk-YG5FFTC4.js} +1 -1
  110. package/dist/chunk-YG5FFTC4.js.map +1 -0
  111. package/dist/{chunk-GOLOL2V6.js → chunk-YSIEXMDD.js} +2 -2
  112. package/dist/chunk-YSIEXMDD.js.map +1 -0
  113. package/dist/chunk-YXVLPPO2.js +2 -0
  114. package/dist/{chunk-DZSZOC2G.js.map → chunk-YXVLPPO2.js.map} +1 -1
  115. package/dist/flows/ContractAmendment/ContractAmendmentBack.d.ts +3 -2
  116. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  117. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +5 -5
  118. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  119. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +5 -4
  120. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  121. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +5 -5
  122. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  123. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.d.ts +3 -2
  124. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  125. package/dist/flows/ContractAmendment/context.d.ts +5 -5
  126. package/dist/flows/ContractAmendment/hooks.d.ts +4 -4
  127. package/dist/flows/ContractAmendment/hooks.js +1 -1
  128. package/dist/flows/ContractAmendment/index.d.ts +3 -2
  129. package/dist/flows/ContractAmendment/index.js +1 -1
  130. package/dist/flows/ContractAmendment/types.d.ts +1 -1
  131. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  132. package/dist/flows/ContractAmendment/utils.js +1 -1
  133. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.d.ts +2 -2
  134. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  135. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +5 -4
  136. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  137. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +9 -5
  138. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  139. package/dist/flows/CostCalculator/CostCalculatorResetButton.d.ts +3 -2
  140. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  141. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.d.ts +3 -2
  142. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  143. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +2 -2
  144. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  145. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +2 -2
  146. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  147. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +2 -2
  148. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  149. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +3 -3
  150. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  151. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.d.ts +2 -2
  152. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  153. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js.map +1 -1
  154. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.d.ts +2 -2
  155. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  156. package/dist/flows/CostCalculator/context.d.ts +9 -6
  157. package/dist/flows/CostCalculator/context.js +1 -1
  158. package/dist/flows/CostCalculator/hooks.d.ts +4 -3
  159. package/dist/flows/CostCalculator/hooks.js +1 -1
  160. package/dist/flows/CostCalculator/index.d.ts +5 -1
  161. package/dist/flows/CostCalculator/index.js +1 -1
  162. package/dist/flows/CostCalculator/types.d.ts +12 -2
  163. package/dist/flows/CostCalculator/utils.d.ts +8 -4
  164. package/dist/flows/CostCalculator/utils.js +1 -1
  165. package/dist/flows/Onboarding/BasicInformationStep.d.ts +4 -4
  166. package/dist/flows/Onboarding/BasicInformationStep.js +1 -1
  167. package/dist/flows/Onboarding/BenefitsStep.d.ts +8 -6
  168. package/dist/flows/Onboarding/BenefitsStep.js +1 -1
  169. package/dist/flows/Onboarding/ContractDetailsStep.d.ts +3 -3
  170. package/dist/flows/Onboarding/ContractDetailsStep.js +1 -1
  171. package/dist/flows/Onboarding/OnboardingBack.d.ts +4 -2
  172. package/dist/flows/Onboarding/OnboardingBack.js +1 -1
  173. package/dist/flows/Onboarding/OnboardingFlow.d.ts +17 -6
  174. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  175. package/dist/flows/Onboarding/OnboardingForm.d.ts +6 -4
  176. package/dist/flows/Onboarding/OnboardingForm.js +1 -1
  177. package/dist/flows/Onboarding/OnboardingInvite.d.ts +15 -8
  178. package/dist/flows/Onboarding/OnboardingInvite.js +1 -1
  179. package/dist/flows/Onboarding/OnboardingSubmit.d.ts +3 -2
  180. package/dist/flows/Onboarding/OnboardingSubmit.js +1 -1
  181. package/dist/flows/Onboarding/ReviewStep.d.ts +38 -0
  182. package/dist/flows/Onboarding/ReviewStep.js +2 -0
  183. package/dist/flows/Onboarding/ReviewStep.js.map +1 -0
  184. package/dist/flows/Onboarding/SelectCountryStep.d.ts +15 -0
  185. package/dist/flows/Onboarding/SelectCountryStep.js +2 -0
  186. package/dist/flows/Onboarding/SelectCountryStep.js.map +1 -0
  187. package/dist/flows/Onboarding/api.d.ts +113 -0
  188. package/dist/flows/Onboarding/api.js +2 -0
  189. package/dist/flows/Onboarding/api.js.map +1 -0
  190. package/dist/flows/Onboarding/context.d.ts +44 -8
  191. package/dist/flows/Onboarding/context.js +1 -1
  192. package/dist/flows/Onboarding/hooks.d.ts +59 -25
  193. package/dist/flows/Onboarding/hooks.js +1 -1
  194. package/dist/flows/Onboarding/index.d.ts +10 -5
  195. package/dist/flows/Onboarding/index.js +1 -1
  196. package/dist/flows/Onboarding/json-schemas/selectCountryStep.d.ts +24 -0
  197. package/dist/flows/Onboarding/json-schemas/selectCountryStep.js +2 -0
  198. package/dist/flows/Onboarding/json-schemas/selectCountryStep.js.map +1 -0
  199. package/dist/flows/Onboarding/types.d.ts +18 -3
  200. package/dist/flows/Onboarding/utils.d.ts +23 -3
  201. package/dist/flows/Onboarding/utils.js +1 -1
  202. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  203. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  204. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +3 -3
  205. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  206. package/dist/flows/Termination/PaidTimeOffForm.d.ts +3 -3
  207. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  208. package/dist/flows/Termination/TerminationBack.d.ts +3 -2
  209. package/dist/flows/Termination/TerminationBack.js +1 -1
  210. package/dist/flows/Termination/TerminationDetailsForm.d.ts +3 -3
  211. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  212. package/dist/flows/Termination/TerminationFlow.d.ts +6 -4
  213. package/dist/flows/Termination/TerminationFlow.js +1 -1
  214. package/dist/flows/Termination/TerminationForm.d.ts +3 -3
  215. package/dist/flows/Termination/TerminationForm.js +1 -1
  216. package/dist/flows/Termination/TerminationSubmit.d.ts +3 -2
  217. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  218. package/dist/flows/Termination/TimeOff.d.ts +4 -4
  219. package/dist/flows/Termination/TimeOff.js +1 -1
  220. package/dist/flows/Termination/context.d.ts +5 -4
  221. package/dist/flows/Termination/hooks.d.ts +3 -2
  222. package/dist/flows/Termination/hooks.js +1 -1
  223. package/dist/flows/Termination/index.d.ts +3 -1
  224. package/dist/flows/Termination/index.js +1 -1
  225. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  226. package/dist/flows/Termination/types.d.ts +1 -1
  227. package/dist/flows/Termination/utils.d.ts +1 -1
  228. package/dist/flows/Termination/utils.js +1 -1
  229. package/dist/flows/types.d.ts +1 -1
  230. package/dist/flows/useStepState.d.ts +19 -6
  231. package/dist/flows/useStepState.js +1 -1
  232. package/dist/flows/utils.d.ts +3 -11
  233. package/dist/flows/utils.js +1 -1
  234. package/dist/index.css +1 -1
  235. package/dist/index.css.map +1 -1
  236. package/dist/index.d.ts +16 -8
  237. package/dist/index.js +1 -1
  238. package/dist/index.js.map +1 -1
  239. package/dist/{remoteFlows-CswYencu.d.ts → remoteFlows-D0i6pVe5.d.ts} +49 -25
  240. package/dist/types-CxSFjQw5.d.ts +3 -0
  241. package/dist/{types.gen-CsMdyQkb.d.ts → types.gen-Ctv2nomK.d.ts} +268 -2
  242. package/package.json +18 -3
  243. package/dist/chunk-2PXGLWCY.js +0 -2
  244. package/dist/chunk-2PXGLWCY.js.map +0 -1
  245. package/dist/chunk-36UPHOJS.js +0 -2
  246. package/dist/chunk-36UPHOJS.js.map +0 -1
  247. package/dist/chunk-3FVI5JIC.js +0 -2
  248. package/dist/chunk-56BNVYTD.js +0 -2
  249. package/dist/chunk-6A3F6JG6.js +0 -2
  250. package/dist/chunk-6A3F6JG6.js.map +0 -1
  251. package/dist/chunk-6TYJC6YS.js +0 -2
  252. package/dist/chunk-6TYJC6YS.js.map +0 -1
  253. package/dist/chunk-7CYG2RHP.js +0 -2
  254. package/dist/chunk-7CYG2RHP.js.map +0 -1
  255. package/dist/chunk-ABR3B66K.js +0 -2
  256. package/dist/chunk-ABR3B66K.js.map +0 -1
  257. package/dist/chunk-ALRU77S5.js +0 -2
  258. package/dist/chunk-ALRU77S5.js.map +0 -1
  259. package/dist/chunk-CFRYIKSR.js +0 -2
  260. package/dist/chunk-CFRYIKSR.js.map +0 -1
  261. package/dist/chunk-CKEVRQRG.js +0 -2
  262. package/dist/chunk-CKEVRQRG.js.map +0 -1
  263. package/dist/chunk-DE5FSFYL.js +0 -2
  264. package/dist/chunk-DGPRFQYK.js +0 -2
  265. package/dist/chunk-DGPRFQYK.js.map +0 -1
  266. package/dist/chunk-DHRIURRT.js +0 -2
  267. package/dist/chunk-DHRIURRT.js.map +0 -1
  268. package/dist/chunk-DZSZOC2G.js +0 -2
  269. package/dist/chunk-EAAIAMTY.js +0 -2
  270. package/dist/chunk-EAAIAMTY.js.map +0 -1
  271. package/dist/chunk-ED3CBUQL.js +0 -2
  272. package/dist/chunk-ED3CBUQL.js.map +0 -1
  273. package/dist/chunk-FMT2OTOL.js +0 -2
  274. package/dist/chunk-FMT2OTOL.js.map +0 -1
  275. package/dist/chunk-FZ2HS6G7.js.map +0 -1
  276. package/dist/chunk-GFBF55NR.js +0 -2
  277. package/dist/chunk-GGAS4ZNQ.js +0 -2
  278. package/dist/chunk-GGAS4ZNQ.js.map +0 -1
  279. package/dist/chunk-GMGKIQLI.js +0 -2
  280. package/dist/chunk-GOLOL2V6.js.map +0 -1
  281. package/dist/chunk-GRYAM4FZ.js +0 -2
  282. package/dist/chunk-GRYAM4FZ.js.map +0 -1
  283. package/dist/chunk-HEPL5WDF.js +0 -2
  284. package/dist/chunk-HEPL5WDF.js.map +0 -1
  285. package/dist/chunk-HSW5HMHH.js +0 -2
  286. package/dist/chunk-IDSJI7KQ.js +0 -2
  287. package/dist/chunk-J55S4SEH.js +0 -2
  288. package/dist/chunk-J55S4SEH.js.map +0 -1
  289. package/dist/chunk-JBG4RVXQ.js +0 -2
  290. package/dist/chunk-JBG4RVXQ.js.map +0 -1
  291. package/dist/chunk-KH6QS5OU.js +0 -2
  292. package/dist/chunk-KH6QS5OU.js.map +0 -1
  293. package/dist/chunk-KQH5HLN5.js +0 -2
  294. package/dist/chunk-KQH5HLN5.js.map +0 -1
  295. package/dist/chunk-KSGPQCSG.js +0 -2
  296. package/dist/chunk-KSGPQCSG.js.map +0 -1
  297. package/dist/chunk-LNKYOAKF.js +0 -2
  298. package/dist/chunk-LNKYOAKF.js.map +0 -1
  299. package/dist/chunk-M7WCW7WD.js +0 -2
  300. package/dist/chunk-M7WCW7WD.js.map +0 -1
  301. package/dist/chunk-MESREYTZ.js +0 -2
  302. package/dist/chunk-MHKNAQLP.js +0 -2
  303. package/dist/chunk-MHKNAQLP.js.map +0 -1
  304. package/dist/chunk-MIHU6CEZ.js +0 -2
  305. package/dist/chunk-MIHU6CEZ.js.map +0 -1
  306. package/dist/chunk-NE547PW4.js +0 -2
  307. package/dist/chunk-NE547PW4.js.map +0 -1
  308. package/dist/chunk-OLJ2S6A6.js.map +0 -1
  309. package/dist/chunk-PNXZHV6W.js +0 -2
  310. package/dist/chunk-PNXZHV6W.js.map +0 -1
  311. package/dist/chunk-PWKM2R6V.js +0 -2
  312. package/dist/chunk-PWKM2R6V.js.map +0 -1
  313. package/dist/chunk-Q64URAIN.js +0 -2
  314. package/dist/chunk-Q64URAIN.js.map +0 -1
  315. package/dist/chunk-QSHYMFMY.js +0 -2
  316. package/dist/chunk-QSHYMFMY.js.map +0 -1
  317. package/dist/chunk-S4FKLPBB.js +0 -2
  318. package/dist/chunk-S4FKLPBB.js.map +0 -1
  319. package/dist/chunk-S56EWAS4.js +0 -2
  320. package/dist/chunk-S56EWAS4.js.map +0 -1
  321. package/dist/chunk-SLD7DFLW.js +0 -2
  322. package/dist/chunk-SLD7DFLW.js.map +0 -1
  323. package/dist/chunk-UECSVYQ5.js.map +0 -1
  324. package/dist/chunk-VRQXHCFR.js +0 -2
  325. package/dist/chunk-VRQXHCFR.js.map +0 -1
  326. package/dist/chunk-WQHKB5T7.js +0 -2
  327. package/dist/chunk-WQHKB5T7.js.map +0 -1
  328. package/dist/chunk-WS3C3WIJ.js +0 -2
  329. package/dist/chunk-WS3C3WIJ.js.map +0 -1
  330. package/dist/chunk-XLFHHYVS.js +0 -2
  331. package/dist/chunk-XLFHHYVS.js.map +0 -1
  332. package/dist/chunk-YOC3VDC7.js +0 -2
  333. package/dist/chunk-YOC3VDC7.js.map +0 -1
  334. /package/dist/{chunk-HSW5HMHH.js.map → chunk-2Y22JKVE.js.map} +0 -0
  335. /package/dist/{chunk-QOMUXX6W.js.map → chunk-3PH5E6CZ.js.map} +0 -0
  336. /package/dist/{chunk-D3SD6MMV.js.map → chunk-WEIRXEXU.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-M22FKNEY.js";import{a as te}from"./chunk-DZSZOC2G.js";import"./chunk-GGAS4ZNQ.js";import"./chunk-HSW5HMHH.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-JODJFARP.js";import"./chunk-WWANHPT7.js";import"./chunk-W5DG5WWJ.js";import"./chunk-FZ2HS6G7.js";import"./chunk-SLD7DFLW.js";import"./chunk-CKEVRQRG.js";import"./chunk-YOC3VDC7.js";import"./chunk-6TYJC6YS.js";import"./chunk-KSGPQCSG.js";import"./chunk-D3SD6MMV.js";import"./chunk-FGBEOUQK.js";import{a as E}from"./chunk-S4FKLPBB.js";import"./chunk-GMGKIQLI.js";import"./chunk-WQHKB5T7.js";import"./chunk-KH6QS5OU.js";import"./chunk-J55S4SEH.js";import"./chunk-3FVI5JIC.js";import"./chunk-6A3F6JG6.js";import"./chunk-MESREYTZ.js";import"./chunk-JBG4RVXQ.js";import"./chunk-Q64URAIN.js";import"./chunk-DZYFSFZ7.js";import"./chunk-GULCZWSK.js";import{a as S}from"./chunk-DGPRFQYK.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as z}from"./chunk-DE5FSFYL.js";import{b as y,c as k,e as C}from"./chunk-GRYAM4FZ.js";import"./chunk-UPRUP24B.js";import{a as P}from"./chunk-PNXZHV6W.js";import{a as R}from"./chunk-7CYG2RHP.js";import{a as F}from"./chunk-EAAIAMTY.js";import"./chunk-OLJ2S6A6.js";import{a as oe}from"./chunk-PWKM2R6V.js";import"./chunk-QSHYMFMY.js";import"./chunk-M7WCW7WD.js";import"./chunk-ALRU77S5.js";import"./chunk-MHKNAQLP.js";import"./chunk-NE547PW4.js";import"./chunk-2PXGLWCY.js";import"./chunk-A7ZJQCNU.js";import"./chunk-CFRYIKSR.js";import"./chunk-ED3CBUQL.js";import"./chunk-LNKYOAKF.js";import"./chunk-WS3C3WIJ.js";import"./chunk-36UPHOJS.js";import{a as ae}from"./chunk-KQH5HLN5.js";import{a as H}from"./chunk-XLFHHYVS.js";import{a as re}from"./chunk-GOLOL2V6.js";import{a as J,b as ee}from"./chunk-QOMUXX6W.js";import"./chunk-JRQSZHUU.js";import{a as p}from"./chunk-DHRIURRT.js";import"./chunk-UECSVYQ5.js";import"./chunk-S56EWAS4.js";import"./chunk-FMT2OTOL.js";import{a as Z}from"./chunk-ABR3B66K.js";import{a as $}from"./chunk-HEPL5WDF.js";import"./chunk-A4RX3KRZ.js";import"./chunk-MIHU6CEZ.js";import"./chunk-GFBF55NR.js";import{a as g,c as v}from"./chunk-WRDKLT4N.js";import"./chunk-56BNVYTD.js";import"./chunk-VRQXHCFR.js";import"./chunk-IDSJI7KQ.js";import"./chunk-6HGUGIYJ.js";import{c as T}from"./chunk-5ETXP2QF.js";import{a}from"./chunk-AYDF3IFZ.js";import{QueryClient as L,QueryClientProvider as q}from"@tanstack/react-query";import n from"react";function l(e){let r=document.documentElement;Object.keys(e).forEach(t=>{let o=e[t];o&&r.style.setProperty(t,o)})}a(l,"setCssProperties");function B(e){let r={};return Object.keys(e).forEach(t=>{r[`--${t}`]=e[t]}),r}a(B,"mapThemeColors");function j(e){return{"--spacing":e}}a(j,"mapThemeSpacing");function M(e){return{"--radius":e}}a(M,"mapThemeBorderRadius");function I(e){return{"--fontSizeBase":e.fontSizeBase}}a(I,"mapThemeFont");function u(e){e?.colors&&l(B(e.colors)),e?.spacing&&l(j(e.spacing)),e?.borderRadius&&l(M(e.borderRadius)),e?.font&&l(I(e.font))}a(u,"applyTheme");import A,{createContext as N,useEffect as O,useMemo as U}from"react";var D=N({theme:{}});function h(e){O(()=>{e.theme&&Object.keys(e.theme).length>0&&u(e.theme)},[e.theme]);let r=U(()=>({theme:e.theme}),[e.theme]);return A.createElement(D.Provider,{value:r},e.children)}a(h,"ThemeProvider");var m={staging:"https://gateway.niceremote.com",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com"};import{createClient as K}from"@hey-api/client-fetch";import{useQuery as V}from"@tanstack/react-query";import{useRef as f}from"react";function W(e){try{return new URL(e),!0}catch{return!1}}a(W,"isValidUrl");var w=a(({auth:e,options:r})=>{let t=f(null),{refetch:o}=V({queryKey:["auth"],queryFn:e,enabled:!1}),s=r.isTestingMode?m.partners:"https://gateway.remote.com",c=p.getConfig(),b="0.4.0-alpha.1",d=!!r.proxy&&W(r.proxy.url);return r.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),f(K({...c,headers:{...c.headers,...d?r.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":b},baseUrl:d?r.proxy?.url:s,auth:a(async()=>{function x(i){return!i||Date.now()+6e4>i}if(a(x,"hasTokenExpired"),!t.current||x(t.current.expiresAt)){let{data:i}=await o();i&&(t.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return t.current?.accessToken},"auth")}))},"useAuth");var Q=new L;function X({children:e,auth:r,isTestingMode:t,proxy:o}){let s=w({auth:r,options:{isTestingMode:!!t,proxy:o}});return n.createElement(v.Provider,{value:{client:s.current}},e)}a(X,"RemoteFlowContextWrapper");function Y({children:e,components:r}){return n.createElement(g.Provider,{value:r?{components:r}:{components:{}}},e)}a(Y,"FormFieldsProvider");function G({auth:e,children:r,components:t,isTestingMode:o=!1,theme:s,proxy:c}){return n.createElement(q,{client:Q},n.createElement(Y,{components:t},n.createElement(X,{isTestingMode:o,auth:e,proxy:c},n.createElement(h,{theme:s},r))))}a(G,"RemoteFlows");export{Z as ContractAmendmentConfirmationForm,ae as ContractAmendmentFlow,$ as ContractAmendmentForm,H as ContractAmendmentSubmit,S as CostCalculatorDisclaimer,z as CostCalculatorFlow,P as CostCalculatorForm,R as CostCalculatorResetButton,E as CostCalculatorResults,F as CostCalculatorSubmitButton,oe as OnboardingFlow,G as RemoteFlows,te as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,T as transformYupErrorsIntoObject,re as useContractAmendment,C as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,ee as useTimeOffQuery};
1
+ import"./chunk-M22FKNEY.js";import{a as tr}from"./chunk-YXVLPPO2.js";import"./chunk-55SA3TEF.js";import"./chunk-WEIRXEXU.js";import"./chunk-DP4SIYAC.js";import"./chunk-XFD3ULUF.js";import"./chunk-WWANHPT7.js";import"./chunk-2Y22JKVE.js";import"./chunk-JODJFARP.js";import"./chunk-W5DG5WWJ.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-S4XU4SE7.js";import"./chunk-V2NCE4LO.js";import"./chunk-OKAOH4ER.js";import"./chunk-7KUKFRKC.js";import"./chunk-UEKXODGJ.js";import"./chunk-B4SVITZI.js";import"./chunk-T5NPHXFC.js";import"./chunk-DZYFSFZ7.js";import"./chunk-GULCZWSK.js";import{a as or}from"./chunk-PMLMQNSO.js";import"./chunk-4A6ZQNMB.js";import"./chunk-JJPI2YDM.js";import"./chunk-6I6RMJXC.js";import"./chunk-RYEOLQIL.js";import"./chunk-TZFGLE7X.js";import"./chunk-LJRUD43L.js";import"./chunk-VI7WS34A.js";import"./chunk-WVJDCDGZ.js";import"./chunk-SIJ5SUY6.js";import"./chunk-HJBXUPHM.js";import"./chunk-MGUDZTTV.js";import"./chunk-SJPBIRXM.js";import"./chunk-PJMKZ3HR.js";import"./chunk-O562EWKG.js";import"./chunk-FGBEOUQK.js";import{a as E}from"./chunk-HBH2PSYQ.js";import"./chunk-P5VTRXW3.js";import"./chunk-4YNOSVYQ.js";import"./chunk-QHN4PPHD.js";import"./chunk-HSY5OO7D.js";import"./chunk-PH5CQN7X.js";import"./chunk-OIXUBXFU.js";import"./chunk-IAHI4OUM.js";import{a as R}from"./chunk-LTDDSH45.js";import{a as z}from"./chunk-IKQ25VV5.js";import{a as F}from"./chunk-FB4QOGWE.js";import"./chunk-A7ZJQCNU.js";import{a as B}from"./chunk-U4M5QBBG.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as T}from"./chunk-DBIPVIBO.js";import"./chunk-YG5FFTC4.js";import{b as y,c as k,e as C}from"./chunk-WU77JQYU.js";import"./chunk-UPRUP24B.js";import"./chunk-G7BISHWK.js";import{a as er}from"./chunk-W5DS5Q4J.js";import{a as H}from"./chunk-NF5IMQEW.js";import{a as ar}from"./chunk-YSIEXMDD.js";import{a as J,b as rr}from"./chunk-3PH5E6CZ.js";import"./chunk-JRQSZHUU.js";import"./chunk-O3QLBSMV.js";import{a as p}from"./chunk-GMU3QGAR.js";import"./chunk-INAXCFVC.js";import"./chunk-GFWQG4ZT.js";import{a as G}from"./chunk-6T3A6GWH.js";import{a as Z}from"./chunk-L5OIK2ZJ.js";import"./chunk-EGDD73PU.js";import"./chunk-NEFNFYRS.js";import"./chunk-A4RX3KRZ.js";import"./chunk-EMVYCKDC.js";import{a as g,c as v}from"./chunk-WRDKLT4N.js";import"./chunk-ONZPO4GN.js";import"./chunk-TPRGCMIZ.js";import"./chunk-6HGUGIYJ.js";import{c as P}from"./chunk-5ETXP2QF.js";import{a as e}from"./chunk-AYDF3IFZ.js";import{QueryClient as L,QueryClientProvider as q}from"@tanstack/react-query";function l(r){let a=document.documentElement;Object.keys(r).forEach(t=>{let o=r[t];o&&a.style.setProperty(t,o)})}e(l,"setCssProperties");function S(r){let a={};return Object.keys(r).forEach(t=>{a[`--${t}`]=r[t]}),a}e(S,"mapThemeColors");function j(r){return{"--spacing":r}}e(j,"mapThemeSpacing");function M(r){return{"--radius":r}}e(M,"mapThemeBorderRadius");function O(r){return{"--fontSizeBase":r.fontSizeBase}}e(O,"mapThemeFont");function h(r){r?.colors&&l(S(r.colors)),r?.spacing&&l(j(r.spacing)),r?.borderRadius&&l(M(r.borderRadius)),r?.font&&l(O(r.font))}e(h,"applyTheme");import{createContext as A,useEffect as D,useMemo as I}from"react";import{jsx as K}from"react/jsx-runtime";var N=A({theme:{}});function u(r){D(()=>{r.theme&&Object.keys(r.theme).length>0&&h(r.theme)},[r.theme]);let a=I(()=>({theme:r.theme}),[r.theme]);return K(N.Provider,{value:a,children:r.children})}e(u,"ThemeProvider");var w={staging:"https://gateway.niceremote.com",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com"};import{createClient as U}from"@hey-api/client-fetch";import{useQuery as V}from"@tanstack/react-query";import{useRef as m}from"react";function W(r){try{return new URL(r),!0}catch{return!1}}e(W,"isValidUrl");var f=e(({auth:r,options:a})=>{let t=m(null),{refetch:o}=V({queryKey:["auth"],queryFn:r,enabled:!1}),c=a.isTestingMode?w.partners:"https://gateway.remote.com",s=p.getConfig(),x="0.4.0-alpha.10",d=!!a.proxy&&W(a.proxy.url);return a.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),m(U({...s,headers:{...s.headers,...d?a.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":x},baseUrl:d?a.proxy?.url:c,auth:e(async()=>{function b(i){return!i||Date.now()+6e4>i}if(e(b,"hasTokenExpired"),!t.current||b(t.current.expiresAt)){let{data:i}=await o();i&&(t.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return t.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var Q=new L;function X({children:r,auth:a,isTestingMode:t,proxy:o}){let c=f({auth:a,options:{isTestingMode:!!t,proxy:o}});return n(v.Provider,{value:{client:c.current},children:r})}e(X,"RemoteFlowContextWrapper");function Y({children:r,components:a}){return n(g.Provider,{value:a?{components:a}:{components:{}},children:r})}e(Y,"FormFieldsProvider");function $({auth:r,children:a,components:t,isTestingMode:o=!1,theme:c,proxy:s}){return n(q,{client:Q,children:n(Y,{components:t,children:n(X,{isTestingMode:o,auth:r,proxy:s,children:n(u,{theme:c,children:a})})})})}e($,"RemoteFlows");export{G as ContractAmendmentConfirmationForm,er as ContractAmendmentFlow,Z as ContractAmendmentForm,H as ContractAmendmentSubmit,B as CostCalculatorDisclaimer,T as CostCalculatorFlow,R as CostCalculatorForm,z as CostCalculatorResetButton,E as CostCalculatorResults,F as CostCalculatorSubmitButton,or as OnboardingFlow,$ as RemoteFlows,tr as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,P as transformYupErrorsIntoObject,ar as useContractAmendment,C as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,rr as useTimeOffQuery};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n isTestingMode?: RemoteFlowsSDKProps['isTestingMode'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n isTestingMode,\n proxy,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n isTestingMode: !!isTestingMode,\n proxy,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n isTestingMode = false,\n theme,\n proxy,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n isTestingMode={isTestingMode}\n auth={auth}\n proxy={proxy}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport React, { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n staging: 'https://gateway.niceremote.com',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = {\n isTestingMode: boolean;\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options.isTestingMode\n ? ENVIRONMENTS.partners\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION;\n const isValidProxy = !!options.proxy && isValidUrl(options.proxy.url);\n\n if (options.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"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","names":["QueryClient","QueryClientProvider","React","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","React","createContext","useEffect","useMemo","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","React","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","isValidProxy","createClient","hasTokenExpired","expiresAt","data","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","isTestingMode","proxy","remoteApiClient","useAuth","React","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
1
+ {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n isTestingMode?: RemoteFlowsSDKProps['isTestingMode'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n isTestingMode,\n proxy,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n isTestingMode: !!isTestingMode,\n proxy,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n isTestingMode = false,\n theme,\n proxy,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n isTestingMode={isTestingMode}\n auth={auth}\n proxy={proxy}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n staging: 'https://gateway.niceremote.com',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = {\n isTestingMode: boolean;\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options.isTestingMode\n ? ENVIRONMENTS.partners\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION;\n const isValidProxy = !!options.proxy && isValidUrl(options.proxy.url);\n\n if (options.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"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","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","isTestingMode","proxy","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
@@ -1,6 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
3
3
  import { AnySchema } from 'yup';
4
+ import { S as SupportedTypes } from './types-CxSFjQw5.js';
4
5
 
5
6
  type ThemeProviderProps = PropsWithChildren<{
6
7
  theme?: Partial<{
@@ -24,8 +25,6 @@ type ThemeFont = {
24
25
  fontSizeBase: string;
25
26
  };
26
27
 
27
- type SupportedTypes = 'text' | 'number' | 'email' | 'select' | 'radio' | 'fieldset' | 'date' | 'checkbox' | 'textarea' | 'money' | 'file' | 'countries';
28
-
29
28
  type StatementProps = {
30
29
  title?: string;
31
30
  description: string;
@@ -59,30 +58,54 @@ type JSFField = {
59
58
  maxLength?: number;
60
59
  multiple?: boolean;
61
60
  };
61
+ /**
62
+ * Props for custom field components.
63
+ * All custom field components receive these three props from React Hook Form's Controller.
64
+ */
65
+ type FieldComponentProps = {
66
+ /**
67
+ * Field prop from React Hook Form's Controller component.
68
+ * Contains field state and methods for registration.
69
+ * You must bind these props to your HTML elements to ensure proper form state management.
70
+ * @see https://react-hook-form.com/docs/usecontroller/controller
71
+ */
72
+ field: ControllerRenderProps<FieldValues, string>;
73
+ /**
74
+ * Field state prop from React Hook Form's Controller component.
75
+ * Contains information about the field's state, such as errors, touched status, etc.
76
+ * @see https://react-hook-form.com/docs/usecontroller/controller
77
+ */
78
+ fieldState: ControllerFieldState;
79
+ /**
80
+ * Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
81
+ * Contains properties defined in the original JSON schema such as type, format, constraints, etc.
82
+ */
83
+ fieldData: Partial<JSFField>;
84
+ };
85
+ /**
86
+ * Props for custom button components.
87
+ */
88
+ type ButtonComponentProps = {
89
+ /**
90
+ * The form ID that the button should be associated with.
91
+ */
92
+ form?: string;
93
+ /**
94
+ * The children content of the button.
95
+ */
96
+ children?: React.ReactNode;
97
+ } & React.ButtonHTMLAttributes<HTMLButtonElement> & Record<string, unknown>;
98
+ /**
99
+ * Props for custom statement components.
100
+ */
101
+ type StatementComponentProps = {
102
+ data: StatementProps;
103
+ };
62
104
  type Components = {
63
- [K in SupportedTypes]?: React.ComponentType<{
64
- /**
65
- * Field prop from React Hook Form's Controller component.
66
- * Contains field state and methods for registration.
67
- * @see https://react-hook-form.com/docs/usecontroller/controller
68
- */
69
- field: ControllerRenderProps<FieldValues, string>;
70
- /**
71
- * Field state prop from React Hook Form's Controller component.
72
- * Contains information about the field's state, such as errors, touched status, etc.
73
- * @see https://react-hook-form.com/docs/usecontroller/controller
74
- */
75
- fieldState: ControllerFieldState;
76
- /**
77
- * Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
78
- * Contains properties defined in the original JSON schema such as type, format, constraints, etc.
79
- */
80
- fieldData: JSFField;
81
- }>;
105
+ [K in SupportedTypes]?: React.ComponentType<FieldComponentProps>;
82
106
  } & {
83
- statement?: React.ComponentType<{
84
- data: StatementProps;
85
- }>;
107
+ statement?: React.ComponentType<StatementComponentProps>;
108
+ button?: React.ComponentType<ButtonComponentProps>;
86
109
  };
87
110
  type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
88
111
  /**
@@ -112,5 +135,6 @@ type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
112
135
  };
113
136
  };
114
137
  };
138
+ type $TSFixMe = any;
115
139
 
116
- export type { Components as C, RemoteFlowsSDKProps as R };
140
+ export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, FieldComponentProps as F, RemoteFlowsSDKProps as R, StatementComponentProps as S };
@@ -0,0 +1,3 @@
1
+ type SupportedTypes = 'text' | 'number' | 'email' | 'select' | 'radio' | 'fieldset' | 'date' | 'checkbox' | 'textarea' | 'money' | 'file' | 'countries' | 'hidden' | 'work-schedule';
2
+
3
+ export type { SupportedTypes as S };
@@ -30,6 +30,14 @@ type TerminationOffboarding = {
30
30
  will_challenge_termination: boolean;
31
31
  will_challenge_termination_description?: string;
32
32
  };
33
+ /**
34
+ * Upsert benefit offers request. As its properties may vary depending on the employment,
35
+ * you must query the [Show benefit offers schema](#tag/benefits/operation/get_show_benefit_offer) endpoint
36
+ * passing the employment id
37
+ */
38
+ type UnifiedEmploymentUpsertBenefitOffersRequest = {
39
+ [key: string]: unknown;
40
+ };
33
41
  type MinimalCountry = {
34
42
  alpha_2_code: string;
35
43
  code: string;
@@ -297,6 +305,113 @@ type ShortId = string;
297
305
  *
298
306
  */
299
307
  type NullableApproverId = string | null;
308
+ /**
309
+ * Description of the basic required and onboarding tasks params to create an employment.
310
+ * You do not need to include all onboarding tasks when creating or updating an employment.
311
+ *
312
+ */
313
+ type EmploymentFullParams = {
314
+ /**
315
+ * Home address information. As its properties may vary depending on the country,
316
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
317
+ * passing the country code and `address_details` as path parameters.
318
+ */
319
+ address_details?: {
320
+ [key: string]: unknown;
321
+ };
322
+ /**
323
+ * Administrative information. As its properties may vary depending on the country,
324
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
325
+ * passing the country code and `administrative_details` as path parameters.
326
+ */
327
+ administrative_details?: {
328
+ [key: string]: unknown;
329
+ };
330
+ /**
331
+ * Bank account information. As its properties may vary depending on the country,
332
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
333
+ * passing the country code and `bank_account_details` as path parameters.
334
+ */
335
+ bank_account_details?: {
336
+ [key: string]: unknown;
337
+ };
338
+ /**
339
+ * Employment basic information. As its properties may vary depending on the country,
340
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
341
+ * passing the country code and `employment_basic_information` as path parameters.
342
+ */
343
+ basic_information?: {
344
+ [key: string]: unknown;
345
+ };
346
+ /**
347
+ * Billing address information. As its properties may vary depending on the country,
348
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
349
+ * passing the country code and `billing_address_details` as path parameters.
350
+ */
351
+ billing_address_details?: {
352
+ [key: string]: unknown;
353
+ };
354
+ company_id?: string;
355
+ /**
356
+ * Contract information. As its properties may vary depending on the country,
357
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
358
+ * passing the country code and `contract_details` as path parameters.
359
+ */
360
+ contract_details?: {
361
+ [key: string]: unknown;
362
+ };
363
+ country?: Country;
364
+ country_code?: string;
365
+ /**
366
+ * The department of the employment. The department must belong to the same company as the employment.
367
+ * When set to `null`, the employment will be unassigned from a department.
368
+ *
369
+ */
370
+ department_id?: string | null;
371
+ /**
372
+ * Emergency contact information. As its properties may vary depending on the country,
373
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
374
+ * passing the country code and `emergency_contact_details` as path parameters.
375
+ */
376
+ emergency_contact_details?: {
377
+ [key: string]: unknown;
378
+ };
379
+ /**
380
+ * A unique reference code for the employment record in a non-Remote system. This optional field links to external data sources. If not provided, it defaults to `null`. While uniqueness is recommended, it is not strictly enforced within Remote's system.
381
+ */
382
+ external_id?: string;
383
+ /**
384
+ * The user id of the manager, who should have an `admin`, `owner` or `people_manager` role.
385
+ * You can find these users by querying the [Company Managers endpoint](#operation/get_index_company_manager).
386
+ * **Update of this field is only available for active employments.**
387
+ *
388
+ */
389
+ manager_id?: string;
390
+ /**
391
+ * Personal details information. As its properties may vary depending on the country,
392
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
393
+ * passing the country code and `personal_details` as path parameters.
394
+ */
395
+ personal_details?: {
396
+ [key: string]: unknown;
397
+ };
398
+ /**
399
+ * Pricing plan details information. As its properties may vary depending on the country,
400
+ * you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
401
+ * passing the country code and `pricing_plan_details` as path parameters.
402
+ */
403
+ pricing_plan_details?: {
404
+ [key: string]: unknown;
405
+ };
406
+ /**
407
+ * If not provided, it will default to `employee`.
408
+ */
409
+ type?: 'employee' | 'contractor';
410
+ /**
411
+ * The work email of the employment.
412
+ */
413
+ work_email?: string;
414
+ };
300
415
  type OffboardingFile = {
301
416
  /**
302
417
  * The content in base64 encoding
@@ -485,6 +600,11 @@ type ListTimeoffResponse = {
485
600
  total_pages?: number;
486
601
  };
487
602
  };
603
+ type MagicLinkResponse = {
604
+ data: {
605
+ url: string;
606
+ };
607
+ };
488
608
  /**
489
609
  * The stage of employment lifecycle. When it's `onboarded` means the employee is ready to commence or has already commenced.
490
610
  */
@@ -540,11 +660,142 @@ type SuccessResponse = {
540
660
  status?: string;
541
661
  };
542
662
  };
663
+ /**
664
+ * Magic link params
665
+ */
666
+ type MagicLinkParams = {
667
+ /**
668
+ * The path to which the user will be redirected to after login. This field has a max length of 2000 characters.
669
+ *
670
+ * If not specified, `/dashboard` will be used by default.
671
+ *
672
+ * Must begin with a forward slash (`/`) and, at least one path segment is required (`/dashboard` e.g.).
673
+ * An ending forward slash (`/`) is not allowed and path segments can only include alphanumeric characters, underscore (`_`) and hyphen (`-`).
674
+ *
675
+ * An optional query string can be specified too. If present, the query string must start with a question mark (`?`)
676
+ * and must include at least one key value pair. Both, keys and values, can only include
677
+ * alphanumeric characters, underscore (`_`), hyphen (`-`) or percent encoded values such as `%20` (space character).
678
+ * Additional key value pairs are allowed using ampersand (`&`).
679
+ *
680
+ * Query keys require at least one alphanumeric, underscore (`_`), hyphen (`-`) or valid percent encoded.
681
+ * Query values are optional, the actual value may be empty and the equals sign (`=`) may be missing too.
682
+ *
683
+ * Some **Valid** examples for `path`:
684
+ * - o `/dashboard`
685
+ * - o `/dashboard/people/new/full_time/663e0b79-c893-45ff-a1b2-f6dcabc098b5`
686
+ * - o `/dashboard/people/hiring?filters%5B0%5D%5Bid%5D=exclude_linked_drafts&filters%5B0%5D%5Bvalue%5D=true`
687
+ * - o `/dashboard?key=value&foo=bar`
688
+ *
689
+ * Some **Invalid** examples for `path`:
690
+ * - x `missing_forward_slash`
691
+ * - x `/invalid//path`
692
+ * - x `//some`
693
+ * - x `/?key=value`
694
+ * - x `/some/i.n:valid*`
695
+ * - x `/invalid/end/slash/`
696
+ * - x `/some?malformed_percent_encoded_key%1=value`
697
+ *
698
+ */
699
+ path?: string;
700
+ user_id: UuidSlug;
701
+ } | {
702
+ employment_id: UuidSlug;
703
+ /**
704
+ * The path to which the user will be redirected to after login. This field has a max length of 2000 characters.
705
+ *
706
+ * If not specified, `/dashboard` will be used by default.
707
+ *
708
+ * Must begin with a forward slash (`/`) and, at least one path segment is required (`/dashboard` e.g.).
709
+ * An ending forward slash (`/`) is not allowed and path segments can only include alphanumeric characters, underscore (`_`) and hyphen (`-`).
710
+ *
711
+ * An optional query string can be specified too. If present, the query string must start with a question mark (`?`)
712
+ * and must include at least one key value pair. Both, keys and values, can only include
713
+ * alphanumeric characters, underscore (`_`), hyphen (`-`) or percent encoded values such as `%20` (space character).
714
+ * Additional key value pairs are allowed using ampersand (`&`).
715
+ *
716
+ * Query keys require at least one alphanumeric, underscore (`_`), hyphen (`-`) or valid percent encoded.
717
+ * Query values are optional, the actual value may be empty and the equals sign (`=`) may be missing too.
718
+ *
719
+ * Some **Valid** examples for `path`:
720
+ * - o `/dashboard`
721
+ * - o `/dashboard/people/new/full_time/663e0b79-c893-45ff-a1b2-f6dcabc098b5`
722
+ * - o `/dashboard/people/hiring?filters%5B0%5D%5Bid%5D=exclude_linked_drafts&filters%5B0%5D%5Bvalue%5D=true`
723
+ * - o `/dashboard?key=value&foo=bar`
724
+ *
725
+ * Some **Invalid** examples for `path`:
726
+ * - x `missing_forward_slash`
727
+ * - x `/invalid//path`
728
+ * - x `//some`
729
+ * - x `/?key=value`
730
+ * - x `/some/i.n:valid*`
731
+ * - x `/invalid/end/slash/`
732
+ * - x `/some?malformed_percent_encoded_key%1=value`
733
+ *
734
+ */
735
+ path?: string;
736
+ };
543
737
  type LeavePolicy = {
544
738
  leave_policy_variant_slug: string;
545
739
  leave_type: TimeoffType;
546
740
  name: string;
547
741
  };
742
+ type Company = {
743
+ /**
744
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
745
+ * Use the desired country and `address_details` as the form name for the placeholders.
746
+ * The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
747
+ *
748
+ */
749
+ address_details: {
750
+ [key: string]: unknown;
751
+ };
752
+ /**
753
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
754
+ * Use the desired country and `bank_account_details` as the form name for the placeholders.
755
+ * The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
756
+ *
757
+ */
758
+ bank_account_details?: {
759
+ [key: string]: unknown;
760
+ };
761
+ company_owner_email: string;
762
+ company_owner_name?: string;
763
+ company_owner_user_id: string;
764
+ country_code: string;
765
+ created_at: string;
766
+ /**
767
+ * The credit risk status of the company default legal entity.
768
+ * - `not_started`: The credit risk assessment has not started yet.
769
+ * - `ready`: The credit risk assessment is ready to be started.
770
+ * - `in_progress`: The automated credit risk assessment is in progress.
771
+ * - `referred`: The credit risk assessment has been referred to a human reviewer.
772
+ * - `fail`: The credit risk assessment has failed and the company will be archived.
773
+ * - `deposit_required`: The company default legal entity requires a deposit before onboarding new employees.
774
+ * - `no_deposit_required`: The company default legal entity does not require a deposit before onboarding new employees.
775
+ *
776
+ */
777
+ default_legal_entity_credit_risk_status: 'not_started' | 'ready' | 'in_progress' | 'referred' | 'fail' | 'deposit_required' | 'no_deposit_required';
778
+ desired_currency: string;
779
+ external_id?: string | null;
780
+ id: string;
781
+ name: string;
782
+ phone_number?: string;
783
+ registration_number?: string | null;
784
+ /**
785
+ * The company status determines what a company is allowed to do:
786
+ * - `pending`: The company has been created and the company owner invited. Remote is waiting for the company owner to complete onboarding.
787
+ * - `review`: The company is under review. In rare occasions, a company may not automatically get created in `active` status because Remote needs to
788
+ * manually review the company that was created. The company will become `active` once the review is completed and no further action is necessary
789
+ * through the Remote API.
790
+ * - `active`: The company owner has completed onboarding and the company is ready to employ.
791
+ * - `archived`: The company is no longer active on the Remote platform and no changes can be made to the company.
792
+ *
793
+ */
794
+ status: 'pending' | 'review' | 'active' | 'archived';
795
+ tax_number?: string | null;
796
+ terms_of_service_accepted_at: string;
797
+ updated_at: string;
798
+ };
548
799
  type TooManyRequestsResponse = {
549
800
  message?: string;
550
801
  };
@@ -689,7 +940,7 @@ type ParameterError = {
689
940
  param: string;
690
941
  };
691
942
  type GenericFile = Blob | File;
692
- type TimeoffType = 'paid_time_off' | 'sick_leave' | 'public_holiday' | 'unpaid_leave' | 'extended_leave' | 'in_lieu_time' | 'maternity_leave' | 'paternity_leave' | 'parental_leave' | 'bereavement' | 'military_leave' | 'other';
943
+ type TimeoffType = 'time_off' | 'sick_leave' | 'public_holiday' | 'unpaid_leave' | 'extended_leave' | 'in_lieu_time' | 'maternity_leave' | 'paternity_leave' | 'parental_leave' | 'bereavement' | 'military_leave' | 'other' | 'paid_time_off' | 'custom_company_leave' | 'rtt' | 'casual_leave' | 'rol' | 'ex_festivita';
693
944
  /**
694
945
  * The details of the salary decrease request if there is one
695
946
  */
@@ -867,6 +1118,21 @@ type PostCreateEstimationPdfErrors = {
867
1118
  422: UnprocessableEntityResponse;
868
1119
  };
869
1120
  type PostCreateEstimationPdfError = PostCreateEstimationPdfErrors[keyof PostCreateEstimationPdfErrors];
1121
+ type PostCreateRiskReserveErrors = {
1122
+ /**
1123
+ * Unauthorized
1124
+ */
1125
+ 401: UnauthorizedResponse;
1126
+ /**
1127
+ * Not Found
1128
+ */
1129
+ 404: NotFoundResponse;
1130
+ /**
1131
+ * Unprocessable Entity
1132
+ */
1133
+ 422: UnprocessableEntityResponse;
1134
+ };
1135
+ type PostCreateRiskReserveError = PostCreateRiskReserveErrors[keyof PostCreateRiskReserveErrors];
870
1136
  type PostCreateContractAmendmentErrors = {
871
1137
  /**
872
1138
  * Unauthorized
@@ -944,4 +1210,4 @@ type PostInviteEmploymentInvitationErrors = {
944
1210
  };
945
1211
  type PostInviteEmploymentInvitationError = PostInviteEmploymentInvitationErrors[keyof PostInviteEmploymentInvitationErrors];
946
1212
 
947
- export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, EmploymentCreationResponse as c, PostCreateEmployment2Error as d, EmploymentResponse as e, PatchUpdateEmployment2Error as f, PutUpdateBenefitOfferError as g, PostInviteEmploymentInvitationError as h, EmploymentCreateParams as i, CostCalculatorEstimateResponse as j, PostCreateEstimationError as k, CostCalculatorEstimatePdfResponse as l, PostCreateEstimationPdfError as m, CostCalculatorEstimateParams as n, EmploymentTermType as o, PostCreateOffboardingError as p, TimeoffStatus as q };
1213
+ export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, MagicLinkResponse as M, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, PostCreateEstimationError as d, CostCalculatorEstimatePdfResponse as e, PostCreateEstimationPdfError as f, CostCalculatorEstimateParams as g, EmploymentCreateParams as h, Employment as i, EmploymentTermType as j, PostCreateOffboardingError as k, EmploymentCreationResponse as l, PostCreateEmployment2Error as m, EmploymentResponse as n, PatchUpdateEmployment2Error as o, PutUpdateBenefitOfferError as p, Company as q, PostInviteEmploymentInvitationError as r, PostCreateRiskReserveError as s, EmploymentFullParams as t, UnprocessableEntityResponse as u, MagicLinkParams as v, TimeoffStatus as w, CostCalculatorEmployment as x, Currency as y };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "0.4.0-alpha.1",
3
+ "version": "0.4.0-alpha.10",
4
4
  "scripts": {
5
5
  "build": "NODE_ENV=production tsup",
6
6
  "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
7
7
  "check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm --exclude-entrypoints index.css",
8
8
  "check-format": "prettier --check .",
9
9
  "dev": "NODE_ENV=development tsup --watch",
10
+ "build:reset": "postcss src/styles/reset.css -o ./example/src/css/reset.css",
10
11
  "lint": "eslint .",
11
12
  "format": "prettier --write .",
12
13
  "openapi-ts": "openapi-ts",
@@ -16,7 +17,8 @@
16
17
  "changeset:version": "changeset version",
17
18
  "prepare": "npm run build",
18
19
  "prerelease": "npm run ci",
19
- "release": "changeset publish"
20
+ "release": "changeset publish",
21
+ "type-check": "tsc --noEmit"
20
22
  },
21
23
  "type": "module",
22
24
  "main": "dist/index.js",
@@ -72,7 +74,13 @@
72
74
  "cmdk": "^1.1.1",
73
75
  "date-fns": "^3.6.0",
74
76
  "dompurify": "^3.2.5",
75
- "lodash": "^4.17.21",
77
+ "lodash.capitalize": "^4.2.1",
78
+ "lodash.get": "^4.4.2",
79
+ "lodash.groupby": "^4.6.0",
80
+ "lodash.isnull": "^3.0.0",
81
+ "lodash.mergewith": "^4.6.2",
82
+ "lodash.omit": "^4.5.0",
83
+ "lodash.omitby": "^4.6.0",
76
84
  "lucide-react": "0.477.0",
77
85
  "postcss": "^8.5.3",
78
86
  "react-day-picker": "^8.10.1",
@@ -94,6 +102,13 @@
94
102
  "@testing-library/react": "^16.2.0",
95
103
  "@testing-library/user-event": "^14.6.1",
96
104
  "@types/jsdom": "^21.1.7",
105
+ "@types/lodash.capitalize": "^4.2.9",
106
+ "@types/lodash.get": "^4.4.9",
107
+ "@types/lodash.groupby": "^4.6.9",
108
+ "@types/lodash.isnull": "^3.0.9",
109
+ "@types/lodash.mergewith": "^4.6.9",
110
+ "@types/lodash.omit": "^4.5.9",
111
+ "@types/lodash.omitby": "^4.6.9",
97
112
  "@types/node": "^22.13.4",
98
113
  "@types/react": "^19.0.10",
99
114
  "@vitest/coverage-istanbul": "^3.0.8",
@@ -1,2 +0,0 @@
1
- var e={basic_information:{index:0,name:"basic_information"},contract_details:{index:1,name:"contract_details"},benefits:{index:2,name:"benefits"},review:{index:3,name:"review"}};export{e as a};
2
- //# sourceMappingURL=chunk-2PXGLWCY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/utils.ts"],"sourcesContent":["import { Step } from '@/src/flows/useStepState';\n\ntype StepKeys =\n | 'basic_information'\n | 'contract_details'\n | 'benefits'\n | 'review';\n\nexport const STEPS: Record<StepKeys, Step> = {\n basic_information: { index: 0, name: 'basic_information' },\n contract_details: { index: 1, name: 'contract_details' },\n benefits: { index: 2, name: 'benefits' },\n review: { index: 3, name: 'review' },\n} as const;\n"],"mappings":"AAQO,IAAMA,EAAgC,CAC3C,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,EACzD,iBAAkB,CAAE,MAAO,EAAG,KAAM,kBAAmB,EACvD,SAAU,CAAE,MAAO,EAAG,KAAM,UAAW,EACvC,OAAQ,CAAE,MAAO,EAAG,KAAM,QAAS,CACrC","names":["STEPS"]}
@@ -1,2 +0,0 @@
1
- import{a as o}from"./chunk-AYDF3IFZ.js";import{object as c}from"yup";function d(n){let t=n.reduce((e,r)=>(e[r.name]=r.schema,e),{});return c(t)}o(d,"buildValidationSchema");function u(n,t){return Object.entries(n).reduce((e,[r,a])=>(e[r]=t.includes(r)?a==="yes":a,e),{})}o(u,"parseFormRadioValues");export{d as a,u as b};
2
- //# sourceMappingURL=chunk-36UPHOJS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/utils.ts"],"sourcesContent":["import { AnyObjectSchema, object } from 'yup';\nimport { Field } from './types';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(fields: Field[]) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\ntype ParsedRadioValues = Record<string, unknown>;\n\n/**\n * Parses the form values to convert radio button values from 'yes'/'no' to boolean.\n *\n * @param values - The form values as a record of key-value pairs.\n * @param fieldKeys - An array of field keys that represent radio button fields.\n * @returns A new object with the parsed values, where radio button fields are converted to boolean.\n *\n * @example\n * const values = {\n * ack: 'yes',\n * confidential: 'no',\n * username: 'john_doe',\n * };\n * const fieldKeys = ['ack', 'confidential'];\n * const parsedValues = parseFormRadioValues(values, fieldKeys);\n * // Output: { ack: true, confidential: false, username: 'john_doe' }\n */\nexport function parseFormRadioValues(\n values: Record<string, unknown>,\n fieldKeys: string[],\n) {\n return Object.entries(values).reduce<ParsedRadioValues>(\n (acc, [key, value]) => {\n acc[key] = fieldKeys.includes(key) ? value === 'yes' : value;\n return acc;\n },\n {},\n );\n}\n"],"mappings":"wCAAA,OAA0B,UAAAA,MAAc,MAOjC,SAASC,EAAsBC,EAAiB,CACrD,IAAMC,EAAeD,EAAO,OAC1B,CAACE,EAAiBC,KAChBD,EAAgBC,EAAM,IAAI,EAAIA,EAAM,OAC7BD,GAET,CAAC,CACH,EACA,OAAOE,EAAOH,CAAY,CAC5B,CATgBI,EAAAN,EAAA,yBA8BT,SAASO,EACdC,EACAC,EACA,CACA,OAAO,OAAO,QAAQD,CAAM,EAAE,OAC5B,CAACE,EAAK,CAACC,EAAKC,CAAK,KACfF,EAAIC,CAAG,EAAIF,EAAU,SAASE,CAAG,EAAIC,IAAU,MAAQA,EAChDF,GAET,CAAC,CACH,CACF,CAXgBJ,EAAAC,EAAA","names":["object","buildValidationSchema","fields","fieldsSchema","fieldsSchemaAcc","field","object","__name","parseFormRadioValues","values","fieldKeys","acc","key","value"]}
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-5ETXP2QF.js";import{a as e}from"./chunk-AYDF3IFZ.js";import*as o from"react";import*as t from"@radix-ui/react-tooltip";function l({delayDuration:i=0,...r}){return o.createElement(t.Provider,{"data-slot":"tooltip-provider",delayDuration:i,...r})}e(l,"TooltipProvider");function d({...i}){return o.createElement(l,null,o.createElement(t.Root,{"data-slot":"tooltip",...i}))}e(d,"Tooltip");function s({...i}){return o.createElement(t.Trigger,{"data-slot":"tooltip-trigger",...i})}e(s,"TooltipTrigger");function f({className:i,sideOffset:r=0,children:p,...n}){return o.createElement(t.Portal,null,o.createElement(t.Content,{"data-slot":"tooltip-content",sideOffset:r,className:a("bg-primary text-primary-foreground shadow-md border animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",i),...n},p,o.createElement(t.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})))}e(f,"TooltipContent");export{l as a,d as b,s as c,f as d};
2
- //# sourceMappingURL=chunk-3FVI5JIC.js.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./chunk-5ETXP2QF.js";import{a as t}from"./chunk-AYDF3IFZ.js";import{Slot as d}from"@radix-ui/react-slot";import{cva as u}from"class-variance-authority";import*as o from"react";var p=u("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:ring-destructive/20 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-link-button-primary underline-offset-4 hover:underline button-link"},size:{default:"h-9 px-4 py-7 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9",link:"px-0"}},defaultVariants:{variant:"default",size:"default"}});function b({className:n,variant:r,size:a,asChild:s=!1,...i}){return o.createElement(s?d:"button",{"data-slot":"button",className:e(p({variant:r,size:a,className:n}),"RemoteFlows__Button"),...i})}t(b,"Button");export{p as a,b};
2
- //# sourceMappingURL=chunk-56BNVYTD.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-MESREYTZ.js";import{b as s}from"./chunk-5ETXP2QF.js";import{a as o}from"./chunk-AYDF3IFZ.js";import r from"react";function n({grossSalary:t,currency:e}){return r.createElement("div",null,r.createElement("div",{className:"flex justify-between items-center mb-2"},r.createElement("h3",{className:"font-medium text-primary-foreground"},"Gross Salary"),r.createElement("span",{className:"font-semibold text-lg"},s(t,e))),r.createElement(a,null))}o(n,"CostCalculatorGrossSalary");export{n as a};
2
- //# sourceMappingURL=chunk-6A3F6JG6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorGrossSalary.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\n\ntype CostCalculatorGrossSalaryProps = {\n grossSalary: number;\n currency: string;\n};\n\nexport function CostCalculatorGrossSalary({\n grossSalary,\n currency,\n}: CostCalculatorGrossSalaryProps) {\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground\">Gross Salary</h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(grossSalary, currency)}\n </span>\n </div>\n <Separator />\n </div>\n );\n}\n"],"mappings":"mHAAA,OAAOA,MAAW,QAUX,SAASC,EAA0B,CACxC,YAAAC,EACA,SAAAC,CACF,EAAmC,CACjC,OACEC,EAAA,cAAC,WACCA,EAAA,cAAC,OAAI,UAAU,0CACbA,EAAA,cAAC,MAAG,UAAU,uCAAsC,cAAY,EAChEA,EAAA,cAAC,QAAK,UAAU,yBACbC,EAAeH,EAAaC,CAAQ,CACvC,CACF,EACAC,EAAA,cAACE,EAAA,IAAU,CACb,CAEJ,CAfgBC,EAAAN,EAAA","names":["React","CostCalculatorGrossSalary","grossSalary","currency","React","formatCurrency","Separator","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-Q64URAIN.js";import{b as r}from"./chunk-DZYFSFZ7.js";import{a as o}from"./chunk-AYDF3IFZ.js";import a from"react";function p({onSubmit:n}){let{terminationBag:i}=r();return a.createElement(m,{onSubmit:o(async t=>{await n?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(p,"TerminationDetailsForm");export{p as a};
2
- //# sourceMappingURL=chunk-6TYJC6YS.js.map