@transferwise/components 0.0.0-experimental-751dc12 → 0.0.0-experimental-4341b9c

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 (318) hide show
  1. package/build/button/Button.js +0 -1
  2. package/build/button/Button.js.map +1 -1
  3. package/build/button/Button.mjs +0 -1
  4. package/build/button/Button.mjs.map +1 -1
  5. package/build/common/RadioButton/RadioButton.js +2 -5
  6. package/build/common/RadioButton/RadioButton.js.map +1 -1
  7. package/build/common/RadioButton/RadioButton.mjs +2 -5
  8. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  9. package/build/common/initials.js +4 -1
  10. package/build/common/initials.js.map +1 -1
  11. package/build/common/initials.mjs +4 -1
  12. package/build/common/initials.mjs.map +1 -1
  13. package/build/i18n/de.json +2 -0
  14. package/build/i18n/de.json.js +2 -0
  15. package/build/i18n/de.json.js.map +1 -1
  16. package/build/i18n/de.json.mjs +2 -0
  17. package/build/i18n/de.json.mjs.map +1 -1
  18. package/build/i18n/fr.json +2 -0
  19. package/build/i18n/fr.json.js +2 -0
  20. package/build/i18n/fr.json.js.map +1 -1
  21. package/build/i18n/fr.json.mjs +2 -0
  22. package/build/i18n/fr.json.mjs.map +1 -1
  23. package/build/i18n/hu.json +2 -0
  24. package/build/i18n/hu.json.js +2 -0
  25. package/build/i18n/hu.json.js.map +1 -1
  26. package/build/i18n/hu.json.mjs +2 -0
  27. package/build/i18n/hu.json.mjs.map +1 -1
  28. package/build/i18n/it.json +2 -0
  29. package/build/i18n/it.json.js +2 -0
  30. package/build/i18n/it.json.js.map +1 -1
  31. package/build/i18n/it.json.mjs +2 -0
  32. package/build/i18n/it.json.mjs.map +1 -1
  33. package/build/i18n/ja.json +2 -0
  34. package/build/i18n/ja.json.js +2 -0
  35. package/build/i18n/ja.json.js.map +1 -1
  36. package/build/i18n/ja.json.mjs +2 -0
  37. package/build/i18n/ja.json.mjs.map +1 -1
  38. package/build/i18n/pl.json +2 -0
  39. package/build/i18n/pl.json.js +2 -0
  40. package/build/i18n/pl.json.js.map +1 -1
  41. package/build/i18n/pl.json.mjs +2 -0
  42. package/build/i18n/pl.json.mjs.map +1 -1
  43. package/build/i18n/pt.json +2 -0
  44. package/build/i18n/pt.json.js +2 -0
  45. package/build/i18n/pt.json.js.map +1 -1
  46. package/build/i18n/pt.json.mjs +2 -0
  47. package/build/i18n/pt.json.mjs.map +1 -1
  48. package/build/i18n/ro.json +2 -0
  49. package/build/i18n/ro.json.js +2 -0
  50. package/build/i18n/ro.json.js.map +1 -1
  51. package/build/i18n/ro.json.mjs +2 -0
  52. package/build/i18n/ro.json.mjs.map +1 -1
  53. package/build/i18n/ru.json +2 -0
  54. package/build/i18n/ru.json.js +2 -0
  55. package/build/i18n/ru.json.js.map +1 -1
  56. package/build/i18n/ru.json.mjs +2 -0
  57. package/build/i18n/ru.json.mjs.map +1 -1
  58. package/build/i18n/tr.json +2 -0
  59. package/build/i18n/tr.json.js +2 -0
  60. package/build/i18n/tr.json.js.map +1 -1
  61. package/build/i18n/tr.json.mjs +2 -0
  62. package/build/i18n/tr.json.mjs.map +1 -1
  63. package/build/i18n/zh-CN.json +2 -0
  64. package/build/i18n/zh-CN.json.js +2 -0
  65. package/build/i18n/zh-CN.json.js.map +1 -1
  66. package/build/i18n/zh-CN.json.mjs +2 -0
  67. package/build/i18n/zh-CN.json.mjs.map +1 -1
  68. package/build/i18n/zh-HK.json +2 -0
  69. package/build/i18n/zh-HK.json.js +2 -0
  70. package/build/i18n/zh-HK.json.js.map +1 -1
  71. package/build/i18n/zh-HK.json.mjs +2 -0
  72. package/build/i18n/zh-HK.json.mjs.map +1 -1
  73. package/build/iconButton/IconButton.js.map +1 -1
  74. package/build/iconButton/IconButton.mjs.map +1 -1
  75. package/build/image/Image.js.map +1 -1
  76. package/build/image/Image.mjs.map +1 -1
  77. package/build/index.js +0 -2
  78. package/build/index.js.map +1 -1
  79. package/build/index.mjs +0 -1
  80. package/build/index.mjs.map +1 -1
  81. package/build/main.css +0 -709
  82. package/build/styles/main.css +0 -709
  83. package/build/switch/Switch.js +0 -2
  84. package/build/switch/Switch.js.map +1 -1
  85. package/build/switch/Switch.mjs +0 -2
  86. package/build/switch/Switch.mjs.map +1 -1
  87. package/build/types/button/Button.d.ts.map +1 -1
  88. package/build/types/button/Button.types.d.ts +1 -1
  89. package/build/types/button/Button.types.d.ts.map +1 -1
  90. package/build/types/button/index.d.ts +1 -1
  91. package/build/types/button/index.d.ts.map +1 -1
  92. package/build/types/common/RadioButton/RadioButton.d.ts +1 -3
  93. package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
  94. package/build/types/common/initials.d.ts.map +1 -1
  95. package/build/types/iconButton/IconButton.d.ts +2 -2
  96. package/build/types/iconButton/IconButton.d.ts.map +1 -1
  97. package/build/types/image/Image.d.ts +0 -3
  98. package/build/types/image/Image.d.ts.map +1 -1
  99. package/build/types/image/index.d.ts +0 -1
  100. package/build/types/image/index.d.ts.map +1 -1
  101. package/build/types/index.d.ts +0 -2
  102. package/build/types/index.d.ts.map +1 -1
  103. package/build/types/switch/Switch.d.ts +0 -2
  104. package/build/types/switch/Switch.d.ts.map +1 -1
  105. package/package.json +1 -1
  106. package/src/button/Button.spec.tsx +0 -18
  107. package/src/button/Button.tsx +1 -5
  108. package/src/button/Button.types.ts +1 -1
  109. package/src/button/index.ts +1 -1
  110. package/src/checkboxButton/CheckboxButton.story.tsx +4 -4
  111. package/src/common/RadioButton/RadioButton.tsx +1 -6
  112. package/src/common/initials.spec.tsx +13 -0
  113. package/src/common/initials.ts +5 -0
  114. package/src/i18n/de.json +2 -0
  115. package/src/i18n/fr.json +2 -0
  116. package/src/i18n/hu.json +2 -0
  117. package/src/i18n/it.json +2 -0
  118. package/src/i18n/ja.json +2 -0
  119. package/src/i18n/pl.json +2 -0
  120. package/src/i18n/pt.json +2 -0
  121. package/src/i18n/ro.json +2 -0
  122. package/src/i18n/ru.json +2 -0
  123. package/src/i18n/tr.json +2 -0
  124. package/src/i18n/zh-CN.json +2 -0
  125. package/src/i18n/zh-HK.json +2 -0
  126. package/src/iconButton/IconButton.story.tsx +1 -1
  127. package/src/iconButton/IconButton.tsx +1 -1
  128. package/src/image/Image.tsx +0 -3
  129. package/src/image/index.ts +0 -1
  130. package/src/index.ts +0 -2
  131. package/src/main.css +0 -709
  132. package/src/main.less +0 -1
  133. package/src/switch/Switch.tsx +0 -4
  134. package/src/test-utils/Parameters.d.ts +77 -0
  135. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +0 -56
  136. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +0 -1
  137. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +0 -54
  138. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +0 -1
  139. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +0 -23
  140. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +0 -1
  141. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +0 -21
  142. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +0 -1
  143. package/build/listItem/AvatarView/ListItemAvatarView.js +0 -23
  144. package/build/listItem/AvatarView/ListItemAvatarView.js.map +0 -1
  145. package/build/listItem/AvatarView/ListItemAvatarView.mjs +0 -21
  146. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +0 -1
  147. package/build/listItem/Button/ListItemButton.js +0 -43
  148. package/build/listItem/Button/ListItemButton.js.map +0 -1
  149. package/build/listItem/Button/ListItemButton.mjs +0 -41
  150. package/build/listItem/Button/ListItemButton.mjs.map +0 -1
  151. package/build/listItem/Checkbox/ListItemCheckbox.js +0 -30
  152. package/build/listItem/Checkbox/ListItemCheckbox.js.map +0 -1
  153. package/build/listItem/Checkbox/ListItemCheckbox.mjs +0 -28
  154. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +0 -1
  155. package/build/listItem/IconButton/ListItemIconButton.js +0 -42
  156. package/build/listItem/IconButton/ListItemIconButton.js.map +0 -1
  157. package/build/listItem/IconButton/ListItemIconButton.mjs +0 -40
  158. package/build/listItem/IconButton/ListItemIconButton.mjs.map +0 -1
  159. package/build/listItem/Image/ListItemImage.js +0 -31
  160. package/build/listItem/Image/ListItemImage.js.map +0 -1
  161. package/build/listItem/Image/ListItemImage.mjs +0 -29
  162. package/build/listItem/Image/ListItemImage.mjs.map +0 -1
  163. package/build/listItem/ListItem.js +0 -308
  164. package/build/listItem/ListItem.js.map +0 -1
  165. package/build/listItem/ListItem.mjs +0 -303
  166. package/build/listItem/ListItem.mjs.map +0 -1
  167. package/build/listItem/ListItemContext.js +0 -8
  168. package/build/listItem/ListItemContext.js.map +0 -1
  169. package/build/listItem/ListItemContext.mjs +0 -6
  170. package/build/listItem/ListItemContext.mjs.map +0 -1
  171. package/build/listItem/Navigation/ListItemNavigation.js +0 -45
  172. package/build/listItem/Navigation/ListItemNavigation.js.map +0 -1
  173. package/build/listItem/Navigation/ListItemNavigation.mjs +0 -43
  174. package/build/listItem/Navigation/ListItemNavigation.mjs.map +0 -1
  175. package/build/listItem/Prompt/ListItemPrompt.js +0 -59
  176. package/build/listItem/Prompt/ListItemPrompt.js.map +0 -1
  177. package/build/listItem/Prompt/ListItemPrompt.mjs +0 -54
  178. package/build/listItem/Prompt/ListItemPrompt.mjs.map +0 -1
  179. package/build/listItem/Radio/ListItemRadio.js +0 -30
  180. package/build/listItem/Radio/ListItemRadio.js.map +0 -1
  181. package/build/listItem/Radio/ListItemRadio.mjs +0 -28
  182. package/build/listItem/Radio/ListItemRadio.mjs.map +0 -1
  183. package/build/listItem/Switch/ListItemSwitch.js +0 -30
  184. package/build/listItem/Switch/ListItemSwitch.js.map +0 -1
  185. package/build/listItem/Switch/ListItemSwitch.mjs +0 -28
  186. package/build/listItem/Switch/ListItemSwitch.mjs.map +0 -1
  187. package/build/listItem/_stories/images/landscape.svg +0 -1
  188. package/build/listItem/_stories/images/portrait.svg +0 -1
  189. package/build/listItem/useListItemControl.js +0 -22
  190. package/build/listItem/useListItemControl.js.map +0 -1
  191. package/build/listItem/useListItemControl.mjs +0 -20
  192. package/build/listItem/useListItemControl.mjs.map +0 -1
  193. package/build/listItem/useListItemMedia.js +0 -21
  194. package/build/listItem/useListItemMedia.js.map +0 -1
  195. package/build/listItem/useListItemMedia.mjs +0 -19
  196. package/build/listItem/useListItemMedia.mjs.map +0 -1
  197. package/build/styles/listItem/ListItem.css +0 -709
  198. package/build/styles/listItem/ListItem.grid.css +0 -368
  199. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +0 -15
  200. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +0 -1
  201. package/build/types/listItem/AdditionalInfo/index.d.ts +0 -3
  202. package/build/types/listItem/AdditionalInfo/index.d.ts.map +0 -1
  203. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +0 -18
  204. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +0 -1
  205. package/build/types/listItem/AvatarLayout/index.d.ts +0 -3
  206. package/build/types/listItem/AvatarLayout/index.d.ts.map +0 -1
  207. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +0 -16
  208. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +0 -1
  209. package/build/types/listItem/AvatarView/index.d.ts +0 -3
  210. package/build/types/listItem/AvatarView/index.d.ts.map +0 -1
  211. package/build/types/listItem/Button/ListItemButton.d.ts +0 -20
  212. package/build/types/listItem/Button/ListItemButton.d.ts.map +0 -1
  213. package/build/types/listItem/Button/index.d.ts +0 -3
  214. package/build/types/listItem/Button/index.d.ts.map +0 -1
  215. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +0 -14
  216. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +0 -1
  217. package/build/types/listItem/Checkbox/index.d.ts +0 -3
  218. package/build/types/listItem/Checkbox/index.d.ts.map +0 -1
  219. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +0 -18
  220. package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +0 -1
  221. package/build/types/listItem/IconButton/index.d.ts +0 -3
  222. package/build/types/listItem/IconButton/index.d.ts.map +0 -1
  223. package/build/types/listItem/Image/ListItemImage.d.ts +0 -25
  224. package/build/types/listItem/Image/ListItemImage.d.ts.map +0 -1
  225. package/build/types/listItem/Image/index.d.ts +0 -3
  226. package/build/types/listItem/Image/index.d.ts.map +0 -1
  227. package/build/types/listItem/ListItem.d.ts +0 -113
  228. package/build/types/listItem/ListItem.d.ts.map +0 -1
  229. package/build/types/listItem/ListItemContext.d.ts +0 -22
  230. package/build/types/listItem/ListItemContext.d.ts.map +0 -1
  231. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +0 -15
  232. package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +0 -1
  233. package/build/types/listItem/Navigation/index.d.ts +0 -3
  234. package/build/types/listItem/Navigation/index.d.ts.map +0 -1
  235. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +0 -16
  236. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +0 -1
  237. package/build/types/listItem/Prompt/index.d.ts +0 -3
  238. package/build/types/listItem/Prompt/index.d.ts.map +0 -1
  239. package/build/types/listItem/Radio/ListItemRadio.d.ts +0 -14
  240. package/build/types/listItem/Radio/ListItemRadio.d.ts.map +0 -1
  241. package/build/types/listItem/Radio/index.d.ts +0 -3
  242. package/build/types/listItem/Radio/index.d.ts.map +0 -1
  243. package/build/types/listItem/Switch/ListItemSwitch.d.ts +0 -14
  244. package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +0 -1
  245. package/build/types/listItem/Switch/index.d.ts +0 -3
  246. package/build/types/listItem/Switch/index.d.ts.map +0 -1
  247. package/build/types/listItem/_stories/subcomponents.d.ts +0 -18
  248. package/build/types/listItem/_stories/subcomponents.d.ts.map +0 -1
  249. package/build/types/listItem/index.d.ts +0 -14
  250. package/build/types/listItem/index.d.ts.map +0 -1
  251. package/build/types/listItem/test-utils.d.ts +0 -7
  252. package/build/types/listItem/test-utils.d.ts.map +0 -1
  253. package/build/types/listItem/useListItemControl.d.ts +0 -5
  254. package/build/types/listItem/useListItemControl.d.ts.map +0 -1
  255. package/build/types/listItem/useListItemMedia.d.ts +0 -6
  256. package/build/types/listItem/useListItemMedia.d.ts.map +0 -1
  257. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +0 -56
  258. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -145
  259. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +0 -36
  260. package/src/listItem/AdditionalInfo/index.ts +0 -2
  261. package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +0 -59
  262. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -118
  263. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +0 -27
  264. package/src/listItem/AvatarLayout/index.ts +0 -2
  265. package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +0 -75
  266. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -318
  267. package/src/listItem/AvatarView/ListItemAvatarView.tsx +0 -27
  268. package/src/listItem/AvatarView/index.ts +0 -2
  269. package/src/listItem/Button/ListItemButton.spec.tsx +0 -68
  270. package/src/listItem/Button/ListItemButton.story.tsx +0 -408
  271. package/src/listItem/Button/ListItemButton.tsx +0 -56
  272. package/src/listItem/Button/index.ts +0 -2
  273. package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +0 -82
  274. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -107
  275. package/src/listItem/Checkbox/ListItemCheckbox.tsx +0 -33
  276. package/src/listItem/Checkbox/index.ts +0 -2
  277. package/src/listItem/IconButton/ListItemIconButton.spec.tsx +0 -119
  278. package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -236
  279. package/src/listItem/IconButton/ListItemIconButton.tsx +0 -56
  280. package/src/listItem/IconButton/index.ts +0 -2
  281. package/src/listItem/Image/ListItemImage.spec.tsx +0 -30
  282. package/src/listItem/Image/ListItemImage.story.tsx +0 -56
  283. package/src/listItem/Image/ListItemImage.tsx +0 -48
  284. package/src/listItem/Image/index.ts +0 -2
  285. package/src/listItem/ListItem.css +0 -709
  286. package/src/listItem/ListItem.grid.css +0 -368
  287. package/src/listItem/ListItem.grid.less +0 -620
  288. package/src/listItem/ListItem.less +0 -346
  289. package/src/listItem/ListItem.spec.tsx +0 -1496
  290. package/src/listItem/ListItem.tsx +0 -441
  291. package/src/listItem/ListItemContext.tsx +0 -27
  292. package/src/listItem/Navigation/ListItemNavigation.spec.tsx +0 -59
  293. package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -106
  294. package/src/listItem/Navigation/ListItemNavigation.tsx +0 -40
  295. package/src/listItem/Navigation/index.ts +0 -2
  296. package/src/listItem/Prompt/ListItemPrompt.spec.tsx +0 -36
  297. package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -201
  298. package/src/listItem/Prompt/ListItemPrompt.tsx +0 -32
  299. package/src/listItem/Prompt/index.ts +0 -2
  300. package/src/listItem/Radio/ListItemRadio.spec.tsx +0 -66
  301. package/src/listItem/Radio/ListItemRadio.story.tsx +0 -98
  302. package/src/listItem/Radio/ListItemRadio.tsx +0 -33
  303. package/src/listItem/Radio/index.ts +0 -2
  304. package/src/listItem/Switch/ListItemSwitch.spec.tsx +0 -47
  305. package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -69
  306. package/src/listItem/Switch/ListItemSwitch.tsx +0 -33
  307. package/src/listItem/Switch/index.ts +0 -2
  308. package/src/listItem/_stories/ListItem.focus.test.story.tsx +0 -250
  309. package/src/listItem/_stories/ListItem.layout.test.story.tsx +0 -338
  310. package/src/listItem/_stories/ListItem.story.tsx +0 -670
  311. package/src/listItem/_stories/ListItem.variants.test.story.tsx +0 -271
  312. package/src/listItem/_stories/images/landscape.svg +0 -1
  313. package/src/listItem/_stories/images/portrait.svg +0 -1
  314. package/src/listItem/_stories/subcomponents.tsx +0 -139
  315. package/src/listItem/index.ts +0 -14
  316. package/src/listItem/test-utils.tsx +0 -33
  317. package/src/listItem/useListItemControl.tsx +0 -18
  318. package/src/listItem/useListItemMedia.tsx +0 -13
