Skip to content
Merged
38 changes: 38 additions & 0 deletions .reports/embedded-react-sdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,10 @@ export const componentEvents: {
readonly CONTRACTOR_REHIRE: "contractor/rehire";
readonly CONTRACTOR_DISMISSAL_CANCELLED: "contractor/dismissal/cancelled";
readonly CONTRACTOR_REHIRE_CANCELLED: "contractor/rehire/cancelled";
readonly CONTRACTOR_MANAGEMENT_PROFILE_EDIT_REQUESTED: "contractor/management/profile/editRequested";
readonly CONTRACTOR_MANAGEMENT_PROFILE_UPDATED: "contractor/management/profile/updated";
readonly CONTRACTOR_MANAGEMENT_PROFILE_EDIT_CANCELLED: "contractor/management/profile/editCancelled";
readonly CONTRACTOR_MANAGEMENT_PROFILE_ALERT_DISMISSED: "contractor/management/profile/alertDismissed";
readonly PAY_SCHEDULE_CREATE: "paySchedule/create";
readonly PAY_SCHEDULE_CREATED: "paySchedule/created";
readonly PAY_SCHEDULE_UPDATE: "paySchedule/update";
Expand Down Expand Up @@ -1774,6 +1778,12 @@ declare namespace ContractorManagement {
ManagementContractorList as ContractorList,
ManagementContractorListProps,
ContractorTab,
Profile_3 as Profile,
ProfileCard_2 as ProfileCard,
ProfileEditForm_2 as ProfileEditForm,
ProfileProps_3 as ProfileProps,
ProfileCardProps_2 as ProfileCardProps,
ProfileEditFormProps_2 as ProfileEditFormProps,
PaymentFlow,
PaymentFlowProps,
PaymentsList,
Expand Down Expand Up @@ -4315,15 +4325,27 @@ function Profile(input: ProfileProps): JSX;
// @public
function Profile_2(input: ProfileProps_2): JSX;

// @public
function Profile_3(input: ProfileProps_3): JSX;

// @public
function ProfileCard(props: ProfileCardProps): JSX;

// @public
function ProfileCard_2(props: ProfileCardProps_2): JSX;

// @public
interface ProfileCardProps {
employeeId: string;
onEvent: OnEventType<EventType, unknown>;
}

// @public
interface ProfileCardProps_2 {
contractorId: string;
onEvent: OnEventType<EventType, unknown>;
}

// @public
type ProfileDefaultValues = RequireAtLeastOne<{
employee?: RequireAtLeastOne<{
Expand All @@ -4346,11 +4368,19 @@ type ProfileDefaultValues = RequireAtLeastOne<{
// @public
function ProfileEditForm(input: ProfileEditFormProps): JSX;

// @public
function ProfileEditForm_2(input: ProfileEditFormProps_2): JSX;

// @public
interface ProfileEditFormProps extends BaseComponentInterface<'Employee.Management.Profile'> {
employeeId: string;
}

// @public
interface ProfileEditFormProps_2 extends BaseComponentInterface<'Contractor.Management.Profile'> {
contractorId: string;
}

// @public
interface ProfileProps extends BaseComponentInterface<'Employee.Profile'> {
companyId: string;
Expand All @@ -4365,6 +4395,11 @@ interface ProfileProps_2 extends BaseComponentInterface<'Employee.Management.Pro
employeeId: string;
}

// @public
interface ProfileProps_3 extends BaseComponentInterface<'Contractor.Management.Profile'> {
contractorId: string;
}

// @public
export interface ProgressBarProps {
className?: string;
Expand Down Expand Up @@ -4532,6 +4567,8 @@ export interface Resources {
// (undocumented)
'Contractor.Landing': Translations.ContractorLanding
// (undocumented)
'Contractor.Management.Profile': Translations.ContractorManagementProfile
// (undocumented)
'Contractor.ManagementContractorList': Translations.ContractorManagementContractorList
// (undocumented)
'Contractor.NewHireReport': Translations.ContractorNewHireReport
Expand Down Expand Up @@ -5690,6 +5727,7 @@ export type UseContractorDetailsFormResult = HookLoadingResult | UseContractorDe
// @public
export type UseContractorDetailsFormSharedProps = {
withSelfOnboardingField?: boolean;
showEmailField?: boolean;
optionalFieldsToRequire?: ContractorDetailsOptionalFieldsToRequire;
defaultValues?: Partial<ContractorDetailsFormData>;
validationMode?: UseFormProps['mode'];
Expand Down
50 changes: 50 additions & 0 deletions docs/reference/Translations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,55 @@ Translation keys for the `Contractor.ManagementContractorList` i18n namespace.

***

<a id="contractormanagementprofile"></a>

### ContractorManagementProfile

Translation keys for the `Contractor.Management.Profile` i18n namespace.

#### Properties

| Property | Default value |
| ------ | ------ |
| <a id="property-contractormanagementprofilealerts"></a> `alerts` | |
| `alerts.profileUpdated` | `"Profile updated"` |
| <a id="property-contractormanagementprofileeditcta"></a> `editCta` | `"Edit"` |
| <a id="property-contractormanagementprofileemail"></a> `email` | `"Email"` |
| <a id="property-contractormanagementprofileemployeridentificationnumber"></a> `employerIdentificationNumber` | `"Employer Identification Number (EIN)"` |
| <a id="property-contractormanagementprofileform"></a> `form` | |
| `form.businessName` | `"Business name"` |
| `form.cancelCta` | `"Cancel"` |
| `form.changeCta` | `"Change"` |
| `form.einLabel` | `"Employer Identification Number (EIN)"` |
| `form.einMask` | `"••-•••••••"` |
| `form.email` | `"Email address"` |
| `form.emailDescription` | `"Used to send onboarding and payment notifications."` |
| `form.firstName` | `"First name"` |
| `form.lastName` | `"Last name"` |
| `form.middleInitial` | `"Middle initial"` |
| `form.onFileHint` | `"Already on file."` |
| `form.saveCta` | `"Save"` |
| `form.ssnLabel` | `"Social security number"` |
| `form.ssnMask` | `"•••-••-••••"` |
| `form.startDate` | `"Start date"` |
| `form.successAlert` | `"Profile updated"` |
| `form.title` | `"Basic details"` |
| `form.validations` | |
| `form.validations.businessName` | `"Business name is required"` |
| `form.validations.ein` | `"The EIN must be exactly 9 digits long."` |
| `form.validations.email` | `"Enter a valid email address"` |
| `form.validations.firstName` | `"First name is required"` |
| `form.validations.lastName` | `"Last name is required"` |
| `form.validations.ssn` | `"The SSN must be exactly 9 digits long, cannot contain all zeros in any group, and the first three digits cannot be '666' or in the range 900–999."` |
| `form.validations.startDate` | `"Start date is required"` |
| <a id="property-contractormanagementprofilelegalname"></a> `legalName` | `"Legal name"` |
| <a id="property-contractormanagementprofilelistemptyplaceholder"></a> `listEmptyPlaceholder` | `"No value on file"` |
| <a id="property-contractormanagementprofilesocialsecuritynumber"></a> `socialSecurityNumber` | `"Social security number"` |
| <a id="property-contractormanagementprofilestartdate"></a> `startDate` | `"Start date"` |
| <a id="property-contractormanagementprofiletitle"></a> `title` | `"Basic details"` |

***

<a id="contractornewhirereport"></a>

### ContractorNewHireReport
Expand Down Expand Up @@ -5120,6 +5169,7 @@ yields that namespace's keys. Backs i18next `t()` typing and `ResourceDictionary
| <a id="property-resourcescontractorcontractorlist"></a> `Contractor.ContractorList` | [`ContractorContractorList`](#contractorcontractorlist) |
| <a id="property-resourcescontractordocumentslist"></a> `Contractor.DocumentsList` | [`ContractorDocumentsList`](#contractordocumentslist) |
| <a id="property-resourcescontractorlanding"></a> `Contractor.Landing` | [`ContractorLanding`](#contractorlanding) |
| <a id="property-resourcescontractormanagementprofile"></a> `Contractor.Management.Profile` | [`ContractorManagementProfile`](#contractormanagementprofile) |
| <a id="property-resourcescontractormanagementcontractorlist"></a> `Contractor.ManagementContractorList` | [`ContractorManagementContractorList`](#contractormanagementcontractorlist) |
| <a id="property-resourcescontractornewhirereport"></a> `Contractor.NewHireReport` | [`ContractorNewHireReport`](#contractornewhirereport) |
| <a id="property-resourcescontractoronboardingsummary"></a> `Contractor.OnboardingSummary` | [`ContractorOnboardingSummary`](#contractoronboardingsummary) |
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Individual form and UI components with SDK logic built in — use these for cust
| [ContractorManagement.PaymentsList](contractor/management/blocks#paymentslist) | Displays a list of contractor payment groups for a company. |
| [ContractorManagement.PaymentStatement](contractor/management/blocks#paymentstatement) | Displays a single contractor's payment statement within a payment group, including wage breakdown, bonuses, reimbursements, and a receipt card for funded direct-deposit payments. |
| [ContractorManagement.PaymentSummary](contractor/management/blocks#paymentsummary) | Displays a summary of a created contractor payment group, including payment totals, debit information, contractor details, and wire transfer instructions when required. |
| [ContractorManagement.Profile](contractor/management/blocks#profile) | Management surface for viewing and editing a contractor's basic profile details after onboarding. |
| [ContractorManagement.ProfileCard](contractor/management/blocks#profilecard) | Read-only card showing a contractor's basic profile details with an Edit action. |
| [ContractorManagement.ProfileEditForm](contractor/management/blocks#profileeditform) | Standalone edit form for a contractor's basic profile details. |
| [ContractorOnboarding.Address](contractor/onboarding/blocks#address) | Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type. |
| [ContractorOnboarding.ContractorList](contractor/onboarding/blocks#contractorlist) | Lists a company's contractors with controls to add, edit, delete, cancel self-onboarding, and continue onboarding. |
| [ContractorOnboarding.ContractorProfile](contractor/onboarding/blocks#contractorprofile) | Form for creating or editing a contractor profile, supporting both individual and business contractor types. |
Expand Down Expand Up @@ -253,6 +256,8 @@ shape mixed into every public SDK feature component.
- [`DocumentsListProps`](contractor/onboarding/blocks.md#documentslistprops)
- [`SignatureFormProps`](contractor/onboarding/blocks.md#signatureformprops)
- [`ManagementContractorListProps`](contractor/management/blocks.md#managementcontractorlistprops)
- [`ProfileProps`](contractor/management/blocks.md#profileprops)
- [`ProfileEditFormProps`](contractor/management/blocks.md#profileeditformprops)
- [`PaymentFlowProps`](contractor/management/payment-flow.md#paymentflowprops)
- [`PaymentsListProps`](contractor/management/blocks.md#paymentslistprops)
- [`CreatePaymentProps`](contractor/management/blocks.md#createpaymentprops)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ self-onboarding preference.
Returns a discriminated union: a loading variant while the contractor fetch
resolves, and a ready variant exposing the form's data, pending status,
submit action, error handling, and bound `Fields`. Field visibility is
driven by the current `type` and `wageType` (self-onboarding only toggles the
`Email` field); fields that do not apply are `undefined` on `form.Fields`.
driven by the current `type` and `wageType` (self-onboarding toggles the
`Email` field unless `showEmailField` is set); fields that do not apply are `undefined` on `form.Fields`.
SSN/EIN are exposed by contractor type regardless of self-onboarding — each
consumer decides whether to render them. Self-onboarding is only toggleable
when the contractor's onboarding status allows it.
Expand Down Expand Up @@ -97,6 +97,7 @@ Discriminated by mode: in create mode supply `companyId` and omit
| `defaultValues?` | `Partial`\<[`ContractorDetailsFormData`](#contractordetailsformdata)\> | Initial values applied before any contractor data loads. |
| `optionalFieldsToRequire?` | [`ContractorDetailsOptionalFieldsToRequire`](#contractordetailsoptionalfieldstorequire) | Fields that are optional by default but should be promoted to required for this form instance. |
| `shouldFocusError?` | `boolean` | Whether react-hook-form should focus the first error on validation failure. Defaults to `true`. |
| `showEmailField?` | `boolean` | Whether `form.Fields.Email` is available regardless of the `selfOnboarding` value. **Remarks** By default `Email` is only exposed while `selfOnboarding` is `true`, since email is otherwise only collected to send a self-onboarding invite. Set this to `true` for surfaces that let an admin edit an already-onboarded contractor's email directly. Defaults to `false`. |
| `validationMode?` | `UseFormProps`\[`"mode"`\] | When validation runs. Forwarded to react-hook-form's `mode`. Defaults to `'onSubmit'`. |
| `withSelfOnboardingField?` | `boolean` | Whether to expose the self-onboarding toggle as `form.Fields.SelfOnboarding`. Defaults to `true`. |

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/contractor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Flows and blocks for managing contractors after onboarding — payments, payment
import { ContractorManagement } from '@gusto/embedded-react-sdk'
```

<DocCardList items={[{"type":"link","href":"management/payment-flow","label":"🚂 PaymentFlow","description":"Hub for creating and managing contractor payments for a company."},{"type":"link","href":"management/blocks","label":"🧩 6 blocks"}]} />
<DocCardList items={[{"type":"link","href":"management/payment-flow","label":"🚂 PaymentFlow","description":"Hub for creating and managing contractor payments for a company."},{"type":"link","href":"management/blocks","label":"🧩 9 blocks"}]} />

---

Expand Down
118 changes: 118 additions & 0 deletions docs/reference/contractor/management/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,124 @@ Props for [PaymentSummary](#paymentsummary).

***

<a id="profile"></a>

## Profile

Management surface for viewing and editing a contractor's basic profile details after onboarding.

### Remarks

Drives the read-view card and edit form via an internal state machine.
Emits events on the supplied `onEvent` handler when the user requests an
edit, saves changes, or cancels.

<br />

### ProfileProps

<a id="profileprops"></a>

Props for [Profile](#profile).

| Property | Type | Description |
| ------ | ------ | ------ |
| `contractorId` | `string` | The associated contractor identifier. |
| `onEvent` | [`OnEventType`](../../events.md#oneventtype)\<[`EventType`](../../events.md#eventtype), `unknown`\> | Callback invoked each time the component emits an event — user interactions, successful API responses, step transitions, or errors. Receives the event type constant and an optional payload whose shape varies by event. See the [Event Handling guide](https://docs.gusto.com/embedded-payroll/docs/event-handling) and each component's event table for the full list of emitted events. |
| `dictionary?` | `Record`\<`"en"`, [`DeepPartial`](../../Translations/index.md#deeppartial)\<[`ContractorManagementProfile`](../../Translations/index.md#contractormanagementprofile)\>\> | Overrides for the component's i18n strings. Supply a partial object whose keys match the component's resource namespace — any omitted keys fall back to SDK defaults. See the [Translation guide](https://docs.gusto.com/embedded-payroll/docs/translation) for details. |

_Inherits `children`, `className`, `defaultValues`, `FallbackComponent`, `LoaderComponent` from [BaseComponentInterface](../../blocks.md#basecomponentinterface)._

<br />

### Events

| Event | Description | Data |
| ----- | ----------- | ---- |
| `contractor/management/profile/editRequested` | Fired when the user clicks Edit on the read-view card | `{ contractorId: string }` |
| `contractor/management/profile/updated` | Fired after the profile is successfully saved | [APIModels.Contractor](../../APIModels/index.md#contractor) |
| `contractor/management/profile/editCancelled` | Fired when the user cancels editing | — |

***

<a id="profilecard"></a>

## ProfileCard

Read-only card showing a contractor's basic profile details with an Edit action.

### Remarks

Standalone card that fetches its own data. Emits an event when the user
clicks Edit so the parent can switch to the edit form. The card does not
render success or error alerts itself — alert presentation is the
surrounding surface's responsibility.

<br />

### ProfileCardProps

<a id="profilecardprops"></a>

Props for [ProfileCard](#profilecard).

| Property | Type | Description |
| ------ | ------ | ------ |
| `contractorId` | `string` | The associated contractor identifier. |
| `onEvent` | [`OnEventType`](../../events.md#oneventtype)\<[`EventType`](../../events.md#eventtype), `unknown`\> | Event handler fired when the user requests to edit the profile. |

<br />

### Events

| Event | Description | Data |
| ----- | ----------- | ---- |
| `contractor/management/profile/editRequested` | Fired when the user clicks the Edit button | `{ contractorId: string }` |

***

<a id="profileeditform"></a>

## ProfileEditForm

Standalone edit form for a contractor's basic profile details.

### Remarks

Renders fields for the contractor's name (or business name), start date,
tax ID (SSN or EIN, depending on the contractor's type), and email — all
required on update except tax ID and email — and shows a success alert
when the save completes. An SSN/EIN already on file renders as a locked,
masked value with a "Change" action rather than a blank editable input.
Save and Cancel both emit events so the parent can return to the read view.

<br />

### ProfileEditFormProps

<a id="profileeditformprops"></a>

Props for [ProfileEditForm](#profileeditform).

| Property | Type | Description |
| ------ | ------ | ------ |
| `contractorId` | `string` | The associated contractor identifier. |
| `onEvent` | [`OnEventType`](../../events.md#oneventtype)\<[`EventType`](../../events.md#eventtype), `unknown`\> | Callback invoked each time the component emits an event — user interactions, successful API responses, step transitions, or errors. Receives the event type constant and an optional payload whose shape varies by event. See the [Event Handling guide](https://docs.gusto.com/embedded-payroll/docs/event-handling) and each component's event table for the full list of emitted events. |
| `dictionary?` | `Record`\<`"en"`, [`DeepPartial`](../../Translations/index.md#deeppartial)\<[`ContractorManagementProfile`](../../Translations/index.md#contractormanagementprofile)\>\> | Overrides for the component's i18n strings. Supply a partial object whose keys match the component's resource namespace — any omitted keys fall back to SDK defaults. See the [Translation guide](https://docs.gusto.com/embedded-payroll/docs/translation) for details. |

_Inherits `children`, `className`, `defaultValues`, `FallbackComponent`, `LoaderComponent` from [BaseComponentInterface](../../blocks.md#basecomponentinterface)._

<br />

### Events

| Event | Description | Data |
| ----- | ----------- | ---- |
| `contractor/management/profile/updated` | Fired after the contractor profile is successfully saved | [APIModels.Contractor](../../APIModels/index.md#contractor) |
| `contractor/management/profile/editCancelled` | Fired when the user clicks Cancel | — |

***

## Utility types

<a id="contractortab"></a>
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/contractor/management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ import { ContractorManagement } from '@gusto/embedded-react-sdk'
| [PaymentsList](blocks.md#paymentslist) | Displays a list of contractor payment groups for a company. |
| [PaymentStatement](blocks.md#paymentstatement) | Displays a single contractor's payment statement within a payment group, including wage breakdown, bonuses, reimbursements, and a receipt card for funded direct-deposit payments. |
| [PaymentSummary](blocks.md#paymentsummary) | Displays a summary of a created contractor payment group, including payment totals, debit information, contractor details, and wire transfer instructions when required. |
| [Profile](blocks.md#profile) | Management surface for viewing and editing a contractor's basic profile details after onboarding. |
| [ProfileCard](blocks.md#profilecard) | Read-only card showing a contractor's basic profile details with an Edit action. |
| [ProfileEditForm](blocks.md#profileeditform) | Standalone edit form for a contractor's basic profile details. |
Loading
Loading