@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.
Files changed (319) hide show
  1. package/build/button/Button.js +1 -0
  2. package/build/button/Button.js.map +1 -1
  3. package/build/button/Button.mjs +1 -0
  4. package/build/button/Button.mjs.map +1 -1
  5. package/build/common/RadioButton/RadioButton.js +5 -2
  6. package/build/common/RadioButton/RadioButton.js.map +1 -1
  7. package/build/common/RadioButton/RadioButton.mjs +5 -2
  8. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  9. package/build/common/initials.js +1 -4
  10. package/build/common/initials.js.map +1 -1
  11. package/build/common/initials.mjs +1 -4
  12. package/build/common/initials.mjs.map +1 -1
  13. package/build/i18n/de.json +0 -2
  14. package/build/i18n/de.json.js +0 -2
  15. package/build/i18n/de.json.js.map +1 -1
  16. package/build/i18n/de.json.mjs +0 -2
  17. package/build/i18n/de.json.mjs.map +1 -1
  18. package/build/i18n/fr.json +0 -2
  19. package/build/i18n/fr.json.js +0 -2
  20. package/build/i18n/fr.json.js.map +1 -1
  21. package/build/i18n/fr.json.mjs +0 -2
  22. package/build/i18n/fr.json.mjs.map +1 -1
  23. package/build/i18n/hu.json +0 -2
  24. package/build/i18n/hu.json.js +0 -2
  25. package/build/i18n/hu.json.js.map +1 -1
  26. package/build/i18n/hu.json.mjs +0 -2
  27. package/build/i18n/hu.json.mjs.map +1 -1
  28. package/build/i18n/it.json +0 -2
  29. package/build/i18n/it.json.js +0 -2
  30. package/build/i18n/it.json.js.map +1 -1
  31. package/build/i18n/it.json.mjs +0 -2
  32. package/build/i18n/it.json.mjs.map +1 -1
  33. package/build/i18n/ja.json +0 -2
  34. package/build/i18n/ja.json.js +0 -2
  35. package/build/i18n/ja.json.js.map +1 -1
  36. package/build/i18n/ja.json.mjs +0 -2
  37. package/build/i18n/ja.json.mjs.map +1 -1
  38. package/build/i18n/pl.json +0 -2
  39. package/build/i18n/pl.json.js +0 -2
  40. package/build/i18n/pl.json.js.map +1 -1
  41. package/build/i18n/pl.json.mjs +0 -2
  42. package/build/i18n/pl.json.mjs.map +1 -1
  43. package/build/i18n/ro.json +0 -2
  44. package/build/i18n/ro.json.js +0 -2
  45. package/build/i18n/ro.json.js.map +1 -1
  46. package/build/i18n/ro.json.mjs +0 -2
  47. package/build/i18n/ro.json.mjs.map +1 -1
  48. package/build/i18n/ru.json +0 -2
  49. package/build/i18n/ru.json.js +0 -2
  50. package/build/i18n/ru.json.js.map +1 -1
  51. package/build/i18n/ru.json.mjs +0 -2
  52. package/build/i18n/ru.json.mjs.map +1 -1
  53. package/build/i18n/tr.json +0 -2
  54. package/build/i18n/tr.json.js +0 -2
  55. package/build/i18n/tr.json.js.map +1 -1
  56. package/build/i18n/tr.json.mjs +0 -2
  57. package/build/i18n/tr.json.mjs.map +1 -1
  58. package/build/i18n/zh-CN.json +0 -2
  59. package/build/i18n/zh-CN.json.js +0 -2
  60. package/build/i18n/zh-CN.json.js.map +1 -1
  61. package/build/i18n/zh-CN.json.mjs +0 -2
  62. package/build/i18n/zh-CN.json.mjs.map +1 -1
  63. package/build/i18n/zh-HK.json +0 -2
  64. package/build/i18n/zh-HK.json.js +0 -2
  65. package/build/i18n/zh-HK.json.js.map +1 -1
  66. package/build/i18n/zh-HK.json.mjs +0 -2
  67. package/build/i18n/zh-HK.json.mjs.map +1 -1
  68. package/build/iconButton/IconButton.js.map +1 -1
  69. package/build/iconButton/IconButton.mjs.map +1 -1
  70. package/build/image/Image.js.map +1 -1
  71. package/build/image/Image.mjs.map +1 -1
  72. package/build/index.js +2 -0
  73. package/build/index.js.map +1 -1
  74. package/build/index.mjs +1 -0
  75. package/build/index.mjs.map +1 -1
  76. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +56 -0
  77. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -0
  78. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +54 -0
  79. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -0
  80. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +23 -0
  81. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -0
  82. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +21 -0
  83. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -0
  84. package/build/listItem/AvatarView/ListItemAvatarView.js +23 -0
  85. package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -0
  86. package/build/listItem/AvatarView/ListItemAvatarView.mjs +21 -0
  87. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -0
  88. package/build/listItem/Button/ListItemButton.js +43 -0
  89. package/build/listItem/Button/ListItemButton.js.map +1 -0
  90. package/build/listItem/Button/ListItemButton.mjs +41 -0
  91. package/build/listItem/Button/ListItemButton.mjs.map +1 -0
  92. package/build/listItem/Checkbox/ListItemCheckbox.js +30 -0
  93. package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -0
  94. package/build/listItem/Checkbox/ListItemCheckbox.mjs +28 -0
  95. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -0
  96. package/build/listItem/IconButton/ListItemIconButton.js +42 -0
  97. package/build/listItem/IconButton/ListItemIconButton.js.map +1 -0
  98. package/build/listItem/IconButton/ListItemIconButton.mjs +40 -0
  99. package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -0
  100. package/build/listItem/Image/ListItemImage.js +31 -0
  101. package/build/listItem/Image/ListItemImage.js.map +1 -0
  102. package/build/listItem/Image/ListItemImage.mjs +29 -0
  103. package/build/listItem/Image/ListItemImage.mjs.map +1 -0
  104. package/build/listItem/ListItem.js +312 -0
  105. package/build/listItem/ListItem.js.map +1 -0
  106. package/build/listItem/ListItem.mjs +307 -0
  107. package/build/listItem/ListItem.mjs.map +1 -0
  108. package/build/listItem/ListItemContext.js +8 -0
  109. package/build/listItem/ListItemContext.js.map +1 -0
  110. package/build/listItem/ListItemContext.mjs +6 -0
  111. package/build/listItem/ListItemContext.mjs.map +1 -0
  112. package/build/listItem/Navigation/ListItemNavigation.js +45 -0
  113. package/build/listItem/Navigation/ListItemNavigation.js.map +1 -0
  114. package/build/listItem/Navigation/ListItemNavigation.mjs +43 -0
  115. package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -0
  116. package/build/listItem/Prompt/ListItemPrompt.js +59 -0
  117. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -0
  118. package/build/listItem/Prompt/ListItemPrompt.mjs +54 -0
  119. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -0
  120. package/build/listItem/Radio/ListItemRadio.js +30 -0
  121. package/build/listItem/Radio/ListItemRadio.js.map +1 -0
  122. package/build/listItem/Radio/ListItemRadio.mjs +28 -0
  123. package/build/listItem/Radio/ListItemRadio.mjs.map +1 -0
  124. package/build/listItem/Switch/ListItemSwitch.js +30 -0
  125. package/build/listItem/Switch/ListItemSwitch.js.map +1 -0
  126. package/build/listItem/Switch/ListItemSwitch.mjs +28 -0
  127. package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -0
  128. package/build/listItem/useListItemControl.js +22 -0
  129. package/build/listItem/useListItemControl.js.map +1 -0
  130. package/build/listItem/useListItemControl.mjs +20 -0
  131. package/build/listItem/useListItemControl.mjs.map +1 -0
  132. package/build/listItem/useListItemMedia.js +21 -0
  133. package/build/listItem/useListItemMedia.js.map +1 -0
  134. package/build/listItem/useListItemMedia.mjs +19 -0
  135. package/build/listItem/useListItemMedia.mjs.map +1 -0
  136. package/build/main.css +773 -1
  137. package/build/styles/avatarView/AvatarView.css +3 -1
  138. package/build/styles/listItem/ListItem.css +770 -0
  139. package/build/styles/listItem/ListItem.grid.css +370 -0
  140. package/build/styles/main.css +773 -1
  141. package/build/switch/Switch.js +2 -0
  142. package/build/switch/Switch.js.map +1 -1
  143. package/build/switch/Switch.mjs +2 -0
  144. package/build/switch/Switch.mjs.map +1 -1
  145. package/build/test-utils/assets/placeholder-landscape.svg +1 -0
  146. package/build/test-utils/assets/placeholder-portrait.svg +1 -0
  147. package/build/types/button/Button.d.ts.map +1 -1
  148. package/build/types/button/Button.types.d.ts +1 -1
  149. package/build/types/button/Button.types.d.ts.map +1 -1
  150. package/build/types/button/index.d.ts +1 -1
  151. package/build/types/button/index.d.ts.map +1 -1
  152. package/build/types/common/RadioButton/RadioButton.d.ts +3 -1
  153. package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
  154. package/build/types/common/initials.d.ts.map +1 -1
  155. package/build/types/iconButton/IconButton.d.ts +2 -2
  156. package/build/types/iconButton/IconButton.d.ts.map +1 -1
  157. package/build/types/image/Image.d.ts +3 -0
  158. package/build/types/image/Image.d.ts.map +1 -1
  159. package/build/types/image/index.d.ts +1 -0
  160. package/build/types/image/index.d.ts.map +1 -1
  161. package/build/types/index.d.ts +2 -0
  162. package/build/types/index.d.ts.map +1 -1
  163. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +15 -0
  164. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +1 -0
  165. package/build/types/listItem/AdditionalInfo/index.d.ts +3 -0
  166. package/build/types/listItem/AdditionalInfo/index.d.ts.map +1 -0
  167. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +18 -0
  168. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -0
  169. package/build/types/listItem/AvatarLayout/index.d.ts +3 -0
  170. package/build/types/listItem/AvatarLayout/index.d.ts.map +1 -0
  171. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +16 -0
  172. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -0
  173. package/build/types/listItem/AvatarView/index.d.ts +3 -0
  174. package/build/types/listItem/AvatarView/index.d.ts.map +1 -0
  175. package/build/types/listItem/Button/ListItemButton.d.ts +20 -0
  176. package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -0
  177. package/build/types/listItem/Button/index.d.ts +3 -0
  178. package/build/types/listItem/Button/index.d.ts.map +1 -0
  179. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +14 -0
  180. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +1 -0
  181. package/build/types/listItem/Checkbox/index.d.ts +3 -0
  182. package/build/types/listItem/Checkbox/index.d.ts.map +1 -0
  183. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +18 -0
  184. package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -0
  185. package/build/types/listItem/IconButton/index.d.ts +3 -0
  186. package/build/types/listItem/IconButton/index.d.ts.map +1 -0
  187. package/build/types/listItem/Image/ListItemImage.d.ts +25 -0
  188. package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -0
  189. package/build/types/listItem/Image/index.d.ts +3 -0
  190. package/build/types/listItem/Image/index.d.ts.map +1 -0
  191. package/build/types/listItem/ListItem.d.ts +113 -0
  192. package/build/types/listItem/ListItem.d.ts.map +1 -0
  193. package/build/types/listItem/ListItemContext.d.ts +22 -0
  194. package/build/types/listItem/ListItemContext.d.ts.map +1 -0
  195. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +15 -0
  196. package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -0
  197. package/build/types/listItem/Navigation/index.d.ts +3 -0
  198. package/build/types/listItem/Navigation/index.d.ts.map +1 -0
  199. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +16 -0
  200. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -0
  201. package/build/types/listItem/Prompt/index.d.ts +3 -0
  202. package/build/types/listItem/Prompt/index.d.ts.map +1 -0
  203. package/build/types/listItem/Radio/ListItemRadio.d.ts +14 -0
  204. package/build/types/listItem/Radio/ListItemRadio.d.ts.map +1 -0
  205. package/build/types/listItem/Radio/index.d.ts +3 -0
  206. package/build/types/listItem/Radio/index.d.ts.map +1 -0
  207. package/build/types/listItem/Switch/ListItemSwitch.d.ts +14 -0
  208. package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +1 -0
  209. package/build/types/listItem/Switch/index.d.ts +3 -0
  210. package/build/types/listItem/Switch/index.d.ts.map +1 -0
  211. package/build/types/listItem/_stories/helpers.d.ts +27 -0
  212. package/build/types/listItem/_stories/helpers.d.ts.map +1 -0
  213. package/build/types/listItem/_stories/subcomponents.d.ts +18 -0
  214. package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -0
  215. package/build/types/listItem/index.d.ts +14 -0
  216. package/build/types/listItem/index.d.ts.map +1 -0
  217. package/build/types/listItem/test-utils.d.ts +7 -0
  218. package/build/types/listItem/test-utils.d.ts.map +1 -0
  219. package/build/types/listItem/useListItemControl.d.ts +5 -0
  220. package/build/types/listItem/useListItemControl.d.ts.map +1 -0
  221. package/build/types/listItem/useListItemMedia.d.ts +6 -0
  222. package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
  223. package/build/types/switch/Switch.d.ts +3 -1
  224. package/build/types/switch/Switch.d.ts.map +1 -1
  225. package/package.json +4 -4
  226. package/src/avatarView/AvatarView.css +3 -1
  227. package/src/avatarView/AvatarView.less +2 -1
  228. package/src/button/Button.spec.tsx +18 -0
  229. package/src/button/Button.tsx +5 -1
  230. package/src/button/Button.types.ts +1 -1
  231. package/src/button/index.ts +1 -1
  232. package/src/checkboxButton/CheckboxButton.story.tsx +4 -4
  233. package/src/common/RadioButton/RadioButton.tsx +6 -1
  234. package/src/common/initials.spec.tsx +0 -13
  235. package/src/common/initials.ts +0 -5
  236. package/src/i18n/de.json +0 -2
  237. package/src/i18n/fr.json +0 -2
  238. package/src/i18n/hu.json +0 -2
  239. package/src/i18n/it.json +0 -2
  240. package/src/i18n/ja.json +0 -2
  241. package/src/i18n/pl.json +0 -2
  242. package/src/i18n/ro.json +0 -2
  243. package/src/i18n/ru.json +0 -2
  244. package/src/i18n/tr.json +0 -2
  245. package/src/i18n/zh-CN.json +0 -2
  246. package/src/i18n/zh-HK.json +0 -2
  247. package/src/iconButton/IconButton.story.tsx +1 -1
  248. package/src/iconButton/IconButton.tsx +1 -1
  249. package/src/image/Image.tsx +3 -0
  250. package/src/image/index.ts +1 -0
  251. package/src/index.ts +2 -0
  252. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +56 -0
  253. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +195 -0
  254. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +36 -0
  255. package/src/listItem/AdditionalInfo/index.ts +2 -0
  256. package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +59 -0
  257. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +121 -0
  258. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +27 -0
  259. package/src/listItem/AvatarLayout/index.ts +2 -0
  260. package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +75 -0
  261. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +336 -0
  262. package/src/listItem/AvatarView/ListItemAvatarView.tsx +27 -0
  263. package/src/listItem/AvatarView/index.ts +2 -0
  264. package/src/listItem/Button/ListItemButton.spec.tsx +68 -0
  265. package/src/listItem/Button/ListItemButton.story.tsx +466 -0
  266. package/src/listItem/Button/ListItemButton.tsx +56 -0
  267. package/src/listItem/Button/index.ts +2 -0
  268. package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +82 -0
  269. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +125 -0
  270. package/src/listItem/Checkbox/ListItemCheckbox.tsx +33 -0
  271. package/src/listItem/Checkbox/index.ts +2 -0
  272. package/src/listItem/IconButton/ListItemIconButton.spec.tsx +119 -0
  273. package/src/listItem/IconButton/ListItemIconButton.story.tsx +249 -0
  274. package/src/listItem/IconButton/ListItemIconButton.tsx +56 -0
  275. package/src/listItem/IconButton/index.ts +2 -0
  276. package/src/listItem/Image/ListItemImage.spec.tsx +30 -0
  277. package/src/listItem/Image/ListItemImage.story.tsx +77 -0
  278. package/src/listItem/Image/ListItemImage.tsx +48 -0
  279. package/src/listItem/Image/index.ts +2 -0
  280. package/src/listItem/ListItem.css +770 -0
  281. package/src/listItem/ListItem.grid.css +370 -0
  282. package/src/listItem/ListItem.grid.less +622 -0
  283. package/src/listItem/ListItem.less +421 -0
  284. package/src/listItem/ListItem.spec.tsx +1496 -0
  285. package/src/listItem/ListItem.tsx +447 -0
  286. package/src/listItem/ListItemContext.tsx +27 -0
  287. package/src/listItem/Navigation/ListItemNavigation.spec.tsx +59 -0
  288. package/src/listItem/Navigation/ListItemNavigation.story.tsx +109 -0
  289. package/src/listItem/Navigation/ListItemNavigation.tsx +40 -0
  290. package/src/listItem/Navigation/index.ts +2 -0
  291. package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
  292. package/src/listItem/Prompt/ListItemPrompt.story.tsx +201 -0
  293. package/src/listItem/Prompt/ListItemPrompt.tsx +32 -0
  294. package/src/listItem/Prompt/index.ts +2 -0
  295. package/src/listItem/Radio/ListItemRadio.spec.tsx +66 -0
  296. package/src/listItem/Radio/ListItemRadio.story.tsx +108 -0
  297. package/src/listItem/Radio/ListItemRadio.tsx +33 -0
  298. package/src/listItem/Radio/index.ts +2 -0
  299. package/src/listItem/Switch/ListItemSwitch.spec.tsx +47 -0
  300. package/src/listItem/Switch/ListItemSwitch.story.tsx +77 -0
  301. package/src/listItem/Switch/ListItemSwitch.tsx +33 -0
  302. package/src/listItem/Switch/index.ts +2 -0
  303. package/src/listItem/_stories/ListItem.focus.test.story.tsx +250 -0
  304. package/src/listItem/_stories/ListItem.layout.test.story.tsx +353 -0
  305. package/src/listItem/_stories/ListItem.scenarios.story.tsx +209 -0
  306. package/src/listItem/_stories/ListItem.story.tsx +772 -0
  307. package/src/listItem/_stories/ListItem.variants.test.story.tsx +271 -0
  308. package/src/listItem/_stories/helpers.tsx +53 -0
  309. package/src/listItem/_stories/subcomponents.tsx +139 -0
  310. package/src/listItem/index.ts +14 -0
  311. package/src/listItem/test-utils.tsx +33 -0
  312. package/src/listItem/useListItemControl.tsx +18 -0
  313. package/src/listItem/useListItemMedia.tsx +13 -0
  314. package/src/main.css +773 -1
  315. package/src/main.less +1 -0
  316. package/src/switch/Switch.tsx +5 -1
  317. package/src/test-utils/assets/placeholder-landscape.svg +1 -0
  318. package/src/test-utils/assets/placeholder-portrait.svg +1 -0
  319. package/src/test-utils/Parameters.d.ts +0 -77
