@gusto/embedded-react-sdk 0.52.1 → 0.52.2

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 (88) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/Base/Base.d.ts +2 -2
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  5. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  7. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  8. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  9. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  10. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  11. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  12. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  13. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  14. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  15. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  16. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  17. package/dist/components/Company/Industry/Context.js +6 -8
  18. package/dist/components/Company/Industry/Context.js.map +1 -1
  19. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  20. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  21. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  22. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  23. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  24. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  25. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  26. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  27. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  28. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  29. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  30. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -1
  31. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +12 -14
  32. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  33. package/dist/components/Contractor/Address/Address.js +83 -75
  34. package/dist/components/Contractor/Address/Address.js.map +1 -1
  35. package/dist/components/Contractor/ContractorList/index.js +52 -61
  36. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  37. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +170 -123
  38. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  39. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js +12 -0
  40. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js.map +1 -0
  41. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +44 -43
  42. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -1
  43. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +91 -88
  44. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
  45. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +0 -33
  46. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +77 -86
  47. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
  48. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
  49. package/dist/components/Contractor/Profile/ContractorProfile.js +63 -57
  50. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  51. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
  52. package/dist/components/Contractor/Submit/Submit.js +118 -101
  53. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  54. package/dist/components/Contractor/shared/useContractorHasSignedW9.d.ts +8 -0
  55. package/dist/components/Contractor/shared/useContractorHasSignedW9.js +10 -0
  56. package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -0
  57. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  58. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  59. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  60. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  61. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  62. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  63. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  64. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  65. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  66. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  67. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  68. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  69. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +1 -0
  70. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  71. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  72. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +1 -0
  73. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  74. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  75. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  76. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  77. package/dist/components/index.d.ts +40 -0
  78. package/dist/i18n/en/Contractor.Address.json.js +22 -20
  79. package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
  80. package/dist/i18n/en/Contractor.Profile.json.js +13 -11
  81. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
  82. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  83. package/dist/i18n/types.d.ts +22 -6
  84. package/dist/index.d.ts +6 -3
  85. package/dist/style.css +1 -1
  86. package/dist/types/Helpers.d.ts +1 -1
  87. package/docs/guides/endpoint-inventory.json +0 -27
  88. package/package.json +6 -6
@@ -1,26 +1,25 @@
1
- import { state as o, transition as e, reduce as T } from "robot3";
1
+ import { state as T, transition as e, reduce as a } from "robot3";
2
2
  import { StateTaxesListContextual as n, StateTaxesFormContextual as i } from "./StateTaxesComponents.js";
