@ledgerhq/lumen-ui-rnative 0.1.65 → 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 (174) 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/ContentBanner/ContentBanner.js +1 -1
  16. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js.map +1 -1
  17. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js +1 -1
  18. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js.map +1 -1
  19. package/dist/module/lib/Components/core/MediaCard/MediaCard.js +1 -1
  20. package/dist/module/lib/Components/core/MediaCard/MediaCard.js.map +1 -1
  21. package/dist/module/lib/Components/core/NavBar/NavBar.js +1 -1
  22. package/dist/module/lib/Components/core/NavBar/NavBar.js.map +1 -1
  23. package/dist/module/lib/Components/core/Spinner/Spinner.js +1 -1
  24. package/dist/module/lib/Components/core/Spinner/Spinner.js.map +1 -1
  25. package/dist/module/lib/Components/core/Stepper/Stepper.js +1 -1
  26. package/dist/module/lib/Components/core/Stepper/Stepper.js.map +1 -1
  27. package/dist/module/lib/Components/core/Subheader/Subheader.js +5 -1
  28. package/dist/module/lib/Components/core/Subheader/Subheader.js.map +1 -1
  29. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js +2 -2
  30. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js.map +1 -1
  31. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js +9 -0
  32. package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js.map +1 -1
  33. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js +1 -1
  34. package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js.map +1 -1
  35. package/dist/module/lib/Components/core/Trend/Trend.js +1 -1
  36. package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
  37. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +1 -1
  38. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
  39. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js +6 -2
  40. package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js.map +1 -1
  41. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js +8 -4
  42. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js.map +1 -1
  43. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js +1 -1
  44. package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js.map +1 -1
  45. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js +12 -3
  46. package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js.map +1 -1
  47. package/dist/module/lib/Components/visualization/Legend/Legend.js +1 -1
  48. package/dist/module/lib/Components/visualization/Legend/Legend.js.map +1 -1
  49. package/dist/module/lib/Components/visualization/Legend/Legend.test.js +12 -8
  50. package/dist/module/lib/Components/visualization/Legend/Legend.test.js.map +1 -1
  51. package/dist/module/lib/Components/visualization/LineChart/LineChart.js +8 -2
  52. package/dist/module/lib/Components/visualization/LineChart/LineChart.js.map +1 -1
  53. package/dist/module/lib/Components/visualization/LineChart/utils.js +3 -2
  54. package/dist/module/lib/Components/visualization/LineChart/utils.js.map +1 -1
  55. package/dist/module/lib/Components/visualization/LineChart/utils.test.js +8 -4
  56. package/dist/module/lib/Components/visualization/LineChart/utils.test.js.map +1 -1
  57. package/dist/module/lib/Components/visualization/config.js +1 -4
  58. package/dist/module/lib/Components/visualization/config.js.map +1 -1
  59. package/dist/module/translations/index.js +5 -0
  60. package/dist/module/translations/index.js.map +1 -0
  61. package/dist/module/{i18n → translations}/languages.js +0 -6
  62. package/dist/module/translations/languages.js.map +1 -0
  63. package/dist/module/{i18n → translations}/locales/de.json +0 -3
  64. package/{src/i18n → dist/module/translations}/locales/en.json +9 -3
  65. package/{src/i18n → dist/module/translations}/locales/es.json +0 -3
  66. package/dist/module/{i18n → translations}/locales/fr.json +0 -3
  67. package/{src/i18n → dist/module/translations}/locales/ja.json +0 -3
  68. package/dist/module/{i18n → translations}/locales/ko.json +0 -3
  69. package/dist/module/{i18n → translations}/locales/pt.json +0 -3
  70. package/dist/module/{i18n → translations}/locales/ru.json +0 -3
  71. package/dist/module/{i18n → translations}/locales/th.json +0 -3
  72. package/dist/module/{i18n → translations}/locales/tr.json +0 -3
  73. package/{src/i18n → dist/module/translations}/locales/zh.json +0 -3
  74. package/dist/module/translations/translations.js +36 -0
  75. package/dist/module/translations/translations.js.map +1 -0
  76. package/dist/module/translations/translations.test.js +34 -0
  77. package/dist/module/translations/translations.test.js.map +1 -0
  78. package/dist/typescript/src/index.d.ts +1 -1
  79. package/dist/typescript/src/index.d.ts.map +1 -1
  80. package/dist/typescript/src/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
  81. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts +1 -1
  82. package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts.map +1 -1
  83. package/dist/typescript/src/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
  84. package/dist/typescript/src/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
  85. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
  86. package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
  87. package/dist/typescript/src/lib/Components/visualization/DonutChart/types.d.ts +1 -1
  88. package/dist/typescript/src/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
  89. package/dist/typescript/src/lib/Components/visualization/Legend/types.d.ts +2 -2
  90. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
  91. package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
  92. package/dist/typescript/src/lib/Components/visualization/LineChart/types.d.ts +1 -1
  93. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts +2 -1
  94. package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
  95. package/dist/typescript/src/lib/Components/visualization/config.d.ts +0 -3
  96. package/dist/typescript/src/lib/Components/visualization/config.d.ts.map +1 -1
  97. package/dist/typescript/src/translations/index.d.ts +3 -0
  98. package/dist/typescript/src/translations/index.d.ts.map +1 -0
  99. package/dist/typescript/src/{i18n → translations}/languages.d.ts +0 -5
  100. package/dist/typescript/src/translations/languages.d.ts.map +1 -0
  101. package/dist/typescript/src/translations/translations.d.ts +421 -0
  102. package/dist/typescript/src/translations/translations.d.ts.map +1 -0
  103. package/package.json +3 -5
  104. package/src/index.ts +1 -1
  105. package/src/lib/Components/core/AddressInput/AddressInput.tsx +1 -1
  106. package/src/lib/Components/core/AmountDisplay/AmountDisplay.tsx +1 -1
  107. package/src/lib/Components/core/AmountInput/AmountInput.tsx +1 -1
  108. package/src/lib/Components/core/Avatar/Avatar.tsx +1 -1
  109. package/src/lib/Components/core/Banner/Banner.tsx +1 -1
  110. package/src/lib/Components/core/BottomSheet/BottomSheetHeader.tsx +1 -1
  111. package/src/lib/Components/core/ContentBanner/ContentBanner.tsx +1 -1
  112. package/src/lib/Components/core/MediaBanner/MediaBanner.tsx +1 -1
  113. package/src/lib/Components/core/MediaCard/MediaCard.tsx +1 -1
  114. package/src/lib/Components/core/NavBar/NavBar.tsx +1 -1
  115. package/src/lib/Components/core/Spinner/Spinner.tsx +1 -1
  116. package/src/lib/Components/core/Stepper/Stepper.tsx +1 -1
  117. package/src/lib/Components/core/Subheader/Subheader.tsx +3 -1
  118. package/src/lib/Components/core/ThemeProvider/ThemeProvider.test.tsx +11 -0
  119. package/src/lib/Components/core/ThemeProvider/ThemeProvider.tsx +3 -3
  120. package/src/lib/Components/core/ThemeProvider/types.ts +1 -1
  121. package/src/lib/Components/core/Toast/hooks/useToastAccessibility.ts +1 -1
  122. package/src/lib/Components/core/Trend/Trend.tsx +1 -1
  123. package/src/lib/Components/internal/BaseInput/BaseInput.tsx +1 -1
  124. package/src/lib/Components/visualization/CartesianChart/CartesianChart.tsx +4 -2
  125. package/src/lib/Components/visualization/CartesianChart/types.ts +1 -1
  126. package/src/lib/Components/visualization/DonutChart/DonutChart.test.tsx +1 -3
  127. package/src/lib/Components/visualization/DonutChart/DonutChart.tsx +7 -3
  128. package/src/lib/Components/visualization/DonutChart/DonutRing.tsx +11 -1
  129. package/src/lib/Components/visualization/DonutChart/types.ts +1 -1
  130. package/src/lib/Components/visualization/Legend/Legend.test.tsx +9 -8
  131. package/src/lib/Components/visualization/Legend/Legend.tsx +1 -1
  132. package/src/lib/Components/visualization/Legend/types.ts +2 -2
  133. package/src/lib/Components/visualization/LineChart/LineChart.tsx +10 -2
  134. package/src/lib/Components/visualization/LineChart/types.ts +1 -1
  135. package/src/lib/Components/visualization/LineChart/utils.test.ts +4 -0
  136. package/src/lib/Components/visualization/LineChart/utils.ts +6 -2
  137. package/src/lib/Components/visualization/config.ts +0 -3
  138. package/src/translations/index.ts +2 -0
  139. package/src/{i18n → translations}/languages.ts +0 -6
  140. package/src/{i18n → translations}/locales/de.json +0 -3
  141. package/{dist/module/i18n → src/translations}/locales/en.json +9 -3
  142. package/{dist/module/i18n → src/translations}/locales/es.json +0 -3
  143. package/src/{i18n → translations}/locales/fr.json +0 -3
  144. package/{dist/module/i18n → src/translations}/locales/ja.json +0 -3
  145. package/src/{i18n → translations}/locales/ko.json +0 -3
  146. package/src/{i18n → translations}/locales/pt.json +0 -3
  147. package/src/{i18n → translations}/locales/ru.json +0 -3
  148. package/src/{i18n → translations}/locales/th.json +0 -3
  149. package/src/{i18n → translations}/locales/tr.json +0 -3
  150. package/{dist/module/i18n → src/translations}/locales/zh.json +0 -3
  151. package/src/translations/translations.test.ts +56 -0
  152. package/src/translations/translations.ts +21 -0
  153. package/dist/module/i18n/I18nProvider.js +0 -20
  154. package/dist/module/i18n/I18nProvider.js.map +0 -1
  155. package/dist/module/i18n/i18n.js +0 -82
  156. package/dist/module/i18n/i18n.js.map +0 -1
  157. package/dist/module/i18n/index.js +0 -6
  158. package/dist/module/i18n/index.js.map +0 -1
  159. package/dist/module/i18n/languages.js.map +0 -1
  160. package/dist/module/i18n/useCommonTranslation.js +0 -8
  161. package/dist/module/i18n/useCommonTranslation.js.map +0 -1
  162. package/dist/typescript/src/i18n/I18nProvider.d.ts +0 -8
  163. package/dist/typescript/src/i18n/I18nProvider.d.ts.map +0 -1
  164. package/dist/typescript/src/i18n/i18n.d.ts +0 -13
  165. package/dist/typescript/src/i18n/i18n.d.ts.map +0 -1
  166. package/dist/typescript/src/i18n/index.d.ts +0 -4
  167. package/dist/typescript/src/i18n/index.d.ts.map +0 -1
  168. package/dist/typescript/src/i18n/languages.d.ts.map +0 -1
  169. package/dist/typescript/src/i18n/useCommonTranslation.d.ts +0 -2
  170. package/dist/typescript/src/i18n/useCommonTranslation.d.ts.map +0 -1
  171. package/src/i18n/I18nProvider.tsx +0 -20
  172. package/src/i18n/i18n.ts +0 -107
  173. package/src/i18n/index.ts +0 -3
  174. package/src/i18n/useCommonTranslation.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-rnative",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
