@veevarts/design-system 1.11.0 → 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 +7283 -4123
- 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/MembershipSelectCards/types.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/TicketSelection/types.d.ts +3 -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,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>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PaymentSubAmountInputProps {
|
|
3
|
+
/** Section heading text (e.g. "Payment #3"). */
|
|
4
|
+
heading: string;
|
|
5
|
+
/** Input label rendered above the field. */
|
|
6
|
+
amountLabel: string;
|
|
7
|
+
/** Controlled value. Use together with `onChange`. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Uncontrolled default. */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
/** Fires on every keystroke with the raw string. */
|
|
12
|
+
onChange?: (next: string) => void;
|
|
13
|
+
/** Placeholder shown when value is empty (e.g. "$150.00"). */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Validation flag — drives the red border + error message UI.
|
|
18
|
+
* The host computes WHY (e.g. amount > remaining); this primitive
|
|
19
|
+
* only renders the visual error state.
|
|
20
|
+
*/
|
|
21
|
+
isInvalid?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Error message rendered below the field when `isInvalid === true`.
|
|
24
|
+
* Translatable. Already-formatted (the host substitutes currency
|
|
25
|
+
* + locale).
|
|
26
|
+
*/
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Auto-focus the amount field when this component mounts. Pair
|
|
30
|
+
* with `key={...}` from the host to re-trigger focus on every
|
|
31
|
+
* sub-payment (the input re-mounts each time and `autoFocus`
|
|
32
|
+
* fires again). The built-in `onFocus` already selects the
|
|
33
|
+
* value, so a cashier landing here can overwrite the placeholder
|
|
34
|
+
* with a single keystroke.
|
|
35
|
+
*
|
|
36
|
+
* Default `false` — the input is unfocused at mount. Hosts opt in
|
|
37
|
+
* when their flow guarantees the cashier just navigated TO this
|
|
38
|
+
* step (e.g. opening Split, advancing to Payment #N).
|
|
39
|
+
*/
|
|
40
|
+
autoFocus?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Hard upper bound for the typed amount, in the same MAJOR-unit scale
|
|
43
|
+
* the host parses the emitted string with. A keystroke that would push
|
|
44
|
+
* the parsed value above this is REJECTED (the controlled `value` is
|
|
45
|
+
* left unchanged, so the input reverts the offending character). Keeps
|
|
46
|
+
* the cashier from entering an amount that overflows the PSP integer
|
|
47
|
+
* range downstream. A character `maxLength` can't enforce this (e.g.
|
|
48
|
+
* `99999999` is only 8 chars yet far over a $999,999.99 cap), so the
|
|
49
|
+
* guard is value-based. Omit for no cap.
|
|
50
|
+
*/
|
|
51
|
+
maxAmount?: number;
|
|
52
|
+
'data-testid'?: string;
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const PaymentSubAmountInput: React.FC<PaymentSubAmountInputProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Money } from '../../utils/money';
|
|
3
|
+
export interface PaymentSuccessViewProps {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
/** Optional email confirmation line ("Client will receive a confirmation email at …"). */
|
|
7
|
+
emailLine?: string;
|
|
8
|
+
/** Email address to render in bold under `emailLine`. Required if `emailLine` is set. */
|
|
9
|
+
confirmationEmail?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Total cash change to return to the customer. Renders as a
|
|
12
|
+
* prominent warning banner with the formatted amount; omit (or
|
|
13
|
+
* pass `value: 0`) when there is no change to give back (any
|
|
14
|
+
* non-cash tender, or cash paid exact).
|
|
15
|
+
*/
|
|
16
|
+
cashChange?: Money;
|
|
17
|
+
/** Label rendered above the cash-change amount. Default: "Cash to return". */
|
|
18
|
+
cashChangeLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Locale used to format `cashChange`. Default `'en-US'`. Ignored
|
|
21
|
+
* when no cashChange is passed.
|
|
22
|
+
*/
|
|
23
|
+
locale?: string;
|
|
24
|
+
/** Close button label. Omit `onClose` to hide the button entirely. */
|
|
25
|
+
closeLabel?: string;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
className?: string;
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const PaymentSuccessView: React.FC<PaymentSuccessViewProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Money } from '../../utils/money';
|
|
3
|
+
export interface PaymentTotalBannerProps {
|
|
4
|
+
/** Amount to render. */
|
|
5
|
+
total: Money;
|
|
6
|
+
/** Label rendered above the amount (e.g. "Total Due:", "Remaining:", "Complete"). */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Locale for currency formatting. Default `'en-US'`. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Visual variant for emphasis. Default `'subtle'`. */
|
|
11
|
+
variant?: 'subtle' | 'success';
|
|
12
|
+
className?: string;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const PaymentTotalBanner: React.FC<PaymentTotalBannerProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SplitPaymentSummary Pattern
|
|
3
|
+
*
|
|
4
|
+
* Pure-UI primitive showing the running list of tenders + remaining balance
|
|
5
|
+
* for multi-tender split payments. Used by `@veevarts/payments-drop-in`'s
|
|
6
|
+
* `<PaymentsDropIn>` orchestrator.
|
|
7
|
+
*/
|
|
8
|
+
export { SplitPaymentSummary } from './SplitPaymentSummary';
|
|
9
|
+
export type { SplitPaymentSummaryProps, SplitPaymentSummaryLabels, TenderRow, TenderRowStatus, TenderRowType, Money, } from './types';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Money } from '../../utils/money';
|
|
2
|
+
export type { Money } from '../../utils/money';
|
|
3
|
+
export type TenderRowType = 'card' | 'cash' | 'check' | 'other';
|
|
4
|
+
export type TenderRowStatus = 'pending' | 'recorded' | 'failed';
|
|
5
|
+
export interface TenderRow {
|
|
6
|
+
/** Stable identifier (idempotency key, server-side payment id, etc.). */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Canonical category used to pick the row icon. */
|
|
9
|
+
type: TenderRowType;
|
|
10
|
+
/** Tender amount in the host's currency. */
|
|
11
|
+
amount: number;
|
|
12
|
+
/**
|
|
13
|
+
* One-line description shown next to the icon. Examples:
|
|
14
|
+
* - `'Credit Card **5555'`
|
|
15
|
+
* - `'Cash'`
|
|
16
|
+
* - `'Check #102934'`
|
|
17
|
+
* - `'ACH'`
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Lifecycle status. `pending` and `recorded` ARE present in the running
|
|
22
|
+
* balance; `failed` is rendered for context but NOT counted toward
|
|
23
|
+
* `collected`.
|
|
24
|
+
*/
|
|
25
|
+
status: TenderRowStatus;
|
|
26
|
+
/**
|
|
27
|
+
* Optional failure message shown inline when `status === 'failed'`.
|
|
28
|
+
*/
|
|
29
|
+
failureReason?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SplitPaymentSummaryLabels {
|
|
32
|
+
collectedHeading?: string;
|
|
33
|
+
remainingLabel?: string;
|
|
34
|
+
completeLabel?: string;
|
|
35
|
+
removeAriaLabel?: string;
|
|
36
|
+
removeTooltipForRecorded?: string;
|
|
37
|
+
statusPending?: string;
|
|
38
|
+
statusRecorded?: string;
|
|
39
|
+
statusFailed?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SplitPaymentSummaryProps {
|
|
42
|
+
/** Total amount the host is collecting (sum target). */
|
|
43
|
+
total: Money;
|
|
44
|
+
/**
|
|
45
|
+
* All tenders entered so far — pending, recorded, or failed. Failed
|
|
46
|
+
* tenders are shown but excluded from the running balance.
|
|
47
|
+
*/
|
|
48
|
+
tenders: TenderRow[];
|
|
49
|
+
/**
|
|
50
|
+
* Invoked when the user clicks the remove button on a tender row. Only
|
|
51
|
+
* fires when removal is allowed (i.e. status === 'pending' or 'failed').
|
|
52
|
+
* Omit to hide remove buttons entirely.
|
|
53
|
+
*/
|
|
54
|
+
onRemove?: (id: string) => void;
|
|
55
|
+
locale?: string;
|
|
56
|
+
labels?: SplitPaymentSummaryLabels;
|
|
57
|
+
/** Hide the collected list (just the remaining banner). */
|
|
58
|
+
hideCollectedList?: boolean;
|
|
59
|
+
'data-testid'?: string;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TileSelectOption {
|
|
3
|
+
/** Stable identifier returned via `onSelect`. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Visible label rendered under the icon. */
|
|
6
|
+
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Icon: iconify name (`'lucide:credit-card'`) or a `ReactNode` for
|
|
9
|
+
* fully-custom SVGs.
|
|
10
|
+
*/
|
|
11
|
+
icon: string | React.ReactNode;
|
|
12
|
+
/** Disable the tile (greyed out, no click). */
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
/** Override per-tile test id; defaults to `${dataTestId}-${key}`. */
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TileSelectProps {
|
|
18
|
+
/** Options to render in order. */
|
|
19
|
+
options: readonly TileSelectOption[];
|
|
20
|
+
/** Currently selected option `key`. `null` = no selection. */
|
|
21
|
+
selectedKey: string | null;
|
|
22
|
+
/** Fires when a tile is selected. */
|
|
23
|
+
onSelect: (key: string) => void;
|
|
24
|
+
/** Optional heading rendered above the grid. */
|
|
25
|
+
heading?: string;
|
|
26
|
+
/**
|
|
27
|
+
* `aria-label` for the wrapping group when `heading` is omitted.
|
|
28
|
+
* Translatable. Default `'Select an option'`. When `heading` is
|
|
29
|
+
* provided this prop is ignored — the grid is labelled by the
|
|
30
|
+
* heading element.
|
|
31
|
+
*/
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/** Grid columns on >= sm. Default `3`. Mobile collapses to 2. */
|
|
34
|
+
columnsDesktop?: 2 | 3 | 4;
|
|
35
|
+
columnsMobile?: 1 | 2;
|
|
36
|
+
className?: string;
|
|
37
|
+
'data-testid'?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const TileSelect: React.FC<TileSelectProps>;
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export { OfferCard, OfferCardList, OfferCardSkeleton, OfferCardError, OfferCardE
|
|
|
17
17
|
export type { Offer, OfferSelection, OfferCardLabels, OfferCardErrorLabels, OfferCardClassNames, OfferCardListClassNames, OfferCardSkeletonClassNames, OfferCardErrorClassNames, OfferCardEmptyClassNames, OfferCardSlots, OfferCardProps, OfferCardListProps, OfferCardSkeletonProps, OfferCardErrorProps, OfferCardEmptyProps, } from './OfferCard';
|
|
18
18
|
export { RevenueDistributionCard, RevenueDistributionSkeleton, RevenueDistributionError, RevenueDistributionEmpty, formatAmount as formatRevenueAmount, formatCurrency as formatRevenueCurrency, getCurrencySymbol, parseCurrency as parseRevenueCurrency, calculateAllocationDifference, generateDistributionId, } from './RevenueDistribution';
|
|
19
19
|
export type { GlAccount, Distribution, RevenueDistributionLabels, RevenueDistributionErrorLabels, RevenueDistributionEmptyLabels, RevenueDistributionCardClassNames, RevenueDistributionSkeletonClassNames, RevenueDistributionErrorClassNames, RevenueDistributionEmptyClassNames, RevenueDistributionCardProps, RevenueDistributionSkeletonProps, RevenueDistributionErrorProps, RevenueDistributionEmptyProps, } from './RevenueDistribution';
|
|
20
|
+
export { InstallmentFundAssignment, InstallmentFundAssignmentSkeleton } from './InstallmentFundAssignment';
|
|
21
|
+
export type * from './InstallmentFundAssignment';
|
|
22
|
+
export { CommitmentDetails } from './CommitmentDetails';
|
|
23
|
+
export type * from './CommitmentDetails';
|
|
24
|
+
export { ConfirmationModal } from './ConfirmationModal';
|
|
25
|
+
export type * from './ConfirmationModal';
|
|
26
|
+
export { InstallmentTable, InstallmentSchedule, InstallmentScheduleSkeleton, generateAutomaticInstallments, } from './InstallmentSchedule';
|
|
27
|
+
export type * from './InstallmentSchedule';
|
|
20
28
|
export { MembershipSelectCards } from './MembershipSelectCards';
|
|
21
29
|
export type * from './MembershipSelectCards';
|
|
22
30
|
export { ItemCard } from './ItemCard';
|
|
@@ -25,3 +33,27 @@ export { Toggle } from './Toggle';
|
|
|
25
33
|
export type * from './Toggle';
|
|
26
34
|
export { TicketSelection } from './TicketSelection';
|
|
27
35
|
export type * from './TicketSelection';
|
|
36
|
+
export { CashTenderForm } from './CashTenderForm';
|
|
37
|
+
export type { CashTenderFormProps, CashTenderValue, CashTenderLabels, } from './CashTenderForm';
|
|
38
|
+
export { CheckTenderForm } from './CheckTenderForm';
|
|
39
|
+
export type { CheckTenderFormProps, CheckTenderValue, CheckTenderLabels } from './CheckTenderForm';
|
|
40
|
+
export { OtherTenderForm } from './OtherTenderForm';
|
|
41
|
+
export type { OtherTenderFormProps, OtherTenderValue, OtherTenderLabels, OtherTenderMethodOption, } from './OtherTenderForm';
|
|
42
|
+
export { SplitPaymentSummary } from './SplitPaymentSummary';
|
|
43
|
+
export type { SplitPaymentSummaryProps, SplitPaymentSummaryLabels, TenderRow, TenderRowStatus, TenderRowType, } from './SplitPaymentSummary';
|
|
44
|
+
export { ModalShell, ModalShellHeader, ModalShellFooter } from './ModalShell';
|
|
45
|
+
export type { ModalShellProps, ModalShellHeaderProps, ModalShellFooterProps, } from './ModalShell';
|
|
46
|
+
export { TileSelect } from './TileSelect';
|
|
47
|
+
export type { TileSelectProps, TileSelectOption } from './TileSelect';
|
|
48
|
+
export { PaymentTotalBanner } from './PaymentTotalBanner';
|
|
49
|
+
export type { PaymentTotalBannerProps } from './PaymentTotalBanner';
|
|
50
|
+
export { LoadingOverlay } from './LoadingOverlay';
|
|
51
|
+
export type { LoadingOverlayProps } from './LoadingOverlay';
|
|
52
|
+
export { PaymentSuccessView } from './PaymentSuccessView';
|
|
53
|
+
export type { PaymentSuccessViewProps } from './PaymentSuccessView';
|
|
54
|
+
export { PaymentCashChangeBanner } from './PaymentCashChangeBanner';
|
|
55
|
+
export type { PaymentCashChangeBannerProps } from './PaymentCashChangeBanner';
|
|
56
|
+
export { PaymentSubAmountInput } from './PaymentSubAmountInput';
|
|
57
|
+
export type { PaymentSubAmountInputProps } from './PaymentSubAmountInput';
|
|
58
|
+
export { ConfirmDialog } from './ConfirmDialog';
|
|
59
|
+
export type { ConfirmDialogProps } from './ConfirmDialog';
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -417,6 +417,19 @@ export declare const tokens: {
|
|
|
417
417
|
readonly 900: "#78350f";
|
|
418
418
|
readonly DEFAULT: "#F5A524";
|
|
419
419
|
};
|
|
420
|
+
readonly info: {
|
|
421
|
+
readonly 50: "#eff6ff";
|
|
422
|
+
readonly 100: "#dbeafe";
|
|
423
|
+
readonly 200: "#bfdbfe";
|
|
424
|
+
readonly 300: "#93c5fd";
|
|
425
|
+
readonly 400: "#60a5fa";
|
|
426
|
+
readonly 500: "#2563EB";
|
|
427
|
+
readonly 600: "#1d4ed8";
|
|
428
|
+
readonly 700: "#1e40af";
|
|
429
|
+
readonly 800: "#1e3a8a";
|
|
430
|
+
readonly 900: "#172554";
|
|
431
|
+
readonly DEFAULT: "#2563EB";
|
|
432
|
+
};
|
|
420
433
|
};
|
|
421
434
|
};
|
|
422
435
|
typography: {
|
package/dist/tailwind/index.js
CHANGED
|
@@ -126,6 +126,19 @@ var colors = {
|
|
|
126
126
|
800: "#92400e",
|
|
127
127
|
900: "#78350f",
|
|
128
128
|
DEFAULT: "#F5A524"
|
|
129
|
+
},
|
|
130
|
+
info: {
|
|
131
|
+
50: "#eff6ff",
|
|
132
|
+
100: "#dbeafe",
|
|
133
|
+
200: "#bfdbfe",
|
|
134
|
+
300: "#93c5fd",
|
|
135
|
+
400: "#60a5fa",
|
|
136
|
+
500: "#2563EB",
|
|
137
|
+
600: "#1d4ed8",
|
|
138
|
+
700: "#1e40af",
|
|
139
|
+
800: "#1e3a8a",
|
|
140
|
+
900: "#172554",
|
|
141
|
+
DEFAULT: "#2563EB"
|
|
129
142
|
}
|
|
130
143
|
}
|
|
131
144
|
};
|
package/dist/tokens/colors.d.ts
CHANGED
|
@@ -94,6 +94,19 @@ export declare const colors: {
|
|
|
94
94
|
readonly 900: "#78350f";
|
|
95
95
|
readonly DEFAULT: "#F5A524";
|
|
96
96
|
};
|
|
97
|
+
readonly info: {
|
|
98
|
+
readonly 50: "#eff6ff";
|
|
99
|
+
readonly 100: "#dbeafe";
|
|
100
|
+
readonly 200: "#bfdbfe";
|
|
101
|
+
readonly 300: "#93c5fd";
|
|
102
|
+
readonly 400: "#60a5fa";
|
|
103
|
+
readonly 500: "#2563EB";
|
|
104
|
+
readonly 600: "#1d4ed8";
|
|
105
|
+
readonly 700: "#1e40af";
|
|
106
|
+
readonly 800: "#1e3a8a";
|
|
107
|
+
readonly 900: "#172554";
|
|
108
|
+
readonly DEFAULT: "#2563EB";
|
|
109
|
+
};
|
|
97
110
|
};
|
|
98
111
|
};
|
|
99
112
|
export type ColorToken = typeof colors;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities exposed at the top level of `@veevarts/design-system`.
|
|
3
|
+
* Each file here is a self-contained module that any pattern (or external
|
|
4
|
+
* consumer) can import without reaching into a specific pattern folder.
|
|
5
|
+
*/
|
|
6
|
+
export { formatMoney, computeChange, currencyFractionDigits, roundToCurrency, } from './money';
|
|
7
|
+
export type { Money, CurrencyCode } from './money';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Money utilities — shared display + precision helpers for any pattern
|
|
3
|
+
* that renders currency.
|
|
4
|
+
*
|
|
5
|
+
* Used by CashTenderForm, PaymentTotalBanner, PaymentCashChangeBanner,
|
|
6
|
+
* SplitPaymentSummary, and any future pattern that surfaces an Amount
|
|
7
|
+
* to the user. Lives under `src/utils/` (not under a specific pattern)
|
|
8
|
+
* so cross-pattern imports follow the canonical `@utils/money` alias
|
|
9
|
+
* instead of reaching into one pattern's internals.
|
|
10
|
+
*
|
|
11
|
+
* Scope is intentionally narrow: formatting + precision + a single
|
|
12
|
+
* trivial `received - due` for cash-change live preview. NOT business
|
|
13
|
+
* logic — the BFF persists `received` and `change` independently as
|
|
14
|
+
* `Amount` value objects and never recomputes the FE's formula. If a
|
|
15
|
+
* future helper needs validation, currency conversion, or aggregate
|
|
16
|
+
* arithmetic, it does NOT belong here; it belongs in the consumer.
|
|
17
|
+
*
|
|
18
|
+
* Currency precision is locale-aware:
|
|
19
|
+
* `Intl.NumberFormat(locale, { style: 'currency', currency }).resolvedOptions().maximumFractionDigits`
|
|
20
|
+
* yields 2 for USD, 0 for JPY, 3 for BHD, etc.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* ISO 4217 currency code (e.g., 'USD', 'EUR', 'JPY').
|
|
24
|
+
* String type kept open to avoid maintaining a closed enum.
|
|
25
|
+
*/
|
|
26
|
+
export type CurrencyCode = string;
|
|
27
|
+
/**
|
|
28
|
+
* Canonical Money shape used across tender patterns.
|
|
29
|
+
* `value` is the major unit as a regular number (e.g. 12.34 for $12.34).
|
|
30
|
+
* Integer-cents storage is up to the consuming app; patterns operate on
|
|
31
|
+
* `number` for the user-facing form layer.
|
|
32
|
+
*/
|
|
33
|
+
export interface Money {
|
|
34
|
+
value: number;
|
|
35
|
+
currency: CurrencyCode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Format a number as a localized currency string.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatMoney(amount: number, locale?: string, currency?: CurrencyCode): string;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the maximum fraction digits Intl exposes for a currency.
|
|
43
|
+
* USD => 2, JPY => 0, BHD => 3, etc.
|
|
44
|
+
*/
|
|
45
|
+
export declare function currencyFractionDigits(currency: CurrencyCode, locale?: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* Round to the precision of the given currency (banker's rounding not required —
|
|
48
|
+
* tender entry rounds to display precision, never to cent-half).
|
|
49
|
+
*/
|
|
50
|
+
export declare function roundToCurrency(amount: number, currency: CurrencyCode, locale?: string): number;
|
|
51
|
+
/**
|
|
52
|
+
* Compute change between received and due. Negative when insufficient.
|
|
53
|
+
* Rounded to currency precision so floating-point noise doesn't leak to UI.
|
|
54
|
+
*/
|
|
55
|
+
export declare function computeChange(received: number, due: number, currency: CurrencyCode, locale?: string): number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veevarts/design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.0-alpha.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@iconify/react": "^6.0.2",
|
|
67
|
+
"@internationalized/date": "^3.10.1",
|
|
67
68
|
"react-hook-form": "^7.56.4",
|
|
68
69
|
"vite-plugin-css-injected-by-js": "3.5.2",
|
|
69
70
|
"vite-plugin-dts": "4.5.4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|