@veevarts/design-system 2.0.0 → 2.1.0-beta.10
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 +8 -8
- package/dist/index.js +7040 -5277
- package/dist/patterns/ActivityTimeline/ActivityTimeline.d.ts +3 -0
- package/dist/patterns/ActivityTimeline/index.d.ts +2 -0
- package/dist/patterns/ActivityTimeline/styles.d.ts +15 -0
- package/dist/patterns/ActivityTimeline/types.d.ts +15 -0
- package/dist/patterns/AdminTable/AdminTable.d.ts +1 -0
- package/dist/patterns/AdminTable/styles.d.ts +6 -0
- package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +1 -0
- package/dist/patterns/AmountList/AmountList.d.ts +3 -0
- package/dist/patterns/AmountList/index.d.ts +2 -0
- package/dist/patterns/AmountList/styles.d.ts +23 -0
- package/dist/patterns/AmountList/types.d.ts +26 -0
- package/dist/patterns/CardList/CardList.d.ts +3 -0
- package/dist/patterns/CardList/index.d.ts +2 -0
- package/dist/patterns/CardList/styles.d.ts +16 -0
- package/dist/patterns/CardList/types.d.ts +19 -0
- package/dist/patterns/CardStack/CardStack.d.ts +7 -0
- package/dist/patterns/CardStack/index.d.ts +2 -0
- package/dist/patterns/CardStack/styles.d.ts +2 -0
- package/dist/patterns/CellText/CellText.d.ts +16 -0
- package/dist/patterns/CellText/index.d.ts +2 -0
- package/dist/patterns/CellText/styles.d.ts +7 -0
- package/dist/patterns/FilterSelect/FilterSelect.d.ts +3 -0
- package/dist/patterns/FilterSelect/index.d.ts +2 -0
- package/dist/patterns/FilterSelect/styles.d.ts +14 -0
- package/dist/patterns/FilterSelect/types.d.ts +13 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +3 -0
- package/dist/patterns/InstallmentSchedule/InstallmentSchedule.d.ts +1 -1
- 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 +62 -3
- package/dist/patterns/InstallmentSchedule/utils.d.ts +33 -0
- package/dist/patterns/KeyValueChip/KeyValueChip.d.ts +1 -0
- package/dist/patterns/KeyValueRows/KeyValueRows.d.ts +13 -0
- package/dist/patterns/KeyValueRows/index.d.ts +2 -0
- package/dist/patterns/KeyValueRows/styles.d.ts +8 -0
- package/dist/patterns/LineItemRows/LineItemRows.d.ts +17 -0
- package/dist/patterns/LineItemRows/index.d.ts +2 -0
- package/dist/patterns/LineItemRows/styles.d.ts +13 -0
- package/dist/patterns/ListPanel/ListPanel.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/LoadMoreFooter.d.ts +3 -0
- package/dist/patterns/LoadMoreFooter/index.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/styles.d.ts +7 -0
- package/dist/patterns/LoadMoreFooter/types.d.ts +10 -0
- package/dist/patterns/PageHeader/PageHeader.d.ts +1 -0
- package/dist/patterns/PaymentSubAmountInput/PaymentSubAmountInput.d.ts +2 -0
- package/dist/patterns/PillTabs/PillTabs.d.ts +3 -0
- package/dist/patterns/PillTabs/ids.d.ts +9 -0
- package/dist/patterns/PillTabs/index.d.ts +3 -0
- package/dist/patterns/PillTabs/styles.d.ts +10 -0
- package/dist/patterns/PillTabs/types.d.ts +13 -0
- package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/type.d.ts +1 -1
- package/dist/patterns/{EventDetails → Programs/EventDetails}/EventDetails.d.ts +3 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/OfferCard.d.ts +1 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/types.d.ts +7 -0
- package/dist/patterns/Programs/ProgramListItem/ProgramListItem.d.ts +17 -0
- package/dist/patterns/Programs/ProgramListItem/index.d.ts +2 -0
- package/dist/patterns/Programs/index.d.ts +5 -0
- package/dist/patterns/RecordCard/RecordCard.d.ts +3 -0
- package/dist/patterns/RecordCard/index.d.ts +2 -0
- package/dist/patterns/RecordCard/styles.d.ts +15 -0
- package/dist/patterns/RecordCard/types.d.ts +17 -0
- package/dist/patterns/RecordHeader/RecordHeader.d.ts +3 -0
- package/dist/patterns/RecordHeader/index.d.ts +2 -0
- package/dist/patterns/RecordHeader/styles.d.ts +43 -0
- package/dist/patterns/RecordHeader/types.d.ts +30 -0
- package/dist/patterns/RecordLayout/RecordLayout.d.ts +3 -0
- package/dist/patterns/RecordLayout/index.d.ts +2 -0
- package/dist/patterns/RecordLayout/styles.d.ts +8 -0
- package/dist/patterns/RecordLayout/types.d.ts +6 -0
- package/dist/patterns/RecordTotals/RecordTotals.d.ts +19 -0
- package/dist/patterns/RecordTotals/index.d.ts +2 -0
- package/dist/patterns/RecordTotals/styles.d.ts +19 -0
- package/dist/patterns/RelatedRecordList/RelatedRecordList.d.ts +3 -0
- package/dist/patterns/RelatedRecordList/index.d.ts +2 -0
- package/dist/patterns/RelatedRecordList/styles.d.ts +19 -0
- package/dist/patterns/RelatedRecordList/types.d.ts +17 -0
- package/dist/patterns/SplitPaymentSummary/index.d.ts +1 -1
- package/dist/patterns/SplitPaymentSummary/types.d.ts +18 -0
- package/dist/patterns/StatTiles/StatTiles.d.ts +3 -0
- package/dist/patterns/StatTiles/index.d.ts +2 -0
- package/dist/patterns/StatTiles/styles.d.ts +8 -0
- package/dist/patterns/StatTiles/types.d.ts +12 -0
- package/dist/patterns/StatusChip/StatusChip.d.ts +3 -3
- package/dist/patterns/Summary/components/ActionBar.d.ts +2 -0
- package/dist/patterns/Summary/components/GrandTotalRow.d.ts +1 -0
- package/dist/patterns/Summary/components/ItemRow.d.ts +1 -0
- package/dist/patterns/Summary/components/SummaryBody.d.ts +4 -1
- package/dist/patterns/Summary/components/TotalsLineRow.d.ts +3 -2
- package/dist/patterns/Summary/types.d.ts +40 -9
- package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +1 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +65 -1
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/ToolbarButton/ToolbarButton.d.ts +2 -0
- package/dist/patterns/index.d.ts +45 -11
- package/dist/patterns/shared/hasContent.d.ts +2 -0
- package/dist/patterns/shared/index.d.ts +1 -0
- package/dist/patterns/shared/motion.d.ts +6 -0
- package/dist/patterns/shared/recordTone.d.ts +9 -0
- package/dist/patterns/shared/rem.d.ts +4 -0
- package/dist/patterns/shared/useContainerWidth.d.ts +6 -0
- package/dist/patterns/shared/useDecimalDraft.d.ts +33 -0
- package/dist/tailwind/index.cjs +17 -1
- package/dist/tailwind/index.d.ts +39 -0
- package/dist/tailwind/index.mjs +17 -1
- package/dist/test/ReducedMotion.d.ts +4 -0
- package/dist/test/RootFontSize.d.ts +5 -0
- package/dist/test/container-width.d.ts +14 -0
- package/dist/test/contrast.d.ts +1 -0
- package/dist/test/px-classes.d.ts +2 -0
- package/dist/test/root-font-size.d.ts +8 -0
- package/dist/tokens/pos-surface.d.ts +7 -0
- package/package.json +1 -1
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/CatalogItemCard.d.ts +0 -0
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/index.d.ts +0 -0
- /package/dist/patterns/{EventDetails → Programs/EventDetails}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/CustomQuantitySelectorExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithEurosCurrencyExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithoutAnimationExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/animations.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/currency.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/offers.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardEmpty.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardError.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardList.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardSkeleton.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/SessionTimeline.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/type.d.ts +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const activityTimelineClass: {
|
|
2
|
+
readonly list: "m-0 list-none p-0 pl-0.5";
|
|
3
|
+
readonly event: "flex gap-3.5";
|
|
4
|
+
readonly eventSpaced: "pb-4";
|
|
5
|
+
readonly rail: "flex flex-none flex-col items-center";
|
|
6
|
+
readonly dot: "mt-[0.3125rem] size-2.5 rounded-full";
|
|
7
|
+
readonly connector: "mt-1 w-[1.5px] flex-1 bg-pos-hair";
|
|
8
|
+
readonly body: "min-w-0 flex-1 pb-0.5";
|
|
9
|
+
readonly head: "flex min-w-0 flex-wrap items-baseline gap-x-3";
|
|
10
|
+
readonly title: "min-w-0 text-[0.90625rem] font-semibold text-default-900 [overflow-wrap:anywhere]";
|
|
11
|
+
readonly timestamp: "ml-auto min-w-0 max-w-full text-[0.8125rem] tabular-nums text-default-500 [overflow-wrap:anywhere]";
|
|
12
|
+
readonly detail: "mt-[0.1875rem] min-w-0 text-[0.84375rem] leading-[1.5] text-default-500 [overflow-wrap:anywhere]";
|
|
13
|
+
readonly actor: "mt-[0.1875rem] min-w-0 text-[0.78125rem] text-default-500 [overflow-wrap:anywhere]";
|
|
14
|
+
readonly empty: "text-[0.875rem] text-default-500";
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RecordTone } from '../shared/recordTone';
|
|
3
|
+
export interface ActivityTimelineEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
tone: RecordTone;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
timestamp: ReactNode;
|
|
8
|
+
detail?: ReactNode;
|
|
9
|
+
actor?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface ActivityTimelineProps {
|
|
12
|
+
events: ActivityTimelineEvent[];
|
|
13
|
+
emptyContent?: ReactNode;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
@@ -35,6 +35,7 @@ export interface AdminTableProps {
|
|
|
35
35
|
footer?: React.ReactNode;
|
|
36
36
|
/** Accessible name. Required: a table with no name is unnavigable by screen reader. */
|
|
37
37
|
ariaLabel: string;
|
|
38
|
+
variant?: 'default' | 'framed';
|
|
38
39
|
className?: string;
|
|
39
40
|
classNames?: AdminTableClassNames;
|
|
40
41
|
'data-testid'?: string;
|
|
@@ -42,3 +42,9 @@ export declare const adminRowClass = "border-t border-acct-hair transition-color
|
|
|
42
42
|
export declare const adminTableClass = "w-full";
|
|
43
43
|
/** The strip under the table where a pager sits. */
|
|
44
44
|
export declare const adminTableFooterClass = "border-t border-acct-border px-5 py-3.5";
|
|
45
|
+
export declare const adminTableFramedClass: {
|
|
46
|
+
readonly base: "overflow-x-auto";
|
|
47
|
+
readonly th: "h-auto whitespace-nowrap border-b border-pos-hair bg-transparent px-4 py-[0.875rem] text-left text-[0.6875rem] font-semibold uppercase leading-[1.5] tracking-[.055em] text-default-500 first:rounded-none last:rounded-none last:pr-3";
|
|
48
|
+
readonly tr: "border-t border-pos-hair transition-colors duration-[120ms] first:border-t-0 data-[focus-visible=true]:outline-offset-[-2px] [tbody>&]:hover:bg-default-50 [tbody>&]:data-[hover=true]:bg-default-50 motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
49
|
+
readonly td: "h-[3.875rem] px-4 data-[focus-visible=true]:outline-offset-[-2px] py-[0.625rem] align-middle text-[0.875rem] text-default-900 last:pr-3";
|
|
50
|
+
};
|
|
@@ -14,6 +14,7 @@ export interface AdminToolbarProps {
|
|
|
14
14
|
trailing?: React.ReactNode;
|
|
15
15
|
/** Search box width. `'md'` (280px) by default, `'lg'` (360px) for wide tables. */
|
|
16
16
|
searchWidth?: 'md' | 'lg';
|
|
17
|
+
variant?: 'default' | 'framed';
|
|
17
18
|
className?: string;
|
|
18
19
|
'data-testid'?: string;
|
|
19
20
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const amountListClass: {
|
|
2
|
+
readonly base: "w-full";
|
|
3
|
+
readonly list: "m-0 list-none p-0";
|
|
4
|
+
readonly item: "border-t border-pos-hair";
|
|
5
|
+
readonly row: "flex w-full items-start gap-3 px-5 py-3 text-left";
|
|
6
|
+
readonly rowInteractive: "cursor-pointer outline-none transition-colors hover:bg-default-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
7
|
+
readonly dot: "mt-[0.4375rem] size-[0.4375rem] shrink-0 rounded-full";
|
|
8
|
+
readonly body: "flex min-w-0 flex-1 flex-col";
|
|
9
|
+
readonly title: "text-[0.875rem] font-semibold text-default-900 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
10
|
+
readonly meta: "mt-1 flex min-w-0 flex-wrap items-center gap-[0.4375rem] text-[0.78125rem] text-default-500";
|
|
11
|
+
readonly reference: "min-w-0 font-normal text-primary [overflow-wrap:anywhere]";
|
|
12
|
+
readonly separator: "text-default-400";
|
|
13
|
+
readonly timestamp: "tabular-nums";
|
|
14
|
+
readonly detail: "mt-[0.1875rem] text-[0.78125rem] text-default-500 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
15
|
+
readonly trailing: "max-w-[45%] min-w-min shrink-0 text-right text-[0.90625rem]";
|
|
16
|
+
readonly amount: "whitespace-nowrap text-[0.90625rem] font-bold tabular-nums text-default-900";
|
|
17
|
+
readonly note: "text-[0.78125rem] italic text-default-500 [overflow-wrap:anywhere]";
|
|
18
|
+
readonly footer: "flex items-baseline gap-3 border-t border-pos-line bg-pos-page px-5 py-[0.8125rem]";
|
|
19
|
+
readonly footerLabel: "min-w-0 text-[0.875rem] font-bold text-default-900 [overflow-wrap:anywhere]";
|
|
20
|
+
readonly footerAmount: "ml-auto whitespace-nowrap text-[1rem] font-bold tabular-nums text-default-900";
|
|
21
|
+
readonly footerNote: "border-t border-pos-hair px-5 py-[0.8125rem] text-[0.78125rem] leading-[1.6] text-default-500";
|
|
22
|
+
readonly empty: "px-5 pb-5 pt-[0.875rem] text-[0.875rem] text-default-500";
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RecordTone } from '../shared/recordTone';
|
|
3
|
+
export interface AmountListRow {
|
|
4
|
+
id: string;
|
|
5
|
+
tone: RecordTone;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
reference?: ReactNode;
|
|
8
|
+
timestamp?: ReactNode;
|
|
9
|
+
detail?: ReactNode;
|
|
10
|
+
amount?: ReactNode;
|
|
11
|
+
amountTone?: 'positive' | 'negative' | 'neutral';
|
|
12
|
+
note?: ReactNode;
|
|
13
|
+
noteTone?: 'muted' | 'warn';
|
|
14
|
+
}
|
|
15
|
+
export interface AmountListProps {
|
|
16
|
+
rows: AmountListRow[];
|
|
17
|
+
footer?: {
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
amount: ReactNode;
|
|
20
|
+
amountTone?: 'positive' | 'negative' | 'neutral';
|
|
21
|
+
note?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
emptyContent?: ReactNode;
|
|
24
|
+
onSelect?: (id: string) => void;
|
|
25
|
+
'data-testid'?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const cardListClass: {
|
|
2
|
+
readonly base: "w-full";
|
|
3
|
+
readonly list: "m-0 list-none p-0";
|
|
4
|
+
readonly item: "border-b border-pos-hair last:border-b-0";
|
|
5
|
+
readonly card: "block w-full px-4 py-[0.875rem] text-left";
|
|
6
|
+
readonly cardInteractive: "cursor-pointer outline-none transition-colors hover:bg-default-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
7
|
+
readonly headline: "flex items-baseline gap-2.5";
|
|
8
|
+
readonly title: "min-w-0 text-[0.90625rem] font-semibold text-primary [overflow-wrap:anywhere]";
|
|
9
|
+
readonly amount: "ml-auto shrink-0 whitespace-nowrap text-[0.9375rem] font-bold tabular-nums text-default-900";
|
|
10
|
+
readonly chips: "mt-[0.5625rem] flex flex-wrap gap-1.5";
|
|
11
|
+
readonly rows: "mt-[0.5625rem] block";
|
|
12
|
+
readonly row: "flex items-baseline gap-3 py-[0.1875rem] text-[0.8125rem]";
|
|
13
|
+
readonly rowLabel: "shrink-0 text-default-500";
|
|
14
|
+
readonly rowValue: "ml-auto min-w-0 text-right text-default-700 [overflow-wrap:anywhere]";
|
|
15
|
+
readonly skeletonRow: "border-b border-pos-hair p-4 last:border-b-0";
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CardListItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
amount?: ReactNode;
|
|
6
|
+
chips?: ReactNode;
|
|
7
|
+
rows?: Array<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export interface CardListProps {
|
|
13
|
+
items: CardListItem[];
|
|
14
|
+
ariaLabel: string;
|
|
15
|
+
onSelect?: (id: string) => void;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
skeletonCount?: number;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type CardStackLayout = 'stack' | 'grid';
|
|
3
|
+
export interface CardStackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
layout?: CardStackLayout;
|
|
5
|
+
'data-testid'?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CardStack: React.FC<CardStackProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SignedAmountTone } from '../shared/recordTone';
|
|
3
|
+
export type CellTextVariant = 'text' | 'reference' | 'amount';
|
|
4
|
+
export interface CellTextProps {
|
|
5
|
+
variant?: CellTextVariant;
|
|
6
|
+
tone?: SignedAmountTone;
|
|
7
|
+
secondary?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const CellText: React.FC<CellTextProps>;
|
|
12
|
+
export interface ChipStackProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const ChipStack: React.FC<ChipStackProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CellTextVariant } from './CellText';
|
|
2
|
+
export declare const cellTextClass: {
|
|
3
|
+
readonly base: "whitespace-nowrap text-[0.875rem]";
|
|
4
|
+
readonly secondary: "text-default-500";
|
|
5
|
+
readonly chipStack: "inline-flex flex-col items-start gap-[0.3125rem]";
|
|
6
|
+
};
|
|
7
|
+
export declare const cellTextVariantClass: Record<CellTextVariant, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const filterSelectClass: {
|
|
2
|
+
readonly base: "relative inline-grid min-w-[10.75rem] grid-cols-[minmax(0,1fr)]";
|
|
3
|
+
readonly baseActive: "max-w-[20rem]";
|
|
4
|
+
readonly cell: "[grid-area:1/1]";
|
|
5
|
+
readonly sizer: "invisible h-0 overflow-hidden whitespace-nowrap border-x-2 border-transparent pl-2 pr-[4.8125rem] text-[0.875rem] font-semibold";
|
|
6
|
+
readonly select: "w-full";
|
|
7
|
+
readonly trigger: "h-[2.375rem] min-h-[2.375rem] rounded-[0.625rem] border-medium border-pos-field bg-white px-2 shadow-none data-[hover=true]:border-default-300 data-[focus=true]:border-primary data-[open=true]:border-primary data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-primary data-[focus-visible=true]:ring-offset-1";
|
|
8
|
+
readonly triggerActive: "!border-acct-rust-border !bg-acct-rust-fill pr-[3.25rem]";
|
|
9
|
+
readonly value: "text-[0.875rem] !text-default-900";
|
|
10
|
+
readonly valueActive: "font-semibold !text-primary-600";
|
|
11
|
+
readonly iconActive: "!text-primary-600";
|
|
12
|
+
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";
|
|
13
|
+
readonly clearIcon: "size-[0.8125rem]";
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FilterSelectOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FilterSelectProps {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | null;
|
|
8
|
+
options: FilterSelectOption[];
|
|
9
|
+
onChange: (value: string | null) => void;
|
|
10
|
+
clearLabel: string;
|
|
11
|
+
minWidth?: number;
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
}
|
|
@@ -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, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, showSavedIndicator, isCollapsed, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
@@ -14,6 +14,7 @@ export type InstallmentFundAssignmentEntry = {
|
|
|
14
14
|
};
|
|
15
15
|
export type InstallmentFundAssignmentLabels = {
|
|
16
16
|
title?: string;
|
|
17
|
+
saved?: string;
|
|
17
18
|
singleFund?: string;
|
|
18
19
|
splitFunds?: string;
|
|
19
20
|
saveAssignment?: string;
|
|
@@ -55,6 +56,8 @@ export type InstallmentFundAssignmentProps = {
|
|
|
55
56
|
classNames?: InstallmentFundAssignmentClassNames;
|
|
56
57
|
isSaving?: boolean;
|
|
57
58
|
hasSavedAssignments?: boolean;
|
|
59
|
+
showSavedIndicator?: boolean;
|
|
60
|
+
isCollapsed?: boolean;
|
|
58
61
|
isFundPickerOpen?: boolean;
|
|
59
62
|
activeAssignmentId?: string | null;
|
|
60
63
|
modalPortalContainer?: Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentScheduleProps } from './types';
|
|
3
|
-
export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, labels: customLabels, classNames, isSaving, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, }: InstallmentScheduleProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, firstInstallmentDateOverride, labels: customLabels, classNames, isSaving, showSavedIndicator, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, onCancel, }: InstallmentScheduleProps): JSX.Element;
|
|
@@ -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, showDelete, payNowHiddenStatuses, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, showSavedIndicator, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { InstallmentSchedule } from './InstallmentSchedule';
|
|
2
2
|
export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
|
|
3
3
|
export { InstallmentTable } from './InstallmentTable';
|
|
4
|
-
export { generateAutomaticInstallments } from './utils';
|
|
4
|
+
export { applyFirstInstallmentDateOverride, generateAutomaticInstallments } from './utils';
|
|
5
5
|
export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, InstallmentStatus, ScheduledInstallment, } from './types';
|
|
@@ -1,12 +1,34 @@
|
|
|
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 = 'scheduled' | 'paid' | 'payment_due' | 'overdue' | 'failed' | 'refunded' | 'disputed' | 'canceled' | 'processing' | 'pending_confirmation';
|
|
4
|
+
export type InstallmentStatus = 'scheduled' | 'paid' | 'payment_due' | 'overdue' | 'failed' | 'refunded' | 'partially_refunded' | 'disputed' | 'canceled' | 'processing' | 'pending_confirmation';
|
|
5
5
|
export type ScheduledInstallment = {
|
|
6
6
|
id: string;
|
|
7
|
+
name?: string | null;
|
|
7
8
|
dueDate: string;
|
|
8
9
|
amount: number;
|
|
9
10
|
status?: InstallmentStatus | (string & {});
|
|
11
|
+
/**
|
|
12
|
+
* When the installment was actually paid: a calendar date (`YYYY-MM-DD`)
|
|
13
|
+
* or an ISO timestamp (shown in the viewer's timezone). Named after the
|
|
14
|
+
* field the commitments API already returns for this, so installments
|
|
15
|
+
* passed straight through from the API carry it without any mapping.
|
|
16
|
+
* `InstallmentTable` shows it on rows whose payment happened (`paid`,
|
|
17
|
+
* `partially_refunded`, `refunded`) and on no other status; omit it to
|
|
18
|
+
* show none.
|
|
19
|
+
*/
|
|
20
|
+
fulfilledAt?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* FR-1422 — how much of the installment was refunded, in the same units as
|
|
23
|
+
* `amount` (a major-unit number: `50` is $50.00). `InstallmentTable`
|
|
24
|
+
* formats it with its own `currency` and `locale` and shows it as
|
|
25
|
+
* "Refunded $50.00" under the amount of a `partially_refunded` row.
|
|
26
|
+
*
|
|
27
|
+
* Ignored on every other status: a `refunded` row gave the whole amount
|
|
28
|
+
* back, so its amount and badge already say it. Also ignored when missing,
|
|
29
|
+
* zero or negative, so a row never reads "Refunded $0.00".
|
|
30
|
+
*/
|
|
31
|
+
refundedAmount?: number | null;
|
|
10
32
|
};
|
|
11
33
|
export type AutomaticScheduleSettings = {
|
|
12
34
|
numberOfInstallments: number;
|
|
@@ -16,11 +38,13 @@ export type AutomaticScheduleSettings = {
|
|
|
16
38
|
export type InstallmentScheduleInput = keyof AutomaticScheduleSettings | 'dayOfMonth';
|
|
17
39
|
export type InstallmentScheduleLabels = {
|
|
18
40
|
title?: string;
|
|
41
|
+
saved?: string;
|
|
19
42
|
automaticMode?: string;
|
|
20
43
|
manualMode?: string;
|
|
21
44
|
createInstallments?: string;
|
|
22
45
|
generateSchedule?: string;
|
|
23
46
|
saveInstallments?: string;
|
|
47
|
+
cancelEdit?: string;
|
|
24
48
|
addInstallment?: string;
|
|
25
49
|
emptyAutomatic?: string;
|
|
26
50
|
emptyManual?: string;
|
|
@@ -45,6 +69,8 @@ export type InstallmentScheduleLabels = {
|
|
|
45
69
|
totalIncreaseConfirmationCancel?: string;
|
|
46
70
|
totalIncreaseConfirmationConfirm?: string;
|
|
47
71
|
dateOrderError?: string;
|
|
72
|
+
/** Inline error on a manual row whose payment date was cleared or left incomplete. */
|
|
73
|
+
dueDateRequiredError?: string;
|
|
48
74
|
amountGreaterThanZeroError?: string;
|
|
49
75
|
};
|
|
50
76
|
export type InstallmentScheduleClassNames = {
|
|
@@ -71,23 +97,54 @@ export type InstallmentScheduleProps = {
|
|
|
71
97
|
showTabs?: boolean;
|
|
72
98
|
inputs?: InstallmentScheduleInput[];
|
|
73
99
|
startDate?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Automatic mode only. Dates installment #1 on this day instead of the day
|
|
102
|
+
* the generated cadence would put it on. Installments #2..N keep the
|
|
103
|
+
* generated cadence untouched.
|
|
104
|
+
*
|
|
105
|
+
* For flows where the first charge happens when the plan is COMMITTED
|
|
106
|
+
* while the schedule anchors on a later term start: a plan created today
|
|
107
|
+
* with a term starting next month charges #1 today, then follows the term.
|
|
108
|
+
* Without this the first charge silently moves to the term start, and the
|
|
109
|
+
* schedule on screen stops matching the one that gets persisted.
|
|
110
|
+
*
|
|
111
|
+
* Ignored in manual mode, where the host already owns every date, and
|
|
112
|
+
* ignored when `firstInstallmentDate` is one of `inputs` — there the user
|
|
113
|
+
* picks that date themselves and the schedule must agree with the field.
|
|
114
|
+
*/
|
|
115
|
+
firstInstallmentDateOverride?: string;
|
|
74
116
|
labels?: InstallmentScheduleLabels;
|
|
75
117
|
classNames?: InstallmentScheduleClassNames;
|
|
76
118
|
isSaving?: boolean;
|
|
119
|
+
showSavedIndicator?: boolean;
|
|
77
120
|
isModeSwitchDisabled?: boolean;
|
|
78
121
|
onModeChange?: (mode: InstallmentScheduleMode) => void;
|
|
79
122
|
onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
|
|
80
123
|
onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
|
|
81
124
|
onSave?: () => void;
|
|
125
|
+
onCancel?: () => void;
|
|
82
126
|
};
|
|
83
127
|
export type InstallmentTableLabels = {
|
|
84
128
|
title?: string;
|
|
129
|
+
saved?: string;
|
|
85
130
|
searchLabel?: string;
|
|
86
131
|
searchPlaceholder?: string;
|
|
87
132
|
editInstallments?: string;
|
|
88
133
|
installmentId?: string;
|
|
89
134
|
amount?: string;
|
|
90
135
|
scheduledDate?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Prefix of the paid date shown under the scheduled date of a row whose
|
|
138
|
+
* payment happened: "Paid on Jun 3, 2026".
|
|
139
|
+
*/
|
|
140
|
+
paidOn?: string;
|
|
141
|
+
/** FR-1422 — text of the `partially_refunded` status badge. Defaults to "Partially refunded". */
|
|
142
|
+
partiallyRefunded?: string;
|
|
143
|
+
/**
|
|
144
|
+
* FR-1422 — prefix of the refunded amount shown under the amount of a
|
|
145
|
+
* `partially_refunded` row: "Refunded $50.00". Defaults to "Refunded".
|
|
146
|
+
*/
|
|
147
|
+
refundedAmount?: string;
|
|
91
148
|
status?: string;
|
|
92
149
|
actions?: string;
|
|
93
150
|
payNow?: string;
|
|
@@ -117,10 +174,12 @@ export type InstallmentTableProps = {
|
|
|
117
174
|
/**
|
|
118
175
|
* FR-1619 — statuses for which the Pay Now button is NOT rendered on a row.
|
|
119
176
|
* Typed with the `InstallmentStatus` union so consumers get compile-time
|
|
120
|
-
* safety on status keys.
|
|
121
|
-
*
|
|
177
|
+
* safety on status keys. A Pay Now button that IS rendered is still
|
|
178
|
+
* disabled on a row whose payment already happened (`paid`,
|
|
179
|
+
* `partially_refunded`, `refunded`). Defaults to `[]`.
|
|
122
180
|
*/
|
|
123
181
|
payNowHiddenStatuses?: InstallmentStatus[];
|
|
182
|
+
showSavedIndicator?: boolean;
|
|
124
183
|
labels?: InstallmentTableLabels;
|
|
125
184
|
isSaving?: boolean;
|
|
126
185
|
onEditInstallments: () => void;
|
|
@@ -1,3 +1,36 @@
|
|
|
1
1
|
import { AutomaticScheduleSettings, ScheduledInstallment } from './types';
|
|
2
2
|
export declare function generateAutomaticInstallments(donationAmount: number, settings: AutomaticScheduleSettings): ScheduledInstallment[];
|
|
3
3
|
export declare function getInvalidDateRowIds(installments: ScheduledInstallment[]): Set<string>;
|
|
4
|
+
export type ManualRowErrors = {
|
|
5
|
+
/** Rows with no due date: the date picker reports a cleared or incomplete date as `''`. */
|
|
6
|
+
missingDateRows: Set<string>;
|
|
7
|
+
/** Rows dated after the next row. */
|
|
8
|
+
invalidDateRows: Set<string>;
|
|
9
|
+
/** Rows whose amount is not greater than zero. */
|
|
10
|
+
invalidAmountRows: Set<string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Every inline error a manual schedule can show, computed once so the rows
|
|
14
|
+
* that render the messages and the Save button that must refuse them can
|
|
15
|
+
* never disagree.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getManualRowErrors(installments: ScheduledInstallment[]): ManualRowErrors;
|
|
18
|
+
export declare function hasManualRowErrors(errors: ManualRowErrors): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Re-dates installment #1 without touching the rest of the schedule.
|
|
21
|
+
*
|
|
22
|
+
* The generator produces one uniform cadence from a single anchor, which
|
|
23
|
+
* cannot express "charge #1 today, then follow the term start". This applies
|
|
24
|
+
* that shape on top: only the first date moves, and only when an override is
|
|
25
|
+
* given and it actually differs.
|
|
26
|
+
*
|
|
27
|
+
* Amounts are never touched — the first-installment rounding remainder stays
|
|
28
|
+
* where the generator put it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function applyFirstInstallmentDateOverride(installments: ScheduledInstallment[], firstInstallmentDateOverride?: string): ScheduledInstallment[];
|
|
31
|
+
/**
|
|
32
|
+
* Whether the installment's payment already happened: it was paid, and may
|
|
33
|
+
* since have been refunded in part or in full. Such a row is a record of money
|
|
34
|
+
* that moved, so it cannot be paid again, edited or deleted.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isSettledInstallment(status: ScheduledInstallment['status']): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface KeyValueRow {
|
|
3
|
+
id?: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export type KeyValueRowsDensity = 'regular' | 'compact';
|
|
8
|
+
export interface KeyValueRowsProps {
|
|
9
|
+
rows: KeyValueRow[];
|
|
10
|
+
density?: KeyValueRowsDensity;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const KeyValueRows: React.FC<KeyValueRowsProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KeyValueRowsDensity } from './KeyValueRows';
|
|
2
|
+
export declare const keyValueRowsClass: {
|
|
3
|
+
readonly list: "m-0 divide-y divide-pos-hair";
|
|
4
|
+
readonly row: "flex items-baseline gap-3";
|
|
5
|
+
readonly label: "min-w-0 text-[0.84375rem] text-default-500";
|
|
6
|
+
readonly value: "m-0 ml-auto flex min-w-0 flex-wrap justify-end gap-[0.3125rem] text-right text-[0.875rem] text-default-900 [overflow-wrap:anywhere]";
|
|
7
|
+
};
|
|
8
|
+
export declare const keyValueRowPadding: Record<KeyValueRowsDensity, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LineItemRow {
|
|
3
|
+
id: string;
|
|
4
|
+
name: React.ReactNode;
|
|
5
|
+
details?: React.ReactNode[];
|
|
6
|
+
amount: React.ReactNode;
|
|
7
|
+
originalAmount?: React.ReactNode;
|
|
8
|
+
chip?: React.ReactNode;
|
|
9
|
+
tone?: 'violet';
|
|
10
|
+
}
|
|
11
|
+
export interface LineItemRowsProps {
|
|
12
|
+
items: LineItemRow[];
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
originalAmountLabel?: string;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const LineItemRows: React.FC<LineItemRowsProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const lineItemRowsClass: {
|
|
2
|
+
readonly list: "m-0 list-none p-0";
|
|
3
|
+
readonly row: "flex items-start gap-[0.875rem] border-t border-pos-hair px-5 py-3";
|
|
4
|
+
readonly body: "min-w-0 flex-1";
|
|
5
|
+
readonly name: "text-[0.90625rem] font-semibold text-default-900 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
6
|
+
readonly details: "mt-[0.3125rem] flex flex-wrap items-center gap-[0.4375rem] text-[0.8125rem] text-default-500";
|
|
7
|
+
readonly separator: "text-default-400";
|
|
8
|
+
readonly detail: "tabular-nums";
|
|
9
|
+
readonly trailing: "flex shrink-0 flex-col items-end gap-1.5 text-right";
|
|
10
|
+
readonly amounts: "inline-flex items-baseline gap-2";
|
|
11
|
+
readonly original: "text-[0.8125rem] tabular-nums text-default-500 line-through";
|
|
12
|
+
readonly amount: "whitespace-nowrap text-[0.9375rem] font-bold tabular-nums text-default-900";
|
|
13
|
+
};
|
|
@@ -38,6 +38,8 @@ export interface ListPanelProps {
|
|
|
38
38
|
emptyContent?: React.ReactNode;
|
|
39
39
|
/** The table/list rendered when none of the async states apply. */
|
|
40
40
|
children?: React.ReactNode;
|
|
41
|
+
toolbar?: React.ReactNode;
|
|
42
|
+
variant?: 'default' | 'framed';
|
|
41
43
|
className?: string;
|
|
42
44
|
classNames?: ListPanelClassNames;
|
|
43
45
|
'data-testid'?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const loadMoreFooterClass: {
|
|
2
|
+
readonly base: "flex flex-wrap items-center justify-center gap-2.5 border-t border-pos-hair px-5 py-[0.875rem] text-[0.84375rem] text-default-500";
|
|
3
|
+
readonly idle: "w-full";
|
|
4
|
+
readonly sentinel: "h-px w-full";
|
|
5
|
+
readonly spinner: "inline-flex";
|
|
6
|
+
readonly error: "text-pos-danger";
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type LoadMoreStatus = 'idle' | 'loading' | 'error' | 'end';
|
|
2
|
+
export interface LoadMoreFooterProps {
|
|
3
|
+
status: LoadMoreStatus;
|
|
4
|
+
onLoadMore: () => void;
|
|
5
|
+
loadingLabel: string;
|
|
6
|
+
errorLabel: string;
|
|
7
|
+
retryLabel: string;
|
|
8
|
+
endLabel?: string;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
}
|
|
@@ -26,6 +26,7 @@ export interface PageHeaderProps {
|
|
|
26
26
|
actions?: React.ReactNode;
|
|
27
27
|
/** Heading level for the title element. Default `'h1'`. */
|
|
28
28
|
titleAs?: 'h1' | 'h2' | 'h3';
|
|
29
|
+
variant?: 'default' | 'list';
|
|
29
30
|
className?: string;
|
|
30
31
|
classNames?: PageHeaderClassNames;
|
|
31
32
|
'data-testid'?: string;
|
|
@@ -10,6 +10,8 @@ export interface PaymentSubAmountInputProps {
|
|
|
10
10
|
defaultValue?: string;
|
|
11
11
|
/** Fires on every keystroke with the raw string. */
|
|
12
12
|
onChange?: (next: string) => void;
|
|
13
|
+
/** Fires when the amount field loses focus. */
|
|
14
|
+
onBlur?: () => void;
|
|
13
15
|
/** Placeholder shown when value is empty (e.g. "$150.00"). */
|
|
14
16
|
placeholder?: string;
|
|
15
17
|
isDisabled?: boolean;
|