@gusto/embedded-react-sdk 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  3. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  4. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  5. package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
  6. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  7. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  8. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  9. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  12. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  13. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  15. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  16. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  17. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  18. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  19. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  20. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  21. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  22. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  23. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  24. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  25. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
  26. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  27. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  28. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  29. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  30. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  31. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  32. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  33. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  34. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  35. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  36. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  37. package/dist/components/Contractor/Address/Address.js +2 -2
  38. package/dist/components/Contractor/Address/Form.js +1 -1
  39. package/dist/components/Contractor/ContractorList/index.js +17 -17
  40. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
  41. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  42. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
  43. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  44. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  45. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
  46. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  47. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  48. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  49. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
  50. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  51. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  52. package/dist/components/Contractor/Submit/Submit.js +1 -1
  53. package/dist/components/Employee/Compensation/Edit.js +14 -14
  54. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +8 -8
  55. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +9 -9
  56. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +9 -9
  57. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  58. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  59. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  60. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  61. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  62. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  63. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  64. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  65. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  66. package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
  67. package/dist/components/Employee/Landing/Landing.js +8 -8
  68. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  69. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
  70. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  71. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  72. package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
  73. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  74. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  75. package/dist/components/Employee/Taxes/FederalForm.js +7 -7
  76. package/dist/components/Flow/Flow.js +2 -3
  77. package/dist/components/Flow/Flow.js.map +1 -1
  78. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  79. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
  80. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  81. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
  82. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  83. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
  84. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  85. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  86. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
  87. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  88. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
  89. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  90. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +10 -10
  91. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  92. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  93. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
  94. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  95. package/dist/i18n/en/common.json.d.ts +1 -0
  96. package/dist/i18n/en/common.json.js +1 -1
  97. package/dist/shared/constants.d.ts +1 -1
  98. package/dist/shared/constants.js +6 -5
  99. package/dist/shared/constants.js.map +1 -1
  100. package/dist/types/i18next.d.ts +1 -0
  101. package/package.json +3 -3
@@ -11,17 +11,17 @@ import { useComponentContext as w } from "../../../../contexts/ComponentAdapter/
11
11
  import { Form as B } from "../../../Common/Form/Form.js";
12
12
  import { Flex as G } from "../../../Common/Flex/Flex.js";
13
13
  import "classnames";
14
- import { componentEvents as c } from "../../../../shared/constants.js";
15
- import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
16
- import { TextInputField as j } from "../../../Common/Fields/TextInputField/TextInputField.js";
17
- import { ActionsLayout as Y } from "../../../Common/ActionsLayout/ActionsLayout.js";
18
- import { NumberInputField as p } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
14
+ import { ActionsLayout as j } from "../../../Common/ActionsLayout/ActionsLayout.js";
19
15
  import "react-error-boundary";
20
16
  import "@gusto/embedded-api/models/errors/apierror";
21
17
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
22
18
  import "@tanstack/react-query";
23
- import { useBase as $ } from "../../../Base/useBase.js";
19
+ import { useBase as Y } from "../../../Base/useBase.js";
20
+ import { componentEvents as c } from "../../../../shared/constants.js";
24
21
  import "dompurify";
