@transferwise/components 46.100.1 → 46.101.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 (190) hide show
  1. package/build/avatarLayout/AvatarLayout.js +1 -1
  2. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  3. package/build/avatarLayout/AvatarLayout.mjs +1 -1
  4. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  5. package/build/dateLookup/DateLookup.js +3 -2
  6. package/build/dateLookup/DateLookup.js.map +1 -1
  7. package/build/dateLookup/DateLookup.mjs +3 -2
  8. package/build/dateLookup/DateLookup.mjs.map +1 -1
  9. package/build/i18n/en.json +2 -0
  10. package/build/i18n/en.json.js +2 -0
  11. package/build/i18n/en.json.js.map +1 -1
  12. package/build/i18n/en.json.mjs +2 -0
  13. package/build/i18n/en.json.mjs.map +1 -1
  14. package/build/main.css +4 -94
  15. package/build/styles/accordion/Accordion.css +27 -16
  16. package/build/styles/avatar/Avatar.css +95 -50
  17. package/build/styles/inputs/Input.css +37 -21
  18. package/build/styles/inputs/TextArea.css +35 -20
  19. package/build/styles/loader/Loader.css +4 -90
  20. package/build/styles/main.css +4 -94
  21. package/build/styles/popover/Popover.css +19 -12
  22. package/build/styles/select/Select.css +131 -68
  23. package/build/styles/switch/Switch.css +27 -16
  24. package/build/styles/tile/Tile.css +31 -18
  25. package/build/types/dateLookup/DateLookup.d.ts +2 -2
  26. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  27. package/build/types/test-utils/index.d.ts +4 -0
  28. package/build/types/test-utils/index.d.ts.map +1 -1
  29. package/build/types/test-utils/story-config.d.ts +2 -3
  30. package/build/types/test-utils/story-config.d.ts.map +1 -1
  31. package/build/types/upload/Upload.d.ts +6 -2
  32. package/build/types/upload/Upload.d.ts.map +1 -1
  33. package/build/types/upload/Upload.messages.d.ts +8 -0
  34. package/build/types/upload/Upload.messages.d.ts.map +1 -1
  35. package/build/types/uploadInput/UploadInput.d.ts +1 -1
  36. package/build/types/uploadInput/uploadButton/UploadButton.d.ts +4 -2
  37. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  38. package/build/upload/Upload.js +16 -9
  39. package/build/upload/Upload.js.map +1 -1
  40. package/build/upload/Upload.messages.js +6 -0
  41. package/build/upload/Upload.messages.js.map +1 -1
  42. package/build/upload/Upload.messages.mjs +6 -0
  43. package/build/upload/Upload.messages.mjs.map +1 -1
  44. package/build/upload/Upload.mjs +16 -9
  45. package/build/upload/Upload.mjs.map +1 -1
  46. package/build/uploadInput/UploadInput.js +1 -1
  47. package/build/uploadInput/UploadInput.js.map +1 -1
  48. package/build/uploadInput/UploadInput.mjs +1 -1
  49. package/build/uploadInput/UploadInput.mjs.map +1 -1
  50. package/build/uploadInput/uploadButton/UploadButton.js +7 -4
  51. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  52. package/build/uploadInput/uploadButton/UploadButton.mjs +7 -4
  53. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  54. package/package.json +19 -27
  55. package/src/accordion/Accordion.css +27 -16
  56. package/src/accordion/Accordion.story.tsx +1 -1
  57. package/src/actionButton/ActionButton.story.tsx +3 -2
  58. package/src/actionOption/ActionOption.story.tsx +2 -2
  59. package/src/alert/Alert.story.tsx +2 -2
  60. package/src/alert/Alert.tests.story.tsx +2 -2
  61. package/src/avatar/Avatar.css +95 -50
  62. package/src/avatar/Avatar.spec.tsx +1 -1
  63. package/src/avatar/Avatar.story.tsx +3 -2
  64. package/src/avatarLayout/AvatarLayout.story.tsx +1 -1
  65. package/src/avatarLayout/AvatarLayout.tsx +1 -1
  66. package/src/avatarView/AvatarView.story.tsx +1 -1
  67. package/src/avatarWrapper/AvatarWrapper.story.tsx +3 -2
  68. package/src/badge/Badge.story.tsx +49 -28
  69. package/src/button/Button.accessibility.docs.mdx +1 -1
  70. package/src/button/Button.story.tsx +2 -2
  71. package/src/button/Button.tests.story.tsx +2 -2
  72. package/src/button/LegacyButton.story.tsx +3 -2
  73. package/src/card/Card.story.tsx +2 -2
  74. package/src/carousel/Carousel.story.tsx +1 -1
  75. package/src/checkbox/Checkbox.story.tsx +2 -2
  76. package/src/checkboxButton/CheckboxButton.story.tsx +2 -2
  77. package/src/checkboxOption/CheckboxOption.story.tsx +35 -29
  78. package/src/chevron/Chevron.story.tsx +1 -1
  79. package/src/chips/Chips.story.tsx +1 -1
  80. package/src/circularButton/CircularButton.story.tsx +1 -1
  81. package/src/circularButton/CircularButton.tests.story.tsx +1 -1
  82. package/src/common/bottomSheet/BottomSheet.story.tsx +2 -2
  83. package/src/common/card/Card.story.tsx +1 -1
  84. package/src/common/circle/Circle.story.tsx +2 -2
  85. package/src/common/locale/index.spec.ts +28 -16
  86. package/src/common/responsivePanel/ResponsivePanel.spec.js +8 -29
  87. package/src/criticalBanner/CriticalCommsBanner.story.tsx +1 -1
  88. package/src/dateInput/DateInput.story.tsx +2 -2
  89. package/src/dateInput/DateInput.tests.story.tsx +2 -2
  90. package/src/dateLookup/DateLookup.spec.tsx +5 -5
  91. package/src/dateLookup/DateLookup.story.tsx +43 -71
  92. package/src/dateLookup/DateLookup.tests.story.tsx +3 -3
  93. package/src/dateLookup/DateLookup.tsx +4 -1
  94. package/src/decision/Decision.story.tsx +24 -49
  95. package/src/definitionList/DefinitionList.story.tsx +1 -1
  96. package/src/dimmer/Dimmer.story.tsx +2 -2
  97. package/src/divider/Divider.accessibility.docs.mdx +1 -1
  98. package/src/divider/Divider.story.tsx +1 -1
  99. package/src/drawer/Drawer.story.tsx +13 -7
  100. package/src/dropFade/DropFade.story.tsx +1 -1
  101. package/src/emphasis/Emphasis.spec.tsx +8 -8
  102. package/src/emphasis/Emphasis.story.tsx +1 -1
  103. package/src/field/Field.story.tsx +3 -3
  104. package/src/flowNavigation/FlowNavigation.story.tsx +305 -260
  105. package/src/i18n/en.json +2 -0
  106. package/src/iconButton/IconButton.story.tsx +2 -2
  107. package/src/image/Image.story.tsx +27 -54
  108. package/src/info/Info.story.tsx +2 -2
  109. package/src/inlineAlert/InlineAlert.story.tsx +1 -1
  110. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +2 -2
  111. package/src/inputs/Input.css +37 -21
  112. package/src/inputs/InputGroup.story.tsx +1 -1
  113. package/src/inputs/SearchInput.story.tsx +1 -1
  114. package/src/inputs/SelectInput.docs.mdx +1 -1
  115. package/src/inputs/SelectInput.story.tsx +2 -2
  116. package/src/inputs/TextArea.css +35 -20
  117. package/src/instructionsList/InstructionsList.story.tsx +2 -2
  118. package/src/legacylistItem/LegacyListItem.story.tsx +1 -1
  119. package/src/loader/Loader.css +4 -90
  120. package/src/loader/Loader.story.tsx +1 -1
  121. package/src/logo/Logo.story.tsx +1 -1
  122. package/src/main.css +4 -94
  123. package/src/markdown/Markdown.story.tsx +1 -1
  124. package/src/modal/Modal.story.tsx +2 -2
  125. package/src/money/Money.story.tsx +1 -1
  126. package/src/moneyInput/MoneyInput.docs.mdx +1 -1
  127. package/src/moneyInput/MoneyInput.spec.tsx +8 -5
  128. package/src/moneyInput/MoneyInput.story.tsx +2 -2
  129. package/src/moneyInput/currencyFormatting.spec.ts +1 -1
  130. package/src/navigationOption/NavigationOption.story.tsx +265 -226
  131. package/src/nudge/Nudge.story.tsx +1 -1
  132. package/src/overlayHeader/OverlayHeader.story.tsx +32 -24
  133. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +1 -1
  134. package/src/phoneNumberInput/utils/setDefaultPrefix/setDefaultPrefix.spec.ts +6 -3
  135. package/src/popover/Popover.css +19 -12
  136. package/src/popover/Popover.story.tsx +2 -2
  137. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +2 -2
  138. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +2 -2
  139. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +2 -2
  140. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +2 -2
  141. package/src/processIndicator/ProcessIndicator.story.tsx +1 -1
  142. package/src/progress/Progress.story.tsx +1 -1
  143. package/src/progressBar/ProgressBar.story.tsx +1 -1
  144. package/src/promoCard/PromoCard.story.tsx +1 -1
  145. package/src/promoCard/PromoCardGroup.story.tsx +1 -1
  146. package/src/provider/Provider.spec.tsx +2 -2
  147. package/src/provider/Provider.story.tsx +1 -1
  148. package/src/provider/direction/DirectionProvider.spec.tsx +1 -1
  149. package/src/provider/language/LanguageProvider.spec.tsx +1 -1
  150. package/src/provider/theme/ThemeProvider.story.tsx +1 -1
  151. package/src/radio/Radio.story.tsx +59 -42
  152. package/src/radioGroup/RadioGroup.story.tsx +2 -2
  153. package/src/radioOption/RadioOption.story.tsx +73 -38
  154. package/src/segmentedControl/SegmentedControl.story.tsx +1 -1
  155. package/src/select/Select.css +131 -68
  156. package/src/select/Select.story.tsx +385 -397
  157. package/src/slidingPanel/SlidingPanel.story.tsx +30 -13
  158. package/src/snackbar/Snackbar.story.tsx +50 -36
  159. package/src/snackbar/Snackbar.tests.story.tsx +3 -2
  160. package/src/statusIcon/StatusIcon.docs.mdx +1 -1
  161. package/src/statusIcon/StatusIcon.spec.tsx +8 -5
  162. package/src/statusIcon/StatusIcon.story.tsx +1 -1
  163. package/src/stepper/Stepper.story.tsx +2 -2
  164. package/src/stepper/Stepper.tests.story.tsx +2 -2
  165. package/src/sticky/Sticky.story.tsx +1 -1
  166. package/src/summary/Summary.story.tsx +18 -17
  167. package/src/switch/Switch.css +27 -16
  168. package/src/switch/Switch.story.tsx +2 -2
  169. package/src/switchOption/SwitchOption.story.tsx +1 -1
  170. package/src/table/Table.story.tsx +1 -1
  171. package/src/test-utils/story-config.ts +9 -6
  172. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +2 -2
  173. package/src/tile/Tile.css +31 -18
  174. package/src/tile/Tile.story.tsx +43 -43
  175. package/src/tooltip/Tooltip.story.tsx +2 -2
  176. package/src/typeahead/Typeahead.story.tsx +2 -2
  177. package/src/upload/Upload.messages.ts +8 -0
  178. package/src/upload/Upload.spec.tsx +6 -0
  179. package/src/upload/Upload.story.tsx +120 -5
  180. package/src/upload/Upload.tests.story.tsx +5 -3
  181. package/src/upload/Upload.tsx +24 -15
  182. package/src/upload/utils/isTypeValid/isTypeValid.spec.ts +3 -1
  183. package/src/uploadInput/UploadInput.story.tsx +1 -1
  184. package/src/uploadInput/UploadInput.tests.story.tsx +10 -3
  185. package/src/uploadInput/UploadInput.tsx +2 -2
  186. package/src/uploadInput/uploadButton/UploadButton.spec.tsx +6 -0
  187. package/src/uploadInput/uploadButton/UploadButton.tsx +12 -6
  188. package/src/withId/withId.docs.mdx +1 -1
  189. package/src/withId/withId.story.tsx +1 -1
  190. package/src/common/responsivePanel/__snapshots__/ResponsivePanel.spec.js.snap +0 -21
