@common-origin/design-system 2.0.1 → 2.3.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/components/atoms/CategoryBadge/CategoryBadge.d.ts +82 -0
- package/dist/components/atoms/CategoryBadge/index.d.ts +2 -0
- 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/StatusBadge/StatusBadge.d.ts +68 -0
- package/dist/components/atoms/StatusBadge/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts +3 -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/ActionSheet/ActionSheet.d.ts +110 -0
- package/dist/components/molecules/ActionSheet/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/SearchField/SearchField.d.ts +108 -0
- package/dist/components/molecules/SearchField/index.d.ts +2 -0
- package/dist/components/molecules/TabBar/TabBar.d.ts +79 -0
- package/dist/components/molecules/TabBar/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 +7 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.esm.js +2214 -335
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2221 -332
- package/dist/index.js.map +1 -1
- package/dist/styles/tokens.json +93 -0
- package/dist/tokens/index.esm.js +93 -0
- package/dist/tokens/index.esm.js.map +1 -1
- package/dist/tokens/index.js +93 -0
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/tokens.d.ts +93 -0
- package/package.json +3 -3
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { IconName } from '../../../types/icons';
|
|
3
|
+
/**
|
|
4
|
+
* Category color options for CategoryBadge
|
|
5
|
+
*/
|
|
6
|
+
export type CategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange' | 'gray';
|
|
7
|
+
/**
|
|
8
|
+
* Visual variant options for CategoryBadge
|
|
9
|
+
*/
|
|
10
|
+
export type CategoryVariant = 'filled' | 'outlined' | 'minimal';
|
|
11
|
+
/**
|
|
12
|
+
* Size options for CategoryBadge
|
|
13
|
+
*/
|
|
14
|
+
export type CategorySize = 'small' | 'medium';
|
|
15
|
+
/**
|
|
16
|
+
* Props for the CategoryBadge component
|
|
17
|
+
*/
|
|
18
|
+
export interface CategoryBadgeProps {
|
|
19
|
+
/**
|
|
20
|
+
* The category text to display
|
|
21
|
+
*/
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Color scheme for the badge
|
|
25
|
+
* @default 'blue'
|
|
26
|
+
*/
|
|
27
|
+
color?: CategoryColor;
|
|
28
|
+
/**
|
|
29
|
+
* Visual variant of the badge
|
|
30
|
+
* @default 'filled'
|
|
31
|
+
*/
|
|
32
|
+
variant?: CategoryVariant;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the badge
|
|
35
|
+
* @default 'medium'
|
|
36
|
+
*/
|
|
37
|
+
size?: CategorySize;
|
|
38
|
+
/**
|
|
39
|
+
* Optional icon name to display
|
|
40
|
+
*/
|
|
41
|
+
icon?: IconName;
|
|
42
|
+
/**
|
|
43
|
+
* Optional click handler (makes badge interactive)
|
|
44
|
+
*/
|
|
45
|
+
onClick?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the badge is disabled
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Test identifier for automated testing
|
|
53
|
+
*/
|
|
54
|
+
'data-testid'?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Accessible label for the badge
|
|
57
|
+
*/
|
|
58
|
+
'aria-label'?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* CategoryBadge component for displaying transaction categories
|
|
62
|
+
*
|
|
63
|
+
* Supports 8 color options, 3 visual variants, optional icons, and interactive behavior.
|
|
64
|
+
* Perfect for categorizing financial transactions or content.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <CategoryBadge color="orange" icon="restaurant">
|
|
69
|
+
* Food & Dining
|
|
70
|
+
* </CategoryBadge>
|
|
71
|
+
*
|
|
72
|
+
* <CategoryBadge
|
|
73
|
+
* color="blue"
|
|
74
|
+
* variant="outlined"
|
|
75
|
+
* size="small"
|
|
76
|
+
* onClick={() => filterByCategory('travel')}
|
|
77
|
+
* >
|
|
78
|
+
* Travel
|
|
79
|
+
* </CategoryBadge>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare const CategoryBadge: React.FC<CategoryBadgeProps>;
|
|
@@ -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,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status type options for StatusBadge
|
|
3
|
+
*/
|
|
4
|
+
export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'processing' | 'scheduled';
|
|
5
|
+
/**
|
|
6
|
+
* Size options for StatusBadge
|
|
7
|
+
*/
|
|
8
|
+
export type StatusSize = 'small' | 'medium';
|
|
9
|
+
/**
|
|
10
|
+
* Props for the StatusBadge component
|
|
11
|
+
*/
|
|
12
|
+
export interface StatusBadgeProps {
|
|
13
|
+
/**
|
|
14
|
+
* The status type to display
|
|
15
|
+
*/
|
|
16
|
+
status: StatusType;
|
|
17
|
+
/**
|
|
18
|
+
* Optional custom label (defaults to status name)
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Size of the badge
|
|
23
|
+
* @default 'medium'
|
|
24
|
+
*/
|
|
25
|
+
size?: StatusSize;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to show the icon
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
showIcon?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether status changes should be announced to screen readers
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
liveRegion?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Test identifier for automated testing
|
|
38
|
+
*/
|
|
39
|
+
'data-testid'?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Accessible label override
|
|
42
|
+
*/
|
|
43
|
+
'aria-label'?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* StatusBadge component for displaying transaction or task status
|
|
47
|
+
*
|
|
48
|
+
* Displays status with appropriate color, icon, and supports live updates for screen readers.
|
|
49
|
+
* Maps to 6 common status types with semantic color tokens.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <StatusBadge status="completed" />
|
|
54
|
+
*
|
|
55
|
+
* <StatusBadge
|
|
56
|
+
* status="pending"
|
|
57
|
+
* label="Awaiting approval"
|
|
58
|
+
* size="small"
|
|
59
|
+
* />
|
|
60
|
+
*
|
|
61
|
+
* <StatusBadge
|
|
62
|
+
* status="failed"
|
|
63
|
+
* showIcon={false}
|
|
64
|
+
* liveRegion={true}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
@@ -2,14 +2,17 @@ export * from './Avatar';
|
|
|
2
2
|
export * from './Badge';
|
|
3
3
|
export * from './Box';
|
|
4
4
|
export * from './Button';
|
|
5
|
+
export * from './CategoryBadge';
|
|
5
6
|
export * from './Chip';
|
|
6
7
|
export * from './Container';
|
|
7
8
|
export * from './Picture';
|
|
8
9
|
export * from './DateFormatter';
|
|
9
10
|
export * from './Icon';
|
|
10
11
|
export * from './IconButton';
|
|
12
|
+
export * from './MoneyDisplay';
|
|
11
13
|
export * from './ProgressBar';
|
|
12
14
|
export * from './Divider';
|
|
13
15
|
export * from './Stack';
|
|
16
|
+
export * from './StatusBadge';
|
|
14
17
|
export * from './Tag';
|
|
15
18
|
export * from './Typography';
|
|
@@ -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>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type IconName } from '../../../types/icons';
|
|
2
|
+
/**
|
|
3
|
+
* Action item for the action sheet
|
|
4
|
+
*/
|
|
5
|
+
export interface Action {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Display label
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional icon
|
|
16
|
+
*/
|
|
17
|
+
icon?: IconName;
|
|
18
|
+
/**
|
|
19
|
+
* Whether this is a destructive action (shown in red)
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
destructive?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether this action is disabled
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback when action is selected
|
|
30
|
+
*/
|
|
31
|
+
onSelect: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props for the ActionSheet component
|
|
35
|
+
*/
|
|
36
|
+
export interface ActionSheetProps {
|
|
37
|
+
/**
|
|
38
|
+
* Whether the action sheet is open
|
|
39
|
+
*/
|
|
40
|
+
isOpen: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Callback when the action sheet should close
|
|
43
|
+
*/
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Title of the action sheet
|
|
47
|
+
*/
|
|
48
|
+
title?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Optional description
|
|
51
|
+
*/
|
|
52
|
+
description?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Array of actions
|
|
55
|
+
*/
|
|
56
|
+
actions: Action[];
|
|
57
|
+
/**
|
|
58
|
+
* Whether to close on overlay click
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
closeOnOverlayClick?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Whether to close on Escape key
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
closeOnEscape?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Show close button in header
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
showCloseButton?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Test identifier
|
|
74
|
+
*/
|
|
75
|
+
'data-testid'?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* ActionSheet component for bottom sheet modals
|
|
79
|
+
*
|
|
80
|
+
* Displays a modal action sheet that slides up from the bottom,
|
|
81
|
+
* providing a list of actions for the user to choose from.
|
|
82
|
+
* Includes focus trapping, keyboard navigation, and accessibility features.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* const [isOpen, setIsOpen] = useState(false)
|
|
87
|
+
*
|
|
88
|
+
* <ActionSheet
|
|
89
|
+
* isOpen={isOpen}
|
|
90
|
+
* onClose={() => setIsOpen(false)}
|
|
91
|
+
* title="Choose an action"
|
|
92
|
+
* actions={[
|
|
93
|
+
* {
|
|
94
|
+
* id: 'edit',
|
|
95
|
+
* label: 'Edit',
|
|
96
|
+
* icon: 'edit',
|
|
97
|
+
* onSelect: () => console.log('Edit')
|
|
98
|
+
* },
|
|
99
|
+
* {
|
|
100
|
+
* id: 'delete',
|
|
101
|
+
* label: 'Delete',
|
|
102
|
+
* icon: 'trash',
|
|
103
|
+
* destructive: true,
|
|
104
|
+
* onSelect: () => console.log('Delete')
|
|
105
|
+
* }
|
|
106
|
+
* ]}
|
|
107
|
+
* />
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare const ActionSheet: ({ isOpen, onClose, title, description, actions, closeOnOverlayClick, closeOnEscape, showCloseButton, "data-testid": dataTestId }: ActionSheetProps) => import("react").ReactPortal | null;
|
|
@@ -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,108 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Suggestion item for autocomplete
|
|
4
|
+
*/
|
|
5
|
+
export interface Suggestion {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Display text
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional secondary text
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional category for grouping
|
|
20
|
+
*/
|
|
21
|
+
category?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Props for the SearchField component
|
|
25
|
+
*/
|
|
26
|
+
export interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange'> {
|
|
27
|
+
/**
|
|
28
|
+
* Current search value
|
|
29
|
+
*/
|
|
30
|
+
value: string;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when value changes
|
|
33
|
+
*/
|
|
34
|
+
onChange: (value: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Suggestions to display
|
|
37
|
+
*/
|
|
38
|
+
suggestions?: Suggestion[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether to show recent searches
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
showRecentSearches?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Array of recent search terms
|
|
46
|
+
*/
|
|
47
|
+
recentSearches?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Callback when a suggestion is selected
|
|
50
|
+
*/
|
|
51
|
+
onSuggestionSelect?: (suggestion: Suggestion | string) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Callback to clear recent searches
|
|
54
|
+
*/
|
|
55
|
+
onClearRecentSearches?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Debounce delay in milliseconds
|
|
58
|
+
* @default 300
|
|
59
|
+
*/
|
|
60
|
+
debounceMs?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Placeholder text
|
|
63
|
+
* @default 'Search...'
|
|
64
|
+
*/
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the field is disabled
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show loading state
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
loading?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Accessible label
|
|
78
|
+
*/
|
|
79
|
+
'aria-label'?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Test identifier
|
|
82
|
+
*/
|
|
83
|
+
'data-testid'?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* SearchField component with autocomplete and recent searches
|
|
87
|
+
*
|
|
88
|
+
* Provides intelligent search with debouncing, keyboard navigation,
|
|
89
|
+
* suggestions, and recent search history. Fully accessible with ARIA.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* const [search, setSearch] = useState('')
|
|
94
|
+
* const [suggestions] = useState([
|
|
95
|
+
* { id: '1', label: 'Apple', category: 'Fruit' },
|
|
96
|
+
* { id: '2', label: 'Banana', category: 'Fruit' }
|
|
97
|
+
* ])
|
|
98
|
+
*
|
|
99
|
+
* <SearchField
|
|
100
|
+
* value={search}
|
|
101
|
+
* onChange={setSearch}
|
|
102
|
+
* suggestions={suggestions}
|
|
103
|
+
* recentSearches={['coffee', 'tea']}
|
|
104
|
+
* onSuggestionSelect={(item) => console.log('Selected:', item)}
|
|
105
|
+
* />
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare const SearchField: import("react").ForwardRefExoticComponent<SearchFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|