@transferwise/components 46.67.0 → 46.67.2
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/flowNavigation/animatedLabel/AnimatedLabel.js +2 -5
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +2 -5
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/i18n/de.json +1 -0
- package/build/i18n/de.json.js +1 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +1 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/es.json +1 -0
- package/build/i18n/es.json.js +1 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +1 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +1 -0
- package/build/i18n/fr.json.js +1 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +1 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +1 -0
- package/build/i18n/hu.json.js +1 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +1 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +1 -0
- package/build/i18n/id.json.js +1 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +1 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +1 -0
- package/build/i18n/it.json.js +1 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +1 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +1 -0
- package/build/i18n/ja.json.js +1 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +1 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pl.json.js +1 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +1 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +1 -0
- package/build/i18n/pt.json.js +1 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +1 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ro.json.js +1 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +1 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +1 -0
- package/build/i18n/ru.json.js +1 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +1 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +1 -0
- package/build/i18n/th.json.js +1 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +1 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +1 -0
- package/build/i18n/tr.json.js +1 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +1 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +1 -0
- package/build/i18n/zh-CN.json.js +1 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +1 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +1 -0
- package/build/i18n/zh-HK.json.js +1 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +1 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/main.css +4 -0
- package/build/moneyInput/MoneyInput.js +1 -0
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -0
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +4 -0
- package/build/styles/main.css +4 -0
- package/build/typeahead/Typeahead.js +1 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/flowNavigation/FlowNavigation.css +4 -0
- package/src/flowNavigation/FlowNavigation.less +4 -0
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +2 -2
- package/src/i18n/de.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/fr.json +1 -0
- package/src/i18n/hu.json +1 -0
- package/src/i18n/id.json +1 -0
- package/src/i18n/it.json +1 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/pl.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/ro.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/th.json +1 -0
- package/src/i18n/tr.json +1 -0
- package/src/i18n/zh-CN.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/main.css +4 -0
- package/src/moneyInput/MoneyInput.tsx +1 -0
- package/src/typeahead/Typeahead.spec.js +6 -0
- package/src/typeahead/Typeahead.story.tsx +12 -9
- package/src/typeahead/Typeahead.tsx +16 -14
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +6 -0
- package/src/typeahead/typeaheadInput/TypeaheadInput.tsx +1 -1
package/src/i18n/pt.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Opcional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(abre em uma nova aba)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Escolha uma opção...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecione a moeda",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Escolha uma opção...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
package/src/i18n/ro.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Opțional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(se deschide într-o filă nouă)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Selectează o opţiune...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selectează moneda",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
package/src/i18n/ru.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(необязательно)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "Выберите валюту",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
package/src/i18n/th.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(ไม่บังคับ)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(เปิดในแท็บใหม่)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "เลือกสกุลเงิน",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
package/src/i18n/tr.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(İsteğe bağlı)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(yeni sekmede açılır)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Bir seçenek seçin...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "Para birimi seçin",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Bir seçenek seçin...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(可选)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "选择货币",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(可選)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
24
|
+
"neptune.MoneyInput.Select.selectCurrencyLabel": "選擇貨幣",
|
|
24
25
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
25
26
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
26
27
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
package/src/main.css
CHANGED
|
@@ -2185,6 +2185,10 @@ html:not([dir="rtl"]) .np-flow-navigation__stepper {
|
|
|
2185
2185
|
.np-flow-navigation--xs-max .np-animated-label {
|
|
2186
2186
|
height: auto;
|
|
2187
2187
|
}
|
|
2188
|
+
.np-flow-navigation--xs-max .np-animated-label .tw-icon-chevron-down {
|
|
2189
|
+
margin-left: 4px;
|
|
2190
|
+
margin-left: var(--size-4);
|
|
2191
|
+
}
|
|
2188
2192
|
.np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
2189
2193
|
min-height: 56px;
|
|
2190
2194
|
}
|
|
@@ -347,6 +347,12 @@ describe('Typeahead', () => {
|
|
|
347
347
|
expect(options.every((label, i) => label === props.options[i].label)).toBe(true);
|
|
348
348
|
});
|
|
349
349
|
|
|
350
|
+
it('renders dropdown-menu if has options', () => {
|
|
351
|
+
expect(component.find('.dropdown-menu')).toHaveLength(1);
|
|
352
|
+
component.setProps({ options: [] });
|
|
353
|
+
expect(component.find('.dropdown-menu')).toHaveLength(0);
|
|
354
|
+
});
|
|
355
|
+
|
|
350
356
|
it('does not render new option if showNewEntry is false', () => {
|
|
351
357
|
component.setProps({
|
|
352
358
|
allowNew: true,
|
|
@@ -6,6 +6,7 @@ import Typeahead, { type TypeaheadOption } from './Typeahead';
|
|
|
6
6
|
import { Size } from '../common';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { Input } from '../inputs/Input';
|
|
9
|
+
import { Field } from '../field/Field';
|
|
9
10
|
|
|
10
11
|
type Story = StoryObj<typeof Typeahead>;
|
|
11
12
|
|
|
@@ -103,15 +104,17 @@ export const Basic: Story = {
|
|
|
103
104
|
|
|
104
105
|
export const Creatable: Story = {
|
|
105
106
|
render: (args) => (
|
|
106
|
-
<Typeahead
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
<Field id={`input-${args.id}`} label="Typeahead with values">
|
|
108
|
+
<Typeahead
|
|
109
|
+
{...args}
|
|
110
|
+
allowNew
|
|
111
|
+
multiple
|
|
112
|
+
initialValue={[]}
|
|
113
|
+
validateChip={validateOptionAsEmail}
|
|
114
|
+
addon={<SearchIcon size={24} />}
|
|
115
|
+
options={[]}
|
|
116
|
+
/>
|
|
117
|
+
</Field>
|
|
115
118
|
),
|
|
116
119
|
play: async ({ canvasElement }) => {
|
|
117
120
|
const canvas = within(canvasElement);
|
|
@@ -401,20 +401,22 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
401
401
|
className={clsx('dropdown btn-group btn-block', { open: dropdownOpen })}
|
|
402
402
|
id={`menu-${id}`}
|
|
403
403
|
>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
404
|
+
{!!optionsToRender.length && (
|
|
405
|
+
<ul className="dropdown-menu" role="menu">
|
|
406
|
+
{optionsToRender.map((option, idx) => (
|
|
407
|
+
<TypeaheadOption
|
|
408
|
+
key={`${option.label}${idx.toString()}`}
|
|
409
|
+
query={query}
|
|
410
|
+
option={option}
|
|
411
|
+
selected={keyboardFocusedOptionIndex === idx}
|
|
412
|
+
onClick={(event) => {
|
|
413
|
+
this.onOptionSelected(event, option);
|
|
414
|
+
}}
|
|
415
|
+
/>
|
|
416
|
+
))}
|
|
417
|
+
{footer}
|
|
418
|
+
</ul>
|
|
419
|
+
)}
|
|
418
420
|
</div>
|
|
419
421
|
);
|
|
420
422
|
};
|
|
@@ -45,6 +45,12 @@ describe('Typeahead input', () => {
|
|
|
45
45
|
expect(inputWrapper().find('span')).toHaveLength(selected.length);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
it('adds aria-controls prop if dropdown is open', () => {
|
|
49
|
+
expect(component.prop('aria-controls')).toBeUndefined();
|
|
50
|
+
component.setProps({ dropdownOpen: true });
|
|
51
|
+
expect(component.prop('aria-controls')).toBe('menu-test');
|
|
52
|
+
});
|
|
53
|
+
|
|
48
54
|
it('passes all callbacks to input', () => {
|
|
49
55
|
const event = {};
|
|
50
56
|
const extraProps = {
|
|
@@ -91,7 +91,7 @@ export default class TypeaheadInput<T> extends Component<
|
|
|
91
91
|
aria-autocomplete="list"
|
|
92
92
|
aria-expanded={dropdownOpen}
|
|
93
93
|
aria-haspopup="listbox"
|
|
94
|
-
aria-controls={`menu-${typeaheadId}`}
|
|
94
|
+
aria-controls={dropdownOpen ? `menu-${typeaheadId}` : undefined}
|
|
95
95
|
autoComplete={autoComplete}
|
|
96
96
|
role="combobox"
|
|
97
97
|
value={value}
|