@transferwise/components 46.143.0 → 46.144.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/cs.json +1 -0
- package/build/i18n/cs.json.js +1 -0
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +1 -0
- package/build/i18n/cs.json.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/nl.json +1 -0
- package/build/i18n/nl.json.js +1 -0
- package/build/i18n/nl.json.js.map +1 -1
- package/build/i18n/nl.json.mjs +1 -0
- package/build/i18n/nl.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/uk.json +1 -0
- package/build/i18n/uk.json.js +1 -0
- package/build/i18n/uk.json.js.map +1 -1
- package/build/i18n/uk.json.mjs +1 -0
- package/build/i18n/uk.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 +17 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +3 -5
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +3 -5
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +4 -0
- package/build/styles/inputs/SelectInput/SelectInput.css +4 -0
- package/build/styles/main.css +17 -1
- package/build/styles/moneyInput/MoneyInput.css +4 -0
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +6 -1
- package/build/types/flowNavigation/index.d.ts +3 -0
- package/build/types/flowNavigation/index.d.ts.map +1 -0
- package/build/types/iconButton/IconButton.d.ts +1 -1
- package/build/types/index.d.ts +3 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/logo/index.d.ts +1 -0
- package/build/types/logo/index.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/flowNavigation/index.ts +2 -0
- package/src/i18n/cs.json +1 -0
- 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/nl.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/uk.json +1 -0
- package/src/i18n/zh-CN.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/index.ts +3 -1
- package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +4 -0
- package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.less +5 -0
- package/src/inputs/SelectInput/SelectInput.css +4 -0
- package/src/inputs/SelectInput/_stories/SelectInput.test.story.tsx +40 -0
- package/src/logo/index.ts +1 -0
- package/src/main.css +17 -1
- package/src/moneyInput/MoneyInput.css +4 -0
- package/src/moneyInput/MoneyInput.less +11 -6
- package/src/prompt/ActionPrompt/ActionPrompt.css +6 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +9 -5
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +0 -59
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +2 -6
package/src/i18n/id.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Perluas",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Ketik mata uang/negara",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Pilih mata uang",
|
|
23
|
+
"neptune.Field.characterCount": "{current} dari {max} karakter digunakan",
|
|
23
24
|
"neptune.FlowNavigation.back": "kembali ke langkah sebelumnya",
|
|
24
25
|
"neptune.Info.ariaLabel": "Informasi lebih lanjut",
|
|
25
26
|
"neptune.Label.optional": "(Opsional)",
|
package/src/i18n/it.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Espandi",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Digita una valuta / paese",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Scegli la valuta",
|
|
23
|
+
"neptune.Field.characterCount": "{current} di {max} caratteri utilizzati",
|
|
23
24
|
"neptune.FlowNavigation.back": "torna al passaggio precedente",
|
|
24
25
|
"neptune.Info.ariaLabel": "Maggiori informazioni",
|
|
25
26
|
"neptune.Label.optional": "(Facoltativo)",
|
package/src/i18n/ja.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "開く",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "通貨または国をご入力ください",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "通貨の選択",
|
|
23
|
+
"neptune.Field.characterCount": "{current}/{max}文字を使用",
|
|
23
24
|
"neptune.FlowNavigation.back": "前のステップに戻る",
|
|
24
25
|
"neptune.Info.ariaLabel": "詳細",
|
|
25
26
|
"neptune.Label.optional": "(任意)",
|
package/src/i18n/nl.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Uitvouwen",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Voer een valuta / land in",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selecteer valuta",
|
|
23
|
+
"neptune.Field.characterCount": "{current} van {max} tekens gebruikt",
|
|
23
24
|
"neptune.FlowNavigation.back": "terug naar vorige stap",
|
|
24
25
|
"neptune.Info.ariaLabel": "Meer informatie",
|
|
25
26
|
"neptune.Label.optional": "(Optioneel)",
|
package/src/i18n/pl.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Rozwiń",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Wpisz walutę / kraj",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Wybierz walutę",
|
|
23
|
+
"neptune.Field.characterCount": "Użyto {current} z {max} znaków",
|
|
23
24
|
"neptune.FlowNavigation.back": "wróć do poprzedniego kroku",
|
|
24
25
|
"neptune.Info.ariaLabel": "Więcej informacji",
|
|
25
26
|
"neptune.Label.optional": "(opcjonalne)",
|
package/src/i18n/pt.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Ver mais",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Digite uma moeda / país",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selecione a moeda",
|
|
23
|
+
"neptune.Field.characterCount": "{current} de {max} caracteres usados",
|
|
23
24
|
"neptune.FlowNavigation.back": "voltar à etapa anterior",
|
|
24
25
|
"neptune.Info.ariaLabel": "Mais informações",
|
|
25
26
|
"neptune.Label.optional": "(Opcional)",
|
package/src/i18n/ro.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Extinde",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Tastează o monedă / țară",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selectează moneda",
|
|
23
|
+
"neptune.Field.characterCount": "{current} din {max} caractere utilizate",
|
|
23
24
|
"neptune.FlowNavigation.back": "înapoi la pasul anterior",
|
|
24
25
|
"neptune.Info.ariaLabel": "Mai multe informații",
|
|
25
26
|
"neptune.Label.optional": "(Opțional)",
|
package/src/i18n/ru.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Развернуть",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Введите валюту/страну",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Выберите валюту",
|
|
23
|
+
"neptune.Field.characterCount": "Использовано символов: {current} из {max}",
|
|
23
24
|
"neptune.FlowNavigation.back": "вернуться к предыдущему шагу",
|
|
24
25
|
"neptune.Info.ariaLabel": "Подробнее",
|
|
25
26
|
"neptune.Label.optional": "(необязательно)",
|
package/src/i18n/th.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "ขยาย",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "ป้อนสกุลเงิน / ประเทศ",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "เลือกสกุลเงิน",
|
|
23
|
+
"neptune.Field.characterCount": "ใช้แล้ว {current} จากจำกัด {max} ตัวอักษร",
|
|
23
24
|
"neptune.FlowNavigation.back": "กลับไปที่ขั้นก่อนหน้า",
|
|
24
25
|
"neptune.Info.ariaLabel": "ข้อมูลเพิ่มเติม",
|
|
25
26
|
"neptune.Label.optional": "(ไม่บังคับ)",
|
package/src/i18n/tr.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Genişlet",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Bir para birimi / ülke girin",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Para birimi seçin",
|
|
23
|
+
"neptune.Field.characterCount": "{current}/{max} karakter kullanıldı",
|
|
23
24
|
"neptune.FlowNavigation.back": "önceki adıma dön",
|
|
24
25
|
"neptune.Info.ariaLabel": "Daha fazla bilgi",
|
|
25
26
|
"neptune.Label.optional": "(İsteğe bağlı)",
|
package/src/i18n/uk.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "Розгорнути",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Вкажіть валюту / країну",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Виберіть валюту",
|
|
23
|
+
"neptune.Field.characterCount": "Використано {current} з {max} символів",
|
|
23
24
|
"neptune.FlowNavigation.back": "назад до попереднього кроку",
|
|
24
25
|
"neptune.Info.ariaLabel": "Більше відомостей",
|
|
25
26
|
"neptune.Label.optional": "(Необов’язково)",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "展开",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "输入货币/国家/地区",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "选择货币",
|
|
23
|
+
"neptune.Field.characterCount": "已使用 {current} 个字符,最多 {max} 个",
|
|
23
24
|
"neptune.FlowNavigation.back": "返回上一步",
|
|
24
25
|
"neptune.Info.ariaLabel": "更多信息",
|
|
25
26
|
"neptune.Label.optional": "(可选)",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Expander.expandAriaLabel": "展開",
|
|
21
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "輸入貨幣或國家/地區",
|
|
22
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "選擇貨幣",
|
|
23
|
+
"neptune.Field.characterCount": "已輸入{current}個字元(上限為{max}個字元)",
|
|
23
24
|
"neptune.FlowNavigation.back": "返回上一個步驟",
|
|
24
25
|
"neptune.Info.ariaLabel": "更多資訊",
|
|
25
26
|
"neptune.Label.optional": "(可選)",
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Types
|
|
5
5
|
*/
|
|
6
6
|
export type { ContainerProps } from './container';
|
|
7
|
+
export type { LogoProps } from './logo';
|
|
8
|
+
export type { FlowNavigationProps } from './flowNavigation';
|
|
7
9
|
export type { AccordionItem, AccordionProps } from './accordion';
|
|
8
10
|
export type { ActionOptionProps } from './actionOption';
|
|
9
11
|
export type { AlertAction, AlertProps, AlertType } from './alert';
|
|
@@ -170,7 +172,7 @@ export { default as Drawer } from './drawer';
|
|
|
170
172
|
export { default as DropFade } from './dropFade';
|
|
171
173
|
export { default as Emphasis } from './emphasis';
|
|
172
174
|
export { Field } from './field/Field';
|
|
173
|
-
export { default as FlowNavigation } from './flowNavigation
|
|
175
|
+
export { default as FlowNavigation } from './flowNavigation';
|
|
174
176
|
export { default as Header } from './header';
|
|
175
177
|
export { default as Image } from './image';
|
|
176
178
|
export { default as Info } from './info';
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
border-radius: var(--size-10);
|
|
7
7
|
text-align: start;
|
|
8
8
|
}
|
|
9
|
+
.np-button-input .np-select-input-option-content-icon {
|
|
10
|
+
padding-right: 1px;
|
|
11
|
+
padding-left: 1px;
|
|
12
|
+
}
|
|
9
13
|
.np-button-input:has(.np-select-input-option-description-in-trigger) {
|
|
10
14
|
height: auto !important;
|
|
11
15
|
align-content: start;
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
border-radius: var(--size-10);
|
|
6
6
|
text-align: start;
|
|
7
7
|
|
|
8
|
+
.np-select-input-option-content-icon {
|
|
9
|
+
padding-right: 1px;
|
|
10
|
+
padding-left: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
// Using !important to overwrite styles from .form-control and inputClassNameBase util, which also use !important
|
|
9
14
|
&:has(.np-select-input-option-description-in-trigger) {
|
|
10
15
|
height: auto !important;
|
|
@@ -102,6 +102,10 @@
|
|
|
102
102
|
border-radius: var(--size-10);
|
|
103
103
|
text-align: start;
|
|
104
104
|
}
|
|
105
|
+
.np-button-input .np-select-input-option-content-icon {
|
|
106
|
+
padding-right: 1px;
|
|
107
|
+
padding-left: 1px;
|
|
108
|
+
}
|
|
105
109
|
.np-button-input:has(.np-select-input-option-description-in-trigger) {
|
|
106
110
|
height: auto !important;
|
|
107
111
|
align-content: start;
|
|
@@ -1927,3 +1927,43 @@ export const Zoom400: Story<TestMonth | null> = {
|
|
|
1927
1927
|
},
|
|
1928
1928
|
...withVariantConfig(['400%']),
|
|
1929
1929
|
};
|
|
1930
|
+
|
|
1931
|
+
const jpy = { code: 'JPY', name: 'Japanese yen' } satisfies TestCurrency;
|
|
1932
|
+
const flagClippingItems = [testCurrencyOption(jpy)];
|
|
1933
|
+
const flagClippingArgs = {
|
|
1934
|
+
items: flagClippingItems,
|
|
1935
|
+
value: jpy,
|
|
1936
|
+
size: 'lg',
|
|
1937
|
+
renderValue: (currency: TestCurrency) => (
|
|
1938
|
+
<SelectInputOptionContent
|
|
1939
|
+
title={currency.code}
|
|
1940
|
+
icon={<Flag code={currency.code} intrinsicSize={24} />}
|
|
1941
|
+
/>
|
|
1942
|
+
),
|
|
1943
|
+
} satisfies Story<TestCurrency>['args'];
|
|
1944
|
+
|
|
1945
|
+
const singleCurrencyMoneyInputProps = {
|
|
1946
|
+
id: 'flag-clipping-money-input',
|
|
1947
|
+
amount: 1234.14,
|
|
1948
|
+
currencies: [],
|
|
1949
|
+
selectedCurrency: {
|
|
1950
|
+
value: 'EUR',
|
|
1951
|
+
label: 'EUR',
|
|
1952
|
+
note: 'Euro',
|
|
1953
|
+
currency: 'eur',
|
|
1954
|
+
searchable: 'Spain, Germany, France, Austria',
|
|
1955
|
+
},
|
|
1956
|
+
onAmountChange: fn() satisfies Mock,
|
|
1957
|
+
onCurrencyChange: fn() satisfies Mock,
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
export const FlagClipping: Story<TestCurrency> = {
|
|
1961
|
+
render: (args) => (
|
|
1962
|
+
<div style={{ display: 'grid', gap: 24, width: 360 }}>
|
|
1963
|
+
<Field label="Flag clipping">
|
|
1964
|
+
<SelectInput {...args} />
|
|
1965
|
+
</Field>
|
|
1966
|
+
</div>
|
|
1967
|
+
),
|
|
1968
|
+
args: flagClippingArgs,
|
|
1969
|
+
};
|
package/src/logo/index.ts
CHANGED
package/src/main.css
CHANGED
|
@@ -30117,6 +30117,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
30117
30117
|
text-align: start;
|
|
30118
30118
|
}
|
|
30119
30119
|
|
|
30120
|
+
.np-button-input .np-select-input-option-content-icon {
|
|
30121
|
+
padding-right: 1px;
|
|
30122
|
+
padding-left: 1px;
|
|
30123
|
+
}
|
|
30124
|
+
|
|
30120
30125
|
.np-button-input:has(.np-select-input-option-description-in-trigger) {
|
|
30121
30126
|
height: auto !important;
|
|
30122
30127
|
align-content: start;
|
|
@@ -30902,6 +30907,11 @@ button.np-link {
|
|
|
30902
30907
|
font-weight: var(--font-weight-semi-bold);
|
|
30903
30908
|
}
|
|
30904
30909
|
|
|
30910
|
+
.tw-money-input .money-input-currency-flag {
|
|
30911
|
+
display: flex;
|
|
30912
|
+
align-items: center;
|
|
30913
|
+
}
|
|
30914
|
+
|
|
30905
30915
|
.tw-money-input.input-group-sm .form-control {
|
|
30906
30916
|
min-height: 34px;
|
|
30907
30917
|
}
|
|
@@ -31952,7 +31962,13 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31952
31962
|
}
|
|
31953
31963
|
|
|
31954
31964
|
@media (max-width: 599.98px) {
|
|
31955
|
-
.wds-action-prompt
|
|
31965
|
+
.wds-action-prompt .wds-action-prompt__action {
|
|
31966
|
+
width: 100%;
|
|
31967
|
+
}
|
|
31968
|
+
}
|
|
31969
|
+
|
|
31970
|
+
@media (max-width: 599.98px) {
|
|
31971
|
+
.wds-action-prompt--with-two-actions .wds-action-prompt__action {
|
|
31956
31972
|
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
31957
31973
|
min-width: -moz-fit-content;
|
|
31958
31974
|
min-width: fit-content;
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.money-input-currency-flag {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
&.input-group-sm {
|
|
16
21
|
.form-control {
|
|
17
22
|
min-height: 34px;
|
|
@@ -32,7 +37,7 @@
|
|
|
32
37
|
|
|
33
38
|
.input-group-addon {
|
|
34
39
|
flex-shrink: 0;
|
|
35
|
-
|
|
40
|
+
|
|
36
41
|
&:not(.amount-currency-select-btn) {
|
|
37
42
|
display: flex;
|
|
38
43
|
align-items: center;
|
|
@@ -44,7 +49,7 @@
|
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
|
-
|
|
52
|
+
|
|
48
53
|
.amount-currency-select-btn {
|
|
49
54
|
flex-shrink: 0;
|
|
50
55
|
width: auto;
|
|
@@ -55,20 +60,20 @@
|
|
|
55
60
|
border-top-right-radius: var(--radius-small) !important;
|
|
56
61
|
border-bottom-right-radius: var(--radius-small) !important;
|
|
57
62
|
|
|
58
|
-
&:not(.disabled
|
|
63
|
+
&:not(.disabled, :disabled):focus-visible {
|
|
59
64
|
border-radius: var(--radius-small) !important;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
&,
|
|
63
68
|
&:active,
|
|
64
|
-
&:not(.disabled
|
|
69
|
+
&:not(.disabled, :disabled):hover,
|
|
65
70
|
.has-error &,
|
|
66
|
-
.has-error &:not(.disabled
|
|
71
|
+
.has-error &:not(.disabled, :disabled):hover {
|
|
67
72
|
box-shadow: none;
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
&:not(.disabled
|
|
76
|
+
&:not(.disabled, :disabled):not(.np-button-input:active):has(.np-button-input:focus-visible) {
|
|
72
77
|
box-shadow: inset 0 0 0 1px var(--color-interactive-secondary) !important;
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
object-fit: contain;
|
|
14
14
|
}
|
|
15
15
|
@media (max-width: 599.98px) {
|
|
16
|
-
.wds-action-prompt
|
|
16
|
+
.wds-action-prompt .wds-action-prompt__action {
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@media (max-width: 599.98px) {
|
|
21
|
+
.wds-action-prompt--with-two-actions .wds-action-prompt__action {
|
|
17
22
|
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
18
23
|
min-width: -moz-fit-content;
|
|
19
24
|
min-width: fit-content;
|
|
@@ -10,13 +10,17 @@
|
|
|
10
10
|
object-fit: contain;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
@media (--screen-xs-max) {
|
|
14
|
+
.wds-action-prompt__action {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
&--with-two-actions {
|
|
14
20
|
@media (--screen-xs-max) {
|
|
15
|
-
.wds-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
min-width: fit-content;
|
|
19
|
-
}
|
|
21
|
+
.wds-action-prompt__action {
|
|
22
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
23
|
+
min-width: fit-content;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { userEvent } from '@testing-library/user-event';
|
|
2
|
-
import { Breakpoint } from '@transferwise/neptune-tokens';
|
|
3
2
|
import { mockMatchMedia, render, screen } from '../../test-utils';
|
|
4
3
|
import { ActionPrompt, ActionPromptProps } from './ActionPrompt';
|
|
5
4
|
|
|
@@ -221,62 +220,4 @@ describe('ActionPrompt', () => {
|
|
|
221
220
|
expect(screen.getByTestId('prompt')).not.toHaveClass('wds-action-prompt--with-two-actions');
|
|
222
221
|
});
|
|
223
222
|
});
|
|
224
|
-
|
|
225
|
-
describe('Responsive behavior', () => {
|
|
226
|
-
it('renders buttons as block on mobile', () => {
|
|
227
|
-
const mockMatchMediaFn = window.matchMedia as jest.Mock;
|
|
228
|
-
mockMatchMediaFn.mockImplementation((query: string) => ({
|
|
229
|
-
matches: query !== `(min-width: ${Breakpoint.SMALL}px)`,
|
|
230
|
-
media: query,
|
|
231
|
-
onchange: null,
|
|
232
|
-
addListener: jest.fn(),
|
|
233
|
-
removeListener: jest.fn(),
|
|
234
|
-
addEventListener: jest.fn(),
|
|
235
|
-
removeEventListener: jest.fn(),
|
|
236
|
-
dispatchEvent: jest.fn(),
|
|
237
|
-
}));
|
|
238
|
-
|
|
239
|
-
render(
|
|
240
|
-
<ActionPrompt
|
|
241
|
-
{...defaultProps}
|
|
242
|
-
actionSecondary={{ label: 'Secondary', onClick: jest.fn() }}
|
|
243
|
-
/>,
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
expect(screen.getByRole('button', { name: 'Primary Action' })).toHaveClass(
|
|
247
|
-
'wds-Button--block',
|
|
248
|
-
);
|
|
249
|
-
expect(screen.getByRole('button', { name: 'Secondary' })).toHaveClass(
|
|
250
|
-
'wds-Button--block'
|
|
251
|
-
);
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
it('renders buttons as inline on desktop', () => {
|
|
255
|
-
const mockMatchMediaFn = window.matchMedia as jest.Mock;
|
|
256
|
-
mockMatchMediaFn.mockImplementation((query: string) => ({
|
|
257
|
-
matches: query === `(min-width: ${Breakpoint.SMALL}px)`,
|
|
258
|
-
media: query,
|
|
259
|
-
onchange: null,
|
|
260
|
-
addListener: jest.fn(),
|
|
261
|
-
removeListener: jest.fn(),
|
|
262
|
-
addEventListener: jest.fn(),
|
|
263
|
-
removeEventListener: jest.fn(),
|
|
264
|
-
dispatchEvent: jest.fn(),
|
|
265
|
-
}));
|
|
266
|
-
|
|
267
|
-
render(
|
|
268
|
-
<ActionPrompt
|
|
269
|
-
{...defaultProps}
|
|
270
|
-
actionSecondary={{ label: 'Secondary', onClick: jest.fn() }}
|
|
271
|
-
/>,
|
|
272
|
-
);
|
|
273
|
-
|
|
274
|
-
expect(screen.getByRole('button', { name: 'Primary Action' })).not.toHaveClass(
|
|
275
|
-
'wds-Button--block',
|
|
276
|
-
);
|
|
277
|
-
expect(screen.getByRole('button', { name: 'Secondary' })).not.toHaveClass(
|
|
278
|
-
'wds-Button--block',
|
|
279
|
-
);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
223
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AriaAttributes, ReactNode, useId } from 'react';
|
|
2
|
-
import { Breakpoint } from '@transferwise/neptune-tokens';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
|
|
5
4
|
import Body from '../../body';
|
|
@@ -7,7 +6,6 @@ import Button from '../../button';
|
|
|
7
6
|
import { Typography } from '../../common';
|
|
8
7
|
import { ButtonProps } from '../../button/Button.types';
|
|
9
8
|
import { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';
|
|
10
|
-
import { useScreenSize } from '../../common/hooks/useScreenSize';
|
|
11
9
|
import { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';
|
|
12
10
|
|
|
13
11
|
export type ActionPromptProps = {
|
|
@@ -50,8 +48,6 @@ export const ActionPrompt = ({
|
|
|
50
48
|
'data-testid': testId,
|
|
51
49
|
'aria-label': ariaLabel,
|
|
52
50
|
}: ActionPromptProps) => {
|
|
53
|
-
const isMobile = !useScreenSize(Breakpoint.SMALL);
|
|
54
|
-
|
|
55
51
|
const mediaId = useId();
|
|
56
52
|
const titleId = useId();
|
|
57
53
|
const descId = useId();
|
|
@@ -87,11 +83,11 @@ export const ActionPrompt = ({
|
|
|
87
83
|
{actionSecondary && (
|
|
88
84
|
// @ts-expect-error onClick type mismatch
|
|
89
85
|
<Button
|
|
86
|
+
className="wds-action-prompt__action"
|
|
90
87
|
v2
|
|
91
88
|
size="md"
|
|
92
89
|
priority="secondary"
|
|
93
90
|
href={actionSecondary.href}
|
|
94
|
-
block={isMobile}
|
|
95
91
|
onClick={actionSecondary?.onClick}
|
|
96
92
|
>
|
|
97
93
|
{actionSecondary.label}
|
|
@@ -99,11 +95,11 @@ export const ActionPrompt = ({
|
|
|
99
95
|
)}
|
|
100
96
|
{/* @ts-expect-error onClick type mismatch */}
|
|
101
97
|
<Button
|
|
98
|
+
className="wds-action-prompt__action"
|
|
102
99
|
v2
|
|
103
100
|
size="md"
|
|
104
101
|
priority="primary"
|
|
105
102
|
href={action.href}
|
|
106
|
-
block={isMobile}
|
|
107
103
|
onClick={action.onClick}
|
|
108
104
|
>
|
|
109
105
|
{action.label}
|