@veevarts/design-system 2.1.0-beta.16 → 2.1.0-beta.17
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/README.md +14 -0
- package/dist/components/Drawer/Drawer.d.ts +17 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Modal/CloseButton.d.ts +18 -0
- package/dist/components/Modal/Modal.d.ts +15 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/useLabelledCloseButton.d.ts +13 -0
- package/dist/components/Table/Table.d.ts +7 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +6235 -5008
- package/dist/patterns/AdminToolbar/styles.d.ts +1 -1
- package/dist/patterns/CashTenderForm/types.d.ts +6 -0
- package/dist/patterns/DonationAmounts/index.d.ts +1 -1
- package/dist/patterns/DonationAmounts/styles.d.ts +32 -0
- package/dist/patterns/DonationAmounts/types.d.ts +55 -1
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +7 -3
- package/dist/patterns/FilterSelect/FilterSelectGroup.d.ts +3 -0
- package/dist/patterns/FilterSelect/index.d.ts +2 -1
- package/dist/patterns/FilterSelect/styles.d.ts +2 -0
- package/dist/patterns/FilterSelect/types.d.ts +6 -0
- package/dist/patterns/MetaCard/types.d.ts +2 -0
- package/dist/patterns/OutcomeView/index.d.ts +1 -1
- package/dist/patterns/OutcomeView/types.d.ts +110 -3
- package/dist/patterns/ReasonSelect/types.d.ts +1 -0
- package/dist/patterns/RefundMethodCards/RefundMethodCards.d.ts +4 -0
- package/dist/patterns/RefundMethodCards/index.d.ts +2 -0
- package/dist/patterns/RefundMethodCards/styles.d.ts +59 -0
- package/dist/patterns/RefundMethodCards/types.d.ts +72 -0
- package/dist/patterns/RefundProgressList/RefundProgressList.d.ts +4 -0
- package/dist/patterns/RefundProgressList/index.d.ts +2 -0
- package/dist/patterns/RefundProgressList/styles.d.ts +44 -0
- package/dist/patterns/RefundProgressList/types.d.ts +37 -0
- package/dist/patterns/StepProgress/StepProgress.d.ts +4 -0
- package/dist/patterns/StepProgress/index.d.ts +2 -0
- package/dist/patterns/StepProgress/styles.d.ts +29 -0
- package/dist/patterns/StepProgress/types.d.ts +43 -0
- package/dist/patterns/Summary/types.d.ts +11 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +13 -0
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/TileSelect/styles.d.ts +14 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +20 -1
- package/dist/patterns/UnderlineTabs/index.d.ts +1 -1
- package/dist/patterns/UnderlineTabs/styles.d.ts +10 -0
- package/dist/patterns/WizardShell/index.d.ts +1 -1
- package/dist/patterns/WizardShell/types.d.ts +9 -1
- package/dist/patterns/index.d.ts +13 -7
- package/dist/patterns/shared/usePrefillEdits.d.ts +7 -0
- package/dist/providers/HeroUIProvider.d.ts +9 -1
- package/dist/providers/close-label-context.d.ts +18 -0
- package/dist/tailwind/index.cjs +8 -0
- package/dist/tailwind/index.mjs +8 -0
- package/dist/test/px-class-names.d.ts +1 -0
- package/dist/test/px-classes.d.ts +2 -1
- package/dist/tokens/pos-surface.d.ts +16 -4
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export declare const DEFAULT_SEARCH_WIDTH: Record<AdminToolbarSearchWidth, strin
|
|
|
11
11
|
export declare const FRAMED_WIDE_REM = 48;
|
|
12
12
|
export declare const FRAMED_CLASS: {
|
|
13
13
|
readonly base: "flex flex-wrap items-center gap-2.5 border-b border-pos-hair px-4 py-[0.875rem]";
|
|
14
|
-
readonly narrow: "[&_[data-slot=filter-select]]:!max-w-none [&_[data-slot=filter-select]]:!min-w-[calc(50%-0.3125rem)] [&_[data-slot=filter-select]]:grow [&_[data-slot=filter-select]]:basis-[calc(50%-0.3125rem)]";
|
|
14
|
+
readonly narrow: "[&_[data-slot=filter-select-group]]:flex [&_[data-slot=filter-select-group]]:flex-wrap [&_[data-slot=filter-select-group]]:!max-w-none [&_[data-slot=filter-select]]:!max-w-none [&_[data-slot=filter-select]]:!min-w-[calc(50%-0.3125rem)] [&_[data-slot=filter-select]]:grow [&_[data-slot=filter-select]]:basis-[calc(50%-0.3125rem)]";
|
|
15
15
|
readonly searchWide: "ml-auto";
|
|
16
16
|
/** Fill wins over the narrow rule: it already takes the row, and keeps a trailing action beside it until 12.5rem. */
|
|
17
17
|
readonly searchFill: "min-w-[12.5rem] flex-1";
|
|
@@ -29,6 +29,10 @@ export interface CashTenderLabels {
|
|
|
29
29
|
* `{due}` is replaced with the formatted due amount.
|
|
30
30
|
*/
|
|
31
31
|
insufficientMessageTemplate?: string;
|
|
32
|
+
exactAmountLabel?: string;
|
|
33
|
+
exactAmountAriaTemplate?: string;
|
|
34
|
+
quickAmountsLabel?: string;
|
|
35
|
+
quickAmountAriaTemplate?: string;
|
|
32
36
|
}
|
|
33
37
|
export interface CashTenderFormProps {
|
|
34
38
|
/**
|
|
@@ -70,6 +74,8 @@ export interface CashTenderFormProps {
|
|
|
70
74
|
* the guard is value-based. Omit for no cap.
|
|
71
75
|
*/
|
|
72
76
|
maxAmount?: number;
|
|
77
|
+
quickAmounts?: readonly number[];
|
|
78
|
+
showExactAmount?: boolean;
|
|
73
79
|
/**
|
|
74
80
|
* Auto-focus the Cash Received field when this component mounts.
|
|
75
81
|
* Pair with `key={...}` from the host to re-trigger focus on every
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Ensures exclusive selection (preset OR custom).
|
|
6
6
|
*/
|
|
7
7
|
export { DonationAmounts } from './DonationAmounts';
|
|
8
|
-
export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps } from './types';
|
|
8
|
+
export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps, DonationAmountsVariant, } from './types';
|
|
9
9
|
export { formatCurrency, parseCurrency } from './utils/currency';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DonationAmountsProps, DonationAmountsVariant } from './types';
|
|
2
|
+
type TiledVariant = Exclude<DonationAmountsVariant, 'pill'>;
|
|
3
|
+
type FieldSize = NonNullable<DonationAmountsProps['size']>;
|
|
4
|
+
interface VariantSlots {
|
|
5
|
+
root: string;
|
|
6
|
+
title: string;
|
|
7
|
+
eyebrow: string;
|
|
8
|
+
caption: string;
|
|
9
|
+
grid: string;
|
|
10
|
+
preset: string;
|
|
11
|
+
presetIdle: string;
|
|
12
|
+
presetSelected: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
amountSelected: string;
|
|
15
|
+
sublabel: string;
|
|
16
|
+
customLabel: string;
|
|
17
|
+
inputBase: string;
|
|
18
|
+
inputWrapper: string;
|
|
19
|
+
inputWrapperActive: string;
|
|
20
|
+
input: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const donationAmountsSlots: Record<TiledVariant, VariantSlots>;
|
|
23
|
+
/**
|
|
24
|
+
* What `size` changes in `tile` and `pos`: the custom field's height and text.
|
|
25
|
+
* `md` is the mockup's field (38px in `tile`, 40px in `pos`); `sm` and `lg`
|
|
26
|
+
* are HeroUI's 32px and 48px fields. The Add button takes `size` directly.
|
|
27
|
+
*/
|
|
28
|
+
export declare const donationAmountsFieldSize: Record<TiledVariant, Record<FieldSize, {
|
|
29
|
+
wrapper: string;
|
|
30
|
+
input: string;
|
|
31
|
+
}>>;
|
|
32
|
+
export {};
|
|
@@ -18,7 +18,27 @@ export interface DonationAmount {
|
|
|
18
18
|
* If not provided, the formatted currency will be used
|
|
19
19
|
*/
|
|
20
20
|
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Second line under the amount, e.g. `'+$0.56 donation'` on a round-up
|
|
23
|
+
* offer. Rendered by the `tile` and `pos` variants only; the `pill`
|
|
24
|
+
* variant has no room for it.
|
|
25
|
+
*/
|
|
26
|
+
sublabel?: string;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* How the presets and the custom input are drawn.
|
|
30
|
+
*
|
|
31
|
+
* - `pill` (default): HeroUI bordered pill buttons; the selected one fills
|
|
32
|
+
* with the brand colour. The original look, unchanged.
|
|
33
|
+
* - `tile`: the Quick Donation / Quick Membership amount grid. Rectangular
|
|
34
|
+
* 12px tiles on the `pos-field` hairline; the selected tile takes a brand
|
|
35
|
+
* border, a 9% brand tint and brand digits.
|
|
36
|
+
* - `pos`: the register's donation modal and round-up offer. 14px chips on
|
|
37
|
+
* the `pos-line` hairline that auto-fit the row (min 96px), 19px digits
|
|
38
|
+
* that stay ink when selected over a 5% brand tint, an optional sublabel,
|
|
39
|
+
* and a visible label over the custom input.
|
|
40
|
+
*/
|
|
41
|
+
export type DonationAmountsVariant = 'pill' | 'tile' | 'pos';
|
|
22
42
|
/**
|
|
23
43
|
* Selected donation value (can be preset or custom)
|
|
24
44
|
*/
|
|
@@ -57,6 +77,27 @@ export interface DonationLabels {
|
|
|
57
77
|
* @default 'Add Donation'
|
|
58
78
|
*/
|
|
59
79
|
addDonationButton?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Small uppercase heading above the presets ("Round up your total").
|
|
82
|
+
* `tile` and `pos` variants only.
|
|
83
|
+
*/
|
|
84
|
+
eyebrow?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Muted line under the eyebrow or title ("Current total $19.44").
|
|
87
|
+
* `tile` and `pos` variants only.
|
|
88
|
+
*/
|
|
89
|
+
caption?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Visible label over the custom amount input ("Custom amount"). When set
|
|
92
|
+
* it also names the input, so `customAmountAriaLabel` is not needed.
|
|
93
|
+
* `tile` and `pos` variants only.
|
|
94
|
+
*/
|
|
95
|
+
customAmountLabel?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Accessible name of the preset group when no `title` is shown.
|
|
98
|
+
* @default 'Suggested amounts'
|
|
99
|
+
*/
|
|
100
|
+
presetsAriaLabel?: string;
|
|
60
101
|
}
|
|
61
102
|
/**
|
|
62
103
|
* Props for DonationAmounts component
|
|
@@ -145,10 +186,23 @@ export interface DonationAmountsProps {
|
|
|
145
186
|
*/
|
|
146
187
|
inputVariant?: 'flat' | 'bordered' | 'faded' | 'underlined';
|
|
147
188
|
/**
|
|
148
|
-
* Size of the custom amount input and add button
|
|
189
|
+
* Size of the custom amount input and add button. In `tile` and `pos`,
|
|
190
|
+
* `md` is the mockup's field; the presets keep their size in every variant.
|
|
149
191
|
* @default 'md'
|
|
150
192
|
*/
|
|
151
193
|
size?: 'sm' | 'md' | 'lg';
|
|
194
|
+
/**
|
|
195
|
+
* Visual variant. See {@link DonationAmountsVariant}.
|
|
196
|
+
* @default 'pill'
|
|
197
|
+
*/
|
|
198
|
+
variant?: DonationAmountsVariant;
|
|
199
|
+
/**
|
|
200
|
+
* Marks the title as required with a danger asterisk (`tile` and `pos`
|
|
201
|
+
* variants). The asterisk is decorative; announce the requirement through
|
|
202
|
+
* the form's own validation.
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
isRequired?: boolean;
|
|
152
206
|
/**
|
|
153
207
|
* Additional CSS classes
|
|
154
208
|
*/
|
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
* @param amount - The amount to format
|
|
7
7
|
* @param locale - The locale to use for formatting (e.g., 'en-US', 'es-ES')
|
|
8
8
|
* @param currency - The currency code (ISO 4217, e.g., 'USD', 'EUR')
|
|
9
|
+
* @param trimZeroCents - Drop the fraction of a whole amount ("$25" rather than
|
|
10
|
+
* "$25.00"). Default `true`; `false` keeps the currency's own digits, as a
|
|
11
|
+
* register price does.
|
|
9
12
|
* @returns Formatted currency string
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
|
-
* formatCurrency(1000, 'en-US', 'USD') // "$1,000
|
|
13
|
-
* formatCurrency(1000, 'es-ES', 'EUR') // "
|
|
15
|
+
* formatCurrency(1000, 'en-US', 'USD') // "$1,000"
|
|
16
|
+
* formatCurrency(1000.5, 'es-ES', 'EUR') // "1000,5 €"
|
|
17
|
+
* formatCurrency(5, 'en-US', 'USD', false) // "$5.00"
|
|
14
18
|
*/
|
|
15
|
-
export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
|
|
19
|
+
export declare function formatCurrency(amount: number, locale?: string, currency?: string, trimZeroCents?: boolean): string;
|
|
16
20
|
/**
|
|
17
21
|
* Parses a currency string to a number
|
|
18
22
|
* @param value - The currency string to parse
|
|
@@ -12,4 +12,6 @@ export declare const filterSelectClass: {
|
|
|
12
12
|
readonly iconActive: "!text-primary-600";
|
|
13
13
|
readonly clear: "absolute right-[1.875rem] top-1/2 z-20 inline-flex size-[1.25rem] -translate-y-1/2 items-center justify-center rounded-md text-primary-600 outline-none hover:bg-white/70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary";
|
|
14
14
|
readonly clearIcon: "size-[0.8125rem]";
|
|
15
|
+
readonly optionTitle: "whitespace-normal break-words";
|
|
15
16
|
};
|
|
17
|
+
export declare const filterSelectGroupClass = "grid shrink grow basis-0 grid-flow-col auto-cols-auto gap-2.5 [--filter-select-cap:16rem] max-w-[calc(var(--filter-select-count)*var(--filter-select-cap)+(var(--filter-select-count)-1)*0.625rem)] [&>[data-slot=filter-select]]:max-w-none";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export interface FilterSelectOption {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
@@ -11,3 +12,8 @@ export interface FilterSelectProps {
|
|
|
11
12
|
minWidth?: number;
|
|
12
13
|
'data-testid'?: string;
|
|
13
14
|
}
|
|
15
|
+
export interface FilterSelectGroupProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
@@ -9,6 +9,8 @@ export interface MetaCardRowProps {
|
|
|
9
9
|
label: string;
|
|
10
10
|
/** Associates the caption with the control it labels. */
|
|
11
11
|
htmlFor?: string;
|
|
12
|
+
/** Marks the caption with a red asterisk; pair it with the control's own required state. */
|
|
13
|
+
required?: boolean;
|
|
12
14
|
children: ReactNode;
|
|
13
15
|
className?: string;
|
|
14
16
|
'data-testid'?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { OutcomeView } from './OutcomeView';
|
|
2
|
-
export type { OutcomeViewProps, OutcomeViewLabels, ReceiptChannel } from './types';
|
|
2
|
+
export type { OutcomeViewProps, OutcomeViewLabels, ReceiptChannel, OutcomeViewKind, OutcomePaidWithLine, OutcomeGroup, OutcomeReceiptAction, OutcomeEmailReceipt, OutcomeChangeDue, } from './types';
|
|
@@ -3,6 +3,77 @@ import { Money } from '../../utils/money';
|
|
|
3
3
|
export type { DestinationLine, DestinationStatus } from '..';
|
|
4
4
|
export type { Money } from '../../utils/money';
|
|
5
5
|
export type ReceiptChannel = 'email' | 'print';
|
|
6
|
+
/**
|
|
7
|
+
* Which settled screen this is. Both are the POS `ex` screen's done stage
|
|
8
|
+
* (`.excard .exdone`); they differ in their default copy and in the top
|
|
9
|
+
* block's spacing.
|
|
10
|
+
*
|
|
11
|
+
* - `refund` (default): "Refund complete", `Reason · …`, "Done". Keeps the
|
|
12
|
+
* refund wizard's `4px 0 2px` top block.
|
|
13
|
+
* - `payment`: "Payment complete", "New sale", "Handled by …". Top block
|
|
14
|
+
* flush with the card padding, as `veevart-2-pos-latest` draws it.
|
|
15
|
+
*/
|
|
16
|
+
export type OutcomeViewKind = 'refund' | 'payment';
|
|
17
|
+
/** One tender in "Paid with": icon box, method, amount, status pill. */
|
|
18
|
+
export interface OutcomePaidWithLine {
|
|
19
|
+
/** Method name ("Card", "Cash", "Visa •••4242"). */
|
|
20
|
+
label: string;
|
|
21
|
+
amount: Money;
|
|
22
|
+
/** Iconify name for the 34px icon box (`'solar:card-outline'`). Omit for no box. */
|
|
23
|
+
icon?: string;
|
|
24
|
+
/** Pill at the row's end ("Paid", "Pending"). Omit for none. */
|
|
25
|
+
status?: string;
|
|
26
|
+
}
|
|
27
|
+
/** One "Outcome" group: an eyebrow over the things the sale produced. */
|
|
28
|
+
export interface OutcomeGroup {
|
|
29
|
+
/** Eyebrow ("Purchased", "Returned"). */
|
|
30
|
+
label: string;
|
|
31
|
+
/** One chip each ("Observer", "Donation"). */
|
|
32
|
+
items: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A receipt button in the `.rc-row` (Email receipt / Print receipt / Send
|
|
36
|
+
* digital card). The host decides which ones a sale offers.
|
|
37
|
+
*/
|
|
38
|
+
export interface OutcomeReceiptAction {
|
|
39
|
+
/** Stable key; also the testid suffix (`-receipt-action-<key>`). */
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
/** Iconify name, 16px, before the label. */
|
|
43
|
+
icon?: string;
|
|
44
|
+
onPress: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* The action opens a panel under the row (the email box). `true` draws it
|
|
47
|
+
* pressed and sets `aria-expanded`. Leave `undefined` for a plain action.
|
|
48
|
+
*/
|
|
49
|
+
expanded?: boolean;
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The email box under the receipt row (`.rc-emailbox`): recipients as
|
|
54
|
+
* removable chips, a free-text field, and the send button. Controlled: the
|
|
55
|
+
* host owns the list, the draft and the validation.
|
|
56
|
+
*/
|
|
57
|
+
export interface OutcomeEmailReceipt {
|
|
58
|
+
emails: string[];
|
|
59
|
+
draft: string;
|
|
60
|
+
onDraftChange: (draft: string) => void;
|
|
61
|
+
/** Enter in the field. The host validates and adds (or flags `isInvalid`). */
|
|
62
|
+
onAddEmail: (draft: string) => void;
|
|
63
|
+
onRemoveEmail: (email: string) => void;
|
|
64
|
+
onSend: () => void;
|
|
65
|
+
/** Danger border on the recipients box. */
|
|
66
|
+
isInvalid?: boolean;
|
|
67
|
+
isSending?: boolean;
|
|
68
|
+
/** Default: disabled while there is no recipient. */
|
|
69
|
+
isSendDisabled?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** Cash paid over the total: the screen leads with the change instead of the total. */
|
|
72
|
+
export interface OutcomeChangeDue {
|
|
73
|
+
amount: Money;
|
|
74
|
+
/** Muted line under the amount ("Total $19.44 · Cash tendered $20.00"). */
|
|
75
|
+
caption?: string;
|
|
76
|
+
}
|
|
6
77
|
export interface OutcomeViewLabels {
|
|
7
78
|
processing?: string;
|
|
8
79
|
title?: string;
|
|
@@ -17,19 +88,55 @@ export interface OutcomeViewLabels {
|
|
|
17
88
|
reason?: string;
|
|
18
89
|
/** `{name}` is replaced with the `authorizedBy` prop. */
|
|
19
90
|
authorizedBy?: string;
|
|
91
|
+
/** Eyebrow over `paidWith`. Default `'Paid with'`. */
|
|
92
|
+
paidWithTitle?: string;
|
|
93
|
+
/** Eyebrow over `outcomeGroups`. Default `'Outcome'`. */
|
|
94
|
+
outcomeTitle?: string;
|
|
95
|
+
/** Label over the change amount. Default `'Change due'`. */
|
|
96
|
+
changeDue?: string;
|
|
97
|
+
/** Placeholder of the email field. Default `'Add email…'`. */
|
|
98
|
+
emailPlaceholder?: string;
|
|
99
|
+
/** Accessible name of the email field. Default `'Add email address'`. */
|
|
100
|
+
emailAriaLabel?: string;
|
|
101
|
+
/** `{email}` is replaced with the address. Default `'Remove {email}'`. */
|
|
102
|
+
removeEmail?: string;
|
|
103
|
+
/** Send button of the email box. Default `'Send receipt'`. */
|
|
104
|
+
sendEmail?: string;
|
|
20
105
|
}
|
|
21
106
|
export interface OutcomeViewProps {
|
|
22
107
|
state: 'processing' | 'complete';
|
|
23
|
-
/**
|
|
108
|
+
/** See {@link OutcomeViewKind}. Default `'refund'`. */
|
|
109
|
+
kind?: OutcomeViewKind;
|
|
110
|
+
/** Amount refunded or paid — shown under the spinner, then as the receipt headline. */
|
|
24
111
|
total?: Money;
|
|
25
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Where a refund went, with a per-line status chip. A payment omits it:
|
|
114
|
+
* the section is drawn only when the prop is given.
|
|
115
|
+
*/
|
|
116
|
+
destinations?: DestinationLine[];
|
|
117
|
+
/** Muted line under the total ("TXN-10483 · Marcus Chen"). */
|
|
118
|
+
subtitle?: string;
|
|
26
119
|
/** Refund reason, printed under the total as `Reason · …`. */
|
|
27
120
|
reason?: string;
|
|
28
|
-
/**
|
|
121
|
+
/** "Paid with" rows. */
|
|
122
|
+
paidWith?: OutcomePaidWithLine[];
|
|
123
|
+
/** "Outcome" groups: what the sale produced, as chips. */
|
|
124
|
+
outcomeGroups?: OutcomeGroup[];
|
|
125
|
+
/** Cash change to hand back. Replaces the title + total block. */
|
|
126
|
+
changeDue?: OutcomeChangeDue;
|
|
127
|
+
/** Who authorized the refund or handled the sale, printed as the footer line. */
|
|
29
128
|
authorizedBy?: string;
|
|
30
129
|
/** Receipt channels already chosen, reflected in the row checkboxes. */
|
|
31
130
|
selectedReceipts?: ReceiptChannel[];
|
|
131
|
+
/** The refund's receipt checkbox rows. Ignored when `receiptActions` is given. */
|
|
32
132
|
onSendReceipt?: (channel: ReceiptChannel) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Receipt buttons in one row (`.rc-row`), the payment screen's
|
|
135
|
+
* Email / Print / Send digital card. Takes the place of the checkbox rows.
|
|
136
|
+
*/
|
|
137
|
+
receiptActions?: OutcomeReceiptAction[];
|
|
138
|
+
/** The email box under the receipt row. Pass it while the email action is expanded. */
|
|
139
|
+
emailReceipt?: OutcomeEmailReceipt;
|
|
33
140
|
onDone: () => void;
|
|
34
141
|
/**
|
|
35
142
|
* Drops the settled state's own `.excard` frame, for hosts that already
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { RefundMethodCards } from './RefundMethodCards';
|
|
2
|
+
export type { RefundMethodCardsProps, RefundMethodCardsLabels, RefundMethodCardsError, RefundMethodView, RefundMethodKind, RefundMethodStatus, RefundMethodOption, RefundMethodAnotherMethod, RefundMethodPaidWith, } from './types';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { RefundMethodKind } from './types';
|
|
3
|
+
export declare const PRIMARY = "hsl(var(--heroui-primary))";
|
|
4
|
+
export declare const refundMethodKindIcon: Record<RefundMethodKind, string>;
|
|
5
|
+
export declare const refundMethodCardsClass: {
|
|
6
|
+
readonly root: "flex flex-col text-default-900";
|
|
7
|
+
readonly banner: "mb-[18px]";
|
|
8
|
+
readonly eyebrowRow: "mb-3 flex min-h-6 items-center justify-between gap-3";
|
|
9
|
+
readonly eyebrow: "text-[11px] font-semibold uppercase tracking-[.08em] text-default-500";
|
|
10
|
+
readonly grid: "grid grid-cols-3 gap-2.5";
|
|
11
|
+
readonly card: "relative flex min-h-[132px] flex-col rounded-[14px] border-[1.5px] bg-white transition-colors";
|
|
12
|
+
readonly focusRing: "outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
|
|
13
|
+
readonly toggle: "flex w-full items-center gap-[11px] rounded-[12px] px-[15px] pt-[13px] text-left disabled:cursor-not-allowed";
|
|
14
|
+
readonly toggleUnselected: "flex-1 flex-col items-stretch gap-3 pb-[13px]";
|
|
15
|
+
readonly toggleHeader: "flex w-full items-center gap-[11px]";
|
|
16
|
+
readonly toggleRemovable: "pr-12";
|
|
17
|
+
readonly iconBox: "flex h-[38px] w-[38px] shrink-0 items-center justify-center rounded-[10px]";
|
|
18
|
+
readonly text: "min-w-0 flex-1";
|
|
19
|
+
readonly label: "block truncate text-[15px] font-semibold leading-5";
|
|
20
|
+
readonly subtitle: "block truncate text-xs text-default-500";
|
|
21
|
+
readonly status: "block truncate text-xs font-semibold";
|
|
22
|
+
readonly lowerSlot: "mt-auto flex h-11 w-full items-center rounded-[10px] px-3 text-[13px] font-medium tabular-nums";
|
|
23
|
+
readonly amountSlot: "mt-auto px-[15px] pb-[13px] pt-3";
|
|
24
|
+
readonly amountWrapper: "h-11 min-h-11 rounded-[10px] bg-white shadow-none";
|
|
25
|
+
readonly amountInput: "text-[15px] font-semibold tabular-nums";
|
|
26
|
+
readonly remove: "absolute right-1 top-1 flex h-11 w-11 items-center justify-center rounded-[10px] text-default-500 hover:text-default-900 disabled:cursor-not-allowed";
|
|
27
|
+
readonly badge: "inline-flex h-[22px] shrink-0 items-center whitespace-nowrap rounded-full px-[9px] text-xs font-medium leading-none";
|
|
28
|
+
readonly another: "flex min-h-[132px] w-full flex-col items-start justify-center gap-3 rounded-[14px] border-[1.5px] border-dashed bg-white px-[15px] py-[13px] text-left transition-colors disabled:cursor-not-allowed";
|
|
29
|
+
readonly anotherOpen: "aria-expanded:scale-100";
|
|
30
|
+
readonly menuItem: "py-2";
|
|
31
|
+
};
|
|
32
|
+
type CardTone = 'idle' | 'selected' | 'declined';
|
|
33
|
+
export declare const refundMethodCardStyle: Record<CardTone, CSSProperties>;
|
|
34
|
+
export declare const refundMethodIconStyle: {
|
|
35
|
+
readonly idle: {
|
|
36
|
+
readonly backgroundColor: "hsl(var(--heroui-default-100))";
|
|
37
|
+
readonly color: "hsl(var(--heroui-default-600))";
|
|
38
|
+
};
|
|
39
|
+
readonly selected: {
|
|
40
|
+
readonly backgroundColor: "hsl(var(--heroui-primary))";
|
|
41
|
+
readonly color: "#fff";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare const refundMethodLowerSlotStyle: CSSProperties;
|
|
45
|
+
export declare const refundMethodAnotherStyle: CSSProperties;
|
|
46
|
+
export declare const refundMethodStatusStyle: {
|
|
47
|
+
readonly declined: {
|
|
48
|
+
readonly color: "#B62214";
|
|
49
|
+
};
|
|
50
|
+
readonly pending: {
|
|
51
|
+
readonly color: "#854F0B";
|
|
52
|
+
readonly backgroundColor: "#FAEEDA";
|
|
53
|
+
};
|
|
54
|
+
readonly done: {
|
|
55
|
+
readonly color: "#3B6D11";
|
|
56
|
+
readonly backgroundColor: "#EAF3DE";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CurrencyCode, Money } from '../../utils/money';
|
|
2
|
+
export type RefundMethodKind = 'card' | 'cash' | 'check' | 'store_credit' | 'reader' | 'other';
|
|
3
|
+
export type RefundMethodStatus = 'idle' | 'declined' | 'pending' | 'done';
|
|
4
|
+
export interface RefundMethodView {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: RefundMethodKind;
|
|
7
|
+
label: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
/** Most this method can take back; shown as "Up to …" and enforced on the amount input. */
|
|
10
|
+
cap?: Money;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
/** The text the cashier typed, owned by the host. */
|
|
13
|
+
amount?: string;
|
|
14
|
+
status?: RefundMethodStatus;
|
|
15
|
+
statusLabel?: string;
|
|
16
|
+
removable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface RefundMethodOption {
|
|
19
|
+
id: string;
|
|
20
|
+
kind: RefundMethodKind;
|
|
21
|
+
label: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RefundMethodAnotherMethod {
|
|
25
|
+
label: string;
|
|
26
|
+
subtitle: string;
|
|
27
|
+
options: RefundMethodOption[];
|
|
28
|
+
onPick: (optionId: string) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface RefundMethodPaidWith {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}
|
|
34
|
+
export interface RefundMethodCardsError {
|
|
35
|
+
tone: 'danger' | 'warning';
|
|
36
|
+
title?: string;
|
|
37
|
+
body: string;
|
|
38
|
+
onRetry?: () => void;
|
|
39
|
+
onChooseDifferent: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface RefundMethodCardsLabels {
|
|
42
|
+
heading?: string;
|
|
43
|
+
/** `{amount}` is replaced with the formatted cap. */
|
|
44
|
+
upTo?: string;
|
|
45
|
+
/** Shown in the lower slot of an unselected method that has no cap. */
|
|
46
|
+
noCap?: string;
|
|
47
|
+
/** Accessible name of the amount input; `{method}` is replaced with the method label. */
|
|
48
|
+
amountFor?: string;
|
|
49
|
+
/** Accessible name of the remove button; `{method}` is replaced with the method label. */
|
|
50
|
+
remove?: string;
|
|
51
|
+
declined?: string;
|
|
52
|
+
pending?: string;
|
|
53
|
+
done?: string;
|
|
54
|
+
retry?: string;
|
|
55
|
+
chooseDifferent?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface RefundMethodCardsProps {
|
|
58
|
+
methods: RefundMethodView[];
|
|
59
|
+
onToggle: (id: string) => void;
|
|
60
|
+
onAmountChange: (id: string, draft: string) => void;
|
|
61
|
+
onAmountBlur?: (id: string) => void;
|
|
62
|
+
onRemove?: (id: string) => void;
|
|
63
|
+
/** Currency of the typed amounts when a method has no cap. Default `'USD'`. */
|
|
64
|
+
currency?: CurrencyCode;
|
|
65
|
+
paidWith?: RefundMethodPaidWith;
|
|
66
|
+
anotherMethod?: RefundMethodAnotherMethod;
|
|
67
|
+
error?: RefundMethodCardsError;
|
|
68
|
+
busy?: boolean;
|
|
69
|
+
labels?: RefundMethodCardsLabels;
|
|
70
|
+
className?: string;
|
|
71
|
+
'data-testid'?: string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { RefundProgressStatus } from './types';
|
|
3
|
+
export declare const refundProgressListClass: {
|
|
4
|
+
readonly root: "flex flex-col text-default-900";
|
|
5
|
+
readonly eyebrow: "mb-3 text-[11px] font-semibold uppercase tracking-[.08em] text-default-500";
|
|
6
|
+
readonly list: "flex flex-col gap-2.5";
|
|
7
|
+
readonly row: "flex flex-col gap-3 rounded-[14px] border-[1.5px] px-[15px] py-[13px] transition-colors";
|
|
8
|
+
readonly main: "flex items-center gap-[11px]";
|
|
9
|
+
readonly iconBox: "flex h-[38px] w-[38px] shrink-0 items-center justify-center rounded-[10px]";
|
|
10
|
+
readonly text: "min-w-0 flex-1";
|
|
11
|
+
readonly label: "block truncate text-[15px] font-semibold leading-5";
|
|
12
|
+
readonly note: "block truncate text-xs text-default-500";
|
|
13
|
+
readonly amount: "shrink-0 text-[15px] font-semibold tabular-nums";
|
|
14
|
+
readonly badge: "inline-flex h-[22px] shrink-0 items-center gap-[5px] whitespace-nowrap rounded-full px-[9px] text-xs font-medium leading-none";
|
|
15
|
+
readonly prompt: "flex flex-wrap items-center gap-3 rounded-[10px] px-3 py-2";
|
|
16
|
+
readonly promptText: "min-w-0 flex-1 text-[13px] font-medium";
|
|
17
|
+
readonly action: "h-11 min-w-0 rounded-[12px] px-4 text-[14px] font-semibold";
|
|
18
|
+
};
|
|
19
|
+
export declare const refundProgressRowStyle: {
|
|
20
|
+
readonly idle: {
|
|
21
|
+
readonly borderColor: "#E7E7E9";
|
|
22
|
+
readonly backgroundColor: "#fff";
|
|
23
|
+
};
|
|
24
|
+
readonly active: {
|
|
25
|
+
readonly borderColor: "hsl(var(--heroui-primary))";
|
|
26
|
+
readonly backgroundColor: "hsl(var(--heroui-primary) / 0.05)";
|
|
27
|
+
};
|
|
28
|
+
readonly failed: {
|
|
29
|
+
readonly borderColor: "#B62214";
|
|
30
|
+
readonly backgroundColor: "#FCEBEB";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const refundProgressIconStyle: {
|
|
34
|
+
readonly idle: {
|
|
35
|
+
readonly backgroundColor: "hsl(var(--heroui-default-100))";
|
|
36
|
+
readonly color: "hsl(var(--heroui-default-600))";
|
|
37
|
+
};
|
|
38
|
+
readonly active: {
|
|
39
|
+
readonly backgroundColor: "hsl(var(--heroui-primary))";
|
|
40
|
+
readonly color: "#fff";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export declare const refundProgressPromptStyle: CSSProperties;
|
|
44
|
+
export declare const refundProgressStatusStyle: Record<RefundProgressStatus, CSSProperties>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Money } from '../../utils/money';
|
|
2
|
+
import { RefundMethodKind } from '../RefundMethodCards/types';
|
|
3
|
+
export type RefundProgressStatus = 'queued' | 'processing' | 'waiting_reader' | 'waiting_cash' | 'done' | 'failed';
|
|
4
|
+
export interface RefundProgressAction {
|
|
5
|
+
label: string;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface RefundProgressPart {
|
|
11
|
+
id: string;
|
|
12
|
+
kind: RefundMethodKind;
|
|
13
|
+
label: string;
|
|
14
|
+
amount: Money;
|
|
15
|
+
status: RefundProgressStatus;
|
|
16
|
+
note?: string;
|
|
17
|
+
/** Instruction for the cashier under the row, e.g. "Give $30.00 from the drawer". */
|
|
18
|
+
prompt?: string;
|
|
19
|
+
action?: RefundProgressAction;
|
|
20
|
+
}
|
|
21
|
+
export interface RefundProgressListLabels {
|
|
22
|
+
heading?: string;
|
|
23
|
+
queued?: string;
|
|
24
|
+
processing?: string;
|
|
25
|
+
waitingReader?: string;
|
|
26
|
+
waitingCash?: string;
|
|
27
|
+
done?: string;
|
|
28
|
+
failed?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface RefundProgressListProps {
|
|
31
|
+
parts: RefundProgressPart[];
|
|
32
|
+
/** Highlighted row. Defaults to the first part that is processing or waiting. */
|
|
33
|
+
activeId?: string;
|
|
34
|
+
labels?: RefundProgressListLabels;
|
|
35
|
+
className?: string;
|
|
36
|
+
'data-testid'?: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot classes for `StepProgress`, measured off `veevart-2-pos-latest`
|
|
3
|
+
* (`.stepbar` and `.exprog`, read with `getComputedStyle` on 2026-10-21).
|
|
4
|
+
*
|
|
5
|
+
* Segment colours are the screen's own: done is `pos-ok` (#3B6D11), active the
|
|
6
|
+
* brand, upcoming the `pos-line` hairline. Names are 12px/600 on an 18px line:
|
|
7
|
+
* upcoming in `pos-muted`, active in `pos-ink`, done in `pos-ok` behind a 13px
|
|
8
|
+
* filled check with a 5px gap. DS tokens only, no stock HeroUI colours.
|
|
9
|
+
*
|
|
10
|
+
* Every size is rem (the 4px segment is `h-1`), so the POS "Text size"
|
|
11
|
+
* setting, which scales the root font size, scales the bar with the screen.
|
|
12
|
+
* Nothing here animates, so reduced motion has nothing to turn off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const stepProgressClass: {
|
|
15
|
+
/** `.stepbar`: bare segments, 6px apart. */
|
|
16
|
+
readonly bare: "flex gap-1.5";
|
|
17
|
+
/** `.exprog`: labelled steps, 16px apart. */
|
|
18
|
+
readonly list: "m-0 flex list-none gap-4 p-0";
|
|
19
|
+
readonly item: "flex min-w-0 flex-1 flex-col";
|
|
20
|
+
readonly step: "flex min-w-0 flex-1 flex-col items-stretch gap-1.5 text-left";
|
|
21
|
+
readonly button: "cursor-pointer rounded-md border-none bg-transparent p-0 font-[inherit] outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[0.1875rem] focus-visible:outline-primary disabled:cursor-default";
|
|
22
|
+
readonly segment: "block h-1 rounded-full";
|
|
23
|
+
readonly name: "flex min-w-0 items-center gap-[0.3125rem] truncate text-xs font-semibold leading-[1.125rem]";
|
|
24
|
+
/** The 13px filled check in front of a finished step's name. */
|
|
25
|
+
readonly check: "flex h-[0.8125rem] w-[0.8125rem] shrink-0";
|
|
26
|
+
};
|
|
27
|
+
export type StepTone = 'done' | 'active' | 'upcoming';
|
|
28
|
+
export declare const segmentToneClass: Record<StepTone, string>;
|
|
29
|
+
export declare const nameToneClass: Record<StepTone, string>;
|