@@ -0,0 +1,113 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ListItemIconButtonProps } from './IconButton';
3
+ import { type ListItemCheckboxProps } from './Checkbox';
4
+ import { type ListItemNavigationProps } from './Navigation';
5
+ import { type ListItemButtonProps } from './Button';
6
+ import { type ListItemRadioProps } from './Radio';
7
+ import { type ListItemSwitchProps } from './Switch';
8
+ export type ListItemTypes = 'non-interactive' | 'navigation' | 'radio' | 'checkbox' | 'switch' | 'button' | 'icon-button';
9
+ export type ListItemControlProps = ListItemNavigationProps | ListItemCheckboxProps | ListItemButtonProps | ListItemIconButtonProps | ListItemRadioProps | ListItemSwitchProps;
10
+ export type Props = {
11
+ as?: 'li' | 'div';
12
+ /**
13
+ * Swaps vertical hierarchy of title and subtitle and their corresponding right values.
14
+ */
15
+ inverted?: boolean;
16
+ disabled?: boolean;
17
+ /**
18
+ * Highlights the list item as an action to be taken or already taken. <br />
19
+ */
20
+ spotlight?: 'active' | 'inactive';
21
+ title: ReactNode;
22
+ subtitle?: ReactNode;
23
+ /**
24
+ * Requires `<ListItem.AdditionalInfo />` component as a sole child. <br />
25
+ * Can be only rendered if `subtitle` is also provided.
26
+ */
27
+ additionalInfo?: ReactNode;
28
+ valueTitle?: ReactNode;
29
+ valueSubtitle?: ReactNode;
30
+ /**
31
+ * Requires one of the following as a sole child: <br />
32
+ * `<ListItem.AvatarView />`,
33
+ * `<ListItem.AvatarLayout />` or
34
+ * `<ListItem.Image />`
35
+ */
36
+ media?: ReactNode;
37
+ /**
38
+ * Requires one of the following as a sole child: <br/>
39
+ * `<ListItem.Button />`, <br/>
40
+ * `<ListItem.Checkbox />`, <br/>
41
+ * `<ListItem.IconButton />`, <br/>
42
+ * `<ListItem.Navigation />`, <br/>
43
+ * `<ListItem.Radio />`, or
44
+ * `<ListItem.Switch />`
45
+ */
46
+ control?: ReactNode;
47
+ /**
48
+ * Requires `<ListItem.Prompt />` component as a sole child.
49
+ */
50
+ prompt?: ReactNode;
51
+ className?: string;
52
+ /**
53
+ * A number between `0–100` which resolves to a `fr` value of a `grid-template-columns` declaration. E.g. `valueColumnWidth={25}` will result in a `75fr 25fr`. <br />
54
+ * Controls the width ratio of left side content (title and subtitle) to the right side content.
55
+ */
56
+ valueColumnWidth?: number;
57
+ id?: string;
58
+ role?: string;
59
+ 'aria-labelledby'?: string;
60
+ };
61
+ /**
62
+ * @see [Design documentation](https://wise.design/components/list-item)
63
+ * @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)
64
+ */
65
+ export declare const ListItem: {
66
+ ({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, className, valueColumnWidth, role, id, "aria-labelledby": ariaLabelledby, }: Props): import("react").JSX.Element;
67
+ Image: {
68
+ ({ alt, size, className, ...props }: import("./Image").ListItemImageProps): import("react").JSX.Element;
69
+ displayName: string;
70
+ };
71
+ AvatarView: {
72
+ ({ className, size, ...props }: import("./AvatarView").ListItemAvatarViewProps): import("react").JSX.Element;
73
+ displayName: string;
74
+ };
75
+ AvatarLayout: {
76
+ ({ className, size, ...props }: import("./AvatarLayout").ListItemAvatarLayoutProps): import("react").JSX.Element;
77
+ displayName: string;
78
+ };
79
+ AdditionalInfo: {
80
+ ({ children, action }: import("./AdditionalInfo").ListItemAdditionalInfoProps): import("react").JSX.Element;
81
+ displayName: string;
82
+ };
83
+ Checkbox: {
84
+ (props: ListItemCheckboxProps): import("react").JSX.Element;
85
+ displayName: string;
86
+ };
87
+ Radio: {
88
+ (props: ListItemRadioProps): import("react").JSX.Element;
89
+ displayName: string;
90
+ };
91
+ IconButton: {
92
+ ({ priority, ...props }: ListItemIconButtonProps): import("react").JSX.Element;
93
+ displayName: string;
94
+ };
95
+ Navigation: {
96
+ ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
97
+ displayName: string;
98
+ };
99
+ Button: {
100
+ ({ priority, partiallyInteractive, ...props }: ListItemButtonProps): import("react").JSX.Element;
101
+ displayName: string;
102
+ };
103
+ Switch: {
104
+ (props: ListItemSwitchProps): import("react").JSX.Element;
105
+ displayName: string;
106
+ };
107
+ Prompt: {
108
+ ({ sentiment, children }: import("./Prompt").ListItemPromptProps): import("react").JSX.Element;
109
+ displayName: string;
110
+ };
111
+ };
112
+ export default ListItem;
113
+ //# sourceMappingURL=ListItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAY,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAS,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAY5D,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,YAAY,GACZ,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;4NAkBlB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkOP,CAAC;AAkGF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';
2
+ import type { ListItemAvatarViewProps } from './AvatarView';
3
+ export type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;
4
+ export type ListItemContextData = {
5
+ setControlType: (type: ListItemTypes) => void;
6
+ setControlProps: (props: ListItemControlProps) => void;
7
+ setMediaSize: (size: ListItemMediaSize | undefined) => void;
8
+ ids: {
9
+ title: string;
10
+ subtitle?: string;
11
+ valueTitle?: string;
12
+ valueSubtitle?: string;
13
+ additionalInfo?: string;
14
+ control: string;
15
+ prompt?: string;
16
+ };
17
+ props: Pick<ListItemProps, 'disabled' | 'inverted'>;
18
+ mediaSize?: ListItemAvatarViewProps['size'];
19
+ describedByIds: string;
20
+ };
21
+ export declare const ListItemContext: import("react").Context<ListItemContextData>;
22
+ //# sourceMappingURL=ListItemContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemContext.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,8CAE3B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ButtonProps } from '../../button/Button.types';
2
+ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;
3
+ /**
4
+ * This component allows for rendering a control functionally synonymous with HTML `anchor` or a
5
+ * `button`, giving users a rich way to choose between options and navigate to another screen or
6
+ * step in a flow. It offers only a subset of features of the HTML element in line with the
7
+ * ListItem's constraints.<br />
8
+ * <br />
9
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.
10
+ */
11
+ export declare const Navigation: {
12
+ ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
13
+ displayName: string;
14
+ };
15
+ //# sourceMappingURL=ListItemNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM7D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;yBAAiD,uBAAuB;;CAoB9F,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemNavigationProps } from './ListItemNavigation';
2
+ export { Navigation } from './ListItemNavigation';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Sentiment } from '../../common';
2
+ export type ListItemPromptProps = {
3
+ sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
4
+ children: React.ReactNode;
5
+ };
6
+ /**
7
+ * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />
8
+ *
9
+ * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.
10
+ */
11
+ export declare const Prompt: {
12
+ ({ sentiment, children }: ListItemPromptProps): import("react").JSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default Prompt;
16
+ //# sourceMappingURL=ListItemPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemPrompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/ListItemPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM;8BAAiD,mBAAmB;;CAWtF,CAAC;AAGF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemPromptProps } from './ListItemPrompt';
2
+ export { Prompt } from './ListItemPrompt';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type RadioButtonProps } from '../../common/RadioButton/RadioButton';
2
+ export type ListItemRadioProps = Omit<RadioButtonProps, 'disabled' | 'readOnly' | 'className' | 'id'>;
3
+ /**
4
+ * This component allows for rendering a Button control. It's a thin wrapper around the
5
+ * [Button component](https://storybook.wise.design/?path=/docs/content-button--docs), but offers only
6
+ * a subset of its features in line with the ListItem's constraints. <br />
7
+ * <br />
8
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.
9
+ */
10
+ export declare const Radio: {
11
+ (props: ListItemRadioProps): import("react").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //# sourceMappingURL=ListItemRadio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemRadio.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/ListItemRadio.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAI1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EAChB,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;YAAoB,kBAAkB;;CAavD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemRadioProps } from './ListItemRadio';
2
+ export { Radio } from './ListItemRadio';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type SwitchProps } from '../../switch';
2
+ export type ListItemSwitchProps = Omit<SwitchProps, 'disabled' | 'id' | 'aria-labelledby' | 'aria-label'>;
3
+ /**
4
+ * This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the
5
+ * [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),
6
+ * but offers only a subset of its features in line with the ListItem's constraints. <br />
7
+ *
8
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.
9
+ */
10
+ export declare const Switch: {
11
+ (props: ListItemSwitchProps): import("react").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //# sourceMappingURL=ListItemSwitch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSwitch.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/ListItemSwitch.tsx"],"names":[],"mappings":"AACA,OAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAI5D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,WAAW,EACX,UAAU,GAAG,IAAI,GAAG,iBAAiB,GAAG,YAAY,CACrD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;YAAoB,mBAAmB;;CAazD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemSwitchProps } from './ListItemSwitch';
2
+ export { Switch } from './ListItemSwitch';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { StoryObj, type Decorator } from '@storybook/react-webpack5';
2
+ import type { Props as ItemProps } from '../ListItem';
3
+ type Story = StoryObj<ItemProps>;
4
+ /**
5
+ * Recent storybook versions render the full source including all story parameters which
6
+ * creates noise, this simple workaround only shows the render function.
7
+ * This is a workaround for the issue.
8
+ * @see https://github.com/storybookjs/storybook/issues/22281
9
+ */
10
+ export declare const storySourceWithoutNoise: (config: Story) => Story;
11
+ /**
12
+ * In order to make preview controls work correctly, we have to refresh the render
13
+ * by swapping the `key`. This is a workaround for the Storybook's limitation.
14
+ */
15
+ export declare const withoutKey: Decorator;
16
+ /**
17
+ * Not all stories need access to all controls as it causes unnecessary UI noise.
18
+ */
19
+ export declare const disableControls: (hiddenByDefault?: string[]) => (hiddenForStory?: string[]) => {
20
+ [k: string]: {
21
+ table: {
22
+ disable: boolean;
23
+ };
24
+ };
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,KAAG,KAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAExB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GACzB,kBAAiB,MAAM,EAAO,MAC9B,iBAAgB,MAAM,EAAO;;;;;;CAG7B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export type SB_ListItem_ControlType = 'button' | 'buttonAsLink' | 'partialButton' | 'partialButtonAsLink' | 'iconButton' | 'iconButtonAsLink' | 'iconButtonWithLabel' | 'iconButtonAsLinkWithLabel' | 'partialIconButton' | 'partialIconButtonAsLink' | 'partialIconButtonWithLabel' | 'partialIconButtonAsLinkWithLabel' | 'navigation' | 'navigationAsButton' | 'checkbox' | 'radio' | 'switch';
3
+ export declare const SB_LIST_ITEM_CONTROLS: Record<SB_ListItem_ControlType, ReactNode>;
4
+ export declare const SB_LIST_ITEM_ADDITIONAL_INFO: {
5
+ readonly interactive: import("react").JSX.Element;
6
+ readonly nonInteractive: import("react").JSX.Element;
7
+ };
8
+ export declare const SB_LIST_ITEM_PROMPTS: {
9
+ readonly interactive: import("react").JSX.Element;
10
+ readonly nonInteractive: import("react").JSX.Element;
11
+ };
12
+ export declare const SB_LIST_ITEM_MEDIA: {
13
+ readonly image: import("react").JSX.Element;
14
+ readonly avatarSingle: import("react").JSX.Element;
15
+ readonly avatarDouble: import("react").JSX.Element;
16
+ readonly avatarDiagonal: import("react").JSX.Element;
17
+ };
18
+ //# sourceMappingURL=subcomponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/subcomponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,cAAc,GACd,eAAe,GACf,qBAAqB,GACrB,YAAY,GACZ,kBAAkB,GAClB,qBAAqB,GACrB,2BAA2B,GAC3B,mBAAmB,GACnB,yBAAyB,GACzB,4BAA4B,GAC5B,kCAAkC,GAClC,YAAY,GACZ,oBAAoB,GACpB,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,EAAE,SAAS,CA0DnE,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;CAe/B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;CAavB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAoBrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type { Props as ListItemProps } from './ListItem';
2
+ export type { ListItemAdditionalInfoProps } from './AdditionalInfo';
3
+ export type { ListItemAvatarLayoutProps } from './AvatarLayout';
4
+ export type { ListItemAvatarViewProps } from './AvatarView';
5
+ export type { ListItemButtonProps } from './Button';
6
+ export type { ListItemCheckboxProps } from './Checkbox';
7
+ export type { ListItemIconButtonProps } from './IconButton';
8
+ export type { ListItemImageProps } from './Image';
9
+ export type { ListItemNavigationProps } from './Navigation';
10
+ export type { ListItemPromptProps } from './Prompt';
11
+ export type { ListItemRadioProps } from './Radio';
12
+ export type { ListItemSwitchProps } from './Switch';
13
+ export { default } from './ListItem';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type RenderResult } from '../test-utils';
2
+ export declare const mockSetControlType: jest.Mock<any, any, any>;
3
+ export declare const mockSetControlProps: jest.Mock<any, any, any>;
4
+ export declare const mockSetMediaSize: jest.Mock<any, any, any>;
5
+ export declare const renderWithListItemContext: (ui: React.ReactNode) => RenderResult;
6
+ export declare const clearListItemMocks: () => void;
7
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/listItem/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAG1D,eAAO,MAAM,kBAAkB,0BAAY,CAAC;AAC5C,eAAO,MAAM,mBAAmB,0BAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,0BAAY,CAAC;AAE1C,eAAO,MAAM,yBAAyB,GAAI,IAAI,KAAK,CAAC,SAAS,KAAG,YAqB/D,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAE9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ListItemTypes, ListItemControlProps } from './ListItem';
2
+ export declare function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps): {
3
+ baseItemProps: Pick<import("./ListItem").Props, "disabled" | "inverted">;
4
+ };
5
+ //# sourceMappingURL=useListItemControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListItemControl.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB;;EAahG"}
@@ -0,0 +1,6 @@
1
+ import type { ListItemAvatarViewProps } from './AvatarView';
2
+ export declare function useListItemMedia(size?: ListItemAvatarViewProps['size']): {
3
+ mediaSize: 32 | 40 | 48 | 56 | 72 | undefined;
4
+ setMediaSize: (size: import("./ListItemContext").ListItemMediaSize | undefined) => void;
5
+ };
6
+ //# sourceMappingURL=useListItemMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListItemMedia.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemMedia.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC;;;EAQtE"}
@@ -8,13 +8,15 @@ export type SwitchProps = CommonProps & {
8
8
  'aria-label'?: string;
9
9
  /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */
10
10
  'aria-labelledby'?: string;
11
+ /** Identifies the element(s) that describes the element on which the attribute is set */
12
+ 'aria-describedby'?: string;
11
13
  /** Whether the switch is checked or not */
12
14
  checked?: boolean;
13
15
  disabled?: boolean;
14
16
  /** ID to apply to the switch container */
15
17
  id?: string;
16
18
  /** Function called when the switch is toggled */
17
- onClick: (event?: MouseEvent<HTMLSpanElement>) => void;
19
+ onClick: (event?: MouseEvent<HTMLButtonElement>) => void;
18
20
  };
