@veevarts/design-system 2.20.0 → 2.21.0
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 +5 -5
- package/dist/index.js +5038 -4544
- 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/WizardShell/index.d.ts +1 -1
- package/dist/patterns/WizardShell/types.d.ts +9 -1
- package/dist/patterns/index.d.ts +5 -1
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { WizardShell } from './WizardShell';
|
|
2
|
-
export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellSecondaryAction, WizardShellTotalRow, WizardShellLabels, } from './types';
|
|
2
|
+
export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellSecondaryAction, WizardShellTotalRow, WizardShellTotalBadge, WizardShellLabels, } from './types';
|
|
@@ -28,10 +28,16 @@ export interface WizardShellSecondaryAction {
|
|
|
28
28
|
* the return covers less than the order, `owes` reads "Customer owes" when the
|
|
29
29
|
* balance runs the other way.
|
|
30
30
|
*/
|
|
31
|
+
export interface WizardShellTotalBadge {
|
|
32
|
+
label: string;
|
|
33
|
+
tone: 'warn' | 'neutral' | 'ok';
|
|
34
|
+
}
|
|
31
35
|
export interface WizardShellTotalRow {
|
|
32
36
|
label: string;
|
|
33
37
|
amount?: Money;
|
|
34
|
-
|
|
38
|
+
/** Renders the amount as a counter against this total: "Assigned $40.00 of $46.00". */
|
|
39
|
+
of?: Money;
|
|
40
|
+
badge?: 'partial' | 'owes' | WizardShellTotalBadge;
|
|
35
41
|
}
|
|
36
42
|
export interface WizardShellLabels {
|
|
37
43
|
back?: string;
|
|
@@ -40,6 +46,8 @@ export interface WizardShellLabels {
|
|
|
40
46
|
cancel?: string;
|
|
41
47
|
partialBadge?: string;
|
|
42
48
|
owesBadge?: string;
|
|
49
|
+
/** The word between `totalRow.amount` and `totalRow.of`. */
|
|
50
|
+
ofSeparator?: string;
|
|
43
51
|
}
|
|
44
52
|
export interface WizardShellProps {
|
|
45
53
|
onClose?: () => void;
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export type { DiscardGuardProps, DiscardGuardController, DiscardGuardActions } f
|
|
|
108
108
|
export { Summary } from './Summary';
|
|
109
109
|
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|
|
110
110
|
export { WizardShell } from './WizardShell';
|
|
111
|
-
export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellSecondaryAction, WizardShellTotalRow, WizardShellLabels, } from './WizardShell';
|
|
111
|
+
export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellSecondaryAction, WizardShellTotalRow, WizardShellTotalBadge, WizardShellLabels, } from './WizardShell';
|
|
112
112
|
export type { TenderError, DestinationLine, DestinationStatus, RecordTone } from './shared';
|
|
113
113
|
export { LineItemList } from './LineItemList';
|
|
114
114
|
export type { LineItemListProps, LineItemView, ItemSelection, LineItemState, LineItemRestockView, ItemDisposition, AmountOnlyView, LineItemListLabels, } from './LineItemList';
|
|
@@ -126,6 +126,10 @@ export { TenderMethods } from './TenderMethods';
|
|
|
126
126
|
export type { TenderMethodsProps, TenderView, TenderKind, TenderMethodsLabels } from './TenderMethods';
|
|
127
127
|
export { SplitTenderPanel } from './SplitTenderPanel';
|
|
128
128
|
export type { SplitTenderPanelProps, SplitPartView, SplitMethodOption, SplitTenderPanelLabels, } from './SplitTenderPanel';
|
|
129
|
+
export { RefundMethodCards } from './RefundMethodCards';
|
|
130
|
+
export type { RefundMethodCardsProps, RefundMethodCardsLabels, RefundMethodCardsError, RefundMethodView, RefundMethodKind, RefundMethodStatus, RefundMethodOption, RefundMethodAnotherMethod, RefundMethodPaidWith, } from './RefundMethodCards';
|
|
131
|
+
export { RefundProgressList } from './RefundProgressList';
|
|
132
|
+
export type { RefundProgressListProps, RefundProgressListLabels, RefundProgressPart, RefundProgressStatus, RefundProgressAction, } from './RefundProgressList';
|
|
129
133
|
export { PinField } from './PinField';
|
|
130
134
|
export type { PinFieldProps, PinFieldLabels } from './PinField';
|
|
131
135
|
export { OutcomeView } from './OutcomeView';
|