@ledgerhq/lumen-ui-rnative 0.1.64 → 0.1.66

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 (303) hide show
  1. package/dist/module/index.js +1 -1
  2. package/dist/module/index.js.map +1 -1
  3. package/dist/module/lib/Components/core/AddressInput/AddressInput.js +1 -1
  4. package/dist/module/lib/Components/core/AddressInput/AddressInput.js.map +1 -1
  5. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.js +1 -1
  6. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.js.map +1 -1
  7. package/dist/module/lib/Components/core/AmountInput/AmountInput.js +1 -1
  8. package/dist/module/lib/Components/core/AmountInput/AmountInput.js.map +1 -1
  9. package/dist/module/lib/Components/core/Avatar/Avatar.js +1 -1
  10. package/dist/module/lib/Components/core/Avatar/Avatar.js.map +1 -1
  11. package/dist/module/lib/Components/core/Banner/Banner.js +1 -1
  12. package/dist/module/lib/Components/core/Banner/Banner.js.map +1 -1
  13. package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js +1 -1
  14. package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js.map +1 -1
  15. package/dist/module/lib/Components/core/CardButton/CardButton.js +2 -0
  16. package/dist/module/lib/Components/core/CardButton/CardButton.js.map +1 -1
  17. package/dist/module/lib/Components/core/CardButton/CardButton.mdx +4 -0
  18. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js +1 -0
  19. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js.map +1 -1
  20. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js +1 -1
  21. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js.map +1 -1
  22. package/dist/module/lib/Components/core/Link/Link.figma.js +2 -1
  23. package/dist/module/lib/Components/core/Link/Link.figma.js.map +1 -1
  24. package/dist/module/lib/Components/core/Link/Link.js +5 -3
  25. package/dist/module/lib/Components/core/Link/Link.js.map +1 -1
  26. package/dist/module/lib/Components/core/Link/Link.mdx +3 -2
  27. package/dist/module/lib/Components/core/Link/Link.stories.js +4 -1
  28. package/dist/module/lib/Components/core/Link/Link.stories.js.map +1 -1
  29. package/dist/module/lib/Components/core/Link/Link.test.js +2 -2
  30. package/dist/module/lib/Components/core/Link/Link.test.js.map +1 -1
  31. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js +1 -1
  32. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js.map +1 -1
  33. package/dist/module/lib/Components/core/MediaCard/MediaCard.js +1 -1
  34. package/dist/module/lib/Components/core/MediaCard/MediaCard.js.map +1 -1
  35. package/dist/module/lib/Components/core/NavBar/NavBar.js +1 -1
  36. package/dist/module/lib/Components/core/NavBar/NavBar.js.map +1 -1
  37. package/dist/module/lib/Components/core/Spinner/Spinner.js +1 -1
  38. package/dist/module/lib/Components/core/Spinner/Spinner.js.map +1 -1
  39. package/dist/module/lib/Components/core/Stepper/Stepper.js +77 -31
  40. package/dist/module/lib/Components/core/Stepper/Stepper.js.map +1 -1
  41. package/dist/module/lib/Components/core/Stepper/Stepper.mdx +37 -16
  42. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js +102 -2
  43. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js.map +1 -1
  44. package/dist/module/lib/Components/core/Stepper/Stepper.test.js +32 -1
  45. package/dist/module/lib/Components/core/Stepper/Stepper.test.js.map +1 -1
  46. package/dist/module/lib/Components/core/Subheader/Subheader.js +5 -1
  47. package/dist/module/lib/Components/core/Subheader/Subheader.js.map +1 -1
  48. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js +2 -2
  49. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js.map +1 -1
  50. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js +9 -0
  51. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js.map +1 -1
  52. package/dist/module/lib/Components/core/Timeline/Timeline.figma.js +83 -0
  53. package/dist/module/lib/Components/core/Timeline/Timeline.figma.js.map +1 -0
  54. package/dist/module/lib/Components/core/Timeline/Timeline.js +464 -0
  55. package/dist/module/lib/Components/core/Timeline/Timeline.js.map +1 -0
  56. package/dist/module/lib/Components/core/Timeline/Timeline.mdx +49 -0
  57. package/dist/module/lib/Components/core/Timeline/Timeline.stories.js +289 -0
  58. package/dist/module/lib/Components/core/Timeline/Timeline.stories.js.map +1 -0
  59. package/dist/module/lib/Components/core/Timeline/Timeline.test.js +234 -0
  60. package/dist/module/lib/Components/core/Timeline/Timeline.test.js.map +1 -0
  61. package/dist/module/lib/Components/core/Timeline/index.js +5 -0
  62. package/dist/module/lib/Components/core/Timeline/index.js.map +1 -0
  63. package/dist/module/lib/Components/core/Timeline/types.js +4 -0
  64. package/dist/module/lib/Components/core/Timeline/types.js.map +1 -0
  65. package/dist/module/lib/Components/core/Toast/Toast.figma.js +39 -0
  66. package/dist/module/lib/Components/core/Toast/Toast.figma.js.map +1 -0
  67. package/dist/module/lib/Components/core/Toast/Toast.js +138 -0
  68. package/dist/module/lib/Components/core/Toast/Toast.js.map +1 -0
  69. package/dist/module/lib/Components/core/Toast/Toast.mdx +203 -0
  70. package/dist/module/lib/Components/core/Toast/Toast.stories.js +238 -0
  71. package/dist/module/lib/Components/core/Toast/Toast.stories.js.map +1 -0
  72. package/dist/module/lib/Components/core/Toast/Toast.test.js +203 -0
  73. package/dist/module/lib/Components/core/Toast/Toast.test.js.map +1 -0
  74. package/dist/module/lib/Components/core/Toast/Toaster.js +147 -0
  75. package/dist/module/lib/Components/core/Toast/Toaster.js.map +1 -0
  76. package/dist/module/lib/Components/core/Toast/Toaster.test.js +732 -0
  77. package/dist/module/lib/Components/core/Toast/Toaster.test.js.map +1 -0
  78. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js +70 -0
  79. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js.map +1 -0
  80. package/dist/module/lib/Components/core/Toast/hooks/useToastCollapse.js +33 -0
  81. package/dist/module/lib/Components/core/Toast/hooks/useToastCollapse.js.map +1 -0
  82. package/dist/module/lib/Components/core/Toast/hooks/useToastGesture.js +224 -0
  83. package/dist/module/lib/Components/core/Toast/hooks/useToastGesture.js.map +1 -0
  84. package/dist/module/lib/Components/core/Toast/hooks/useToastMotion.js +82 -0
  85. package/dist/module/lib/Components/core/Toast/hooks/useToastMotion.js.map +1 -0
  86. package/dist/module/lib/Components/core/Toast/hooks/useToastViewportStyles.js +21 -0
  87. package/dist/module/lib/Components/core/Toast/hooks/useToastViewportStyles.js.map +1 -0
  88. package/dist/module/lib/Components/core/Toast/index.js +7 -0
  89. package/dist/module/lib/Components/core/Toast/index.js.map +1 -0
  90. package/dist/module/lib/Components/core/Toast/types.js +4 -0
  91. package/dist/module/lib/Components/core/Toast/types.js.map +1 -0
  92. package/dist/module/lib/Components/core/Trend/Trend.js +1 -1
  93. package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
  94. package/dist/module/lib/Components/core/index.js +2 -0
  95. package/dist/module/lib/Components/core/index.js.map +1 -1
  96. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +1 -1
  97. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
  98. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js +6 -2
  99. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js.map +1 -1
  100. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js +8 -4
  101. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js.map +1 -1
  102. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js +1 -1
  103. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js.map +1 -1
  104. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js +12 -3
  105. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js.map +1 -1
  106. package/dist/module/lib/Components/visualization/Legend/Legend.js +1 -1
  107. package/dist/module/lib/Components/visualization/Legend/Legend.js.map +1 -1
  108. package/dist/module/lib/Components/visualization/Legend/Legend.test.js +12 -8
  109. package/dist/module/lib/Components/visualization/Legend/Legend.test.js.map +1 -1
  110. package/dist/module/lib/Components/visualization/LineChart/LineChart.js +8 -2
  111. package/dist/module/lib/Components/visualization/LineChart/LineChart.js.map +1 -1
  112. package/dist/module/lib/Components/visualization/LineChart/utils.js +3 -2
  113. package/dist/module/lib/Components/visualization/LineChart/utils.js.map +1 -1
  114. package/dist/module/lib/Components/visualization/LineChart/utils.test.js +8 -4
  115. package/dist/module/lib/Components/visualization/LineChart/utils.test.js.map +1 -1
  116. package/dist/module/lib/Components/visualization/config.js +1 -4
  117. package/dist/module/lib/Components/visualization/config.js.map +1 -1
  118. package/dist/module/translations/index.js +5 -0
  119. package/dist/module/translations/index.js.map +1 -0
  120. package/dist/module/{i18n → translations}/languages.js +0 -6
  121. package/dist/module/translations/languages.js.map +1 -0
  122. package/dist/module/{i18n → translations}/locales/de.json +0 -3
  123. package/{src/i18n → dist/module/translations}/locales/en.json +9 -3
  124. package/{src/i18n → dist/module/translations}/locales/es.json +0 -3
  125. package/dist/module/{i18n → translations}/locales/fr.json +0 -3
  126. package/{src/i18n → dist/module/translations}/locales/ja.json +0 -3
  127. package/dist/module/{i18n → translations}/locales/ko.json +0 -3
  128. package/dist/module/{i18n → translations}/locales/pt.json +0 -3
  129. package/dist/module/{i18n → translations}/locales/ru.json +0 -3
  130. package/dist/module/{i18n → translations}/locales/th.json +0 -3
  131. package/dist/module/{i18n → translations}/locales/tr.json +0 -3
  132. package/{src/i18n → dist/module/translations}/locales/zh.json +0 -3
  133. package/dist/module/translations/translations.js +36 -0
  134. package/dist/module/translations/translations.js.map +1 -0
  135. package/dist/module/translations/translations.test.js +34 -0
  136. package/dist/module/translations/translations.test.js.map +1 -0
  137. package/dist/typescript/src/index.d.ts +1 -1
  138. package/dist/typescript/src/index.d.ts.map +1 -1
  139. package/dist/typescript/src/lib/Components/core/CardButton/CardButton.d.ts +2 -0
  140. package/dist/typescript/src/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
  141. package/dist/typescript/src/lib/Components/core/Link/Link.d.ts +1 -1
  142. package/dist/typescript/src/lib/Components/core/Link/Link.d.ts.map +1 -1
  143. package/dist/typescript/src/lib/Components/core/Link/types.d.ts +1 -1
  144. package/dist/typescript/src/lib/Components/core/Link/types.d.ts.map +1 -1
  145. package/dist/typescript/src/lib/Components/core/Stepper/Stepper.d.ts +4 -3
  146. package/dist/typescript/src/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
  147. package/dist/typescript/src/lib/Components/core/Stepper/types.d.ts +12 -2
  148. package/dist/typescript/src/lib/Components/core/Stepper/types.d.ts.map +1 -1
  149. package/dist/typescript/src/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
  150. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts +1 -1
  151. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts.map +1 -1
  152. package/dist/typescript/src/lib/Components/core/Timeline/Timeline.d.ts +56 -0
  153. package/dist/typescript/src/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
  154. package/dist/typescript/src/lib/Components/core/Timeline/index.d.ts +3 -0
  155. package/dist/typescript/src/lib/Components/core/Timeline/index.d.ts.map +1 -0
  156. package/dist/typescript/src/lib/Components/core/Timeline/types.d.ts +109 -0
  157. package/dist/typescript/src/lib/Components/core/Timeline/types.d.ts.map +1 -0
  158. package/dist/typescript/src/lib/Components/core/Toast/Toast.d.ts +24 -0
  159. package/dist/typescript/src/lib/Components/core/Toast/Toast.d.ts.map +1 -0
  160. package/dist/typescript/src/lib/Components/core/Toast/Toaster.d.ts +35 -0
  161. package/dist/typescript/src/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
  162. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastAccessibility.d.ts +17 -0
  163. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastAccessibility.d.ts.map +1 -0
  164. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +19 -0
  165. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
  166. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastGesture.d.ts +14 -0
  167. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastGesture.d.ts.map +1 -0
  168. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastMotion.d.ts +15 -0
  169. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastMotion.d.ts.map +1 -0
  170. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastViewportStyles.d.ts +21 -0
  171. package/dist/typescript/src/lib/Components/core/Toast/hooks/useToastViewportStyles.d.ts.map +1 -0
  172. package/dist/typescript/src/lib/Components/core/Toast/index.d.ts +5 -0
  173. package/dist/typescript/src/lib/Components/core/Toast/index.d.ts.map +1 -0
  174. package/dist/typescript/src/lib/Components/core/Toast/types.d.ts +75 -0
  175. package/dist/typescript/src/lib/Components/core/Toast/types.d.ts.map +1 -0
  176. package/dist/typescript/src/lib/Components/core/index.d.ts +2 -0
  177. package/dist/typescript/src/lib/Components/core/index.d.ts.map +1 -1
  178. package/dist/typescript/src/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
  179. package/dist/typescript/src/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
  180. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
  181. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
  182. package/dist/typescript/src/lib/Components/visualization/DonutChart/types.d.ts +1 -1
  183. package/dist/typescript/src/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
  184. package/dist/typescript/src/lib/Components/visualization/Legend/types.d.ts +2 -2
  185. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
  186. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
  187. package/dist/typescript/src/lib/Components/visualization/LineChart/types.d.ts +1 -1
  188. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts +2 -1
  189. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
  190. package/dist/typescript/src/lib/Components/visualization/config.d.ts +0 -3
  191. package/dist/typescript/src/lib/Components/visualization/config.d.ts.map +1 -1
  192. package/dist/typescript/src/translations/index.d.ts +3 -0
  193. package/dist/typescript/src/translations/index.d.ts.map +1 -0
  194. package/dist/typescript/src/{i18n → translations}/languages.d.ts +0 -5
  195. package/dist/typescript/src/translations/languages.d.ts.map +1 -0
  196. package/dist/typescript/src/translations/translations.d.ts +421 -0
  197. package/dist/typescript/src/translations/translations.d.ts.map +1 -0
  198. package/package.json +4 -6
  199. package/src/index.ts +1 -1
  200. package/src/lib/Components/core/AddressInput/AddressInput.tsx +1 -1
  201. package/src/lib/Components/core/AmountDisplay/AmountDisplay.tsx +1 -1
  202. package/src/lib/Components/core/AmountInput/AmountInput.tsx +1 -1
  203. package/src/lib/Components/core/Avatar/Avatar.tsx +1 -1
  204. package/src/lib/Components/core/Banner/Banner.tsx +1 -1
  205. package/src/lib/Components/core/BottomSheet/BottomSheetHeader.tsx +1 -1
  206. package/src/lib/Components/core/CardButton/CardButton.mdx +4 -0
  207. package/src/lib/Components/core/CardButton/CardButton.stories.tsx +1 -0
  208. package/src/lib/Components/core/CardButton/CardButton.tsx +2 -0
  209. package/src/lib/Components/core/ContentBanner/ContentBanner.tsx +1 -1
  210. package/src/lib/Components/core/Link/Link.figma.tsx +1 -0
  211. package/src/lib/Components/core/Link/Link.mdx +3 -2
  212. package/src/lib/Components/core/Link/Link.stories.tsx +3 -2
  213. package/src/lib/Components/core/Link/Link.test.tsx +2 -0
  214. package/src/lib/Components/core/Link/Link.tsx +3 -1
  215. package/src/lib/Components/core/Link/types.ts +1 -1
  216. package/src/lib/Components/core/MediaBanner/MediaBanner.tsx +1 -1
  217. package/src/lib/Components/core/MediaCard/MediaCard.tsx +1 -1
  218. package/src/lib/Components/core/NavBar/NavBar.tsx +1 -1
  219. package/src/lib/Components/core/Spinner/Spinner.tsx +1 -1
  220. package/src/lib/Components/core/Stepper/Stepper.mdx +37 -16
  221. package/src/lib/Components/core/Stepper/Stepper.stories.tsx +50 -2
  222. package/src/lib/Components/core/Stepper/Stepper.test.tsx +29 -1
  223. package/src/lib/Components/core/Stepper/Stepper.tsx +74 -33
  224. package/src/lib/Components/core/Stepper/types.ts +12 -2
  225. package/src/lib/Components/core/Subheader/Subheader.tsx +3 -1
  226. package/src/lib/Components/core/ThemeProvider/ThemeProvider.test.tsx +11 -0
  227. package/src/lib/Components/core/ThemeProvider/ThemeProvider.tsx +3 -3
  228. package/src/lib/Components/core/ThemeProvider/types.ts +1 -1
  229. package/src/lib/Components/core/Timeline/Timeline.figma.tsx +79 -0
  230. package/src/lib/Components/core/Timeline/Timeline.mdx +49 -0
  231. package/src/lib/Components/core/Timeline/Timeline.stories.tsx +250 -0
  232. package/src/lib/Components/core/Timeline/Timeline.test.tsx +275 -0
  233. package/src/lib/Components/core/Timeline/Timeline.tsx +576 -0
  234. package/src/lib/Components/core/Timeline/index.ts +2 -0
  235. package/src/lib/Components/core/Timeline/types.ts +124 -0
  236. package/src/lib/Components/core/Toast/Toast.figma.tsx +36 -0
  237. package/src/lib/Components/core/Toast/Toast.mdx +203 -0
  238. package/src/lib/Components/core/Toast/Toast.stories.tsx +260 -0
  239. package/src/lib/Components/core/Toast/Toast.test.tsx +181 -0
  240. package/src/lib/Components/core/Toast/Toast.tsx +163 -0
  241. package/src/lib/Components/core/Toast/Toaster.test.tsx +687 -0
  242. package/src/lib/Components/core/Toast/Toaster.tsx +157 -0
  243. package/src/lib/Components/core/Toast/hooks/useToastAccessibility.ts +82 -0
  244. package/src/lib/Components/core/Toast/hooks/useToastCollapse.ts +38 -0
  245. package/src/lib/Components/core/Toast/hooks/useToastGesture.ts +83 -0
  246. package/src/lib/Components/core/Toast/hooks/useToastMotion.ts +71 -0
  247. package/src/lib/Components/core/Toast/hooks/useToastViewportStyles.ts +45 -0
  248. package/src/lib/Components/core/Toast/index.ts +4 -0
  249. package/src/lib/Components/core/Toast/types.ts +94 -0
  250. package/src/lib/Components/core/Trend/Trend.tsx +1 -1
  251. package/src/lib/Components/core/index.ts +2 -0
  252. package/src/lib/Components/internal/BaseInput/BaseInput.tsx +1 -1
  253. package/src/lib/Components/visualization/CartesianChart/CartesianChart.tsx +4 -2
  254. package/src/lib/Components/visualization/CartesianChart/types.ts +1 -1
  255. package/src/lib/Components/visualization/DonutChart/DonutChart.test.tsx +1 -3
  256. package/src/lib/Components/visualization/DonutChart/DonutChart.tsx +7 -3
  257. package/src/lib/Components/visualization/DonutChart/DonutRing.tsx +11 -1
  258. package/src/lib/Components/visualization/DonutChart/types.ts +1 -1
  259. package/src/lib/Components/visualization/Legend/Legend.test.tsx +9 -8
  260. package/src/lib/Components/visualization/Legend/Legend.tsx +1 -1
  261. package/src/lib/Components/visualization/Legend/types.ts +2 -2
  262. package/src/lib/Components/visualization/LineChart/LineChart.tsx +10 -2
  263. package/src/lib/Components/visualization/LineChart/types.ts +1 -1
  264. package/src/lib/Components/visualization/LineChart/utils.test.ts +4 -0
  265. package/src/lib/Components/visualization/LineChart/utils.ts +6 -2
  266. package/src/lib/Components/visualization/config.ts +0 -3
  267. package/src/translations/index.ts +2 -0
  268. package/src/{i18n → translations}/languages.ts +0 -6
  269. package/src/{i18n → translations}/locales/de.json +0 -3
  270. package/{dist/module/i18n → src/translations}/locales/en.json +9 -3
  271. package/{dist/module/i18n → src/translations}/locales/es.json +0 -3
  272. package/src/{i18n → translations}/locales/fr.json +0 -3
  273. package/{dist/module/i18n → src/translations}/locales/ja.json +0 -3
  274. package/src/{i18n → translations}/locales/ko.json +0 -3
  275. package/src/{i18n → translations}/locales/pt.json +0 -3
  276. package/src/{i18n → translations}/locales/ru.json +0 -3
  277. package/src/{i18n → translations}/locales/th.json +0 -3
  278. package/src/{i18n → translations}/locales/tr.json +0 -3
  279. package/{dist/module/i18n → src/translations}/locales/zh.json +0 -3
  280. package/src/translations/translations.test.ts +56 -0
  281. package/src/translations/translations.ts +21 -0
  282. package/dist/module/i18n/I18nProvider.js +0 -20
  283. package/dist/module/i18n/I18nProvider.js.map +0 -1
  284. package/dist/module/i18n/i18n.js +0 -82
  285. package/dist/module/i18n/i18n.js.map +0 -1
  286. package/dist/module/i18n/index.js +0 -6
  287. package/dist/module/i18n/index.js.map +0 -1
  288. package/dist/module/i18n/languages.js.map +0 -1
  289. package/dist/module/i18n/useCommonTranslation.js +0 -8
  290. package/dist/module/i18n/useCommonTranslation.js.map +0 -1
  291. package/dist/typescript/src/i18n/I18nProvider.d.ts +0 -8
  292. package/dist/typescript/src/i18n/I18nProvider.d.ts.map +0 -1
  293. package/dist/typescript/src/i18n/i18n.d.ts +0 -13
  294. package/dist/typescript/src/i18n/i18n.d.ts.map +0 -1
  295. package/dist/typescript/src/i18n/index.d.ts +0 -4
  296. package/dist/typescript/src/i18n/index.d.ts.map +0 -1
  297. package/dist/typescript/src/i18n/languages.d.ts.map +0 -1
  298. package/dist/typescript/src/i18n/useCommonTranslation.d.ts +0 -2
  299. package/dist/typescript/src/i18n/useCommonTranslation.d.ts.map +0 -1
  300. package/src/i18n/I18nProvider.tsx +0 -20
  301. package/src/i18n/i18n.ts +0 -107
  302. package/src/i18n/index.ts +0 -3
  303. package/src/i18n/useCommonTranslation.ts +0 -6