@@ -1,21 +1,24 @@
1
- @media (min-width: 768px) {
2
- }@media (min-width: 768px) {
3
- }.np-accordion-item {
1
+ .np-accordion-item {
4
2
  display: block;
5
3
  width: 100%;
6
- }.np-accordion-item--open .media {
4
+ }
5
+ .np-accordion-item--open .media {
7
6
  border: 0 !important;
8
- }.np-accordion-item .decision:not(.disabled):not(:disabled):hover {
7
+ }
8
+ .np-accordion-item .decision:not(.disabled):not(:disabled):hover {
9
9
  background-color: transparent;
10
- }.np-accordion-item.np-accordion-item--dark .media-body,
10
+ }
11
+ .np-accordion-item.np-accordion-item--dark .media-body,
11
12
  .np-accordion-item.np-accordion-item--dark .np-text-title-body {
12
13
  color: #ffffff;
13
- }.np-accordion-item__content {
14
+ }
15
+ .np-accordion-item__content {
14
16
  padding: 0 12px 24px 12px;
15
17
  padding: 0 var(--size-12) var(--size-24) var(--size-12);
16
18
  border-bottom: 1px solid rgba(0,0,0,0.10196);
17
19
  border-bottom: 1px solid var(--color-border-neutral);
18
- }@media (min-width: 480px) {
20
+ }
21
+ @media (min-width: 480px) {
19
22
  .np-accordion-item__content.has-icon {
20
23
  padding-left: 68px;
21
24
  }
@@ -24,22 +27,28 @@
24
27
  padding-left: 0;
25
28
  padding-left: initial;
26
29
  }
