@transferwise/components 0.0.0-experimental-6a6c19f → 0.0.0-experimental-e72bc9f
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 +4 -3
- 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/image/Image.js +10 -9
- 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 +1 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -1
- package/build/main.css +188 -0
- package/build/styles/listItem/ListItem.css +188 -0
- package/build/styles/main.css +188 -0
- package/build/test-utils/assets/apple-pay-logo.svg +84 -0
- package/build/types/image/Image.d.ts +1 -0
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +43 -0
- package/build/types/listItem/ListItem.d.ts.map +1 -0
- package/build/types/listItem/ListItemAdditionalInfo.d.ts +9 -0
- package/build/types/listItem/ListItemAdditionalInfo.d.ts.map +1 -0
- package/build/types/listItem/ListItemButton.d.ts +4 -0
- package/build/types/listItem/ListItemButton.d.ts.map +1 -0
- package/build/types/listItem/ListItemCheckbox.d.ts +4 -0
- package/build/types/listItem/ListItemCheckbox.d.ts.map +1 -0
- package/build/types/listItem/ListItemIconButton.d.ts +7 -0
- package/build/types/listItem/ListItemIconButton.d.ts.map +1 -0
- package/build/types/listItem/ListItemMedia.d.ts +19 -0
- package/build/types/listItem/ListItemMedia.d.ts.map +1 -0
- package/build/types/listItem/ListItemNavigation.d.ts +4 -0
- package/build/types/listItem/ListItemNavigation.d.ts.map +1 -0
- package/build/types/listItem/ListItemSwitch.d.ts +3 -0
- package/build/types/listItem/ListItemSwitch.d.ts.map +1 -0
- package/build/types/listItem/index.d.ts +6 -0
- package/build/types/listItem/index.d.ts.map +1 -0
- package/build/types/listItem/prompt/Prompt.d.ts +12 -0
- package/build/types/listItem/prompt/Prompt.d.ts.map +1 -0
- package/build/types/listItem/useItemControl.d.ts +5 -0
- package/build/types/listItem/useItemControl.d.ts.map +1 -0
- package/build/types/test-utils/fake-data.d.ts +2 -0
- package/build/types/test-utils/fake-data.d.ts.map +1 -1
- package/package.json +3 -3
- 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 +4 -3
- 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/image/Image.spec.tsx +3 -3
- package/src/image/Image.tsx +12 -10
- package/src/index.ts +2 -0
- package/src/legacylistItem/LegacyListItem.story.tsx +5 -5
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +6 -6
- package/src/listItem/ListItem.css +188 -0
- package/src/listItem/ListItem.less +182 -0
- package/src/listItem/ListItem.story.tsx +273 -0
- package/src/listItem/ListItem.tsx +183 -0
- package/src/listItem/ListItemAdditionalInfo.tsx +31 -0
- package/src/listItem/ListItemButton.spec.tsx +90 -0
- package/src/listItem/ListItemButton.tsx +18 -0
- package/src/listItem/ListItemCheckbox.tsx +14 -0
- package/src/listItem/ListItemIconButton.tsx +13 -0
- package/src/listItem/ListItemMedia.tsx +52 -0
- package/src/listItem/ListItemNavigation.tsx +11 -0
- package/src/listItem/ListItemSwitch.tsx +8 -0
- package/src/listItem/index.ts +10 -0
- package/src/listItem/prompt/Prompt.spec.tsx +77 -0
- package/src/listItem/prompt/Prompt.story.tsx +170 -0
- package/src/listItem/prompt/Prompt.tsx +44 -0
- package/src/listItem/useItemControl.tsx +12 -0
- package/src/main.css +188 -0
- package/src/main.less +1 -0
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +0 -1
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +0 -2
- package/src/test-utils/assets/apple-pay-logo.svg +84 -0
- package/src/test-utils/fake-data.ts +5 -0
package/src/i18n/hu.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Válaszható)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Írj be egy pénznemet vagy országot",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Pénznem kiválasztása",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Országazonosító",
|
package/src/i18n/id.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Opsional)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(terbuka di tab baru)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Pilih opsi...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Ketik nama mata uang atau negara",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Pilih mata uang",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Pilih opsi...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Kode negara",
|
package/src/i18n/it.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"neptune.Label.optional": "(Facoltativo)",
|
|
22
22
|
"neptune.Link.opensInNewTab": "(si apre in una nuova scheda)",
|
|
23
23
|
"neptune.MoneyInput.Select.placeholder": "Seleziona un'opzione...",
|
|
24
|
+
"neptune.MoneyInput.Select.searchPlaceholder": "Inserisci una valuta o un paese",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Scegli la valuta",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Seleziona un'opzione...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Prefisso",
|
package/src/i18n/ja.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.searchPlaceholder": "通貨または国を入力してください",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "通貨を選択してください",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "選択してください…",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "国コード",
|
package/src/i18n/nl.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
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...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Landcode",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"neptune.StatusIcon.iconLabel.success": "Gelukt:",
|
|
36
37
|
"neptune.StatusIcon.iconLabel.warning": "Waarschuwing:",
|
|
37
38
|
"neptune.Summary.statusDone": "Item klaar",
|
|
38
|
-
"neptune.Summary.statusNotDone": "
|
|
39
|
+
"neptune.Summary.statusNotDone": "Te doen-item",
|
|
39
40
|
"neptune.Summary.statusPending": "Item in behandeling",
|
|
40
41
|
"neptune.Table.actionHeader": "Actie",
|
|
41
42
|
"neptune.Table.emptyData": "Geen resultaten gevonden",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
|
|
47
48
|
"neptune.Upload.csSuccessText": "Uploaden voltooid!",
|
|
48
49
|
"neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
|
|
49
|
-
"neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand
|
|
50
|
+
"neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
|
|
50
51
|
"neptune.Upload.psButtonText": "Annuleren",
|
|
51
52
|
"neptune.Upload.psProcessingText": "Uploaden...",
|
|
52
53
|
"neptune.Upload.retry": "Opnieuw proberen",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"neptune.UploadButton.maximumFiles": "Maximaal {maxFiles} bestanden.",
|
|
60
61
|
"neptune.UploadButton.uploadFile": "Bestand uploaden",
|
|
61
62
|
"neptune.UploadButton.uploadFiles": "Bestanden uploaden",
|
|
62
|
-
"neptune.UploadInput.deleteModalBody": "
|
|
63
|
+
"neptune.UploadInput.deleteModalBody": "Als je dit bestand verwijdert, wordt het van ons systeem gewist.",
|
|
63
64
|
"neptune.UploadInput.deleteModalCancelButtonText": "Annuleren",
|
|
64
65
|
"neptune.UploadInput.deleteModalConfirmButtonText": "Verwijderen",
|
|
65
66
|
"neptune.UploadInput.deleteModalTitle": "Weet je zeker dat je dit bestand wilt verwijderen?",
|
package/src/i18n/pl.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
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ę...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Numer kierunkowy",
|
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.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...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Código do país",
|
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.searchPlaceholder": "Tastează o monedă sau țară",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Selectează moneda",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Codul țării",
|
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.searchPlaceholder": "Введите валюту или страну",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "Выберите валюту",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Код страны",
|
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.searchPlaceholder": "ป้อนสกุลเงินหรือประเทศ",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "เลือกสกุลเงิน",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
|
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.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...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "Ülke kodu",
|
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.searchPlaceholder": "输入货币或国家/地区",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "选择货币",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "国家/地区代码",
|
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.searchPlaceholder": "輸入貨幣或國家/地區",
|
|
24
25
|
"neptune.MoneyInput.Select.selectCurrencyLabel": "選擇貨幣",
|
|
25
26
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
26
27
|
"neptune.PhoneNumberInput.countryCodeLabel": "國家/地區代碼",
|
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 { ImageProps } from './Image';
|
|
4
|
+
import { EmptyTransparentImage, 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 EmptyTransparentImage 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(EmptyTransparentImage);
|
|
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
|
|
2
|
+
import { useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useHasIntersected } from '../common/hooks';
|
|
5
5
|
|
|
@@ -16,6 +16,9 @@ export interface ImageProps {
|
|
|
16
16
|
shrink?: boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export const EmptyTransparentImage =
|
|
20
|
+
'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
|
21
|
+
|
|
19
22
|
const Image = ({
|
|
20
23
|
id,
|
|
21
24
|
src,
|
|
@@ -30,21 +33,20 @@ const Image = ({
|
|
|
30
33
|
}: ImageProps) => {
|
|
31
34
|
const elementReference = useRef<HTMLImageElement>(null);
|
|
32
35
|
const [hasIntersected] = useHasIntersected({ elRef: elementReference, loading });
|
|
36
|
+
let imageSource = src;
|
|
37
|
+
let imageOnLoad = onLoad;
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}, [hasIntersected, onLoad]);
|
|
39
|
+
if (loading === 'lazy' && !hasIntersected) {
|
|
40
|
+
imageSource = EmptyTransparentImage;
|
|
41
|
+
imageOnLoad = undefined;
|
|
42
|
+
}
|
|
40
43
|
|
|
41
44
|
return (
|
|
42
45
|
<img
|
|
43
46
|
ref={elementReference}
|
|
44
47
|
id={id}
|
|
45
48
|
alt={alt}
|
|
46
|
-
src={
|
|
47
|
-
loading={loading}
|
|
49
|
+
src={imageSource}
|
|
48
50
|
className={clsx([
|
|
49
51
|
'tw-image',
|
|
50
52
|
{
|
|
@@ -54,7 +56,7 @@ const Image = ({
|
|
|
54
56
|
className,
|
|
55
57
|
])}
|
|
56
58
|
role={role}
|
|
57
|
-
onLoad={
|
|
59
|
+
onLoad={imageOnLoad}
|
|
58
60
|
onError={onError}
|
|
59
61
|
/>
|
|
60
62
|
);
|
package/src/index.ts
CHANGED
|
@@ -109,6 +109,7 @@ export type {
|
|
|
109
109
|
TableCellStatus,
|
|
110
110
|
TableCellType,
|
|
111
111
|
} from './table';
|
|
112
|
+
export type { ListItemProps, ListItemAdditionalInfoProps, ListItemCheckboxProps } from './listItem';
|
|
112
113
|
|
|
113
114
|
/**
|
|
114
115
|
* Components
|
|
@@ -211,6 +212,7 @@ export { default as Typeahead } from './typeahead';
|
|
|
211
212
|
export { default as Upload } from './upload';
|
|
212
213
|
export { default as UploadInput } from './uploadInput';
|
|
213
214
|
export { default as Table } from './table';
|
|
215
|
+
export { default as Item } from './table';
|
|
214
216
|
|
|
215
217
|
/**
|
|
216
218
|
* Hooks
|
|
@@ -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."
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
.wds-list-item {
|
|
2
|
+
padding: 16px;
|
|
3
|
+
padding: var(--size-16);
|
|
4
|
+
border-radius: 24px;
|
|
5
|
+
border-radius: var(--radius-large);
|
|
6
|
+
background-color: #ffffff;
|
|
7
|
+
background-color: var(--color-background-screen);
|
|
8
|
+
gap: 16px;
|
|
9
|
+
gap: var(--size-16);
|
|
10
|
+
}
|
|
11
|
+
.wds-list-item-interactive {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
.wds-list-item-interactive:hover {
|
|
15
|
+
background-color: var(--color-background-screen-hover);
|
|
16
|
+
}
|
|
17
|
+
.wds-list-item-interactive:active {
|
|
18
|
+
background-color: var(--color-background-screen-active);
|
|
19
|
+
}
|
|
20
|
+
.wds-list-item-media-image {
|
|
21
|
+
width: var(--item-media-image-size);
|
|
22
|
+
height: var(--item-media-image-size);
|
|
23
|
+
}
|
|
24
|
+
.wds-list-item-body {
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
.wds-list-item-title {
|
|
28
|
+
color: #37517e;
|
|
29
|
+
color: var(--color-content-primary);
|
|
30
|
+
}
|
|
31
|
+
.wds-list-item-additional-info {
|
|
32
|
+
color: #768e9c;
|
|
33
|
+
color: var(--color-content-tertiary);
|
|
34
|
+
}
|
|
35
|
+
.wds-list-item-value {
|
|
36
|
+
flex: 0 0 auto;
|
|
37
|
+
}
|
|
38
|
+
.wds-list-item-control {
|
|
39
|
+
flex: 0 0 auto;
|
|
40
|
+
}
|
|
41
|
+
.wds-list-item-spotlight-active {
|
|
42
|
+
background-color: rgba(134,167,189,0.10196);
|
|
43
|
+
background-color: var(--color-background-neutral);
|
|
44
|
+
}
|
|
45
|
+
.wds-list-item-spotlight-active:hover {
|
|
46
|
+
background-color: var(--color-background-neutral-hover);
|
|
47
|
+
}
|
|
48
|
+
.wds-list-item-spotlight-active:active {
|
|
49
|
+
background-color: var(--color-background-neutral-active);
|
|
50
|
+
}
|
|
51
|
+
.wds-list-item-spotlight-inactive {
|
|
52
|
+
background-color: rgba(134, 167, 189, 0.025);
|
|
53
|
+
border: 1px dashed rgba(0,0,0,0.10196);
|
|
54
|
+
border: 1px dashed var(--color-border-neutral);
|
|
55
|
+
}
|
|
56
|
+
@supports (color: color-mix(in lch, red, blue)) {
|
|
57
|
+
.wds-list-item-spotlight-inactive {
|
|
58
|
+
background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.wds-list-item-spotlight-inactive:hover {
|
|
62
|
+
background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
|
|
63
|
+
}
|
|
64
|
+
.wds-list-item-spotlight-inactive:active {
|
|
65
|
+
background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
|
|
66
|
+
}
|
|
67
|
+
.wds-list-item-prompt {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
padding-top: calc(8px / 2);
|
|
70
|
+
padding-top: calc(var(--padding-x-small) / 2);
|
|
71
|
+
padding-bottom: calc(8px / 2);
|
|
72
|
+
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
73
|
+
padding-left: calc(8px - 1px);
|
|
74
|
+
padding-left: calc(var(--padding-x-small) - 1px);
|
|
75
|
+
padding-right: 8px;
|
|
76
|
+
padding-right: var(--padding-x-small);
|
|
77
|
+
border-radius: 10px;
|
|
78
|
+
border-radius: var(--radius-small);
|
|
79
|
+
word-break: break-word;
|
|
80
|
+
word-wrap: break-word;
|
|
81
|
+
}
|
|
82
|
+
.wds-list-item-prompt .np-prompt-icon {
|
|
83
|
+
padding-right: calc(12px / 2);
|
|
84
|
+
padding-right: calc(var(--size-12) / 2);
|
|
85
|
+
padding-top: calc(4px - 1px);
|
|
86
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
87
|
+
padding-bottom: calc(4px - 1px);
|
|
88
|
+
padding-bottom: calc(var(--size-4) - 1px);
|
|
89
|
+
}
|
|
90
|
+
.wds-list-item-prompt .np-prompt-icon .tw-icon-tags,
|
|
91
|
+
.wds-list-item-prompt .np-prompt-icon .tw-icon-confetti {
|
|
92
|
+
color: var(--color-sentiment-positive-primary);
|
|
93
|
+
}
|
|
94
|
+
.wds-list-item-prompt a {
|
|
95
|
+
text-underline-offset: calc(4px / 2);
|
|
96
|
+
text-underline-offset: calc(var(--size-4) / 2);
|
|
97
|
+
}
|
|
98
|
+
.wds-list-item-prompt.np-prompt-interactive {
|
|
99
|
+
-webkit-text-decoration: none;
|
|
100
|
+
text-decoration: none;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
border: none;
|
|
103
|
+
}
|
|
104
|
+
.wds-list-item-prompt.negative {
|
|
105
|
+
background-color: var(--color-sentiment-negative-secondary);
|
|
106
|
+
color: var(--color-sentiment-negative-primary);
|
|
107
|
+
}
|
|
108
|
+
.wds-list-item-prompt.negative a {
|
|
109
|
+
color: var(--color-sentiment-negative-primary);
|
|
110
|
+
}
|
|
111
|
+
.wds-list-item-prompt.negative a:hover {
|
|
112
|
+
color: var(--color-sentiment-negative-primary-hover);
|
|
113
|
+
}
|
|
114
|
+
.wds-list-item-prompt.negative a:active {
|
|
115
|
+
color: var(--color-sentiment-negative-primary-active);
|
|
116
|
+
}
|
|
117
|
+
.np-prompt-interactive.wds-list-item-prompt.negative:hover {
|
|
118
|
+
background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
|
|
119
|
+
}
|
|
120
|
+
.np-prompt-interactive.wds-list-item-prompt.negative:active {
|
|
121
|
+
background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
|
|
122
|
+
}
|
|
123
|
+
.wds-list-item-prompt.positive,
|
|
124
|
+
.wds-list-item-prompt.discount,
|
|
125
|
+
.wds-list-item-prompt.savings {
|
|
126
|
+
background-color: var(--color-sentiment-positive-secondary);
|
|
127
|
+
color: var(--color-sentiment-positive-primary);
|
|
128
|
+
}
|
|
129
|
+
.wds-list-item-prompt.positive a,
|
|
130
|
+
.wds-list-item-prompt.discount a,
|
|
131
|
+
.wds-list-item-prompt.savings a {
|
|
132
|
+
color: var(--color-sentiment-positive-primary);
|
|
133
|
+
}
|
|
134
|
+
.wds-list-item-prompt.positive a:hover,
|
|
135
|
+
.wds-list-item-prompt.discount a:hover,
|
|
136
|
+
.wds-list-item-prompt.savings a:hover {
|
|
137
|
+
color: var(--color-sentiment-positive-primary-hover);
|
|
138
|
+
}
|
|
139
|
+
.wds-list-item-prompt.positive a:active,
|
|
140
|
+
.wds-list-item-prompt.discount a:active,
|
|
141
|
+
.wds-list-item-prompt.savings a:active {
|
|
142
|
+
color: var(--color-sentiment-positive-primary-active);
|
|
143
|
+
}
|
|
144
|
+
.np-prompt-interactive.wds-list-item-prompt.positive:hover,
|
|
145
|
+
.np-prompt-interactive.wds-list-item-prompt.discount:hover,
|
|
146
|
+
.np-prompt-interactive.wds-list-item-prompt.savings:hover {
|
|
147
|
+
background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
|
|
148
|
+
}
|
|
149
|
+
.np-prompt-interactive.wds-list-item-prompt.positive:active,
|
|
150
|
+
.np-prompt-interactive.wds-list-item-prompt.discount:active,
|
|
151
|
+
.np-prompt-interactive.wds-list-item-prompt.savings:active {
|
|
152
|
+
background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
|
|
153
|
+
}
|
|
154
|
+
.wds-list-item-prompt.neutral {
|
|
155
|
+
background-color: rgba(134,167,189,0.10196);
|
|
156
|
+
background-color: var(--color-background-neutral);
|
|
157
|
+
color: #37517e;
|
|
158
|
+
color: var(--color-content-primary);
|
|
159
|
+
}
|
|
160
|
+
.wds-list-item-prompt.neutral a {
|
|
161
|
+
color: #37517e;
|
|
162
|
+
color: var(--color-content-primary);
|
|
163
|
+
}
|
|
164
|
+
.np-prompt-interactive.wds-list-item-prompt.neutral:hover {
|
|
165
|
+
background-color: var(--color-background-neutral-hover);
|
|
166
|
+
}
|
|
167
|
+
.np-prompt-interactive.wds-list-item-prompt.neutral:active {
|
|
168
|
+
background-color: var(--color-background-neutral-active);
|
|
169
|
+
}
|
|
170
|
+
.wds-list-item-prompt.warning {
|
|
171
|
+
background-color: var(--color-sentiment-warning-secondary);
|
|
172
|
+
color: var(--color-sentiment-warning-content);
|
|
173
|
+
}
|
|
174
|
+
.wds-list-item-prompt.warning a {
|
|
175
|
+
color: var(--color-sentiment-warning-content);
|
|
176
|
+
}
|
|
177
|
+
.wds-list-item-prompt.warning a:hover {
|
|
178
|
+
color: var(--color-sentiment-warning-content-hover);
|
|
179
|
+
}
|
|
180
|
+
.wds-list-item-prompt.warning a:active {
|
|
181
|
+
color: var(--color-sentiment-warning-content-active);
|
|
182
|
+
}
|
|
183
|
+
.np-prompt-interactive.wds-list-item-prompt.warning:hover {
|
|
184
|
+
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
|
|
185
|
+
}
|
|
186
|
+
.np-prompt-interactive.wds-list-item-prompt.warning:active {
|
|
187
|
+
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
|
|
188
|
+
}
|