@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.
- package/build/alert/Alert.js +17 -13
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +17 -13
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatar/Avatar.js +2 -7
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +2 -7
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/badge/Badge.js +1 -10
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +1 -10
- package/build/badge/Badge.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/circle/Circle.js +15 -2
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +15 -2
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/i18n/de.json +5 -0
- package/build/i18n/de.json.js +5 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +5 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/es.json +5 -0
- package/build/i18n/es.json.js +5 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +5 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +5 -0
- package/build/i18n/fr.json.js +5 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +5 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +5 -0
- package/build/i18n/hu.json.js +5 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +5 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +5 -0
- package/build/i18n/id.json.js +5 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +5 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +5 -0
- package/build/i18n/it.json.js +5 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +5 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +5 -0
- package/build/i18n/ja.json.js +5 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +5 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +5 -0
- package/build/i18n/pl.json.js +5 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +5 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +5 -0
- package/build/i18n/pt.json.js +5 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +5 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +5 -0
- package/build/i18n/ro.json.js +5 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +5 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +5 -0
- package/build/i18n/ru.json.js +5 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +5 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/tr.json +5 -0
- package/build/i18n/tr.json.js +5 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +5 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/main.css +46 -22
- package/build/statusIcon/StatusIcon.js +4 -4
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +4 -4
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatar/Avatar.css +29 -0
- package/build/styles/badge/Badge.css +6 -0
- package/build/styles/circularButton/CircularButton.css +2 -2
- package/build/styles/common/circle/Circle.css +4 -0
- package/build/styles/main.css +46 -22
- package/build/styles/statusIcon/StatusIcon.css +0 -20
- package/build/types/alert/Alert.d.ts +3 -11
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -1
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +7 -3
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.spec.story.tsx +85 -4
- package/src/alert/Alert.spec.tsx +36 -14
- package/src/alert/Alert.story.tsx +50 -35
- package/src/alert/Alert.tsx +22 -23
- package/src/avatar/Avatar.css +29 -0
- package/src/avatar/Avatar.less +12 -0
- package/src/avatar/Avatar.tsx +4 -8
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +11 -22
- package/src/badge/Badge.css +6 -0
- package/src/badge/Badge.less +6 -0
- package/src/badge/Badge.tsx +1 -11
- package/src/circularButton/CircularButton.css +2 -2
- package/src/circularButton/CircularButton.less +1 -1
- package/src/circularButton/CircularButton.story.tsx +3 -0
- package/src/circularButton/CircularButton.tsx +1 -1
- package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +10 -10
- package/src/common/circle/Circle.css +4 -0
- package/src/common/circle/Circle.less +6 -0
- package/src/common/circle/Circle.story.tsx +2 -2
- package/src/common/circle/Circle.tsx +25 -2
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +4 -8
- package/src/i18n/de.json +5 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/hu.json +5 -0
- package/src/i18n/id.json +5 -0
- package/src/i18n/it.json +5 -0
- package/src/i18n/ja.json +5 -0
- package/src/i18n/pl.json +5 -0
- package/src/i18n/pt.json +5 -0
- package/src/i18n/ro.json +5 -0
- package/src/i18n/ru.json +5 -0
- package/src/i18n/tr.json +5 -0
- package/src/main.css +46 -22
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +2 -4
- package/src/promoCard/PromoCard.spec.tsx +1 -1
- package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +2 -4
- package/src/statusIcon/StatusIcon.css +0 -20
- package/src/statusIcon/StatusIcon.less +0 -17
- package/src/statusIcon/StatusIcon.spec.tsx +2 -21
- package/src/statusIcon/StatusIcon.story.tsx +32 -1
- package/src/statusIcon/StatusIcon.tsx +11 -10
package/src/avatar/Avatar.tsx
CHANGED
|
@@ -65,9 +65,7 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
65
65
|
const size = backwardsCompatibleSize(sizeFromProps);
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
|
-
<
|
|
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
|
-
<
|
|
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
|
-
</
|
|
88
|
-
</
|
|
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="
|
|
6
|
-
style="--circle-size: 48px;"
|
|
5
|
+
class="tw-avatar tw-avatar--48 tw-avatar--thumbnail"
|
|
7
6
|
>
|
|
8
7
|
<div
|
|
9
|
-
class="
|
|
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="
|
|
23
|
-
style="--circle-size: 48px;"
|
|
20
|
+
class="tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
24
21
|
>
|
|
25
22
|
<div
|
|
26
|
-
class="
|
|
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="
|
|
54
|
-
style="--circle-size: 48px;"
|
|
49
|
+
class="tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
55
50
|
>
|
|
56
51
|
<div
|
|
57
|
-
class="
|
|
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="
|
|
91
|
-
style="--circle-size: 48px;"
|
|
84
|
+
class="tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
92
85
|
>
|
|
93
86
|
<div
|
|
94
|
-
class="
|
|
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="
|
|
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="
|
|
133
|
-
style="--circle-size: 48px;"
|
|
123
|
+
class="tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
134
124
|
>
|
|
135
125
|
<div
|
|
136
|
-
class="
|
|
137
|
-
style="--circle-size: 48px;"
|
|
126
|
+
class="tw-avatar__content"
|
|
138
127
|
>
|
|
139
128
|
<span
|
|
140
129
|
class="tw-icon tw-icon-person "
|
package/src/badge/Badge.css
CHANGED
|
@@ -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;
|
package/src/badge/Badge.less
CHANGED
|
@@ -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
|
|
package/src/badge/Badge.tsx
CHANGED
|
@@ -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
|
-
<
|
|
62
|
-
{badge}
|
|
63
|
-
</Circle>
|
|
53
|
+
<div className="tw-badge__content">{badge}</div>
|
|
64
54
|
</div>
|
|
65
55
|
);
|
|
66
56
|
};
|
|
@@ -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%'] });
|
|
@@ -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
|
|
@@ -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:
|
|
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 |
|
|
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={{
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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",
|