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