@transferwise/components 0.0.0-experimental-4b93e2b → 0.0.0-experimental-f144cf1
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/Calendar/DateHeader/DateHeader.js +6 -2
- package/build/Calendar/DateHeader/DateHeader.js.map +1 -1
- package/build/Calendar/DateHeader/DateHeader.mjs +7 -3
- package/build/Calendar/DateHeader/DateHeader.mjs.map +1 -1
- package/build/Carousel/Carousel.js +2 -2
- package/build/Carousel/Carousel.js.map +1 -1
- package/build/Carousel/Carousel.mjs +3 -3
- package/build/Carousel/Carousel.mjs.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -4
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -4
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
- package/build/ListItem/Navigation/ListItemNavigation.js +1 -1
- package/build/ListItem/Navigation/ListItemNavigation.js.map +1 -1
- package/build/ListItem/Navigation/ListItemNavigation.mjs +2 -2
- package/build/ListItem/Navigation/ListItemNavigation.mjs.map +1 -1
- package/build/PhoneNumberInput/PhoneNumberInput.js +1 -2
- package/build/PhoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/PhoneNumberInput/PhoneNumberInput.mjs +1 -2
- package/build/PhoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/PromoCard/Indicator/PromoCardIndicator.js +1 -1
- package/build/PromoCard/Indicator/PromoCardIndicator.js.map +1 -1
- package/build/PromoCard/Indicator/PromoCardIndicator.mjs +2 -2
- package/build/PromoCard/Indicator/PromoCardIndicator.mjs.map +1 -1
- package/build/Snackbar/Snackbar.js +212 -108
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.messages.js +14 -0
- package/build/Snackbar/Snackbar.messages.js.map +1 -0
- package/build/Snackbar/Snackbar.messages.mjs +10 -0
- package/build/Snackbar/Snackbar.messages.mjs.map +1 -0
- package/build/Snackbar/Snackbar.mjs +213 -107
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/Snackbar/SnackbarContext.js.map +1 -1
- package/build/Snackbar/SnackbarContext.mjs.map +1 -1
- package/build/Snackbar/SnackbarPortal.js +92 -0
- package/build/Snackbar/SnackbarPortal.js.map +1 -0
- package/build/Snackbar/SnackbarPortal.mjs +89 -0
- package/build/Snackbar/SnackbarPortal.mjs.map +1 -0
- package/build/Snackbar/SnackbarProvider.js +21 -31
- package/build/Snackbar/SnackbarProvider.js.map +1 -1
- package/build/Snackbar/SnackbarProvider.mjs +22 -32
- package/build/Snackbar/SnackbarProvider.mjs.map +1 -1
- package/build/Snackbar/constants.js +14 -0
- package/build/Snackbar/constants.js.map +1 -0
- package/build/Snackbar/constants.mjs +8 -0
- package/build/Snackbar/constants.mjs.map +1 -0
- package/build/Snackbar/useSnackbarAutoDismiss.js +135 -0
- package/build/Snackbar/useSnackbarAutoDismiss.js.map +1 -0
- package/build/Snackbar/useSnackbarAutoDismiss.mjs +131 -0
- package/build/Snackbar/useSnackbarAutoDismiss.mjs.map +1 -0
- package/build/Snackbar/useSnackbarManager.js +164 -0
- package/build/Snackbar/useSnackbarManager.js.map +1 -0
- package/build/Snackbar/useSnackbarManager.mjs +160 -0
- package/build/Snackbar/useSnackbarManager.mjs.map +1 -0
- package/build/Snackbar/useSnackbarSwipeDismiss.js +114 -0
- package/build/Snackbar/useSnackbarSwipeDismiss.js.map +1 -0
- package/build/Snackbar/useSnackbarSwipeDismiss.mjs +110 -0
- package/build/Snackbar/useSnackbarSwipeDismiss.mjs.map +1 -0
- package/build/common/PropsValues/typography.js +0 -6
- package/build/common/PropsValues/typography.js.map +1 -1
- package/build/common/PropsValues/typography.mjs +0 -6
- package/build/common/PropsValues/typography.mjs.map +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/index.mjs +2 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +864 -1509
- package/build/styles/Button/Button.css +3 -0
- package/build/styles/DateInput/DateInput.css +0 -13
- package/build/styles/Inputs/Input/Input.css +24 -0
- package/build/styles/Inputs/TextArea/TextArea.css +24 -0
- package/build/styles/ListItem/ListItem.css +1 -1
- package/build/styles/PhoneNumberInput/PhoneNumberInput.css +0 -3
- package/build/styles/Popover/Popover.css +6 -0
- package/build/styles/PromoCard/PromoCard.css +3 -0
- package/build/styles/Snackbar/Snackbar.css +182 -61
- package/build/styles/_deprecated/Select/Select.css +6 -0
- package/build/styles/css/accordion.css +12 -0
- package/build/styles/css/button-groups.css +6 -0
- package/build/styles/css/buttons.css +2 -0
- package/build/styles/css/decision.css +12 -0
- package/build/styles/css/dropdowns.css +18 -2
- package/build/styles/css/droppable.css +6 -0
- package/build/styles/css/footer.css +12 -0
- package/build/styles/css/input-groups.css +42 -2
- package/build/styles/css/list-group.css +6 -0
- package/build/styles/css/navbar.css +18 -2
- package/build/styles/css/neptune-core.css +512 -4
- package/build/styles/css/neptune.css +640 -1426
- package/build/styles/css/popovers.css +18 -0
- package/build/styles/css/tooltip.css +6 -0
- package/build/styles/less/neptune-tokens.less +0 -8
- package/build/styles/main.css +864 -1509
- package/build/styles/props/neptune-tokens.css +0 -8
- package/build/styles/styles/less/accordion.css +12 -0
- package/build/styles/styles/less/button-groups.css +6 -0
- package/build/styles/styles/less/buttons.css +2 -0
- package/build/styles/styles/less/decision.css +12 -0
- package/build/styles/styles/less/dropdowns.css +18 -2
- package/build/styles/styles/less/droppable.css +6 -0
- package/build/styles/styles/less/footer.css +12 -0
- package/build/styles/styles/less/forms/bootstrap-forms.css +24 -2
- package/build/styles/styles/less/input-groups.css +42 -2
- package/build/styles/styles/less/list-group.css +6 -0
- package/build/styles/styles/less/navbar.css +18 -2
- package/build/styles/styles/less/neptune-core.css +512 -4
- package/build/styles/styles/less/neptune.css +640 -1426
- package/build/styles/styles/less/popovers.css +18 -0
- package/build/styles/styles/less/tooltip.css +6 -0
- package/build/types/Inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +1 -2
- package/build/types/Inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +1 -1
- package/build/types/PhoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.d.ts +41 -24
- package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.messages.d.ts +9 -0
- package/build/types/Snackbar/Snackbar.messages.d.ts.map +1 -0
- package/build/types/Snackbar/Snackbar.types.d.ts +21 -0
- package/build/types/Snackbar/Snackbar.types.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarContext.d.ts +2 -2
- package/build/types/Snackbar/SnackbarContext.d.ts.map +1 -1
- package/build/types/Snackbar/SnackbarPortal.d.ts +5 -0
- package/build/types/Snackbar/SnackbarPortal.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarProvider.d.ts +6 -0
- package/build/types/Snackbar/SnackbarProvider.d.ts.map +1 -1
- package/build/types/Snackbar/constants.d.ts +6 -0
- package/build/types/Snackbar/constants.d.ts.map +1 -0
- package/build/types/Snackbar/index.d.ts +3 -1
- package/build/types/Snackbar/index.d.ts.map +1 -1
- package/build/types/Snackbar/useSnackbar.d.ts +1 -1
- package/build/types/Snackbar/useSnackbar.d.ts.map +1 -1
- package/build/types/Snackbar/useSnackbarAutoDismiss.d.ts +18 -0
- package/build/types/Snackbar/useSnackbarAutoDismiss.d.ts.map +1 -0
- package/build/types/Snackbar/useSnackbarManager.d.ts +17 -0
- package/build/types/Snackbar/useSnackbarManager.d.ts.map +1 -0
- package/build/types/Snackbar/useSnackbarSwipeDismiss.d.ts +11 -0
- package/build/types/Snackbar/useSnackbarSwipeDismiss.d.ts.map +1 -0
- package/build/types/common/PropsValues/typography.d.ts +1 -13
- package/build/types/common/PropsValues/typography.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +2 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Button/Button.css +3 -0
- package/src/Button/Button.less +16 -0
- package/src/Button/_stories/Button.test.story.tsx +12 -12
- package/src/Calendar/DateHeader/DateHeader.tsx +3 -3
- package/src/Carousel/Carousel.tsx +3 -3
- package/src/DateInput/DateInput.css +0 -13
- package/src/DateInput/DateInput.less +2 -10
- package/src/DateInput/_stories/DateInput.test.story.tsx +13 -0
- package/src/Display/_stories/Display.story.tsx +6 -20
- package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +1 -1
- package/src/InputWithDisplayFormat/_stories/InputWithDisplayFormat.test.story.tsx +0 -52
- package/src/Inputs/Input/Input.css +24 -0
- package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +1 -4
- package/src/Inputs/SelectInput/SelectInput.test.tsx +0 -74
- package/src/Inputs/TextArea/TextArea.css +24 -0
- package/src/ListItem/ListItem.css +1 -1
- package/src/ListItem/ListItem.grid.less +4 -4
- package/src/ListItem/ListItem.less +1 -1
- package/src/ListItem/Navigation/ListItemNavigation.tsx +2 -2
- package/src/PhoneNumberInput/PhoneNumberInput.css +0 -3
- package/src/PhoneNumberInput/PhoneNumberInput.less +2 -10
- package/src/PhoneNumberInput/PhoneNumberInput.tsx +0 -1
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +1 -1
- package/src/Popover/Popover.css +6 -0
- package/src/PromoCard/Indicator/PromoCardIndicator.tsx +2 -2
- package/src/PromoCard/PromoCard.css +3 -0
- package/src/PromoCard/PromoCard.less +5 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +1 -1
- package/src/Snackbar/Snackbar.css +182 -61
- package/src/Snackbar/Snackbar.less +185 -56
- package/src/Snackbar/Snackbar.messages.ts +9 -0
- package/src/Snackbar/Snackbar.test.tsx +697 -0
- package/src/Snackbar/Snackbar.tsx +227 -96
- package/src/Snackbar/Snackbar.types.ts +26 -0
- package/src/Snackbar/SnackbarContext.ts +2 -2
- package/src/Snackbar/SnackbarPortal.tsx +110 -0
- package/src/Snackbar/SnackbarProvider.test.tsx +202 -0
- package/src/Snackbar/SnackbarProvider.tsx +25 -25
- package/src/Snackbar/_stories/Snackbar.accessibility.docs.mdx +73 -0
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +1 -12
- package/src/Snackbar/_stories/Snackbar.story.tsx +447 -62
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +91 -16
- package/src/Snackbar/constants.ts +5 -0
- package/src/Snackbar/index.ts +3 -1
- package/src/Snackbar/useSnackbarAutoDismiss.ts +155 -0
- package/src/Snackbar/useSnackbarManager.ts +181 -0
- package/src/Snackbar/useSnackbarSwipeDismiss.ts +129 -0
- package/src/_deprecated/Select/Select.css +6 -0
- package/src/common/PropsValues/typography.ts +1 -20
- package/src/i18n/en.json +1 -1
- package/src/index.ts +7 -2
- package/src/main.css +864 -1509
- package/src/styles/less/accordion.css +12 -0
- package/src/styles/less/button-groups.css +6 -0
- package/src/styles/less/buttons.css +2 -0
- package/src/styles/less/core/_typography.less +194 -26
- package/src/styles/less/decision.css +12 -0
- package/src/styles/less/dropdowns.css +18 -2
- package/src/styles/less/droppable.css +6 -0
- package/src/styles/less/footer.css +12 -0
- package/src/styles/less/forms/bootstrap-forms.css +24 -2
- package/src/styles/less/input-groups.css +42 -2
- package/src/styles/less/list-group.css +6 -0
- package/src/styles/less/navbar.css +18 -2
- package/src/styles/less/neptune-core.css +512 -4
- package/src/styles/less/neptune.bundle.less +0 -2
- package/src/styles/less/neptune.css +640 -1426
- package/src/styles/less/popovers.css +18 -0
- package/src/styles/less/tooltip.css +6 -0
- package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +0 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import { ArrowRight, ChevronRight, Freeze } from '@transferwise/icons';
|
|
3
3
|
import { Flag } from '@wise/art';
|
|
4
4
|
import { expect, userEvent, within } from 'storybook/test';
|
|
5
5
|
import Button from '../Button.resolver';
|
|
@@ -55,7 +55,7 @@ export const AllVariants: Story = {
|
|
|
55
55
|
priority={priority}
|
|
56
56
|
size={size}
|
|
57
57
|
addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}
|
|
58
|
-
addonEnd={{ type: 'icon', value: <
|
|
58
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
59
59
|
block
|
|
60
60
|
>
|
|
61
61
|
{`${priority} default ${size}`}
|
|
@@ -69,7 +69,7 @@ export const AllVariants: Story = {
|
|
|
69
69
|
type: 'avatar',
|
|
70
70
|
value: [{ asset: <Freeze /> }, { asset: <Freeze /> }],
|
|
71
71
|
}}
|
|
72
|
-
addonEnd={{ type: 'icon', value: <
|
|
72
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
73
73
|
block
|
|
74
74
|
disabled
|
|
75
75
|
>
|
|
@@ -80,7 +80,7 @@ export const AllVariants: Story = {
|
|
|
80
80
|
priority={priority}
|
|
81
81
|
size={size}
|
|
82
82
|
addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}
|
|
83
|
-
addonEnd={{ type: 'icon', value: <
|
|
83
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
84
84
|
block
|
|
85
85
|
loading
|
|
86
86
|
>
|
|
@@ -100,7 +100,7 @@ export const AllVariants: Story = {
|
|
|
100
100
|
sentiment="negative"
|
|
101
101
|
priority={priority as ButtonPriority}
|
|
102
102
|
size={size}
|
|
103
|
-
addonEnd={{ type: 'icon', value: <
|
|
103
|
+
addonEnd={{ type: 'icon', value: <ChevronRight /> }}
|
|
104
104
|
addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}
|
|
105
105
|
block
|
|
106
106
|
>
|
|
@@ -112,7 +112,7 @@ export const AllVariants: Story = {
|
|
|
112
112
|
sentiment="negative"
|
|
113
113
|
priority={priority as ButtonPriority}
|
|
114
114
|
size={size}
|
|
115
|
-
addonEnd={{ type: 'icon', value: <
|
|
115
|
+
addonEnd={{ type: 'icon', value: <ChevronRight /> }}
|
|
116
116
|
addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}
|
|
117
117
|
block
|
|
118
118
|
disabled
|
|
@@ -124,7 +124,7 @@ export const AllVariants: Story = {
|
|
|
124
124
|
sentiment="negative"
|
|
125
125
|
priority={priority as ButtonPriority}
|
|
126
126
|
size={size}
|
|
127
|
-
addonEnd={{ type: 'icon', value: <
|
|
127
|
+
addonEnd={{ type: 'icon', value: <ChevronRight /> }}
|
|
128
128
|
addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}
|
|
129
129
|
block
|
|
130
130
|
loading
|
|
@@ -174,7 +174,7 @@ export const RTLDiff: Story = {
|
|
|
174
174
|
Start icon
|
|
175
175
|
</Button>
|
|
176
176
|
|
|
177
|
-
<Button v2 size="md" addonEnd={{ type: 'icon', value: <
|
|
177
|
+
<Button v2 size="md" addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
178
178
|
End icon
|
|
179
179
|
</Button>
|
|
180
180
|
|
|
@@ -182,7 +182,7 @@ export const RTLDiff: Story = {
|
|
|
182
182
|
v2
|
|
183
183
|
size="md"
|
|
184
184
|
addonStart={{ type: 'icon', value: <Freeze /> }}
|
|
185
|
-
addonEnd={{ type: 'icon', value: <
|
|
185
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
186
186
|
>
|
|
187
187
|
Both icons
|
|
188
188
|
</Button>
|
|
@@ -206,7 +206,7 @@ export const RTLDiff: Story = {
|
|
|
206
206
|
Sm start icon
|
|
207
207
|
</Button>
|
|
208
208
|
|
|
209
|
-
<Button v2 size="sm" addonEnd={{ type: 'icon', value: <
|
|
209
|
+
<Button v2 size="sm" addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
210
210
|
Sm end icon
|
|
211
211
|
</Button>
|
|
212
212
|
|
|
@@ -214,12 +214,12 @@ export const RTLDiff: Story = {
|
|
|
214
214
|
v2
|
|
215
215
|
size="sm"
|
|
216
216
|
addonStart={{ type: 'icon', value: <Freeze /> }}
|
|
217
|
-
addonEnd={{ type: 'icon', value: <
|
|
217
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
218
218
|
>
|
|
219
219
|
Sm both icons
|
|
220
220
|
</Button>
|
|
221
221
|
|
|
222
|
-
<Button v2 size="md" loading addonEnd={{ type: 'icon', value: <
|
|
222
|
+
<Button v2 size="md" loading addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
223
223
|
Loading
|
|
224
224
|
</Button>
|
|
225
225
|
|
|
@@ -6,7 +6,7 @@ import { useLayout } from '../../common/hooks';
|
|
|
6
6
|
import Title from '../../Title';
|
|
7
7
|
import messages from '../Calendar.messages';
|
|
8
8
|
import Button from '../../Button/Button';
|
|
9
|
-
import { ChevronDown,
|
|
9
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';
|
|
10
10
|
import IconButton from '../../IconButton';
|
|
11
11
|
|
|
12
12
|
interface DateHeaderProps {
|
|
@@ -41,7 +41,7 @@ const DateHeader: React.FC<DateHeaderProps> = ({
|
|
|
41
41
|
disabled={isPreviousDisabled}
|
|
42
42
|
onClick={onPreviousClick}
|
|
43
43
|
>
|
|
44
|
-
<
|
|
44
|
+
<ChevronLeft className="left-single-direction" />
|
|
45
45
|
</IconButton>
|
|
46
46
|
</div>
|
|
47
47
|
{label && (
|
|
@@ -69,7 +69,7 @@ const DateHeader: React.FC<DateHeaderProps> = ({
|
|
|
69
69
|
disabled={isNextDisabled}
|
|
70
70
|
onClick={onNextClick}
|
|
71
71
|
>
|
|
72
|
-
<
|
|
72
|
+
<ChevronRight className="right-single-direction" />
|
|
73
73
|
</IconButton>
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChevronLeft, ChevronRight } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from 'react';
|
|
4
4
|
|
|
@@ -182,7 +182,7 @@ const Carousel: React.FC<CarouselProps> = ({ header, className, cards, onClick }
|
|
|
182
182
|
data-testid="scroll-carousel-left"
|
|
183
183
|
onClick={() => scrollCarousel('backward')}
|
|
184
184
|
>
|
|
185
|
-
<
|
|
185
|
+
<ChevronLeft />
|
|
186
186
|
</IconButton>
|
|
187
187
|
<IconButton
|
|
188
188
|
size={32}
|
|
@@ -194,7 +194,7 @@ const Carousel: React.FC<CarouselProps> = ({ header, className, cards, onClick }
|
|
|
194
194
|
disabled={scrollIsAtEnd}
|
|
195
195
|
onClick={() => scrollCarousel('forward')}
|
|
196
196
|
>
|
|
197
|
-
<
|
|
197
|
+
<ChevronRight />
|
|
198
198
|
</IconButton>
|
|
199
199
|
</div>
|
|
200
200
|
) : null}
|
|
@@ -9,19 +9,6 @@
|
|
|
9
9
|
.tw-date .tw-date--day {
|
|
10
10
|
margin-block-end: 0;
|
|
11
11
|
}
|
|
12
|
-
[dir="rtl"] .tw-date .np-input {
|
|
13
|
-
text-align: end;
|
|
14
|
-
}
|
|
15
|
-
[dir="rtl"] .tw-date .np-input::-moz-placeholder {
|
|
16
|
-
text-align: start;
|
|
17
|
-
}
|
|
18
|
-
[dir="rtl"] .tw-date .np-input:-moz-placeholder {
|
|
19
|
-
text-align: start;
|
|
20
|
-
}
|
|
21
|
-
[dir="rtl"] .tw-date .np-input::placeholder,
|
|
22
|
-
[dir="rtl"] .tw-date .np-input:placeholder-shown {
|
|
23
|
-
text-align: start;
|
|
24
|
-
}
|
|
25
12
|
@media (min-width: 600px) {
|
|
26
13
|
.np-theme-personal .tw-date label {
|
|
27
14
|
margin-block-end: 0;
|
|
@@ -10,15 +10,7 @@
|
|
|
10
10
|
.tw-date--year,
|
|
11
11
|
.tw-date--month,
|
|
12
12
|
.tw-date--day {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
[dir="rtl"] & .np-input {
|
|
16
|
-
text-align: right;
|
|
17
|
-
|
|
18
|
-
&::placeholder,
|
|
19
|
-
&:placeholder-shown {
|
|
20
|
-
text-align: start;
|
|
21
|
-
}
|
|
13
|
+
margin-bottom: 0;
|
|
22
14
|
}
|
|
23
15
|
}
|
|
24
16
|
|
|
@@ -30,4 +22,4 @@
|
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
|
-
}
|
|
25
|
+
}
|
|
@@ -6,6 +6,7 @@ import { lorem10 } from '../../test-utils';
|
|
|
6
6
|
|
|
7
7
|
import Provider from '../../Provider';
|
|
8
8
|
import translations from '../../i18n';
|
|
9
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
9
10
|
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
10
11
|
|
|
11
12
|
const meta: Meta<typeof DateInput> = {
|
|
@@ -230,3 +231,15 @@ export const InputErrorMobile: Story = {
|
|
|
230
231
|
...InputError,
|
|
231
232
|
...withVariantConfig(['mobile'], InputError),
|
|
232
233
|
};
|
|
234
|
+
|
|
235
|
+
export const RTLDiff: Story = {
|
|
236
|
+
render: () => (
|
|
237
|
+
<>
|
|
238
|
+
<DateInput size="sm" onChange={fn()} />
|
|
239
|
+
<DateInput size="md" onChange={fn()} />
|
|
240
|
+
<DateInput size="lg" onChange={fn()} />
|
|
241
|
+
<DateInput mode="month-year" onChange={fn()} />
|
|
242
|
+
</>
|
|
243
|
+
),
|
|
244
|
+
...withRTLDiff(),
|
|
245
|
+
};
|
|
@@ -118,40 +118,26 @@ export const Basic = () => {
|
|
|
118
118
|
export const Numbers = () => {
|
|
119
119
|
return (
|
|
120
120
|
<>
|
|
121
|
-
<Title type={Typography.TITLE_SCREEN}>Display Number
|
|
121
|
+
<Title type={Typography.TITLE_SCREEN}>Display Number</Title>
|
|
122
122
|
<hr />
|
|
123
|
-
<Display type={Typography.
|
|
123
|
+
<Display type={Typography.DISPLAY_NUMBER}>
|
|
124
124
|
<Money amount={1050.6} currency="UAH" />
|
|
125
125
|
</Display>
|
|
126
126
|
<hr />
|
|
127
|
-
<Display type={Typography.
|
|
127
|
+
<Display type={Typography.DISPLAY_NUMBER}>
|
|
128
128
|
<Money amount={10.17} currency="JPY" />
|
|
129
129
|
</Display>
|
|
130
|
-
|
|
131
|
-
<Title type={Typography.TITLE_SCREEN}>Display Number Medium</Title>
|
|
132
130
|
<hr />
|
|
133
|
-
<Display type={Typography.
|
|
131
|
+
<Display type={Typography.DISPLAY_NUMBER}>
|
|
134
132
|
<Money amount={0.01} currency="EUR" />
|
|
135
133
|
</Display>
|
|
136
134
|
<hr />
|
|
137
|
-
<Display type={Typography.
|
|
135
|
+
<Display type={Typography.DISPLAY_NUMBER}>
|
|
138
136
|
<Money amount={1000000} currency="EUR" />
|
|
139
137
|
</Display>
|
|
140
|
-
|
|
141
|
-
<Title type={Typography.TITLE_SCREEN}>Display Number Large</Title>
|
|
142
|
-
<hr />
|
|
143
|
-
<Display type={Typography.DISPLAY_NUMBER_LARGE}>
|
|
144
|
-
<Money amount={1000000} currency="GBP" />
|
|
145
|
-
</Display>
|
|
146
|
-
<hr />
|
|
147
|
-
<Display type={Typography.DISPLAY_NUMBER_LARGE}>
|
|
148
|
-
<Money amount={1050.6} currency="UAH" />
|
|
149
|
-
</Display>
|
|
150
|
-
|
|
151
|
-
<Title type={Typography.TITLE_SCREEN}>Display Number (Deprecated)</Title>
|
|
152
138
|
<hr />
|
|
153
139
|
<Display type={Typography.DISPLAY_NUMBER}>
|
|
154
|
-
<Money amount={
|
|
140
|
+
<Money amount={1000000} currency="GBP" />
|
|
155
141
|
</Display>
|
|
156
142
|
</>
|
|
157
143
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { userEvent, within } from 'storybook/test';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
|
|
4
|
-
import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
4
|
import InputWithDisplayFormat, { InputWithDisplayFormatProps } from '..';
|
|
6
5
|
import Field, { FieldProps } from '../../Field/Field';
|
|
7
6
|
|
|
@@ -32,54 +31,3 @@ export const SecurityPinPlay: Story = {
|
|
|
32
31
|
await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), '123456');
|
|
33
32
|
},
|
|
34
33
|
};
|
|
35
|
-
|
|
36
|
-
export const RTLDiff: StoryObj<typeof InputWithDisplayFormat> = {
|
|
37
|
-
render: () => {
|
|
38
|
-
const i18n = useRtlDiffI18n();
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<>
|
|
42
|
-
<Field id="empty" label="Empty with placeholder">
|
|
43
|
-
<InputWithDisplayFormat
|
|
44
|
-
id="empty"
|
|
45
|
-
value=""
|
|
46
|
-
displayPattern="**** - **** - ****"
|
|
47
|
-
placeholder={i18n.placeholder}
|
|
48
|
-
onChange={() => {}}
|
|
49
|
-
/>
|
|
50
|
-
</Field>
|
|
51
|
-
<Field id="card-code" label="Localised pattern">
|
|
52
|
-
<InputWithDisplayFormat
|
|
53
|
-
id="card-code"
|
|
54
|
-
value={i18n.value}
|
|
55
|
-
maxLength={16}
|
|
56
|
-
displayPattern="**** - **** - ****"
|
|
57
|
-
onChange={() => {}}
|
|
58
|
-
/>
|
|
59
|
-
</Field>
|
|
60
|
-
<Field id="iban" label="IBAN (not localised)">
|
|
61
|
-
<InputWithDisplayFormat
|
|
62
|
-
id="iban"
|
|
63
|
-
value="GB29NWBK60161331926819"
|
|
64
|
-
maxLength={22}
|
|
65
|
-
displayPattern="** **** **** **** **** ****"
|
|
66
|
-
onChange={() => {}}
|
|
67
|
-
/>
|
|
68
|
-
</Field>
|
|
69
|
-
</>
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
...withRTLDiff({
|
|
73
|
-
width: 'stretch',
|
|
74
|
-
i18n: {
|
|
75
|
-
value: {
|
|
76
|
-
ltr: 'XKQMRTBWJNFL',
|
|
77
|
-
rtl: 'خكقمرتبوجنفل',
|
|
78
|
-
},
|
|
79
|
-
placeholder: {
|
|
80
|
-
ltr: 'Enter code',
|
|
81
|
-
rtl: 'أدخل الرمز',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
};
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
--ring-color: var(--color-interactive-primary);
|
|
40
40
|
}
|
|
41
41
|
.np-form-control--size-auto {
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
font-weight: var(--font-weight-regular);
|
|
44
|
+
font-size: 1rem;
|
|
45
|
+
font-size: var(--font-size-16);
|
|
46
|
+
line-height: 150%;
|
|
47
|
+
letter-spacing: -0.011em;
|
|
42
48
|
word-wrap: break-word;
|
|
43
49
|
padding-block-start: 12px;
|
|
44
50
|
padding-block-start: var(--size-12);
|
|
@@ -80,6 +86,12 @@
|
|
|
80
86
|
padding-block-end: 0 !important;
|
|
81
87
|
}
|
|
82
88
|
.np-form-control--size-sm {
|
|
89
|
+
font-size: 0.875rem;
|
|
90
|
+
font-size: var(--font-size-14);
|
|
91
|
+
line-height: 155%;
|
|
92
|
+
letter-spacing: -0.006em;
|
|
93
|
+
font-weight: 400;
|
|
94
|
+
font-weight: var(--font-weight-regular);
|
|
83
95
|
word-wrap: break-word;
|
|
84
96
|
block-size: 32px !important;
|
|
85
97
|
block-size: var(--size-32) !important;
|
|
@@ -119,6 +131,12 @@
|
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
.np-form-control--size-md {
|
|
134
|
+
font-weight: 400;
|
|
135
|
+
font-weight: var(--font-weight-regular);
|
|
136
|
+
font-size: 1rem;
|
|
137
|
+
font-size: var(--font-size-16);
|
|
138
|
+
line-height: 150%;
|
|
139
|
+
letter-spacing: -0.011em;
|
|
122
140
|
word-wrap: break-word;
|
|
123
141
|
block-size: 48px !important;
|
|
124
142
|
block-size: var(--size-48) !important;
|
|
@@ -166,6 +184,12 @@
|
|
|
166
184
|
letter-spacing: 0;
|
|
167
185
|
word-wrap: break-word;
|
|
168
186
|
margin-block-end: initial;
|
|
187
|
+
font-size: 1.375rem;
|
|
188
|
+
font-size: var(--font-size-22);
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
font-weight: var(--font-weight-semi-bold);
|
|
191
|
+
letter-spacing: -0.018em;
|
|
192
|
+
line-height: 125%;
|
|
169
193
|
block-size: 72px !important;
|
|
170
194
|
block-size: var(--size-72) !important;
|
|
171
195
|
}
|
|
@@ -7,7 +7,6 @@ export interface SelectInputOptionContentProps {
|
|
|
7
7
|
note?: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
|
-
className?: string;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -20,7 +19,6 @@ export function SelectInputOptionContent({
|
|
|
20
19
|
note,
|
|
21
20
|
description,
|
|
22
21
|
icon,
|
|
23
|
-
className,
|
|
24
22
|
}: SelectInputOptionContentProps) {
|
|
25
23
|
const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
|
|
26
24
|
|
|
@@ -29,7 +27,6 @@ export function SelectInputOptionContent({
|
|
|
29
27
|
className={clsx(
|
|
30
28
|
'np-select-input-option-content-container',
|
|
31
29
|
(note || description) && 'np-text-body-large',
|
|
32
|
-
className,
|
|
33
30
|
)}
|
|
34
31
|
>
|
|
35
32
|
{icon ? (
|
|
@@ -50,7 +47,7 @@ export function SelectInputOptionContent({
|
|
|
50
47
|
withinTrigger && 'np-select-input-option-content-text-within-trigger',
|
|
51
48
|
)}
|
|
52
49
|
>
|
|
53
|
-
<div className="d-inline
|
|
50
|
+
<div className="d-inline">{title}</div>
|
|
54
51
|
{note ? (
|
|
55
52
|
<span className="np-select-input-option-content-text-secondary np-text-body-default">
|
|
56
53
|
{note}
|
|
@@ -721,80 +721,6 @@ describe('SelectInput', () => {
|
|
|
721
721
|
expect(descriptionElement).toHaveClass('np-select-input-option-description-in-trigger');
|
|
722
722
|
});
|
|
723
723
|
|
|
724
|
-
it('applies custom className to option content container in the trigger', () => {
|
|
725
|
-
render(
|
|
726
|
-
<SelectInput
|
|
727
|
-
items={[
|
|
728
|
-
{ type: 'option', value: 'USD' },
|
|
729
|
-
{ type: 'option', value: 'EUR' },
|
|
730
|
-
]}
|
|
731
|
-
renderValue={(currency) => (
|
|
732
|
-
<SelectInputOptionContent title={currency} className="custom-option-class" />
|
|
733
|
-
)}
|
|
734
|
-
value="USD"
|
|
735
|
-
/>,
|
|
736
|
-
);
|
|
737
|
-
|
|
738
|
-
const triggerContent = screen
|
|
739
|
-
.getByText('USD')
|
|
740
|
-
.closest('.np-select-input-option-content-container');
|
|
741
|
-
expect(triggerContent).toHaveClass('custom-option-class');
|
|
742
|
-
});
|
|
743
|
-
|
|
744
|
-
it('applies custom className to option content container in dropdown options', async () => {
|
|
745
|
-
render(
|
|
746
|
-
<SelectInput
|
|
747
|
-
items={[
|
|
748
|
-
{ type: 'option', value: 'USD' },
|
|
749
|
-
{ type: 'option', value: 'EUR' },
|
|
750
|
-
]}
|
|
751
|
-
renderValue={(currency) => (
|
|
752
|
-
<SelectInputOptionContent title={currency} className="custom-option-class" />
|
|
753
|
-
)}
|
|
754
|
-
value="USD"
|
|
755
|
-
/>,
|
|
756
|
-
);
|
|
757
|
-
|
|
758
|
-
const trigger = screen.getByRole('combobox');
|
|
759
|
-
await userEvent.click(trigger);
|
|
760
|
-
|
|
761
|
-
const listbox = screen.getByRole('listbox');
|
|
762
|
-
const options = within(listbox).getAllByRole('option');
|
|
763
|
-
const optionContent = options[0].querySelector('.np-select-input-option-content-container');
|
|
764
|
-
expect(optionContent).toHaveClass('custom-option-class');
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
it('supports conditional className based on withinTrigger', async () => {
|
|
768
|
-
render(
|
|
769
|
-
<SelectInput
|
|
770
|
-
items={[
|
|
771
|
-
{ type: 'option', value: 'USD' },
|
|
772
|
-
{ type: 'option', value: 'EUR' },
|
|
773
|
-
]}
|
|
774
|
-
renderValue={(currency, withinTrigger) => (
|
|
775
|
-
<SelectInputOptionContent
|
|
776
|
-
title={currency}
|
|
777
|
-
className={withinTrigger ? undefined : 'dropdown-only-class'}
|
|
778
|
-
/>
|
|
779
|
-
)}
|
|
780
|
-
value="USD"
|
|
781
|
-
/>,
|
|
782
|
-
);
|
|
783
|
-
|
|
784
|
-
const triggerContent = screen
|
|
785
|
-
.getByText('USD')
|
|
786
|
-
.closest('.np-select-input-option-content-container');
|
|
787
|
-
expect(triggerContent).not.toHaveClass('dropdown-only-class');
|
|
788
|
-
|
|
789
|
-
const trigger = screen.getByRole('combobox');
|
|
790
|
-
await userEvent.click(trigger);
|
|
791
|
-
|
|
792
|
-
const listbox = screen.getByRole('listbox');
|
|
793
|
-
const options = within(listbox).getAllByRole('option');
|
|
794
|
-
const optionContent = options[0].querySelector('.np-select-input-option-content-container');
|
|
795
|
-
expect(optionContent).toHaveClass('dropdown-only-class');
|
|
796
|
-
});
|
|
797
|
-
|
|
798
724
|
describe('listbox label', () => {
|
|
799
725
|
const fieldLabel = 'Fruits';
|
|
800
726
|
const triggerLabel = 'Select fruit';
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
--ring-color: var(--color-interactive-primary);
|
|
40
40
|
}
|
|
41
41
|
.np-form-control--size-auto {
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
font-weight: var(--font-weight-regular);
|
|
44
|
+
font-size: 1rem;
|
|
45
|
+
font-size: var(--font-size-16);
|
|
46
|
+
line-height: 150%;
|
|
47
|
+
letter-spacing: -0.011em;
|
|
42
48
|
word-wrap: break-word;
|
|
43
49
|
padding-block-start: 12px;
|
|
44
50
|
padding-block-start: var(--size-12);
|
|
@@ -80,6 +86,12 @@
|
|
|
80
86
|
padding-block-end: 0 !important;
|
|
81
87
|
}
|
|
82
88
|
.np-form-control--size-sm {
|
|
89
|
+
font-size: 0.875rem;
|
|
90
|
+
font-size: var(--font-size-14);
|
|
91
|
+
line-height: 155%;
|
|
92
|
+
letter-spacing: -0.006em;
|
|
93
|
+
font-weight: 400;
|
|
94
|
+
font-weight: var(--font-weight-regular);
|
|
83
95
|
word-wrap: break-word;
|
|
84
96
|
block-size: 32px !important;
|
|
85
97
|
block-size: var(--size-32) !important;
|
|
@@ -119,6 +131,12 @@
|
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
.np-form-control--size-md {
|
|
134
|
+
font-weight: 400;
|
|
135
|
+
font-weight: var(--font-weight-regular);
|
|
136
|
+
font-size: 1rem;
|
|
137
|
+
font-size: var(--font-size-16);
|
|
138
|
+
line-height: 150%;
|
|
139
|
+
letter-spacing: -0.011em;
|
|
122
140
|
word-wrap: break-word;
|
|
123
141
|
block-size: 48px !important;
|
|
124
142
|
block-size: var(--size-48) !important;
|
|
@@ -166,6 +184,12 @@
|
|
|
166
184
|
letter-spacing: 0;
|
|
167
185
|
word-wrap: break-word;
|
|
168
186
|
margin-block-end: initial;
|
|
187
|
+
font-size: 1.375rem;
|
|
188
|
+
font-size: var(--font-size-22);
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
font-weight: var(--font-weight-semi-bold);
|
|
191
|
+
letter-spacing: -0.018em;
|
|
192
|
+
line-height: 125%;
|
|
169
193
|
block-size: 72px !important;
|
|
170
194
|
block-size: var(--size-72) !important;
|
|
171
195
|
}
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
.wds-list-item-control-wrapper {
|
|
568
568
|
grid-area: control;
|
|
569
569
|
}
|
|
570
|
-
.wds-list-item-navigation .tw-icon-chevron-
|
|
570
|
+
.wds-list-item-navigation .tw-icon-chevron-right {
|
|
571
571
|
color: #c9cbce;
|
|
572
572
|
color: var(--color-interactive-secondary);
|
|
573
573
|
display: block;
|
|
@@ -169,10 +169,10 @@
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
// LESS struggles with ranged container queries so
|
|
173
|
-
// escape the interpolated expression
|
|
174
|
-
@container (
|
|
175
|
-
.wds-list-item-media-image
|
|
172
|
+
// LESS struggles with ranged container queries so
|
|
173
|
+
// we need to escape the interpolated expression.
|
|
174
|
+
@container (~"@{wds-list-item-cq-min} < width <= @{wds-list-item-cq-max}") {
|
|
175
|
+
.wds-list-item-media-image{
|
|
176
176
|
object-position: bottom left;
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChevronRight } from '@transferwise/icons';
|
|
2
2
|
import type { ButtonProps } from '../../Button/Button.types';
|
|
3
3
|
import { useListItemControl } from '../useListItemControl';
|
|
4
4
|
import { PrimitiveButton } from '../../Primitives';
|
|
@@ -32,7 +32,7 @@ export const Navigation = function Navigation({
|
|
|
32
32
|
}: ListItemNavigationProps) {
|
|
33
33
|
const { baseItemProps } = useListItemControl('navigation', { href, hideIndicator, ...props });
|
|
34
34
|
const { ids, describedByIds } = useContext(ListItemContext);
|
|
35
|
-
const icon = hideIndicator ? null : <
|
|
35
|
+
const icon = hideIndicator ? null : <ChevronRight size={16} data-testid="NavigationIndicator" />;
|
|
36
36
|
|
|
37
37
|
return href ? (
|
|
38
38
|
<>{icon}</>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
margin-left: var(--size-12);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
&__number-input-field
|
|
10
|
+
&__number-input-field{
|
|
11
11
|
[dir="rtl"] & {
|
|
12
12
|
text-align: end;
|
|
13
13
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
width: 100%;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.np-select-input-content
|
|
25
|
+
.np-select-input-content{
|
|
26
26
|
[dir="rtl"] & {
|
|
27
27
|
text-align: end;
|
|
28
28
|
direction: ltr;
|
|
@@ -40,11 +40,3 @@
|
|
|
40
40
|
.tw-telephone__number-input {
|
|
41
41
|
flex: auto 1 1;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
// Prevent bidi algorithm from flipping "+{country-code}" to "{country-code}+"
|
|
45
|
-
// in RTL dropdown options as phone numbers are universally read as LTR.
|
|
46
|
-
.tw-telephone__prefix-option .np-select-input-option-content-title {
|
|
47
|
-
[dir="rtl"] & {
|
|
48
|
-
direction: ltr;
|
|
49
|
-
}
|
|
50
|
-
}
|