Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@
"react-error-boundary": "^6.1.3",
"react-hook-form": "^7.85.0",
"react-i18next": "^17.0.11",
"react-robot": "^1.2.1",
"robot3": "^1.2.0",
"zod": "^4.3.6"
},
"sideEffects": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { agentPaymentsMachine } from './agentPaymentsStateMachine'
import type {
AgentPaymentsFlowProps,
AgentPaymentsFlowContextInterface,
} from './AgentPaymentsFlowComponents'
import { AgentPaymentsListContextual } from './AgentPaymentsFlowComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'

export const AgentPaymentsFlow = ({ companyId, onEvent }: AgentPaymentsFlowProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { transition, reduce, state } from 'robot3'
import {
AgentPaymentsListContextual,
AgentPaymentDetailContextual,
type AgentPaymentsFlowContextInterface,
} from './AgentPaymentsFlowComponents'
import { agentPaymentsEvents } from './events'
import { transition, reduce, state } from '@/lib/state-machine'
import type { MachineTransition } from '@/types/Helpers'

const createReducer = (props: Partial<AgentPaymentsFlowContextInterface>) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { reduce, state, transition } from 'robot3'
import type { ComponentType } from 'react'
import type { ContractorProfileContextInterface } from './ContractorProfileComponents'
import {
Expand All @@ -9,6 +8,7 @@ import {
EditCompensationContextual,
EditBasicDetailsContextual,
} from './ContractorProfileComponents'
import { reduce, state, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineTransition } from '@/types/Helpers'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMemo } from 'react'
import { useOutletContext, useParams } from 'react-router-dom'
import { createMachine } from 'robot3'
import type { EntityIds } from '../../../../useEntities'
import { contractorProfileStateMachine } from './contractorProfileStateMachine'
import type { ContractorProfileContextInterface } from './ContractorProfileComponents'
import { ProfileViewContextual } from './ContractorProfileComponents'
import { createMachine } from '@/lib/state-machine'
import { EmptyData } from '@/components/Common'
import { Flow } from '@/components/Flow/Flow'
import { BaseComponent, useBase } from '@/components/Base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { taxFilingsMachine } from './taxFilingsStateMachine'
import type {
TaxFilingsFlowProps,
TaxFilingsFlowContextInterface,
} from './TaxFilingsFlowComponents'
import { TaxFilingsListContextual } from './TaxFilingsFlowComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'

export const TaxFilingsFlow = ({ companyId, onEvent }: TaxFilingsFlowProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { transition, reduce, state } from 'robot3'
import { taxFilingsEvents } from './events'
import {
TaxFilingsListContextual,
TaxFilingDetailContextual,
type TaxFilingsFlowContextInterface,
} from './TaxFilingsFlowComponents'
import { transition, reduce, state } from '@/lib/state-machine'
import type { MachineTransition } from '@/types/Helpers'

const createReducer = (props: Partial<TaxFilingsFlowContextInterface>) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { guard, reduce, transition } from 'robot3'
import { guard, reduce, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'

type BreadcrumbNavigateEvent<TContext> = {
Expand All @@ -8,9 +8,8 @@ type BreadcrumbNavigateEvent<TContext> = {
}
}

/* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */
/**
* Builds a factory that produces robot3 transitions handling a
* Builds a factory that produces transitions handling a
* `breadcrumb/navigate` event for a given target state.
*
* @remarks
Expand All @@ -22,11 +21,10 @@ type BreadcrumbNavigateEvent<TContext> = {
*
* @typeParam TContext - The state machine context shape.
* @returns A factory `(targetState, canNavigate?) => transition` that emits a
* guarded robot3 transition for the `breadcrumb/navigate` event.
* guarded transition for the `breadcrumb/navigate` event.
* @internal
*/
export const createBreadcrumbNavigateTransition = <TContext>() => {
/* eslint-enable @typescript-eslint/no-unnecessary-type-parameters */
return (targetState: string, canNavigate?: (ctx: TContext) => boolean) =>
transition(
componentEvents.BREADCRUMB_NAVIGATE,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/BankAccount/BankAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'
import {
Expand All @@ -7,6 +6,7 @@ import {
} from './BankAccountComponents'
import { bankAccountStateMachine } from './stateMachine'
import { BankAccountListContextual } from './BankAccountComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import { BaseComponent, type BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/BankAccount/stateMachine.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { state, transition, reduce } from 'robot3'
import type { BankAccountContextInterface, EventPayloads } from './BankAccountComponents'
import {
BankAccountFormContextual,
BankAccountVerifyContextual,
BankAccountListContextual,
} from './BankAccountComponents'
import { state, transition, reduce } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/DocumentSigner/DocumentSigner.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createMachine } from 'robot3'
import { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'
import { useMemo } from 'react'
import { AssignSignatory, DocumentList } from './documentSignerStateMachine'
import { documentSignerMachine } from './stateMachine'
import type { DocumentSignerContextInterface } from './useDocumentSigner'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import { BaseComponent, type BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down Expand Up @@ -47,7 +47,7 @@
}),
),

[companyId], // Only companyId - prevents recreation when signatoryId/doesSignatoryExist change

Check warning on line 50 in src/components/Company/DocumentSigner/DocumentSigner.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useMemo has missing dependencies: 'doesSignatoryExist' and 'signatoryId'. Either include them or remove the dependency array
)
return <Flow machine={documentSigner} onEvent={onEvent} />
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { state, transition, reduce } from 'robot3'
import type { EventPayloads } from './documentSignerStateMachine'
import { DocumentList } from './documentSignerStateMachine'
import type { DocumentSignerContextInterface } from './useDocumentSigner'
import { state, transition, reduce } from '@/lib/state-machine'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'
import { companyEvents } from '@/shared/constants'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/DocumentSigner/stateMachine.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { state, transition, reduce } from 'robot3'
import type { EventPayloads } from './documentSignerStateMachine'
import { SignatureForm, AssignSignatory, DocumentList } from './documentSignerStateMachine'
import { assignSignatoryState } from './assignSignatoryState'
import type { DocumentSignerContextInterface } from './useDocumentSigner'
import { state, transition, reduce } from '@/lib/state-machine'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'
import { companyEvents } from '@/shared/constants'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/Locations/Locations.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { type LocationsContextInterface } from './locationsStateMachine'
import { locationsStateMachine } from './stateMachine'
import { LocationsListContextual } from './locationsStateMachine'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import type { BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/Locations/stateMachine.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { state, transition, reduce } from 'robot3'
import type { LocationsContextInterface, EventPayloads } from './locationsStateMachine'
import { LocationFormContextual, LocationsListContextual } from './locationsStateMachine'
import { state, transition, reduce } from '@/lib/state-machine'
import { companyEvents, componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/OnboardingFlow/OnboardingFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { onboardingMachine } from './onboardingStateMachine'
import type { OnboardingFlowProps } from './OnboardingFlowComponents'
import {
OnboardingOverviewContextual,
type OnboardingFlowContextInterface,
} from './OnboardingFlowComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'

export type { OnboardingFlowProps, OnboardingFlowDefaultValues } from './OnboardingFlowComponents'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { transition, reduce, state } from 'robot3'
import {
BankAccountContextual,
DocumentSignerContextual,
Expand All @@ -11,6 +10,7 @@ import {
StateTaxesContextual,
type OnboardingFlowContextInterface,
} from './OnboardingFlowComponents'
import { transition, reduce, state } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineTransition } from '@/types/Helpers'
import type { FlowHeaderConfig } from '@/components/Flow/useFlow'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/PaySchedule/PaySchedule.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMemo } from 'react'
import { createMachine } from 'robot3'
import { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'
import { payScheduleStateMachine } from './payScheduleStateMachine'
import type { PayScheduleContextInterface } from './PayScheduleComponents'
import { PayScheduleFormContextual, PayScheduleListContextual } from './PayScheduleComponents'
import type { PayScheduleFormData } from './shared/usePayScheduleForm/payScheduleSchema'
import { createMachine } from '@/lib/state-machine'
import type { BaseComponentInterface } from '@/components/Base'
import { BaseComponent, useBase } from '@/components/Base'
import type { BaseComponentKeys } from '@/components/Base/Base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { reduce, state, transition } from 'robot3'
import type { ComponentType } from 'react'
import type { PayScheduleContextInterface } from './PayScheduleComponents'
import { PayScheduleFormContextual, PayScheduleListContextual } from './PayScheduleComponents'
import { reduce, state, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Company/StateTaxes/StateTaxes.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { stateTaxesStateMachine } from './stateTaxesStateMachine'
import type { StateTaxesContextInterface } from './StateTaxesComponents'
import { StateTaxesListContextual } from './StateTaxesComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import type { BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { reduce, state, transition } from 'robot3'
import type { ComponentType } from 'react'
import type { StateTaxesContextInterface } from './StateTaxesComponents'
import {
StateTaxesFormContextual,
StateTaxesListContextual,
TaxRateManagementContextual,
} from './StateTaxesComponents'
import { reduce, state, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Contractor/Address/management/Address.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { CardContextual, type AddressContextInterface } from './AddressComponents'
import { addressStateMachine } from './addressStateMachine'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { reduce, state, transition } from 'robot3'
import type { ComponentType } from 'react'
import type { AddressContextInterface } from './AddressComponents'
import { CardContextual, AddressEditFormContextual } from './AddressComponents'
import { reduce, state, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineTransition } from '@/types/Helpers'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { CardContextual, type CompensationContextInterface } from './CompensationComponents'
import { compensationStateMachine } from './compensationStateMachine'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { reduce, state, transition } from 'robot3'
import type { ComponentType } from 'react'
import type { CompensationContextInterface } from './CompensationComponents'
import { CardContextual, CompensationEditFormContextual } from './CompensationComponents'
import { reduce, state, transition } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineTransition } from '@/types/Helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Contractor/Dashboard/DashboardFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { dashboardStateMachine } from './dashboardStateMachine'
import { type DashboardContextInterface, DashboardViewContextual } from './DashboardComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import type { BaseComponentInterface } from '@/components/Base'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { transition, reduce, state } from 'robot3'
import type { DashboardTab } from './Dashboard'
import {
DashboardViewContextual,
Expand All @@ -8,6 +7,7 @@ import {
CompensationEditFormContextual,
type DashboardContextInterface,
} from './DashboardComponents'
import { transition, reduce, state } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import type { DocumentsListProps } from '../DocumentsList'
import {
DocumentsListContextual,
type DocumentSignerContextInterface,
} from './documentSignerStateMachine'
import { documentSignerMachine } from './stateMachine'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'
import { BaseComponent, type BaseComponentInterface } from '@/components/Base'
import { useComponentDictionary } from '@/i18n/I18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { state, transition, reduce } from 'robot3'
import type { DocumentSignerContextInterface, EventPayloads } from './documentSignerStateMachine'
import { SignatureFormContextual, DocumentsListContextual } from './documentSignerStateMachine'
import { state, transition, reduce } from '@/lib/state-machine'
import { componentEvents } from '@/shared/constants'
import type { MachineEventType, MachineTransition } from '@/types/Helpers'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createMachine } from 'robot3'
import { useMemo } from 'react'
import { onboardingMachine } from './onboardingStateMachine'
import type { OnboardingFlowProps } from './OnboardingFlowComponents'
import {
ContractorListContextual,
type OnboardingFlowContextInterface,
} from './OnboardingFlowComponents'
import { createMachine } from '@/lib/state-machine'
import { Flow } from '@/components/Flow/Flow'

/**
Expand Down
Loading
Loading