27
- }.np-accordion-item .np-option .np-option__title {
30
+ }
31
+ .np-accordion-item .np-option .np-option__title {
28
32
  font-weight: 600;
29
33
  font-weight: var(--font-weight-semi-bold);
30
- }.np-theme-personal .np-accordion-item--with-media .media {
34
+ }
35
+ .np-theme-personal .np-accordion-item--with-media .media {
31
36
  display: flex;
32
37
  align-items: center;
33
- }.np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
38
+ }
39
+ .np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
34
40
  padding: 0 56px 16px;
35
41
  padding: 0 var(--size-56) var(--size-16);
36
- }.np-theme-personal .np-accordion-item--with-icon .media {
42
+ }
43
+ .np-theme-personal .np-accordion-item--with-icon .media {
37
44
  display: flex;
38
45
  align-items: flex-start;
39
- }.np-theme-personal .np-accordion-item .decision__title {
46
+ }
47
+ .np-theme-personal .np-accordion-item .decision__title {
40
48
  font-size: 1.125rem;
41
49
  font-size: var(--font-size-18);
42
- }.np-theme-personal .np-accordion-item .np-option .np-option__title {
50
+ }
51
+ .np-theme-personal .np-accordion-item .np-option .np-option__title {
43
52
  margin-bottom: 0;
44
53
  font-size: 1.125rem;
45
54
  font-size: var(--font-size-18);
@@ -47,14 +56,16 @@
47
56
  letter-spacing: var(--letter-spacing-negative-xs);
48
57
  line-height: 1.5rem;
49
58
  line-height: var(--line-height-24);
50
- }.np-theme-personal .np-accordion-item .np-option .circle-sm {
59
+ }
60
+ .np-theme-personal .np-accordion-item .np-option .circle-sm {
51
61
  background-color: transparent;
52
62
  width: 24px;
53
63
  width: var(--size-24);
54
64
  height: 24px;
55
65
  height: var(--size-24);
56
66
  border-radius: 0;
57
- }.np-theme-personal .np-accordion-item__content {
67
+ }
68
+ .np-theme-personal .np-accordion-item__content {
58
69
  padding: 0 56px 16px 16px;
59
70
  padding: 0 var(--size-56) var(--size-16) var(--size-16);
60
71
  border-bottom: none;
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Meta, StoryObj } from '@storybook/react';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import { FastFlag as FastFlagIcon, CardWise as CardWiseIcon } from '@transferwise/icons';
4
4
 