19
21
  declare const Switch: (props: SwitchProps) => import("react").JSX.Element;
20
22
  export default Switch;
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,QAAA,MAAM,MAAM,GAAI,OAAO,WAAW,gCAwCjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,QAAA,MAAM,MAAM,GAAI,OAAO,WAAW,gCA0CjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-29d0f94",
3
+ "version": "0.0.0-experimental-4b1de0a",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -83,10 +83,10 @@
83
83
  "storybook": "^9.0.18",
84
84
  "storybook-addon-tag-badges": "^2.0.1",
85
85
  "storybook-addon-test-codegen": "^2.0.1",
86
- "@transferwise/less-config": "3.1.2",
87
86
  "@transferwise/neptune-css": "14.24.5",
88
- "@wise/wds-configs": "0.0.0",
89
- "@wise/components-theming": "1.6.4"
87
+ "@transferwise/less-config": "3.1.2",
88
+ "@wise/components-theming": "1.6.4",
89
+ "@wise/wds-configs": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/icons": "^3.22.3",
@@ -19,7 +19,8 @@
19
19
  right: 0;
20
20
  }
21
21
  .np-avatar-view .np-avatar-view-content {
22
- color: var(--color-interactive-primary);
22
+ color: #37517e;
23
+ color: var(--color-content-primary);
23
24
  }
