@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.
Files changed (79) hide show
  1. package/dist/client.js +261 -208
  2. package/dist/client.js.map +1 -1
  3. package/dist/components/atoms/Badge/Badge.d.mts +16 -4
  4. package/dist/components/atoms/Badge/Badge.d.ts +16 -4
  5. package/dist/components/atoms/Badge/Badge.mjs +4 -5
  6. package/dist/components/atoms/Badge/index.d.mts +1 -1
  7. package/dist/components/atoms/Badge/index.d.ts +1 -1
  8. package/dist/components/atoms/Box/Box.d.mts +25 -1
  9. package/dist/components/atoms/Box/Box.d.ts +25 -1
  10. package/dist/components/atoms/Box/Box.mjs +5 -2
  11. package/dist/components/atoms/Button/Button.mjs +1 -1
  12. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +23 -8
  13. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +23 -8
  14. package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +31 -18
  15. package/dist/components/atoms/CategoryLabel/index.d.mts +1 -1
  16. package/dist/components/atoms/CategoryLabel/index.d.ts +1 -1
  17. package/dist/components/atoms/Chip/SuggestionChip.mjs +1 -1
  18. package/dist/components/atoms/Chip/shared/utils.mjs +1 -1
  19. package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -1
  20. package/dist/components/atoms/Icon/Icon.mjs +1 -1
  21. package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs +14 -60
  22. package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +3 -2
  23. package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +3 -2
  24. package/dist/components/atoms/StatusBadge/StatusBadge.mjs +1 -1
  25. package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +1 -1
  26. package/dist/components/atoms/StatusLabel/StatusLabel.d.mts +5 -2
  27. package/dist/components/atoms/StatusLabel/StatusLabel.d.ts +5 -2
  28. package/dist/components/atoms/StatusLabel/StatusLabel.mjs +5 -2
  29. package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -1
  30. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +2 -2
  31. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +2 -2
  32. package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +19 -13
  33. package/dist/components/atoms/StatusLabel/StatusShape.d.mts +4 -0
  34. package/dist/components/atoms/StatusLabel/StatusShape.d.ts +4 -0
  35. package/dist/components/atoms/StatusLabel/StatusShape.mjs +31 -0
  36. package/dist/components/atoms/StatusLabel/StatusShape.mjs.map +1 -0
  37. package/dist/components/atoms/Typography/Typography.mjs +2 -2
  38. package/dist/components/molecules/AccountCard/AccountCard.mjs +22 -14
  39. package/dist/components/molecules/Alert/Alert.d.mts +4 -4
  40. package/dist/components/molecules/Alert/Alert.d.ts +4 -4
  41. package/dist/components/molecules/Alert/Alert.mjs +5 -4
  42. package/dist/components/molecules/CodeBlock/CodeBlock.mjs +1 -1
  43. package/dist/components/molecules/Dropdown/Dropdown.mjs +2 -2
  44. package/dist/components/molecules/InlineAlert/InlineAlert.mjs +15 -5
  45. package/dist/components/molecules/TabBar/TabBar.mjs +3 -3
  46. package/dist/components/molecules/TransactionListItem/TransactionListItem.d.mts +1 -1
  47. package/dist/components/molecules/TransactionListItem/TransactionListItem.d.ts +1 -1
  48. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +15 -31
  49. package/dist/data.js +514 -303
  50. package/dist/data.js.map +1 -1
  51. package/dist/lib/statusShapes.d.mts +2 -0
  52. package/dist/lib/statusShapes.d.ts +2 -0
  53. package/dist/lib/statusShapes.mjs +16 -0
  54. package/dist/lib/statusShapes.mjs.map +1 -0
  55. package/dist/lib/styleUtils.mjs +2 -2
  56. package/dist/lib/styleUtils.mjs.map +1 -1
  57. package/dist/lib/tokenAliases.d.mts +9 -0
  58. package/dist/lib/tokenAliases.d.ts +9 -0
  59. package/dist/lib/tokenAliases.mjs +50 -11
  60. package/dist/lib/tokenAliases.mjs.map +1 -1
  61. package/dist/styles/icons.json +141 -0
  62. package/dist/styles/icons.json.mjs +153 -2
  63. package/dist/styles/icons.json.mjs.map +1 -1
  64. package/dist/styles/tokens.d.mts +721 -123
  65. package/dist/styles/tokens.d.ts +721 -123
  66. package/dist/styles/tokens.json +362 -302
  67. package/dist/styles/tokens.json.mjs +362 -302
  68. package/dist/styles/tokens.json.mjs.map +1 -1
  69. package/dist/tokens/index.js +362 -302
  70. package/dist/tokens/index.js.map +1 -1
  71. package/dist/tokens/index.mjs +362 -302
  72. package/dist/tokens/index.mjs.map +1 -1
  73. package/dist/tokens/styles/tokens.d.mts +721 -123
  74. package/dist/tokens/styles/tokens.d.ts +721 -123
  75. package/dist/tokens.css +363 -317
  76. package/dist/types/icons.d.mts +1 -1
  77. package/dist/types/icons.d.ts +1 -1
  78. package/dist/types/icons.mjs.map +1 -1
  79. 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.emphasis, tokens.component.tabBar.scrollbar.height, semantic.surface.raised, semantic.color.border["default"], semantic.radius.sm);
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['accent-hover'] : semantic.color.text["default"];
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['accent-pressed'] : semantic.color.text["default"];
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, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
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, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
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 { Badge } from '../../atoms/Badge/Badge.mjs';
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: 'purple',
62
+ color: 'magenta',
61
63
  icon: 'paper',
62
64
  label: 'Shopping'
63
65
  },
64
66
  dining: {
65
- color: 'orange',
67
+ color: 'rose',
66
68
  icon: 'paper',
67
69
  label: 'Dining'
68
70
  },
69
71
  transport: {
70
- color: 'blue',
72
+ color: 'periwinkle',
71
73
  icon: 'paper',
72
74
  label: 'Transport'
73
75
  },
74
76
  entertainment: {
75
- color: 'pink',
77
+ color: 'olive',
76
78
  icon: 'star',
77
79
  label: 'Entertainment'
78
80
  },
79
81
  bills: {
80
- color: 'red',
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, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
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: status === 'pending' ? jsx(Badge, {
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 === 'failed' && jsx(Badge, {
179
- variant: "error",
180
- dot: true,
181
- "aria-label": "Failed transaction",
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,