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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 {};
@@ -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 {};
@@ -77,4 +77,10 @@ export declare function useEntityForm(): {
77
77
  handleAccountTypeChange: (next: EntityFormValues["accountType"]) => void;
78
78
  handleCancel: () => void;
79
79
  goToDashboard: () => void;
80
+ enabledPayments: import('../../embedded/EmbeddedContext').PaymentType[];
81
+ isPaymentPickerOpen: boolean;
82
+ startPayment: () => void;
83
+ closePaymentPicker: () => void;
84
+ startFederalPayment: () => void;
85
+ startStatePayment: () => void;
80
86
  };
@@ -0,0 +1,25 @@
1
+ export interface CustomSelectOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ /** Small pill shown to the right of the label (e.g. "Coming Soon") — plain text, no markup. */
6
+ badge?: string;
7
+ }
8
+ interface CustomSelectProps {
9
+ value: string;
10
+ onChange: (value: string) => void;
11
+ options: CustomSelectOption[];
12
+ placeholder: string;
13
+ disabled?: boolean;
14
+ hasError?: boolean;
15
+ loading?: boolean;
16
+ loadingLabel?: string;
17
+ }
18
+ /**
19
+ * The one dropdown implementation every field in the State Payment form shares, so hover/focus/
20
+ * selected styling stays identical everywhere (border-gov-400 / bg-gov-50, matching the app's
21
+ * existing focus-ring accent) — a native <select>'s option list is OS-rendered chrome the page
22
+ * can't restyle, and can't show a badge (see the Reason for Payment "Coming Soon" case) at all.
23
+ */
24
+ export declare function CustomSelect({ value, onChange, options, placeholder, disabled, hasError, loading, loadingLabel, }: CustomSelectProps): import("react").JSX.Element;
25
+ export {};
@@ -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
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 {};
@@ -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 Zenwork 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.";
@@ -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 {};
@@ -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).