@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
@@ -2,8 +2,9 @@ import { useCallback, useMemo } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import { Gesture, GestureDetector } from 'react-native-gesture-handler';
4
4
  import { scheduleOnRN } from 'react-native-worklets';
5
+ import { useCommonTranslation } from '../../../../translations';
5
6
  import { useControllableState } from '../../../utils';
6
- import { chartConfig, DONUT_GEOMETRY } from '../config';
7
+ import { DONUT_GEOMETRY } from '../config';
7
8
  import { toRingLocalPoint } from './constants';
8
9
  import { DonutChartAnimatedCenter } from './DonutChartAnimatedCenter';
9
10
  import { DonutRing } from './DonutRing';
@@ -21,7 +22,7 @@ import {
21
22
  export function DonutChart({
22
23
  series: seriesProp,
23
24
  size = 'md',
24
- accessibilityLabel = 'Donut chart',
25
+ accessibilityLabel,
25
26
  loading = false,
26
27
  activeId: activeIdProp,
27
28
  defaultActiveId = null,
@@ -30,6 +31,7 @@ export function DonutChart({
30
31
  renderCenterActive,
31
32
  enableColorContrast = false,
32
33
  }: DonutChartProps) {
34
+ const { t } = useCommonTranslation();
33
35
  const geometry = DONUT_GEOMETRY[size];
34
36
 
35
37
  const [activeId, setActiveId] = useControllableState({
@@ -113,7 +115,9 @@ export function DonutChart({
113
115
  segments={segments}
114
116
  geometry={geometry}
115
117
  accessibilityLabel={
116
- loading ? chartConfig.donut.loading.ariaLabel : accessibilityLabel
118
+ loading
119
+ ? t('components.chart.loadingAriaLabel')
120
+ : (accessibilityLabel ?? t('components.chart.defaultAriaLabel'))
117
121
  }
118
122
  activeId={activeId}
119
123
  loading={loading}
@@ -8,6 +8,7 @@ import Animated, {
8
8
  } from 'react-native-reanimated';
9
9
  import { G, Path, Svg } from 'react-native-svg';
10
10
 
11
+ import { useCommonTranslation } from '../../../../translations';
11
12
  import {
12
13
  DONUT_INTERACTION,
13
14
  useChartTokens,
@@ -45,6 +46,7 @@ type RingSegmentProps = {
45
46
  };
46
47
 
47
48
  const RingSegment = ({ segment, defaultColor, activeId }: RingSegmentProps) => {
49
+ const { t } = useCommonTranslation();
48
50
  const isActive = activeId === segment.id;
49
51
  const opacity = useSharedValue(1);
50
52
  const translateX = useSharedValue(0);
@@ -85,7 +87,15 @@ const RingSegment = ({ segment, defaultColor, activeId }: RingSegmentProps) => {
85
87
  d={segment.path}
86
88
  fill={segment.color ?? defaultColor}
87
89
  accessible
88
- accessibilityLabel={isActive ? `${segment.id}, selected` : segment.id}
90
+ // react-native-svg forwards accessibilityLabel but drops accessibilityState,
91
+ // so the active state has to be part of the label.
92
+ accessibilityLabel={
93
+ isActive
94
+ ? t('components.chart.selectedSegmentAriaLabel', {
95
+ label: segment.id,
96
+ })
97
+ : segment.id
98
+ }
89
99
  animatedProps={animatedProps}
90
100
  />
91
101
  );
@@ -98,7 +98,7 @@ export type DonutChartProps = {
98
98
  size?: DonutSize;
99
99
  /**
100
100
  * Accessible label describing what the chart represents.
101
- * @default 'Donut chart'
101
+ * @default 'Chart' (translated)
102
102
  */
103
103
  accessibilityLabel?: string;
104
104
  /**
@@ -30,10 +30,7 @@ describe('Legend', () => {
30
30
  });
31
31
 
32
32
  it('renders nothing when series is empty', () => {
33
- const { toJSON, queryByLabelText } = renderWithTheme(
34
- <Legend series={[]} />,
35
- );
36
- expect(queryByLabelText('Legend')).toBeNull();
33
+ const { toJSON } = renderWithTheme(<Legend series={[]} />);
37
34
  expect(toJSON()).toBeNull();
38
35
  });
39
36
 
@@ -86,11 +83,15 @@ describe('Legend', () => {
86
83
  });
87
84
 
88
85
  it('merges consumer styles into the root', () => {
89
- const { getByLabelText } = renderWithTheme(
86
+ const { toJSON } = renderWithTheme(
90
87
  <Legend series={sampleItems} style={{ maxWidth: 176 }} />,
91
88
  );
92
- expect(getByLabelText('Legend').props.style).toEqual(
93
- expect.objectContaining({ maxWidth: 176, flexWrap: 'wrap' }),
94
- );
89
+ // The list root is not an accessibility element, so role queries skip it.
90
+ expect(toJSON()).toMatchObject({
91
+ props: {
92
+ role: 'list',
93
+ style: expect.objectContaining({ maxWidth: 176, flexWrap: 'wrap' }),
94
+ },
95
+ });
95
96
  });
96
97
  });
@@ -19,7 +19,7 @@ const useLegendStyles = () =>
19
19
 
20
20
  export function Legend({
21
21
  series,
22
- accessibilityLabel = 'Legend',
22
+ accessibilityLabel,
23
23
  style,
24
24
  ...props
25
25
  }: LegendProps) {
@@ -23,8 +23,8 @@ export type LegendProps = {
23
23
  */
24
24
  series: LegendItem[];
25
25
  /**
26
- * Accessible label for the legend group.
27
- * @default 'Legend'
26
+ * Accessible label for the legend list. Optional: each item already carries
27
+ * its own visible text.
28
28
  */
29
29
  accessibilityLabel?: string;
30
30
  } & Omit<BoxProps, 'children'>;
@@ -4,6 +4,7 @@ import Animated from 'react-native-reanimated';
4
4
  import { G } from 'react-native-svg';
5
5
  import { useTheme } from '../../../../styles';
6
6
 
7
+ import { useCommonTranslation } from '../../../../translations';
7
8
  import { XAxis, type XAxisProps } from '../Axis/XAxis';
8
9
  import { YAxis, DEFAULT_AXIS_WIDTH, type YAxisProps } from '../Axis/YAxis';
9
10
  import { CartesianChart } from '../CartesianChart';
@@ -146,10 +147,11 @@ export function LineChart({
146
147
  animate,
147
148
  magnetRadius,
148
149
  loading = false,
149
- emptyLabel = chartConfig.emptyState.defaultLabel,
150
+ emptyLabel: emptyLabelProp,
150
151
  connectNulls,
151
152
  enableColorContrast = false,
152
153
  }: LineChartProps) {
154
+ const { t } = useCommonTranslation();
153
155
  const { theme } = useTheme();
154
156
  const bgColor = theme.colors.bg.canvas;
155
157
  const series = useMemo(
@@ -193,7 +195,13 @@ export function LineChart({
193
195
  const hasData = canRenderLine(series, xAxisConfig.data);
194
196
 
195
197
  const states = getChartDisplayStates({ loading, hasData });
196
- const ariaLabel = getChartAriaLabel({ loading, hasData, emptyLabel });
198
+ const emptyLabel = emptyLabelProp ?? t('components.chart.emptyLabel');
199
+ const ariaLabel = getChartAriaLabel({
200
+ loading,
201
+ hasData,
202
+ emptyLabel,
203
+ loadingLabel: t('components.chart.loadingAriaLabel'),
204
+ });
197
205
 
198
206
  return (
199
207
  <CartesianChart
@@ -62,7 +62,7 @@ export type LineChartProps = LineRenderOptions &
62
62
  /**
63
63
  * Text shown in the centre of the chart when there is no data and the chart
64
64
  * is not loading.
65
- * @default 'No data'
65
+ * @default 'No data' (translated)
66
66
  */
67
67
  emptyLabel?: string;
68
68
  /**
@@ -187,6 +187,7 @@ describe('getChartAriaLabel', () => {
187
187
  loading: true,
188
188
  hasData: false,
189
189
  emptyLabel: 'No data',
190
+ loadingLabel: 'Loading chart',
190
191
  }),
191
192
  ).toBe('Loading chart');
192
193
  expect(
@@ -194,6 +195,7 @@ describe('getChartAriaLabel', () => {
194
195
  loading: true,
195
196
  hasData: true,
196
197
  emptyLabel: 'No data',
198
+ loadingLabel: 'Loading chart',
197
199
  }),
198
200
  ).toBe('Loading chart');
199
201
  });
@@ -204,6 +206,7 @@ describe('getChartAriaLabel', () => {
204
206
  loading: false,
205
207
  hasData: false,
206
208
  emptyLabel: 'Nothing here',
209
+ loadingLabel: 'Loading chart',
207
210
  }),
208
211
  ).toBe('Nothing here');
209
212
  });
@@ -214,6 +217,7 @@ describe('getChartAriaLabel', () => {
214
217
  loading: false,
215
218
  hasData: true,
216
219
  emptyLabel: 'No data',
220
+ loadingLabel: 'Loading chart',
217
221
  }),
218
222
  ).toBeUndefined();
219
223
  });
@@ -74,9 +74,13 @@ export const getChartAriaLabel = ({
74
74
  loading,
75
75
  hasData,
76
76
  emptyLabel,
77
- }: ChartDisplayStateParams & { emptyLabel: string }): string | undefined => {
77
+ loadingLabel,
78
+ }: ChartDisplayStateParams & {
79
+ emptyLabel: string;
80
+ loadingLabel: string;
81
+ }): string | undefined => {
78
82
  if (loading) {
79
- return chartConfig.emptyState.loadingAriaLabel;
83
+ return loadingLabel;
80
84
  }
81
85
 
82
86
  if (!hasData) {
@@ -65,8 +65,6 @@ export const chartConfig = {
65
65
 
66
66
  emptyState: {
67
67
  minDrawablePoints: 2,
68
- loadingAriaLabel: 'Loading chart',
69
- defaultLabel: 'No data',
70
68
  gridLineRatios: [0.3, 0.5, 0.7],
71
69
  placeholderViewWidth: 728,
72
70
  placeholderViewHeight: 208,
@@ -136,7 +134,6 @@ export const chartConfig = {
136
134
  loading: {
137
135
  duration: 2000,
138
136
  minOpacity: 0.5,
139
- ariaLabel: 'Loading donut chart',
140
137
  },
141
138
  },
142
139
  } as const;
@@ -0,0 +1,2 @@
1
+ export { type SupportedLocale, Languages } from './languages';
2
+ export { TranslationsProvider, useCommonTranslation } from './translations';
@@ -46,9 +46,3 @@ export const DEFAULT_LANGUAGE = Languages.en.id;
46
46
  * Supported locales type
47
47
  */
48
48
  export type SupportedLocale = keyof typeof Languages;
49
-
50
- /**
51
- * Default namespace for i18n
52
- * Currently there is only one namespace
53
- */
54
- export const I18N_DEFAULT_NAMESPACE = 'common';
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Schließen"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(Öffnet in neuem Tab)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Schritt {{currentStep}} von {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Close"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(opens in a new tab)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Step {{currentStep}} of {{totalSteps}}"
33
30
  },
@@ -35,6 +32,15 @@
35
32
  "positiveAriaLabel": "Trending up by {{value}}",
36
33
  "negativeAriaLabel": "Trending down by {{value}}",
37
34
  "neutralAriaLabel": "No change, {{value}}"
35
+ },
36
+ "chart": {
37
+ "emptyLabel": "No data",
38
+ "loadingAriaLabel": "Loading chart",
39
+ "defaultAriaLabel": "Chart",
40
+ "selectedSegmentAriaLabel": "{{label}}, selected"
41
+ },
42
+ "subheader": {
43
+ "moreInfoAriaLabel": "More information"
38
44
  }
39
45
  }
40
46
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Cerrar"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(se abre en una pestaña nueva)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Paso {{currentStep}} de {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Fermer"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(s'ouvre dans un nouvel onglet)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Étape {{currentStep}} sur {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "閉じる"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(新しいタブで開く)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "ステップ{{currentStep}}/{{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "닫기"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(새 탭에서 열기)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "{{totalSteps}} 중 {{currentStep}} 단계"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Fechar"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(abre em uma nova aba)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Passo {{currentStep}} de {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Закрыть"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(открывается в новой вкладке)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Шаг {{currentStep}} из {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "ปิด"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(เปิดในแท็บใหม่)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "ขั้นตอนที่ {{currentStep}} จาก {{totalSteps}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "Kapat"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(yeni sekmede açılır)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "Adım {{totalSteps}} / {{currentStep}}"
33
30
  }
@@ -25,9 +25,6 @@
25
25
  "banner": {
26
26
  "closeAriaLabel": "关闭"
27
27
  },
28
- "link": {
29
- "opensInNewTabAriaLabel": "(在新选项卡中打开)"
30
- },
31
28
  "stepper": {
32
29
  "progressAriaLabel": "第 {{currentStep}} / {{totalSteps}} 步"
33
30
  }
@@ -0,0 +1,56 @@
1
+ import { describe, expect, it } from '@jest/globals';
2
+ import { dictionaries } from './translations';
3
+
4
+ type Dictionary = { [key: string]: string | Dictionary };
5
+
6
+ const flatten = (dictionary: Dictionary, prefix = ''): Record<string, string> =>
7
+ Object.entries(dictionary).reduce<Record<string, string>>(
8
+ (entries, [key, value]) => {
9
+ const path = prefix ? `${prefix}.${key}` : key;
10
+ return typeof value === 'string'
11
+ ? { ...entries, [path]: value }
12
+ : { ...entries, ...flatten(value, path) };
13
+ },
14
+ {},
15
+ );
16
+
17
+ const placeholdersOf = (value: string): string[] =>
18
+ [...value.matchAll(/\{\{\s*(\w+)\s*\}\}/g)].map(([, name]) => name).sort();
19
+
20
+ // Keys that are allowed to fall back to en until they are translated.
21
+ const UNTRANSLATED_KEYS = [
22
+ 'components.trend.positiveAriaLabel',
23
+ 'components.trend.negativeAriaLabel',
24
+ 'components.trend.neutralAriaLabel',
25
+ 'components.chart.emptyLabel',
26
+ 'components.chart.loadingAriaLabel',
27
+ 'components.chart.defaultAriaLabel',
28
+ 'components.chart.selectedSegmentAriaLabel',
29
+ 'components.subheader.moreInfoAriaLabel',
30
+ ];
31
+ const source = flatten(dictionaries.en);
32
+ const locales = Object.entries(dictionaries)
33
+ .filter(([locale]) => locale !== 'en')
34
+ .map(([locale, dictionary]) => [locale, flatten(dictionary)] as const);
35
+
36
+ describe('translation dictionaries', () => {
37
+ it.each(locales)('%s has no key that en lacks', (_, entries) => {
38
+ expect(Object.keys(entries).filter((key) => !(key in source))).toEqual([]);
39
+ });
40
+
41
+ it.each(locales)('%s translates every en key', (_, entries) => {
42
+ const missing = Object.keys(source).filter(
43
+ (key) => !(key in entries) && !UNTRANSLATED_KEYS.includes(key),
44
+ );
45
+ expect(missing).toEqual([]);
46
+ });
47
+
48
+ it.each(locales)('%s uses the same placeholders as en', (_, entries) => {
49
+ const mismatches = Object.entries(entries).filter(
50
+ ([key, value]) =>
51
+ placeholdersOf(value).join() !==
52
+ placeholdersOf(source[key] ?? '').join(),
53
+ );
54
+ expect(mismatches).toEqual([]);
55
+ });
56
+ });
@@ -0,0 +1,21 @@
1
+ import { createTranslations } from '@ledgerhq/lumen-utils-shared';
2
+ import { DEFAULT_LANGUAGE, type SupportedLocale } from './languages';
3
+ import de from './locales/de.json';
4
+ import en from './locales/en.json';
5
+ import es from './locales/es.json';
6
+ import fr from './locales/fr.json';
7
+ import ja from './locales/ja.json';
8
+ import ko from './locales/ko.json';
9
+ import pt from './locales/pt.json';
10
+ import ru from './locales/ru.json';
11
+ import th from './locales/th.json';
12
+ import tr from './locales/tr.json';
13
+ import zh from './locales/zh.json';
14
+
15
+ export const dictionaries = { de, en, es, fr, ja, ko, pt, ru, th, tr, zh };
16
+
17
+ export const { TranslationsProvider, useTranslations: useCommonTranslation } =
18
+ createTranslations<SupportedLocale, typeof en>({
19
+ dictionaries,
20
+ defaultLocale: DEFAULT_LANGUAGE,
21
+ });
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- import { useEffect } from 'react';
4
- import { I18nextProvider } from 'react-i18next';
5
- import { i18n, switchLanguage } from "./i18n.js";
6
- import { DEFAULT_LANGUAGE } from "./languages.js";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- export const I18nProvider = ({
9
- locale = DEFAULT_LANGUAGE,
10
- children
11
- }) => {
12
- useEffect(() => {
13
- switchLanguage(locale);
14
- }, [locale]);
15
- return /*#__PURE__*/_jsx(I18nextProvider, {
16
- i18n: i18n,
17
- children: children
18
- });
19
- };
20
- //# sourceMappingURL=I18nProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","I18nextProvider","i18n","switchLanguage","DEFAULT_LANGUAGE","jsx","_jsx","I18nProvider","locale","children"],"sourceRoot":"../../../src","sources":["i18n/I18nProvider.tsx"],"mappings":";;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,IAAI,EAAEC,cAAc,QAAQ,WAAQ;AAC7C,SAASC,gBAAgB,QAA8B,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMrE,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAC3BC,MAAM,GAAGJ,gBAAgB;EACzBK;AACiB,CAAC,KAAK;EACvBT,SAAS,CAAC,MAAM;IACdG,cAAc,CAACK,MAAM,CAAC;EACxB,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,oBAAOF,IAAA,CAACL,eAAe;IAACC,IAAI,EAAEA,IAAK;IAAAO,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AAClE,CAAC","ignoreList":[]}
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- import i18next from 'i18next';
4
- import { initReactI18next } from 'react-i18next';
5
- import { DEFAULT_LANGUAGE, I18N_DEFAULT_NAMESPACE } from "./languages.js";
6
- import de from './locales/de.json';
7
- import en from './locales/en.json';
8
- import es from './locales/es.json';
9
- import fr from './locales/fr.json';
10
- import ja from './locales/ja.json';
11
- import ko from './locales/ko.json';
12
- import pt from './locales/pt.json';
13
- import ru from './locales/ru.json';
14
- import th from './locales/th.json';
15
- import tr from './locales/tr.json';
16
- import zh from './locales/zh.json';
17
- const localeResources = {
18
- de,
19
- en,
20
- es,
21
- fr,
22
- ja,
23
- ko,
24
- pt,
25
- ru,
26
- th,
27
- tr,
28
- zh
29
- };
30
- const loadedLocales = new Set();
31
- const initializeI18n = () => {
32
- const instance = i18next.createInstance();
33
- const resources = Object.fromEntries(Object.entries(localeResources).map(([locale, translations]) => [locale, {
34
- [I18N_DEFAULT_NAMESPACE]: translations
35
- }]));
36
- Object.keys(localeResources).forEach(locale => loadedLocales.add(locale));
37
- instance.use(initReactI18next).init({
38
- resources,
39
- lng: DEFAULT_LANGUAGE,
40
- defaultNS: I18N_DEFAULT_NAMESPACE,
41
- fallbackLng: DEFAULT_LANGUAGE,
42
- interpolation: {
43
- escapeValue: false
44
- },
45
- react: {
46
- useSuspense: false
47
- }
48
- }).catch(error => {
49
- // eslint-disable-next-line no-console
50
- console.error('Failed to initialize i18next:', error);
51
- });
52
- return instance;
53
- };
54
- export const i18n = initializeI18n();
55
-
56
- /**
57
- * Loads the translations for a given locale.
58
- * In React Native, we bundle all locales, so this just adds the resource bundle.
59
- */
60
- export const loadLocale = async locale => {
61
- if (loadedLocales.has(locale)) {
62
- return;
63
- }
64
- try {
65
- const translations = localeResources[locale];
66
- i18n.addResourceBundle(locale, I18N_DEFAULT_NAMESPACE, translations, true, true);
67
- loadedLocales.add(locale);
68
- } catch (error) {
69
- // eslint-disable-next-line no-console
70
- console.error(`Failed to load locale ${locale}`, error);
71
- throw error;
72
- }
73
- };
74
-
75
- /**
76
- * Switches the language to the given locale.
77
- */
78
- export const switchLanguage = async locale => {
79
- await loadLocale(locale);
80
- await i18n.changeLanguage(locale);
81
- };
82
- //# sourceMappingURL=i18n.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["i18next","initReactI18next","DEFAULT_LANGUAGE","I18N_DEFAULT_NAMESPACE","de","en","es","fr","ja","ko","pt","ru","th","tr","zh","localeResources","loadedLocales","Set","initializeI18n","instance","createInstance","resources","Object","fromEntries","entries","map","locale","translations","keys","forEach","add","use","init","lng","defaultNS","fallbackLng","interpolation","escapeValue","react","useSuspense","catch","error","console","i18n","loadLocale","has","addResourceBundle","switchLanguage","changeLanguage"],"sourceRoot":"../../../src","sources":["i18n/i18n.ts"],"mappings":"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","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- export { I18nProvider } from "./I18nProvider.js";
4
- export { Languages } from "./languages.js";
5
- export { useCommonTranslation } from "./useCommonTranslation.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["I18nProvider","Languages","useCommonTranslation"],"sourceRoot":"../../../src","sources":["i18n/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,mBAAgB;AAC7C,SAA+BC,SAAS,QAAQ,gBAAa;AAC7D,SAASC,oBAAoB,QAAQ,2BAAwB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["Languages","de","id","en","es","fr","ja","ko","pt","ru","th","tr","zh","DEFAULT_LANGUAGE","I18N_DEFAULT_NAMESPACE"],"sourceRoot":"../../../src","sources":["i18n/languages.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG;EACvBC,EAAE,EAAE;IACFC,EAAE,EAAE;EACN,CAAC;EACDC,EAAE,EAAE;IACFD,EAAE,EAAE;EACN,CAAC;EACDE,EAAE,EAAE;IACFF,EAAE,EAAE;EACN,CAAC;EACDG,EAAE,EAAE;IACFH,EAAE,EAAE;EACN,CAAC;EACDI,EAAE,EAAE;IACFJ,EAAE,EAAE;EACN,CAAC;EACDK,EAAE,EAAE;IACFL,EAAE,EAAE;EACN,CAAC;EACDM,EAAE,EAAE;IACFN,EAAE,EAAE;EACN,CAAC;EACDO,EAAE,EAAE;IACFP,EAAE,EAAE;EACN,CAAC;EACDQ,EAAE,EAAE;IACFR,EAAE,EAAE;EACN,CAAC;EACDS,EAAE,EAAE;IACFT,EAAE,EAAE;EACN,CAAC;EACDU,EAAE,EAAE;IACFV,EAAE,EAAE;EACN;AACF,CAAmD;;AAEnD;AACA;AACA;AACA,OAAO,MAAMW,gBAAgB,GAAGb,SAAS,CAACG,EAAE,CAACD,EAAE;;AAE/C;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,OAAO,MAAMY,sBAAsB,GAAG,QAAQ","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- import { useTranslation as useI18nextTranslation } from 'react-i18next';
4
- import { I18N_DEFAULT_NAMESPACE } from "./languages.js";
5
- export const useCommonTranslation = () => {
6
- return useI18nextTranslation(I18N_DEFAULT_NAMESPACE);
7
- };
8
- //# sourceMappingURL=useCommonTranslation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useTranslation","useI18nextTranslation","I18N_DEFAULT_NAMESPACE","useCommonTranslation"],"sourceRoot":"../../../src","sources":["i18n/useCommonTranslation.ts"],"mappings":";;AAAA,SAASA,cAAc,IAAIC,qBAAqB,QAAQ,eAAe;AACvE,SAASC,sBAAsB,QAAQ,gBAAa;AAEpD,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,OAAOF,qBAAqB,CAACC,sBAAsB,CAAC;AACtD,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- import { type SupportedLocale } from './languages';
3
- type I18nProviderProps = PropsWithChildren & {
4
- locale?: SupportedLocale;
5
- };
6
- export declare const I18nProvider: ({ locale, children, }: I18nProviderProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
8
- //# sourceMappingURL=I18nProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18nProvider.d.ts","sourceRoot":"","sources":["../../../../src/i18n/I18nProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAErE,KAAK,iBAAiB,GAAG,iBAAiB,GAAG;IAC3C,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,uBAG1B,iBAAiB,4CAMnB,CAAC"}