@transferwise/components 46.97.5 → 46.98.1
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/alert/Alert.js +8 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +8 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js +3 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +3 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/dateInput/DateInput.js +4 -4
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +4 -4
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +4 -4
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +4 -4
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
- package/build/i18n/cs.json +3 -2
- package/build/i18n/cs.json.js +3 -2
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +3 -2
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +3 -2
- package/build/i18n/de.json.js +3 -2
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +3 -2
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/en.json +3 -2
- package/build/i18n/en.json.js +3 -2
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +3 -2
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +3 -2
- package/build/i18n/es.json.js +3 -2
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +3 -2
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +3 -2
- package/build/i18n/fr.json.js +3 -2
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +3 -2
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +3 -2
- package/build/i18n/hu.json.js +3 -2
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +3 -2
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +3 -2
- package/build/i18n/id.json.js +3 -2
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +3 -2
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +3 -2
- package/build/i18n/it.json.js +3 -2
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +3 -2
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +3 -2
- package/build/i18n/ja.json.js +3 -2
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +3 -2
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +6 -5
- package/build/i18n/pl.json +3 -2
- package/build/i18n/pl.json.js +3 -2
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +3 -2
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +3 -2
- package/build/i18n/pt.json.js +3 -2
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +3 -2
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +3 -2
- package/build/i18n/ro.json.js +3 -2
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +3 -2
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +3 -2
- package/build/i18n/ru.json.js +3 -2
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +3 -2
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +3 -2
- package/build/i18n/th.json.js +3 -2
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +3 -2
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +3 -2
- package/build/i18n/tr.json.js +3 -2
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +3 -2
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +3 -2
- package/build/i18n/zh-CN.json.js +3 -2
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +3 -2
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +3 -2
- package/build/i18n/zh-HK.json.js +3 -2
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +3 -2
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/image/Image.js +9 -10
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +11 -11
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +16 -45
- package/build/moneyInput/MoneyInput.js +4 -8
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +3 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +4 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/snackbar/Snackbar.js +1 -1
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/Snackbar.mjs +1 -1
- package/build/snackbar/Snackbar.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -0
- package/build/styles/dateInput/DateInput.css +13 -0
- package/build/styles/main.css +16 -45
- package/build/styles/uploadInput/uploadItem/UploadItem.css +2 -1
- package/build/tabs/Tabs.js +3 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +3 -3
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/test-utils/assets/apple-pay-logo.svg +84 -0
- package/build/typeahead/Typeahead.js +2 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +2 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +2 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +5 -0
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts +8 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts.map +1 -1
- package/build/types/test-utils/fake-data.d.ts +2 -0
- package/build/types/test-utils/fake-data.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +6 -4
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +1 -2
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts +1 -3
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/upload/Upload.js +29 -45
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +29 -45
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -3
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -3
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +54 -6
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +54 -6
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +12 -6
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +12 -6
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +14 -17
- package/src/alert/Alert.spec.tsx +11 -0
- package/src/alert/Alert.story.tsx +23 -9
- package/src/alert/Alert.tsx +14 -1
- package/src/circularButton/CircularButton.css +1 -0
- package/src/circularButton/CircularButton.less +1 -0
- package/src/circularButton/CircularButton.tests.story.tsx +23 -0
- package/src/common/closeButton/CloseButton.spec.tsx +13 -1
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/dateInput/DateInput.css +13 -0
- package/src/dateInput/DateInput.less +20 -0
- package/src/dateInput/DateInput.tests.story.tsx +14 -3
- package/src/dateInput/DateInput.tsx +4 -4
- package/src/i18n/cs.json +3 -2
- package/src/i18n/de.json +3 -2
- package/src/i18n/en.json +3 -2
- package/src/i18n/es.json +3 -2
- package/src/i18n/fr.json +3 -2
- package/src/i18n/hu.json +3 -2
- package/src/i18n/id.json +3 -2
- package/src/i18n/it.json +3 -2
- package/src/i18n/ja.json +3 -2
- package/src/i18n/nl.json +6 -5
- package/src/i18n/pl.json +3 -2
- package/src/i18n/pt.json +3 -2
- package/src/i18n/ro.json +3 -2
- package/src/i18n/ru.json +3 -2
- package/src/i18n/th.json +3 -2
- package/src/i18n/tr.json +3 -2
- package/src/i18n/zh-CN.json +3 -2
- package/src/i18n/zh-HK.json +3 -2
- package/src/image/Image.spec.tsx +3 -3
- package/src/image/Image.tsx +10 -12
- package/src/index.ts +0 -2
- package/src/legacylistItem/LegacyListItem.story.tsx +5 -5
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +6 -6
- package/src/main.css +16 -45
- package/src/main.less +0 -1
- package/src/moneyInput/MoneyInput.messages.ts +5 -0
- package/src/moneyInput/MoneyInput.spec.tsx +42 -5
- package/src/moneyInput/MoneyInput.story.tsx +11 -2
- package/src/moneyInput/MoneyInput.tsx +5 -7
- package/src/phoneNumberInput/PhoneNumberInput.messages.ts +8 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +77 -43
- package/src/phoneNumberInput/PhoneNumberInput.tsx +34 -2
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +1 -0
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +2 -0
- package/src/ssr.spec.tsx +0 -1
- package/src/test-utils/assets/apple-pay-logo.svg +84 -0
- package/src/test-utils/fake-data.ts +5 -0
- package/src/test-utils/jest.setup.ts +0 -4
- package/src/typeahead/Typeahead.spec.tsx +182 -0
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.tsx +103 -0
- package/src/typeahead/util/highlight.spec.tsx +43 -0
- package/src/upload/Upload.spec.tsx +63 -0
- package/src/upload/Upload.story.tsx +0 -51
- package/src/upload/Upload.tests.story.tsx +93 -0
- package/src/upload/Upload.tsx +28 -49
- package/src/upload/steps/processingStep/processingStep.tsx +2 -7
- package/src/uploadInput/UploadInput.tsx +74 -10
- package/src/uploadInput/uploadItem/UploadItem.css +2 -1
- package/src/uploadInput/uploadItem/UploadItem.less +1 -1
- package/src/uploadInput/uploadItem/UploadItem.tsx +11 -6
- package/src/withDisplayFormat/WithDisplayFormat.spec.js +11 -15
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -2
- package/build/selectOption/SelectOption.js +0 -131
- package/build/selectOption/SelectOption.js.map +0 -1
- package/build/selectOption/SelectOption.messages.js +0 -17
- package/build/selectOption/SelectOption.messages.js.map +0 -1
- package/build/selectOption/SelectOption.messages.mjs +0 -13
- package/build/selectOption/SelectOption.messages.mjs.map +0 -1
- package/build/selectOption/SelectOption.mjs +0 -127
- package/build/selectOption/SelectOption.mjs.map +0 -1
- package/build/styles/selectOption/SelectOption.css +0 -44
- package/build/types/selectOption/SelectOption.d.ts +0 -21
- package/build/types/selectOption/SelectOption.d.ts.map +0 -1
- package/build/types/selectOption/SelectOption.messages.d.ts +0 -12
- package/build/types/selectOption/SelectOption.messages.d.ts.map +0 -1
- package/build/types/selectOption/index.d.ts +0 -3
- package/build/types/selectOption/index.d.ts.map +0 -1
- package/src/selectOption/SelectOption.css +0 -44
- package/src/selectOption/SelectOption.less +0 -40
- package/src/selectOption/SelectOption.messages.ts +0 -12
- package/src/selectOption/SelectOption.spec.tsx +0 -83
- package/src/selectOption/SelectOption.story.tsx +0 -277
- package/src/selectOption/SelectOption.tsx +0 -151
- package/src/selectOption/index.ts +0 -2
- package/src/typeahead/Typeahead.rtl.spec.tsx +0 -54
- package/src/typeahead/Typeahead.spec.js +0 -404
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +0 -74
- package/src/typeahead/typeaheadOption/TypeaheadOption.spec.js +0 -75
- package/src/typeahead/util/highlight.spec.js +0 -34
package/src/i18n/ja.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(任意)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(新しいタブで開きます)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "選択してください...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "通貨または国をご入力ください",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "通貨を選択してください",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "選択してください…",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "国コード",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "電話番号",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "検索する... ",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
28
|
-
"neptune.SelectOption.action.label": "選択してください",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "選択したオプションを変更する",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "エラー:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "情報:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "保留中:",
|
package/src/i18n/nl.json
CHANGED
|
@@ -21,19 +21,20 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Optioneel)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(wordt geopend in een nieuw tabblad)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Selecteer een optie...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Typ een valuta of land",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecteer valuta",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecteer een optie...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Landcode",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefoonnummer",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Zoeken...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Geen resultaten gevonden",
|
|
28
|
-
"neptune.SelectOption.action.label": "Kiezen",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Gekozen optie wijzigen",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Fout:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Informatie:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "In behandeling:",
|
|
33
34
|
"neptune.StatusIcon.iconLabel.success": "Gelukt:",
|
|
34
35
|
"neptune.StatusIcon.iconLabel.warning": "Waarschuwing:",
|
|
35
36
|
"neptune.Summary.statusDone": "Item klaar",
|
|
36
|
-
"neptune.Summary.statusNotDone": "
|
|
37
|
+
"neptune.Summary.statusNotDone": "Te doen-item",
|
|
37
38
|
"neptune.Summary.statusPending": "Item in behandeling",
|
|
38
39
|
"neptune.Table.actionHeader": "Actie",
|
|
39
40
|
"neptune.Table.emptyData": "Geen resultaten gevonden",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
|
|
45
46
|
"neptune.Upload.csSuccessText": "Uploaden voltooid!",
|
|
46
47
|
"neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
|
|
47
|
-
"neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand
|
|
48
|
+
"neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
|
|
48
49
|
"neptune.Upload.psButtonText": "Annuleren",
|
|
49
50
|
"neptune.Upload.psProcessingText": "Uploaden...",
|
|
50
51
|
"neptune.Upload.retry": "Opnieuw proberen",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"neptune.UploadButton.maximumFiles": "Maximaal {maxFiles} bestanden.",
|
|
58
59
|
"neptune.UploadButton.uploadFile": "Bestand uploaden",
|
|
59
60
|
"neptune.UploadButton.uploadFiles": "Bestanden uploaden",
|
|
60
|
-
"neptune.UploadInput.deleteModalBody": "
|
|
61
|
+
"neptune.UploadInput.deleteModalBody": "Als je dit bestand verwijdert, wordt het van ons systeem gewist.",
|
|
61
62
|
"neptune.UploadInput.deleteModalCancelButtonText": "Annuleren",
|
|
62
63
|
"neptune.UploadInput.deleteModalConfirmButtonText": "Verwijderen",
|
|
63
64
|
"neptune.UploadInput.deleteModalTitle": "Weet je zeker dat je dit bestand wilt verwijderen?",
|
package/src/i18n/pl.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(opcjonalne)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(otworzy się w nowej zakładce)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Wybierz opcję...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Wpisz walutę lub kraj",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Wybierz walutę",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wybierz opcję...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Numer kierunkowy",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Numer telefonu",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
28
|
-
"neptune.SelectOption.action.label": "Wybierz",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Zmień wybraną opcję",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Błąd:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Informacje:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "W toku:",
|
package/src/i18n/pt.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
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.searchPlaceholder": "Digite uma moeda ou país",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selecione a moeda",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Escolha uma opção...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Código do país",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de telefone",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
28
|
-
"neptune.SelectOption.action.label": "Selecionar",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Altere a opção escolhida",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Erro:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Informação:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "Pendente:",
|
package/src/i18n/ro.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
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.searchPlaceholder": "Tastează o monedă sau țară",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selectează moneda",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Codul țării",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Număr de telefon",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
28
|
-
"neptune.SelectOption.action.label": "Alege",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Schimbă opțiunea aleasă",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Eroare:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Informații:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "În așteptare:",
|
package/src/i18n/ru.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(необязательно)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Введите валюту или страну",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Выберите валюту",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Код страны",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Номер телефона",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
28
|
-
"neptune.SelectOption.action.label": "Выбрать",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Изменить выбранный вариант",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Ошибка:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Информация:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "В ожидании:",
|
package/src/i18n/th.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(ไม่บังคับ)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(เปิดในแท็บใหม่)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "ป้อนสกุลเงินหรือประเทศ",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "เลือกสกุลเงิน",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
28
|
-
"neptune.SelectOption.action.label": "เลือก",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "เปลี่ยนตัวเลือกที่เลือกไว้",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "ข้อมูล:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "รอดำเนินการ:",
|
package/src/i18n/tr.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
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.searchPlaceholder": "Bir para birimi veya ülke girin",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Para birimi seçin",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Bir seçenek seçin...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "Ülke kodu",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefon numarası",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
28
|
-
"neptune.SelectOption.action.label": "Seç",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "Seçilen opsiyonu değiştir",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Hata:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Bilgi:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "Bekliyor:",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(可选)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "输入货币或国家/地区",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "选择货币",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "国家/地区代码",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "电话号码",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
28
|
-
"neptune.SelectOption.action.label": "选择",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "更改所选选项",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "错误:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "信息:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "待处理:",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"neptune.Label.optional": "(可選)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "輸入貨幣或國家/地區",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "選擇貨幣",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
27
|
+
"neptune.PhoneNumberInput.countryCodeLabel": "國家/地區代碼",
|
|
28
|
+
"neptune.PhoneNumberInput.phoneNumberLabel": "電話號碼",
|
|
26
29
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
27
30
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
28
|
-
"neptune.SelectOption.action.label": "選擇",
|
|
29
|
-
"neptune.SelectOption.selected.action.label": "更改已選選項",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "錯誤:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "資訊:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "處理中:",
|
package/src/image/Image.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as useHasIntersectedUtils from '../common/hooks/useHasIntersected/useHasIntersected';
|
|
2
2
|
import { render, fireEvent, screen } from '../test-utils';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ImageProps } from './Image';
|
|
5
5
|
|
|
6
6
|
import Image from '.';
|
|
7
7
|
|
|
@@ -32,14 +32,14 @@ describe('Image', () => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
describe('when lazy loading is enabled', () => {
|
|
35
|
-
it('renders the image with
|
|
35
|
+
it('renders the image with actual src even if element is not visible', () => {
|
|
36
36
|
jest.spyOn(useHasIntersectedUtils, 'useHasIntersected').mockReturnValue([false]);
|
|
37
37
|
render(<Image {...props} />);
|
|
38
38
|
|
|
39
39
|
const image: HTMLImageElement = screen.getByRole('img');
|
|
40
40
|
|
|
41
41
|
expect(image).toBeInTheDocument();
|
|
42
|
-
expect(image.src).toStrictEqual(
|
|
42
|
+
expect(image.src).toStrictEqual(props.src);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
it('renders the image with src if element is visible', () => {
|
package/src/image/Image.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import { useRef } from 'react';
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useHasIntersected } from '../common/hooks';
|
|
5
5
|
|
|
@@ -16,9 +16,6 @@ export interface ImageProps {
|
|
|
16
16
|
shrink?: boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const EmptyTransparentImage =
|
|
20
|
-
'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
|
21
|
-
|
|
22
19
|
const Image = ({
|
|
23
20
|
id,
|
|
24
21
|
src,
|
|
@@ -33,20 +30,21 @@ const Image = ({
|
|
|
33
30
|
}: ImageProps) => {
|
|
34
31
|
const elementReference = useRef<HTMLImageElement>(null);
|
|
35
32
|
const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });
|
|
36
|
-
let imageSource = src;
|
|
37
|
-
let imageOnLoad = onLoad;
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
// Internal onLoad handler that calls user onLoad only if hasIntersected is true
|
|
35
|
+
const handleLoad = useCallback(() => {
|
|
36
|
+
if (hasIntersected && onLoad) {
|
|
37
|
+
onLoad();
|
|
38
|
+
}
|
|
39
|
+
}, [hasIntersected, onLoad]);
|
|
43
40
|
|
|
44
41
|
return (
|
|
45
42
|
<img
|
|
46
43
|
ref={elementReference}
|
|
47
44
|
id={id}
|
|
48
45
|
alt={alt}
|
|
49
|
-
src={
|
|
46
|
+
src={src}
|
|
47
|
+
loading={loading}
|
|
50
48
|
className={clsx([
|
|
51
49
|
'tw-image',
|
|
52
50
|
{
|
|
@@ -56,7 +54,7 @@ const Image = ({
|
|
|
56
54
|
className,
|
|
57
55
|
])}
|
|
58
56
|
role={role}
|
|
59
|
-
onLoad={
|
|
57
|
+
onLoad={handleLoad}
|
|
60
58
|
onError={onError}
|
|
61
59
|
/>
|
|
62
60
|
);
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type { AccordionItem, AccordionProps } from './accordion';
|
|
7
7
|
export type { ActionOptionProps } from './actionOption';
|
|
8
|
-
export type { SelectOptionProps, SelectOptionValue, SelectOptiopsSection } from './selectOption';
|
|
9
8
|
export type { AlertAction, AlertProps, AlertType } from './alert';
|
|
10
9
|
export type { AvatarProps } from './avatar';
|
|
11
10
|
export type { AvatarViewProps } from './avatarView';
|
|
@@ -116,7 +115,6 @@ export type {
|
|
|
116
115
|
export { default as Accordion } from './accordion';
|
|
117
116
|
export { default as ActionButton } from './actionButton';
|
|
118
117
|
export { default as ActionOption } from './actionOption';
|
|
119
|
-
export { default as SelectOption } from './selectOption';
|
|
120
118
|
export { default as Alert } from './alert';
|
|
121
119
|
export { default as Avatar } from './avatar';
|
|
122
120
|
export { default as AvatarView } from './avatarView';
|
|
@@ -6,11 +6,11 @@ import { Button, IconButton } from '..';
|
|
|
6
6
|
import AvatarView from '../avatarView';
|
|
7
7
|
import Info from '../info';
|
|
8
8
|
import Title from '../title/Title';
|
|
9
|
-
import
|
|
9
|
+
import LegacyListItem, { List } from '.';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
component:
|
|
13
|
-
title: 'Other/
|
|
12
|
+
component: LegacyListItem,
|
|
13
|
+
title: 'Other/LegacyListItem',
|
|
14
14
|
tags: ['autodocs'],
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -18,8 +18,8 @@ const Template = ({
|
|
|
18
18
|
title = 'Wise',
|
|
19
19
|
value = 'We’re building the world’s most international account',
|
|
20
20
|
...props
|
|
21
|
-
}: Partial<ComponentProps<typeof
|
|
22
|
-
return <
|
|
21
|
+
}: Partial<ComponentProps<typeof LegacyListItem>>) => {
|
|
22
|
+
return <LegacyListItem title={title} value={value} {...props} />;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const Basic = () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FastFlag } from '@transferwise/icons';
|
|
2
2
|
import Button from '../button';
|
|
3
3
|
import AvatarView from '../avatarView';
|
|
4
|
-
import
|
|
4
|
+
import LegacyListItem, { List, type LegacyListItemProps } from '.';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
component:
|
|
8
|
-
title: 'Other/
|
|
7
|
+
component: LegacyListItem,
|
|
8
|
+
title: 'Other/LegacyListItem/tests',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const LongText = () => {
|
|
@@ -21,13 +21,13 @@ export const LongText = () => {
|
|
|
21
21
|
return (
|
|
22
22
|
<div style={{ width: '35rem' }}>
|
|
23
23
|
<List>
|
|
24
|
-
<
|
|
24
|
+
<LegacyListItem
|
|
25
25
|
{...sharedProps}
|
|
26
26
|
title="Default behaviour"
|
|
27
27
|
value="This is a test of a long word dontbreakme dontbreakme dontbreakme breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme word."
|
|
28
28
|
/>
|
|
29
29
|
|
|
30
|
-
<
|
|
30
|
+
<LegacyListItem
|
|
31
31
|
{...sharedProps}
|
|
32
32
|
title="Wrapping the long word with a 'span.text-word-break'"
|
|
33
33
|
value={
|
|
@@ -41,7 +41,7 @@ export const LongText = () => {
|
|
|
41
41
|
}
|
|
42
42
|
/>
|
|
43
43
|
|
|
44
|
-
<
|
|
44
|
+
<LegacyListItem
|
|
45
45
|
{...sharedProps}
|
|
46
46
|
title="Using '&shy;' HTML entitty"
|
|
47
47
|
value="This is a test of a a very long word dontbreakme dontbreakme dontbreakme break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­me word."
|
package/src/main.css
CHANGED
|
@@ -1402,6 +1402,7 @@
|
|
|
1402
1402
|
}
|
|
1403
1403
|
.np-circular-btn-primary-default .np-circular-btn-label,
|
|
1404
1404
|
.np-circular-btn-secondary-default .np-circular-btn-label {
|
|
1405
|
+
text-align: center;
|
|
1405
1406
|
color: var(--color-interactive-primary);
|
|
1406
1407
|
}
|
|
1407
1408
|
.np-circular-btn-primary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover,
|
|
@@ -1788,50 +1789,6 @@ button.np-option {
|
|
|
1788
1789
|
margin-top: -3px;
|
|
1789
1790
|
}
|
|
1790
1791
|
}
|
|
1791
|
-
.np-select-option {
|
|
1792
|
-
border-radius: 10px;
|
|
1793
|
-
border-radius: var(--radius-small);
|
|
1794
|
-
padding: 16px;
|
|
1795
|
-
padding: var(--size-16);
|
|
1796
|
-
}
|
|
1797
|
-
.np-select-option-placeholder {
|
|
1798
|
-
background-color: rgba(134,167,189,0.10196);
|
|
1799
|
-
background-color: var(--color-background-neutral);
|
|
1800
|
-
}
|
|
1801
|
-
.np-select-option-placeholder:not(.disabled):hover {
|
|
1802
|
-
background-color: var(--color-background-neutral-hover);
|
|
1803
|
-
}
|
|
1804
|
-
.np-select-option-placeholder:not(.disabled):focus,
|
|
1805
|
-
.np-select-option-placeholder:not(.disabled):active {
|
|
1806
|
-
background-color: var(--color-background-neutral-active);
|
|
1807
|
-
}
|
|
1808
|
-
.np-select-option-selected {
|
|
1809
|
-
border: 1px solid #c9cbce;
|
|
1810
|
-
border: 1px solid var(--color-interactive-secondary);
|
|
1811
|
-
}
|
|
1812
|
-
.np-select-option-list {
|
|
1813
|
-
max-height: 350px;
|
|
1814
|
-
overflow-y: auto;
|
|
1815
|
-
}
|
|
1816
|
-
.np-select-option-list > .np-section {
|
|
1817
|
-
margin-top: 0;
|
|
1818
|
-
}
|
|
1819
|
-
.has-error * .np-select-option {
|
|
1820
|
-
--ring-outline-color: var(--color-sentiment-negative);
|
|
1821
|
-
--ring-outline-width: 3px;
|
|
1822
|
-
--ring-outline-offset: calc(-1 * var(--ring-outline-width));
|
|
1823
|
-
outline: var(--ring-outline-color) solid 3px;
|
|
1824
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
1825
|
-
outline-offset: calc(-1 * 3px);
|
|
1826
|
-
outline-offset: var(--ring-outline-offset);
|
|
1827
|
-
}
|
|
1828
|
-
.has-error * .np-select-option:focus {
|
|
1829
|
-
outline: none;
|
|
1830
|
-
}
|
|
1831
|
-
.has-error * .np-select-option:focus-visible {
|
|
1832
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
1833
|
-
outline-offset: var(--ring-outline-offset);
|
|
1834
|
-
}
|
|
1835
1792
|
.np-panel__content {
|
|
1836
1793
|
opacity: 0;
|
|
1837
1794
|
visibility: hidden;
|
|
@@ -1912,6 +1869,19 @@ button.np-option {
|
|
|
1912
1869
|
.tw-date label {
|
|
1913
1870
|
width: 100%;
|
|
1914
1871
|
}
|
|
1872
|
+
.tw-date .tw-date--year label {
|
|
1873
|
+
margin-bottom: 0;
|
|
1874
|
+
}
|
|
1875
|
+
.tw-date .tw-date--year,
|
|
1876
|
+
.tw-date .tw-date--month,
|
|
1877
|
+
.tw-date .tw-date--day {
|
|
1878
|
+
margin-bottom: 0;
|
|
1879
|
+
}
|
|
1880
|
+
@media (min-width: 576px) {
|
|
1881
|
+
.np-theme-personal .tw-date label {
|
|
1882
|
+
margin-bottom: 0;
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1915
1885
|
.tw-date-lookup-menu {
|
|
1916
1886
|
width: 400px;
|
|
1917
1887
|
}
|
|
@@ -6243,7 +6213,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
6243
6213
|
padding-left: var(--size-16);
|
|
6244
6214
|
}
|
|
6245
6215
|
.np-upload-input__item .np-upload-input-errors > li::before {
|
|
6246
|
-
content: '•';
|
|
6216
|
+
content: '•' ;
|
|
6217
|
+
content: '•' / '';
|
|
6247
6218
|
position: absolute;
|
|
6248
6219
|
display: block;
|
|
6249
6220
|
left: 0;
|
package/src/main.less
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
@import "./common/card/Card.less";
|
|
21
21
|
@import "./common/closeButton/CloseButton.less";
|
|
22
22
|
@import "./common/Option/Option.less";
|
|
23
|
-
@import "./selectOption/SelectOption.less";
|
|
24
23
|
@import "./common/panel/Panel.less";
|
|
25
24
|
@import "./common/RadioButton/RadioButton.less";
|
|
26
25
|
@import "./dateInput/DateInput.less";
|
|
@@ -5,6 +5,11 @@ export default defineMessages({
|
|
|
5
5
|
id: 'neptune.MoneyInput.Select.placeholder',
|
|
6
6
|
defaultMessage: 'Select an option...',
|
|
7
7
|
},
|
|
8
|
+
searchPlaceholder: {
|
|
9
|
+
id: 'neptune.MoneyInput.Select.searchPlaceholder',
|
|
10
|
+
defaultMessage: 'Type a currency or country',
|
|
11
|
+
description: 'Default placeholder text for the search input in the currency selector.',
|
|
12
|
+
},
|
|
8
13
|
selectCurrencyLabel: {
|
|
9
14
|
id: 'neptune.MoneyInput.Select.selectCurrencyLabel',
|
|
10
15
|
defaultMessage: 'Select currency',
|
|
@@ -316,11 +316,21 @@ describe('Money Input', () => {
|
|
|
316
316
|
});
|
|
317
317
|
});
|
|
318
318
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
describe('search placeholder', () => {
|
|
320
|
+
it('uses default value', async () => {
|
|
321
|
+
customRender();
|
|
322
|
+
await openDropdown();
|
|
323
|
+
expect(
|
|
324
|
+
screen.getByRole('combobox', { name: messages.searchPlaceholder.defaultMessage }),
|
|
325
|
+
).toBeInTheDocument();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('allows for custom values', async () => {
|
|
329
|
+
const searchPlaceholder = 'custom placeholder';
|
|
330
|
+
customRender({ searchPlaceholder });
|
|
331
|
+
await openDropdown();
|
|
332
|
+
expect(screen.getByRole('combobox', { name: searchPlaceholder })).toBeInTheDocument();
|
|
333
|
+
});
|
|
324
334
|
});
|
|
325
335
|
|
|
326
336
|
it('calls onSearchChange', async () => {
|
|
@@ -465,4 +475,31 @@ describe('Money Input', () => {
|
|
|
465
475
|
expect(triggerLabel).toBeTruthy();
|
|
466
476
|
expect(screen.getByRole('listbox', { name: triggerLabel ?? '' })).toBeInTheDocument();
|
|
467
477
|
});
|
|
478
|
+
|
|
479
|
+
it('renders custom action button in dropdown footer and calls onCustomAction', async () => {
|
|
480
|
+
const onCustomAction = jest.fn();
|
|
481
|
+
render(
|
|
482
|
+
<MoneyInput
|
|
483
|
+
currencies={[
|
|
484
|
+
{ value: 'USD', label: 'US Dollar', currency: 'usd' },
|
|
485
|
+
{ value: 'EUR', label: 'Euro', currency: 'eur' },
|
|
486
|
+
]}
|
|
487
|
+
selectedCurrency={{ value: 'USD', label: 'US Dollar', currency: 'usd' }}
|
|
488
|
+
amount={100}
|
|
489
|
+
customActionLabel="Go to Wishes"
|
|
490
|
+
onCurrencyChange={jest.fn()}
|
|
491
|
+
onAmountChange={jest.fn()}
|
|
492
|
+
onCustomAction={onCustomAction}
|
|
493
|
+
/>,
|
|
494
|
+
);
|
|
495
|
+
|
|
496
|
+
const trigger = screen.getByRole('combobox', { name: /select currency/i });
|
|
497
|
+
await userEvent.click(trigger);
|
|
498
|
+
|
|
499
|
+
const customActionBtn = await screen.findByRole('button', { name: /go to wishes/i });
|
|
500
|
+
expect(customActionBtn).toBeInTheDocument();
|
|
501
|
+
|
|
502
|
+
await userEvent.click(customActionBtn);
|
|
503
|
+
expect(onCustomAction).toHaveBeenCalled();
|
|
504
|
+
});
|
|
468
505
|
});
|
|
@@ -5,6 +5,7 @@ import { useState } from 'react';
|
|
|
5
5
|
|
|
6
6
|
import MoneyInput, { CurrencyOptionItem } from '.';
|
|
7
7
|
import { Field } from '../field/Field';
|
|
8
|
+
import translations from '../i18n/en.json';
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
component: MoneyInput,
|
|
@@ -27,9 +28,19 @@ export default {
|
|
|
27
28
|
args: {
|
|
28
29
|
amount: 1000,
|
|
29
30
|
id: 'moneyInput',
|
|
31
|
+
searchPlaceholder: '',
|
|
30
32
|
onAmountChange: () => {},
|
|
31
33
|
onCurrencyChange: () => {},
|
|
32
34
|
},
|
|
35
|
+
argTypes: {
|
|
36
|
+
searchPlaceholder: {
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: {
|
|
39
|
+
summary: `"${translations['neptune.MoneyInput.Select.searchPlaceholder']}"`,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
33
44
|
tags: ['autodocs'],
|
|
34
45
|
} satisfies Meta<typeof MoneyInput>;
|
|
35
46
|
|
|
@@ -128,7 +139,6 @@ export const MultipleCurrencies: Story = {
|
|
|
128
139
|
console.log('Custom action');
|
|
129
140
|
},
|
|
130
141
|
selectedCurrency: exampleCurrency.usd,
|
|
131
|
-
searchPlaceholder: 'Type a currency / country',
|
|
132
142
|
id: 'moneyInput',
|
|
133
143
|
},
|
|
134
144
|
};
|
|
@@ -143,7 +153,6 @@ export const BalanceCurrencies: Story = {
|
|
|
143
153
|
exampleBalanceCurrency.gbp,
|
|
144
154
|
],
|
|
145
155
|
selectedCurrency: exampleBalanceCurrency.eur,
|
|
146
|
-
searchPlaceholder: 'Type a currency / country',
|
|
147
156
|
},
|
|
148
157
|
};
|
|
149
158
|
|
|
@@ -262,11 +262,6 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
262
262
|
this.props.onCurrencyChange?.(value);
|
|
263
263
|
};
|
|
264
264
|
|
|
265
|
-
handleCustomAction = () => {
|
|
266
|
-
this.handleSearchChange('');
|
|
267
|
-
this.props.onCustomAction?.();
|
|
268
|
-
};
|
|
269
|
-
|
|
270
265
|
handleSearchChange = (searchQuery: string) => {
|
|
271
266
|
this.setState({ searchQuery });
|
|
272
267
|
this.props.onSearchChange?.({
|
|
@@ -413,7 +408,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
413
408
|
this.props.onCustomAction
|
|
414
409
|
? () => (
|
|
415
410
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
416
|
-
<div role="button" tabIndex={0} onClick={this.
|
|
411
|
+
<div role="button" tabIndex={0} onClick={this.props.onCustomAction}>
|
|
417
412
|
{this.props.customActionLabel}
|
|
418
413
|
</div>
|
|
419
414
|
)
|
|
@@ -421,7 +416,10 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
421
416
|
}
|
|
422
417
|
placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}
|
|
423
418
|
filterable
|
|
424
|
-
filterPlaceholder={
|
|
419
|
+
filterPlaceholder={
|
|
420
|
+
this.props.searchPlaceholder ||
|
|
421
|
+
this.props.intl.formatMessage(messages.searchPlaceholder)
|
|
422
|
+
}
|
|
425
423
|
disabled={disabled}
|
|
426
424
|
size={size}
|
|
427
425
|
onChange={this.handleSelectChange}
|
|
@@ -5,4 +5,12 @@ export default defineMessages({
|
|
|
5
5
|
id: 'neptune.PhoneNumberInput.SelectInput.placeholder',
|
|
6
6
|
defaultMessage: 'Select an option...',
|
|
7
7
|
},
|
|
8
|
+
countryCodeLabel: {
|
|
9
|
+
id: 'neptune.PhoneNumberInput.countryCodeLabel',
|
|
10
|
+
defaultMessage: 'Country code',
|
|
11
|
+
},
|
|
12
|
+
phoneNumberLabel: {
|
|
13
|
+
id: 'neptune.PhoneNumberInput.phoneNumberLabel',
|
|
14
|
+
defaultMessage: 'Phone number',
|
|
15
|
+
},
|
|
8
16
|
});
|