4
4
  "license": "Apache-2.0",
5
5
  "keywords": [
6
6
  "react-native",
@@ -49,13 +49,11 @@
49
49
  "!**/*.tsbuildinfo"
50
50
  ],
51
51
  "dependencies": {
52
- "@ledgerhq/lumen-utils-shared": "0.1.15",
52
+ "@ledgerhq/lumen-utils-shared": "0.1.16",
53
53
  "@types/d3-scale": "^4.0.9",
54
54
  "@types/d3-shape": "^3.1.8",
55
55
  "d3-scale": "^4.0.2",
56
- "d3-shape": "^3.2.0",
57
- "i18next": "^23.7.0",
58
- "react-i18next": "^14.0.0"
56
+ "d3-shape": "^3.2.0"
59
57
  },
60
58
  "devDependencies": {
61
59
  "@types/react": "^19.0.0"
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type SupportedLocale, Languages } from './i18n';
1
+ export { type SupportedLocale, Languages } from './translations';
2
2
  export { RuntimeConstants, useControllableState } from './lib/utils';
3
3
  export { useTheme, useStyleSheet } from './styles';
4
4
  export * from './lib/Components';
@@ -1,7 +1,7 @@
1
1
  import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
2
2
  import { StyleSheet, Text } from 'react-native';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import { useStyleSheet } from '../../../../styles';
