@veevarts/design-system 1.11.0-beta.2 → 1.12.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/components/Select/Select.d.ts +11 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.cjs +36 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7402 -4302
- package/dist/patterns/CashTenderForm/CashTenderForm.d.ts +4 -0
- package/dist/patterns/CashTenderForm/index.d.ts +9 -0
- package/dist/patterns/CashTenderForm/types.d.ts +95 -0
- package/dist/patterns/CheckTenderForm/CheckTenderForm.d.ts +4 -0
- package/dist/patterns/CheckTenderForm/index.d.ts +9 -0
- package/dist/patterns/CheckTenderForm/types.d.ts +62 -0
- package/dist/patterns/CommitmentDetails/CommitmentDetails.d.ts +16 -0
- package/dist/patterns/CommitmentDetails/index.d.ts +2 -0
- package/dist/patterns/ConfirmDialog/ConfirmDialog.d.ts +21 -0
- package/dist/patterns/ConfirmDialog/index.d.ts +2 -0
- package/dist/patterns/ConfirmationModal/ConfirmationModal.d.ts +18 -0
- package/dist/patterns/ConfirmationModal/index.d.ts +2 -0
- package/dist/patterns/EventDetails/EventDetails.d.ts +3 -1
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +3 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignmentSkeleton.d.ts +2 -0
- package/dist/patterns/InstallmentFundAssignment/index.d.ts +3 -0
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +67 -0
- package/dist/patterns/InstallmentSchedule/InstallmentSchedule.d.ts +3 -0
- package/dist/patterns/InstallmentSchedule/InstallmentScheduleSkeleton.d.ts +2 -0
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +3 -0
- package/dist/patterns/InstallmentSchedule/index.d.ts +5 -0
- package/dist/patterns/InstallmentSchedule/types.d.ts +93 -0
- package/dist/patterns/InstallmentSchedule/utils.d.ts +2 -0
- package/dist/patterns/LoadingOverlay/LoadingOverlay.d.ts +18 -0
- package/dist/patterns/LoadingOverlay/index.d.ts +2 -0
- package/dist/patterns/ModalShell/ModalShell.d.ts +40 -0
- package/dist/patterns/ModalShell/index.d.ts +2 -0
- package/dist/patterns/OtherTenderForm/OtherTenderForm.d.ts +4 -0
- package/dist/patterns/OtherTenderForm/index.d.ts +8 -0
- package/dist/patterns/OtherTenderForm/types.d.ts +53 -0
- package/dist/patterns/PaymentCashChangeBanner/PaymentCashChangeBanner.d.ts +35 -0
- package/dist/patterns/PaymentCashChangeBanner/index.d.ts +2 -0
- package/dist/patterns/PaymentSubAmountInput/PaymentSubAmountInput.d.ts +55 -0
- package/dist/patterns/PaymentSubAmountInput/index.d.ts +2 -0
- package/dist/patterns/PaymentSuccessView/PaymentSuccessView.d.ts +30 -0
- package/dist/patterns/PaymentSuccessView/index.d.ts +2 -0
- package/dist/patterns/PaymentTotalBanner/PaymentTotalBanner.d.ts +15 -0
- package/dist/patterns/PaymentTotalBanner/index.d.ts +2 -0
- package/dist/patterns/SplitPaymentSummary/SplitPaymentSummary.d.ts +4 -0
- package/dist/patterns/SplitPaymentSummary/index.d.ts +9 -0
- package/dist/patterns/SplitPaymentSummary/types.d.ts +61 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +39 -0
- package/dist/patterns/TileSelect/index.d.ts +2 -0
- package/dist/patterns/index.d.ts +32 -0
- package/dist/tailwind/index.d.ts +13 -0
- package/dist/tailwind/index.js +13 -0
- package/dist/tokens/colors.d.ts +13 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/money.d.ts +55 -0
- package/package.json +2 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/patterns/DonationAmounts/__test__/DonationAmounts.test.d.ts +0 -4
- package/dist/patterns/EventDetails/__test__/EventDetails.test.d.ts +0 -1
- package/dist/patterns/ExpireCartTimer/__test__/ExpireCartTimer.test.d.ts +0 -4
- package/dist/patterns/Footer/__test__/Footer.test.d.ts +0 -1
- package/dist/patterns/ItemCard/__test__/ItemCard.test.d.ts +0 -4
- package/dist/patterns/MembershipSelectCards/__test__/MembershipSelectCards.test.d.ts +0 -4
- package/dist/patterns/Multiselect/__test__/Multiselect.test.d.ts +0 -4
- package/dist/patterns/Navbar/__test__/Navbar.test.d.ts +0 -1
- package/dist/patterns/OfferCard/__test__/OfferCard.test.d.ts +0 -1
- package/dist/patterns/RevenueDistribution/__test__/RevenueDistributionCard.test.d.ts +0 -1
- package/dist/patterns/RichText/RichText.test.d.ts +0 -1
- package/dist/patterns/RichText/core/TipTapEditor.test.d.ts +0 -1
- package/dist/patterns/Stepper/Stepper.test.d.ts +0 -4
- package/dist/patterns/TicketSelection/__test__/TicketSelection.test.d.ts +0 -4
- package/dist/patterns/Toggle/__test__/Toggle.test.d.ts +0 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CashTenderForm Pattern
|
|
3
|
+
*
|
|
4
|
+
* Pure-UI primitive for cash tender entry with change calculation and
|
|
5
|
+
* currency-aware precision. Used by `@veevarts/payments-drop-in`'s
|
|
6
|
+
* `<CashTender>` and any other consumer that needs cash collection UX.
|
|
7
|
+
*/
|
|
8
|
+
export { CashTenderForm } from './CashTenderForm';
|
|
9
|
+
export type { CashTenderFormProps, CashTenderValue, CashTenderLabels, } from './types';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Money } from '../../utils/money';
|
|
2
|
+
export type { Money, CurrencyCode } from '../../utils/money';
|
|
3
|
+
/**
|
|
4
|
+
* Snapshot emitted on every change of the cash tender entry.
|
|
5
|
+
* `isValid` is `true` when `received >= dueAmount.value`.
|
|
6
|
+
*/
|
|
7
|
+
export interface CashTenderValue {
|
|
8
|
+
/** Amount the cashier received from the customer (major units). */
|
|
9
|
+
received: number;
|
|
10
|
+
/** Computed change owed to the customer (`received - due`, rounded). */
|
|
11
|
+
change: number;
|
|
12
|
+
/** Whether the received amount satisfies the due amount. */
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Strings the pattern displays. All optional — sensible English defaults exist.
|
|
17
|
+
*/
|
|
18
|
+
export interface CashTenderLabels {
|
|
19
|
+
receivedLabel?: string;
|
|
20
|
+
receivedPlaceholder?: string;
|
|
21
|
+
changeLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Template for the change message. `{change}` is replaced with the
|
|
24
|
+
* formatted change amount.
|
|
25
|
+
*/
|
|
26
|
+
changeMessageTemplate?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Validation message shown when received < due.
|
|
29
|
+
* `{due}` is replaced with the formatted due amount.
|
|
30
|
+
*/
|
|
31
|
+
insufficientMessageTemplate?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CashTenderFormProps {
|
|
34
|
+
/**
|
|
35
|
+
* The amount due. Currency drives input precision (USD 2 dec, JPY 0 dec, etc.).
|
|
36
|
+
*/
|
|
37
|
+
dueAmount: Money;
|
|
38
|
+
/**
|
|
39
|
+
* Controlled received value. Use together with `onChange`.
|
|
40
|
+
*/
|
|
41
|
+
received?: number | null;
|
|
42
|
+
/**
|
|
43
|
+
* Uncontrolled default received value.
|
|
44
|
+
*/
|
|
45
|
+
defaultReceived?: number | null;
|
|
46
|
+
/**
|
|
47
|
+
* Fires on every keystroke with the current snapshot.
|
|
48
|
+
*/
|
|
49
|
+
onChange?: (value: CashTenderValue) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Locale for currency formatting and input mask.
|
|
52
|
+
* @default 'en-US'
|
|
53
|
+
*/
|
|
54
|
+
locale?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Label overrides for i18n.
|
|
57
|
+
*/
|
|
58
|
+
labels?: CashTenderLabels;
|
|
59
|
+
/**
|
|
60
|
+
* Disable interactions (e.g. while submitting).
|
|
61
|
+
*/
|
|
62
|
+
isDisabled?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Hard upper bound for the received amount, in MAJOR units (same unit
|
|
65
|
+
* as `dueAmount.value`). A keystroke that would push the parsed value
|
|
66
|
+
* above this is REJECTED (the field keeps its prior value) — so a
|
|
67
|
+
* cashier can't enter a pathological amount that overflows the PSP
|
|
68
|
+
* integer range downstream. A character `maxLength` can't enforce this
|
|
69
|
+
* (e.g. `99999999` is only 8 chars yet far over a $999,999.99 cap), so
|
|
70
|
+
* the guard is value-based. Omit for no cap.
|
|
71
|
+
*/
|
|
72
|
+
maxAmount?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Auto-focus the Cash Received field when this component mounts.
|
|
75
|
+
* Pair with `key={...}` from the host to re-trigger focus on every
|
|
76
|
+
* sub-payment (the form re-mounts and `autoFocus` fires again).
|
|
77
|
+
* The built-in `onFocus` already selects the value, so a cashier
|
|
78
|
+
* landing here can overwrite the existing amount with a single
|
|
79
|
+
* keystroke.
|
|
80
|
+
*
|
|
81
|
+
* Default `false` — the field is unfocused at mount. Hosts opt in
|
|
82
|
+
* when their flow guarantees the cashier just navigated TO this
|
|
83
|
+
* tender (e.g. selecting Cash from the method picker, advancing to
|
|
84
|
+
* the next split sub-payment).
|
|
85
|
+
*/
|
|
86
|
+
autoFocus?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Inline test id forwarded to the root element.
|
|
89
|
+
*/
|
|
90
|
+
'data-testid'?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Extra className for the root element.
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CheckTenderForm Pattern
|
|
3
|
+
*
|
|
4
|
+
* Pure-UI primitive for check tender entry. Used by
|
|
5
|
+
* `@veevarts/payments-drop-in`'s `<CheckTender>` and any other consumer that
|
|
6
|
+
* needs check collection UX.
|
|
7
|
+
*/
|
|
8
|
+
export { CheckTenderForm } from './CheckTenderForm';
|
|
9
|
+
export type { CheckTenderFormProps, CheckTenderValue, CheckTenderLabels, Money } from './types';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Money } from '../../utils/money';
|
|
2
|
+
export type { Money } from '../../utils/money';
|
|
3
|
+
/**
|
|
4
|
+
* Snapshot emitted whenever the form mutates.
|
|
5
|
+
* `isValid` is `true` when `checkNumber` is non-empty.
|
|
6
|
+
*/
|
|
7
|
+
export interface CheckTenderValue {
|
|
8
|
+
/** Amount tendered via this check (matches `dueAmount.value`). */
|
|
9
|
+
amount: number;
|
|
10
|
+
/** Check number as written on the physical check. Required. */
|
|
11
|
+
checkNumber: string;
|
|
12
|
+
/** Optional issuing bank name. */
|
|
13
|
+
bankName?: string;
|
|
14
|
+
/** Optional check date (ISO-8601 yyyy-mm-dd). Defaults to today when the host omits. */
|
|
15
|
+
date?: string;
|
|
16
|
+
isValid: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface CheckTenderLabels {
|
|
19
|
+
checkNumberLabel?: string;
|
|
20
|
+
checkNumberPlaceholder?: string;
|
|
21
|
+
bankNameLabel?: string;
|
|
22
|
+
bankNamePlaceholder?: string;
|
|
23
|
+
dateLabel?: string;
|
|
24
|
+
checkNumberRequiredMessage?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CheckTenderFormProps {
|
|
27
|
+
dueAmount: Money;
|
|
28
|
+
/** Controlled values. Use together with `onChange`. */
|
|
29
|
+
value?: Partial<Pick<CheckTenderValue, 'checkNumber' | 'bankName' | 'date'>>;
|
|
30
|
+
/** Uncontrolled defaults. */
|
|
31
|
+
defaultValue?: Partial<Pick<CheckTenderValue, 'checkNumber' | 'bankName' | 'date'>>;
|
|
32
|
+
onChange?: (value: CheckTenderValue) => void;
|
|
33
|
+
locale?: string;
|
|
34
|
+
labels?: CheckTenderLabels;
|
|
35
|
+
/** Hide the date picker when the host already collects it elsewhere. */
|
|
36
|
+
hideDate?: boolean;
|
|
37
|
+
/** Hide the bank name field when the host doesn't care. */
|
|
38
|
+
hideBankName?: boolean;
|
|
39
|
+
isDisabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Character cap for the Check Number field. Guards against pathological
|
|
42
|
+
* paste / extreme input. Default `34` (the length of the longest IBAN,
|
|
43
|
+
* a generous ceiling for any cheque / international reference).
|
|
44
|
+
*/
|
|
45
|
+
checkNumberMaxLength?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Character cap for the Bank Name field. Default `100`.
|
|
48
|
+
*/
|
|
49
|
+
bankNameMaxLength?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Auto-focus the Check Number field when this component mounts.
|
|
52
|
+
* Pair with `key={...}` from the host to re-trigger focus on every
|
|
53
|
+
* sub-payment (the form re-mounts and `autoFocus` fires again).
|
|
54
|
+
* Default `false` — the field is unfocused at mount. Hosts opt in
|
|
55
|
+
* when their flow guarantees the cashier just navigated TO this
|
|
56
|
+
* tender (e.g. selecting Check from the method picker, advancing
|
|
57
|
+
* to the next split sub-payment).
|
|
58
|
+
*/
|
|
59
|
+
autoFocus?: boolean;
|
|
60
|
+
'data-testid'?: string;
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export type CommitmentDetailsLabels = {
|
|
3
|
+
totalAmount?: string;
|
|
4
|
+
remainingBalance?: string;
|
|
5
|
+
amountReceived?: string;
|
|
6
|
+
};
|
|
7
|
+
export type CommitmentDetailsProps = {
|
|
8
|
+
totalAmount: number;
|
|
9
|
+
remainingBalance: number;
|
|
10
|
+
amountReceived: number;
|
|
11
|
+
currency?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
labels?: CommitmentDetailsLabels;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function CommitmentDetails({ totalAmount, remainingBalance, amountReceived, currency, locale, labels: customLabels, className, }: CommitmentDetailsProps): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ConfirmDialogProps {
|
|
3
|
+
/** Whether the dialog is currently open. Controlled by the host. */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Title rendered as the dialog heading. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Body copy explaining the consequences of confirming. */
|
|
8
|
+
body: string;
|
|
9
|
+
/** Label for the confirm action. */
|
|
10
|
+
confirmLabel: string;
|
|
11
|
+
/** Visual variant of the confirm button. Default `'danger'`. */
|
|
12
|
+
confirmVariant?: 'danger' | 'primary';
|
|
13
|
+
/** Label for the dismiss action. */
|
|
14
|
+
dismissLabel: string;
|
|
15
|
+
/** Fires when the user confirms. */
|
|
16
|
+
onConfirm: () => void;
|
|
17
|
+
/** Fires when the user dismisses (Cancel button OR Esc / outside click). */
|
|
18
|
+
onDismiss: () => void;
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
export type ConfirmationModalLabels = {
|
|
3
|
+
title: string;
|
|
4
|
+
description: ReactNode;
|
|
5
|
+
cancel: string;
|
|
6
|
+
confirm: string;
|
|
7
|
+
};
|
|
8
|
+
export type ConfirmationModalProps = {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
labels: ConfirmationModalLabels;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
isConfirming?: boolean;
|
|
13
|
+
confirmColor?: 'primary' | 'danger';
|
|
14
|
+
iconTone?: 'danger' | 'warning';
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onConfirm: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function ConfirmationModal({ isOpen, labels, icon, isConfirming, confirmColor, iconTone, onClose, onConfirm, }: ConfirmationModalProps): JSX.Element;
|
|
@@ -20,6 +20,8 @@ export interface EventDetailsProps {
|
|
|
20
20
|
classes?: string;
|
|
21
21
|
/** @property {boolean} [showImage] - Optional flag to show or hide the event image. Defaults to true. */
|
|
22
22
|
showImage?: boolean;
|
|
23
|
+
/** @property {'lazy' | 'eager'} [imageLoading] - Optional loading strategy for the event image. Use `'lazy'` for off-screen placements (long lists, below-the-fold). Defaults to `'eager'` since the banner is typically above-the-fold. */
|
|
24
|
+
imageLoading?: 'lazy' | 'eager';
|
|
23
25
|
/** @property {string} [showMoreButtonClassName] - Optional Tailwind CSS utility classes for the 'Show more/less' button. */
|
|
24
26
|
showMoreButtonClassName?: string;
|
|
25
27
|
/** @property {Object} labels - Labels for the event details, used for localization. */
|
|
@@ -33,5 +35,5 @@ export interface EventDetailsProps {
|
|
|
33
35
|
* @function EventDetails
|
|
34
36
|
* @description Displays a card with event information such as name, image, date, time, location, and description.
|
|
35
37
|
*/
|
|
36
|
-
export declare const EventDetails: ({ classes, name, imageUrl, eventDate, eventTime, location, description, showImage, showMoreButtonClassName, labels, }: EventDetailsProps) => JSX.Element;
|
|
38
|
+
export declare const EventDetails: ({ classes, name, imageUrl, eventDate, eventTime, location, description, showImage, imageLoading, showMoreButtonClassName, labels, }: EventDetailsProps) => JSX.Element;
|
|
37
39
|
export default EventDetails;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { InstallmentFundAssignmentProps } from './types';
|
|
3
|
+
export declare function InstallmentFundAssignment({ mode, assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, isFundPickerOpen, activeAssignmentId, footer, onModeChange, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { InstallmentFundAssignment } from './InstallmentFundAssignment';
|
|
2
|
+
export { InstallmentFundAssignmentSkeleton } from './InstallmentFundAssignmentSkeleton';
|
|
3
|
+
export type { InstallmentFundAssignmentClassNames, InstallmentFundAssignmentLabels, InstallmentFundAssignmentMode, InstallmentFundAssignmentProps, InstallmentFund, InstallmentFundAssignmentEntry, } from './types';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type InstallmentFundAssignmentMode = 'single' | 'split';
|
|
3
|
+
export type InstallmentFund = {
|
|
4
|
+
id: string;
|
|
5
|
+
glCode: string;
|
|
6
|
+
accountName: string;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export type InstallmentFundAssignmentEntry = {
|
|
10
|
+
id: string;
|
|
11
|
+
fund: InstallmentFund | null;
|
|
12
|
+
percentage: number;
|
|
13
|
+
sortOrder?: number;
|
|
14
|
+
};
|
|
15
|
+
export type InstallmentFundAssignmentLabels = {
|
|
16
|
+
title?: string;
|
|
17
|
+
singleFund?: string;
|
|
18
|
+
splitFunds?: string;
|
|
19
|
+
saveAssignment?: string;
|
|
20
|
+
assignSpecificFund?: string;
|
|
21
|
+
addFund?: string;
|
|
22
|
+
emptySingle?: string;
|
|
23
|
+
emptySplit?: string;
|
|
24
|
+
selectedFund?: string;
|
|
25
|
+
percentage?: string;
|
|
26
|
+
total?: string;
|
|
27
|
+
totalError?: string;
|
|
28
|
+
removeFund?: string;
|
|
29
|
+
modalTitle?: string;
|
|
30
|
+
searchPlaceholder?: string;
|
|
31
|
+
glCode?: string;
|
|
32
|
+
accountName?: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
actions?: string;
|
|
35
|
+
select?: string;
|
|
36
|
+
noFunds?: string;
|
|
37
|
+
modifyAssignedFundsTitle?: string;
|
|
38
|
+
modifyAssignedFundsDescription?: string;
|
|
39
|
+
modifyAssignedFundsWarning?: string;
|
|
40
|
+
modifyAssignedFundsCancel?: string;
|
|
41
|
+
modifyAssignedFundsConfirm?: string;
|
|
42
|
+
};
|
|
43
|
+
export type InstallmentFundAssignmentClassNames = {
|
|
44
|
+
root?: string;
|
|
45
|
+
panel?: string;
|
|
46
|
+
header?: string;
|
|
47
|
+
tabs?: string;
|
|
48
|
+
content?: string;
|
|
49
|
+
};
|
|
50
|
+
export type InstallmentFundAssignmentProps = {
|
|
51
|
+
mode: InstallmentFundAssignmentMode;
|
|
52
|
+
assignments: InstallmentFundAssignmentEntry[];
|
|
53
|
+
funds: InstallmentFund[];
|
|
54
|
+
labels?: InstallmentFundAssignmentLabels;
|
|
55
|
+
classNames?: InstallmentFundAssignmentClassNames;
|
|
56
|
+
isSaving?: boolean;
|
|
57
|
+
hasSavedAssignments?: boolean;
|
|
58
|
+
isFundPickerOpen?: boolean;
|
|
59
|
+
activeAssignmentId?: string | null;
|
|
60
|
+
footer?: ReactNode;
|
|
61
|
+
onModeChange: (mode: InstallmentFundAssignmentMode) => void;
|
|
62
|
+
onAssignmentsChange: (assignments: InstallmentFundAssignmentEntry[]) => void;
|
|
63
|
+
onOpenFundPicker: (assignmentId?: string) => void;
|
|
64
|
+
onCloseFundPicker: () => void;
|
|
65
|
+
onCollapseChange?: (isCollapsed: boolean) => void;
|
|
66
|
+
onSave: () => void;
|
|
67
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { InstallmentTableProps } from './types';
|
|
3
|
+
export declare function InstallmentTable({ installments, currency, locale, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InstallmentSchedule } from './InstallmentSchedule';
|
|
2
|
+
export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
|
|
3
|
+
export { InstallmentTable } from './InstallmentTable';
|
|
4
|
+
export { generateAutomaticInstallments } from './utils';
|
|
5
|
+
export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, ScheduledInstallment, } from './types';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type InstallmentScheduleMode = 'automatic' | 'manual';
|
|
3
|
+
export type InstallmentFrequency = 'monthly' | 'quarterly' | 'annual';
|
|
4
|
+
export type ScheduledInstallment = {
|
|
5
|
+
id: string;
|
|
6
|
+
dueDate: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
status?: 'scheduled' | 'fulfilled' | 'failed' | 'cancelled' | 'refunded' | 'paid';
|
|
9
|
+
};
|
|
10
|
+
export type AutomaticScheduleSettings = {
|
|
11
|
+
numberOfInstallments: number;
|
|
12
|
+
frequency: InstallmentFrequency;
|
|
13
|
+
firstInstallmentDate: string;
|
|
14
|
+
};
|
|
15
|
+
export type InstallmentScheduleLabels = {
|
|
16
|
+
title?: string;
|
|
17
|
+
automaticMode?: string;
|
|
18
|
+
manualMode?: string;
|
|
19
|
+
createInstallments?: string;
|
|
20
|
+
generateSchedule?: string;
|
|
21
|
+
saveInstallments?: string;
|
|
22
|
+
addInstallment?: string;
|
|
23
|
+
emptyAutomatic?: string;
|
|
24
|
+
emptyManual?: string;
|
|
25
|
+
numberOfInstallments?: string;
|
|
26
|
+
frequency?: string;
|
|
27
|
+
firstInstallmentDate?: string;
|
|
28
|
+
installment?: string;
|
|
29
|
+
dueDate?: string;
|
|
30
|
+
amount?: string;
|
|
31
|
+
total?: string;
|
|
32
|
+
remaining?: string;
|
|
33
|
+
deleteInstallment?: string;
|
|
34
|
+
monthly?: string;
|
|
35
|
+
quarterly?: string;
|
|
36
|
+
annual?: string;
|
|
37
|
+
totalError?: string;
|
|
38
|
+
};
|
|
39
|
+
export type InstallmentScheduleClassNames = {
|
|
40
|
+
root?: string;
|
|
41
|
+
panel?: string;
|
|
42
|
+
header?: string;
|
|
43
|
+
tabs?: string;
|
|
44
|
+
content?: string;
|
|
45
|
+
};
|
|
46
|
+
export type InstallmentScheduleProps = {
|
|
47
|
+
mode: InstallmentScheduleMode;
|
|
48
|
+
donationAmount: number;
|
|
49
|
+
currency?: string;
|
|
50
|
+
locale?: string;
|
|
51
|
+
installments: ScheduledInstallment[];
|
|
52
|
+
automaticSettings: AutomaticScheduleSettings;
|
|
53
|
+
labels?: InstallmentScheduleLabels;
|
|
54
|
+
classNames?: InstallmentScheduleClassNames;
|
|
55
|
+
isSaving?: boolean;
|
|
56
|
+
isModeSwitchDisabled?: boolean;
|
|
57
|
+
onModeChange: (mode: InstallmentScheduleMode) => void;
|
|
58
|
+
onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
|
|
59
|
+
onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
|
|
60
|
+
onSave: () => void;
|
|
61
|
+
};
|
|
62
|
+
export type InstallmentTableLabels = {
|
|
63
|
+
title?: string;
|
|
64
|
+
searchLabel?: string;
|
|
65
|
+
searchPlaceholder?: string;
|
|
66
|
+
editInstallments?: string;
|
|
67
|
+
installmentId?: string;
|
|
68
|
+
amount?: string;
|
|
69
|
+
scheduledDate?: string;
|
|
70
|
+
status?: string;
|
|
71
|
+
actions?: string;
|
|
72
|
+
payNow?: string;
|
|
73
|
+
sendLink?: string;
|
|
74
|
+
sendLinkDescription?: string;
|
|
75
|
+
dangerZone?: string;
|
|
76
|
+
deleteInstallment?: string;
|
|
77
|
+
deleteInstallmentDescription?: string;
|
|
78
|
+
deleteInstallmentConfirmationTitle?: string;
|
|
79
|
+
deleteInstallmentConfirmationDescription?: ReactNode;
|
|
80
|
+
deleteInstallmentConfirmationCancel?: string;
|
|
81
|
+
deleteInstallmentConfirmationConfirm?: string;
|
|
82
|
+
noInstallmentsFound?: string;
|
|
83
|
+
};
|
|
84
|
+
export type InstallmentTableProps = {
|
|
85
|
+
installments: ScheduledInstallment[];
|
|
86
|
+
currency: string;
|
|
87
|
+
locale?: string;
|
|
88
|
+
labels?: InstallmentTableLabels;
|
|
89
|
+
isSaving?: boolean;
|
|
90
|
+
onEditInstallments: () => void;
|
|
91
|
+
onPayInstallment?: (installment: ScheduledInstallment) => void;
|
|
92
|
+
onDeleteInstallment: (installmentId: string) => void;
|
|
93
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LoadingOverlayProps {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
/** Tint of the backdrop. Default `'white'`. `'transparent'` lets the modal show through. */
|
|
6
|
+
backdrop?: 'white' | 'transparent';
|
|
7
|
+
/**
|
|
8
|
+
* When `true`, the overlay plays its EXIT animation (fade-out) and
|
|
9
|
+
* becomes non-interactive. Host keeps it mounted for the duration of
|
|
10
|
+
* the exit so it can crossfade against the success view rather than
|
|
11
|
+
* snap-unmounting (which produced a visible flash between the
|
|
12
|
+
* loading state and the success view fade-in).
|
|
13
|
+
*/
|
|
14
|
+
exiting?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const LoadingOverlay: React.FC<LoadingOverlayProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ModalShellProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Adds the visual `relative` positioning context for overlays. Default `true`. */
|
|
5
|
+
relativeOverlayRoot?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Inline style. Primarily used by the host orchestrator to pin
|
|
9
|
+
* the modal height during the loading → success crossfade so the
|
|
10
|
+
* collecting tree's post-success re-render (`hasPartialPayments`
|
|
11
|
+
* flipping `PaymentTotalBanner` → `SplitPaymentSummary`, form
|
|
12
|
+
* re-render with the recorded tender) doesn't visibly grow the
|
|
13
|
+
* modal card underneath the absolute success view. Released once
|
|
14
|
+
* the collecting tree unmounts and the modal settles to its
|
|
15
|
+
* success-view natural height.
|
|
16
|
+
*/
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const ModalShell: React.ForwardRefExoticComponent<ModalShellProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export interface ModalShellHeaderProps {
|
|
22
|
+
/** Title rendered as an `h2`. */
|
|
23
|
+
title: string;
|
|
24
|
+
/** Optional close button — omit `onClose` to hide. */
|
|
25
|
+
onClose?: () => void;
|
|
26
|
+
closeLabel?: string;
|
|
27
|
+
/** Optional content rendered to the right of the title (e.g. badges). */
|
|
28
|
+
actions?: React.ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const ModalShellHeader: React.FC<ModalShellHeaderProps>;
|
|
33
|
+
export interface ModalShellFooterProps {
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
/** Grid column template. Default `2-col grid` (Cancel + Collect). */
|
|
36
|
+
columns?: 1 | 2;
|
|
37
|
+
className?: string;
|
|
38
|
+
'data-testid'?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const ModalShellFooter: React.FC<ModalShellFooterProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OtherTenderForm Pattern
|
|
3
|
+
*
|
|
4
|
+
* Pure-UI primitive for catch-all (non card/cash/check) tender entry.
|
|
5
|
+
* Used by `@veevarts/payments-drop-in`'s `<OtherTender>`.
|
|
6
|
+
*/
|
|
7
|
+
export { OtherTenderForm } from './OtherTenderForm';
|
|
8
|
+
export type { OtherTenderFormProps, OtherTenderValue, OtherTenderLabels, OtherTenderMethodOption, Money, } from './types';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Money } from '../../utils/money';
|
|
2
|
+
export type { Money } from '../../utils/money';
|
|
3
|
+
/** A single selectable non-card / non-cash / non-check payment method. */
|
|
4
|
+
export interface OtherTenderMethodOption {
|
|
5
|
+
/** Stable identifier (e.g. `'ach'`, `'wire'`, `'gift_card'`, `'voucher'`). */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Localized display label. */
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
/** Snapshot emitted whenever the form mutates. */
|
|
11
|
+
export interface OtherTenderValue {
|
|
12
|
+
amount: number;
|
|
13
|
+
/**
|
|
14
|
+
* The selected method's `value` (machine-friendly). Empty string means "no
|
|
15
|
+
* selection yet".
|
|
16
|
+
*/
|
|
17
|
+
method: string;
|
|
18
|
+
/**
|
|
19
|
+
* Human-readable description of the selected method (its `label`). Always
|
|
20
|
+
* paired with `method`.
|
|
21
|
+
*/
|
|
22
|
+
description: string;
|
|
23
|
+
/** Free-form reference number (e.g. external voucher ID). */
|
|
24
|
+
reference?: string;
|
|
25
|
+
isValid: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface OtherTenderLabels {
|
|
28
|
+
methodLabel?: string;
|
|
29
|
+
methodPlaceholder?: string;
|
|
30
|
+
referenceLabel?: string;
|
|
31
|
+
referencePlaceholder?: string;
|
|
32
|
+
methodRequiredMessage?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface OtherTenderFormProps {
|
|
35
|
+
dueAmount: Money;
|
|
36
|
+
/**
|
|
37
|
+
* Available payment methods. Defaults to a small generic set (ACH, Wire,
|
|
38
|
+
* Gift Card, Voucher, Other). Hosts almost always want to override.
|
|
39
|
+
*/
|
|
40
|
+
methodOptions?: OtherTenderMethodOption[];
|
|
41
|
+
/** Controlled value. Use together with `onChange`. */
|
|
42
|
+
value?: Partial<Pick<OtherTenderValue, 'method' | 'reference'>>;
|
|
43
|
+
/** Uncontrolled defaults. */
|
|
44
|
+
defaultValue?: Partial<Pick<OtherTenderValue, 'method' | 'reference'>>;
|
|
45
|
+
onChange?: (value: OtherTenderValue) => void;
|
|
46
|
+
locale?: string;
|
|
47
|
+
labels?: OtherTenderLabels;
|
|
48
|
+
/** Show the optional `reference` text input. */
|
|
49
|
+
showReference?: boolean;
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
'data-testid'?: string;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Money } from '../../utils/money';
|
|
3
|
+
export interface PaymentCashChangeBannerProps {
|
|
4
|
+
/** Amount of cash to give back. Banner only renders when > 0. */
|
|
5
|
+
cashChange: Money;
|
|
6
|
+
/** Heading above the amount. Translatable. Default `'Cash to return'`. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional secondary line below the amount. Use in mid-split flows
|
|
10
|
+
* to disambiguate WHICH sub-payment the change refers to (e.g.
|
|
11
|
+
* `'From Payment #1'`).
|
|
12
|
+
*/
|
|
13
|
+
secondaryLine?: string;
|
|
14
|
+
/** Locale forwarded to `formatMoney`. Default `'en-US'`. */
|
|
15
|
+
locale?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Dismiss button — when set, renders an X button that fires this
|
|
18
|
+
* callback. Omit to render the banner non-dismissible (used inside
|
|
19
|
+
* `<PaymentSuccessView>` where the entire view replaces on Close).
|
|
20
|
+
*/
|
|
21
|
+
onDismiss?: () => void;
|
|
22
|
+
/** Accessible label for the dismiss button. Default `'Dismiss'`. */
|
|
23
|
+
dismissAriaLabel?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Horizontal alignment of the inner content (icon + text block).
|
|
26
|
+
* Default `'left'` — used mid-split where the banner sits inline
|
|
27
|
+
* with left-aligned form sections.
|
|
28
|
+
* `'center'` — used inside `<PaymentSuccessView>` so the banner
|
|
29
|
+
* lines up under the centered success badge + title.
|
|
30
|
+
*/
|
|
31
|
+
align?: 'left' | 'center';
|
|
32
|
+
className?: string;
|
|
33
|
+
'data-testid'?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const PaymentCashChangeBanner: React.FC<PaymentCashChangeBannerProps>;
|