@transferwise/components 0.0.0-experimental-76bb7cd → 0.0.0-experimental-54cbbb2

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 (99) hide show
  1. package/build/avatar/Avatar.js +3 -0
  2. package/build/avatar/Avatar.js.map +1 -1
  3. package/build/avatar/Avatar.mjs +3 -0
  4. package/build/avatar/Avatar.mjs.map +1 -1
  5. package/build/avatarView/AvatarView.js +170 -0
  6. package/build/avatarView/AvatarView.js.map +1 -0
  7. package/build/avatarView/AvatarView.mjs +168 -0
  8. package/build/avatarView/AvatarView.mjs.map +1 -0
  9. package/build/avatarView/NotificationDot.js +59 -0
  10. package/build/avatarView/NotificationDot.js.map +1 -0
  11. package/build/avatarView/NotificationDot.mjs +57 -0
  12. package/build/avatarView/NotificationDot.mjs.map +1 -0
  13. package/build/avatarWrapper/AvatarWrapper.js +10 -4
  14. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  15. package/build/avatarWrapper/AvatarWrapper.mjs +10 -4
  16. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  17. package/build/badge/Badge.js +16 -4
  18. package/build/badge/Badge.js.map +1 -1
  19. package/build/badge/Badge.mjs +15 -3
  20. package/build/badge/Badge.mjs.map +1 -1
  21. package/build/badge/BadgeAssets.js +60 -0
  22. package/build/badge/BadgeAssets.js.map +1 -0
  23. package/build/badge/BadgeAssets.mjs +58 -0
  24. package/build/badge/BadgeAssets.mjs.map +1 -0
  25. package/build/common/circle/Circle.js +17 -1
  26. package/build/common/circle/Circle.js.map +1 -1
  27. package/build/common/circle/Circle.mjs +17 -1
  28. package/build/common/circle/Circle.mjs.map +1 -1
  29. package/build/index.js +20 -13
  30. package/build/index.js.map +1 -1
  31. package/build/index.mjs +11 -7
  32. package/build/index.mjs.map +1 -1
  33. package/build/main.css +109 -5
  34. package/build/styles/avatarGroup/AvatarGroup.css +29 -0
  35. package/build/styles/avatarView/AvatarView.css +42 -0
  36. package/build/styles/avatarView/NotificationDot.css +20 -0
  37. package/build/styles/badge/Badge.css +6 -5
  38. package/build/styles/common/circle/Circle.css +32 -0
  39. package/build/styles/main.css +109 -5
  40. package/build/types/avatar/Avatar.d.ts +3 -0
  41. package/build/types/avatar/Avatar.d.ts.map +1 -1
  42. package/build/types/avatarGroup/AvatarGroup.d.ts +18 -0
  43. package/build/types/avatarGroup/AvatarGroup.d.ts.map +1 -0
  44. package/build/types/avatarGroup/index.d.ts +3 -0
  45. package/build/types/avatarGroup/index.d.ts.map +1 -0
  46. package/build/types/avatarView/AvatarView.d.ts +26 -0
  47. package/build/types/avatarView/AvatarView.d.ts.map +1 -0
  48. package/build/types/avatarView/NotificationDot.d.ts +8 -0
  49. package/build/types/avatarView/NotificationDot.d.ts.map +1 -0
  50. package/build/types/avatarView/index.d.ts +3 -0
  51. package/build/types/avatarView/index.d.ts.map +1 -0
  52. package/build/types/avatarWrapper/AvatarWrapper.d.ts +3 -0
  53. package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
  54. package/build/types/badge/Badge.d.ts +9 -4
  55. package/build/types/badge/Badge.d.ts.map +1 -1
  56. package/build/types/badge/BadgeAssets.d.ts +14 -0
  57. package/build/types/badge/BadgeAssets.d.ts.map +1 -0
  58. package/build/types/badge/index.d.ts +2 -0
  59. package/build/types/badge/index.d.ts.map +1 -1
  60. package/build/types/common/circle/Circle.d.ts +2 -0
  61. package/build/types/common/circle/Circle.d.ts.map +1 -1
  62. package/build/types/index.d.ts +3 -1
  63. package/build/types/index.d.ts.map +1 -1
  64. package/package.json +3 -3
  65. package/src/avatar/Avatar.tsx +3 -0
  66. package/src/avatarGroup/AvatarGroup.css +29 -0
  67. package/src/avatarGroup/AvatarGroup.less +42 -0
  68. package/src/avatarGroup/AvatarGroup.story.tsx +284 -0
  69. package/src/avatarGroup/AvatarGroup.tsx +117 -0
  70. package/src/avatarGroup/index.ts +2 -0
  71. package/src/avatarView/AvatarView.css +42 -0
  72. package/src/avatarView/AvatarView.less +33 -0
  73. package/src/avatarView/AvatarView.story.tsx +482 -0
  74. package/src/avatarView/AvatarView.tsx +169 -0
  75. package/src/avatarView/NotificationDot.css +20 -0
  76. package/src/avatarView/NotificationDot.less +24 -0
  77. package/src/avatarView/NotificationDot.tsx +35 -0
  78. package/src/avatarView/index.ts +2 -0
  79. package/src/avatarWrapper/AvatarWrapper.tsx +3 -0
  80. package/src/badge/Badge.css +6 -5
  81. package/src/badge/Badge.less +4 -3
  82. package/src/badge/Badge.tsx +20 -6
  83. package/src/badge/BadgeAssets.tsx +61 -0
  84. package/src/badge/index.ts +3 -0
  85. package/src/common/circle/Circle.css +32 -0
  86. package/src/common/circle/Circle.less +35 -0
  87. package/src/common/circle/Circle.tsx +22 -1
  88. package/src/decision/Decision.story.tsx +10 -46
  89. package/src/flowNavigation/FlowNavigation.story.tsx +10 -48
  90. package/src/index.ts +4 -0
  91. package/src/listItem/ListItem.story.tsx +5 -43
  92. package/src/main.css +109 -5
  93. package/src/main.less +2 -0
  94. package/src/navigationOption/NavigationOption.story.tsx +14 -65
  95. package/src/overlayHeader/OverlayHeader.story.tsx +5 -10
  96. package/src/radio/Radio.story.tsx +5 -5
  97. package/src/radioGroup/RadioGroup.story.tsx +3 -3
  98. package/src/selectOption/SelectOption.story.tsx +31 -30
  99. package/src/tile/Tile.story.tsx +2 -6
