@ledgerhq/lumen-ui-rnative 0.1.65 → 0.1.67

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 (304) 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/BottomSheet.stories.js +6 -3
  14. package/dist/module/lib/Components/core/BottomSheet/BottomSheet.stories.js.map +1 -1
  15. package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js +1 -1
  16. package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js.map +1 -1
  17. package/dist/module/lib/Components/core/Card/Card.figma.js +0 -1
  18. package/dist/module/lib/Components/core/Card/Card.figma.js.map +1 -1
  19. package/dist/module/lib/Components/core/Card/Card.stories.js +0 -2
  20. package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
  21. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.figma.js +0 -1
  22. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.figma.js.map +1 -1
  23. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js +2 -2
  24. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js.map +1 -1
  25. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.mdx +4 -4
  26. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +1 -9
  27. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
  28. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.test.js +0 -1
  29. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.test.js.map +1 -1
  30. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js +0 -5
  31. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js.map +1 -1
  32. package/dist/module/lib/Components/core/ListItem/ListItem.figma.js +0 -1
  33. package/dist/module/lib/Components/core/ListItem/ListItem.figma.js.map +1 -1
  34. package/dist/module/lib/Components/core/ListItem/ListItem.js +1 -1
  35. package/dist/module/lib/Components/core/ListItem/ListItem.mdx +10 -10
  36. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +2 -29
  37. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
  38. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js +1 -1
  39. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js.map +1 -1
  40. package/dist/module/lib/Components/core/MediaCard/MediaCard.js +1 -1
  41. package/dist/module/lib/Components/core/MediaCard/MediaCard.js.map +1 -1
  42. package/dist/module/lib/Components/core/NavBar/NavBar.js +1 -1
  43. package/dist/module/lib/Components/core/NavBar/NavBar.js.map +1 -1
  44. package/dist/module/lib/Components/core/SelectList/SelectList.mdx +1 -1
  45. package/dist/module/lib/Components/core/SelectList/SelectList.stories.js +0 -1
  46. package/dist/module/lib/Components/core/SelectList/SelectList.stories.js.map +1 -1
  47. package/dist/module/lib/Components/core/Spinner/Spinner.js +1 -1
  48. package/dist/module/lib/Components/core/Spinner/Spinner.js.map +1 -1
  49. package/dist/module/lib/Components/core/Spot/Spot.figma.js +31 -16
  50. package/dist/module/lib/Components/core/Spot/Spot.figma.js.map +1 -1
  51. package/dist/module/lib/Components/core/Spot/Spot.js +24 -146
  52. package/dist/module/lib/Components/core/Spot/Spot.js.map +1 -1
  53. package/dist/module/lib/Components/core/Spot/Spot.mdx +47 -108
  54. package/dist/module/lib/Components/core/Spot/Spot.stories.js +108 -215
  55. package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
  56. package/dist/module/lib/Components/core/Spot/Spot.test.js +61 -0
  57. package/dist/module/lib/Components/core/Spot/Spot.test.js.map +1 -0
  58. package/dist/module/lib/Components/core/Spot/SpotNumber.js +56 -0
  59. package/dist/module/lib/Components/core/Spot/SpotNumber.js.map +1 -0
  60. package/dist/module/lib/Components/core/Spot/SpotNumber.test.js +72 -0
  61. package/dist/module/lib/Components/core/Spot/SpotNumber.test.js.map +1 -0
  62. package/dist/module/lib/Components/core/Spot/index.js +1 -0
  63. package/dist/module/lib/Components/core/Spot/index.js.map +1 -1
  64. package/dist/module/lib/Components/core/Spot/useSpotStyles.js +93 -0
  65. package/dist/module/lib/Components/core/Spot/useSpotStyles.js.map +1 -0
  66. package/dist/module/lib/Components/core/Stepper/Stepper.js +1 -1
  67. package/dist/module/lib/Components/core/Stepper/Stepper.js.map +1 -1
  68. package/dist/module/lib/Components/core/Subheader/Subheader.js +5 -1
  69. package/dist/module/lib/Components/core/Subheader/Subheader.js.map +1 -1
  70. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js +2 -2
  71. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js.map +1 -1
  72. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js +9 -1
  73. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js.map +1 -1
  74. package/dist/module/lib/Components/core/Tile/Tile.figma.js +0 -1
  75. package/dist/module/lib/Components/core/Tile/Tile.figma.js.map +1 -1
  76. package/dist/module/lib/Components/core/Tile/Tile.js +3 -3
  77. package/dist/module/lib/Components/core/Tile/Tile.mdx +8 -8
  78. package/dist/module/lib/Components/core/Tile/Tile.stories.js +7 -25
  79. package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
  80. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js +1 -1
  81. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js.map +1 -1
  82. package/dist/module/lib/Components/core/Trend/Trend.js +1 -1
  83. package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
  84. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +1 -1
  85. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
  86. package/dist/module/lib/Components/symbols/icons/AiBubble.js +60 -0
  87. package/dist/module/lib/Components/symbols/icons/AiBubble.js.map +1 -0
  88. package/dist/module/lib/Components/symbols/icons/ArrowBottomLeft.js +49 -0
  89. package/dist/module/lib/Components/symbols/icons/ArrowBottomLeft.js.map +1 -0
  90. package/dist/module/lib/Components/symbols/icons/Bug.js +1 -1
  91. package/dist/module/lib/Components/symbols/icons/Bug.js.map +1 -1
  92. package/dist/module/lib/Components/symbols/icons/Hourglass.js +49 -0
  93. package/dist/module/lib/Components/symbols/icons/Hourglass.js.map +1 -0
  94. package/dist/module/lib/Components/symbols/icons/Repeat.js +49 -0
  95. package/dist/module/lib/Components/symbols/icons/Repeat.js.map +1 -0
  96. package/dist/module/lib/Components/symbols/icons/Robot.js +57 -0
  97. package/dist/module/lib/Components/symbols/icons/Robot.js.map +1 -0
  98. package/dist/module/lib/Components/symbols/icons/Switch.js +11 -5
  99. package/dist/module/lib/Components/symbols/icons/Switch.js.map +1 -1
  100. package/dist/module/lib/Components/symbols/icons/Wifi.js +52 -0
  101. package/dist/module/lib/Components/symbols/icons/Wifi.js.map +1 -0
  102. package/dist/module/lib/Components/symbols/index.js +6 -0
  103. package/dist/module/lib/Components/symbols/index.js.map +1 -1
  104. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js +6 -2
  105. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js.map +1 -1
  106. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js +8 -4
  107. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js.map +1 -1
  108. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js +1 -1
  109. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js.map +1 -1
  110. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js +12 -3
  111. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js.map +1 -1
  112. package/dist/module/lib/Components/visualization/Legend/Legend.js +1 -1
  113. package/dist/module/lib/Components/visualization/Legend/Legend.js.map +1 -1
  114. package/dist/module/lib/Components/visualization/Legend/Legend.test.js +12 -8
  115. package/dist/module/lib/Components/visualization/Legend/Legend.test.js.map +1 -1
  116. package/dist/module/lib/Components/visualization/LineChart/LineChart.js +8 -2
  117. package/dist/module/lib/Components/visualization/LineChart/LineChart.js.map +1 -1
  118. package/dist/module/lib/Components/visualization/LineChart/utils.js +3 -2
  119. package/dist/module/lib/Components/visualization/LineChart/utils.js.map +1 -1
  120. package/dist/module/lib/Components/visualization/LineChart/utils.test.js +8 -4
  121. package/dist/module/lib/Components/visualization/LineChart/utils.test.js.map +1 -1
  122. package/dist/module/lib/Components/visualization/config.js +1 -4
  123. package/dist/module/lib/Components/visualization/config.js.map +1 -1
  124. package/dist/module/translations/index.js +5 -0
  125. package/dist/module/translations/index.js.map +1 -0
  126. package/dist/module/{i18n → translations}/languages.js +0 -6
  127. package/dist/module/translations/languages.js.map +1 -0
  128. package/dist/module/{i18n → translations}/locales/de.json +0 -3
  129. package/{src/i18n → dist/module/translations}/locales/en.json +9 -3
  130. package/{src/i18n → dist/module/translations}/locales/es.json +0 -3
  131. package/dist/module/{i18n → translations}/locales/fr.json +0 -3
  132. package/{src/i18n → dist/module/translations}/locales/ja.json +0 -3
  133. package/dist/module/{i18n → translations}/locales/ko.json +0 -3
  134. package/dist/module/{i18n → translations}/locales/pt.json +0 -3
  135. package/dist/module/{i18n → translations}/locales/ru.json +0 -3
  136. package/dist/module/{i18n → translations}/locales/th.json +0 -3
  137. package/dist/module/{i18n → translations}/locales/tr.json +0 -3
  138. package/{src/i18n → dist/module/translations}/locales/zh.json +0 -3
  139. package/dist/module/translations/translations.js +36 -0
  140. package/dist/module/translations/translations.js.map +1 -0
  141. package/dist/module/translations/translations.test.js +34 -0
  142. package/dist/module/translations/translations.test.js.map +1 -0
  143. package/dist/typescript/src/index.d.ts +1 -1
  144. package/dist/typescript/src/index.d.ts.map +1 -1
  145. package/dist/typescript/src/lib/Components/core/ContentBanner/ContentBanner.d.ts +1 -1
  146. package/dist/typescript/src/lib/Components/core/ListItem/ListItem.d.ts +1 -1
  147. package/dist/typescript/src/lib/Components/core/Spot/Spot.d.ts +7 -25
  148. package/dist/typescript/src/lib/Components/core/Spot/Spot.d.ts.map +1 -1
  149. package/dist/typescript/src/lib/Components/core/Spot/SpotNumber.d.ts +16 -0
  150. package/dist/typescript/src/lib/Components/core/Spot/SpotNumber.d.ts.map +1 -0
  151. package/dist/typescript/src/lib/Components/core/Spot/index.d.ts +1 -0
  152. package/dist/typescript/src/lib/Components/core/Spot/index.d.ts.map +1 -1
  153. package/dist/typescript/src/lib/Components/core/Spot/types.d.ts +29 -29
  154. package/dist/typescript/src/lib/Components/core/Spot/types.d.ts.map +1 -1
  155. package/dist/typescript/src/lib/Components/core/Spot/useSpotStyles.d.ts +14 -0
  156. package/dist/typescript/src/lib/Components/core/Spot/useSpotStyles.d.ts.map +1 -0
  157. package/dist/typescript/src/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
  158. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts +1 -1
  159. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts.map +1 -1
  160. package/dist/typescript/src/lib/Components/core/Tile/Tile.d.ts +3 -3
  161. package/dist/typescript/src/lib/Components/symbols/icons/AiBubble.d.ts +35 -0
  162. package/dist/typescript/src/lib/Components/symbols/icons/AiBubble.d.ts.map +1 -0
  163. package/dist/typescript/src/lib/Components/symbols/icons/ArrowBottomLeft.d.ts +35 -0
  164. package/dist/typescript/src/lib/Components/symbols/icons/ArrowBottomLeft.d.ts.map +1 -0
  165. package/dist/typescript/src/lib/Components/symbols/icons/Hourglass.d.ts +35 -0
  166. package/dist/typescript/src/lib/Components/symbols/icons/Hourglass.d.ts.map +1 -0
  167. package/dist/typescript/src/lib/Components/symbols/icons/Repeat.d.ts +35 -0
  168. package/dist/typescript/src/lib/Components/symbols/icons/Repeat.d.ts.map +1 -0
  169. package/dist/typescript/src/lib/Components/symbols/icons/Robot.d.ts +35 -0
  170. package/dist/typescript/src/lib/Components/symbols/icons/Robot.d.ts.map +1 -0
  171. package/dist/typescript/src/lib/Components/symbols/icons/Switch.d.ts.map +1 -1
  172. package/dist/typescript/src/lib/Components/symbols/icons/Wifi.d.ts +35 -0
  173. package/dist/typescript/src/lib/Components/symbols/icons/Wifi.d.ts.map +1 -0
  174. package/dist/typescript/src/lib/Components/symbols/index.d.ts +6 -0
  175. package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
  176. package/dist/typescript/src/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
  177. package/dist/typescript/src/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
  178. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
  179. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
  180. package/dist/typescript/src/lib/Components/visualization/DonutChart/types.d.ts +1 -1
  181. package/dist/typescript/src/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
  182. package/dist/typescript/src/lib/Components/visualization/Legend/types.d.ts +2 -2
  183. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
  184. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
  185. package/dist/typescript/src/lib/Components/visualization/LineChart/types.d.ts +1 -1
  186. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts +2 -1
  187. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
  188. package/dist/typescript/src/lib/Components/visualization/config.d.ts +0 -3
  189. package/dist/typescript/src/lib/Components/visualization/config.d.ts.map +1 -1
  190. package/dist/typescript/src/translations/index.d.ts +3 -0
  191. package/dist/typescript/src/translations/index.d.ts.map +1 -0
  192. package/dist/typescript/src/{i18n → translations}/languages.d.ts +0 -5
  193. package/dist/typescript/src/translations/languages.d.ts.map +1 -0
  194. package/dist/typescript/src/translations/translations.d.ts +421 -0
  195. package/dist/typescript/src/translations/translations.d.ts.map +1 -0
  196. package/package.json +4 -6
  197. package/src/index.ts +1 -1
  198. package/src/lib/Components/core/AddressInput/AddressInput.tsx +1 -1
  199. package/src/lib/Components/core/AmountDisplay/AmountDisplay.tsx +1 -1
  200. package/src/lib/Components/core/AmountInput/AmountInput.tsx +1 -1
  201. package/src/lib/Components/core/Avatar/Avatar.tsx +1 -1
  202. package/src/lib/Components/core/Banner/Banner.tsx +1 -1
  203. package/src/lib/Components/core/BottomSheet/BottomSheet.stories.tsx +12 -4
  204. package/src/lib/Components/core/BottomSheet/BottomSheetHeader.tsx +1 -1
  205. package/src/lib/Components/core/Card/Card.figma.tsx +1 -1
  206. package/src/lib/Components/core/Card/Card.stories.tsx +2 -2
  207. package/src/lib/Components/core/ContentBanner/ContentBanner.figma.tsx +1 -1
  208. package/src/lib/Components/core/ContentBanner/ContentBanner.mdx +4 -4
  209. package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +9 -9
  210. package/src/lib/Components/core/ContentBanner/ContentBanner.test.tsx +1 -1
  211. package/src/lib/Components/core/ContentBanner/ContentBanner.tsx +2 -2
  212. package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +5 -5
  213. package/src/lib/Components/core/ListItem/ListItem.figma.tsx +1 -1
  214. package/src/lib/Components/core/ListItem/ListItem.mdx +10 -10
  215. package/src/lib/Components/core/ListItem/ListItem.stories.tsx +29 -33
  216. package/src/lib/Components/core/ListItem/ListItem.tsx +1 -1
  217. package/src/lib/Components/core/MediaBanner/MediaBanner.tsx +1 -1
  218. package/src/lib/Components/core/MediaCard/MediaCard.tsx +1 -1
  219. package/src/lib/Components/core/NavBar/NavBar.tsx +1 -1
  220. package/src/lib/Components/core/SelectList/SelectList.mdx +1 -1
  221. package/src/lib/Components/core/SelectList/SelectList.stories.tsx +1 -1
  222. package/src/lib/Components/core/Spinner/Spinner.tsx +1 -1
  223. package/src/lib/Components/core/Spot/Spot.figma.tsx +42 -21
  224. package/src/lib/Components/core/Spot/Spot.mdx +47 -108
  225. package/src/lib/Components/core/Spot/Spot.stories.tsx +114 -175
  226. package/src/lib/Components/core/Spot/Spot.test.tsx +71 -0
  227. package/src/lib/Components/core/Spot/Spot.tsx +21 -163
  228. package/src/lib/Components/core/Spot/SpotNumber.test.tsx +93 -0
  229. package/src/lib/Components/core/Spot/SpotNumber.tsx +48 -0
  230. package/src/lib/Components/core/Spot/index.ts +1 -0
  231. package/src/lib/Components/core/Spot/types.ts +39 -41
  232. package/src/lib/Components/core/Spot/useSpotStyles.ts +119 -0
  233. package/src/lib/Components/core/Stepper/Stepper.tsx +1 -1
  234. package/src/lib/Components/core/Subheader/Subheader.tsx +3 -1
  235. package/src/lib/Components/core/ThemeProvider/ThemeProvider.test.tsx +12 -1
  236. package/src/lib/Components/core/ThemeProvider/ThemeProvider.tsx +3 -3
  237. package/src/lib/Components/core/ThemeProvider/types.ts +1 -1
  238. package/src/lib/Components/core/Tile/Tile.figma.tsx +1 -1
  239. package/src/lib/Components/core/Tile/Tile.mdx +8 -8
  240. package/src/lib/Components/core/Tile/Tile.stories.tsx +32 -25
  241. package/src/lib/Components/core/Tile/Tile.tsx +3 -3
  242. package/src/lib/Components/core/Toast/hooks/useToastAccessibility.ts +1 -1
  243. package/src/lib/Components/core/Trend/Trend.tsx +1 -1
  244. package/src/lib/Components/internal/BaseInput/BaseInput.tsx +1 -1
  245. package/src/lib/Components/symbols/icons/AiBubble.tsx +51 -0
  246. package/src/lib/Components/symbols/icons/ArrowBottomLeft.tsx +44 -0
  247. package/src/lib/Components/symbols/icons/Bug.tsx +1 -1
  248. package/src/lib/Components/symbols/icons/Hourglass.tsx +44 -0
  249. package/src/lib/Components/symbols/icons/Repeat.tsx +44 -0
  250. package/src/lib/Components/symbols/icons/Robot.tsx +44 -0
  251. package/src/lib/Components/symbols/icons/Switch.tsx +8 -1
  252. package/src/lib/Components/symbols/icons/Wifi.tsx +48 -0
  253. package/src/lib/Components/symbols/index.ts +6 -0
  254. package/src/lib/Components/visualization/CartesianChart/CartesianChart.tsx +4 -2
  255. package/src/lib/Components/visualization/CartesianChart/types.ts +1 -1
  256. package/src/lib/Components/visualization/DonutChart/DonutChart.test.tsx +1 -3
  257. package/src/lib/Components/visualization/DonutChart/DonutChart.tsx +7 -3
  258. package/src/lib/Components/visualization/DonutChart/DonutRing.tsx +11 -1
  259. package/src/lib/Components/visualization/DonutChart/types.ts +1 -1
  260. package/src/lib/Components/visualization/Legend/Legend.test.tsx +9 -8
  261. package/src/lib/Components/visualization/Legend/Legend.tsx +1 -1
  262. package/src/lib/Components/visualization/Legend/types.ts +2 -2
  263. package/src/lib/Components/visualization/LineChart/LineChart.tsx +10 -2
  264. package/src/lib/Components/visualization/LineChart/types.ts +1 -1
  265. package/src/lib/Components/visualization/LineChart/utils.test.ts +4 -0
  266. package/src/lib/Components/visualization/LineChart/utils.ts +6 -2
  267. package/src/lib/Components/visualization/config.ts +0 -3
  268. package/src/translations/index.ts +2 -0
  269. package/src/{i18n → translations}/languages.ts +0 -6
  270. package/src/{i18n → translations}/locales/de.json +0 -3
  271. package/{dist/module/i18n → src/translations}/locales/en.json +9 -3
  272. package/{dist/module/i18n → src/translations}/locales/es.json +0 -3
  273. package/src/{i18n → translations}/locales/fr.json +0 -3
  274. package/{dist/module/i18n → src/translations}/locales/ja.json +0 -3
  275. package/src/{i18n → translations}/locales/ko.json +0 -3
  276. package/src/{i18n → translations}/locales/pt.json +0 -3
  277. package/src/{i18n → translations}/locales/ru.json +0 -3
  278. package/src/{i18n → translations}/locales/th.json +0 -3
  279. package/src/{i18n → translations}/locales/tr.json +0 -3
  280. package/{dist/module/i18n → src/translations}/locales/zh.json +0 -3
  281. package/src/translations/translations.test.ts +56 -0
  282. package/src/translations/translations.ts +21 -0
  283. package/dist/module/i18n/I18nProvider.js +0 -20
  284. package/dist/module/i18n/I18nProvider.js.map +0 -1
  285. package/dist/module/i18n/i18n.js +0 -82
  286. package/dist/module/i18n/i18n.js.map +0 -1
  287. package/dist/module/i18n/index.js +0 -6
  288. package/dist/module/i18n/index.js.map +0 -1
  289. package/dist/module/i18n/languages.js.map +0 -1
  290. package/dist/module/i18n/useCommonTranslation.js +0 -8
  291. package/dist/module/i18n/useCommonTranslation.js.map +0 -1
  292. package/dist/typescript/src/i18n/I18nProvider.d.ts +0 -8
  293. package/dist/typescript/src/i18n/I18nProvider.d.ts.map +0 -1
  294. package/dist/typescript/src/i18n/i18n.d.ts +0 -13
  295. package/dist/typescript/src/i18n/i18n.d.ts.map +0 -1
  296. package/dist/typescript/src/i18n/index.d.ts +0 -4
  297. package/dist/typescript/src/i18n/index.d.ts.map +0 -1
  298. package/dist/typescript/src/i18n/languages.d.ts.map +0 -1
  299. package/dist/typescript/src/i18n/useCommonTranslation.d.ts +0 -2
  300. package/dist/typescript/src/i18n/useCommonTranslation.d.ts.map +0 -1
  301. package/src/i18n/I18nProvider.tsx +0 -20
  302. package/src/i18n/i18n.ts +0 -107
  303. package/src/i18n/index.ts +0 -3
  304. package/src/i18n/useCommonTranslation.ts +0 -6