3
- import { componentEvents as a } from "../../../shared/constants.js";
3
+ import { componentEvents as o } from "../../../shared/constants.js";
4
4
  const S = {
5
- viewStateTaxes: o(
5
+ viewStateTaxes: T(
6
6
  e(
7
- a.COMPANY_STATE_TAX_EDIT,
7
+ o.COMPANY_STATE_TAX_EDIT,
8
8
  "editStateTaxes",
9
- T(
9
+ a(
10
10
  (t, s) => ({
11
11
  ...t,
12
12
  component: i,
13
13
  state: s.payload.state
14
14
  })
15
15
  )
16
- ),
17
- e(a.COMPANY_STATE_TAX_DONE, "done")
16
+ )
18
17
  ),
19
- editStateTaxes: o(
18
+ editStateTaxes: T(
20
19
  e(
21
- a.COMPANY_STATE_TAX_UPDATED,
20
+ o.COMPANY_STATE_TAX_UPDATED,
22
21
  "viewStateTaxes",
23
- T(
22
+ a(
24
23
  (t, s) => ({
25
24
  ...t,
26
25
  component: n,
@@ -29,16 +28,15 @@ const S = {
29
28
  )
30
29
  ),
31
30
  e(
32
- a.CANCEL,
31
+ o.CANCEL,
33
32
  "viewStateTaxes",
34
- T((t) => ({
33
+ a((t) => ({
35
34
  ...t,
36
35
  component: n,
37
36
  state: void 0
38
37
  }))
39
38
  )
40
- ),
41
- done: o()
39
+ )
42
40
  };
43
41
  export {
44
42
  S as stateTaxesStateMachine
@@ -1 +1 @@
1
- {"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesFormContextual, StateTaxesListContextual } from './StateTaxesComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.COMPANY_STATE_TAX_UPDATED]: undefined\n [componentEvents.COMPANY_STATE_TAX_EDIT]: { state: string }\n}\n\n/** @internal */\nexport const stateTaxesStateMachine = {\n viewStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_EDIT,\n 'editStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_EDIT>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesFormContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n transition(componentEvents.COMPANY_STATE_TAX_DONE, 'done'),\n ),\n editStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_UPDATED,\n 'viewStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_UPDATED>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce((ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n })),\n ),\n ),\n done: final(),\n}\n"],"names":["stateTaxesStateMachine","state","transition","componentEvents","reduce","ctx","ev","StateTaxesFormContextual","StateTaxesListContextual","final"],"mappings":";;;AAaO,MAAMA,IAAyB;AAAA,EACpC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,OAAOD,EAAG,QAAQ;AAAA,QAAA;AAAA,MACpB;AAAA,IACF;AAAA,IAEFJ,EAAWC,EAAgB,wBAAwB,MAAM;AAAA,EAAA;AAAA,EAE3D,gBAAgBF;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWG;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEFN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAiE;AAAA,QACvE,GAAGA;AAAA,QACH,WAAWG;AAAA,QACX,OAAO;AAAA,MAAA,EACP;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,MAAMC,EAAA;AACR;"}
1
+ {"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesFormContextual, StateTaxesListContextual } from './StateTaxesComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.COMPANY_STATE_TAX_UPDATED]: undefined\n [componentEvents.COMPANY_STATE_TAX_EDIT]: { state: string }\n}\n\n/** @internal */\nexport const stateTaxesStateMachine = {\n viewStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_EDIT,\n 'editStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_EDIT>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesFormContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n ),\n editStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_UPDATED,\n 'viewStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_UPDATED>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce((ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n })),\n ),\n ),\n}\n"],"names":["stateTaxesStateMachine","state","transition","componentEvents","reduce","ctx","ev","StateTaxesFormContextual","StateTaxesListContextual"],"mappings":";;;AAaO,MAAMA,IAAyB;AAAA,EACpC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,OAAOD,EAAG,QAAQ;AAAA,QAAA;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,gBAAgBL;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWG;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEFN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAiE;AAAA,QACvE,GAAGA;AAAA,QACH,WAAWG;AAAA,QACX,OAAO;AAAA,MAAA,EACP;AAAA,IAAA;AAAA,EACJ;AAEJ;"}
@@ -1,91 +1,99 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useTranslation as c } from "react-i18next";
3
- import g from "classnames";
4
- import C from "./Address.module.scss.js";
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import { useTranslation as m } from "react-i18next";
3
+ import R from "classnames";
4
+ import b from "./Address.module.scss.js";
5
5
  import { useContractorAddressForm as E } from "./shared/useContractorAddressForm/useContractorAddressForm.js";
6
6
  import { BaseBoundaries as S, BaseLayout as p } from "../../Base/Base.js";
7
7
  import "../../Base/useBase.js";
8
- import { SDKFormProvider as b } from "../../../partner-hook-utils/form/SDKFormProvider.js";
9
- import { Form as v } from "../../Common/Form/Form.js";
10
- import { Flex as u } from "../../Common/Flex/Flex.js";
11
- import { Grid as I } from "../../Common/Grid/Grid.js";
12
- import { ActionsLayout as T } from "../../Common/ActionsLayout/ActionsLayout.js";
13
- import { useComponentContext as y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import { SDKFormProvider as v } from "../../../partner-hook-utils/form/SDKFormProvider.js";
9
+ import { Form as T } from "../../Common/Form/Form.js";
10
+ import { Flex as f } from "../../Common/Flex/Flex.js";
11
+ import { Grid as y } from "../../Common/Grid/Grid.js";
12
+ import { ActionsLayout as I } from "../../Common/ActionsLayout/ActionsLayout.js";
13
+ import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
14
  import "react";
15
15
  import { useComponentDictionary as x, useI18n as _ } from "../../../i18n/I18n.js";
16
- import { contractorEvents as f } from "../../../shared/constants.js";
17
- const F = {
16
+ import { contractorEvents as g } from "../../../shared/constants.js";
17
+ import { useContractorHasSignedW9 as F } from "../shared/useContractorHasSignedW9.js";
18
+ const L = {
18
19
  update: ["street1", "city", "state", "zip"]
19
20
  };
20
- function G({ onEvent: n, FallbackComponent: a, ...i }) {
21
- return /* @__PURE__ */ e(S, { componentName: "Contractor.Address", FallbackComponent: a, children: /* @__PURE__ */ e(L, { onEvent: n, ...i }) });
21
+ function J({ onEvent: s, FallbackComponent: i, ...o }) {
22
+ return /* @__PURE__ */ t(S, { componentName: "Contractor.Address", FallbackComponent: i, children: /* @__PURE__ */ t(B, { onEvent: s, ...o }) });
22
23
  }
23
- function L({
24
- contractorId: n,
25
- defaultValues: a,
26
- onEvent: i,
27
- dictionary: D,
28
- className: h
24
+ function N({ contractorId: s }) {
25
+ const i = F(s), { t: o } = m("Contractor.Address"), d = h();
26
+ return i ? /* @__PURE__ */ t(d.Alert, { status: "warning", disableScrollIntoView: !0, label: o("w9EditWarning.label"), children: /* @__PURE__ */ t(d.Text, { children: o("w9EditWarning.body") }) }) : null;
27
+ }
28
+ function B({
29
+ contractorId: s,
30
+ defaultValues: i,
31
+ onEvent: o,
32
+ dictionary: d,
33
+ className: D
29
34
  }) {
30
- x("Contractor.Address", D), _("Contractor.Address");
31
- const { t } = c("Contractor.Address"), { t: A } = c("common"), d = y(), r = E({
32
- contractorId: n,
33
- optionalFieldsToRequire: F,
34
- defaultValues: a
35
+ x("Contractor.Address", d), _("Contractor.Address");
36
+ const { t: r } = m("Contractor.Address"), { t: A } = m("common"), c = h(), e = E({
37
+ contractorId: s,
38
+ optionalFieldsToRequire: L,
39
+ defaultValues: i
35
40
  });
36
- if (r.isLoading)
37
- return /* @__PURE__ */ e(p, { isLoading: !0, error: r.errorHandling.errors });
38
- const { Fields: s } = r.form, m = r.data.contractorType === "Business", R = async () => {
39
- const o = await r.actions.onSubmit();
40
- o && (i(f.CONTRACTOR_ADDRESS_UPDATED, o.data), i(f.CONTRACTOR_ADDRESS_DONE));
41
+ if (e.isLoading)
42
+ return /* @__PURE__ */ t(p, { isLoading: !0, error: e.errorHandling.errors });
43
+ const { Fields: n } = e.form, u = e.data.contractorType === "Business", C = async () => {
44
+ const a = await e.actions.onSubmit();
45
+ a && (o(g.CONTRACTOR_ADDRESS_UPDATED, a.data), o(g.CONTRACTOR_ADDRESS_DONE));
41
46
  };
42
- return /* @__PURE__ */ e("section", { className: g(C.container, h), children: /* @__PURE__ */ e(p, { error: r.errorHandling.errors, children: /* @__PURE__ */ e(b, { formHookResult: r, children: /* @__PURE__ */ e(v, { onSubmit: () => {
43
- R();
44
- }, children: /* @__PURE__ */ l(u, { flexDirection: "column", gap: 32, alignItems: "stretch", children: [
45
- /* @__PURE__ */ e("header", { children: /* @__PURE__ */ l(u, { flexDirection: "column", gap: 4, children: [
46
- /* @__PURE__ */ e(d.Heading, { as: "h2", children: t(m ? "businessAddressTitle" : "homeAddressTitle") }),
47
- /* @__PURE__ */ e(d.Text, { variant: "supporting", children: t(m ? "businessAddressDescription" : "homeAddressDescription") })
48
- ] }) }),
49
- /* @__PURE__ */ l(I, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
50
- /* @__PURE__ */ e(
51
- s.Street1,
52
- {
53
- label: t("street1"),
54
- validationMessages: { REQUIRED: t("validations.street1") }
55
- }
56
- ),
57
- /* @__PURE__ */ e(s.Street2, { label: t("street2") }),
58
- /* @__PURE__ */ e(
59
- s.City,
60
- {
61
- label: t("city"),
62
- validationMessages: { REQUIRED: t("validations.city") }
63
- }
64
- ),
65
- /* @__PURE__ */ e(
66
- s.State,
67
- {
68
- label: t("state"),
69
- placeholder: t("statePlaceholder"),
70
- validationMessages: { REQUIRED: t("validations.state") },
71
- getOptionLabel: (o) => A(`statesHash.${o}`, { defaultValue: o })
72
- }
73
- ),
74
- /* @__PURE__ */ e(
75
- s.Zip,
76
- {
77
- label: t("zip"),
78
- validationMessages: {
79
- REQUIRED: t("validations.zip"),
80
- INVALID_ZIP: t("validations.zipInvalid")
47
+ return /* @__PURE__ */ t("section", { className: R(b.container, D), children: /* @__PURE__ */ t(p, { error: e.errorHandling.errors, children: /* @__PURE__ */ t(v, { formHookResult: e, children: /* @__PURE__ */ l(T, { onSubmit: () => {
48
+ C();
49
+ }, children: [
50
+ /* @__PURE__ */ t(N, { contractorId: s }),
51
+ /* @__PURE__ */ l(f, { flexDirection: "column", gap: 32, alignItems: "stretch", children: [
52
+ /* @__PURE__ */ t("header", { children: /* @__PURE__ */ l(f, { flexDirection: "column", gap: 4, children: [
53
+ /* @__PURE__ */ t(c.Heading, { as: "h2", children: r(u ? "businessAddressTitle" : "homeAddressTitle") }),
54
+ /* @__PURE__ */ t(c.Text, { variant: "supporting", children: r(u ? "businessAddressDescription" : "homeAddressDescription") })
55
+ ] }) }),
56
+ /* @__PURE__ */ l(y, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
57
+ /* @__PURE__ */ t(
58
+ n.Street1,
59
+ {
60
+ label: r("street1"),
61
+ validationMessages: { REQUIRED: r("validations.street1") }
62
+ }
63
+ ),
64
+ /* @__PURE__ */ t(n.Street2, { label: r("street2") }),
65
+ /* @__PURE__ */ t(
66
+ n.City,
67
+ {
68
+ label: r("city"),
69
+ validationMessages: { REQUIRED: r("validations.city") }
70
+ }
71
+ ),
72
+ /* @__PURE__ */ t(
73
+ n.State,
74
+ {
75
+ label: r("state"),
76
+ placeholder: r("statePlaceholder"),
77
+ validationMessages: { REQUIRED: r("validations.state") },
78
+ getOptionLabel: (a) => A(`statesHash.${a}`, { defaultValue: a })
79
+ }
80
+ ),
81
+ /* @__PURE__ */ t(
82
+ n.Zip,
83
+ {
84
+ label: r("zip"),
85
+ validationMessages: {
86
+ REQUIRED: r("validations.zip"),
87
+ INVALID_ZIP: r("validations.zipInvalid")
88
+ }
81
89
  }
82
- }
83
- )
84
- ] }),
85
- /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(d.Button, { type: "submit", isDisabled: r.status.isPending, children: r.status.isPending ? t("submitting") : t("submit") }) })
86
- ] }) }) }) }) });
90
+ )
91
+ ] }),
92
+ /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(c.Button, { type: "submit", isDisabled: e.status.isPending, children: e.status.isPending ? r("submitting") : r("submit") }) })
93
+ ] })
94
+ ] }) }) }) });
87
95
  }
88
96
  export {
89
- G as Address
97
+ J as Address
90
98
  };
91
99
  //# sourceMappingURL=Address.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type { FallbackProps } from 'react-error-boundary'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { Form } from '@/components/Common/Form'\nimport { Flex, Grid, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\nimport { contractorEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n// The hook defaults to the API contract, which treats every address field as\n// optional. The SDK's address form has always required a complete mailing\n// address, so it opts those fields back into being required here.\nconst SDK_REQUIRED_ADDRESS_FIELDS: ContractorAddressOptionalFieldsToRequire = {\n update: ['street1', 'city', 'state', 'zip'],\n}\n\n/**\n * Props for {@link Address}.\n *\n * @public\n */\nexport interface AddressProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Pre-fill values for address fields. Server data takes precedence when the contractor already has an address on file. */\n defaultValues?: AddressDefaultValues\n /** Callback invoked each time the component emits an event. */\n onEvent: OnEventType<EventType, unknown>\n /** Overrides for the component's i18n strings. */\n dictionary?: ResourceDictionary<'Contractor.Address'>\n /** Optional class applied to the wrapping `<section>`. */\n className?: string\n /** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n}\n\n/**\n * Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/address/updated` | Fired after the address is saved | The updated `ContractorAddress` entity |\n * | `contractor/address/done` | Fired after a successful save so the parent flow can advance | — |\n *\n * @param props - See {@link AddressProps}.\n * @returns The contractor address form.\n * @public\n *\n * @example\n * ```tsx\n * import { ContractorOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <ContractorOnboarding.Address\n * contractorId=\"contractor-uuid\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps) {\n return (\n <BaseBoundaries componentName=\"Contractor.Address\" FallbackComponent={FallbackComponent}>\n <AddressRoot onEvent={onEvent} {...rootProps} />\n </BaseBoundaries>\n )\n}\n\nfunction AddressRoot({\n contractorId,\n defaultValues,\n onEvent,\n dictionary,\n className,\n}: Omit<AddressProps, 'FallbackComponent'>) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const { t } = useTranslation('Contractor.Address')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n const contractorAddress = useContractorAddressForm({\n contractorId,\n optionalFieldsToRequire: SDK_REQUIRED_ADDRESS_FIELDS,\n defaultValues,\n })\n\n if (contractorAddress.isLoading) {\n return <BaseLayout isLoading error={contractorAddress.errorHandling.errors} />\n }\n\n const { Fields } = contractorAddress.form\n const isBusiness = contractorAddress.data.contractorType === 'Business'\n\n const handleSubmit = async () => {\n const result = await contractorAddress.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, result.data)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n }\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={contractorAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={contractorAddress}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <header>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {isBusiness ? t('businessAddressTitle') : t('homeAddressTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {isBusiness ? t('businessAddressDescription') : t('homeAddressDescription')}\n </Components.Text>\n </Flex>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <Fields.Street1\n label={t('street1')}\n validationMessages={{ REQUIRED: t('validations.street1') }}\n />\n <Fields.Street2 label={t('street2')} />\n <Fields.City\n label={t('city')}\n validationMessages={{ REQUIRED: t('validations.city') }}\n />\n <Fields.State\n label={t('state')}\n placeholder={t('statePlaceholder')}\n validationMessages={{ REQUIRED: t('validations.state') }}\n getOptionLabel={(abbr: string) =>\n tCommon(`statesHash.${abbr}`, { defaultValue: abbr })\n }\n />\n <Fields.Zip\n label={t('zip')}\n validationMessages={{\n REQUIRED: t('validations.zip'),\n INVALID_ZIP: t('validations.zipInvalid'),\n }}\n />\n </Grid>\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isDisabled={contractorAddress.status.isPending}>\n {contractorAddress.status.isPending ? t('submitting') : t('submit')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SDK_REQUIRED_ADDRESS_FIELDS","Address","onEvent","FallbackComponent","rootProps","jsx","BaseBoundaries","AddressRoot","contractorId","defaultValues","dictionary","className","useComponentDictionary","useI18n","useTranslation","tCommon","Components","useComponentContext","contractorAddress","useContractorAddressForm","BaseLayout","Fields","isBusiness","handleSubmit","result","contractorEvents","classNames","styles","SDKFormProvider","Form","jsxs","Flex","Grid","abbr","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,IAAwE;AAAA,EAC5E,QAAQ,CAAC,WAAW,QAAQ,SAAS,KAAK;AAC5C;AAiDO,SAASC,EAAQ,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,GAAGC,KAA2B;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,eAAc,sBAAqB,mBAAAH,GACjD,4BAACI,GAAA,EAAY,SAAAL,GAAmB,GAAGE,EAAA,CAAW,EAAA,CAChD;AAEJ;AAEA,SAASG,EAAY;AAAA,EACnB,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAP;AAAA,EACA,YAAAQ;AAAA,EACA,WAAAC;AACF,GAA4C;AAC1C,EAAAC,EAAuB,sBAAsBF,CAAU,GACvDG,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,EAAA,IAAMC,EAAe,oBAAoB,GAC3C,EAAE,GAAGC,MAAYD,EAAe,QAAQ,GACxCE,IAAaC,EAAA,GAEbC,IAAoBC,EAAyB;AAAA,IACjD,cAAAX;AAAA,IACA,yBAAyBR;AAAA,IACzB,eAAAS;AAAA,EAAA,CACD;AAED,MAAIS,EAAkB;AACpB,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAkB,cAAc,QAAQ;AAG9E,QAAM,EAAE,QAAAG,MAAWH,EAAkB,MAC/BI,IAAaJ,EAAkB,KAAK,mBAAmB,YAEvDK,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMN,EAAkB,QAAQ,SAAA;AAC/C,IAAIM,MACFtB,EAAQuB,EAAiB,4BAA4BD,EAAO,IAAI,GAChEtB,EAAQuB,EAAiB,uBAAuB;AAAA,EAEpD;AAEA,SACE,gBAAApB,EAAC,WAAA,EAAQ,WAAWqB,EAAWC,EAAO,WAAWhB,CAAS,GACxD,UAAA,gBAAAN,EAACe,GAAA,EA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AA,UACrD,gBAAgB,CAACY,MACflB,EAAQ,cAAckB,CAAI,IAAI,EAAE,cAAcA,EAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,MAGxD,gBAAA5B;AAAA,QAACgB,EAAO;AAAA,QAAP;AAAA,UACC,OAAO,EAAE,KAAK;AAAA,UACd,oBAAoB;AAAA,YAClB,UAAU,EAAE,iBAAiB;AAAA,YAC7B,aAAa,EAAE,wBAAwB;AAAA,UAAA;AAAA,QACzC;AAAA,MAAA;AAAA,IACF,GACF;AAAA,IAEA,gBAAAhB,EAAC6B,KACC,UAAA,gBAAA7B,EAACW,EAAW,QAAX,EAAkB,MAAK,UAAS,YAAYE,EAAkB,OAAO,WACnE,UAAAA,EAAkB,OAAO,YAAY,EAAE,YAAY,IAAI,EAAE,QAAQ,EAAA,CACpE,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF,GACF,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type { FallbackProps } from 'react-error-boundary'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { Form } from '@/components/Common/Form'\nimport { Flex, Grid, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\nimport { contractorEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useContractorHasSignedW9 } from '@/components/Contractor/shared/useContractorHasSignedW9'\n\n// The hook defaults to the API contract, which treats every address field as\n// optional. The SDK's address form has always required a complete mailing\n// address, so it opts those fields back into being required here.\nconst SDK_REQUIRED_ADDRESS_FIELDS: ContractorAddressOptionalFieldsToRequire = {\n update: ['street1', 'city', 'state', 'zip'],\n}\n\n/**\n * Props for {@link Address}.\n *\n * @public\n */\nexport interface AddressProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Pre-fill values for address fields. Server data takes precedence when the contractor already has an address on file. */\n defaultValues?: AddressDefaultValues\n /** Callback invoked each time the component emits an event. */\n onEvent: OnEventType<EventType, unknown>\n /** Overrides for the component's i18n strings. */\n dictionary?: ResourceDictionary<'Contractor.Address'>\n /** Optional class applied to the wrapping `<section>`. */\n className?: string\n /** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n}\n\n/**\n * Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/address/updated` | Fired after the address is saved | The updated `ContractorAddress` entity |\n * | `contractor/address/done` | Fired after a successful save so the parent flow can advance | — |\n *\n * @param props - See {@link AddressProps}.\n * @returns The contractor address form.\n * @public\n *\n * @example\n * ```tsx\n * import { ContractorOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <ContractorOnboarding.Address\n * contractorId=\"contractor-uuid\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps) {\n return (\n <BaseBoundaries componentName=\"Contractor.Address\" FallbackComponent={FallbackComponent}>\n <AddressRoot onEvent={onEvent} {...rootProps} />\n </BaseBoundaries>\n )\n}\n\nfunction ContractorAddressW9Warning({ contractorId }: { contractorId: string }) {\n const hasSignedW9 = useContractorHasSignedW9(contractorId)\n const { t } = useTranslation('Contractor.Address')\n const Components = useComponentContext()\n if (!hasSignedW9) return null\n return (\n <Components.Alert status=\"warning\" disableScrollIntoView label={t('w9EditWarning.label')}>\n <Components.Text>{t('w9EditWarning.body')}</Components.Text>\n </Components.Alert>\n )\n}\n\nfunction AddressRoot({\n contractorId,\n defaultValues,\n onEvent,\n dictionary,\n className,\n}: Omit<AddressProps, 'FallbackComponent'>) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const { t } = useTranslation('Contractor.Address')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n const contractorAddress = useContractorAddressForm({\n contractorId,\n optionalFieldsToRequire: SDK_REQUIRED_ADDRESS_FIELDS,\n defaultValues,\n })\n\n if (contractorAddress.isLoading) {\n return <BaseLayout isLoading error={contractorAddress.errorHandling.errors} />\n }\n\n const { Fields } = contractorAddress.form\n const isBusiness = contractorAddress.data.contractorType === 'Business'\n\n const handleSubmit = async () => {\n const result = await contractorAddress.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, result.data)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n }\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={contractorAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={contractorAddress}>\n <Form onSubmit={() => void handleSubmit()}>\n <ContractorAddressW9Warning contractorId={contractorId} />\n\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <header>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {isBusiness ? t('businessAddressTitle') : t('homeAddressTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {isBusiness ? t('businessAddressDescription') : t('homeAddressDescription')}\n </Components.Text>\n </Flex>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <Fields.Street1\n label={t('street1')}\n validationMessages={{ REQUIRED: t('validations.street1') }}\n />\n <Fields.Street2 label={t('street2')} />\n <Fields.City\n label={t('city')}\n validationMessages={{ REQUIRED: t('validations.city') }}\n />\n <Fields.State\n label={t('state')}\n placeholder={t('statePlaceholder')}\n validationMessages={{ REQUIRED: t('validations.state') }}\n getOptionLabel={(abbr: string) =>\n tCommon(`statesHash.${abbr}`, { defaultValue: abbr })\n }\n />\n <Fields.Zip\n label={t('zip')}\n validationMessages={{\n REQUIRED: t('validations.zip'),\n INVALID_ZIP: t('validations.zipInvalid'),\n }}\n />\n </Grid>\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isDisabled={contractorAddress.status.isPending}>\n {contractorAddress.status.isPending ? t('submitting') : t('submit')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SDK_REQUIRED_ADDRESS_FIELDS","Address","onEvent","FallbackComponent","rootProps","jsx","BaseBoundaries","AddressRoot","ContractorAddressW9Warning","contractorId","hasSignedW9","useContractorHasSignedW9","t","useTranslation","Components","useComponentContext","defaultValues","dictionary","className","useComponentDictionary","useI18n","tCommon","contractorAddress","useContractorAddressForm","BaseLayout","Fields","isBusiness","handleSubmit","result","contractorEvents","classNames","styles","SDKFormProvider","jsxs","Form","Flex","Grid","abbr","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAMA,IAAwE;AAAA,EAC5E,QAAQ,CAAC,WAAW,QAAQ,SAAS,KAAK;AAC5C;AAiDO,SAASC,EAAQ,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,GAAGC,KAA2B;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,eAAc,sBAAqB,mBAAAH,GACjD,4BAACI,GAAA,EAAY,SAAAL,GAAmB,GAAGE,EAAA,CAAW,EAAA,CAChD;AAEJ;AAEA,SAASI,EAA2B,EAAE,cAAAC,KAA0C;AAC9E,QAAMC,IAAcC,EAAyBF,CAAY,GACnD,EAAE,GAAAG,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA;AACnB,SAAKL,sBA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;AAAA,YACC,OAAOb,EAAE,KAAK;AAAA,YACd,oBAAoB;AAAA,cAClB,UAAUA,EAAE,iBAAiB;AAAA,cAC7B,aAAaA,EAAE,wBAAwB;AAAA,YAAA;AAAA,UACzC;AAAA,QAAA;AAAA,MACF,GACF;AAAA,MAEA,gBAAAP,EAACiC,KACC,UAAA,gBAAAjC,EAACS,EAAW,QAAX,EAAkB,MAAK,UAAS,YAAYQ,EAAkB,OAAO,WACnE,UAAAA,EAAkB,OAAO,YAAYV,EAAE,YAAY,IAAIA,EAAE,QAAQ,EAAA,CACpE,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,15 +1,15 @@
1
1
  import { jsx as n, jsxs as C } from "react/jsx-runtime";
2
- import { useTranslation as g } from "react-i18next";
2
+ import { useTranslation as p } from "react-i18next";
3
3
  import { useContractorsDeleteMutation as V } from "@gusto/embedded-api/react-query/contractorsDelete";
4
4
  import { useContractorsUpdateOnboardingStatusMutation as j } from "@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus";
5
5
  import { useContractors as q } from "./useContractorList.js";
6
- import { Flex as N } from "../../Common/Flex/Flex.js";
6
+ import { Flex as b } from "../../Common/Flex/Flex.js";
7
7
  import { EmptyData as W } from "../../Common/EmptyData/EmptyData.js";
8
- import { ActionsLayout as b } from "../../Common/ActionsLayout/ActionsLayout.js";
8
+ import { ActionsLayout as S } from "../../Common/ActionsLayout/ActionsLayout.js";
9
9
  import { HamburgerMenu as X } from "../../Common/HamburgerMenu/HamburgerMenu.js";
10
10
  import { firstLastName as Y } from "../../../helpers/formattedStrings.js";
11
11
  import z from "../../../assets/icons/pencil.svg.js";
12
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
13
  import { ContractorOnboardingStatusBadge as J } from "../../Common/OnboardingStatusBadge/index.js";
14
14
  import { useI18n as K, useComponentDictionary as Q } from "../../../i18n/I18n.js";
15
15
  import { BaseComponent as Z } from "../../Base/Base.js";
@@ -20,33 +20,33 @@ import et from "../../../assets/icons/x-circle.svg.js";
20
20
  import { useDataView as ot } from "../../Common/DataView/useDataView.js";
21
21
  import { DataView as at } from "../../Common/DataView/DataView.js";
22
22
  function rt({ count: o, handleAdd: i }) {
23
- const { Button: r, Heading: d } = p(), { t: e } = g("Contractor.ContractorList");
24
- return /* @__PURE__ */ C(N, { alignItems: "center", justifyContent: "space-between", children: [
23
+ const { Button: r, Heading: d } = f(), { t: e } = p("Contractor.ContractorList");
24
+ return /* @__PURE__ */ C(b, { alignItems: "center", justifyContent: "space-between", children: [
25
25
  /* @__PURE__ */ n(d, { as: "h2", children: e("title") }),
26
26
  o !== 0 && /* @__PURE__ */ n(r, { variant: "secondary", onClick: i, children: e("addAnotherCta") })
27
27
  ] });
28
28
  }
29
29
  function it({ handleAdd: o }) {
30
- const { Button: i } = p(), { t: r } = g("Contractor.ContractorList");
31
- return /* @__PURE__ */ n(W, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ n(b, { justifyContent: "center", children: /* @__PURE__ */ n(i, { onClick: o, children: r("addContractorCta") }) }) });
30
+ const { Button: i } = f(), { t: r } = p("Contractor.ContractorList");
31
+ return /* @__PURE__ */ n(W, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ n(S, { justifyContent: "center", children: /* @__PURE__ */ n(i, { onClick: o, children: r("addContractorCta") }) }) });
32
32
  }
33
33
  function It(o) {
34
34
  return /* @__PURE__ */ n(Z, { ...o, children: /* @__PURE__ */ n(st, { ...o, children: o.children }) });
35
35
  }
36
36
  function st({ companyId: o, className: i, dictionary: r, successMessage: d }) {
37
37
  K("Contractor.ContractorList"), Q("Contractor.ContractorList", r);
38
- const { t: e } = g("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: f } = $(), { Alert: S, Button: E } = p(), {
39
- contractors: T,
38
+ const { t: e } = p("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: g } = $(), { Alert: E, Button: T } = f(), {
39
+ contractors: A,
40
40
  totalCount: O,
41
- handleNextPage: A,
42
- handleFirstPage: L,
43
- handleLastPage: R,
44
- handlePreviousPage: D,
45
- handleItemsPerPageChange: P,
46
- currentPage: I,
47
- totalPages: _,
48
- itemsPerPage: y
49
- } = q({ companyUuid: o }), { mutateAsync: B, isPending: v } = V(), { mutateAsync: w, isPending: U } = j(), x = ot({
41
+ handleNextPage: R,
42
+ handleFirstPage: D,
43
+ handleLastPage: L,
44
+ handlePreviousPage: P,
45
+ handleItemsPerPageChange: I,
46
+ currentPage: _,
47
+ totalPages: y,
48
+ itemsPerPage: B
49
+ } = q({ companyUuid: o }), { mutateAsync: v, isPending: w } = V(), { mutateAsync: U, isPending: x } = j(), M = ot({
50
50
  columns: [
51
51
  {
52
52
  title: e("listHeaders.name"),
@@ -63,65 +63,56 @@ function st({ companyId: o, className: i, dictionary: r, successMessage: d }) {
63
63
  )
64
64
  }
65
65
  ],
66
- data: T,
66
+ data: A,
67
67
  itemMenu: (t) => {
68
- const a = t.onboardingStatus === u.SELF_ONBOARDING_REVIEW, l = e(a ? "reviewCta" : "editCta"), H = t.onboardingStatus === u.SELF_ONBOARDING_INVITED || t.onboardingStatus === u.SELF_ONBOARDING_STARTED, m = [
69
- {
70
- label: l,
71
- icon: /* @__PURE__ */ n(z, { "aria-hidden": !0 }),
72
- onClick: () => {
73
- M(t.uuid);
74
- }
68
+ const a = t.onboardingStatus === u.SELF_ONBOARDING_REVIEW, m = e(a ? "reviewCta" : "editCta"), N = t.onboardingStatus === u.SELF_ONBOARDING_INVITED || t.onboardingStatus === u.SELF_ONBOARDING_STARTED, l = [];
69
+ return N || l.push({
70
+ label: m,
71
+ icon: /* @__PURE__ */ n(z, { "aria-hidden": !0 }),
72
+ onClick: () => {
73
+ k(t.uuid);
75
74
  }
76
- ];
77
- return H && m.push({
75
+ }), N && l.push({
78
76
  label: e("cancelSelfOnboardingCta"),
79
77
  icon: /* @__PURE__ */ n(et, { "aria-hidden": !0 }),
80
78
  onClick: () => {
81
- G(t.uuid);
79
+ H(t.uuid);
82
80
  }
83
- }), m.push({
81
+ }), l.push({
84
82
  label: e("deleteCta"),
85
83
  icon: /* @__PURE__ */ n(nt, { "aria-hidden": !0 }),
86
84
  onClick: () => {
87
- F(t.uuid);
88
- }
89
- }), /* @__PURE__ */ n(
90
- X,
91
- {
92
- items: m,
93
- triggerLabel: l,
94
- isLoading: v || U
85
+ G(t.uuid);
95
86
  }
96
- );
87
+ }), /* @__PURE__ */ n(X, { items: l, isLoading: w || x });
97
88
  },
98
89
  emptyState: () => /* @__PURE__ */ n(it, { handleAdd: h }),
99
90
  pagination: {
100
- handleNextPage: A,
101
- handleFirstPage: L,
102
- handleLastPage: R,
103
- handlePreviousPage: D,
104
- handleItemsPerPageChange: P,
105
- currentPage: I,
106
- totalPages: _,
91
+ handleNextPage: R,
92
+ handleFirstPage: D,
93
+ handleLastPage: L,
94
+ handlePreviousPage: P,
95
+ handleItemsPerPageChange: I,
96
+ currentPage: _,
97
+ totalPages: y,
107
98
  totalCount: O,
108
- itemsPerPage: y
99
+ itemsPerPage: B
109
100
  }
110
101
  }), h = () => {
111
102
  s(c.CONTRACTOR_CREATE);
112
- }, M = (t) => {
103
+ }, k = (t) => {
113
104
  s(c.CONTRACTOR_UPDATE, { contractorId: t });
114
- }, k = () => {
105
+ }, F = () => {
115
106
  s(c.CONTRACTOR_ONBOARDING_CONTINUE);
116
- }, F = async (t) => {
117
- await f(t, async (a) => {
118
- await B({
107
+ }, G = async (t) => {
108
+ await g(t, async (a) => {
109
+ await v({
119
110
  request: { contractorUuid: a }
120
111
  }), s(c.CONTRACTOR_DELETED, { contractorId: a });
121
112
  });
122
- }, G = async (t) => {
123
- await f(t, async (a) => {
124
- const l = await w({
113
+ }, H = async (t) => {
114
+ await g(t, async (a) => {
115
+ const m = await U({
125
116
  request: {
126
117
  contractorUuid: a,
127
118
  contractorOnboardingStatusUpdateRequestBody: {
@@ -131,16 +122,16 @@ function st({ companyId: o, className: i, dictionary: r, successMessage: d }) {
131
122
  });
132
123
  s(
133
124
  c.CONTRACTOR_SELF_ONBOARDING_CANCELLED,
134
- l.contractorOnboardingStatus
125
+ m.contractorOnboardingStatus
135
126
  );
136
127
  });
137
128
  };
138
129
  return /* @__PURE__ */ C("section", { className: i, children: [
139
- d && /* @__PURE__ */ n(S, { label: d, status: "success" }),
140
- /* @__PURE__ */ C(N, { flexDirection: "column", children: [
130
+ d && /* @__PURE__ */ n(E, { label: d, status: "success" }),
131
+ /* @__PURE__ */ C(b, { flexDirection: "column", children: [
141
132
  /* @__PURE__ */ n(rt, { count: O, handleAdd: h }),
142
- /* @__PURE__ */ n(at, { label: e("contractorListLabel"), ...x }),
143
- /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(E, { onClick: k, isLoading: !1, children: e("continueCta") }) })
133
+ /* @__PURE__ */ n(at, { label: e("contractorListLabel"), ...M }),
134
+ /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(T, { onClick: F, isLoading: !1, children: e("continueCta") }) })
144
135
  ] })
145
136
  ] });
146
137
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE, ContractorOnboardingStatus } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport XCircleSvg from '@/assets/icons/x-circle.svg?react'\n\ninterface HeadProps {\n count: number\n handleAdd: () => void\n}\nfunction Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\ninterface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nfunction EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\n/**\n * Props for {@link ContractorList}.\n *\n * @public\n */\nexport interface ContractorListProps extends BaseComponentInterface<'Contractor.ContractorList'> {\n /** UUID of the company whose contractors should be listed. */\n companyId: string\n /** Success message to display in an alert above the list, typically after a create, update, or delete action. */\n successMessage?: string\n}\n\n/**\n * Lists a company's contractors with controls to add, edit, delete, cancel self-onboarding, and continue onboarding.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | The add-contractor action was triggered. | — |\n * | `contractor/update` | A contractor row's edit action was triggered. | `{ contractorId: string }` |\n * | `contractor/deleted` | A contractor was successfully deleted. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | A contractor's self-onboarding was cancelled, reverting them to admin onboarding. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/onboarding/continue` | The continue action was triggered to advance onboarding. | — |\n *\n * @param props - See {@link ContractorListProps}.\n * @returns The rendered contractor list.\n * @public\n */\nexport function ContractorList(props: ContractorListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n useComponentDictionary('Contractor.ContractorList', dictionary)\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n const { mutateAsync: updateOnboardingStatusMutation, isPending: isPendingCancel } =\n useContractorsUpdateOnboardingStatusMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => {\n const isAwaitingSelfOnboardingReview =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_REVIEW\n const editLabel = isAwaitingSelfOnboardingReview ? t('reviewCta') : t('editCta')\n const canCancelSelfOnboarding =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_INVITED ||\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_STARTED\n\n const menuItems = [\n {\n label: editLabel,\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n },\n ]\n\n if (canCancelSelfOnboarding) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n icon: <XCircleSvg aria-hidden />,\n onClick: () => {\n void handleCancelSelfOnboarding(contractor.uuid)\n },\n })\n }\n\n menuItems.push({\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n })\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={editLabel}\n isLoading={isPendingDelete || isPendingCancel}\n />\n )\n },\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n const handleCancelSelfOnboarding = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n const response = await updateOnboardingStatusMutation({\n request: {\n contractorUuid: payload,\n contractorOnboardingStatusUpdateRequestBody: {\n onboardingStatus: ContractorOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n\n onEvent(\n componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED,\n response.contractorOnboardingStatus,\n )\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","updateOnboardingStatusMutation","isPendingCancel","useContractorsUpdateOnboardingStatusMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","isAwaitingSelfOnboardingReview","ContractorOnboardingStatus","editLabel","canCancelSelfOnboarding","menuItems","PencilSvg","handleEdit","XCircleSvg","handleCancelSelfOnboarding","TrashCanSvg","handleDelete","HamburgerMenu","componentEvents","uuid","handleContinue","payload","response","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAASA,GAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AAC7C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAA,GACtB,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAC,EAACC,GAAA,EAAK,YAAW,UAAS,gBAAe,iBACvC,UAAA;AAAA,IAAA,gBAAAC,EAACN,GAAA,EAAQ,IAAG,MAAM,UAAAE,EAAE,OAAO,GAAE;AAAA,IAE5BL,MAAU,KACT,gBAAAS,E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A9B;AAAA,QACEyC,EAAgB;AAAA,QAChBI,EAAS;AAAA,MAAA;AAAA,IAEb,CAAC;AAAA,EACH;AAEA,SACE,gBAAA7D,EAAC,aAAQ,WAAAW,GACN,UAAA;AAAA,IAAAE,KAAkB,gBAAAX,EAACiB,GAAA,EAAM,OAAON,GAAgB,QAAO,WAAU;AAAA,IAClE,gBAAAb,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,MAAA,gBAAAC,EAACV,IAAA,EAAK,OAAO6B,GAAY,WAAA3B,EAAA,CAAsB;AAAA,wBAC9CoE,IAAA,EAAS,OAAOhE,EAAE,qBAAqB,GAAI,GAAGuC,GAAe;AAAA,MAC9D,gBAAAnC,EAACG,GAAA,EACC,UAAA,gBAAAH,EAACP,GAAA,EAAO,SAASgE,GAAgB,WAAW,IACzC,UAAA7D,EAAE,aAAa,EAAA,CAClB,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE, ContractorOnboardingStatus } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport XCircleSvg from '@/assets/icons/x-circle.svg?react'\n\ninterface HeadProps {\n count: number\n handleAdd: () => void\n}\nfunction Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\ninterface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nfunction EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\n/**\n * Props for {@link ContractorList}.\n *\n * @public\n */\nexport interface ContractorListProps extends BaseComponentInterface<'Contractor.ContractorList'> {\n /** UUID of the company whose contractors should be listed. */\n companyId: string\n /** Success message to display in an alert above the list, typically after a create, update, or delete action. */\n successMessage?: string\n}\n\n/**\n * Lists a company's contractors with controls to add, edit, delete, cancel self-onboarding, and continue onboarding.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | The add-contractor action was triggered. | — |\n * | `contractor/update` | A contractor row's edit action was triggered. | `{ contractorId: string }` |\n * | `contractor/deleted` | A contractor was successfully deleted. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | A contractor's self-onboarding was cancelled, reverting them to admin onboarding. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/onboarding/continue` | The continue action was triggered to advance onboarding. | — |\n *\n * @param props - See {@link ContractorListProps}.\n * @returns The rendered contractor list.\n * @public\n */\nexport function ContractorList(props: ContractorListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n useComponentDictionary('Contractor.ContractorList', dictionary)\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n const { mutateAsync: updateOnboardingStatusMutation, isPending: isPendingCancel } =\n useContractorsUpdateOnboardingStatusMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => {\n const isAwaitingSelfOnboardingReview =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_REVIEW\n const editLabel = isAwaitingSelfOnboardingReview ? t('reviewCta') : t('editCta')\n const canCancelSelfOnboarding =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_INVITED ||\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_STARTED\n\n // While the contractor is mid self-onboarding, editing is blocked: the\n // admin must first cancel self-onboarding. So the Edit item is omitted\n // whenever cancelling is available.\n const menuItems: MenuItem[] = []\n\n if (!canCancelSelfOnboarding) {\n menuItems.push({\n label: editLabel,\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n })\n }\n\n if (canCancelSelfOnboarding) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n icon: <XCircleSvg aria-hidden />,\n onClick: () => {\n void handleCancelSelfOnboarding(contractor.uuid)\n },\n })\n }\n\n menuItems.push({\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n })\n\n return <HamburgerMenu items={menuItems} isLoading={isPendingDelete || isPendingCancel} />\n },\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n const handleCancelSelfOnboarding = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n const response = await updateOnboardingStatusMutation({\n request: {\n contractorUuid: payload,\n contractorOnboardingStatusUpdateRequestBody: {\n onboardingStatus: ContractorOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n\n onEvent(\n componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED,\n response.contractorOnboardingStatus,\n )\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","updateOnboardingStatusMutation","isPendingCancel","useContractorsUpdateOnboardingStatusMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","isAwaitingSelfOnboardingReview","ContractorOnboardingStatus","editLabel","canCancelSelfOnboarding","menuItems","PencilSvg","handleEdit","XCircleSvg","handleCancelSelfOnboarding","TrashCanSvg","handleDelete","HamburgerMenu","componentEvents","uuid","handleContinue","payload","response","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,SAASA,GAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AAC7C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAA,GACtB,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAC,EAACC,GAAA,EAAK,YAAW,UAAS,gBAAe,iBACvC,UAAA;AAAA,IAAA,gBAAAC,EAACN,GAAA,EAAQ,IAAG,MAAM,UAAAE,EAAE,OAAO,GAAE;AAAA,IAE5BL,MAAU,KACT,gBAAAS,EAACP,GAAA,EAAO,SAAQ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