5
5
  import { Scroll, Size } from '../common';
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { Settings } from '@transferwise/icons';
3
3
 
4
4
  import { storyConfig } from '../test-utils/story-config';
@@ -12,7 +12,8 @@ import ActionButton from './ActionButton';
12
12
  */
13
13
  export default {
14
14
  component: ActionButton,
15
- title: 'Actions/ActionButton (Deprecated)',
15
+ title: 'Actions/ActionButton',
16
+ tags: ['deprecated'],
16
17
  } satisfies Meta<typeof ActionButton>;
17
18
 
18
19
  type Story = StoryObj<typeof ActionButton>;
@@ -1,5 +1,5 @@
1
- import { action } from '@storybook/addon-actions';
2
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { action } from 'storybook/actions';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import { FastFlag as FastFlagIcon } from '@transferwise/icons';
4
4
 
5
5
  import { Nudge, Title, Typography } from '..';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
+ import { action } from 'storybook/actions';
4
4
  import { ClockBorderless } from '@transferwise/icons';
5
5
 
6
6
  import { lorem40 } from '../test-utils';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import { userEvent, within, expect, waitFor } from '@storybook/test';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
+ import { userEvent, within, expect, waitFor } from 'storybook/test';
4
4
  import { Button, Field, SelectInput, Sentiment } from '..';
5
5
  import Alert, { type AlertProps } from './Alert';
6
6
 
