@gusto/embedded-react-sdk 0.56.3 → 0.56.5

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 (74) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/Common/DocumentEmbed/DocumentEmbed.js +18 -0
  3. package/dist/components/Common/DocumentEmbed/DocumentEmbed.js.map +1 -0
  4. package/dist/components/Common/DocumentViewer/DocumentViewer.js +35 -29
  5. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  6. package/dist/components/Common/FieldCaption/FieldCaption.js +21 -18
  7. package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
  8. package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +5 -3
  9. package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js.map +1 -1
  10. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +64 -61
  11. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
  12. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +133 -134
  13. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
  14. package/dist/components/Contractor/ContractorListFlow/ContractorListFlow.js.map +1 -1
  15. package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js +22 -9
  16. package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js.map +1 -1
  17. package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js +51 -20
  18. package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js.map +1 -1
  19. package/dist/components/Contractor/Dismissal/Dismissal.js +77 -0
  20. package/dist/components/Contractor/Dismissal/Dismissal.js.map +1 -0
  21. package/dist/components/Contractor/Dismissal/DismissalPresentation.js +57 -0
  22. package/dist/components/Contractor/Dismissal/DismissalPresentation.js.map +1 -0
  23. package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js +44 -0
  24. package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js.map +1 -0
  25. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +45 -41
  26. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  27. package/dist/components/Contractor/exports/contractorManagement.js +56 -54
  28. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  29. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +201 -196
  30. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  31. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +55 -52
  32. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
  33. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js +38 -29
  34. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js.map +1 -1
  35. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +17 -14
  36. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  37. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +72 -68
  38. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
  39. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  40. package/dist/i18n/I18n.js +1 -0
  41. package/dist/i18n/I18n.js.map +1 -1
  42. package/dist/i18n/en/Contractor.Dismissal.json.js +20 -0
  43. package/dist/i18n/en/Contractor.Dismissal.json.js.map +1 -0
  44. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +2 -2
  45. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +38 -38
  46. package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +31 -31
  47. package/dist/i18n/en/common.json.js +37 -35
  48. package/dist/i18n/en/common.json.js.map +1 -1
  49. package/dist/package.json.js +1 -1
  50. package/dist/shared/constants.js +1 -0
  51. package/dist/shared/constants.js.map +1 -1
  52. package/dist/src/components/Common/DocumentEmbed/DocumentEmbed.d.ts +3 -0
  53. package/dist/src/components/Common/DocumentEmbed/DocumentEmbedTypes.d.ts +25 -0
  54. package/dist/src/components/Common/DocumentEmbed/index.d.ts +2 -0
  55. package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +2 -0
  56. package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +3 -1
  57. package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +6 -4
  58. package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -0
  59. package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.d.ts +1 -0
  60. package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.test.d.ts +1 -0
  61. package/dist/src/components/Contractor/Dismissal/Dismissal.d.ts +45 -0
  62. package/dist/src/components/Contractor/Dismissal/DismissalPresentation.d.ts +17 -0
  63. package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.d.ts +41 -0
  64. package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.test.d.ts +1 -0
  65. package/dist/src/components/Contractor/exports/contractorManagement.d.ts +1 -0
  66. package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.d.ts +19 -0
  67. package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  68. package/dist/src/contexts/ComponentAdapter/useComponentContext.d.ts +5 -2
  69. package/dist/src/i18n/en/common.json.d.ts +3 -0
  70. package/dist/src/i18n/types.d.ts +47 -0
  71. package/dist/src/shared/constants.d.ts +2 -0
  72. package/dist/style.css +1 -1
  73. package/docs/guides/endpoint-inventory.json +18 -0
  74. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.56.5](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.4...v0.56.5) (2026-10-07)
