@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,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tab variant options for TabBar
|
|
3
|
+
*/
|
|
4
|
+
export type TabVariant = 'default' | 'pills' | 'underline';
|
|
5
|
+
/**
|
|
6
|
+
* Individual tab configuration
|
|
7
|
+
*/
|
|
8
|
+
export interface Tab {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier for the tab
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Tab label text
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional badge count to display
|
|
19
|
+
*/
|
|
20
|
+
badge?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Whether this tab is disabled
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props for the TabBar component
|
|
29
|
+
*/
|
|
30
|
+
export interface TabBarProps {
|
|
31
|
+
/**
|
|
32
|
+
* Array of tab configurations
|
|
33
|
+
*/
|
|
34
|
+
tabs: Tab[];
|
|
35
|
+
/**
|
|
36
|
+
* Currently active tab ID
|
|
37
|
+
*/
|
|
38
|
+
activeTab: string;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when tab changes
|
|
41
|
+
*/
|
|
42
|
+
onTabChange: (tabId: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Visual variant of the tabs
|
|
45
|
+
* @default 'default'
|
|
46
|
+
*/
|
|
47
|
+
variant?: TabVariant;
|
|
48
|
+
/**
|
|
49
|
+
* Accessible label for the tab list
|
|
50
|
+
*/
|
|
51
|
+
'aria-label'?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Test identifier for automated testing
|
|
54
|
+
*/
|
|
55
|
+
'data-testid'?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* TabBar component for tabbed navigation
|
|
59
|
+
*
|
|
60
|
+
* Provides accessible tab navigation with 3 visual variants, keyboard support,
|
|
61
|
+
* and optional badge counts. Follows ARIA tablist pattern.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* const [activeTab, setActiveTab] = useState('all')
|
|
66
|
+
*
|
|
67
|
+
* <TabBar
|
|
68
|
+
* tabs={[
|
|
69
|
+
* { id: 'all', label: 'All', badge: 42 },
|
|
70
|
+
* { id: 'pending', label: 'Pending', badge: 5 },
|
|
71
|
+
* { id: 'completed', label: 'Completed' }
|
|
72
|
+
* ]}
|
|
73
|
+
* activeTab={activeTab}
|
|
74
|
+
* onTabChange={setActiveTab}
|
|
75
|
+
* variant="pills"
|
|
76
|
+
* />
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const TabBar: React.FC<TabBarProps>;
|
|
@@ -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,5 @@
|
|
|
1
|
+
export * from './AccountCard';
|
|
2
|
+
export * from './ActionSheet';
|
|
1
3
|
export * from './Alert';
|
|
2
4
|
export * from './Breadcrumbs';
|
|
3
5
|
export * from './CardSmall';
|
|
@@ -5,12 +7,17 @@ export * from './CardLarge';
|
|
|
5
7
|
export * from './Checkbox';
|
|
6
8
|
export * from './ChipGroup';
|
|
7
9
|
export * from './CodeBlock';
|
|
10
|
+
export * from './DateGroup';
|
|
11
|
+
export * from './EmptyState';
|
|
8
12
|
export * from './FeatureBlock';
|
|
9
13
|
export * from './Dropdown';
|
|
10
14
|
export * from './List';
|
|
11
15
|
export * from './NumberInput';
|
|
12
16
|
export * from './PageTitle';
|
|
13
17
|
export * from './PasswordField';
|
|
18
|
+
export * from './SearchField';
|
|
14
19
|
export * from './Sheet';
|
|
15
20
|
export * from './Slider';
|
|
21
|
+
export * from './TabBar';
|
|
16
22
|
export * from './TextField';
|
|
23
|
+
export * from './TransactionListItem';
|
package/dist/index.d.ts
CHANGED
|
@@ -169,6 +169,51 @@ export declare const tokens: {
|
|
|
169
169
|
"1200": string;
|
|
170
170
|
"1300": string;
|
|
171
171
|
};
|
|
172
|
+
purple: {
|
|
173
|
+
"100": string;
|
|
174
|
+
"200": string;
|
|
175
|
+
"300": string;
|
|
176
|
+
"400": string;
|
|
177
|
+
"500": string;
|
|
178
|
+
"600": string;
|
|
179
|
+
"700": string;
|
|
180
|
+
"800": string;
|
|
181
|
+
"900": string;
|
|
182
|
+
"1000": string;
|
|
183
|
+
"1100": string;
|
|
184
|
+
"1200": string;
|
|
185
|
+
"1300": string;
|
|
186
|
+
};
|
|
187
|
+
pink: {
|
|
188
|
+
"100": string;
|
|
189
|
+
"200": string;
|
|
190
|
+
"300": string;
|
|
191
|
+
"400": string;
|
|
192
|
+
"500": string;
|
|
193
|
+
"600": string;
|
|
194
|
+
"700": string;
|
|
195
|
+
"800": string;
|
|
196
|
+
"900": string;
|
|
197
|
+
"1000": string;
|
|
198
|
+
"1100": string;
|
|
199
|
+
"1200": string;
|
|
200
|
+
"1300": string;
|
|
201
|
+
};
|
|
202
|
+
yellow: {
|
|
203
|
+
"100": string;
|
|
204
|
+
"200": string;
|
|
205
|
+
"300": string;
|
|
206
|
+
"400": string;
|
|
207
|
+
"500": string;
|
|
208
|
+
"600": string;
|
|
209
|
+
"700": string;
|
|
210
|
+
"800": string;
|
|
211
|
+
"900": string;
|
|
212
|
+
"1000": string;
|
|
213
|
+
"1100": string;
|
|
214
|
+
"1200": string;
|
|
215
|
+
"1300": string;
|
|
216
|
+
};
|
|
172
217
|
};
|
|
173
218
|
spacing: {
|
|
174
219
|
"0": string;
|
|
@@ -639,6 +684,54 @@ export declare const tokens: {
|
|
|
639
684
|
success: string;
|
|
640
685
|
warning: string;
|
|
641
686
|
};
|
|
687
|
+
financial: {
|
|
688
|
+
credit: string;
|
|
689
|
+
"credit-hover": string;
|
|
690
|
+
debit: string;
|
|
691
|
+
"debit-hover": string;
|
|
692
|
+
pending: string;
|
|
693
|
+
neutral: string;
|
|
694
|
+
};
|
|
695
|
+
category: {
|
|
696
|
+
blue: string;
|
|
697
|
+
"blue-emphasis": string;
|
|
698
|
+
"blue-subtle": string;
|
|
699
|
+
purple: string;
|
|
700
|
+
"purple-emphasis": string;
|
|
701
|
+
"purple-subtle": string;
|
|
702
|
+
pink: string;
|
|
703
|
+
"pink-emphasis": string;
|
|
704
|
+
"pink-subtle": string;
|
|
705
|
+
yellow: string;
|
|
706
|
+
"yellow-emphasis": string;
|
|
707
|
+
"yellow-subtle": string;
|
|
708
|
+
green: string;
|
|
709
|
+
"green-emphasis": string;
|
|
710
|
+
"green-subtle": string;
|
|
711
|
+
red: string;
|
|
712
|
+
"red-emphasis": string;
|
|
713
|
+
"red-subtle": string;
|
|
714
|
+
orange: string;
|
|
715
|
+
"orange-emphasis": string;
|
|
716
|
+
"orange-subtle": string;
|
|
717
|
+
gray: string;
|
|
718
|
+
"gray-emphasis": string;
|
|
719
|
+
"gray-subtle": string;
|
|
720
|
+
};
|
|
721
|
+
status: {
|
|
722
|
+
pending: string;
|
|
723
|
+
"pending-bg": string;
|
|
724
|
+
completed: string;
|
|
725
|
+
"completed-bg": string;
|
|
726
|
+
failed: string;
|
|
727
|
+
"failed-bg": string;
|
|
728
|
+
cancelled: string;
|
|
729
|
+
"cancelled-bg": string;
|
|
730
|
+
processing: string;
|
|
731
|
+
"processing-bg": string;
|
|
732
|
+
scheduled: string;
|
|
733
|
+
"scheduled-bg": string;
|
|
734
|
+
};
|
|
642
735
|
};
|
|
643
736
|
typography: {
|
|
644
737
|
display: string;
|