@gusto/embedded-react-sdk 0.10.3 → 0.10.4

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 (208) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/Base/Base.js +3 -2
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  5. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  7. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  9. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
  11. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  13. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
  27. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  31. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  33. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  34. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
  35. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
  37. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  38. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  39. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  41. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  43. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  45. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  46. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  47. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
  49. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  50. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  51. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  52. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -7
  53. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  54. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  55. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  56. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  57. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  58. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
  59. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  60. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  61. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  62. package/dist/components/Company/FederalTaxes/Head.js +11 -11
  63. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  64. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
  65. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  66. package/dist/components/Company/Industry/Actions.js +6 -5
  67. package/dist/components/Company/Industry/Actions.js.map +1 -1
  68. package/dist/components/Company/Industry/Context.js +7 -6
  69. package/dist/components/Company/Industry/Context.js.map +1 -1
  70. package/dist/components/Company/Industry/Edit.js +11 -10
  71. package/dist/components/Company/Industry/Edit.js.map +1 -1
  72. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  73. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  74. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  75. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  76. package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -7
  77. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  78. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  79. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  81. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationsList/List.js +9 -8
  83. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  84. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
  85. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  87. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  88. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  89. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  90. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  91. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  92. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
  93. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  94. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  95. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  96. package/dist/components/Company/PaySchedule/PaySchedule.js +88 -106
  97. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  98. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  99. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  100. package/dist/components/Company/PaySchedule/_parts/Edit.js +65 -51
  101. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  102. package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
  103. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  105. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  106. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  107. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  108. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  109. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  110. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  111. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  112. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  113. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  114. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  115. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  116. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  117. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  118. package/dist/components/Contractor/Address/Address.js +2 -0
  119. package/dist/components/Contractor/Address/Address.js.map +1 -1
  120. package/dist/components/Contractor/Address/Form.js +3 -2
  121. package/dist/components/Contractor/Address/Form.js.map +1 -1
  122. package/dist/components/Contractor/Address/useAddress.js +6 -5
  123. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  124. package/dist/components/Contractor/List/index.js +48 -50
  125. package/dist/components/Contractor/List/index.js.map +1 -1
  126. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  127. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  128. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  129. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  130. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  131. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  132. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  133. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  134. package/dist/components/Employee/Compensation/Actions.js +5 -4
  135. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  136. package/dist/components/Employee/Compensation/Edit.js +3 -2
  137. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  138. package/dist/components/Employee/Compensation/List.js +6 -5
  139. package/dist/components/Employee/Compensation/List.js.map +1 -1
  140. package/dist/components/Employee/Deductions/Actions.js +9 -8
  141. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  142. package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
  143. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  144. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  145. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  146. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  147. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  148. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  149. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  150. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  151. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  152. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
  153. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  154. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  155. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  156. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  157. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  158. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
  159. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  160. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  161. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  162. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  163. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  164. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -2
  165. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  166. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  167. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  168. package/dist/components/Employee/EmployeeList/List.js +3 -2
  169. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  170. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  171. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  172. package/dist/components/Employee/Landing/Landing.js +7 -6
  173. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  174. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  175. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  176. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  177. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  178. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  179. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  180. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  181. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  182. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  183. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  184. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  185. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  186. package/dist/components/Employee/Profile/Actions.js +7 -6
  187. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  188. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  189. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  190. package/dist/components/Employee/Profile/HomeAddress.js +5 -4
  191. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  192. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  193. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  194. package/dist/components/Employee/Profile/useProfile.js +4 -3
  195. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  196. package/dist/components/Employee/Taxes/Actions.js +8 -7
  197. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  198. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  199. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  200. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  201. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  202. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  203. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  204. package/dist/i18n/en/Company.Locations.json.js +2 -2
  205. package/dist/i18n/en/Company.PaySchedule.json.js +24 -19
  206. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  207. package/dist/types/i18next.d.ts +5 -1
  208. package/package.json +4 -1
@@ -8,12 +8,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
11
12
  import "dompurify";
12
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
14
- const [S, c] = o("SignatureFormContext");
15
+ const [c, d] = o("SignatureFormContext");
15
16
  export {
16
- c as SignatureFormProvider,
17
- S as useSignatureForm
17
+ d as SignatureFormProvider,
18
+ c as useSignatureForm
18
19
  };
19
20
  //# sourceMappingURL=useSignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
3
  import { useEmployeeList as m } from "./useEmployeeList.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as l } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function y() {
7
- const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = l();
6
+ import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ function C() {
8
+ const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = p();
8
9
  return e.length === 0 ? null : /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(i.Button, { onClick: n, isLoading: !1, children: t("continueCta") }) });
9
10
  }