4
+
5
+ ### Features & Enhancements
6
+
7
+ - Add a standalone `Dismissal` component (via `useDismissal`) for scheduling a contractor's dismissal date. `ContractorListFlow`'s "Dismiss contractor" action now opens this flow instead of only emitting an event ([#2862](https://github.com/Gusto/embedded-react-sdk/issues/2862))
8
+ - Add an optional `DocumentEmbed` override to `ComponentsContext`, letting you replace the SDK's default PDF rendering — useful if your Content Security Policy can't allow `object-src`. Falls back to the existing rendering when no override is supplied ([#2876](https://github.com/Gusto/embedded-react-sdk/issues/2876))
9
+
10
+ ### Fixes
11
+
12
+ - Show the receipt ID and the correct recipient name on the contractor payment receipt, sourced from the receipt payload itself ([#2867](https://github.com/Gusto/embedded-react-sdk/issues/2867))
13
+ - Cap payroll hours (99999) and reimbursement amounts (1,000,000) client-side to match server limits, so an out-of-range value is caught before submit instead of failing with a 422 ([#2870](https://github.com/Gusto/embedded-react-sdk/issues/2870))
14
+ - Allow breadcrumb navigation from the receipts screen back to overview, instead of silently no-opping ([#2878](https://github.com/Gusto/embedded-react-sdk/issues/2878))
15
+
16
+ ## [0.56.4](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.3...v0.56.4) (2026-10-02)
17
+
18
+ ### Fixes
19
+
20
+ - Keep the required-field asterisk out of the field's accessible name, so screen readers no longer announce it as part of the label ([#2865](https://github.com/Gusto/embedded-react-sdk/issues/2865))
21
+
3
22
  ## [0.56.3](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.2...v0.56.3) (2026-10-01)
4
23
 
5
24
  ### Features & Enhancements
@@ -0,0 +1,18 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
3
+ const c = ({ url: e, title: o, className: n }) => /* @__PURE__ */ t(
4
+ "embed",
5
+ {
6
+ src: `${e}#toolbar=0&navpanes=0`,
7
+ title: o,
8
+ type: "application/pdf",
9
+ className: n
10
+ }
11
+ ), s = (e) => {
12
+ const o = m();
13
+ return o.DocumentEmbed ? /* @__PURE__ */ t(o.DocumentEmbed, { ...e }) : /* @__PURE__ */ t(c, { ...e });
14
+ };
15
+ export {
16
+ s as DocumentEmbed
17
+ };
18
+ //# sourceMappingURL=DocumentEmbed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentEmbed.js","sources":["../../../../src/components/Common/DocumentEmbed/DocumentEmbed.tsx"],"sourcesContent":["import type { DocumentEmbedProps } from './DocumentEmbedTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst DefaultDocumentEmbed = ({ url, title, className }: DocumentEmbedProps) => (\n <embed\n // `#toolbar=0&navpanes=0` is a PDF.js/browser-plugin URL fragment convention\n // (not a real query string) that hides the built-in PDF viewer's toolbar and\n // side navigation panel so it reads as part of our UI rather than a bare\n // plugin frame. It only affects this default `<embed>` rendering — a partner\n // supplying their own `DocumentEmbed` override gets the raw `url` and owns\n // any such chrome themselves.\n src={`${url}#toolbar=0&navpanes=0`}\n title={title}\n type=\"application/pdf\"\n className={className}\n />\n)\n\n/** @internal */\nexport const DocumentEmbed = (props: DocumentEmbedProps) => {\n const Components = useComponentContext()\n\n return Components.DocumentEmbed ? (\n <Components.DocumentEmbed {...props} />\n ) : (\n <DefaultDocumentEmbed {...props} />\n )\n}\n"],"names":["DefaultDocumentEmbed","url","title","className","jsx","DocumentEmbed","props","Components","useComponentContext"],"mappings":";;AAGA,MAAMA,IAAuB,CAAC,EAAE,KAAAC,GAAK,OAAAC,GAAO,WAAAC,QAC1C,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IAOC,KAAK,GAAGH,CAAG;AAAA,IACX,OAAAC;AAAA,IACA,MAAK;AAAA,IACL,WAAAC;AAAA,EAAA;AACF,GAIWE,IAAgB,CAACC,MAA8B;AAC1D,QAAMC,IAAaC,EAAA;AAEnB,SAAOD,EAAW,gBAChB,gBAAAH,EAACG,EAAW,eAAX,EAA0B,GAAGD,EAAA,CAAO,IAErC,gBAAAF,EAACJ,GAAA,EAAsB,GAAGM,EAAA,CAAO;AAErC;"}
@@ -1,41 +1,47 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { useRef as p } from "react";
3
- import { Flex as i } from "../Flex/Flex.js";
4
- import n from "./DocumentViewer.module.scss.js";
5
- import h from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
6
- import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function k({
8
- url: r,
9
- title: a,
10
- downloadInstructions: m,
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { useRef as u } from "react";
3
+ import { useTranslation as x } from "react-i18next";
4
+ import { Flex as s } from "../Flex/Flex.js";
5
+ import t from "./DocumentViewer.module.scss.js";
6
+ import { DocumentEmbed as l } from "../DocumentEmbed/DocumentEmbed.js";
7
+ import N from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
8
+ import { useComponentContext as b } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ function w({
10
+ url: n,
11
+ title: c,
12
+ downloadInstructions: i,
11
13
  viewDocumentLabel: d,
12
- headingLevel: l = "h3"
14
+ headingLevel: f = "h3"
13
15
  }) {
14
- const o = u(), t = p(null), f = h({
15
- ref: t
16
+ const r = b(), { t: p } = x("common"), m = u(null), h = N({
17
+ ref: m
16
18
  }).includes("small");
17
- if (!r) return null;
18
- const c = {
19
- src: `${r}#toolbar=0&navpanes=0`,
20
- title: a,
21
- type: "application/pdf"
22
- };
23
- return /* @__PURE__ */ e("div", { className: n.container, ref: t, children: f ? /* @__PURE__ */ e("embed", { ...c, className: n.embedPdf }, r) : /* @__PURE__ */ e("div", { className: n.smallEmbedPdfContainer, children: /* @__PURE__ */ s(i, { gap: 20, children: [
24
- /* @__PURE__ */ e("embed", { ...c, className: n.smallEmbedPdf }, r),
25
- /* @__PURE__ */ s(i, { flexDirection: "column", gap: 8, children: [
26
- /* @__PURE__ */ s("div", { children: [
27
- a && /* @__PURE__ */ e(o.Heading, { as: l, className: n.heading, children: a }),
28
- m && /* @__PURE__ */ e(o.Text, { className: n.downloadInstructions, children: m })
19
+ if (!n) return null;
20
+ const o = c ?? p("documentEmbed.defaultTitle");
21
+ return /* @__PURE__ */ e("div", { className: t.container, ref: m, children: h ? /* @__PURE__ */ e(l, { url: n, title: o, className: t.embedPdf }, n) : /* @__PURE__ */ e("div", { className: t.smallEmbedPdfContainer, children: /* @__PURE__ */ a(s, { gap: 20, children: [
22
+ /* @__PURE__ */ e(
23
+ l,
24
+ {
25
+ url: n,
26
+ title: o,
27
+ className: t.smallEmbedPdf
28
+ },
29
+ n
30
+ ),
31
+ /* @__PURE__ */ a(s, { flexDirection: "column", gap: 8, children: [
32
+ /* @__PURE__ */ a("div", { children: [
33
+ /* @__PURE__ */ e(r.Heading, { as: f, className: t.heading, children: o }),
34
+ i && /* @__PURE__ */ e(r.Text, { className: t.downloadInstructions, children: i })
29
35
  ] }),
30
36
  /* @__PURE__ */ e(
31
- o.Link,
37
+ r.Link,
32
38
  {
33
39
  className: "react-aria-Button",
34
40
  "data-variant": "secondary",
35
- href: r,
41
+ href: n,
36
42
  target: "_blank",
37
43
  rel: "noopener noreferrer",
38
- download: `${a || "document"}.pdf`,
44
+ download: `${o}.pdf`,
39
45
  children: d
40
46
  }
41
47
  )
@@ -43,6 +49,6 @@ function k({
43
49
  ] }) }) });
44
50
  }
45
51
  export {
46
- k as DocumentViewer
52
+ w as DocumentViewer
47
53
  };
48
54
  //# sourceMappingURL=DocumentViewer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentViewer.js","sources":["../../../../src/components/Common/DocumentViewer/DocumentViewer.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { Flex } from '../Flex/Flex'\nimport styles from './DocumentViewer.module.scss'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\ninterface DocumentViewerProps {\n url?: string | null\n title?: string\n downloadInstructions?: string\n viewDocumentLabel: string\n headingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\n/** @internal */\nexport function DocumentViewer({\n url,\n title,\n downloadInstructions,\n viewDocumentLabel,\n headingLevel = 'h3',\n}: DocumentViewerProps) {\n const Components = useComponentContext()\n const containerRef = useRef<HTMLDivElement>(null)\n const matches = useContainerBreakpoints({\n ref: containerRef,\n })\n\n const isContainerWidthSmallOrGreater = matches.includes('small')\n\n if (!url) return null\n\n const commonEmbeddedPdfProps = {\n src: `${url}#toolbar=0&navpanes=0`,\n title,\n type: 'application/pdf',\n }\n\n // Keying the `<embed>` on the URL forces React to remount the element when\n // the URL changes (e.g. after signing replaces an unsigned PDF). Without\n // this, React reuses the existing DOM node, the browser's PDF plugin\n // doesn't reload the new src, and the viewer renders blank until a manual\n // reload.\n return (\n <div className={styles.container} ref={containerRef}>\n {isContainerWidthSmallOrGreater ? (\n <embed key={url} {...commonEmbeddedPdfProps} className={styles.embedPdf} />\n ) : (\n <div className={styles.smallEmbedPdfContainer}>\n <Flex gap={20}>\n <embed key={url} {...commonEmbeddedPdfProps} className={styles.smallEmbedPdf} />\n <Flex flexDirection=\"column\" gap={8}>\n <div>\n {title && (\n <Components.Heading as={headingLevel} className={styles.heading}>\n {title}\n </Components.Heading>\n )}\n {downloadInstructions && (\n <Components.Text className={styles.downloadInstructions}>\n {downloadInstructions}\n </Components.Text>\n )}\n </div>\n <Components.Link\n className=\"react-aria-Button\"\n data-variant=\"secondary\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${title || 'document'}.pdf`}\n >\n {viewDocumentLabel}\n </Components.Link>\n </Flex>\n </Flex>\n </div>\n )}\n </div>\n )\n}\n"],"names":["DocumentViewer","url","title","downloadInstructions","viewDocumentLabel","headingLevel","Components","useComponentContext","containerRef","useRef","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ML;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,UAAU,GAAGC,KAAS,UAAU;AAAA,UAE/B,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"DocumentViewer.js","sources":["../../../../src/components/Common/DocumentViewer/DocumentViewer.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Flex } from '../Flex/Flex'\nimport styles from './DocumentViewer.module.scss'\nimport { DocumentEmbed } from '@/components/Common/DocumentEmbed'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface DocumentViewerProps {\n url?: string | null\n title?: string\n downloadInstructions?: string\n viewDocumentLabel: string\n headingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\n/** @internal */\nexport function DocumentViewer({\n url,\n title,\n downloadInstructions,\n viewDocumentLabel,\n headingLevel = 'h3',\n}: DocumentViewerProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const containerRef = useRef<HTMLDivElement>(null)\n const matches = useContainerBreakpoints({\n ref: containerRef,\n })\n\n const isContainerWidthSmallOrGreater = matches.includes('small')\n\n if (!url) return null\n\n const resolvedTitle = title ?? t('documentEmbed.defaultTitle')\n\n // Keying the embed on the URL forces React to remount the element when the\n // URL changes (e.g. after signing replaces an unsigned PDF). Without this,\n // React reuses the existing DOM node, the browser's PDF plugin doesn't\n // reload the new src, and the viewer renders blank until a manual reload.\n return (\n <div className={styles.container} ref={containerRef}>\n {isContainerWidthSmallOrGreater ? (\n <DocumentEmbed key={url} url={url} title={resolvedTitle} className={styles.embedPdf} />\n ) : (\n <div className={styles.smallEmbedPdfContainer}>\n <Flex gap={20}>\n <DocumentEmbed\n key={url}\n url={url}\n title={resolvedTitle}\n className={styles.smallEmbedPdf}\n />\n <Flex flexDirection=\"column\" gap={8}>\n <div>\n <Components.Heading as={headingLevel} className={styles.heading}>\n {resolvedTitle}\n </Components.Heading>\n {downloadInstructions && (\n <Components.Text className={styles.downloadInstructions}>\n {downloadInstructions}\n </Components.Text>\n )}\n </div>\n <Components.Link\n className=\"react-aria-Button\"\n data-variant=\"secondary\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${resolvedTitle}.pdf`}\n >\n {viewDocumentLabel}\n </Components.Link>\n </Flex>\n </Flex>\n </div>\n )}\n </div>\n )\n}\n"],"names":["DocumentViewer","url","title","downloadInstructions","viewDocumentLabel","headingLevel","Components","useComponentContext","t","useTranslation","containerRef","useRef","isContainerWidthSmallOrGreater","useContainerBreakpoints","resolvedTitle","jsx","styles","DocumentEmbed","jsxs","Flex"],"mappings":";;;;;;;;AAiBO,SAASA,EAAe;AAAA,EAC7B,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,cAAAC,IAAe;AACjB,GAAwB;AACtB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAeC,EAAuB,IAAI,GAK1CC,IAJUC,EAAwB;AAAA,IACtC,KAAKH;AAAA,EAAA,CACN,EAE8C,SAAS,OAAO;AAE/D,MAAI,CAACT,EAAK,QAAO;AAEjB,QAAMa,IAAgBZ,KAASM,EAAE,4BAA4B;AAM7D,SACE,gBAAAO,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAW,KAAKN,GACpC,UAAAE,IACC,gBAAAG,EAACE,GAAA,EAAwB,KAAAhB,GAAU,OAAOa,GAAe,WAAWE,EAAO,SAAA,GAAvDf,CAAiE,IAErF,gBAAAc,EAAC,OAAA,EAAI,WAAWC,EAAO,wBACrB,UAAA,gBAAAE,EAACC,GAAA,EAAK,KAAK,IACT,UAAA;AAAA,IAAA,gBAAAJ;AAAA,MAACE;AAAA,MAAA;AAAA,QAEC,KAAAhB;AAAA,QACA,OAAOa;AAAA,QACP,WAAWE,EAAO;AAAA,MAAA;AAAA,MAHbf;AAAA,IAAA;AAAA,IAKP,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAD,EAAC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAAH,EAACT,EAAW,SAAX,EAAmB,IAAID,GAAc,WAAWW,EAAO,SACrD,UAAAF,EAAA,CACH;AAAA,QACCX,uBACEG,EAAW,MAAX,EAAgB,WAAWU,EAAO,sBAChC,UAAAb,EAAA,CACH;AAAA,MAAA,GAEJ;AAAA,MACA,gBAAAY;AAAA,QAACT,EAAW;AAAA,QAAX;AAAA,UACC,WAAU;AAAA,UACV,gBAAa;AAAA,UACb,MAAML;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,UAAU,GAAGa,CAAa;AAAA,UAEzB,UAAAV;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GAEJ;AAEJ;"}
@@ -1,31 +1,34 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import s from "classnames";
3
- import a from "./FieldCaption.module.scss.js";
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import d from "classnames";
3
+ import i from "./FieldCaption.module.scss.js";
4
4
  import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
5
- import { VisuallyHidden as d } from "../VisuallyHidden/VisuallyHidden.js";
6
- const c = ({
5
+ import { VisuallyHidden as c } from "../VisuallyHidden/VisuallyHidden.js";
6
+ const C = ({
7
7
  children: t,
8
8
  as: o = "label",
9
- htmlFor: i,
10
- isRequired: r = !1,
11
- isVisuallyHidden: l = !1,
12
- className: m
9
+ htmlFor: l,
10
+ isRequired: n = !1,
11
+ isVisuallyHidden: a = !1,
12
+ className: s
13
13
  }) => {
14
- const n = /* @__PURE__ */ e(
14
+ const r = /* @__PURE__ */ m(
15
15
  o,
16
16
  {
17
- className: s(a.root, m),
18
- htmlFor: o === "label" ? i : void 0,
19
- "data-required": r || void 0,
20
- children: t
17
+ className: d(i.root, s),
18
+ htmlFor: o === "label" ? l : void 0,
19
+ "data-required": n || void 0,
20
+ children: [
21
+ t,
22
+ n ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: i.requiredIndicator }) : null
23
+ ]
21
24
  }
22
25
  );
23
- return l ? /* @__PURE__ */ e(d, { children: n }) : n;
24
- }, h = (t) => {
26
+ return a ? /* @__PURE__ */ e(c, { children: r }) : r;
27
+ }, b = (t) => {
25
28
  const o = p();
26
- return o.FieldCaption ? /* @__PURE__ */ e(o.FieldCaption, { ...t }) : /* @__PURE__ */ e(c, { ...t });
29
+ return o.FieldCaption ? /* @__PURE__ */ e(o.FieldCaption, { ...t }) : /* @__PURE__ */ e(C, { ...t });
27
30
  };
28
31
  export {
29
- h as FieldCaption
32
+ b as FieldCaption
30
33
  };
31
34
  //# sourceMappingURL=FieldCaption.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldCaption.js","sources":["../../../../src/components/Common/FieldCaption/FieldCaption.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { FieldCaptionProps } from './FieldCaptionTypes'\nimport styles from './FieldCaption.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst DefaultFieldCaption = ({\n children,\n as = 'label',\n htmlFor,\n isRequired = false,\n isVisuallyHidden = false,\n className,\n}: FieldCaptionProps) => {\n const Component = as\n\n const content = (\n <Component\n className={classNames(styles.root, className)}\n htmlFor={as === 'label' ? htmlFor : undefined}\n data-required={isRequired || undefined}\n >\n {children}\n </Component>\n )\n\n return isVisuallyHidden ? <VisuallyHidden>{content}</VisuallyHidden> : content\n}\n\n/** @internal */\nexport const FieldCaption = (props: FieldCaptionProps) => {\n const Components = useComponentContext()\n\n return Components.FieldCaption ? (\n <Components.FieldCaption {...props} />\n ) : (\n <DefaultFieldCaption {...props} />\n )\n}\n"],"names":["DefaultFieldCaption","children","as","htmlFor","isRequired","isVisuallyHidden","className","content","jsx","classNames","styles","VisuallyHidden","FieldCaption","props","Components","useComponentContext"],"mappings":";;;;;AAMA,MAAMA,IAAsB,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,SAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,kBAAAC,IAAmB;AAAA,EACnB,WAAAC;AACF,MAAyB;AAGvB,QAAMC,IACJ,gBAAAC;AAAA,IAHgBN;AAAA,IAGf;AAAA,MACC,WAAWO,EAAWC,EAAO,MAAMJ,CAAS;AAAA,MAC5C,SAASJ,MAAO,UAAUC,IAAU;AAAA,MACpC,iBAAeC,KAAc;AAAA,MAE5B,UAAAH;AAAA,IAAA;AAAA,EAAA;AAIL,SAAOI,IAAmB,gBAAAG,EAACG,GAAA,EAAgB,UAAAJ,EAAA,CAAQ,IAAoBA;AACzE,GAGaK,IAAe,CAACC,MAA6B;AACxD,QAAMC,IAAaC,EAAA;AAEnB,SAAOD,EAAW,eAChB,gBAAAN,EAACM,EAAW,cAAX,EAAyB,GAAGD,EAAA,CAAO,IAEpC,gBAAAL,EAACR,GAAA,EAAqB,GAAGa,EAAA,CAAO;AAEpC;"}
1
+ {"version":3,"file":"FieldCaption.js","sources":["../../../../src/components/Common/FieldCaption/FieldCaption.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { FieldCaptionProps } from './FieldCaptionTypes'\nimport styles from './FieldCaption.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst DefaultFieldCaption = ({\n children,\n as = 'label',\n htmlFor,\n isRequired = false,\n isVisuallyHidden = false,\n className,\n}: FieldCaptionProps) => {\n const Component = as\n\n const content = (\n <Component\n className={classNames(styles.root, className)}\n htmlFor={as === 'label' ? htmlFor : undefined}\n data-required={isRequired || undefined}\n >\n {children}\n {isRequired ? <span aria-hidden=\"true\" className={styles.requiredIndicator} /> : null}\n </Component>\n )\n\n return isVisuallyHidden ? <VisuallyHidden>{content}</VisuallyHidden> : content\n}\n\n/** @internal */\nexport const FieldCaption = (props: FieldCaptionProps) => {\n const Components = useComponentContext()\n\n return Components.FieldCaption ? (\n <Components.FieldCaption {...props} />\n ) : (\n <DefaultFieldCaption {...props} />\n )\n}\n"],"names":["DefaultFieldCaption","children","as","htmlFor","isRequired","isVisuallyHidden","className","content","jsxs","classNames","styles","jsx","VisuallyHidden","FieldCaption","props","Components","useComponentContext"],"mappings":";;;;;AAMA,MAAMA,IAAsB,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,SAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,kBAAAC,IAAmB;AAAA,EACnB,WAAAC;AACF,MAAyB;AAGvB,QAAMC,IACJ,gBAAAC;AAAA,IAHgBN;AAAA,IAGf;AAAA,MACC,WAAWO,EAAWC,EAAO,MAAMJ,CAAS;AAAA,MAC5C,SAASJ,MAAO,UAAUC,IAAU;AAAA,MACpC,iBAAeC,KAAc;AAAA,MAE5B,UAAA;AAAA,QAAAH;AAAA,QACAG,sBAAc,QAAA,EAAK,eAAY,QAAO,WAAWM,EAAO,mBAAmB,IAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIrF,SAAOL,IAAmB,gBAAAM,EAACC,GAAA,EAAgB,UAAAL,EAAA,CAAQ,IAAoBA;AACzE,GAGaM,IAAe,CAACC,MAA6B;AACxD,QAAMC,IAAaC,EAAA;AAEnB,SAAOD,EAAW,eAChB,gBAAAJ,EAACI,EAAW,cAAX,EAAyB,GAAGD,EAAA,CAAO,IAEpC,gBAAAH,EAACX,GAAA,EAAqB,GAAGc,EAAA,CAAO;AAEpC;"}
@@ -1,8 +1,10 @@
1
- const o = "_root_15825_2", t = {
2
- root: o
1
+ const r = "_root_1jhri_2", o = "_requiredIndicator_1jhri_11", t = {
2
+ root: r,
3
+ requiredIndicator: o
3
4
  };
4
5
  export {
5
6
  t as default,
6
- o as root
7
+ o as requiredIndicator,
8
+ r as root
7
9
  };
8
10
  //# sourceMappingURL=FieldCaption.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldCaption.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"FieldCaption.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,12 +1,12 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { useContractorList as D } from "../shared/useContractorList.js";
4
- import { ManagementContractorListView as N } from "./ManagementContractorListView.js";
5
- import { BaseBoundaries as p, BaseLayout as m } from "../../../Base/Base.js";
6
- import { useI18n as f, useComponentDictionary as E } from "../../../../i18n/I18n.js";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useState as R } from "react";
3
+ import { useContractorList as f } from "../shared/useContractorList.js";
4
+ import { ManagementContractorListView as E } from "./ManagementContractorListView.js";
5
+ import { BaseBoundaries as _, BaseLayout as T } from "../../../Base/Base.js";
6
+ import { useI18n as S, useComponentDictionary as b } from "../../../../i18n/I18n.js";
7
7
  import { componentEvents as o } from "../../../../shared/constants.js";
8
- const _ = (r) => {
9
- switch (r) {
8
+ const M = (e) => {
9
+ switch (e) {
10
10
  case "active":
11
11
  return "active";
12
12
  case "onboarding":
@@ -15,88 +15,91 @@ const _ = (r) => {
15
15
  return "terminated";
16
16
  }
17
17
  };
18
- function S({
19
- companyId: r,
18
+ function w({
19
+ companyId: e,
20
20
  initialTab: i = "active",
21
- onEvent: n,
22
- dictionary: R,
23
- LoaderComponent: s,
24
- className: T
21
+ successMessage: c,
22
+ onEvent: a,
23
+ dictionary: g,
24
+ LoaderComponent: C,
25
+ className: l
25
26
  }) {
26
- f("Contractor.ManagementContractorList"), E("Contractor.ManagementContractorList", R);
27
- const [c, d] = h(i), a = D({
28
- companyId: r,
29
- contractorType: _(c)
27
+ S("Contractor.ManagementContractorList"), b("Contractor.ManagementContractorList", g);
28
+ const [d, O] = R(i), [u, r] = R(c), n = f({
29
+ companyId: e,
30
+ contractorType: M(d)
30
31
  });
31
- if (a.isLoading)
32
- return /* @__PURE__ */ e(
33
- m,
32
+ if (n.isLoading)
33
+ return /* @__PURE__ */ s(
34
+ T,
34
35
  {
35
36
  isLoading: !0,
36
- error: a.errorHandling.errors,
37
- LoaderComponent: s
37
+ error: n.errorHandling.errors,
38
+ LoaderComponent: C
38
39
  }
39
40
  );
40
- const l = (t) => {
41
- n(o.CONTRACTOR_UPDATE, { contractorId: t });
42
- }, O = (t) => {
43
- n(o.CONTRACTOR_VIEW, { contractorId: t });
44
- }, g = () => {
45
- n(o.CONTRACTOR_CREATE);
46
- }, u = (t) => {
47
- n(o.CONTRACTOR_DISMISS, { contractorId: t });
48
- }, A = (t) => {
49
- n(o.CONTRACTOR_REHIRE, { contractorId: t });
41
+ const A = (t) => {
42
+ a(o.CONTRACTOR_UPDATE, { contractorId: t });
50
43
  }, L = (t) => {
51
- d(t);
44
+ a(o.CONTRACTOR_VIEW, { contractorId: t });
45
+ }, h = () => {
46
+ a(o.CONTRACTOR_CREATE);
47
+ }, D = (t) => {
48
+ a(o.CONTRACTOR_DISMISS, { contractorId: t });
49
+ }, N = (t) => {
50
+ a(o.CONTRACTOR_REHIRE, { contractorId: t });
51
+ }, p = (t) => {
52
+ r(void 0), O(t);
52
53
  };
53
- return /* @__PURE__ */ e(m, { error: a.errorHandling.errors, LoaderComponent: s, children: /* @__PURE__ */ e(
54
- N,
54
+ return /* @__PURE__ */ s(T, { error: n.errorHandling.errors, LoaderComponent: C, children: /* @__PURE__ */ s(
55
+ E,
55
56
  {
56
- className: T,
57
- selectedTab: c,
58
- onTabChange: L,
59
- contractors: a.data.contractors,
60
- isFetching: a.status.isFetching,
61
- pagination: a.pagination,
62
- status: a.status,
63
- onEdit: l,
64
- onView: O,
65
- onDismiss: u,
66
- onRehire: A,
57
+ className: l,
58
+ selectedTab: d,
59
+ onTabChange: p,
60
+ successMessage: u,
61
+ contractors: n.data.contractors,
62
+ isFetching: n.status.isFetching,
63
+ pagination: n.pagination,
64
+ status: n.status,
65
+ onEdit: A,
66
+ onView: L,
67
+ onDismiss: D,
68
+ onRehire: N,
67
69
  onDelete: async (t) => {
68
- await a.actions.onDelete(t), n(o.CONTRACTOR_DELETED, { contractorId: t });
70
+ r(void 0), await n.actions.onDelete(t), a(o.CONTRACTOR_DELETED, { contractorId: t });
69
71
  },
70
72
  onCancelSelfOnboarding: async (t) => {
71
- const C = await a.actions.onCancelSelfOnboarding(t);
72
- C && n(o.CONTRACTOR_SELF_ONBOARDING_CANCELLED, C);
73
+ r(void 0);
74
+ const m = await n.actions.onCancelSelfOnboarding(t);
75
+ m && a(o.CONTRACTOR_SELF_ONBOARDING_CANCELLED, m);
73
76
  },
74
77
  onCancelDismissal: async (t) => {
75
- await a.actions.onCancelDismissal(t), n(o.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId: t });
78
+ r(void 0), await n.actions.onCancelDismissal(t), a(o.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId: t });
76
79
  },
77
80
  onCancelRehire: async (t) => {
78
- await a.actions.onCancelRehire(t), n(o.CONTRACTOR_REHIRE_CANCELLED, { contractorId: t });
81
+ r(void 0), await n.actions.onCancelRehire(t), a(o.CONTRACTOR_REHIRE_CANCELLED, { contractorId: t });
79
82
  },
80
- onAddContractor: g
83
+ onAddContractor: h
81
84
  }
82
85
  ) });
83
86
  }
84
- function V({
85
- FallbackComponent: r,
87
+ function j({
88
+ FallbackComponent: e,
86
89
  LoaderComponent: i,
87
- ...n
90
+ ...c
88
91
  }) {
89
- return /* @__PURE__ */ e(
90
- p,
92
+ return /* @__PURE__ */ s(
93
+ _,
91
94
  {
92
95
  componentName: "Contractor.ManagementContractorList",
93
- FallbackComponent: r,
96
+ FallbackComponent: e,
94
97
  LoaderComponent: i,
95
- children: /* @__PURE__ */ e(S, { LoaderComponent: i, ...n })
98
+ children: /* @__PURE__ */ s(w, { LoaderComponent: i, ...c })
96
99
  }
97
100
  );
98
101
  }
99
102
  export {
100
- V as ManagementContractorList
103
+ j as ManagementContractorList
101
104
  };
102
105
  //# sourceMappingURL=ManagementContractorList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManagementContractorList.js","sources":["../../../../../src/components/Contractor/ContractorList/management/ManagementContractorList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useContractorList, type ContractorType } from '../shared/useContractorList'\nimport { ManagementContractorListView } from './ManagementContractorListView'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The tab currently selected on {@link ManagementContractorList}.\n *\n * @public\n */\nexport type ContractorTab = 'active' | 'onboarding' | 'dismissed'\n\n/**\n * Props for {@link ManagementContractorList}.\n *\n * @public\n */\nexport interface ManagementContractorListProps extends BaseComponentInterface<'Contractor.ManagementContractorList'> {\n /** The associated company identifier. */\n companyId: string\n /** Tab to render first: Active, Onboarding, or Dismissed. Defaults to `'active'`. */\n initialTab?: ContractorTab\n}\n\nconst mapTabToContractorType = (tab: ContractorTab): ContractorType => {\n switch (tab) {\n case 'active':\n return 'active'\n case 'onboarding':\n return 'onboarding'\n case 'dismissed':\n return 'terminated'\n }\n}\n\nfunction ManagementContractorListRoot({\n companyId,\n initialTab = 'active',\n onEvent,\n dictionary,\n LoaderComponent,\n className,\n}: ManagementContractorListProps) {\n useI18n('Contractor.ManagementContractorList')\n useComponentDictionary('Contractor.ManagementContractorList', dictionary)\n\n const [selectedTab, setSelectedTab] = useState<ContractorTab>(initialTab)\n\n const contractorList = useContractorList({\n companyId,\n contractorType: mapTabToContractorType(selectedTab),\n })\n\n if (contractorList.isLoading) {\n return (\n <BaseLayout\n isLoading\n error={contractorList.errorHandling.errors}\n LoaderComponent={LoaderComponent}\n />\n )\n }\n\n const handleEdit = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId })\n }\n\n const handleView = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_VIEW, { contractorId })\n }\n\n const handleAddContractor = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleDismiss = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_DISMISS, { contractorId })\n }\n\n const handleRehire = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_REHIRE, { contractorId })\n }\n\n const handleTabChange = (tab: ContractorTab) => {\n setSelectedTab(tab)\n }\n\n return (\n <BaseLayout error={contractorList.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <ManagementContractorListView\n className={className}\n selectedTab={selectedTab}\n onTabChange={handleTabChange}\n contractors={contractorList.data.contractors}\n isFetching={contractorList.status.isFetching}\n pagination={contractorList.pagination}\n status={contractorList.status}\n onEdit={handleEdit}\n onView={handleView}\n onDismiss={handleDismiss}\n onRehire={handleRehire}\n onDelete={async (contractorId: string) => {\n await contractorList.actions.onDelete(contractorId)\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId })\n }}\n onCancelSelfOnboarding={async (contractorId: string) => {\n const onboardingStatus = await contractorList.actions.onCancelSelfOnboarding(contractorId)\n if (!onboardingStatus) return\n onEvent(componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED, onboardingStatus)\n }}\n onCancelDismissal={async (contractorId: string) => {\n await contractorList.actions.onCancelDismissal(contractorId)\n onEvent(componentEvents.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId })\n }}\n onCancelRehire={async (contractorId: string) => {\n await contractorList.actions.onCancelRehire(contractorId)\n onEvent(componentEvents.CONTRACTOR_REHIRE_CANCELLED, { contractorId })\n }}\n onAddContractor={handleAddContractor}\n />\n </BaseLayout>\n )\n}\n\n/**\n * Renders a tabbed list of a company's contractors split across Active, Onboarding, and Dismissed\n * tabs, with per-row actions tailored to each tab (edit, delete, view details, dismiss, rehire,\n * cancel a scheduled dismissal or rehire).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | Fired when the user clicks \"Add contractor\". | — |\n * | `contractor/update` | Fired when the user selects \"Edit\"/\"Review\" on an onboarding-tab row. | `{ contractorId: string }` |\n * | `contractor/view` | Fired when the user selects \"View details\" on an active or dismissed row. | `{ contractorId: string }` |\n * | `contractor/deleted` | Fired after an onboarding-tab row's \"Remove\" action completes. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | Fired after the \"Cancel self-onboarding\" action updates a contractor's onboarding status. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/dismiss` | Fired when the user selects \"Dismiss\" on an active row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/rehire` | Fired when the user selects \"Rehire\" on a dismissed row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/dismissal/cancelled` | Fired after a scheduled dismissal is cancelled via the confirm dialog. | `{ contractorId: string }` |\n * | `contractor/rehire/cancelled` | Fired after a scheduled rehire is cancelled via the confirm dialog. | `{ contractorId: string }` |\n *\n * @public\n */\nexport function ManagementContractorList({\n FallbackComponent,\n LoaderComponent,\n ...props\n}: ManagementContractorListProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.ManagementContractorList\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <ManagementContractorListRoot LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["mapTabToContractorType","tab","ManagementContractorListRoot","companyId","initialTab","onEvent","dictionary","LoaderComponent","className","useI18n","useComponentDictionary","selectedTab","setSelectedTab","useState","contractorList","useContractorList","jsx","BaseLayout","handleEdit","contractorId","componentEvents","handleView","handleAddContractor","handleDismiss","handleRehire","handleTabChange","ManagementContractorListView","onboardingStatus","ManagementContractorList","FallbackComponent","props","BaseBoundaries"],"mappings":";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mC,GAAGuB,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGjF;"}
1
+ {"version":3,"file":"ManagementContractorList.js","sources":["../../../../../src/components/Contractor/ContractorList/management/ManagementContractorList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useContractorList, type ContractorType } from '../shared/useContractorList'\nimport { ManagementContractorListView } from './ManagementContractorListView'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The tab currently selected on {@link ManagementContractorList}.\n *\n * @public\n */\nexport type ContractorTab = 'active' | 'onboarding' | 'dismissed'\n\n/**\n * Props for {@link ManagementContractorList}.\n *\n * @public\n */\nexport interface ManagementContractorListProps extends BaseComponentInterface<'Contractor.ManagementContractorList'> {\n /** The associated company identifier. */\n companyId: string\n /** Tab to render first: Active, Onboarding, or Dismissed. Defaults to `'active'`. */\n initialTab?: ContractorTab\n /** Success message to display in an alert above the list, typically after a dismissal is scheduled. */\n successMessage?: string\n}\n\nconst mapTabToContractorType = (tab: ContractorTab): ContractorType => {\n switch (tab) {\n case 'active':\n return 'active'\n case 'onboarding':\n return 'onboarding'\n case 'dismissed':\n return 'terminated'\n }\n}\n\nfunction ManagementContractorListRoot({\n companyId,\n initialTab = 'active',\n successMessage,\n onEvent,\n dictionary,\n LoaderComponent,\n className,\n}: ManagementContractorListProps) {\n useI18n('Contractor.ManagementContractorList')\n useComponentDictionary('Contractor.ManagementContractorList', dictionary)\n\n const [selectedTab, setSelectedTab] = useState<ContractorTab>(initialTab)\n // Seeded from the prop on mount only — the prop changes only when the owning flow\n // remounts this component on the way back from a sub-flow (e.g. Dismissal), so a fresh\n // mount always starts with the latest message. Cleared locally on any further\n // interaction below so a stale banner doesn't linger past the action it announced.\n const [bannerMessage, setBannerMessage] = useState(successMessage)\n\n const contractorList = useContractorList({\n companyId,\n contractorType: mapTabToContractorType(selectedTab),\n })\n\n if (contractorList.isLoading) {\n return (\n <BaseLayout\n isLoading\n error={contractorList.errorHandling.errors}\n LoaderComponent={LoaderComponent}\n />\n )\n }\n\n const handleEdit = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId })\n }\n\n const handleView = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_VIEW, { contractorId })\n }\n\n const handleAddContractor = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleDismiss = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_DISMISS, { contractorId })\n }\n\n const handleRehire = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_REHIRE, { contractorId })\n }\n\n const handleTabChange = (tab: ContractorTab) => {\n setBannerMessage(undefined)\n setSelectedTab(tab)\n }\n\n return (\n <BaseLayout error={contractorList.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <ManagementContractorListView\n className={className}\n selectedTab={selectedTab}\n onTabChange={handleTabChange}\n successMessage={bannerMessage}\n contractors={contractorList.data.contractors}\n isFetching={contractorList.status.isFetching}\n pagination={contractorList.pagination}\n status={contractorList.status}\n onEdit={handleEdit}\n onView={handleView}\n onDismiss={handleDismiss}\n onRehire={handleRehire}\n onDelete={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onDelete(contractorId)\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId })\n }}\n onCancelSelfOnboarding={async (contractorId: string) => {\n setBannerMessage(undefined)\n const onboardingStatus = await contractorList.actions.onCancelSelfOnboarding(contractorId)\n if (!onboardingStatus) return\n onEvent(componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED, onboardingStatus)\n }}\n onCancelDismissal={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onCancelDismissal(contractorId)\n onEvent(componentEvents.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId })\n }}\n onCancelRehire={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onCancelRehire(contractorId)\n onEvent(componentEvents.CONTRACTOR_REHIRE_CANCELLED, { contractorId })\n }}\n onAddContractor={handleAddContractor}\n />\n </BaseLayout>\n )\n}\n\n/**\n * Renders a tabbed list of a company's contractors split across Active, Onboarding, and Dismissed\n * tabs, with per-row actions tailored to each tab (edit, delete, view details, dismiss, rehire,\n * cancel a scheduled dismissal or rehire).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | Fired when the user clicks \"Add contractor\". | — |\n * | `contractor/update` | Fired when the user selects \"Edit\"/\"Review\" on an onboarding-tab row. | `{ contractorId: string }` |\n * | `contractor/view` | Fired when the user selects \"View details\" on an active or dismissed row. | `{ contractorId: string }` |\n * | `contractor/deleted` | Fired after an onboarding-tab row's \"Remove\" action completes. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | Fired after the \"Cancel self-onboarding\" action updates a contractor's onboarding status. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/dismiss` | Fired when the user selects \"Dismiss\" on an active row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/rehire` | Fired when the user selects \"Rehire\" on a dismissed row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/dismissal/cancelled` | Fired after a scheduled dismissal is cancelled via the confirm dialog. | `{ contractorId: string }` |\n * | `contractor/rehire/cancelled` | Fired after a scheduled rehire is cancelled via the confirm dialog. | `{ contractorId: string }` |\n *\n * @public\n */\nexport function ManagementContractorList({\n FallbackComponent,\n LoaderComponent,\n ...props\n}: ManagementContractorListProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.ManagementContractorList\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <ManagementContractorListRoot LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["mapTabToContractorType","tab","ManagementContractorListRoot","companyId","initialTab","successMessage","onEvent","dictionary","LoaderComponent","className","useI18n","useComponentDictionary","selectedTab","setSelectedTab","useState","bannerMessage","setBannerMessage","contractorList","useContractorList","jsx","BaseLayout","handleEdit","contractorId","componentEvents","handleView","handleAddContractor","handleDismiss","handleRehire","handleTabChange","ManagementContractorListView","onboardingStatus","ManagementContractorList","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;AA4BA,MAAMA,IAAyB,CAACC,MAAuC;AACrE,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,EAAA;AAEb;AAEA,SAASC,EAA6B;AAAA,EACpC,WAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AACF,GAAkC;AAChC,EAAAC,EAAQ,qCAAqC,GAC7CC,EAAuB,uCAAuCJ,CAAU;AAExE,QAAM,CAACK,GAAaC,CAAc,IAAIC,EAAwBV,CAAU,GAKlE,CAACW,GAAeC,CAAgB,IAAIF,EAAST,CAAc,GAE3DY,IAAiBC,EAAkB;AAAA,IACvC,WAAAf;AAAA,IACA,gBAAgBH,EAAuBY,CAAW;AAAA,EAAA,CACnD;AAED,MAAIK,EAAe;AACjB,WACE,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAS;AAAA,QACT,OAAOH,EAAe,cAAc;AAAA,QACpC,iBAAAT;AAAA,MAAA;AAAA,IAAA;AAKN,QAAMa,IAAa,CAACC,MAAyB;AAC3C,IAAAhB,EAAQiB,EAAgB,mBAAmB,EAAE,cAAAD,EAAA,CAAc;AAAA,EAC7D,GAEME,IAAa,CAACF,MAAyB;AAC3C,IAAAhB,EAAQiB,EAAgB,iBAAiB,EAAE,cAAAD,EAAA,CAAc;AAAA,EAC3D,GAEMG,IAAsB,MAAM;AAChC,IAAAnB,EAAQiB,EAAgB,iBAAiB;AAAA,EAC3C,GAEMG,IAAgB,CAACJ,MAAyB;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