@veevarts/design-system 2.0.0-alpha.7 → 2.0.0-alpha.9

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, }: 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,6 +4,7 @@ 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 & {});
@@ -16,6 +17,7 @@ export type AutomaticScheduleSettings = {
16
17
  export type InstallmentScheduleInput = keyof AutomaticScheduleSettings | 'dayOfMonth';
17
18
  export type InstallmentScheduleLabels = {
18
19
  title?: string;
20
+ saved?: string;
19
21
  automaticMode?: string;
20
22
  manualMode?: string;
21
23
  createInstallments?: string;
@@ -71,9 +73,26 @@ export type InstallmentScheduleProps = {
71
73
  showTabs?: boolean;
72
74
  inputs?: InstallmentScheduleInput[];
73
75
  startDate?: string;
76
+ /**
77
+ * Automatic mode only. Dates installment #1 on this day instead of the day
78
+ * the generated cadence would put it on. Installments #2..N keep the
79
+ * generated cadence untouched.
80
+ *
81
+ * For flows where the first charge happens when the plan is COMMITTED
82
+ * while the schedule anchors on a later term start: a plan created today
83
+ * with a term starting next month charges #1 today, then follows the term.
84
+ * Without this the first charge silently moves to the term start, and the
85
+ * schedule on screen stops matching the one that gets persisted.
86
+ *
87
+ * Ignored in manual mode, where the host already owns every date, and
88
+ * ignored when `firstInstallmentDate` is one of `inputs` — there the user
89
+ * picks that date themselves and the schedule must agree with the field.
90
+ */
91
+ firstInstallmentDateOverride?: string;
74
92
  labels?: InstallmentScheduleLabels;
75
93
  classNames?: InstallmentScheduleClassNames;
76
94
  isSaving?: boolean;
95
+ showSavedIndicator?: boolean;
77
96
  isModeSwitchDisabled?: boolean;
78
97
  onModeChange?: (mode: InstallmentScheduleMode) => void;
79
98
  onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
@@ -82,6 +101,7 @@ export type InstallmentScheduleProps = {
82
101
  };
83
102
  export type InstallmentTableLabels = {
84
103
  title?: string;
104
+ saved?: string;
85
105
  searchLabel?: string;
86
106
  searchPlaceholder?: string;
87
107
  editInstallments?: string;
@@ -121,6 +141,7 @@ export type InstallmentTableProps = {
121
141
  * applies to any Pay Now button that IS rendered. Defaults to `[]`.
122
142
  */
123
143
  payNowHiddenStatuses?: InstallmentStatus[];
144
+ showSavedIndicator?: boolean;
124
145
  labels?: InstallmentTableLabels;
125
146
  isSaving?: boolean;
126
147
  onEditInstallments: () => void;
@@ -1,3 +1,15 @@
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
+ /**
5
+ * Re-dates installment #1 without touching the rest of the schedule.
6
+ *
7
+ * The generator produces one uniform cadence from a single anchor, which
8
+ * cannot express "charge #1 today, then follow the term start". This applies
9
+ * that shape on top: only the first date moves, and only when an override is
10
+ * given and it actually differs.
11
+ *
12
+ * Amounts are never touched — the first-installment rounding remainder stays
13
+ * where the generator put it.
14
+ */
15
+ 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-alpha.7",
4
+ "version": "2.0.0-alpha.9",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",