10
11
  export {
11
- y as Actions
12
+ C as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAgB,GAC5CC,IAAaC,EAAoB;AAEnC,SAAAH,EAAU,WAAW,IAChB,OAIN,gBAAAI,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAgB,GAC5CC,IAAaC,EAAoB;AAEnC,SAAAH,EAAU,WAAW,IAChB,OAIN,gBAAAI,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
@@ -8,6 +8,8 @@ import { Actions as P } from "./Actions.js";
8
8
  import { BaseComponent as H } from "../../Base/Base.js";
9
9
  import { useBase as j } from "../../Base/useBase.js";
10
10
  import { Flex as k } from "../../Common/Flex/Flex.js";
11
+ import "react-i18next";
12
+ import "classnames";
11
13
  import { useI18n as V, useComponentDictionary as z } from "../../../i18n/I18n.js";
12
14
  import { componentEvents as s, EmployeeOnboardingStatus as l } from "../../../shared/constants.js";
13
15
  import { Head as h } from "./Head.js";
@@ -95,12 +97,12 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
95
97
  m.Head = h;
96
98
  m.List = O;
97
99
  m.Actions = P;
98
- const ue = () => {
100
+ const Pe = () => {
99
101
  const { companyId: n, onEvent: E } = J();
100
102
  return /* @__PURE__ */ o(m, { companyId: n, onEvent: E });
101
103
  };
102
104
  export {
103
105
  m as EmployeeList,
104
- ue as EmployeeListContextual
106
+ Pe as EmployeeListContextual
105
107
  };
106
108
  //# sourceMappingURL=EmployeeList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, employees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\nEmployeeList.Head = Head\nEmployeeList.List = List\nEmployeeList.Actions = Actions\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":";;;;;;;;;;;;;;;AA0BO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAAiC;AA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EAAgB,wBAAwB;AAAA,QAClD;AAAA,MAuBM;AAAA,MAEC,UACChC,KAEC,gBAAA0C,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAhD,EAACiD,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEArD,EAAa,OAAOmD;AACpBnD,EAAa,OAAOoD;AACpBpD,EAAa,UAAUqD;AAKhB,MAAMC,KAAyB,MAAM;AAC1C,QAAM,EAAE,WAAAjD,GAAW,SAAAM,EAAQ,IAAI4C,EAAoC;AAC5D,SAAA,gBAAArD,EAACF,GAAa,EAAA,WAAAK,GAAsB,SAAAM,EAAkB,CAAA;AAC/D;"}
1
+ {"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, employees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\nEmployeeList.Head = Head\nEmployeeList.List = List\nEmployeeList.Actions = Actions\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":";;;;;;;;;;;;;;;;;AA0BO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAAiC;AAE/E,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C,EAAE,MAAAG,MAASC,EAAyB,EAAE,WAAAf,GAAW,MAAMS,GAAa,KAAKG,GAAc,GACvF,EAAE,UAAAI,GAAU,WAAWC,EAAiB,IAAAH,GACxCI,IAAYD,GAEZ,EAAE,aAAaE,EAAuB,IAAIC,EAA2B,GACrE,EAAE,aAAaC,EAAuC,IAC1DC,EAA2C,GAEvCC,IAAa,OAAOP,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC,GAEvEQ,IAA2B,CAACC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 +1,13 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as n } from "react-i18next";
3
3
  import { Flex as r } from "../../Common/Flex/Flex.js";
4
+ import "classnames";
4
5
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
5
- const a = () => {
6
+ const c = () => {
6
7
  const { t } = n("Employee.EmployeeList"), o = m();
7
8
  return /* @__PURE__ */ e(r, { justifyContent: "space-between", alignItems: "center", children: /* @__PURE__ */ e(o.Heading, { as: "h2", children: t("title") }) });
8
9
  };
9
10
  export {
10
- a as Head
11
+ c as Head
11
12
  };
12
13
  //# sourceMappingURL=Head.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAE,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAE,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}
@@ -3,6 +3,7 @@ import { useTranslation as A } from "react-i18next";
3
3
  import { useState as T } from "react";
4
4
  import k from "./List.module.scss.js";
5
5
  import { useEmployeeList as w } from "./useEmployeeList.js";
6
+ import "classnames";
6
7
  import { EmptyData as B } from "../../Common/EmptyData/EmptyData.js";
7
8
  import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
8
9
  import { useComponentContext as M } from "../../../contexts/ComponentAdapter/useComponentContext.js";
@@ -14,7 +15,7 @@ import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as x } fr
14
15
  import { firstLastName as F } from "../../../helpers/formattedStrings.js";
15
16
  import { useDataView as V } from "../../Common/DataView/useDataView.js";
16
17
  import { DataView as j } from "../../Common/DataView/DataView.js";
17
- const it = () => {
18
+ const rt = () => {
18
19
  const {
19
20
  handleDelete: g,
20
21
  employees: d,
@@ -113,6 +114,6 @@ const it = () => {
113
114
  ] });
114
115
  };
115
116
  export {
116
- it as List
117
+ rt as List
117
118
  };
118
119
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/EmployeeList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport style from './List.module.scss'\nimport { useEmployeeList } from './useEmployeeList'\nimport { DataView, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { EmployeeOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const {\n handleDelete,\n employees,\n handleEdit,\n handleReview,\n handleNew,\n handleCancelSelfOnboarding,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n handleSkip,\n } = useEmployeeList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Employee.EmployeeList')\n const [deleting, setDeleting] = useState<Set<string>>(new Set())\n const { ...dataViewProps } = useDataView({\n data: employees,\n columns: [\n {\n key: 'name',\n title: t('nameLabel'),\n render: employee => {\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n },\n },\n {\n key: 'status',\n title: t('statusLabel'),\n render: ({ onboarded, onboardingStatus }) => (\n <EmployeeOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n itemMenu: employee => {\n const menuItems = []\n\n // Edit item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED\n ) {\n menuItems.push({\n label: t('editCta'),\n onClick: () => {\n handleEdit(employee.uuid, employee.onboardingStatus ?? undefined)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Cancel self onboarding item\n /* @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses */\n if (EmployeeSelfOnboardingStatuses.has(employee.onboarding_status ?? '')) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n onClick: async () => {\n await handleCancelSelfOnboarding(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Review item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n menuItems.push({\n label: t('reviewCta'),\n onClick: () => {\n void handleReview(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Delete item\n if (!employee.onboarded) {\n menuItems.push({\n label: t('deleteCta'),\n onClick: () => {\n setDeleting(prev => new Set(prev).add(employee.uuid))\n void handleDelete(employee.uuid).then(() => {\n setDeleting(prev => {\n const newSet = new Set(prev)\n newSet.delete(employee.uuid)\n return newSet\n })\n })\n },\n icon: <TrashCanSvg aria-hidden />,\n })\n }\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={t('hamburgerTitle')}\n isLoading={deleting.has(employee.uuid)}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button variant=\"secondary\" onClick={handleSkip}>\n {t('skipCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" onClick={handleNew}>\n {t('addEmployeeCTA')}\n </Components.Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n return (\n <>\n {employees.length > 0 && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleNew}>\n {t('addAnotherCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n <div className={style.container}>\n <DataView label={t('employeeListLabel')} {...dataViewProps} />\n </div>\n </>\n )\n}\n"],"names":["List","handleDelete","employees","handleEdit","handleReview","handleNew","handleCancelSelfOnboarding","handleFirstPage","handlePreviousPage","handleNextPage","handleLastPage","handleItemsPerPageChange","currentPage","totalPages","handleSkip","useEmployeeList","Components","useComponentContext","t","useTranslation","deleting","setDeleting","useState","dataViewProps","useDataView","employee","firstLastName","onboarded","onboardingStatus","jsx","EmployeeOnboardingStatusBadge","menuItems","EmployeeOnboardingStatus","PencilSvg","EmployeeSelfOnboardingStatuses","prev","newSet","TrashCanSvg","HamburgerMenu","EmptyData","jsxs","ActionsLayout","Fragment","style","DataView"],"mappings":";;;;;;;;;;;;;;;;AAcO,MAAMA,KAAO,MAAM;AAClB,QAAA;AAAA,IACJ,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,MACEC,EAAgB,GACdC,IAAaC,EAAoB,GAEjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,CAACC,GAAUC,CAAW,IAAIC,EAAsB,oBAAI,KAAK,GACzD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMtB;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOgB,EAAE,WAAW;AAAA,QACpB,QAAQ,CAAYO,MACXC,EAAc;AAAA,UACnB,YAAYD,EAAS;AAAA,UACrB,WAAWA,EAAS;AAAA,QAAA,CACrB;AAAA,MAEL;AAAA,MACA;AAAA,QACE,KAAK;AAAA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C,UAAEa,EAAA,eAAe,EACpB,CAAA,GACF;AAAA,IAED,gBAAAW,EAAA,OAAA,EAAI,WAAWc,EAAM,WACpB,UAAA,gBAAAd,EAACe,GAAS,EAAA,OAAO1B,EAAE,mBAAmB,GAAI,GAAGK,GAAe,EAC9D,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/EmployeeList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport style from './List.module.scss'\nimport { useEmployeeList } from './useEmployeeList'\nimport { DataView, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { EmployeeOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const {\n handleDelete,\n employees,\n handleEdit,\n handleReview,\n handleNew,\n handleCancelSelfOnboarding,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n handleSkip,\n } = useEmployeeList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Employee.EmployeeList')\n const [deleting, setDeleting] = useState<Set<string>>(new Set())\n const { ...dataViewProps } = useDataView({\n data: employees,\n columns: [\n {\n key: 'name',\n title: t('nameLabel'),\n render: employee => {\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n },\n },\n {\n key: 'status',\n title: t('statusLabel'),\n render: ({ onboarded, onboardingStatus }) => (\n <EmployeeOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n itemMenu: employee => {\n const menuItems = []\n\n // Edit item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED\n ) {\n menuItems.push({\n label: t('editCta'),\n onClick: () => {\n handleEdit(employee.uuid, employee.onboardingStatus ?? undefined)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Cancel self onboarding item\n /* @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses */\n if (EmployeeSelfOnboardingStatuses.has(employee.onboarding_status ?? '')) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n onClick: async () => {\n await handleCancelSelfOnboarding(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Review item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n menuItems.push({\n label: t('reviewCta'),\n onClick: () => {\n void handleReview(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Delete item\n if (!employee.onboarded) {\n menuItems.push({\n label: t('deleteCta'),\n onClick: () => {\n setDeleting(prev => new Set(prev).add(employee.uuid))\n void handleDelete(employee.uuid).then(() => {\n setDeleting(prev => {\n const newSet = new Set(prev)\n newSet.delete(employee.uuid)\n return newSet\n })\n })\n },\n icon: <TrashCanSvg aria-hidden />,\n })\n }\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={t('hamburgerTitle')}\n isLoading={deleting.has(employee.uuid)}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button variant=\"secondary\" onClick={handleSkip}>\n {t('skipCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" onClick={handleNew}>\n {t('addEmployeeCTA')}\n </Components.Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n return (\n <>\n {employees.length > 0 && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleNew}>\n {t('addAnotherCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n <div className={style.container}>\n <DataView label={t('employeeListLabel')} {...dataViewProps} />\n </div>\n </>\n )\n}\n"],"names":["List","handleDelete","employees","handleEdit","handleReview","handleNew","handleCancelSelfOnboarding","handleFirstPage","handlePreviousPage","handleNextPage","handleLastPage","handleItemsPerPageChange","currentPage","totalPages","handleSkip","useEmployeeList","Components","useComponentContext","t","useTranslation","deleting","setDeleting","useState","dataViewProps","useDataView","employee","firstLastName","onboarded","onboardingStatus","jsx","EmployeeOnboardingStatusBadge","menuItems","EmployeeOnboardingStatus","PencilSvg","EmployeeSelfOnboardingStatuses","prev","newSet","TrashCanSvg","HamburgerMenu","EmptyData","jsxs","ActionsLayout","Fragment","style","DataView"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAMA,KAAO,MAAM;AAClB,QAAA;AAAA,IACJ,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,MACEC,EAAgB,GACdC,IAAaC,EAAoB,GAEjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,CAACC,GAAUC,CAAW,IAAIC,EAAs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BAAAW,EAACb,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASX,GAC3C,UAAEa,EAAA,gBAAgB,EACrB,CAAA;AAAA,IAAA,EAAA,CACF,EACF,CAAA;AAAA,EAAA,CAEH;AACD,SAEK,gBAAAsB,EAAAE,GAAA,EAAA,UAAA;AAAA,IAAAxC,EAAU,SAAS,KACjB,gBAAA2B,EAAAY,GAAA,EACC,4BAACzB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASX,GAC7C,UAAEa,EAAA,eAAe,EACpB,CAAA,GACF;AAAA,IAED,gBAAAW,EAAA,OAAA,EAAI,WAAWc,EAAM,WACpB,UAAA,gBAAAd,EAACe,GAAS,EAAA,OAAO1B,EAAE,mBAAmB,GAAI,GAAGK,GAAe,EAC9D,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -8,12 +8,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
+ import "classnames";
11
12
  import "dompurify";
12
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
14
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
14
- const [L, c] = o("EmployeeListContext");
15
+ const [c, d] = o("EmployeeListContext");
15
16
  export {
16
- c as EmployeeListProvider,
17
- L as useEmployeeList
17
+ d as EmployeeListProvider,
18
+ c as useEmployeeList
18
19
  };
19
20
  //# sourceMappingURL=useEmployeeList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -6,20 +6,21 @@ import s from "./Landing.module.scss.js";
6
6
  import { BaseComponent as x } from "../../Base/Base.js";
7
7
  import { useBase as y } from "../../Base/useBase.js";
8
8
  import { Flex as r } from "../../Common/Flex/Flex.js";
9
+ import "classnames";
9
10
  import { ActionsLayout as E } from "../../Common/ActionsLayout/ActionsLayout.js";
10
11
  import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import { useI18n as D, useComponentDictionary as I } from "../../../i18n/I18n.js";
12
13
  import { componentEvents as S } from "../../../shared/constants.js";
13
- function F(t) {
14
+ function H(t) {
14
15
  return D("Employee.Landing"), I("Employee.Landing", t.dictionary), /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(L, { ...t, children: t.children }) });
15
16
  }
16
- const L = ({ employeeId: t, companyId: c, className: l }) => {
17
- const { onEvent: m } = y(), o = C(), {
17
+ const L = ({ employeeId: t, companyId: c, className: m }) => {
18
+ const { onEvent: l } = y(), o = C(), {
18
19
  data: { employee: a }
19
20
  } = h({ employeeId: t }), p = a.firstName, {
20
21
  data: { company: d }
21
22
  } = g({ companyId: c }), f = d?.name, { t: n } = u("Employee.Landing");
22
- return /* @__PURE__ */ e("section", { className: l, children: /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 32, children: [
23
+ return /* @__PURE__ */ e("section", { className: m, children: /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 32, children: [
23
24
  /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 8, children: [
24
25
  /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: n("landingSubtitle", { firstName: p, companyName: f }) }),
25
26
  /* @__PURE__ */ e(o.Text, { className: s.description, children: n("landingDescription") })
@@ -38,7 +39,7 @@ const L = ({ employeeId: t, companyId: c, className: l }) => {
38
39
  {
39
40
  variant: "secondary",
40
41
  onClick: () => {
41
- m(S.EMPLOYEE_SELF_ONBOARDING_START);
42
+ l(S.EMPLOYEE_SELF_ONBOARDING_START);
42
43
  },
43
44
  children: n("getStartedCta")
44
45
  }
@@ -48,6 +49,6 @@ const L = ({ employeeId: t, companyId: c, className: l }) => {
48
49
  ] }) });
49
50
  };
50
51
  export {
51
- F as Landing
52
+ H as Landing
52
53
  };
53
54
  //# sourceMappingURL=Landing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport styles from './Landing.module.scss'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const firstName = employee!.firstName\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const companyName = company?.name\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('landingSubtitle', { firstName, companyName })}\n </Components.Heading>\n <Components.Text className={styles.description}>\n {t('landingDescription')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <ul>\n <li>{t('steps.personalInfo')}</li>\n <li>{t('steps.taxInfo')}</li>\n <li>{t('steps.bankInfo')}</li>\n </ul>\n </Flex>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n </Components.Button>\n </ActionsLayout>\n <Components.Text className={styles.description}>\n {t('getStartedDescription')}\n </Components.Text>\n </Flex>\n </Flex>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","company","useCompaniesGetSuspense","companyName","t","useTranslation","jsxs","Flex","styles","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;AAqBO,SAASA,EAAQC,GAA8C;AACpE,SAAAC,EAAQ,kBAAkB,GACHC,EAAA,oBAAoBF,EAAM,UAAU,GAGzD,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,WAAAC,QAA8B;AAC7D,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtBC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,EAAA,IACfC,EAAwB,EAAE,YAAAR,GAAY,GACpCS,IAAYF,EAAU,WAEtB;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAQ;AAAA,EAAA,IACdC,EAAwB,EAAE,WAAA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B,8BAA8B;AAAA,UACxD;AAAA,UAEC,YAAE,eAAe;AAAA,QAAA;AAAA,MAAA,GAEtB;AAAA,MACA,gBAAAtB,EAACQ,EAAW,MAAX,EAAgB,WAAWY,EAAO,aAChC,UAAEJ,EAAA,uBAAuB,EAC5B,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport styles from './Landing.module.scss'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const firstName = employee!.firstName\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const companyName = company?.name\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('landingSubtitle', { firstName, companyName })}\n </Components.Heading>\n <Components.Text className={styles.description}>\n {t('landingDescription')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <ul>\n <li>{t('steps.personalInfo')}</li>\n <li>{t('steps.taxInfo')}</li>\n <li>{t('steps.bankInfo')}</li>\n </ul>\n </Flex>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n </Components.Button>\n </ActionsLayout>\n <Components.Text className={styles.description}>\n {t('getStartedDescription')}\n </Components.Text>\n </Flex>\n </Flex>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","company","useCompaniesGetSuspense","companyName","t","useTranslation","jsxs","Flex","styles","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;;AAqBO,SAASA,EAAQC,GAA8C;AACpE,SAAAC,EAAQ,kBAAkB,GACHC,EAAA,oBAAoBF,EAAM,UAAU,GAGzD,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,WAAAC,QAA8B;AAC7D,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtBC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,EAAA,IACfC,EAAwB,EAAE,YAAAR,GAAY,GACpCS,IAAYF,EAAU,WAEtB;AAAA,I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;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAF,EAAQgB,EAAgB,8BAA8B;AAAA,UACxD;AAAA,UAEC,YAAE,eAAe;AAAA,QAAA;AAAA,MAAA,GAEtB;AAAA,MACA,gBAAAtB,EAACQ,EAAW,MAAX,EAAgB,WAAWY,EAAO,aAChC,UAAEJ,EAAA,uBAAuB,EAC5B,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
@@ -1,10 +1,11 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import { usePaymentMethod as m } from "./usePaymentMethod.js";
2
+ import { useTranslation as m } from "react-i18next";
3
+ import { usePaymentMethod as l } from "./usePaymentMethod.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const L = () => {
7
- const { handleAdd: a, handleCancel: i, isPending: r, bankAccounts: s, handleSplit: c, mode: t } = m(), { t: n } = l("Employee.PaymentMethod"), o = u();
7
+ const f = () => {
8
+ const { handleAdd: a, handleCancel: i, isPending: r, bankAccounts: s, handleSplit: c, mode: t } = l(), { t: n } = m("Employee.PaymentMethod"), o = u();
8
9
  return /* @__PURE__ */ d(p, { children: [
9
10
  (t === "ADD" || t === "SPLIT") && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: i, children: n("cancelAddCta") }),
10
11
  t === "LIST" && s.length > 1 && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: c, children: n("splitCta") }),
@@ -13,6 +14,6 @@ const L = () => {
13
14
  ] });
14
15
  };
15
16
  export {
16
- L as Actions
17
+ f as Actions
17
18
  };
18
19
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AACrB,QAAA,EAAE,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,cAAAC,GAAc,aAAAC,GAAa,MAAAC,MAASC,EAAiB,GAC3F,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAN,MAAS,SAASA,MAAS,YAC3B,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASR,GAC3D,UAAAM,EAAE,cAAc,GACnB;AAAA,IAEDF,MAAS,UAAUF,EAAa,SAAS,uBACvCM,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASL,GAC3D,UAAAG,EAAE,UAAU,GACf;AAAA,IAEDF,MAAS,UACP,gBAAAO,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAAST,GAC3D,UAAAO,EAAE,eAAe,GACpB;AAAA,IAED,gBAAAK,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAK,EAAEF,MAAS,SAASA,MAAS,UAAU,YAAY,WAAW,EACjE,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AACrB,QAAA,EAAE,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,cAAAC,GAAc,aAAAC,GAAa,MAAAC,MAASC,EAAiB,GAC3F,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAN,MAAS,SAASA,MAAS,YAC3B,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASR,GAC3D,UAAAM,EAAE,cAAc,GACnB;AAAA,IAEDF,MAAS,UAAUF,EAAa,SAAS,uBACvCM,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASL,GAC3D,UAAAG,EAAE,UAAU,GACf;AAAA,IAEDF,MAAS,UACP,gBAAAO,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAAST,GAC3D,UAAAO,EAAE,eAAe,GACpB;AAAA,IAED,gBAAAK,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAK,EAAEF,MAAS,SAASA,MAAS,UAAU,YAAY,WAAW,EACjE,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -2,10 +2,11 @@ import { jsxs as i, Fragment as u, jsx as r } from "react/jsx-runtime";
2
2
  import { useFormContext as m } from "react-hook-form";
3
3
  import { useTranslation as c } from "react-i18next";
4
4
  import { usePaymentMethod as s } from "./usePaymentMethod.js";
5
+ import "classnames";
5
6
  import { PAYMENT_METHODS as l } from "../../../shared/constants.js";
6
7
  import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
7
8
  import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
- const h = () => {
9
+ const v = () => {
9
10
  const { mode: a, watchedType: t } = s(), { t: e } = c("Employee.PaymentMethod"), { setValue: n } = m();
10
11
  if (!(a !== "ADD" && a !== "INITIAL" || t === l.check))
11
12
  return n("hasBankPayload", !0), /* @__PURE__ */ i(u, { children: [
@@ -51,6 +52,6 @@ const h = () => {
51
52
  ] });
52
53
  };
53
54
  export {
54
- h as BankAccountForm
55
+ v as BankAccountForm
55
56
  };
56
57
  //# sourceMappingURL=BankAccountEdit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BankAccountEdit.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountEdit.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { BankAccountInputs } from './BankAccount'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const BankAccountForm = () => {\n const { mode, watchedType } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const { setValue } = useFormContext<BankAccountInputs>()\n\n if ((mode !== 'ADD' && mode !== 'INITIAL') || watchedType === PAYMENT_METHODS.check) {\n return\n }\n //Used by form schema to determine variant\n setValue('hasBankPayload', true)\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","mode","watchedType","usePaymentMethod","t","useTranslation","setValue","useFormContext","PAYMENT_METHODS","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;;;;AAOO,MAAMA,IAAkB,MAAM;AACnC,QAAM,EAAE,MAAAC,GAAM,aAAAC,EAAY,IAAIC,EAAiB,GACzC,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,UAAAC,EAAS,IAAIC,EAAkC;AAEvD,MAAK,EAAAN,MAAS,SAASA,MAAS,aAAcC,MAAgBM,EAAgB;AAI9E,WAAAF,EAAS,kBAAkB,EAAI,GAI3B,gBAAAG,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOR,EAAE,WAAW;AAAA,UACpB,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAC3C;AAAA,MAEA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,YAAU;AAAA,UACV,aAAaA,EAAE,0BAA0B;AAAA,UACzC,cAAcA,EAAE,2BAA2B;AAAA,QAAA;AAAA,MAC7C;AAAA,MAEA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,cAAcA,EAAE,2BAA2B;AAAA,UAC3C,YAAU;AAAA,QAAA;AAAA,MACZ;AAAA,MAEA,gBAAAO;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOT,EAAE,kBAAkB;AAAA,UAC3B,SAAS;AAAA,YACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAE;AAAA,YACrD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAE;AAAA,UAAA;AAAA,QACrD;AAAA,MAAA;AAAA,IACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"BankAccountEdit.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountEdit.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { BankAccountInputs } from './BankAccount'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const BankAccountForm = () => {\n const { mode, watchedType } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const { setValue } = useFormContext<BankAccountInputs>()\n\n if ((mode !== 'ADD' && mode !== 'INITIAL') || watchedType === PAYMENT_METHODS.check) {\n return\n }\n //Used by form schema to determine variant\n setValue('hasBankPayload', true)\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","mode","watchedType","usePaymentMethod","t","useTranslation","setValue","useFormContext","PAYMENT_METHODS","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;;;;;AAOO,MAAMA,IAAkB,MAAM;AACnC,QAAM,EAAE,MAAAC,GAAM,aAAAC,EAAY,IAAIC,EAAiB,GACzC,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,UAAAC,EAAS,IAAIC,EAAkC;AAEvD,MAAK,EAAAN,MAAS,SAASA,MAAS,aAAcC,MAAgBM,EAAgB;AAI9E,WAAAF,EAAS,kBAAkB,EAAI,GAI3B,gBAAAG,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOR,EAAE,WAAW;AAAA,UACpB,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAC3C;AAAA,MAEA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,YAAU;AAAA,UACV,aAAaA,EAAE,0BAA0B;AAAA,UACzC,cAAcA,EAAE,2BAA2B;AAAA,QAAA;AAAA,MAC7C;AAAA,MAEA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,cAAcA,EAAE,2BAA2B;AAAA,UAC3C,YAAU;AAAA,QAAA;AAAA,MACZ;AAAA,MAEA,gBAAAO;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOT,EAAE,kBAAkB;AAAA,UAC3B,SAAS;AAAA,YACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAE;AAAA,YACrD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAE;AAAA,UAAA;AAAA,QACrD;AAAA,MAAA;AAAA,IACF,GACF;AAEJ;"}
@@ -2,11 +2,12 @@ import { jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { usePaymentMethod as p } from "./usePaymentMethod.js";
4
4
  import d from "../../../assets/icons/trashcan.svg.js";
5
+ import "classnames";
5
6
  import f from "../../Common/hooks/useNumberFormatter.js";
6
7
  import { HamburgerMenu as y } from "../../Common/HamburgerMenu/HamburgerMenu.js";
7
8
  import { useDataView as b } from "../../Common/DataView/useDataView.js";
8
9
  import { DataView as k } from "../../Common/DataView/DataView.js";
9
- function w() {
10
+ function B() {
10
11
  const { bankAccounts: r, paymentMethod: o, mode: i, handleDelete: m, isPending: u } = p(), { t } = s("Employee.PaymentMethod"), a = f(o.splitBy === "Amount" ? "currency" : "percent"), { ...l } = b({
11
12
  data: r,
12
13
  columns: [
@@ -42,6 +43,6 @@ function w() {
42
43
  return /* @__PURE__ */ n(k, { label: t("bankAccountsListLabel"), ...l });
43
44
  }
44
45
  export {
45
- w as BankAccountsList
46
+ B as BankAccountsList
46
47
  };
47
48
  //# sourceMappingURL=BankAccountsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n return format(\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0,\n )\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCTA'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","split","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":";;;;;;;;AAOO,SAASA,IAAmB;AACjC,QAAM,EAAE,cAAAC,GAAc,eAAAC,GAAe,MAAAC,GAAM,cAAAC,GAAc,WAAAC,MAAcC,EAAiB,GAClF,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAASC,EAAmBP,EAAc,YAAY,WAAW,aAAa,SAAS,GAEvF,EAAE,GAAGQ,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,QAAQ,OAAO,EAAE,gBAAgB,EAAE;AAAA,MAC1C,EAAE,KAAK,iBAAiB,OAAO,EAAE,qBAAqB,EAAE;AAAA,MACxD,EAAE,KAAK,eAAe,OAAO,EAAE,mBAAmB,EAAE;AAAA,MACpD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAeW,MACdJ;AAAA,UACLN,EAAc,QAAQ,KAAK,CAAAW,MAASA,EAAM,SAASD,EAAY,IAAI,GAAG,eAAe;AAAA,QACvF;AAAA,MACF;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAX,EAAaQ,EAAY,IAAI;AAAA,YAC/B;AAAA,YACA,MAAM,gBAAAE,EAACE,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAEnC;AAAA,QACA,cAAc,EAAE,gBAAgB;AAAA,QAChC,WAAWX;AAAA,MAAA;AAAA,IACb;AAAA,EAEJ,CACD;AAED,MAAIF,MAAS;AAEb,6BAAQc,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGP,GAAe;AACzE;"}
1
+ {"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n return format(\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0,\n )\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCTA'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","split","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAOO,SAASA,IAAmB;AACjC,QAAM,EAAE,cAAAC,GAAc,eAAAC,GAAe,MAAAC,GAAM,cAAAC,GAAc,WAAAC,MAAcC,EAAiB,GAClF,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAASC,EAAmBP,EAAc,YAAY,WAAW,aAAa,SAAS,GAEvF,EAAE,GAAGQ,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,QAAQ,OAAO,EAAE,gBAAgB,EAAE;AAAA,MAC1C,EAAE,KAAK,iBAAiB,OAAO,EAAE,qBAAqB,EAAE;AAAA,MACxD,EAAE,KAAK,eAAe,OAAO,EAAE,mBAAmB,EAAE;AAAA,MACpD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAeW,MACdJ;AAAA,UACLN,EAAc,QAAQ,KAAK,CAAAW,MAASA,EAAM,SAASD,EAAY,IAAI,GAAG,eAAe;AAAA,QACvF;AAAA,MACF;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAX,EAAaQ,EAAY,IAAI;AAAA,YAC/B;AAAA,YACA,MAAM,gBAAAE,EAACE,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAEnC;AAAA,QACA,cAAc,EAAE,gBAAgB;AAAA,QAChC,WAAWX;AAAA,MAAA;AAAA,IACb;AAAA,EAEJ,CACD;AAED,MAAIF,MAAS;AAEb,6BAAQc,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGP,GAAe;AACzE;"}
@@ -2,12 +2,13 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { z as o } from "zod";
4
4
  import { usePaymentMethod as m } from "./usePaymentMethod.js";
5
+ import "classnames";
5
6
  import { PAYMENT_METHODS as i } from "../../../shared/constants.js";
6
7
  import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
8
  o.object({
8
9
  type: o.enum(["Check", "Direct Deposit"])
9
10
  });
10
- function y() {
11
+ function f() {
11
12
  const { mode: t } = m(), { t: e } = p("Employee.PaymentMethod");
12
13
  if (!(t !== "INITIAL" && t !== "LIST"))
13
14
  return /* @__PURE__ */ r(
@@ -32,6 +33,6 @@ function y() {
32
33
  );
33
34
  }
34
35
  export {
35
- y as PaymentTypeForm
36
+ f as PaymentTypeForm
36
37
  };
37
38
  //# sourceMappingURL=PaymentTypeForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentTypeForm.js","sources":["../../../../src/components/Employee/PaymentMethod/PaymentTypeForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const PaymentTypeSchema = z.object({\n type: z.enum(['Check', 'Direct Deposit']),\n})\nexport type PaymentTypeInputs = z.input<typeof PaymentTypeSchema>\nexport type PaymentTypePayload = z.output<typeof PaymentTypeSchema>\n\nexport function PaymentTypeForm() {\n const { mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <RadioGroupField\n name=\"type\"\n label={t('paymentFieldsetLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: PAYMENT_METHODS.directDeposit,\n label: t('directDepositLabel'),\n description: t('directDepositDescription'),\n },\n {\n value: PAYMENT_METHODS.check,\n label: t('checkLabel'),\n description: t('checkDescription'),\n },\n ]}\n />\n )\n}\n"],"names":["z","PaymentTypeForm","mode","usePaymentMethod","t","useTranslation","jsx","RadioGroupField","PAYMENT_METHODS"],"mappings":";;;;;;AAMiCA,EAAE,OAAO;AAAA,EACxC,MAAMA,EAAE,KAAK,CAAC,SAAS,gBAAgB,CAAC;AAC1C,CAAC;AAIM,SAASC,IAAkB;AAC1B,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAiB,GAC5B,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB;AACjD,MAAA,EAAAH,MAAS,aAAaA,MAAS;AAEjC,WAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,uBAAuB;AAAA,QAChC,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAC3C;AAAA,UACA;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,YAAY;AAAA,YACrB,aAAaA,EAAE,kBAAkB;AAAA,UAAA;AAAA,QACnC;AAAA,MACF;AAAA,IACF;AAEJ;"}
1
+ {"version":3,"file":"PaymentTypeForm.js","sources":["../../../../src/components/Employee/PaymentMethod/PaymentTypeForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const PaymentTypeSchema = z.object({\n type: z.enum(['Check', 'Direct Deposit']),\n})\nexport type PaymentTypeInputs = z.input<typeof PaymentTypeSchema>\nexport type PaymentTypePayload = z.output<typeof PaymentTypeSchema>\n\nexport function PaymentTypeForm() {\n const { mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <RadioGroupField\n name=\"type\"\n label={t('paymentFieldsetLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: PAYMENT_METHODS.directDeposit,\n label: t('directDepositLabel'),\n description: t('directDepositDescription'),\n },\n {\n value: PAYMENT_METHODS.check,\n label: t('checkLabel'),\n description: t('checkDescription'),\n },\n ]}\n />\n )\n}\n"],"names":["z","PaymentTypeForm","mode","usePaymentMethod","t","useTranslation","jsx","RadioGroupField","PAYMENT_METHODS"],"mappings":";;;;;;;AAMiCA,EAAE,OAAO;AAAA,EACxC,MAAMA,EAAE,KAAK,CAAC,SAAS,gBAAgB,CAAC;AAC1C,CAAC;AAIM,SAASC,IAAkB;AAC1B,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAiB,GAC5B,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB;AACjD,MAAA,EAAAH,MAAS,aAAaA,MAAS;AAEjC,WAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,uBAAuB;AAAA,QAChC,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAC3C;AAAA,UACA;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,YAAY;AAAA,YACrB,aAAaA,EAAE,kBAAkB;AAAA,UAAA;AAAA,QACnC;AAAA,MACF;AAAA,IACF;AAEJ;"}
@@ -5,13 +5,14 @@ import { ErrorMessage as z } from "@hookform/error-message";
5
5
  import y from "dompurify";
6
6
  import { useMemo as j, useEffect as D } from "react";
7
7
  import { usePaymentMethod as N } from "./usePaymentMethod.js";
8
+ import "classnames";
8
9
  import { useLocale as q } from "../../../contexts/LocaleProvider/useLocale.js";
9
10
  import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
11
  import { ReorderableList as I } from "../../Common/ReorderableList/ReorderableList.js";
11
12
  import { SPLIT_BY as h } from "../../../shared/constants.js";
12
13
  import { RadioGroupField as W } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
14
  import { NumberInputField as F } from "../../Common/Fields/NumberInputField/NumberInputField.js";
14
- function oe() {
15
+ function ie() {
15
16
  const { paymentMethod: r, bankAccounts: m, mode: c } = N(), {
16
17
  control: s,
17
18
  setValue: o,
@@ -168,6 +169,6 @@ function G({
168
169
  ) }, r.uuid);
169
170
  }
170
171
  export {
171
- oe as Split
172
+ ie as Split
172
173
  };
173
174
  //# sourceMappingURL=Split.js.map