@veevarts/design-system 2.0.0 → 2.1.0-beta.2

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, 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;
@@ -1,5 +1,5 @@
1
1
  export { InstallmentSchedule } from './InstallmentSchedule';
2
2
  export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
3
3
  export { InstallmentTable } from './InstallmentTable';
4
- export { generateAutomaticInstallments } from './utils';
4
+ export { applyFirstInstallmentDateOverride, generateAutomaticInstallments } from './utils';
5
5
  export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, InstallmentStatus, ScheduledInstallment, } from './types';
@@ -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 = {
@@ -71,23 +84,44 @@ export type InstallmentScheduleProps = {
71
84
  showTabs?: boolean;
72
85
  inputs?: InstallmentScheduleInput[];
73
86
  startDate?: string;
87
+ /**
88
+ * Automatic mode only. Dates installment #1 on this day instead of the day
89
+ * the generated cadence would put it on. Installments #2..N keep the
90
+ * generated cadence untouched.
91
+ *
92
+ * For flows where the first charge happens when the plan is COMMITTED
93
+ * while the schedule anchors on a later term start: a plan created today
94
+ * with a term starting next month charges #1 today, then follows the term.
95
+ * Without this the first charge silently moves to the term start, and the
96
+ * schedule on screen stops matching the one that gets persisted.
97
+ *
98
+ * Ignored in manual mode, where the host already owns every date, and
99
+ * ignored when `firstInstallmentDate` is one of `inputs` — there the user
100
+ * picks that date themselves and the schedule must agree with the field.
101
+ */
102
+ firstInstallmentDateOverride?: string;
74
103
  labels?: InstallmentScheduleLabels;
75
104
  classNames?: InstallmentScheduleClassNames;
76
105
  isSaving?: boolean;
106
+ showSavedIndicator?: boolean;
77
107
  isModeSwitchDisabled?: boolean;
78
108
  onModeChange?: (mode: InstallmentScheduleMode) => void;
79
109
  onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
80
110
  onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
81
111
  onSave?: () => void;
112
+ onCancel?: () => void;
82
113
  };
83
114
  export type InstallmentTableLabels = {
84
115
  title?: string;
116
+ saved?: string;
85
117
  searchLabel?: string;
86
118
  searchPlaceholder?: string;
87
119
  editInstallments?: string;
88
120
  installmentId?: string;
89
121
  amount?: string;
90
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;
91
125
  status?: string;
92
126
  actions?: string;
93
127
  payNow?: string;
@@ -121,6 +155,7 @@ export type InstallmentTableProps = {
121
155
  * applies to any Pay Now button that IS rendered. Defaults to `[]`.
122
156
  */
123
157
  payNowHiddenStatuses?: InstallmentStatus[];
158
+ showSavedIndicator?: boolean;
124
159
  labels?: InstallmentTableLabels;
125
160
  isSaving?: boolean;
126
161
  onEditInstallments: () => void;
@@ -1,3 +1,30 @@
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;
19
+ /**
20
+ * Re-dates installment #1 without touching the rest of the schedule.
21
+ *
22
+ * The generator produces one uniform cadence from a single anchor, which
23
+ * cannot express "charge #1 today, then follow the term start". This applies
24
+ * that shape on top: only the first date moves, and only when an override is
25
+ * given and it actually differs.
26
+ *
27
+ * Amounts are never touched — the first-installment rounding remainder stays
28
+ * where the generator put it.
29
+ */
30
+ export declare function applyFirstInstallmentDateOverride(installments: ScheduledInstallment[], firstInstallmentDateOverride?: string): ScheduledInstallment[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.0.0",
4
+ "version": "2.1.0-beta.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",