@@ -1,13 +1,12 @@
1
- @media (min-width: 768px) {
2
- }@media (min-width: 768px) {
3
- }.tw-avatar {
1
+ .tw-avatar {
4
2
  position: relative;
5
3
  border-radius: 50%;
6
4
  -webkit-user-select: none;
7
5
  -moz-user-select: none;
8
6
  user-select: none;
9
7
  box-sizing: border-box;
10
- }.tw-avatar .tw-avatar__content {
8
+ }
9
+ .tw-avatar .tw-avatar__content {
11
10
  align-items: center;
12
11
  background-color: rgba(134,167,189,0.10196);
13
12
  background-color: #86a7bd1a;
@@ -22,58 +21,73 @@
22
21
  max-width: 100%;
23
22
  overflow: hidden;
24
23
  width: 100%;
25
- }.tw-avatar--outlined {
24
+ }
25
+ .tw-avatar--outlined {
26
26
  border: 1px solid #00a2dd;
27
27
  border: 1px solid var(--color-interactive-accent);
28
28
  cursor: pointer;
29
- }.tw-avatar--outlined:not(.disabled):not(:disabled):hover {
29
+ }
30
+ .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
30
31
  border-color: #008fc9;
31
32
  border-color: var(--color-interactive-accent-hover);
32
- }.tw-avatar--thumbnail * {
33
+ }
34
+ .tw-avatar--thumbnail * {
33
35
  width: 100%;
34
36
  height: 100%;
35
37
  -o-object-fit: cover;
36
38
  object-fit: cover;
37
- }.tw-avatar--icon * {
39
+ }
40
+ .tw-avatar--icon * {
38
41
  max-height: 100%;
39
42
  max-width: 100%;
40
- }.tw-avatar.tw-avatar--initials,
43
+ }
44
+ .tw-avatar.tw-avatar--initials,
41
45
  .tw-avatar.tw-avatar--emoji {
42
46
  font-family: Arial, sans-serif;
43
47
  font-weight: 600;
44
48
  font-weight: var(--font-weight-semi-bold);
45
- }.tw-avatar.tw-avatar--initials,
49
+ }
50
+ .tw-avatar.tw-avatar--initials,
46
51
  .tw-avatar.tw-avatar--icon {
47
52
  color: #37517e;
48
53
  color: var(--color-content-primary);
49
- }.tw-avatar.tw-avatar--initials,
54
+ }
55
+ .tw-avatar.tw-avatar--initials,
50
56
  .tw-avatar.tw-avatar--emoji {
51
57
  font-family: Arial, sans-serif;
52
- }.tw-avatar.tw-avatar--branded .tw-avatar__content {
58
+ }
59
+ .tw-avatar.tw-avatar--branded .tw-avatar__content {
53
60
  font-family: 'Wise Sans', 'Inter', sans-serif;
54
61
  font-family: var(--font-family-display);
55
62
  font-feature-settings: "ss01";
56
63
  color: var(--color-dark-charcoal);
57
64
  line-height: 1;
58
- }.tw-avatar--24 {
65
+ }
66
+ .tw-avatar--24 {
59
67
  min-width: 24px;
60
68
  width: 24px;
61
69
  height: 24px;
62
- }.tw-avatar--24.tw-avatar--emoji,
70
+ }
71
+ .tw-avatar--24.tw-avatar--emoji,
63
72
  .tw-avatar--24.tw-avatar--icon {
64
73
  font-size: 12px;
65
- }.tw-avatar--24.tw-avatar--initials {
74
+ }
75
+ .tw-avatar--24.tw-avatar--initials {
66
76
  font-size: 8.4px;
67
- }.tw-avatar--24.tw-avatar--branded {
77
+ }
78
+ .tw-avatar--24.tw-avatar--branded {
68
79
  font-size: 10.8px;
69
- }.tw-avatar--24.tw-avatar--outlined {
80
+ }
81
+ .tw-avatar--24.tw-avatar--outlined {
70
82
  padding: 2px;
71
- }.tw-avatar--24.tw-avatar--outlined.tw-avatar--thumbnail::after {
83
+ }
84
+ .tw-avatar--24.tw-avatar--outlined.tw-avatar--thumbnail::after {
72
85
  top: 2px;
73
86
  left: 2px;
74
87
  right: 2px;
75
88
  bottom: 2px;
76
- }.tw-avatar--24.tw-avatar--thumbnail::after {
89
+ }
90
+ .tw-avatar--24.tw-avatar--thumbnail::after {
77
91
  position: absolute;
78
92
  top: 0;
79
93
  left: 0;
@@ -83,25 +97,32 @@
83
97
  border: 1px solid var(--color-border-overlay);
84
98
  content: "";
85
99
  border-radius: 50%;
86
- }.tw-avatar--40 {
100
+ }
101
+ .tw-avatar--40 {
87
102
  min-width: 40px;
88
103
  width: 40px;
89
104
  height: 40px;
90
- }.tw-avatar--40.tw-avatar--emoji,
105
+ }
106
+ .tw-avatar--40.tw-avatar--emoji,
91
107
  .tw-avatar--40.tw-avatar--icon {
92
108
  font-size: 20px;
93
- }.tw-avatar--40.tw-avatar--initials {
109
+ }
110
+ .tw-avatar--40.tw-avatar--initials {
94
111
  font-size: 14px;
95
- }.tw-avatar--40.tw-avatar--branded {
112
+ }
113
+ .tw-avatar--40.tw-avatar--branded {
96
114
  font-size: 18px;
97
- }.tw-avatar--40.tw-avatar--outlined {
115
+ }
116
+ .tw-avatar--40.tw-avatar--outlined {
98
117
  padding: 2px;
99
- }.tw-avatar--40.tw-avatar--outlined.tw-avatar--thumbnail::after {
118
+ }
119
+ .tw-avatar--40.tw-avatar--outlined.tw-avatar--thumbnail::after {
100
120
  top: 2px;
101
121
  left: 2px;
102
122
  right: 2px;
103
123
  bottom: 2px;
104
- }.tw-avatar--40.tw-avatar--thumbnail::after {
124
+ }
125
+ .tw-avatar--40.tw-avatar--thumbnail::after {
105
126
  position: absolute;
106
127
  top: 0;
107
128
  left: 0;
@@ -111,25 +132,32 @@
111
132
  border: 1px solid var(--color-border-overlay);
112
133
  content: "";
113
134
  border-radius: 50%;
114
- }.tw-avatar--48 {
135
+ }
136
+ .tw-avatar--48 {
115
137
  min-width: 48px;
116
138
  width: 48px;
117
139
  height: 48px;
118
- }.tw-avatar--48.tw-avatar--emoji,
140
+ }
141
+ .tw-avatar--48.tw-avatar--emoji,
119
142
  .tw-avatar--48.tw-avatar--icon {
120
143
  font-size: 24px;
121
- }.tw-avatar--48.tw-avatar--initials {
144
+ }
145
+ .tw-avatar--48.tw-avatar--initials {
122
146
  font-size: 16.8px;
123
- }.tw-avatar--48.tw-avatar--branded {
147
+ }
148
+ .tw-avatar--48.tw-avatar--branded {
124
149
  font-size: 21.6px;
125
- }.tw-avatar--48.tw-avatar--outlined {
150
+ }
151
+ .tw-avatar--48.tw-avatar--outlined {
126
152
  padding: 2px;
127
- }.tw-avatar--48.tw-avatar--outlined.tw-avatar--thumbnail::after {
153
+ }
154
+ .tw-avatar--48.tw-avatar--outlined.tw-avatar--thumbnail::after {
128
155
  top: 2px;
129
156
  left: 2px;
130
157
  right: 2px;
131
158
  bottom: 2px;
132
- }.tw-avatar--48.tw-avatar--thumbnail::after {
159
+ }
160
+ .tw-avatar--48.tw-avatar--thumbnail::after {
133
161
  position: absolute;
134
162
  top: 0;
135
163
  left: 0;
@@ -139,25 +167,32 @@
139
167
  border: 1px solid var(--color-border-overlay);
140
168
  content: "";
141
169
  border-radius: 50%;
142
- }.tw-avatar--56 {
170
+ }
171
+ .tw-avatar--56 {
143
172
  min-width: 56px;
144
173
  width: 56px;
145
174
  height: 56px;
146
- }.tw-avatar--56.tw-avatar--emoji,
175
+ }
176
+ .tw-avatar--56.tw-avatar--emoji,
147
177
  .tw-avatar--56.tw-avatar--icon {
148
178
  font-size: 28px;
149
- }.tw-avatar--56.tw-avatar--initials {
179
+ }
180
+ .tw-avatar--56.tw-avatar--initials {
150
181
  font-size: 19.6px;
151
- }.tw-avatar--56.tw-avatar--branded {
182
+ }
183
+ .tw-avatar--56.tw-avatar--branded {
152
184
  font-size: 25.2px;
153
- }.tw-avatar--56.tw-avatar--outlined {
185
+ }
186
+ .tw-avatar--56.tw-avatar--outlined {
154
187
  padding: 2px;
155
- }.tw-avatar--56.tw-avatar--outlined.tw-avatar--thumbnail::after {
188
+ }
189
+ .tw-avatar--56.tw-avatar--outlined.tw-avatar--thumbnail::after {
156
190
  top: 2px;
157
191
  left: 2px;
158
192
  right: 2px;
159
193
  bottom: 2px;
160
- }.tw-avatar--56.tw-avatar--thumbnail::after {
194
+ }
195
+ .tw-avatar--56.tw-avatar--thumbnail::after {
161
196
  position: absolute;
162
197
  top: 0;
163
198
  left: 0;
@@ -167,25 +202,32 @@
167
202
  border: 1px solid var(--color-border-overlay);
168
203
  content: "";
169
204
  border-radius: 50%;
170
- }.tw-avatar--72 {
205
+ }
206
+ .tw-avatar--72 {
171
207
  min-width: 72px;
172
208
  width: 72px;
173
209
  height: 72px;
174
- }.tw-avatar--72.tw-avatar--emoji,
210
+ }
211
+ .tw-avatar--72.tw-avatar--emoji,
175
212
  .tw-avatar--72.tw-avatar--icon {
176
213
  font-size: 36px;
177
- }.tw-avatar--72.tw-avatar--initials {
214
+ }
215
+ .tw-avatar--72.tw-avatar--initials {
178
216
  font-size: 25.2px;
179
- }.tw-avatar--72.tw-avatar--branded {
217
+ }
218
+ .tw-avatar--72.tw-avatar--branded {
180
219
  font-size: 32.4px;
181
- }.tw-avatar--72.tw-avatar--outlined {
220
+ }
221
+ .tw-avatar--72.tw-avatar--outlined {
182
222
  padding: 2px;
183
- }.tw-avatar--72.tw-avatar--outlined.tw-avatar--thumbnail::after {
223
+ }
224
+ .tw-avatar--72.tw-avatar--outlined.tw-avatar--thumbnail::after {
184
225
  top: 2px;
185
226
  left: 2px;
186
227
  right: 2px;
187
228
  bottom: 2px;
188
- }.tw-avatar--72.tw-avatar--thumbnail::after {
229
+ }
230
+ .tw-avatar--72.tw-avatar--thumbnail::after {
189
231
  position: absolute;
190
232
  top: 0;
191
233
  left: 0;
@@ -195,11 +237,14 @@
195
237
  border: 1px solid var(--color-border-overlay);
196
238
  content: "";
197
239
  border-radius: 50%;
198
- }.tw-avatar img {
240
+ }
241
+ .tw-avatar img {
199
242
  width: 100%;
200
243
  height: 100%;
201
- }.np-theme-personal .tw-avatar--outlined {
244
+ }
245
+ .np-theme-personal .tw-avatar--outlined {
202
246
  border-color: var(--color-interactive-primary);
203
- }.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
247
+ }
248
+ .np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
204
249
  border-color: var(--color-interactive-primary-hover);
