@unif/react-native-chat 2.0.0

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 (345) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +48 -0
  3. package/lib/module/actions/index.js +2 -0
  4. package/lib/module/actions/index.js.map +1 -0
  5. package/lib/module/actions/types.js +4 -0
  6. package/lib/module/actions/types.js.map +1 -0
  7. package/lib/module/components/Attachments/AttachmentItem.js +108 -0
  8. package/lib/module/components/Attachments/AttachmentItem.js.map +1 -0
  9. package/lib/module/components/Attachments/Attachments.js +60 -0
  10. package/lib/module/components/Attachments/Attachments.js.map +1 -0
  11. package/lib/module/components/Attachments/constants.js +18 -0
  12. package/lib/module/components/Attachments/constants.js.map +1 -0
  13. package/lib/module/components/Attachments/index.js +4 -0
  14. package/lib/module/components/Attachments/index.js.map +1 -0
  15. package/lib/module/components/Attachments/styles.js +83 -0
  16. package/lib/module/components/Attachments/styles.js.map +1 -0
  17. package/lib/module/components/Attachments/types.js +4 -0
  18. package/lib/module/components/Attachments/types.js.map +1 -0
  19. package/lib/module/components/Chat/Chat.js +29 -0
  20. package/lib/module/components/Chat/Chat.js.map +1 -0
  21. package/lib/module/components/Chat/index.js +4 -0
  22. package/lib/module/components/Chat/index.js.map +1 -0
  23. package/lib/module/components/Chat/styles.js +17 -0
  24. package/lib/module/components/Chat/styles.js.map +1 -0
  25. package/lib/module/components/Chat/types.js +4 -0
  26. package/lib/module/components/Chat/types.js.map +1 -0
  27. package/lib/module/components/Citation/Citation.js +32 -0
  28. package/lib/module/components/Citation/Citation.js.map +1 -0
  29. package/lib/module/components/Citation/index.js +4 -0
  30. package/lib/module/components/Citation/index.js.map +1 -0
  31. package/lib/module/components/Citation/styles.js +15 -0
  32. package/lib/module/components/Citation/styles.js.map +1 -0
  33. package/lib/module/components/Citation/types.js +2 -0
  34. package/lib/module/components/Citation/types.js.map +1 -0
  35. package/lib/module/components/Composer/Composer.js +149 -0
  36. package/lib/module/components/Composer/Composer.js.map +1 -0
  37. package/lib/module/components/Composer/constants.js +14 -0
  38. package/lib/module/components/Composer/constants.js.map +1 -0
  39. package/lib/module/components/Composer/index.js +4 -0
  40. package/lib/module/components/Composer/index.js.map +1 -0
  41. package/lib/module/components/Composer/styles.js +43 -0
  42. package/lib/module/components/Composer/styles.js.map +1 -0
  43. package/lib/module/components/Composer/types.js +4 -0
  44. package/lib/module/components/Composer/types.js.map +1 -0
  45. package/lib/module/components/Confirmation/Confirmation.js +56 -0
  46. package/lib/module/components/Confirmation/Confirmation.js.map +1 -0
  47. package/lib/module/components/Confirmation/constants.js +10 -0
  48. package/lib/module/components/Confirmation/constants.js.map +1 -0
  49. package/lib/module/components/Confirmation/index.js +4 -0
  50. package/lib/module/components/Confirmation/index.js.map +1 -0
  51. package/lib/module/components/Confirmation/styles.js +34 -0
  52. package/lib/module/components/Confirmation/styles.js.map +1 -0
  53. package/lib/module/components/Confirmation/types.js +4 -0
  54. package/lib/module/components/Confirmation/types.js.map +1 -0
  55. package/lib/module/components/Feedback/Feedback.js +82 -0
  56. package/lib/module/components/Feedback/Feedback.js.map +1 -0
  57. package/lib/module/components/Feedback/constants.js +15 -0
  58. package/lib/module/components/Feedback/constants.js.map +1 -0
  59. package/lib/module/components/Feedback/index.js +4 -0
  60. package/lib/module/components/Feedback/index.js.map +1 -0
  61. package/lib/module/components/Feedback/styles.js +30 -0
  62. package/lib/module/components/Feedback/styles.js.map +1 -0
  63. package/lib/module/components/Feedback/types.js +4 -0
  64. package/lib/module/components/Feedback/types.js.map +1 -0
  65. package/lib/module/components/Message/MarkdownContent/MarkdownContent.js +68 -0
  66. package/lib/module/components/Message/MarkdownContent/MarkdownContent.js.map +1 -0
  67. package/lib/module/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.js +53 -0
  68. package/lib/module/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.js.map +1 -0
  69. package/lib/module/components/Message/MarkdownContent/MarkdownImage/styles.js +10 -0
  70. package/lib/module/components/Message/MarkdownContent/MarkdownImage/styles.js.map +1 -0
  71. package/lib/module/components/Message/MarkdownContent/MarkdownImage/types.js +2 -0
  72. package/lib/module/components/Message/MarkdownContent/MarkdownImage/types.js.map +1 -0
  73. package/lib/module/components/Message/MarkdownContent/styles.js +85 -0
  74. package/lib/module/components/Message/MarkdownContent/styles.js.map +1 -0
  75. package/lib/module/components/Message/MarkdownContent/types.js +2 -0
  76. package/lib/module/components/Message/MarkdownContent/types.js.map +1 -0
  77. package/lib/module/components/Message/Message.js +87 -0
  78. package/lib/module/components/Message/Message.js.map +1 -0
  79. package/lib/module/components/Message/constants.js +4 -0
  80. package/lib/module/components/Message/constants.js.map +1 -0
  81. package/lib/module/components/Message/index.js +4 -0
  82. package/lib/module/components/Message/index.js.map +1 -0
  83. package/lib/module/components/Message/isNestedAction.js +14 -0
  84. package/lib/module/components/Message/isNestedAction.js.map +1 -0
  85. package/lib/module/components/Message/styles.js +73 -0
  86. package/lib/module/components/Message/styles.js.map +1 -0
  87. package/lib/module/components/Message/types.js +4 -0
  88. package/lib/module/components/Message/types.js.map +1 -0
  89. package/lib/module/components/MessageList/MessageList.js +223 -0
  90. package/lib/module/components/MessageList/MessageList.js.map +1 -0
  91. package/lib/module/components/MessageList/constants.js +4 -0
  92. package/lib/module/components/MessageList/constants.js.map +1 -0
  93. package/lib/module/components/MessageList/index.js +4 -0
  94. package/lib/module/components/MessageList/index.js.map +1 -0
  95. package/lib/module/components/MessageList/styles.js +20 -0
  96. package/lib/module/components/MessageList/styles.js.map +1 -0
  97. package/lib/module/components/MessageList/types.js +4 -0
  98. package/lib/module/components/MessageList/types.js.map +1 -0
  99. package/lib/module/components/MessageList/webPrependAnchor/constants.js +4 -0
  100. package/lib/module/components/MessageList/webPrependAnchor/constants.js.map +1 -0
  101. package/lib/module/components/MessageList/webPrependAnchor/index.js +4 -0
  102. package/lib/module/components/MessageList/webPrependAnchor/index.js.map +1 -0
  103. package/lib/module/components/MessageList/webPrependAnchor/types.js +4 -0
  104. package/lib/module/components/MessageList/webPrependAnchor/types.js.map +1 -0
  105. package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.js +19 -0
  106. package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.js.map +1 -0
  107. package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.js +208 -0
  108. package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.js.map +1 -0
  109. package/lib/module/components/Process/Process.js +121 -0
  110. package/lib/module/components/Process/Process.js.map +1 -0
  111. package/lib/module/components/Process/constants.js +17 -0
  112. package/lib/module/components/Process/constants.js.map +1 -0
  113. package/lib/module/components/Process/index.js +4 -0
  114. package/lib/module/components/Process/index.js.map +1 -0
  115. package/lib/module/components/Process/styles.js +77 -0
  116. package/lib/module/components/Process/styles.js.map +1 -0
  117. package/lib/module/components/Process/types.js +4 -0
  118. package/lib/module/components/Process/types.js.map +1 -0
  119. package/lib/module/components/Sources/Sources.js +64 -0
  120. package/lib/module/components/Sources/Sources.js.map +1 -0
  121. package/lib/module/components/Sources/constants.js +4 -0
  122. package/lib/module/components/Sources/constants.js.map +1 -0
  123. package/lib/module/components/Sources/index.js +4 -0
  124. package/lib/module/components/Sources/index.js.map +1 -0
  125. package/lib/module/components/Sources/styles.js +52 -0
  126. package/lib/module/components/Sources/styles.js.map +1 -0
  127. package/lib/module/components/Sources/types.js +4 -0
  128. package/lib/module/components/Sources/types.js.map +1 -0
  129. package/lib/module/components/Suggestions/Suggestions.js +31 -0
  130. package/lib/module/components/Suggestions/Suggestions.js.map +1 -0
  131. package/lib/module/components/Suggestions/index.js +4 -0
  132. package/lib/module/components/Suggestions/index.js.map +1 -0
  133. package/lib/module/components/Suggestions/styles.js +18 -0
  134. package/lib/module/components/Suggestions/styles.js.map +1 -0
  135. package/lib/module/components/Suggestions/types.js +4 -0
  136. package/lib/module/components/Suggestions/types.js.map +1 -0
  137. package/lib/module/index.js +14 -0
  138. package/lib/module/index.js.map +1 -0
  139. package/lib/module/package.json +1 -0
  140. package/lib/typescript/package.json +1 -0
  141. package/lib/typescript/src/actions/index.d.ts +2 -0
  142. package/lib/typescript/src/actions/index.d.ts.map +1 -0
  143. package/lib/typescript/src/actions/types.d.ts +11 -0
  144. package/lib/typescript/src/actions/types.d.ts.map +1 -0
  145. package/lib/typescript/src/components/Attachments/AttachmentItem.d.ts +3 -0
  146. package/lib/typescript/src/components/Attachments/AttachmentItem.d.ts.map +1 -0
  147. package/lib/typescript/src/components/Attachments/Attachments.d.ts +3 -0
  148. package/lib/typescript/src/components/Attachments/Attachments.d.ts.map +1 -0
  149. package/lib/typescript/src/components/Attachments/constants.d.ts +13 -0
  150. package/lib/typescript/src/components/Attachments/constants.d.ts.map +1 -0
  151. package/lib/typescript/src/components/Attachments/index.d.ts +3 -0
  152. package/lib/typescript/src/components/Attachments/index.d.ts.map +1 -0
  153. package/lib/typescript/src/components/Attachments/styles.d.ts +80 -0
  154. package/lib/typescript/src/components/Attachments/styles.d.ts.map +1 -0
  155. package/lib/typescript/src/components/Attachments/types.d.ts +34 -0
  156. package/lib/typescript/src/components/Attachments/types.d.ts.map +1 -0
  157. package/lib/typescript/src/components/Chat/Chat.d.ts +3 -0
  158. package/lib/typescript/src/components/Chat/Chat.d.ts.map +1 -0
  159. package/lib/typescript/src/components/Chat/index.d.ts +3 -0
  160. package/lib/typescript/src/components/Chat/index.d.ts.map +1 -0
  161. package/lib/typescript/src/components/Chat/styles.d.ts +15 -0
  162. package/lib/typescript/src/components/Chat/styles.d.ts.map +1 -0
  163. package/lib/typescript/src/components/Chat/types.d.ts +12 -0
  164. package/lib/typescript/src/components/Chat/types.d.ts.map +1 -0
  165. package/lib/typescript/src/components/Citation/Citation.d.ts +3 -0
  166. package/lib/typescript/src/components/Citation/Citation.d.ts.map +1 -0
  167. package/lib/typescript/src/components/Citation/index.d.ts +3 -0
  168. package/lib/typescript/src/components/Citation/index.d.ts.map +1 -0
  169. package/lib/typescript/src/components/Citation/styles.d.ts +12 -0
  170. package/lib/typescript/src/components/Citation/styles.d.ts.map +1 -0
  171. package/lib/typescript/src/components/Citation/types.d.ts +8 -0
  172. package/lib/typescript/src/components/Citation/types.d.ts.map +1 -0
  173. package/lib/typescript/src/components/Composer/Composer.d.ts +4 -0
  174. package/lib/typescript/src/components/Composer/Composer.d.ts.map +1 -0
  175. package/lib/typescript/src/components/Composer/constants.d.ts +12 -0
  176. package/lib/typescript/src/components/Composer/constants.d.ts.map +1 -0
  177. package/lib/typescript/src/components/Composer/index.d.ts +3 -0
  178. package/lib/typescript/src/components/Composer/index.d.ts.map +1 -0
  179. package/lib/typescript/src/components/Composer/styles.d.ts +40 -0
  180. package/lib/typescript/src/components/Composer/styles.d.ts.map +1 -0
  181. package/lib/typescript/src/components/Composer/types.d.ts +53 -0
  182. package/lib/typescript/src/components/Composer/types.d.ts.map +1 -0
  183. package/lib/typescript/src/components/Confirmation/Confirmation.d.ts +3 -0
  184. package/lib/typescript/src/components/Confirmation/Confirmation.d.ts.map +1 -0
  185. package/lib/typescript/src/components/Confirmation/constants.d.ts +5 -0
  186. package/lib/typescript/src/components/Confirmation/constants.d.ts.map +1 -0
  187. package/lib/typescript/src/components/Confirmation/index.d.ts +3 -0
  188. package/lib/typescript/src/components/Confirmation/index.d.ts.map +1 -0
  189. package/lib/typescript/src/components/Confirmation/styles.d.ts +31 -0
  190. package/lib/typescript/src/components/Confirmation/styles.d.ts.map +1 -0
  191. package/lib/typescript/src/components/Confirmation/types.d.ts +19 -0
  192. package/lib/typescript/src/components/Confirmation/types.d.ts.map +1 -0
  193. package/lib/typescript/src/components/Feedback/Feedback.d.ts +3 -0
  194. package/lib/typescript/src/components/Feedback/Feedback.d.ts.map +1 -0
  195. package/lib/typescript/src/components/Feedback/constants.d.ts +5 -0
  196. package/lib/typescript/src/components/Feedback/constants.d.ts.map +1 -0
  197. package/lib/typescript/src/components/Feedback/index.d.ts +3 -0
  198. package/lib/typescript/src/components/Feedback/index.d.ts.map +1 -0
  199. package/lib/typescript/src/components/Feedback/styles.d.ts +27 -0
  200. package/lib/typescript/src/components/Feedback/styles.d.ts.map +1 -0
  201. package/lib/typescript/src/components/Feedback/types.d.ts +12 -0
  202. package/lib/typescript/src/components/Feedback/types.d.ts.map +1 -0
  203. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownContent.d.ts +3 -0
  204. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownContent.d.ts.map +1 -0
  205. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.d.ts +3 -0
  206. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.d.ts.map +1 -0
  207. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/styles.d.ts +7 -0
  208. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/styles.d.ts.map +1 -0
  209. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/types.d.ts +9 -0
  210. package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/types.d.ts.map +1 -0
  211. package/lib/typescript/src/components/Message/MarkdownContent/styles.d.ts +92 -0
  212. package/lib/typescript/src/components/Message/MarkdownContent/styles.d.ts.map +1 -0
  213. package/lib/typescript/src/components/Message/MarkdownContent/types.d.ts +5 -0
  214. package/lib/typescript/src/components/Message/MarkdownContent/types.d.ts.map +1 -0
  215. package/lib/typescript/src/components/Message/Message.d.ts +3 -0
  216. package/lib/typescript/src/components/Message/Message.d.ts.map +1 -0
  217. package/lib/typescript/src/components/Message/constants.d.ts +2 -0
  218. package/lib/typescript/src/components/Message/constants.d.ts.map +1 -0
  219. package/lib/typescript/src/components/Message/index.d.ts +3 -0
  220. package/lib/typescript/src/components/Message/index.d.ts.map +1 -0
  221. package/lib/typescript/src/components/Message/isNestedAction.d.ts +3 -0
  222. package/lib/typescript/src/components/Message/isNestedAction.d.ts.map +1 -0
  223. package/lib/typescript/src/components/Message/styles.d.ts +70 -0
  224. package/lib/typescript/src/components/Message/styles.d.ts.map +1 -0
  225. package/lib/typescript/src/components/Message/types.d.ts +44 -0
  226. package/lib/typescript/src/components/Message/types.d.ts.map +1 -0
  227. package/lib/typescript/src/components/MessageList/MessageList.d.ts +4 -0
  228. package/lib/typescript/src/components/MessageList/MessageList.d.ts.map +1 -0
  229. package/lib/typescript/src/components/MessageList/constants.d.ts +2 -0
  230. package/lib/typescript/src/components/MessageList/constants.d.ts.map +1 -0
  231. package/lib/typescript/src/components/MessageList/index.d.ts +3 -0
  232. package/lib/typescript/src/components/MessageList/index.d.ts.map +1 -0
  233. package/lib/typescript/src/components/MessageList/styles.d.ts +16 -0
  234. package/lib/typescript/src/components/MessageList/styles.d.ts.map +1 -0
  235. package/lib/typescript/src/components/MessageList/types.d.ts +36 -0
  236. package/lib/typescript/src/components/MessageList/types.d.ts.map +1 -0
  237. package/lib/typescript/src/components/MessageList/webPrependAnchor/constants.d.ts +2 -0
  238. package/lib/typescript/src/components/MessageList/webPrependAnchor/constants.d.ts.map +1 -0
  239. package/lib/typescript/src/components/MessageList/webPrependAnchor/index.d.ts +3 -0
  240. package/lib/typescript/src/components/MessageList/webPrependAnchor/index.d.ts.map +1 -0
  241. package/lib/typescript/src/components/MessageList/webPrependAnchor/types.d.ts +72 -0
  242. package/lib/typescript/src/components/MessageList/webPrependAnchor/types.d.ts.map +1 -0
  243. package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.d.ts +3 -0
  244. package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.d.ts.map +1 -0
  245. package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.d.ts +3 -0
  246. package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.d.ts.map +1 -0
  247. package/lib/typescript/src/components/Process/Process.d.ts +3 -0
  248. package/lib/typescript/src/components/Process/Process.d.ts.map +1 -0
  249. package/lib/typescript/src/components/Process/constants.d.ts +5 -0
  250. package/lib/typescript/src/components/Process/constants.d.ts.map +1 -0
  251. package/lib/typescript/src/components/Process/index.d.ts +3 -0
  252. package/lib/typescript/src/components/Process/index.d.ts.map +1 -0
  253. package/lib/typescript/src/components/Process/styles.d.ts +74 -0
  254. package/lib/typescript/src/components/Process/styles.d.ts.map +1 -0
  255. package/lib/typescript/src/components/Process/types.d.ts +32 -0
  256. package/lib/typescript/src/components/Process/types.d.ts.map +1 -0
  257. package/lib/typescript/src/components/Sources/Sources.d.ts +3 -0
  258. package/lib/typescript/src/components/Sources/Sources.d.ts.map +1 -0
  259. package/lib/typescript/src/components/Sources/constants.d.ts +2 -0
  260. package/lib/typescript/src/components/Sources/constants.d.ts.map +1 -0
  261. package/lib/typescript/src/components/Sources/index.d.ts +3 -0
  262. package/lib/typescript/src/components/Sources/index.d.ts.map +1 -0
  263. package/lib/typescript/src/components/Sources/styles.d.ts +49 -0
  264. package/lib/typescript/src/components/Sources/styles.d.ts.map +1 -0
  265. package/lib/typescript/src/components/Sources/types.d.ts +16 -0
  266. package/lib/typescript/src/components/Sources/types.d.ts.map +1 -0
  267. package/lib/typescript/src/components/Suggestions/Suggestions.d.ts +3 -0
  268. package/lib/typescript/src/components/Suggestions/Suggestions.d.ts.map +1 -0
  269. package/lib/typescript/src/components/Suggestions/index.d.ts +3 -0
  270. package/lib/typescript/src/components/Suggestions/index.d.ts.map +1 -0
  271. package/lib/typescript/src/components/Suggestions/styles.d.ts +14 -0
  272. package/lib/typescript/src/components/Suggestions/styles.d.ts.map +1 -0
  273. package/lib/typescript/src/components/Suggestions/types.d.ts +18 -0
  274. package/lib/typescript/src/components/Suggestions/types.d.ts.map +1 -0
  275. package/lib/typescript/src/index.d.ts +24 -0
  276. package/lib/typescript/src/index.d.ts.map +1 -0
  277. package/package.json +178 -0
  278. package/src/actions/index.ts +1 -0
  279. package/src/actions/types.ts +11 -0
  280. package/src/components/Attachments/AttachmentItem.tsx +139 -0
  281. package/src/components/Attachments/Attachments.tsx +72 -0
  282. package/src/components/Attachments/constants.ts +21 -0
  283. package/src/components/Attachments/index.ts +6 -0
  284. package/src/components/Attachments/styles.ts +54 -0
  285. package/src/components/Attachments/types.ts +38 -0
  286. package/src/components/Chat/Chat.tsx +26 -0
  287. package/src/components/Chat/index.ts +2 -0
  288. package/src/components/Chat/styles.ts +12 -0
  289. package/src/components/Chat/types.ts +11 -0
  290. package/src/components/Citation/Citation.tsx +33 -0
  291. package/src/components/Citation/index.ts +2 -0
  292. package/src/components/Citation/styles.ts +15 -0
  293. package/src/components/Citation/types.ts +7 -0
  294. package/src/components/Composer/Composer.tsx +208 -0
  295. package/src/components/Composer/constants.ts +11 -0
  296. package/src/components/Composer/index.ts +11 -0
  297. package/src/components/Composer/styles.ts +25 -0
  298. package/src/components/Composer/types.ts +61 -0
  299. package/src/components/Confirmation/Confirmation.tsx +63 -0
  300. package/src/components/Confirmation/constants.ts +12 -0
  301. package/src/components/Confirmation/index.ts +2 -0
  302. package/src/components/Confirmation/styles.ts +39 -0
  303. package/src/components/Confirmation/types.ts +21 -0
  304. package/src/components/Feedback/Feedback.tsx +87 -0
  305. package/src/components/Feedback/constants.ts +16 -0
  306. package/src/components/Feedback/index.ts +2 -0
  307. package/src/components/Feedback/styles.ts +30 -0
  308. package/src/components/Feedback/types.ts +13 -0
  309. package/src/components/Message/MarkdownContent/MarkdownContent.tsx +70 -0
  310. package/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.tsx +52 -0
  311. package/src/components/Message/MarkdownContent/MarkdownImage/styles.ts +4 -0
  312. package/src/components/Message/MarkdownContent/MarkdownImage/types.ts +8 -0
  313. package/src/components/Message/MarkdownContent/styles.ts +61 -0
  314. package/src/components/Message/MarkdownContent/types.ts +4 -0
  315. package/src/components/Message/Message.tsx +137 -0
  316. package/src/components/Message/constants.ts +2 -0
  317. package/src/components/Message/index.ts +10 -0
  318. package/src/components/Message/isNestedAction.ts +22 -0
  319. package/src/components/Message/styles.ts +42 -0
  320. package/src/components/Message/types.ts +45 -0
  321. package/src/components/MessageList/MessageList.tsx +238 -0
  322. package/src/components/MessageList/constants.ts +1 -0
  323. package/src/components/MessageList/index.ts +6 -0
  324. package/src/components/MessageList/styles.ts +7 -0
  325. package/src/components/MessageList/types.ts +36 -0
  326. package/src/components/MessageList/webPrependAnchor/constants.ts +6 -0
  327. package/src/components/MessageList/webPrependAnchor/index.ts +7 -0
  328. package/src/components/MessageList/webPrependAnchor/types.ts +92 -0
  329. package/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.ts +27 -0
  330. package/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.ts +293 -0
  331. package/src/components/Process/Process.tsx +160 -0
  332. package/src/components/Process/constants.ts +22 -0
  333. package/src/components/Process/index.ts +9 -0
  334. package/src/components/Process/styles.ts +77 -0
  335. package/src/components/Process/types.ts +39 -0
  336. package/src/components/Sources/Sources.tsx +70 -0
  337. package/src/components/Sources/constants.ts +1 -0
  338. package/src/components/Sources/index.ts +2 -0
  339. package/src/components/Sources/styles.ts +59 -0
  340. package/src/components/Sources/types.ts +17 -0
  341. package/src/components/Suggestions/Suggestions.tsx +34 -0
  342. package/src/components/Suggestions/index.ts +2 -0
  343. package/src/components/Suggestions/styles.ts +16 -0
  344. package/src/components/Suggestions/types.ts +19 -0
  345. package/src/index.tsx +61 -0