@@ -0,0 +1,48 @@
1
+ import Svg, { Path } from 'react-native-svg';
2
+ import createIcon from '../Icon/createIcon';
3
+
4
+ /**
5
+ * Wifi icon component for React Native.
6
+ *
7
+ * This icon component is automatically generated from SVG files and uses the createIcon utility
8
+ * to create a consistent icon interface. It supports all standard SVG props (from react-native-svg)
9
+ * and additional size variants defined in the Icon component.
10
+ *
11
+ * @component
12
+ * @param {16 | 20 | 24 | 40 | 48 | 56} [size=24] - The size of the icon in pixels.
13
+ * @param {string} [color] - The color of the icon.
14
+ * @param {SVGProps} [...props] - All standard SVG element props (from react-native-svg).
15
+ *
16
+ * @example
17
+ * // Basic usage with default size (24px)
18
+ * import { Wifi } from '@ledgerhq/lumen-ui-rnative/symbols';
19
+ *
20
+ * <Wifi />
21
+ *
22
+ * @example
23
+ * // With custom size and style
24
+ * <Wifi size={40} color="warning" lx={{ marginTop: 's4' }} />
25
+ *
26
+ * @example
27
+ * // Used within a Button component
28
+ * import { Button } from '@ledgerhq/lumen-ui-rnative';
29
+ *
30
+ * <Button icon={Wifi} size="md">
31
+ * Click me
32
+ * </Button>
33
+ */
34
+ export const Wifi = createIcon(
35
+ 'Wifi',
36
+ <Svg width={24} height={24} fill='currentColor' viewBox='0 0 16 16'>
37
+ <Path
38
+ fill='currentColor'
39
+ d='M7.999 12.333a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5'
40
+ />
41
+ <Path
42
+ stroke='currentColor'
43
+ strokeLinecap='round'
44
+ strokeLinejoin='round'
45
+ d='M3.06 8c2.729-2.502 7.15-2.502 9.879 0M1.063 5.203c3.831-3.382 10.043-3.382 13.874 0m-9.884 5.344a4.184 4.184 0 0 1 5.894 0'
46
+ />
47
+ </Svg>,
48
+ );
@@ -1,3 +1,4 @@
1
+ export { AiBubble } from './icons/AiBubble';
1
2
  export { Airplane } from './icons/Airplane';
