@veevarts/design-system 2.1.0 → 2.2.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.
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
2
  import { InstallmentFundAssignmentProps } from './types';
3
- export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
3
+ export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, showSavedIndicator, isCollapsed, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
@@ -14,6 +14,7 @@ export type InstallmentFundAssignmentEntry = {
14
14
  };
15
15
  export type InstallmentFundAssignmentLabels = {
16
16
  title?: string;
17
+ saved?: string;
17
18
  singleFund?: string;
18
19
  splitFunds?: string;
19
20
  saveAssignment?: string;
@@ -55,6 +56,8 @@ export type InstallmentFundAssignmentProps = {
55
56
  classNames?: InstallmentFundAssignmentClassNames;
56
57
  isSaving?: boolean;
57
58
  hasSavedAssignments?: boolean;
59
+ showSavedIndicator?: boolean;
60
+ isCollapsed?: boolean;
58
61
  isFundPickerOpen?: boolean;
59
62
  activeAssignmentId?: string | null;
60
63
  modalPortalContainer?: Element;
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
2
  import { InstallmentScheduleProps } from './types';
3
- export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, firstInstallmentDateOverride, labels: customLabels, classNames, isSaving, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, }: InstallmentScheduleProps): JSX.Element;
3
+ export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, firstInstallmentDateOverride, labels: customLabels, classNames, isSaving, showSavedIndicator, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, onCancel, }: InstallmentScheduleProps): JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
2
  import { InstallmentTableProps } from './types';
3
- export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
3
+ export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, showSavedIndicator, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
@@ -4,9 +4,18 @@ export type InstallmentFrequency = 'weekly' | 'monthly' | 'quarterly' | 'annual'
4
4
  export type InstallmentStatus = 'scheduled' | 'paid' | 'payment_due' | 'overdue' | 'failed' | 'refunded' | 'disputed' | 'canceled' | 'processing' | 'pending_confirmation';
5
5
  export type ScheduledInstallment = {
6
6
  id: string;
7
+ name?: string | null;
7
8
  dueDate: string;
8
9
  amount: number;
9
10
  status?: InstallmentStatus | (string & {});
11
+ /**
12
+ * When the installment was actually paid: a calendar date (`YYYY-MM-DD`)
13
+ * or an ISO timestamp (shown in the viewer's timezone). Named after the
14
+ * field the commitments API already returns for this, so installments
15
+ * passed straight through from the API carry it without any mapping.
16
+ * `InstallmentTable` shows it on `paid` rows only; omit it to show none.
17
+ */
18
+ fulfilledAt?: string | null;
10
19
  };
11
20
  export type AutomaticScheduleSettings = {
12
21
  numberOfInstallments: number;
@@ -16,11 +25,13 @@ export type AutomaticScheduleSettings = {
16
25
  export type InstallmentScheduleInput = keyof AutomaticScheduleSettings | 'dayOfMonth';
17
26
  export type InstallmentScheduleLabels = {
18
27
  title?: string;
28
+ saved?: string;
19
29
  automaticMode?: string;
20
30
  manualMode?: string;
21
31
  createInstallments?: string;
22
32
  generateSchedule?: string;
23
33
  saveInstallments?: string;
34
+ cancelEdit?: string;
24
35
  addInstallment?: string;
25
36
  emptyAutomatic?: string;
26
37
  emptyManual?: string;
@@ -45,6 +56,8 @@ export type InstallmentScheduleLabels = {
45
56
  totalIncreaseConfirmationCancel?: string;
46
57
  totalIncreaseConfirmationConfirm?: string;
47
58
  dateOrderError?: string;
59
+ /** Inline error on a manual row whose payment date was cleared or left incomplete. */
60
+ dueDateRequiredError?: string;
48
61
  amountGreaterThanZeroError?: string;
49
62
  };
50
63
  export type InstallmentScheduleClassNames = {
@@ -90,20 +103,25 @@ export type InstallmentScheduleProps = {
90
103
  labels?: InstallmentScheduleLabels;
91
104
  classNames?: InstallmentScheduleClassNames;
92
105
  isSaving?: boolean;
106
+ showSavedIndicator?: boolean;
93
107
  isModeSwitchDisabled?: boolean;
94
108
  onModeChange?: (mode: InstallmentScheduleMode) => void;
95
109
  onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
96
110
  onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
97
111
  onSave?: () => void;
112
+ onCancel?: () => void;
98
113
  };
99
114
  export type InstallmentTableLabels = {
100
115
  title?: string;
116
+ saved?: string;
101
117
  searchLabel?: string;
102
118
  searchPlaceholder?: string;
103
119
  editInstallments?: string;
104
120
  installmentId?: string;
105
121
  amount?: string;
106
122
  scheduledDate?: string;
123
+ /** Prefix of the paid date shown under the scheduled date of a paid row: "Paid on Jun 3, 2026". */
124
+ paidOn?: string;
107
125
  status?: string;
108
126
  actions?: string;
109
127
  payNow?: string;
@@ -137,6 +155,7 @@ export type InstallmentTableProps = {
137
155
  * applies to any Pay Now button that IS rendered. Defaults to `[]`.
138
156
  */
139
157
  payNowHiddenStatuses?: InstallmentStatus[];
158
+ showSavedIndicator?: boolean;
140
159
  labels?: InstallmentTableLabels;
141
160
  isSaving?: boolean;
142
161
  onEditInstallments: () => void;
@@ -1,6 +1,21 @@
1
1
  import { AutomaticScheduleSettings, ScheduledInstallment } from './types';
2
2
  export declare function generateAutomaticInstallments(donationAmount: number, settings: AutomaticScheduleSettings): ScheduledInstallment[];
3
3
  export declare function getInvalidDateRowIds(installments: ScheduledInstallment[]): Set<string>;
4
+ export type ManualRowErrors = {
5
+ /** Rows with no due date: the date picker reports a cleared or incomplete date as `''`. */
6
+ missingDateRows: Set<string>;
7
+ /** Rows dated after the next row. */
8
+ invalidDateRows: Set<string>;
9
+ /** Rows whose amount is not greater than zero. */
10
+ invalidAmountRows: Set<string>;
11
+ };
12
+ /**
13
+ * Every inline error a manual schedule can show, computed once so the rows
14
+ * that render the messages and the Save button that must refuse them can
15
+ * never disagree.
16
+ */
17
+ export declare function getManualRowErrors(installments: ScheduledInstallment[]): ManualRowErrors;
18
+ export declare function hasManualRowErrors(errors: ManualRowErrors): boolean;
4
19
  /**
5
20
  * Re-dates installment #1 without touching the rest of the schedule.
6
21
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.1.0",
4
+ "version": "2.2.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",