@transferwise/components 0.0.0-experimental-1eb29c0 → 0.0.0-experimental-9adbb01
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 +2 -0
- package/build/index.esm.js +11 -3
- package/build/index.esm.js.map +1 -1
- package/build/index.js +11 -3
- package/build/index.js.map +1 -1
- package/build/types/dateInput/DateInput.messages.d.ts +15 -0
- package/package.json +1 -1
- package/src/dateInput/DateInput.js +2 -2
- package/src/dateInput/DateInput.messages.js +10 -0
- package/src/dateInput/DateInput.spec.js +10 -0
- package/src/i18n/en.json +2 -0
- package/src/moneyInput/MoneyInput.js +1 -1
- package/src/moneyInput/MoneyInput.story.tsx +25 -2
|
@@ -15,6 +15,21 @@ declare namespace _default {
|
|
|
15
15
|
const defaultMessage_2: string;
|
|
16
16
|
export { defaultMessage_2 as defaultMessage };
|
|
17
17
|
}
|
|
18
|
+
namespace dayPlaceholder {
|
|
19
|
+
const id_3: string;
|
|
20
|
+
export { id_3 as id };
|
|
21
|
+
const defaultMessage_3: string;
|
|
22
|
+
export { defaultMessage_3 as defaultMessage };
|
|
23
|
+
export const description: string;
|
|
24
|
+
}
|
|
25
|
+
namespace yearPlaceholder {
|
|
26
|
+
const id_4: string;
|
|
27
|
+
export { id_4 as id };
|
|
28
|
+
const defaultMessage_4: string;
|
|
29
|
+
export { defaultMessage_4 as defaultMessage };
|
|
30
|
+
const description_1: string;
|
|
31
|
+
export { description_1 as description };
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
export default _default;
|
|
20
35
|
//# sourceMappingURL=DateInput.messages.d.ts.map
|
package/package.json
CHANGED
|
@@ -64,9 +64,9 @@ const DateInput = ({
|
|
|
64
64
|
monthLabel = monthLabel || formatMessage(messages.monthLabel);
|
|
65
65
|
yearLabel = yearLabel || formatMessage(messages.yearLabel);
|
|
66
66
|
placeholders = {
|
|
67
|
-
day: placeholders?.day ||
|
|
67
|
+
day: placeholders?.day || formatMessage(messages.dayPlaceholder),
|
|
68
68
|
month: placeholders?.month || formatMessage(messages.monthLabel),
|
|
69
|
-
year: placeholders?.year ||
|
|
69
|
+
year: placeholders?.year || formatMessage(messages.yearPlaceholder),
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
const getDateAsString = (date) => {
|
|
@@ -13,4 +13,14 @@ export default defineMessages({
|
|
|
13
13
|
id: 'neptune.DateInput.year.label',
|
|
14
14
|
defaultMessage: 'Year',
|
|
15
15
|
},
|
|
16
|
+
dayPlaceholder: {
|
|
17
|
+
id: 'neptune.DateInput.day.placeholder',
|
|
18
|
+
defaultMessage: 'DD',
|
|
19
|
+
description: 'Placeholder for 2-digit day values within an input.',
|
|
20
|
+
},
|
|
21
|
+
yearPlaceholder: {
|
|
22
|
+
id: 'neptune.DateInput.year.placeholder',
|
|
23
|
+
defaultMessage: 'YYYY',
|
|
24
|
+
description: 'Placeholder for 4-digit year values within an input.',
|
|
25
|
+
},
|
|
16
26
|
});
|
|
@@ -60,6 +60,16 @@ jest.mock('./DateInput.messages', () => ({
|
|
|
60
60
|
id: 'neptune.DateInput.year.label',
|
|
61
61
|
defaultMessage: 'Year',
|
|
62
62
|
},
|
|
63
|
+
dayPlaceholder: {
|
|
64
|
+
id: 'neptune.DateInput.day.placeholder',
|
|
65
|
+
defaultMessage: 'DD',
|
|
66
|
+
description: 'Placeholder for 2-digit day values within an input.',
|
|
67
|
+
},
|
|
68
|
+
yearPlaceholder: {
|
|
69
|
+
id: 'neptune.DateInput.year.placeholder',
|
|
70
|
+
defaultMessage: 'YYYY',
|
|
71
|
+
description: 'Placeholder for 4-digit year values within an input.',
|
|
72
|
+
},
|
|
63
73
|
}));
|
|
64
74
|
|
|
65
75
|
jest.mock('react-intl');
|
package/src/i18n/en.json
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
"neptune.ClearButton.ariaLabel": "Clear",
|
|
5
5
|
"neptune.CloseButton.ariaLabel": "Close",
|
|
6
6
|
"neptune.DateInput.day.label": "Day",
|
|
7
|
+
"neptune.DateInput.day.placeholder": "DD",
|
|
7
8
|
"neptune.DateInput.month.label": "Month",
|
|
8
9
|
"neptune.DateInput.year.label": "Year",
|
|
10
|
+
"neptune.DateInput.year.placeholder": "YYYY",
|
|
9
11
|
"neptune.DateLookup.day": "day",
|
|
10
12
|
"neptune.DateLookup.goTo20YearView": "Go to 20 year view",
|
|
11
13
|
"neptune.DateLookup.month": "month",
|
|
@@ -361,7 +361,7 @@ class MoneyInput extends Component {
|
|
|
361
361
|
renderValue={(currency, withinTrigger) => {
|
|
362
362
|
return (
|
|
363
363
|
<SelectInputOptionContent
|
|
364
|
-
title={currency.label}
|
|
364
|
+
title={withinTrigger ? currency.currency.toUpperCase() : currency.label}
|
|
365
365
|
note={withinTrigger ? undefined : currency.note}
|
|
366
366
|
icon={<Flag code={currency.currency} intrinsicSize={24} />}
|
|
367
367
|
/>
|
|
@@ -3,8 +3,6 @@ import { within, userEvent } from '@storybook/testing-library';
|
|
|
3
3
|
import { Lock } from '@transferwise/icons';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import Drawer from '../drawer';
|
|
7
|
-
|
|
8
6
|
import MoneyInput from '.';
|
|
9
7
|
|
|
10
8
|
export default {
|
|
@@ -82,6 +80,17 @@ const exampleCurrency = {
|
|
|
82
80
|
},
|
|
83
81
|
} as const;
|
|
84
82
|
|
|
83
|
+
const exampleBalanceCurrency = {
|
|
84
|
+
eur: {
|
|
85
|
+
...exampleCurrency.eur,
|
|
86
|
+
label: '123.45 EUR',
|
|
87
|
+
},
|
|
88
|
+
gbp: {
|
|
89
|
+
...exampleCurrency.gbp,
|
|
90
|
+
label: '12.34 GBP',
|
|
91
|
+
},
|
|
92
|
+
} as const;
|
|
93
|
+
|
|
85
94
|
export const SingleCurrency: Story = {
|
|
86
95
|
args: {
|
|
87
96
|
currencies: [],
|
|
@@ -117,6 +126,20 @@ export const MultipleCurrencies: Story = {
|
|
|
117
126
|
},
|
|
118
127
|
};
|
|
119
128
|
|
|
129
|
+
export const BalanceCurrencies: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
currencies: [
|
|
132
|
+
{
|
|
133
|
+
header: 'Balance currencies',
|
|
134
|
+
},
|
|
135
|
+
exampleBalanceCurrency.eur,
|
|
136
|
+
exampleBalanceCurrency.gbp,
|
|
137
|
+
],
|
|
138
|
+
selectedCurrency: exampleBalanceCurrency.eur,
|
|
139
|
+
searchPlaceholder: 'Type a currency / country',
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
120
143
|
export const OpenedInput: Story = {
|
|
121
144
|
...MultipleCurrencies,
|
|
122
145
|
play: ({ canvasElement }) => {
|