@npm-zenwork/tax-remittance-ui 0.4.3 → 0.5.1

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.
Files changed (37) hide show
  1. package/dist/components/dashboard/PaymentsTypeCard.d.ts +6 -2
  2. package/dist/components/dashboard/useSetupProgress.d.ts +13 -1
  3. package/dist/components/entities/EntityCard.d.ts +7 -1
  4. package/dist/components/forms/CustomSelect.d.ts +40 -0
  5. package/dist/components/forms/FormField.d.ts +1 -8
  6. package/dist/components/forms/PhoneNumberInput.d.ts +27 -0
  7. package/dist/components/onboarding/EntityAddressFields.d.ts +3 -2
  8. package/dist/components/onboarding/EntityBusinessFields.d.ts +3 -2
  9. package/dist/components/onboarding/SecondaryTaxpayerSection.d.ts +3 -1
  10. package/dist/components/onboarding/entityHelpContent.d.ts +1 -1
  11. package/dist/components/onboarding/useEntityForm.d.ts +8 -0
  12. package/dist/components/payments/PaymentActionsFooter.d.ts +6 -0
  13. package/dist/components/payments/PaymentField.d.ts +1 -1
  14. package/dist/components/payments/RecurringPaymentToggle.d.ts +3 -2
  15. package/dist/components/payments/SignatureFieldGroup.d.ts +6 -1
  16. package/dist/components/payments/federalSubcategoryRules.d.ts +7 -0
  17. package/dist/components/payments/reportingAgentAuthorizationConfig.d.ts +7 -3
  18. package/dist/components/payments/statePaymentAuthorizationConfig.d.ts +3 -2
  19. package/dist/components/settings/EditEntityForm.d.ts +1 -1
  20. package/dist/components/settings/TaxAccountDrawer.d.ts +4 -2
  21. package/dist/components/ui/useAnchoredLayer.d.ts +35 -0
  22. package/dist/embedded/EmbeddedLayout.d.ts +2 -4
  23. package/dist/embedded/EmbeddedWidgetBase.d.ts +3 -1
  24. package/dist/embedded/TaxRemittanceEmbedded.d.ts +7 -0
  25. package/dist/index.cjs +32 -32
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.mjs +9419 -9074
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/lib/entityFormUtils.d.ts +12 -4
  31. package/dist/lib/fieldRules.d.ts +24 -6
  32. package/dist/styles.css +1 -1
  33. package/dist/types/dashboard.d.ts +3 -3
  34. package/dist/types/entity.d.ts +2 -2
  35. package/package.json +1 -1
  36. package/dist/components/forms/PhoneInputGroup.d.ts +0 -14
  37. package/dist/components/onboarding/EntityPhoneField.d.ts +0 -9
@@ -1,7 +1,11 @@
1
+ import { TaxYearOption } from './dashboardUtils';
1
2
  import { PaymentTypeBar } from './dashboardMockData';
2
3
  interface PaymentsTypeCardProps {
3
4
  bars: PaymentTypeBar[];
4
- year: number;
5
+ /** Owned by the dashboard page, independent of the other chart cards' years. */
6
+ taxYear: number;
7
+ taxYearOptions: TaxYearOption[];
8
+ onTaxYearChange: (taxYear: number) => void;
5
9
  }
6
- export declare function PaymentsTypeCard({ bars, year }: PaymentsTypeCardProps): import("react").JSX.Element;
10
+ export declare function PaymentsTypeCard({ bars, taxYear, taxYearOptions, onTaxYearChange }: PaymentsTypeCardProps): import("react").JSX.Element;
7
11
  export {};
@@ -2,7 +2,11 @@ import { DashboardResponse } from '../../types/dashboard';
2
2
  interface UseSetupProgressArgs {
3
3
  entityId: number | null;
4
4
  entityCount: number;
5
+ /** True while the entities list itself is still loading. */
6
+ entitiesLoading: boolean;
5
7
  dashboard: DashboardResponse | undefined;
8
+ /** True while the selected entity's dashboard summary is still loading. */
9
+ dashboardLoading: boolean;
6
10
  /**
7
11
  * Full name of the signed-in user, when the host app supplies one. Embedded
8
12
  * hosts own the session, so the widget's own storage is empty there.
@@ -15,6 +19,14 @@ export interface SetupProgress {
15
19
  hasBankAccount: boolean;
16
20
  hasAuthorizedPayment: boolean;
17
21
  isComplete: boolean;
22
+ /**
23
+ * True until every signal `isComplete` depends on — entities, and (once an
24
+ * entity is selected) its dashboard summary and bank accounts — has loaded
25
+ * at least once. Callers must wait for this before branching on
26
+ * `isComplete`, otherwise the checklist flashes true/false/true as each
27
+ * query resolves at a different time (e.g. right after login).
28
+ */
29
+ isLoading: boolean;
18
30
  /** First name of the signed-in user, when the session carries one. */
19
31
  userName?: string;
20
32
  }
