@gusto/embedded-react-sdk 0.13.4 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/assets/icons/plus-circle.svg.js +10 -0
  3. package/dist/assets/icons/plus-circle.svg.js.map +1 -0
  4. package/dist/assets/icons/spinner_large.svg.js +10 -0
  5. package/dist/assets/icons/spinner_large.svg.js.map +1 -0
  6. package/dist/assets/icons/x-circle.svg.js +10 -0
  7. package/dist/assets/icons/x-circle.svg.js.map +1 -0
  8. package/dist/components/Common/Flex/Flex.js +16 -12
  9. package/dist/components/Common/Flex/Flex.js.map +1 -1
  10. package/dist/components/Common/Loading/Loading.d.ts +5 -1
  11. package/dist/components/Common/Loading/Loading.js +9 -9
  12. package/dist/components/Common/Loading/Loading.js.map +1 -1
  13. package/dist/components/Common/Loading/Loading.module.scss.js +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  16. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  17. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
  18. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +1 -1
  19. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.d.ts +3 -0
  20. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.js +25 -0
  21. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.js.map +1 -0
  22. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.module.scss.js +10 -0
  23. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.module.scss.js.map +1 -0
  24. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +18 -0
  25. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js +8 -0
  26. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -0
  27. package/dist/components/Common/UI/LoadingSpinner/index.d.ts +4 -0
  28. package/dist/components/Common/index.d.ts +1 -0
  29. package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -6
  30. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  31. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
  32. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  34. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +3 -2
  36. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
  38. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  40. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  41. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
  42. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  43. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +11 -10
  44. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  46. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -9
  47. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  48. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -9
  49. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  51. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  54. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  55. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +3 -2
  57. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  58. package/dist/components/Company/DocumentSigner/DocumentSigner.js +0 -1
  59. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  60. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -6
  61. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  62. package/dist/components/Company/FederalTaxes/Actions.js +5 -6
  63. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  64. package/dist/components/Company/FederalTaxes/FederalTaxes.js +13 -12
  65. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  66. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  67. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  68. package/dist/components/Company/Industry/Actions.js +2 -3
  69. package/dist/components/Company/Industry/Actions.js.map +1 -1
  70. package/dist/components/Company/Industry/Edit.js +4 -5
  71. package/dist/components/Company/Industry/Edit.js.map +1 -1
  72. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  73. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  74. package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
  75. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  76. package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -10
  77. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  78. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -7
  79. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationsList/List.js +9 -10
  81. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -6
  83. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  84. package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
  85. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  86. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
  87. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  88. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  89. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  90. package/dist/components/Company/PaySchedule/PaySchedule.js +34 -33
  91. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  92. package/dist/components/Company/PaySchedule/_parts/Actions.js +9 -10
  93. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  94. package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -16
  95. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  96. package/dist/components/Company/PaySchedule/_parts/Head.js +6 -7
  97. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  98. package/dist/components/Company/PaySchedule/_parts/List.js +14 -15
  99. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  100. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  101. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  102. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  103. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  104. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  105. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  106. package/dist/components/Contractor/Address/Address.js +5 -4
  107. package/dist/components/Contractor/Address/Address.js.map +1 -1
  108. package/dist/components/Contractor/Address/Form.js +4 -3
  109. package/dist/components/Contractor/Address/Form.js.map +1 -1
  110. package/dist/components/Contractor/ContractorList/index.js +17 -17
  111. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -6
  112. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  113. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  114. package/dist/components/Contractor/Submit/Submit.js +1 -1
  115. package/dist/components/Employee/Compensation/Actions.js +1 -1
  116. package/dist/components/Employee/Compensation/Compensation.js +144 -147
  117. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  118. package/dist/components/Employee/Compensation/Edit.js +38 -37
  119. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  120. package/dist/components/Employee/Compensation/List.js +22 -23
  121. package/dist/components/Employee/Compensation/List.js.map +1 -1
  122. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +8 -8
  123. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +9 -9
  124. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
  125. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -7
  126. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +8 -8
  127. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -7
  128. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  129. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -7
  130. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  131. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  132. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  133. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -9
  134. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  135. package/dist/components/Employee/EmployeeList/Actions.js +2 -3
  136. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  137. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  138. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  139. package/dist/components/Employee/EmployeeList/Head.js +5 -6
  140. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  141. package/dist/components/Employee/EmployeeList/List.js +14 -14
  142. package/dist/components/Employee/FederalTaxes/Actions.js +6 -7
  143. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  144. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -12
  145. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  146. package/dist/components/Employee/Landing/Landing.js +8 -8
  147. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  148. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  149. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  150. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
  151. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -9
  152. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  153. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  154. package/dist/components/Employee/Profile/Actions.js +6 -7
  155. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  156. package/dist/components/Employee/Profile/HomeAddress.js +6 -5
  157. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  158. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +22 -21
  159. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  160. package/dist/components/Employee/StateTaxes/Actions.js +7 -8
  161. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  162. package/dist/components/Employee/Taxes/Actions.js +8 -9
  163. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  164. package/dist/components/Employee/Taxes/FederalForm.js +12 -13
  165. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  166. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +6 -0
  167. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +32 -0
  168. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -0
  169. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +14 -0
  170. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +53 -0
  171. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -0
  172. package/dist/components/Payroll/PayrollBlocker/{PayrollBlockerList.d.ts → components/PayrollBlockerList.d.ts} +14 -1
  173. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +39 -0
  174. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -0
  175. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.module.scss.js +8 -0
  176. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.module.scss.js.map +1 -0
  177. package/dist/components/Payroll/PayrollBlocker/index.d.ts +4 -3
  178. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +27 -0
  179. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +39 -0
  180. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -0
  181. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +108 -66
  182. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  183. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +7 -2
  184. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +177 -124
  185. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  186. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +8 -0
  187. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -0
  188. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +39 -36
  189. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  190. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +66 -65
  191. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  192. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  193. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  194. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  195. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +32 -26
  196. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  197. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +1 -0
  198. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +72 -48
  199. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  200. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +10 -11
  201. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  202. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
  203. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -36
  204. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  205. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +15 -0
  206. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +62 -0
  207. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -0
  208. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +5 -0
  209. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +93 -0
  210. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -0
  211. package/dist/components/Payroll/PayrollList/PayrollList.d.ts +1 -1
  212. package/dist/components/Payroll/PayrollList/PayrollList.js +65 -24
  213. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  214. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +13 -1
  215. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +149 -52
  216. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  217. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -0
  218. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -0
  219. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +2 -1
  220. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +105 -77
  221. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  222. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  223. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +309 -263
  224. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  225. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  226. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +26 -12
  227. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  228. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  229. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +44 -41
  230. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  231. package/dist/components/Payroll/index.d.ts +1 -1
  232. package/dist/components/Payroll/index.js +6 -8
  233. package/dist/components/Payroll/index.js.map +1 -1
  234. package/dist/components/Payroll/usePreparedPayrollData.js +39 -24
  235. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  236. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +28 -26
  237. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  238. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  239. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -23
  240. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  241. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  242. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  243. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  244. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  245. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +3 -1
  246. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +8 -8
  247. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
  248. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  249. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +17 -17
  250. package/dist/i18n/en/Payroll.PayrollList.json.js +24 -14
  251. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  252. package/dist/i18n/en/Payroll.PayrollOverview.json.js +56 -50
  253. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  254. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +14 -12
  255. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
  256. package/dist/i18n/en/PayrollBlocker.json.js +17 -11
  257. package/dist/i18n/en/PayrollBlocker.json.js.map +1 -1
  258. package/dist/shared/constants.d.ts +7 -1
  259. package/dist/shared/constants.js +11 -8
  260. package/dist/shared/constants.js.map +1 -1
  261. package/dist/style.css +1 -1
  262. package/dist/types/i18next.d.ts +159 -3
  263. package/package.json +21 -21
  264. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.d.ts +0 -7
  265. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerTypes.d.ts +0 -101
  266. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +0 -126
  267. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +0 -1
  268. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +0 -22
  269. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +0 -1
@@ -1,39 +1,54 @@
1
- import { useState as n, useCallback as P, useEffect as c } from "react";
1
+ import { useState as c, useCallback as m, useEffect as P } from "react";
2
2
  import { usePayrollsPrepareMutation as y } from "@gusto/embedded-api/react-query/payrollsPrepare";