@@ -0,0 +1,6 @@
1
+ export const USER_INTERACTION_EVENTS = [
2
+ 'wheel',
3
+ 'touchstart',
4
+ 'pointerdown',
5
+ 'keydown',
6
+ ] as const;
@@ -0,0 +1,7 @@
1
+ export { useWebPrependAnchor } from './useWebPrependAnchor';
2
+ export type {
3
+ UseWebPrependAnchorOptions,
4
+ WebPrependAnchorHandle,
5
+ WebPrependAnchorListHandle,
6
+ WebPrependScrollToOffsetOptions,
7
+ } from './types';
@@ -0,0 +1,92 @@
1
+ import type { RefObject } from 'react';
2
+
3
+ export interface WebRectLike {
4
+ top: number;
5
+ bottom: number;
6
+ }
7
+
8
+ export interface WebEventListenerOptions {
9
+ capture?: boolean;
10
+ passive?: boolean;
11
+ }
12
+
13
+ export interface WebElementLike {
14
+ id: string;
15
+ scrollTop: number;
16
+ scrollHeight: number;
17
+ getBoundingClientRect(): WebRectLike;
18
+ querySelectorAll(selector: string): ArrayLike<unknown>;
19
+ contains(candidate: unknown): boolean;
20
+ addEventListener(
21
+ type: string,
22
+ listener: () => void,
23
+ options?: WebEventListenerOptions
24
+ ): void;
25
+ removeEventListener(
26
+ type: string,
27
+ listener: () => void,
28
+ options?: WebEventListenerOptions
29
+ ): void;
30
+ }
31
+
32
+ export interface WebObserverLike {
33
+ observe(target: unknown, options?: unknown): void;
34
+ unobserve?(target: unknown): void;
35
+ disconnect(): void;
36
+ }
37
+
38
+ export interface WebObserverConstructor {
39
+ new (callback: () => void): WebObserverLike;
40
+ }
41
+
42
+ export interface WebDocumentLike {
43
+ getElementById(id: string): unknown;
44
+ }
45
+
46
+ export interface WebGlobals {
47
+ document?: WebDocumentLike;
48
+ MutationObserver?: WebObserverConstructor;
49
+ ResizeObserver?: WebObserverConstructor;
50
+ requestAnimationFrame?(callback: () => void): number;
51
+ cancelAnimationFrame?(frame: number): void;
52
+ }
53
+
54
+ export interface WebAnchorSnapshot {
55
+ id: string;
56
+ top: number;
57
+ scrollHeight: number;
58
+ scrollTop: number;
59
+ }
60
+
61
+ export interface WebPrependScrollToOffsetOptions {
62
+ offset: number;
63
+ animated?: boolean;
64
+ }
65
+
66
+ export interface WebPrependAnchorListHandle {
67
+ getScrollableNode(): unknown;
68
+ scrollToOffset(options: WebPrependScrollToOffsetOptions): void;
69
+ }
70
+
71
+ export interface WebPrependAnchorConnection {
72
+ list: WebPrependAnchorListHandle;
73
+ scroller: WebElementLike;
74
+ mutationObserver?: WebObserverLike;
75
+ resizeObserver?: WebObserverLike;
76
+ resizeTargets: Set<WebElementLike>;
77
+ userInteraction(): void;
78
+ scroll(): void;
79
+ }
80
+
81
+ export interface UseWebPrependAnchorOptions {
82
+ listRef: RefObject<WebPrependAnchorListHandle | null>;
83
+ itemsIdentity: unknown;
84
+ keys: readonly string[];
85
+ }
86
+
87
+ export interface WebPrependAnchorHandle {
88
+ rowNativeIDPrefix: string;
89
+ getRowNativeID(key: string): string;
90
+ preservingPrependRef: RefObject<boolean>;
91
+ cancelPrependPreservation(): void;
92
+ }
@@ -0,0 +1,27 @@
1
+ import { useCallback, useId, useRef } from 'react';
2
+ import type {
3
+ UseWebPrependAnchorOptions,
4
+ WebPrependAnchorHandle,
5
+ } from './types';
6
+
7
+ export function useWebPrependAnchor(
8
+ _options: UseWebPrependAnchorOptions
9
+ ): WebPrependAnchorHandle {
10
+ const instanceId = useId();
11
+ const rowNativeIDPrefix = `unif-message-row-${encodeURIComponent(instanceId)}`;
12
+ const preservingPrependRef = useRef(false);
13
+ const getRowNativeID = useCallback(
14
+ (key: string) => `${rowNativeIDPrefix}-${encodeURIComponent(key)}`,
15
+ [rowNativeIDPrefix]
16
+ );
17
+ const cancelPrependPreservation = useCallback(() => {
18
+ preservingPrependRef.current = false;
19
+ }, []);
20
+
21
+ return {
22
+ rowNativeIDPrefix,
23
+ getRowNativeID,
24
+ preservingPrependRef,
25
+ cancelPrependPreservation,
26
+ };
27
+ }
@@ -0,0 +1,293 @@
1
+ import { useId, useLayoutEffect, useRef } from 'react';
2
+ import { Platform } from 'react-native';
3
+ import { USER_INTERACTION_EVENTS } from './constants';
4
+ import type {
5
+ UseWebPrependAnchorOptions,
6
+ WebAnchorSnapshot,
7
+ WebElementLike,
8
+ WebGlobals,
9
+ WebPrependAnchorHandle,
10
+ WebPrependAnchorConnection,
11
+ } from './types';
12
+
13
+ function isWebElementLike(value: unknown): value is WebElementLike {
14
+ if (!value || typeof value !== 'object') return false;
15
+ const candidate = value as Partial<WebElementLike>;
16
+ return (
17
+ typeof candidate.scrollTop === 'number' &&
18
+ typeof candidate.scrollHeight === 'number' &&
19
+ typeof candidate.getBoundingClientRect === 'function' &&
20
+ typeof candidate.querySelectorAll === 'function' &&
21
+ typeof candidate.contains === 'function' &&
22
+ typeof candidate.addEventListener === 'function' &&
23
+ typeof candidate.removeEventListener === 'function'
24
+ );
25
+ }
26
+
27
+ function sameKeys(left: readonly string[], right: readonly string[]): boolean {
28
+ return (
29
+ left.length === right.length &&
30
+ left.every((key, index) => key === right[index])
31
+ );
32
+ }
33
+
34
+ function isPurePrepend(
35
+ previous: readonly string[],
36
+ current: readonly string[]
37
+ ): boolean {
38
+ const added = current.length - previous.length;
39
+ return (
40
+ previous.length > 0 &&
41
+ added > 0 &&
42
+ previous.every((key, index) => current[index + added] === key)
43
+ );
44
+ }
45
+
46
+ function disconnectConnection(
47
+ connection: WebPrependAnchorConnection | undefined
48
+ ) {
49
+ if (!connection) return;
50
+ connection.mutationObserver?.disconnect();
51
+ connection.resizeObserver?.disconnect();
52
+ connection.resizeTargets.clear();
53
+ USER_INTERACTION_EVENTS.forEach((eventName) =>
54
+ connection.scroller.removeEventListener(
55
+ eventName,
56
+ connection.userInteraction,
57
+ { capture: true }
58
+ )
59
+ );
60
+ connection.scroller.removeEventListener('scroll', connection.scroll);
61
+ }
62
+
63
+ export function useWebPrependAnchor({
64
+ listRef,
65
+ itemsIdentity,
66
+ keys,
67
+ }: UseWebPrependAnchorOptions): WebPrependAnchorHandle {
68
+ const instanceId = useId();
69
+ const rowNativeIDPrefix = `unif-message-row-${encodeURIComponent(instanceId)}`;
70
+ const preservingPrependRef = useRef(false);
71
+ const previousIdentityRef = useRef<unknown>(itemsIdentity);
72
+ const previousKeysRef = useRef<readonly string[] | undefined>(undefined);
73
+ const lastAnchorRef = useRef<WebAnchorSnapshot | undefined>(undefined);
74
+ const preservationRef = useRef<WebAnchorSnapshot | undefined>(undefined);
75
+ const connectionRef = useRef<WebPrependAnchorConnection | undefined>(
76
+ undefined
77
+ );
78
+ const frameRef = useRef<number | undefined>(undefined);
79
+
80
+ const globals = globalThis as unknown as WebGlobals;
81
+
82
+ const getRowNativeID = (key: string) =>
83
+ `${rowNativeIDPrefix}-${encodeURIComponent(key)}`;
84
+
85
+ const getRows = (scroller: WebElementLike): WebElementLike[] =>
86
+ Array.from(scroller.querySelectorAll('[id]')).filter(
87
+ (candidate): candidate is WebElementLike =>
88
+ isWebElementLike(candidate) &&
89
+ candidate.id.startsWith(`${rowNativeIDPrefix}-`)
90
+ );
91
+
92
+ const findRow = (
93
+ scroller: WebElementLike,
94
+ id: string
95
+ ): WebElementLike | undefined => {
96
+ const candidate = globals.document?.getElementById(id);
97
+ return isWebElementLike(candidate) && scroller.contains(candidate)
98
+ ? candidate
99
+ : undefined;
100
+ };
101
+
102
+ const captureAnchor = (connection: WebPrependAnchorConnection) => {
103
+ const viewport = connection.scroller.getBoundingClientRect();
104
+ const firstVisible = getRows(connection.scroller).find((row) => {
105
+ const rect = row.getBoundingClientRect();
106
+ return rect.bottom > viewport.top && rect.top < viewport.bottom;
107
+ });
108
+ if (!firstVisible) return;
109
+ lastAnchorRef.current = {
110
+ id: firstVisible.id,
111
+ top: firstVisible.getBoundingClientRect().top - viewport.top,
112
+ scrollHeight: connection.scroller.scrollHeight,
113
+ scrollTop: connection.scroller.scrollTop,
114
+ };
115
+ };
116
+
117
+ const refreshResizeTargets = (connection: WebPrependAnchorConnection) => {
118
+ const resizeObserver = connection.resizeObserver;
119
+ if (!resizeObserver) return;
120
+ const nextTargets = new Set([
121
+ connection.scroller,
122
+ ...getRows(connection.scroller),
123
+ ]);
124
+ connection.resizeTargets.forEach((target) => {
125
+ if (!nextTargets.has(target)) resizeObserver.unobserve?.(target);
126
+ });
127
+ nextTargets.forEach((target) => {
128
+ if (!connection.resizeTargets.has(target)) resizeObserver.observe(target);
129
+ });
130
+ connection.resizeTargets = nextTargets;
131
+ };
132
+
133
+ const correctPrepend = (connection: WebPrependAnchorConnection) => {
134
+ const preservation = preservationRef.current;
135
+ if (!preservation) return;
136
+ const anchor = findRow(connection.scroller, preservation.id);
137
+ if (anchor) {
138
+ const viewport = connection.scroller.getBoundingClientRect();
139
+ const currentTop = anchor.getBoundingClientRect().top - viewport.top;
140
+ const delta = currentTop - preservation.top;
141
+ if (Math.abs(delta) > 0.5) {
142
+ connection.list.scrollToOffset({
143
+ offset: Math.max(0, connection.scroller.scrollTop + delta),
144
+ animated: false,
145
+ });
146
+ }
147
+ return;
148
+ }
149
+
150
+ const heightDelta = Math.max(
151
+ 0,
152
+ connection.scroller.scrollHeight - preservation.scrollHeight
153
+ );
154
+ if (heightDelta > 0) {
155
+ connection.list.scrollToOffset({
156
+ offset: Math.max(0, preservation.scrollTop + heightDelta),
157
+ animated: false,
158
+ });
159
+ }
160
+ };
161
+
162
+ const runFrame = () => {
163
+ frameRef.current = undefined;
164
+ const connection = connectionRef.current;
165
+ if (!connection) return;
166
+ refreshResizeTargets(connection);
167
+ if (preservingPrependRef.current) correctPrepend(connection);
168
+ else captureAnchor(connection);
169
+ };
170
+
171
+ const scheduleFrame = () => {
172
+ if (frameRef.current !== undefined) return;
173
+ if (globals.requestAnimationFrame) {
174
+ frameRef.current = globals.requestAnimationFrame(runFrame);
175
+ } else {
176
+ runFrame();
177
+ }
178
+ };
179
+
180
+ const stopPreserving = () => {
181
+ preservingPrependRef.current = false;
182
+ preservationRef.current = undefined;
183
+ lastAnchorRef.current = undefined;
184
+ };
185
+
186
+ const disconnect = () => {
187
+ const connection = connectionRef.current;
188
+ disconnectConnection(connection);
189
+ connectionRef.current = undefined;
190
+ if (frameRef.current !== undefined) {
191
+ globals.cancelAnimationFrame?.(frameRef.current);
192
+ frameRef.current = undefined;
193
+ }
194
+ };
195
+
196
+ const ensureConnected = () => {
197
+ if (Platform.OS !== 'web') return;
198
+ const list = listRef.current;
199
+ const scroller = list ? list.getScrollableNode() : undefined;
200
+ if (!list || !isWebElementLike(scroller)) {
201
+ disconnect();
202
+ return;
203
+ }
204
+ if (connectionRef.current?.scroller === scroller) return;
205
+ disconnect();
206
+ stopPreserving();
207
+
208
+ const userInteraction = () => {
209
+ stopPreserving();
210
+ const currentConnection = connectionRef.current;
211
+ if (currentConnection) captureAnchor(currentConnection);
212
+ scheduleFrame();
213
+ };
214
+ const scroll = () => scheduleFrame();
215
+ const mutationObserver = globals.MutationObserver
216
+ ? new globals.MutationObserver(scheduleFrame)
217
+ : undefined;
218
+ const resizeObserver = globals.ResizeObserver
219
+ ? new globals.ResizeObserver(scheduleFrame)
220
+ : undefined;
221
+ const connection: WebPrependAnchorConnection = {
222
+ list,
223
+ scroller,
224
+ mutationObserver,
225
+ resizeObserver,
226
+ resizeTargets: new Set(),
227
+ userInteraction,
228
+ scroll,
229
+ };
230
+ connectionRef.current = connection;
231
+ mutationObserver?.observe(scroller, {
232
+ childList: true,
233
+ subtree: true,
234
+ });
235
+ USER_INTERACTION_EVENTS.forEach((eventName) =>
236
+ scroller.addEventListener(eventName, userInteraction, {
237
+ capture: true,
238
+ passive: eventName === 'wheel' || eventName === 'touchstart',
239
+ })
240
+ );
241
+ scroller.addEventListener('scroll', scroll, { passive: true });
242
+ refreshResizeTargets(connection);
243
+ scheduleFrame();
244
+ };
245
+
246
+ const cancelPrependPreservation = () => {
247
+ stopPreserving();
248
+ scheduleFrame();
249
+ };
250
+
251
+ useLayoutEffect(() => {
252
+ ensureConnected();
253
+ const previousKeys = previousKeysRef.current;
254
+ const identityChanged = previousIdentityRef.current !== itemsIdentity;
255
+ if (previousKeys) {
256
+ const keysChanged = !sameKeys(previousKeys, keys);
257
+ if (
258
+ keysChanged &&
259
+ isPurePrepend(previousKeys, keys) &&
260
+ lastAnchorRef.current
261
+ ) {
262
+ preservationRef.current = lastAnchorRef.current;
263
+ preservingPrependRef.current = true;
264
+ } else if (keysChanged || identityChanged) {
265
+ stopPreserving();
266
+ }
267
+ }
268
+ previousIdentityRef.current = itemsIdentity;
269
+ previousKeysRef.current = [...keys];
270
+ scheduleFrame();
271
+ });
272
+
273
+ useLayoutEffect(
274
+ () => () => {
275
+ disconnectConnection(connectionRef.current);
276
+ connectionRef.current = undefined;
277
+ if (frameRef.current !== undefined) {
278
+ (globalThis as unknown as WebGlobals).cancelAnimationFrame?.(
279
+ frameRef.current
280
+ );
281
+ frameRef.current = undefined;
282
+ }
283
+ },
284
+ []
285
+ );
286
+
287
+ return {
288
+ rowNativeIDPrefix,
289
+ getRowNativeID,
290
+ preservingPrependRef,
291
+ cancelPrependPreservation,
292
+ };
293
+ }
@@ -0,0 +1,160 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { Text, View } from 'react-native';
3
+ import {
4
+ Button,
5
+ Icon,
6
+ useColors,
7
+ useThemedStyles,
8
+ } from '@unif/react-native-design';
9
+ import { PROCESS_STATUS_ICONS, PROCESS_STATUS_LABELS } from './constants';
10
+ import { createStyles } from './styles';
11
+ import type { ProcessProps, ProcessStep } from './types';
12
+
13
+ function idsWithDetails(
14
+ ids: readonly string[],
15
+ steps: readonly ProcessStep[]
16
+ ): readonly string[] {
17
+ const availableIds = new Set(
18
+ steps.filter((step) => step.details != null).map((step) => step.id)
19
+ );
20
+ return ids.filter((id) => availableIds.has(id));
21
+ }
22
+
23
+ function formatElapsedMs(elapsedMs: number | undefined): string | undefined {
24
+ if (elapsedMs === undefined || !Number.isFinite(elapsedMs) || elapsedMs < 0) {
25
+ return undefined;
26
+ }
27
+ if (elapsedMs < 1000) return `${Math.round(elapsedMs)} 毫秒`;
28
+
29
+ const roundedSeconds = Math.round(elapsedMs / 100) / 10;
30
+ if (roundedSeconds < 60) {
31
+ const formatted = Number.isInteger(roundedSeconds)
32
+ ? String(roundedSeconds)
33
+ : roundedSeconds.toFixed(1);
34
+ return `${formatted} 秒`;
35
+ }
36
+
37
+ const totalSeconds = Math.round(elapsedMs / 1000);
38
+ const minutes = Math.floor(totalSeconds / 60);
39
+ const remainingSeconds = totalSeconds % 60;
40
+ return remainingSeconds === 0
41
+ ? `${minutes} 分钟`
42
+ : `${minutes} 分 ${remainingSeconds} 秒`;
43
+ }
44
+
45
+ export function Process(props: ProcessProps): React.JSX.Element {
46
+ const { steps, title, identity, style, testID } = props;
47
+ const styles = useThemedStyles(createStyles);
48
+ const colors = useColors();
49
+ const isControlled = props.expandedIds !== undefined;
50
+ const [localExpandedIds, setLocalExpandedIds] = useState<readonly string[]>(
51
+ () => idsWithDetails(props.defaultExpandedIds ?? [], steps)
52
+ );
53
+
54
+ useEffect(() => {
55
+ if (!isControlled) {
56
+ setLocalExpandedIds((current) => idsWithDetails(current, steps));
57
+ }
58
+ }, [isControlled, steps]);
59
+
60
+ const expandedIds = idsWithDetails(
61
+ isControlled ? props.expandedIds : localExpandedIds,
62
+ steps
63
+ );
64
+
65
+ const toggleDetails = (stepId: string) => {
66
+ const nextIds = expandedIds.includes(stepId)
67
+ ? expandedIds.filter((id) => id !== stepId)
68
+ : [...expandedIds, stepId];
69
+ if (!isControlled) setLocalExpandedIds(nextIds);
70
+ props.onExpandedChange?.(nextIds);
71
+ };
72
+
73
+ return (
74
+ <View style={[styles.root, style]} testID={testID}>
75
+ {title || identity ? (
76
+ <View style={styles.heading}>
77
+ {identity}
78
+ {title ? <Text style={styles.headingTitle}>{title}</Text> : null}
79
+ </View>
80
+ ) : null}
81
+ <View style={styles.steps}>
82
+ {steps.map((step, index) => {
83
+ const statusLabel = PROCESS_STATUS_LABELS[step.status];
84
+ const elapsed = formatElapsedMs(step.elapsedMs);
85
+ const isExpanded = expandedIds.includes(step.id);
86
+ return (
87
+ <View
88
+ key={step.id}
89
+ style={[
90
+ styles.step,
91
+ index === steps.length - 1 && styles.stepLast,
92
+ ]}
93
+ >
94
+ <View style={styles.stepHeader}>
95
+ <Text
96
+ style={styles.stepTitle}
97
+ testID={`process-step-title-${step.id}`}
98
+ >
99
+ {step.title}
100
+ </Text>
101
+ <View
102
+ style={styles.status}
103
+ accessible
104
+ accessibilityLabel={`${step.title},${statusLabel}`}
105
+ >
106
+ <Icon
107
+ name={PROCESS_STATUS_ICONS[step.status]}
108
+ color={
109
+ step.status === 'failed'
110
+ ? colors.error
111
+ : step.status === 'completed'
112
+ ? colors.success
113
+ : colors.foregroundMuted
114
+ }
115
+ />
116
+ <Text style={styles.statusText}>{statusLabel}</Text>
117
+ </View>
118
+ </View>
119
+ {step.description ? (
120
+ <Text style={styles.description}>{step.description}</Text>
121
+ ) : null}
122
+ {elapsed ? <Text style={styles.elapsed}>{elapsed}</Text> : null}
123
+ {step.details != null ? (
124
+ <>
125
+ <Button
126
+ label={isExpanded ? '收起详情' : '展开详情'}
127
+ onPress={() => toggleDetails(step.id)}
128
+ size="sm"
129
+ variant="text"
130
+ testID={`process-step-${step.id}-toggle`}
131
+ />
132
+ {isExpanded ? (
133
+ <View style={styles.details}>{step.details}</View>
134
+ ) : null}
135
+ </>
136
+ ) : null}
137
+ {step.actions && step.actions.length > 0 ? (
138
+ <View style={styles.actions}>
139
+ {step.actions.map((action) => (
140
+ <Button
141
+ key={action.id}
142
+ label={action.label}
143
+ leftIcon={action.icon}
144
+ onPress={action.onPress}
145
+ disabled={action.disabled}
146
+ loading={action.loading}
147
+ accessibilityHint={action.accessibilityHint}
148
+ size="sm"
149
+ variant="outline"
150
+ />
151
+ ))}
152
+ </View>
153
+ ) : null}
154
+ </View>
155
+ );
156
+ })}
157
+ </View>
158
+ </View>
159
+ );
160
+ }
@@ -0,0 +1,22 @@
1
+ import type { IconName } from '@unif/react-native-design';
2
+ import type { ProcessStepStatus } from './types';
3
+
4
+ export const PROCESS_STATUS_LABELS: Readonly<
5
+ Record<ProcessStepStatus, string>
6
+ > = {
7
+ pending: '待处理',
8
+ running: '处理中',
9
+ completed: '已完成',
10
+ failed: '失败',
11
+ cancelled: '已取消',
12
+ };
13
+
14
+ export const PROCESS_STATUS_ICONS: Readonly<
15
+ Record<ProcessStepStatus, IconName>
16
+ > = {
17
+ pending: 'circle-minus',
18
+ running: 'thinking',
19
+ completed: 'success',
20
+ failed: 'error',
21
+ cancelled: 'close',
22
+ };
@@ -0,0 +1,9 @@
1
+ export { Process } from './Process';
2
+ export type {
3
+ ProcessBaseProps,
4
+ ProcessControlledExpansion,
5
+ ProcessLocalExpansion,
6
+ ProcessProps,
7
+ ProcessStep,
8
+ ProcessStepStatus,
9
+ } from './types';
@@ -0,0 +1,77 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { fw, radius, space, type } from '@unif/react-native-design';
3
+ import type { ColorTokens } from '@unif/react-native-design';
4
+
5
+ export const createStyles = (colors: ColorTokens) =>
6
+ StyleSheet.create({
7
+ root: {
8
+ gap: space[4],
9
+ padding: space[5],
10
+ borderRadius: radius.xl,
11
+ borderWidth: 1,
12
+ borderColor: colors.outline,
13
+ backgroundColor: colors.surface,
14
+ },
15
+ heading: {
16
+ flexDirection: 'row',
17
+ alignItems: 'center',
18
+ gap: space[3],
19
+ },
20
+ headingTitle: {
21
+ flex: 1,
22
+ color: colors.foreground,
23
+ fontSize: type.h3,
24
+ fontWeight: fw.semi,
25
+ },
26
+ steps: {
27
+ gap: space[4],
28
+ },
29
+ step: {
30
+ gap: space[2],
31
+ paddingBottom: space[4],
32
+ borderBottomWidth: StyleSheet.hairlineWidth,
33
+ borderBottomColor: colors.outline,
34
+ },
35
+ stepLast: {
36
+ paddingBottom: 0,
37
+ borderBottomWidth: 0,
38
+ },
39
+ stepHeader: {
40
+ flexDirection: 'row',
41
+ alignItems: 'center',
42
+ gap: space[3],
43
+ },
44
+ stepTitle: {
45
+ flex: 1,
46
+ color: colors.foreground,
47
+ fontSize: type.sm,
48
+ fontWeight: fw.medium,
49
+ },
50
+ status: {
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ gap: space[1],
54
+ },
55
+ statusText: {
56
+ color: colors.foregroundMuted,
57
+ fontSize: type.xxs,
58
+ },
59
+ description: {
60
+ color: colors.foregroundMuted,
61
+ fontSize: type.sm,
62
+ },
63
+ elapsed: {
64
+ color: colors.foregroundSubtle,
65
+ fontSize: type.xxs,
66
+ },
67
+ details: {
68
+ padding: space[4],
69
+ borderRadius: radius.md,
70
+ backgroundColor: colors.surfaceContainer,
71
+ },
72
+ actions: {
73
+ flexDirection: 'row',
74
+ flexWrap: 'wrap',
75
+ gap: space[3],
76
+ },
77
+ });