@common-origin/design-system 2.21.0 → 2.22.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 (74) hide show
  1. package/dist/client.js +222 -206
  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/Button/Button.mjs +1 -1
  9. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +23 -8
  10. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +23 -8
  11. package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +31 -18
  12. package/dist/components/atoms/CategoryLabel/index.d.mts +1 -1
  13. package/dist/components/atoms/CategoryLabel/index.d.ts +1 -1
  14. package/dist/components/atoms/Chip/SuggestionChip.mjs +1 -1
  15. package/dist/components/atoms/Chip/shared/utils.mjs +1 -1
  16. package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -1
  17. package/dist/components/atoms/Icon/Icon.mjs +1 -1
  18. package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs +14 -60
  19. package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +3 -2
  20. package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +3 -2
  21. package/dist/components/atoms/StatusBadge/StatusBadge.mjs +1 -1
  22. package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +1 -1
  23. package/dist/components/atoms/StatusLabel/StatusLabel.d.mts +5 -2
  24. package/dist/components/atoms/StatusLabel/StatusLabel.d.ts +5 -2
  25. package/dist/components/atoms/StatusLabel/StatusLabel.mjs +5 -2
  26. package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -1
  27. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +2 -2
  28. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +2 -2
  29. package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +19 -13
  30. package/dist/components/atoms/StatusLabel/StatusShape.d.mts +4 -0
  31. package/dist/components/atoms/StatusLabel/StatusShape.d.ts +4 -0
  32. package/dist/components/atoms/StatusLabel/StatusShape.mjs +31 -0
  33. package/dist/components/atoms/StatusLabel/StatusShape.mjs.map +1 -0
  34. package/dist/components/atoms/Typography/Typography.mjs +2 -2
  35. package/dist/components/molecules/AccountCard/AccountCard.mjs +21 -13
  36. package/dist/components/molecules/Alert/Alert.d.mts +4 -4
  37. package/dist/components/molecules/Alert/Alert.d.ts +4 -4
  38. package/dist/components/molecules/Alert/Alert.mjs +5 -4
  39. package/dist/components/molecules/CodeBlock/CodeBlock.mjs +1 -1
  40. package/dist/components/molecules/Dropdown/Dropdown.mjs +2 -2
  41. package/dist/components/molecules/InlineAlert/InlineAlert.mjs +15 -5
  42. package/dist/components/molecules/TabBar/TabBar.mjs +3 -3
  43. package/dist/components/molecules/TransactionListItem/TransactionListItem.d.mts +1 -1
  44. package/dist/components/molecules/TransactionListItem/TransactionListItem.d.ts +1 -1
  45. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +15 -31
  46. package/dist/data.js +505 -295
  47. package/dist/data.js.map +1 -1
  48. package/dist/lib/statusShapes.d.mts +2 -0
  49. package/dist/lib/statusShapes.d.ts +2 -0
  50. package/dist/lib/statusShapes.mjs +16 -0
  51. package/dist/lib/statusShapes.mjs.map +1 -0
  52. package/dist/lib/styleUtils.mjs +2 -2
  53. package/dist/lib/styleUtils.mjs.map +1 -1
  54. package/dist/lib/tokenAliases.mjs +15 -10
  55. package/dist/lib/tokenAliases.mjs.map +1 -1
  56. package/dist/styles/icons.json +141 -0
  57. package/dist/styles/icons.json.mjs +153 -2
  58. package/dist/styles/icons.json.mjs.map +1 -1
  59. package/dist/styles/tokens.d.mts +412 -122
  60. package/dist/styles/tokens.d.ts +412 -122
  61. package/dist/styles/tokens.json +353 -294
  62. package/dist/styles/tokens.json.mjs +353 -294
  63. package/dist/styles/tokens.json.mjs.map +1 -1
  64. package/dist/tokens/index.js +353 -294
  65. package/dist/tokens/index.js.map +1 -1
  66. package/dist/tokens/index.mjs +353 -294
  67. package/dist/tokens/index.mjs.map +1 -1
  68. package/dist/tokens/styles/tokens.d.mts +412 -122
  69. package/dist/tokens/styles/tokens.d.ts +412 -122
  70. package/dist/tokens.css +257 -212
  71. package/dist/types/icons.d.mts +1 -1
  72. package/dist/types/icons.d.ts +1 -1
  73. package/dist/types/icons.mjs.map +1 -1
  74. package/package.json +1 -1
@@ -1,4 +1,13 @@
1
1
  import React from 'react';
