@transferwise/components 46.76.0 → 46.78.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 (142) hide show
  1. package/build/alert/Alert.js +17 -13
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +17 -13
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/avatar/Avatar.js +2 -7
  6. package/build/avatar/Avatar.js.map +1 -1
  7. package/build/avatar/Avatar.mjs +2 -7
  8. package/build/avatar/Avatar.mjs.map +1 -1
  9. package/build/badge/Badge.js +1 -10
  10. package/build/badge/Badge.js.map +1 -1
  11. package/build/badge/Badge.mjs +1 -10
  12. package/build/badge/Badge.mjs.map +1 -1
  13. package/build/circularButton/CircularButton.js +1 -1
  14. package/build/circularButton/CircularButton.js.map +1 -1
  15. package/build/circularButton/CircularButton.mjs +1 -1
  16. package/build/circularButton/CircularButton.mjs.map +1 -1
  17. package/build/common/circle/Circle.js +15 -2
  18. package/build/common/circle/Circle.js.map +1 -1
  19. package/build/common/circle/Circle.mjs +15 -2
  20. package/build/common/circle/Circle.mjs.map +1 -1
  21. package/build/i18n/de.json +5 -0
  22. package/build/i18n/de.json.js +5 -0
  23. package/build/i18n/de.json.js.map +1 -1
  24. package/build/i18n/de.json.mjs +5 -0
  25. package/build/i18n/de.json.mjs.map +1 -1
  26. package/build/i18n/es.json +5 -0
  27. package/build/i18n/es.json.js +5 -0
  28. package/build/i18n/es.json.js.map +1 -1
  29. package/build/i18n/es.json.mjs +5 -0
  30. package/build/i18n/es.json.mjs.map +1 -1
  31. package/build/i18n/fr.json +5 -0
  32. package/build/i18n/fr.json.js +5 -0
  33. package/build/i18n/fr.json.js.map +1 -1
  34. package/build/i18n/fr.json.mjs +5 -0
  35. package/build/i18n/fr.json.mjs.map +1 -1
  36. package/build/i18n/hu.json +5 -0
  37. package/build/i18n/hu.json.js +5 -0
  38. package/build/i18n/hu.json.js.map +1 -1
  39. package/build/i18n/hu.json.mjs +5 -0
  40. package/build/i18n/hu.json.mjs.map +1 -1
  41. package/build/i18n/id.json +5 -0
  42. package/build/i18n/id.json.js +5 -0
  43. package/build/i18n/id.json.js.map +1 -1
  44. package/build/i18n/id.json.mjs +5 -0
  45. package/build/i18n/id.json.mjs.map +1 -1
  46. package/build/i18n/it.json +5 -0
  47. package/build/i18n/it.json.js +5 -0
  48. package/build/i18n/it.json.js.map +1 -1
  49. package/build/i18n/it.json.mjs +5 -0
  50. package/build/i18n/it.json.mjs.map +1 -1
  51. package/build/i18n/ja.json +5 -0
  52. package/build/i18n/ja.json.js +5 -0
  53. package/build/i18n/ja.json.js.map +1 -1
  54. package/build/i18n/ja.json.mjs +5 -0
  55. package/build/i18n/ja.json.mjs.map +1 -1
  56. package/build/i18n/pl.json +5 -0
  57. package/build/i18n/pl.json.js +5 -0
  58. package/build/i18n/pl.json.js.map +1 -1
  59. package/build/i18n/pl.json.mjs +5 -0
  60. package/build/i18n/pl.json.mjs.map +1 -1
  61. package/build/i18n/pt.json +5 -0
  62. package/build/i18n/pt.json.js +5 -0
  63. package/build/i18n/pt.json.js.map +1 -1
  64. package/build/i18n/pt.json.mjs +5 -0
  65. package/build/i18n/pt.json.mjs.map +1 -1
  66. package/build/i18n/ro.json +5 -0
  67. package/build/i18n/ro.json.js +5 -0
  68. package/build/i18n/ro.json.js.map +1 -1
  69. package/build/i18n/ro.json.mjs +5 -0
  70. package/build/i18n/ro.json.mjs.map +1 -1
  71. package/build/i18n/ru.json +5 -0
  72. package/build/i18n/ru.json.js +5 -0
  73. package/build/i18n/ru.json.js.map +1 -1
  74. package/build/i18n/ru.json.mjs +5 -0
  75. package/build/i18n/ru.json.mjs.map +1 -1
  76. package/build/i18n/tr.json +5 -0
  77. package/build/i18n/tr.json.js +5 -0
  78. package/build/i18n/tr.json.js.map +1 -1
  79. package/build/i18n/tr.json.mjs +5 -0
  80. package/build/i18n/tr.json.mjs.map +1 -1
  81. package/build/main.css +46 -22
  82. package/build/statusIcon/StatusIcon.js +4 -4
  83. package/build/statusIcon/StatusIcon.js.map +1 -1
  84. package/build/statusIcon/StatusIcon.mjs +4 -4
  85. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  86. package/build/styles/avatar/Avatar.css +29 -0
  87. package/build/styles/badge/Badge.css +6 -0
  88. package/build/styles/circularButton/CircularButton.css +2 -2
  89. package/build/styles/common/circle/Circle.css +4 -0
  90. package/build/styles/main.css +46 -22
  91. package/build/styles/statusIcon/StatusIcon.css +0 -20
  92. package/build/types/alert/Alert.d.ts +3 -11
  93. package/build/types/alert/Alert.d.ts.map +1 -1
  94. package/build/types/avatar/Avatar.d.ts.map +1 -1
  95. package/build/types/badge/Badge.d.ts.map +1 -1
  96. package/build/types/common/circle/Circle.d.ts +1 -1
  97. package/build/types/common/circle/Circle.d.ts.map +1 -1
  98. package/build/types/statusIcon/StatusIcon.d.ts +7 -3
  99. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  100. package/package.json +3 -3
  101. package/src/alert/Alert.spec.story.tsx +85 -4
  102. package/src/alert/Alert.spec.tsx +36 -14
  103. package/src/alert/Alert.story.tsx +50 -35
  104. package/src/alert/Alert.tsx +22 -23
  105. package/src/avatar/Avatar.css +29 -0
  106. package/src/avatar/Avatar.less +12 -0
  107. package/src/avatar/Avatar.tsx +4 -8
  108. package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +11 -22
  109. package/src/badge/Badge.css +6 -0
  110. package/src/badge/Badge.less +6 -0
  111. package/src/badge/Badge.tsx +1 -11
  112. package/src/circularButton/CircularButton.css +2 -2
  113. package/src/circularButton/CircularButton.less +1 -1
  114. package/src/circularButton/CircularButton.story.tsx +3 -0
  115. package/src/circularButton/CircularButton.tsx +1 -1
  116. package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +10 -10
  117. package/src/common/circle/Circle.css +4 -0
  118. package/src/common/circle/Circle.less +6 -0
  119. package/src/common/circle/Circle.story.tsx +2 -2
  120. package/src/common/circle/Circle.tsx +25 -2
  121. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +4 -8
  122. package/src/i18n/de.json +5 -0
  123. package/src/i18n/es.json +5 -0
  124. package/src/i18n/fr.json +5 -0
  125. package/src/i18n/hu.json +5 -0
  126. package/src/i18n/id.json +5 -0
  127. package/src/i18n/it.json +5 -0
  128. package/src/i18n/ja.json +5 -0
  129. package/src/i18n/pl.json +5 -0
  130. package/src/i18n/pt.json +5 -0
  131. package/src/i18n/ro.json +5 -0
  132. package/src/i18n/ru.json +5 -0
  133. package/src/i18n/tr.json +5 -0
  134. package/src/main.css +46 -22
  135. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +2 -4
  136. package/src/promoCard/PromoCard.spec.tsx +1 -1
  137. package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +2 -4
  138. package/src/statusIcon/StatusIcon.css +0 -20
  139. package/src/statusIcon/StatusIcon.less +0 -17
  140. package/src/statusIcon/StatusIcon.spec.tsx +2 -21
  141. package/src/statusIcon/StatusIcon.story.tsx +32 -1
  142. package/src/statusIcon/StatusIcon.tsx +11 -10