2
3
  export { AlarmClock } from './icons/AlarmClock';
3
4
  export { Android } from './icons/Android';
@@ -5,6 +6,7 @@ export { Apex } from './icons/Apex';
5
6
  export { Apple } from './icons/Apple';
6
7
  export { Apps } from './icons/Apps';
7
8
  export { Ar } from './icons/Ar';
9
+ export { ArrowBottomLeft } from './icons/ArrowBottomLeft';
8
10
  export { ArrowDown } from './icons/ArrowDown';
9
11
  export { ArrowDownRight } from './icons/ArrowDownRight';
10
12
  export { ArrowLeft } from './icons/ArrowLeft';
@@ -140,6 +142,7 @@ export { HatSchool } from './icons/HatSchool';
140
142
  export { Heart } from './icons/Heart';
141
143
  export { Home } from './icons/Home';
142
144
  export { HomeFill } from './icons/HomeFill';
145
+ export { Hourglass } from './icons/Hourglass';
143
146
  export { IdCard } from './icons/IdCard';
144
147
  export { Incognito } from './icons/Incognito';
145
148
  export { Infinite } from './icons/Infinite';
@@ -224,7 +227,9 @@ export { Reduce } from './icons/Reduce';
224
227
  export { Refresh } from './icons/Refresh';
