@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,8 +1,10 @@
|
|
|
1
|
-
import { Meta,
|
|
1
|
+
import { Meta, Canvas, Controls, Source } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as SpotStories from './Spot.stories';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
CustomTabs,
|
|
5
|
+
Tab,
|
|
6
|
+
SetupNote,
|
|
7
|
+
} from '../../../../../.storybook/components';
|
|
6
8
|
|
|
7
9
|
<Meta title='Core/Spot' of={SpotStories} />
|
|
8
10
|
|
|
@@ -13,7 +15,7 @@ import { CustomTabs, Tab } from '../../../../../.storybook/components';
|
|
|
13
15
|
|
|
14
16
|
## Introduction
|
|
15
17
|
|
|
16
|
-
Spots are circular
|
|
18
|
+
Spots are circular icon containers. `appearance` selects a color palette. `fill` chooses whether that palette paints only the icon, or the circle as well.
|
|
17
19
|
|
|
18
20
|
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=6786-4738).
|
|
19
21
|
|
|
@@ -21,154 +23,91 @@ Spots are circular status indicators that provide visual feedback about differen
|
|
|
21
23
|
|
|
22
24
|
<Canvas of={SpotStories.Base} />
|
|
23
25
|
|
|
24
|
-
- **Circular
|
|
25
|
-
- **
|
|
26
|
+
- **Circular container**: Transparent muted fill, or a solid fill from the palette
|
|
27
|
+
- **Icon**: Status spots pass a filled symbol such as `CheckmarkCircleFill`
|
|
26
28
|
|
|
27
|
-
## Properties
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
## Properties
|
|
30
31
|
|
|
31
32
|
<Canvas of={SpotStories.Base} />
|
|
32
33
|
<Controls of={SpotStories.Base} />
|
|
33
34
|
|
|
34
|
-
### Appearance
|
|
35
|
-
|
|
36
|
-
There are 8 predefined spot appearances, each serving different purposes:
|
|
35
|
+
### Appearance
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
- **bluetooth**: Bluetooth connectivity indicator
|
|
40
|
-
- **check**: Success/completion state
|
|
41
|
-
- **error**: Error or failure state
|
|
42
|
-
- **warning**: Warning or caution state
|
|
43
|
-
- **info**: Information state
|
|
44
|
-
- **loader**: Loading or processing state
|
|
45
|
-
- **number**: Numeric display (0-9)
|
|
37
|
+
`appearance` is the color palette. On a transparent fill it colors the icon. On a plain fill it also paints the circle, using the palette's paired text color.
|
|
46
38
|
|
|
47
39
|
<Canvas of={SpotStories.AppearanceShowcase} />
|
|
48
40
|
|
|
49
|
-
###
|
|
41
|
+
### Fill
|
|
50
42
|
|
|
51
|
-
|
|
43
|
+
`transparent` keeps the muted transparent circle. `plain` uses the palette's solid background.
|
|
52
44
|
|
|
53
|
-
<Canvas of={SpotStories.
|
|
45
|
+
<Canvas of={SpotStories.FillShowcase} />
|
|
54
46
|
|
|
55
|
-
###
|
|
47
|
+
### Size
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
<Canvas of={SpotStories.SizeShowcase} />
|
|
58
50
|
|
|
59
|
-
<Canvas of={SpotStories.StatesShowcase} />
|
|
60
51
|
|
|
61
|
-
###
|
|
52
|
+
### Loading
|
|
62
53
|
|
|
63
|
-
|
|
54
|
+
Pass `Spinner` as the icon to keep the circle around a loading indicator. Spot sizes the spinner from its own size.
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
- `appearance: 'number'` requires a `number` prop (0-9)
|
|
67
|
-
- All other appearances are self-contained
|
|
56
|
+
<Canvas of={SpotStories.WithSpinner} />
|
|
68
57
|
|
|
69
|
-
|
|
58
|
+
### Number
|
|
70
59
|
|
|
71
|
-
|
|
60
|
+
A single digit uses `SpotNumber`. It follows the same `appearance`, `fill`, and `size`.
|
|
72
61
|
|
|
73
|
-
|
|
74
|
-
- Screen reader support for status descriptions
|
|
75
|
-
- Keyboard navigation considerations
|
|
76
|
-
- Semantic labeling for different states
|
|
62
|
+
<Canvas of={SpotStories.WithNumber} />
|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
<Tab label="Implementation">
|
|
80
|
-
|
|
81
|
-
## Setup
|
|
64
|
+
### With DotSymbol
|
|
82
65
|
|
|
83
|
-
|
|
66
|
+
A coin badge stays a `DotSymbol` wrapped around the spot.
|
|
84
67
|
|
|
85
|
-
|
|
68
|
+
<Canvas of={SpotStories.WithDotSymbol} />
|
|
86
69
|
|
|
87
|
-
|
|
88
|
-
import { Spot } from '@ledgerhq/lumen-ui-rnative';
|
|
89
|
-
|
|
90
|
-
function MyComponent() {
|
|
91
|
-
return <Spot appearance='check' />;
|
|
92
|
-
}
|
|
93
|
-
```
|
|
70
|
+
## Accessibility
|
|
94
71
|
|
|
95
|
-
|
|
72
|
+
When a spot conveys status, label the Spot container (for example, `<Spot accessible accessibilityLabel='Success' ... />`). Color alone does not communicate the state.
|
|
96
73
|
|
|
97
|
-
|
|
74
|
+
</Tab>
|
|
75
|
+
<Tab label="Implementation">
|
|
98
76
|
|
|
99
|
-
```
|
|
100
|
-
|
|
77
|
+
```bash
|
|
78
|
+
npm install @ledgerhq/lumen-ui-rnative
|
|
101
79
|
```
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
The Spot component supports custom icons through the discriminated union type system:
|
|
81
|
+
<SetupNote />
|
|
106
82
|
|
|
107
|
-
|
|
108
|
-
import { Spot, Box } from '@ledgerhq/lumen-ui-rnative';
|
|
109
|
-
import { Settings, Heart, Star } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
83
|
+
## Basic usage
|
|
110
84
|
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
<Box lx={{ flexDirection: 'row', gap: 's16' }}>
|
|
114
|
-
<Spot appearance='icon' icon={Settings} />
|
|
115
|
-
<Spot appearance='icon' icon={Heart} />
|
|
116
|
-
<Spot appearance='icon' icon={Star} />
|
|
117
|
-
</Box>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### With Numbers
|
|
85
|
+
<Source of={SpotStories.Base} />
|
|
123
86
|
|
|
124
|
-
|
|
87
|
+
## Appearance
|
|
125
88
|
|
|
126
|
-
|
|
127
|
-
import { Spot, Box } from '@ledgerhq/lumen-ui-rnative';
|
|
89
|
+
<Source of={SpotStories.AppearanceShowcase} />
|
|
128
90
|
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<Box lx={{ flexDirection: 'row', gap: 's16' }}>
|
|
132
|
-
<Spot appearance='number' number={1} />
|
|
133
|
-
<Spot appearance='number' number={2} />
|
|
134
|
-
<Spot appearance='number' number={3} />
|
|
135
|
-
</Box>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
```
|
|
91
|
+
## Fill
|
|
139
92
|
|
|
140
|
-
|
|
93
|
+
<Source of={SpotStories.FillShowcase} />
|
|
141
94
|
|
|
142
|
-
|
|
95
|
+
## Size
|
|
143
96
|
|
|
144
|
-
|
|
145
|
-
import { Spot, Box } from '@ledgerhq/lumen-ui-rnative';
|
|
97
|
+
<Source of={SpotStories.SizeShowcase} />
|
|
146
98
|
|
|
147
|
-
function StatusIndicators() {
|
|
148
|
-
return (
|
|
149
|
-
<Box lx={{ flexDirection: 'row', gap: 's16' }}>
|
|
150
|
-
{/* Success state */}
|
|
151
|
-
<Spot appearance='check' />
|
|
152
99
|
|
|
153
|
-
|
|
154
|
-
<Spot appearance='error' />
|
|
100
|
+
## Loading
|
|
155
101
|
|
|
156
|
-
|
|
157
|
-
<Spot appearance='warning' />
|
|
102
|
+
<Source of={SpotStories.WithSpinner} />
|
|
158
103
|
|
|
159
|
-
|
|
160
|
-
<Spot appearance='info' />
|
|
104
|
+
## Number
|
|
161
105
|
|
|
162
|
-
|
|
163
|
-
<Spot appearance='loader' />
|
|
106
|
+
<Source of={SpotStories.WithNumber} />
|
|
164
107
|
|
|
165
|
-
|
|
166
|
-
<Spot appearance='bluetooth' />
|
|
167
|
-
</Box>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
```
|
|
108
|
+
## With DotSymbol
|
|
171
109
|
|
|
110
|
+
<Source of={SpotStories.WithDotSymbol} />
|
|
172
111
|
|
|
173
112
|
</Tab>
|
|
174
113
|
</CustomTabs>
|
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
2
3
|
import { Box, Text } from '../../primitives';
|
|
3
|
-
import {
|
|
4
|
-
|
|
4
|
+
import {
|
|
5
|
+
CheckmarkCircleFill,
|
|
6
|
+
DeleteCircleFill,
|
|
7
|
+
Heart,
|
|
8
|
+
InformationFill,
|
|
9
|
+
Settings,
|
|
10
|
+
Star,
|
|
11
|
+
WarningFill,
|
|
12
|
+
} from '../../symbols';
|
|
13
|
+
import type { IconSize } from '../../symbols/Icon';
|
|
14
|
+
import { DotSymbol, getDotSymbolProps } from '../DotSymbol';
|
|
15
|
+
import { Spinner } from '../Spinner';
|
|
5
16
|
import { Spot } from './Spot';
|
|
6
|
-
import
|
|
17
|
+
import { SpotNumber } from './SpotNumber';
|
|
18
|
+
import type { SpotAppearance } from './types';
|
|
7
19
|
|
|
8
20
|
const meta = {
|
|
9
21
|
component: Spot,
|
|
10
22
|
id: 'rnative-spot',
|
|
11
23
|
title: 'Core/Spot',
|
|
12
24
|
parameters: {
|
|
25
|
+
layout: 'centered',
|
|
26
|
+
backgrounds: { default: 'light' },
|
|
13
27
|
docs: {
|
|
14
28
|
source: {
|
|
15
29
|
language: 'tsx',
|
|
16
30
|
format: true,
|
|
17
|
-
type: '
|
|
31
|
+
type: 'dynamic',
|
|
18
32
|
},
|
|
19
33
|
},
|
|
20
34
|
},
|
|
21
35
|
argTypes: {
|
|
22
|
-
appearance: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: [
|
|
25
|
-
'icon',
|
|
26
|
-
'bluetooth',
|
|
27
|
-
'check',
|
|
28
|
-
'error',
|
|
29
|
-
'warning',
|
|
30
|
-
'info',
|
|
31
|
-
'loader',
|
|
32
|
-
'number',
|
|
33
|
-
],
|
|
34
|
-
description: 'The visual appearance and behavior of the spot',
|
|
35
|
-
},
|
|
36
|
-
size: {
|
|
37
|
-
control: 'select',
|
|
38
|
-
options: [32, 40, 48, 56, 72],
|
|
39
|
-
description: 'The size of the spot',
|
|
40
|
-
},
|
|
41
|
-
disabled: {
|
|
42
|
-
control: 'boolean',
|
|
43
|
-
description: 'Whether the spot looks disabled',
|
|
44
|
-
},
|
|
45
36
|
icon: {
|
|
46
37
|
control: 'select',
|
|
47
|
-
|
|
48
|
-
options: ['None', 'Settings', 'Plus', 'Heart', 'Star'],
|
|
38
|
+
options: ['Settings', 'Heart', 'Star', 'CheckmarkCircleFill'],
|
|
49
39
|
mapping: {
|
|
50
|
-
None: undefined,
|
|
51
40
|
Settings: Settings,
|
|
52
|
-
Plus: Plus,
|
|
53
41
|
Heart: Heart,
|
|
54
42
|
Star: Star,
|
|
43
|
+
CheckmarkCircleFill: CheckmarkCircleFill,
|
|
55
44
|
},
|
|
56
45
|
},
|
|
57
|
-
number: {
|
|
58
|
-
control: 'select',
|
|
59
|
-
options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
|
|
60
|
-
description: 'Number to display (required for number appearance)',
|
|
61
|
-
},
|
|
62
46
|
},
|
|
63
47
|
} satisfies Meta<typeof Spot>;
|
|
64
48
|
|
|
@@ -67,43 +51,23 @@ type Story = StoryObj<typeof Spot>;
|
|
|
67
51
|
|
|
68
52
|
export const Base: Story = {
|
|
69
53
|
args: {
|
|
70
|
-
appearance: 'icon',
|
|
71
54
|
icon: Settings,
|
|
72
55
|
},
|
|
73
|
-
|
|
74
|
-
docs: {
|
|
75
|
-
source: {
|
|
76
|
-
code: `
|
|
77
|
-
<Spot
|
|
78
|
-
appearance="icon"
|
|
79
|
-
icon={Settings}
|
|
80
|
-
/>
|
|
81
|
-
`,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
56
|
+
render: (args) => <Spot {...args} />,
|
|
85
57
|
};
|
|
86
58
|
|
|
87
59
|
export const AppearanceShowcase: Story = {
|
|
88
|
-
args: {
|
|
89
|
-
appearance: 'icon',
|
|
90
|
-
icon: Settings,
|
|
91
|
-
},
|
|
92
60
|
render: () => {
|
|
93
61
|
const appearances: {
|
|
94
62
|
name: string;
|
|
95
|
-
appearance:
|
|
96
|
-
icon
|
|
97
|
-
number?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
63
|
+
appearance: SpotAppearance;
|
|
64
|
+
icon: ComponentType<{ size?: IconSize }>;
|
|
98
65
|
}[] = [
|
|
99
|
-
{ name: '
|
|
100
|
-
{ name: '
|
|
101
|
-
{ name: '
|
|
102
|
-
{ name: '
|
|
103
|
-
{ name: '
|
|
104
|
-
{ name: 'Info', appearance: 'info' },
|
|
105
|
-
{ name: 'Loader', appearance: 'loader' },
|
|
106
|
-
{ name: 'Number', appearance: 'number', number: 3 },
|
|
66
|
+
{ name: 'Base', appearance: 'base', icon: Settings },
|
|
67
|
+
{ name: 'Success', appearance: 'success', icon: CheckmarkCircleFill },
|
|
68
|
+
{ name: 'Error', appearance: 'error', icon: DeleteCircleFill },
|
|
69
|
+
{ name: 'Warning', appearance: 'warning', icon: WarningFill },
|
|
70
|
+
{ name: 'Muted', appearance: 'muted', icon: InformationFill },
|
|
107
71
|
];
|
|
108
72
|
|
|
109
73
|
return (
|
|
@@ -115,22 +79,16 @@ export const AppearanceShowcase: Story = {
|
|
|
115
79
|
padding: 's8',
|
|
116
80
|
}}
|
|
117
81
|
>
|
|
118
|
-
{appearances.map(({ name, appearance, icon
|
|
82
|
+
{appearances.map(({ name, appearance, icon }) => (
|
|
119
83
|
<Box
|
|
120
|
-
key={
|
|
121
|
-
lx={{
|
|
122
|
-
width: 's64',
|
|
123
|
-
flexDirection: 'column',
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
gap: 's4',
|
|
126
|
-
}}
|
|
84
|
+
key={name}
|
|
85
|
+
lx={{ alignItems: 'center', gap: 's4', width: 's64' }}
|
|
127
86
|
>
|
|
128
|
-
<Spot
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<Text typography='body3' lx={{ color: 'muted' }}>
|
|
87
|
+
<Spot appearance={appearance} icon={icon} />
|
|
88
|
+
<Text
|
|
89
|
+
typography='body3'
|
|
90
|
+
lx={{ color: 'muted', textAlign: 'center' }}
|
|
91
|
+
>
|
|
134
92
|
{name}
|
|
135
93
|
</Text>
|
|
136
94
|
</Box>
|
|
@@ -140,137 +98,118 @@ export const AppearanceShowcase: Story = {
|
|
|
140
98
|
},
|
|
141
99
|
};
|
|
142
100
|
|
|
143
|
-
export const
|
|
144
|
-
args: {
|
|
145
|
-
appearance: 'icon',
|
|
146
|
-
icon: Settings,
|
|
147
|
-
},
|
|
101
|
+
export const FillShowcase: Story = {
|
|
148
102
|
render: () => {
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
103
|
+
const appearances: SpotAppearance[] = [
|
|
104
|
+
'base',
|
|
105
|
+
'success',
|
|
106
|
+
'error',
|
|
107
|
+
'warning',
|
|
108
|
+
'muted',
|
|
109
|
+
'decorative-blue',
|
|
110
|
+
'decorative-pink',
|
|
111
|
+
'decorative-purple',
|
|
112
|
+
'decorative-green',
|
|
113
|
+
'decorative-turquoise',
|
|
114
|
+
'decorative-yellow',
|
|
115
|
+
'decorative-orange',
|
|
116
|
+
'decorative-red',
|
|
154
117
|
];
|
|
155
118
|
|
|
156
119
|
return (
|
|
157
|
-
<Box lx={{
|
|
158
|
-
{
|
|
159
|
-
<
|
|
120
|
+
<Box lx={{ gap: 's16', padding: 's8' }}>
|
|
121
|
+
{(['transparent', 'plain'] as const).map((fill) => (
|
|
122
|
+
<Box key={fill} lx={{ gap: 's8' }}>
|
|
123
|
+
<Text typography='body2SemiBold' lx={{ color: 'base' }}>
|
|
124
|
+
{fill}
|
|
125
|
+
</Text>
|
|
126
|
+
<Box lx={{ flexDirection: 'row', flexWrap: 'wrap', gap: 's12' }}>
|
|
127
|
+
{appearances.map((appearance) => (
|
|
128
|
+
<Spot
|
|
129
|
+
key={appearance}
|
|
130
|
+
appearance={appearance}
|
|
131
|
+
fill={fill}
|
|
132
|
+
icon={Settings}
|
|
133
|
+
/>
|
|
134
|
+
))}
|
|
135
|
+
</Box>
|
|
136
|
+
</Box>
|
|
160
137
|
))}
|
|
161
138
|
</Box>
|
|
162
139
|
);
|
|
163
140
|
},
|
|
164
141
|
};
|
|
165
142
|
|
|
166
|
-
export const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
143
|
+
export const SizeShowcase: Story = {
|
|
144
|
+
render: () => {
|
|
145
|
+
const sizes = [32, 40, 48, 56, 72] as const;
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<Box lx={{ gap: 's32', padding: 's16' }}>
|
|
149
|
+
{sizes.map((size) => (
|
|
150
|
+
<Box key={size} lx={{ gap: 's16' }}>
|
|
151
|
+
<Text typography='body2SemiBold'>{size}px</Text>
|
|
152
|
+
<Box
|
|
153
|
+
lx={{ flexDirection: 'row', gap: 's12', alignItems: 'center' }}
|
|
154
|
+
>
|
|
155
|
+
<Spot icon={Settings} size={size} />
|
|
156
|
+
<Spot appearance='muted' icon={InformationFill} size={size} />
|
|
157
|
+
<Spot
|
|
158
|
+
appearance='success'
|
|
159
|
+
fill='plain'
|
|
160
|
+
icon={Settings}
|
|
161
|
+
size={size}
|
|
162
|
+
/>
|
|
163
|
+
</Box>
|
|
164
|
+
</Box>
|
|
165
|
+
))}
|
|
166
|
+
</Box>
|
|
167
|
+
);
|
|
170
168
|
},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const WithSpinner: Story = {
|
|
171
172
|
render: () => {
|
|
172
|
-
const
|
|
173
|
+
const sizes = [32, 40, 48, 56, 72] as const;
|
|
173
174
|
|
|
174
175
|
return (
|
|
175
176
|
<Box
|
|
176
177
|
lx={{
|
|
177
178
|
flexDirection: 'row',
|
|
178
|
-
|
|
179
|
-
gap: '
|
|
180
|
-
padding: '
|
|
179
|
+
alignItems: 'flex-end',
|
|
180
|
+
gap: 's16',
|
|
181
|
+
padding: 's16',
|
|
181
182
|
}}
|
|
182
183
|
>
|
|
183
|
-
{
|
|
184
|
-
<Spot key={
|
|
184
|
+
{sizes.map((size) => (
|
|
185
|
+
<Spot key={size} icon={Spinner} size={size} />
|
|
185
186
|
))}
|
|
186
187
|
</Box>
|
|
187
188
|
);
|
|
188
189
|
},
|
|
189
190
|
};
|
|
190
191
|
|
|
191
|
-
export const
|
|
192
|
-
args: {
|
|
193
|
-
appearance: 'icon',
|
|
194
|
-
icon: Settings,
|
|
195
|
-
},
|
|
192
|
+
export const WithDotSymbol: Story = {
|
|
196
193
|
render: () => {
|
|
197
|
-
const sizes = [32, 40, 48, 56, 72] as const;
|
|
198
|
-
|
|
199
194
|
return (
|
|
200
|
-
<Box lx={{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
</Box>
|
|
209
|
-
</Box>
|
|
210
|
-
))}
|
|
195
|
+
<Box lx={{ padding: 's16' }}>
|
|
196
|
+
<DotSymbol
|
|
197
|
+
src='https://crypto-icons.ledger.com/BTC.png'
|
|
198
|
+
pin='bottom-end'
|
|
199
|
+
{...getDotSymbolProps('spot', 48)}
|
|
200
|
+
>
|
|
201
|
+
<Spot icon={Settings} />
|
|
202
|
+
</DotSymbol>
|
|
211
203
|
</Box>
|
|
212
204
|
);
|
|
213
205
|
},
|
|
214
206
|
};
|
|
215
207
|
|
|
216
|
-
export const
|
|
217
|
-
args: {
|
|
218
|
-
appearance: 'icon',
|
|
219
|
-
icon: Settings,
|
|
220
|
-
},
|
|
208
|
+
export const WithNumber: Story = {
|
|
221
209
|
render: () => {
|
|
222
210
|
return (
|
|
223
|
-
<Box lx={{
|
|
224
|
-
<
|
|
225
|
-
<Text typography='body2'>Default</Text>
|
|
226
|
-
<Box lx={{ flexDirection: 'row', flexWrap: 'wrap', gap: 's16' }}>
|
|
227
|
-
<Box
|
|
228
|
-
lx={{
|
|
229
|
-
width: 's64',
|
|
230
|
-
flexDirection: 'column',
|
|
231
|
-
alignItems: 'center',
|
|
232
|
-
gap: 's4',
|
|
233
|
-
}}
|
|
234
|
-
>
|
|
235
|
-
<Spot appearance='icon' icon={Settings} />
|
|
236
|
-
</Box>
|
|
237
|
-
<Box
|
|
238
|
-
lx={{
|
|
239
|
-
width: 's64',
|
|
240
|
-
flexDirection: 'column',
|
|
241
|
-
alignItems: 'center',
|
|
242
|
-
gap: 's4',
|
|
243
|
-
}}
|
|
244
|
-
>
|
|
245
|
-
<Spot appearance='bluetooth' />
|
|
246
|
-
</Box>
|
|
247
|
-
</Box>
|
|
248
|
-
</Box>
|
|
249
|
-
<Box lx={{ flexDirection: 'column', gap: 's8' }}>
|
|
250
|
-
<Text typography='body2'>Disabled</Text>
|
|
251
|
-
<Box lx={{ flexDirection: 'row', flexWrap: 'wrap', gap: 's16' }}>
|
|
252
|
-
<Box
|
|
253
|
-
lx={{
|
|
254
|
-
width: 's64',
|
|
255
|
-
flexDirection: 'column',
|
|
256
|
-
alignItems: 'center',
|
|
257
|
-
gap: 's4',
|
|
258
|
-
}}
|
|
259
|
-
>
|
|
260
|
-
<Spot appearance='icon' icon={Settings} disabled />
|
|
261
|
-
</Box>
|
|
262
|
-
<Box
|
|
263
|
-
lx={{
|
|
264
|
-
width: 's64',
|
|
265
|
-
flexDirection: 'column',
|
|
266
|
-
alignItems: 'center',
|
|
267
|
-
gap: 's4',
|
|
268
|
-
}}
|
|
269
|
-
>
|
|
270
|
-
<Spot appearance='bluetooth' disabled />
|
|
271
|
-
</Box>
|
|
272
|
-
</Box>
|
|
273
|
-
</Box>
|
|
211
|
+
<Box lx={{ padding: 's16' }}>
|
|
212
|
+
<SpotNumber value={9} />
|
|
274
213
|
</Box>
|
|
275
214
|
);
|
|
276
215
|
},
|
|
@@ -0,0 +1,71 @@
|
|
|
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 type { StyleProp, TextStyle } from 'react-native';
|
|
6
|
+
import { View } from 'react-native';
|
|
7
|
+
import type { IconSize } from '../../symbols/Icon';
|
|
8
|
+
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
9
|
+
import { Spot } from './Spot';
|
|
10
|
+
|
|
11
|
+
const { colors } = ledgerLiveThemes.dark;
|
|
12
|
+
|
|
13
|
+
const TestWrapper = ({ children }: { children: ReactNode }) => (
|
|
14
|
+
<ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
|
|
15
|
+
{children}
|
|
16
|
+
</ThemeProvider>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const TestIcon = ({
|
|
20
|
+
style,
|
|
21
|
+
}: {
|
|
22
|
+
size?: IconSize;
|
|
23
|
+
style?: StyleProp<TextStyle>;
|
|
24
|
+
}) => <View testID='spot-icon' style={style} />;
|
|
25
|
+
|
|
26
|
+
describe('Spot', () => {
|
|
27
|
+
it('should paint only the icon when fill is transparent', () => {
|
|
28
|
+
render(
|
|
29
|
+
<TestWrapper>
|
|
30
|
+
<Spot appearance='success' icon={TestIcon} />
|
|
31
|
+
</TestWrapper>,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
expect(
|
|
35
|
+
screen.getByTestId('spot-container').props.style.backgroundColor,
|
|
36
|
+
).toBe(colors.bg.mutedTransparent);
|
|
37
|
+
expect(screen.getByTestId('spot-icon').props.style.color).toBe(
|
|
38
|
+
colors.text.success,
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should paint the circle and a paired text color when fill is plain', () => {
|
|
43
|
+
render(
|
|
44
|
+
<TestWrapper>
|
|
45
|
+
<Spot appearance='success' fill='plain' icon={TestIcon} />
|
|
46
|
+
</TestWrapper>,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(
|
|
50
|
+
screen.getByTestId('spot-container').props.style.backgroundColor,
|
|
51
|
+
).toBe(colors.bg.success);
|
|
52
|
+
expect(screen.getByTestId('spot-icon').props.style.color).toBe(
|
|
53
|
+
colors.text.successStrong,
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should use the disabled text color', () => {
|
|
58
|
+
render(
|
|
59
|
+
<TestWrapper>
|
|
60
|
+
<Spot appearance='success' disabled icon={TestIcon} />
|
|
61
|
+
</TestWrapper>,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
expect(
|
|
65
|
+
screen.getByTestId('spot-container').props.style.backgroundColor,
|
|
66
|
+
).toBe(colors.bg.mutedTransparent);
|
|
67
|
+
expect(screen.getByTestId('spot-icon').props.style.color).toBe(
|
|
68
|
+
colors.text.disabled,
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
});
|