@veevarts/design-system 1.13.1 → 1.14.0-alpha.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.
- package/dist/index.cjs +4 -4
- package/dist/index.js +3901 -3618
- package/dist/patterns/InstallmentFundAssignment/utils.d.ts +1 -0
- package/dist/patterns/InstallmentSchedule/InstallmentSchedule.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/index.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/types.d.ts +20 -4
- package/dist/patterns/Summary/components/ActionBar.d.ts +2 -0
- package/dist/patterns/Summary/components/ItemRow.d.ts +2 -0
- package/dist/patterns/Summary/components/SecondaryTotalRow.d.ts +11 -0
- package/dist/patterns/Summary/components/SummaryBody.d.ts +2 -0
- package/dist/patterns/Summary/drag.d.ts +12 -0
- package/dist/patterns/Summary/index.d.ts +1 -1
- package/dist/patterns/Summary/types.d.ts +62 -3
- package/dist/patterns/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
77
|
+
onModeChange?: (mode: InstallmentScheduleMode) => void;
|
|
65
78
|
onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
|
|
66
79
|
onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
|
|
67
|
-
onSave
|
|
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;
|
|
@@ -10,6 +10,8 @@ export interface ActionBarProps {
|
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
cart?: SummaryProps['cart'];
|
|
12
12
|
cartAriaLabel: string;
|
|
13
|
+
/** Optional caption rendered under the open-layer CTA (e.g. installment breakdown). */
|
|
14
|
+
ctaCaption?: React.ReactNode;
|
|
13
15
|
/** Expand the summary — the closed-bar cart button opens it on click. */
|
|
14
16
|
onToggleOpen?: () => void;
|
|
15
17
|
classNames: SummaryClassNames;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Money } from '../types';
|
|
3
|
+
export interface SecondaryTotalRowProps {
|
|
4
|
+
secondaryTotal: {
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
amount: Money;
|
|
7
|
+
};
|
|
8
|
+
locale: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const SecondaryTotalRow: React.FC<SecondaryTotalRowProps>;
|
|
@@ -9,6 +9,8 @@ export interface SummaryBodyProps {
|
|
|
9
9
|
locale: string;
|
|
10
10
|
onRemoveItem?: (id: string) => void;
|
|
11
11
|
removeAriaLabel: string;
|
|
12
|
+
/** Show the per-item remove control. Defaults to `true`. */
|
|
13
|
+
showRemoveButton?: boolean;
|
|
12
14
|
emptyState?: React.ReactNode;
|
|
13
15
|
classNames: SummaryClassNames;
|
|
14
16
|
}
|
|
@@ -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
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Total + CTA, and a compact mobile bottom-bar.
|
|
5
5
|
*/
|
|
6
6
|
export { Summary } from './Summary';
|
|
7
|
-
export type { SummaryProps, SummaryLineItem, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
7
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Money } from '../../utils/money';
|
|
3
3
|
export type { Money } from '../../utils/money';
|
|
4
|
+
/**
|
|
5
|
+
* A generic, parametrizable detail row rendered under a line item — an icon +
|
|
6
|
+
* label, an optional right-aligned value, and an optional info tooltip. It is
|
|
7
|
+
* intentionally agnostic: the host composes whatever the design needs (e.g. an
|
|
8
|
+
* auto-renewal note, a "pay by installments" line, a fulfilment hint) without
|
|
9
|
+
* the Summary pattern knowing those domains. The existing `dateLabel` /
|
|
10
|
+
* `dateRange` slots stay as dedicated rows; this covers everything else.
|
|
11
|
+
*/
|
|
12
|
+
export interface SummaryItemDetail {
|
|
13
|
+
/** Stable key for `data-testid` (falls back to the row index). */
|
|
14
|
+
key?: string;
|
|
15
|
+
/** Leading icon node (e.g. `lucide:refresh-cw`, `lucide:scissors`). */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** Left label (rendered muted, like the date rows). */
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
/** Optional right-aligned value (e.g. "$4.23 / month"). */
|
|
20
|
+
value?: ReactNode;
|
|
21
|
+
/** Tone of the value: `'primary'` paints it in the primary color; default inherits the muted label tone. */
|
|
22
|
+
valueTone?: 'default' | 'primary';
|
|
23
|
+
/** When set, an info icon next to the value reveals this content in a tooltip. */
|
|
24
|
+
tooltip?: ReactNode;
|
|
25
|
+
}
|
|
4
26
|
/**
|
|
5
27
|
* A single, flexible line item. The four Figma "types" (Ticket, Event,
|
|
6
28
|
* Membership, Donation) are compositions of this one shape — not rigid
|
|
@@ -28,6 +50,12 @@ export interface SummaryLineItem {
|
|
|
28
50
|
};
|
|
29
51
|
/** Nested rows, indented (Event's Adult / Children). */
|
|
30
52
|
children?: SummaryLineItem[];
|
|
53
|
+
/**
|
|
54
|
+
* Extra detail rows rendered under the item (after any date row). Generic
|
|
55
|
+
* and agnostic — see {@link SummaryItemDetail}. Used e.g. by membership to
|
|
56
|
+
* show an auto-renewal note and a pay-by-installments line.
|
|
57
|
+
*/
|
|
58
|
+
details?: SummaryItemDetail[];
|
|
31
59
|
}
|
|
32
60
|
/** The "Pay Service fee" radio-toggle row. */
|
|
33
61
|
export interface SummaryServiceFee {
|
|
@@ -86,8 +114,12 @@ export interface SummaryClassNames {
|
|
|
86
114
|
totalsRows?: string;
|
|
87
115
|
/** The Total row. */
|
|
88
116
|
total?: string;
|
|
117
|
+
/** The secondary (primary-colored) total row under the Total. */
|
|
118
|
+
secondaryTotal?: string;
|
|
89
119
|
/** Primary CTA button. */
|
|
90
120
|
cta?: string;
|
|
121
|
+
/** The caption rendered under the CTA. */
|
|
122
|
+
ctaCaption?: string;
|
|
91
123
|
/** Mobile compact bottom-bar. */
|
|
92
124
|
mobileBar?: string;
|
|
93
125
|
/** Mobile cart button. */
|
|
@@ -113,6 +145,26 @@ export interface SummaryProps {
|
|
|
113
145
|
label?: ReactNode;
|
|
114
146
|
amount: Money;
|
|
115
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* An optional secondary total rendered right under the Total, in the primary
|
|
150
|
+
* color (e.g. "Due Today"). Purely presentational — the host supplies both
|
|
151
|
+
* the label and the already-computed amount.
|
|
152
|
+
*/
|
|
153
|
+
secondaryTotal?: {
|
|
154
|
+
label: ReactNode;
|
|
155
|
+
amount: Money;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* An optional caption rendered under the CTA, in muted text (e.g. an
|
|
159
|
+
* installment breakdown like "$50.75 total · 12 monthly installments…").
|
|
160
|
+
*/
|
|
161
|
+
ctaCaption?: ReactNode;
|
|
162
|
+
/**
|
|
163
|
+
* Whether the per-item remove (trash) control is shown. Defaults to `true`;
|
|
164
|
+
* pass `false` to hide it even when `onRemoveItem` is wired. Independent of
|
|
165
|
+
* `onRemoveItem` so a host can keep the handler but suppress the control.
|
|
166
|
+
*/
|
|
167
|
+
showRemoveButton?: boolean;
|
|
116
168
|
/**
|
|
117
169
|
* Whether the summary can collapse — the header shows a `×` and the whole
|
|
118
170
|
* header toggles Open/Closed. Defaults to `variant === 'mobile'` (including
|
|
@@ -121,12 +173,19 @@ export interface SummaryProps {
|
|
|
121
173
|
*/
|
|
122
174
|
collapsible?: boolean;
|
|
123
175
|
/**
|
|
124
|
-
* Controlled open/closed state.
|
|
125
|
-
*
|
|
176
|
+
* Controlled open/closed state. OMIT it and the component manages the
|
|
177
|
+
* state itself (uncontrolled — every toggle surface just works), starting
|
|
178
|
+
* at {@link defaultOpen}. The non-collapsible card is always open.
|
|
126
179
|
*/
|
|
127
180
|
isOpen?: boolean;
|
|
128
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Fires when the header (open) — or the closed bar's Total (closed) — is
|
|
183
|
+
* activated to toggle. Uncontrolled summaries flip themselves AND still
|
|
184
|
+
* notify through this callback.
|
|
185
|
+
*/
|
|
129
186
|
onToggleOpen?: () => void;
|
|
187
|
+
/** Initial open state when uncontrolled. Defaults to `false` (the mobile sheet rests collapsed). */
|
|
188
|
+
defaultOpen?: boolean;
|
|
130
189
|
/** The primary CTA. */
|
|
131
190
|
primaryAction?: SummaryPrimaryAction;
|
|
132
191
|
/** When provided, item rows show a red trash remove control. */
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -66,4 +66,4 @@ export type { PaymentSubAmountInputProps } from './PaymentSubAmountInput';
|
|
|
66
66
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
67
67
|
export type { ConfirmDialogProps } from './ConfirmDialog';
|
|
68
68
|
export { Summary } from './Summary';
|
|
69
|
-
export type { SummaryProps, SummaryLineItem, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|
|
69
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|