225
228
  export { RefreshBack } from './icons/RefreshBack';
226
229
  export { Repair } from './icons/Repair';
230
+ export { Repeat } from './icons/Repeat';
227
231
  export { Retry } from './icons/Retry';
232
+ export { Robot } from './icons/Robot';
228
233
  export { Screens } from './icons/Screens';
229
234
  export { Search } from './icons/Search';
230
235
  export { Send } from './icons/Send';
@@ -294,6 +299,7 @@ export { Warning } from './icons/Warning';
294
299
  export { WarningCircleFill } from './icons/WarningCircleFill';
295
300
  export { WarningFill } from './icons/WarningFill';
296
301
  export { Whatsapp } from './icons/Whatsapp';
302
+ export { Wifi } from './icons/Wifi';
297
303
  export { Windows } from './icons/Windows';
298
304
  export { WirelessCharging } from './icons/WirelessCharging';
299
305
  export { Youtube } from './icons/Youtube';
@@ -2,6 +2,7 @@ import { useCallback, useMemo, useState } from 'react';
2
2
  import { View, type LayoutChangeEvent } from 'react-native';
3
3
  import { Svg } from 'react-native-svg';
4
4
 
5
+ import { useCommonTranslation } from '../../../../translations';
5
6
  import { MagneticPointsProvider } from '../Point/pointContext';
