@gusto/embedded-react-sdk 0.10.7 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
  3. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  4. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  5. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
  7. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  9. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  10. package/dist/components/Common/UI/Button/Button.js +4 -4
  11. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  12. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
  13. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
  14. package/dist/components/Company/AssignSignatory/AssignSignatory.js +34 -38
  15. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
  17. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -54
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -43
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -11
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  33. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  34. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  35. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  37. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  38. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  39. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -8
  41. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
  43. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  45. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  46. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  48. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  50. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  51. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  54. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  55. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  57. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -43
  58. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  59. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  60. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  61. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  62. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  63. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -46
  64. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  65. package/dist/components/Company/FederalTaxes/Actions.js +6 -5
  66. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  67. package/dist/components/Company/FederalTaxes/FederalTaxes.js +12 -13
  68. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  69. package/dist/components/Company/FederalTaxes/Form.js +4 -3
  70. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  71. package/dist/components/Company/Industry/Actions.js +3 -2
  72. package/dist/components/Company/Industry/Actions.js.map +1 -1
  73. package/dist/components/Company/Industry/Edit.js +5 -4
  74. package/dist/components/Company/Industry/Edit.js.map +1 -1
  75. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  76. package/dist/components/Company/Industry/Industry.js +23 -29
  77. package/dist/components/Company/Industry/Industry.js.map +1 -1
  78. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  79. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
  81. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  83. package/dist/components/Company/Locations/LocationForm/LocationForm.js +44 -48
  84. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  85. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  86. package/dist/components/Company/Locations/Locations.js +14 -18
  87. package/dist/components/Company/Locations/Locations.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
  89. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  90. package/dist/components/Company/Locations/LocationsList/List.js +3 -2
  91. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  93. package/dist/components/Company/Locations/LocationsList/LocationsList.js +28 -32
  94. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  95. package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
  96. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  97. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -6
  98. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  99. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
  100. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  101. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  102. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -77
  103. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -9
  105. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  106. package/dist/components/Company/PaySchedule/_parts/Edit.js +37 -38
  107. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  108. package/dist/components/Company/PaySchedule/_parts/Head.js +7 -6
  109. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  110. package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
  111. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  112. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  113. package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
  114. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  115. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  116. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  117. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  118. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  119. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  120. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  121. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  123. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  125. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  126. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  127. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  128. package/dist/components/Contractor/Address/Address.js +35 -39
  129. package/dist/components/Contractor/Address/Address.js.map +1 -1
  130. package/dist/components/Contractor/Address/Form.js +3 -4
  131. package/dist/components/Contractor/Address/Form.js.map +1 -1
  132. package/dist/components/Contractor/List/index.js +2 -3
  133. package/dist/components/Contractor/List/index.js.map +1 -1
  134. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
  135. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  136. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  137. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  138. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  139. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  140. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  141. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  142. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  143. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  144. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  145. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  146. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  147. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  148. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  149. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  150. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  151. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  152. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  153. package/dist/components/Contractor/Submit/index.js +20 -0
  154. package/dist/components/Contractor/Submit/index.js.map +1 -0
  155. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  156. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  157. package/dist/components/Contractor/index.d.ts +2 -0
  158. package/dist/components/Contractor/index.js +10 -6
  159. package/dist/components/Contractor/index.js.map +1 -1
  160. package/dist/components/Employee/Compensation/Actions.js +1 -1
  161. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  162. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  163. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  164. package/dist/components/Employee/Compensation/Edit.js +12 -12
  165. package/dist/components/Employee/Compensation/List.js +23 -22
  166. package/dist/components/Employee/Compensation/List.js.map +1 -1
  167. package/dist/components/Employee/Deductions/Actions.js +8 -7
  168. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  169. package/dist/components/Employee/Deductions/DeductionForm.js +11 -10
  170. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  171. package/dist/components/Employee/Deductions/DeductionsList.js +6 -5
  172. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  173. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +11 -10
  174. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  175. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
  176. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  177. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  178. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -29
  179. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  180. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  181. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  182. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  183. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  184. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  185. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  186. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -45
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  188. package/dist/components/Employee/EmployeeList/Actions.js +3 -2
  189. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  190. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  191. package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -60
  192. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  193. package/dist/components/Employee/EmployeeList/Head.js +6 -5
  194. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  195. package/dist/components/Employee/EmployeeList/List.js +12 -12
  196. package/dist/components/Employee/Landing/Landing.js +8 -8
  197. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  198. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  199. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  200. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
  201. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -8
  202. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  203. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  204. package/dist/components/Employee/Profile/Actions.js +7 -6
  205. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  206. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  207. package/dist/components/Employee/Profile/HomeAddress.js +5 -6
  208. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  209. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  210. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -11
  211. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  212. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  213. package/dist/components/Employee/Profile/Profile.js +131 -138
  214. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  215. package/dist/components/Employee/Taxes/Actions.js +9 -8
  216. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  217. package/dist/components/Employee/Taxes/FederalForm.js +11 -10
  218. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  219. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  220. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  221. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  222. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  223. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  224. package/dist/i18n/I18n.js +1 -1
  225. package/dist/i18n/I18n.js.map +1 -1
  226. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  227. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  228. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  229. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  230. package/dist/shared/constants.d.ts +14 -0
  231. package/dist/shared/constants.js +33 -26
  232. package/dist/shared/constants.js.map +1 -1
  233. package/dist/style.css +1 -1
  234. package/dist/types/i18next.d.ts +77 -1
  235. package/package.json +3 -3
