@common-origin/design-system 2.0.1 → 2.2.5
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/components/atoms/Chip/shared/ChipBase.d.ts +1 -1
- package/dist/components/atoms/Chip/shared/utils.d.ts +1 -1
- package/dist/components/atoms/DateFormatter/DateFormatter.d.ts +3 -0
- package/dist/components/atoms/MoneyDisplay/MoneyDisplay.d.ts +26 -0
- package/dist/components/atoms/MoneyDisplay/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/molecules/AccountCard/AccountCard.d.ts +44 -0
- package/dist/components/molecules/AccountCard/index.d.ts +2 -0
- package/dist/components/molecules/Checkbox/SelectableInputBase.d.ts +1 -2
- package/dist/components/molecules/DateGroup/DateGroup.d.ts +34 -0
- package/dist/components/molecules/DateGroup/index.d.ts +2 -0
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +32 -0
- package/dist/components/molecules/EmptyState/index.d.ts +2 -0
- package/dist/components/molecules/TextField/InputBase.d.ts +0 -1
- package/dist/components/molecules/TransactionListItem/TransactionListItem.d.ts +39 -0
- package/dist/components/molecules/TransactionListItem/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +4 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.esm.js +866 -190
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +869 -188
- package/dist/index.js.map +1 -1
- package/dist/styles/tokens.json +8 -0
- package/dist/tokens/index.esm.js +8 -0
- package/dist/tokens/index.esm.js.map +1 -1
- package/dist/tokens/index.js +8 -0
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/tokens.d.ts +8 -0
- package/package.json +3 -3
|
@@ -3,6 +3,6 @@ import { InternalStyledProps } from './types';
|
|
|
3
3
|
export declare const BaseChipStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
4
|
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
5
5
|
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
6
|
-
$disabled?: boolean
|
|
6
|
+
$disabled?: boolean;
|
|
7
7
|
}>> & string;
|
|
8
8
|
export declare const StyledChipWrapper: React.FC<React.PropsWithChildren<InternalStyledProps & React.HTMLAttributes<HTMLSpanElement>>>;
|
|
@@ -40,7 +40,7 @@ export declare const getVariantStylesAsObject: (variant: ChipVariant, selected?:
|
|
|
40
40
|
backgroundColor: string;
|
|
41
41
|
color: string;
|
|
42
42
|
};
|
|
43
|
-
export declare const getSizeStylesAsObject: (size: BaseChipProps[
|
|
43
|
+
export declare const getSizeStylesAsObject: (size: BaseChipProps["size"]) => {
|
|
44
44
|
font: string;
|
|
45
45
|
padding: string;
|
|
46
46
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type DateFormatMode = 'absolute' | 'relative' | 'smart';
|
|
2
3
|
export interface DateFormatterProps {
|
|
3
4
|
/** ISO date string to format */
|
|
4
5
|
dateString: string;
|
|
5
6
|
/** Format pattern (defaults to 'yyyy') */
|
|
6
7
|
formatString?: string;
|
|
8
|
+
/** Date formatting mode: 'absolute' uses formatString, 'relative' shows "Today"/"Yesterday", 'smart' combines both */
|
|
9
|
+
mode?: DateFormatMode;
|
|
7
10
|
/** Optional data-testid for testing */
|
|
8
11
|
'data-testid'?: string;
|
|
9
12
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MoneyDisplayVariant = 'default' | 'positive' | 'negative' | 'neutral';
|
|
3
|
+
export type MoneyDisplaySize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
export type MoneyDisplayWeight = 'regular' | 'medium' | 'bold';
|
|
5
|
+
export type MoneyDisplayAlign = 'left' | 'center' | 'right';
|
|
6
|
+
export interface MoneyDisplayProps {
|
|
7
|
+
/** The monetary amount to display */
|
|
8
|
+
amount: number;
|
|
9
|
+
/** Currency code (ISO 4217) */
|
|
10
|
+
currency?: string;
|
|
11
|
+
/** Visual variant affecting color and style */
|
|
12
|
+
variant?: MoneyDisplayVariant;
|
|
13
|
+
/** Show +/- sign prefix */
|
|
14
|
+
showSign?: boolean;
|
|
15
|
+
/** Size of the amount display */
|
|
16
|
+
size?: MoneyDisplaySize;
|
|
17
|
+
/** Font weight */
|
|
18
|
+
weight?: MoneyDisplayWeight;
|
|
19
|
+
/** Locale for number formatting */
|
|
20
|
+
locale?: string;
|
|
21
|
+
/** Align text */
|
|
22
|
+
align?: MoneyDisplayAlign;
|
|
23
|
+
/** Data test id for testing */
|
|
24
|
+
'data-testid'?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const MoneyDisplay: React.FC<MoneyDisplayProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconName } from '../../atoms/Icon';
|
|
3
|
+
export type AccountType = 'checking' | 'savings' | 'credit' | 'investment' | 'loan';
|
|
4
|
+
export type TrendDirection = 'up' | 'down' | 'neutral';
|
|
5
|
+
export interface AccountCardAction {
|
|
6
|
+
label: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'naked';
|
|
10
|
+
}
|
|
11
|
+
export interface AccountCardProps {
|
|
12
|
+
/** Type of account */
|
|
13
|
+
accountType: AccountType;
|
|
14
|
+
/** Display name of the account */
|
|
15
|
+
accountName: string;
|
|
16
|
+
/** Account balance */
|
|
17
|
+
balance: number;
|
|
18
|
+
/** Optional account number (last 4 digits) */
|
|
19
|
+
accountNumber?: string;
|
|
20
|
+
/** Trend direction for balance change */
|
|
21
|
+
trend?: TrendDirection;
|
|
22
|
+
/** Trend value (e.g., percentage or amount) */
|
|
23
|
+
trendValue?: string;
|
|
24
|
+
/** Primary action button */
|
|
25
|
+
action?: AccountCardAction;
|
|
26
|
+
/** Secondary action button */
|
|
27
|
+
secondaryAction?: AccountCardAction;
|
|
28
|
+
/** Currency code */
|
|
29
|
+
currency?: string;
|
|
30
|
+
/** Whether the card should be interactive (clickable) */
|
|
31
|
+
onClick?: () => void;
|
|
32
|
+
/** Test identifier for automated testing */
|
|
33
|
+
'data-testid'?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* AccountCard component
|
|
37
|
+
*
|
|
38
|
+
* Displays account information in a card format with account type icon,
|
|
39
|
+
* name, balance, optional trend indicator, and action buttons. Minimum
|
|
40
|
+
* 300x200px with elevation and hover effects.
|
|
41
|
+
*
|
|
42
|
+
* Composes: Stack, Box, Icon, Typography, MoneyDisplay, Button
|
|
43
|
+
*/
|
|
44
|
+
export declare const AccountCard: React.FC<AccountCardProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type SelectableInputState = 'default' | 'error' | 'disabled';
|
|
3
2
|
interface StyledCheckboxInputProps {
|
|
4
3
|
$state: SelectableInputState;
|
|
@@ -22,7 +21,7 @@ export declare const StyledCheckbox: import("styled-components/dist/types").ISty
|
|
|
22
21
|
*/
|
|
23
22
|
export declare const StyledCheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
|
|
24
23
|
$disabled: boolean;
|
|
25
|
-
$labelPosition:
|
|
24
|
+
$labelPosition: "left" | "right";
|
|
26
25
|
}>> & string;
|
|
27
26
|
/**
|
|
28
27
|
* Label text with proper typography
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateFormatMode } from '../../atoms/DateFormatter';
|
|
3
|
+
export interface DateGroupProps {
|
|
4
|
+
/** The date for this group (used for formatting the header) */
|
|
5
|
+
date: Date | string;
|
|
6
|
+
/** Children to render under the date header (typically transactions) */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Format mode for date display */
|
|
9
|
+
format?: DateFormatMode;
|
|
10
|
+
/** Whether to show total amount for this date group */
|
|
11
|
+
showTotal?: boolean;
|
|
12
|
+
/** Total amount for this date group (shown if showTotal is true) */
|
|
13
|
+
totalAmount?: number;
|
|
14
|
+
/** Whether to show count of items in this group */
|
|
15
|
+
showCount?: boolean;
|
|
16
|
+
/** Count of items in this group (shown if showCount is true) */
|
|
17
|
+
count?: number;
|
|
18
|
+
/** Whether to make the header sticky (useful for scrolling lists) */
|
|
19
|
+
sticky?: boolean;
|
|
20
|
+
/** Currency for total amount display */
|
|
21
|
+
currency?: string;
|
|
22
|
+
/** Test identifier for automated testing */
|
|
23
|
+
'data-testid'?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* DateGroup component
|
|
27
|
+
*
|
|
28
|
+
* Groups related content (typically transactions) under a formatted date header
|
|
29
|
+
* with optional total amount and item count displays. Supports sticky headers
|
|
30
|
+
* for scrolling lists.
|
|
31
|
+
*
|
|
32
|
+
* Composes: DateFormatter, MoneyDisplay, Stack, Typography
|
|
33
|
+
*/
|
|
34
|
+
export declare const DateGroup: React.FC<DateGroupProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IconName } from '../../../types/icons';
|
|
3
|
+
export type EmptyStateIllustration = 'search' | 'transactions' | 'notifications' | 'empty' | 'error' | 'custom';
|
|
4
|
+
export type EmptyStateVariant = 'default' | 'error' | 'success';
|
|
5
|
+
export type EmptyStateSize = 'small' | 'medium' | 'large';
|
|
6
|
+
export interface EmptyStateAction {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
variant?: 'primary' | 'secondary';
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
}
|
|
12
|
+
export interface EmptyStateProps {
|
|
13
|
+
/** Predefined illustration type */
|
|
14
|
+
illustration?: EmptyStateIllustration;
|
|
15
|
+
/** Custom illustration (SVG string or React node) */
|
|
16
|
+
customIllustration?: React.ReactNode;
|
|
17
|
+
/** Main heading */
|
|
18
|
+
title: string;
|
|
19
|
+
/** Descriptive text */
|
|
20
|
+
description: string;
|
|
21
|
+
/** Primary call-to-action */
|
|
22
|
+
action?: EmptyStateAction;
|
|
23
|
+
/** Secondary action */
|
|
24
|
+
secondaryAction?: EmptyStateAction;
|
|
25
|
+
/** Visual variant */
|
|
26
|
+
variant?: EmptyStateVariant;
|
|
27
|
+
/** Size of the component */
|
|
28
|
+
size?: EmptyStateSize;
|
|
29
|
+
/** Data test id for testing */
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const EmptyState: React.FC<EmptyStateProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TransactionStatus = 'completed' | 'pending' | 'failed';
|
|
3
|
+
export type TransactionCategory = 'shopping' | 'dining' | 'transport' | 'entertainment' | 'bills' | 'other';
|
|
4
|
+
export interface TransactionListItemProps {
|
|
5
|
+
/** Merchant or transaction name */
|
|
6
|
+
merchant: string;
|
|
7
|
+
/** Transaction amount (positive for income, negative for expense) */
|
|
8
|
+
amount: number;
|
|
9
|
+
/** Transaction date */
|
|
10
|
+
date: Date | string;
|
|
11
|
+
/** Transaction status */
|
|
12
|
+
status?: TransactionStatus;
|
|
13
|
+
/** Transaction category */
|
|
14
|
+
category?: TransactionCategory;
|
|
15
|
+
/** Optional merchant logo URL */
|
|
16
|
+
merchantLogo?: string;
|
|
17
|
+
/** Optional description or note */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Whether this transaction has a receipt attached */
|
|
20
|
+
hasReceipt?: boolean;
|
|
21
|
+
/** Whether this transaction has notes attached */
|
|
22
|
+
hasNote?: boolean;
|
|
23
|
+
/** Currency code */
|
|
24
|
+
currency?: string;
|
|
25
|
+
/** Click handler for the transaction */
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
/** Test identifier for automated testing */
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* TransactionListItem component
|
|
32
|
+
*
|
|
33
|
+
* Displays a single transaction in a list with merchant info, amount, date,
|
|
34
|
+
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
35
|
+
* with interactive states for clickable items.
|
|
36
|
+
*
|
|
37
|
+
* Composes: Avatar, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
38
|
+
*/
|
|
39
|
+
export declare const TransactionListItem: React.FC<TransactionListItemProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './AccountCard';
|
|
1
2
|
export * from './Alert';
|
|
2
3
|
export * from './Breadcrumbs';
|
|
3
4
|
export * from './CardSmall';
|
|
@@ -5,6 +6,8 @@ export * from './CardLarge';
|
|
|
5
6
|
export * from './Checkbox';
|
|
6
7
|
export * from './ChipGroup';
|
|
7
8
|
export * from './CodeBlock';
|
|
9
|
+
export * from './DateGroup';
|
|
10
|
+
export * from './EmptyState';
|
|
8
11
|
export * from './FeatureBlock';
|
|
9
12
|
export * from './Dropdown';
|
|
10
13
|
export * from './List';
|
|
@@ -14,3 +17,4 @@ export * from './PasswordField';
|
|
|
14
17
|
export * from './Sheet';
|
|
15
18
|
export * from './Slider';
|
|
16
19
|
export * from './TextField';
|
|
20
|
+
export * from './TransactionListItem';
|
package/dist/index.d.ts
CHANGED
|
@@ -639,6 +639,14 @@ export declare const tokens: {
|
|
|
639
639
|
success: string;
|
|
640
640
|
warning: string;
|
|
641
641
|
};
|
|
642
|
+
financial: {
|
|
643
|
+
credit: string;
|
|
644
|
+
"credit-hover": string;
|
|
645
|
+
debit: string;
|
|
646
|
+
"debit-hover": string;
|
|
647
|
+
pending: string;
|
|
648
|
+
neutral: string;
|
|
649
|
+
};
|
|
642
650
|
};
|
|
643
651
|
typography: {
|
|
644
652
|
display: string;
|