24
25
  .np-avatar-view-interactive {
25
26
  cursor: pointer;
@@ -27,6 +28,7 @@
27
28
  .np-avatar-view-interactive .np-circle {
28
29
  background-color: rgba(134,167,189,0.10196);
29
30
  background-color: var(--color-background-neutral);
31
+ color: var(--color-interactive-primary);
30
32
  }
31
33
  .np-avatar-view-non-interactive .np-circle {
32
34
  background-color: transparent;
@@ -2,13 +2,14 @@
2
2
 
3
3
  .np-avatar-view {
4
4
  .np-avatar-view-content {
5
- color: var(--color-interactive-primary);
5
+ color: var(--color-content-primary);
6
6
  }
7
7
 
8
8
  &-interactive {
9
9
  cursor: pointer;
10
10
  .np-circle {
11
11
  background-color: var(--color-background-neutral);
12
+ color: var(--color-interactive-primary);
12
13
  }
13
14
  }
14
15
 
@@ -202,6 +202,24 @@ describe('Button', () => {
202
202
  expect(button).not.toHaveAttribute('href');
203
203
  });
204
204
  });
205
+
206
+ describe('content id', () => {
207
+ it('should not set id for content by default', () => {
208
+ const { container } = render(<Button v2>clickMe</Button>);
209
+
210
+ expect(container.querySelector('[id$="_content"]')).not.toBeInTheDocument();
211
+ });
212
+
213
+ it('should set id for content by default if `id` is passed as a button prop', () => {
214
+ const { container } = render(
215
+ <Button v2 id="myId">
216
+ clickMe
217
+ </Button>,
218
+ );
219
+
220
+ expect(container.querySelector('#myId_content')).toBeInTheDocument();
221
+ });
222
+ });
205
223
  });