2
+ /**
3
+ * Badge variants: `default` and `accent`, plus deprecated aliases of `accent` kept until 3.0.
4
+ */
5
+ export type BadgeVariant = 'default' | 'accent' | DeprecatedBadgeVariant;
6
+ /**
7
+ * Deprecated Badge variants, each rendered as `accent` until 3.0 (decisions 0029, 0045).
8
+ * @deprecated Use `accent`. For a count of items with a status, use StatusLabel.
9
+ */
10
+ export type DeprecatedBadgeVariant = 'primary' | 'error' | 'warning' | 'success';
2
11
  export interface BadgeProps {
3
12
  /** Content to wrap with the badge */
4
13
  children: React.ReactNode;
@@ -7,12 +16,15 @@ export interface BadgeProps {
7
16
  /** Maximum number to display before showing "99+" */
8
17
  max?: number;
9
18
  /**
10
- * Visual variant of the badge. `accent` is the blue highlight. `primary` is a deprecated alias
11
- * for `accent`, because Button's `primary` is near-black (decision 0029). It keeps working
12
- * until it is removed in 3.0.
19
+ * Visual variant of the badge. A badge means new or unread items (decision 0045): `accent` is
20
+ * the blue highlight, and `default` the near-black count. `primary` is a deprecated alias for
21
+ * `accent`, because Button's `primary` is near-black (decision 0029). `error`, `warning` and
22
+ * `success` are deprecated aliases for `accent`: a badge's colour alone can't carry a status, so
23
+ * a count of items with a status uses the status pattern instead ("3 failed" with StatusLabel).
24
+ * All four keep working until they are removed in 3.0.
13
25
  * @default 'default'
14
26
  */
15
- variant?: 'default' | 'accent' | 'primary' | 'error' | 'warning' | 'success';
27
+ variant?: BadgeVariant;
16
28
  /** Show only a dot indicator instead of count */
17
29
  dot?: boolean;
18
30
  /** Screen reader label for the badge */
@@ -1,4 +1,13 @@
1
1
  import React from 'react';
2
+ /**
3
+ * Badge variants: `default` and `accent`, plus deprecated aliases of `accent` kept until 3.0.
4
+ */
5
+ export type BadgeVariant = 'default' | 'accent' | DeprecatedBadgeVariant;
6
+ /**
7
+ * Deprecated Badge variants, each rendered as `accent` until 3.0 (decisions 0029, 0045).
8
+ * @deprecated Use `accent`. For a count of items with a status, use StatusLabel.
9
+ */
10
+ export type DeprecatedBadgeVariant = 'primary' | 'error' | 'warning' | 'success';
2
11
  export interface BadgeProps {
3
12
  /** Content to wrap with the badge */
4
13
  children: React.ReactNode;
@@ -7,12 +16,15 @@ export interface BadgeProps {
7
16
  /** Maximum number to display before showing "99+" */
8
17
  max?: number;
9
18
  /**
10
- * Visual variant of the badge. `accent` is the blue highlight. `primary` is a deprecated alias
11
- * for `accent`, because Button's `primary` is near-black (decision 0029). It keeps working
12
- * until it is removed in 3.0.
19
+ * Visual variant of the badge. A badge means new or unread items (decision 0045): `accent` is
20
+ * the blue highlight, and `default` the near-black count. `primary` is a deprecated alias for
21
+ * `accent`, because Button's `primary` is near-black (decision 0029). `error`, `warning` and
22
+ * `success` are deprecated aliases for `accent`: a badge's colour alone can't carry a status, so
23
+ * a count of items with a status uses the status pattern instead ("3 failed" with StatusLabel).
24
+ * All four keep working until they are removed in 3.0.
13
25
  * @default 'default'
14
26
  */
15
- variant?: 'default' | 'accent' | 'primary' | 'error' | 'warning' | 'success';
27
+ variant?: BadgeVariant;
16
28
  /** Show only a dot indicator instead of count */
17
29
  dot?: boolean;
18
30
  /** Screen reader label for the badge */
@@ -37,16 +37,15 @@ var BadgeIndicator = /*#__PURE__*/styled.span.withConfig({
37
37
  return props.$isDot ? "".concat(forcedColors, " { forced-color-adjust: none; background-color: CanvasText; }") : "".concat(forcedColors, " { border: ").concat(semantic.border.width.thin, " solid currentColor; }");
38
38
  }, function (props) {
39
39
  switch (props.$variant) {
40
+ // 'primary', 'error', 'warning' and 'success' are deprecated aliases for 'accent', removed in
41
+ // 3.0: 'primary' (#169), and the status colours, because a badge's colour alone can't carry a
42
+ // status (decision 0045, #263)
40
43
  case 'accent':
41
44
  case 'primary':
42
- // Deprecated alias for 'accent', removed in 3.0 (#169)
43
- return "\n background-color: ".concat(color.fill.accent, ";\n color: ").concat(color.text.inverse, ";\n ");
44
45
  case 'error':
45
- return "\n background-color: ".concat(color.fill.danger, ";\n color: ").concat(color.text.inverse, ";\n ");
46
46
  case 'warning':
47
- return "\n background-color: ".concat(color.fill.warning, ";\n color: ").concat(color.text.inverse, ";\n ");
48
47
  case 'success':
49
- return "\n background-color: ".concat(color.fill.success, ";\n color: ").concat(color.text.inverse, ";\n ");
48
+ return "\n background-color: ".concat(color.fill.accent, ";\n color: ").concat(color.text.inverse, ";\n ");
50
49
  default:
51
50
  return "\n background-color: ".concat(color.fill.emphasis, ";\n color: ").concat(color.text.inverse, ";\n ");
52
51
  }
@@ -1,2 +1,2 @@
1
1
  export { Badge } from './Badge.mjs';
2
- export type { BadgeProps } from './Badge.mjs';
2
+ export type { BadgeProps, BadgeVariant, DeprecatedBadgeVariant } from './Badge.mjs';
@@ -1,2 +1,2 @@
1
1
  export { Badge } from './Badge';
2
- export type { BadgeProps } from './Badge';
2
+ export type { BadgeProps, BadgeVariant, DeprecatedBadgeVariant } from './Badge';
@@ -78,7 +78,7 @@ var getSizeStyles = function getSizeStyles(_a) {
78
78
  var $size = _a.$size;
79
79
  switch ($size) {
80
80
  case 'small':
81
- return "\n font: ".concat(button.sizes.small.font, ";\n min-height: ").concat(control.sm, ";\n padding: 0 ").concat(inset.md, ";\n ");
81
+ return "\n font: ".concat(button.sizes.small.font, ";\n font-weight: ").concat(button.sizes.small.fontWeight, ";\n min-height: ").concat(control.sm, ";\n padding: 0 ").concat(inset.md, ";\n ");
82
82
  case 'medium':
83
83
  return "\n font: ".concat(button.sizes.medium.font, ";\n min-height: ").concat(control.md, ";\n padding: 0 ").concat(inset.lg, ";\n ");
84
84
  case 'large':
@@ -1,9 +1,22 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { IconName } from '../../../types/icons.mjs';
3
3
  /**
4
- * Category color options for CategoryLabel
4
+ * The category colours: four display colours with no meaning, and grey for "other" (decision 0043).
5
+ * They never mean status; for status use StatusLabel.
5
6
  */
6
- export type CategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange' | 'gray';
7
+ export type CategoryDisplayColor = 'olive' | 'periwinkle' | 'rose' | 'magenta' | 'gray';
8
+ /**
9
+ * Deprecated category colour names, each an alias of the nearest display colour until 3.0
10
+ * (decision 0043): blue is periwinkle; purple is magenta; pink, red and orange are rose; yellow and
11
+ * green are olive.
12
+ * @deprecated Use a CategoryDisplayColor: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'.
13
+ */
14
+ export type DeprecatedCategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange';
15
+ /**
16
+ * Category color options for CategoryLabel. The old hue names still work, as aliases of the
17
+ * nearest display colour, until 3.0.
18
+ */
19
+ export type CategoryColor = CategoryDisplayColor | DeprecatedCategoryColor;
7
20
  /**
8
21
  * Visual variant options for CategoryLabel
9
22
  */
@@ -21,8 +34,9 @@ export interface CategoryLabelProps {
21
34
  */
22
35
  children: ReactNode;
23
36
  /**
24
- * Color scheme for the label
25
- * @default 'blue'
37
+ * Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'. The old hue names are
38
+ * deprecated aliases (decision 0043).
39
+ * @default 'periwinkle'
26
40
  */
27
41
  color?: CategoryColor;
28
42
  /**
@@ -52,16 +66,17 @@ export interface CategoryLabelProps {
52
66
  /**
53
67
  * CategoryLabel colour-codes an item's category, such as a transaction's (decision 0018).
54
68
  *
55
- * A static, chip-like label with 8 category colours, 3 visual variants and an optional icon.
56
- * Category colours carry no status meaning; for status use StatusLabel.
69
+ * A static, chip-like label with 4 display colours plus grey, 3 visual variants and an optional
70
+ * icon. Category colours carry no meaning (decision 0043); for status use StatusLabel. Beyond five
71
+ * categories, the icon and text tell them apart.
57
72
  *
58
73
  * @example
59
74
  * ```tsx
60
- * <CategoryLabel color="orange" icon="creditCard">
75
+ * <CategoryLabel color="rose" icon="creditCard">
61
76
  * Shopping
62
77
  * </CategoryLabel>
63
78
  *
64
- * <CategoryLabel color="blue" variant="outlined" size="medium">
79
+ * <CategoryLabel color="periwinkle" variant="outlined" size="medium">
65
80
  * Travel
66
81
  * </CategoryLabel>
67
82
  * ```
@@ -1,9 +1,22 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { IconName } from '../../../types/icons';
3
3
  /**
4
- * Category color options for CategoryLabel
4
+ * The category colours: four display colours with no meaning, and grey for "other" (decision 0043).
5
+ * They never mean status; for status use StatusLabel.
5
6
  */
6
- export type CategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange' | 'gray';
7
+ export type CategoryDisplayColor = 'olive' | 'periwinkle' | 'rose' | 'magenta' | 'gray';
8
+ /**
9
+ * Deprecated category colour names, each an alias of the nearest display colour until 3.0
10
+ * (decision 0043): blue is periwinkle; purple is magenta; pink, red and orange are rose; yellow and
11
+ * green are olive.
12
+ * @deprecated Use a CategoryDisplayColor: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'.
13
+ */
14
+ export type DeprecatedCategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange';
15
+ /**
16
+ * Category color options for CategoryLabel. The old hue names still work, as aliases of the
17
+ * nearest display colour, until 3.0.
18
+ */
19
+ export type CategoryColor = CategoryDisplayColor | DeprecatedCategoryColor;
7
20
  /**
8
21
  * Visual variant options for CategoryLabel
9
22
  */
@@ -21,8 +34,9 @@ export interface CategoryLabelProps {
21
34
  */
22
35
  children: ReactNode;
23
36
  /**
24
- * Color scheme for the label
25
- * @default 'blue'
37
+ * Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'. The old hue names are
38
+ * deprecated aliases (decision 0043).
39
+ * @default 'periwinkle'
26
40
  */
27
41
  color?: CategoryColor;
28
42
  /**
@@ -52,16 +66,17 @@ export interface CategoryLabelProps {
52
66
  /**
53
67
  * CategoryLabel colour-codes an item's category, such as a transaction's (decision 0018).
54
68
  *
55
- * A static, chip-like label with 8 category colours, 3 visual variants and an optional icon.
56
- * Category colours carry no status meaning; for status use StatusLabel.
69
+ * A static, chip-like label with 4 display colours plus grey, 3 visual variants and an optional
70
+ * icon. Category colours carry no meaning (decision 0043); for status use StatusLabel. Beyond five
71
+ * categories, the icon and text tell them apart.
57
72
  *
58
73
  * @example
59
74
  * ```tsx
60
- * <CategoryLabel color="orange" icon="creditCard">
75
+ * <CategoryLabel color="rose" icon="creditCard">
61
76
  * Shopping
62
77
  * </CategoryLabel>
63
78
  *
64
- * <CategoryLabel color="blue" variant="outlined" size="medium">
79
+ * <CategoryLabel color="periwinkle" variant="outlined" size="medium">
65
80
  * Travel
66
81
  * </CategoryLabel>
67
82
  * ```
@@ -14,15 +14,26 @@ var category = color.category;
14
14
  var radius = semantic.radius;
15
15
  var space = semantic.space;
16
16
  var labelHeight = semantic.size.label;
17
- // Text on white or the -subtle fill (outlined and minimal), at least 4.5:1 (#115)
17
+ var displayColor = {
18
+ olive: 'olive',
19
+ periwinkle: 'periwinkle',
20
+ rose: 'rose',
21
+ magenta: 'magenta',
22
+ gray: 'gray',
23
+ blue: 'periwinkle',
24
+ purple: 'magenta',
25
+ pink: 'rose',
26
+ yellow: 'olive',
27
+ green: 'olive',
28
+ red: 'rose',
29
+ orange: 'rose'
30
+ };
31
+ // Text on white or the -muted fill (outlined and minimal), at least 4.5:1 (#115)
18
32
  var categoryText = {
19
- blue: category['blue-text'],
20
- purple: category['purple-text'],
21
- pink: category['pink-text'],
22
- yellow: category['yellow-text'],
23
- green: category['green-text'],
24
- red: category['red-text'],
25
- orange: category['orange-text'],
33
+ olive: category['olive-text'],
34
+ periwinkle: category['periwinkle-text'],
35
+ rose: category['rose-text'],
36
+ magenta: category['magenta-text'],
26
37
  gray: category['gray-text']
27
38
  };
28
39
  var StyledCategoryLabel = /*#__PURE__*/styled.span.withConfig({
@@ -82,16 +93,17 @@ var HiddenLabel = /*#__PURE__*/styled.span.withConfig({
82
93
  /**
83
94
  * CategoryLabel colour-codes an item's category, such as a transaction's (decision 0018).
84
95
  *
85
- * A static, chip-like label with 8 category colours, 3 visual variants and an optional icon.
86
- * Category colours carry no status meaning; for status use StatusLabel.
96
+ * A static, chip-like label with 4 display colours plus grey, 3 visual variants and an optional
97
+ * icon. Category colours carry no meaning (decision 0043); for status use StatusLabel. Beyond five
98
+ * categories, the icon and text tell them apart.
87
99
  *
88
100
  * @example
89
101
  * ```tsx
90
- * <CategoryLabel color="orange" icon="creditCard">
102
+ * <CategoryLabel color="rose" icon="creditCard">
91
103
  * Shopping
92
104
  * </CategoryLabel>
93
105
  *
94
- * <CategoryLabel color="blue" variant="outlined" size="medium">
106
+ * <CategoryLabel color="periwinkle" variant="outlined" size="medium">
95
107
  * Travel
96
108
  * </CategoryLabel>
97
109
  * ```
@@ -99,16 +111,17 @@ var HiddenLabel = /*#__PURE__*/styled.span.withConfig({
99
111
  /**
100
112
  * CategoryLabel colour-codes an item's category, such as a transaction's (decision 0018).
101
113
  *
102
- * A static, chip-like label with 8 category colours, 3 visual variants and an optional icon.
103
- * Category colours carry no status meaning; for status use StatusLabel.
114
+ * A static, chip-like label with 4 display colours plus grey, 3 visual variants and an optional
115
+ * icon. Category colours carry no meaning (decision 0043); for status use StatusLabel. Beyond five
116
+ * categories, the icon and text tell them apart.
104
117
  *
105
118
  * @example
106
119
  * ```tsx
107
- * <CategoryLabel color="orange" icon="creditCard">
120
+ * <CategoryLabel color="rose" icon="creditCard">
108
121
  * Shopping
109
122
  * </CategoryLabel>
110
123
  *
111
- * <CategoryLabel color="blue" variant="outlined" size="medium">
124
+ * <CategoryLabel color="periwinkle" variant="outlined" size="medium">
112
125
  * Travel
113
126
  * </CategoryLabel>
114
127
  * ```
@@ -116,7 +129,7 @@ var HiddenLabel = /*#__PURE__*/styled.span.withConfig({
116
129
  var CategoryLabel = function CategoryLabel(_a) {
117
130
  var children = _a.children,
118
131
  _b = _a.color,
119
- color = _b === void 0 ? 'blue' : _b,
132
+ color = _b === void 0 ? 'periwinkle' : _b,
120
133
  _c = _a.variant,
121
134
  variant = _c === void 0 ? 'filled' : _c,
122
135
  _d = _a.size,
@@ -128,7 +141,7 @@ var CategoryLabel = function CategoryLabel(_a) {
128
141
  // A blank aria-label is no label at all, so it falls back like a missing one
129
142
  var accessibleLabel = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) ? ariaLabel : undefined;
130
143
  return jsxs(StyledCategoryLabel, {
131
- "$color": color,
144
+ "$color": displayColor[color],
132
145
  "$variant": variant,
133
146
  "$size": size,
134
147
  "data-testid": dataTestId,
@@ -1,2 +1,2 @@
1
1
  export { CategoryLabel } from './CategoryLabel.mjs';
2
- export type { CategoryLabelProps, CategoryColor, CategoryVariant, CategoryLabelSize } from './CategoryLabel.mjs';
2
+ export type { CategoryLabelProps, CategoryColor, CategoryDisplayColor, CategoryVariant, CategoryLabelSize } from './CategoryLabel.mjs';
@@ -1,2 +1,2 @@
1
1
  export { CategoryLabel } from './CategoryLabel';
2
- export type { CategoryLabelProps, CategoryColor, CategoryVariant, CategoryLabelSize } from './CategoryLabel';
2
+ export type { CategoryLabelProps, CategoryColor, CategoryDisplayColor, CategoryVariant, CategoryLabelSize } from './CategoryLabel';
@@ -27,7 +27,7 @@ var StyledSuggestionChip = /*#__PURE__*/styled.button.withConfig({
27
27
  * - A native button: Enter and Space pick it, and its text is its accessible name
28
28
  * - Outlined, with the naked hover and pressed fills; no selected state
29
29
  * - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
30
- */])), semantic.border.width.thin, color.border.input, chip["default"].borderRadius, color.fill.none, color.text["default"], semantic.motion.transition.feedback, sizeStyles, color.fill['none-hover'], color.fill['none-pressed'], chip.focus.outline, semantic.border.focusOffset, color.border.emphasis, color.text.disabled, forcedColors);
30
+ */])), semantic.border.width.thin, color.border.input, chip["default"].borderRadius, color.fill.none, color.text["default"], semantic.motion.transition.feedback, sizeStyles, color.fill['none-hover'], color.fill['none-pressed'], chip.focus.outline, semantic.border.focusOffset, color.border["default"], color.text.disabled, forcedColors);
31
31
  /**
32
32
  * SuggestionChip - Offers text to put in the agent input
33
33
  *
@@ -23,7 +23,7 @@ var getVariantStyles = function getVariantStyles(_a) {
23
23
  fill = _b.fill,
24
24
  text = _b.text;
25
25
  var interactiveStates = $clickable;
26
- return "\n background-color: ".concat(fill['accent-muted'], ";\n color: ").concat(text.accent, ";\n \n &:hover {\n background-color: ").concat(interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text['accent-hover'] : text.accent, ";\n }\n \n &:active {\n background-color: ").concat(interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text['accent-pressed'] : text.accent, ";\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ").concat(forcedColors, " {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n ");
26
+ return "\n background-color: ".concat(fill['accent-muted'], ";\n color: ").concat(text.accent, ";\n \n &:hover {\n background-color: ").concat(interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text.accent : text.accent, ";\n }\n \n &:active {\n background-color: ").concat(interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text.accent : text.accent, ";\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ").concat(forcedColors, " {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n ");
27
27
  }
28
28
  switch ($variant) {
29
29
  case 'emphasis':
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../../../src/components/atoms/Chip/shared/utils.ts"],"sourcesContent":["import tokens from '../../../../lib/cssTokens'\nimport { forcedColors } from '../../../../lib/styleUtils'\nimport { ChipVariant } from './types'\n\nconst { component: { chip }, semantic } = tokens\n\ninterface StyledChipProps {\n $variant: ChipVariant\n $disabled?: boolean\n $clickable?: boolean\n $selected?: boolean\n}\n\n// Helper function to get variant styles matching Button's approach\nexport const getVariantStyles = ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => {\n // Selected filter and input chips use the light-blue selected treatment (decision 0016).\n // The text darkens with the fill so every state stays at least 4.5:1.\n if ($selected) {\n // A selected disabled chip looks like any disabled chip; the checkmark keeps the\n // selected state visible (#110)\n if ($disabled) {\n const { disabled } = chip.variants.subtle\n return `\n background-color: ${disabled.backgroundColor};\n color: ${disabled.textColor};\n `\n }\n\n const { fill, text } = tokens.semantic.color\n const interactiveStates = $clickable\n return `\n background-color: ${fill['accent-muted']};\n color: ${text.accent};\n \n &:hover {\n background-color: ${interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted']};\n color: ${interactiveStates ? text['accent-hover'] : text.accent};\n }\n \n &:active {\n background-color: ${interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted']};\n color: ${interactiveStates ? text['accent-pressed'] : text.accent};\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ${forcedColors} {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n `\n }\n \n switch ($variant) {\n case 'emphasis':\n return `\n background-color: ${chip.variants.emphasis.backgroundColor};\n color: ${chip.variants.emphasis.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.emphasis.disabled.backgroundColor};\n color: ${chip.variants.emphasis.disabled.textColor};\n ` : ''}\n `\n case 'subtle':\n return `\n background-color: ${chip.variants.subtle.backgroundColor};\n color: ${chip.variants.subtle.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.subtle.disabled.backgroundColor};\n color: ${chip.variants.subtle.disabled.textColor};\n ` : ''}\n `\n case 'interactive':\n return `\n background-color: ${chip.variants.interactive.backgroundColor};\n color: ${chip.variants.interactive.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.interactive.disabled.backgroundColor};\n color: ${chip.variants.interactive.disabled.textColor};\n ` : ''}\n `\n case 'default':\n default:\n return `\n background-color: ${chip.default.backgroundColor};\n color: ${chip.default.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.hover.backgroundColor : chip.default.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.active.backgroundColor : chip.default.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.disabled.backgroundColor};\n color: ${chip.disabled.textColor};\n ` : ''}\n `\n }\n}\n\n// Chips have one size: 24px from the label scale as a minimum, with the content centred\n// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the\n// semantic spacing scale (decision 0022).\nexport const sizeStyles = `\n font: ${chip.sizes.medium.font};\n min-height: ${semantic.size.label.medium};\n padding: 0 ${semantic.space.inset.sm};\n`\n\n"],"names":["chip","tokens","component","semantic","getVariantStyles","_a","$variant","$selected","$clickable","$disabled","disabled","variants","subtle","concat","backgroundColor","textColor","_b","color","fill","text","interactiveStates","accent","forcedColors","emphasis","hover","active","interactive","sizeStyles","sizes","medium","font","size","label","space","inset","sm"],"mappings":";;;;AAIqB,IAAAA,IAAI,GAAiBC,MAAM,CAAAC,SAAA,CAAAF,IAAvB;EAAIG,QAAQ,GAAKF,MAAM,CAAAE,QAAX,CAAA;AASrC;IACaC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,EAA+D,EAAA;MAA7DC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IAAEC,SAAS,GAAAF,EAAA,CAAAE,SAAA;IAAEC,UAAU,GAAAH,EAAA,CAAAG,UAAA;IAAEC,SAAS,GAAAJ,EAAA,CAAAI,SAAA,CAAA;AAC3E;AACA;AACA,EAAA,IAAIF,SAAS,EAAE;AACb;AACA;AACA,IAAA,IAAIE,SAAS,EAAE;MACL,IAAAC,QAAQ,GAAKV,IAAI,CAACW,QAAQ,CAACC,MAAM,SAAzB,CAAA;AAChB,MAAA,OAAO,8BAAA,CAAAC,MAAA,CACeH,QAAQ,CAACI,eAAe,+BACnCJ,QAAQ,CAACK,SAAS,EAAA,WAAA,CAC5B,CAAA;AACH,KAAA;AAEM,IAAA,IAAAC,EAAiB,GAAAf,MAAM,CAACE,QAAQ,CAACc,KAAK;MAApCC,IAAI,GAAAF,EAAA,CAAAE,IAAA;MAAEC,IAAI,GAAAH,EAAA,CAAAG,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,CACvCb,IAAI,CAAA,SAAA,CAAQ,CAACe,SAAS,EAAA,8DAAA,CAAA,CAAAF,MAAA,CAGTJ,SAAS,GAAGT,IAAI,CAACU,QAAQ,CAACI,eAAe,GAAIN,UAAU,GAAGR,IAAI,CAACwB,KAAK,CAACV,eAAe,GAAGd,IAAI,CAAQ,SAAA,CAAA,CAACc,eAAgB,EAAA,0EAAA,CAAA,CAAAD,MAAA,CAIpHJ,SAAS,GAAGT,IAAI,CAACU,QAAQ,CAACI,eAAe,GAAIN,UAAU,GAAGR,IAAI,CAACyB,MAAM,CAACX,eAAe,GAAGd,IAAI,CAAA,SAAA,CAAQ,CAACc,eAAgB,EAGzI,kCAAA,CAAA,CAAAD,MAAA,CAAAJ,SAAS,GAAG,wCACQT,IAAI,CAACU,QAAQ,CAACI,eAAe,EAAA,sBAAA,CAAA,CAAAD,MAAA,CACxCb,IAAI,CAACU,QAAQ,CAACK,SAAS,EAAA,aAAA,CACjC,GAAG,EAAE,EAAA,UAAA,CACP,CAAA;AACL,GAAA;AACF,EAAC;AAED;AACA;AACA;IACaY,UAAU,GAAG,YAChB,CAAAd,MAAA,CAAAb,IAAI,CAAC4B,KAAK,CAACC,MAAM,CAACC,IAAI,EAChB,mBAAA,CAAA,CAAAjB,MAAA,CAAAV,QAAQ,CAAC4B,IAAI,CAACC,KAAK,CAACH,MAAM,EAC3B,kBAAA,CAAA,CAAAhB,MAAA,CAAAV,QAAQ,CAAC8B,KAAK,CAACC,KAAK,CAACC,EAAE;;;;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../../src/components/atoms/Chip/shared/utils.ts"],"sourcesContent":["import tokens from '../../../../lib/cssTokens'\nimport { forcedColors } from '../../../../lib/styleUtils'\nimport { ChipVariant } from './types'\n\nconst { component: { chip }, semantic } = tokens\n\ninterface StyledChipProps {\n $variant: ChipVariant\n $disabled?: boolean\n $clickable?: boolean\n $selected?: boolean\n}\n\n// Helper function to get variant styles matching Button's approach\nexport const getVariantStyles = ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => {\n // Selected filter and input chips use the light-blue selected treatment (decision 0016).\n // The text darkens with the fill so every state stays at least 4.5:1.\n if ($selected) {\n // A selected disabled chip looks like any disabled chip; the checkmark keeps the\n // selected state visible (#110)\n if ($disabled) {\n const { disabled } = chip.variants.subtle\n return `\n background-color: ${disabled.backgroundColor};\n color: ${disabled.textColor};\n `\n }\n\n const { fill, text } = tokens.semantic.color\n const interactiveStates = $clickable\n return `\n background-color: ${fill['accent-muted']};\n color: ${text.accent};\n \n &:hover {\n background-color: ${interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n \n &:active {\n background-color: ${interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ${forcedColors} {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n `\n }\n \n switch ($variant) {\n case 'emphasis':\n return `\n background-color: ${chip.variants.emphasis.backgroundColor};\n color: ${chip.variants.emphasis.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.emphasis.disabled.backgroundColor};\n color: ${chip.variants.emphasis.disabled.textColor};\n ` : ''}\n `\n case 'subtle':\n return `\n background-color: ${chip.variants.subtle.backgroundColor};\n color: ${chip.variants.subtle.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.subtle.disabled.backgroundColor};\n color: ${chip.variants.subtle.disabled.textColor};\n ` : ''}\n `\n case 'interactive':\n return `\n background-color: ${chip.variants.interactive.backgroundColor};\n color: ${chip.variants.interactive.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.interactive.disabled.backgroundColor};\n color: ${chip.variants.interactive.disabled.textColor};\n ` : ''}\n `\n case 'default':\n default:\n return `\n background-color: ${chip.default.backgroundColor};\n color: ${chip.default.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.hover.backgroundColor : chip.default.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.active.backgroundColor : chip.default.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.disabled.backgroundColor};\n color: ${chip.disabled.textColor};\n ` : ''}\n `\n }\n}\n\n// Chips have one size: 24px from the label scale as a minimum, with the content centred\n// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the\n// semantic spacing scale (decision 0022).\nexport const sizeStyles = `\n font: ${chip.sizes.medium.font};\n min-height: ${semantic.size.label.medium};\n padding: 0 ${semantic.space.inset.sm};\n`\n\n"],"names":["chip","tokens","component","semantic","getVariantStyles","_a","$variant","$selected","$clickable","$disabled","disabled","variants","subtle","concat","backgroundColor","textColor","_b","color","fill","text","interactiveStates","accent","forcedColors","emphasis","hover","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A,CAAA,CAAAD,MAAA,CAAAJ,SAAS,GAAG,wCACQT,IAAI,CAACU,QAAQ,CAACI,eAAe,EAAA,sBAAA,CAAA,CAAAD,MAAA,CACxCb,IAAI,CAACU,QAAQ,CAACK,SAAS,EAAA,aAAA,CACjC,GAAG,EAAE,EAAA,UAAA,CACP,CAAA;AACL,GAAA;AACF,EAAC;AAED;AACA;AACA;IACaY,UAAU,GAAG,YAChB,CAAAd,MAAA,CAAAb,IAAI,CAAC4B,KAAK,CAACC,MAAM,CAACC,IAAI,EAChB,mBAAA,CAAA,CAAAjB,MAAA,CAAAV,QAAQ,CAAC4B,IAAI,CAACC,KAAK,CAACH,MAAM,EAC3B,kBAAA,CAAA,CAAAhB,MAAA,CAAAV,QAAQ,CAAC8B,KAAK,CAACC,KAAK,CAACC,EAAE;;;;"}
@@ -24,7 +24,7 @@ var IconStyled = /*#__PURE__*/styled.span.withConfig({
24
24
  case 'default':
25
25
  return tokens.semantic.color.icon["default"];
26
26
  case 'emphasis':
27
- return tokens.semantic.color.icon.emphasis;
27
+ return tokens.semantic.color.icon["default"];
28
28
  case 'subdued':
29
29
  return tokens.semantic.color.icon.muted;
30
30
  case 'disabled':
@@ -1,10 +1,9 @@
1
1
  'use client';
2
2
  import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
3
- import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import styled$module from 'styled-components';
5
5
  const styled = styled$module.default || styled$module;
6
6
  import { Typography } from '../Typography/Typography.mjs';
7
- import { Icon } from '../Icon/Icon.mjs';
8
7
  import tokens from '../../../lib/cssTokens.mjs';
9
8
 
10
9
  var StyledWrapper = /*#__PURE__*/styled.span.withConfig({
@@ -13,7 +12,7 @@ var StyledWrapper = /*#__PURE__*/styled.span.withConfig({
13
12
  },
14
13
  displayName: "MoneyDisplay__StyledWrapper",
15
14
  componentId: "sc-1mddej3-0"
16
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"
15
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n text-align: ", ";\n font-weight: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n text-align: ", ";\n font-weight: ", ";\n"
17
16
  // Map size to Typography variant
18
17
  ])), function (_a) {
19
18
  var $align = _a.$align;
@@ -29,35 +28,8 @@ var sizeToTypographyVariant = {
29
28
  large: 'h3',
30
29
  xlarge: 'h2'
31
30
  };
32
- // Map size to Icon size for consistent visual alignment
33
- var sizeToIconSize = {
34
- small: 'xs',
35
- medium: 'sm',
36
- large: 'md',
37
- xlarge: 'lg'
38
- };
39
- /**
40
- * Generates aria-label with spelled out amount
41
- */
42
- var generateAriaLabel = function generateAriaLabel(amount, currency, locale) {
43
- var _a, _b;
44
- var formatter = new Intl.NumberFormat(locale, {
45
- style: 'currency',
46
- currency: currency,
47
- minimumFractionDigits: 2,
48
- maximumFractionDigits: 2
49
- });
50
- // Get parts to spell out the amount
51
- var parts = formatter.formatToParts(Math.abs(amount));
52
- var integerPart = ((_a = parts.find(function (p) {
53
- return p.type === 'integer';
54
- })) === null || _a === void 0 ? void 0 : _a.value) || '0';
55
- var fractionPart = ((_b = parts.find(function (p) {
56
- return p.type === 'fraction';
57
- })) === null || _b === void 0 ? void 0 : _b.value) || '00';
58
- var sign = amount < 0 ? 'negative ' : '';
59
- return "".concat(sign).concat(integerPart, " dollars and ").concat(fractionPart, " cents");
60
- };
31
+ // The minus sign, not a hyphen, so it reads and copies as minus (decision 0045)
32
+ var MINUS = "\u2212";
61
33
  var MoneyDisplay = function MoneyDisplay(_a) {
62
34
  var amount = _a.amount,
63
35
  _b = _a.currency,
@@ -83,41 +55,23 @@ var MoneyDisplay = function MoneyDisplay(_a) {
83
55
  maximumFractionDigits: 2
84
56
  });
85
57
  var formattedAmount = formatter.format(Math.abs(amount));
86
- // Determine if we need to show a sign icon
87
- var showPositiveIcon = showSign && amount > 0 || variant === 'positive';
88
- var showNegativeIcon = amount < 0 || variant === 'negative';
89
- // Generate accessibility label
90
- var ariaLabel = generateAriaLabel(amount, currency, locale);
91
- // Get typography variant and icon size
58
+ // A signed amount carries its sign as text, so the sign survives copying and is read aloud, and the
59
+ // role colour repeats it (decision 0045). Negative amounts always show their sign.
60
+ var isNegative = amount < 0 || variant === 'negative';
61
+ var isPositive = !isNegative && (showSign && amount > 0 || variant === 'positive');
62
+ var sign = isNegative ? MINUS : isPositive ? '+' : '';
92
63
  var typographyVariant = sizeToTypographyVariant[size];
93
- var iconSize = sizeToIconSize[size];
94
- // Determine icon color based on variant
95
- var iconColor = variant === 'positive' || showPositiveIcon ? 'success' : variant === 'negative' || showNegativeIcon ? 'error' : variant === 'neutral' ? 'subdued' : 'default';
96
- // Amount always uses default color (except neutral which stays subdued)
97
- var amountColor = variant === 'neutral' ? 'subdued' : 'default';
98
- return jsxs(StyledWrapper, {
64
+ var amountColor = isNegative ? 'error' : isPositive ? 'success' : variant === 'neutral' ? 'subdued' : 'default';
65
+ return jsx(StyledWrapper, {
99
66
  "$align": align,
100
67
  "$weight": weight,
101
- "aria-label": ariaLabel,
102
68
  "data-testid": dataTestId,
103
- children: [showPositiveIcon && !showNegativeIcon &&
104
- // The amount is shown without a sign, so the icon is the sign and needs a name (#85)
105
- jsx(Icon, {
106
- name: "addRing",
107
- size: iconSize,
108
- iconColor: iconColor,
109
- "aria-label": "Plus"
110
- }), showNegativeIcon && jsx(Icon, {
111
- name: "remove",
112
- size: iconSize,
113
- iconColor: iconColor,
114
- "aria-label": "Minus"
115
- }), jsx(Typography, {
69
+ children: jsxs(Typography, {
116
70
  variant: typographyVariant,
117
71
  color: amountColor,
118
72
  as: "span",
119
- children: formattedAmount
120
- })]
73
+ children: [sign, formattedAmount]
74
+ })
121
75
  });
122
76
  };
123
77
  var templateObject_1;
@@ -10,7 +10,8 @@ export interface StatusBadgeProps extends StatusLabelProps {
10
10
  /**
11
11
  * Whether to show the icon
12
12
  * @default true
13
- * @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.
13
+ * @deprecated StatusLabel always shows its status icon or shape with the text, so status is
14
+ * never conveyed by colour alone (decision 0045).
14
15
  */
15
16
  showIcon?: boolean;
16
17
  }
@@ -18,6 +19,6 @@ export interface StatusBadgeProps extends StatusLabelProps {
18
19
  * StatusBadge displays a transaction or task status.
19
20
  *
20
21
  * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
21
- * shows the icon. StatusBadge is removed in 3.0 (decision 0018).
22
+ * shows its status icon or shape. StatusBadge is removed in 3.0 (decision 0018).
22
23
  */
23
24
  export declare const StatusBadge: React.FC<StatusBadgeProps>;
@@ -10,7 +10,8 @@ export interface StatusBadgeProps extends StatusLabelProps {
10
10
  /**
11
11
  * Whether to show the icon
12
12
  * @default true
13
- * @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.
13
+ * @deprecated StatusLabel always shows its status icon or shape with the text, so status is
14
+ * never conveyed by colour alone (decision 0045).
14
15
  */
15
16
  showIcon?: boolean;
16
17
  }
@@ -18,6 +19,6 @@ export interface StatusBadgeProps extends StatusLabelProps {
18
19
  * StatusBadge displays a transaction or task status.
19
20
  *
20
21
  * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
21
- * shows the icon. StatusBadge is removed in 3.0 (decision 0018).
22
+ * shows its status icon or shape. StatusBadge is removed in 3.0 (decision 0018).
22
23
  */
23
24
  export declare const StatusBadge: React.FC<StatusBadgeProps>;
@@ -7,7 +7,7 @@ import { StatusLabelBase } from '../StatusLabel/StatusLabelBase.mjs';
7
7
  * StatusBadge displays a transaction or task status.
8
8
  *
9
9
  * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
10
- * shows the icon. StatusBadge is removed in 3.0 (decision 0018).
10
+ * shows its status icon or shape. StatusBadge is removed in 3.0 (decision 0018).
11
11
  */
12
12
  var StatusBadge = function StatusBadge(props) {
13
13
  return jsx(StatusLabelBase, __assign({}, props));
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.mjs","sources":["../../../../src/components/atoms/StatusBadge/StatusBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from '../StatusLabel/StatusLabelBase'\n\nexport type { StatusType, StatusSize } from '../StatusLabel/StatusLabelBase'\n\n/**\n * Props for the StatusBadge component\n * @deprecated Use `StatusLabelProps`. StatusBadge is renamed StatusLabel and is removed in 3.0\n * (decision 0018).\n */\nexport interface StatusBadgeProps extends StatusLabelProps {\n /**\n * Whether to show the icon\n * @default true\n * @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.\n */\n showIcon?: boolean\n}\n\n/**\n * StatusBadge displays a transaction or task status.\n *\n * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always\n * shows the icon. StatusBadge is removed in 3.0 (decision 0018).\n */\nexport const StatusBadge: React.FC<StatusBadgeProps> = (props) => <StatusLabelBase {...props} />\n\nStatusBadge.displayName = 'StatusBadge'\n"],"names":["StatusBadge","props","_jsx","StatusLabelBase","__assign","displayName"],"mappings":";;;;;AAmBA;;;;;AAKG;IACUA,WAAW,GAA+B,SAA1CA,WAAWA,CAAgCC,KAAK,EAAA;EAAK,OAAAC,GAAA,CAACC,eAAe,EAAKC,QAAA,CAAA,EAAA,EAAAH,KAAK,CAAI,CAAA,CAAA;AAA9B,EAA8B;AAEhGD,WAAW,CAACK,WAAW,GAAG,aAAa;;;;"}
1
+ {"version":3,"file":"StatusBadge.mjs","sources":["../../../../src/components/atoms/StatusBadge/StatusBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from '../StatusLabel/StatusLabelBase'\n\nexport type { StatusType, StatusSize } from '../StatusLabel/StatusLabelBase'\n\n/**\n * Props for the StatusBadge component\n * @deprecated Use `StatusLabelProps`. StatusBadge is renamed StatusLabel and is removed in 3.0\n * (decision 0018).\n */\nexport interface StatusBadgeProps extends StatusLabelProps {\n /**\n * Whether to show the icon\n * @default true\n * @deprecated StatusLabel always shows its status icon or shape with the text, so status is\n * never conveyed by colour alone (decision 0045).\n */\n showIcon?: boolean\n}\n\n/**\n * StatusBadge displays a transaction or task status.\n *\n * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always\n * shows its status icon or shape. StatusBadge is removed in 3.0 (decision 0018).\n */\nexport const StatusBadge: React.FC<StatusBadgeProps> = (props) => <StatusLabelBase {...props} />\n\nStatusBadge.displayName = 'StatusBadge'\n"],"names":["StatusBadge","props","_jsx","StatusLabelBase","__assign","displayName"],"mappings":";;;;;AAoBA;;;;;AAKG;IACUA,WAAW,GAA+B,SAA1CA,WAAWA,CAAgCC,KAAK,EAAA;EAAK,OAAAC,GAAA,CAACC,eAAe,EAAKC,QAAA,CAAA,EAAA,EAAAH,KAAK,CAAI,CAAA,CAAA;AAA9B,EAA8B;AAEhGD,WAAW,CAACK,WAAW,GAAG,aAAa;;;;"}
@@ -4,8 +4,11 @@ export type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase
4
4
  /**
5
5
  * StatusLabel conveys the status of something, such as a transaction or task (decision 0018).
6
6
  *
7
- * Uses only the status colour tokens and always shows an icon with its text, so status is never
8
- * conveyed by colour alone. Not interactive. Announces changes politely to screen readers.
7
+ * Uses only the status colour tokens and always shows its text, so status is never conveyed by
8
+ * colour alone (decision 0045). Medium shows the status icon. Small shows the status shape for
9
+ * completed, failed and processing, and text only for the neutral pending, scheduled and
10
+ * cancelled, so keep the label visible. Not interactive. Announces changes politely to screen
11
+ * readers.
9
12
  *
10
13
  * @example
11
14
  * ```tsx