22
+ import { TextInputField as $ } from "../../../Common/Fields/TextInputField/TextInputField.js";
23
+ import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
24
+ import { NumberInputField as p } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
25
25
  const z = r.object({
26
26
  active: r.boolean(),
27
27
  amount: r.number().min(0).transform(String),
@@ -40,7 +40,7 @@ function fe({
40
40
  selectedGarnishmentType: A,
41
41
  selectedGarnishmentTitle: D
42
42
  }) {
43
- const { onEvent: a, baseSubmitHandler: E } = $(), { t: n } = F("Employee.Deductions"), m = w(), { mutateAsync: y, isPending: P } = V(), { mutateAsync: x, isPending: C } = _(), T = P || C, M = N(() => ({
43
+ const { onEvent: a, baseSubmitHandler: E } = Y(), { t: n } = F("Employee.Deductions"), m = w(), { mutateAsync: y, isPending: P } = V(), { mutateAsync: x, isPending: C } = _(), T = P || C, M = N(() => ({
44
44
  amount: e?.amount ? Number(e.amount) : 0,
45
45
  description: e?.description ?? "",
46
46
  times: e?.times ?? null,
@@ -83,7 +83,7 @@ function fe({
83
83
  };
84
84
  return /* @__PURE__ */ t(S, { ...u, children: /* @__PURE__ */ t(B, { onSubmit: u.handleSubmit(O), children: /* @__PURE__ */ t(G, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ l(b, { children: [
85
85
  /* @__PURE__ */ t(m.Heading, { as: "h3", children: D }),
86
- /* @__PURE__ */ t(j, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
86
+ /* @__PURE__ */ t($, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
87
87
  /* @__PURE__ */ t(
88
88
  f,
89
89
  {
@@ -145,7 +145,7 @@ function fe({
145
145
  }
146
146
  )
147
147
  ] }),
148
- /* @__PURE__ */ l(Y, { children: [
148
+ /* @__PURE__ */ l(j, { children: [
149
149
  /* @__PURE__ */ t(m.Button, { variant: "secondary", onClick: L, children: n("cancelCta") }),
150
150
  /* @__PURE__ */ t(m.Button, { type: "submit", isLoading: T, children: n(e ? "continueCta" : "addDeductionCta") })
151
151
  ] })
@@ -6,13 +6,13 @@ import { BaseComponent as I } from "../../../Base/Base.js";
6
6
  import { useBase as k } from "../../../Base/useBase.js";
7
7
  import { Flex as U } from "../../../Common/Flex/Flex.js";
8
8
  import "classnames";
9
- import { componentEvents as a } from "../../../../shared/constants.js";
10
9
  import { ActionsLayout as Y } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
10
  import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
12
11
  import E from "../../../../hooks/useNumberFormatter.js";
13
12
  import S from "../../../../assets/icons/pencil.svg.js";
14
13
  import V from "../../../../assets/icons/trashcan.svg.js";
15
14
  import { useComponentDictionary as q, useI18n as F } from "../../../../i18n/I18n.js";
15
+ import { componentEvents as a } from "../../../../shared/constants.js";
16
16
  import { useComponentContext as H } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
17
  import { useDataView as j } from "../../../Common/DataView/useDataView.js";
18
18
  import { DataView as G } from "../../../Common/DataView/DataView.js";
@@ -9,8 +9,8 @@ import { useBase as L } from "../../../Base/useBase.js";
9
9
  import { useI18n as S } from "../../../../i18n/I18n.js";
10
10
  import { componentEvents as m } from "../../../../shared/constants.js";
11
11
  import { Flex as g } from "../../../Common/Flex/Flex.js";
12
- import "classnames";
13
12
  import "react-i18next";
13
+ import "classnames";
14
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
15
  import "react";
16
16
  function G(e) {
@@ -3,11 +3,10 @@ import { useTranslation as m } from "react-i18next";
3
3
  import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
5
  import "classnames";
6
- import "../../../../shared/constants.js";
7
6
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
7
  import "react";
9
8
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
10
- function D() {
9
+ function S() {
11
10
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
12
11
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
13
12
  u,
@@ -36,6 +35,6 @@ function D() {
36
35
  ) }) });
37
36
  }
38
37
  export {
39
- D as List
38
+ S as List
40
39
  };
41
40
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
@@ -12,8 +12,8 @@ import { useBase as C } from "../../../Base/useBase.js";
12
12
  import { useI18n as G } from "../../../../i18n/I18n.js";
13
13
  import { componentEvents as i } from "../../../../shared/constants.js";
14
14
  import { Flex as M } from "../../../Common/Flex/Flex.js";
15
- import "classnames";
16
15
  import "react-i18next";
16
+ import "classnames";
17
17
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
18
18
  import "react";
19
19
  import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
@@ -9,12 +9,11 @@ import { Actions as k } from "./Actions.js";
9
9
  import { BaseComponent as q } from "../../Base/Base.js";
10
10
  import { useBase as j } from "../../Base/useBase.js";
11
11
  import { Flex as H } from "../../Common/Flex/Flex.js";
12
- import "classnames";
13
- import { componentEvents as s, EmployeeOnboardingStatus as E } from "../../../shared/constants.js";
14
12
  import { Loading as V } from "../../Common/Loading/Loading.js";
15
13
  import "react-i18next";
16
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
17
15
  import { useI18n as z, useComponentDictionary as J } from "../../../i18n/I18n.js";
16
+ import { componentEvents as s, EmployeeOnboardingStatus as E } from "../../../shared/constants.js";
18
17
  import { Head as K } from "./Head.js";
19
18
  import { List as Q } from "./List.js";
20
19
  import { useFlow as X } from "../../Flow/useFlow.js";
@@ -109,12 +108,12 @@ function $({ companyId: n, className: m, children: l, dictionary: P }) {
109
108
  }
110
109
  ) });
111
110
  }
112
- const Ne = () => {
111
+ const Ie = () => {
113
112
  const { companyId: n, onEvent: m } = X();
114
113
  return /* @__PURE__ */ o(Z, { companyId: n, onEvent: m });
115
114
  };
116
115
  export {
117
116
  Z as EmployeeList,
118
- Ne as EmployeeListContextual
117
+ Ie as EmployeeListContextual
119
118
  };
120
119
  //# 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 { useEmployeesList } 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 { keepPreviousData } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\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, Loading } 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'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\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<PaginationItemsPerPage>(5)\n\n const { data, fetchStatus, isFetching } = useEmployeesList(\n {\n companyId,\n page: currentPage,\n per: itemsPerPage,\n },\n { placeholderData: keepPreviousData },\n )\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n if (fetchStatus === 'fetching' && !data) {\n return <Loading />\n }\n const { httpMeta, showEmployees: employeeList } = data!\n const employees = employeeList!\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: PaginationItemsPerPage) => {\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 itemsPerPage,\n isFetching,\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\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","fetchStatus","isFetching","useEmployeesList","keepPreviousData","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","Loading","httpMeta","employeeList","employees","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":";;;;;;;;;;;;;;;;;;;;AA4BO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;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,EAAA,IAAsBC,EAAA,GACjC,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAiC,CAAC,GAEpE,EAAE,MAAAG,GAAM,aAAAC,GAAa,YAAAC,EAAA,IAAeC;AAAA,IACxC;AAAA,MACE,WAAAjB;AAAA,MACA,MAAMS;AAAA,MACN,KAAKG;AAAA,IAAA;AAAA,IAEP,EAAE,iBAAiBM,EAAA;AAAA,EAAiB,GAGhC,EAAE,aAAaC,EAAA,IAA2BC,EAAA,GAC1C,EAAE,aAAaC,EAAA,IACnBC,EAAA;AAEF,MAAIP,MAAgB,cAAc,CAACD;AACjC,6BAAQS,GAAA,EAAQ;AAElB,QAAM,EAAE,UAAAC,GAAU,eAAeC,EAAA,IAAiBX,GAC5CY,IAAYD,GAEZE,IAAa,OAAOH,EAAS,SAAS,QAAQ,IA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
1
+ {"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesList } 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 { keepPreviousData } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\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, Loading } 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'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\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<PaginationItemsPerPage>(5)\n\n const { data, fetchStatus, isFetching } = useEmployeesList(\n {\n companyId,\n page: currentPage,\n per: itemsPerPage,\n },\n { placeholderData: keepPreviousData },\n )\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n if (fetchStatus === 'fetching' && !data) {\n return <Loading />\n }\n const { httpMeta, showEmployees: employeeList } = data!\n const employees = employeeList!\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: PaginationItemsPerPage) => {\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 itemsPerPage,\n isFetching,\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\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","fetchStatus","isFetching","useEmployeesList","keepPreviousData","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","Loading","httpMeta","employeeList","employees","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":";;;;;;;;;;;;;;;;;;;AA4BO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;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,EAAA,IAAsBC,EAAA,GACjC,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAiC,CAAC,GAEpE,EAAE,MAAAG,GAAM,aAAAC,GAAa,YAAAC,EAAA,IAAeC;AAAA,IACxC;AAAA,MACE,WAAAjB;AAAA,MACA,MAAMS;AAAA,MACN,KAAKG;AAAA,IAAA;AAAA,IAEP,EAAE,iBAAiBM,EAAA;AAAA,EAAiB,GAGhC,EAAE,aAAaC,EAAA,IAA2BC,EAAA,GAC1C,EAAE,aAAaC,EAAA,IACnBC,EAAA;AAEF,MAAIP,MAAgB,cAAc,CAACD;AACjC,6BAAQS,GAAA,EAAQ;AAElB,QAAM,EAAE,UAAAC,GAAU,eAAeC,EAAA,IAAiBX,GAC5CY,IAAYD,GAEZE,IAAa,OAAOH,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC,GAEvEI,IAA2B,CAACC,MAAqC;AACrE,IAAAhB,EAAgBgB,CAAQ;AAAA,EAC1B,GACMC,IAAkB,MAAM;AAC5B,IAAApB,EAAe,CAAC;AAAA,EAClB,GACMqB,IAAqB,MAAM;AAC/B,IAAArB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,EACH;AAWA,SACE,gBAAAhD,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACiD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,YAPW,CAACV,GAAcW,MAAwC;AACxE,UAAAzC,EAAQgC,EAAgB,iBAAiB,EAAE,YAAYF,GAAM,kBAAAW,GAAkB;AAAA,QACjF;AAAA,QAMQ,WAfU,MAAM;AACtB,UAAAzC,EAAQgC,EAAgB,eAAe;AAAA,QACzC;AAAA,QAcQ,cAAAC;AAAA,QACA,cAAAJ;AAAA,QACA,WAAAT;AAAA,QACA,aAAAjB;AAAA,QACA,YAAAkB;AAAA,QACA,iBAAAG;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAE;AAAA,QACA,gBAAAC;AAAA,QACA,4BAAAS;AAAA,QACA,0BAAAf;AAAA,QACA,YAxBW,MAAM;AACvB,UAAAtB,EAAQgC,EAAgB,wBAAwB;AAAA,QAClD;AAAA,QAuBQ,cAAA1B;AAAA,QACA,YAAAI;AAAA,MAAA;AAAA,MAGD,UAAAd,KAGC,gBAAA8C,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAApD,EAACqD,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAKO,MAAMC,KAAyB,MAAM;AAC1C,QAAM,EAAE,WAAArD,GAAW,SAAAM,EAAA,IAAYgD,EAAA;AAC/B,SAAO,gBAAAzD,EAACF,GAAA,EAAa,WAAAK,GAAsB,SAAAM,EAAA,CAAkB;AAC/D;"}
@@ -2,14 +2,13 @@ import { jsx as t } 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
4
  import "classnames";
5
- import "../../../shared/constants.js";
6
5
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
6
  import "react";
8
- const d = () => {
7
+ const f = () => {
9
8
  const { t: e } = n("Employee.EmployeeList"), o = m();
10
9
  return /* @__PURE__ */ t(r, { justifyContent: "space-between", alignItems: "center", children: /* @__PURE__ */ t(o.Heading, { as: "h2", children: e("title") }) });
11
10
  };
12
11
  export {
13
- d as Head
12
+ f as Head
14
13
  };
15
14
  //# 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","t","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,OAAO,GAAE,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","t","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,OAAO,GAAE,GAC1C;AAEJ;"}
@@ -4,12 +4,12 @@ import { useFormContext as m } from "react-hook-form";
4
4
  import { z as i } from "zod";
5
5
  import "../../../shared/constants.js";
6
6
  import "classnames";
7
- import { RadioGroupField as g } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
- import { TextInputField as f } from "../../Common/Fields/TextInputField/TextInputField.js";
9
- import { NumberInputField as r } from "../../Common/Fields/NumberInputField/NumberInputField.js";
10
- import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
8
  import "react";
12
9
  import { SelectField as s } from "../../Common/Fields/SelectField/SelectField.js";
10
+ import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
+ import { NumberInputField as r } from "../../Common/Fields/NumberInputField/NumberInputField.js";
12
+ import { TextInputField as c } from "../../Common/Fields/TextInputField/TextInputField.js";
13
13
  const p = i.object({
14
14
  w4DataType: i.literal("rev_2020_w4"),
15
15
  filingStatus: i.string().min(1),
@@ -29,7 +29,7 @@ function A() {
29
29
  return e("w4DataType") === "rev_2020_w4" ? /* @__PURE__ */ t(b, {}) : /* @__PURE__ */ t(S, {});
30
30
  }
31
31
  function b() {
32
- const { t: e } = o("Employee.FederalTaxes"), l = c(), d = [
32
+ const { t: e } = o("Employee.FederalTaxes"), l = g(), d = [
33
33
  { value: "Single", label: e("filingStatusSingle") },
34
34
  { value: "Married", label: e("filingStatusMarried") },
35
35
  { value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
@@ -49,7 +49,7 @@ function b() {
49
49
  }
50
50
  ),
51
51
  /* @__PURE__ */ t(
52
- g,
52
+ f,
53
53
  {
54
54
  name: "twoJobs",
55
55
  isRequired: !0,
@@ -150,7 +150,7 @@ function S() {
150
150
  }
151
151
  ),
152
152
  /* @__PURE__ */ t(
153
- f,
153
+ c,
154
154
  {
155
155
  name: "additionalWithholding",
156
156
  label: e("additionalWithholding"),
@@ -7,16 +7,16 @@ 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
9
  import "classnames";
10
- import { componentEvents as E } from "../../../shared/constants.js";
11
- import { ActionsLayout as C } from "../../Common/ActionsLayout/ActionsLayout.js";
12
- import { useComponentContext as D } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import { ActionsLayout as E } from "../../Common/ActionsLayout/ActionsLayout.js";
11
+ import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "react";
14
- import { useI18n as I, useComponentDictionary as L } from "../../../i18n/I18n.js";
13
+ import { useI18n as D, useComponentDictionary as I } from "../../../i18n/I18n.js";
14
+ import { componentEvents as L } from "../../../shared/constants.js";
15
15
  function M(t) {
16
- return I("Employee.Landing"), L("Employee.Landing", t.dictionary), /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(S, { ...t, children: t.children }) });
16
+ return D("Employee.Landing"), I("Employee.Landing", t.dictionary), /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(S, { ...t, children: t.children }) });
17
17
  }
18
18
  const S = ({ employeeId: t, companyId: m, className: c }) => {
19
- const { onEvent: a } = y(), o = D(), {
19
+ const { onEvent: a } = y(), o = C(), {
20
20
  data: { employee: l }
21
21
  } = g({ employeeId: t }), p = l.firstName, {
22
22
  data: { company: d }
@@ -36,12 +36,12 @@ const S = ({ employeeId: t, companyId: m, className: c }) => {
36
36
  )
37
37
  ] }),
38
38
  /* @__PURE__ */ i(r, { flexDirection: "column", alignItems: "center", gap: 8, children: [
39
- /* @__PURE__ */ e(C, { justifyContent: "center", children: /* @__PURE__ */ e(
39
+ /* @__PURE__ */ e(E, { justifyContent: "center", children: /* @__PURE__ */ e(
40
40
  o.Button,
41
41
  {
42
42
  variant: "secondary",
43
43
  onClick: () => {
44
- a(E.EMPLOYEE_SELF_ONBOARDING_START);
44
+ a(L.EMPLOYEE_SELF_ONBOARDING_START);
45
45
  },
46
46
  children: n("getStartedCta")
47
47
  }
@@ -9,10 +9,10 @@ import r from "./OnboardingSummary.module.scss.js";
9
9
  import { BaseComponent as P } from "../../Base/Base.js";
10
10
  import { useBase as R } from "../../Base/useBase.js";
11
11
  import { Flex as d } from "../../Common/Flex/Flex.js";
12
- import { componentEvents as E, EmployeeOnboardingStatus as N } from "../../../shared/constants.js";
13
- import { ActionsLayout as O } from "../../Common/ActionsLayout/ActionsLayout.js";
12
+ import { ActionsLayout as E } from "../../Common/ActionsLayout/ActionsLayout.js";
14
13
  import { useComponentContext as T } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
14
  import { useI18n as _, useComponentDictionary as w } from "../../../i18n/I18n.js";
15
+ import { componentEvents as N, EmployeeOnboardingStatus as O } from "../../../shared/constants.js";
16
16
  import F from "../../../assets/icons/success_check.svg.js";
17
17
  import G from "../../../assets/icons/unchecked_circular.svg.js";
18
18
  import { useFlow as M } from "../../Flow/useFlow.js";
@@ -22,7 +22,7 @@ function j(n) {
22
22
  const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
23
23
  const { onEvent: a } = R(), { t } = b("Employee.OnboardingSummary"), o = T(), {
24
24
  data: { employee: x }
25
- } = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h === N.ONBOARDING_COMPLETED || !I && h === N.SELF_ONBOARDING_PENDING_INVITE, D = S(() => y.sanitize(u), [u]), v = S(() => y.sanitize(p), [p]);
25
+ } = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h === O.ONBOARDING_COMPLETED || !I && h === O.SELF_ONBOARDING_PENDING_INVITE, D = S(() => y.sanitize(u), [u]), v = S(() => y.sanitize(p), [p]);
26
26
  return /* @__PURE__ */ e("section", { className: c, children: /* @__PURE__ */ s(d, { flexDirection: "column", gap: 32, children: [
27
27
  /* @__PURE__ */ e(d, { alignItems: "center", flexDirection: "column", gap: 8, children: m ? f ? /* @__PURE__ */ s(g, { children: [
28
28
  /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
@@ -47,23 +47,23 @@ const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
47
47
  ] }) : /* @__PURE__ */ s(g, { children: [
48
48
  /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
49
49
  /* @__PURE__ */ e(o.Text, { className: r.description, children: t("onboardedSelfDescription") }),
50
- /* @__PURE__ */ e(O, { justifyContent: f ? "center" : "start", children: /* @__PURE__ */ e(
50
+ /* @__PURE__ */ e(E, { justifyContent: f ? "center" : "start", children: /* @__PURE__ */ e(
51
51
  o.Button,
52
52
  {
53
53
  variant: "secondary",
54
54
  onClick: () => {
55
- a(E.EMPLOYEE_ONBOARDING_DONE);
55
+ a(N.EMPLOYEE_ONBOARDING_DONE);
56
56
  },
57
57
  children: t("doneCta")
58
58
  }
59
59
  ) })
60
60
  ] }) }),
61
- m && /* @__PURE__ */ e(O, { justifyContent: "center", children: /* @__PURE__ */ e(
61
+ m && /* @__PURE__ */ e(E, { justifyContent: "center", children: /* @__PURE__ */ e(
62
62
  o.Button,
63
63
  {
64
64
  variant: "secondary",
65
65
  onClick: () => {
66
- a(E.EMPLOYEES_LIST);
66
+ a(N.EMPLOYEES_LIST);
67
67
  },
68
68
  children: t("doneCta")
69
69
  }
@@ -4,10 +4,10 @@ import { useTranslation as s } from "react-i18next";
4
4
  import { usePaymentMethod as c } from "./usePaymentMethod.js";
5
5
  import { PAYMENT_METHODS as l } from "../../../shared/constants.js";
6
6
  import "classnames";
7
- import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
9
7
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
10
8
  import "react";
9
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
10
+ import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
11
  const k = () => {
12
12
  const { mode: t, watchedType: a } = c(), { t: e } = s("Employee.PaymentMethod"), { setValue: n } = m();
13
13
  if (!(t !== "ADD" && t !== "INITIAL" || a === l.check))
@@ -4,9 +4,9 @@ import { z as o } from "zod";
4
4
  import { usePaymentMethod as c } from "./usePaymentMethod.js";
5
5
  import { PAYMENT_METHODS as r } from "../../../shared/constants.js";
6
6
  import "classnames";
7
- import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
7
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
9
8
  import "react";
9
+ import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
10
  o.object({
11
11
  type: o.enum(["Check", "Direct Deposit"])
12
12
  });
@@ -7,11 +7,11 @@ import { useMemo as j, useEffect as D } from "react";
7
7
  import { usePaymentMethod as N } from "./usePaymentMethod.js";
8
8
  import { SPLIT_BY as h } from "../../../shared/constants.js";
9
9
  import "classnames";
10
- import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
+ import { useComponentContext as q } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { useLocale as w } from "../../../contexts/LocaleProvider/useLocale.js";
12
+ import { ReorderableList as I } from "../../Common/ReorderableList/ReorderableList.js";
13
+ import { RadioGroupField as W } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
14
  import { NumberInputField as F } from "../../Common/Fields/NumberInputField/NumberInputField.js";
12
- import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import { useLocale as I } from "../../../contexts/LocaleProvider/useLocale.js";
14
- import { ReorderableList as W } from "../../Common/ReorderableList/ReorderableList.js";
15
15
  function ie() {
16
16
  const { paymentMethod: r, bankAccounts: m, mode: c } = N(), {
17
17
  control: s,
@@ -22,7 +22,7 @@ function ie() {
22
22
  } = B(), { t: u } = g("Employee.PaymentMethod"), d = A("splitBy"), L = A("priority"), a = j(() => r.splits ?? [], [r.splits]), l = Object.entries(L).reduce(
23
23
  (e, [t, i]) => !e || (L[e] ?? 0) < i ? t : e,
24
24
  ""
25
- ), { currency: $ } = I();
25
+ ), { currency: $ } = w();
26
26
  D(() => {
27
27
  if (a.length)
28
28
  if (d === h.amount) {
@@ -33,7 +33,7 @@ function ie() {
33
33
  o("splitAmount", e);
34
34
  }
35
35
  }, [d, a, l, o]);
36
- const f = w();
36
+ const f = q();
37
37
  if (c !== "SPLIT" || m.length < 2 || r.splits === null) return null;
38
38
  o("isSplit", !0);
39
39
  const b = (e, t) => {
@@ -50,7 +50,7 @@ function ie() {
50
50
  const p = a[i];
51
51
  p && (o("priority", t), l && l !== p.uuid && (S(`splitAmount.${l}`), b(l, 0)), b(p.uuid, null));
52
52
  }, R = () => d === h.amount ? /* @__PURE__ */ n(
53
- W,
53
+ I,
54
54
  {
55
55
  label: u("draggableListLabel"),
56
56
  items: a.map((e) => ({
@@ -106,7 +106,7 @@ function ie() {
106
106
  /* @__PURE__ */ n(f.Heading, { as: "h2", children: u("title") }),
107
107
  /* @__PURE__ */ n(V, { t: u, i18nKey: "splitDescription", components: { p: /* @__PURE__ */ n(f.Text, {}) } }),
108
108
  /* @__PURE__ */ n(
109
- q,
109
+ W,
110
110
  {
111
111
  name: "splitBy",
112
112
  label: u("splitByLabel"),
@@ -8,8 +8,8 @@ import P from "./AdminPersonalDetails.module.scss.js";
8
8
  import { useProfile as C } from "./useProfile.js";
9
9
  import "../../../shared/constants.js";
10
10
  import "classnames";
11
- import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
12
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
13
13
  const d = y.merge(
14
14
  x
15
15
  ).extend({
@@ -6,9 +6,9 @@ import { useProfile as b } from "./useProfile.js";
6
6
  import { STATES_ABBR as y } from "../../../shared/constants.js";
7
7
  import { Grid as x } from "../../Common/Grid/Grid.js";
8
8
  import "classnames";
9
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
10
9
  import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
10
  import "react";
11
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
12
12
  import { SelectField as T } from "../../Common/Fields/SelectField/SelectField.js";
13
13
  import { CheckboxField as A } from "../../Common/Fields/CheckboxField/CheckboxField.js";
14
14
  const s = t.object({
@@ -5,14 +5,14 @@ import { useTranslation as s } from "react-i18next";
5
5
  import "../../../shared/constants.js";
6
6
  import { Grid as b } from "../../Common/Grid/Grid.js";
7
7
  import "classnames";
8
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
9
- import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
10
8
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
9
  import "react";
12
10
  import { removeNonDigits as S, addressInline as g } from "../../../helpers/formattedStrings.js";
13
11
  import { usePlaceholderSSN as h, normalizeSSN as N } from "../../../helpers/ssn.js";
14
12
  import { SSN_REGEX as D, nameValidation as m } from "../../../helpers/validations.js";
13
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
15
14
  import { SelectField as I } from "../../Common/Fields/SelectField/SelectField.js";
15
+ import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
16
16
  const v = t.object({
17
17
  firstName: m,
18
18
  middleInitial: t.string().optional(),
@@ -4,12 +4,12 @@ import { useFormContext as m } from "react-hook-form";
4
4
  import { z as t } from "zod";
5
5
  import "../../../shared/constants.js";
6
6
  import "classnames";
7
- import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
- import { TextInputField as g } from "../../Common/Fields/TextInputField/TextInputField.js";
9
- import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
10
- import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
8
  import "react";
12
9
  import { SelectField as s } from "../../Common/Fields/SelectField/SelectField.js";
10
+ import { RadioGroupField as g } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
+ import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
12
+ import { TextInputField as c } from "../../Common/Fields/TextInputField/TextInputField.js";
13
13
  const p = t.object({
14
14
  w4DataType: t.literal("rev_2020_w4"),
15
15
  filingStatus: t.string().min(1),
@@ -29,7 +29,7 @@ function A() {
29
29
  return e("w4DataType") === "rev_2020_w4" ? /* @__PURE__ */ i(b, {}) : /* @__PURE__ */ i(S, {});
30
30
  }
31
31
  function b() {
32
- const { t: e } = o("Employee.Taxes"), r = c(), d = [
32
+ const { t: e } = o("Employee.Taxes"), r = f(), d = [
33
33
  { value: "Single", label: e("filingStatusSingle") },
34
34
  { value: "Married", label: e("filingStatusMarried") },
35
35
  { value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
@@ -48,7 +48,7 @@ function b() {
48
48
  }
49
49
  ),
50
50
  /* @__PURE__ */ i(
51
- f,
51
+ g,
52
52
  {
53
53
  name: "twoJobs",
54
54
  isRequired: !0,
@@ -149,7 +149,7 @@ function S() {
149
149
  }
150
150
  ),
151
151
  /* @__PURE__ */ i(
152
- g,
152
+ c,
153
153
  {
154
154
  name: "additionalWithholding",
155
155
  label: e("additionalWithholding"),
@@ -4,11 +4,10 @@ import { useTranslation as w } from "react-i18next";
4
4
  import { FlowBreadcrumbs as F } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
5
5
  import { Flex as s, FlexItem as d } from "../Common/Flex/Flex.js";
6
6
  import "classnames";
7
- import "../../shared/constants.js";
8
7
  import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
9
8
  import "react";
10
9
  import { FlowContext as E } from "./useFlow.js";
11
- const q = ({
10
+ const k = ({
12
11
  onEvent: x,
13
12
  machine: f
14
13
  }) => {
@@ -60,6 +59,6 @@ const q = ({
60
59
  ) });
61
60
  };
62
61
  export {
63
- q as Flow
62
+ k as Flow
64
63
  };
65
64
  //# sourceMappingURL=Flow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,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UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,EAAC,IACbT,EAAQ;AAEZ,WAASI,EAAYM,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASZ;AAEf,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