@veevarts/design-system 1.13.1 → 1.14.0-beta.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,5 +1,6 @@
1
1
  import { InstallmentFundAssignmentEntry, InstallmentFundAssignmentMode } from './types';
2
2
  export declare const createEmptyAssignment: () => InstallmentFundAssignmentEntry;
3
+ export declare function isEmptyAssignmentDraft(assignment: InstallmentFundAssignmentEntry): boolean;
3
4
  export declare function getAssignmentsForModeChange({ nextMode, assignments, previousSingleAssignments, previousSplitAssignments, }: {
4
5
  nextMode: InstallmentFundAssignmentMode;
5
6
  assignments: InstallmentFundAssignmentEntry[];
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
2
  import { InstallmentScheduleProps } from './types';
3
- export declare function InstallmentSchedule({ mode, donationAmount, currency, locale, installments, automaticSettings, 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, labels: customLabels, classNames, isSaving, 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, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
3
+ export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
@@ -2,4 +2,4 @@ export { InstallmentSchedule } from './InstallmentSchedule';
2
2
  export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
3
3
  export { InstallmentTable } from './InstallmentTable';
4
4
  export { generateAutomaticInstallments } from './utils';
5
- export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, ScheduledInstallment, } from './types';
5
+ export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, ScheduledInstallment, } from './types';
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type InstallmentScheduleMode = 'automatic' | 'manual';
3
- export type InstallmentFrequency = 'monthly' | 'quarterly' | 'annual';
3
+ export type InstallmentFrequency = 'weekly' | 'monthly' | 'quarterly' | 'annual';
4
4
  export type ScheduledInstallment = {
5
5
  id: string;
6
6
  dueDate: string;
@@ -12,6 +12,7 @@ export type AutomaticScheduleSettings = {
12
12
  frequency: InstallmentFrequency;
13
13
  firstInstallmentDate: string;
14
14
  };
15
+ export type InstallmentScheduleInput = keyof AutomaticScheduleSettings | 'dayOfMonth';
15
16
  export type InstallmentScheduleLabels = {
16
17
  title?: string;
17
18
  automaticMode?: string;
@@ -24,6 +25,7 @@ export type InstallmentScheduleLabels = {
24
25
  emptyManual?: string;
25
26
  numberOfInstallments?: string;
26
27
  frequency?: string;
28
+ dayOfMonth?: string;
27
29
  firstInstallmentDate?: string;
28
30
  installment?: string;
29
31
  dueDate?: string;
@@ -31,6 +33,7 @@ export type InstallmentScheduleLabels = {
31
33
  total?: string;
32
34
  remaining?: string;
33
35
  deleteInstallment?: string;
36
+ weekly?: string;
34
37
  monthly?: string;
35
38
  quarterly?: string;
36
39
  annual?: string;
@@ -48,23 +51,33 @@ export type InstallmentScheduleClassNames = {
48
51
  panel?: string;
49
52
  header?: string;
50
53
  tabs?: string;
54
+ controls?: string;
55
+ preview?: string;
56
+ summary?: string;
51
57
  content?: string;
52
58
  };
53
59
  export type InstallmentScheduleProps = {
54
- mode: InstallmentScheduleMode;
60
+ mode?: InstallmentScheduleMode;
55
61
  donationAmount: number;
56
62
  currency?: string;
57
63
  locale?: string;
58
64
  installments: ScheduledInstallment[];
59
65
  automaticSettings: AutomaticScheduleSettings;
66
+ defaultTab?: InstallmentScheduleMode;
67
+ showTitle?: boolean;
68
+ showCard?: boolean;
69
+ showSavePayment?: boolean;
70
+ showTabs?: boolean;
71
+ inputs?: InstallmentScheduleInput[];
72
+ startDate?: string;
60
73
  labels?: InstallmentScheduleLabels;
61
74
  classNames?: InstallmentScheduleClassNames;
62
75
  isSaving?: boolean;
63
76
  isModeSwitchDisabled?: boolean;
64
- onModeChange: (mode: InstallmentScheduleMode) => void;
77
+ onModeChange?: (mode: InstallmentScheduleMode) => void;
65
78
  onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
66
79
  onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
67
- onSave: () => void;
80
+ onSave?: () => void;
68
81
  };
69
82
  export type InstallmentTableLabels = {
70
83
  title?: string;
@@ -92,6 +105,9 @@ export type InstallmentTableProps = {
92
105
  installments: ScheduledInstallment[];
93
106
  currency: string;
94
107
  locale?: string;
108
+ showTitle?: boolean;
109
+ showCard?: boolean;
110
+ showEditPayment?: boolean;
95
111
  labels?: InstallmentTableLabels;
96
112
  isSaving?: boolean;
97
113
  onEditInstallments: () => void;
@@ -20,6 +20,18 @@ export declare const DRAG_TOGGLE_THRESHOLD = 60;
20
20
  export declare const shouldToggleOnDrag: (offsetY: number, open: boolean, threshold?: number) => boolean;
21
21
  /** Clamp a proposed reveal height into `[0, fullHeight]`. */
22
22
  export declare const clampRevealHeight: (proposed: number, fullHeight: number) => number;
23
+ /**
24
+ * Vertical viewport space reserved for the sheet's chrome around the reveal
25
+ * panel (collapse header + action bar + the sheet paddings). Exported so the
26
+ * cap is testable and tunable.
27
+ */
28
+ export declare const SHEET_CHROME_PX = 160;
29
+ /**
30
+ * Cap the panel's natural height to the room the viewport leaves after the
31
+ * sheet chrome, so the OPEN sheet never outgrows the screen — taller content
32
+ * scrolls inside the reveal panel instead.
33
+ */
34
+ export declare const capRevealHeight: (naturalHeight: number, viewportHeight: number, chrome?: number) => number;
23
35
  /**
24
36
  * Live reveal height while dragging: dragging **up** (negative `offsetY`) grows
25
37
  * the panel from its `baseHeight`; dragging **down** shrinks it. Clamped to the
@@ -121,12 +121,19 @@ export interface SummaryProps {
121
121
  */
122
122
  collapsible?: boolean;
123
123
  /**
124
- * Controlled open/closed state. Defaults to **closed** when collapsible (the
125
- * mobile sheet rests collapsed) and always open on the non-collapsible card.
124
+ * Controlled open/closed state. OMIT it and the component manages the
125
+ * state itself (uncontrolled every toggle surface just works), starting
126
+ * at {@link defaultOpen}. The non-collapsible card is always open.
126
127
  */
127
128
  isOpen?: boolean;
128
- /** Fires when the header (open) — or the closed bar's Total (closed) — is activated to toggle. */
129
+ /**
130
+ * Fires when the header (open) — or the closed bar's Total (closed) — is
131
+ * activated to toggle. Uncontrolled summaries flip themselves AND still
132
+ * notify through this callback.
133
+ */
129
134
  onToggleOpen?: () => void;
135
+ /** Initial open state when uncontrolled. Defaults to `false` (the mobile sheet rests collapsed). */
136
+ defaultOpen?: boolean;
130
137
  /** The primary CTA. */
131
138
  primaryAction?: SummaryPrimaryAction;
132
139
  /** When provided, item rows show a red trash remove control. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "1.13.1",
4
+ "version": "1.14.0-beta.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",