@@ -2,9 +2,8 @@ import { action } from '@storybook/addon-actions';
2
2
  import { select, text } from '@storybook/addon-knobs';
3
3
  import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';
4
4
 
5
- import Avatar, { AvatarType } from '../avatar';
6
- import AvatarWrapper from '../avatarWrapper';
7
- import { ProfileType, Size } from '../common';
5
+ import AvatarView from '../avatarView';
6
+ import { ProfileType } from '../common';
8
7
  import Logo from '../logo';
9
8
 
10
9
  import OverlayHeader from './OverlayHeader';
@@ -29,11 +28,7 @@ export const Basic = () => {
29
28
  return (
30
29
  <OverlayHeader
31
30
  logo={<Logo />}
32
- avatar={
33
- <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
34
- {avatarProfiles[showAvatar]}
35
- </Avatar>
36
- }
31
+ avatar={<AvatarView>{avatarProfiles[showAvatar]}</AvatarView>}
37
32
  onClose={action('Close clicked')}
38
33
  />
39
34
  );
@@ -46,13 +41,13 @@ export const WithAvatarWrapper = () => {
46
41
  );
47
42
  const profileType = select(
48
43
  'profileType',
49
- Object.keys(ProfileType) as `${ProfileType}`[],
44
+ [ProfileType.PERSONAL, ProfileType.BUSINESS],
50
45
  undefined,
51
46
  );
52
47
  return (
53
48
  <OverlayHeader
54
49
  logo={<Logo />}
55
- avatar={<AvatarWrapper url={avatarURL} profileType={profileType} />}
50
+ avatar={<AvatarView imgSrc={avatarURL} profileType={profileType?.toLowerCase()} />}
56
51
  onClose={action('Close clicked')}
57
52
  />
58
53
  );
@@ -2,7 +2,7 @@ import { boolean, text } from '@storybook/addon-knobs';
2
2
  import { Flag } from '@wise/art';
3
3
  import { useState } from 'react';
4
4
 
5
- import Avatar, { AvatarType } from '../avatar';
5
+ import AvatarView from '../avatarView';
6
6
  import Checkbox from '../checkbox';
7
7
 
8
8
  import Radio from './Radio';
@@ -32,9 +32,9 @@ export const Basic = () => {
32
32
  disabled={disabled}
33
33
  avatar={
34
34
  showAvatar ? (
35
- <Avatar type={AvatarType.THUMBNAIL}>
35
+ <AvatarView>
36
36
  <Flag code="IMP" />
37
- </Avatar>
37
+ </AvatarView>
38
38
  ) : null
39
39
  }
40
40
  onChange={() => setChecked(!checked)}
@@ -50,9 +50,9 @@ export const Basic = () => {
50
50
  secondary={secondary}
51
51
  avatar={
52
52
  showAvatar ? (
53
- <Avatar type={AvatarType.THUMBNAIL}>
53
+ <AvatarView>
54
54
  <Flag code="KES" />
55
- </Avatar>
55
+ </AvatarView>
56
56
  ) : null
57
57
  }
58
58
  onChange={() => setChecked(!checked)}
@@ -1,6 +1,6 @@
1
1
  import { Flag } from '@wise/art';
2
2
 
3
- import Avatar, { AvatarType } from '../avatar';
3
+ import AvatarView from '../avatarView';
4
4
 
5
5
  import RadioGroup, { RadioGroupProps, RadioGroupRadio } from './RadioGroup';
6
6
  import { Field } from '../field/Field';
@@ -52,9 +52,9 @@ export const WithAvatars = {
52
52
  ({
53
53
  ...radio,
54
54
  avatar: (
55
- <Avatar type={AvatarType.THUMBNAIL}>
55
+ <AvatarView>
56
56
  <Flag code="NZD" />
57
- </Avatar>
57
+ </AvatarView>
58
58
  ),
59
59
  }) satisfies RadioGroupRadio,
60
60
  ),
@@ -8,8 +8,7 @@ import SelectOption, {
8
8
  import { Bank, BankTransfer, Beach, Briefcase, Card, Plane } from '@transferwise/icons';
9
9
  import { Field } from '../field/Field';
10
10
  import { lorem10 } from '../test-utils';
11
- import Badge from '../badge';
12
- import Avatar from '../avatar';
11
+ import AvatarView from '../avatarView';
13
12
  import { Sentiment } from '../common';
14
13
  import { useState } from 'react';
15
14
 
@@ -116,57 +115,59 @@ const paymentMethods: SelectOptiopsSection<CustomData>[] = [
116
115
  ];
117
116
 
118
117
  const balances: SelectOptiopsSection[] = [
119
- {
120
- title: 'Balances',
121
- options: [
122
- {
123
- media: <Flag code="gbp" />,
124
- title: 'Wise GBP balance',
125
- },
126
- {
127
- media: <Flag code="eur" />,
128
- title: 'Wise EUR balance',
129
- },
130
- ],
131
- },
132
118
  {
133
119
  title: 'Jars',
134
120
  options: [
135
121
  {
136
122
  media: (
137
- <Badge badge={<Flag code="usd" />} size="md">
138
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-pink)">
139
- <Beach size="24" />
140
- </Avatar>
141
- </Badge>
123
+ <AvatarView
124
+ badge={{ flagCode: 'usd' }}
125
+ style={{ backgroundColor: 'var(--color-bright-pink)' }}
126
+ profileName="Tim Cook"
127
+ />
142
128
  ),
143
129
  title: 'Hawaii Holiday',
144
130
  content: 'Wise USD jar',
145
131
  },
146
132
  {
147
133
  media: (
148
- <Badge badge={<Flag code="aed" />} size="md">
149
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-yellow)">
150
- <Briefcase size="24" />
151
- </Avatar>
152
- </Badge>
134
+ <AvatarView
135
+ badge={{ flagCode: 'aed' }}
136
+ style={{ backgroundColor: 'var(--color-bright-yellow)' }}
137
+ >
138
+ <Briefcase />
139
+ </AvatarView>
153
140
  ),
154
141
  title: 'Emirates Business Trip',
155
142
  content: 'Wise AED jar',
156
143
  },
157
144
  {
158
145
  media: (
159
- <Badge badge={<Flag code="jpy" />} size="md">
160
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-blue)">
161
- <Plane size="24" />
162
- </Avatar>
163
- </Badge>
146
+ <AvatarView
147
+ badge={{ flagCode: 'jpy' }}
148
+ style={{ backgroundColor: 'var(--color-bright-blue)' }}
149
+ >
150
+ <Plane />
151
+ </AvatarView>
164
152
  ),
165
153
  title: 'Trip to Mars',
166
154
  content: 'Wise Jpy jar',
167
155
  },
168
156
  ],
169
157
  },
158
+ {
159
+ title: 'Balances',
160
+ options: [
161
+ {
162
+ media: <Flag code="gbp" />,
163
+ title: 'Wise GBP balance',
164
+ },
165
+ {
166
+ media: <Flag code="eur" />,
167
+ title: 'Wise EUR balance',
168
+ },
169
+ ],
170
+ },
170
171
  ];
171
172
 
172
173
  export const Basic: Story = {
@@ -1,7 +1,7 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { text, boolean } from '@storybook/addon-knobs';
3
3
 
4
- import Avatar from '../avatar';
4
+ import AvatarView from '../avatarView';
5
5
  import { Size } from '../common';
6
6
 
7
7
  import Tile from '.';
@@ -41,11 +41,7 @@ export const Basic = () => {
41
41
  description={description}
42
42
  disabled={disabled}
43
43
  href="#href1"
44
- media={
45
- <Avatar size="md" type="initials">
46
- HM
47
- </Avatar>
48
- }
44
+ media={<AvatarView profileName="Henry Mike" />}
49
45
  size={medium ? Size.MEDIUM : Size.SMALL}
50
46
  title={title}
51
47
  onClick={action('onClick')}