@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,203 @@
1
+ "use strict";
2
+
3
+ import { describe, it, expect, jest } from '@jest/globals';
4
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
5
+ import { fireEvent, render } from '@testing-library/react-native';
6
+ import { StyleSheet } from 'react-native';
7
+ import { ThemeProvider } from "../ThemeProvider/ThemeProvider.js";
8
+ import { Toast } from "./Toast.js";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const TestWrapper = ({
11
+ children
12
+ }) => /*#__PURE__*/_jsx(ThemeProvider, {
13
+ themes: ledgerLiveThemes,
14
+ colorScheme: "dark",
15
+ locale: "en",
16
+ children: children
17
+ });
18
+ describe('Toast', () => {
19
+ describe('Rendering', () => {
20
+ it('should render the title', () => {
21
+ const {
22
+ getByText
23
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
24
+ children: /*#__PURE__*/_jsx(Toast, {
25
+ title: "Payment done"
26
+ })
27
+ }));
28
+ getByText('Payment done');
29
+ });
30
+ it('should wrap the title over up to five lines', () => {
31
+ const {
32
+ getByText
33
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
34
+ children: /*#__PURE__*/_jsx(Toast, {
35
+ title: "A very long toast title"
36
+ })
37
+ }));
38
+ expect(getByText('A very long toast title').props.numberOfLines).toBe(5);
39
+ });
40
+ it('should not render a leading icon for the info appearance', () => {
41
+ const {
42
+ queryByTestId
43
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
44
+ children: /*#__PURE__*/_jsx(Toast, {
45
+ title: "Info",
46
+ appearance: "info"
47
+ })
48
+ }));
49
+ expect(queryByTestId('toast-icon')).toBeNull();
50
+ });
51
+ it('should render a status icon for non-info appearances', () => {
52
+ const {
53
+ getByTestId
54
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
55
+ children: /*#__PURE__*/_jsx(Toast, {
56
+ title: "Saved",
57
+ appearance: "success"
58
+ })
59
+ }));
60
+ getByTestId('toast-icon');
61
+ });
62
+ it('should render a spinner while loading', () => {
63
+ const {
64
+ getByTestId
65
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
66
+ children: /*#__PURE__*/_jsx(Toast, {
67
+ title: "Uploading",
68
+ loading: true
69
+ })
70
+ }));
71
+ getByTestId('toast-spinner');
72
+ });
73
+ });
74
+ describe('Layout', () => {
75
+ it('should wrap the title and action together, so an action that does not fit drops to its own line under the title', () => {
76
+ const {
77
+ getByTestId
78
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
79
+ children: /*#__PURE__*/_jsx(Toast, {
80
+ title: "Report ready",
81
+ action: {
82
+ label: 'Download the report',
83
+ onAction: jest.fn()
84
+ }
85
+ })
86
+ }));
87
+ expect(getByTestId('toast-text-action').props.style).toEqual(expect.objectContaining({
88
+ flexDirection: 'row',
89
+ flexWrap: 'wrap',
90
+ alignItems: 'flex-start'
91
+ }));
92
+ expect(getByTestId('toast-text-action').props.style.justifyContent).toBeUndefined();
93
+ });
94
+ it('should not shift the action when there is no leading icon', () => {
95
+ const {
96
+ getByTestId
97
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
98
+ children: /*#__PURE__*/_jsx(Toast, {
99
+ appearance: "info",
100
+ title: "Report ready",
101
+ action: {
102
+ label: 'Open',
103
+ onAction: jest.fn()
104
+ }
105
+ })
106
+ }));
107
+ expect(StyleSheet.flatten(getByTestId('toast-action').props.style).marginLeft).toBeUndefined();
108
+ });
109
+ it('should shift the action to align its label with the title when there is a leading icon', () => {
110
+ const {
111
+ getByTestId
112
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
113
+ children: /*#__PURE__*/_jsx(Toast, {
114
+ appearance: "success",
115
+ title: "Report ready",
116
+ action: {
117
+ label: 'Open',
118
+ onAction: jest.fn()
119
+ }
120
+ })
121
+ }));
122
+ expect(StyleSheet.flatten(getByTestId('toast-action').props.style).marginLeft).toBe(-16);
123
+ });
124
+ it('should shift the action to align its label with the title when loading', () => {
125
+ const {
126
+ getByTestId
127
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
128
+ children: /*#__PURE__*/_jsx(Toast, {
129
+ loading: true,
130
+ title: "Uploading",
131
+ action: {
132
+ label: 'Cancel',
133
+ onAction: jest.fn()
134
+ }
135
+ })
136
+ }));
137
+ expect(StyleSheet.flatten(getByTestId('toast-action').props.style).marginLeft).toBe(-16);
138
+ });
139
+ });
140
+ describe('Accessibility', () => {
141
+ it('should announce info and success politely', () => {
142
+ const {
143
+ getByTestId,
144
+ rerender
145
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
146
+ children: /*#__PURE__*/_jsx(Toast, {
147
+ testID: "toast",
148
+ title: "Info",
149
+ appearance: "info"
150
+ })
151
+ }));
152
+ expect(getByTestId('toast').props.accessibilityLiveRegion).toBe('polite');
153
+ rerender(/*#__PURE__*/_jsx(TestWrapper, {
154
+ children: /*#__PURE__*/_jsx(Toast, {
155
+ testID: "toast",
156
+ title: "Saved",
157
+ appearance: "success"
158
+ })
159
+ }));
160
+ expect(getByTestId('toast').props.accessibilityLiveRegion).toBe('polite');
161
+ });
162
+ it('should announce warning and error assertively', () => {
163
+ const {
164
+ getByTestId,
165
+ rerender
166
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
167
+ children: /*#__PURE__*/_jsx(Toast, {
168
+ testID: "toast",
169
+ title: "Careful",
170
+ appearance: "warning"
171
+ })
172
+ }));
173
+ expect(getByTestId('toast').props.accessibilityLiveRegion).toBe('assertive');
174
+ rerender(/*#__PURE__*/_jsx(TestWrapper, {
175
+ children: /*#__PURE__*/_jsx(Toast, {
176
+ testID: "toast",
177
+ title: "Failed",
178
+ appearance: "error"
179
+ })
180
+ }));
181
+ expect(getByTestId('toast').props.accessibilityLiveRegion).toBe('assertive');
182
+ });
183
+ });
184
+ describe('Interactions', () => {
185
+ it('should render the action and fire onAction', () => {
186
+ const onAction = jest.fn();
187
+ const {
188
+ getByText
189
+ } = render(/*#__PURE__*/_jsx(TestWrapper, {
190
+ children: /*#__PURE__*/_jsx(Toast, {
191
+ title: "Upload failed",
192
+ action: {
193
+ label: 'Retry',
194
+ onAction
195
+ }
196
+ })
197
+ }));
198
+ fireEvent.press(getByText('Retry'));
199
+ expect(onAction).toHaveBeenCalledTimes(1);
200
+ });
201
+ });
202
+ });
203
+ //# sourceMappingURL=Toast.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["describe","it","expect","jest","ledgerLiveThemes","fireEvent","render","StyleSheet","ThemeProvider","Toast","jsx","_jsx","TestWrapper","children","themes","colorScheme","locale","getByText","title","props","numberOfLines","toBe","queryByTestId","appearance","toBeNull","getByTestId","loading","action","label","onAction","fn","style","toEqual","objectContaining","flexDirection","flexWrap","alignItems","justifyContent","toBeUndefined","flatten","marginLeft","rerender","testID","accessibilityLiveRegion","press","toHaveBeenCalledTimes"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/Toast/Toast.test.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,EAAEC,IAAI,QAAQ,eAAe;AAC1D,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,EAAEC,MAAM,QAAQ,+BAA+B;AACjE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,mCAAgC;AAC9D,SAASC,KAAK,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhC,MAAMC,WAAW,GAAGA,CAAC;EAAEC;AAAwC,CAAC,kBAC9DF,IAAA,CAACH,aAAa;EAACM,MAAM,EAAEV,gBAAiB;EAACW,WAAW,EAAC,MAAM;EAACC,MAAM,EAAC,IAAI;EAAAH,QAAA,EACpEA;AAAQ,CACI,CAChB;AAEDb,QAAQ,CAAC,OAAO,EAAE,MAAM;EACtBA,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BC,EAAE,CAAC,yBAAyB,EAAE,MAAM;MAClC,MAAM;QAAEgB;MAAU,CAAC,GAAGX,MAAM,cAC1BK,IAAA,CAACC,WAAW;QAAAC,QAAA,eACVF,IAAA,CAACF,KAAK;UAACS,KAAK,EAAC;QAAc,CAAE;MAAC,CACnB,CACf,CAAC;MACDD,SAAS,CAAC,cAAc,CAAC;IAC3B,CAAC,CAAC;IAEFhB,EAAE,CAAC,6CAA6C,EAAE,MAAM;MACtD,MAAM;QAAEgB;MAAU,CAAC,GAAGX,MAAM,cAC1BK,IAAA,CAACC,WAAW;QAAAC,QAAA,eACVF,IAAA,CAACF,KAAK;UAACS,KAAK,EAAC;QAAyB,CAAE;MAAC,CAC9B,CACf,CAAC;MACDhB,MAAM,CAACe,SAAS,CAAC,yBAAyB,CAAC,CAACE,KAAK,CAACC,a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OAAO;YAAEC;UAAS;QAAE,CAAE;MAAC,CAC1D,CACf,CAAC;MAEDxB,SAAS,CAACuC,KAAK,CAAC3B,SAAS,CAAC,OAAO,CAAC,CAAC;MACnCf,MAAM,CAAC2B,QAAQ,CAAC,CAACgB,qBAAqB,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+
3
+ import { resolveDurationMs, resolveMaxItems, toastStore, useToastBacklog, useToastLifecycle } from '@ledgerhq/lumen-utils-shared';
4
+ import { useEffect, useState, useSyncExternalStore } from 'react';
5
+ import { View } from 'react-native';
6
+ import { GestureDetector } from 'react-native-gesture-handler';
7
+ import Animated from 'react-native-reanimated';
8
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
9
+ import { useToastAccessibility } from "./hooks/useToastAccessibility.js";
10
+ import { useToastCollapse } from "./hooks/useToastCollapse.js";
11
+ import { useToastGesture } from "./hooks/useToastGesture.js";
12
+ import { useToastMotion } from "./hooks/useToastMotion.js";
13
+ import { useToastViewportStyles } from "./hooks/useToastViewportStyles.js";
14
+ import { Toast } from "./Toast.js";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ const ToastQueueItem = ({
17
+ item,
18
+ durationMs,
19
+ queued,
20
+ position,
21
+ onDismiss
22
+ }) => {
23
+ const exiting = item.exiting ?? false;
24
+ const [held, setHeld] = useState(false);
25
+ useToastLifecycle({
26
+ durationMs,
27
+ paused: held,
28
+ exiting,
29
+ onDismiss
30
+ });
31
+ const {
32
+ animatedStyle,
33
+ translateX,
34
+ markDismissedViaSwipe
35
+ } = useToastMotion({
36
+ position,
37
+ queued,
38
+ exiting
39
+ });
40
+ const {
41
+ gesture
42
+ } = useToastGesture({
43
+ dismissible: item.dismissible,
44
+ translateX,
45
+ onHoldChange: setHeld,
46
+ onSwipeDismiss: () => {
47
+ markDismissedViaSwipe();
48
+ onDismiss();
49
+ }
50
+ });
51
+ const {
52
+ collapseStyle,
53
+ handleLayout
54
+ } = useToastCollapse({
55
+ position,
56
+ exiting
57
+ });
58
+ const accessibilityProps = useToastAccessibility({
59
+ item,
60
+ exiting,
61
+ onDismiss
62
+ });
63
+ return /*#__PURE__*/_jsx(Animated.View, {
64
+ testID: "toast-collapse",
65
+ style: collapseStyle,
66
+ children: /*#__PURE__*/_jsx(GestureDetector, {
67
+ gesture: gesture,
68
+ children: /*#__PURE__*/_jsx(Animated.View, {
69
+ testID: "toast-entry",
70
+ style: animatedStyle,
71
+ onLayout: handleLayout,
72
+ ...accessibilityProps,
73
+ children: /*#__PURE__*/_jsx(Toast, {
74
+ appearance: item.appearance,
75
+ loading: item.loading,
76
+ title: item.title,
77
+ action: item.action
78
+ })
79
+ })
80
+ })
81
+ });
82
+ };
83
+
84
+ /**
85
+ * Subscribes to the module-level toast store and renders the queue viewport
86
+ * as an absolutely-positioned overlay. Mount it once, near the app root — it
87
+ * takes no children. `toast.*` from `@ledgerhq/lumen-utils-shared` works even
88
+ * before this mounts, or from outside the React tree entirely.
89
+ *
90
+ * Mount exactly one `<Toaster />` for the whole app. Every instance renders
91
+ * the full queue, so a second one duplicates every toast on screen — mounting
92
+ * more than one logs a console warning in development.
93
+ *
94
+ * Toasts are dismissed by swiping left or right; there is no close icon.
95
+ * Screen-reader users get the dismissal and the inline action as accessibility
96
+ * actions instead, and each toast is announced when it appears or changes.
97
+ * Touching a toast — a hold or an in-progress swipe — pauses its auto-dismiss
98
+ * timer until the finger is released.
99
+ * Requires `react-native-gesture-handler`'s `GestureHandlerRootView` at the
100
+ * app root.
101
+ *
102
+ * @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-toast--docs Guidelines}
103
+ *
104
+ * @example
105
+ * import { Toaster } from '@ledgerhq/lumen-ui-rnative';
106
+ *
107
+ * function App() {
108
+ * return (
109
+ * <>
110
+ * <Toaster position="bottom" maxItems={1} />
111
+ * <Screens />
112
+ * </>
113
+ * );
114
+ * }
115
+ */
116
+ export const Toaster = ({
117
+ maxItems = 1,
118
+ position = 'bottom',
119
+ insets = {},
120
+ durations
121
+ }) => {
122
+ const items = useSyncExternalStore(toastStore.subscribe, toastStore.getSnapshot);
123
+ const safeAreaInsets = useSafeAreaInsets();
124
+ const viewportStyles = useToastViewportStyles({
125
+ position,
126
+ safeAreaTop: safeAreaInsets.top,
127
+ safeAreaBottom: safeAreaInsets.bottom,
128
+ insets
129
+ });
130
+ useEffect(() => toastStore.registerRenderer(), []);
131
+ const visibleSlots = resolveMaxItems(maxItems);
132
+ const visibleItems = items.slice(0, visibleSlots);
133
+ const isQueued = useToastBacklog(items, visibleSlots);
134
+ return /*#__PURE__*/_jsx(View, {
135
+ testID: "toast-viewport",
136
+ pointerEvents: "box-none",
137
+ style: viewportStyles.root,
138
+ children: visibleItems.map(item => /*#__PURE__*/_jsx(ToastQueueItem, {
139
+ item: item,
140
+ durationMs: resolveDurationMs(item, durations),
141
+ queued: isQueued(item.id),
142
+ position: position,
143
+ onDismiss: () => toastStore.dismiss(item.id)
144
+ }, item.id))
145
+ });
146
+ };
147
+ //# sourceMappingURL=Toaster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolveDurationMs","resolveMaxItems","toastStore","useToastBacklog","useToastLifecycle","useEffect","useState","useSyncExternalStore","View","GestureDetector","Animated","useSafeAreaInsets","useToastAccessibility","useToastCollapse","useToastGesture","useToastMotion","useToastViewportStyles","Toast","jsx","_jsx","ToastQueueItem","item","durationMs","queued","position","onDismiss","exiting","held","setHeld","paused","animatedStyle","translateX","markDismissedViaSwipe","gesture","dismissible","onHoldChange","onSwipeDismiss","collapseStyle","handleLayout","accessibilityProps","testID","style","children","onLayout","appearance","loading","title","action","Toaster","maxItems","insets","durations","items","subscribe","getSnapshot","safeAreaInsets","viewportStyles","safeAreaTop","top","safeAreaBottom","bottom","registerRenderer","visibleSlots","visibleItems","slice","isQueued","pointerEvents","root","map","id","dismiss"],"sourceRoot":"../../../../../../src","sources":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