@common-origin/design-system 2.21.0 → 2.23.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/client.js +261 -208
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.d.mts +16 -4
- package/dist/components/atoms/Badge/Badge.d.ts +16 -4
- package/dist/components/atoms/Badge/Badge.mjs +4 -5
- package/dist/components/atoms/Badge/index.d.mts +1 -1
- package/dist/components/atoms/Badge/index.d.ts +1 -1
- package/dist/components/atoms/Box/Box.d.mts +25 -1
- package/dist/components/atoms/Box/Box.d.ts +25 -1
- package/dist/components/atoms/Box/Box.mjs +5 -2
- package/dist/components/atoms/Button/Button.mjs +1 -1
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +23 -8
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +23 -8
- package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +31 -18
- package/dist/components/atoms/CategoryLabel/index.d.mts +1 -1
- package/dist/components/atoms/CategoryLabel/index.d.ts +1 -1
- package/dist/components/atoms/Chip/SuggestionChip.mjs +1 -1
- package/dist/components/atoms/Chip/shared/utils.mjs +1 -1
- package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -1
- package/dist/components/atoms/Icon/Icon.mjs +1 -1
- package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs +14 -60
- package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +3 -2
- package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +3 -2
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs +1 -1
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +1 -1
- package/dist/components/atoms/StatusLabel/StatusLabel.d.mts +5 -2
- package/dist/components/atoms/StatusLabel/StatusLabel.d.ts +5 -2
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs +5 -2
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -1
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +2 -2
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +2 -2
- package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +19 -13
- package/dist/components/atoms/StatusLabel/StatusShape.d.mts +4 -0
- package/dist/components/atoms/StatusLabel/StatusShape.d.ts +4 -0
- package/dist/components/atoms/StatusLabel/StatusShape.mjs +31 -0
- package/dist/components/atoms/StatusLabel/StatusShape.mjs.map +1 -0
- package/dist/components/atoms/Typography/Typography.mjs +2 -2
- package/dist/components/molecules/AccountCard/AccountCard.mjs +22 -14
- package/dist/components/molecules/Alert/Alert.d.mts +4 -4
- package/dist/components/molecules/Alert/Alert.d.ts +4 -4
- package/dist/components/molecules/Alert/Alert.mjs +5 -4
- package/dist/components/molecules/CodeBlock/CodeBlock.mjs +1 -1
- package/dist/components/molecules/Dropdown/Dropdown.mjs +2 -2
- package/dist/components/molecules/InlineAlert/InlineAlert.mjs +15 -5
- package/dist/components/molecules/TabBar/TabBar.mjs +3 -3
- package/dist/components/molecules/TransactionListItem/TransactionListItem.d.mts +1 -1
- package/dist/components/molecules/TransactionListItem/TransactionListItem.d.ts +1 -1
- package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +15 -31
- package/dist/data.js +514 -303
- package/dist/data.js.map +1 -1
- package/dist/lib/statusShapes.d.mts +2 -0
- package/dist/lib/statusShapes.d.ts +2 -0
- package/dist/lib/statusShapes.mjs +16 -0
- package/dist/lib/statusShapes.mjs.map +1 -0
- package/dist/lib/styleUtils.mjs +2 -2
- package/dist/lib/styleUtils.mjs.map +1 -1
- package/dist/lib/tokenAliases.d.mts +9 -0
- package/dist/lib/tokenAliases.d.ts +9 -0
- package/dist/lib/tokenAliases.mjs +50 -11
- package/dist/lib/tokenAliases.mjs.map +1 -1
- package/dist/styles/icons.json +141 -0
- package/dist/styles/icons.json.mjs +153 -2
- package/dist/styles/icons.json.mjs.map +1 -1
- package/dist/styles/tokens.d.mts +721 -123
- package/dist/styles/tokens.d.ts +721 -123
- package/dist/styles/tokens.json +362 -302
- package/dist/styles/tokens.json.mjs +362 -302
- package/dist/styles/tokens.json.mjs.map +1 -1
- package/dist/tokens/index.js +362 -302
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +362 -302
- package/dist/tokens/index.mjs.map +1 -1
- package/dist/tokens/styles/tokens.d.mts +721 -123
- package/dist/tokens/styles/tokens.d.ts +721 -123
- package/dist/tokens.css +363 -317
- package/dist/types/icons.d.mts +1 -1
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/icons.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ var semantic = tokens.semantic;
|
|
|
11
11
|
var StyledTabList = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "TabBar__StyledTabList",
|
|
13
13
|
componentId: "sc-1g9ib0y-0"
|
|
14
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"])), semantic.border.width.thin, semantic.color.border
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"])), semantic.border.width.thin, semantic.color.border["default"], tokens.component.tabBar.scrollbar.height, semantic.surface.raised, semantic.color.border["default"], semantic.radius.sm);
|
|
15
15
|
var StyledTab = /*#__PURE__*/styled.button.withConfig({
|
|
16
16
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
17
17
|
return !prop.startsWith('$');
|
|
@@ -31,11 +31,11 @@ var StyledTab = /*#__PURE__*/styled.button.withConfig({
|
|
|
31
31
|
}, function (props) {
|
|
32
32
|
return props.$isActive ? semantic.color.fill['accent-muted-hover'] : 'transparent';
|
|
33
33
|
}, function (props) {
|
|
34
|
-
return props.$isActive ? semantic.color.text
|
|
34
|
+
return props.$isActive ? semantic.color.text.accent : semantic.color.text["default"];
|
|
35
35
|
}, function (props) {
|
|
36
36
|
return props.$isActive ? semantic.color.fill['accent-muted-pressed'] : 'transparent';
|
|
37
37
|
}, function (props) {
|
|
38
|
-
return props.$isActive ? semantic.color.text
|
|
38
|
+
return props.$isActive ? semantic.color.text.accent : semantic.color.text["default"];
|
|
39
39
|
}, function (props) {
|
|
40
40
|
return props.$disabled ? '0.5' : '1';
|
|
41
41
|
}, semantic.border.focus, semantic.border.focusOffset);
|
|
@@ -34,6 +34,6 @@ export interface TransactionListItemProps {
|
|
|
34
34
|
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
35
35
|
* with interactive states for clickable items.
|
|
36
36
|
*
|
|
37
|
-
* Composes: Avatar,
|
|
37
|
+
* Composes: Avatar, CategoryLabel, StatusLabel, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
38
38
|
*/
|
|
39
39
|
export declare const TransactionListItem: React.FC<TransactionListItemProps>;
|
|
@@ -34,6 +34,6 @@ export interface TransactionListItemProps {
|
|
|
34
34
|
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
35
35
|
* with interactive states for clickable items.
|
|
36
36
|
*
|
|
37
|
-
* Composes: Avatar,
|
|
37
|
+
* Composes: Avatar, CategoryLabel, StatusLabel, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
38
38
|
*/
|
|
39
39
|
export declare const TransactionListItem: React.FC<TransactionListItemProps>;
|
|
@@ -4,7 +4,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import styled$module from 'styled-components';
|
|
5
5
|
const styled = styled$module.default || styled$module;
|
|
6
6
|
import { Avatar } from '../../atoms/Avatar/Avatar.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { StatusLabel } from '../../atoms/StatusLabel/StatusLabel.mjs';
|
|
8
8
|
import { CategoryLabel } from '../../atoms/CategoryLabel/CategoryLabel.mjs';
|
|
9
9
|
import { MoneyDisplay } from '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
10
10
|
import { Icon } from '../../atoms/Icon/Icon.mjs';
|
|
@@ -56,28 +56,30 @@ var StyledTruncatedText = /*#__PURE__*/styled.span.withConfig({
|
|
|
56
56
|
])));
|
|
57
57
|
// Map categories to CategoryLabel configurations
|
|
58
58
|
var categoryConfig = {
|
|
59
|
+
// Display colours carry no meaning (decision 0043); five coloured categories share four colours,
|
|
60
|
+
// so the icon and label tell dining and bills apart
|
|
59
61
|
shopping: {
|
|
60
|
-
color: '
|
|
62
|
+
color: 'magenta',
|
|
61
63
|
icon: 'paper',
|
|
62
64
|
label: 'Shopping'
|
|
63
65
|
},
|
|
64
66
|
dining: {
|
|
65
|
-
color: '
|
|
67
|
+
color: 'rose',
|
|
66
68
|
icon: 'paper',
|
|
67
69
|
label: 'Dining'
|
|
68
70
|
},
|
|
69
71
|
transport: {
|
|
70
|
-
color: '
|
|
72
|
+
color: 'periwinkle',
|
|
71
73
|
icon: 'paper',
|
|
72
74
|
label: 'Transport'
|
|
73
75
|
},
|
|
74
76
|
entertainment: {
|
|
75
|
-
color: '
|
|
77
|
+
color: 'olive',
|
|
76
78
|
icon: 'star',
|
|
77
79
|
label: 'Entertainment'
|
|
78
80
|
},
|
|
79
81
|
bills: {
|
|
80
|
-
color: '
|
|
82
|
+
color: 'rose',
|
|
81
83
|
icon: 'paper',
|
|
82
84
|
label: 'Bills'
|
|
83
85
|
},
|
|
@@ -87,12 +89,6 @@ var categoryConfig = {
|
|
|
87
89
|
label: 'Other'
|
|
88
90
|
}
|
|
89
91
|
};
|
|
90
|
-
// Map status to badge variant
|
|
91
|
-
var statusToBadgeVariant = {
|
|
92
|
-
completed: 'success',
|
|
93
|
-
pending: 'warning',
|
|
94
|
-
failed: 'error'
|
|
95
|
-
};
|
|
96
92
|
/**
|
|
97
93
|
* TransactionListItem component
|
|
98
94
|
*
|
|
@@ -100,7 +96,7 @@ var statusToBadgeVariant = {
|
|
|
100
96
|
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
101
97
|
* with interactive states for clickable items.
|
|
102
98
|
*
|
|
103
|
-
* Composes: Avatar,
|
|
99
|
+
* Composes: Avatar, CategoryLabel, StatusLabel, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
104
100
|
*/
|
|
105
101
|
var TransactionListItem = function TransactionListItem(_a) {
|
|
106
102
|
var merchant = _a.merchant,
|
|
@@ -124,8 +120,6 @@ var TransactionListItem = function TransactionListItem(_a) {
|
|
|
124
120
|
var amountVariant = amount > 0 ? 'positive' : amount < 0 ? 'negative' : 'default';
|
|
125
121
|
// Get category configuration
|
|
126
122
|
var categoryData = category ? categoryConfig[category] : undefined;
|
|
127
|
-
// Get badge variant from status
|
|
128
|
-
var badgeVariant = statusToBadgeVariant[status];
|
|
129
123
|
var handleClick = function handleClick() {
|
|
130
124
|
if (isClickable && onClick) {
|
|
131
125
|
onClick();
|
|
@@ -143,19 +137,10 @@ var TransactionListItem = function TransactionListItem(_a) {
|
|
|
143
137
|
onKeyDown: handleKeyDown,
|
|
144
138
|
tabIndex: isClickable ? 0 : undefined,
|
|
145
139
|
role: isClickable ? 'button' : undefined,
|
|
146
|
-
"aria-label": isClickable ? "".concat(merchant, " transaction, ").concat(amount < 0 ? 'expense' : 'income', " of ").concat(Math.abs(amount)) : undefined,
|
|
140
|
+
"aria-label": isClickable ? "".concat(merchant, " transaction, ").concat(amount < 0 ? 'expense' : 'income', " of ").concat(Math.abs(amount)).concat(status === 'completed' ? '' : ", ".concat(status)) : undefined,
|
|
147
141
|
"data-testid": dataTestId,
|
|
148
142
|
children: [jsx(StyledAvatarSection, {
|
|
149
|
-
children:
|
|
150
|
-
variant: badgeVariant,
|
|
151
|
-
dot: true,
|
|
152
|
-
"aria-label": "Pending transaction",
|
|
153
|
-
children: jsx(Avatar, {
|
|
154
|
-
name: merchant,
|
|
155
|
-
picture: merchantLogo,
|
|
156
|
-
size: "md"
|
|
157
|
-
})
|
|
158
|
-
}) : jsx(Avatar, {
|
|
143
|
+
children: jsx(Avatar, {
|
|
159
144
|
name: merchant,
|
|
160
145
|
picture: merchantLogo,
|
|
161
146
|
size: "md"
|
|
@@ -175,11 +160,10 @@ var TransactionListItem = function TransactionListItem(_a) {
|
|
|
175
160
|
variant: "minimal",
|
|
176
161
|
"aria-label": "Category: ".concat(categoryData.label),
|
|
177
162
|
children: categoryData.label
|
|
178
|
-
}), status
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
children: jsx("span", {})
|
|
163
|
+
}), status !== 'completed' && jsx(StatusLabel, {
|
|
164
|
+
status: status,
|
|
165
|
+
size: "small",
|
|
166
|
+
liveRegion: false
|
|
183
167
|
})]
|
|
184
168
|
}), jsx(MoneyDisplay, {
|
|
185
169
|
amount: amount,
|