206
224
  });
207
225
  });
@@ -62,7 +62,11 @@ const Button = forwardRef<ButtonReferenceType, NewButtonProps>(
62
62
  data-testid="button-loader-indicator"
63
63
  />
64
64
  )}
65
- <span className="wds-Button-label" aria-hidden={loading}>
65
+ <span
66
+ className="wds-Button-label"
67
+ id={props.id ? `${props.id}_content` : undefined}
68
+ aria-hidden={loading}
69
+ >
66
70
  {size === 'lg' ? (
67
71
  <span className="wds-Button-labelText">{children}</span>
68
72
  ) : (
@@ -5,7 +5,7 @@ export type ButtonSentiment = 'default' | 'negative';
5
5
  export type ButtonPriority = 'primary' | 'secondary' | 'secondary-neutral' | 'tertiary';
6
6
  export type ButtonSize = 'sm' | 'md' | 'lg';
7
7
  export type ButtonReferenceType = HTMLButtonElement | HTMLAnchorElement;
8
- type ButtonAddonIcon = {
8
+ export type ButtonAddonIcon = {
9
9
  type: 'icon';
10
10
  value: ReactNode;
11
11
  };
@@ -1,5 +1,5 @@
1
1
  export { default } from './Button.resolver';
2
- export type { ButtonProps as NewButtonProps } from './Button.types';
2
+ export type { ButtonProps as NewButtonProps, ButtonAddonIcon } from './Button.types';
3
3
 
4
4
  // export legacy button props for backwards compatibility with legacy Button interface
5
5
  // delete this when migration to new Button is done (or aleast no more deep imports, use following query)
@@ -35,14 +35,14 @@ export const Indeterminate: Story = {
35
35
  indeterminate: true,
36
36
  },
37
37
  render: (args) => {
38
- const [indeterminate, setIndeterminate] = useState(true);
38
+ const [checked, setChecked] = useState<boolean | undefined>(undefined);
39
39
 
40
40
  return (
41
41
  <CheckboxButton
42
42
  {...args}
43
- checked
44
- indeterminate={indeterminate}
45
- onChange={() => setIndeterminate(!indeterminate)}
43
+ checked={false}
44
+ indeterminate={args.indeterminate}
45
+ onChange={() => setChecked(!checked)}
46
46
  />
47
47
  );
48
48
  },
@@ -8,6 +8,8 @@ export interface RadioButtonProps<T extends string | number = string> {
8
8
  disabled?: boolean;
9
9
  value?: T;
10
10
  readOnly?: boolean;
11
+ className?: string;
12
+ 'aria-describedby'?: string;
11
13
  }
12
14
 
13
15
  export default function RadioButton<T extends string | number = ''>({
@@ -18,17 +20,20 @@ export default function RadioButton<T extends string | number = ''>({
18
20
  onChange,
19
21
  disabled,
20
22
  readOnly,
23
+ className,
24
+ 'aria-describedby': ariaDescribedBy,
21
25
  }: RadioButtonProps<T>) {
22
26
  return (
23
27
  <>
24
28
  <input
25
29
  type="radio"
26
- className="sr-only"
30
+ className={clsx('sr-only', className)}
27
31
  id={id}
28
32
  value={value}
29
33
  name={name}
30
34
  checked={checked}
31
35
  disabled={disabled || readOnly}
36
+ aria-describedby={ariaDescribedBy}
32
37
  onChange={() => {
33
38
  if (!checked) {
34
39
  onChange?.(value);
@@ -39,17 +39,4 @@ describe('getInitials', () => {
39
39
  it('handles single character', () => {
40
40
  expect(getInitials('Q')).toBe('Q');
41
41
  });
42
-
43
- it('handles names with (parenthesized) values', () => {
44
- expect(getInitials('Squirrel (GBP)')).toBe('S');
45
- expect(getInitials('Fantastic Squirrel (USD)')).toBe('FS');
46
- expect(getInitials('Squirrel [GBP]')).toBe('S');
47
- expect(getInitials('Fantastic Squirrel [USD]')).toBe('FS');
48
- expect(getInitials('Squirrel {GBP}')).toBe('S');
49
- expect(getInitials('Fantastic Squirrel {USD}')).toBe('FS');
50
- expect(getInitials('Squirrel <GBP>')).toBe('S');
51
- expect(getInitials('Fantastic Squirrel <USD>')).toBe('FS');
52
- expect(getInitials('(Super) Fantastic Squirrel')).toBe('FS');
53
- expect(getInitials('Super (Fantastic) Squirrel')).toBe('SS');
54
- });
55
42
  });
@@ -5,7 +5,6 @@ export function getInitials(name: string) {
5
5
 
6
6
  const allInitials = name
7
7
  .split(' ')
8
- .filter((part) => !startsWithParenthesis(part))
9
8
  .map((part) => part[0])
10
9
  .join('')
11
10
  .toUpperCase();
@@ -15,8 +14,4 @@ export function getInitials(name: string) {
15
14
  }
16
15
 
17
16
  return allInitials[0] + allInitials.slice(-1);
18
-
19
- function startsWithParenthesis(part: string) {
20
- return /^[({[<]/.test(part);
21
- }
22
17
  }
package/src/i18n/de.json CHANGED
@@ -45,7 +45,6 @@
45
45
  "neptune.Upload.csFailureText": "Hochladen fehlgeschlagen. Bitte versuche es erneut",
46
46
  "neptune.Upload.csSuccessText": "Fertig hochgeladen!",
47
47
  "neptune.Upload.csTooLargeMessage": "Bitte wähle eine Datei aus, die kleiner als {maxSize} MB ist",
48
- "neptune.Upload.csTooLargeNoLimitMessage": "Bitte stelle eine kleinere Datei zur Verfügung",
49
48
  "neptune.Upload.csWrongTypeMessage": "Dateityp wird nicht unterstützt. Bitte versuche es erneut mit einer anderen Datei",
50
49
  "neptune.Upload.psButtonText": "Abbrechen",
51
50
  "neptune.Upload.psProcessingText": "Wird hochgeladen...",
@@ -53,7 +52,6 @@
53
52
  "neptune.Upload.usButtonText": "Oder wähle eine Datei aus",
54
53
  "neptune.Upload.usDropMessage": "Datei zum Hochladen in dieses Feld ziehen",
55
54
  "neptune.Upload.usPlaceholder": "Zieh eine Datei in dieses Feld, die kleiner als {maxSize} MB ist",
56
- "neptune.Upload.usPlaceholderNoLimit": "Ziehe eine Datei hierher",
57
55
  "neptune.UploadButton.allFileTypes": "Alle Dateiformate",
58
56
  "neptune.UploadButton.dropFiles": "Datei zum Hochladen in dieses Feld ziehen",
59
57
  "neptune.UploadButton.instructions": "{fileTypes}, kleiner als {size} MB",