4
+ import { useCommonTranslation } from '../../../../translations';
5
5
  import { RuntimeConstants } from '../../../utils';
6
6
  import { BaseInput } from '../../internal/BaseInput';
7
7
  import { QrCode } from '../../symbols';
@@ -7,9 +7,9 @@ import Animated, {
7
7
  useSharedValue,
8
8
  withTiming,
9
9
  } from 'react-native-reanimated';
10
- import { useCommonTranslation } from '../../../../i18n';
11
10
  import type { LumenTypographyTokenName } from '../../../../styles';
12
11
  import { useStyleSheet } from '../../../../styles';
12
+ import { useCommonTranslation } from '../../../../translations';
13
13
  import { RuntimeConstants, useGet } from '../../../utils';
14
14
  import { Pulse } from '../../animations/Pulse';
15
15
  import { useTimingConfig } from '../../animations/useTimingConfig';
@@ -117,7 +117,7 @@ export const AmountInput = ({
117
117
  <Pressable
118
118
  onPress={handlePress}
119
119
  style={styles.pressable}
120
- accessibilityLabel={props.accessibilityLabel || 'Amount input'}
120
+ accessibilityLabel={props.accessibilityLabel}
121
121
  >
122
122
  {currencyText && currencyPosition === 'left' && (
123
123
  <Currency style={[styles.currency, animatedCurrencyStyle]}>
@@ -2,12 +2,12 @@ import type { TypographyDefinition } from '@ledgerhq/lumen-design-core';
2
2
  import { AVATAR_COLOR_KEYS, capitalize } from '@ledgerhq/lumen-utils-shared';
3
3
  import { useEffect, useState } from 'react';
4
4
  import { Image, StyleSheet, Text, View } from 'react-native';
5
- import { useCommonTranslation } from '../../../../i18n';
6
5
  import {
7
6
  useStyleSheet,
8
7
  useTheme,
9
8
  type LumenStyleSheetTheme,
10
9
  } from '../../../../styles';
10
+ import { useCommonTranslation } from '../../../../translations';
11
11
  import { Box } from '../../primitives';
12
12
  import { User } from '../../symbols';
13
13
  import type { IconSize, IconProps } from '../../symbols/Icon';
@@ -1,8 +1,8 @@
1
1
  import { isTextChildren } from '@ledgerhq/lumen-utils-shared';
2
2
  import type { ComponentType } from 'react';
3
3
  import { StyleSheet, Text, View } from 'react-native';
4
- import { useCommonTranslation } from '../../../../i18n';
5
4
  import { useStyleSheet } from '../../../../styles';
5
+ import { useCommonTranslation } from '../../../../translations';
6
6
  import { Box } from '../../primitives';
7
7
  import {
8
8
  InformationFill,
@@ -1,8 +1,8 @@
1
1
  import { useBottomSheet } from '@gorhom/bottom-sheet';
2
2
  import { useCallback } from 'react';
3
3
  import { StyleSheet } from 'react-native';
4
- import { useCommonTranslation } from '../../../../i18n';
5
4
  import { useStyleSheet } from '../../../../styles';
5
+ import { useCommonTranslation } from '../../../../translations';
6
6
  import { Box, Text } from '../../primitives';
7
7
  import { ArrowLeft, Close } from '../../symbols';
8
8
  import { IconButton } from '../IconButton';
@@ -1,7 +1,7 @@
1
1
  import { isTextChildren } from '@ledgerhq/lumen-utils-shared';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import { useStyleSheet } from '../../../../styles';
4
+ import { useCommonTranslation } from '../../../../translations';
5
5
  import { Box, Text } from '../../primitives';
6
6
  import { Close } from '../../symbols';
7
7
  import { InteractiveIcon } from '../InteractiveIcon';
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { Image, StyleSheet, View } from 'react-native';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import { useStyleSheet, useTheme } from '../../../../styles';
4
+ import { useCommonTranslation } from '../../../../translations';
5
5
  import { Box, LinearGradient, Pressable, Text } from '../../primitives';
6
6
  import { Close } from '../../symbols';
7
7
  import { InteractiveIcon } from '../InteractiveIcon';
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import { Image, StyleSheet, View } from 'react-native';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import { useStyleSheet } from '../../../../styles';
4
+ import { useCommonTranslation } from '../../../../translations';
5
5
  import { LinearGradient, Pressable, Text } from '../../primitives';
6
6
  import { Close } from '../../symbols';
7
7
  import { InteractiveIcon } from '../InteractiveIcon';
@@ -3,8 +3,8 @@ import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
3
3
  import type { ReactNode } from 'react';
4
4
  import { Children, isValidElement } from 'react';
5
5
  import { StyleSheet } from 'react-native';
6
- import { useCommonTranslation } from '../../../../i18n';
7
6
  import { useStyleSheet } from '../../../../styles';
7
+ import { useCommonTranslation } from '../../../../translations';
8
8
  import { Box, Text } from '../../primitives';
9
9
  import { ArrowLeft } from '../../symbols';
10
10
  import { IconButton } from '../IconButton';
@@ -1,8 +1,8 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
  import Svg, { Path } from 'react-native-svg';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import type { LumenTextStyle } from '../../../../styles';
5
4
  import { useResolveTextStyle, useTheme } from '../../../../styles';
5
+ import { useCommonTranslation } from '../../../../translations';
6
6
  import { Spin } from '../../animations/Spin';
7
7
  import { Box } from '../../primitives';
8
8
  import type { SpinnerProps } from './types';
@@ -10,8 +10,8 @@ import Animated, {
10
10
  withTiming,
11
11
  } from 'react-native-reanimated';
12
12
  import Svg, { Circle, Defs, Mask } from 'react-native-svg';
13
- import { useCommonTranslation } from '../../../../i18n';
14
13
  import { useTheme } from '../../../../styles';
14
+ import { useCommonTranslation } from '../../../../translations';
15
15
  import { useTimingConfig } from '../../animations/useTimingConfig';
16
16
  import { Box } from '../../primitives/Box';
17
17
  import { Text } from '../../primitives/Text';
@@ -1,5 +1,6 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
  import { useStyleSheet } from '../../../../styles';
3
+ import { useCommonTranslation } from '../../../../translations';
3
4
  import { Box, Pressable, Text } from '../../primitives';
4
5
  import { ChevronRight, Information } from '../../symbols';
5
6
  import { InteractiveIcon } from '../InteractiveIcon';
@@ -130,12 +131,13 @@ export const SubheaderInfo = ({
130
131
  style,
131
132
  ...props
132
133
  }: SubheaderInfoProps) => {
134
+ const { t } = useCommonTranslation();
133
135
  return (
134
136
  <InteractiveIcon
135
137
  iconType={iconType}
136
138
  icon={Information}
137
139
  size={16}
138
- accessibilityLabel='More information'
140
+ accessibilityLabel={t('components.subheader.moreInfoAriaLabel')}
139
141
  style={style}
140
142
  {...props}
141
143
  />
@@ -4,6 +4,7 @@ import { render, screen } from '@testing-library/react-native';
4
4
  import { Box, Text } from '../../primitives';
5
5
  import { ChevronBigLeft, Wallet } from '../../symbols';
6
6
  import { Button } from '../Button';
7
+ import { Spinner } from '../Spinner';
7
8
  import { Spot } from '../Spot';
8
9
  import { Tile } from '../Tile/Tile';
9
10
  import { ThemeProvider } from './ThemeProvider';
@@ -25,4 +26,14 @@ describe('ThemeProvider', () => {
25
26
  expect(screen.getByTestId('child')).toBeTruthy();
26
27
  expect(screen.getByText('Hello World')).toBeTruthy();
27
28
  });
29
+
30
+ it('translates Lumen components in the given locale', () => {
31
+ render(
32
+ <ThemeProvider themes={ledgerLiveThemes} locale='fr'>
33
+ <Spinner />
34
+ </ThemeProvider>,
35
+ );
36
+
37
+ expect(screen.getByLabelText('Chargement')).toBeTruthy();
38
+ });
28
39
  });
@@ -1,7 +1,7 @@
1
1
  import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
2
2
 
3
- import { I18nProvider } from '../../../../i18n';
4
3
  import { LumenStyleSheetProvider } from '../../../../styles';
4
+ import { TranslationsProvider } from '../../../../translations';
5
5
 
6
6
  import { GlobalTooltipProvider } from '../Tooltip/GlobalTooltipContext';
7
7
  import type { ThemeProviderProps } from './types';
@@ -17,9 +17,9 @@ const ThemeProvider = ({
17
17
  return (
18
18
  <ThemeContextProvider value={{}}>
19
19
  <LumenStyleSheetProvider colorScheme={colorScheme} themes={themes}>
20
- <I18nProvider locale={locale}>
20
+ <TranslationsProvider locale={locale}>
21
21
  <GlobalTooltipProvider>{children}</GlobalTooltipProvider>
22
- </I18nProvider>
22
+ </TranslationsProvider>
23
23
  </LumenStyleSheetProvider>
24
24
  </ThemeContextProvider>
25
25
  );
@@ -1,7 +1,7 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import type { ColorSchemeName } from 'react-native';
3
- import type { SupportedLocale } from '../../../../i18n/languages';
4
3
  import type { LumenThemes } from '../../../../styles';
4
+ import type { SupportedLocale } from '../../../../translations/languages';
5
5
 
6
6
  export type ThemeProviderProps = PropsWithChildren & {
7
7
  /**
@@ -6,7 +6,7 @@ import {
6
6
  type AccessibilityActionInfo,
7
7
  type ViewProps,
8
8
  } from 'react-native';
9
- import { useCommonTranslation } from '../../../../../i18n';
9
+ import { useCommonTranslation } from '../../../../../translations';
10
10
  import type { ToastItem } from '../types';
11
11
 
12
12
  type UseToastAccessibilityArgs = {
@@ -1,8 +1,8 @@
1
1
  import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
2
2
  import { StyleSheet } from 'react-native';
3
- import { useCommonTranslation } from '../../../../i18n';
4
3
  import type { LumenTextStyle } from '../../../../styles';
5
4
  import { useStyleSheet } from '../../../../styles';
5
+ import { useCommonTranslation } from '../../../../translations';
6
6
  import { Box, Text } from '../../primitives';
7
7
  import { TriangleDown, TriangleUp } from '../../symbols';
8
8
  import type { IconSize } from '../../symbols/Icon';
@@ -5,8 +5,8 @@ import {
5
5
  } from '@ledgerhq/lumen-utils-shared';
6
6
  import { useState } from 'react';
7
7
  import { StyleSheet, TextInput, View } from 'react-native';
8
- import { useCommonTranslation } from '../../../../i18n';
9
8
  import { useStyleSheet, useTheme } from '../../../../styles';
9
+ import { useCommonTranslation } from '../../../../translations';
10
10
  import { RuntimeConstants } from '../../../utils';
11
11
  import { InteractiveIcon } from '../../core/InteractiveIcon';
12
12
  import { Box, Pressable } from '../../primitives';
@@ -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
  }