@gusto/embedded-react-sdk 0.56.4 → 0.56.6
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.
- package/CHANGELOG.md +25 -0
- package/dist/components/Common/DocumentEmbed/DocumentEmbed.js +18 -0
- package/dist/components/Common/DocumentEmbed/DocumentEmbed.js.map +1 -0
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +35 -29
- package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js +39 -0
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js +54 -0
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js +56 -0
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PaySchedule.js +54 -39
- package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +48 -32
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +8 -8
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +74 -32
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -3
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +64 -61
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +133 -134
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlow.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js +22 -9
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js +51 -20
- package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js.map +1 -1
- package/dist/components/Contractor/Dismissal/Dismissal.js +77 -0
- package/dist/components/Contractor/Dismissal/Dismissal.js.map +1 -0
- package/dist/components/Contractor/Dismissal/DismissalPresentation.js +57 -0
- package/dist/components/Contractor/Dismissal/DismissalPresentation.js.map +1 -0
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js +44 -0
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +17 -14
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +45 -41
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.js +56 -54
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +27 -16
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +25 -17
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +6 -5
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +201 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +55 -52
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js +38 -29
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +63 -62
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +25 -18
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +72 -68
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/i18n/I18n.js +2 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js +22 -0
- package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Dismissal.json.js +20 -0
- package/dist/i18n/en/Contractor.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +38 -38
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +31 -31
- package/dist/i18n/en/common.json.js +37 -35
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +19 -15
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/DocumentEmbed/DocumentEmbed.d.ts +3 -0
- package/dist/src/components/Common/DocumentEmbed/DocumentEmbedTypes.d.ts +25 -0
- package/dist/src/components/Common/DocumentEmbed/index.d.ts +2 -0
- package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.d.ts +17 -0
- package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.d.ts +22 -0
- package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +17 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +2 -0
- package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -1
- package/dist/src/components/Company/exports/companyManagement.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +2 -0
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +3 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +6 -4
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -0
- package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.d.ts +1 -0
- package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.test.d.ts +1 -0
- package/dist/src/components/Contractor/Dismissal/Dismissal.d.ts +45 -0
- package/dist/src/components/Contractor/Dismissal/DismissalPresentation.d.ts +17 -0
- package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.d.ts +41 -0
- package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.test.d.ts +1 -0
- package/dist/src/components/Contractor/exports/contractorManagement.d.ts +1 -0
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +6 -0
- package/dist/src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.test.d.ts +1 -0
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.d.ts +19 -0
- package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/src/contexts/ComponentAdapter/useComponentContext.d.ts +5 -2
- package/dist/src/i18n/en/common.json.d.ts +3 -0
- package/dist/src/i18n/types.d.ts +128 -0
- package/dist/src/shared/constants.d.ts +8 -0
- package/docs/guides/endpoint-inventory.json +30 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.56.6](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.5...v0.56.6) (2026-10-12)
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Add the alpha `AutoPilotDialog` to `CompanyManagement.PaySchedule`'s overview, letting a company toggle AutoPilot for its pay schedule and see any blocking eligibility issues inline. Gated behind the `managePaySchedules` unstable feature flag ([#2871](https://github.com/Gusto/embedded-react-sdk/issues/2871))
|
|
8
|
+
- Add `isSelfOnboardingEnabled` and `withEmployeeI9` props to `EmployeeListFlow`, matching the options already available on the standalone onboarding flow ([#2885](https://github.com/Gusto/embedded-react-sdk/issues/2885))
|
|
9
|
+
|
|
10
|
+
### Fixes
|
|
11
|
+
|
|
12
|
+
- Stop stale alerts from persisting across payroll run screens after transitioning between states ([#2879](https://github.com/Gusto/embedded-react-sdk/issues/2879))
|
|
13
|
+
- Stop stale alerts from reappearing in the contractor payment information-request round-trip and on the wire-confirmation screen ([#2882](https://github.com/Gusto/embedded-react-sdk/issues/2882))
|
|
14
|
+
|
|
15
|
+
## [0.56.5](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.4...v0.56.5) (2026-10-07)
|
|
16
|
+
|
|
17
|
+
### Features & Enhancements
|
|
18
|
+
|
|
19
|
+
- 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))
|
|
20
|
+
- 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))
|
|
21
|
+
|
|
22
|
+
### Fixes
|
|
23
|
+
|
|
24
|
+
- 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))
|
|
25
|
+
- 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))
|
|
26
|
+
- 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))
|
|
27
|
+
|
|
3
28
|
## [0.56.4](https://github.com/Gusto/embedded-react-sdk/compare/v0.56.3...v0.56.4) (2026-10-02)
|
|
4
29
|
|
|
5
30
|
### Fixes
|
|
@@ -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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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:
|
|
14
|
+
headingLevel: f = "h3"
|
|
13
15
|
}) {
|
|
14
|
-
const
|
|
15
|
-
ref:
|
|
16
|
+
const r = b(), { t: p } = x("common"), m = u(null), h = N({
|
|
17
|
+
ref: m
|
|
16
18
|
}).includes("small");
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
37
|
+
r.Link,
|
|
32
38
|
{
|
|
33
39
|
className: "react-aria-Button",
|
|
34
40
|
"data-variant": "secondary",
|
|
35
|
-
href:
|
|
41
|
+
href: n,
|
|
36
42
|
target: "_blank",
|
|
37
43
|
rel: "noopener noreferrer",
|
|
38
|
-
download: `${
|
|
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
|
-
|
|
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
|
|
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;"}
|
|
@@ -11,10 +11,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [s, u] = t("CreateSignatoryContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
u as CreateSignatoryProvider,
|
|
19
|
+
s as useCreateSignatory
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=useCreateSignatory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/**\n * Initial values for the {@link CreateSignatory} form fields. At least one field must be provided.\n *\n * @public\n */\nexport type CreateSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title' | 'phone' | 'birthday'> &\n Pick<\n NonNullable<Signatory['homeAddress']>,\n 'street1' | 'street2' | 'city' | 'state' | 'zip'\n > & {\n ssn?: string\n }\n>\ntype CreateSignatoryContextType = {\n isPending: boolean\n currentSignatory?: Signatory\n}\n\nconst [useCreateSignatory, CreateSignatoryProvider] =\n createCompoundContext<CreateSignatoryContextType>('CreateSignatoryContext')\n\nexport {\n /** @internal */\n useCreateSignatory,\n /** @internal */\n CreateSignatoryProvider,\n}\n"],"names":["useCreateSignatory","CreateSignatoryProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCreateSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/**\n * Initial values for the {@link CreateSignatory} form fields. At least one field must be provided.\n *\n * @public\n */\nexport type CreateSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title' | 'phone' | 'birthday'> &\n Pick<\n NonNullable<Signatory['homeAddress']>,\n 'street1' | 'street2' | 'city' | 'state' | 'zip'\n > & {\n ssn?: string\n }\n>\ntype CreateSignatoryContextType = {\n isPending: boolean\n currentSignatory?: Signatory\n}\n\nconst [useCreateSignatory, CreateSignatoryProvider] =\n createCompoundContext<CreateSignatoryContextType>('CreateSignatoryContext')\n\nexport {\n /** @internal */\n useCreateSignatory,\n /** @internal */\n CreateSignatoryProvider,\n}\n"],"names":["useCreateSignatory","CreateSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
|
|
@@ -11,10 +11,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [c, d] = t("InviteSignatoryContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
d as InviteSignatoryProvider,
|
|
19
|
+
c as useInviteSignatory
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=useInviteSignatory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\ntype InviteSignatoryContextType = {\n isPending: boolean\n}\n\n/**\n * Default values for the invite signatory form fields: `firstName`, `lastName`, `email`,\n * `confirmEmail`, and `title`. At least one field is required.\n *\n * @public\n */\nexport type InviteSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title'> & {\n confirmEmail: string\n }\n>\n\nconst [useInviteSignatory, InviteSignatoryProvider] =\n createCompoundContext<InviteSignatoryContextType>('InviteSignatoryContext')\n\nexport { useInviteSignatory, InviteSignatoryProvider }\n"],"names":["useInviteSignatory","InviteSignatoryProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\ntype InviteSignatoryContextType = {\n isPending: boolean\n}\n\n/**\n * Default values for the invite signatory form fields: `firstName`, `lastName`, `email`,\n * `confirmEmail`, and `title`. At least one field is required.\n *\n * @public\n */\nexport type InviteSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title'> & {\n confirmEmail: string\n }\n>\n\nconst [useInviteSignatory, InviteSignatoryProvider] =\n createCompoundContext<InviteSignatoryContextType>('InviteSignatoryContext')\n\nexport { useInviteSignatory, InviteSignatoryProvider }\n"],"names":["useInviteSignatory","InviteSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
|
|
@@ -11,14 +11,15 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const
|
|
16
|
+
const v = {
|
|
16
17
|
createSignatory: "createSignatory",
|
|
17
18
|
inviteSignatory: "inviteSignatory"
|
|
18
|
-
}, [
|
|
19
|
+
}, [x, C] = t("AssignSignatoryContext");
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
C as AssignSignatoryProvider,
|
|
22
|
+
v as SignatoryAssignmentMode,
|
|
23
|
+
x as useAssignSignatory
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=useAssignSignatory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\n/**\n * Default values for the create and invite forms rendered by {@link AssignSignatory}.\n *\n * @remarks\n * At least one of `create` or `invite` must be provided.\n *\n * @public\n */\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\n/**\n * Default values for the create and invite forms rendered by {@link AssignSignatory}.\n *\n * @remarks\n * At least one of `create` or `invite` must be provided.\n *\n * @public\n */\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAOO,MAAMA,IAA0B;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAuBM,CAACC,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
|
|
@@ -11,10 +11,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [d, s] = o("BankAccountContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
s as BankAccountFormProvider,
|
|
19
|
+
d as useBankAccountForm
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport { type OnEventType } from '@/components/Base/useBase'\nimport { type EventType } from '@/shared/constants'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n isEditing: boolean\n onEvent: OnEventType<EventType, unknown>\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport { type OnEventType } from '@/components/Base/useBase'\nimport { type EventType } from '@/shared/constants'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n isEditing: boolean\n onEvent: OnEventType<EventType, unknown>\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,oBAAoB;"}
|
|
@@ -11,12 +11,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [d, f] = t(
|
|
16
17
|
"CompanyDocumentListContext"
|
|
17
18
|
);
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
f as DocumentListProvider,
|
|
21
|
+
d as useDocumentList
|
|
21
22
|
};
|
|
22
23
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -13,18 +13,19 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
13
13
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
14
14
|
import "../../../shared/constants.js";
|
|
15
15
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
16
17
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
17
|
-
const
|
|
18
|
+
const b = o.object({
|
|
18
19
|
federalEin: o.string().optional(),
|
|
19
20
|
taxPayerType: o.enum(Object.values(e)).optional(),
|
|
20
21
|
filingForm: o.enum(Object.values(r)).optional(),
|
|
21
22
|
legalName: o.string().min(1)
|
|
22
|
-
}), [
|
|
23
|
+
}), [j, v] = t(
|
|
23
24
|
"CompanyFederalTaxesContext"
|
|
24
25
|
);
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
b as FederalTaxFormSchema,
|
|
28
|
+
v as FederalTaxesProvider,
|
|
29
|
+
j as useFederalTaxes
|
|
29
30
|
};
|
|
30
31
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { FilingForm, TaxPayerType } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\n/** @internal */\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\n/**\n * Pre-populated values for the company federal tax form, supplied via {@link FederalTaxesProps}.\n * At least one of `taxPayerType`, `filingForm`, or `legalName` must be provided.\n *\n * @public\n */\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { FilingForm, TaxPayerType } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\n/** @internal */\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\n/**\n * Pre-populated values for the company federal tax form, supplied via {@link FederalTaxesProps}.\n * At least one of `taxPayerType`, `filingForm`, or `legalName` must be provided.\n *\n * @public\n */\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAOO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAsBK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -11,16 +11,17 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [P, f] = t("IndustryItems", {
|
|
16
17
|
items: []
|
|
17
|
-
}), [
|
|
18
|
+
}), [v, x] = t("IndustryApi", {
|
|
18
19
|
isPending: !1
|
|
19
20
|
});
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
x as IndustryApiStateProvider,
|
|
23
|
+
f as IndustryItemsProvider,
|
|
24
|
+
v as useIndustryApiState,
|
|
25
|
+
P as useIndustryItems
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
|
|
@@ -11,12 +11,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [L, f] = o(
|
|
16
17
|
"CompanyDocumentFormContext"
|
|
17
18
|
);
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
f as LocationsFormProvider,
|
|
21
|
+
L as useLocationsForm
|
|
21
22
|
};
|
|
22
23
|
//# sourceMappingURL=useLocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -11,12 +11,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [f, v] = o(
|
|
16
17
|
"CompanyDocumentListContext"
|
|
17
18
|
);
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
v as LocationsListProvider,
|
|
21
|
+
f as useLocationsList
|
|
21
22
|
};
|
|
22
23
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n isFetching?: boolean\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n isFetching?: boolean\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -11,10 +11,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [C, c] = o("OnboardingOverviewContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
c as OnboardingOverviewProvider,
|
|
19
|
+
C as useOnboardingOverview
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { AutoPilotDialogPresentation as d } from "./AutoPilotDialogPresentation.js";
|
|
3
|
+
import { useAutoPilotDialog as f } from "./useAutoPilotDialog.js";
|
|
4
|
+
function E({ companyId: e, schedule: o, onEvent: r }) {
|
|
5
|
+
const {
|
|
6
|
+
nextEnabled: t,
|
|
7
|
+
setNextEnabled: i,
|
|
8
|
+
blockers: n,
|
|
9
|
+
isEnableBlocked: a,
|
|
10
|
+
isLoadingBlockers: s,
|
|
11
|
+
isSaving: l,
|
|
12
|
+
hasGenericError: m,
|
|
13
|
+
errorMessage: g,
|
|
14
|
+
onSave: c,
|
|
15
|
+
onClose: u
|
|
16
|
+
} = f({ companyId: e, schedule: o, onEvent: r });
|
|
17
|
+
return /* @__PURE__ */ b(
|
|
18
|
+
d,
|
|
19
|
+
{
|
|
20
|
+
scheduleName: o.customName ?? o.name ?? "",
|
|
21
|
+
blockers: n,
|
|
22
|
+
isEnableBlocked: a,
|
|
23
|
+
isLoadingBlockers: s,
|
|
24
|
+
nextEnabled: t,
|
|
25
|
+
isSaving: l,
|
|
26
|
+
hasGenericError: m,
|
|
27
|
+
errorMessage: g,
|
|
28
|
+
onToggle: i,
|
|
29
|
+
onSave: () => {
|
|
30
|
+
c();
|
|
31
|
+
},
|
|
32
|
+
onClose: u
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
E as AutoPilotDialog
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=AutoPilotDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoPilotDialog.js","sources":["../../../../../../src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.tsx"],"sourcesContent":["import type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { AutoPilotDialogPresentation } from './AutoPilotDialogPresentation'\nimport { useAutoPilotDialog } from './useAutoPilotDialog'\nimport type { EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\ninterface AutoPilotDialogProps {\n companyId: string\n schedule: PayScheduleShow\n onEvent: OnEventType<EventType, unknown>\n}\n\n/** @internal */\nexport function AutoPilotDialog({ companyId, schedule, onEvent }: AutoPilotDialogProps) {\n const {\n nextEnabled,\n setNextEnabled,\n blockers,\n isEnableBlocked,\n isLoadingBlockers,\n isSaving,\n hasGenericError,\n errorMessage,\n onSave,\n onClose,\n } = useAutoPilotDialog({ companyId, schedule, onEvent })\n\n return (\n <AutoPilotDialogPresentation\n scheduleName={schedule.customName ?? schedule.name ?? ''}\n blockers={blockers}\n isEnableBlocked={isEnableBlocked}\n isLoadingBlockers={isLoadingBlockers}\n nextEnabled={nextEnabled}\n isSaving={isSaving}\n hasGenericError={hasGenericError}\n errorMessage={errorMessage}\n onToggle={setNextEnabled}\n onSave={() => void onSave()}\n onClose={onClose}\n />\n )\n}\n"],"names":["AutoPilotDialog","companyId","schedule","onEvent","nextEnabled","setNextEnabled","blockers","isEnableBlocked","isLoadingBlockers","isSaving","hasGenericError","errorMessage","onSave","onClose","useAutoPilotDialog","jsx","AutoPilotDialogPresentation"],"mappings":";;;AAaO,SAASA,EAAgB,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAC,KAAiC;AACtF,QAAM;AAAA,IACJ,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAmB,EAAE,WAAAb,GAAW,UAAAC,GAAU,SAAAC,GAAS;AAEvD,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,cAAcd,EAAS,cAAcA,EAAS,QAAQ;AAAA,MACtD,UAAAI;AAAA,MACA,iBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAJ;AAAA,MACA,UAAAK;AAAA,MACA,iBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAUN;AAAA,MACV,QAAQ,MAAA;AAAM,QAAKO,EAAA;AAAA;AAAA,MACnB,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import { useComponentContext as A } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
import { Flex as r } from "../../../../Common/Flex/Flex.js";
|
|
5
|
+
function P({
|
|
6
|
+
scheduleName: c,
|
|
7
|
+
blockers: s,
|
|
8
|
+
isEnableBlocked: o,
|
|
9
|
+
isLoadingBlockers: p,
|
|
10
|
+
nextEnabled: u,
|
|
11
|
+
isSaving: d,
|
|
12
|
+
hasGenericError: m,
|
|
13
|
+
errorMessage: g,
|
|
14
|
+
onToggle: h,
|
|
15
|
+
onSave: b,
|
|
16
|
+
onClose: x
|
|
17
|
+
}) {
|
|
18
|
+
const { t: e } = f("Company.Management.AutoPilotDialog"), t = A(), n = s.map((l) => l.key).filter((l) => !!l);
|
|
19
|
+
return /* @__PURE__ */ i(
|
|
20
|
+
t.Dialog,
|
|
21
|
+
{
|
|
22
|
+
isOpen: !0,
|
|
23
|
+
onClose: x,
|
|
24
|
+
onPrimaryActionClick: b,
|
|
25
|
+
title: e("title", { scheduleName: c }),
|
|
26
|
+
primaryActionLabel: e("saveCta"),
|
|
27
|
+
closeActionLabel: e("cancelCta"),
|
|
28
|
+
isPrimaryActionLoading: d,
|
|
29
|
+
children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 16, children: [
|
|
30
|
+
/* @__PURE__ */ i(t.Text, { children: e("description") }),
|
|
31
|
+
/* @__PURE__ */ i(
|
|
32
|
+
t.Switch,
|
|
33
|
+
{
|
|
34
|
+
label: e("toggleLabel"),
|
|
35
|
+
value: u,
|
|
36
|
+
onChange: h,
|
|
37
|
+
isDisabled: o
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
p ? /* @__PURE__ */ i(t.Text, { variant: "supporting", children: e("checkingEligibility") }) : o ? /* @__PURE__ */ i(t.Alert, { status: "error", label: e("blockers.heading"), disableScrollIntoView: !0, children: /* @__PURE__ */ i(r, { flexDirection: "column", gap: 12, children: (n.length > 0 ? n : ["generic"]).map((l) => /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, children: [
|
|
41
|
+
/* @__PURE__ */ i(t.Text, { weight: "semibold", children: e(`blockers.${l}.title`, { defaultValue: e("blockers.generic.title") }) }),
|
|
42
|
+
/* @__PURE__ */ i(t.Text, { variant: "supporting", children: e(`blockers.${l}.description`, {
|
|
43
|
+
defaultValue: e("blockers.generic.description")
|
|
44
|
+
}) })
|
|
45
|
+
] }, l)) }) }) : null,
|
|
46
|
+
m ? /* @__PURE__ */ i(t.Alert, { status: "error", label: e("saveError.title"), disableScrollIntoView: !0, children: g ?? e("saveError.description") }) : null
|
|
47
|
+
] })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
P as AutoPilotDialogPresentation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=AutoPilotDialogPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoPilotDialogPresentation.js","sources":["../../../../../../src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleAutoPayrollEnablementBlocker } from '@gusto/embedded-api/models/components/payscheduleautopayrollenablementblocker'\nimport { Flex } from '@/components/Common/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport interface AutoPilotDialogPresentationProps {\n scheduleName: string\n blockers: PayScheduleAutoPayrollEnablementBlocker[]\n isEnableBlocked: boolean\n isLoadingBlockers: boolean\n nextEnabled: boolean\n isSaving: boolean\n hasGenericError: boolean\n errorMessage?: string\n onToggle: (enabled: boolean) => void\n onSave: () => void\n onClose: () => void\n}\n\n/** @internal */\nexport function AutoPilotDialogPresentation({\n scheduleName,\n blockers,\n isEnableBlocked,\n isLoadingBlockers,\n nextEnabled,\n isSaving,\n hasGenericError,\n errorMessage,\n onToggle,\n onSave,\n onClose,\n}: AutoPilotDialogPresentationProps) {\n const { t } = useTranslation('Company.Management.AutoPilotDialog')\n const Components = useComponentContext()\n const namedBlockers = blockers\n .map(blocker => blocker.key)\n .filter((key): key is string => Boolean(key))\n\n return (\n <Components.Dialog\n isOpen\n onClose={onClose}\n onPrimaryActionClick={onSave}\n title={t('title', { scheduleName })}\n primaryActionLabel={t('saveCta')}\n closeActionLabel={t('cancelCta')}\n isPrimaryActionLoading={isSaving}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Text>{t('description')}</Components.Text>\n <Components.Switch\n label={t('toggleLabel')}\n value={nextEnabled}\n onChange={onToggle}\n isDisabled={isEnableBlocked}\n />\n {isLoadingBlockers ? (\n <Components.Text variant=\"supporting\">{t('checkingEligibility')}</Components.Text>\n ) : isEnableBlocked ? (\n <Components.Alert status=\"error\" label={t('blockers.heading')} disableScrollIntoView>\n <Flex flexDirection=\"column\" gap={12}>\n {/* Blockers without a recognized key can't be labeled individually and would\n collide on a shared 'generic' React key, so drop them and fall back to a\n single generic entry if nothing named is left to show. */}\n {(namedBlockers.length > 0 ? namedBlockers : ['generic']).map(key => (\n <Flex key={key} flexDirection=\"column\" gap={4}>\n <Components.Text weight=\"semibold\">\n {t(`blockers.${key}.title`, { defaultValue: t('blockers.generic.title') })}\n </Components.Text>\n <Components.Text variant=\"supporting\">\n {t(`blockers.${key}.description`, {\n defaultValue: t('blockers.generic.description'),\n })}\n </Components.Text>\n </Flex>\n ))}\n </Flex>\n </Components.Alert>\n ) : null}\n {hasGenericError ? (\n <Components.Alert status=\"error\" label={t('saveError.title')} disableScrollIntoView>\n {errorMessage ?? t('saveError.description')}\n </Components.Alert>\n ) : null}\n </Flex>\n </Components.Dialog>\n )\n}\n"],"names":["AutoPilotDialogPresentation","scheduleName","blockers","isEnableBlocked","isLoadingBlockers","nextEnabled","isSaving","hasGenericError","errorMessage","onToggle","onSave","onClose","t","useTranslation","Components","useComponentContext","namedBlockers","blocker","key","jsx","jsxs","Flex"],"mappings":";;;;AAqBO,SAASA,EAA4B;AAAA,EAC1C,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AACF,GAAqC;AACnC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAaC,EAAA,GACbC,IAAgBd,EACnB,IAAI,CAAAe,MAAWA,EAAQ,GAAG,EAC1B,OAAO,CAACC,MAAuB,EAAQA,CAAI;AAE9C,SACE,gBAAAC;AAAA,IAACL,EAAW;AAAA,IAAX;AAAA,MACC,QAAM;AAAA,MACN,SAAAH;AAAA,MACA,sBAAsBD;AAAA,MACtB,OAAOE,EAAE,SAAS,EAAE,cAAAX,GAAc;AAAA,MAClC,oBAAoBW,EAAE,SAAS;AAAA,MAC/B,kBAAkBA,EAAE,WAAW;AAAA,MAC/B,wBAAwBN;AAAA,MAExB,UAAA,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACL,EAAW,MAAX,EAAiB,UAAAF,EAAE,aAAa,GAAE;AAAA,QACnC,gBAAAO;AAAA,UAACL,EAAW;AAAA,UAAX;AAAA,YACC,OAAOF,EAAE,aAAa;AAAA,YACtB,OAAOP;AAAA,YACP,UAAUI;AAAA,YACV,YAAYN;AAAA,UAAA;AAAA,QAAA;AAAA,QAEbC,sBACEU,EAAW,MAAX,EAAgB,SAAQ,cAAc,YAAE,qBAAqB,GAAE,IAC9DX,IACF,gBAAAgB,EAACL,EAAW,OAAX,EAAiB,QAAO,SAAQ,OAAOF,EAAE,kBAAkB,GAAG,uBAAqB,IAClF,UAAA,gBAAAO,EAACE,KAAK,eAAc,UAAS,KAAK,IAI9B,WAAAL,EAAc,SAAS,IAAIA,IAAgB,CAAC,SAAS,GAAG,IAAI,CAAAE,MAC5D,gBAAAE,EAACC,KAAe,eAAc,UAAS,KAAK,GAC1C,UAAA;AAAA,UAAA,gBAAAF,EAACL,EAAW,MAAX,EAAgB,QAAO,YACrB,UAAAF,EAAE,YAAYM,CAAG,UAAU,EAAE,cAAcN,EAAE,wBAAwB,EAAA,CAAG,GAC3E;AAAA,UACA,gBAAAO,EAACL,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAAF,EAAE,YAAYM,CAAG,gBAAgB;AAAA,YAChC,cAAcN,EAAE,8BAA8B;AAAA,UAAA,CAC/C,EAAA,CACH;AAAA,QAAA,EAAA,GARSM,CASX,CACD,GACH,EAAA,CACF,IACE;AAAA,QACHX,IACC,gBAAAY,EAACL,EAAW,OAAX,EAAiB,QAAO,SAAQ,OAAOF,EAAE,iBAAiB,GAAG,uBAAqB,IAChF,eAAgBA,EAAE,uBAAuB,GAC5C,IACE;AAAA,MAAA,EAAA,CACN;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|