@transferwise/components 0.0.0-experimental-29d0f94 → 0.0.0-experimental-4b1de0a
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/button/Button.js +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js +5 -2
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs +5 -2
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/initials.js +1 -4
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +1 -4
- package/build/common/initials.mjs.map +1 -1
- package/build/i18n/de.json +0 -2
- package/build/i18n/de.json.js +0 -2
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +0 -2
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/fr.json +0 -2
- package/build/i18n/fr.json.js +0 -2
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +0 -2
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +0 -2
- package/build/i18n/hu.json.js +0 -2
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +0 -2
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/it.json +0 -2
- package/build/i18n/it.json.js +0 -2
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +0 -2
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +0 -2
- package/build/i18n/ja.json.js +0 -2
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +0 -2
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +0 -2
- package/build/i18n/pl.json.js +0 -2
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +0 -2
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/ro.json +0 -2
- package/build/i18n/ro.json.js +0 -2
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +0 -2
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +0 -2
- package/build/i18n/ru.json.js +0 -2
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +0 -2
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/tr.json +0 -2
- package/build/i18n/tr.json.js +0 -2
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +0 -2
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +0 -2
- package/build/i18n/zh-CN.json.js +0 -2
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +0 -2
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +0 -2
- package/build/i18n/zh-HK.json.js +0 -2
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +0 -2
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +56 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +54 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +23 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +21 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js +23 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs +21 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -0
- package/build/listItem/Button/ListItemButton.js +43 -0
- package/build/listItem/Button/ListItemButton.js.map +1 -0
- package/build/listItem/Button/ListItemButton.mjs +41 -0
- package/build/listItem/Button/ListItemButton.mjs.map +1 -0
- package/build/listItem/Checkbox/ListItemCheckbox.js +30 -0
- package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -0
- package/build/listItem/Checkbox/ListItemCheckbox.mjs +28 -0
- package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -0
- package/build/listItem/IconButton/ListItemIconButton.js +42 -0
- package/build/listItem/IconButton/ListItemIconButton.js.map +1 -0
- package/build/listItem/IconButton/ListItemIconButton.mjs +40 -0
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -0
- package/build/listItem/Image/ListItemImage.js +31 -0
- package/build/listItem/Image/ListItemImage.js.map +1 -0
- package/build/listItem/Image/ListItemImage.mjs +29 -0
- package/build/listItem/Image/ListItemImage.mjs.map +1 -0
- package/build/listItem/ListItem.js +312 -0
- package/build/listItem/ListItem.js.map +1 -0
- package/build/listItem/ListItem.mjs +307 -0
- package/build/listItem/ListItem.mjs.map +1 -0
- package/build/listItem/ListItemContext.js +8 -0
- package/build/listItem/ListItemContext.js.map +1 -0
- package/build/listItem/ListItemContext.mjs +6 -0
- package/build/listItem/ListItemContext.mjs.map +1 -0
- package/build/listItem/Navigation/ListItemNavigation.js +45 -0
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -0
- package/build/listItem/Navigation/ListItemNavigation.mjs +43 -0
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js +59 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs +54 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -0
- package/build/listItem/Radio/ListItemRadio.js +30 -0
- package/build/listItem/Radio/ListItemRadio.js.map +1 -0
- package/build/listItem/Radio/ListItemRadio.mjs +28 -0
- package/build/listItem/Radio/ListItemRadio.mjs.map +1 -0
- package/build/listItem/Switch/ListItemSwitch.js +30 -0
- package/build/listItem/Switch/ListItemSwitch.js.map +1 -0
- package/build/listItem/Switch/ListItemSwitch.mjs +28 -0
- package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -0
- package/build/listItem/useListItemControl.js +22 -0
- package/build/listItem/useListItemControl.js.map +1 -0
- package/build/listItem/useListItemControl.mjs +20 -0
- package/build/listItem/useListItemControl.mjs.map +1 -0
- package/build/listItem/useListItemMedia.js +21 -0
- package/build/listItem/useListItemMedia.js.map +1 -0
- package/build/listItem/useListItemMedia.mjs +19 -0
- package/build/listItem/useListItemMedia.mjs.map +1 -0
- package/build/main.css +773 -1
- package/build/styles/avatarView/AvatarView.css +3 -1
- package/build/styles/listItem/ListItem.css +770 -0
- package/build/styles/listItem/ListItem.grid.css +370 -0
- package/build/styles/main.css +773 -1
- package/build/switch/Switch.js +2 -0
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs +2 -0
- package/build/switch/Switch.mjs.map +1 -1
- package/build/test-utils/assets/placeholder-landscape.svg +1 -0
- package/build/test-utils/assets/placeholder-portrait.svg +1 -0
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +1 -1
- package/build/types/button/Button.types.d.ts.map +1 -1
- package/build/types/button/index.d.ts +1 -1
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/RadioButton/RadioButton.d.ts +3 -1
- package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
- package/build/types/common/initials.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +2 -2
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +3 -0
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/image/index.d.ts +1 -0
- package/build/types/image/index.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/AdditionalInfo/ListItemAdditionalInfo.d.ts +15 -0
- package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +1 -0
- package/build/types/listItem/AdditionalInfo/index.d.ts +3 -0
- package/build/types/listItem/AdditionalInfo/index.d.ts.map +1 -0
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +18 -0
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -0
- package/build/types/listItem/AvatarLayout/index.d.ts +3 -0
- package/build/types/listItem/AvatarLayout/index.d.ts.map +1 -0
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +16 -0
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -0
- package/build/types/listItem/AvatarView/index.d.ts +3 -0
- package/build/types/listItem/AvatarView/index.d.ts.map +1 -0
- package/build/types/listItem/Button/ListItemButton.d.ts +20 -0
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -0
- package/build/types/listItem/Button/index.d.ts +3 -0
- package/build/types/listItem/Button/index.d.ts.map +1 -0
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +14 -0
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +1 -0
- package/build/types/listItem/Checkbox/index.d.ts +3 -0
- package/build/types/listItem/Checkbox/index.d.ts.map +1 -0
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +18 -0
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -0
- package/build/types/listItem/IconButton/index.d.ts +3 -0
- package/build/types/listItem/IconButton/index.d.ts.map +1 -0
- package/build/types/listItem/Image/ListItemImage.d.ts +25 -0
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -0
- package/build/types/listItem/Image/index.d.ts +3 -0
- package/build/types/listItem/Image/index.d.ts.map +1 -0
- package/build/types/listItem/ListItem.d.ts +113 -0
- package/build/types/listItem/ListItem.d.ts.map +1 -0
- package/build/types/listItem/ListItemContext.d.ts +22 -0
- package/build/types/listItem/ListItemContext.d.ts.map +1 -0
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts +15 -0
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -0
- package/build/types/listItem/Navigation/index.d.ts +3 -0
- package/build/types/listItem/Navigation/index.d.ts.map +1 -0
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +16 -0
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -0
- package/build/types/listItem/Prompt/index.d.ts +3 -0
- package/build/types/listItem/Prompt/index.d.ts.map +1 -0
- package/build/types/listItem/Radio/ListItemRadio.d.ts +14 -0
- package/build/types/listItem/Radio/ListItemRadio.d.ts.map +1 -0
- package/build/types/listItem/Radio/index.d.ts +3 -0
- package/build/types/listItem/Radio/index.d.ts.map +1 -0
- package/build/types/listItem/Switch/ListItemSwitch.d.ts +14 -0
- package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +1 -0
- package/build/types/listItem/Switch/index.d.ts +3 -0
- package/build/types/listItem/Switch/index.d.ts.map +1 -0
- package/build/types/listItem/_stories/helpers.d.ts +27 -0
- package/build/types/listItem/_stories/helpers.d.ts.map +1 -0
- package/build/types/listItem/_stories/subcomponents.d.ts +18 -0
- package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -0
- package/build/types/listItem/index.d.ts +14 -0
- package/build/types/listItem/index.d.ts.map +1 -0
- package/build/types/listItem/test-utils.d.ts +7 -0
- package/build/types/listItem/test-utils.d.ts.map +1 -0
- package/build/types/listItem/useListItemControl.d.ts +5 -0
- package/build/types/listItem/useListItemControl.d.ts.map +1 -0
- package/build/types/listItem/useListItemMedia.d.ts +6 -0
- package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
- package/build/types/switch/Switch.d.ts +3 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/avatarView/AvatarView.css +3 -1
- package/src/avatarView/AvatarView.less +2 -1
- package/src/button/Button.spec.tsx +18 -0
- package/src/button/Button.tsx +5 -1
- package/src/button/Button.types.ts +1 -1
- package/src/button/index.ts +1 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +4 -4
- package/src/common/RadioButton/RadioButton.tsx +6 -1
- package/src/common/initials.spec.tsx +0 -13
- package/src/common/initials.ts +0 -5
- package/src/i18n/de.json +0 -2
- package/src/i18n/fr.json +0 -2
- package/src/i18n/hu.json +0 -2
- package/src/i18n/it.json +0 -2
- package/src/i18n/ja.json +0 -2
- package/src/i18n/pl.json +0 -2
- package/src/i18n/ro.json +0 -2
- package/src/i18n/ru.json +0 -2
- package/src/i18n/tr.json +0 -2
- package/src/i18n/zh-CN.json +0 -2
- package/src/i18n/zh-HK.json +0 -2
- package/src/iconButton/IconButton.story.tsx +1 -1
- package/src/iconButton/IconButton.tsx +1 -1
- package/src/image/Image.tsx +3 -0
- package/src/image/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +56 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +195 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +36 -0
- package/src/listItem/AdditionalInfo/index.ts +2 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +59 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +121 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +27 -0
- package/src/listItem/AvatarLayout/index.ts +2 -0
- package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +75 -0
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +336 -0
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +27 -0
- package/src/listItem/AvatarView/index.ts +2 -0
- package/src/listItem/Button/ListItemButton.spec.tsx +68 -0
- package/src/listItem/Button/ListItemButton.story.tsx +466 -0
- package/src/listItem/Button/ListItemButton.tsx +56 -0
- package/src/listItem/Button/index.ts +2 -0
- package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +82 -0
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +125 -0
- package/src/listItem/Checkbox/ListItemCheckbox.tsx +33 -0
- package/src/listItem/Checkbox/index.ts +2 -0
- package/src/listItem/IconButton/ListItemIconButton.spec.tsx +119 -0
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +249 -0
- package/src/listItem/IconButton/ListItemIconButton.tsx +56 -0
- package/src/listItem/IconButton/index.ts +2 -0
- package/src/listItem/Image/ListItemImage.spec.tsx +30 -0
- package/src/listItem/Image/ListItemImage.story.tsx +77 -0
- package/src/listItem/Image/ListItemImage.tsx +48 -0
- package/src/listItem/Image/index.ts +2 -0
- package/src/listItem/ListItem.css +770 -0
- package/src/listItem/ListItem.grid.css +370 -0
- package/src/listItem/ListItem.grid.less +622 -0
- package/src/listItem/ListItem.less +421 -0
- package/src/listItem/ListItem.spec.tsx +1496 -0
- package/src/listItem/ListItem.tsx +447 -0
- package/src/listItem/ListItemContext.tsx +27 -0
- package/src/listItem/Navigation/ListItemNavigation.spec.tsx +59 -0
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +109 -0
- package/src/listItem/Navigation/ListItemNavigation.tsx +40 -0
- package/src/listItem/Navigation/index.ts +2 -0
- package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +201 -0
- package/src/listItem/Prompt/ListItemPrompt.tsx +32 -0
- package/src/listItem/Prompt/index.ts +2 -0
- package/src/listItem/Radio/ListItemRadio.spec.tsx +66 -0
- package/src/listItem/Radio/ListItemRadio.story.tsx +108 -0
- package/src/listItem/Radio/ListItemRadio.tsx +33 -0
- package/src/listItem/Radio/index.ts +2 -0
- package/src/listItem/Switch/ListItemSwitch.spec.tsx +47 -0
- package/src/listItem/Switch/ListItemSwitch.story.tsx +77 -0
- package/src/listItem/Switch/ListItemSwitch.tsx +33 -0
- package/src/listItem/Switch/index.ts +2 -0
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +250 -0
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +353 -0
- package/src/listItem/_stories/ListItem.scenarios.story.tsx +209 -0
- package/src/listItem/_stories/ListItem.story.tsx +772 -0
- package/src/listItem/_stories/ListItem.variants.test.story.tsx +271 -0
- package/src/listItem/_stories/helpers.tsx +53 -0
- package/src/listItem/_stories/subcomponents.tsx +139 -0
- package/src/listItem/index.ts +14 -0
- package/src/listItem/test-utils.tsx +33 -0
- package/src/listItem/useListItemControl.tsx +18 -0
- package/src/listItem/useListItemMedia.tsx +13 -0
- package/src/main.css +773 -1
- package/src/main.less +1 -0
- package/src/switch/Switch.tsx +5 -1
- package/src/test-utils/assets/placeholder-landscape.svg +1 -0
- package/src/test-utils/assets/placeholder-portrait.svg +1 -0
- package/src/test-utils/Parameters.d.ts +0 -77
package/src/i18n/fr.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Échec du téléchargement. Veuillez réessayer",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Téléchargement terminé !",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Veuillez fournir un fichier de moins de {maxSize} Mo",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Veuillez fournir un fichier plus petit",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Format non pris en charge. Veuillez réessayer avec un fichier différent",
|
|
50
49
|
"neptune.Upload.psButtonText": "Annuler",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Téléchargement...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Ou sélectionnez un fichier",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Déposer un fichier pour démarrer le téléchargement",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Glissez-déposez un fichier de moins de {maxSize} Mo",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Glissez et déposez un fichier",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Tous types de fichiers",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Déposer un fichier pour démarrer le téléchargement",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, inférieur à {size} Mo",
|
package/src/i18n/hu.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Feltöltés sikertelen. Kérünk, próbáld újra",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Feltöltés sikeres",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Kérünk, olyan fájlt küldj el, amely kisebb mint {maxSize}MB",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Kérünk, egy kisebb fájlt küldj",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Nem támogatott fájltípus. Kérünk, próbáld újra másik fájllal",
|
|
50
49
|
"neptune.Upload.psButtonText": "Mégsem",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Feltöltés...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Vagy válaszd ki a fájlt",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Húzd ide a fájlokat a feltöltéshez",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Húzz ide egy legfeljebb {maxSize}MB méretű fájlt",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Húzd át a fájlt",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Összes fájltípus",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Húzd a fájlokat ide a feltöltéshez",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, legfeljebb {size}MB",
|
package/src/i18n/it.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Caricamento fallito. Per favore riprova",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Caricamento completato!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Carica un file inferiore a {maxSize}MB",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Fornisci un file più piccolo",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Formato del documento non supportato. Riprova con un formato diverso",
|
|
50
49
|
"neptune.Upload.psButtonText": "Annulla",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Caricamento...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "O seleziona un documento",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Rilascia il documento per iniziare il caricamento",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Trascina e rilascia un file inferiore a {maxSize}MB",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Trascina e rilascia un file",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Tutti i tipi di file",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Rilascia file per iniziare a caricare",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, minore di {size}MB",
|
package/src/i18n/ja.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "アップロードに失敗しました。もう一度やり直してください。",
|
|
46
46
|
"neptune.Upload.csSuccessText": "アップロードが完了しました。",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "{maxSize}MB以下のファイルをアップロードしてください",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "より小さいファイルをご提供ください",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "ファイルの種類はサポートされていません。別のファイルで再度お試しください",
|
|
50
49
|
"neptune.Upload.psButtonText": "キャンセルする",
|
|
51
50
|
"neptune.Upload.psProcessingText": "アップロードしています…",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "またはファイルを選択する",
|
|
54
53
|
"neptune.Upload.usDropMessage": "ファイルをドロップしてアップロードする",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "{maxSize}MB以下のファイルをドラッグ&ドロップしてください",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "ファイルをドラッグ&ドロップ",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "すべてのファイル種類",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "ファイルをドロップしてアップロードする",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}、{size}MB以下",
|
package/src/i18n/pl.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Przesyłanie nie powiodło się. Proszę spróbować ponownie",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Przesyłanie zakończone!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Prosimy przesłać plik mniejszy niż {maxSize} MB",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Prosimy przesłać mniejszy plik",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Nieobsługiwany typ pliku. Spróbuj ponownie z innym plikiem",
|
|
50
49
|
"neptune.Upload.psButtonText": "Anuluj",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Przesyłanie...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Lub wybierz plik",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Upuść plik, aby rozpocząć przesyłanie",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Przeciągnij i upuść plik nie większy niż {maxSize} MB",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Przeciągnij i upuść plik",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Wszystkie typy plików",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Upuść plik, żeby rozpocząć przesyłanie",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, mniejsze niż {size}MB",
|
package/src/i18n/ro.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Încărcare eșuată. Te rugăm să încerci din nou",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Încărcare completă!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Te rugăm să furnizezi un fișier mai mic de {maxSize} MB",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Te rugăm să furnizezi un fișier mai mic",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Tipul de fișier nu a fost acceptat. Te rugăm să încerci din nou cu un alt fișier",
|
|
50
49
|
"neptune.Upload.psButtonText": "Anulează",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Se încarcă...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Sau selectează un fișier",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Atașează fișierul pentru a începe încărcarea",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Glisează și atașează un fișier mai mic de {maxSize} MB",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Glisează și lipește un fișier",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Toate tipurile de fișiere",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Trage fișierul pentru a începe încărcarea",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, de maximum {size}MB",
|
package/src/i18n/ru.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Загрузка не удалась. Пожалуйста, попробуйте снова",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Загрузка завершена!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Пожалуйста, загрузите файл размером менее {maxSize} Мб",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Пожалуйста, загрузите файл меньшего размера",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Тип файла не поддерживается. Пожалуйста, попробуйте еще раз с другим файлом",
|
|
50
49
|
"neptune.Upload.psButtonText": "Отменить",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Загружаем...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Или выберите файл",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Перетащите файл, чтобы начать загрузку",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "Перетащите файл размером не более {maxSize} Mб",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Перетащите файл",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Все типы файлов",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Перетащите файл, чтобы начать загрузку",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, не превышающий {size} MB",
|
package/src/i18n/tr.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "Yükleme başarısız. Lütfen yine deneyin",
|
|
46
46
|
"neptune.Upload.csSuccessText": "Yükleme tamamlandı!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "Lütfen {maxSize} MB'den küçük bir dosya sağlayın",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "Lütfen daha küçük bir dosya gönderin",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "Desteklenmeyen dosya biçimi. Lütfen başka bir dosyayla tekrar deneyin",
|
|
50
49
|
"neptune.Upload.psButtonText": "İptal edin",
|
|
51
50
|
"neptune.Upload.psProcessingText": "Yükleniyor...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "Veya bir dosya seçin",
|
|
54
53
|
"neptune.Upload.usDropMessage": "Yüklemeyi başlatmak için dosyayı bırakın",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "{maxSize} MB'den küçük bir dosya sürükleyin ve bırakın",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "Dosyayı sürükleyip bırakın",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "Tüm belge tipleri",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "Yüklemeyi başlatmak için dosyayı bırakın",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes}, en fazla {size}MB",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "上传失败。请重试",
|
|
46
46
|
"neptune.Upload.csSuccessText": "上传完毕!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "请提供一个小于 {maxSize} MB 的文件",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "请提供更小的文件。",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "不支持该文件类型,请试试其他文件",
|
|
50
49
|
"neptune.Upload.psButtonText": "取消",
|
|
51
50
|
"neptune.Upload.psProcessingText": "正在上传…",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "或选择文件",
|
|
54
53
|
"neptune.Upload.usDropMessage": "拖放文件开始上传",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "拖放一个不超过 {maxSize} MB 的文件",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "拖放文件",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "所有文件类型",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "拖放文件开始上传",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes},小于 {size} MB",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"neptune.Upload.csFailureText": "上載失敗,請重試。",
|
|
46
46
|
"neptune.Upload.csSuccessText": "上載完成!",
|
|
47
47
|
"neptune.Upload.csTooLargeMessage": "請提供一個小於{maxSize}MB的檔案",
|
|
48
|
-
"neptune.Upload.csTooLargeNoLimitMessage": "請提供較小的檔案",
|
|
49
48
|
"neptune.Upload.csWrongTypeMessage": "不支持檔案類型,請使用其他檔案重試",
|
|
50
49
|
"neptune.Upload.psButtonText": "取消",
|
|
51
50
|
"neptune.Upload.psProcessingText": "上載中...",
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
"neptune.Upload.usButtonText": "或者選擇一個檔案",
|
|
54
53
|
"neptune.Upload.usDropMessage": "拖放檔案以開始上載",
|
|
55
54
|
"neptune.Upload.usPlaceholder": "拖放一個不超過{maxSize}MB的檔案",
|
|
56
|
-
"neptune.Upload.usPlaceholderNoLimit": "拖放檔案",
|
|
57
55
|
"neptune.UploadButton.allFileTypes": "所有檔案類型",
|
|
58
56
|
"neptune.UploadButton.dropFiles": "拖放檔案以開始上載",
|
|
59
57
|
"neptune.UploadButton.instructions": "{fileTypes},小於{size}MB",
|
|
@@ -91,7 +91,7 @@ export const Basic: Story = {
|
|
|
91
91
|
gridTemplate: `auto auto / repeat(6, min-content)`,
|
|
92
92
|
}}
|
|
93
93
|
>
|
|
94
|
-
{['Primary', 'Secondary', 'Tertiary', '
|
|
94
|
+
{['Primary', 'Secondary', 'Tertiary', 'Minimal', 'Neg primary', 'Neg secondary'].map(
|
|
95
95
|
(variant) => (
|
|
96
96
|
<Body type="body-default-bold">{variant}</Body>
|
|
97
97
|
),
|
|
@@ -12,7 +12,7 @@ export type Props = {
|
|
|
12
12
|
Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> &
|
|
13
13
|
Pick<
|
|
14
14
|
HTMLAttributes<HTMLDivElement>,
|
|
15
|
-
'className' | 'role' | 'children' | 'aria-label' | 'tabIndex'
|
|
15
|
+
'id' | 'className' | 'role' | 'children' | 'aria-label' | 'tabIndex'
|
|
16
16
|
>;
|
|
17
17
|
|
|
18
18
|
const IconButton = forwardRef(function IconButton(
|
package/src/image/Image.tsx
CHANGED
|
@@ -10,6 +10,9 @@ export interface ImageProps {
|
|
|
10
10
|
onLoad?: () => void;
|
|
11
11
|
onError?: () => void;
|
|
12
12
|
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Specifies the [loading behavior of the image](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#loading).
|
|
15
|
+
*/
|
|
13
16
|
loading?: 'lazy' | 'eager';
|
|
14
17
|
stretch?: boolean;
|
|
15
18
|
role?: string;
|
package/src/image/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -108,6 +108,7 @@ export type {
|
|
|
108
108
|
TableCellStatus,
|
|
109
109
|
TableCellType,
|
|
110
110
|
} from './table';
|
|
111
|
+
export type { ListItemProps, ListItemAdditionalInfoProps, ListItemCheckboxProps } from './listItem';
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
114
|
* Components
|
|
@@ -209,6 +210,7 @@ export { default as Typeahead } from './typeahead';
|
|
|
209
210
|
export { default as Upload } from './upload';
|
|
210
211
|
export { default as UploadInput } from './uploadInput';
|
|
211
212
|
export { default as Table } from './table';
|
|
213
|
+
export { default as ListItem } from './listItem';
|
|
212
214
|
|
|
213
215
|
/**
|
|
214
216
|
* Hooks
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { render, screen } from '../../test-utils';
|
|
2
|
+
import { ListItem, type Props as ListItemProps } from '../ListItem';
|
|
3
|
+
|
|
4
|
+
describe('ListItem.AdditionalInfo', () => {
|
|
5
|
+
const renderWithInfo = (info: ListItemProps['additionalInfo']) =>
|
|
6
|
+
render(<ListItem title="Test title" subtitle="Test subtitle" additionalInfo={info} />);
|
|
7
|
+
|
|
8
|
+
it('renders children content', () => {
|
|
9
|
+
renderWithInfo(
|
|
10
|
+
<ListItem.AdditionalInfo>Additional information content</ListItem.AdditionalInfo>,
|
|
11
|
+
);
|
|
12
|
+
expect(screen.getByText('Additional information content')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders action button when onClick provided', () => {
|
|
16
|
+
const handleActionClick = jest.fn();
|
|
17
|
+
renderWithInfo(
|
|
18
|
+
<ListItem.AdditionalInfo action={{ label: 'Learn more', onClick: handleActionClick }}>
|
|
19
|
+
Additional info
|
|
20
|
+
</ListItem.AdditionalInfo>,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(screen.getByRole('button', { name: 'Learn more' })).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders action link with href when provided', () => {
|
|
27
|
+
renderWithInfo(
|
|
28
|
+
<ListItem.AdditionalInfo action={{ label: 'Learn more', href: '/learn' }}>
|
|
29
|
+
Additional info
|
|
30
|
+
</ListItem.AdditionalInfo>,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const actionLink = screen.getByRole('link', { name: 'Learn more' });
|
|
34
|
+
expect(actionLink).toBeInTheDocument();
|
|
35
|
+
expect(actionLink).toHaveAttribute('href', '/learn');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('renders action link with target when provided', () => {
|
|
39
|
+
renderWithInfo(
|
|
40
|
+
<ListItem.AdditionalInfo action={{ label: 'Learn more', href: '/learn', target: '_blank' }}>
|
|
41
|
+
Additional info
|
|
42
|
+
</ListItem.AdditionalInfo>,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const actionLink = screen.getByRole('link', { name: 'Learn more (opens in new tab)' });
|
|
46
|
+
expect(actionLink).toBeInTheDocument();
|
|
47
|
+
expect(actionLink).toHaveAttribute('target', '_blank');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('does not render action when not provided', () => {
|
|
51
|
+
renderWithInfo(<ListItem.AdditionalInfo>Additional info only</ListItem.AdditionalInfo>);
|
|
52
|
+
|
|
53
|
+
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
|
54
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
|
+
import { lorem20 } from '../../test-utils';
|
|
5
|
+
import { ListItem } from '../ListItem';
|
|
6
|
+
import {
|
|
7
|
+
SB_LIST_ITEM_CONTROLS as CONTROLS,
|
|
8
|
+
SB_LIST_ITEM_MEDIA as MEDIA,
|
|
9
|
+
} from '../_stories/subcomponents';
|
|
10
|
+
import { disableControls } from '../_stories/helpers';
|
|
11
|
+
import type { ListItemAdditionalInfoProps } from './ListItemAdditionalInfo';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Use additional information to add extra details that help make the information clearer for users. Use additional information only after you've used the subtitle.
|
|
15
|
+
*
|
|
16
|
+
* Refer to the [design documentation](https://wise.design/components/list-item#content:~:text=StatusIcon.iconLabel.error-,Additional%20information,-Use%20additional%20information) for more details.
|
|
17
|
+
*/
|
|
18
|
+
export default {
|
|
19
|
+
component: ListItem.AdditionalInfo,
|
|
20
|
+
title: 'Content/ListItem/ListItem.AdditionalInfo',
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
toc: true,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
children: lorem20,
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
children: {
|
|
31
|
+
table: {
|
|
32
|
+
type: { summary: 'ReactNode' },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
action: {
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: `{ label: string } & Pick<LinkProps, 'href' | 'onClick' | 'target'>` },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
} satisfies Meta<ListItemAdditionalInfoProps>;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<ListItemAdditionalInfoProps>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Convenience controls for previewing rich markup,
|
|
47
|
+
* not otherwise possible via Storybook
|
|
48
|
+
*/
|
|
49
|
+
type PreviewStoryArgs = ListItemAdditionalInfoProps & {
|
|
50
|
+
previewAction?: string | ListItemAdditionalInfoProps['action'];
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const previewArgGroup = {
|
|
54
|
+
category: 'Preview options',
|
|
55
|
+
type: {
|
|
56
|
+
summary: undefined,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const previewArgTypes = {
|
|
61
|
+
previewAction: {
|
|
62
|
+
name: 'Preview `action`',
|
|
63
|
+
control: 'radio',
|
|
64
|
+
options: ['unset (undefined)', 'link', 'button'],
|
|
65
|
+
mapping: {
|
|
66
|
+
'unset (undefined)': undefined,
|
|
67
|
+
link: {
|
|
68
|
+
label: 'Details about the subject.',
|
|
69
|
+
href: 'https://wise.com',
|
|
70
|
+
target: '_blank',
|
|
71
|
+
},
|
|
72
|
+
button: {
|
|
73
|
+
label: 'Details about the subject.',
|
|
74
|
+
onClick: fn(),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
table: previewArgGroup,
|
|
78
|
+
},
|
|
79
|
+
} as const;
|
|
80
|
+
|
|
81
|
+
export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
82
|
+
tags: ['!autodocs'],
|
|
83
|
+
argTypes: previewArgTypes,
|
|
84
|
+
args: {
|
|
85
|
+
children: lorem20,
|
|
86
|
+
previewAction: 'link',
|
|
87
|
+
},
|
|
88
|
+
render: (args: PreviewStoryArgs) => {
|
|
89
|
+
const { previewAction, ...props } = args as {
|
|
90
|
+
previewAction: ListItemAdditionalInfoProps['action'];
|
|
91
|
+
props: ListItemAdditionalInfoProps;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<ListItem
|
|
96
|
+
title="List item title"
|
|
97
|
+
subtitle="Subtitle goes here"
|
|
98
|
+
media={MEDIA.avatarSingle}
|
|
99
|
+
control={CONTROLS.partialButton}
|
|
100
|
+
additionalInfo={<ListItem.AdditionalInfo {...props} action={previewAction} />}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Fully interactive ListItems do not allow for any nested links or inline buttons as that would fail accessibility compliance.
|
|
108
|
+
*
|
|
109
|
+
* Non-interactive or partially-interactive ListItems allow appending a single link or inline button via `action` prop. The restriction has been introduced to ensure that the ListItem remains accessible and adheres to the vendors' best practices for mobile platforms.
|
|
110
|
+
*/
|
|
111
|
+
export const Interactivity: Story = {
|
|
112
|
+
args: {
|
|
113
|
+
action: {
|
|
114
|
+
label: 'Details about the subject.',
|
|
115
|
+
href: 'https://wise.com',
|
|
116
|
+
target: '_blank',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
argTypes: disableControls()(['action']),
|
|
120
|
+
render: (args: ListItemAdditionalInfoProps) => {
|
|
121
|
+
return (
|
|
122
|
+
<ol className="list-unstyled">
|
|
123
|
+
<ListItem
|
|
124
|
+
title="Fully interactive ListItem"
|
|
125
|
+
subtitle="Subtitle goes here"
|
|
126
|
+
media={MEDIA.avatarSingle}
|
|
127
|
+
control={CONTROLS.button}
|
|
128
|
+
additionalInfo={<ListItem.AdditionalInfo {...args} action={undefined} />}
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<ListItem
|
|
132
|
+
title="Partially interactive ListItem"
|
|
133
|
+
subtitle="Subtitle goes here"
|
|
134
|
+
media={MEDIA.avatarSingle}
|
|
135
|
+
control={CONTROLS.partialButton}
|
|
136
|
+
additionalInfo={<ListItem.AdditionalInfo {...args} />}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<ListItem
|
|
140
|
+
title="Non-interactive ListItem"
|
|
141
|
+
subtitle="Subtitle goes here"
|
|
142
|
+
media={MEDIA.avatarSingle}
|
|
143
|
+
additionalInfo={<ListItem.AdditionalInfo {...args} />}
|
|
144
|
+
/>
|
|
145
|
+
</ol>
|
|
146
|
+
);
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Interactive `ListItem.AdditionalInfo` allows for 2 types of actions: a link or a button.
|
|
152
|
+
*/
|
|
153
|
+
export const Actions: Story = {
|
|
154
|
+
argTypes: disableControls()(['action']),
|
|
155
|
+
render: (args: ListItemAdditionalInfoProps) => {
|
|
156
|
+
return (
|
|
157
|
+
<ol className="list-unstyled">
|
|
158
|
+
<ListItem
|
|
159
|
+
title="Partially interactive ListItem"
|
|
160
|
+
subtitle="Subtitle goes here"
|
|
161
|
+
media={MEDIA.avatarSingle}
|
|
162
|
+
control={CONTROLS.partialButton}
|
|
163
|
+
additionalInfo={
|
|
164
|
+
<ListItem.AdditionalInfo
|
|
165
|
+
{...args}
|
|
166
|
+
action={{
|
|
167
|
+
label: 'I am a link.',
|
|
168
|
+
href: 'https://wise.com',
|
|
169
|
+
target: '_blank',
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<ListItem
|
|
176
|
+
title="Partially interactive ListItem"
|
|
177
|
+
subtitle="Subtitle goes here"
|
|
178
|
+
media={MEDIA.avatarSingle}
|
|
179
|
+
control={CONTROLS.partialButton}
|
|
180
|
+
additionalInfo={
|
|
181
|
+
<ListItem.AdditionalInfo
|
|
182
|
+
{...args}
|
|
183
|
+
action={{
|
|
184
|
+
label: 'I am a button.',
|
|
185
|
+
onClick: () => {
|
|
186
|
+
action('Button clicked')();
|
|
187
|
+
},
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
}
|
|
191
|
+
/>
|
|
192
|
+
</ol>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PropsWithChildren, useContext } from 'react';
|
|
2
|
+
import { ListItemContext, type ListItemContextData } from '../ListItemContext';
|
|
3
|
+
import Body from '../../body';
|
|
4
|
+
import Link, { LinkProps } from '../../link';
|
|
5
|
+
import { Typography } from '../../common';
|
|
6
|
+
|
|
7
|
+
export type ListItemAdditionalInfoProps = PropsWithChildren<{
|
|
8
|
+
/**
|
|
9
|
+
* Props object to be passed to the [Link](https://storybook.wise.design/?path=/docs/typography-link--docs) component.
|
|
10
|
+
*/
|
|
11
|
+
action?: { label: string } & Pick<LinkProps, 'href' | 'onClick' | 'target'>;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export const AdditionalInfo = function ({ children, action }: ListItemAdditionalInfoProps) {
|
|
15
|
+
const { ids } = useContext<ListItemContextData>(ListItemContext);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Body
|
|
19
|
+
type={Typography.BODY_DEFAULT}
|
|
20
|
+
id={ids.additionalInfo}
|
|
21
|
+
className="wds-list-item-additional-info"
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
{action ? (
|
|
25
|
+
<>
|
|
26
|
+
{' '}
|
|
27
|
+
<Link href={action.href} target={action.target} onClick={action.onClick}>
|
|
28
|
+
{action.label}
|
|
29
|
+
</Link>
|
|
30
|
+
</>
|
|
31
|
+
) : null}
|
|
32
|
+
</Body>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
AdditionalInfo.displayName = 'ListItem.AdditionalInfo';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { mockMatchMedia, render, screen } from '../../test-utils';
|
|
2
|
+
import { ListItem, type Props as ListItemProps } from '../ListItem';
|
|
3
|
+
|
|
4
|
+
mockMatchMedia();
|
|
5
|
+
|
|
6
|
+
const avatars = [
|
|
7
|
+
{ imgSrc: 'avatar1.jpg', profileName: 'User 1' },
|
|
8
|
+
{ imgSrc: 'avatar2.jpg', profileName: 'User 2' },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const renderWithMedia = (media: ListItemProps['media']) =>
|
|
12
|
+
render(<ListItem title="Test Title" media={media} />);
|
|
13
|
+
|
|
14
|
+
describe('ListItem.AvatarLayout', () => {
|
|
15
|
+
it('applies custom className alongside default class', () => {
|
|
16
|
+
renderWithMedia(
|
|
17
|
+
<ListItem.AvatarLayout
|
|
18
|
+
className="custom-class"
|
|
19
|
+
role="group"
|
|
20
|
+
aria-label="Custom avatar group"
|
|
21
|
+
avatars={avatars}
|
|
22
|
+
/>,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
expect(screen.getByRole('group', { name: 'Custom avatar group' })).toHaveClass('custom-class');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('renders both avatars', () => {
|
|
29
|
+
renderWithMedia(<ListItem.AvatarLayout avatars={avatars} />);
|
|
30
|
+
|
|
31
|
+
const images = screen.getAllByRole('presentation');
|
|
32
|
+
expect(images).toHaveLength(avatars.length);
|
|
33
|
+
expect(images[0]).toHaveAttribute('src', avatars[0].imgSrc);
|
|
34
|
+
expect(images[1]).toHaveAttribute('src', avatars[1].imgSrc);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('renders with single avatar', () => {
|
|
38
|
+
renderWithMedia(<ListItem.AvatarLayout avatars={[avatars[0]]} />);
|
|
39
|
+
expect(screen.getByRole('presentation')).toHaveAttribute('src', avatars[0].imgSrc);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('handles empty avatars array', () => {
|
|
43
|
+
renderWithMedia(<ListItem.AvatarLayout avatars={[]} />);
|
|
44
|
+
expect(screen.queryByRole('img')).not.toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('supports accessibility props', () => {
|
|
48
|
+
renderWithMedia(<ListItem.AvatarLayout aria-label="User avatars" avatars={avatars} />);
|
|
49
|
+
expect(screen.getByLabelText('User avatars')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('passes through role', () => {
|
|
53
|
+
renderWithMedia(
|
|
54
|
+
<ListItem.AvatarLayout role="group" aria-label="Avatar group" avatars={avatars} />,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
expect(screen.getByRole('group', { name: 'Avatar group' })).toBeInTheDocument();
|
|
58
|
+
});
|
|
59
|
+
});
|