@veevarts/design-system 1.16.0 → 1.17.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/README.md +12 -0
- package/dist/components/AppliedCodeCard/AppliedCodeCard.d.ts +13 -0
- package/dist/components/AppliedCodeCard/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/RedeemCodeInput/RedeemCodeInput.d.ts +21 -0
- package/dist/components/RedeemCodeInput/index.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +9015 -8178
- package/dist/patterns/CheckboxCardGroup/CheckboxCardGroup.d.ts +53 -0
- package/dist/patterns/CheckboxCardGroup/index.d.ts +2 -0
- package/dist/patterns/ConfirmDialog/ConfirmDialog.d.ts +22 -9
- package/dist/patterns/ConfirmDialog/index.d.ts +1 -1
- package/dist/patterns/DimensionChip/DimensionChip.d.ts +12 -0
- package/dist/patterns/DimensionChip/index.d.ts +2 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +1 -0
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/index.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/types.d.ts +14 -1
- package/dist/patterns/ListPanel/ListPanel.d.ts +45 -0
- package/dist/patterns/ListPanel/index.d.ts +2 -0
- package/dist/patterns/OfferCard/OfferCard.d.ts +1 -1
- package/dist/patterns/OfferCard/types.d.ts +23 -0
- package/dist/patterns/PageHeader/PageHeader.d.ts +33 -0
- package/dist/patterns/PageHeader/index.d.ts +2 -0
- package/dist/patterns/StatusChip/StatusChip.d.ts +28 -0
- package/dist/patterns/StatusChip/index.d.ts +2 -0
- package/dist/patterns/Summary/components/CollapseHeader.d.ts +6 -0
- package/dist/patterns/Summary/components/TotalsLineRow.d.ts +6 -2
- package/dist/patterns/Summary/index.d.ts +1 -1
- package/dist/patterns/Summary/types.d.ts +31 -6
- package/dist/patterns/grid-columns.d.ts +10 -0
- package/dist/patterns/index.d.ts +12 -2
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CheckboxCardOption {
|
|
3
|
+
/** Stable identifier surfaced through `onChange`. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Visible label. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional secondary line under the label. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Iconify name (`'solar:ticket-outline'`) or a custom node. */
|
|
10
|
+
icon?: string | React.ReactNode;
|
|
11
|
+
/** Disable just this card. */
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
/** Override per-card test id; defaults to `${dataTestId}-${key}`. */
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CheckboxCardGroupClassNames {
|
|
17
|
+
base?: string;
|
|
18
|
+
grid?: string;
|
|
19
|
+
card?: string;
|
|
20
|
+
hint?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CheckboxCardGroupProps {
|
|
23
|
+
/** Options to render in order. */
|
|
24
|
+
options: readonly CheckboxCardOption[];
|
|
25
|
+
/** Currently selected option keys. */
|
|
26
|
+
selectedKeys: readonly string[];
|
|
27
|
+
/** Fires with the next full selection whenever a card is toggled. Keys are emitted in the original option order (not selection order); any selected key not present in `options` is preserved. */
|
|
28
|
+
onChange: (keys: string[]) => void;
|
|
29
|
+
/** Optional heading rendered above the grid (labels the group). */
|
|
30
|
+
heading?: string;
|
|
31
|
+
/** `aria-label` for the group when `heading` is omitted. Default `'Select options'`. */
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/** Grid columns on >= sm. Default `2`. */
|
|
34
|
+
columnsDesktop?: 2 | 3 | 4;
|
|
35
|
+
/** Grid columns on mobile. Default `1`. */
|
|
36
|
+
columnsMobile?: 1 | 2;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum number of selections. When set, the group auto-derives its
|
|
39
|
+
* invalid state (`selectedKeys.length < minSelected`) and a default hint,
|
|
40
|
+
* unless `isInvalid` / `hint` are explicitly supplied.
|
|
41
|
+
*/
|
|
42
|
+
minSelected?: number;
|
|
43
|
+
/** Helper text under the grid. Overrides the `minSelected` default hint. */
|
|
44
|
+
hint?: React.ReactNode;
|
|
45
|
+
/** Error styling + `aria-invalid`. Overrides the `minSelected`-derived state. */
|
|
46
|
+
isInvalid?: boolean;
|
|
47
|
+
/** Disable every card. */
|
|
48
|
+
isDisabled?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
classNames?: CheckboxCardGroupClassNames;
|
|
51
|
+
'data-testid'?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const CheckboxCardGroup: React.FC<CheckboxCardGroupProps>;
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
export type ConfirmDialogVariant = 'danger' | 'warning';
|
|
2
3
|
export interface ConfirmDialogProps {
|
|
3
|
-
/** Whether the dialog is
|
|
4
|
+
/** Whether the dialog is open. Controlled by the host. */
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
/** Title rendered as the dialog heading. */
|
|
6
7
|
title: string;
|
|
7
|
-
/** Body copy explaining the consequences of confirming. */
|
|
8
|
-
body: string;
|
|
9
8
|
/** Label for the confirm action. */
|
|
10
9
|
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
10
|
/** Fires when the user confirms. */
|
|
16
11
|
onConfirm: () => void;
|
|
17
|
-
/**
|
|
18
|
-
|
|
12
|
+
/** HeroUI open-change; fires with `false` on cancel / Esc / outside click. */
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
/** Rich body content. Overrides `description`. */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Body copy explaining the consequences of confirming. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/** Label for the cancel action. Default `'Cancel'`. */
|
|
19
|
+
cancelLabel?: string;
|
|
20
|
+
/** Semantic variant driving the icon tile + confirm colour. Default `'danger'`. */
|
|
21
|
+
variant?: ConfirmDialogVariant;
|
|
22
|
+
/** Spinner on confirm + locks every dismissal channel while true. Default `false`. */
|
|
23
|
+
isPending?: boolean;
|
|
24
|
+
/** Override backdrop dismissability. Defaults to `!isPending`. */
|
|
25
|
+
isDismissable?: boolean;
|
|
26
|
+
/** Disable Esc-to-close. Forced on while `isPending`. Default `false`. */
|
|
27
|
+
isKeyboardDismissDisabled?: boolean;
|
|
28
|
+
/** Hide the header icon tile. */
|
|
29
|
+
hideIcon?: boolean;
|
|
30
|
+
/** Override the header icon (iconify name or node). Defaults to the variant icon. */
|
|
31
|
+
icon?: string | React.ReactNode;
|
|
19
32
|
'data-testid'?: string;
|
|
20
33
|
}
|
|
21
34
|
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
2
|
-
export type { ConfirmDialogProps } from './ConfirmDialog';
|
|
2
|
+
export type { ConfirmDialogProps, ConfirmDialogVariant } from './ConfirmDialog';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DimensionChipProps {
|
|
3
|
+
/** Muted leading text — the category/type (e.g. a dimension-type name). */
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
/** Emphasised trailing text — the selected value. */
|
|
6
|
+
value: React.ReactNode;
|
|
7
|
+
/** Chip size. `'sm'` (default) for dense tables, `'md'` for detail panels. */
|
|
8
|
+
size?: 'sm' | 'md';
|
|
9
|
+
className?: string;
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const DimensionChip: React.FC<DimensionChipProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentFundAssignmentProps } from './types';
|
|
3
|
-
export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, isFundPickerOpen, activeAssignmentId, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
@@ -57,6 +57,7 @@ export type InstallmentFundAssignmentProps = {
|
|
|
57
57
|
hasSavedAssignments?: boolean;
|
|
58
58
|
isFundPickerOpen?: boolean;
|
|
59
59
|
activeAssignmentId?: string | null;
|
|
60
|
+
modalPortalContainer?: Element;
|
|
60
61
|
footer?: ReactNode;
|
|
61
62
|
onModeChange?: (mode: InstallmentFundAssignmentMode) => void;
|
|
62
63
|
onAssignmentsChange: (assignments: InstallmentFundAssignmentEntry[]) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentTableProps } from './types';
|
|
3
|
-
export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
@@ -2,4 +2,4 @@ export { InstallmentSchedule } from './InstallmentSchedule';
|
|
|
2
2
|
export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
|
|
3
3
|
export { InstallmentTable } from './InstallmentTable';
|
|
4
4
|
export { generateAutomaticInstallments } from './utils';
|
|
5
|
-
export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, ScheduledInstallment, } from './types';
|
|
5
|
+
export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, InstallmentStatus, ScheduledInstallment, } from './types';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type InstallmentScheduleMode = 'automatic' | 'manual';
|
|
3
3
|
export type InstallmentFrequency = 'weekly' | 'monthly' | 'quarterly' | 'annual';
|
|
4
|
+
export type InstallmentStatus = 'schedule' | 'paid' | 'payment_due' | 'overdue' | 'failed' | 'refunded' | 'disputed' | 'canceled';
|
|
4
5
|
export type ScheduledInstallment = {
|
|
5
6
|
id: string;
|
|
6
7
|
dueDate: string;
|
|
7
8
|
amount: number;
|
|
8
|
-
status?:
|
|
9
|
+
status?: InstallmentStatus | (string & {});
|
|
9
10
|
};
|
|
10
11
|
export type AutomaticScheduleSettings = {
|
|
11
12
|
numberOfInstallments: number;
|
|
@@ -108,6 +109,18 @@ export type InstallmentTableProps = {
|
|
|
108
109
|
showTitle?: boolean;
|
|
109
110
|
showCard?: boolean;
|
|
110
111
|
showEditPayment?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* FR-1619 — when `false`, the delete action inside the row-actions
|
|
114
|
+
* dropdown is not rendered. Defaults to `true` (backward-compatible).
|
|
115
|
+
*/
|
|
116
|
+
showDelete?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* FR-1619 — statuses for which the Pay Now button is NOT rendered on a row.
|
|
119
|
+
* Typed with the `InstallmentStatus` union so consumers get compile-time
|
|
120
|
+
* safety on status keys. The pre-existing `paid` disabled guard still
|
|
121
|
+
* applies to any Pay Now button that IS rendered. Defaults to `[]`.
|
|
122
|
+
*/
|
|
123
|
+
payNowHiddenStatuses?: InstallmentStatus[];
|
|
111
124
|
labels?: InstallmentTableLabels;
|
|
112
125
|
isSaving?: boolean;
|
|
113
126
|
onEditInstallments: () => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ListPanelClassNames {
|
|
3
|
+
base?: string;
|
|
4
|
+
state?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ListPanelProps {
|
|
7
|
+
/** Show the loading state. Highest precedence (loading > error > empty > children). */
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
/** Show the error state. Wins over empty and children. */
|
|
10
|
+
isError?: boolean;
|
|
11
|
+
/** Show the empty state. Wins over children. */
|
|
12
|
+
isEmpty?: boolean;
|
|
13
|
+
/** Loading headline. Default `'Loading…'`. */
|
|
14
|
+
loadingTitle?: React.ReactNode;
|
|
15
|
+
/** Replace the whole loading state. */
|
|
16
|
+
loadingContent?: React.ReactNode;
|
|
17
|
+
/** Error headline. Default `'Something went wrong'`. */
|
|
18
|
+
errorTitle?: React.ReactNode;
|
|
19
|
+
/** Error supporting copy. */
|
|
20
|
+
errorDescription?: React.ReactNode;
|
|
21
|
+
/** Retry button label. Default `'Retry'`. Rendered only when `onRetry` is set. */
|
|
22
|
+
retryLabel?: React.ReactNode;
|
|
23
|
+
/** Retry handler; when set, a Retry button appears in the error state. */
|
|
24
|
+
onRetry?: () => void;
|
|
25
|
+
/** Replace the error state's action area (overrides the Retry button). */
|
|
26
|
+
errorActions?: React.ReactNode;
|
|
27
|
+
/** Replace the whole error state. */
|
|
28
|
+
errorContent?: React.ReactNode;
|
|
29
|
+
/** Empty headline. Default `'Nothing here yet'`. */
|
|
30
|
+
emptyTitle?: React.ReactNode;
|
|
31
|
+
/** Empty supporting copy. */
|
|
32
|
+
emptyDescription?: React.ReactNode;
|
|
33
|
+
/** Iconify name or node for the empty state. */
|
|
34
|
+
emptyIcon?: string | React.ReactNode | false;
|
|
35
|
+
/** Empty-state CTA area. */
|
|
36
|
+
emptyActions?: React.ReactNode;
|
|
37
|
+
/** Replace the whole empty state. */
|
|
38
|
+
emptyContent?: React.ReactNode;
|
|
39
|
+
/** The table/list rendered when none of the async states apply. */
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
className?: string;
|
|
42
|
+
classNames?: ListPanelClassNames;
|
|
43
|
+
'data-testid'?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const ListPanel: React.FC<ListPanelProps>;
|
|
@@ -6,7 +6,7 @@ import { OfferCardProps } from './types';
|
|
|
6
6
|
* Supports slot-based customization for all rendered elements.
|
|
7
7
|
*/
|
|
8
8
|
export declare const OfferCard: {
|
|
9
|
-
({ offer, quantity: quantityProp, defaultQuantity, onQuantityChange, currency, locale, labels: customLabels, slots, isDisabled, buttonVariant, buttonColor, showCard, showDescription, showPeopleCount, showPrice, classNames, "data-testid": dataTestId, selectedColor, compact, isSoldOut: isSoldOutProp, isMaxReached: isMaxReachedProp, isRuleBlocked: isRuleBlockedProp, statusTone: statusToneProp, statusLabel, disabledReason, disabled, }: OfferCardProps): JSX.Element;
|
|
9
|
+
({ offer, quantity: quantityProp, defaultQuantity, onQuantityChange, currency, locale, labels: customLabels, slots, isDisabled, buttonVariant, buttonColor, showCard, showDescription, showPeopleCount, showPrice, priceDisplay, classNames, "data-testid": dataTestId, selectedColor, compact, isSoldOut: isSoldOutProp, isMaxReached: isMaxReachedProp, isRuleBlocked: isRuleBlockedProp, statusTone: statusToneProp, statusLabel, disabledReason, disabled, }: OfferCardProps): JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export default OfferCard;
|
|
@@ -134,6 +134,14 @@ export interface OfferCardClassNames {
|
|
|
134
134
|
* Class for the price display
|
|
135
135
|
*/
|
|
136
136
|
price?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Class for the crossed-out original price when `priceDisplay` renders a discount.
|
|
139
|
+
*/
|
|
140
|
+
originalPrice?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Class for the current discounted price when `priceDisplay` renders a discount.
|
|
143
|
+
*/
|
|
144
|
+
discountedPrice?: string;
|
|
137
145
|
/**
|
|
138
146
|
* Class for the description text
|
|
139
147
|
*/
|
|
@@ -362,6 +370,21 @@ export interface OfferCardProps {
|
|
|
362
370
|
* @default true
|
|
363
371
|
*/
|
|
364
372
|
showPrice?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Optional explicit price display contract. Existing consumers keep the
|
|
375
|
+
* legacy `offer.price` rendering when this prop is omitted.
|
|
376
|
+
*/
|
|
377
|
+
priceDisplay?: {
|
|
378
|
+
/**
|
|
379
|
+
* Current/effective price to display.
|
|
380
|
+
*/
|
|
381
|
+
price: number;
|
|
382
|
+
/**
|
|
383
|
+
* Optional compare-at/original price. A discounted display is rendered
|
|
384
|
+
* only when this value is greater than `price`.
|
|
385
|
+
*/
|
|
386
|
+
originalPrice?: number | null;
|
|
387
|
+
};
|
|
365
388
|
/**
|
|
366
389
|
* Class names for styling different parts of the component
|
|
367
390
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PageHeaderClassNames {
|
|
3
|
+
base?: string;
|
|
4
|
+
iconWrapper?: string;
|
|
5
|
+
eyebrow?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
actions?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PageHeaderProps {
|
|
11
|
+
/** Main heading. */
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
/** Supporting copy under the title. */
|
|
14
|
+
subtitle?: React.ReactNode;
|
|
15
|
+
/** Small uppercase label above the title (e.g. a section or category name). */
|
|
16
|
+
eyebrow?: React.ReactNode;
|
|
17
|
+
/** Iconify name (`'solar:tag-outline'`) or a custom node for the tile. */
|
|
18
|
+
icon?: string | React.ReactNode;
|
|
19
|
+
/** Short text rendered in the tile when no `icon` is given (e.g. "DT"). */
|
|
20
|
+
initials?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Right-aligned action area. Compose the primary CTA here, with an
|
|
23
|
+
* optional secondary button alongside it (caller-composed). Style the
|
|
24
|
+
* tile via `classNames.iconWrapper`.
|
|
25
|
+
*/
|
|
26
|
+
actions?: React.ReactNode;
|
|
27
|
+
/** Heading level for the title element. Default `'h1'`. */
|
|
28
|
+
titleAs?: 'h1' | 'h2' | 'h3';
|
|
29
|
+
className?: string;
|
|
30
|
+
classNames?: PageHeaderClassNames;
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const PageHeader: React.FC<PageHeaderProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChipProps } from '../../components';
|
|
3
|
+
/** Domain-agnostic lifecycle states an admin row can be in. */
|
|
4
|
+
export type StatusChipStatus = 'active' | 'archived' | 'inactive' | 'draft' | 'pending' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
5
|
+
export interface StatusChipProps {
|
|
6
|
+
/** Lifecycle state — selects the colour/tone only, never the text. */
|
|
7
|
+
status: StatusChipStatus;
|
|
8
|
+
/** Visible label. Caller-supplied so no domain copy lives here. */
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Visual style. HeroUI chip variants (default `'flat'`), plus the DS
|
|
12
|
+
* `'dot'` variant: a soft, radius-full pill with a leading tone dot,
|
|
13
|
+
* 12px / weight-600 text, tuned for dense admin lifecycle tables.
|
|
14
|
+
*/
|
|
15
|
+
variant?: ChipProps['variant'] | 'dot';
|
|
16
|
+
/** Chip size. Default `'sm'`. Ignored by `variant="dot"`. */
|
|
17
|
+
size?: ChipProps['size'];
|
|
18
|
+
/**
|
|
19
|
+
* Override the colour derived from `status`. Escape hatch for the
|
|
20
|
+
* rare state not covered by `StatusChipStatus`. Ignored by `variant="dot"`.
|
|
21
|
+
*/
|
|
22
|
+
color?: ChipProps['color'];
|
|
23
|
+
/** Optional leading element (dot, icon). Ignored by `variant="dot"`. */
|
|
24
|
+
startContent?: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const StatusChip: React.FC<StatusChipProps>;
|
|
@@ -6,6 +6,12 @@ export interface CollapseHeaderProps {
|
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
amount: Money;
|
|
8
8
|
};
|
|
9
|
+
/** Optional primary-colored row mirrored under the Total in the compact bar
|
|
10
|
+
* (e.g. "Due Today"); cross-fades like the Total. */
|
|
11
|
+
secondaryTotal?: {
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
amount: Money;
|
|
14
|
+
};
|
|
9
15
|
locale: string;
|
|
10
16
|
open: boolean;
|
|
11
17
|
/** Open progress 0→1; drives the cross-fade opacity. */
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SummaryPostTotalRow } from '../types';
|
|
3
3
|
export interface TotalsLineRowProps {
|
|
4
|
-
row:
|
|
4
|
+
row: SummaryPostTotalRow;
|
|
5
5
|
locale: string;
|
|
6
6
|
emphasized: boolean;
|
|
7
|
+
onRemove?: (id: string) => void;
|
|
8
|
+
removeAriaLabel?: string;
|
|
9
|
+
/** Show the per-row remove control. Defaults to `true`. */
|
|
10
|
+
showRemoveButton?: boolean;
|
|
7
11
|
}
|
|
8
12
|
export declare const TotalsLineRow: React.FC<TotalsLineRowProps>;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Total + CTA, and a compact mobile bottom-bar.
|
|
5
5
|
*/
|
|
6
6
|
export { Summary } from './Summary';
|
|
7
|
-
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
7
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
@@ -73,6 +73,16 @@ export interface SummaryTotalRow {
|
|
|
73
73
|
label: ReactNode;
|
|
74
74
|
amount: Money;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* A post-total row — the same flat shape as {@link SummaryTotalRow}, plus an
|
|
78
|
+
* optional `id` that (together with `onRemovePostTotalRow`) enables the same
|
|
79
|
+
* trash remove control the line items use. Kept as its own interface so the
|
|
80
|
+
* pre-total `rows` — where an id/remove has no meaning — stay untouched.
|
|
81
|
+
*/
|
|
82
|
+
export interface SummaryPostTotalRow extends SummaryTotalRow {
|
|
83
|
+
/** Stable id; when set and `onRemovePostTotalRow` exists, the row shows the remove control. */
|
|
84
|
+
id?: string;
|
|
85
|
+
}
|
|
76
86
|
/** The primary call-to-action (orange pill + arrow). */
|
|
77
87
|
export interface SummaryPrimaryAction {
|
|
78
88
|
label: ReactNode;
|
|
@@ -84,6 +94,8 @@ export interface SummaryPrimaryAction {
|
|
|
84
94
|
export interface SummaryLabels {
|
|
85
95
|
/** Aria label for the per-item remove control. Default "Remove item". */
|
|
86
96
|
removeAriaLabel?: string;
|
|
97
|
+
/** Aria label for the per-post-total-row remove control. Default "Remove applied code". */
|
|
98
|
+
removePostTotalRowAriaLabel?: string;
|
|
87
99
|
/** Aria label for the collapse/expand press target. Default "Toggle summary". */
|
|
88
100
|
toggleAriaLabel?: string;
|
|
89
101
|
/** Aria label for the mobile cart button. Default "View cart". */
|
|
@@ -146,9 +158,19 @@ export interface SummaryProps {
|
|
|
146
158
|
amount: Money;
|
|
147
159
|
};
|
|
148
160
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
161
|
+
* Optional flat rows rendered BETWEEN the Total and the secondary total —
|
|
162
|
+
* e.g. applied gift cards as tenders ("Gift Card · …XWDG −$50.00"). Same
|
|
163
|
+
* shape and flat style as `rows`; negative amounts are passed as data,
|
|
164
|
+
* exactly like a Discounts line. The Total itself is never affected. Rows
|
|
165
|
+
* with an `id` show the trash remove control when `onRemovePostTotalRow`
|
|
166
|
+
* is provided (same gating as the item remove, incl. `showRemoveButton`).
|
|
167
|
+
*/
|
|
168
|
+
postTotalRows?: SummaryPostTotalRow[];
|
|
169
|
+
/**
|
|
170
|
+
* An optional secondary total rendered under the Total (after any
|
|
171
|
+
* `postTotalRows`), in the primary color (e.g. "Due Today"). Purely
|
|
172
|
+
* presentational — the host supplies both the label and the
|
|
173
|
+
* already-computed amount.
|
|
152
174
|
*/
|
|
153
175
|
secondaryTotal?: {
|
|
154
176
|
label: ReactNode;
|
|
@@ -160,9 +182,10 @@ export interface SummaryProps {
|
|
|
160
182
|
*/
|
|
161
183
|
ctaCaption?: ReactNode;
|
|
162
184
|
/**
|
|
163
|
-
* Whether the
|
|
164
|
-
*
|
|
165
|
-
* `onRemoveItem`
|
|
185
|
+
* Whether the remove (trash) controls are shown — per-item and
|
|
186
|
+
* per-post-total-row alike. Defaults to `true`; pass `false` to hide them
|
|
187
|
+
* even when `onRemoveItem` / `onRemovePostTotalRow` are wired. Independent
|
|
188
|
+
* of the handlers so a host can keep them but suppress the controls.
|
|
166
189
|
*/
|
|
167
190
|
showRemoveButton?: boolean;
|
|
168
191
|
/**
|
|
@@ -190,6 +213,8 @@ export interface SummaryProps {
|
|
|
190
213
|
primaryAction?: SummaryPrimaryAction;
|
|
191
214
|
/** When provided, item rows show a red trash remove control. */
|
|
192
215
|
onRemoveItem?: (id: string) => void;
|
|
216
|
+
/** When provided, post-total rows with an `id` show the same red trash remove control. */
|
|
217
|
+
onRemovePostTotalRow?: (id: string) => void;
|
|
193
218
|
/**
|
|
194
219
|
* Layout: full card (`'main'`) or the bottom-sheet / compact bar (`'mobile'`).
|
|
195
220
|
* When OMITTED the layout is auto-detected from the viewport (below `md`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared responsive grid-column class maps for the card-picker patterns
|
|
3
|
+
* (TileSelect single-select, CheckboxCardGroup multi-select). Kept in one
|
|
4
|
+
* place so the two siblings never drift on breakpoints or column counts.
|
|
5
|
+
*
|
|
6
|
+
* The literal Tailwind classes must stay spelled out (not interpolated) so
|
|
7
|
+
* the JIT scanner keeps generating them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const GRID_DESKTOP_COLS: Record<2 | 3 | 4, string>;
|
|
10
|
+
export declare const GRID_MOBILE_COLS: Record<1 | 2, string>;
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -41,6 +41,16 @@ export { FilterPopover } from './FilterPopover';
|
|
|
41
41
|
export type * from './FilterPopover';
|
|
42
42
|
export { SessionTimeline } from './SessionTimeline';
|
|
43
43
|
export type * from './SessionTimeline';
|
|
44
|
+
export { PageHeader } from './PageHeader';
|
|
45
|
+
export type { PageHeaderProps, PageHeaderClassNames } from './PageHeader';
|
|
46
|
+
export { StatusChip } from './StatusChip';
|
|
47
|
+
export type { StatusChipProps, StatusChipStatus } from './StatusChip';
|
|
48
|
+
export { DimensionChip } from './DimensionChip';
|
|
49
|
+
export type { DimensionChipProps } from './DimensionChip';
|
|
50
|
+
export { CheckboxCardGroup } from './CheckboxCardGroup';
|
|
51
|
+
export type { CheckboxCardGroupProps, CheckboxCardOption } from './CheckboxCardGroup';
|
|
52
|
+
export { ListPanel } from './ListPanel';
|
|
53
|
+
export type { ListPanelProps, ListPanelClassNames } from './ListPanel';
|
|
44
54
|
export { CashTenderForm } from './CashTenderForm';
|
|
45
55
|
export type { CashTenderFormProps, CashTenderValue, CashTenderLabels, } from './CashTenderForm';
|
|
46
56
|
export { CheckTenderForm } from './CheckTenderForm';
|
|
@@ -64,6 +74,6 @@ export type { PaymentCashChangeBannerProps } from './PaymentCashChangeBanner';
|
|
|
64
74
|
export { PaymentSubAmountInput } from './PaymentSubAmountInput';
|
|
65
75
|
export type { PaymentSubAmountInputProps } from './PaymentSubAmountInput';
|
|
66
76
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
67
|
-
export type { ConfirmDialogProps } from './ConfirmDialog';
|
|
77
|
+
export type { ConfirmDialogProps, ConfirmDialogVariant } from './ConfirmDialog';
|
|
68
78
|
export { Summary } from './Summary';
|
|
69
|
-
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|
|
79
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|