@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.
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.js +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.js.map +1 -1
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.js +1 -1
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.js.map +1 -1
- package/dist/module/lib/Components/core/AmountInput/AmountInput.js +1 -1
- package/dist/module/lib/Components/core/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/Avatar.js +1 -1
- package/dist/module/lib/Components/core/Avatar/Avatar.js.map +1 -1
- package/dist/module/lib/Components/core/Banner/Banner.js +1 -1
- package/dist/module/lib/Components/core/Banner/Banner.js.map +1 -1
- package/dist/module/lib/Components/core/BottomSheet/BottomSheet.stories.js +6 -3
- package/dist/module/lib/Components/core/BottomSheet/BottomSheet.stories.js.map +1 -1
- package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js +1 -1
- package/dist/module/lib/Components/core/BottomSheet/BottomSheetHeader.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.figma.js +0 -1
- package/dist/module/lib/Components/core/Card/Card.figma.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.stories.js +0 -2
- package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.figma.js +0 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.figma.js.map +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js +2 -2
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.js.map +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.mdx +4 -4
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +1 -9
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.test.js +0 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.test.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js +0 -5
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.figma.js +0 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.figma.js.map +1 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.js +1 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.mdx +10 -10
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +2 -29
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js +1 -1
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.js.map +1 -1
- package/dist/module/lib/Components/core/MediaCard/MediaCard.js +1 -1
- package/dist/module/lib/Components/core/MediaCard/MediaCard.js.map +1 -1
- package/dist/module/lib/Components/core/NavBar/NavBar.js +1 -1
- package/dist/module/lib/Components/core/NavBar/NavBar.js.map +1 -1
- package/dist/module/lib/Components/core/SelectList/SelectList.mdx +1 -1
- package/dist/module/lib/Components/core/SelectList/SelectList.stories.js +0 -1
- package/dist/module/lib/Components/core/SelectList/SelectList.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spinner/Spinner.js +1 -1
- package/dist/module/lib/Components/core/Spinner/Spinner.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.figma.js +31 -16
- package/dist/module/lib/Components/core/Spot/Spot.figma.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.js +24 -146
- package/dist/module/lib/Components/core/Spot/Spot.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.mdx +47 -108
- package/dist/module/lib/Components/core/Spot/Spot.stories.js +108 -215
- package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.test.js +61 -0
- package/dist/module/lib/Components/core/Spot/Spot.test.js.map +1 -0
- package/dist/module/lib/Components/core/Spot/SpotNumber.js +56 -0
- package/dist/module/lib/Components/core/Spot/SpotNumber.js.map +1 -0
- package/dist/module/lib/Components/core/Spot/SpotNumber.test.js +72 -0
- package/dist/module/lib/Components/core/Spot/SpotNumber.test.js.map +1 -0
- package/dist/module/lib/Components/core/Spot/index.js +1 -0
- package/dist/module/lib/Components/core/Spot/index.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/useSpotStyles.js +93 -0
- package/dist/module/lib/Components/core/Spot/useSpotStyles.js.map +1 -0
- package/dist/module/lib/Components/core/Stepper/Stepper.js +1 -1
- package/dist/module/lib/Components/core/Stepper/Stepper.js.map +1 -1
- package/dist/module/lib/Components/core/Subheader/Subheader.js +5 -1
- package/dist/module/lib/Components/core/Subheader/Subheader.js.map +1 -1
- package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js +2 -2
- package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js +9 -1
- package/dist/module/lib/Components/core/ThemeProvider/ThemeProvider.test.js.map +1 -1
- package/dist/module/lib/Components/core/Tile/Tile.figma.js +0 -1
- package/dist/module/lib/Components/core/Tile/Tile.figma.js.map +1 -1
- package/dist/module/lib/Components/core/Tile/Tile.js +3 -3
- package/dist/module/lib/Components/core/Tile/Tile.mdx +8 -8
- package/dist/module/lib/Components/core/Tile/Tile.stories.js +7 -25
- package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js +1 -1
- package/dist/module/lib/Components/core/Toast/hooks/useToastAccessibility.js.map +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.js +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +1 -1
- package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/AiBubble.js +60 -0
- package/dist/module/lib/Components/symbols/icons/AiBubble.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/ArrowBottomLeft.js +49 -0
- package/dist/module/lib/Components/symbols/icons/ArrowBottomLeft.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Bug.js +1 -1
- package/dist/module/lib/Components/symbols/icons/Bug.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Hourglass.js +49 -0
- package/dist/module/lib/Components/symbols/icons/Hourglass.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Repeat.js +49 -0
- package/dist/module/lib/Components/symbols/icons/Repeat.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Robot.js +57 -0
- package/dist/module/lib/Components/symbols/icons/Robot.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Switch.js +11 -5
- package/dist/module/lib/Components/symbols/icons/Switch.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Wifi.js +52 -0
- package/dist/module/lib/Components/symbols/icons/Wifi.js.map +1 -0
- package/dist/module/lib/Components/symbols/index.js +6 -0
- package/dist/module/lib/Components/symbols/index.js.map +1 -1
- package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js +6 -2
- package/dist/module/lib/Components/visualization/CartesianChart/CartesianChart.js.map +1 -1
- package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js +8 -4
- package/dist/module/lib/Components/visualization/DonutChart/DonutChart.js.map +1 -1
- package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js +1 -1
- package/dist/module/lib/Components/visualization/DonutChart/DonutChart.test.js.map +1 -1
- package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js +12 -3
- package/dist/module/lib/Components/visualization/DonutChart/DonutRing.js.map +1 -1
- package/dist/module/lib/Components/visualization/Legend/Legend.js +1 -1
- package/dist/module/lib/Components/visualization/Legend/Legend.js.map +1 -1
- package/dist/module/lib/Components/visualization/Legend/Legend.test.js +12 -8
- package/dist/module/lib/Components/visualization/Legend/Legend.test.js.map +1 -1
- package/dist/module/lib/Components/visualization/LineChart/LineChart.js +8 -2
- package/dist/module/lib/Components/visualization/LineChart/LineChart.js.map +1 -1
- package/dist/module/lib/Components/visualization/LineChart/utils.js +3 -2
- package/dist/module/lib/Components/visualization/LineChart/utils.js.map +1 -1
- package/dist/module/lib/Components/visualization/LineChart/utils.test.js +8 -4
- package/dist/module/lib/Components/visualization/LineChart/utils.test.js.map +1 -1
- package/dist/module/lib/Components/visualization/config.js +1 -4
- package/dist/module/lib/Components/visualization/config.js.map +1 -1
- package/dist/module/translations/index.js +5 -0
- package/dist/module/translations/index.js.map +1 -0
- package/dist/module/{i18n → translations}/languages.js +0 -6
- package/dist/module/translations/languages.js.map +1 -0
- package/dist/module/{i18n → translations}/locales/de.json +0 -3
- package/{src/i18n → dist/module/translations}/locales/en.json +9 -3
- package/{src/i18n → dist/module/translations}/locales/es.json +0 -3
- package/dist/module/{i18n → translations}/locales/fr.json +0 -3
- package/{src/i18n → dist/module/translations}/locales/ja.json +0 -3
- package/dist/module/{i18n → translations}/locales/ko.json +0 -3
- package/dist/module/{i18n → translations}/locales/pt.json +0 -3
- package/dist/module/{i18n → translations}/locales/ru.json +0 -3
- package/dist/module/{i18n → translations}/locales/th.json +0 -3
- package/dist/module/{i18n → translations}/locales/tr.json +0 -3
- package/{src/i18n → dist/module/translations}/locales/zh.json +0 -3
- package/dist/module/translations/translations.js +36 -0
- package/dist/module/translations/translations.js.map +1 -0
- package/dist/module/translations/translations.test.js +34 -0
- package/dist/module/translations/translations.test.js.map +1 -0
- package/dist/typescript/src/index.d.ts +1 -1
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/ContentBanner/ContentBanner.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/ListItem/ListItem.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/Spot/Spot.d.ts +7 -25
- package/dist/typescript/src/lib/Components/core/Spot/Spot.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Spot/SpotNumber.d.ts +16 -0
- package/dist/typescript/src/lib/Components/core/Spot/SpotNumber.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Spot/index.d.ts +1 -0
- package/dist/typescript/src/lib/Components/core/Spot/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Spot/types.d.ts +29 -29
- package/dist/typescript/src/lib/Components/core/Spot/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Spot/useSpotStyles.d.ts +14 -0
- package/dist/typescript/src/lib/Components/core/Spot/useSpotStyles.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/ThemeProvider/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Tile/Tile.d.ts +3 -3
- package/dist/typescript/src/lib/Components/symbols/icons/AiBubble.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/AiBubble.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/ArrowBottomLeft.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/ArrowBottomLeft.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Hourglass.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Hourglass.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Repeat.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Repeat.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Robot.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Robot.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Switch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/Wifi.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Wifi.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts +6 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/DonutChart/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/Legend/types.d.ts +2 -2
- package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/LineChart/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts +2 -1
- package/dist/typescript/src/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/config.d.ts +0 -3
- package/dist/typescript/src/lib/Components/visualization/config.d.ts.map +1 -1
- package/dist/typescript/src/translations/index.d.ts +3 -0
- package/dist/typescript/src/translations/index.d.ts.map +1 -0
- package/dist/typescript/src/{i18n → translations}/languages.d.ts +0 -5
- package/dist/typescript/src/translations/languages.d.ts.map +1 -0
- package/dist/typescript/src/translations/translations.d.ts +421 -0
- package/dist/typescript/src/translations/translations.d.ts.map +1 -0
- package/package.json +4 -6
- package/src/index.ts +1 -1
- package/src/lib/Components/core/AddressInput/AddressInput.tsx +1 -1
- package/src/lib/Components/core/AmountDisplay/AmountDisplay.tsx +1 -1
- package/src/lib/Components/core/AmountInput/AmountInput.tsx +1 -1
- package/src/lib/Components/core/Avatar/Avatar.tsx +1 -1
- package/src/lib/Components/core/Banner/Banner.tsx +1 -1
- package/src/lib/Components/core/BottomSheet/BottomSheet.stories.tsx +12 -4
- package/src/lib/Components/core/BottomSheet/BottomSheetHeader.tsx +1 -1
- package/src/lib/Components/core/Card/Card.figma.tsx +1 -1
- package/src/lib/Components/core/Card/Card.stories.tsx +2 -2
- package/src/lib/Components/core/ContentBanner/ContentBanner.figma.tsx +1 -1
- package/src/lib/Components/core/ContentBanner/ContentBanner.mdx +4 -4
- package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +9 -9
- package/src/lib/Components/core/ContentBanner/ContentBanner.test.tsx +1 -1
- package/src/lib/Components/core/ContentBanner/ContentBanner.tsx +2 -2
- package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +5 -5
- package/src/lib/Components/core/ListItem/ListItem.figma.tsx +1 -1
- package/src/lib/Components/core/ListItem/ListItem.mdx +10 -10
- package/src/lib/Components/core/ListItem/ListItem.stories.tsx +29 -33
- package/src/lib/Components/core/ListItem/ListItem.tsx +1 -1
- package/src/lib/Components/core/MediaBanner/MediaBanner.tsx +1 -1
- package/src/lib/Components/core/MediaCard/MediaCard.tsx +1 -1
- package/src/lib/Components/core/NavBar/NavBar.tsx +1 -1
- package/src/lib/Components/core/SelectList/SelectList.mdx +1 -1
- package/src/lib/Components/core/SelectList/SelectList.stories.tsx +1 -1
- package/src/lib/Components/core/Spinner/Spinner.tsx +1 -1
- package/src/lib/Components/core/Spot/Spot.figma.tsx +42 -21
- package/src/lib/Components/core/Spot/Spot.mdx +47 -108
- package/src/lib/Components/core/Spot/Spot.stories.tsx +114 -175
- package/src/lib/Components/core/Spot/Spot.test.tsx +71 -0
- package/src/lib/Components/core/Spot/Spot.tsx +21 -163
- package/src/lib/Components/core/Spot/SpotNumber.test.tsx +93 -0
- package/src/lib/Components/core/Spot/SpotNumber.tsx +48 -0
- package/src/lib/Components/core/Spot/index.ts +1 -0
- package/src/lib/Components/core/Spot/types.ts +39 -41
- package/src/lib/Components/core/Spot/useSpotStyles.ts +119 -0
- package/src/lib/Components/core/Stepper/Stepper.tsx +1 -1
- package/src/lib/Components/core/Subheader/Subheader.tsx +3 -1
- package/src/lib/Components/core/ThemeProvider/ThemeProvider.test.tsx +12 -1
- package/src/lib/Components/core/ThemeProvider/ThemeProvider.tsx +3 -3
- package/src/lib/Components/core/ThemeProvider/types.ts +1 -1
- package/src/lib/Components/core/Tile/Tile.figma.tsx +1 -1
- package/src/lib/Components/core/Tile/Tile.mdx +8 -8
- package/src/lib/Components/core/Tile/Tile.stories.tsx +32 -25
- package/src/lib/Components/core/Tile/Tile.tsx +3 -3
- package/src/lib/Components/core/Toast/hooks/useToastAccessibility.ts +1 -1
- package/src/lib/Components/core/Trend/Trend.tsx +1 -1
- package/src/lib/Components/internal/BaseInput/BaseInput.tsx +1 -1
- package/src/lib/Components/symbols/icons/AiBubble.tsx +51 -0
- package/src/lib/Components/symbols/icons/ArrowBottomLeft.tsx +44 -0
- package/src/lib/Components/symbols/icons/Bug.tsx +1 -1
- package/src/lib/Components/symbols/icons/Hourglass.tsx +44 -0
- package/src/lib/Components/symbols/icons/Repeat.tsx +44 -0
- package/src/lib/Components/symbols/icons/Robot.tsx +44 -0
- package/src/lib/Components/symbols/icons/Switch.tsx +8 -1
- package/src/lib/Components/symbols/icons/Wifi.tsx +48 -0
- package/src/lib/Components/symbols/index.ts +6 -0
- package/src/lib/Components/visualization/CartesianChart/CartesianChart.tsx +4 -2
- package/src/lib/Components/visualization/CartesianChart/types.ts +1 -1
- package/src/lib/Components/visualization/DonutChart/DonutChart.test.tsx +1 -3
- package/src/lib/Components/visualization/DonutChart/DonutChart.tsx +7 -3
- package/src/lib/Components/visualization/DonutChart/DonutRing.tsx +11 -1
- package/src/lib/Components/visualization/DonutChart/types.ts +1 -1
- package/src/lib/Components/visualization/Legend/Legend.test.tsx +9 -8
- package/src/lib/Components/visualization/Legend/Legend.tsx +1 -1
- package/src/lib/Components/visualization/Legend/types.ts +2 -2
- package/src/lib/Components/visualization/LineChart/LineChart.tsx +10 -2
- package/src/lib/Components/visualization/LineChart/types.ts +1 -1
- package/src/lib/Components/visualization/LineChart/utils.test.ts +4 -0
- package/src/lib/Components/visualization/LineChart/utils.ts +6 -2
- package/src/lib/Components/visualization/config.ts +0 -3
- package/src/translations/index.ts +2 -0
- package/src/{i18n → translations}/languages.ts +0 -6
- package/src/{i18n → translations}/locales/de.json +0 -3
- package/{dist/module/i18n → src/translations}/locales/en.json +9 -3
- package/{dist/module/i18n → src/translations}/locales/es.json +0 -3
- package/src/{i18n → translations}/locales/fr.json +0 -3
- package/{dist/module/i18n → src/translations}/locales/ja.json +0 -3
- package/src/{i18n → translations}/locales/ko.json +0 -3
- package/src/{i18n → translations}/locales/pt.json +0 -3
- package/src/{i18n → translations}/locales/ru.json +0 -3
- package/src/{i18n → translations}/locales/th.json +0 -3
- package/src/{i18n → translations}/locales/tr.json +0 -3
- package/{dist/module/i18n → src/translations}/locales/zh.json +0 -3
- package/src/translations/translations.test.ts +56 -0
- package/src/translations/translations.ts +21 -0
- package/dist/module/i18n/I18nProvider.js +0 -20
- package/dist/module/i18n/I18nProvider.js.map +0 -1
- package/dist/module/i18n/i18n.js +0 -82
- package/dist/module/i18n/i18n.js.map +0 -1
- package/dist/module/i18n/index.js +0 -6
- package/dist/module/i18n/index.js.map +0 -1
- package/dist/module/i18n/languages.js.map +0 -1
- package/dist/module/i18n/useCommonTranslation.js +0 -8
- package/dist/module/i18n/useCommonTranslation.js.map +0 -1
- package/dist/typescript/src/i18n/I18nProvider.d.ts +0 -8
- package/dist/typescript/src/i18n/I18nProvider.d.ts.map +0 -1
- package/dist/typescript/src/i18n/i18n.d.ts +0 -13
- package/dist/typescript/src/i18n/i18n.d.ts.map +0 -1
- package/dist/typescript/src/i18n/index.d.ts +0 -4
- package/dist/typescript/src/i18n/index.d.ts.map +0 -1
- package/dist/typescript/src/i18n/languages.d.ts.map +0 -1
- package/dist/typescript/src/i18n/useCommonTranslation.d.ts +0 -2
- package/dist/typescript/src/i18n/useCommonTranslation.d.ts.map +0 -1
- package/src/i18n/I18nProvider.tsx +0 -20
- package/src/i18n/i18n.ts +0 -107
- package/src/i18n/index.ts +0 -3
- 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
|
|
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,
|
|
@@ -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 {
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
);
|
|
@@ -30,10 +30,7 @@ describe('Legend', () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('renders nothing when series is empty', () => {
|
|
33
|
-
const { toJSON
|
|
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 {
|
|
86
|
+
const { toJSON } = renderWithTheme(
|
|
90
87
|
<Legend series={sampleItems} style={{ maxWidth: 176 }} />,
|
|
91
88
|
);
|
|
92
|
-
|
|
93
|
-
|
|
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
|
});
|
|
@@ -23,8 +23,8 @@ export type LegendProps = {
|
|
|
23
23
|
*/
|
|
24
24
|
series: LegendItem[];
|
|
25
25
|
/**
|
|
26
|
-
* Accessible label for the legend
|
|
27
|
-
*
|
|
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
|
|
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
|
|
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
|
|
@@ -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
|
-
|
|
77
|
+
loadingLabel,
|
|
78
|
+
}: ChartDisplayStateParams & {
|
|
79
|
+
emptyLabel: string;
|
|
80
|
+
loadingLabel: string;
|
|
81
|
+
}): string | undefined => {
|
|
78
82
|
if (loading) {
|
|
79
|
-
return
|
|
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;
|
|
@@ -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": "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
|
}
|
|
@@ -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":[]}
|