6
7
  import { ScrubberProvider } from '../Scrubber/ScrubberProvider';
7
8
  import { CartesianChartProvider, useBuildChartContext } from './context';
@@ -23,7 +24,7 @@ export function CartesianChart({
23
24
  height = DEFAULT_HEIGHT,
24
25
  inset,
25
26
  axisPadding,
26
- ariaLabel = 'Chart',
27
+ ariaLabel,
27
28
  ariaBusy = false,
28
29
  overlay,
29
30
  children,
@@ -32,6 +33,7 @@ export function CartesianChart({
32
33
  animate = true,
33
34
  magnetRadius,
34
35
  }: Readonly<CartesianChartProps>) {
36
+ const { t } = useCommonTranslation();
35
37
  const [measuredWidth, setMeasuredWidth] = useState<number | undefined>(width);
36
38
 
37
39
  const needsMeasurement = width === undefined;
@@ -76,7 +78,7 @@ export function CartesianChart({
76
78
  testID='chart-container'
77
79
  onLayout={needsMeasurement ? handleLayout : undefined}
78
80
  accessibilityRole='image'
79
- accessibilityLabel={ariaLabel}
81
+ accessibilityLabel={ariaLabel || t('components.chart.defaultAriaLabel')}
80
82
  accessibilityState={{ busy: ariaBusy }}
81
83
  style={{
82
84
  width: needsMeasurement ? undefined : resolvedWidth,
@@ -70,7 +70,7 @@ export type CartesianChartProps = ScrubbingOptions & {
70
70
  axisPadding?: Partial<ChartInset>;
71
71
  /**
72
72
  * Accessible label for the chart.
73
- * @default 'Chart'
73
+ * @default 'Chart' (translated)
74
74
  */
75
75
  ariaLabel?: string;
76
76
  /**
@@ -193,9 +193,7 @@ describe('DonutChart', () => {
193
193
 
194
194
  const ring = getByTestId('donut-ring');
195
195
  expect(ring.props.accessibilityState).toEqual({ busy: true });
196
- expect(ring.props.accessibilityLabel).toBe(
197
- chartConfig.donut.loading.ariaLabel,
198
- );
196
+ expect(ring.props.accessibilityLabel).toBe('Loading chart');
199
197
  });
200
198
 
201
199
  it('ignores taps while loading', () => {
@@ -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":[]}