@@ -1,303 +0,0 @@
1
- import { useId, useState, useMemo, useContext } from 'react';
2
- import '../common/theme.mjs';
3
- import '../common/direction.mjs';
4
- import '../common/propsValues/control.mjs';
5
- import '../common/propsValues/breakpoint.mjs';
6
- import '../common/propsValues/size.mjs';
7
- import { Typography } from '../common/propsValues/typography.mjs';
8
- import '../common/propsValues/width.mjs';
9
- import '../common/propsValues/type.mjs';
10
- import '../common/propsValues/dateMode.mjs';
11
- import '../common/propsValues/monthFormat.mjs';
12
- import '../common/propsValues/position.mjs';
13
- import '../common/propsValues/layouts.mjs';
14
- import '../common/propsValues/status.mjs';
15
- import '../common/propsValues/sentiment.mjs';
16
- import '../common/propsValues/profileType.mjs';
17
- import '../common/propsValues/variant.mjs';
18
- import '../common/propsValues/scroll.mjs';
19
- import '../common/propsValues/markdownNodeType.mjs';
20
- import '../common/fileType.mjs';
21
- import '@transferwise/icons';
22
- import { clsx } from 'clsx';
23
- import 'react-intl';
24
- import '../common/closeButton/CloseButton.messages.mjs';
25
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
26
- import Body from '../body/Body.mjs';
27
- import { AdditionalInfo } from './AdditionalInfo/ListItemAdditionalInfo.mjs';
28
- import { IconButton } from './IconButton/ListItemIconButton.mjs';
29
- import { Checkbox } from './Checkbox/ListItemCheckbox.mjs';
30
- import { Navigation } from './Navigation/ListItemNavigation.mjs';
31
- import { Button } from './Button/ListItemButton.mjs';
32
- import { Radio } from './Radio/ListItemRadio.mjs';
33
- import { Switch } from './Switch/ListItemSwitch.mjs';
34
- import { AvatarLayout } from './AvatarLayout/ListItemAvatarLayout.mjs';
35
- import { AvatarView } from './AvatarView/ListItemAvatarView.mjs';
36
- import { Image } from './Image/ListItemImage.mjs';
37
- import { Prompt } from './Prompt/ListItemPrompt.mjs';
38
- import '../primitives/PrimitiveButton/PrimitiveButton.mjs';
39
- import PrimitiveAnchor from '../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
40
- import { ListItemContext } from './ListItemContext.mjs';
41
-
42
- /* eslint-disable functional/immutable-data */
43
- const ListItem = ({
44
- as: ListItemElement = 'li',
45
- title,
46
- subtitle,
47
- additionalInfo,
48
- prompt,
49
- inverted,
50
- media,
51
- spotlight,
52
- valueTitle,
53
- valueSubtitle,
54
- control = null,
55
- disabled,
56
- className,
57
- valueColumnWidth,
58
- role,
59
- id,
60
- 'aria-labelledby': ariaLabelledby
61
- }) => {
62
- const idPrefix = useId();
63
- const [controlProps, setControlProps] = useState({});
64
- const [controlType, setControlType] = useState('non-interactive');
65
- const [mediaSize, setMediaSize] = useState();
66
- const ids = {
67
- title: `${idPrefix}_title`,
68
- ...(subtitle ? {
69
- subtitle: `${idPrefix}_subtitle`
70
- } : {}),
71
- ...(valueTitle ? {
72
- valueTitle: `${idPrefix}_value-title`
73
- } : {}),
74
- ...(valueSubtitle ? {
75
- valueSubtitle: `${idPrefix}_value-subtitle`
76
- } : {}),
77
- control: `${idPrefix}_control`,
78
- ...(prompt ? {
79
- prompt: `${idPrefix}_prompt`
80
- } : {}),
81
- ...(additionalInfo ? {
82
- additionalInfo: `${idPrefix}_additional-info`
83
- } : {})
84
- };
85
- const isPartiallyInteractive = Boolean((controlType === 'button' || controlType === 'icon-button') && controlProps?.partiallyInteractive);
86
- const isFullyInteractive = controlType !== 'non-interactive' && !isPartiallyInteractive;
87
- const isButtonAsLink = (controlType === 'button' || controlType === 'icon-button') && Boolean(controlProps?.href);
88
- const titlesAndValues = [inverted ? ids.subtitle : ids.title, inverted ? ids.title : ids.subtitle, inverted ? ids.valueSubtitle : ids.valueTitle, inverted ? ids.valueTitle : ids.valueSubtitle].join(' ');
89
- const additionalInfoPrompt = [ids.additionalInfo, ids.prompt].filter(Boolean).join(' ');
90
- const describedByIds = useMemo(() => {
91
- return isFullyInteractive && !isButtonAsLink ? additionalInfoPrompt : `${titlesAndValues} ${additionalInfoPrompt}`;
92
- }, [isFullyInteractive]);
93
- const listItemContext = useMemo(() => ({
94
- setControlType,
95
- setControlProps,
96
- setMediaSize,
97
- ids,
98
- props: {
99
- disabled,
100
- inverted
101
- },
102
- mediaSize,
103
- describedByIds
104
- }), [describedByIds, mediaSize]);
105
- const gridColumnsStyle = {
106
- '--wds-list-item-body-left': valueColumnWidth ? `${100 - valueColumnWidth}fr` : '50fr',
107
- '--wds-list-item-body-right': valueColumnWidth ? `${valueColumnWidth}fr` : '50fr'
108
- };
109
- const getFeatureClassName = () => {
110
- const partials = [];
111
- const hasMedia = Boolean(media);
112
- const hasControl = Boolean(control);
113
- const hasInfo = Boolean(additionalInfo);
114
- const hasPrompt = Boolean(prompt);
115
- if (hasMedia && hasControl) {
116
- partials.push('wds-list-item-hasMedia-hasControl');
117
- }
118
- if (hasMedia && !hasControl) {
119
- partials.push('wds-list-item-hasMedia-noControl');
120
- }
121
- if (!hasMedia && hasControl) {
122
- partials.push('wds-list-item-noMedia-hasControl');
123
- }
124
- if (!hasMedia && !hasControl) {
125
- partials.push('wds-list-item-noMedia-noControl');
126
- }
127
- if (hasInfo && hasPrompt) {
128
- partials.push('wds-list-item-hasInfo-hasPrompt');
129
- }
130
- if (hasInfo && !hasPrompt) {
131
- partials.push('wds-list-item-hasInfo-noPrompt');
132
- }
133
- if (!hasInfo && hasPrompt) {
134
- partials.push('wds-list-item-noInfo-hasPrompt');
135
- }
136
- if (!hasInfo && !hasPrompt) {
137
- partials.push('wds-list-item-noInfo-noPrompt');
138
- }
139
- return partials.join(' ');
140
- };
141
- return /*#__PURE__*/jsx(ListItemContext.Provider, {
142
- value: listItemContext,
143
- children: /*#__PURE__*/jsx(ListItemElement, {
144
- className: clsx('wds-list-item', `wds-list-item-${controlType}`, getFeatureClassName(), {
145
- 'wds-list-item-interactive': isFullyInteractive,
146
- 'wds-list-item-partially-interactive': isPartiallyInteractive,
147
- [`wds-list-item-spotlight wds-list-item-spotlight-${spotlight}`]: isFullyInteractive && !!spotlight,
148
- disabled
149
- }, className),
150
- id: id,
151
- role: role,
152
- "aria-disabled": disabled,
153
- "aria-labelledby": ariaLabelledby,
154
- children: /*#__PURE__*/jsxs(View, {
155
- isPartiallyInteractive,
156
- subtitle,
157
- additionalInfo,
158
- disabled,
159
- prompt,
160
- controlType,
161
- controlProps,
162
- className: getFeatureClassName(),
163
- children: [media && /*#__PURE__*/jsx("div", {
164
- className: "wds-list-item-media",
165
- children: media
166
- }), /*#__PURE__*/jsxs("div", {
167
- className: "wds-list-item-body",
168
- style: valueColumnWidth ? gridColumnsStyle : undefined,
169
- children: [/*#__PURE__*/jsx("span", {
170
- className: clsx({
171
- 'wds-list-item-body-center': title && !subtitle
172
- }),
173
- children: (() => {
174
- const titles = [/*#__PURE__*/jsx(Body, {
175
- id: ids.title,
176
- type: Typography.BODY_LARGE_BOLD,
177
- className: "wds-list-item-title",
178
- children: title
179
- }, ids.title)];
180
- if (subtitle) {
181
- titles.push(/*#__PURE__*/jsx(Body, {
182
- id: ids.subtitle,
183
- className: "wds-list-item-subtitle",
184
- children: subtitle
185
- }, ids.subtitle));
186
- }
187
- return inverted ? [...titles].reverse() : titles;
188
- })()
189
- }), (valueTitle || valueSubtitle) && /*#__PURE__*/jsx("span", {
190
- className: clsx('wds-list-item-value', {
191
- 'flex-column': valueTitle !== undefined || valueSubtitle !== undefined,
192
- 'wds-list-item-body-center': valueTitle && !valueSubtitle || !valueTitle && valueSubtitle
193
- }),
194
- children: (() => {
195
- const values = [];
196
- if (valueTitle) {
197
- values.push(/*#__PURE__*/jsx(Body, {
198
- id: ids.valueTitle,
199
- type: Typography.BODY_LARGE_BOLD,
200
- className: "wds-list-item-title-value",
201
- children: valueTitle
202
- }, ids.valueTitle));
203
- }
204
- if (valueSubtitle) {
205
- values.push(/*#__PURE__*/jsx(Body, {
206
- id: ids.valueSubtitle,
207
- className: "wds-list-item-subtitle-value",
208
- children: valueSubtitle
209
- }, ids.valueSubtitle));
210
- }
211
- return inverted ? [...values].reverse() : values;
212
- })()
213
- })]
214
- }), control === null ? null : /*#__PURE__*/jsx(Body, {
215
- className: clsx('wds-list-item-control-wrapper', {
216
- 'wds-list-item-button-control': controlType === 'button'
217
- }),
218
- style: {
219
- '--wds-list-item-control-wrapper-height': mediaSize ? `${mediaSize}px` : 'auto'
220
- },
221
- children: control
222
- })]
223
- })
224
- })
225
- });
226
- };
227
- function View({
228
- children,
229
- subtitle,
230
- additionalInfo,
231
- prompt,
232
- disabled,
233
- isPartiallyInteractive,
234
- controlType = 'non-interactive',
235
- controlProps,
236
- className = ''
237
- }) {
238
- const {
239
- ids,
240
- describedByIds
241
- } = useContext(ListItemContext);
242
- const isLinkControl = ['navigation'].includes(controlType);
243
- const isHrefProvided = isLinkControl && !!controlProps?.href && controlProps?.href !== '#';
244
- const renderExtras = () => /*#__PURE__*/jsxs(Fragment, {
245
- children: [Boolean(subtitle) && additionalInfo, prompt]
246
- });
247
- if (isLinkControl && isHrefProvided) {
248
- return (
249
- /*#__PURE__*/
250
- // for link instances of .Navigation, .IconButton, .Button
251
- jsxs("div", {
252
- className: clsx('wds-list-item-gridWrapper', className),
253
- children: [/*#__PURE__*/jsx(PrimitiveAnchor, {
254
- "aria-describedby": describedByIds,
255
- href: controlProps?.href,
256
- target: controlProps?.target,
257
- className: clsx('wds-list-item-view d-flex flex-row', {
258
- 'wds-list-item-control': controlType === 'navigation'
259
- }),
260
- disabled: disabled,
261
- children: children
262
- }), renderExtras()]
263
- })
264
- );
265
- }
266
- if (isPartiallyInteractive || controlType === 'non-interactive') {
267
- return /*#__PURE__*/jsxs("div", {
268
- className: clsx('wds-list-item-gridWrapper', className),
269
- children: [/*#__PURE__*/jsx("div", {
270
- className: clsx('wds-list-item-view d-flex flex-row'),
271
- children: children
272
- }), renderExtras()]
273
- });
274
- }
275
- // for form control instances of .Radio, .Checkbox, .Switch, .Button, .Navigation etc
276
- // Radio cannot be wrapped in a <fieldset> element to announce it as a group.
277
- const InputWrapper = controlType === 'radio' ? 'div' : 'fieldset';
278
- return /*#__PURE__*/jsxs(InputWrapper, {
279
- className: clsx('wds-list-item-gridWrapper', className),
280
- children: [/*#__PURE__*/jsx("label", {
281
- htmlFor: ids.control,
282
- className: clsx('wds-list-item-view', {
283
- clickable: !disabled,
284
- fullyInteractive: !isPartiallyInteractive
285
- }),
286
- children: children
287
- }), renderExtras()]
288
- });
289
- }
290
- ListItem.Image = Image;
291
- ListItem.AvatarView = AvatarView;
292
- ListItem.AvatarLayout = AvatarLayout;
293
- ListItem.AdditionalInfo = AdditionalInfo;
294
- ListItem.Checkbox = Checkbox;
295
- ListItem.Radio = Radio;
296
- ListItem.IconButton = IconButton;
297
- ListItem.Navigation = Navigation;
298
- ListItem.Button = Button;
299
- ListItem.Switch = Switch;
300
- ListItem.Prompt = Prompt;
301
-
302
- export { ListItem, ListItem as default };
303
- //# sourceMappingURL=ListItem.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.mjs","sources":["../../src/listItem/ListItem.tsx"],"sourcesContent":["/* eslint-disable functional/immutable-data */\nimport {\n useContext,\n useId,\n useMemo,\n useState,\n useEffect,\n type PropsWithChildren,\n type ReactNode,\n} from 'react';\nimport { Typography } from '../common';\nimport Body from '../body';\nimport { AdditionalInfo } from './AdditionalInfo';\nimport { IconButton, type ListItemIconButtonProps } from './IconButton';\nimport { Checkbox, type ListItemCheckboxProps } from './Checkbox';\nimport { Navigation, type ListItemNavigationProps } from './Navigation';\nimport { clsx } from 'clsx';\nimport { Button, type ListItemButtonProps } from './Button';\nimport { Radio, type ListItemRadioProps } from './Radio';\nimport { Switch, type ListItemSwitchProps } from './Switch';\nimport { AvatarLayout } from './AvatarLayout';\nimport { AvatarView } from './AvatarView';\nimport { Image } from './Image';\nimport { Prompt } from './Prompt';\nimport { PrimitiveAnchor } from '../primitives';\nimport {\n ListItemContext,\n type ListItemContextData,\n type ListItemMediaSize,\n} from './ListItemContext';\n\nexport type ListItemTypes =\n | 'non-interactive'\n | 'navigation'\n | 'radio'\n | 'checkbox'\n | 'switch'\n | 'button'\n | 'icon-button';\n\nexport type ListItemControlProps =\n | ListItemNavigationProps\n | ListItemCheckboxProps\n | ListItemButtonProps\n | ListItemIconButtonProps\n | ListItemRadioProps\n | ListItemSwitchProps;\n\nexport type Props = {\n as?: 'li' | 'div';\n /**\n * Swaps vertical hierarchy of title and subtitle and their corresponding right values.\n */\n inverted?: boolean;\n disabled?: boolean;\n /**\n * Highlights the list item as an action to be taken or already taken. <br />\n */\n spotlight?: 'active' | 'inactive';\n title: ReactNode;\n subtitle?: ReactNode;\n /**\n * Requires `<ListItem.AdditionalInfo />` component as a sole child. <br />\n * Can be only rendered if `subtitle` is also provided.\n */\n additionalInfo?: ReactNode;\n valueTitle?: ReactNode;\n valueSubtitle?: ReactNode;\n /**\n * Requires one of the following as a sole child: <br />\n * `<ListItem.AvatarView />`,\n * `<ListItem.AvatarLayout />` or\n * `<ListItem.Image />`\n */\n media?: ReactNode;\n /**\n * Requires one of the following as a sole child: <br/>\n * `<ListItem.Button />`, <br/>\n * `<ListItem.Checkbox />`, <br/>\n * `<ListItem.IconButton />`, <br/>\n * `<ListItem.Navigation />`, <br/>\n * `<ListItem.Radio />`, or\n * `<ListItem.Switch />`\n */\n control?: ReactNode;\n /**\n * Requires `<ListItem.Prompt />` component as a sole child.\n */\n prompt?: ReactNode;\n className?: string;\n /**\n * 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 />\n * Controls the width ratio of left side content (title and subtitle) to the right side content.\n */\n valueColumnWidth?: number;\n id?: string;\n role?: string;\n 'aria-labelledby'?: string;\n};\n\n/**\n * @see [Design documentation](https://wise.design/components/list-item)\n * @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n */\nexport const ListItem = ({\n as: ListItemElement = 'li',\n title,\n subtitle,\n additionalInfo,\n prompt,\n inverted,\n media,\n spotlight,\n valueTitle,\n valueSubtitle,\n control = null,\n disabled,\n className,\n valueColumnWidth,\n role,\n id,\n 'aria-labelledby': ariaLabelledby,\n}: Props) => {\n const idPrefix = useId();\n const [controlProps, setControlProps] = useState<ListItemControlProps>({});\n const [controlType, setControlType] = useState<ListItemTypes>('non-interactive');\n const [mediaSize, setMediaSize] = useState<ListItemMediaSize | undefined>();\n\n const ids: ListItemContextData['ids'] = {\n title: `${idPrefix}_title`,\n ...(subtitle ? { subtitle: `${idPrefix}_subtitle` } : {}),\n ...(valueTitle ? { valueTitle: `${idPrefix}_value-title` } : {}),\n ...(valueSubtitle ? { valueSubtitle: `${idPrefix}_value-subtitle` } : {}),\n control: `${idPrefix}_control`,\n ...(prompt ? { prompt: `${idPrefix}_prompt` } : {}),\n ...(additionalInfo ? { additionalInfo: `${idPrefix}_additional-info` } : {}),\n };\n\n const isPartiallyInteractive = Boolean(\n (controlType === 'button' || controlType === 'icon-button') &&\n (controlProps as ListItemButtonProps | ListItemIconButtonProps)?.partiallyInteractive,\n );\n const isFullyInteractive = controlType !== 'non-interactive' && !isPartiallyInteractive;\n const isButtonAsLink =\n (controlType === 'button' || controlType === 'icon-button') &&\n Boolean((controlProps as ListItemButtonProps | ListItemIconButtonProps)?.href);\n\n const titlesAndValues = [\n inverted ? ids.subtitle : ids.title,\n inverted ? ids.title : ids.subtitle,\n inverted ? ids.valueSubtitle : ids.valueTitle,\n inverted ? ids.valueTitle : ids.valueSubtitle,\n ].join(' ');\n const additionalInfoPrompt = [ids.additionalInfo, ids.prompt].filter(Boolean).join(' ');\n\n const describedByIds = useMemo(() => {\n return isFullyInteractive && !isButtonAsLink\n ? additionalInfoPrompt\n : `${titlesAndValues} ${additionalInfoPrompt}`;\n }, [isFullyInteractive]);\n\n const listItemContext = useMemo(\n () => ({\n setControlType,\n setControlProps,\n setMediaSize,\n ids,\n props: { disabled, inverted },\n mediaSize,\n describedByIds,\n }),\n [describedByIds, mediaSize],\n );\n const gridColumnsStyle = {\n '--wds-list-item-body-left': valueColumnWidth ? `${100 - valueColumnWidth}fr` : '50fr',\n '--wds-list-item-body-right': valueColumnWidth ? `${valueColumnWidth}fr` : '50fr',\n } as React.CSSProperties;\n\n const getFeatureClassName = () => {\n const partials = [];\n const hasMedia = Boolean(media);\n const hasControl = Boolean(control);\n const hasInfo = Boolean(additionalInfo);\n const hasPrompt = Boolean(prompt);\n\n if (hasMedia && hasControl) {\n partials.push('wds-list-item-hasMedia-hasControl');\n }\n\n if (hasMedia && !hasControl) {\n partials.push('wds-list-item-hasMedia-noControl');\n }\n\n if (!hasMedia && hasControl) {\n partials.push('wds-list-item-noMedia-hasControl');\n }\n\n if (!hasMedia && !hasControl) {\n partials.push('wds-list-item-noMedia-noControl');\n }\n\n if (hasInfo && hasPrompt) {\n partials.push('wds-list-item-hasInfo-hasPrompt');\n }\n if (hasInfo && !hasPrompt) {\n partials.push('wds-list-item-hasInfo-noPrompt');\n }\n if (!hasInfo && hasPrompt) {\n partials.push('wds-list-item-noInfo-hasPrompt');\n }\n if (!hasInfo && !hasPrompt) {\n partials.push('wds-list-item-noInfo-noPrompt');\n }\n\n return partials.join(' ');\n };\n\n return (\n <ListItemContext.Provider value={listItemContext}>\n <ListItemElement\n className={clsx(\n 'wds-list-item',\n `wds-list-item-${controlType}`,\n getFeatureClassName(),\n {\n 'wds-list-item-interactive': isFullyInteractive,\n 'wds-list-item-partially-interactive': isPartiallyInteractive,\n [`wds-list-item-spotlight wds-list-item-spotlight-${spotlight}`]:\n isFullyInteractive && !!spotlight,\n disabled,\n },\n className,\n )}\n id={id}\n role={role}\n aria-disabled={disabled}\n aria-labelledby={ariaLabelledby}\n >\n <View\n {...{\n isPartiallyInteractive,\n subtitle,\n additionalInfo,\n disabled,\n prompt,\n controlType,\n controlProps,\n }}\n className={getFeatureClassName()}\n >\n {media && <div className=\"wds-list-item-media\">{media}</div>}\n\n {/* Title + Subtitle + Values - Group */}\n <div\n className=\"wds-list-item-body\"\n style={valueColumnWidth ? gridColumnsStyle : undefined}\n >\n {/* Title + Subtitle + Values - Group */}\n <span\n className={clsx({\n 'wds-list-item-body-center': title && !subtitle,\n })}\n >\n {(() => {\n const titles = [\n <Body\n key={ids.title}\n id={ids.title}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-list-item-title\"\n >\n {title}\n </Body>,\n ];\n if (subtitle) {\n titles.push(\n <Body key={ids.subtitle} id={ids.subtitle} className=\"wds-list-item-subtitle\">\n {subtitle}\n </Body>,\n );\n }\n return inverted ? [...titles].reverse() : titles;\n })()}\n </span>\n\n {(valueTitle || valueSubtitle) && (\n <span\n className={clsx('wds-list-item-value', {\n 'flex-column': valueTitle !== undefined || valueSubtitle !== undefined,\n 'wds-list-item-body-center':\n (valueTitle && !valueSubtitle) || (!valueTitle && valueSubtitle),\n })}\n >\n {(() => {\n const values = [];\n if (valueTitle) {\n values.push(\n <Body\n key={ids.valueTitle}\n id={ids.valueTitle}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-list-item-title-value\"\n >\n {valueTitle}\n </Body>,\n );\n }\n if (valueSubtitle) {\n values.push(\n <Body\n key={ids.valueSubtitle}\n id={ids.valueSubtitle}\n className=\"wds-list-item-subtitle-value\"\n >\n {valueSubtitle}\n </Body>,\n );\n }\n return inverted ? [...values].reverse() : values;\n })()}\n </span>\n )}\n </div>\n\n {control === null ? null : (\n <Body\n className={clsx('wds-list-item-control-wrapper', {\n 'wds-list-item-button-control': controlType === 'button',\n })}\n style={\n {\n '--wds-list-item-control-wrapper-height': mediaSize ? `${mediaSize}px` : 'auto',\n } as React.CSSProperties\n }\n >\n {control}\n </Body>\n )}\n </View>\n </ListItemElement>\n </ListItemContext.Provider>\n );\n};\n\ntype ViewProps = PropsWithChildren<{\n isPartiallyInteractive: boolean;\n controlType?: ListItemTypes;\n controlProps?: ListItemControlProps;\n}> &\n Pick<Props, 'subtitle' | 'additionalInfo' | 'disabled' | 'prompt' | 'className'>;\n\nfunction View({\n children,\n subtitle,\n additionalInfo,\n prompt,\n disabled,\n isPartiallyInteractive,\n controlType = 'non-interactive',\n controlProps,\n className = '',\n}: ViewProps) {\n const { ids, describedByIds } = useContext<ListItemContextData>(ListItemContext);\n const isLinkControl = ['navigation'].includes(controlType);\n\n const isHrefProvided =\n isLinkControl &&\n !!(controlProps as ListItemNavigationProps)?.href &&\n (controlProps as ListItemNavigationProps)?.href !== '#';\n\n const renderExtras = () => (\n <>\n {Boolean(subtitle) && additionalInfo}\n {prompt}\n </>\n );\n\n if (isLinkControl && isHrefProvided) {\n return (\n // for link instances of .Navigation, .IconButton, .Button\n <div className={clsx('wds-list-item-gridWrapper', className)}>\n <PrimitiveAnchor\n aria-describedby={describedByIds}\n href={(controlProps as ListItemNavigationProps)?.href}\n target={(controlProps as ListItemNavigationProps)?.target}\n className={clsx('wds-list-item-view d-flex flex-row', {\n 'wds-list-item-control': controlType === 'navigation',\n })}\n disabled={disabled}\n >\n {children}\n </PrimitiveAnchor>\n\n {renderExtras()}\n </div>\n );\n }\n\n if (isPartiallyInteractive || controlType === 'non-interactive') {\n return (\n <div className={clsx('wds-list-item-gridWrapper', className)}>\n <div className={clsx('wds-list-item-view d-flex flex-row')}>{children}</div>\n\n {renderExtras()}\n </div>\n );\n }\n\n // for form control instances of .Radio, .Checkbox, .Switch, .Button, .Navigation etc\n // Radio cannot be wrapped in a <fieldset> element to announce it as a group.\n const InputWrapper = controlType === 'radio' ? 'div' : 'fieldset';\n return (\n <InputWrapper className={clsx('wds-list-item-gridWrapper', className)}>\n <label\n htmlFor={ids.control}\n className={clsx('wds-list-item-view', {\n clickable: !disabled,\n fullyInteractive: !isPartiallyInteractive,\n })}\n >\n {children}\n </label>\n\n {renderExtras()}\n </InputWrapper>\n );\n}\n\nListItem.Image = Image;\nListItem.AvatarView = AvatarView;\nListItem.AvatarLayout = AvatarLayout;\nListItem.AdditionalInfo = AdditionalInfo;\nListItem.Checkbox = Checkbox;\nListItem.Radio = Radio;\nListItem.IconButton = IconButton;\nListItem.Navigation = Navigation;\nListItem.Button = Button;\nListItem.Switch = Switch;\nListItem.Prompt = Prompt;\n\nexport default ListItem;\n"],"names":["ListItem","as","ListItemElement","title","subtitle","additionalInfo","prompt","inverted","media","spotlight","valueTitle","valueSubtitle","control","disabled","className","valueColumnWidth","role","id","ariaLabelledby","idPrefix","useId","controlProps","setControlProps","useState","controlType","setControlType","mediaSize","setMediaSize","ids","isPartiallyInteractive","Boolean","partiallyInteractive","isFullyInteractive","isButtonAsLink","href","titlesAndValues","join","additionalInfoPrompt","filter","describedByIds","useMemo","listItemContext","props","gridColumnsStyle","getFeatureClassName","partials","hasMedia","hasControl","hasInfo","hasPrompt","push","_jsx","ListItemContext","Provider","value","children","clsx","_jsxs","View","style","undefined","titles","Body","type","Typography","BODY_LARGE_BOLD","reverse","values","useContext","isLinkControl","includes","isHrefProvided","renderExtras","_Fragment","PrimitiveAnchor","target","InputWrapper","htmlFor","clickable","fullyInteractive","Image","AvatarView","AvatarLayout","AdditionalInfo","Checkbox","Radio","IconButton","Navigation","Button","Switch","Prompt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAwGO,MAAMA,QAAQ,GAAGA,CAAC;EACvBC,EAAE,EAAEC,eAAe,GAAG,IAAI;EAC1BC,KAAK;EACLC,QAAQ;EACRC,cAAc;EACdC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,SAAS;EACTC,UAAU;EACVC,aAAa;AACbC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,SAAS;EACTC,gBAAgB;EAChBC,IAAI;EACJC,EAAE;AACF,EAAA,iBAAiB,EAAEC;AAAc,CAC3B,KAAI;AACV,EAAA,MAAMC,QAAQ,GAAGC,KAAK,EAAE;EACxB,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAAuB,EAAE,CAAC;EAC1E,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,QAAQ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Y,EAAA;AAAC9D,IAAAA,SAAS,EAAE0C,IAAI,CAAC,2BAA2B,EAAE1C,SAAS,CAAE;AAAAyC,IAAAA,QAAA,gBACpEJ,GAAA,CAAA,OAAA,EAAA;MACE0B,OAAO,EAAEjD,GAAG,CAAChB,OAAQ;AACrBE,MAAAA,SAAS,EAAE0C,IAAI,CAAC,oBAAoB,EAAE;QACpCsB,SAAS,EAAE,CAACjE,QAAQ;AACpBkE,QAAAA,gBAAgB,EAAE,CAAClD;AACpB,OAAA,CAAE;AAAA0B,MAAAA,QAAA,EAEFA;AAAQ,KACJ,CAEP,EAACiB,YAAY,EAAE;AAAA,GACH,CAAC;AAEnB;AAEAxE,QAAQ,CAACgF,KAAK,GAAGA,KAAK;AACtBhF,QAAQ,CAACiF,UAAU,GAAGA,UAAU;AAChCjF,QAAQ,CAACkF,YAAY,GAAGA,YAAY;AACpClF,QAAQ,CAACmF,cAAc,GAAGA,cAAc;AACxCnF,QAAQ,CAACoF,QAAQ,GAAGA,QAAQ;AAC5BpF,QAAQ,CAACqF,KAAK,GAAGA,KAAK;AACtBrF,QAAQ,CAACsF,UAAU,GAAGA,UAAU;AAChCtF,QAAQ,CAACuF,UAAU,GAAGA,UAAU;AAChCvF,QAAQ,CAACwF,MAAM,GAAGA,MAAM;AACxBxF,QAAQ,CAACyF,MAAM,GAAGA,MAAM;AACxBzF,QAAQ,CAAC0F,MAAM,GAAGA,MAAM;;;;"}
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- const ListItemContext = /*#__PURE__*/React.createContext(null);
6
-
7
- exports.ListItemContext = ListItemContext;
8
- //# sourceMappingURL=ListItemContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemContext.js","sources":["../../src/listItem/ListItemContext.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => void;\n setMediaSize: (size: ListItemMediaSize | undefined) => void;\n ids: {\n title: string;\n subtitle?: string;\n valueTitle?: string;\n valueSubtitle?: string;\n additionalInfo?: string;\n control: string;\n prompt?: string;\n };\n props: Pick<ListItemProps, 'disabled' | 'inverted'>;\n mediaSize?: ListItemAvatarViewProps['size'];\n describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;;;MAwBaA,eAAe,gBAAGC,mBAAa,CAC1C,IAAsC;;;;"}
@@ -1,6 +0,0 @@
1
- import { createContext } from 'react';
2
-
3
- const ListItemContext = /*#__PURE__*/createContext(null);
4
-
5
- export { ListItemContext };
6
- //# sourceMappingURL=ListItemContext.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemContext.mjs","sources":["../../src/listItem/ListItemContext.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => void;\n setMediaSize: (size: ListItemMediaSize | undefined) => void;\n ids: {\n title: string;\n subtitle?: string;\n valueTitle?: string;\n valueSubtitle?: string;\n additionalInfo?: string;\n control: string;\n prompt?: string;\n };\n props: Pick<ListItemProps, 'disabled' | 'inverted'>;\n mediaSize?: ListItemAvatarViewProps['size'];\n describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;MAwBaA,eAAe,gBAAGC,aAAa,CAC1C,IAAsC;;;;"}
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- var icons = require('@transferwise/icons');
4
- var useListItemControl = require('../useListItemControl.js');
5
- var PrimitiveButton = require('../../primitives/PrimitiveButton/PrimitiveButton.js');
6
- require('../../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
7
- var React = require('react');
8
- var ListItemContext = require('../ListItemContext.js');
9
- var jsxRuntime = require('react/jsx-runtime');
10
-
11
- const Navigation = function Navigation({
12
- href = '#',
13
- ...props
14
- }) {
15
- const {
16
- baseItemProps
17
- } = useListItemControl.useListItemControl('navigation', {
18
- href,
19
- ...props
20
- });
21
- const {
22
- ids,
23
- describedByIds
24
- } = React.useContext(ListItemContext.ListItemContext);
25
- const isLink = href !== '#';
26
- const icon = /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
27
- size: 16
28
- });
29
- if (baseItemProps.disabled) return /*#__PURE__*/jsxRuntime.jsx(icons.BackslashCircle, {
30
- size: 24
31
- });
32
- return isLink ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
33
- children: icon
34
- }) : /*#__PURE__*/jsxRuntime.jsx(PrimitiveButton.default, {
35
- "aria-describedby": describedByIds,
36
- id: ids.control,
37
- className: "btn-unstyled wds-list-item-control",
38
- onClick: props.onClick,
39
- children: icon
40
- });
41
- };
42
- Navigation.displayName = 'ListItem.Navigation';
43
-
44
- exports.Navigation = Navigation;
45
- //# sourceMappingURL=ListItemNavigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemNavigation.js","sources":["../../../src/listItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight, BackslashCircle } from '@transferwise/icons';\nimport type { ButtonProps } from '../../button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href = '#', ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const isLink = href !== '#';\n const icon = <ChevronRight size={16} />;\n\n if (baseItemProps.disabled) return <BackslashCircle size={24} />;\n\n return isLink ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","isLink","icon","_jsx","ChevronRight","size","disabled","BackslashCircle","_Fragment","children","PrimitiveButton","id","control","className","onClick","displayName"],"mappings":";;;;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;AAAEC,EAAAA,IAAI,GAAG,GAAG;EAAE,GAAGC;AAAK,CAA2B,EAAA;EAC7F,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;AAC3D,EAAA,MAAMC,MAAM,GAAGR,IAAI,KAAK,GAAG;AAC3B,EAAA,MAAMS,IAAI,gBAAGC,cAAA,CAACC,kBAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,IAAIV,aAAa,CAACW,QAAQ,EAAE,oBAAOH,cAAA,CAACI,qBAAe,EAAA;AAACF,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEhE,EAAA,OAAOJ,MAAM,gBACXE,cAAA,CAAAK,mBAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGP;AAAI,IAAI,gBAEXC,cAAA,CAACO,uBAAe,EAAA;AACd,IAAA,kBAAA,EAAkBZ,cAAe;IACjCa,EAAE,EAAEd,GAAG,CAACe,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAEpB,KAAK,CAACoB,OAAkE;AAAAL,IAAAA,QAAA,EAEhFP;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACuB,WAAW,GAAG,qBAAqB;;;;"}
@@ -1,43 +0,0 @@
1
- import { BackslashCircle, ChevronRight } from '@transferwise/icons';
2
- import { useListItemControl } from '../useListItemControl.mjs';
3
- import PrimitiveButton from '../../primitives/PrimitiveButton/PrimitiveButton.mjs';
4
- import '../../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
5
- import { useContext } from 'react';
6
- import { ListItemContext } from '../ListItemContext.mjs';
7
- import { jsx, Fragment } from 'react/jsx-runtime';
8
-
9
- const Navigation = function Navigation({
10
- href = '#',
11
- ...props
12
- }) {
13
- const {
14
- baseItemProps
15
- } = useListItemControl('navigation', {
16
- href,
17
- ...props
18
- });
19
- const {
20
- ids,
21
- describedByIds
22
- } = useContext(ListItemContext);
23
- const isLink = href !== '#';
24
- const icon = /*#__PURE__*/jsx(ChevronRight, {
25
- size: 16
26
- });
27
- if (baseItemProps.disabled) return /*#__PURE__*/jsx(BackslashCircle, {
28
- size: 24
29
- });
30
- return isLink ? /*#__PURE__*/jsx(Fragment, {
31
- children: icon
32
- }) : /*#__PURE__*/jsx(PrimitiveButton, {
33
- "aria-describedby": describedByIds,
34
- id: ids.control,
35
- className: "btn-unstyled wds-list-item-control",
36
- onClick: props.onClick,
37
- children: icon
38
- });
39
- };
40
- Navigation.displayName = 'ListItem.Navigation';
41
-
42
- export { Navigation };
43
- //# sourceMappingURL=ListItemNavigation.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemNavigation.mjs","sources":["../../../src/listItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight, BackslashCircle } from '@transferwise/icons';\nimport type { ButtonProps } from '../../button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href = '#', ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const isLink = href !== '#';\n const icon = <ChevronRight size={16} />;\n\n if (baseItemProps.disabled) return <BackslashCircle size={24} />;\n\n return isLink ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","isLink","icon","_jsx","ChevronRight","size","disabled","BackslashCircle","_Fragment","children","PrimitiveButton","id","control","className","onClick","displayName"],"mappings":";;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;AAAEC,EAAAA,IAAI,GAAG,GAAG;EAAE,GAAGC;AAAK,CAA2B,EAAA;EAC7F,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;AAC3D,EAAA,MAAMC,MAAM,GAAGR,IAAI,KAAK,GAAG;AAC3B,EAAA,MAAMS,IAAI,gBAAGC,GAAA,CAACC,YAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,IAAIV,aAAa,CAACW,QAAQ,EAAE,oBAAOH,GAAA,CAACI,eAAe,EAAA;AAACF,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEhE,EAAA,OAAOJ,MAAM,gBACXE,GAAA,CAAAK,QAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGP;AAAI,IAAI,gBAEXC,GAAA,CAACO,eAAe,EAAA;AACd,IAAA,kBAAA,EAAkBZ,cAAe;IACjCa,EAAE,EAAEd,GAAG,CAACe,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAEpB,KAAK,CAACoB,OAAkE;AAAAL,IAAAA,QAAA,EAEhFP;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACuB,WAAW,GAAG,qBAAqB;;;;"}
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var clsx = require('clsx');
7
- require('../../common/theme.js');
8
- require('../../common/direction.js');
9
- require('../../common/propsValues/control.js');
10
- require('../../common/propsValues/breakpoint.js');
11
- require('../../common/propsValues/size.js');
12
- require('../../common/propsValues/typography.js');
13
- require('../../common/propsValues/width.js');
14
- require('../../common/propsValues/type.js');
15
- require('../../common/propsValues/dateMode.js');
16
- require('../../common/propsValues/monthFormat.js');
17
- require('../../common/propsValues/position.js');
18
- require('../../common/propsValues/layouts.js');
19
- require('../../common/propsValues/status.js');
20
- var sentiment = require('../../common/propsValues/sentiment.js');
21
- require('../../common/propsValues/profileType.js');
22
- require('../../common/propsValues/variant.js');
23
- require('../../common/propsValues/scroll.js');
24
- require('../../common/propsValues/markdownNodeType.js');
25
- require('../../common/fileType.js');
26
- require('@transferwise/icons');
27
- require('react-intl');
28
- require('../../common/closeButton/CloseButton.messages.js');
29
- var jsxRuntime = require('react/jsx-runtime');
30
- var StatusIcon = require('../../statusIcon/StatusIcon.js');
31
- var Body = require('../../body/Body.js');
32
- var ListItemContext = require('../ListItemContext.js');
33
-
34
- const Prompt = ({
35
- sentiment: sentiment$1 = sentiment.Sentiment.NEUTRAL,
36
- children
37
- }) => {
38
- const {
39
- ids
40
- } = React.useContext(ListItemContext.ListItemContext);
41
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
42
- id: ids.prompt,
43
- className: clsx.clsx('wds-list-item-prompt', sentiment$1),
44
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
45
- className: "np-prompt-icon",
46
- children: /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
47
- size: 16,
48
- sentiment: sentiment$1
49
- })
50
- }), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
51
- children: children
52
- })]
53
- });
54
- };
55
- Prompt.displayName = 'ListItem.Prompt';
56
-
57
- exports.Prompt = Prompt;
58
- exports.default = Prompt;
59
- //# sourceMappingURL=ListItemPrompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { clsx } from 'clsx';\nimport { Sentiment } from '../../common';\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\n\nexport type ListItemPromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n children: React.ReactNode;\n};\n\n/**\n * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({ sentiment = Sentiment.NEUTRAL, children }: ListItemPromptProps) => {\n const { ids } = useContext<ListItemContextData>(ListItemContext);\n\n return (\n <div id={ids.prompt} className={clsx('wds-list-item-prompt', sentiment)}>\n <div className=\"np-prompt-icon\">\n <StatusIcon size={16} sentiment={sentiment} />\n </div>\n <Body>{children}</Body>\n </div>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","children","ids","useContext","ListItemContext","_jsxs","id","prompt","className","clsx","_jsx","StatusIcon","size","Body","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,MAAM,GAAGA,CAAC;aAAEC,WAAS,GAAGC,mBAAS,CAACC,OAAO;AAAEC,EAAAA;AAAQ,CAAuB,KAAI;EACzF,MAAM;AAAEC,IAAAA;AAAG,GAAE,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;AAEhE,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;IAAKC,EAAE,EAAEJ,GAAG,CAACK,MAAO;AAACC,IAAAA,SAAS,EAAEC,SAAI,CAAC,sBAAsB,EAAEX,WAAS,CAAE;AAAAG,IAAAA,QAAA,gBACtES,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,gBAAgB;MAAAP,QAAA,eAC7BS,cAAA,CAACC,kBAAU,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;AAACd,QAAAA,SAAS,EAAEA;OAAU;AAC7C,KAAK,CACL,eAAAY,cAAA,CAACG,YAAI,EAAA;AAAAZ,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;AAEAJ,MAAM,CAACiB,WAAW,GAAG,iBAAiB;;;;;"}
@@ -1,54 +0,0 @@
1
- import { useContext } from 'react';
2
- import { clsx } from 'clsx';
3
- import '../../common/theme.mjs';
4
- import '../../common/direction.mjs';
5
- import '../../common/propsValues/control.mjs';
6
- import '../../common/propsValues/breakpoint.mjs';
7
- import '../../common/propsValues/size.mjs';
8
- import '../../common/propsValues/typography.mjs';
9
- import '../../common/propsValues/width.mjs';
10
- import '../../common/propsValues/type.mjs';
11
- import '../../common/propsValues/dateMode.mjs';
12
- import '../../common/propsValues/monthFormat.mjs';
13
- import '../../common/propsValues/position.mjs';
14
- import '../../common/propsValues/layouts.mjs';
15
- import '../../common/propsValues/status.mjs';
16
- import { Sentiment } from '../../common/propsValues/sentiment.mjs';
17
- import '../../common/propsValues/profileType.mjs';
18
- import '../../common/propsValues/variant.mjs';
19
- import '../../common/propsValues/scroll.mjs';
20
- import '../../common/propsValues/markdownNodeType.mjs';
21
- import '../../common/fileType.mjs';
22
- import '@transferwise/icons';
23
- import 'react-intl';
24
- import '../../common/closeButton/CloseButton.messages.mjs';
25
- import { jsxs, jsx } from 'react/jsx-runtime';
26
- import StatusIcon from '../../statusIcon/StatusIcon.mjs';
27
- import Body from '../../body/Body.mjs';
28
- import { ListItemContext } from '../ListItemContext.mjs';
29
-
30
- const Prompt = ({
31
- sentiment = Sentiment.NEUTRAL,
32
- children
33
- }) => {
34
- const {
35
- ids
36
- } = useContext(ListItemContext);
37
- return /*#__PURE__*/jsxs("div", {
38
- id: ids.prompt,
39
- className: clsx('wds-list-item-prompt', sentiment),
40
- children: [/*#__PURE__*/jsx("div", {
41
- className: "np-prompt-icon",
42
- children: /*#__PURE__*/jsx(StatusIcon, {
43
- size: 16,
44
- sentiment: sentiment
45
- })
46
- }), /*#__PURE__*/jsx(Body, {
47
- children: children
48
- })]
49
- });
50
- };
51
- Prompt.displayName = 'ListItem.Prompt';
52
-
53
- export { Prompt, Prompt as default };
54
- //# sourceMappingURL=ListItemPrompt.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { clsx } from 'clsx';\nimport { Sentiment } from '../../common';\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\n\nexport type ListItemPromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n children: React.ReactNode;\n};\n\n/**\n * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({ sentiment = Sentiment.NEUTRAL, children }: ListItemPromptProps) => {\n const { ids } = useContext<ListItemContextData>(ListItemContext);\n\n return (\n <div id={ids.prompt} className={clsx('wds-list-item-prompt', sentiment)}>\n <div className=\"np-prompt-icon\">\n <StatusIcon size={16} sentiment={sentiment} />\n </div>\n <Body>{children}</Body>\n </div>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","children","ids","useContext","ListItemContext","_jsxs","id","prompt","className","clsx","_jsx","StatusIcon","size","Body","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,MAAM,GAAGA,CAAC;EAAEC,SAAS,GAAGC,SAAS,CAACC,OAAO;AAAEC,EAAAA;AAAQ,CAAuB,KAAI;EACzF,MAAM;AAAEC,IAAAA;AAAG,GAAE,GAAGC,UAAU,CAAsBC,eAAe,CAAC;AAEhE,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;IAAKC,EAAE,EAAEJ,GAAG,CAACK,MAAO;AAACC,IAAAA,SAAS,EAAEC,IAAI,CAAC,sBAAsB,EAAEX,SAAS,CAAE;AAAAG,IAAAA,QAAA,gBACtES,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,gBAAgB;MAAAP,QAAA,eAC7BS,GAAA,CAACC,UAAU,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;AAACd,QAAAA,SAAS,EAAEA;OAAU;AAC7C,KAAK,CACL,eAAAY,GAAA,CAACG,IAAI,EAAA;AAAAZ,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;AAEAJ,MAAM,CAACiB,WAAW,GAAG,iBAAiB;;;;"}