@gusto/embedded-react-sdk 0.55.8 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +43 -42
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.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/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/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/EmployeeList/management/ManagementEmployeeListView.js +70 -69
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +2 -2
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +51 -42
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +29 -26
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +2 -2
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +11 -11
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +76 -79
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +2 -2
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +10 -10
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +49 -45
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +83 -76
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +63 -60
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +184 -165
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js +48 -34
- package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +185 -171
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js +45 -34
- package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +44 -44
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +14 -14
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js +16 -16
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js.map +1 -1
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js +52 -37
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +9 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +29 -28
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/apiVersionMismatchHook.js +15 -0
- package/dist/contexts/ApiProvider/apiVersionMismatchHook.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.js +32 -26
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/hooks/usePollingTask/usePollingTask.js +53 -41
- package/dist/hooks/usePollingTask/usePollingTask.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +28 -24
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -10
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +8 -8
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +15 -15
- package/dist/package.json.js +1 -1
- package/dist/src/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
- package/dist/src/components/Common/UI/DatePicker/DatePickerTypes.d.ts +2 -1
- package/dist/src/components/Common/UI/Menu/MenuTypes.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +5 -0
- package/dist/src/components/Common/UI/Select/SelectTypes.d.ts +2 -1
- package/dist/src/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +7 -2
- package/dist/src/components/Employee/EmployeeListFlow/employeeListStateMachine.test.d.ts +1 -0
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +6 -0
- package/dist/src/components/Payroll/PayrollConfiguration/useCalculationPoll.d.ts +6 -1
- package/dist/src/components/Payroll/PayrollOverview/useSubmissionPoll.d.ts +10 -1
- package/dist/src/contexts/ApiProvider/ApiProvider.d.ts +5 -3
- package/dist/src/contexts/ApiProvider/apiVersionMismatchHook.d.ts +3 -0
- package/dist/src/contexts/ApiProvider/apiVersionMismatchHook.test.d.ts +1 -0
- package/dist/src/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +9 -1
- package/dist/src/contexts/ThemeProvider/ThemeProvider.d.ts +8 -3
- package/dist/src/hooks/usePollingTask/usePollingTask.d.ts +55 -14
- package/dist/src/i18n/types.d.ts +14 -0
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +5 -0
- package/package.json +6 -6
|
@@ -45,7 +45,15 @@ export interface GustoBaseProviderProps {
|
|
|
45
45
|
* Also exposed to custom UI components via `useNonce`.
|
|
46
46
|
*/
|
|
47
47
|
nonce?: string;
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Element to use as the portal container for SDK popovers and dropdowns.
|
|
50
|
+
* Defaults to a themed root element the SDK appends to `document.body`.
|
|
51
|
+
*
|
|
52
|
+
* Pass an element here if rendering inside a modal, or **required** if
|
|
53
|
+
* rendering inside a shadow root — `document.body` sits outside every
|
|
54
|
+
* shadow boundary, so without an explicit container overlays would
|
|
55
|
+
* otherwise escape your shadow root's style encapsulation.
|
|
56
|
+
*/
|
|
49
57
|
portalContainer?: HTMLElement;
|
|
50
58
|
/** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */
|
|
51
59
|
queryClient?: QueryClient;
|
|
@@ -6,10 +6,15 @@ export interface ThemeProviderProps {
|
|
|
6
6
|
theme?: Partial<GustoSDKTheme>;
|
|
7
7
|
/**
|
|
8
8
|
* Element to use as the portal container for all SDK overlays (Select, ComboBox,
|
|
9
|
-
* DatePicker, Menu, etc.). Defaults to
|
|
9
|
+
* DatePicker, Menu, etc.). Defaults to a themed root element the SDK appends
|
|
10
|
+
* directly to `document.body`, so overlays are never affected by a host page's
|
|
11
|
+
* `position`, `transform`, `filter`, or `contain` on an intervening ancestor.
|
|
12
|
+
* That default root carries both the `GSDK` and `GSDK-portal-root` classes —
|
|
13
|
+
* the latter lets a host page's own `.GSDK` overrides exclude it
|
|
14
|
+
* (`.GSDK:not(.GSDK-portal-root)`) instead of reaching overlay content.
|
|
10
15
|
*
|
|
11
|
-
* Pass
|
|
12
|
-
*
|
|
16
|
+
* Pass a specific element (e.g. when rendering inside a modal or shadow root)
|
|
17
|
+
* to portal overlays there instead.
|
|
13
18
|
*/
|
|
14
19
|
portalContainer?: HTMLElement;
|
|
15
20
|
/** Subtree rendered inside the SDK's themed root element. */
|
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The outcome of evaluating a single poll tick.
|
|
3
3
|
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* `'done'` (a domain-understood outcome, success or real failure) and `'error'` (the read failed
|
|
6
|
+
* in a way not worth retrying, so the poll never learned what happened) are both terminal but go
|
|
7
|
+
* to different callbacks — `onDone` and `onError` — so callers can't conflate the two.
|
|
8
|
+
*
|
|
4
9
|
* @typeParam TValue - The terminal value handed to `onDone`.
|
|
5
10
|
* @internal
|
|
6
11
|
*/
|
|
7
12
|
export type PollTickResult<TValue> = {
|
|
8
|
-
|
|
13
|
+
status: 'polling';
|
|
14
|
+
} | {
|
|
15
|
+
status: 'done';
|
|
9
16
|
value: TValue;
|
|
10
17
|
} | {
|
|
11
|
-
|
|
18
|
+
status: 'error';
|
|
19
|
+
error: unknown;
|
|
12
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* The result of one poll tick's read — the data it resolved to, or the error it rejected with.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* `lastData` (rejection only) is the most recent successfully-read data, or `null` if none has
|
|
26
|
+
* succeeded yet — the same value `onDeadline` receives, and worth verifying against for the same
|
|
27
|
+
* reason.
|
|
28
|
+
*
|
|
29
|
+
* @typeParam TData - The value a successful read resolves to.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export type PollReadOutcome<TData> = {
|
|
33
|
+
success: true;
|
|
34
|
+
data: TData;
|
|
35
|
+
} | {
|
|
36
|
+
success: false;
|
|
37
|
+
error: unknown;
|
|
38
|
+
lastData: TData | null;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Whether a poll read's error is not worth retrying.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* `SDKValidationError` (also matches `ResponseValidationError`) means the response failed schema
|
|
45
|
+
* validation. A 401/403 means the session that started the poll expired mid-poll (SDK-1291) --
|
|
46
|
+
* neither recovers by retrying. Everything else (network blips, timeouts, transient 5xx) may
|
|
47
|
+
* still succeed on the next tick.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export declare function isNonRetryablePollError(error: unknown): boolean;
|
|
13
52
|
/**
|
|
14
53
|
* Configuration for {@link usePollingTask}.
|
|
15
54
|
*
|
|
@@ -18,16 +57,18 @@ export type PollTickResult<TValue> = {
|
|
|
18
57
|
* @internal
|
|
19
58
|
*/
|
|
20
59
|
export interface UsePollingTaskOptions<TData, TValue> {
|
|
21
|
-
/** Reads the current server state for one tick. Rejections are
|
|
60
|
+
/** Reads the current server state for one tick. Rejections are passed to `evaluate`, not thrown. */
|
|
22
61
|
fetch: (signal: AbortSignal) => Promise<TData>;
|
|
23
62
|
/**
|
|
24
|
-
* Decides whether the operation has reached a terminal state, from
|
|
25
|
-
*
|
|
26
|
-
*
|
|
63
|
+
* Decides whether the operation has reached a terminal state, from this tick's read outcome.
|
|
64
|
+
* Called on every tick, including ones where `fetch` rejected — see {@link PollReadOutcome} and
|
|
65
|
+
* {@link isNonRetryablePollError}.
|
|
27
66
|
*/
|
|
28
|
-
evaluate: (
|
|
29
|
-
/** Called once, from the poll loop, when `evaluate` reports a terminal state. */
|
|
67
|
+
evaluate: (outcome: PollReadOutcome<TData>) => PollTickResult<TValue>;
|
|
68
|
+
/** Called once, from the poll loop, when `evaluate` reports a `'done'` terminal state. */
|
|
30
69
|
onDone: (value: TValue) => void;
|
|
70
|
+
/** Called once, from the poll loop, when `evaluate` reports an `'error'` terminal state. */
|
|
71
|
+
onError: (error: unknown) => void;
|
|
31
72
|
/**
|
|
32
73
|
* Called once when `deadlineMs` elapses without a terminal state, with the most recent data
|
|
33
74
|
* successfully read (or `null` if no read ever succeeded). Verify against that data before
|
|
@@ -79,12 +120,12 @@ export interface PollingTask {
|
|
|
79
120
|
*
|
|
80
121
|
* - `start()` reads immediately, then every `intervalMs` after the previous read settles, so a
|
|
81
122
|
* slow read never stacks up overlapping requests.
|
|
82
|
-
* - A rejected read
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* see the error
|
|
86
|
-
* - A
|
|
87
|
-
* last data read so the caller can verify before declaring failure.
|
|
123
|
+
* - A rejected read isn't thrown; it's handed to `evaluate` as a {@link PollReadOutcome}, since
|
|
124
|
+
* SDK queries are configured with `retry: false`. See {@link PollTickResult} for how `evaluate`
|
|
125
|
+
* routes a read error to `'polling'` (retry) vs `'error'` (give up). When `fetch` reads through
|
|
126
|
+
* a shared query key, observers of that key still see the error even though the task carries on.
|
|
127
|
+
* - A `'done'` or `'error'` result on the deadline tick wins over the deadline, and `onDeadline`
|
|
128
|
+
* receives the last data read so the caller can verify before declaring failure.
|
|
88
129
|
* - Each tick bumps internal state, which gives the calling component a render source
|
|
89
130
|
* independent of any query observer. Fresh cache data is then picked up on that render.
|
|
90
131
|
* - `stop()` and unmount abort the in-flight read and guarantee no further callbacks fire.
|
package/dist/src/i18n/types.d.ts
CHANGED
|
@@ -6121,6 +6121,10 @@ export namespace Translations {
|
|
|
6121
6121
|
statusLabel: string
|
|
6122
6122
|
/** @defaultValue `"Last day"` */
|
|
6123
6123
|
lastDayLabel: string
|
|
6124
|
+
/** @defaultValue `"Pending dismissal"` */
|
|
6125
|
+
pendingDismissalLabel: string
|
|
6126
|
+
/** @defaultValue `"Last day {{date}}"` */
|
|
6127
|
+
pendingDismissalBadge: string
|
|
6124
6128
|
/** @defaultValue `"Edit employee"` */
|
|
6125
6129
|
editCta: string
|
|
6126
6130
|
/** @defaultValue `"Dismiss employee"` */
|
|
@@ -6977,6 +6981,8 @@ export namespace Translations {
|
|
|
6977
6981
|
calculatingCta: string
|
|
6978
6982
|
/** @defaultValue `"Apply"` */
|
|
6979
6983
|
applyCta: string
|
|
6984
|
+
/** @defaultValue `"Calculate a gross amount first to apply it."` */
|
|
6985
|
+
applyHint: string
|
|
6980
6986
|
/** @defaultValue `"Cancel"` */
|
|
6981
6987
|
cancelCta: string
|
|
6982
6988
|
/** @defaultValue `"Calculated gross pay"` */
|
|
@@ -7520,6 +7526,12 @@ export namespace Translations {
|
|
|
7520
7526
|
/** @defaultValue `"{{employeeName}} updated successfully"` */
|
|
7521
7527
|
label: string
|
|
7522
7528
|
}
|
|
7529
|
+
processingFailed: {
|
|
7530
|
+
/** @defaultValue `"This payroll couldn't be calculated"` */
|
|
7531
|
+
label: string
|
|
7532
|
+
/** @defaultValue `"Please try calculating again."` */
|
|
7533
|
+
message: string
|
|
7534
|
+
}
|
|
7523
7535
|
}
|
|
7524
7536
|
/** @defaultValue `"Preparing payroll..."` */
|
|
7525
7537
|
loadingTitle: string
|
|
@@ -7904,6 +7916,8 @@ export namespace Translations {
|
|
|
7904
7916
|
alerts: {
|
|
7905
7917
|
/** @defaultValue `"Payroll is not calculated"` */
|
|
7906
7918
|
payrollNotCalculated: string
|
|
7919
|
+
/** @defaultValue `"There was an issue loading this payroll. Please try again."` */
|
|
7920
|
+
payrollLoadFailed: string
|
|
7907
7921
|
/** @defaultValue `"To pay your employees with direct deposit by {{payDate}}, you'll need to run payroll by {{time}} on {{date}}."` */
|
|
7908
7922
|
directDepositDeadline: string
|
|
7909
7923
|
/** @defaultValue `"Make sure to submit before the deadline to ensure timely payments."` */
|