3
- import { usePaySchedulesGet as h } from "@gusto/embedded-api/react-query/paySchedulesGet";
4
- const m = ({
3
+ import { usePaySchedulesGet as S } from "@gusto/embedded-api/react-query/paySchedulesGet";
4
+ import "react/jsx-runtime";
5
+ import "react-error-boundary";
6
+ import "react-i18next";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
+ import "@tanstack/react-query";
11
+ import { useBase as h } from "../Base/useBase.js";
12
+ import "../../shared/constants.js";
13
+ import "classnames";
14
+ import "dompurify";
15
+ import "../../contexts/LocaleProvider/useLocale.js";
16
+ import "../../contexts/ComponentAdapter/useComponentContext.js";
17
+ const G = ({
5
18
  companyId: e,
6
- payrollId: l
19
+ payrollId: t
7
20
  }) => {
8
- const { mutateAsync: o, isPending: t } = y(), [a, s] = n(), { data: d, isLoading: u } = h(
21
+ const { mutateAsync: o, isPending: p } = y(), [r, l] = c(), { baseSubmitHandler: i } = h(), { data: s, isLoading: d } = S(
9
22
  {
10
23
  companyId: e,
11
- payScheduleId: a?.payPeriod?.payScheduleUuid || ""
24
+ payScheduleId: r?.payPeriod?.payScheduleUuid || ""
12
25
  },
13
26
  {
14
- enabled: !!a?.payPeriod?.payScheduleUuid
27
+ enabled: !!r?.payPeriod?.payScheduleUuid
15
28
  }
16
- ), r = P(async () => {
17
- const p = await o({
18
- request: {
19
- companyId: e,
20
- payrollId: l
21
- }
29
+ ), a = m(async () => {
30
+ await i(null, async () => {
31
+ const n = await o({
32
+ request: {
33
+ companyId: e,
34
+ payrollId: t
35
+ }
36
+ });
37
+ l(n.payrollPrepared);
22
38
  });
23
- s(p.payrollPrepared);
24
- }, [e, l, o]);
25
- c(() => {
26
- r();
27
- }, [r]);
28
- const i = t || u;
39
+ }, [e, t, o, i]);
40
+ P(() => {
41
+ a();
42
+ }, [a]);
43
+ const u = p || d;
29
44
  return {
30
- handlePreparePayroll: r,
31
- preparedPayroll: a,
32
- paySchedule: d?.payScheduleObject,
33
- isLoading: i
45
+ handlePreparePayroll: a,
46
+ preparedPayroll: r,
47
+ paySchedule: s?.payScheduleObject,
48
+ isLoading: u
34
49
  };
35
50
  };
36
51
  export {
37
- m as usePreparedPayrollData
52
+ G as usePreparedPayrollData
38
53
  };
39
54
  //# sourceMappingURL=usePreparedPayrollData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: Boolean(preparedPayroll?.payPeriod?.payScheduleUuid),\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n }, [companyId, payrollId, preparePayroll])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;AAkBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GAExC,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAV;AAAA,MACA,eAAeK,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,EAAQA,GAAiB,WAAW;AAAA,IAAe;AAAA,EAC9D,GAGIM,IAAuBC,EAAY,YAAY;AACnD,UAAMC,IAAS,MAAMX,EAAe;AAAA,MAClC,SAAS;AAAA,QACP,WAAAF;AAAA,QACA,WAAAC;AAAA,MAAA;AAAA,IACF,CACD;AACD,IAAAK,EAAmBO,EAAO,eAAe;AAAA,EAC3C,GAAG,CAACb,GAAWC,GAAWC,CAAc,CAAC;AAEzC,EAAAY,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYZ,KAA2BM;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAN;AAAA,IACA,aAAaG,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAZ;AAAA,MACA,eAAeK,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAF;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MACF,CACD;AACD,MAAAK,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACf,GAAWC,GAAWC,GAAgBM,CAAiB,CAAC;AAE5D,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { TextInput as m } from "../../../components/Common/UI/TextInput/TextInput.js";
3
3
  import { NumberInput as t } from "../../../components/Common/UI/NumberInput/NumberInput.js";
4
- import { CheckboxGroup as e } from "../../../components/Common/UI/CheckboxGroup/CheckboxGroup.js";
5
- import { ComboBox as i } from "../../../components/Common/UI/ComboBox/ComboBox.js";
4
+ import { CheckboxGroup as i } from "../../../components/Common/UI/CheckboxGroup/CheckboxGroup.js";
5
+ import { ComboBox as e } from "../../../components/Common/UI/ComboBox/ComboBox.js";
6
6
  import { Checkbox as p } from "../../../components/Common/UI/Checkbox/Checkbox.js";
7
7
  import { DatePicker as f } from "../../../components/Common/UI/DatePicker/DatePicker.js";
8
- import { Radio as a } from "../../../components/Common/UI/Radio/Radio.js";
9
- import { RadioGroup as n } from "../../../components/Common/UI/RadioGroup/RadioGroup.js";
8
+ import { Radio as n } from "../../../components/Common/UI/Radio/Radio.js";
9
+ import { RadioGroup as a } from "../../../components/Common/UI/RadioGroup/RadioGroup.js";
10
10
  import { Select as d } from "../../../components/Common/UI/Select/Select.js";
11
11
  import { Switch as u } from "../../../components/Common/UI/Switch/Switch.js";
12
12
  import { Button as c } from "../../../components/Common/UI/Button/Button.js";
@@ -15,17 +15,18 @@ import { Alert as b } from "../../../components/Common/UI/Alert/Alert.js";
15
15
  import { Card as x } from "../../../components/Common/UI/Card/Card.js";
16
16
  import { Badge as l } from "../../../components/Common/UI/Badge/Badge.js";
17
17
  import { Link as C } from "../../../components/Common/UI/Link/Link.js";
18
- import { Menu as B } from "../../../components/Common/UI/Menu/Menu.js";
19
- import { Table as g } from "../../../components/Common/UI/Table/Table.js";
18
+ import { Menu as g } from "../../../components/Common/UI/Menu/Menu.js";
19
+ import { Table as B } from "../../../components/Common/UI/Table/Table.js";
20
20
  import { OrderedList as k } from "../../../components/Common/UI/List/OrderedList.js";
21
- import { UnorderedList as T } from "../../../components/Common/UI/List/UnorderedList.js";
22
- import { Heading as h } from "../../../components/Common/UI/Heading/Heading.js";
23
- import { Text as I } from "../../../components/Common/UI/Text/Text.js";
24
- import { CalendarPreview as L } from "../../../components/Common/UI/CalendarPreview/CalendarPreview.js";
21
+ import { UnorderedList as L } from "../../../components/Common/UI/List/UnorderedList.js";
22
+ import { Heading as T } from "../../../components/Common/UI/Heading/Heading.js";
23
+ import { Text as h } from "../../../components/Common/UI/Text/Text.js";
24
+ import { CalendarPreview as I } from "../../../components/Common/UI/CalendarPreview/CalendarPreview.js";
25
25
  import { ProgressBar as P } from "../../../components/Common/UI/ProgressBar/ProgressBar.js";
26
- import { Tabs as w } from "../../../components/Common/UI/Tabs/Tabs.js";
27
- import { Dialog as D } from "../../../components/Common/UI/Dialog/Dialog.js";
28
- const ro = {
26
+ import { Tabs as S } from "../../../components/Common/UI/Tabs/Tabs.js";
27
+ import { Dialog as w } from "../../../components/Common/UI/Dialog/Dialog.js";
28
+ import { LoadingSpinner as D } from "../../../components/Common/UI/LoadingSpinner/LoadingSpinner.js";
29
+ const to = {
29
30
  Alert: (o) => /* @__PURE__ */ r(b, { ...o }),
30
31
  Badge: (o) => /* @__PURE__ */ r(l, { ...o }),
31
32
  Button: (o) => /* @__PURE__ */ r(c, { ...o }),
@@ -33,27 +34,28 @@ const ro = {
33
34
  Card: (o) => /* @__PURE__ */ r(x, { ...o }),
34
35
  TextInput: (o) => /* @__PURE__ */ r(m, { ...o }),
35
36
  Checkbox: (o) => /* @__PURE__ */ r(p, { ...o }),
36
- CheckboxGroup: (o) => /* @__PURE__ */ r(e, { ...o }),
37
- ComboBox: (o) => /* @__PURE__ */ r(i, { ...o }),
37
+ CheckboxGroup: (o) => /* @__PURE__ */ r(i, { ...o }),
38
+ ComboBox: (o) => /* @__PURE__ */ r(e, { ...o }),
38
39
  DatePicker: (o) => /* @__PURE__ */ r(f, { ...o }),
39
40
  OrderedList: (o) => /* @__PURE__ */ r(k, { ...o }),
40
- UnorderedList: (o) => /* @__PURE__ */ r(T, { ...o }),
41
+ UnorderedList: (o) => /* @__PURE__ */ r(L, { ...o }),
41
42
  NumberInput: (o) => /* @__PURE__ */ r(t, { ...o }),
42
- Radio: (o) => /* @__PURE__ */ r(a, { ...o }),
43
- RadioGroup: (o) => /* @__PURE__ */ r(n, { ...o }),
43
+ Radio: (o) => /* @__PURE__ */ r(n, { ...o }),
44
+ RadioGroup: (o) => /* @__PURE__ */ r(a, { ...o }),
44
45
  Select: (o) => /* @__PURE__ */ r(d, { ...o }),
45
46
  Switch: (o) => /* @__PURE__ */ r(u, { ...o }),
46
47
  Link: (o) => /* @__PURE__ */ r(C, { ...o }),
47
- Menu: (o) => /* @__PURE__ */ r(B, { ...o }),
48
- Table: (o) => /* @__PURE__ */ r(g, { ...o }),
49
- Heading: (o) => /* @__PURE__ */ r(h, { ...o }),
50
- Text: (o) => /* @__PURE__ */ r(I, { ...o }),
51
- CalendarPreview: (o) => /* @__PURE__ */ r(L, { ...o }),
48
+ Menu: (o) => /* @__PURE__ */ r(g, { ...o }),
49
+ Table: (o) => /* @__PURE__ */ r(B, { ...o }),
50
+ Heading: (o) => /* @__PURE__ */ r(T, { ...o }),
51
+ Text: (o) => /* @__PURE__ */ r(h, { ...o }),
52
+ CalendarPreview: (o) => /* @__PURE__ */ r(I, { ...o }),
52
53
  ProgressBar: (o) => /* @__PURE__ */ r(P, { ...o }),
53
- Tabs: (o) => /* @__PURE__ */ r(w, { ...o }),
54
- Dialog: (o) => /* @__PURE__ */ r(D, { ...o })
54
+ Tabs: (o) => /* @__PURE__ */ r(S, { ...o }),
55
+ Dialog: (o) => /* @__PURE__ */ r(w, { ...o }),
56
+ LoadingSpinner: (o) => /* @__PURE__ */ r(D, { ...o })
55
57
  };
56
58
  export {
57
- ro as defaultComponents
59
+ to as defaultComponents
58
60
  };
59
61
  //# sourceMappingURL=defaultComponentAdapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Tabs","Dialog"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDO,MAAMA,KAA2C;AAAA,EACtD,OAAO,CAACC,MAAsB,gBAAAC,EAACC,GAAA,EAAO,GAAGF,GAAO;AAAA,EAChD,OAAO,CAACA,MAAsB,gBAAAC,EAACE,GAAA,EAAO,GAAGH,GAAO;AAAA,EAChD,QAAQ,CAACA,MAAuB,gBAAAC,EAACG,GAAA,EAAQ,GAAGJ,GAAO;AAAA,EACnD,YAAY,CAACA,MAA2B,gBAAAC,EAACI,GAAA,EAAY,GAAGL,GAAO;AAAA,EAC/D,MAAM,CAACA,MAAqB,gBAAAC,EAACK,GAAA,EAAM,GAAGN,GAAO;AAAA,EAC7C,WAAW,CAACA,MAA0B,gBAAAC,EAACM,GAAA,EAAW,GAAGP,GAAO;AAAA,EAC5D,UAAU,CAACA,MAAyB,gBAAAC,EAACO,GAAA,EAAU,GAAGR,GAAO;AAAA,EACzD,eAAe,CAACA,MAA8B,gBAAAC,EAACQ,GAAA,EAAe,GAAGT,GAAO;AAAA,EACxE,UAAU,CAACA,MAAyB,gBAAAC,EAACS,GAAA,EAAU,GAAGV,GAAO;AAAA,EACzD,YAAY,CAACA,MAA2B,gBAAAC,EAACU,GAAA,EAAY,GAAGX,GAAO;AAAA,EAC/D,aAAa,CAACA,MAA4B,gBAAAC,EAACW,GAAA,EAAa,GAAGZ,GAAO;AAAA,EAClE,eAAe,CAACA,MAA8B,gBAAAC,EAACY,GAAA,EAAe,GAAGb,GAAO;AAAA,EACxE,aAAa,CAACA,MAA4B,gBAAAC,EAACa,GAAA,EAAa,GAAGd,GAAO;AAAA,EAClE,OAAO,CAACA,MAAsB,gBAAAC,EAACc,GAAA,EAAO,GAAGf,GAAO;AAAA,EAChD,YAAY,CAACA,MAA2B,gBAAAC,EAACe,GAAA,EAAY,GAAGhB,GAAO;AAAA,EAC/D,QAAQ,CAACA,MAAuB,gBAAAC,EAACgB,GAAA,EAAQ,GAAGjB,GAAO;AAAA,EACnD,QAAQ,CAACA,MAAuB,gBAAAC,EAACiB,GAAA,EAAQ,GAAGlB,GAAO;AAAA,EACnD,MAAM,CAACA,MAAqB,gBAAAC,EAACkB,GAAA,EAAM,GAAGnB,GAAO;AAAA,EAC7C,MAAM,CAACA,MAAqB,gBAAAC,EAACmB,GAAA,EAAM,GAAGpB,GAAO;AAAA,EAC7C,OAAO,CAACA,MAAsB,gBAAAC,EAACoB,GAAA,EAAO,GAAGrB,GAAO;AAAA,EAChD,SAAS,CAACA,MAAwB,gBAAAC,EAACqB,GAAA,EAAS,GAAGtB,GAAO;AAAA,EACtD,MAAM,CAACA,MAAqB,gBAAAC,EAACsB,GAAA,EAAM,GAAGvB,GAAO;AAAA,EAC7C,iBAAiB,CAACA,MAAgC,gBAAAC,EAACuB,GAAA,EAAiB,GAAGxB,GAAO;AAAA,EAC9E,aAAa,CAACA,MAA4B,gBAAAC,EAACwB,GAAA,EAAa,GAAGzB,GAAO;AAAA,EAClE,MAAM,CAACA,MAAqB,gBAAAC,EAACyB,GAAA,EAAM,GAAG1B,GAAO;AAAA,EAC7C,QAAQ,CAACA,MAAuB,gBAAAC,EAAC0B,GAAA,EAAQ,GAAG3B,EAAA,CAAO;AACrD;"}
1
+ {"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinner } from '@/components/Common/UI/LoadingSpinner'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n LoadingSpinner: (props: LoadingSpinnerProps) => <LoadingSpinner {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Tabs","Dialog","LoadingSpinner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,MAAMA,KAA2C;AAAA,EACtD,OAAO,CAACC,MAAsB,gBAAAC,EAACC,GAAA,EAAO,GAAGF,GAAO;AAAA,EAChD,OAAO,CAACA,MAAsB,gBAAAC,EAACE,GAAA,EAAO,GAAGH,GAAO;AAAA,EAChD,QAAQ,CAACA,MAAuB,gBAAAC,EAACG,GAAA,EAAQ,GAAGJ,GAAO;AAAA,EACnD,YAAY,CAACA,MAA2B,gBAAAC,EAACI,GAAA,EAAY,GAAGL,GAAO;AAAA,EAC/D,MAAM,CAACA,MAAqB,gBAAAC,EAACK,GAAA,EAAM,GAAGN,GAAO;AAAA,EAC7C,WAAW,CAACA,MAA0B,gBAAAC,EAACM,GAAA,EAAW,GAAGP,GAAO;AAAA,EAC5D,UAAU,CAACA,MAAyB,gBAAAC,EAACO,GAAA,EAAU,GAAGR,GAAO;AAAA,EACzD,eAAe,CAACA,MAA8B,gBAAAC,EAACQ,GAAA,EAAe,GAAGT,GAAO;AAAA,EACxE,UAAU,CAACA,MAAyB,gBAAAC,EAACS,GAAA,EAAU,GAAGV,GAAO;AAAA,EACzD,YAAY,CAACA,MAA2B,gBAAAC,EAACU,GAAA,EAAY,GAAGX,GAAO;AAAA,EAC/D,aAAa,CAACA,MAA4B,gBAAAC,EAACW,GAAA,EAAa,GAAGZ,GAAO;AAAA,EAClE,eAAe,CAACA,MAA8B,gBAAAC,EAACY,GAAA,EAAe,GAAGb,GAAO;AAAA,EACxE,aAAa,CAACA,MAA4B,gBAAAC,EAACa,GAAA,EAAa,GAAGd,GAAO;AAAA,EAClE,OAAO,CAACA,MAAsB,gBAAAC,EAACc,GAAA,EAAO,GAAGf,GAAO;AAAA,EAChD,YAAY,CAACA,MAA2B,gBAAAC,EAACe,GAAA,EAAY,GAAGhB,GAAO;AAAA,EAC/D,QAAQ,CAACA,MAAuB,gBAAAC,EAACgB,GAAA,EAAQ,GAAGjB,GAAO;AAAA,EACnD,QAAQ,CAACA,MAAuB,gBAAAC,EAACiB,GAAA,EAAQ,GAAGlB,GAAO;AAAA,EACnD,MAAM,CAACA,MAAqB,gBAAAC,EAACkB,GAAA,EAAM,GAAGnB,GAAO;AAAA,EAC7C,MAAM,CAACA,MAAqB,gBAAAC,EAACmB,GAAA,EAAM,GAAGpB,GAAO;AAAA,EAC7C,OAAO,CAACA,MAAsB,gBAAAC,EAACoB,GAAA,EAAO,GAAGrB,GAAO;AAAA,EAChD,SAAS,CAACA,MAAwB,gBAAAC,EAACqB,GAAA,EAAS,GAAGtB,GAAO;AAAA,EACtD,MAAM,CAACA,MAAqB,gBAAAC,EAACsB,GAAA,EAAM,GAAGvB,GAAO;AAAA,EAC7C,iBAAiB,CAACA,MAAgC,gBAAAC,EAACuB,GAAA,EAAiB,GAAGxB,GAAO;AAAA,EAC9E,aAAa,CAACA,MAA4B,gBAAAC,EAACwB,GAAA,EAAa,GAAGzB,GAAO;AAAA,EAClE,MAAM,CAACA,MAAqB,gBAAAC,EAACyB,GAAA,EAAM,GAAG1B,GAAO;AAAA,EAC7C,QAAQ,CAACA,MAAuB,gBAAAC,EAAC0B,GAAA,EAAQ,GAAG3B,GAAO;AAAA,EACnD,gBAAgB,CAACA,MAA+B,gBAAAC,EAAC2B,GAAA,EAAgB,GAAG5B,EAAA,CAAO;AAC7E;"}
@@ -13,6 +13,7 @@ import { TableProps } from '../../components/Common/UI/Table/TableTypes';
13
13
  import { TextProps } from '../../components/Common/UI/Text/TextTypes';
14
14
  import { TextInputProps } from '../../components/Common/UI/TextInput/TextInputTypes';
15
15
  import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
16
+ import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
16
17
  export declare const componentCreators: {
17
18
  readonly Alert: (customComponent: (props: AlertProps) => React.ReactElement | null) => {
18
19
  (props: AlertProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
@@ -70,6 +71,10 @@ export declare const componentCreators: {
70
71
  (props: DialogProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
71
72
  displayName: string;
72
73
  };
74
+ readonly LoadingSpinner: (customComponent: (props: LoadingSpinnerProps) => React.ReactElement | null) => {
75
+ (props: LoadingSpinnerProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
76
+ displayName: string;
77
+ };
73
78
  };
74
79
  /**
75
80
  * Creates components with automatic default prop handling.
@@ -1,57 +1,62 @@
1
- import { defaultComponents as f } from "./adapters/defaultComponentAdapter.js";
2
- import { applyMissingDefaults as i } from "../../helpers/applyMissingDefaults.js";
1
+ import { defaultComponents as m } from "./adapters/defaultComponentAdapter.js";
2
+ import { applyMissingDefaults as f } from "../../helpers/applyMissingDefaults.js";
3
3
  import { AlertDefaults as s } from "../../components/Common/UI/Alert/AlertTypes.js";
4
- import { BadgeDefaults as c } from "../../components/Common/UI/Badge/BadgeTypes.js";
5
- import { ButtonIconDefaults as l, ButtonDefaults as D } from "../../components/Common/UI/Button/ButtonTypes.js";
4
+ import { BadgeDefaults as l } from "../../components/Common/UI/Badge/BadgeTypes.js";
5
+ import { ButtonIconDefaults as c, ButtonDefaults as D } from "../../components/Common/UI/Button/ButtonTypes.js";
6
6
  import { CheckboxDefaults as d } from "../../components/Common/UI/Checkbox/CheckboxTypes.js";
7
7
  import { CheckboxGroupDefaults as x } from "../../components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js";
8
8
  import { MenuDefaults as h } from "../../components/Common/UI/Menu/MenuTypes.js";
9
9
  import { RadioDefaults as C } from "../../components/Common/UI/Radio/RadioTypes.js";
10
10
  import { RadioGroupDefaults as b } from "../../components/Common/UI/RadioGroup/RadioGroupTypes.js";
11
- import { SwitchDefaults as B } from "../../components/Common/UI/Switch/SwitchTypes.js";
12
- import { TableDefaults as T } from "../../components/Common/UI/Table/TableTypes.js";
13
- import { TextDefaults as g } from "../../components/Common/UI/Text/TextTypes.js";
11
+ import { SwitchDefaults as g } from "../../components/Common/UI/Switch/SwitchTypes.js";
12
+ import { TableDefaults as B } from "../../components/Common/UI/Table/TableTypes.js";
13
+ import { TextDefaults as T } from "../../components/Common/UI/Text/TextTypes.js";
14
14
  import { TextInputDefaults as k } from "../../components/Common/UI/TextInput/TextInputTypes.js";
15
15
  import { DialogDefaults as G } from "../../components/Common/UI/Dialog/DialogTypes.js";
16
+ import { LoadingSpinnerDefaults as I } from "../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js";
16
17
  function o(a, t) {
17
18
  return (e) => {
18
19
  const r = (n) => {
19
- const u = i(n, a);
20
- return e(u);
20
+ const p = f(n, a);
21
+ return e(p);
21
22
  };
22
23
  return r.displayName = `withAutoDefault(${t})`, r;
23
24
  };
24
25
  }
25
- const p = {
26
+ const i = {
26
27
  Alert: o(s, "Alert"),
27
- Badge: o(c, "Badge"),
28
+ Badge: o(l, "Badge"),
28
29
  Button: o(D, "Button"),
29
- ButtonIcon: o(l, "ButtonIcon"),
30
+ ButtonIcon: o(c, "ButtonIcon"),
30
31
  Checkbox: o(d, "Checkbox"),
31
32
  CheckboxGroup: o(x, "CheckboxGroup"),
32
33
  Menu: o(h, "Menu"),
33
34
  Radio: o(C, "Radio"),
34
35
  RadioGroup: o(b, "RadioGroup"),
35
- Switch: o(B, "Switch"),
36
- Table: o(T, "Table"),
37
- Text: o(g, "Text"),
36
+ Switch: o(g, "Switch"),
37
+ Table: o(B, "Table"),
38
+ Text: o(T, "Text"),
38
39
  TextInput: o(k, "TextInput"),
39
- Dialog: o(G, "Dialog")
40
+ Dialog: o(G, "Dialog"),
41
+ LoadingSpinner: o(
42
+ I,
43
+ "LoadingSpinner"
44
+ )
40
45
  };
41
- function z(a = {}) {
42
- const t = { ...f };
46
+ function E(a = {}) {
47
+ const t = { ...m };
43
48
  for (const [e, r] of Object.entries(a)) {
44
49
  const n = e;
45
- if (e in p) {
46
- const m = p[e];
47
- t[n] = m(r);
50
+ if (e in i) {
51
+ const u = i[e];
52
+ t[n] = u(r);
48
53
  } else
49
54
  t[n] = r;
50
55
  }
51
56
  return t;
52
57
  }
53
58
  export {
54
- p as componentCreators,
55
- z as createComponents
59
+ i as componentCreators,
60
+ E as createComponents
56
61
  };
57
62
  //# sourceMappingURL=createComponentsWithDefaults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createComponentsWithDefaults.js","sources":["../../../src/contexts/ComponentAdapter/createComponentsWithDefaults.ts"],"sourcesContent":["import type React from 'react'\nimport type { ComponentsContextType } from './useComponentContext'\nimport { defaultComponents } from './adapters/defaultComponentAdapter'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\n// Import prop types and their defaults\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { AlertDefaults } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { BadgeDefaults } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { ButtonDefaults, ButtonIconDefaults } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { CheckboxDefaults } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroupDefaults } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { MenuDefaults } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { RadioDefaults } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroupDefaults } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { SwitchDefaults } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { TableDefaults } from '@/components/Common/UI/Table/TableTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { TextDefaults } from '@/components/Common/UI/Text/TextTypes'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInputDefaults } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { DialogDefaults } from '@/components/Common/UI/Dialog/DialogTypes'\n\nfunction composeWithDefaults<TProps>(defaults: Partial<TProps>, componentName: string) {\n return (customComponent: (props: TProps) => React.ReactElement | null) => {\n const wrappedComponent = (props: TProps) => {\n const propsWithDefaults = applyMissingDefaults(props, defaults)\n return customComponent(propsWithDefaults)\n }\n wrappedComponent.displayName = `withAutoDefault(${componentName})`\n return wrappedComponent\n }\n}\n\n// Component creators with defaults\nexport const componentCreators = {\n Alert: composeWithDefaults<AlertProps>(AlertDefaults, 'Alert'),\n Badge: composeWithDefaults<BadgeProps>(BadgeDefaults, 'Badge'),\n Button: composeWithDefaults<ButtonProps>(ButtonDefaults, 'Button'),\n ButtonIcon: composeWithDefaults<ButtonIconProps>(ButtonIconDefaults, 'ButtonIcon'),\n Checkbox: composeWithDefaults<CheckboxProps>(CheckboxDefaults, 'Checkbox'),\n CheckboxGroup: composeWithDefaults<CheckboxGroupProps>(CheckboxGroupDefaults, 'CheckboxGroup'),\n Menu: composeWithDefaults<MenuProps>(MenuDefaults, 'Menu'),\n Radio: composeWithDefaults<RadioProps>(RadioDefaults, 'Radio'),\n RadioGroup: composeWithDefaults<RadioGroupProps>(RadioGroupDefaults, 'RadioGroup'),\n Switch: composeWithDefaults<SwitchProps>(SwitchDefaults, 'Switch'),\n Table: composeWithDefaults<TableProps>(TableDefaults, 'Table'),\n Text: composeWithDefaults<TextProps>(TextDefaults, 'Text'),\n TextInput: composeWithDefaults<TextInputProps>(TextInputDefaults, 'TextInput'),\n Dialog: composeWithDefaults<DialogProps>(DialogDefaults, 'Dialog'),\n} as const\n\n/**\n * Creates components with automatic default prop handling.\n * Supports both partial (GustoProvider) and full (GustoProviderCustomUIAdapter) component sets.\n */\nexport function createComponents(\n providedComponents: Partial<ComponentsContextType> = {},\n): ComponentsContextType {\n const components = { ...defaultComponents }\n\n for (const [componentName, providedComponent] of Object.entries(providedComponents)) {\n const typedComponentName = componentName as keyof ComponentsContextType\n\n if (componentName in componentCreators) {\n const creatorKey = componentName as keyof typeof componentCreators\n const creator = componentCreators[creatorKey]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = creator(providedComponent as any) as any\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = providedComponent as any\n }\n }\n\n return components\n}\n"],"names":["composeWithDefaults","defaults","componentName","customComponent","wrappedComponent","props","propsWithDefaults","applyMissingDefaults","componentCreators","AlertDefaults","BadgeDefaults","ButtonDefaults","ButtonIconDefaults","CheckboxDefaults","CheckboxGroupDefaults","MenuDefaults","RadioDefaults","RadioGroupDefaults","SwitchDefaults","TableDefaults","TextDefaults","TextInputDefaults","DialogDefaults","createComponents","providedComponents","components","defaultComponents","providedComponent","typedComponentName","creator"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAASA,EAA4BC,GAA2BC,GAAuB;AACrF,SAAO,CAACC,MAAkE;AACxE,UAAMC,IAAmB,CAACC,MAAkB;AAC1C,YAAMC,IAAoBC,EAAqBF,GAAOJ,CAAQ;AAC9D,aAAOE,EAAgBG,CAAiB;AAAA,IAC1C;AACA,WAAAF,EAAiB,cAAc,mBAAmBF,CAAa,KACxDE;AAAA,EACT;AACF;AAGO,MAAMI,IAAoB;AAAA,EAC/B,OAAOR,EAAgCS,GAAe,OAAO;AAAA,EAC7D,OAAOT,EAAgCU,GAAe,OAAO;AAAA,EAC7D,QAAQV,EAAiCW,GAAgB,QAAQ;AAAA,EACjE,YAAYX,EAAqCY,GAAoB,YAAY;AAAA,EACjF,UAAUZ,EAAmCa,GAAkB,UAAU;AAAA,EACzE,eAAeb,EAAwCc,GAAuB,eAAe;AAAA,EAC7F,MAAMd,EAA+Be,GAAc,MAAM;AAAA,EACzD,OAAOf,EAAgCgB,GAAe,OAAO;AAAA,EAC7D,YAAYhB,EAAqCiB,GAAoB,YAAY;AAAA,EACjF,QAAQjB,EAAiCkB,GAAgB,QAAQ;AAAA,EACjE,OAAOlB,EAAgCmB,GAAe,OAAO;AAAA,EAC7D,MAAMnB,EAA+BoB,GAAc,MAAM;AAAA,EACzD,WAAWpB,EAAoCqB,GAAmB,WAAW;AAAA,EAC7E,QAAQrB,EAAiCsB,GAAgB,QAAQ;AACnE;AAMO,SAASC,EACdC,IAAqD,IAC9B;AACvB,QAAMC,IAAa,EAAE,GAAGC,EAAA;AAExB,aAAW,CAACxB,GAAeyB,CAAiB,KAAK,OAAO,QAAQH,CAAkB,GAAG;AACnF,UAAMI,IAAqB1B;AAE3B,QAAIA,KAAiBM,GAAmB;AAEtC,YAAMqB,IAAUrB,EADGN,CACyB;AAE5C,MAAAuB,EAAWG,CAAkB,IAAIC,EAAQF,CAAwB;AAAA,IACnE;AAEE,MAAAF,EAAWG,CAAkB,IAAID;AAAA,EAErC;AAEA,SAAOF;AACT;"}
1
+ {"version":3,"file":"createComponentsWithDefaults.js","sources":["../../../src/contexts/ComponentAdapter/createComponentsWithDefaults.ts"],"sourcesContent":["import type React from 'react'\nimport type { ComponentsContextType } from './useComponentContext'\nimport { defaultComponents } from './adapters/defaultComponentAdapter'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\n// Import prop types and their defaults\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { AlertDefaults } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { BadgeDefaults } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { ButtonDefaults, ButtonIconDefaults } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { CheckboxDefaults } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroupDefaults } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { MenuDefaults } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { RadioDefaults } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroupDefaults } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { SwitchDefaults } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { TableDefaults } from '@/components/Common/UI/Table/TableTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { TextDefaults } from '@/components/Common/UI/Text/TextTypes'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInputDefaults } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { DialogDefaults } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinnerDefaults } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\n\nfunction composeWithDefaults<TProps>(defaults: Partial<TProps>, componentName: string) {\n return (customComponent: (props: TProps) => React.ReactElement | null) => {\n const wrappedComponent = (props: TProps) => {\n const propsWithDefaults = applyMissingDefaults(props, defaults)\n return customComponent(propsWithDefaults)\n }\n wrappedComponent.displayName = `withAutoDefault(${componentName})`\n return wrappedComponent\n }\n}\n\n// Component creators with defaults\nexport const componentCreators = {\n Alert: composeWithDefaults<AlertProps>(AlertDefaults, 'Alert'),\n Badge: composeWithDefaults<BadgeProps>(BadgeDefaults, 'Badge'),\n Button: composeWithDefaults<ButtonProps>(ButtonDefaults, 'Button'),\n ButtonIcon: composeWithDefaults<ButtonIconProps>(ButtonIconDefaults, 'ButtonIcon'),\n Checkbox: composeWithDefaults<CheckboxProps>(CheckboxDefaults, 'Checkbox'),\n CheckboxGroup: composeWithDefaults<CheckboxGroupProps>(CheckboxGroupDefaults, 'CheckboxGroup'),\n Menu: composeWithDefaults<MenuProps>(MenuDefaults, 'Menu'),\n Radio: composeWithDefaults<RadioProps>(RadioDefaults, 'Radio'),\n RadioGroup: composeWithDefaults<RadioGroupProps>(RadioGroupDefaults, 'RadioGroup'),\n Switch: composeWithDefaults<SwitchProps>(SwitchDefaults, 'Switch'),\n Table: composeWithDefaults<TableProps>(TableDefaults, 'Table'),\n Text: composeWithDefaults<TextProps>(TextDefaults, 'Text'),\n TextInput: composeWithDefaults<TextInputProps>(TextInputDefaults, 'TextInput'),\n Dialog: composeWithDefaults<DialogProps>(DialogDefaults, 'Dialog'),\n LoadingSpinner: composeWithDefaults<LoadingSpinnerProps>(\n LoadingSpinnerDefaults,\n 'LoadingSpinner',\n ),\n} as const\n\n/**\n * Creates components with automatic default prop handling.\n * Supports both partial (GustoProvider) and full (GustoProviderCustomUIAdapter) component sets.\n */\nexport function createComponents(\n providedComponents: Partial<ComponentsContextType> = {},\n): ComponentsContextType {\n const components = { ...defaultComponents }\n\n for (const [componentName, providedComponent] of Object.entries(providedComponents)) {\n const typedComponentName = componentName as keyof ComponentsContextType\n\n if (componentName in componentCreators) {\n const creatorKey = componentName as keyof typeof componentCreators\n const creator = componentCreators[creatorKey]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = creator(providedComponent as any) as any\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = providedComponent as any\n }\n }\n\n return components\n}\n"],"names":["composeWithDefaults","defaults","componentName","customComponent","wrappedComponent","props","propsWithDefaults","applyMissingDefaults","componentCreators","AlertDefaults","BadgeDefaults","ButtonDefaults","ButtonIconDefaults","CheckboxDefaults","CheckboxGroupDefaults","MenuDefaults","RadioDefaults","RadioGroupDefaults","SwitchDefaults","TableDefaults","TextDefaults","TextInputDefaults","DialogDefaults","LoadingSpinnerDefaults","createComponents","providedComponents","components","defaultComponents","providedComponent","typedComponentName","creator"],"mappings":";;;;;;;;;;;;;;;;AAkCA,SAASA,EAA4BC,GAA2BC,GAAuB;AACrF,SAAO,CAACC,MAAkE;AACxE,UAAMC,IAAmB,CAACC,MAAkB;AAC1C,YAAMC,IAAoBC,EAAqBF,GAAOJ,CAAQ;AAC9D,aAAOE,EAAgBG,CAAiB;AAAA,IAC1C;AACA,WAAAF,EAAiB,cAAc,mBAAmBF,CAAa,KACxDE;AAAA,EACT;AACF;AAGO,MAAMI,IAAoB;AAAA,EAC/B,OAAOR,EAAgCS,GAAe,OAAO;AAAA,EAC7D,OAAOT,EAAgCU,GAAe,OAAO;AAAA,EAC7D,QAAQV,EAAiCW,GAAgB,QAAQ;AAAA,EACjE,YAAYX,EAAqCY,GAAoB,YAAY;AAAA,EACjF,UAAUZ,EAAmCa,GAAkB,UAAU;AAAA,EACzE,eAAeb,EAAwCc,GAAuB,eAAe;AAAA,EAC7F,MAAMd,EAA+Be,GAAc,MAAM;AAAA,EACzD,OAAOf,EAAgCgB,GAAe,OAAO;AAAA,EAC7D,YAAYhB,EAAqCiB,GAAoB,YAAY;AAAA,EACjF,QAAQjB,EAAiCkB,GAAgB,QAAQ;AAAA,EACjE,OAAOlB,EAAgCmB,GAAe,OAAO;AAAA,EAC7D,MAAMnB,EAA+BoB,GAAc,MAAM;AAAA,EACzD,WAAWpB,EAAoCqB,GAAmB,WAAW;AAAA,EAC7E,QAAQrB,EAAiCsB,GAAgB,QAAQ;AAAA,EACjE,gBAAgBtB;AAAA,IACduB;AAAA,IACA;AAAA,EAAA;AAEJ;AAMO,SAASC,EACdC,IAAqD,IAC9B;AACvB,QAAMC,IAAa,EAAE,GAAGC,EAAA;AAExB,aAAW,CAACzB,GAAe0B,CAAiB,KAAK,OAAO,QAAQH,CAAkB,GAAG;AACnF,UAAMI,IAAqB3B;AAE3B,QAAIA,KAAiBM,GAAmB;AAEtC,YAAMsB,IAAUtB,EADGN,CACyB;AAE5C,MAAAwB,EAAWG,CAAkB,IAAIC,EAAQF,CAAwB;AAAA,IACnE;AAEE,MAAAF,EAAWG,CAAkB,IAAID;AAAA,EAErC;AAEA,SAAOF;AACT;"}
@@ -24,6 +24,7 @@ import { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview
24
24
  import { ProgressBarProps } from '../../components/Common/UI/ProgressBar/ProgressBarTypes';
25
25
  import { TabsProps } from '../../components/Common/UI/Tabs/TabsTypes';
26
26
  import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
27
+ import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
27
28
  export interface ComponentsContextType {
28
29
  Alert: (props: AlertProps) => JSX.Element | null;
29
30
  Badge: (props: BadgeProps) => JSX.Element | null;
@@ -52,6 +53,7 @@ export interface ComponentsContextType {
52
53
  ProgressBar: (props: ProgressBarProps) => JSX.Element | null;
53
54
  Tabs: (props: TabsProps) => JSX.Element | null;
54
55
  Dialog: (props: DialogProps) => JSX.Element | null;
56
+ LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null;
55
57
  }
56
58
  export declare const ComponentsContext: import('react').Context<ComponentsContextType | null>;
57
59
  export declare const useComponentContext: () => ComponentsContextType;
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";AA0DO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
1
+ {"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";AA4DO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
@@ -8,12 +8,11 @@ import { ApiProvider as I } from "../ApiProvider/ApiProvider.js";
8
8
  import { LoadingIndicatorProvider as x } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
9
9
  import { SDKI18next as t } from "./SDKI18next.js";
10
10
  import "classnames";
11
- import "../../shared/constants.js";
12
11
  import { InternalError as y } from "../../components/Common/InternalError/InternalError.js";
13
12
  import { LocaleProvider as L } from "../LocaleProvider/LocaleProvider.js";
14
13
  import "../LocaleProvider/useLocale.js";
15
14
  import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
16
- const z = (a) => {
15
+ const q = (a) => {
17
16
  const {
18
17
  children: c,
19
18
  config: e,
@@ -42,6 +41,6 @@ const z = (a) => {
42
41
  }, [n]), /* @__PURE__ */ r(P, { value: C(s), children: /* @__PURE__ */ r(x, { value: f, children: /* @__PURE__ */ r(h, { FallbackComponent: y, children: /* @__PURE__ */ r(U, { theme: l, children: /* @__PURE__ */ r(L, { locale: d, currency: p, children: /* @__PURE__ */ r(v, { i18n: t, children: /* @__PURE__ */ r(I, { url: e.baseUrl, headers: e.headers, hooks: e.hooks, children: c }) }, n) }) }) }) }) });
43
42
  };
44
43
  export {
45
- z as GustoProviderCustomUIAdapter
44
+ q as GustoProviderCustomUIAdapter
46
45
  };
47
46
  //# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={createComponents(components)}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider url={config.baseUrl} headers={config.headers} hooks={config.hooks}>\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;AA4CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACb,iBAAWE,KAAMT,EAAWQ,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeT,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,qBAGLW,GAAA,EAAmB,OAAOC,EAAiBR,CAAU,GACpD,4BAACS,GAAA,EAAyB,OAAOR,GAC/B,UAAA,gBAAAS,EAACC,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAF,EAACG,KAAc,OAAAd,GACb,UAAA,gBAAAW,EAACI,KAAe,QAAAjB,GAAgB,UAAAC,GAC9B,4BAACiB,GAAA,EAAgB,MAAMV,GACrB,UAAA,gBAAAK,EAACM,GAAA,EAAY,KAAKtB,EAAO,SAAS,SAASA,EAAO,SAAS,OAAOA,EAAO,OACtE,UAAAD,GACH,EAAA,GAHsCG,CAIxC,GACF,EAAA,CACF,GACF,GACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={createComponents(components)}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider url={config.baseUrl} headers={config.headers} hooks={config.hooks}>\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACb,iBAAWE,KAAMT,EAAWQ,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeT,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,qBAGLW,GAAA,EAAmB,OAAOC,EAAiBR,CAAU,GACpD,4BAACS,GAAA,EAAyB,OAAOR,GAC/B,UAAA,gBAAAS,EAACC,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAF,EAACG,KAAc,OAAAd,GACb,UAAA,gBAAAW,EAACI,KAAe,QAAAjB,GAAgB,UAAAC,GAC9B,4BAACiB,GAAA,EAAgB,MAAMV,GACrB,UAAA,gBAAAK,EAACM,GAAA,EAAY,KAAKtB,EAAO,SAAS,SAASA,EAAO,SAAS,OAAOA,EAAO,OACtE,UAAAD,GACH,EAAA,GAHsCG,CAIxC,GACF,EAAA,CACF,GACF,GACF,EAAA,CACF;AAEJ;"}
@@ -1,6 +1,8 @@
1
1
  import { JSX } from 'react';
2
2
  export interface LoadingIndicatorContextProps {
3
- LoadingIndicator: () => JSX.Element;
3
+ LoadingIndicator: ({ children }: {
4
+ children?: React.ReactNode;
5
+ }) => JSX.Element;
4
6
  }
5
7
  export declare const LoadingIndicatorContext: import('react').Context<LoadingIndicatorContextProps>;
6
8
  export declare const useLoadingIndicator: () => LoadingIndicatorContextProps;
@@ -1,11 +1,11 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useContext as t, createContext as n } from "react";
3
- import { Loading as r } from "../../components/Common/Loading/Loading.js";
4
- const i = n({
5
- LoadingIndicator: () => /* @__PURE__ */ o(r, {})
6
- }), c = () => t(i);
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useContext as n, createContext as r } from "react";
3
+ import { Loading as i } from "../../components/Common/Loading/Loading.js";
4
+ const a = r({
5
+ LoadingIndicator: ({ children: o }) => /* @__PURE__ */ t(i, { children: o })
6
+ }), m = () => n(a);
7
7
  export {
8
- i as LoadingIndicatorContext,
9
- c as useLoadingIndicator
8
+ a as LoadingIndicatorContext,
9
+ m as useLoadingIndicator
10
10
  };
11
11
  //# sourceMappingURL=useLoadingIndicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadingIndicator.js","sources":["../../../src/contexts/LoadingIndicatorProvider/useLoadingIndicator.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { createContext, useContext } from 'react'\nimport { Loading } from '@/components/Common/Loading/Loading'\n\nexport interface LoadingIndicatorContextProps {\n LoadingIndicator: () => JSX.Element\n}\nexport const LoadingIndicatorContext = createContext<LoadingIndicatorContextProps>({\n LoadingIndicator: () => <Loading />,\n})\n\nexport const useLoadingIndicator = () => useContext(LoadingIndicatorContext)\n"],"names":["LoadingIndicatorContext","createContext","jsx","Loading","useLoadingIndicator","useContext"],"mappings":";;;AAOO,MAAMA,IAA0BC,EAA4C;AAAA,EACjF,kBAAkB,MAAM,gBAAAC,EAACC,GAAA,CAAA,CAAQ;AACnC,CAAC,GAEYC,IAAsB,MAAMC,EAAWL,CAAuB;"}
1
+ {"version":3,"file":"useLoadingIndicator.js","sources":["../../../src/contexts/LoadingIndicatorProvider/useLoadingIndicator.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { createContext, useContext } from 'react'\nimport { Loading } from '@/components/Common/Loading/Loading'\n\nexport interface LoadingIndicatorContextProps {\n LoadingIndicator: ({ children }: { children?: React.ReactNode }) => JSX.Element\n}\nexport const LoadingIndicatorContext = createContext<LoadingIndicatorContextProps>({\n LoadingIndicator: ({ children }: { children?: React.ReactNode }) => <Loading>{children}</Loading>,\n})\n\nexport const useLoadingIndicator = () => useContext(LoadingIndicatorContext)\n"],"names":["LoadingIndicatorContext","createContext","children","jsx","Loading","useLoadingIndicator","useContext"],"mappings":";;;AAOO,MAAMA,IAA0BC,EAA4C;AAAA,EACjF,kBAAkB,CAAC,EAAE,UAAAC,QAA+C,gBAAAC,EAACC,KAAS,UAAAF,EAAA,CAAS;AACzF,CAAC,GAEYG,IAAsB,MAAMC,EAAWN,CAAuB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useContainerBreakpoints.js","sources":["../../../src/hooks/useContainerBreakpoints/useContainerBreakpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react'\nimport type React from 'react'\nimport type { BREAKPOINTS } from '@/shared/constants'\nimport { BREAKPOINTS_VALUES } from '@/shared/constants'\nimport { remToPx } from '@/helpers/rem'\n\nexport type BreakpointKey = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS]\n\nexport type useContainerBreakpointsProps = {\n ref: React.RefObject<HTMLElement | null>\n breakpoints?: Record<string, number | string>\n debounceTimeout?: number\n}\n\nconst DEBOUNCE_TIMEOUT = 10\n\nexport const useContainerBreakpoints = ({\n ref,\n breakpoints = BREAKPOINTS_VALUES,\n debounceTimeout = DEBOUNCE_TIMEOUT,\n}: useContainerBreakpointsProps) => {\n const [activeBreakpoints, setActiveBreakpoint] = useState<Array<keyof typeof breakpoints>>([])\n const timeoutRef = useRef<NodeJS.Timeout | null>(null)\n\n const calculateBreakpoints = (width: number) => {\n const returnBreakpoints: Array<keyof typeof breakpoints> = []\n\n for (const [key, value] of Object.entries(breakpoints)) {\n if (width >= remToPx(value)) {\n returnBreakpoints.push(key)\n }\n }\n\n return returnBreakpoints\n }\n\n useEffect(() => {\n const debouncedHandleResize = (entries: ResizeObserverEntry[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n timeoutRef.current = setTimeout(() => {\n if (entries.length >= 1) {\n const width = entries[0]?.contentRect.width ?? 0\n const newBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(newBreakpoints)\n }\n }, debounceTimeout)\n }\n\n const observer = new ResizeObserver(debouncedHandleResize)\n\n if (ref.current) {\n // Do initial calculation\n const width = ref.current.offsetWidth\n if (width > 0) {\n const initialBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(initialBreakpoints)\n }\n\n observer.observe(ref.current)\n }\n\n return () => {\n observer.disconnect()\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [debounceTimeout])\n\n return activeBreakpoints\n}\n\nexport default useContainerBreakpoints\n"],"names":["DEBOUNCE_TIMEOUT","useContainerBreakpoints","ref","breakpoints","BREAKPOINTS_VALUES","debounceTimeout","activeBreakpoints","setActiveBreakpoint","useState","timeoutRef","useRef","calculateBreakpoints","width","returnBreakpoints","key","value","remToPx","useEffect","debouncedHandleResize","entries","newBreakpoints","observer","initialBreakpoints"],"mappings":";;;AAcA,MAAMA,IAAmB,IAEZC,IAA0B,CAAC;AAAA,EACtC,KAAAC;AAAA,EACA,aAAAC,IAAcC;AAAA,EACd,iBAAAC,IAAkBL;AACpB,MAAoC;AAClC,QAAM,CAACM,GAAmBC,CAAmB,IAAIC,EAA0C,CAAA,CAAE,GACvFC,IAAaC,EAA8B,IAAI,GAE/CC,IAAuB,CAACC,MAAkB;AAC9C,UAAMC,IAAqD,CAAA;AAE3D,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQZ,CAAW;AACnD,MAAIS,KAASI,EAAQD,CAAK,KACxBF,EAAkB,KAAKC,CAAG;AAI9B,WAAOD;AAAA,EACT;AAEA,SAAAI,EAAU,MAAM;AACd,UAAMC,IAAwB,CAACC,MAAmC;AAChE,MAAIV,EAAW,WACb,aAAaA,EAAW,OAAO,GAEjCA,EAAW,UAAU,WAAW,MAAM;AACpC,YAAIU,EAAQ,UAAU,GAAG;AACvB,gBAAMP,IAAQO,EAAQ,CAAC,GAAG,YAAY,SAAS,GACzCC,IAAiBT,EAAqBC,CAAK;AACjD,UAAAL,EAAoBa,CAAc;AAAA,QACpC;AAAA,MACF,GAAGf,CAAe;AAAA,IACpB,GAEMgB,IAAW,IAAI,eAAeH,CAAqB;AAEzD,QAAIhB,EAAI,SAAS;AAEf,YAAMU,IAAQV,EAAI,QAAQ;AAC1B,UAAIU,IAAQ,GAAG;AACb,cAAMU,IAAqBX,EAAqBC,CAAK;AACrD,QAAAL,EAAoBe,CAAkB;AAAA,MACxC;AAEA,MAAAD,EAAS,QAAQnB,EAAI,OAAO;AAAA,IAC9B;AAEA,WAAO,MAAM;AACX,MAAAmB,EAAS,WAAA,GACLZ,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,IAEnC;AAAA,EAEF,GAAG,CAACJ,CAAe,CAAC,GAEbC;AACT;"}
1
+ {"version":3,"file":"useContainerBreakpoints.js","sources":["../../../src/hooks/useContainerBreakpoints/useContainerBreakpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react'\nimport type React from 'react'\nimport type { BREAKPOINTS } from '@/shared/constants'\nimport { BREAKPOINTS_VALUES } from '@/shared/constants'\nimport { remToPx } from '@/helpers/rem'\n\nexport type BreakpointKey = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS]\n\nexport type useContainerBreakpointsProps = {\n ref: React.RefObject<HTMLElement | null>\n breakpoints?: Record<string, number | string>\n debounceTimeout?: number\n}\n\nconst DEBOUNCE_TIMEOUT = 10\n\nexport const useContainerBreakpoints = ({\n ref,\n breakpoints = BREAKPOINTS_VALUES,\n debounceTimeout = DEBOUNCE_TIMEOUT,\n}: useContainerBreakpointsProps) => {\n const [activeBreakpoints, setActiveBreakpoint] = useState<Array<keyof typeof breakpoints>>([])\n const timeoutRef = useRef<NodeJS.Timeout | null>(null)\n\n const calculateBreakpoints = (width: number) => {\n const returnBreakpoints: Array<keyof typeof breakpoints> = []\n\n for (const [key, value] of Object.entries(breakpoints)) {\n if (width >= remToPx(value)) {\n returnBreakpoints.push(key)\n }\n }\n\n return returnBreakpoints\n }\n\n useEffect(() => {\n const debouncedHandleResize = (entries: ResizeObserverEntry[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n timeoutRef.current = setTimeout(() => {\n if (entries.length >= 1) {\n const width = entries[0]?.contentRect.width ?? 0\n const newBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(newBreakpoints)\n }\n }, debounceTimeout)\n }\n\n const observer = new ResizeObserver(debouncedHandleResize)\n\n if (ref.current) {\n // Do initial calculation\n const width = ref.current.offsetWidth\n if (width > 0) {\n const initialBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(initialBreakpoints)\n }\n\n observer.observe(ref.current)\n }\n\n return () => {\n observer.disconnect()\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n }\n }, [debounceTimeout])\n\n return activeBreakpoints\n}\n\nexport default useContainerBreakpoints\n"],"names":["DEBOUNCE_TIMEOUT","useContainerBreakpoints","ref","breakpoints","BREAKPOINTS_VALUES","debounceTimeout","activeBreakpoints","setActiveBreakpoint","useState","timeoutRef","useRef","calculateBreakpoints","width","returnBreakpoints","key","value","remToPx","useEffect","debouncedHandleResize","entries","newBreakpoints","observer","initialBreakpoints"],"mappings":";;;AAcA,MAAMA,IAAmB,IAEZC,IAA0B,CAAC;AAAA,EACtC,KAAAC;AAAA,EACA,aAAAC,IAAcC;AAAA,EACd,iBAAAC,IAAkBL;AACpB,MAAoC;AAClC,QAAM,CAACM,GAAmBC,CAAmB,IAAIC,EAA0C,CAAA,CAAE,GACvFC,IAAaC,EAA8B,IAAI,GAE/CC,IAAuB,CAACC,MAAkB;AAC9C,UAAMC,IAAqD,CAAA;AAE3D,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQZ,CAAW;AACnD,MAAIS,KAASI,EAAQD,CAAK,KACxBF,EAAkB,KAAKC,CAAG;AAI9B,WAAOD;AAAA,EACT;AAEA,SAAAI,EAAU,MAAM;AACd,UAAMC,IAAwB,CAACC,MAAmC;AAChE,MAAIV,EAAW,WACb,aAAaA,EAAW,OAAO,GAEjCA,EAAW,UAAU,WAAW,MAAM;AACpC,YAAIU,EAAQ,UAAU,GAAG;AACvB,gBAAMP,IAAQO,EAAQ,CAAC,GAAG,YAAY,SAAS,GACzCC,IAAiBT,EAAqBC,CAAK;AACjD,UAAAL,EAAoBa,CAAc;AAAA,QACpC;AAAA,MACF,GAAGf,CAAe;AAAA,IACpB,GAEMgB,IAAW,IAAI,eAAeH,CAAqB;AAEzD,QAAIhB,EAAI,SAAS;AAEf,YAAMU,IAAQV,EAAI,QAAQ;AAC1B,UAAIU,IAAQ,GAAG;AACb,cAAMU,IAAqBX,EAAqBC,CAAK;AACrD,QAAAL,EAAoBe,CAAkB;AAAA,MACxC;AAEA,MAAAD,EAAS,QAAQnB,EAAI,OAAO;AAAA,IAC9B;AAEA,WAAO,MAAM;AACX,MAAAmB,EAAS,WAAA,GACLZ,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,IAEnC;AAAA,EACF,GAAG,CAACJ,CAAe,CAAC,GAEbC;AACT;"}
@@ -1,32 +1,32 @@
1
- const e = "Run payroll for {{startDate}} - {{endDate}}", o = "Regular payroll", a = "Calculate payroll", l = "Calculate payroll", s = "Hours and additional earnings", t = "Review and update your employee's hours, reimbursements, and additional earnings below.", n = "Employee compensations", r = { employees: "Employees", hours: "Hours", timeOff: "Time off", additionalEarnings: "Additional earnings", reimbursements: "Reimbursements", totalPay: "Total pay" }, i = "Skipped", d = { edit: "Edit" }, p = "Back", y = "Back", c = { progressSaved: "Your progress has been saved", payrollDeadline: { label: "Payroll Deadline", message: "To pay your employees with direct deposit on the check date, you'll need to run payroll by the deadline." }, skippedEmployees: { label: "Skipped Employees", employeeAddressNotVerified: "Employee address not verified" }, employeeUpdated: { label: "{{employeeName}} updated successfully" } }, u = {
1
+ const e = "Edit Payroll", a = "Regular payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", o = "Calculate payroll", l = "Calculate payroll", s = "Hours and additional earnings", t = "Review and update your employee's hours, reimbursements, and additional earnings below.", n = "Employee compensations", i = { employees: "Employees", hours: "Hours", timeOff: "Time off", additionalEarnings: "Additional earnings", reimbursements: "Reimbursements", totalPay: "Total pay" }, r = "Skipped", p = { edit: "Edit", skip: "Skip employee", unskip: "Unskip employee" }, d = { progressSaved: "Your progress has been saved", payrollDeadline: { label: "Payroll Deadline", message: "To pay your employees with direct deposit on the check date, you'll need to run payroll by the deadline." }, skippedEmployees: { label: "Skipped Employees", employeeAddressNotVerified: "Employee address not verified" }, employeeUpdated: { label: "{{employeeName}} updated successfully" } }, y = "Preparing payroll...", c = "This may take a minute or two. You can navigate away while this happens.", u = {
2
2
  pageTitle: e,
3
- regularPayroll: o,
4
- calculatePayroll: a,
3
+ description: a,
4
+ calculatePayroll: o,
5
5
  calculatePayrollTitle: l,
6
6
  hoursAndEarningsTitle: s,
7
7
  hoursAndEarningsDescription: t,
8
8
  employeeCompensationsTitle: n,
9
- tableColumns: r,
10
- skippedBadge: i,
11
- editMenu: d,
12
- backButton: p,
13
- backButtonTitle: y,
14
- alerts: c
9
+ tableColumns: i,
10
+ skippedBadge: r,
11
+ editMenu: p,
12
+ alerts: d,
13
+ loadingTitle: y,
14
+ loadingDescription: c
15
15
  };
16
16
  export {
17
- c as alerts,
18
- p as backButton,
19
- y as backButtonTitle,
20
- a as calculatePayroll,
17
+ d as alerts,
18
+ o as calculatePayroll,
21
19
  l as calculatePayrollTitle,
22
20
  u as default,
23
- d as editMenu,
21
+ a as description,
22
+ p as editMenu,
24
23
  n as employeeCompensationsTitle,
25
24
  t as hoursAndEarningsDescription,
26
25
  s as hoursAndEarningsTitle,
26
+ c as loadingDescription,
27
+ y as loadingTitle,
27
28
  e as pageTitle,
28
- o as regularPayroll,
29
- i as skippedBadge,
30
- r as tableColumns
29
+ r as skippedBadge,
30
+ i as tableColumns
31
31
  };
32
32
  //# sourceMappingURL=Payroll.PayrollConfiguration.json.js.map