@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
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
-
import {
|
|
3
|
-
import { StyleSheet, Text } from 'react-native';
|
|
4
|
-
import type { LumenTypographyTokens } from '../../../../styles';
|
|
5
|
-
import { useStyleSheet } from '../../../../styles';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
6
3
|
import { Box } from '../../primitives';
|
|
7
|
-
import {
|
|
8
|
-
BluetoothCircleFill,
|
|
9
|
-
CheckmarkCircleFill,
|
|
10
|
-
DeleteCircleFill,
|
|
11
|
-
InformationFill,
|
|
12
|
-
WarningFill,
|
|
13
|
-
} from '../../symbols';
|
|
14
4
|
import type { IconSize } from '../../symbols/Icon';
|
|
15
|
-
import type {
|
|
16
|
-
import {
|
|
17
|
-
import type { SpotAppearance, SpotProps, SpotSize } from './types';
|
|
18
|
-
|
|
19
|
-
const BLUETOOTH_COLOR = '#0082FC';
|
|
5
|
+
import type { SpotProps, SpotSize } from './types';
|
|
6
|
+
import { useSpotStyles } from './useSpotStyles';
|
|
20
7
|
|
|
21
8
|
const iconSizeMap: Record<SpotSize, IconSize> = {
|
|
22
9
|
32: 12,
|
|
@@ -26,166 +13,37 @@ const iconSizeMap: Record<SpotSize, IconSize> = {
|
|
|
26
13
|
72: 40,
|
|
27
14
|
};
|
|
28
15
|
|
|
29
|
-
const spotSizeMap: Record<SpotSize, number> = {
|
|
30
|
-
32: 32,
|
|
31
|
-
40: 40,
|
|
32
|
-
48: 48,
|
|
33
|
-
56: 56,
|
|
34
|
-
72: 72,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const numberTypographyMap: Record<SpotSize, keyof LumenTypographyTokens> = {
|
|
38
|
-
32: 'body2SemiBold',
|
|
39
|
-
40: 'body1SemiBold',
|
|
40
|
-
48: 'heading5',
|
|
41
|
-
56: 'heading4',
|
|
42
|
-
72: 'heading2',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const useStyles = ({
|
|
46
|
-
size,
|
|
47
|
-
appearance,
|
|
48
|
-
disabled,
|
|
49
|
-
}: {
|
|
50
|
-
size: SpotSize;
|
|
51
|
-
appearance: SpotAppearance;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
}) => {
|
|
54
|
-
return useStyleSheet(
|
|
55
|
-
(t) => {
|
|
56
|
-
const colorMap: Record<SpotAppearance, string> = {
|
|
57
|
-
icon: t.colors.text.base,
|
|
58
|
-
bluetooth: BLUETOOTH_COLOR,
|
|
59
|
-
check: t.colors.text.success,
|
|
60
|
-
error: t.colors.text.error,
|
|
61
|
-
warning: t.colors.text.warning,
|
|
62
|
-
info: t.colors.text.muted,
|
|
63
|
-
loader: t.colors.text.base,
|
|
64
|
-
number: t.colors.text.base,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const spotSize = spotSizeMap[size];
|
|
68
|
-
const typography = t.typographies[numberTypographyMap[size]];
|
|
69
|
-
const contentColor = disabled
|
|
70
|
-
? t.colors.text.disabled
|
|
71
|
-
: colorMap[appearance];
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
root: {
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
justifyContent: 'center',
|
|
77
|
-
borderRadius: t.borderRadius.full,
|
|
78
|
-
backgroundColor: t.colors.bg.mutedTransparent,
|
|
79
|
-
width: spotSize,
|
|
80
|
-
height: spotSize,
|
|
81
|
-
flexShrink: 0,
|
|
82
|
-
},
|
|
83
|
-
icon: {
|
|
84
|
-
color: contentColor,
|
|
85
|
-
},
|
|
86
|
-
numberText: StyleSheet.flatten([
|
|
87
|
-
typography,
|
|
88
|
-
{
|
|
89
|
-
color: contentColor,
|
|
90
|
-
},
|
|
91
|
-
]),
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
[size, appearance, disabled],
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
16
|
/**
|
|
99
|
-
* A circular
|
|
100
|
-
*
|
|
101
|
-
* Uses a discriminated union type system where the required props depend on the `appearance` value:
|
|
102
|
-
* - `'icon'` appearance requires an `icon` prop
|
|
103
|
-
* - `'number'` appearance requires a `number` prop
|
|
104
|
-
* - All other appearances are self-contained
|
|
17
|
+
* A circular icon container. `appearance` selects the color palette and `fill` selects whether that palette paints only the icon or the circle as well.
|
|
105
18
|
*
|
|
106
19
|
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-spot--docs Storybook}
|
|
107
20
|
*
|
|
108
21
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
109
|
-
* Do not use it to modify the spot's core appearance (colors, size, etc). Use the `appearance`
|
|
22
|
+
* Do not use it to modify the spot's core appearance (colors, size, etc). Use the `appearance` and `fill` props instead.
|
|
110
23
|
*
|
|
111
24
|
* @example
|
|
112
25
|
* import { Spot } from '@ledgerhq/lumen-ui-rnative';
|
|
26
|
+
* import { Settings, CheckmarkCircleFill } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
113
27
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* <Spot appearance="icon" icon={Settings} />
|
|
118
|
-
*
|
|
119
|
-
* // Number spot
|
|
120
|
-
* <Spot appearance="number" number={5} />
|
|
121
|
-
*
|
|
122
|
-
* // Status indicators (no additional props needed)
|
|
123
|
-
* <Spot appearance="check" />
|
|
124
|
-
* <Spot appearance="error" />
|
|
125
|
-
* <Spot appearance="warning" />
|
|
126
|
-
* <Spot appearance="loader" />
|
|
127
|
-
*
|
|
128
|
-
* // Bluetooth states
|
|
129
|
-
* <Spot appearance="bluetooth" />
|
|
130
|
-
* <Spot appearance="bluetooth" disabled />
|
|
28
|
+
* <Spot icon={Settings} />
|
|
29
|
+
* <Spot appearance="success" icon={CheckmarkCircleFill} />
|
|
30
|
+
* <Spot appearance="success" fill="plain" icon={Settings} />
|
|
131
31
|
*/
|
|
132
|
-
export const Spot = (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
32
|
+
export const Spot = ({
|
|
33
|
+
appearance = 'base',
|
|
34
|
+
fill = 'transparent',
|
|
35
|
+
icon: Icon,
|
|
36
|
+
disabled: disabledProp = false,
|
|
37
|
+
size = 48,
|
|
38
|
+
lx = {},
|
|
39
|
+
style,
|
|
40
|
+
...rest
|
|
41
|
+
}: SpotProps) => {
|
|
141
42
|
const disabled = useDisabledContext({
|
|
142
43
|
consumerName: 'Spot',
|
|
143
44
|
mergeWith: { disabled: disabledProp },
|
|
144
45
|
});
|
|
145
|
-
|
|
146
|
-
const styles = useStyles({ size, appearance, disabled });
|
|
147
|
-
const calculatedIconSize = iconSizeMap[size];
|
|
148
|
-
|
|
149
|
-
const content = useMemo(() => {
|
|
150
|
-
switch (props.appearance) {
|
|
151
|
-
case 'icon': {
|
|
152
|
-
const { icon: Icon } = props;
|
|
153
|
-
return <Icon size={calculatedIconSize} style={styles.icon} />;
|
|
154
|
-
}
|
|
155
|
-
case 'number': {
|
|
156
|
-
return (
|
|
157
|
-
<Text style={styles.numberText} allowFontScaling={false}>
|
|
158
|
-
{props.number}
|
|
159
|
-
</Text>
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
case 'bluetooth':
|
|
163
|
-
return (
|
|
164
|
-
<BluetoothCircleFill size={calculatedIconSize} style={styles.icon} />
|
|
165
|
-
);
|
|
166
|
-
case 'check':
|
|
167
|
-
return (
|
|
168
|
-
<CheckmarkCircleFill size={calculatedIconSize} style={styles.icon} />
|
|
169
|
-
);
|
|
170
|
-
case 'error':
|
|
171
|
-
return (
|
|
172
|
-
<DeleteCircleFill size={calculatedIconSize} style={styles.icon} />
|
|
173
|
-
);
|
|
174
|
-
case 'warning':
|
|
175
|
-
return <WarningFill size={calculatedIconSize} style={styles.icon} />;
|
|
176
|
-
case 'info':
|
|
177
|
-
return (
|
|
178
|
-
<InformationFill size={calculatedIconSize} style={styles.icon} />
|
|
179
|
-
);
|
|
180
|
-
case 'loader':
|
|
181
|
-
return (
|
|
182
|
-
<Spinner
|
|
183
|
-
size={calculatedIconSize}
|
|
184
|
-
color={styles.icon.color as SpinnerProps['color']}
|
|
185
|
-
/>
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
}, [props, calculatedIconSize, styles.icon, styles.numberText]);
|
|
46
|
+
const styles = useSpotStyles({ size, appearance, fill, disabled });
|
|
189
47
|
|
|
190
48
|
return (
|
|
191
49
|
<Box
|
|
@@ -194,7 +52,7 @@ export const Spot = (props: SpotProps) => {
|
|
|
194
52
|
style={StyleSheet.flatten([styles.root, style])}
|
|
195
53
|
{...rest}
|
|
196
54
|
>
|
|
197
|
-
{
|
|
55
|
+
<Icon size={iconSizeMap[size]} style={styles.icon} />
|
|
198
56
|
</Box>
|
|
199
57
|
);
|
|
200
58
|
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { describe, expect, it } from '@jest/globals';
|
|
2
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
|
+
import { render, screen } from '@testing-library/react-native';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { StyleSheet } from 'react-native';
|
|
6
|
+
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
|
+
import { SpotNumber } from './SpotNumber';
|
|
8
|
+
import type { SpotSize } from './types';
|
|
9
|
+
|
|
10
|
+
const { colors } = ledgerLiveThemes.dark;
|
|
11
|
+
const typographies = {
|
|
12
|
+
...ledgerLiveThemes.dark.typographies.xs.heading,
|
|
13
|
+
...ledgerLiveThemes.dark.typographies.xs.body,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const TestWrapper = ({ children }: { children: ReactNode }) => (
|
|
17
|
+
<ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
|
|
18
|
+
{children}
|
|
19
|
+
</ThemeProvider>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const sizeTypography: [SpotSize, keyof typeof typographies][] = [
|
|
23
|
+
[32, 'body2SemiBold'],
|
|
24
|
+
[40, 'body1SemiBold'],
|
|
25
|
+
[48, 'heading5'],
|
|
26
|
+
[56, 'heading4'],
|
|
27
|
+
[72, 'heading2'],
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
describe('SpotNumber', () => {
|
|
31
|
+
it('should color the digit when fill is transparent', () => {
|
|
32
|
+
render(
|
|
33
|
+
<TestWrapper>
|
|
34
|
+
<SpotNumber appearance='success' value={5} />
|
|
35
|
+
</TestWrapper>,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
expect(screen.getByTestId('spot-number').props.style.backgroundColor).toBe(
|
|
39
|
+
colors.bg.mutedTransparent,
|
|
40
|
+
);
|
|
41
|
+
expect(StyleSheet.flatten(screen.getByText('5').props.style)).toEqual(
|
|
42
|
+
expect.objectContaining({
|
|
43
|
+
color: colors.text.success,
|
|
44
|
+
fontSize: typographies.heading5.fontSize,
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should paint the circle and a paired text color when fill is plain', () => {
|
|
50
|
+
render(
|
|
51
|
+
<TestWrapper>
|
|
52
|
+
<SpotNumber appearance='success' fill='plain' value={5} />
|
|
53
|
+
</TestWrapper>,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
expect(screen.getByTestId('spot-number').props.style.backgroundColor).toBe(
|
|
57
|
+
colors.bg.success,
|
|
58
|
+
);
|
|
59
|
+
expect(StyleSheet.flatten(screen.getByText('5').props.style).color).toBe(
|
|
60
|
+
colors.text.successStrong,
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should use the disabled text color', () => {
|
|
65
|
+
render(
|
|
66
|
+
<TestWrapper>
|
|
67
|
+
<SpotNumber appearance='success' disabled value={5} />
|
|
68
|
+
</TestWrapper>,
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(screen.getByTestId('spot-number').props.style.backgroundColor).toBe(
|
|
72
|
+
colors.bg.mutedTransparent,
|
|
73
|
+
);
|
|
74
|
+
expect(StyleSheet.flatten(screen.getByText('5').props.style).color).toBe(
|
|
75
|
+
colors.text.disabled,
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it.each(sizeTypography)(
|
|
80
|
+
'should apply size %s typography %s',
|
|
81
|
+
(size, token) => {
|
|
82
|
+
render(
|
|
83
|
+
<TestWrapper>
|
|
84
|
+
<SpotNumber size={size} value={5} />
|
|
85
|
+
</TestWrapper>,
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
expect(
|
|
89
|
+
StyleSheet.flatten(screen.getByText('5').props.style).fontSize,
|
|
90
|
+
).toBe(typographies[token].fontSize);
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
+
import { StyleSheet, Text } from 'react-native';
|
|
3
|
+
import { Box } from '../../primitives';
|
|
4
|
+
import type { SpotNumberProps } from './types';
|
|
5
|
+
import { useSpotStyles } from './useSpotStyles';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A circular digit. Uses the same palette, fill, and size as `Spot`.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-spot--docs Storybook}
|
|
11
|
+
*
|
|
12
|
+
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
13
|
+
* Do not use it to modify the circle's core appearance (colors, size, etc). Use the `appearance` and `fill` props instead.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { SpotNumber } from '@ledgerhq/lumen-ui-rnative';
|
|
17
|
+
*
|
|
18
|
+
* <SpotNumber value={9} />
|
|
19
|
+
*/
|
|
20
|
+
export const SpotNumber = ({
|
|
21
|
+
appearance = 'base',
|
|
22
|
+
fill = 'transparent',
|
|
23
|
+
value,
|
|
24
|
+
disabled: disabledProp = false,
|
|
25
|
+
size = 48,
|
|
26
|
+
lx = {},
|
|
27
|
+
style,
|
|
28
|
+
...rest
|
|
29
|
+
}: SpotNumberProps) => {
|
|
30
|
+
const disabled = useDisabledContext({
|
|
31
|
+
consumerName: 'SpotNumber',
|
|
32
|
+
mergeWith: { disabled: disabledProp },
|
|
33
|
+
});
|
|
34
|
+
const styles = useSpotStyles({ size, appearance, fill, disabled });
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Box
|
|
38
|
+
testID='spot-number'
|
|
39
|
+
lx={lx}
|
|
40
|
+
style={StyleSheet.flatten([styles.root, style])}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
<Text style={styles.numberText} allowFontScaling={false}>
|
|
44
|
+
{value}
|
|
45
|
+
</Text>
|
|
46
|
+
</Box>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle } from 'react-native';
|
|
2
3
|
import type { StyledViewProps } from '../../../../styles';
|
|
3
|
-
import type {
|
|
4
|
+
import type { IconSize } from '../../symbols/Icon';
|
|
4
5
|
|
|
5
6
|
export type SpotAppearance =
|
|
6
|
-
| '
|
|
7
|
-
| '
|
|
8
|
-
| 'check'
|
|
7
|
+
| 'base'
|
|
8
|
+
| 'success'
|
|
9
9
|
| 'error'
|
|
10
10
|
| 'warning'
|
|
11
|
-
| '
|
|
12
|
-
| '
|
|
13
|
-
| '
|
|
11
|
+
| 'muted'
|
|
12
|
+
| 'decorative-blue'
|
|
13
|
+
| 'decorative-pink'
|
|
14
|
+
| 'decorative-purple'
|
|
15
|
+
| 'decorative-green'
|
|
16
|
+
| 'decorative-turquoise'
|
|
17
|
+
| 'decorative-yellow'
|
|
18
|
+
| 'decorative-orange'
|
|
19
|
+
| 'decorative-red';
|
|
14
20
|
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
appearance: 'icon';
|
|
20
|
-
/**
|
|
21
|
-
* A React component to be rendered as the icon. Required when appearance is 'icon'.
|
|
22
|
-
*/
|
|
23
|
-
icon: ComponentType<IconProps>;
|
|
24
|
-
};
|
|
21
|
+
export type SpotFill = 'transparent' | 'plain';
|
|
22
|
+
|
|
23
|
+
export type SpotSize = 32 | 40 | 48 | 56 | 72;
|
|
25
24
|
|
|
26
|
-
type
|
|
25
|
+
export type SpotDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
26
|
+
|
|
27
|
+
export type SpotProps = {
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Color palette for the icon, and for the circle when `fill` is plain.
|
|
30
|
+
* @default 'base'
|
|
29
31
|
*/
|
|
30
|
-
appearance
|
|
32
|
+
appearance?: SpotAppearance;
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* Circle treatment. Transparent keeps a muted transparent fill. Plain uses the palette's solid background and paired text color.
|
|
35
|
+
* @default 'transparent'
|
|
33
36
|
*/
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
type StatusSpotProps = {
|
|
38
|
-
/**
|
|
39
|
-
* Self-contained predefined status indicators with semantic styling.
|
|
40
|
-
*/
|
|
41
|
-
appearance: Exclude<SpotAppearance, 'icon' | 'number'>;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type DiscriminatedSpotProps =
|
|
45
|
-
| IconSpotProps
|
|
46
|
-
| NumberSpotProps
|
|
47
|
-
| StatusSpotProps;
|
|
48
|
-
|
|
49
|
-
export type SpotSize = 32 | 40 | 48 | 56 | 72;
|
|
50
|
-
|
|
51
|
-
export type SpotProps = {
|
|
37
|
+
fill?: SpotFill;
|
|
52
38
|
/**
|
|
53
39
|
* Whether the spot is disabled.
|
|
54
40
|
* @default false
|
|
@@ -59,5 +45,17 @@ export type SpotProps = {
|
|
|
59
45
|
* @default 48
|
|
60
46
|
*/
|
|
61
47
|
size?: SpotSize;
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Icon rendered inside the circle.
|
|
50
|
+
* @required
|
|
51
|
+
*/
|
|
52
|
+
icon: ComponentType<{ size?: IconSize; style?: StyleProp<TextStyle> }>;
|
|
53
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
54
|
+
|
|
55
|
+
export type SpotNumberProps = {
|
|
56
|
+
/**
|
|
57
|
+
* Digit rendered inside the circle.
|
|
58
|
+
* @required
|
|
59
|
+
*/
|
|
60
|
+
value: SpotDigit;
|
|
61
|
+
} & Omit<SpotProps, 'icon'>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import type { LumenTypographyTokens } from '../../../../styles';
|
|
4
|
+
import { useStyleSheet } from '../../../../styles';
|
|
5
|
+
import type { SpotAppearance, SpotFill, SpotSize } from './types';
|
|
6
|
+
|
|
7
|
+
const numberTypographyMap: Record<SpotSize, keyof LumenTypographyTokens> = {
|
|
8
|
+
32: 'body2SemiBold',
|
|
9
|
+
40: 'body1SemiBold',
|
|
10
|
+
48: 'heading5',
|
|
11
|
+
56: 'heading4',
|
|
12
|
+
72: 'heading2',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type SpotStyles = {
|
|
16
|
+
root: ViewStyle;
|
|
17
|
+
icon: TextStyle;
|
|
18
|
+
numberText: TextStyle;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useSpotStyles = ({
|
|
22
|
+
size,
|
|
23
|
+
appearance,
|
|
24
|
+
fill,
|
|
25
|
+
disabled,
|
|
26
|
+
}: {
|
|
27
|
+
size: SpotSize;
|
|
28
|
+
appearance: SpotAppearance;
|
|
29
|
+
fill: SpotFill;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}): SpotStyles => {
|
|
32
|
+
return useStyleSheet(
|
|
33
|
+
(t) => {
|
|
34
|
+
const textColors: Record<SpotFill, Record<SpotAppearance, string>> = {
|
|
35
|
+
transparent: {
|
|
36
|
+
base: t.colors.text.base,
|
|
37
|
+
success: t.colors.text.success,
|
|
38
|
+
error: t.colors.text.error,
|
|
39
|
+
warning: t.colors.text.warning,
|
|
40
|
+
muted: t.colors.text.muted,
|
|
41
|
+
'decorative-blue': t.colors.text.decorativeBlue,
|
|
42
|
+
'decorative-pink': t.colors.text.decorativePink,
|
|
43
|
+
'decorative-purple': t.colors.text.decorativePurple,
|
|
44
|
+
'decorative-green': t.colors.text.decorativeGreen,
|
|
45
|
+
'decorative-turquoise': t.colors.text.decorativeTurquoise,
|
|
46
|
+
'decorative-yellow': t.colors.text.decorativeYellow,
|
|
47
|
+
'decorative-orange': t.colors.text.decorativeOrange,
|
|
48
|
+
'decorative-red': t.colors.text.decorativeRed,
|
|
49
|
+
},
|
|
50
|
+
plain: {
|
|
51
|
+
base: t.colors.text.base,
|
|
52
|
+
success: t.colors.text.successStrong,
|
|
53
|
+
error: t.colors.text.errorStrong,
|
|
54
|
+
warning: t.colors.text.warningStrong,
|
|
55
|
+
muted: t.colors.text.muted,
|
|
56
|
+
'decorative-blue': t.colors.text.decorativeStrongBlue,
|
|
57
|
+
'decorative-pink': t.colors.text.decorativeStrongPink,
|
|
58
|
+
'decorative-purple': t.colors.text.decorativeStrongPurple,
|
|
59
|
+
'decorative-green': t.colors.text.decorativeStrongGreen,
|
|
60
|
+
'decorative-turquoise': t.colors.text.decorativeStrongTurquoise,
|
|
61
|
+
'decorative-yellow': t.colors.text.decorativeStrongYellow,
|
|
62
|
+
'decorative-orange': t.colors.text.decorativeStrongOrange,
|
|
63
|
+
'decorative-red': t.colors.text.decorativeStrongRed,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const plainBackgroundColor: Record<SpotAppearance, string> = {
|
|
68
|
+
base: t.colors.bg.muted,
|
|
69
|
+
success: t.colors.bg.success,
|
|
70
|
+
error: t.colors.bg.error,
|
|
71
|
+
warning: t.colors.bg.warning,
|
|
72
|
+
muted: t.colors.bg.mutedPressed,
|
|
73
|
+
'decorative-blue': t.colors.bg.decorativeBlue,
|
|
74
|
+
'decorative-pink': t.colors.bg.decorativePink,
|
|
75
|
+
'decorative-purple': t.colors.bg.decorativePurple,
|
|
76
|
+
'decorative-green': t.colors.bg.decorativeGreen,
|
|
77
|
+
'decorative-turquoise': t.colors.bg.decorativeTurquoise,
|
|
78
|
+
'decorative-yellow': t.colors.bg.decorativeYellow,
|
|
79
|
+
'decorative-orange': t.colors.bg.decorativeOrange,
|
|
80
|
+
'decorative-red': t.colors.bg.decorativeRed,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const spotSize: Record<SpotSize, number> = {
|
|
84
|
+
32: t.sizes.s32,
|
|
85
|
+
40: t.sizes.s40,
|
|
86
|
+
48: t.sizes.s48,
|
|
87
|
+
56: t.sizes.s56,
|
|
88
|
+
72: t.sizes.s72,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const contentColor = disabled
|
|
92
|
+
? t.colors.text.disabled
|
|
93
|
+
: textColors[fill][appearance];
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
root: {
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
borderRadius: t.borderRadius.full,
|
|
100
|
+
backgroundColor:
|
|
101
|
+
fill === 'plain'
|
|
102
|
+
? plainBackgroundColor[appearance]
|
|
103
|
+
: t.colors.bg.mutedTransparent,
|
|
104
|
+
width: spotSize[size],
|
|
105
|
+
height: spotSize[size],
|
|
106
|
+
flexShrink: 0,
|
|
107
|
+
},
|
|
108
|
+
icon: {
|
|
109
|
+
color: contentColor,
|
|
110
|
+
},
|
|
111
|
+
numberText: StyleSheet.flatten([
|
|
112
|
+
t.typographies[numberTypographyMap[size]],
|
|
113
|
+
{ color: contentColor },
|
|
114
|
+
]),
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
[size, appearance, fill, disabled],
|
|
118
|
+
);
|
|
119
|
+
};
|
|
@@ -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='
|
|
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';
|
|
@@ -14,7 +15,7 @@ describe('ThemeProvider', () => {
|
|
|
14
15
|
<ThemeProvider themes={ledgerLiveThemes}>
|
|
15
16
|
<Button testID='child'>Hello World</Button>
|
|
16
17
|
<Tile>Tile</Tile>
|
|
17
|
-
<Spot
|
|
18
|
+
<Spot icon={Wallet} />
|
|
18
19
|
<Box>
|
|
19
20
|
<Text>Text</Text>
|
|
20
21
|
</Box>
|
|
@@ -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
|
-
<
|
|
20
|
+
<TranslationsProvider locale={locale}>
|
|
21
21
|
<GlobalTooltipProvider>{children}</GlobalTooltipProvider>
|
|
22
|
-
</
|
|
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
|
/**
|