@transferwise/components 45.14.1 → 45.15.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/i18n/en.json +1 -0
- package/build/index.esm.js +695 -53
- package/build/index.esm.js.map +1 -1
- package/build/index.js +698 -53
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +1 -1
- package/build/styles/inputs/Input.css +1 -1
- package/build/styles/inputs/InputGroup.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -0
- package/build/styles/inputs/TextArea.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/promoCard/PromoCard.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/types/common/hooks/useMedia.d.ts +2 -0
- package/build/types/common/hooks/useMedia.d.ts.map +1 -0
- package/build/types/common/hooks/useScreenSize.d.ts +3 -0
- package/build/types/common/hooks/useScreenSize.d.ts.map +1 -0
- package/build/types/common/preventScroll/PreventScroll.d.ts +2 -0
- package/build/types/common/preventScroll/PreventScroll.d.ts.map +1 -0
- package/build/types/dateLookup/dateTrigger/DateTrigger.messages.d.ts +7 -7
- package/build/types/dateLookup/dateTrigger/DateTrigger.messages.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts +1 -0
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts +10 -0
- package/build/types/inputs/SearchInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.d.ts +41 -0
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/_BottomSheet.d.ts +17 -0
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -0
- package/build/types/inputs/_ButtonInput.d.ts +6 -0
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -0
- package/build/types/inputs/_Popover.d.ts +18 -0
- package/build/types/inputs/_Popover.d.ts.map +1 -0
- package/build/types/inputs/_common.d.ts.map +1 -1
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/link/Link.messages.d.ts +8 -0
- package/build/types/link/Link.messages.d.ts.map +1 -0
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/stepper/Stepper.d.ts.map +1 -1
- package/build/types/tile/Tile.d.ts.map +1 -1
- package/build/types/utilities/wrapInFragment.d.ts +3 -0
- package/build/types/utilities/wrapInFragment.d.ts.map +1 -0
- package/package.json +28 -22
- package/src/avatar/Avatar.story.tsx +16 -14
- package/src/common/closeButton/CloseButton.css +1 -1
- package/src/common/hooks/useMedia.spec.ts +39 -0
- package/src/common/hooks/useMedia.ts +15 -0
- package/src/common/hooks/useScreenSize.ts +7 -0
- package/src/common/preventScroll/PreventScroll.tsx +6 -0
- package/src/decision/Decision.story.js +11 -11
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +12 -12
- package/src/i18n/en.json +1 -0
- package/src/index.ts +8 -0
- package/src/inputs/Input.css +1 -1
- package/src/inputs/Input.less +14 -0
- package/src/inputs/Input.tsx +6 -2
- package/src/inputs/InputGroup.css +1 -1
- package/src/inputs/InputGroup.less +5 -0
- package/src/inputs/SearchInput.story.tsx +40 -0
- package/src/inputs/SearchInput.tsx +35 -0
- package/src/inputs/SelectInput.css +1 -0
- package/src/inputs/SelectInput.less +183 -0
- package/src/inputs/SelectInput.spec.tsx +120 -0
- package/src/inputs/SelectInput.story.tsx +259 -0
- package/src/inputs/SelectInput.tsx +565 -0
- package/src/inputs/TextArea.css +1 -1
- package/src/inputs/TextArea.less +5 -0
- package/src/inputs/_BottomSheet.less +107 -0
- package/src/inputs/_BottomSheet.tsx +128 -0
- package/src/inputs/_ButtonInput.less +7 -0
- package/src/inputs/_ButtonInput.tsx +27 -0
- package/src/inputs/_Popover.less +38 -0
- package/src/inputs/_Popover.tsx +118 -0
- package/src/inputs/_common.less +0 -4
- package/src/inputs/_common.ts +0 -1
- package/src/link/Link.messages.ts +8 -0
- package/src/link/Link.tsx +6 -2
- package/src/logo/Logo.js +3 -21
- package/src/logo/__snapshots__/Logo.spec.js.snap +78 -30
- package/src/main.css +1 -1
- package/src/main.less +4 -0
- package/src/navigationOption/NavigationOption.story.js +3 -5
- package/src/promoCard/PromoCard.css +1 -1
- package/src/radio/Radio.story.js +3 -2
- package/src/radioGroup/RadioGroup.story.js +2 -1
- package/src/select/searchBox/__snapshots__/SearchBox.spec.js.snap +1 -1
- package/src/ssr.spec.js +7 -0
- package/src/stepper/Stepper.css +1 -1
- package/src/stepper/Stepper.less +1 -9
- package/src/stepper/Stepper.spec.js +4 -4
- package/src/stepper/Stepper.tsx +2 -5
- package/src/tile/Tile.js +5 -11
- package/src/tile/__snapshots__/Tile.spec.js.snap +7 -9
- package/src/utilities/wrapInFragment.tsx +3 -0
- /package/src/dateLookup/dateTrigger/{DateTrigger.messages.js → DateTrigger.messages.ts} +0 -0
package/src/main.less
CHANGED
|
@@ -30,8 +30,12 @@
|
|
|
30
30
|
@import "./header/Header.less";
|
|
31
31
|
@import "./image/Image.less";
|
|
32
32
|
@import "./info/Info.less";
|
|
33
|
+
@import "./inputs/_BottomSheet.less";
|
|
34
|
+
@import "./inputs/_ButtonInput.less";
|
|
35
|
+
@import "./inputs/_Popover.less";
|
|
33
36
|
@import "./inputs/Input.less";
|
|
34
37
|
@import "./inputs/InputGroup.less";
|
|
38
|
+
@import "./inputs/SelectInput.less";
|
|
35
39
|
@import "./inputs/TextArea.less";
|
|
36
40
|
@import "./instructionsList/InstructionsList.less";
|
|
37
41
|
@import "./link/Link.less";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Profile,
|
|
8
8
|
UpwardGraph as UpwardGraphIcon,
|
|
9
9
|
} from '@transferwise/icons';
|
|
10
|
-
import { Illustration, Assets } from '@wise/art';
|
|
10
|
+
import { Illustration, Assets, Flag } from '@wise/art';
|
|
11
11
|
|
|
12
12
|
import { Badge, Nudge, Avatar, Header } from '..';
|
|
13
13
|
|
|
@@ -203,7 +203,7 @@ export const BalanceContent = () => (
|
|
|
203
203
|
showMediaCircle={false}
|
|
204
204
|
media={
|
|
205
205
|
<Avatar type="icon">
|
|
206
|
-
<
|
|
206
|
+
<Flag code="GBP" />
|
|
207
207
|
</Avatar>
|
|
208
208
|
}
|
|
209
209
|
/>
|
|
@@ -229,9 +229,7 @@ export const ExistingContactContent = () => (
|
|
|
229
229
|
content="EUR account ending in 1111"
|
|
230
230
|
showMediaCircle={false}
|
|
231
231
|
media={
|
|
232
|
-
<Badge
|
|
233
|
-
badge={<img src="https://wise.com/public-resources/assets/flags/square/eur.svg" alt="" />}
|
|
234
|
-
>
|
|
232
|
+
<Badge badge={<Flag code="EUR" />}>
|
|
235
233
|
<Avatar type="initials" size="md">
|
|
236
234
|
<span aria-hidden>WS</span>
|
|
237
235
|
</Avatar>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-Card{--Card-image-scale:1;--Card-image-translate:0;--Card-indicator-text-background-color:var(--color-background-neutral);--Card-indicator-icon-background-color:var(--color-interactive-accent);--Card-indicator-icon-color:var(--color-interactive-control);--Card-check-background-color:var(--color-interactive-primary);--Card-check-color:var(--color-interactive-control)}.np-Card--promoCard{--Card-max-width:358px}.np-Card--promoCard.is-disabled{filter:grayscale(1);opacity:.45}.np-Card-image{height:auto;left:-24px;left:calc(var(--size-24)*-1);margin:0 auto;position:relative;transform:scale(var(--Card-image-scale)) translateY(var(--Card-image-translate));transition:transform .5s ease-in-out;width:100%;width:calc(100% + 48px);width:calc(100% + var(--size-48))}[dir=rtl] .np-Card-image{left:auto;right:-24px;right:calc(var(--size-24)*-1)}.np-Card-indicator{bottom:8px;bottom:var(--size-8);display:flex;gap:4px;gap:var(--size-4);position:absolute;right:8px;right:var(--size-8)}[dir=rtl] .np-Card-indicator{left:8px;left:var(--size-8);right:auto}.np-Card-indicatorText{background:var(--Card-indicator-text-background-color);border-radius:100px;display:inline-block;padding:16px;padding:var(--size-16);text-align:left;vertical-align:middle}.np-Card-indicatorIcon{align-items:center;background:var(--Card-indicator-icon-background-color);border-radius:
|
|
1
|
+
.np-Card{--Card-image-scale:1;--Card-image-translate:0;--Card-indicator-text-background-color:var(--color-background-neutral);--Card-indicator-icon-background-color:var(--color-interactive-accent);--Card-indicator-icon-color:var(--color-interactive-control);--Card-check-background-color:var(--color-interactive-primary);--Card-check-color:var(--color-interactive-control)}.np-Card--promoCard{--Card-max-width:358px}.np-Card--promoCard.is-disabled{filter:grayscale(1);opacity:.45}.np-Card-image{height:auto;left:-24px;left:calc(var(--size-24)*-1);margin:0 auto;position:relative;transform:scale(var(--Card-image-scale)) translateY(var(--Card-image-translate));transition:transform .5s ease-in-out;width:100%;width:calc(100% + 48px);width:calc(100% + var(--size-48))}[dir=rtl] .np-Card-image{left:auto;right:-24px;right:calc(var(--size-24)*-1)}.np-Card-indicator{bottom:8px;bottom:var(--size-8);display:flex;gap:4px;gap:var(--size-4);position:absolute;right:8px;right:var(--size-8)}[dir=rtl] .np-Card-indicator{left:8px;left:var(--size-8);right:auto}.np-Card-indicatorText{background:var(--Card-indicator-text-background-color);border-radius:100px;display:inline-block;padding:16px;padding:var(--size-16);text-align:left;vertical-align:middle}.np-Card-indicatorIcon{align-items:center;background:var(--Card-indicator-icon-background-color);border-radius:9999px;border-radius:var(--radius-full);color:var(--Card-indicator-icon-color);display:inline-block;display:flex;height:56px;height:var(--size-56);justify-content:center;width:56px;width:var(--size-56)}[dir=rtl] .np-Card-indicatorIcon{transform:scaleX(-1)}.np-Card--checked,.np-Card--link{box-shadow:none;color:currentColor;cursor:pointer;transform:scale(1);transition:box-shadow .2s ease-in-out,transform .5s ease-in-out}.np-theme-personal:not(.np-theme-personal--dark,.np-theme-personal--bright-green,.np-theme-personal--forest-green) .np-Card--checked,.np-theme-personal:not(.np-theme-personal--dark,.np-theme-personal--bright-green,.np-theme-personal--forest-green) .np-Card--link{--Card-box-shadow:0px 20px var(--size-40) 0px var(--color-background-neutral);--Card-check-color:var(--color-interactive-accent)}.np-Card--checked.is-disabled,.np-Card--link.is-disabled{cursor:not-allowed}@media (prefers-reduced-motion:reduce){.np-Card--checked,.np-Card--link{transition:none}}.np-Card--checked:hover:not(.is-disabled,:disabled,.is-checked,:focus-within),.np-Card--link:hover:not(.is-disabled,:disabled,.is-checked,:focus-within){--Card-image-scale:1.1;box-shadow:var(--Card-box-shadow)}.np-Card--checked:active:not(.is-disabled,:disabled,.is-checked),.np-Card--link:active:not(.is-disabled,:disabled,.is-checked){--Card-background-color:var(--color-background-neutral-active);--Card-image-scale:1.1;--Card-image-translate:var(--size-8);box-shadow:var(--Card-box-shadow);transform:scale(98%)}.np-theme-personal--bright-green .np-Card--checked:active:not(.is-disabled,:disabled,.is-checked),.np-theme-personal--bright-green .np-Card--link:active:not(.is-disabled,:disabled,.is-checked){--Card-background-color:var(--color-background-neutral)}.np-Card--checked:focus-visible:not(.is-disabled,:disabled),.np-Card--checked:has(:focus-visible):not(.np-Card--checked),.np-Card--link:focus-visible:not(.is-disabled,:disabled),.np-Card--link:has(:focus-visible):not(.np-Card--checked){--Card-image-scale:1.1;box-shadow:var(--Card-box-shadow);outline:var(--ring-outline-color) solid 4px;outline:var(--ring-outline-color) solid var(--size-4);outline-offset:4px;outline-offset:var(--size-4)}.np-Card--link .np-Card-titleLink{color:#37517e;color:var(--color-content-primary);text-decoration:none}.np-Card--link .np-Card-titleLink:focus-visible{outline:none}.np-Card--link .np-Card-titleLink:after{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%;z-index:10}.np-Card--checked.is-checked{box-shadow:0 0 0 4px var(--color-interactive-primary);box-shadow:0 0 0 var(--size-4) var(--color-interactive-primary)}.np-Card--checked.is-checked .np-Card-check{align-items:center;background:var(--Card-check-background-color);border-radius:9999px;border-radius:var(--radius-full);color:var(--Card-check-color);display:flex;height:40px;height:var(--size-40);justify-content:center;position:absolute;right:8px;right:var(--size-8);top:8px;top:var(--size-8);width:40px;width:var(--size-40)}[dir=rtl] .np-Card--checked.is-checked .np-Card-check{left:8px;left:var(--size-8);right:auto}.np-Card--checked.is-checked:focus-visible:not(.is-disabled,:disabled){box-shadow:none}.np-CardGroup{display:flex;flex-direction:column;gap:24px;gap:var(--size-24);width:100%}@media (min-width:768px){.np-CardGroup{flex-direction:row}}.np-CardGroup .np-Card.np-Card--promoCard{max-width:100%}
|
package/src/radio/Radio.story.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { boolean, text } from '@storybook/addon-knobs';
|
|
2
2
|
import { Check } from '@transferwise/icons';
|
|
3
|
+
import { Flag } from '@wise/art';
|
|
3
4
|
import { useState } from 'react';
|
|
4
5
|
|
|
5
6
|
import Avatar, { AvatarType } from '../avatar';
|
|
@@ -33,7 +34,7 @@ export const Basic = () => {
|
|
|
33
34
|
avatar={
|
|
34
35
|
showAvatar ? (
|
|
35
36
|
<Avatar type={AvatarType.THUMBNAIL}>
|
|
36
|
-
<
|
|
37
|
+
<Flag code="IMP" />
|
|
37
38
|
</Avatar>
|
|
38
39
|
) : null
|
|
39
40
|
}
|
|
@@ -51,7 +52,7 @@ export const Basic = () => {
|
|
|
51
52
|
avatar={
|
|
52
53
|
showAvatar ? (
|
|
53
54
|
<Avatar type={AvatarType.THUMBNAIL}>
|
|
54
|
-
<
|
|
55
|
+
<Flag code="KES" />
|
|
55
56
|
</Avatar>
|
|
56
57
|
) : null
|
|
57
58
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
import { boolean } from '@storybook/addon-knobs';
|
|
3
|
+
import { Flag } from '@wise/art';
|
|
3
4
|
|
|
4
5
|
import Avatar, { AvatarType } from '../avatar';
|
|
5
6
|
|
|
@@ -16,7 +17,7 @@ export const Basic = () => {
|
|
|
16
17
|
|
|
17
18
|
const avatar = showAvatars ? (
|
|
18
19
|
<Avatar type={AvatarType.THUMBNAIL}>
|
|
19
|
-
<
|
|
20
|
+
<Flag code="NZD" />
|
|
20
21
|
</Avatar>
|
|
21
22
|
) : undefined;
|
|
22
23
|
|
|
@@ -34,7 +34,7 @@ exports[`SearchBox renders 1`] = `
|
|
|
34
34
|
</span>
|
|
35
35
|
</span>
|
|
36
36
|
<input
|
|
37
|
-
class="np-select-filter form-control np-form-control np-form-control--size-auto np-text-body-large np-
|
|
37
|
+
class="np-select-filter form-control np-form-control np-form-control--size-auto np-text-body-large np-input np-input--shape-rectangle"
|
|
38
38
|
placeholder="placeholder"
|
|
39
39
|
spellcheck="false"
|
|
40
40
|
value="value"
|
package/src/ssr.spec.js
CHANGED
|
@@ -48,6 +48,10 @@ const excluded = new Set([
|
|
|
48
48
|
'Typography',
|
|
49
49
|
|
|
50
50
|
// types
|
|
51
|
+
'SearchInputProps',
|
|
52
|
+
'SelectInputItem',
|
|
53
|
+
'SelectInputOptionContentProps',
|
|
54
|
+
'SelectInputProps',
|
|
51
55
|
'UploadedFile',
|
|
52
56
|
'UploadError',
|
|
53
57
|
'UploadResponse',
|
|
@@ -179,6 +183,9 @@ describe('Server side rendering', () => {
|
|
|
179
183
|
Input: {
|
|
180
184
|
children: undefined,
|
|
181
185
|
},
|
|
186
|
+
SearchInput: {
|
|
187
|
+
children: undefined,
|
|
188
|
+
},
|
|
182
189
|
TextArea: {
|
|
183
190
|
children: undefined,
|
|
184
191
|
},
|
package/src/stepper/Stepper.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.tw-stepper{padding-bottom:24px;width:100%}@media only screen and (max-width:575px){.tw-stepper{padding-bottom:0}}.tw-stepper__step{list-style-type:none;position:absolute;top:0}.tw-stepper__step--active .tw-stepper__step-label{color:#37517e;color:var(--color-content-primary);cursor:default
|
|
1
|
+
.tw-stepper{padding-bottom:24px;width:100%}@media only screen and (max-width:575px){.tw-stepper{padding-bottom:0}}.tw-stepper__step{list-style-type:none;position:absolute;top:0}.tw-stepper__step--active .tw-stepper__step-label{color:#37517e;color:var(--color-content-primary);cursor:default}.tw-stepper__step--clickable .tw-stepper__step-label{border-radius:2px;color:#0097c7;color:var(--color-content-accent);line-height:0;transition:color .15s ease-in-out}.np-theme-personal .tw-stepper__step--clickable .tw-stepper__step-label{color:#5d7079;color:var(--color-content-secondary);top:0}.tw-stepper__step--has-tooltip{cursor:pointer}@media screen and (min-width:576px) and (max-width:991px){.tw-stepper__step:first-child .tooltip-inner{transform:translateX(calc(50% - 32px))}.tw-stepper__step:last-child .tooltip-inner{transform:translateX(calc(-50% + 32px))}}.tw-stepper__step-label{color:#5d7079;color:var(--color-content-secondary);position:absolute;top:0;transform:translateX(-50%);transition:color .6s ease-in-out;white-space:nowrap}[dir=rtl] .tw-stepper__step-label{transform:translateX(50%)}.tw-stepper .tooltip{top:24px!important;white-space:nowrap}.tw-stepper .tooltip .tooltip-inner{max-width:100%}.tw-stepper .tw-tooltip-container{display:block}.tw-stepper-steps{padding:0;position:relative}[dir=rtl] .tw-stepper-steps{padding:0}.progress-bar{-webkit-backface-visibility:hidden;background-color:var(--color-interactive-primary);border-bottom-left-radius:1px;border-top-left-radius:1px;float:left;height:100%;transition:width .6s ease-in-out;will-change:width}[dir=rtl] .progress-bar{float:right}.progress-bar:after{border-radius:4px;content:"";float:right;height:8px;margin-right:-4px;margin-top:-3px;width:8px}[dir=rtl] .progress-bar:after{float:left;margin-left:-4px;margin-right:0}.btn-unstyled{background:none;border:none;display:block;margin:0;padding:0}
|
package/src/stepper/Stepper.less
CHANGED
|
@@ -19,13 +19,6 @@
|
|
|
19
19
|
.tw-stepper__step-label {
|
|
20
20
|
cursor: default;
|
|
21
21
|
color: var(--color-content-primary);
|
|
22
|
-
font-weight: 600;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.np-theme-personal & ~ li:not(.tw-stepper__step--has-tooltip:hover) {
|
|
26
|
-
.tw-stepper__step-label:not(:active,:focus) {
|
|
27
|
-
opacity: 0.45;
|
|
28
|
-
}
|
|
29
22
|
}
|
|
30
23
|
}
|
|
31
24
|
|
|
@@ -41,7 +34,7 @@
|
|
|
41
34
|
}
|
|
42
35
|
}
|
|
43
36
|
|
|
44
|
-
&--has-tooltip
|
|
37
|
+
&--has-tooltip {
|
|
45
38
|
cursor: pointer;
|
|
46
39
|
}
|
|
47
40
|
|
|
@@ -62,7 +55,6 @@
|
|
|
62
55
|
color: var(--color-content-secondary);
|
|
63
56
|
transition: color 0.6s ease-in-out;
|
|
64
57
|
white-space: nowrap;
|
|
65
|
-
font-weight: var(--font-weight-semi-bold);
|
|
66
58
|
.translateX(-50%);
|
|
67
59
|
}
|
|
68
60
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shallow } from 'enzyme';
|
|
2
2
|
|
|
3
|
-
import { Tooltip
|
|
3
|
+
import { Tooltip } from '..';
|
|
4
4
|
|
|
5
5
|
import Stepper from './Stepper';
|
|
6
6
|
|
|
@@ -57,7 +57,7 @@ describe('Stepper', () => {
|
|
|
57
57
|
steps(5);
|
|
58
58
|
[0, 1, 2, 3, 4].forEach((label, index) => {
|
|
59
59
|
expect(
|
|
60
|
-
component.find('.tw-stepper__step').at(index).find(
|
|
60
|
+
component.find('.tw-stepper__step').at(index).find('span').props().children,
|
|
61
61
|
).toStrictEqual(`${label}`);
|
|
62
62
|
});
|
|
63
63
|
});
|
|
@@ -173,7 +173,7 @@ describe('Stepper', () => {
|
|
|
173
173
|
const firstStepHoverLabel = step(0).children();
|
|
174
174
|
expect(firstStepHoverLabel.type()).toBe(Tooltip);
|
|
175
175
|
expect(firstStepHoverLabel.children().render().text()).toStrictEqual('label');
|
|
176
|
-
expect(step(1).find(
|
|
176
|
+
expect(step(1).find('span').props().children).toStrictEqual('label 2');
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
it('renders jsx', () => {
|
|
@@ -203,7 +203,7 @@ describe('Stepper', () => {
|
|
|
203
203
|
steps: [{ hoverLabel: 'hover', label: 'label' }, { label: 'label 2' }],
|
|
204
204
|
});
|
|
205
205
|
const firstStepHoverLabel = step(0).children();
|
|
206
|
-
expect(firstStepHoverLabel.type()).toBe(
|
|
206
|
+
expect(firstStepHoverLabel.type()).toBe('span');
|
|
207
207
|
expect(firstStepHoverLabel.props().children).toStrictEqual('label');
|
|
208
208
|
expect(step(1).children().props().children).toStrictEqual('label 2');
|
|
209
209
|
});
|
package/src/stepper/Stepper.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import Body from '../body/Body';
|
|
5
4
|
import { Position } from '../common';
|
|
6
5
|
import { useDirection } from '../common/hooks';
|
|
7
6
|
import Tooltip from '../tooltip';
|
|
@@ -49,9 +48,7 @@ const Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {
|
|
|
49
48
|
<small>{step.label}</small>
|
|
50
49
|
</button>
|
|
51
50
|
) : (
|
|
52
|
-
<
|
|
53
|
-
{step.label}
|
|
54
|
-
</Body>
|
|
51
|
+
<span className="tw-stepper__step-label">{step.label}</span>
|
|
55
52
|
);
|
|
56
53
|
return (
|
|
57
54
|
<li
|
|
@@ -59,7 +56,7 @@ const Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {
|
|
|
59
56
|
className={classNames(
|
|
60
57
|
'hidden-xs',
|
|
61
58
|
'tw-stepper__step',
|
|
62
|
-
active
|
|
59
|
+
active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',
|
|
63
60
|
clickable && 'tw-stepper__step--clickable',
|
|
64
61
|
step.hoverLabel && 'tw-stepper__step--has-tooltip',
|
|
65
62
|
)}
|
package/src/tile/Tile.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useTheme } from '@wise/components-theming';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
|
|
@@ -18,7 +17,6 @@ export const Tile = ({
|
|
|
18
17
|
title,
|
|
19
18
|
}) => {
|
|
20
19
|
const isSmall = size === Size.SMALL;
|
|
21
|
-
const { isModern } = useTheme();
|
|
22
20
|
const Element = href ? 'a' : 'button';
|
|
23
21
|
|
|
24
22
|
return (
|
|
@@ -31,16 +29,13 @@ export const Tile = ({
|
|
|
31
29
|
'text-xs-center',
|
|
32
30
|
className,
|
|
33
31
|
{
|
|
34
|
-
'p-a-3': !isSmall
|
|
35
|
-
'p-
|
|
36
|
-
'p-a-2': isSmall,
|
|
37
|
-
'np-tile--small': isSmall,
|
|
38
|
-
disabled,
|
|
32
|
+
'p-a-3': !isSmall,
|
|
33
|
+
'p-a-2 np-tile--small': isSmall,
|
|
39
34
|
},
|
|
35
|
+
disabled && 'disabled',
|
|
40
36
|
)}
|
|
41
37
|
href={href}
|
|
42
38
|
target={target}
|
|
43
|
-
aria-label={title}
|
|
44
39
|
onClick={disabled ? null : onClick}
|
|
45
40
|
onKeyDown={
|
|
46
41
|
disabled
|
|
@@ -56,12 +51,11 @@ export const Tile = ({
|
|
|
56
51
|
<Title type={Typography.TITLE_SUBSECTION} className={classNames(isSmall ? 'm-t-1' : 'm-t-2')}>
|
|
57
52
|
{title}
|
|
58
53
|
</Title>
|
|
59
|
-
{
|
|
54
|
+
{description ? (
|
|
60
55
|
<Body as="span" type={Typography.BODY_DEFAULT} className="m-t-1">
|
|
61
56
|
{description}
|
|
62
57
|
</Body>
|
|
63
|
-
)}
|
|
64
|
-
{!isModern && description && <div className="np-tile__description">{description}</div>}
|
|
58
|
+
) : null}
|
|
65
59
|
</Element>
|
|
66
60
|
);
|
|
67
61
|
};
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
exports[`Tile matches snapshot when regular size 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<a
|
|
6
|
-
|
|
7
|
-
class="decision flex-column np-tile text-no-decoration text-xs-center p-y-5 p-x-4"
|
|
6
|
+
class="decision flex-column np-tile text-no-decoration text-xs-center p-a-3"
|
|
8
7
|
href="#href"
|
|
9
8
|
>
|
|
10
9
|
<div
|
|
@@ -19,11 +18,11 @@ exports[`Tile matches snapshot when regular size 1`] = `
|
|
|
19
18
|
>
|
|
20
19
|
Receive money
|
|
21
20
|
</h3>
|
|
22
|
-
<
|
|
23
|
-
class="np-
|
|
21
|
+
<span
|
|
22
|
+
class="np-text-body-default m-t-1"
|
|
24
23
|
>
|
|
25
24
|
Receive money from friends and family like a local
|
|
26
|
-
</
|
|
25
|
+
</span>
|
|
27
26
|
</a>
|
|
28
27
|
</DocumentFragment>
|
|
29
28
|
`;
|
|
@@ -31,7 +30,6 @@ exports[`Tile matches snapshot when regular size 1`] = `
|
|
|
31
30
|
exports[`Tile matches snapshot when small size 1`] = `
|
|
32
31
|
<DocumentFragment>
|
|
33
32
|
<a
|
|
34
|
-
aria-label="Receive money"
|
|
35
33
|
class="decision flex-column np-tile text-no-decoration text-xs-center p-a-2 np-tile--small"
|
|
36
34
|
href="#href"
|
|
37
35
|
>
|
|
@@ -47,11 +45,11 @@ exports[`Tile matches snapshot when small size 1`] = `
|
|
|
47
45
|
>
|
|
48
46
|
Receive money
|
|
49
47
|
</h3>
|
|
50
|
-
<
|
|
51
|
-
class="np-
|
|
48
|
+
<span
|
|
49
|
+
class="np-text-body-default m-t-1"
|
|
52
50
|
>
|
|
53
51
|
Receive money from friends and family like a local
|
|
54
|
-
</
|
|
52
|
+
</span>
|
|
55
53
|
</a>
|
|
56
54
|
</DocumentFragment>
|
|
57
55
|
`;
|
|
File without changes
|