@@ -26,5 +38,5 @@ export interface SetupProgress {
26
38
  * are filled in, and scheduling happens later from the drafts tab. The API has
27
39
  * no separate authorization flag to read.
28
40
  */
29
- export declare function useSetupProgress({ entityId, entityCount, dashboard, userName, }: UseSetupProgressArgs): SetupProgress;
41
+ export declare function useSetupProgress({ entityId, entityCount, entitiesLoading, dashboard, dashboardLoading, userName, }: UseSetupProgressArgs): SetupProgress;
30
42
  export {};
@@ -3,6 +3,12 @@ interface EntityCardProps {
3
3
  entity: EntityDetailsResponse;
4
4
  selected: boolean;
5
5
  onEdit: (entity: EntityDetailsResponse) => void;
6
+ /**
7
+ * Optional — when provided, the card body becomes clickable and switches the
8
+ * active entity (matching the header's entity switcher). Callers that don't
9
+ * need "click to switch" (e.g. a read-only listing) can omit this prop.
10
+ */
11
+ onSelect?: (entity: EntityDetailsResponse) => void;
6
12
  }
7
- export declare function EntityCard({ entity, selected, onEdit }: EntityCardProps): import("react").JSX.Element;
13
+ export declare function EntityCard({ entity, selected, onEdit, onSelect }: EntityCardProps): import("react").JSX.Element;
8
14
  export {};
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from 'react';
2
+ export interface CustomSelectOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ /** Small pill shown to the right of the label (e.g. "Coming Soon") — plain text, no markup. */
7
+ badge?: string;
8
+ }
9
+ interface CustomSelectProps {
10
+ value: string;
11
+ onChange: (value: string) => void;
12
+ options: CustomSelectOption[];
13
+ placeholder: string;
14
+ disabled?: boolean;
15
+ hasError?: boolean;
16
+ loading?: boolean;
17
+ loadingLabel?: string;
18
+ /**
19
+ * Renders the control with its own label and error line. Omit it when the
20
+ * caller already provides those — inside a `PaymentField`, say.
21
+ */
22
+ label?: string;
23
+ required?: boolean;
24
+ error?: string;
25
+ id?: string;
26
+ ariaLabel?: string;
27
+ /** `sm` is the compact inline control toolbars use (pagination, chart headers). */
28
+ size?: 'md' | 'sm';
29
+ /** Icon pinned inside the control's left edge, as on the tax-year picker. */
30
+ leadingIcon?: ReactNode;
31
+ }
32
+ /**
33
+ * The one dropdown in the app. Every select goes through it so hover/focus/selected
34
+ * styling stays identical everywhere (border-gov-400 / bg-gov-50, matching the app's
35
+ * focus-ring accent) — a native <select>'s option list is OS-rendered chrome the page
36
+ * can't restyle, and can't show a badge (see the Reason for Payment "Coming Soon"
37
+ * case) at all. Change it here and every dropdown changes with it.
38
+ */
39
+ export declare function CustomSelect({ value, onChange, options, placeholder, disabled, hasError, loading, loadingLabel, label, required, error, id, ariaLabel, size, leadingIcon, }: CustomSelectProps): import("react").JSX.Element;
40
+ export {};
@@ -1,4 +1,4 @@
1
- import { InputHTMLAttributes, ReactNode, SelectHTMLAttributes } from 'react';
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
2
  export interface FormLabelProps {
3
3
  label: string;
4
4
  required?: boolean;
@@ -13,13 +13,6 @@ interface FormInputProps extends InputHTMLAttributes<HTMLInputElement> {
13
13
  tooltip?: string;
14
14
  }
15
15
  export declare const FormInput: import('react').ForwardRefExoticComponent<FormInputProps & import('react').RefAttributes<HTMLInputElement>>;
16
- interface FormSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
17
- label: string;
18
- required?: boolean;
19
- error?: string;
20
- children: ReactNode;
21
- }
22
- export declare const FormSelect: import('react').ForwardRefExoticComponent<FormSelectProps & import('react').RefAttributes<HTMLSelectElement>>;
23
16
  interface FormSectionProps {
24
17
  step?: number;
25
18
  title: string;
@@ -0,0 +1,27 @@
1
+ import { ChangeEvent, FocusEventHandler } from 'react';
2
+ import { UseFormRegisterReturn } from 'react-hook-form';
3
+ interface PhoneNumberInputProps {
4
+ label?: string;
5
+ required?: boolean;
6
+ error?: string;
7
+ /** Chrome only: `payment` matches the IRS-form fields, everything else uses `default`. */
8
+ variant?: 'default' | 'payment';
9
+ placeholder?: string;
10
+ id?: string;
11
+ name?: string;
12
+ readOnly?: boolean;
13
+ disabled?: boolean;
14
+ onFocus?: FocusEventHandler<HTMLInputElement>;
15
+ /** react-hook-form registration — omit for a controlled field. */
16
+ register?: UseFormRegisterReturn;
17
+ /** Controlled value/handler — omit when `register` is given. */
18
+ value?: string;
19
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
20
+ }
21
+ /**
22
+ * The only phone number input in the app. Every phone field goes through it so
23
+ * they all mask alike (`+1 (479) 555-0123`), cap at the same length and accept
24
+ * digits only — change it here and every form changes with it.
25
+ */
26
+ export declare function PhoneNumberInput({ label, required, error, variant, placeholder, id, name, readOnly, disabled, onFocus, register, value, onChange, }: PhoneNumberInputProps): import("react").JSX.Element;
27
+ export {};
@@ -1,9 +1,10 @@
1
- import { FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
1
+ import { Control, FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
2
2
  import { StateOption } from '../../lib/useAddressReference';
3
3
  import { EntityFormValues } from '../../types/entity';
4
4
  import { HelpKey } from './entityHelpContent';
5
5
  interface EntityAddressFieldsProps {
6
6
  register: UseFormRegister<EntityFormValues>;
7
+ control: Control<EntityFormValues>;
7
8
  errors: FieldErrors<EntityFormValues>;
8
9
  zipRegister: UseFormRegisterReturn;
9
10
  isUS: boolean;
@@ -13,5 +14,5 @@ interface EntityAddressFieldsProps {
13
14
  focusHelp: (key: HelpKey) => () => void;
14
15
  }
15
16
  /** 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 declare function EntityAddressFields({ register, control, errors, zipRegister, isUS, state, stateOptions, zipStateMismatch, focusHelp, }: EntityAddressFieldsProps): import("react").JSX.Element;
17
18
  export {};
@@ -1,8 +1,9 @@
1
- import { FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
1
+ import { Control, FieldErrors, UseFormRegister, UseFormRegisterReturn } from 'react-hook-form';
2
2
  import { EntityFormValues } from '../../types/entity';
3
3
  import { HelpKey } from './entityHelpContent';
4
4
  interface EntityBusinessFieldsProps {
5
5
  register: UseFormRegister<EntityFormValues>;
6
+ control: Control<EntityFormValues>;
6
7
  errors: FieldErrors<EntityFormValues>;
7
8
  einRegister: UseFormRegisterReturn;
8
9
  phoneRegister: UseFormRegisterReturn;
@@ -13,5 +14,5 @@ interface EntityBusinessFieldsProps {
13
14
  focusHelp: (key: HelpKey) => () => void;
14
15
  }
15
16
  /** Business account fields: names, contact details, entity type and EIN. */
16
- export declare function EntityBusinessFields({ register, errors, einRegister, phoneRegister, accountType, idLabel, idPlaceholder, idMaxLength, focusHelp, }: EntityBusinessFieldsProps): import("react").JSX.Element;
17
+ export declare function EntityBusinessFields({ register, control, errors, einRegister, phoneRegister, accountType, idLabel, idPlaceholder, idMaxLength, focusHelp, }: EntityBusinessFieldsProps): import("react").JSX.Element;
17
18
  export {};
@@ -12,6 +12,8 @@ interface SecondaryTaxpayerSectionProps {
12
12
  /** Per-field messages, populated on submit. */
13
13
  errors: SecondaryTaxpayerErrors;
14
14
  onFieldChange: (field: SecondaryField) => (event: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
15
+ /** Value-based counterpart, for controls that report a value rather than an event. */
16
+ onFieldValueChange: (field: SecondaryField, value: string) => void;
15
17
  onSsnChange: (value: string) => void;
16
18
  onSameAsPrimaryChange: (checked: boolean) => void;
17
19
  }
@@ -19,5 +21,5 @@ interface SecondaryTaxpayerSectionProps {
19
21
  * Joint-filer details, shown for Individual + "Married Filing Jointly".
20
22
  * UI-only — nothing here is submitted yet (see SecondaryTaxpayer).
21
23
  */
22
- export declare function SecondaryTaxpayerSection({ values, address, stateOptions, errors, onFieldChange, onSsnChange, onSameAsPrimaryChange, }: SecondaryTaxpayerSectionProps): import("react").JSX.Element;
24
+ export declare function SecondaryTaxpayerSection({ values, address, stateOptions, errors, onFieldChange, onFieldValueChange, onSsnChange, onSameAsPrimaryChange, }: SecondaryTaxpayerSectionProps): import("react").JSX.Element;
23
25
  export {};
@@ -9,7 +9,7 @@ export interface FieldHelp {
9
9
  mistake?: string;
10
10
  }
11
11
  /**
12
- * Per-field copy for the "How to fill this" side panel — keyed by a help key
12
+ * Per-field copy for the "How to fill this" side panel - keyed by a help key
13
13
  * set on each input's onFocus. Fields without an entry here fall back to the
14
14
  * panel's generic copy.
15
15
  */
@@ -13,6 +13,7 @@ export interface CreatedEntitySnapshot {
13
13
  */
14
14
  export declare function useEntityForm(): {
15
15
  register: import('react-hook-form').UseFormRegister<EntityFormValues>;
16
+ control: import('react-hook-form').Control<EntityFormValues, any, EntityFormValues>;
16
17
  errors: import('react-hook-form').FieldErrors<EntityFormValues>;
17
18
  onSubmit: (e?: React.BaseSyntheticEvent) => Promise<void>;
18
19
  error: string | null;
@@ -71,10 +72,17 @@ export declare function useEntityForm(): {
71
72
  };
72
73
  secondaryStateOptions: import('../../lib/useAddressReference').StateOption[];
73
74
  updateSecondaryField: <K extends keyof Omit<SecondaryTaxpayer, "sameAsPrimaryAddress">>(field: K) => (event: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
75
+ setSecondaryField: <K extends keyof Omit<SecondaryTaxpayer, "sameAsPrimaryAddress">>(field: K, value: string) => void;
74
76
  setSecondarySsn: (value: string) => void;
75
77
  setSecondarySameAsPrimary: (checked: boolean) => void;
76
78
  createdEntity: CreatedEntitySnapshot | null;
77
79
  handleAccountTypeChange: (next: EntityFormValues["accountType"]) => void;
78
80
  handleCancel: () => void;
79
81
  goToDashboard: () => void;
82
+ enabledPayments: import('../../embedded/EmbeddedContext').PaymentType[];
83
+ isPaymentPickerOpen: boolean;
84
+ startPayment: () => void;
85
+ closePaymentPicker: () => void;
86
+ startFederalPayment: () => void;
87
+ startStatePayment: () => void;
80
88
  };
@@ -26,6 +26,12 @@ interface SubmitAction {
26
26
  label: string;
27
27
  disabled?: boolean;
28
28
  isSubmitting?: boolean;
29
+ /**
30
+ * Set false where the submit is blocked by something that does not make the
31
+ * step unsaveable — an unticked consent box, say: the payment is filled in
32
+ * and worth keeping as a draft, the taxpayer just has not agreed yet.
33
+ */
34
+ blocksDraft?: boolean;
29
35
  /**
30
36
  * Steps that are a `<form>` leave this off and let the button submit. The
31
37
  * federal review step is a plain `<div>`, so it passes its handler here.
@@ -15,7 +15,7 @@ interface PaymentFieldProps {
15
15
  }
16
16
  export declare function PaymentField({ label, required, error, info, children }: PaymentFieldProps): import("react").JSX.Element;
17
17
  export declare function paymentInputClass(hasError?: boolean, readOnly?: boolean): string;
18
- export declare function paymentSelectClass(hasError?: boolean): string;
18
+ export declare function paymentSelectClass(hasError?: boolean, readOnly?: boolean): string;
19
19
  declare function ChevronDownIcon({ className }: {
20
20
  className?: string;
21
21
  }): import("react").JSX.Element;
@@ -2,11 +2,12 @@ interface RecurringPaymentToggleProps {
2
2
  enabled: boolean;
3
3
  onChange: (enabled: boolean) => void;
4
4
  disabled?: boolean;
5
+ helperText?: string;
5
6
  }
6
7
  /**
7
8
  * "Make This a Recurring Payment" panel. When enabled, the caller adds each occurrence
8
- * explicitly ("+ Add New" in the Tax Periods & Amounts section below) — every occurrence keeps
9
+ * explicitly ("+ Add New" in the Tax Periods & Amounts section below) - every occurrence keeps
9
10
  * its own Tax Period, Tax Amount, and Payment Date, submitted together as one series.
10
11
  */
11
- export declare function RecurringPaymentToggle({ enabled, onChange, disabled, }: RecurringPaymentToggleProps): import("react").JSX.Element;
12
+ export declare function RecurringPaymentToggle({ enabled, onChange, disabled, helperText, }: RecurringPaymentToggleProps): import("react").JSX.Element;
12
13
  export {};
@@ -5,15 +5,20 @@ interface SignatureFieldGroupProps {
5
5
  signature: UseFormRegisterReturn;
6
6
  title: UseFormRegisterReturn;
7
7
  date: UseFormRegisterReturn;
8
+ /** Adds a signer-name cell between the signature and the title — state authorizations ask for it. */
9
+ signerName?: UseFormRegisterReturn;
10
+ signerNameCaption?: string;
11
+ signerNamePlaceholder?: string;
8
12
  signatureValue: string;
9
13
  dateValue?: string;
10
14
  dateReadOnly?: boolean;
11
15
  errors?: {
12
16
  signature?: string;
17
+ signerName?: string;
13
18
  title?: string;
14
19
  date?: string;
15
20
  };
16
21
  signatureCaption?: string;
17
22
  }
18
- export declare function SignatureFieldGroup({ label, required, signature, title, date, signatureValue, dateValue, dateReadOnly, errors, signatureCaption, }: SignatureFieldGroupProps): import("react").JSX.Element;
23
+ export declare function SignatureFieldGroup({ label, required, signature, title, date, signerName, signerNameCaption, signerNamePlaceholder, signatureValue, dateValue, dateReadOnly, errors, signatureCaption, }: SignatureFieldGroupProps): import("react").JSX.Element;
19
24
  export {};
@@ -26,6 +26,13 @@ export declare function getSubcategoryCodeLabels(taxFormType: string): {
26
26
  export declare function isValidAmountField(value: string): boolean;
27
27
  export declare function sanitizeFederalAmountInput(raw: string): string;
28
28
  export declare function parseAmountField(value: string): number | null;
29
+ /**
30
+ * Settle a half-typed amount when the field loses focus: `123` becomes
31
+ * `123.00`, `123.4` becomes `123.40`, `12.` becomes `12.00`. An empty field is
32
+ * left empty — a blank is "not filled in yet", not zero — and anything that
33
+ * isn't a number is returned untouched so validation can report it as typed.
34
+ */
35
+ export declare function formatAmountFieldOnBlur(value: string): string;
29
36
  export declare function sumSubcategoryAmounts(amount1: string, amount2: string, amount3: string, includeAmount3: boolean): number;
30
37
  export declare function amountsEqual(left: number, right: number): boolean;
31
38
  /** Maps subcategory amounts to IRS API codes ("1", "2", "3") per Tax1099 backend. */
@@ -1,7 +1,11 @@
1
1
  export declare const authorizationTaxForms: readonly ["720", "940", "941", "943", "944", "945", "990-PF", "990-T", "1041", "1042", "1120", "CT-1"];
2
2
  export type AuthorizationTaxForm = (typeof authorizationTaxForms)[number];
3
- /** Line 16 of Form 8655 only lists these forms — no "Other" option exists on the
4
- * real form, so an unmatched tax form type is left unselected. */
5
- export declare function resolveAuthorizedTaxForm(taxFormType: string): AuthorizationTaxForm | '';
3
+ /** Everything Line 16 of Form 8655 doesn't list falls under this option. */
4
+ export declare const otherAuthorizationTaxForm = "Other";
5
+ /** Line 16 of Form 8655 lists the forms above; anything else is authorized
6
+ * under "Other", which carries the form type through as-is. */
7
+ export declare function resolveAuthorizedTaxForm(taxFormType: string): string;
8
+ /** True once a form type is set but isn't one Line 16 names. */
9
+ export declare function isOtherAuthorizedTaxForm(value: string): boolean;
6
10
  export declare const authorizationAgreementLead = "I understand that this agreement does not relieve me, as the taxpayer, of the responsibility to ensure that all tax returns are filed and that all deposits and payments are made and that I may enroll in the Electronic Federal Tax Payment System (EFTPS) to view deposits and payments made on my behalf.";
7
11
  export declare const authorizationAgreementBody = "I further understand that this agreement does not authorize the reporting agent to sign any tax returns, to otherwise act as a legal representative of the taxpayer, or to represent the taxpayer before the IRS. I also understand that the reporting agent is not responsible for any penalties or interest that may be assessed against the taxpayer. I authorize the reporting agent to complete Form 8655, Reporting Agent Authorization, and to make deposits and payments on my behalf for the tax return(s) indicated above. I also authorize the reporting agent to receive confidential information and to perform acts as specified on Form 2848, Power of Attorney and Declaration of Representative, or Form 8821, Tax Information Authorization, as applicable.";
@@ -1,2 +1,3 @@
1
- export declare const statePaymentAuthorizationText = "Before your payment is processed, please review the information carefully. By proceeding, you authorize to initiate this payment to the selected tax authority using your chosen bank account. You acknowledge that you are responsible for ensuring the accuracy of the payment information and for complying with all applicable tax filing and payment requirements.";
2
- export declare const statePaymentAuthorizationCheckboxLabel = "I have reviewed the details and authorize this payment.";
1
+ export declare const statePaymentAuthorizationIntro = "By signing below, you authorize Govpay Payments to initiate this tax payment using the payment details you provided.";
2
+ export declare const statePaymentAuthorizationAcknowledgements: string[];
3
+ export declare const statePaymentAuthorizationClosing = "By signing, you confirm that you are authorized to act on behalf of the taxpayer or business listed above.";
@@ -6,7 +6,7 @@ interface EditEntityFormProps {
6
6
  }
7
7
  /**
8
8
  * Edit Entity form — same composition as the Add Entity form (EntityForm), with
9
- * the identifier locked and no filing status, which the update payload omits.
9
+ * the identifier locked. Filing Status is editable here too, same as at creation.
10
10
  */
11
11
  export declare function EditEntityForm({ entity, onCancel, onSaved }: EditEntityFormProps): import("react").JSX.Element;
12
12
  export {};
@@ -14,9 +14,11 @@ export type TaxAccountDrawerValues = z.infer<typeof taxAccountSchema>;
14
14
  interface TaxAccountDrawerProps {
15
15
  open: boolean;
16
16
  entityId: number | null;
17
- /** When set, the drawer edits this account instead of creating one. */
17
+ /** When set, the drawer edits (or, with `readOnly`, displays) this account instead of creating one. */
18
18
  account?: TaxAccountDetailResponse | null;
19
+ /** Renders every field disabled with a single "Close" action — the Figma "View" state. */
20
+ readOnly?: boolean;
19
21
  onClose: () => void;
20
22
  }
21
- export declare function TaxAccountDrawer({ open, entityId, account, onClose }: TaxAccountDrawerProps): import("react").JSX.Element;
23
+ export declare function TaxAccountDrawer({ open, entityId, account, readOnly, onClose }: TaxAccountDrawerProps): import("react").JSX.Element;
22
24
  export {};
@@ -0,0 +1,35 @@
1
+ import { CSSProperties, RefObject } from 'react';
2
+ interface AnchoredLayerOptions {
3
+ open: boolean;
4
+ /** The trigger the layer hangs off. */
5
+ anchorRef: RefObject<HTMLElement | null>;
6
+ /** The floating element itself — needed so a click inside it is not "outside". */
7
+ layerRef: RefObject<HTMLElement | null>;
8
+ onDismiss: () => void;
9
+ /** `anchor` matches the trigger's width (dropdowns); a number pins it (menus). */
10
+ width?: number | 'anchor';
11
+ /** `end` right-aligns the layer with the trigger, as row menus do. */
12
+ align?: 'start' | 'end';
13
+ gap?: number;
14
+ /** Caps a scrolling list; omit for menus, which are measured instead. */
15
+ maxHeight?: number;
16
+ }
17
+ /**
18
+ * Positions a floating layer against its trigger in viewport coordinates, for
19
+ * use with a portal. Anything rendered this way is immune to the two things
20
+ * that break an `absolute` popup: an ancestor's `overflow` clipping it (the
21
+ * payments table scroller) and a later sibling's stacking context painting over
22
+ * it. Repositions while the page or a drawer scrolls, and handles dismissal on
23
+ * outside click and Escape.
24
+ *
25
+ * Returns `null` until the first measurement, so callers render nothing yet.
26
+ */
27
+ export declare function useAnchoredLayer({ open, anchorRef, layerRef, onDismiss, width, align, gap, maxHeight, }: AnchoredLayerOptions): CSSProperties | null;
28
+ /**
29
+ * Where a floating layer is mounted. The widget's own root rather than
30
+ * `document.body`: the `--embedded-*` tokens the gov-* palette reads are scoped
31
+ * to `.tax-remittance-embedded`, and outside it those colours fall back to the
32
+ * unthemed defaults.
33
+ */
34
+ export declare function getLayerHost(anchor: HTMLElement | null): HTMLElement | null;
35
+ export {};
@@ -10,9 +10,7 @@ export interface PortalOutletContext {
10
10
  setSelectedEntityId: (entityId: number) => void;
11
11
  }
12
12
  /**
13
- * Minimal shell for the embedded widget — no sidebar, no header branding.
14
- * Renders a compact top bar with:
15
- * - Entity selector (dropdown) when multiple entities exist
16
- * - Back button when on a sub-page
13
+ * Minimal shell for the embedded widget — no sidebar, no header branding, no
14
+ * top bar. Each page carries its own heading and back affordance.
17
15
  */
18
16
  export declare function EmbeddedLayout(): import("react").JSX.Element;
@@ -13,6 +13,8 @@ export interface EmbeddedWidgetBaseProps {
13
13
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
14
14
  onNavigate?: (routeKey: EmbeddedRouteKey, pathname: string) => void;
15
15
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
16
+ /** Called whenever the widget's active entity changes, from either the host or the widget. */
17
+ onEntityChange?: (entity: EntityDetailsResponse) => void;
16
18
  navigateFnRef: MutableRefObject<((path: string) => void) | null>;
17
19
  selectEntityFnRef: MutableRefObject<((id: number) => void) | null>;
18
20
  /** Payment types this widget instance supports. Controls which dashboard action cards appear. */
@@ -32,4 +34,4 @@ export interface EmbeddedWidgetBaseProps {
32
34
  *
33
35
  * Children should be a <Routes> element with the widget-specific route tree.
34
36
  */
35
- export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, onPaymentRequired, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
37
+ export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, onPaymentRequired, onEntityChange, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
@@ -82,6 +82,13 @@ export interface TaxRemittanceEmbeddedProps {
82
82
  * after the payment succeeds and schedule-after-payment has been called.
83
83
  */
84
84
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
85
+ /**
86
+ * Called whenever the widget's active entity changes — whether the host triggered it via
87
+ * `widgetRef.current?.selectEntity(id)`, or it happened inside the widget itself (e.g. the
88
+ * user clicked an entity card on the Entities list). Use this to keep the host app's own
89
+ * "current entity" state (a header switcher, breadcrumb, etc.) in sync with the widget.
90
+ */
91
+ onEntityChange?: (entity: EntityDetailsResponse) => void;
85
92
  }
86
93
  /**
87
94
  * Full embedded widget — all sections (dashboard, payments, tax forms, settings).