@transferwise/components 0.0.0-experimental-8109a86 → 0.0.0-experimental-02ea5b3
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/avatarView/AvatarView.js +5 -5
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +5 -5
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/common/circle/Circle.js +3 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +3 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/i18n/zh-HK.json +5 -0
- package/build/i18n/zh-HK.json.js +5 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +5 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/main.css +0 -35
- package/build/styles/avatarView/AvatarView.css +0 -6
- package/build/styles/main.css +0 -35
- package/build/types/avatarView/AvatarView.d.ts +1 -1
- package/build/types/avatarView/AvatarView.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatarView/AvatarView.css +0 -6
- package/src/avatarView/AvatarView.less +1 -7
- package/src/avatarView/AvatarView.story.tsx +20 -54
- package/src/avatarView/AvatarView.tsx +4 -4
- package/src/circularButton/CircularButton.spec.tsx +0 -36
- package/src/common/circle/Circle.less +2 -2
- package/src/common/circle/Circle.tsx +3 -1
- package/src/flowNavigation/FlowNavigation.story.tsx +16 -11
- package/src/i18n/zh-HK.json +5 -0
- package/src/main.css +0 -35
- package/src/main.less +0 -1
- package/src/overlayHeader/OverlayHeader.story.tsx +2 -5
- package/build/styles/avatarGroup/AvatarGroup.css +0 -29
- package/build/types/avatarGroup/AvatarGroup.d.ts +0 -18
- package/build/types/avatarGroup/AvatarGroup.d.ts.map +0 -1
- package/build/types/avatarGroup/index.d.ts +0 -3
- package/build/types/avatarGroup/index.d.ts.map +0 -1
- package/src/avatarGroup/AvatarGroup.css +0 -29
- package/src/avatarGroup/AvatarGroup.less +0 -42
- package/src/avatarGroup/AvatarGroup.story.tsx +0 -284
- package/src/avatarGroup/AvatarGroup.tsx +0 -117
- package/src/avatarGroup/index.ts +0 -2
- package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +0 -381
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '@transferwise/icons';
|
|
21
21
|
import AvatarView, { AvatarViewProps } from '.';
|
|
22
22
|
import { Flag } from '@wise/art';
|
|
23
|
-
import { getBrandColorFromSeed, getInitials } from '../common';
|
|
23
|
+
import { getBrandColorFromSeed, getInitials, ProfileType } from '../common';
|
|
24
24
|
import Display from '../display';
|
|
25
25
|
|
|
26
26
|
export default {
|
|
@@ -98,40 +98,6 @@ export const Notification: Story = {
|
|
|
98
98
|
),
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
export const Test: Story = {
|
|
102
|
-
// tags: ['autodocs'],
|
|
103
|
-
render: () => (
|
|
104
|
-
<div>
|
|
105
|
-
<AvatarView
|
|
106
|
-
imgSrc="../avatar-square-dude.webp"
|
|
107
|
-
size={72}
|
|
108
|
-
badge={{
|
|
109
|
-
flagCode: 'EU',
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
112
|
-
<AvatarView
|
|
113
|
-
imgSrc="../avatar-square-dude.webp"
|
|
114
|
-
size={72}
|
|
115
|
-
badge={{
|
|
116
|
-
asset: (
|
|
117
|
-
<div
|
|
118
|
-
className="d-flex align-items-center justify-content-center"
|
|
119
|
-
style={{
|
|
120
|
-
backgroundColor: 'var(--color-bright-pink)',
|
|
121
|
-
color: 'var(--color-interactive-primary)',
|
|
122
|
-
width: '100%',
|
|
123
|
-
height: '100%',
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
<Leaf />
|
|
127
|
-
</div>
|
|
128
|
-
),
|
|
129
|
-
}}
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
),
|
|
133
|
-
};
|
|
134
|
-
|
|
135
101
|
export const Badge: Story = {
|
|
136
102
|
tags: ['autodocs'],
|
|
137
103
|
render: () => {
|
|
@@ -160,7 +126,7 @@ export const Badge: Story = {
|
|
|
160
126
|
</AvatarView>
|
|
161
127
|
))}
|
|
162
128
|
|
|
163
|
-
{sizes.map((size
|
|
129
|
+
{sizes.map((size) => (
|
|
164
130
|
<AvatarView
|
|
165
131
|
key={size}
|
|
166
132
|
size={size}
|
|
@@ -169,7 +135,7 @@ export const Badge: Story = {
|
|
|
169
135
|
/>
|
|
170
136
|
))}
|
|
171
137
|
|
|
172
|
-
{sizes.map((size
|
|
138
|
+
{sizes.map((size) => (
|
|
173
139
|
<AvatarView
|
|
174
140
|
key={size}
|
|
175
141
|
size={size}
|
|
@@ -292,7 +258,7 @@ export const Images: Story = {
|
|
|
292
258
|
interactive
|
|
293
259
|
imgSrc="../avatar-square-dude.webp"
|
|
294
260
|
profileName="Test Name"
|
|
295
|
-
profileType=
|
|
261
|
+
profileType={ProfileType.BUSINESS}
|
|
296
262
|
/>
|
|
297
263
|
))}
|
|
298
264
|
{sizes.map((size) => (
|
|
@@ -301,7 +267,7 @@ export const Images: Story = {
|
|
|
301
267
|
size={size}
|
|
302
268
|
imgSrc="../avatar-square-dude.webp"
|
|
303
269
|
profileName="Test Name"
|
|
304
|
-
profileType=
|
|
270
|
+
profileType={ProfileType.BUSINESS}
|
|
305
271
|
/>
|
|
306
272
|
))}
|
|
307
273
|
{sizes.map((size) => (
|
|
@@ -343,7 +309,7 @@ export const Profiles: Story = {
|
|
|
343
309
|
size={size}
|
|
344
310
|
imgSrc="../avatar-square-dude.webp"
|
|
345
311
|
profileName="Test Name"
|
|
346
|
-
profileType=
|
|
312
|
+
profileType={ProfileType.BUSINESS}
|
|
347
313
|
/>
|
|
348
314
|
))}
|
|
349
315
|
|
|
@@ -354,7 +320,7 @@ export const Profiles: Story = {
|
|
|
354
320
|
interactive
|
|
355
321
|
imgSrc="../avatar-square-dude.webp"
|
|
356
322
|
profileName="Test Name"
|
|
357
|
-
profileType=
|
|
323
|
+
profileType={ProfileType.BUSINESS}
|
|
358
324
|
/>
|
|
359
325
|
))}
|
|
360
326
|
|
|
@@ -367,11 +333,11 @@ export const Profiles: Story = {
|
|
|
367
333
|
))}
|
|
368
334
|
|
|
369
335
|
{sizes.map((size) => (
|
|
370
|
-
<AvatarView key={size} size={size} profileType=
|
|
336
|
+
<AvatarView key={size} size={size} profileType={ProfileType.BUSINESS} />
|
|
371
337
|
))}
|
|
372
338
|
|
|
373
339
|
{sizes.map((size) => (
|
|
374
|
-
<AvatarView key={size} size={size} interactive profileType=
|
|
340
|
+
<AvatarView key={size} size={size} interactive profileType={ProfileType.BUSINESS} />
|
|
375
341
|
))}
|
|
376
342
|
|
|
377
343
|
{sizes.map((size) => (
|
|
@@ -387,13 +353,17 @@ export const Profiles: Story = {
|
|
|
387
353
|
};
|
|
388
354
|
|
|
389
355
|
export const ProfileBrokenImageFallback: Story = {
|
|
390
|
-
render: () =>
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
356
|
+
render: () => {
|
|
357
|
+
const assetUrl = 'https://test.com/img-wrong-url.test';
|
|
358
|
+
return (
|
|
359
|
+
<>
|
|
360
|
+
<AvatarView />
|
|
361
|
+
<AvatarView imgSrc={assetUrl} />
|
|
362
|
+
<AvatarView imgSrc={assetUrl} profileType={ProfileType.BUSINESS} />
|
|
363
|
+
<AvatarView imgSrc={assetUrl} profileType={ProfileType.BUSINESS} profileName="Test Name" />
|
|
364
|
+
</>
|
|
365
|
+
);
|
|
366
|
+
},
|
|
397
367
|
};
|
|
398
368
|
|
|
399
369
|
export const EdgeInstaces: Story = {
|
|
@@ -412,7 +382,6 @@ export const EdgeInstaces: Story = {
|
|
|
412
382
|
}}
|
|
413
383
|
>
|
|
414
384
|
<style>{css}</style>
|
|
415
|
-
{/* <Body>- Custom colors</Body> */}
|
|
416
385
|
<AvatarView
|
|
417
386
|
interactive
|
|
418
387
|
badge={{ flagCode: 'EU' }}
|
|
@@ -426,14 +395,12 @@ export const EdgeInstaces: Story = {
|
|
|
426
395
|
>
|
|
427
396
|
<Money />
|
|
428
397
|
</AvatarView>
|
|
429
|
-
{/* <Body>- Add example with dashed avatar as in shared balances</Body> */}
|
|
430
398
|
<AvatarView interactive className="custom-variant">
|
|
431
399
|
<PlusCircle />
|
|
432
400
|
</AvatarView>
|
|
433
401
|
<AvatarView interactive className="custom-variant">
|
|
434
402
|
{null}
|
|
435
403
|
</AvatarView>
|
|
436
|
-
{/* <Body> - Add example custom backgrounds as in account summary (https://wise.com/account-summary)</Body> */}
|
|
437
404
|
<AvatarView style={{ color: 'rgb(22, 51, 0)', backgroundColor: 'rgb(203, 217, 195)' }}>
|
|
438
405
|
<Graph />
|
|
439
406
|
</AvatarView>
|
|
@@ -452,7 +419,6 @@ export const EdgeInstaces: Story = {
|
|
|
452
419
|
>
|
|
453
420
|
<Rewards />
|
|
454
421
|
</AvatarView>
|
|
455
|
-
{/* <Body>- Add example Wise Sand + custom background from hash</Body> */}
|
|
456
422
|
<AvatarView
|
|
457
423
|
badge={{ flagCode: 'EU' }}
|
|
458
424
|
style={{ backgroundColor: getBrandColorFromSeed(profileName1) }}
|
|
@@ -46,8 +46,8 @@ function AvatarView({
|
|
|
46
46
|
className,
|
|
47
47
|
style,
|
|
48
48
|
imgSrc,
|
|
49
|
-
profileType
|
|
50
|
-
profileName
|
|
49
|
+
profileType,
|
|
50
|
+
profileName,
|
|
51
51
|
...restProps
|
|
52
52
|
}: Props) {
|
|
53
53
|
return (
|
|
@@ -73,7 +73,7 @@ function AvatarView({
|
|
|
73
73
|
...style,
|
|
74
74
|
}}
|
|
75
75
|
>
|
|
76
|
-
<AvatarViewContent {...{ imgSrc, profileType
|
|
76
|
+
<AvatarViewContent {...{ imgSrc, profileType, profileName }}>
|
|
77
77
|
{children}
|
|
78
78
|
</AvatarViewContent>
|
|
79
79
|
</Circle>
|
|
@@ -93,7 +93,7 @@ const MAP_BADGE_ASSET_SIZE = {
|
|
|
93
93
|
72: 24,
|
|
94
94
|
} satisfies Record<number, BadgeAssetsProps['size']>;
|
|
95
95
|
|
|
96
|
-
/** Certain sizes of AvatarView has a custom offset
|
|
96
|
+
/** Certain sizes of AvatarView has a custom offset for badge */
|
|
97
97
|
const MAP_BADGE_POSITION = {
|
|
98
98
|
24: -6,
|
|
99
99
|
32: -4,
|
|
@@ -34,10 +34,6 @@ describe('CircularButton', () => {
|
|
|
34
34
|
it('is not disabled', () => {
|
|
35
35
|
expect(screen.getByRole('button')).toBeEnabled();
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
it('renders a button of type accent and priority primary', () => {
|
|
39
|
-
expect(render(<CircularButton {...props} />).container).toMatchSnapshot();
|
|
40
|
-
});
|
|
41
37
|
});
|
|
42
38
|
|
|
43
39
|
describe('button attributes', () => {
|
|
@@ -69,36 +65,4 @@ describe('CircularButton', () => {
|
|
|
69
65
|
expect(onClick).toHaveBeenCalledTimes(0);
|
|
70
66
|
});
|
|
71
67
|
});
|
|
72
|
-
|
|
73
|
-
describe('types', () => {
|
|
74
|
-
it('renders accent buttons', () => {
|
|
75
|
-
expect(render(<CircularButton {...props} type={ACCENT} />).container).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('renders positive buttons', () => {
|
|
79
|
-
expect(render(<CircularButton {...props} type={POSITIVE} />).container).toMatchSnapshot();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('renders negative buttons', () => {
|
|
83
|
-
expect(render(<CircularButton {...props} type={NEGATIVE} />).container).toMatchSnapshot();
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
describe('priorities', () => {
|
|
88
|
-
it('renders primary buttons', () => {
|
|
89
|
-
[ACCENT, POSITIVE, NEGATIVE].forEach((type) =>
|
|
90
|
-
expect(
|
|
91
|
-
render(<CircularButton {...props} priority={PRIMARY} type={type} />).container,
|
|
92
|
-
).toMatchSnapshot(),
|
|
93
|
-
);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('renders secondary buttons', () => {
|
|
97
|
-
[ACCENT, POSITIVE, NEGATIVE].forEach((type) =>
|
|
98
|
-
expect(
|
|
99
|
-
render(<CircularButton {...props} priority={SECONDARY} type={type} />).container,
|
|
100
|
-
).toMatchSnapshot(),
|
|
101
|
-
);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
68
|
});
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
--circle-border-color: var(--color-border-neutral);
|
|
8
8
|
--circle-border-width: 1px;
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// circle like components have custom typography styles for for default (Inter) font
|
|
11
11
|
font-size: var(--circle-font-size);
|
|
12
12
|
font-weight: var(--font-weight-semi-bold);
|
|
13
13
|
line-height: 1;
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// circle like components have custom typography styles for Wise Sand font
|
|
16
16
|
.np-display {
|
|
17
17
|
font-size: var(--circle-font-size);
|
|
18
18
|
}
|
|
@@ -36,7 +36,9 @@ const MAP_ICON_SIZE = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* circle like components have custom
|
|
39
|
+
* circle like components have custom typography styles for for default (Inter) font
|
|
40
|
+
*
|
|
41
|
+
* circle size : font size (px)
|
|
40
42
|
*/
|
|
41
43
|
const MAP_FONT_SIZE = {
|
|
42
44
|
16: 8,
|
|
@@ -21,19 +21,20 @@ export default {
|
|
|
21
21
|
export const Variants = () => {
|
|
22
22
|
const [activeStep, setActiveStep] = useState(2);
|
|
23
23
|
const [closed, setClosed] = useState(false);
|
|
24
|
-
const
|
|
24
|
+
const profileType = select(
|
|
25
|
+
'avatar',
|
|
26
|
+
[ProfileType.PERSONAL, ProfileType.BUSINESS],
|
|
27
|
+
ProfileType.PERSONAL,
|
|
28
|
+
);
|
|
25
29
|
const showCloseButton = boolean('show closeButton', true);
|
|
26
30
|
const showMobileBackButton = boolean('show mobile backButton', true);
|
|
27
31
|
const done = boolean('done', false);
|
|
28
|
-
const avatarURL = text(
|
|
29
|
-
'avatarURL',
|
|
30
|
-
'https://wise.com/web-art/assets/illustrations/heart-small@2x.webp',
|
|
31
|
-
);
|
|
32
|
+
const avatarURL = text('avatarURL', '../tapestry-01.png');
|
|
32
33
|
|
|
33
34
|
return !closed ? (
|
|
34
35
|
<>
|
|
35
36
|
<FlowNavigation
|
|
36
|
-
avatar={!
|
|
37
|
+
avatar={!profileType ? null : <AvatarView profileType={profileType} />}
|
|
37
38
|
logo={<Logo />}
|
|
38
39
|
activeStep={activeStep}
|
|
39
40
|
done={done}
|
|
@@ -110,7 +111,7 @@ export const Variants = () => {
|
|
|
110
111
|
|
|
111
112
|
<FlowNavigation
|
|
112
113
|
done={done}
|
|
113
|
-
avatar={<AvatarView imgSrc={avatarURL} profileType={
|
|
114
|
+
avatar={<AvatarView imgSrc={avatarURL} profileType={profileType} />}
|
|
114
115
|
activeStep={activeStep}
|
|
115
116
|
steps={[
|
|
116
117
|
{
|
|
@@ -156,7 +157,7 @@ export const Variants = () => {
|
|
|
156
157
|
{/* Instance of always `done` FlowNav for visual testing */}
|
|
157
158
|
<FlowNavigation
|
|
158
159
|
done
|
|
159
|
-
avatar={<AvatarView imgSrc={avatarURL} profileType={
|
|
160
|
+
avatar={<AvatarView imgSrc={avatarURL} profileType={profileType} />}
|
|
160
161
|
activeStep={activeStep}
|
|
161
162
|
steps={[
|
|
162
163
|
{ label: 'Recipient', hoverLabel: 'Daniele Tomboro', onClick: () => setActiveStep(0) },
|
|
@@ -246,7 +247,11 @@ export const SendFlow = () => {
|
|
|
246
247
|
export const WithOverlayHeaderComparison = () => {
|
|
247
248
|
const [activeStep, setActiveStep] = useState(4);
|
|
248
249
|
const [closed, setClosed] = useState(false);
|
|
249
|
-
const
|
|
250
|
+
const profileType = select(
|
|
251
|
+
'avatar',
|
|
252
|
+
[ProfileType.PERSONAL, ProfileType.BUSINESS],
|
|
253
|
+
ProfileType.PERSONAL,
|
|
254
|
+
);
|
|
250
255
|
const showCloseButton = boolean('show closeButton', true);
|
|
251
256
|
const showMobileBackButton = boolean('show mobile backButton', true);
|
|
252
257
|
const done = boolean('done', false);
|
|
@@ -255,7 +260,7 @@ export const WithOverlayHeaderComparison = () => {
|
|
|
255
260
|
<>
|
|
256
261
|
<div style={{ border: '1px solid #e8e8e8' }}>
|
|
257
262
|
<FlowNavigation
|
|
258
|
-
avatar={
|
|
263
|
+
avatar={profileType ? <AvatarView profileType={profileType} /> : null}
|
|
259
264
|
activeStep={activeStep}
|
|
260
265
|
done={done}
|
|
261
266
|
steps={[]}
|
|
@@ -269,7 +274,7 @@ export const WithOverlayHeaderComparison = () => {
|
|
|
269
274
|
</div>
|
|
270
275
|
<div style={{ border: '1px solid #e8e8e8' }}>
|
|
271
276
|
<OverlayHeader
|
|
272
|
-
avatar={
|
|
277
|
+
avatar={profileType ? <AvatarView profileType={profileType} /> : null}
|
|
273
278
|
onClose={showCloseButton ? () => setClosed(true) : undefined}
|
|
274
279
|
/>
|
|
275
280
|
</div>
|
package/src/i18n/zh-HK.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/main.css
CHANGED
|
@@ -499,47 +499,12 @@ div.critical-comms .critical-comms-body {
|
|
|
499
499
|
background-color: rgba(134,167,189,0.10196);
|
|
500
500
|
background-color: var(--color-background-neutral);
|
|
501
501
|
}
|
|
502
|
-
.np-avatar-view-interactive:hover {
|
|
503
|
-
background-color: var(--color-background-neutral-hover);
|
|
504
|
-
}
|
|
505
|
-
.np-avatar-view-interactive:active {
|
|
506
|
-
background-color: var(--color-background-neutral-active);
|
|
507
|
-
}
|
|
508
502
|
.np-avatar-view-non-interactive .np-circle {
|
|
509
503
|
background-color: transparent;
|
|
510
504
|
}
|
|
511
505
|
.np-avatar-view-non-interactive .np-avatar-view-content .wds-flag {
|
|
512
506
|
box-shadow: none;
|
|
513
507
|
}
|
|
514
|
-
.np-avatar-group {
|
|
515
|
-
display: inline-flex;
|
|
516
|
-
position: relative;
|
|
517
|
-
}
|
|
518
|
-
.np-avatar-group-diagonal {
|
|
519
|
-
width: var(--np-avatar-group-size);
|
|
520
|
-
height: var(--np-avatar-group-size);
|
|
521
|
-
}
|
|
522
|
-
.np-avatar-group-diagonal-mask {
|
|
523
|
-
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
524
|
-
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
525
|
-
}
|
|
526
|
-
.np-avatar-group-diagonal-child {
|
|
527
|
-
position: absolute;
|
|
528
|
-
top: var(--np-avatar-group-diagonal-child-position);
|
|
529
|
-
right: 0;
|
|
530
|
-
}
|
|
531
|
-
.np-avatar-group-horizontal {
|
|
532
|
-
height: var(--np-avatar-group-size);
|
|
533
|
-
}
|
|
534
|
-
.np-avatar-group-horizontal-mask {
|
|
535
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
536
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
537
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
538
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
539
|
-
}
|
|
540
|
-
.np-avatar-group-horizontal-child {
|
|
541
|
-
margin-left: calc(var(--np-avatar-group-horizontal-child-position) * -1);
|
|
542
|
-
}
|
|
543
508
|
.tw-badge {
|
|
544
509
|
position: relative;
|
|
545
510
|
display: inline-block;
|
package/src/main.less
CHANGED
|
@@ -35,10 +35,7 @@ export const Basic = () => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export const WithAvatarWrapper = () => {
|
|
38
|
-
const avatarURL = text(
|
|
39
|
-
'avatarURL',
|
|
40
|
-
'https://wise.com/web-art/assets/illustrations/heart-small@2x.webp',
|
|
41
|
-
);
|
|
38
|
+
const avatarURL = text('avatarURL', '../tapestry-01.png');
|
|
42
39
|
const profileType = select(
|
|
43
40
|
'profileType',
|
|
44
41
|
[ProfileType.PERSONAL, ProfileType.BUSINESS],
|
|
@@ -47,7 +44,7 @@ export const WithAvatarWrapper = () => {
|
|
|
47
44
|
return (
|
|
48
45
|
<OverlayHeader
|
|
49
46
|
logo={<Logo />}
|
|
50
|
-
avatar={<AvatarView imgSrc={avatarURL} profileType={profileType
|
|
47
|
+
avatar={<AvatarView imgSrc={avatarURL} profileType={profileType} />}
|
|
51
48
|
onClose={action('Close clicked')}
|
|
52
49
|
/>
|
|
53
50
|
);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.np-avatar-group {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
.np-avatar-group-diagonal {
|
|
6
|
-
width: var(--np-avatar-group-size);
|
|
7
|
-
height: var(--np-avatar-group-size);
|
|
8
|
-
}
|
|
9
|
-
.np-avatar-group-diagonal-mask {
|
|
10
|
-
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
11
|
-
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
12
|
-
}
|
|
13
|
-
.np-avatar-group-diagonal-child {
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: var(--np-avatar-group-diagonal-child-position);
|
|
16
|
-
right: 0;
|
|
17
|
-
}
|
|
18
|
-
.np-avatar-group-horizontal {
|
|
19
|
-
height: var(--np-avatar-group-size);
|
|
20
|
-
}
|
|
21
|
-
.np-avatar-group-horizontal-mask {
|
|
22
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
23
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
24
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
25
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
26
|
-
}
|
|
27
|
-
.np-avatar-group-horizontal-child {
|
|
28
|
-
margin-left: calc(var(--np-avatar-group-horizontal-child-position) * -1);
|
|
29
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CommonProps } from '../common';
|
|
2
|
-
import { AvatarViewProps } from '../avatarView';
|
|
3
|
-
type AvatarType = {
|
|
4
|
-
asset?: AvatarViewProps['children'];
|
|
5
|
-
} & Omit<AvatarViewProps, 'notification' | 'selected' | 'size' | 'badge' | 'action' | 'children'>;
|
|
6
|
-
type AvatarGroupOrientation = 'horizontal' | 'diagonal';
|
|
7
|
-
type AvatarGroupDiagonalSize = 24 | 32 | 40 | 48 | 56 | 72;
|
|
8
|
-
type AvatarGroupSize = 16 | AvatarGroupDiagonalSize;
|
|
9
|
-
export type Props = {
|
|
10
|
-
'aria-label'?: string;
|
|
11
|
-
avatars: AvatarType[];
|
|
12
|
-
orientation?: AvatarGroupOrientation;
|
|
13
|
-
size?: AvatarGroupSize;
|
|
14
|
-
interactive?: boolean;
|
|
15
|
-
} & CommonProps;
|
|
16
|
-
export default function AvatarGroup({ avatars, orientation, size: groupSize, 'aria-label': ariaLabel, className, interactive, }: Props): import("react").JSX.Element;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=AvatarGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../../src/avatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,KAAK,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;CAAE,GAAG,IAAI,CAC9D,eAAe,EACf,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CACvE,CAAC;AACF,KAAK,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AACxD,KAAK,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC3D,KAAK,eAAe,GAAG,EAAE,GAAG,uBAAuB,CAAC;AAqCpD,MAAM,MAAM,KAAK,GAAG;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,WAAW,CAAC;AAEhB,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,WAA0B,EAC1B,IAAI,EAAE,SAAc,EACpB,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,WAAW,GACZ,EAAE,KAAK,+BAoDP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/avatarGroup/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.np-avatar-group {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
.np-avatar-group-diagonal {
|
|
6
|
-
width: var(--np-avatar-group-size);
|
|
7
|
-
height: var(--np-avatar-group-size);
|
|
8
|
-
}
|
|
9
|
-
.np-avatar-group-diagonal-mask {
|
|
10
|
-
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
11
|
-
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
|
|
12
|
-
}
|
|
13
|
-
.np-avatar-group-diagonal-child {
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: var(--np-avatar-group-diagonal-child-position);
|
|
16
|
-
right: 0;
|
|
17
|
-
}
|
|
18
|
-
.np-avatar-group-horizontal {
|
|
19
|
-
height: var(--np-avatar-group-size);
|
|
20
|
-
}
|
|
21
|
-
.np-avatar-group-horizontal-mask {
|
|
22
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
23
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
24
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
25
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
|
|
26
|
-
}
|
|
27
|
-
.np-avatar-group-horizontal-child {
|
|
28
|
-
margin-left: calc(var(--np-avatar-group-horizontal-child-position) * -1);
|
|
29
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.np-avatar-group {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
|
|
5
|
-
&-diagonal {
|
|
6
|
-
width: var(--np-avatar-group-size);
|
|
7
|
-
height: var(--np-avatar-group-size);
|
|
8
|
-
|
|
9
|
-
&-mask {
|
|
10
|
-
mask-image: radial-gradient(
|
|
11
|
-
circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5)
|
|
12
|
-
right calc(100% - var(--np-avatar-group-size) / 1.5),
|
|
13
|
-
transparent 0,
|
|
14
|
-
transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px),
|
|
15
|
-
black 0
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&-child {
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: var(--np-avatar-group-diagonal-child-position);
|
|
22
|
-
right: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&-horizontal {
|
|
27
|
-
height: var(--np-avatar-group-size);
|
|
28
|
-
|
|
29
|
-
&-mask {
|
|
30
|
-
mask-image: radial-gradient(
|
|
31
|
-
circle at top calc(100% - var(--np-avatar-group-single-size) / 2)
|
|
32
|
-
right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1),
|
|
33
|
-
transparent 0,
|
|
34
|
-
transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)),
|
|
35
|
-
black 0);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&-child {
|
|
39
|
-
margin-left: calc(var(--np-avatar-group-horizontal-child-position) * -1);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|