@@ -0,0 +1,576 @@
1
+ import {
2
+ createSafeContext,
3
+ isTextChildren,
4
+ } from '@ledgerhq/lumen-utils-shared';
5
+ import type { Key, ReactElement, ReactNode } from 'react';
6
+ import { Children, Fragment, isValidElement } from 'react';
7
+ import { StyleSheet } from 'react-native';
8
+ import { useStyleSheet } from '../../../../styles';
9
+ import { Box, Text } from '../../primitives';
10
+ import {
11
+ CheckmarkCircleFill,
12
+ ClockFill,
13
+ DeleteCircleFill,
14
+ } from '../../symbols';
15
+ import { Spinner } from '../Spinner';
16
+ import type {
17
+ TimelineItemBodyProps,
18
+ TimelineItemCaptionProps,
19
+ TimelineItemDescriptionProps,
20
+ TimelineItemHeaderProps,
21
+ TimelineItemLeadingProps,
22
+ TimelineItemLeadingRowProps,
23
+ TimelineItemProps,
24
+ TimelineItemStatus,
25
+ TimelineItemTitleProps,
26
+ TimelineItemTrailingProps,
27
+ TimelineProps,
28
+ } from './types';
29
+
30
+ type TimelineItemContextValue = {
31
+ status?: TimelineItemStatus;
32
+ };
33
+
34
+ type TimelinePosition = {
35
+ isFirst: boolean;
36
+ isLast: boolean;
37
+ };
38
+
39
+ type TimelineChild = {
40
+ key: Key;
41
+ node: ReactNode;
42
+ };
43
+
44
+ const flattenTimelineChildren = (
45
+ children: ReactNode,
46
+ keyPrefix = '',
47
+ ): TimelineChild[] =>
48
+ Children.toArray(children).flatMap((child, index) => {
49
+ const key = `${keyPrefix}${isValidElement(child) ? (child.key ?? index) : index}`;
50
+
51
+ if (
52
+ isValidElement<{ children?: ReactNode }>(child) &&
53
+ child.type === Fragment
54
+ ) {
55
+ return flattenTimelineChildren(child.props.children, `${key}/`);
56
+ }
57
+
58
+ return [{ key, node: child }];
59
+ });
60
+
61
+ const [TimelineItemProvider, useTimelineItemContext] =
62
+ createSafeContext<TimelineItemContextValue>('TimelineItem');
63
+
64
+ const [TimelinePositionProvider, useTimelinePosition] =
65
+ createSafeContext<TimelinePosition>('Timeline', {
66
+ isFirst: true,
67
+ isLast: true,
68
+ });
69
+
70
+ const useTimelineStyles = () =>
71
+ useStyleSheet(
72
+ (t) => ({
73
+ root: {
74
+ width: t.sizes.full,
75
+ minWidth: 0,
76
+ flexDirection: 'column',
77
+ },
78
+ item: {
79
+ width: t.sizes.full,
80
+ minWidth: 0,
81
+ flexDirection: 'column',
82
+ position: 'relative',
83
+ },
84
+ rail: {
85
+ position: 'absolute',
86
+ top: 0,
87
+ bottom: 0,
88
+ start: 0,
89
+ width: t.sizes.s32,
90
+ flexDirection: 'column',
91
+ alignItems: 'center',
92
+ },
93
+ line: {
94
+ width: t.borderWidth.s2,
95
+ backgroundColor: t.colors.border.mutedSubtleHover,
96
+ },
97
+ lineIn: {
98
+ height: t.sizes.s16,
99
+ },
100
+ lineInHidden: {
101
+ opacity: 0,
102
+ },
103
+ indicatorSpacer: {
104
+ height: t.sizes.s32,
105
+ flexShrink: 0,
106
+ },
107
+ lineOut: {
108
+ flex: 1,
109
+ },
110
+ indicator: {
111
+ marginTop: t.spacings.s16,
112
+ width: t.sizes.s32,
113
+ height: t.sizes.s32,
114
+ flexShrink: 0,
115
+ alignSelf: 'flex-start',
116
+ alignItems: 'center',
117
+ justifyContent: 'center',
118
+ },
119
+ neutralDot: {
120
+ width: t.sizes.s12,
121
+ height: t.sizes.s12,
122
+ borderRadius: t.borderRadius.full,
123
+ backgroundColor: t.colors.bg.mutedPressed,
124
+ },
125
+ idleRing: {
126
+ width: t.sizes.s20,
127
+ height: t.sizes.s20,
128
+ borderRadius: t.borderRadius.full,
129
+ borderWidth: t.borderWidth.s2,
130
+ borderColor: t.colors.border.mutedSubtleHover,
131
+ },
132
+ header: {
133
+ flexDirection: 'row',
134
+ alignItems: 'center',
135
+ minHeight: t.sizes.s64,
136
+ minWidth: 0,
137
+ gap: t.spacings.s8,
138
+ },
139
+ leading: {
140
+ flex: 1,
141
+ minWidth: 0,
142
+ flexDirection: 'column',
143
+ gap: t.spacings.s2,
144
+ },
145
+ leadingRow: {
146
+ flexDirection: 'row',
147
+ alignItems: 'center',
148
+ minWidth: 0,
149
+ gap: t.spacings.s4,
150
+ },
151
+ caption: StyleSheet.flatten([
152
+ t.typographies.body4,
153
+ {
154
+ minWidth: 0,
155
+ flexShrink: 1,
156
+ color: t.colors.text.muted,
157
+ },
158
+ ]),
159
+ description: StyleSheet.flatten([
160
+ t.typographies.body3,
161
+ {
162
+ minWidth: 0,
163
+ flexShrink: 1,
164
+ color: t.colors.text.muted,
165
+ },
166
+ ]),
167
+ trailing: {
168
+ marginStart: 'auto',
169
+ flexShrink: 0,
170
+ flexDirection: 'column',
171
+ alignItems: 'flex-end',
172
+ },
173
+ body: {
174
+ marginStart: t.spacings.s40,
175
+ minWidth: 0,
176
+ paddingTop: t.spacings.s8,
177
+ paddingBottom: t.spacings.s12,
178
+ },
179
+ }),
180
+ [],
181
+ );
182
+
183
+ const useTitleStyles = (muted: boolean) =>
184
+ useStyleSheet(
185
+ (t) => ({
186
+ title: StyleSheet.flatten([
187
+ t.typographies.body2SemiBold,
188
+ {
189
+ minWidth: 0,
190
+ flexShrink: 1,
191
+ color: muted ? t.colors.text.muted : t.colors.text.base,
192
+ },
193
+ ]),
194
+ }),
195
+ [muted],
196
+ );
197
+
198
+ const TimelineIndicator = ({ status }: { status?: TimelineItemStatus }) => {
199
+ const styles = useTimelineStyles();
200
+ const decorative = status !== 'loading';
201
+ const indicatorByStatus = {
202
+ success: (
203
+ <CheckmarkCircleFill
204
+ accessible={false}
205
+ color='success'
206
+ size={24}
207
+ testID='timeline-indicator-success'
208
+ />
209
+ ),
210
+ error: (
211
+ <DeleteCircleFill
212
+ accessible={false}
213
+ color='error'
214
+ size={24}
215
+ testID='timeline-indicator-error'
216
+ />
217
+ ),
218
+ pending: (
219
+ <ClockFill
220
+ accessible={false}
221
+ color='muted'
222
+ size={24}
223
+ testID='timeline-indicator-pending'
224
+ />
225
+ ),
226
+ loading: (
227
+ <Spinner color='muted' size={24} testID='timeline-indicator-loading' />
228
+ ),
229
+ idle: (
230
+ <Box
231
+ accessible={false}
232
+ style={styles.idleRing}
233
+ testID='timeline-indicator-idle'
234
+ />
235
+ ),
236
+ } satisfies Record<TimelineItemStatus, ReactElement>;
237
+
238
+ return (
239
+ <Box
240
+ accessibilityElementsHidden={decorative}
241
+ importantForAccessibility={decorative ? 'no-hide-descendants' : 'auto'}
242
+ style={styles.indicator}
243
+ >
244
+ {status ? (
245
+ indicatorByStatus[status]
246
+ ) : (
247
+ <Box
248
+ accessible={false}
249
+ style={styles.neutralDot}
250
+ testID='timeline-indicator-neutral'
251
+ />
252
+ )}
253
+ </Box>
254
+ );
255
+ };
256
+
257
+ const TimelineRail = () => {
258
+ const styles = useTimelineStyles();
259
+ const { isFirst, isLast } = useTimelinePosition({
260
+ consumerName: 'TimelineItem',
261
+ contextRequired: false,
262
+ });
263
+
264
+ return (
265
+ <Box
266
+ accessibilityElementsHidden
267
+ importantForAccessibility='no-hide-descendants'
268
+ pointerEvents='none'
269
+ style={styles.rail}
270
+ >
271
+ <Box
272
+ style={StyleSheet.flatten([
273
+ styles.line,
274
+ styles.lineIn,
275
+ isFirst && styles.lineInHidden,
276
+ ])}
277
+ testID='timeline-line-in'
278
+ />
279
+ <Box style={styles.indicatorSpacer} />
280
+ {!isLast && (
281
+ <Box
282
+ style={StyleSheet.flatten([styles.line, styles.lineOut])}
283
+ testID='timeline-line-out'
284
+ />
285
+ )}
286
+ </Box>
287
+ );
288
+ };
289
+
290
+ /**
291
+ * Vertical timeline. Lays out its items and holds no state of its own.
292
+ *
293
+ * @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-timeline--docs Storybook}
294
+ *
295
+ * @example
296
+ * <Timeline>
297
+ * <TimelineItem>
298
+ * <TimelineItemHeader>
299
+ * <TimelineItemLeading>
300
+ * <TimelineItemTitle>Payment confirmed</TimelineItemTitle>
301
+ * </TimelineItemLeading>
302
+ * </TimelineItemHeader>
303
+ * </TimelineItem>
304
+ * </Timeline>
305
+ */
306
+ export const Timeline = ({
307
+ ref,
308
+ children,
309
+ lx,
310
+ style,
311
+ ...props
312
+ }: TimelineProps) => {
313
+ const styles = useTimelineStyles();
314
+ const items = flattenTimelineChildren(children);
315
+
316
+ return (
317
+ <Box
318
+ ref={ref}
319
+ lx={lx}
320
+ style={StyleSheet.flatten([styles.root, style])}
321
+ {...props}
322
+ >
323
+ {items.map(({ key, node }, index) => (
324
+ <TimelinePositionProvider
325
+ key={key}
326
+ value={{
327
+ isFirst: index === 0,
328
+ isLast: index === items.length - 1,
329
+ }}
330
+ >
331
+ {node}
332
+ </TimelinePositionProvider>
333
+ ))}
334
+ </Box>
335
+ );
336
+ };
337
+
338
+ /**
339
+ * One row of a timeline. Draws the indicator from `status` and the connector
340
+ * to the neighbouring items.
341
+ */
342
+ export const TimelineItem = ({
343
+ ref,
344
+ status,
345
+ children,
346
+ lx,
347
+ style,
348
+ ...props
349
+ }: TimelineItemProps) => {
350
+ const styles = useTimelineStyles();
351
+
352
+ return (
353
+ <TimelineItemProvider value={{ status }}>
354
+ <Box
355
+ ref={ref}
356
+ lx={lx}
357
+ style={StyleSheet.flatten([styles.item, style])}
358
+ testID='timeline-item'
359
+ {...props}
360
+ >
361
+ <TimelineRail />
362
+ {children}
363
+ </Box>
364
+ </TimelineItemProvider>
365
+ );
366
+ };
367
+
368
+ /**
369
+ * Row beside the indicator. Holds the leading column and the trailing slot.
370
+ */
371
+ export const TimelineItemHeader = ({
372
+ ref,
373
+ children,
374
+ lx,
375
+ style,
376
+ ...props
377
+ }: TimelineItemHeaderProps) => {
378
+ const styles = useTimelineStyles();
379
+ const { status } = useTimelineItemContext({
380
+ consumerName: 'TimelineItemHeader',
381
+ contextRequired: true,
382
+ });
383
+
384
+ return (
385
+ <Box
386
+ ref={ref}
387
+ lx={lx}
388
+ style={StyleSheet.flatten([styles.header, style])}
389
+ {...props}
390
+ >
391
+ <TimelineIndicator status={status} />
392
+ {children}
393
+ </Box>
394
+ );
395
+ };
396
+
397
+ /**
398
+ * Caption, title, and description column.
399
+ */
400
+ export const TimelineItemLeading = ({
401
+ ref,
402
+ children,
403
+ lx,
404
+ style,
405
+ ...props
406
+ }: TimelineItemLeadingProps) => {
407
+ const styles = useTimelineStyles();
408
+
409
+ return (
410
+ <Box
411
+ ref={ref}
412
+ lx={lx}
413
+ style={StyleSheet.flatten([styles.leading, style])}
414
+ {...props}
415
+ >
416
+ {children}
417
+ </Box>
418
+ );
419
+ };
420
+
421
+ /**
422
+ * Horizontal row for a title or description beside a tag.
423
+ */
424
+ export const TimelineItemLeadingRow = ({
425
+ ref,
426
+ children,
427
+ lx,
428
+ style,
429
+ ...props
430
+ }: TimelineItemLeadingRowProps) => {
431
+ const styles = useTimelineStyles();
432
+
433
+ return (
434
+ <Box
435
+ ref={ref}
436
+ lx={lx}
437
+ style={StyleSheet.flatten([styles.leadingRow, style])}
438
+ {...props}
439
+ >
440
+ {children}
441
+ </Box>
442
+ );
443
+ };
444
+
445
+ /**
446
+ * Overline above the title.
447
+ */
448
+ export const TimelineItemCaption = ({
449
+ ref,
450
+ children,
451
+ lx,
452
+ style,
453
+ ...props
454
+ }: TimelineItemCaptionProps) => {
455
+ const styles = useTimelineStyles();
456
+
457
+ return (
458
+ <Text
459
+ ref={ref}
460
+ allowFontScaling={false}
461
+ ellipsizeMode='tail'
462
+ lx={lx}
463
+ numberOfLines={1}
464
+ style={StyleSheet.flatten([styles.caption, style])}
465
+ {...props}
466
+ >
467
+ {children}
468
+ </Text>
469
+ );
470
+ };
471
+
472
+ /**
473
+ * Title. An `idle` item uses the muted tone.
474
+ */
475
+ export const TimelineItemTitle = ({
476
+ ref,
477
+ children,
478
+ lx,
479
+ style,
480
+ ...props
481
+ }: TimelineItemTitleProps) => {
482
+ const { status } = useTimelineItemContext({
483
+ consumerName: 'TimelineItemTitle',
484
+ contextRequired: true,
485
+ });
486
+ const styles = useTitleStyles(status === 'idle');
487
+
488
+ return (
489
+ <Text
490
+ ref={ref}
491
+ allowFontScaling={false}
492
+ ellipsizeMode='tail'
493
+ lx={lx}
494
+ numberOfLines={1}
495
+ style={StyleSheet.flatten([styles.title, style])}
496
+ {...props}
497
+ >
498
+ {children}
499
+ </Text>
500
+ );
501
+ };
502
+
503
+ /**
504
+ * Description under the title.
505
+ */
506
+ export const TimelineItemDescription = ({
507
+ ref,
508
+ children,
509
+ lx,
510
+ style,
511
+ ...props
512
+ }: TimelineItemDescriptionProps) => {
513
+ const styles = useTimelineStyles();
514
+
515
+ return (
516
+ <Text
517
+ ref={ref}
518
+ allowFontScaling={false}
519
+ ellipsizeMode='tail'
520
+ lx={lx}
521
+ numberOfLines={1}
522
+ style={StyleSheet.flatten([styles.description, style])}
523
+ {...props}
524
+ >
525
+ {children}
526
+ </Text>
527
+ );
528
+ };
529
+
530
+ /**
531
+ * End-aligned slot in the header.
532
+ */
533
+ export const TimelineItemTrailing = ({
534
+ ref,
535
+ children,
536
+ lx,
537
+ style,
538
+ ...props
539
+ }: TimelineItemTrailingProps) => {
540
+ const styles = useTimelineStyles();
541
+
542
+ return (
543
+ <Box
544
+ ref={ref}
545
+ lx={lx}
546
+ style={StyleSheet.flatten([styles.trailing, style])}
547
+ {...props}
548
+ >
549
+ {isTextChildren(children) ? <Text>{children}</Text> : children}
550
+ </Box>
551
+ );
552
+ };
553
+
554
+ /**
555
+ * Block under the header, indented past the indicator.
556
+ */
557
+ export const TimelineItemBody = ({
558
+ ref,
559
+ children,
560
+ lx,
561
+ style,
562
+ ...props
563
+ }: TimelineItemBodyProps) => {
564
+ const styles = useTimelineStyles();
565
+
566
+ return (
567
+ <Box
568
+ ref={ref}
569
+ lx={lx}
570
+ style={StyleSheet.flatten([styles.body, style])}
571
+ {...props}
572
+ >
573
+ {isTextChildren(children) ? <Text>{children}</Text> : children}
574
+ </Box>
575
+ );
576
+ };
@@ -0,0 +1,2 @@
1
+ export * from './Timeline';
2
+ export * from './types';
@@ -0,0 +1,124 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StyledTextProps, StyledViewProps } from '../../../../styles';
3
+
4
+ export type TimelineItemStatus =
5
+ | 'idle'
6
+ | 'success'
7
+ | 'error'
8
+ | 'pending'
9
+ | 'loading';
10
+
11
+ /**
12
+ * Props for the Timeline root.
13
+ */
14
+ export type TimelineProps = {
15
+ /**
16
+ * The timeline items.
17
+ * @required
18
+ */
19
+ children: ReactNode;
20
+ } & Omit<StyledViewProps, 'children'>;
21
+
22
+ /**
23
+ * Props for one timeline item.
24
+ */
25
+ export type TimelineItemProps = {
26
+ /**
27
+ * Indicator and title tone. Omit it for a neutral item.
28
+ * @default undefined
29
+ */
30
+ status?: TimelineItemStatus;
31
+ /**
32
+ * Header and content of the item.
33
+ * @required
34
+ */
35
+ children: ReactNode;
36
+ } & Omit<StyledViewProps, 'children'>;
37
+
38
+ /**
39
+ * Props for the row beside the indicator.
40
+ */
41
+ export type TimelineItemHeaderProps = {
42
+ /**
43
+ * Leading and trailing parts.
44
+ * @required
45
+ */
46
+ children: ReactNode;
47
+ } & Omit<StyledViewProps, 'children'>;
48
+
49
+ /**
50
+ * Props for the text column opposite the trailing slot.
51
+ */
52
+ export type TimelineItemLeadingProps = {
53
+ /**
54
+ * Caption, title, and description.
55
+ * @required
56
+ */
57
+ children: ReactNode;
58
+ } & Omit<StyledViewProps, 'children'>;
59
+
60
+ /**
61
+ * Props for a horizontal row inside the leading column.
62
+ */
63
+ export type TimelineItemLeadingRowProps = {
64
+ /**
65
+ * A title or description beside an optional tag.
66
+ * @required
67
+ */
68
+ children: ReactNode;
69
+ } & Omit<StyledViewProps, 'children'>;
70
+
71
+ /**
72
+ * Props for the overline above the title.
73
+ */
74
+ export type TimelineItemCaptionProps = {
75
+ /**
76
+ * Overline text. A date is the common case.
77
+ * @required
78
+ */
79
+ children: ReactNode;
80
+ } & Omit<StyledTextProps, 'children'>;
81
+
82
+ /**
83
+ * Props for the item title.
84
+ */
85
+ export type TimelineItemTitleProps = {
86
+ /**
87
+ * Title text.
88
+ * @required
89
+ */
90
+ children: ReactNode;
91
+ } & Omit<StyledTextProps, 'children'>;
92
+
93
+ /**
94
+ * Props for the description under the title.
95
+ */
96
+ export type TimelineItemDescriptionProps = {
97
+ /**
98
+ * Description text.
99
+ * @required
100
+ */
101
+ children: ReactNode;
102
+ } & Omit<StyledTextProps, 'children'>;
103
+
104
+ /**
105
+ * Props for the end-aligned header slot.
106
+ */
107
+ export type TimelineItemTrailingProps = {
108
+ /**
109
+ * Amount, tag, or text. A string or number is wrapped so it can render.
110
+ * @required
111
+ */
112
+ children: ReactNode;
113
+ } & Omit<StyledViewProps, 'children'>;
114
+
115
+ /**
116
+ * Props for the block under the header.
117
+ */
118
+ export type TimelineItemBodyProps = {
119
+ /**
120
+ * Content indented past the indicator. A string or number is wrapped so it can render.
121
+ * @required
122
+ */
123
+ children: ReactNode;
124
+ } & Omit<StyledViewProps, 'children'>;