@ledgerhq/lumen-ui-rnative 0.1.68 → 0.1.70
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/lib/Components/animations/Pulse/Pulse.stories.js +7 -0
- package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js.map +1 -1
- package/dist/module/lib/Components/animations/Spin/Spin.stories.js +7 -0
- package/dist/module/lib/Components/animations/Spin/Spin.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js +129 -136
- package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js +12 -6
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js +154 -176
- package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/Avatar.stories.js +54 -47
- package/dist/module/lib/Components/core/Avatar/Avatar.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AvatarButton/AvatarButton.stories.js +2 -9
- package/dist/module/lib/Components/core/AvatarButton/AvatarButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Banner/Banner.stories.js +48 -87
- package/dist/module/lib/Components/core/Banner/Banner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Button/Button.figma.js +2 -1
- package/dist/module/lib/Components/core/Button/Button.figma.js.map +1 -1
- package/dist/module/lib/Components/core/Button/Button.mdx +2 -1
- package/dist/module/lib/Components/core/Button/Button.stories.js +34 -10
- package/dist/module/lib/Components/core/Button/Button.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.mdx +6 -0
- package/dist/module/lib/Components/core/Card/Card.stories.js +63 -24
- package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
- package/dist/module/lib/Components/core/CardButton/CardButton.stories.js +27 -85
- package/dist/module/lib/Components/core/CardButton/CardButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Checkbox/Checkbox.stories.js +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +8 -18
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js +28 -0
- package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Divider/Divider.stories.js +7 -0
- package/dist/module/lib/Components/core/Divider/Divider.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotCount/DotCount.stories.js +28 -0
- package/dist/module/lib/Components/core/DotCount/DotCount.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js +12 -0
- package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotIndicator/DotIndicator.stories.js +21 -0
- package/dist/module/lib/Components/core/DotIndicator/DotIndicator.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js +21 -0
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/core/IconButton/IconButton.stories.js +17 -0
- package/dist/module/lib/Components/core/IconButton/IconButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js +15 -21
- package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Link/Link.js +1 -1
- package/dist/module/lib/Components/core/Link/Link.mdx +32 -5
- package/dist/module/lib/Components/core/Link/Link.stories.js +35 -139
- package/dist/module/lib/Components/core/Link/Link.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Link/Link.test.js +1 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +2 -41
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js +19 -12
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js +2 -13
- package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js +24 -50
- package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaImage/MediaImage.js +1 -1
- package/dist/module/lib/Components/core/MediaImage/MediaImage.js.map +1 -1
- package/dist/module/lib/Components/core/MediaImage/MediaImage.stories.js +1 -1
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.figma.js +215 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.figma.js.map +1 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.js +221 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.js.map +1 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.mdx +96 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.js +258 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.js.map +1 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.test.js +246 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.test.js.map +1 -0
- package/dist/module/lib/Components/core/MediaImageGroup/index.js +5 -0
- package/dist/module/lib/Components/core/MediaImageGroup/index.js.map +1 -0
- package/dist/module/lib/Components/core/MediaImageGroup/types.js +4 -0
- package/dist/module/lib/Components/core/MediaImageGroup/types.js.map +1 -0
- package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js +9 -0
- package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MenuList/MenuList.mdx +2 -2
- package/dist/module/lib/Components/core/MenuList/MenuList.stories.js +17 -1
- package/dist/module/lib/Components/core/MenuList/MenuList.stories.js.map +1 -1
- package/dist/module/lib/Components/core/PageIndicator/PageIndicator.figma.js +1 -1
- package/dist/module/lib/Components/core/PageIndicator/PageIndicator.figma.js.map +1 -1
- package/dist/module/lib/Components/core/PageIndicator/PageIndicator.stories.js +56 -50
- package/dist/module/lib/Components/core/PageIndicator/PageIndicator.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Pagination/Pagination.figma.js +22 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.figma.js.map +1 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.js +182 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.js.map +1 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.mdx +108 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.stories.js +121 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.stories.js.map +1 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.test.js +338 -0
- package/dist/module/lib/Components/core/Pagination/Pagination.test.js.map +1 -0
- package/dist/module/lib/Components/core/Pagination/index.js +4 -0
- package/dist/module/lib/Components/core/Pagination/index.js.map +1 -0
- package/dist/module/lib/Components/core/Pagination/types.js +4 -0
- package/dist/module/lib/Components/core/Pagination/types.js.map +1 -0
- package/dist/module/lib/Components/core/SearchInput/SearchInput.stories.js +75 -67
- package/dist/module/lib/Components/core/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/SegmentedControl/SegmentedControl.stories.js +12 -0
- package/dist/module/lib/Components/core/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/dist/module/lib/Components/core/SelectList/SelectList.mdx +3 -1
- package/dist/module/lib/Components/core/SelectList/SelectList.stories.js +3 -3
- package/dist/module/lib/Components/core/SelectList/SelectList.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Skeleton/Skeleton.stories.js +7 -0
- package/dist/module/lib/Components/core/Skeleton/Skeleton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spinner/Spinner.stories.js +7 -0
- package/dist/module/lib/Components/core/Spinner/Spinner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.stories.js +20 -1
- package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Stepper/Stepper.stories.js +7 -0
- package/dist/module/lib/Components/core/Stepper/Stepper.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Subheader/Subheader.stories.js +11 -1
- package/dist/module/lib/Components/core/Subheader/Subheader.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Switch/Switch.stories.js +21 -1
- package/dist/module/lib/Components/core/Switch/Switch.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TabBar/TabBar.stories.js +17 -5
- package/dist/module/lib/Components/core/TabBar/TabBar.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Tag/Tag.stories.js +28 -0
- package/dist/module/lib/Components/core/Tag/Tag.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TextInput/TextInput.stories.js +159 -196
- package/dist/module/lib/Components/core/TextInput/TextInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TextInput/TextInput.test.js +2 -2
- package/dist/module/lib/Components/core/TextInput/TextInput.test.js.map +1 -1
- package/dist/module/lib/Components/core/Tile/Tile.stories.js +2 -35
- package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TileButton/TileButton.stories.js +18 -8
- package/dist/module/lib/Components/core/TileButton/TileButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Timeline/Timeline.js +81 -67
- package/dist/module/lib/Components/core/Timeline/Timeline.js.map +1 -1
- package/dist/module/lib/Components/core/Timeline/Timeline.stories.js +46 -16
- package/dist/module/lib/Components/core/Timeline/Timeline.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Timeline/Timeline.test.js +8 -5
- package/dist/module/lib/Components/core/Timeline/Timeline.test.js.map +1 -1
- package/dist/module/lib/Components/core/Toast/Toast.mdx +1 -1
- package/dist/module/lib/Components/core/Toast/Toast.stories.js +61 -58
- package/dist/module/lib/Components/core/Toast/Toast.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Toast/Toaster.test.js +1 -1
- package/dist/module/lib/Components/core/Toast/Toaster.test.js.map +1 -1
- package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js +31 -2
- package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.stories.js +9 -0
- package/dist/module/lib/Components/core/Trend/Trend.stories.js.map +1 -1
- package/dist/module/lib/Components/core/index.js +2 -0
- package/dist/module/lib/Components/core/index.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.js +5 -2
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.test.js +1 -1
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.test.js.map +1 -1
- package/dist/module/lib/Components/primitives/Box/Box.stories.js +1 -18
- package/dist/module/lib/Components/primitives/Box/Box.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js +36 -0
- package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js +1 -1
- package/dist/module/lib/Components/primitives/Pressable/Pressable.stories.js +1 -19
- package/dist/module/lib/Components/primitives/Pressable/Pressable.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Text/Text.stories.js +1 -12
- package/dist/module/lib/Components/primitives/Text/Text.stories.js.map +1 -1
- package/dist/module/lib/Components/symbols/Icon/Icon.stories.js +128 -85
- package/dist/module/lib/Components/symbols/Icon/Icon.stories.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Ar.js +2 -2
- package/dist/module/lib/Components/symbols/icons/Ar.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Range.js +1 -1
- package/dist/module/lib/Components/symbols/icons/Share.js +1 -1
- package/dist/module/lib/Components/symbols/icons/{Charon.js → ShoppingInvoiceList.js} +8 -8
- package/dist/module/lib/Components/symbols/icons/ShoppingInvoiceList.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/WalletInput.js +1 -1
- package/dist/module/lib/Components/symbols/icons/WalletInput.js.map +1 -1
- package/dist/module/lib/Components/symbols/index.js +1 -4
- package/dist/module/lib/Components/symbols/index.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/Line/utils.js +1 -1
- package/dist/module/lib/Components/visualization/LineChart/LineChart.stories.js +69 -0
- package/dist/module/lib/Components/visualization/LineChart/LineChart.stories.js.map +1 -1
- package/dist/module/lib/Components/visualization/LineChart/LineChart.test.js +1 -1
- package/dist/module/lib/Components/visualization/LineChart/LineChart.test.js.map +1 -1
- package/dist/module/lib/Components/visualization/Point/Point.stories.js +12 -0
- package/dist/module/lib/Components/visualization/Point/Point.stories.js.map +1 -1
- package/dist/module/lib/Components/visualization/Point/Point.test.js +1 -1
- package/dist/module/lib/Components/visualization/Point/usePointGeometry.js +1 -1
- package/dist/module/lib/Components/visualization/Point/utils.js +1 -1
- package/dist/module/lib/Components/visualization/Point/utils.test.js +2 -2
- package/dist/module/lib/Components/visualization/ReferenceLine/ReferenceLine.stories.js +23 -0
- package/dist/module/lib/Components/visualization/ReferenceLine/ReferenceLine.stories.js.map +1 -1
- package/dist/module/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.js +3 -3
- package/dist/module/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.js.map +1 -1
- package/dist/module/lib/Components/visualization/Scrubber/Scrubber.stories.js +35 -0
- package/dist/module/lib/Components/visualization/Scrubber/Scrubber.stories.js.map +1 -1
- package/dist/module/translations/locales/de.json +7 -0
- package/dist/module/translations/locales/en.json +7 -0
- package/dist/module/translations/locales/es.json +7 -0
- package/dist/module/translations/locales/fr.json +7 -0
- package/dist/module/translations/locales/ja.json +7 -0
- package/dist/module/translations/locales/ko.json +7 -0
- package/dist/module/translations/locales/pt.json +7 -0
- package/dist/module/translations/locales/ru.json +7 -0
- package/dist/module/translations/locales/th.json +7 -0
- package/dist/module/translations/locales/tr.json +7 -0
- package/dist/module/translations/locales/zh.json +7 -0
- package/dist/typescript/src/lib/Components/core/MediaImage/MediaImage.d.ts +4 -0
- package/dist/typescript/src/lib/Components/core/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/MediaImageGroup.d.ts +33 -0
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/MediaImageGroup.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/types.d.ts +66 -0
- package/dist/typescript/src/lib/Components/core/MediaImageGroup/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Pagination/Pagination.d.ts +15 -0
- package/dist/typescript/src/lib/Components/core/Pagination/Pagination.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Pagination/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/core/Pagination/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Pagination/types.d.ts +29 -0
- package/dist/typescript/src/lib/Components/core/Pagination/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/Timeline/Timeline.d.ts +2 -2
- package/dist/typescript/src/lib/Components/core/Timeline/Timeline.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/core/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseButton/BaseButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseButton/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseButton/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/{Charon.d.ts → ShoppingInvoiceList.d.ts} +7 -7
- package/dist/typescript/src/lib/Components/symbols/icons/ShoppingInvoiceList.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts +1 -4
- package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/visualization/Axis/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/Line/utils.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/LineChart/types.d.ts +3 -3
- package/dist/typescript/src/lib/Components/visualization/Point/types.d.ts +3 -3
- package/dist/typescript/src/lib/Components/visualization/Point/usePointGeometry.d.ts +1 -1
- package/dist/typescript/src/lib/Components/visualization/Point/utils.d.ts +1 -1
- package/dist/typescript/src/translations/translations.d.ts +84 -0
- package/dist/typescript/src/translations/translations.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/lib/Components/animations/Pulse/Pulse.stories.tsx +1 -0
- package/src/lib/Components/animations/Spin/Spin.stories.tsx +1 -0
- package/src/lib/Components/core/AddressInput/AddressInput.stories.tsx +168 -123
- package/src/lib/Components/core/AmountDisplay/AmountDisplay.stories.tsx +7 -7
- package/src/lib/Components/core/AmountInput/AmountInput.stories.tsx +162 -158
- package/src/lib/Components/core/Avatar/Avatar.stories.tsx +37 -46
- package/src/lib/Components/core/AvatarButton/AvatarButton.stories.tsx +1 -8
- package/src/lib/Components/core/Banner/Banner.stories.tsx +8 -95
- package/src/lib/Components/core/Button/Button.figma.tsx +1 -0
- package/src/lib/Components/core/Button/Button.mdx +2 -1
- package/src/lib/Components/core/Button/Button.stories.tsx +13 -14
- package/src/lib/Components/core/Card/Card.mdx +6 -0
- package/src/lib/Components/core/Card/Card.stories.tsx +31 -27
- package/src/lib/Components/core/CardButton/CardButton.stories.tsx +14 -90
- package/src/lib/Components/core/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +1 -17
- package/src/lib/Components/core/DescriptionItem/DescriptionItem.stories.tsx +4 -0
- package/src/lib/Components/core/Divider/Divider.stories.tsx +1 -0
- package/src/lib/Components/core/DotCount/DotCount.stories.tsx +4 -0
- package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +8 -0
- package/src/lib/Components/core/DotIndicator/DotIndicator.stories.tsx +3 -0
- package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +3 -0
- package/src/lib/Components/core/IconButton/IconButton.stories.tsx +9 -0
- package/src/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.tsx +16 -23
- package/src/lib/Components/core/Link/Link.mdx +32 -5
- package/src/lib/Components/core/Link/Link.stories.tsx +20 -146
- package/src/lib/Components/core/Link/Link.test.tsx +1 -1
- package/src/lib/Components/core/Link/Link.tsx +1 -1
- package/src/lib/Components/core/ListItem/ListItem.stories.tsx +0 -39
- package/src/lib/Components/core/MediaBanner/MediaBanner.stories.tsx +3 -14
- package/src/lib/Components/core/MediaButton/MediaButton.stories.tsx +1 -12
- package/src/lib/Components/core/MediaCard/MediaCard.stories.tsx +10 -53
- package/src/lib/Components/core/MediaImage/MediaImage.stories.tsx +1 -1
- package/src/lib/Components/core/MediaImage/MediaImage.tsx +1 -1
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.figma.tsx +119 -0
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.mdx +96 -0
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.tsx +154 -0
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.test.tsx +213 -0
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.tsx +264 -0
- package/src/lib/Components/core/MediaImageGroup/index.ts +2 -0
- package/src/lib/Components/core/MediaImageGroup/types.ts +77 -0
- package/src/lib/Components/core/MediaTag/MediaTag.stories.tsx +3 -0
- package/src/lib/Components/core/MenuList/MenuList.mdx +2 -2
- package/src/lib/Components/core/MenuList/MenuList.stories.tsx +13 -1
- package/src/lib/Components/core/PageIndicator/PageIndicator.figma.tsx +1 -1
- package/src/lib/Components/core/PageIndicator/PageIndicator.stories.tsx +45 -42
- package/src/lib/Components/core/Pagination/Pagination.figma.tsx +25 -0
- package/src/lib/Components/core/Pagination/Pagination.mdx +108 -0
- package/src/lib/Components/core/Pagination/Pagination.stories.tsx +90 -0
- package/src/lib/Components/core/Pagination/Pagination.test.tsx +346 -0
- package/src/lib/Components/core/Pagination/Pagination.tsx +200 -0
- package/src/lib/Components/core/Pagination/index.ts +2 -0
- package/src/lib/Components/core/Pagination/types.ts +29 -0
- package/src/lib/Components/core/SearchInput/SearchInput.stories.tsx +91 -66
- package/src/lib/Components/core/SegmentedControl/SegmentedControl.stories.tsx +2 -0
- package/src/lib/Components/core/SelectList/SelectList.mdx +3 -1
- package/src/lib/Components/core/SelectList/SelectList.stories.tsx +3 -3
- package/src/lib/Components/core/Skeleton/Skeleton.stories.tsx +1 -0
- package/src/lib/Components/core/Spinner/Spinner.stories.tsx +1 -0
- package/src/lib/Components/core/Spot/Spot.stories.tsx +10 -1
- package/src/lib/Components/core/Stepper/Stepper.stories.tsx +1 -0
- package/src/lib/Components/core/Subheader/Subheader.stories.tsx +5 -2
- package/src/lib/Components/core/Switch/Switch.stories.tsx +17 -1
- package/src/lib/Components/core/TabBar/TabBar.stories.tsx +15 -5
- package/src/lib/Components/core/Tag/Tag.stories.tsx +4 -0
- package/src/lib/Components/core/TextInput/TextInput.stories.tsx +186 -174
- package/src/lib/Components/core/TextInput/TextInput.test.tsx +2 -2
- package/src/lib/Components/core/Tile/Tile.stories.tsx +0 -33
- package/src/lib/Components/core/TileButton/TileButton.stories.tsx +9 -7
- package/src/lib/Components/core/Timeline/Timeline.stories.tsx +20 -1
- package/src/lib/Components/core/Timeline/Timeline.test.tsx +12 -8
- package/src/lib/Components/core/Timeline/Timeline.tsx +79 -75
- package/src/lib/Components/core/Toast/Toast.mdx +1 -1
- package/src/lib/Components/core/Toast/Toast.stories.tsx +55 -66
- package/src/lib/Components/core/Toast/Toaster.test.tsx +1 -1
- package/src/lib/Components/core/Tooltip/Tooltip.stories.tsx +7 -3
- package/src/lib/Components/core/Trend/Trend.stories.tsx +3 -0
- package/src/lib/Components/core/index.ts +2 -0
- package/src/lib/Components/internal/BaseButton/BaseButton.test.tsx +1 -0
- package/src/lib/Components/internal/BaseButton/BaseButton.tsx +3 -0
- package/src/lib/Components/internal/BaseButton/types.ts +2 -1
- package/src/lib/Components/internal/BaseInput/types.ts +1 -1
- package/src/lib/Components/primitives/Box/Box.stories.tsx +1 -18
- package/src/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.tsx +12 -0
- package/src/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.tsx +1 -1
- package/src/lib/Components/primitives/Pressable/Pressable.stories.tsx +0 -18
- package/src/lib/Components/primitives/Text/Text.stories.tsx +1 -12
- package/src/lib/Components/symbols/Icon/Icon.stories.tsx +133 -94
- package/src/lib/Components/symbols/icons/Ar.tsx +2 -2
- package/src/lib/Components/symbols/icons/Range.tsx +1 -1
- package/src/lib/Components/symbols/icons/Share.tsx +1 -1
- package/src/lib/Components/symbols/icons/{Charon.tsx → ShoppingInvoiceList.tsx} +8 -8
- package/src/lib/Components/symbols/icons/WalletInput.tsx +1 -1
- package/src/lib/Components/symbols/index.ts +1 -4
- package/src/lib/Components/visualization/Axis/types.ts +1 -1
- package/src/lib/Components/visualization/CartesianChart/types.ts +1 -1
- package/src/lib/Components/visualization/DonutChart/DonutChart.test.tsx +1 -1
- package/src/lib/Components/visualization/Line/utils.ts +1 -1
- package/src/lib/Components/visualization/LineChart/LineChart.stories.tsx +15 -0
- package/src/lib/Components/visualization/LineChart/LineChart.test.tsx +1 -1
- package/src/lib/Components/visualization/LineChart/types.ts +3 -3
- package/src/lib/Components/visualization/Point/Point.stories.tsx +2 -0
- package/src/lib/Components/visualization/Point/Point.test.tsx +1 -1
- package/src/lib/Components/visualization/Point/types.ts +3 -3
- package/src/lib/Components/visualization/Point/usePointGeometry.ts +1 -1
- package/src/lib/Components/visualization/Point/utils.test.ts +2 -2
- package/src/lib/Components/visualization/Point/utils.ts +1 -1
- package/src/lib/Components/visualization/ReferenceLine/ReferenceLine.stories.tsx +5 -0
- package/src/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.ts +3 -3
- package/src/lib/Components/visualization/Scrubber/Scrubber.stories.tsx +5 -0
- package/src/translations/locales/de.json +7 -0
- package/src/translations/locales/en.json +7 -0
- package/src/translations/locales/es.json +7 -0
- package/src/translations/locales/fr.json +7 -0
- package/src/translations/locales/ja.json +7 -0
- package/src/translations/locales/ko.json +7 -0
- package/src/translations/locales/pt.json +7 -0
- package/src/translations/locales/ru.json +7 -0
- package/src/translations/locales/th.json +7 -0
- package/src/translations/locales/tr.json +7 -0
- package/src/translations/locales/zh.json +7 -0
- package/dist/module/lib/Components/symbols/icons/Apex.js +0 -49
- package/dist/module/lib/Components/symbols/icons/Apex.js.map +0 -1
- package/dist/module/lib/Components/symbols/icons/BellNotification.js +0 -91
- package/dist/module/lib/Components/symbols/icons/BellNotification.js.map +0 -1
- package/dist/module/lib/Components/symbols/icons/Charon.js.map +0 -1
- package/dist/module/lib/Components/symbols/icons/ShieldCheckNotification.js +0 -82
- package/dist/module/lib/Components/symbols/icons/ShieldCheckNotification.js.map +0 -1
- package/dist/typescript/src/lib/Components/symbols/icons/Apex.d.ts +0 -35
- package/dist/typescript/src/lib/Components/symbols/icons/Apex.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/symbols/icons/BellNotification.d.ts +0 -35
- package/dist/typescript/src/lib/Components/symbols/icons/BellNotification.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/symbols/icons/Charon.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/symbols/icons/ShieldCheckNotification.d.ts +0 -35
- package/dist/typescript/src/lib/Components/symbols/icons/ShieldCheckNotification.d.ts.map +0 -1
- package/src/lib/Components/symbols/icons/Apex.tsx +0 -44
- package/src/lib/Components/symbols/icons/BellNotification.tsx +0 -75
- package/src/lib/Components/symbols/icons/ShieldCheckNotification.tsx +0 -67
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import CryptoIcon from '@ledgerhq/crypto-icons/native';
|
|
3
|
+
import { MediaImageGroup } from './MediaImageGroup';
|
|
4
|
+
|
|
5
|
+
const imports = [
|
|
6
|
+
"import { MediaImageGroup } from '@ledgerhq/lumen-ui-rnative'",
|
|
7
|
+
"import CryptoIcon from '@ledgerhq/crypto-icons/native'",
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
figma.connect(
|
|
11
|
+
MediaImageGroup,
|
|
12
|
+
'https://www.figma.com/design/UCnMvFYyI50pCA2yJEcpXt?node-id=7970-737',
|
|
13
|
+
{
|
|
14
|
+
imports,
|
|
15
|
+
props: {
|
|
16
|
+
data: figma.enum('amount', {
|
|
17
|
+
'2': [
|
|
18
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
19
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
20
|
+
],
|
|
21
|
+
'3': [
|
|
22
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
23
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
24
|
+
{ id: 'solana', ledgerId: 'solana', ticker: 'SOL' },
|
|
25
|
+
],
|
|
26
|
+
'4': [
|
|
27
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
28
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
29
|
+
{ id: 'solana', ledgerId: 'solana', ticker: 'SOL' },
|
|
30
|
+
{ id: 'cardano', ledgerId: 'cardano', ticker: 'ADA' },
|
|
31
|
+
],
|
|
32
|
+
'4+': [
|
|
33
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
34
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
35
|
+
{ id: 'solana', ledgerId: 'solana', ticker: 'SOL' },
|
|
36
|
+
{ id: 'cardano', ledgerId: 'cardano', ticker: 'ADA' },
|
|
37
|
+
{ id: 'polkadot', ledgerId: 'polkadot', ticker: 'DOT' },
|
|
38
|
+
{ id: 'ripple', ledgerId: 'ripple', ticker: 'XRP' },
|
|
39
|
+
{ id: 'dogecoin', ledgerId: 'dogecoin', ticker: 'DOGE' },
|
|
40
|
+
{ id: 'litecoin', ledgerId: 'litecoin', ticker: 'LTC' },
|
|
41
|
+
{ id: 'tron', ledgerId: 'tron', ticker: 'TRX' },
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
disabled: figma.enum('state', { disabled: true }),
|
|
45
|
+
},
|
|
46
|
+
example: (props) => (
|
|
47
|
+
<MediaImageGroup
|
|
48
|
+
disabled={props.disabled}
|
|
49
|
+
size={16} // replace with your desired size 16, 24, 32, 40
|
|
50
|
+
shape='circle' // square, circle
|
|
51
|
+
data={props.data}
|
|
52
|
+
renderItem={(asset, { size, shape }) => (
|
|
53
|
+
<CryptoIcon
|
|
54
|
+
ledgerId={asset.ledgerId}
|
|
55
|
+
ticker={asset.ticker}
|
|
56
|
+
size={size}
|
|
57
|
+
shape={shape}
|
|
58
|
+
disabled={props.disabled}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
figma.connect(
|
|
67
|
+
MediaImageGroup,
|
|
68
|
+
'https://www.figma.com/design/UCnMvFYyI50pCA2yJEcpXt?node-id=6330-1183',
|
|
69
|
+
{
|
|
70
|
+
imports,
|
|
71
|
+
props: {
|
|
72
|
+
data: figma.enum('amount', {
|
|
73
|
+
'2': [
|
|
74
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
75
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
76
|
+
],
|
|
77
|
+
'3': [
|
|
78
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
79
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
80
|
+
{ id: 'bsc', ledgerId: 'bsc', ticker: 'BNB' },
|
|
81
|
+
],
|
|
82
|
+
'4': [
|
|
83
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
84
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
85
|
+
{ id: 'bsc', ledgerId: 'bsc', ticker: 'BNB' },
|
|
86
|
+
{ id: 'algorand', ledgerId: 'algorand', ticker: 'ALGO' },
|
|
87
|
+
],
|
|
88
|
+
'4+': [
|
|
89
|
+
{ id: 'bitcoin', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
90
|
+
{ id: 'ethereum', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
91
|
+
{ id: 'bsc', ledgerId: 'bsc', ticker: 'BNB' },
|
|
92
|
+
{ id: 'algorand', ledgerId: 'algorand', ticker: 'ALGO' },
|
|
93
|
+
{ id: 'bitcoin_cash', ledgerId: 'bitcoin_cash', ticker: 'BCH' },
|
|
94
|
+
{ id: 'polkadot', ledgerId: 'polkadot', ticker: 'DOT' },
|
|
95
|
+
{ id: 'cosmos', ledgerId: 'cosmos', ticker: 'ATOM' },
|
|
96
|
+
{ id: 'solana', ledgerId: 'solana', ticker: 'SOL' },
|
|
97
|
+
{ id: 'tron', ledgerId: 'tron', ticker: 'TRX' },
|
|
98
|
+
],
|
|
99
|
+
}),
|
|
100
|
+
disabled: figma.enum('state', { disabled: true }),
|
|
101
|
+
},
|
|
102
|
+
example: (props) => (
|
|
103
|
+
<MediaImageGroup
|
|
104
|
+
size={16} // replace with the correct size 12, 16, 20, 24, 32, 40, 48, 56, 64, 72
|
|
105
|
+
shape='square' // square, circle
|
|
106
|
+
data={props.data}
|
|
107
|
+
renderItem={(network, { size, shape }) => (
|
|
108
|
+
<CryptoIcon
|
|
109
|
+
ledgerId={network.ledgerId}
|
|
110
|
+
ticker={network.ticker}
|
|
111
|
+
size={size}
|
|
112
|
+
shape={shape}
|
|
113
|
+
disabled={props.disabled}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
116
|
+
/>
|
|
117
|
+
),
|
|
118
|
+
},
|
|
119
|
+
);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls, Source } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as MediaImageGroupStories from './MediaImageGroup.stories';
|
|
3
|
+
import { CustomTabs, Tab } from '../../../../../.storybook/components';
|
|
4
|
+
|
|
5
|
+
<Meta title='Core/MediaImageGroup' of={MediaImageGroupStories} />
|
|
6
|
+
|
|
7
|
+
# MediaImageGroup
|
|
8
|
+
|
|
9
|
+
<CustomTabs>
|
|
10
|
+
<Tab label="Overview">
|
|
11
|
+
|
|
12
|
+
## Introduction
|
|
13
|
+
|
|
14
|
+
MediaImageGroup displays a stack of overlapping media images. When there are more items than `maxVisible`, the last slot becomes a `+N` badge with the number of hidden items.
|
|
15
|
+
|
|
16
|
+
## Anatomy
|
|
17
|
+
|
|
18
|
+
<Canvas of={MediaImageGroupStories.Base} />
|
|
19
|
+
|
|
20
|
+
- **Slot**: Ring around each item, sized by the group
|
|
21
|
+
- **Item**: A `MediaImage`, or the element returned by `renderItem`
|
|
22
|
+
- **Overflow badge**: `+N` slot shown when the data exceeds `maxVisible`
|
|
23
|
+
|
|
24
|
+
## Properties
|
|
25
|
+
|
|
26
|
+
### Overview
|
|
27
|
+
|
|
28
|
+
<Canvas of={MediaImageGroupStories.Base} />
|
|
29
|
+
<Controls of={MediaImageGroupStories.Base} />
|
|
30
|
+
|
|
31
|
+
### Custom items
|
|
32
|
+
|
|
33
|
+
Pass `renderItem` to render something other than a `MediaImage`, such as a **crypto icon**, and forward the `size` and `shape` it receives.
|
|
34
|
+
|
|
35
|
+
<Canvas of={MediaImageGroupStories.WithRenderItem} />
|
|
36
|
+
|
|
37
|
+
### Sizes
|
|
38
|
+
|
|
39
|
+
The group owns the size of every item. Overlap scales with it.
|
|
40
|
+
|
|
41
|
+
<Canvas of={MediaImageGroupStories.SizeShowcase} />
|
|
42
|
+
|
|
43
|
+
### Shapes
|
|
44
|
+
|
|
45
|
+
<Canvas of={MediaImageGroupStories.ShapeShowcase} />
|
|
46
|
+
|
|
47
|
+
### Overflow
|
|
48
|
+
|
|
49
|
+
`maxVisible` counts the overflow badge. With `maxVisible={4}` and 6 items, 3 items and a `+3` badge are displayed. The badge reads `99+` beyond 99 hidden items.
|
|
50
|
+
|
|
51
|
+
<Canvas of={MediaImageGroupStories.WithOverflow} />
|
|
52
|
+
|
|
53
|
+
### Disabled
|
|
54
|
+
|
|
55
|
+
Set `disabled` to dim the items and the `+N` badge. Custom items rendered with `renderItem` inherit it.
|
|
56
|
+
|
|
57
|
+
<Canvas of={MediaImageGroupStories.Disabled} />
|
|
58
|
+
|
|
59
|
+
To dim a single item, set `disabled` on that item in `data`. The `+N` badge and the other items stay enabled.
|
|
60
|
+
|
|
61
|
+
<Canvas of={MediaImageGroupStories.DisabledItem} />
|
|
62
|
+
|
|
63
|
+
### Fallback and loading
|
|
64
|
+
|
|
65
|
+
Each item accepts the `MediaImage` fallback and loading props.
|
|
66
|
+
|
|
67
|
+
<Canvas of={MediaImageGroupStories.WithFallback} />
|
|
68
|
+
|
|
69
|
+
## Accessibility
|
|
70
|
+
|
|
71
|
+
- Each item keeps the accessibility of the element it renders, so give every item a meaningful `alt`.
|
|
72
|
+
- Forward an `accessibilityLabel` to the root to describe the group.
|
|
73
|
+
|
|
74
|
+
</Tab>
|
|
75
|
+
<Tab label="Implementation">
|
|
76
|
+
|
|
77
|
+
## Setup
|
|
78
|
+
|
|
79
|
+
Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
|
|
80
|
+
|
|
81
|
+
### Basic Usage
|
|
82
|
+
|
|
83
|
+
<Source of={MediaImageGroupStories.Base} />
|
|
84
|
+
|
|
85
|
+
### Custom items
|
|
86
|
+
|
|
87
|
+
Pass `renderItem` to render something other than a `MediaImage`, such as a crypto icon. Forward the `size` and `shape` it receives so the overlap and the overflow badge stay consistent.
|
|
88
|
+
|
|
89
|
+
<Source of={MediaImageGroupStories.WithRenderItem} type='code' />
|
|
90
|
+
|
|
91
|
+
### Item keys
|
|
92
|
+
|
|
93
|
+
To set a stable React key, pass an `id` in each `data` item. When omitted, the index is used. Items rendered with `renderItem` are keyed by index.
|
|
94
|
+
|
|
95
|
+
</Tab>
|
|
96
|
+
</CustomTabs>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import CryptoIcon from '@ledgerhq/crypto-icons/native';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
3
|
+
import { Box } from '../../primitives';
|
|
4
|
+
import { MediaImageGroup } from './MediaImageGroup';
|
|
5
|
+
import type { MediaImageGroupItem } from './types';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: MediaImageGroup,
|
|
9
|
+
id: 'rnative-mediaimagegroup',
|
|
10
|
+
title: 'Core/MediaImageGroup',
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
source: {
|
|
14
|
+
language: 'tsx',
|
|
15
|
+
format: true,
|
|
16
|
+
type: 'code',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
} satisfies Meta<typeof MediaImageGroup>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof MediaImageGroup>;
|
|
24
|
+
|
|
25
|
+
const assets = [
|
|
26
|
+
{ id: 'btc', src: 'https://crypto-icons.ledger.com/BTC.png', alt: 'Bitcoin' },
|
|
27
|
+
{
|
|
28
|
+
id: 'eth',
|
|
29
|
+
src: 'https://crypto-icons.ledger.com/ETH.png',
|
|
30
|
+
alt: 'Ethereum',
|
|
31
|
+
},
|
|
32
|
+
{ id: 'ada', src: 'https://crypto-icons.ledger.com/ADA.png', alt: 'Cardano' },
|
|
33
|
+
{ id: 'sol', src: 'https://crypto-icons.ledger.com/SOL.png', alt: 'Solana' },
|
|
34
|
+
{
|
|
35
|
+
id: 'dot',
|
|
36
|
+
src: 'https://crypto-icons.ledger.com/DOT.png',
|
|
37
|
+
alt: 'Polkadot',
|
|
38
|
+
},
|
|
39
|
+
{ id: 'xrp', src: 'https://crypto-icons.ledger.com/XRP.png', alt: 'XRP' },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const fallbackItems: MediaImageGroupItem[] = [
|
|
43
|
+
{ id: 'btc', fallback: 'Bitcoin' },
|
|
44
|
+
{ id: 'eth', fallback: 'Ethereum' },
|
|
45
|
+
{ id: 'loading', loading: true },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export const Base: Story = {
|
|
49
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
50
|
+
args: {
|
|
51
|
+
data: [
|
|
52
|
+
{
|
|
53
|
+
id: 'btc',
|
|
54
|
+
src: 'https://crypto-icons.ledger.com/BTC.png',
|
|
55
|
+
alt: 'Bitcoin',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'eth',
|
|
59
|
+
src: 'https://crypto-icons.ledger.com/ETH.png',
|
|
60
|
+
alt: 'Ethereum',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'ada',
|
|
64
|
+
src: 'https://crypto-icons.ledger.com/ADA.png',
|
|
65
|
+
alt: 'Cardano',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
size: 32,
|
|
69
|
+
shape: 'circle',
|
|
70
|
+
maxVisible: 4,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const SizeShowcase: Story = {
|
|
75
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
76
|
+
render: () => (
|
|
77
|
+
<Box lx={{ gap: 's16' }}>
|
|
78
|
+
<MediaImageGroup data={assets} size={12} />
|
|
79
|
+
<MediaImageGroup data={assets} size={16} />
|
|
80
|
+
<MediaImageGroup data={assets} size={20} />
|
|
81
|
+
<MediaImageGroup data={assets} size={24} />
|
|
82
|
+
<MediaImageGroup data={assets} size={32} />
|
|
83
|
+
<MediaImageGroup data={assets} size={40} />
|
|
84
|
+
<MediaImageGroup data={assets} size={48} />
|
|
85
|
+
<MediaImageGroup data={assets} size={56} />
|
|
86
|
+
<MediaImageGroup data={assets} size={64} />
|
|
87
|
+
<MediaImageGroup data={assets} size={72} />
|
|
88
|
+
</Box>
|
|
89
|
+
),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const ShapeShowcase: Story = {
|
|
93
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
94
|
+
render: () => (
|
|
95
|
+
<Box lx={{ gap: 's24' }}>
|
|
96
|
+
<MediaImageGroup data={assets} size={40} shape='circle' />
|
|
97
|
+
<MediaImageGroup data={assets} size={40} shape='square' />
|
|
98
|
+
</Box>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const WithOverflow: Story = {
|
|
103
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
104
|
+
render: () => (
|
|
105
|
+
<Box lx={{ gap: 's24' }}>
|
|
106
|
+
<MediaImageGroup data={assets.slice(0, 4)} maxVisible={4} />
|
|
107
|
+
<MediaImageGroup data={assets} maxVisible={4} />
|
|
108
|
+
<MediaImageGroup data={assets} maxVisible={3} />
|
|
109
|
+
</Box>
|
|
110
|
+
),
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const Disabled: Story = {
|
|
114
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
115
|
+
args: { data: assets, maxVisible: 4, disabled: true },
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const DisabledItem: Story = {
|
|
119
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
120
|
+
args: {
|
|
121
|
+
data: assets.map((asset) => ({ ...asset, disabled: asset.id === 'eth' })),
|
|
122
|
+
maxVisible: 4,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const WithFallback: Story = {
|
|
127
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
128
|
+
args: { data: fallbackItems },
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const WithRenderItem: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<MediaImageGroup
|
|
134
|
+
data={[
|
|
135
|
+
{ id: 'btc', ledgerId: 'bitcoin', ticker: 'BTC' },
|
|
136
|
+
{ id: 'eth', ledgerId: 'ethereum', ticker: 'ETH' },
|
|
137
|
+
{ id: 'ada', ledgerId: 'cardano', ticker: 'ADA' },
|
|
138
|
+
{ id: 'sol', ledgerId: 'solana', ticker: 'SOL' },
|
|
139
|
+
{ id: 'dot', ledgerId: 'polkadot', ticker: 'DOT' },
|
|
140
|
+
{ id: 'xrp', ledgerId: 'ripple', ticker: 'XRP' },
|
|
141
|
+
]}
|
|
142
|
+
size={40}
|
|
143
|
+
maxVisible={4}
|
|
144
|
+
renderItem={(asset, { size, shape }) => (
|
|
145
|
+
<CryptoIcon
|
|
146
|
+
ledgerId={asset.ledgerId}
|
|
147
|
+
ticker={asset.ticker}
|
|
148
|
+
size={size}
|
|
149
|
+
shape={shape}
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
152
|
+
/>
|
|
153
|
+
),
|
|
154
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
|
+
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
4
|
+
import { render } from '@testing-library/react-native';
|
|
5
|
+
import { Text } from 'react-native';
|
|
6
|
+
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
|
+
import { MediaImageGroup } from './MediaImageGroup';
|
|
8
|
+
|
|
9
|
+
const TestWrapper = ({ children }: { children: React.ReactNode }) => (
|
|
10
|
+
<ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
|
|
11
|
+
{children}
|
|
12
|
+
</ThemeProvider>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const DisabledProbe = () => {
|
|
16
|
+
const disabled = useDisabledContext({ consumerName: 'DisabledProbe' });
|
|
17
|
+
return <Text>{disabled ? 'disabled' : 'enabled'}</Text>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const items = (count: number) =>
|
|
21
|
+
Array.from({ length: count }, (_, i) => ({
|
|
22
|
+
id: `item-${i}`,
|
|
23
|
+
alt: `item-${i}`,
|
|
24
|
+
fallback: 'A',
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
describe('MediaImageGroup', () => {
|
|
28
|
+
describe('Rendering', () => {
|
|
29
|
+
it('should render every item and no badge within maxVisible', () => {
|
|
30
|
+
const { getAllByLabelText, queryByText } = render(
|
|
31
|
+
<TestWrapper>
|
|
32
|
+
<MediaImageGroup data={items(3)} maxVisible={4} />
|
|
33
|
+
</TestWrapper>,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
expect(getAllByLabelText(/^item-/)).toHaveLength(3);
|
|
37
|
+
expect(queryByText(/^\+/)).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should render the overflow badge within the maxVisible budget', () => {
|
|
41
|
+
const { getAllByLabelText, getByText } = render(
|
|
42
|
+
<TestWrapper>
|
|
43
|
+
<MediaImageGroup data={items(10)} maxVisible={4} />
|
|
44
|
+
</TestWrapper>,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
expect(getAllByLabelText(/^item-/)).toHaveLength(3);
|
|
48
|
+
expect(getByText('+7')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should render nothing when data is empty', () => {
|
|
52
|
+
const { toJSON } = render(
|
|
53
|
+
<TestWrapper>
|
|
54
|
+
<MediaImageGroup data={[]} testID='group' />
|
|
55
|
+
</TestWrapper>,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(toJSON()).toBeNull();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should not forward the item id to the rendered media image', () => {
|
|
62
|
+
const { getByLabelText } = render(
|
|
63
|
+
<TestWrapper>
|
|
64
|
+
<MediaImageGroup
|
|
65
|
+
data={[{ id: 'btc', alt: 'Bitcoin', fallback: 'B' }]}
|
|
66
|
+
/>
|
|
67
|
+
</TestWrapper>,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
expect(getByLabelText('Bitcoin').props.id).toBeUndefined();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe('renderItem', () => {
|
|
75
|
+
it('should pass the group size and shape to renderItem', () => {
|
|
76
|
+
const contexts: unknown[] = [];
|
|
77
|
+
const { getByText } = render(
|
|
78
|
+
<TestWrapper>
|
|
79
|
+
<MediaImageGroup
|
|
80
|
+
data={[{ id: 'btc' }, { id: 'eth' }]}
|
|
81
|
+
size={24}
|
|
82
|
+
shape='square'
|
|
83
|
+
renderItem={(item, context) => {
|
|
84
|
+
contexts.push(context);
|
|
85
|
+
return <Text>{item.id}</Text>;
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
</TestWrapper>,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect(getByText('btc')).toBeTruthy();
|
|
92
|
+
expect(getByText('eth')).toBeTruthy();
|
|
93
|
+
expect(contexts).toEqual([
|
|
94
|
+
{ size: 24, shape: 'square' },
|
|
95
|
+
{ size: 24, shape: 'square' },
|
|
96
|
+
]);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should only render the visible items', () => {
|
|
100
|
+
const { getByText, queryByText } = render(
|
|
101
|
+
<TestWrapper>
|
|
102
|
+
<MediaImageGroup
|
|
103
|
+
data={Array.from({ length: 6 }, (_, i) => ({ id: `asset-${i}` }))}
|
|
104
|
+
maxVisible={3}
|
|
105
|
+
renderItem={(item) => <Text>{item.id}</Text>}
|
|
106
|
+
/>
|
|
107
|
+
</TestWrapper>,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
expect(getByText('asset-0')).toBeTruthy();
|
|
111
|
+
expect(getByText('asset-1')).toBeTruthy();
|
|
112
|
+
expect(queryByText('asset-2')).toBeNull();
|
|
113
|
+
expect(getByText('+4')).toBeTruthy();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('Props', () => {
|
|
118
|
+
it('should forward testID to the root', () => {
|
|
119
|
+
const { getByTestId } = render(
|
|
120
|
+
<TestWrapper>
|
|
121
|
+
<MediaImageGroup data={items(2)} testID='group' />
|
|
122
|
+
</TestWrapper>,
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(getByTestId('group')).toBeTruthy();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should forward overflowTestID to the overflow badge', () => {
|
|
129
|
+
const { getByTestId } = render(
|
|
130
|
+
<TestWrapper>
|
|
131
|
+
<MediaImageGroup
|
|
132
|
+
data={items(10)}
|
|
133
|
+
maxVisible={4}
|
|
134
|
+
overflowTestID='overflow'
|
|
135
|
+
/>
|
|
136
|
+
</TestWrapper>,
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
expect(getByTestId('overflow')).toBeTruthy();
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe('Disabled', () => {
|
|
144
|
+
it('should dim the overflow badge when disabled', () => {
|
|
145
|
+
const { getByTestId } = render(
|
|
146
|
+
<TestWrapper>
|
|
147
|
+
<MediaImageGroup
|
|
148
|
+
data={items(10)}
|
|
149
|
+
maxVisible={4}
|
|
150
|
+
disabled
|
|
151
|
+
overflowTestID='overflow'
|
|
152
|
+
/>
|
|
153
|
+
</TestWrapper>,
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
expect(getByTestId('overflow')).toHaveStyle({ opacity: 0.3 });
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('should not dim the overflow badge by default', () => {
|
|
160
|
+
const { getByTestId } = render(
|
|
161
|
+
<TestWrapper>
|
|
162
|
+
<MediaImageGroup
|
|
163
|
+
data={items(10)}
|
|
164
|
+
maxVisible={4}
|
|
165
|
+
overflowTestID='overflow'
|
|
166
|
+
/>
|
|
167
|
+
</TestWrapper>,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
expect(getByTestId('overflow')).not.toHaveStyle({ opacity: 0.3 });
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('should provide the disabled state to custom items', () => {
|
|
174
|
+
const { getByText } = render(
|
|
175
|
+
<TestWrapper>
|
|
176
|
+
<MediaImageGroup
|
|
177
|
+
data={[{ id: 'btc' }]}
|
|
178
|
+
disabled
|
|
179
|
+
renderItem={() => <DisabledProbe />}
|
|
180
|
+
/>
|
|
181
|
+
</TestWrapper>,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
expect(getByText('disabled')).toBeTruthy();
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
describe('Types', () => {
|
|
189
|
+
it('should require renderItem when data is not MediaImageGroupItem[]', () => {
|
|
190
|
+
const assets = [{ ticker: 'BTC' }];
|
|
191
|
+
|
|
192
|
+
// Compile-time only: a `@ts-expect-error` fails typecheck if the union
|
|
193
|
+
// stops rejecting the line below it.
|
|
194
|
+
const typeChecks = () => (
|
|
195
|
+
<>
|
|
196
|
+
<MediaImageGroup data={[{ src: 'btc.png', alt: 'Bitcoin' }]} />
|
|
197
|
+
<MediaImageGroup
|
|
198
|
+
data={assets}
|
|
199
|
+
renderItem={(asset) => <Text>{asset.ticker}</Text>}
|
|
200
|
+
/>
|
|
201
|
+
{/* @ts-expect-error custom data requires renderItem */}
|
|
202
|
+
<MediaImageGroup data={assets} />
|
|
203
|
+
{/* @ts-expect-error excess property on an inline MediaImage item */}
|
|
204
|
+
<MediaImageGroup
|
|
205
|
+
data={[{ src: 'btc.png', alt: 'Bitcoin', ticker: 'BTC' }]}
|
|
206
|
+
/>
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
expect(typeChecks).toBeDefined();
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|