@veevarts/design-system 1.12.5 → 1.12.6
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 +36 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4662 -3516
- package/dist/patterns/CashTenderForm/CashTenderForm.d.ts +4 -0
- package/dist/patterns/CashTenderForm/__test__/CashTenderForm.test.d.ts +4 -0
- package/dist/patterns/CashTenderForm/index.d.ts +9 -0
- package/dist/patterns/CashTenderForm/types.d.ts +71 -0
- package/dist/patterns/CheckTenderForm/CheckTenderForm.d.ts +4 -0
- package/dist/patterns/CheckTenderForm/__test__/CheckTenderForm.test.d.ts +4 -0
- package/dist/patterns/CheckTenderForm/index.d.ts +9 -0
- package/dist/patterns/CheckTenderForm/types.d.ts +42 -0
- package/dist/patterns/ConfirmDialog/ConfirmDialog.d.ts +21 -0
- package/dist/patterns/ConfirmDialog/index.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/__test__/OtherTenderForm.test.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 +31 -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/__test__/SplitPaymentSummary.test.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 +24 -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 +1 -1
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;
|