@@ -65,9 +65,7 @@ const Avatar: React.FC<AvatarProps> = ({
65
65
  const size = backwardsCompatibleSize(sizeFromProps);
66
66
 
67
67
  return (
68
- <Circle
69
- size={size}
70
- fixedSize
68
+ <div
71
69
  className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {
72
70
  'tw-avatar--outlined': outlined,
73
71
  'tw-avatar--branded': Boolean(backgroundColorFromSeed),
@@ -75,17 +73,15 @@ const Avatar: React.FC<AvatarProps> = ({
75
73
  })}
76
74
  aria-label={ariaLabel}
77
75
  >
78
- <Circle
79
- size={size}
80
- fixedSize
76
+ <div
81
77
  className="tw-avatar__content"
82
78
  style={{
83
79
  backgroundColor: backgroundColor || backgroundColorFromSeed,
84
80
  }}
85
81
  >
86
82
  {children}
87
- </Circle>
88
- </Circle>
83
+ </div>
84
+ </div>
89
85
  );
90
86
  };
91
87
 
@@ -2,12 +2,10 @@
2
2
 
3
3
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType AND avatar url renders the image 1`] = `
4
4
  <div
5
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--thumbnail"
6
- style="--circle-size: 48px;"
5
+ class="tw-avatar tw-avatar--48 tw-avatar--thumbnail"
7
6
  >
8
7
  <div
9
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
10
- style="--circle-size: 48px;"
8
+ class="tw-avatar__content"
11
9
  >
12
10
  <img
13
11
  alt=""
@@ -19,12 +17,10 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
19
17
 
20
18
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as BUSINESS profile type with an icon 1`] = `
21
19
  <div
22
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
23
- style="--circle-size: 48px;"
20
+ class="tw-avatar tw-avatar--48 tw-avatar--icon"
24
21
  >
25
22
  <div
26
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
27
- style="--circle-size: 48px;"
23
+ class="tw-avatar__content"
28
24
  >
29
25
  <span
30
26
  class="tw-icon tw-icon-briefcase "
@@ -50,12 +46,10 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
50
46
 
51
47
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as PERSONAL profile type with an icon 1`] = `
52
48
  <div
53
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
54
- style="--circle-size: 48px;"
49
+ class="tw-avatar tw-avatar--48 tw-avatar--icon"
55
50
  >
56
51
  <div
57
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
58
- style="--circle-size: 48px;"
52
+ class="tw-avatar__content"
59
53
  >
60
54
  <span
61
55
  class="tw-icon tw-icon-person "
@@ -87,12 +81,10 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
87
81
  class="tw-badge__children"
88
82
  >
89
83
  <div
90
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
91
- style="--circle-size: 48px;"
84
+ class="tw-avatar tw-avatar--48 tw-avatar--icon"
92
85
  >
93
86
  <div
94
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
95
- style="--circle-size: 48px;"
87
+ class="tw-avatar__content"
96
88
  >
97
89
  <span
98
90
  class="tw-icon tw-icon-person "
@@ -116,8 +108,7 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
116
108
  </div>
117
109
  </div>
118
110
  <div
119
- class="np-circle d-flex align-items-center justify-content-center tw-badge__content"
120
- style="--circle-size: 24px;"
111
+ class="tw-badge__content"
121
112
  >
122
113
  <img
123
114
  alt="badge alt text"
@@ -129,12 +120,10 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
129
120
 
130
121
  exports[`FlowNavigationAvatar with a name AND profileType with nothing passed renders a personal icon 1`] = `
131
122
  <div
132
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
133
- style="--circle-size: 48px;"
123
+ class="tw-avatar tw-avatar--48 tw-avatar--icon"
134
124
  >
135
125
  <div
136
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
137
- style="--circle-size: 48px;"
126
+ class="tw-avatar__content"
138
127
  >
139
128
  <span
140
129
  class="tw-icon tw-icon-person "
@@ -23,10 +23,16 @@
23
23
  }
24
24
  .tw-badge > .tw-badge__content {
25
25
  position: absolute;
26
+ width: var(--badge-size);
27
+ height: var(--badge-size);
26
28
  bottom: 0;
27
29
  right: 0;
28
30
  box-sizing: border-box;
31
+ border-radius: 50%;
29
32
  text-align: center;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
30
36
  overflow: hidden;
31
37
  -webkit-user-select: none;
32
38
  -moz-user-select: none;
@@ -52,11 +52,17 @@
52
52
 
53
53
  & > &__content {
54
54
  position: absolute;
55
+ width: var(--badge-size);
56
+ height: var(--badge-size);
55
57
  bottom: 0;
56
58
  .right(0);
57
59
 
58
60
  box-sizing: border-box;
61
+ border-radius: 50%;
59
62
  text-align: center;
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
60
66
  overflow: hidden;
61
67
  user-select: none;
62
68
 
@@ -11,7 +11,6 @@ import {
11
11
  ThemeLight,
12
12
  CommonProps,
13
13
  } from '../common';
14
- import Circle, { CircleProps } from '../common/circle';
15
14
 
16
15
  /**
17
16
  * @deprecated Use `SizeSmall` or `SizeLarge` instead.
@@ -29,13 +28,6 @@ export type BadgeProps = {
29
28
  'aria-label'?: string;
30
29
  } & CommonProps;
31
30
 
32
- const mapLegacySize = {
33
- [String(Size.SMALL)]: 16,
34
- // medium is deprecated, so we map it to small
35
- [String(Size.MEDIUM)]: 16,
36
- [String(Size.LARGE)]: 24,
37
- } satisfies Record<string, CircleProps['size']>;
38
-
39
31
  const Badge = ({
40
32
  badge,
41
33
  className = undefined,
@@ -58,9 +50,7 @@ const Badge = ({
58
50
  return (
59
51
  <div aria-label={ariaLabel} className={classes}>
60
52
  <div className="tw-badge__children">{children}</div>
61
- <Circle size={mapLegacySize[size]} fixedSize className="tw-badge__content">
62
- {badge}
63
- </Circle>
53
+ <div className="tw-badge__content">{badge}</div>
64
54
  </div>
65
55
  );
66
56
  };
@@ -23,8 +23,8 @@
23
23
  }
24
24
  @media (max-width: 320px) {
25
25
  .np-circular-btn .tw-icon {
26
- top: 8px;
27
- top: var(--size-8);
26
+ top: 12px;
27
+ top: var(--size-12);
28
28
  }
29
29
  }
30
30
  .np-circular-btn .tw-icon > svg {
@@ -19,7 +19,7 @@
19
19
  .left(0);
20
20
 
21
21
  @media (--screen-400-zoom) {
22
- top: var(--size-8);
22
+ top: var(--size-12);
23
23
  }
24
24
 
25
25
  > svg {
@@ -4,6 +4,7 @@ import { ControlType, Priority } from '../common';
4
4
 
5
5
  import { Meta, StoryObj } from '@storybook/react';
6
6
  import CircularButton from './CircularButton';
7
+ import { storyConfig } from '../test-utils';
7
8
 
8
9
  export default {
9
10
  component: CircularButton,
@@ -64,3 +65,5 @@ export const All: Story = {
64
65
  );
65
66
  },
66
67
  };
68
+
69
+ export const All400Zoom: Story = storyConfig(All, { variants: ['400%'] });
@@ -38,7 +38,7 @@ const CircularButton = ({
38
38
  as="input"
39
39
  // @ts-expect-error it's input[type=button] element
40
40
  type="button"
41
- size={isTinyViewport ? 64 : 56}
41
+ size={isTinyViewport ? 72 : 56}
42
42
  aria-label={children}
43
43
  className={classes}
44
44
  disabled={disabled}
@@ -8,7 +8,7 @@ exports[`CircularButton defaults renders a button of type accent and priority pr
8
8
  <input
9
9
  aria-label="Add money"
10
10
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
11
- style="--circle-size: var(--size-56);"
11
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
12
12
  type="button"
13
13
  />
14
14
  <span
@@ -46,7 +46,7 @@ exports[`CircularButton priorities renders primary buttons 1`] = `
46
46
  <input
47
47
  aria-label="Add money"
48
48
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
49
- style="--circle-size: var(--size-56);"
49
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
50
50
  type="button"
51
51
  />
52
52
  <span
@@ -84,7 +84,7 @@ exports[`CircularButton priorities renders primary buttons 2`] = `
84
84
  <input
85
85
  aria-label="Add money"
86
86
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
87
- style="--circle-size: var(--size-56);"
87
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
88
88
  type="button"
89
89
  />
90
90
  <span
@@ -122,7 +122,7 @@ exports[`CircularButton priorities renders primary buttons 3`] = `
122
122
  <input
123
123
  aria-label="Add money"
124
124
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
125
- style="--circle-size: var(--size-56);"
125
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
126
126
  type="button"
127
127
  />
128
128
  <span
@@ -160,7 +160,7 @@ exports[`CircularButton priorities renders secondary buttons 1`] = `
160
160
  <input
161
161
  aria-label="Add money"
162
162
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-2"
163
- style="--circle-size: var(--size-56);"
163
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
164
164
  type="button"
165
165
  />
166
166
  <span
@@ -198,7 +198,7 @@ exports[`CircularButton priorities renders secondary buttons 2`] = `
198
198
  <input
199
199
  aria-label="Add money"
200
200
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-2"
201
- style="--circle-size: var(--size-56);"
201
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
202
202
  type="button"
203
203
  />
204
204
  <span
@@ -236,7 +236,7 @@ exports[`CircularButton priorities renders secondary buttons 3`] = `
236
236
  <input
237
237
  aria-label="Add money"
238
238
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-2"
239
- style="--circle-size: var(--size-56);"
239
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
240
240
  type="button"
241
241
  />
242
242
  <span
@@ -274,7 +274,7 @@ exports[`CircularButton types renders accent buttons 1`] = `
274
274
  <input
275
275
  aria-label="Add money"
276
276
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
277
- style="--circle-size: var(--size-56);"
277
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
278
278
  type="button"
279
279
  />
280
280
  <span
@@ -312,7 +312,7 @@ exports[`CircularButton types renders negative buttons 1`] = `
312
312
  <input
313
313
  aria-label="Add money"
314
314
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
315
- style="--circle-size: var(--size-56);"
315
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
316
316
  type="button"
317
317
  />
318
318
  <span
@@ -350,7 +350,7 @@ exports[`CircularButton types renders positive buttons 1`] = `
350
350
  <input
351
351
  aria-label="Add money"
352
352
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
353
- style="--circle-size: var(--size-56);"
353
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
354
354
  type="button"
355
355
  />
356
356
  <span
@@ -5,3 +5,7 @@
5
5
  height: var(--circle-size);
6
6
  flex-shrink: 0;
7
7
  }
8
+ .np-circle .tw-icon > svg {
9
+ height: var(--circle-icon-size);
10
+ width: var(--circle-icon-size);
11
+ }
@@ -3,4 +3,10 @@
3
3
  width: var(--circle-size);
4
4
  height: var(--circle-size);
5
5
  flex-shrink: 0;
6
+
7
+ // circle like components has custom icon sizes
8
+ .tw-icon > svg {
9
+ height: var(--circle-icon-size);
10
+ width: var(--circle-icon-size);
11
+ }
6
12
  }
@@ -30,14 +30,14 @@ export const Sizes: Story = storyConfig(
30
30
  {
31
31
  render: () => {
32
32
  const content = <Profile size={16} />;
33
- const sizes: CircleProps['size'][] = [32, 40, 48, 56, 72];
33
+ const sizes: CircleProps['size'][] = [16, 24, 32, 40, 48, 56, 72];
34
34
  return (
35
35
  <div
36
36
  style={{
37
37
  gap: '1em',
38
38
  display: 'grid',
39
39
  justifyContent: 'space-between',
40
- gridTemplate: 'auto auto / repeat(5, min-content)',
40
+ gridTemplate: `auto auto / repeat(${sizes.length}, min-content)`,
41
41
  }}
42
42
  >
43
43
  {sizes.map((size) => (
@@ -1,7 +1,9 @@
1
1
  import { HTMLAttributes, forwardRef } from 'react';
2
2
  import { clsx } from 'clsx';
3
+ import { useMedia } from '../hooks/useMedia';
4
+ import { Breakpoint } from '../propsValues/breakpoint';
3
5
 
4
- export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
6
+ export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
5
7
 
6
8
  export type Props = {
7
9
  /**
@@ -19,6 +21,19 @@ export type Props = {
19
21
  fixedSize?: boolean;
20
22
  } & HTMLAttributes<HTMLDivElement>;
21
23
 
24
+ /**
25
+ * circle like components has custom sizes for icons
26
+ */
27
+ const MAP_ICON_SIZE = {
28
+ 16: 12,
29
+ 24: 16,
30
+ 32: 18,
31
+ 40: 20,
32
+ 48: 24,
33
+ 56: 28,
34
+ 72: 36,
35
+ };
36
+
22
37
  const Circle = forwardRef(function Circle(
23
38
  {
24
39
  as: Element = 'div',
@@ -31,11 +46,19 @@ const Circle = forwardRef(function Circle(
31
46
  }: Props,
32
47
  ref,
33
48
  ) {
49
+ const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
34
50
  return (
35
51
  <Element
36
52
  {...props}
37
53
  ref={ref}
38
- style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}
54
+ style={{
55
+ '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,
56
+ '--circle-icon-size':
57
+ isTinyViewport && !fixedSize
58
+ ? `${MAP_ICON_SIZE[size] / 2}px`
59
+ : `${MAP_ICON_SIZE[size]}px`,
60
+ ...style,
61
+ }}
39
62
  className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}
40
63
  >
41
64
  {children}
@@ -21,12 +21,10 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
21
21
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
22
22
  >
23
23
  <div
24
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
25
- style="--circle-size: 48px;"
24
+ class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
26
25
  >
27
26
  <div
28
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
29
- style="--circle-size: 48px;"
27
+ class="tw-avatar__content"
30
28
  >
31
29
  TM
32
30
  </div>
@@ -138,12 +136,10 @@ exports[`FlowNavigation renders as expected 1`] = `
138
136
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
139
137
  >
140
138
  <div
141
- class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
142
- style="--circle-size: 48px;"
139
+ class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
143
140
  >
144
141
  <div
145
- class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
146
- style="--circle-size: 48px;"
142
+ class="tw-avatar__content"
147
143
  >
148
144
  TM
149
145
  </div>
package/src/i18n/de.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
28
28
  "neptune.SelectOption.action.label": "Auswählen",
29
29
  "neptune.SelectOption.selected.action.label": "Ausgewählte Option ändern",
30
+ "neptune.StatusIcon.iconLabel.error": "Fehler:",
31
+ "neptune.StatusIcon.iconLabel.information": "Auskünfte:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Ausstehend:",
33
+ "neptune.StatusIcon.iconLabel.success": "Erfolgreich:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Warnung:",
30
35
  "neptune.Summary.statusDone": "Schritt erledigt",
31
36
  "neptune.Summary.statusNotDone": "Schritt noch zu erledigen",
32
37
  "neptune.Summary.statusPending": "Schritt ausstehend",
package/src/i18n/es.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
28
28
  "neptune.SelectOption.action.label": "Elegir",
29
29
  "neptune.SelectOption.selected.action.label": "Cambiar opción elegida",
30
+ "neptune.StatusIcon.iconLabel.error": "Error:",
31
+ "neptune.StatusIcon.iconLabel.information": "Información:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Pendiente:",
33
+ "neptune.StatusIcon.iconLabel.success": "Éxito:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Advertencia:",
30
35
  "neptune.Summary.statusDone": "Apartado listo",
31
36
  "neptune.Summary.statusNotDone": "Apartado a completar",
32
37
  "neptune.Summary.statusPending": "Apartado pendiente",
package/src/i18n/fr.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
28
28
  "neptune.SelectOption.action.label": "Sélectionner",
29
29
  "neptune.SelectOption.selected.action.label": "Modifier l'option choisie",
30
+ "neptune.StatusIcon.iconLabel.error": "Erreur:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informations:",
32
+ "neptune.StatusIcon.iconLabel.pending": "En attente :",
33
+ "neptune.StatusIcon.iconLabel.success": "Terminé:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Attention:",
30
35
  "neptune.Summary.statusDone": "Validé",
31
36
  "neptune.Summary.statusNotDone": "À compléter",
32
37
  "neptune.Summary.statusPending": "En attente",
package/src/i18n/hu.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Nincs találat",
28
28
  "neptune.SelectOption.action.label": "Kiválasztás",
29
29
  "neptune.SelectOption.selected.action.label": "Kiválasztott opció módosítása",
30
+ "neptune.StatusIcon.iconLabel.error": "Hiba:",
31
+ "neptune.StatusIcon.iconLabel.information": "Információ:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Függőben:",
33
+ "neptune.StatusIcon.iconLabel.success": "Siker:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Figyelmeztetés:",
30
35
  "neptune.Summary.statusDone": "Kész",
31
36
  "neptune.Summary.statusNotDone": "Hátravan",
32
37
  "neptune.Summary.statusPending": "Függőben",
package/src/i18n/id.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
28
28
  "neptune.SelectOption.action.label": "Pilih",
29
29
  "neptune.SelectOption.selected.action.label": "Ubah opsi yang dipilih",
30
+ "neptune.StatusIcon.iconLabel.error": "Kesalahan:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informasi:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Tertunda:",
33
+ "neptune.StatusIcon.iconLabel.success": "Berhasil:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Peringatan:",
30
35
  "neptune.Summary.statusDone": "Item selesai",
31
36
  "neptune.Summary.statusNotDone": "Item yang harus dilakukan",
32
37
  "neptune.Summary.statusPending": "Item tertunda",
package/src/i18n/it.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
28
28
  "neptune.SelectOption.action.label": "Scegli",
29
29
  "neptune.SelectOption.selected.action.label": "Modifica l'opzione scelta",
30
+ "neptune.StatusIcon.iconLabel.error": "Errore:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informazioni:",
32
+ "neptune.StatusIcon.iconLabel.pending": "In attesa:",
33
+ "neptune.StatusIcon.iconLabel.success": "Fatto:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Attenzione:",
30
35
  "neptune.Summary.statusDone": "Completato",
31
36
  "neptune.Summary.statusNotDone": "Da completare",
32
37
  "neptune.Summary.statusPending": "In corso",
package/src/i18n/ja.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
28
28
  "neptune.SelectOption.action.label": "選択してください",
29
29
  "neptune.SelectOption.selected.action.label": "選択したオプションを変更する",
30
+ "neptune.StatusIcon.iconLabel.error": "エラー:",
31
+ "neptune.StatusIcon.iconLabel.information": "情報:",
32
+ "neptune.StatusIcon.iconLabel.pending": "保留中:",
33
+ "neptune.StatusIcon.iconLabel.success": "完了:",
34
+ "neptune.StatusIcon.iconLabel.warning": "警告:",
30
35
  "neptune.Summary.statusDone": "完了",
31
36
  "neptune.Summary.statusNotDone": "未完了",
32
37
  "neptune.Summary.statusPending": "保留中",
package/src/i18n/pl.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
28
28
  "neptune.SelectOption.action.label": "Wybierz",
29
29
  "neptune.SelectOption.selected.action.label": "Zmień wybraną opcję",
30
+ "neptune.StatusIcon.iconLabel.error": "Błąd:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informacje:",
32
+ "neptune.StatusIcon.iconLabel.pending": "W toku:",
33
+ "neptune.StatusIcon.iconLabel.success": "Gotowe:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Ostrzeżenie:",
30
35
  "neptune.Summary.statusDone": "Czynność wykonana",
31
36
  "neptune.Summary.statusNotDone": "Czynność do wykonania",
32
37
  "neptune.Summary.statusPending": "Czynność oczekująca",
package/src/i18n/pt.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
28
28
  "neptune.SelectOption.action.label": "Selecionar",
29
29
  "neptune.SelectOption.selected.action.label": "Altere a opção escolhida",
30
+ "neptune.StatusIcon.iconLabel.error": "Erro:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informação:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Pendente:",
33
+ "neptune.StatusIcon.iconLabel.success": "Concluído:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Aviso:",
30
35
  "neptune.Summary.statusDone": "Pronto",
31
36
  "neptune.Summary.statusNotDone": "Não iniciado",
32
37
  "neptune.Summary.statusPending": "Pendente",
package/src/i18n/ro.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
28
28
  "neptune.SelectOption.action.label": "Alege",
29
29
  "neptune.SelectOption.selected.action.label": "Schimbă opțiunea aleasă",
30
+ "neptune.StatusIcon.iconLabel.error": "Eroare:",
31
+ "neptune.StatusIcon.iconLabel.information": "Informații:",
32
+ "neptune.StatusIcon.iconLabel.pending": "În așteptare:",
33
+ "neptune.StatusIcon.iconLabel.success": "Gata:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Avertisment:",
30
35
  "neptune.Summary.statusDone": "Finalizat",
31
36
  "neptune.Summary.statusNotDone": "De făcut",
32
37
  "neptune.Summary.statusPending": "În așteptare",
package/src/i18n/ru.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Ничего не найдено",
28
28
  "neptune.SelectOption.action.label": "Выбрать",
29
29
  "neptune.SelectOption.selected.action.label": "Изменить выбранный вариант",
30
+ "neptune.StatusIcon.iconLabel.error": "Ошибка:",
31
+ "neptune.StatusIcon.iconLabel.information": "Информация:",
32
+ "neptune.StatusIcon.iconLabel.pending": "В ожидании:",
33
+ "neptune.StatusIcon.iconLabel.success": "Готово:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Внимание:",
30
35
  "neptune.Summary.statusDone": "Этап завершен",
31
36
  "neptune.Summary.statusNotDone": "Этап к выполнению",
32
37
  "neptune.Summary.statusPending": "Этап в процессе",
package/src/i18n/tr.json CHANGED
@@ -27,6 +27,11 @@
27
27
  "neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
28
28
  "neptune.SelectOption.action.label": "Seç",
29
29
  "neptune.SelectOption.selected.action.label": "Seçilen opsiyonu değiştir",
30
+ "neptune.StatusIcon.iconLabel.error": "Hata:",
31
+ "neptune.StatusIcon.iconLabel.information": "Bilgi:",
32
+ "neptune.StatusIcon.iconLabel.pending": "Bekliyor:",
33
+ "neptune.StatusIcon.iconLabel.success": "Başarılı:",
34
+ "neptune.StatusIcon.iconLabel.warning": "Uyarı:",
30
35
  "neptune.Summary.statusDone": "Tamamlanan aşama",
31
36
  "neptune.Summary.statusNotDone": "Yapılacak",
32
37
  "neptune.Summary.statusPending": "Bekliyor",