@@ -2,12 +2,13 @@ import { jsxs as e, Fragment as d, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
3
  import { usePaySchedule as m } from "../usePaySchedule.js";
4
4
  import "classnames";
5
- import { ActionsLayout as i } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as r } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const E = () => {
8
- const { t: n } = l("Company.PaySchedule"), { mode: c, handleAdd: a, handleCancel: r, handleContinue: s } = m(), t = u();
8
+ const v = () => {
9
+ const { t: n } = l("Company.PaySchedule"), { mode: i, handleAdd: a, handleCancel: c, handleContinue: s } = m(), t = u();
9
10
  return /* @__PURE__ */ e(d, { children: [
10
- c === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(i, { children: [
11
+ i === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(r, { children: [
11
12
  /* @__PURE__ */ o(
12
13
  t.Button,
13
14
  {
@@ -29,26 +30,26 @@ const E = () => {
29
30
  }
30
31
  )
31
32
  ] }),
32
- c === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(i, { children: [
33
+ i === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
33
34
  /* @__PURE__ */ o(
34
35
  t.Button,
35
36
  {
36
37
  variant: "secondary",
37
38
  onClick: () => {
38
- r();
39
+ c();
39
40
  },
40
41
  children: n("actions.cancel")
41
42
  }
42
43
  ),
43
44
  /* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
44
45
  ] }),
45
- c === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(i, { children: [
46
+ i === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
46
47
  /* @__PURE__ */ o(
47
48
  t.Button,
48
49
  {
49
50
  variant: "secondary",
50
51
  onClick: () => {
51
- r();
52
+ c();
52
53
  },
53
54
  children: n("actions.cancel")
54
55
  }
@@ -58,6 +59,6 @@ const E = () => {
58
59
  ] });
59
60
  };
60
61
  export {
61
- E as Actions
62
+ v as Actions
62
63
  };
63
64
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAe,GACnEC,IAAaC,EAAoB;AAEvC,SAEK,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAASR,MAAA,0CACPS,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACH,YAAAJ,EAAA;AAAA,UACZ;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAC/B;AAAA,MACA,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACE,YAAAF,EAAA;AAAA,UACjB;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,EACtD,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAe,GACnEC,IAAaC,EAAoB;AAEvC,SAEK,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAASR,MAAA,0CACPS,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACH,YAAAJ,EAAA;AAAA,UACZ;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAC/B;AAAA,MACA,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACE,YAAAF,EAAA;AAAA,UACjB;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,EACtD,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
2
  import { useFormContext as S, useWatch as u } from "react-hook-form";
3
3
  import { useTranslation as T } from "react-i18next";
4
4
  import { useState as N, useEffect as h } from "react";
@@ -6,25 +6,24 @@ import { usePaySchedule as x } from "../usePaySchedule.js";
6
6
  import n from "./Edit.module.scss.js";
7
7
  import { Flex as f } from "../../../Common/Flex/Flex.js";
8
8
  import { Grid as E } from "../../../Common/Grid/Grid.js";
9
- import "classnames";
10
- import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { formatDateNamedWeekdayShortPlusDate as P } from "../../../../helpers/dateFormatting.js";
9
+ import { RadioGroupField as R } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
12
10
  import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
13
- import { SelectField as v } from "../../../Common/Fields/SelectField/SelectField.js";
14
- import { RadioGroupField as F } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
15
- import { NumberInputField as D } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
16
- import { DatePickerField as w } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
17
- const J = () => {
18
- const d = R(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [a, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
11
+ import { DatePickerField as P } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
12
+ import { NumberInputField as v } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
13
+ import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { formatDateNamedWeekdayShortPlusDate as D } from "../../../../helpers/dateFormatting.js";
15
+ import { SelectField as w } from "../../../Common/Fields/SelectField/SelectField.js";
16
+ const z = () => {
17
+ const d = F(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [r, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
19
18
  return h(() => {
20
19
  i === "Twice per month" && l === "1st15th" && (o("day1", 15), o("day2", 31));
21
20
  }, [i, l, o]), h(() => {
22
- y === void 0 && o("payPeriodPreviewRange", a);
23
- }, [a, o, y]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ r("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
24
- /* @__PURE__ */ r("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(f, { flexDirection: "column", children: [
25
- /* @__PURE__ */ r(O, { name: "customName", label: "Name", isRequired: !0 }),
26
- /* @__PURE__ */ r(
27
- v,
21
+ y === void 0 && o("payPeriodPreviewRange", r);
22
+ }, [r, o, y]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ a("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
23
+ /* @__PURE__ */ a("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(f, { flexDirection: "column", children: [
24
+ /* @__PURE__ */ a(O, { name: "customName", label: "Name", isRequired: !0 }),
25
+ /* @__PURE__ */ a(
26
+ w,
28
27
  {
29
28
  name: "frequency",
30
29
  label: e("labels.frequency"),
@@ -37,8 +36,8 @@ const J = () => {
37
36
  isRequired: !0
38
37
  }
39
38
  ),
40
- i === "Twice per month" && /* @__PURE__ */ r(
41
- F,
39
+ i === "Twice per month" && /* @__PURE__ */ a(
40
+ R,
42
41
  {
43
42
  name: "customTwicePerMonth",
44
43
  label: e("labels.frequencyOptions"),
@@ -49,8 +48,8 @@ const J = () => {
49
48
  ]
50
49
  }
51
50
  ),
52
- /* @__PURE__ */ r(
53
- w,
51
+ /* @__PURE__ */ a(
52
+ P,
54
53
  {
55
54
  name: "anchorPayDate",
56
55
  label: e("labels.firstPayDate"),
@@ -58,8 +57,8 @@ const J = () => {
58
57
  isRequired: !0
59
58
  }
60
59
  ),
61
- /* @__PURE__ */ r(
62
- w,
60
+ /* @__PURE__ */ a(
61
+ P,
63
62
  {
64
63
  name: "anchorEndOfPayPeriod",
65
64
  label: e("labels.firstPayPeriodEndDate"),
@@ -67,55 +66,55 @@ const J = () => {
67
66
  isRequired: !0
68
67
  }
69
68
  ),
70
- /* @__PURE__ */ r("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ r(D, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
71
- /* @__PURE__ */ r("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ r(D, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
69
+ /* @__PURE__ */ a("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
70
+ /* @__PURE__ */ a("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
72
71
  ] }) }),
73
- /* @__PURE__ */ r(f, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: t && t[a] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
74
- !b && /* @__PURE__ */ r(
75
- v,
72
+ /* @__PURE__ */ a(f, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: t && t[r] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
73
+ !b && /* @__PURE__ */ a(
74
+ w,
76
75
  {
77
76
  name: "payPeriodPreviewRange",
78
77
  label: e("labels.preview"),
79
78
  options: t.map((s, c) => ({
80
79
  value: String(c),
81
- label: `${P(s.startDate)} – ${P(s.endDate)}`
80
+ label: `${D(s.startDate)} – ${D(s.endDate)}`
82
81
  })),
83
- defaultValue: String(a),
82
+ defaultValue: String(r),
84
83
  onChange: (s) => {
85
84
  const c = Number(s);
86
85
  isNaN(c) || g(c);
87
86
  }
88
87
  }
89
88
  ),
90
- /* @__PURE__ */ r(
89
+ /* @__PURE__ */ a(
91
90
  d.CalendarPreview,
92
91
  {
93
92
  dateRange: {
94
- start: new Date(t[a].startDate),
95
- end: new Date(t[a].endDate),
93
+ start: new Date(t[r].startDate),
94
+ end: new Date(t[r].endDate),
96
95
  label: e("payPreview.payPeriod") || "Pay Period"
97
96
  },
98
97
  highlightDates: [
99
98
  {
100
- date: new Date(t[a].checkDate),
99
+ date: new Date(t[r].checkDate),
101
100
  highlightColor: "primary",
102
101
  label: e("payPreview.payday") || "Payday"
103
102
  },
104
103
  {
105
- date: new Date(t[a].runPayrollBy),
104
+ date: new Date(t[r].runPayrollBy),
106
105
  highlightColor: "secondary",
107
106
  label: e("payPreview.payrollDeadline") || "Payroll Deadline"
108
107
  }
109
108
  ]
110
109
  },
111
- a
110
+ r
112
111
  )
113
- ] }) : /* @__PURE__ */ r("div", { className: n.calendarContainer, children: /* @__PURE__ */ r(
112
+ ] }) : /* @__PURE__ */ a("div", { className: n.calendarContainer, children: /* @__PURE__ */ a(
114
113
  d.Alert,
115
114
  {
116
115
  status: "info",
117
116
  label: e("previewAlert.title", "Pay Schedule Preview"),
118
- children: /* @__PURE__ */ r(d.Text, { children: e(
117
+ children: /* @__PURE__ */ a(d.Text, { children: e(
119
118
  "previewAlert.description",
120
119
  "Complete all the required fields on the left to see a preview of your pay schedule."
121
120
  ) })
@@ -124,6 +123,6 @@ const J = () => {
124
123
  ] }) });
125
124
  };
126
125
  export {
127
- J as Edit
126
+ z as Edit
128
127
  };
129
128
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n const payPeriodPreviewRange = useWatch({ name: 'payPeriodPreviewRange' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n // This is a workaround to ensure that the pay period preview range is set when the selected pay period index changes\n // TODO: Once we have a RHF free select, that can be used and this effect can be removed\n useEffect(() => {\n if (payPeriodPreviewRange === undefined) {\n setValue('payPeriodPreviewRange', selectedPayPeriodIndex)\n }\n }, [selectedPayPeriodIndex, setValue, payPeriodPreviewRange])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <SelectField\n name=\"payPeriodPreviewRange\"\n label={t('labels.preview')}\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate)}`,\n }\n })}\n defaultValue={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","payPeriodPreviewRange","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAe,GAC/D,EAAE,UAAAC,EAAS,IAAIC,EAAkC,GACjD,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAC9DE,IAAwBF,EAAS,EAAE,MAAM,yBAAyB,GAElEG,IACHJ,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFK,IAAiBL,MAAc,qBAAqBE,MAAwB;AAiB9E,SAfJI,EAAU,MAAM;AACV,IAAAN,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEpB,GAAA,CAACK,GAAWE,GAAqBP,CAAQ,CAAC,GAI7CW,EAAU,MAAM;AACd,IAAIH,MAA0B,UAC5BR,EAAS,yBAAyBE,CAAsB;AAAA,EAEzD,GAAA,CAACA,GAAwBF,GAAUQ,CAAqB,CAAC,GAExDX,MAAS,uBAAuBA,MAAS,qBACpC,OAIN,gBAAAe,EAAA,OAAA,EAAI,WAAWC,EAAM,sBACpB,UAAC,gBAAAC,EAAAC,GAAA,EAAK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AAiB;AAAA,YACxE,OAAOR,EAAE,sBAAsB,KAAK;AAAA,UACtC;AAAA,UACA,gBAAgB;AAAA,YACd;AAAA,cACE,MAAM,IAAI,KAAKE,EAAiBM,CAAsB,EAAE,SAAmB;AAAA,cAC3E,gBAAgB;AAAA,cAChB,OAAOR,EAAE,mBAAmB,KAAK;AAAA,YACnC;AAAA,YACA;AAAA,cACE,MAAM,IAAI,KAAKE,EAAiBM,CAAsB,EAAE,YAAsB;AAAA,cAC9E,gBAAgB;AAAA,cAChB,OAAOR,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKQ;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAU,EAAC,OAAI,EAAA,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACpB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAkB,EAACpB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA;AAAA,OAEJ,EAEJ,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n const payPeriodPreviewRange = useWatch({ name: 'payPeriodPreviewRange' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n // This is a workaround to ensure that the pay period preview range is set when the selected pay period index changes\n // TODO: Once we have a RHF free select, that can be used and this effect can be removed\n useEffect(() => {\n if (payPeriodPreviewRange === undefined) {\n setValue('payPeriodPreviewRange', selectedPayPeriodIndex)\n }\n }, [selectedPayPeriodIndex, setValue, payPeriodPreviewRange])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <SelectField\n name=\"payPeriodPreviewRange\"\n label={t('labels.preview')}\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate)}`,\n }\n })}\n defaultValue={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","payPeriodPreviewRange","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAe,GAC/D,EAAE,UAAAC,EAAS,IAAIC,EAAkC,GACjD,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAC9DE,IAAwBF,EAAS,EAAE,MAAM,yBAAyB,GAElEG,IACHJ,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFK,IAAiBL,MAAc,qBAAqBE,MAAwB;AAiB9E,SAfJI,EAAU,MAAM;AACV,IAAAN,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEpB,GAAA,CAACK,GAAWE,GA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AC7B,YAAC,MAAMC,CAAY,KACrBvB,EAA0BuB,CAAY;AAAA,UACxC;AAAA,QACF;AAAA,MACF;AAAA,MAEF,gBAAAd;AAAA,QAACpB,EAAW;AAAA,QAAX;AAAA,UAEC,WAAW;AAAA,YACT,OAAO,IAAI,KAAKI,EAAiBM,CAAsB,EAAE,SAAmB;AAAA,YAC5E,KAAK,IAAI,KAAKN,EAAiBM,CAAsB,EAAE,OAAiB;AAAA,YACxE,OAAOR,EAAE,sBAAsB,KAAK;AAAA,UACtC;AAAA,UACA,gBAAgB;AAAA,YACd;AAAA,cACE,MAAM,IAAI,KAAKE,EAAiBM,CAAsB,EAAE,SAAmB;AAAA,cAC3E,gBAAgB;AAAA,cAChB,OAAOR,EAAE,mBAAmB,KAAK;AAAA,YACnC;AAAA,YACA;AAAA,cACE,MAAM,IAAI,KAAKE,EAAiBM,CAAsB,EAAE,YAAsB;AAAA,cAC9E,gBAAgB;AAAA,cAChB,OAAOR,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKQ;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAU,EAAC,OAAI,EAAA,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACpB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAkB,EAACpB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA;AAAA,OAEJ,EAEJ,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
@@ -1,15 +1,16 @@
1
- import { jsx as e, jsxs as r, Fragment as o } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
2
2
  import { useTranslation as c, Trans as a } from "react-i18next";
3
3
  import { usePaySchedule as d } from "../usePaySchedule.js";
4
4
  import { Flex as h } from "../../../Common/Flex/Flex.js";
5
5
  import "classnames";
6
+ import "../../../../shared/constants.js";
6
7
  import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const D = () => {
8
- const { t } = c("Company.PaySchedule"), n = l(), { mode: s } = d();
8
+ const S = () => {
9
+ const { t } = c("Company.PaySchedule"), n = l(), { mode: r } = d();
9
10
  let i = /* @__PURE__ */ e(o, {});
10
- switch (s) {
11
+ switch (r) {
11
12
  case "LIST_PAY_SCHEDULES":
12
- i = /* @__PURE__ */ r(o, { children: [
13
+ i = /* @__PURE__ */ s(o, { children: [
13
14
  /* @__PURE__ */ e(n.Heading, { as: "h2", children: t("headings.pageTitle") }),
14
15
  /* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
15
16
  a,
@@ -43,6 +44,6 @@ const D = () => {
43
44
  return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: i }) });
44
45
  };
45
46
  export {
46
- D as Head
47
+ S as Head
47
48
  };
48
49
  //# sourceMappingURL=Head.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
@@ -1,37 +1,38 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
2
  import { useTranslation as h } from "react-i18next";
3
3
  import { usePaySchedule as y } from "../usePaySchedule.js";
4
4
  import o from "./List.module.scss.js";
5
5
  import { Flex as s } from "../../../Common/Flex/Flex.js";
6
6
  import "classnames";
7
+ import "../../../../shared/constants.js";
7
8
  import f from "../../../../assets/icons/pencil.svg.js";
8
9
  import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
10
  import { HamburgerMenu as v } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
10
11
  import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
11
12
  import { useDataView as L } from "../../../Common/DataView/useDataView.js";
12
13
  import { DataView as C } from "../../../Common/DataView/DataView.js";
13
- const B = () => {
14
- const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
14
+ const F = () => {
15
+ const { t: r } = h("Company.PaySchedule"), n = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
15
16
  data: m || [],
16
17
  columns: [
17
18
  {
18
- title: n("payScheduleList.name"),
19
+ title: r("payScheduleList.name"),
19
20
  key: "customName",
20
21
  render: (t) => {
21
22
  const a = !!t.name;
22
23
  let i = a ? t.name : t.customName;
23
24
  i && i.length > 1 ? i = i.charAt(0).toUpperCase() + i.slice(1) : i = t.customName;
24
- const u = t.customName;
25
- return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ p("div", { className: o.content, children: [
25
+ const p = t.customName;
26
+ return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ u("div", { className: o.content, children: [
26
27
  /* @__PURE__ */ e("div", { children: i }),
27
- a && /* @__PURE__ */ e("div", { children: u })
28
+ a && /* @__PURE__ */ e("div", { children: p })
28
29
  ] }) });
29
30
  }
30
31
  },
31
32
  {
32
- title: /* @__PURE__ */ e(g, { children: n("payScheduleList.active") }),
33
+ title: /* @__PURE__ */ e(g, { children: r("payScheduleList.active") }),
33
34
  key: "active",
34
- render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(r.Badge, { status: "success", children: n("payScheduleList.active") }) : /* @__PURE__ */ e(r.Badge, { status: "info", children: n("payScheduleList.inactive") }) }) })
35
+ render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(n.Badge, { status: "success", children: r("payScheduleList.active") }) : /* @__PURE__ */ e(n.Badge, { status: "info", children: r("payScheduleList.inactive") }) }) })
35
36
  }
36
37
  ],
37
38
  itemMenu: (t) => /* @__PURE__ */ e(
@@ -40,7 +41,7 @@ const B = () => {
40
41
  triggerLabel: "Actions",
41
42
  items: [
42
43
  {
43
- label: n("payScheduleList.edit"),
44
+ label: r("payScheduleList.edit"),
44
45
  onClick: () => {
45
46
  l(t);
46
47
  },
@@ -53,6 +54,6 @@ const B = () => {
53
54
  return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
54
55
  };
55
56
  export {
56
- B as List
57
+ F as List
57
58
  };
58
59
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","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B,QAAO,WAAW,UAAAF,EAAE,wBAAwB,EAAE,CAAA,IAE/D,gBAAAc,EAAAZ,EAAW,OAAX,EAAiB,QAAO,QAAQ,UAAAF,EAAE,0BAA0B,GAAE,GAEnE,EACF,CAAA;AAAA,MAAA;AAAA,IAGN;AAAA,IACA,UAAU,CAAYU,MAElB,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACjD,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D;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
@@ -3,7 +3,3 @@ export interface StateTaxesProps extends BaseComponentInterface<'Company.StateTa
3
3
  companyId: string;
4
4
  }
5
5
  export declare function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace StateTaxes {
7
- var StateTaxesList: typeof import("./StateTaxesList/StateTaxesList").StateTaxesList;
8
- var StateTaxesForm: typeof import("./StateTaxesForm/StateTaxesForm").StateTaxesForm;
9
- }
@@ -1,27 +1,23 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createMachine as s } from "robot3";
3
- import { stateTaxesStateMachine as n } from "./stateTaxesStateMachine.js";
4
- import { StateTaxesListContextual as x } from "./StateTaxesComponents.js";
5
- import { StateTaxesList as p } from "./StateTaxesList/StateTaxesList.js";
6
- import { StateTaxesForm as S } from "./StateTaxesForm/StateTaxesForm.js";
7
- import { Flow as T } from "../../Flow/Flow.js";
8
- import { useComponentDictionary as f } from "../../../i18n/I18n.js";
9
- function t({ companyId: e, onEvent: a, dictionary: o }) {
10
- f("Company.StateTaxes", o);
11
- const m = s(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createMachine as n } from "robot3";
3
+ import { stateTaxesStateMachine as i } from "./stateTaxesStateMachine.js";
4
+ import { StateTaxesListContextual as s } from "./StateTaxesComponents.js";
5
+ import { Flow as p } from "../../Flow/Flow.js";
6
+ import { useComponentDictionary as x } from "../../../i18n/I18n.js";
7
+ function C({ companyId: t, onEvent: e, dictionary: o }) {
8
+ x("Company.StateTaxes", o);
9
+ const a = n(
12
10
  "viewStateTaxes",
13
- n,
14
- (r) => ({
15
- ...r,
16
- component: x,
17
- companyId: e
11
+ i,
12
+ (m) => ({
13
+ ...m,
14
+ component: s,
15
+ companyId: t
18
16
  })
19
17
  );
20
- return /* @__PURE__ */ i(T, { machine: m, onEvent: a });
18
+ return /* @__PURE__ */ r(p, { machine: a, onEvent: e });
21
19
  }
22
- t.StateTaxesList = p;
23
- t.StateTaxesForm = S;
24
20
  export {
25
- t as StateTaxes
21
+ C as StateTaxes
26
22
  };
27
23
  //# sourceMappingURL=StateTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesListContextual } from './StateTaxesComponents'\nimport { StateTaxesList } from './StateTaxesList/StateTaxesList'\nimport { StateTaxesForm } from './StateTaxesForm/StateTaxesForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface StateTaxesProps extends BaseComponentInterface<'Company.StateTaxes'> {\n companyId: string\n}\n\nexport function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps) {\n useComponentDictionary('Company.StateTaxes', dictionary)\n const manageStateTaxes = createMachine(\n 'viewStateTaxes',\n stateTaxesStateMachine,\n (initialContext: StateTaxesContextInterface) => ({\n ...initialContext,\n component: StateTaxesListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageStateTaxes} onEvent={onEvent} />\n}\n\nStateTaxes.StateTaxesList = StateTaxesList\nStateTaxes.StateTaxesForm = StateTaxesForm\n"],"names":["StateTaxes","companyId","onEvent","dictionary","useComponentDictionary","manageStateTaxes","createMachine","stateTaxesStateMachine","initialContext","StateTaxesListContextual","jsx","Flow","StateTaxesList","StateTaxesForm"],"mappings":";;;;;;;;AAcO,SAASA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA+B;AAC9E,EAAAC,EAAuB,sBAAsBD,CAAU;AACvD,QAAME,IAAmBC;AAAA,IACvB;AAAA,IACAC;AAAA,IACA,CAACC,OAAgD;AAAA,MAC/C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAkB,SAAAH,EAAkB,CAAA;AAC5D;AAEAF,EAAW,iBAAiBY;AAC5BZ,EAAW,iBAAiBa;"}
1
+ {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesListContextual } from './StateTaxesComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface StateTaxesProps extends BaseComponentInterface<'Company.StateTaxes'> {\n companyId: string\n}\n\nexport function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps) {\n useComponentDictionary('Company.StateTaxes', dictionary)\n const manageStateTaxes = createMachine(\n 'viewStateTaxes',\n stateTaxesStateMachine,\n (initialContext: StateTaxesContextInterface) => ({\n ...initialContext,\n component: StateTaxesListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageStateTaxes} onEvent={onEvent} />\n}\n"],"names":["StateTaxes","companyId","onEvent","dictionary","useComponentDictionary","manageStateTaxes","createMachine","stateTaxesStateMachine","initialContext","StateTaxesListContextual","jsx","Flow"],"mappings":";;;;;;AAYO,SAASA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA+B;AAC9E,EAAAC,EAAuB,sBAAsBD,CAAU;AACvD,QAAME,IAAmBC;AAAA,IACvB;AAAA,IACAC;AAAA,IACA,CAACC,OAAgD;AAAA,MAC/C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAkB,SAAAH,EAAkB,CAAA;AAC5D;"}
@@ -2,9 +2,10 @@ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useStateTaxesForm as s } from "./context.js";
4
4
  import "classnames";
5
+ import "../../../../shared/constants.js";
5
6
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function x() {
8
+ function y() {
8
9
  const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
9
10
  return /* @__PURE__ */ i(m, { children: [
10
11
  /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
@@ -12,6 +13,6 @@ function x() {
12
13
  ] });
13
14
  }
14
15
  export {
15
- x as Actions
16
+ y as Actions
16
17
  };
17
18
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,9 +4,4 @@ interface StateTaxesFormProps extends CommonComponentInterface {
4
4
  state: string;
5
5
  }
6
6
  export declare function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace StateTaxesForm {
8
- var Head: typeof import("./Head").Head;
9
- var Form: typeof import("./Form").Form;
10
- var Actions: typeof import("./Actions").Actions;
11
- }
12
7
  export {};