@npm-zenwork/tax-remittance-ui 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bankAccounts.d.ts +9 -7
- package/dist/api/entities.d.ts +10 -7
- package/dist/api/remittancePayments.d.ts +2 -0
- package/dist/components/dashboard/AddFirstPaymentModal.d.ts +12 -0
- package/dist/components/dashboard/SetupChecklist.d.ts +22 -0
- package/dist/components/dashboard/useSetupProgress.d.ts +25 -0
- package/dist/components/entities/EntityActionsMenu.d.ts +3 -1
- package/dist/components/entities/EntityCard.d.ts +8 -0
- package/dist/components/entities/EntityTypeFilter.d.ts +8 -0
- package/dist/components/entities/entityListUtils.d.ts +6 -0
- package/dist/components/forms/SegmentedControl.d.ts +5 -1
- package/dist/components/icons/BankIcon.d.ts +1 -0
- package/dist/components/icons/BusinessIcon.d.ts +1 -0
- package/dist/components/icons/CheckCircleIcon.d.ts +1 -0
- package/dist/components/icons/EmptyTaxAccountsIllustration.d.ts +5 -0
- package/dist/components/icons/EntitySuccessIllustration.d.ts +2 -0
- package/dist/components/icons/EyeIcon.d.ts +1 -0
- package/dist/components/icons/EyeOffIcon.d.ts +1 -0
- package/dist/components/icons/IndividualEntitySuccessIllustration.d.ts +2 -0
- package/dist/components/icons/PersonIcon.d.ts +1 -0
- package/dist/components/icons/XCircleIcon.d.ts +1 -0
- package/dist/components/onboarding/EntityAccountTypeRow.d.ts +14 -0
- package/dist/components/onboarding/EntityAddressFields.d.ts +17 -0
- package/dist/components/onboarding/EntityBusinessFields.d.ts +19 -0
- package/dist/components/onboarding/EntityCreatedModal.d.ts +14 -0
- package/dist/components/onboarding/EntityForm.d.ts +5 -0
- package/dist/components/onboarding/EntityFormHelpPanel.d.ts +8 -0
- package/dist/components/onboarding/EntityIdNumberInput.d.ts +14 -0
- package/dist/components/onboarding/EntityPhoneField.d.ts +10 -0
- package/dist/components/onboarding/EntityPrimaryTaxpayerFields.d.ts +17 -0
- package/dist/components/onboarding/EntitySuccessModal.d.ts +35 -0
- package/dist/components/onboarding/SecondaryTaxpayerSection.d.ts +21 -0
- package/dist/components/onboarding/entityHelpContent.d.ts +123 -0
- package/dist/components/onboarding/useEntityForm.d.ts +78 -0
- package/dist/components/payments/BankAccountCard.d.ts +16 -0
- package/dist/components/payments/BankAccountDrawer.d.ts +15 -0
- package/dist/components/payments/BankConnectionMethodModal.d.ts +11 -0
- package/dist/components/payments/BankConnectionMethodPicker.d.ts +10 -0
- package/dist/components/payments/InlineRowActions.d.ts +17 -0
- package/dist/components/payments/PaymentActionButton.d.ts +9 -0
- package/dist/components/payments/PaymentFormSection.d.ts +1 -1
- package/dist/components/payments/PaymentRowMenu.d.ts +14 -0
- package/dist/components/payments/PaymentStatusBadge.d.ts +7 -0
- package/dist/components/payments/PaymentStepper.d.ts +14 -0
- package/dist/components/payments/PaymentTableRow.d.ts +14 -0
- package/dist/components/payments/PaymentsNeedAttention.d.ts +14 -0
- package/dist/components/payments/RecurringPaymentToggle.d.ts +16 -0
- package/dist/components/payments/RecurringPeriodRows.d.ts +34 -0
- package/dist/components/payments/StateBankDetailsForm.d.ts +8 -0
- package/dist/components/payments/StatePaymentReviewPanel.d.ts +14 -0
- package/dist/components/payments/federalPaymentSteps.d.ts +6 -0
- package/dist/components/payments/federalPaymentUtils.d.ts +4 -0
- package/dist/components/payments/paymentsTableConfig.d.ts +20 -9
- package/dist/components/payments/remittancePaymentMappers.d.ts +3 -0
- package/dist/components/payments/statePaymentAuthorizationConfig.d.ts +1 -1
- package/dist/components/payments/useStatePaymentDraftSave.d.ts +11 -0
- package/dist/components/settings/BankAccountActionsMenu.d.ts +3 -1
- package/dist/components/settings/TaxAccountDrawer.d.ts +22 -0
- package/dist/components/settings/settingsNavConfig.d.ts +1 -1
- package/dist/components/settings/taxAccountDrawerConfig.d.ts +5 -0
- package/dist/components/tax-forms/TaxFormCard.d.ts +7 -0
- package/dist/components/tax-forms/TaxFormsGrid.d.ts +9 -0
- package/dist/components/ui/SideDrawer.d.ts +18 -0
- package/dist/components/ui/StatusPill.d.ts +10 -0
- package/dist/index.cjs +34 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13230 -10490
- package/dist/index.mjs.map +1 -1
- package/dist/lib/bankAccountInputRules.d.ts +17 -0
- package/dist/lib/entityFormUtils.d.ts +44 -1
- package/dist/lib/paymentsNavigation.d.ts +4 -2
- package/dist/pages/StateBankDetailsPage.d.ts +2 -0
- package/dist/styles.css +1 -1
- package/dist/types/entity.d.ts +24 -0
- package/dist/types/federalPaymentFlow.d.ts +2 -0
- package/dist/types/statePayment.d.ts +7 -0
- package/dist/types/statePaymentFlow.d.ts +3 -0
- package/package.json +1 -1
- package/dist/api/paymentTransactions.d.ts +0 -7
- package/dist/components/dashboard/EmptyPaymentCard.d.ts +0 -9
- package/dist/components/payments/PaymentRowActions.d.ts +0 -13
- package/dist/components/settings/AddBankAccountManualForm.d.ts +0 -7
- package/dist/components/settings/AddBankAccountModal.d.ts +0 -8
- package/dist/components/settings/EditBankAccountModal.d.ts +0 -8
- package/dist/components/settings/PaymentHistorySection.d.ts +0 -5
- package/dist/components/settings/SettingsPlaceholderSection.d.ts +0 -6
- package/dist/components/tax-forms/TaxFormsTable.d.ts +0 -8
- package/dist/pages/StatePaymentEditorPage.d.ts +0 -5
- package/dist/types/paymentHistory.d.ts +0 -26
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { BankAccountResponse } from '../types/bankAccount';
|
|
2
2
|
import { CreateBankAccountRequest, UpdateBankAccountRequest } from '../types/createBankAccount';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The entity's bank accounts.
|
|
5
|
+
*
|
|
6
|
+
* The backend paginates this endpoint, but every `['bank-accounts', entityId]`
|
|
7
|
+
* consumer filters/paginates the full list client-side, so this fetches every
|
|
8
|
+
* account in one page rather than threading server-side paging through those
|
|
9
|
+
* call sites.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getBankAccounts(entityId: number): Promise<BankAccountResponse[]>;
|
|
10
12
|
export declare function createBankAccount(request: CreateBankAccountRequest): Promise<BankAccountResponse>;
|
|
11
13
|
export declare function updateBankAccount(bankAccountDetailId: number, request: UpdateBankAccountRequest): Promise<BankAccountResponse>;
|
package/dist/api/entities.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { CreateEntityDetailsRequest, EntityDetailsResponse, UpdateEntityDetailsRequest } from '../types/entity';
|
|
2
|
-
import { PagedResult } from '../types/pagination';
|
|
3
2
|
interface CreateEntityDetailsResponse {
|
|
4
3
|
entityId: number;
|
|
5
4
|
userId: number | null;
|
|
6
5
|
apiClientId: number | null;
|
|
7
6
|
status: string;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The caller's entity list.
|
|
10
|
+
*
|
|
11
|
+
* The backend supports real search/pagination on this endpoint, but this is what
|
|
12
|
+
* backs the shared `['entities', 'mine']` query used by EmbeddedContext, the
|
|
13
|
+
* entity list page and the entity form — all of which filter/paginate a full
|
|
14
|
+
* list client-side, so this fetches every entity in one page rather than
|
|
15
|
+
* threading server-side paging through those call sites.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAllMyEntities(): Promise<EntityDetailsResponse[]>;
|
|
15
18
|
export declare function createEntity(request: CreateEntityDetailsRequest): Promise<CreateEntityDetailsResponse>;
|
|
16
19
|
export declare function updateEntity(entityId: number, request: UpdateEntityDetailsRequest): Promise<EntityDetailsResponse>;
|
|
17
20
|
export {};
|
|
@@ -11,6 +11,8 @@ export interface RemittancePaymentResponse {
|
|
|
11
11
|
paymentDate: string;
|
|
12
12
|
status: string | null;
|
|
13
13
|
reason: string | null;
|
|
14
|
+
/** Federal tax form / state reason for payment — not served by the API yet. */
|
|
15
|
+
formType?: string | null;
|
|
14
16
|
}
|
|
15
17
|
export interface RemittancePaymentStatusCounts {
|
|
16
18
|
drafts: number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PaymentType } from '../../embedded/EmbeddedContext';
|
|
2
|
+
interface AddFirstPaymentModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
/** Payment types the host enabled — local is always shown as coming soon. */
|
|
6
|
+
enabledPayments: PaymentType[];
|
|
7
|
+
onSelectFederal: () => void;
|
|
8
|
+
onSelectState: () => void;
|
|
9
|
+
}
|
|
10
|
+
/** Payment-type picker shown when starting the first payment from the dashboard. */
|
|
11
|
+
export declare function AddFirstPaymentModal({ open, onClose, enabledPayments, onSelectFederal, onSelectState, }: AddFirstPaymentModalProps): import('react').ReactPortal | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SetupStep {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
/** Label for the call-to-action shown while this step is the active one. */
|
|
5
|
+
actionLabel: string;
|
|
6
|
+
done: boolean;
|
|
7
|
+
onAction?: () => void;
|
|
8
|
+
/** Where the "View" button goes once the step is done. */
|
|
9
|
+
onView?: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface SetupChecklistProps {
|
|
12
|
+
/** First name of the signed-in user, when known. */
|
|
13
|
+
userName?: string;
|
|
14
|
+
steps: SetupStep[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* "Complete your setup" onboarding card. Shown in place of the dashboard
|
|
18
|
+
* until the user has an entity, a payment, a bank account and an authorized
|
|
19
|
+
* payment.
|
|
20
|
+
*/
|
|
21
|
+
export declare function SetupChecklist({ userName, steps }: SetupChecklistProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DashboardResponse } from '../../types/dashboard';
|
|
2
|
+
interface UseSetupProgressArgs {
|
|
3
|
+
entityId: number | null;
|
|
4
|
+
entityCount: number;
|
|
5
|
+
dashboard: DashboardResponse | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface SetupProgress {
|
|
8
|
+
hasEntity: boolean;
|
|
9
|
+
hasPayment: boolean;
|
|
10
|
+
hasBankAccount: boolean;
|
|
11
|
+
hasAuthorizedPayment: boolean;
|
|
12
|
+
isComplete: boolean;
|
|
13
|
+
/** First name of the signed-in user, when the session carries one. */
|
|
14
|
+
userName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether the four onboarding steps are done.
|
|
18
|
+
*
|
|
19
|
+
* Review & Authorize counts as done once a payment record exists, Draft
|
|
20
|
+
* included: the wizard only persists a payment after the authorization details
|
|
21
|
+
* are filled in, and scheduling happens later from the drafts tab. The API has
|
|
22
|
+
* no separate authorization flag to read.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSetupProgress({ entityId, entityCount, dashboard, }: UseSetupProgressArgs): SetupProgress;
|
|
25
|
+
export {};
|
|
@@ -2,6 +2,8 @@ import { EntityDetailsResponse } from '../../types/entity';
|
|
|
2
2
|
interface EntityActionsMenuProps {
|
|
3
3
|
entity: EntityDetailsResponse;
|
|
4
4
|
onEdit: (entity: EntityDetailsResponse) => void;
|
|
5
|
+
/** `kebab` is the icon-only trigger used on the entity cards. */
|
|
6
|
+
variant?: 'button' | 'kebab';
|
|
5
7
|
}
|
|
6
|
-
export declare function EntityActionsMenu({ entity, onEdit }: EntityActionsMenuProps): import("react").JSX.Element;
|
|
8
|
+
export declare function EntityActionsMenu({ entity, onEdit, variant }: EntityActionsMenuProps): import("react").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntityDetailsResponse } from '../../types/entity';
|
|
2
|
+
interface EntityCardProps {
|
|
3
|
+
entity: EntityDetailsResponse;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
onEdit: (entity: EntityDetailsResponse) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EntityCard({ entity, selected, onEdit }: EntityCardProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ALL_ENTITY_TYPES = "All";
|
|
2
|
+
interface EntityTypeFilterProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (entityType: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Filter-icon button opening the entity type list. `All` clears the filter. */
|
|
7
|
+
export declare function EntityTypeFilter({ value, onChange }: EntityTypeFilterProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { EntityDetailsResponse } from '../../types/entity';
|
|
2
2
|
export declare function formatEin(idNumber: string): string;
|
|
3
3
|
export declare function formatSsn(idNumber: string): string;
|
|
4
|
+
/** Mask an EIN for display, revealing only the last 4 digits: `**-***6789`. */
|
|
5
|
+
export declare function maskEin(idNumber: string): string;
|
|
6
|
+
/** Mask an SSN for display, revealing only the last 4 digits: `***-**-6789`. */
|
|
7
|
+
export declare function maskSsn(idNumber: string): string;
|
|
8
|
+
/** Mask a stored 9-digit id for display: SSN shape for Individual, EIN otherwise. */
|
|
9
|
+
export declare function maskIdNumber(idNumber: string, accountType: string): string;
|
|
4
10
|
/** Format a stored 9-digit id for display: SSN for Individual, EIN otherwise. */
|
|
5
11
|
export declare function formatIdNumber(idNumber: string, accountType: string): string;
|
|
6
12
|
/**
|
|
@@ -10,6 +10,10 @@ interface SegmentedControlProps<T extends string> {
|
|
|
10
10
|
options: SegmentedControlOption<T>[];
|
|
11
11
|
value: T;
|
|
12
12
|
onChange: (value: T) => void;
|
|
13
|
+
/** false renders compact, content-width buttons instead of stretching to fill the row. */
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
/** Fires when any option receives focus — lets a contextual help panel follow the group. */
|
|
16
|
+
onFocus?: () => void;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* Accessible segmented control (WAI-ARIA radiogroup pattern) for a small,
|
|
@@ -18,5 +22,5 @@ interface SegmentedControlProps<T extends string> {
|
|
|
18
22
|
* viewport width, from a full row on desktop down to two narrow cards on
|
|
19
23
|
* mobile. Generic — not tied to any specific option set.
|
|
20
24
|
*/
|
|
21
|
-
export declare function SegmentedControl<T extends string>({ label, required, options, value, onChange, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
25
|
+
export declare function SegmentedControl<T extends string>({ label, required, options, value, onChange, fullWidth, onFocus, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BankIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BusinessIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CheckCircleIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EyeIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EyeOffIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PersonIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function XCircleIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EntityFormValues } from '../../types/entity';
|
|
2
|
+
import { HelpKey } from './entityHelpContent';
|
|
3
|
+
interface EntityAccountTypeRowProps {
|
|
4
|
+
accountType: EntityFormValues['accountType'];
|
|
5
|
+
onAccountTypeChange: (next: EntityFormValues['accountType']) => void;
|
|
6
|
+
isIndividual: boolean;
|
|
7
|
+
filingStatus: string;
|
|
8
|
+
onFilingStatusChange: (value: string) => void;
|
|
9
|
+
focusHelp: (key: HelpKey) => () => void;
|
|
10
|
+
resetHelp: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** Account Type toggle, plus Filing Status for individual accounts. */
|
|
13
|
+
export declare function EntityAccountTypeRow({ accountType, onAccountTypeChange, isIndividual, filingStatus, onFilingStatusChange, focusHelp, resetHelp, }: EntityAccountTypeRowProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
import { StateOption } from '../../lib/useAddressReference';
|
|
3
|
+
import { EntityFormValues } from '../../types/entity';
|
|
4
|
+
import { HelpKey } from './entityHelpContent';
|
|
5
|
+
interface EntityAddressFieldsProps {
|
|
6
|
+
register: UseFormRegister<EntityFormValues>;
|
|
7
|
+
errors: FieldErrors<EntityFormValues>;
|
|
8
|
+
zipRegister: UseFormRegisterReturn;
|
|
9
|
+
isUS: boolean;
|
|
10
|
+
state: string;
|
|
11
|
+
stateOptions: StateOption[];
|
|
12
|
+
zipStateMismatch: boolean;
|
|
13
|
+
focusHelp: (key: HelpKey) => () => void;
|
|
14
|
+
}
|
|
15
|
+
/** Registered address for the entity — labels and formatting follow the country. */
|
|
16
|
+
export declare function EntityAddressFields({ register, errors, zipRegister, isUS, state, stateOptions, zipStateMismatch, focusHelp, }: EntityAddressFieldsProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
import { EntityFormValues } from '../../types/entity';
|
|
3
|
+
import { HelpKey } from './entityHelpContent';
|
|
4
|
+
interface EntityBusinessFieldsProps {
|
|
5
|
+
register: UseFormRegister<EntityFormValues>;
|
|
6
|
+
errors: FieldErrors<EntityFormValues>;
|
|
7
|
+
einRegister: UseFormRegisterReturn;
|
|
8
|
+
phoneRegister: UseFormRegisterReturn;
|
|
9
|
+
countryCodeRegister: UseFormRegisterReturn;
|
|
10
|
+
entityTypeOptions: string[];
|
|
11
|
+
accountType: string;
|
|
12
|
+
idLabel: string;
|
|
13
|
+
idPlaceholder: string;
|
|
14
|
+
idMaxLength: number;
|
|
15
|
+
focusHelp: (key: HelpKey) => () => void;
|
|
16
|
+
}
|
|
17
|
+
/** Business account fields: names, contact details, entity type and EIN. */
|
|
18
|
+
export declare function EntityBusinessFields({ register, errors, einRegister, phoneRegister, countryCodeRegister, entityTypeOptions, accountType, idLabel, idPlaceholder, idMaxLength, focusHelp, }: EntityBusinessFieldsProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CreatedEntitySnapshot } from './useEntityForm';
|
|
2
|
+
interface EntityCreatedModalProps {
|
|
3
|
+
created: CreatedEntitySnapshot | null;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onGoToDashboard: () => void;
|
|
6
|
+
onStartPayment: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Picks the right success-modal variant for what was just created: business
|
|
10
|
+
* entities get one details page, individuals get the primary taxpayer plus an
|
|
11
|
+
* optional second page for a joint filer.
|
|
12
|
+
*/
|
|
13
|
+
export declare function EntityCreatedModal({ created, onClose, onGoToDashboard, onStartPayment, }: EntityCreatedModalProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add Entity form — business or individual, with the contextual help panel
|
|
3
|
+
* beside it and a success modal once the entity is created. All behaviour
|
|
4
|
+
* lives in useEntityForm; this is layout only.
|
|
5
|
+
*/
|
|
1
6
|
export declare function EntityForm(): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldHelp } from './entityHelpContent';
|
|
2
|
+
/**
|
|
3
|
+
* Context panel beside the form. Shows generic guidance until a field with
|
|
4
|
+
* dedicated copy is focused, then swaps in that field's help.
|
|
5
|
+
*/
|
|
6
|
+
export declare function EntityFormHelpPanel({ active }: {
|
|
7
|
+
active: FieldHelp | null;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
interface EntityIdNumberInputProps {
|
|
3
|
+
/** "EIN" for Business, "SSN" for Individual. */
|
|
4
|
+
label: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
maxLength: number;
|
|
7
|
+
accountType: string;
|
|
8
|
+
register: UseFormRegisterReturn;
|
|
9
|
+
error?: string;
|
|
10
|
+
onFocus: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** EIN / SSN input — masks the dashes in as the user types. */
|
|
13
|
+
export declare function EntityIdNumberInput({ label, placeholder, maxLength, accountType, register, error, onFocus, }: EntityIdNumberInputProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
interface EntityPhoneFieldProps {
|
|
3
|
+
countryCodeRegister: UseFormRegisterReturn;
|
|
4
|
+
phoneRegister: UseFormRegisterReturn;
|
|
5
|
+
error?: string;
|
|
6
|
+
onFocus: () => void;
|
|
7
|
+
}
|
|
8
|
+
/** Country code + 10-digit phone number, stripped to digits as the user types. */
|
|
9
|
+
export declare function EntityPhoneField({ countryCodeRegister, phoneRegister, error, onFocus, }: EntityPhoneFieldProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
import { EntityFormValues } from '../../types/entity';
|
|
3
|
+
interface EntityPrimaryTaxpayerFieldsProps {
|
|
4
|
+
register: UseFormRegister<EntityFormValues>;
|
|
5
|
+
errors: FieldErrors<EntityFormValues>;
|
|
6
|
+
einRegister: UseFormRegisterReturn;
|
|
7
|
+
phoneRegister: UseFormRegisterReturn;
|
|
8
|
+
countryCodeRegister: UseFormRegisterReturn;
|
|
9
|
+
accountType: string;
|
|
10
|
+
idLabel: string;
|
|
11
|
+
idPlaceholder: string;
|
|
12
|
+
idMaxLength: number;
|
|
13
|
+
resetHelp: () => void;
|
|
14
|
+
}
|
|
15
|
+
/** Individual account fields: the primary taxpayer's name, SSN and contact details. */
|
|
16
|
+
export declare function EntityPrimaryTaxpayerFields({ register, errors, einRegister, phoneRegister, countryCodeRegister, accountType, idLabel, idPlaceholder, idMaxLength, resetHelp, }: EntityPrimaryTaxpayerFieldsProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SuccessDetailRow {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/**
|
|
6
|
+
* Masked stand-in for a sensitive value (EIN / SSN). When set the row shows
|
|
7
|
+
* this instead of `value`, with a reveal toggle.
|
|
8
|
+
*/
|
|
9
|
+
masked?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SuccessDetailPage {
|
|
12
|
+
/** Section heading — also turns on the pager when there's more than one page. */
|
|
13
|
+
title?: string;
|
|
14
|
+
rows: SuccessDetailRow[];
|
|
15
|
+
}
|
|
16
|
+
interface EntitySuccessModalProps {
|
|
17
|
+
open: boolean;
|
|
18
|
+
entityName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
illustration: ReactNode;
|
|
21
|
+
pages: SuccessDetailPage[];
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onGoToDashboard: () => void;
|
|
24
|
+
onStartPayment: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Confirmation shown right after an entity is created. Business entities get a
|
|
28
|
+
* single details page; individuals filing jointly get a second page for the
|
|
29
|
+
* secondary taxpayer, reachable via the pager.
|
|
30
|
+
*
|
|
31
|
+
* "Go to Dashboard" and "Start Payment" both just go to the dashboard for now —
|
|
32
|
+
* there's no payment flow wired up yet.
|
|
33
|
+
*/
|
|
34
|
+
export declare function EntitySuccessModal({ open, entityName, description, illustration, pages, onClose, onGoToDashboard, onStartPayment, }: EntitySuccessModalProps): import('react').ReactPortal | null;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { AddressParts, SecondaryTaxpayer } from '../../lib/entityFormUtils';
|
|
3
|
+
import { StateOption } from '../../lib/useAddressReference';
|
|
4
|
+
type SecondaryField = keyof Omit<SecondaryTaxpayer, 'sameAsPrimaryAddress'>;
|
|
5
|
+
interface SecondaryTaxpayerSectionProps {
|
|
6
|
+
values: SecondaryTaxpayer;
|
|
7
|
+
/** Address to display — mirrors the primary address while the toggle is on. */
|
|
8
|
+
address: AddressParts & {
|
|
9
|
+
country: string;
|
|
10
|
+
};
|
|
11
|
+
stateOptions: StateOption[];
|
|
12
|
+
onFieldChange: (field: SecondaryField) => (event: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
|
|
13
|
+
onSsnChange: (value: string) => void;
|
|
14
|
+
onSameAsPrimaryChange: (checked: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Joint-filer details, shown for Individual + "Married Filing Jointly".
|
|
18
|
+
* UI-only — nothing here is submitted yet (see SecondaryTaxpayer).
|
|
19
|
+
*/
|
|
20
|
+
export declare function SecondaryTaxpayerSection({ values, address, stateOptions, onFieldChange, onSsnChange, onSameAsPrimaryChange, }: SecondaryTaxpayerSectionProps): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FieldHelp {
|
|
3
|
+
title: string;
|
|
4
|
+
/** Drives the REQUIRED / OPTIONAL badge in the help panel. */
|
|
5
|
+
required: boolean;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
tips: ReactNode[];
|
|
8
|
+
correct?: string;
|
|
9
|
+
mistake?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Per-field copy for the "How to fill this" side panel — keyed by a help key
|
|
13
|
+
* set on each input's onFocus. Fields without an entry here fall back to the
|
|
14
|
+
* panel's generic copy.
|
|
15
|
+
*/
|
|
16
|
+
export declare const HELP_CONTENT: {
|
|
17
|
+
accountType: {
|
|
18
|
+
title: string;
|
|
19
|
+
required: true;
|
|
20
|
+
description: string;
|
|
21
|
+
tips: (string | import("react").JSX.Element)[];
|
|
22
|
+
correct: string;
|
|
23
|
+
mistake: string;
|
|
24
|
+
};
|
|
25
|
+
legalBusinessName: {
|
|
26
|
+
title: string;
|
|
27
|
+
required: true;
|
|
28
|
+
description: import("react").JSX.Element;
|
|
29
|
+
tips: (string | import("react").JSX.Element)[];
|
|
30
|
+
correct: string;
|
|
31
|
+
mistake: string;
|
|
32
|
+
};
|
|
33
|
+
businessDisplayName: {
|
|
34
|
+
title: string;
|
|
35
|
+
required: false;
|
|
36
|
+
description: string;
|
|
37
|
+
tips: string[];
|
|
38
|
+
correct: string;
|
|
39
|
+
mistake: string;
|
|
40
|
+
};
|
|
41
|
+
email: {
|
|
42
|
+
title: string;
|
|
43
|
+
required: true;
|
|
44
|
+
description: string;
|
|
45
|
+
tips: string[];
|
|
46
|
+
correct: string;
|
|
47
|
+
mistake: string;
|
|
48
|
+
};
|
|
49
|
+
phoneNumber: {
|
|
50
|
+
title: string;
|
|
51
|
+
required: true;
|
|
52
|
+
description: string;
|
|
53
|
+
tips: string[];
|
|
54
|
+
correct: string;
|
|
55
|
+
mistake: string;
|
|
56
|
+
};
|
|
57
|
+
entityType: {
|
|
58
|
+
title: string;
|
|
59
|
+
required: true;
|
|
60
|
+
description: string;
|
|
61
|
+
tips: string[];
|
|
62
|
+
correct: string;
|
|
63
|
+
mistake: string;
|
|
64
|
+
};
|
|
65
|
+
ein: {
|
|
66
|
+
title: string;
|
|
67
|
+
required: true;
|
|
68
|
+
description: import("react").JSX.Element;
|
|
69
|
+
tips: string[];
|
|
70
|
+
correct: string;
|
|
71
|
+
mistake: string;
|
|
72
|
+
};
|
|
73
|
+
address1: {
|
|
74
|
+
title: string;
|
|
75
|
+
required: true;
|
|
76
|
+
description: string;
|
|
77
|
+
tips: string[];
|
|
78
|
+
correct: string;
|
|
79
|
+
mistake: string;
|
|
80
|
+
};
|
|
81
|
+
address2: {
|
|
82
|
+
title: string;
|
|
83
|
+
required: false;
|
|
84
|
+
description: string;
|
|
85
|
+
tips: string[];
|
|
86
|
+
correct: string;
|
|
87
|
+
mistake: string;
|
|
88
|
+
};
|
|
89
|
+
city: {
|
|
90
|
+
title: string;
|
|
91
|
+
required: true;
|
|
92
|
+
description: string;
|
|
93
|
+
tips: string[];
|
|
94
|
+
correct: string;
|
|
95
|
+
mistake: string;
|
|
96
|
+
};
|
|
97
|
+
state: {
|
|
98
|
+
title: string;
|
|
99
|
+
required: true;
|
|
100
|
+
description: string;
|
|
101
|
+
tips: string[];
|
|
102
|
+
correct: string;
|
|
103
|
+
mistake: string;
|
|
104
|
+
};
|
|
105
|
+
zipCode: {
|
|
106
|
+
title: string;
|
|
107
|
+
required: true;
|
|
108
|
+
description: string;
|
|
109
|
+
tips: string[];
|
|
110
|
+
correct: string;
|
|
111
|
+
mistake: string;
|
|
112
|
+
};
|
|
113
|
+
country: {
|
|
114
|
+
title: string;
|
|
115
|
+
required: true;
|
|
116
|
+
description: string;
|
|
117
|
+
tips: string[];
|
|
118
|
+
correct: string;
|
|
119
|
+
mistake: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export type HelpKey = keyof typeof HELP_CONTENT;
|
|
123
|
+
export declare const DEFAULT_HELP_TIPS: ReactNode[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { SecondaryTaxpayer } from '../../lib/entityFormUtils';
|
|
3
|
+
import { EntityFormValues } from '../../types/entity';
|
|
4
|
+
import { HelpKey } from './entityHelpContent';
|
|
5
|
+
/** What the success modal renders — captured at save time. */
|
|
6
|
+
export interface CreatedEntitySnapshot {
|
|
7
|
+
values: EntityFormValues;
|
|
8
|
+
secondary: SecondaryTaxpayer | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* All state, validation and submit behaviour for the Add Entity form. Kept
|
|
12
|
+
* out of the component so the JSX is pure composition.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEntityForm(): {
|
|
15
|
+
register: import('react-hook-form').UseFormRegister<EntityFormValues>;
|
|
16
|
+
errors: import('react-hook-form').FieldErrors<EntityFormValues>;
|
|
17
|
+
onSubmit: (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
18
|
+
error: string | null;
|
|
19
|
+
isSubmitting: boolean;
|
|
20
|
+
einRegister: import('react-hook-form').UseFormRegisterReturn<"ein">;
|
|
21
|
+
phoneRegister: import('react-hook-form').UseFormRegisterReturn<"phoneNumber">;
|
|
22
|
+
zipRegister: import('react-hook-form').UseFormRegisterReturn<"zipCode">;
|
|
23
|
+
countryCodeRegister: import('react-hook-form').UseFormRegisterReturn<"countryCode">;
|
|
24
|
+
accountType: "Business" | "Individual";
|
|
25
|
+
isIndividual: boolean;
|
|
26
|
+
isUS: boolean;
|
|
27
|
+
idLabel: string;
|
|
28
|
+
idPlaceholder: string;
|
|
29
|
+
idMaxLength: number;
|
|
30
|
+
entityTypeOptions: string[];
|
|
31
|
+
stateOptions: import('../../lib/useAddressReference').StateOption[];
|
|
32
|
+
state: string;
|
|
33
|
+
zipStateMismatch: boolean;
|
|
34
|
+
activeHelp: {
|
|
35
|
+
title: string;
|
|
36
|
+
required: true;
|
|
37
|
+
description: string;
|
|
38
|
+
tips: (string | import("react").JSX.Element)[];
|
|
39
|
+
correct: string;
|
|
40
|
+
mistake: string;
|
|
41
|
+
} | {
|
|
42
|
+
title: string;
|
|
43
|
+
required: true;
|
|
44
|
+
description: import("react").JSX.Element;
|
|
45
|
+
tips: (string | import("react").JSX.Element)[];
|
|
46
|
+
correct: string;
|
|
47
|
+
mistake: string;
|
|
48
|
+
} | {
|
|
49
|
+
title: string;
|
|
50
|
+
required: false;
|
|
51
|
+
description: string;
|
|
52
|
+
tips: string[];
|
|
53
|
+
correct: string;
|
|
54
|
+
mistake: string;
|
|
55
|
+
} | null;
|
|
56
|
+
focusHelp: (key: HelpKey) => () => void;
|
|
57
|
+
resetHelp: () => void;
|
|
58
|
+
filingStatus: string;
|
|
59
|
+
setFilingStatus: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
60
|
+
showSecondaryTaxpayer: boolean;
|
|
61
|
+
secondaryTaxpayer: SecondaryTaxpayer;
|
|
62
|
+
secondaryAddress: {
|
|
63
|
+
address1: string;
|
|
64
|
+
address2: string;
|
|
65
|
+
city: string;
|
|
66
|
+
state: string;
|
|
67
|
+
zipCode: string;
|
|
68
|
+
country: string;
|
|
69
|
+
};
|
|
70
|
+
secondaryStateOptions: import('../../lib/useAddressReference').StateOption[];
|
|
71
|
+
updateSecondaryField: <K extends keyof Omit<SecondaryTaxpayer, "sameAsPrimaryAddress">>(field: K) => (event: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
|
|
72
|
+
setSecondarySsn: (value: string) => void;
|
|
73
|
+
setSecondarySameAsPrimary: (checked: boolean) => void;
|
|
74
|
+
createdEntity: CreatedEntitySnapshot | null;
|
|
75
|
+
handleAccountTypeChange: (next: EntityFormValues["accountType"]) => void;
|
|
76
|
+
handleCancel: () => void;
|
|
77
|
+
goToDashboard: () => void;
|
|
78
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BankAccountResponse } from '../../types/bankAccount';
|
|
2
|
+
interface BankAccountCardProps {
|
|
3
|
+
account: BankAccountResponse;
|
|
4
|
+
onEdit: (account: BankAccountResponse) => void;
|
|
5
|
+
/** Omit to render a plain (non-selectable) card, as on the settings page. */
|
|
6
|
+
onSelect?: (bankAccountDetailId: number) => void;
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Bank account tile with an actions menu. In the payment flow it doubles as a
|
|
11
|
+
* radio for choosing the account to debit; inactive accounts are shown (so the
|
|
12
|
+
* user can see why one isn't usable) but can't be picked — they can still be
|
|
13
|
+
* edited or reactivated from the menu.
|
|
14
|
+
*/
|
|
15
|
+
export declare function BankAccountCard({ account, onEdit, onSelect, selected, }: BankAccountCardProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|