205
250
  }
@@ -37,7 +37,7 @@ describe('Avatar', () => {
37
37
  describe('branded avatar colors', () => {
38
38
  it.each(avatarColorTestCases)(
39
39
  'for seed of $key return background color of `$color.token`',
40
- (item) => {
40
+ (item: { key: string | number; color: { hex: string; token: string } }) => {
41
41
  render(<Avatar backgroundColorSeed={item.key.toString()}>JS</Avatar>);
42
42
 
43
43
  expect(screen.getByText('JS')).toHaveStyle(`background-color: var(${item.color.token})`);
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import * as wiseIcons from '@transferwise/icons';
3
3
  import { Flag } from '@wise/art';
4
4
 
@@ -12,7 +12,8 @@ import Avatar, { AvatarType } from '.';
12
12
  */
13
13
  export default {
14
14
  component: Avatar,
15
- title: 'Content/Avatar (Deprecated)',
15
+ title: 'Content/Avatar',
16
+ tags: ['deprecated'],
16
17
  } satisfies Meta<typeof Avatar>;
17
18
 
18
19
  type Story = StoryObj<typeof Avatar>;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/jsx-key */
2
- import { Meta, StoryObj } from '@storybook/react';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import AvatarLayout, { AvatarLayoutProps } from '.';
4
4
  import { Freeze, Graph, Plane, Rewards } from '@transferwise/icons';
5
5
  import { Flag } from '@wise/art';
@@ -84,7 +84,7 @@ export default function AvatarLayout({
84
84
  const DIAGONAL_LAYOUT_STYLE_CONFIG = {
85
85
  // Diagonal layout doesn't support 16 size
86
86
  16: { avatarSize: undefined, offset: undefined, fontSize: undefined, iconSize: undefined },
87
- 24: { avatarSize: 15, offset: 2.5, fontSize: 8, iconSize: 11.25 },
87
+ 24: { avatarSize: 16, offset: 2.5, fontSize: 8, iconSize: 11.25 },
88
88
  32: { avatarSize: 20, offset: 2.5, fontSize: 12, iconSize: 15 },
89
89
  40: { avatarSize: 24, offset: 4.5, fontSize: 12, iconSize: 18 },
90
90
  48: { avatarSize: 30, offset: 3.5, fontSize: 14, iconSize: 16.87 },
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/jsx-key */
2
- import { Meta, StoryObj } from '@storybook/react';
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import {
4
4
  Camera,
5
5
  Convert,
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
 
3
3
  import { ProfileType, Sentiment, Status } from '../common';
4
4
 
@@ -9,7 +9,8 @@ import AvatarWrapper from './AvatarWrapper';
9
9
  */
10
10
  export default {
11
11
  component: AvatarWrapper,
12
- title: 'Content/AvatarWrapper (Deprecated)',
12
+ title: 'Content/AvatarWrapper',
13
+ tags: ['deprecated'],
13
14
  } satisfies Meta<typeof AvatarWrapper>;
14
15
 
15
16
  type Story = StoryObj<typeof AvatarWrapper>;
@@ -1,20 +1,42 @@
1
- import { text, select } from '@storybook/addon-knobs';
2
-
1
+ import { Meta } from '@storybook/react-webpack5';
3
2
  import { default as AvatarComponent, AvatarType } from '../avatar';
4
3
  import { Size, Theme } from '../common';
5
-
6
- import Badge from './Badge';
4
+ import Badge, { type BadgeProps } from './Badge';
7
5
 
8
6
  /**
9
7
  * @deprecated use **`<AvatarView badge={..} />`** components instead
10
8
  */
11
- export default {
9
+ const meta: Meta<typeof Badge> = {
12
10
  component: Badge,
13
- title: 'Content/Badge (Deprecated)',
14
- excludeStories: ['ExampleBadgeCss'],
11
+ title: 'Content/Badge',
12
+ tags: ['deprecated'],
15
13
  };
16
14
 
17
- export const ExampleBadgeCss = {
15
+ export default meta;
16
+
17
+ /**
18
+ * Used for showing multiple components within a Canvas.
19
+ * @decorator
20
+ */
21
+ const withComponentGrid =
22
+ (maxWidth = 'auto') =>
23
+ (Story: any) => (
24
+ <div
25
+ style={{
26
+ width: '100%',
27
+ placeItems: 'center',
28
+ justifyContent: 'center',
29
+ display: 'flex',
30
+ flexWrap: 'wrap',
31
+ gap: '2rem',
32
+ maxWidth,
33
+ }}
34
+ >
35
+ <Story />
36
+ </div>
37
+ );
38
+
39
+ const ExampleBadgeStyle = {
18
40
  background: 'var(--color-content-positive)',
19
41
  width: '100%',
20
42
  height: '100%',
@@ -25,47 +47,46 @@ export const ExampleBadgeCss = {
25
47
  alignItems: 'center',
26
48
  };
27
49
 
28
- export const Avatar = () => {
29
- const BadgeText = text('BadgeText', 'B');
30
- const border = select('Border', [undefined, Theme.LIGHT, Theme.DARK], Theme.LIGHT);
31
-
32
- return (
33
- <div>
34
- <div style={{ display: 'inline', margin: 8 }}>
50
+ export const LegacyAvatarWithBadge = {
51
+ decorators: [withComponentGrid()],
52
+ parameters: {
53
+ docs: {
54
+ source: { type: 'dynamic' },
55
+ },
56
+ },
57
+ render: () => {
58
+ return (
59
+ <>
35
60
  <Badge
36
- badge={<div style={ExampleBadgeCss}>{BadgeText}</div>}
37
- border={border}
61
+ badge={<div style={ExampleBadgeStyle}>B</div>}
62
+ border={Theme.LIGHT}
38
63
  size={Size.LARGE}
39
64
  >
40
65
  <AvatarComponent type={AvatarType.INITIALS} size={Size.LARGE}>
41
66
  AA
42
67
  </AvatarComponent>
43
68
  </Badge>
44
- </div>
45
69
 
46
- <div style={{ display: 'inline', margin: 8 }}>
47
70
  <Badge
48
- badge={<div style={ExampleBadgeCss}>{BadgeText}</div>}
49
- border={border}
71
+ badge={<div style={ExampleBadgeStyle}>B</div>}
72
+ border={Theme.LIGHT}
50
73
  size={Size.MEDIUM}
51
74
  >
52
75
  <AvatarComponent type={AvatarType.INITIALS} size={Size.MEDIUM}>
53
76
  AA
54
77
  </AvatarComponent>
55
78
  </Badge>
56
- </div>
57
79
 
58
- <div style={{ display: 'inline', margin: 8 }}>
59
80
  <Badge
60
- badge={<div style={ExampleBadgeCss}>{BadgeText}</div>}
61
- border={border}
81
+ badge={<div style={ExampleBadgeStyle}>B</div>}
82
+ border={Theme.LIGHT}
62
83
  size={Size.SMALL}
63
84
  >
64
85
  <AvatarComponent type={AvatarType.INITIALS} size={Size.MEDIUM}>
65
86
  AA
66
87
  </AvatarComponent>
67
88
  </Badge>
68
- </div>
69
- </div>
70
- );
89
+ </>
90
+ );
91
+ },
71
92
  };
@@ -1,4 +1,4 @@
1
- import { Meta, Canvas, Source } from '@storybook/blocks';
1
+ import { Meta, Canvas, Source } from '@storybook/addon-docs/blocks';
2
2
  import { NavigationOption } from '..';
3
3
  import { Bulb } from '@transferwise/icons';
4
4
  import * as stories from './Button.story';
@@ -1,5 +1,5 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { fn } from '@storybook/test';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { fn } from 'storybook/test';
3
3
  import { Freeze, ArrowRight, ChevronRight } from '@transferwise/icons';
4
4
  import { Flag } from '@wise/art';
5
5
  import Button from './Button.resolver';
@@ -1,6 +1,6 @@
1
- import { Meta } from '@storybook/react';
1
+ import { Meta } from '@storybook/react-webpack5';
2
2
  import Button from './Button.resolver';
3
- import { expect, userEvent, within } from '@storybook/test';
3
+ import { expect, userEvent, within } from 'storybook/test';
4
4
  import { storyConfig } from '../test-utils';
5
5
 
6
6
  const meta: Meta<typeof Button> = {
@@ -1,5 +1,5 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { userEvent, within, fn, expect } from '@storybook/test';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { userEvent, within, fn, expect } from 'storybook/test';
3
3
  import { useState } from 'react';
4
4
 
5
5
  import Button from '.';
@@ -25,6 +25,7 @@ const withContainer = (Story: any) => (
25
25
  const meta: Meta<typeof LegacyButton> = {
26
26
  component: LegacyButton,
27
27
  title: 'Actions/Button/Legacy Button',
28
+ tags: ['deprecated'],
28
29
  args: {
29
30
  size: undefined,
30
31
  priority: undefined,
@@ -1,7 +1,7 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { FastFlag as FastFlagIcon } from '@transferwise/icons';
3
3
  import { useState } from 'react';
4
- import { fn } from '@storybook/test';
4
+ import { fn } from 'storybook/test';
5
5
 
6
6
  import Card from '.';
7
7
 
@@ -1,4 +1,4 @@
1
- import type { StoryFn } from '@storybook/react';
1
+ import type { StoryFn } from '@storybook/react-webpack5';
2
2
  import { Illustration } from '@wise/art';
3
3
  import React from 'react';
4
4