@ledgerhq/lumen-ui-rnative 0.1.69 → 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.stories.js +1 -1
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.mdx +6 -0
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.js +96 -22
- package/dist/module/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.js.map +1 -1
- 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 +1 -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/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/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 +1 -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/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 +8 -8
- 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/MediaImageGroup/MediaImageGroup.mdx +6 -0
- package/src/lib/Components/core/MediaImageGroup/MediaImageGroup.stories.tsx +47 -15
- 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 +1 -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/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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import CryptoIcon from '@ledgerhq/crypto-icons/native';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
3
|
import { Box } from '../../primitives';
|
|
3
|
-
import { MediaImage } from '../MediaImage';
|
|
4
4
|
import { MediaImageGroup } from './MediaImageGroup';
|
|
5
5
|
import type { MediaImageGroupItem } from './types';
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ const meta = {
|
|
|
13
13
|
source: {
|
|
14
14
|
language: 'tsx',
|
|
15
15
|
format: true,
|
|
16
|
-
type: '
|
|
16
|
+
type: 'code',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -23,20 +23,20 @@ export default meta;
|
|
|
23
23
|
type Story = StoryObj<typeof MediaImageGroup>;
|
|
24
24
|
|
|
25
25
|
const assets = [
|
|
26
|
-
{ src: 'https://crypto-icons.ledger.com/BTC.png',
|
|
26
|
+
{ id: 'btc', src: 'https://crypto-icons.ledger.com/BTC.png', alt: 'Bitcoin' },
|
|
27
27
|
{
|
|
28
|
-
src: 'https://crypto-icons.ledger.com/ETH.png',
|
|
29
28
|
id: 'eth',
|
|
29
|
+
src: 'https://crypto-icons.ledger.com/ETH.png',
|
|
30
30
|
alt: 'Ethereum',
|
|
31
31
|
},
|
|
32
|
-
{ src: 'https://crypto-icons.ledger.com/ADA.png',
|
|
33
|
-
{ src: 'https://crypto-icons.ledger.com/SOL.png',
|
|
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
34
|
{
|
|
35
|
-
src: 'https://crypto-icons.ledger.com/DOT.png',
|
|
36
35
|
id: 'dot',
|
|
36
|
+
src: 'https://crypto-icons.ledger.com/DOT.png',
|
|
37
37
|
alt: 'Polkadot',
|
|
38
38
|
},
|
|
39
|
-
{ src: 'https://crypto-icons.ledger.com/XRP.png',
|
|
39
|
+
{ id: 'xrp', src: 'https://crypto-icons.ledger.com/XRP.png', alt: 'XRP' },
|
|
40
40
|
];
|
|
41
41
|
|
|
42
42
|
const fallbackItems: MediaImageGroupItem[] = [
|
|
@@ -46,8 +46,25 @@ const fallbackItems: MediaImageGroupItem[] = [
|
|
|
46
46
|
];
|
|
47
47
|
|
|
48
48
|
export const Base: Story = {
|
|
49
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
49
50
|
args: {
|
|
50
|
-
data:
|
|
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
|
+
],
|
|
51
68
|
size: 32,
|
|
52
69
|
shape: 'circle',
|
|
53
70
|
maxVisible: 4,
|
|
@@ -55,7 +72,7 @@ export const Base: Story = {
|
|
|
55
72
|
};
|
|
56
73
|
|
|
57
74
|
export const SizeShowcase: Story = {
|
|
58
|
-
|
|
75
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
59
76
|
render: () => (
|
|
60
77
|
<Box lx={{ gap: 's16' }}>
|
|
61
78
|
<MediaImageGroup data={assets} size={12} />
|
|
@@ -73,7 +90,7 @@ export const SizeShowcase: Story = {
|
|
|
73
90
|
};
|
|
74
91
|
|
|
75
92
|
export const ShapeShowcase: Story = {
|
|
76
|
-
|
|
93
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
77
94
|
render: () => (
|
|
78
95
|
<Box lx={{ gap: 's24' }}>
|
|
79
96
|
<MediaImageGroup data={assets} size={40} shape='circle' />
|
|
@@ -83,7 +100,7 @@ export const ShapeShowcase: Story = {
|
|
|
83
100
|
};
|
|
84
101
|
|
|
85
102
|
export const WithOverflow: Story = {
|
|
86
|
-
|
|
103
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
87
104
|
render: () => (
|
|
88
105
|
<Box lx={{ gap: 's24' }}>
|
|
89
106
|
<MediaImageGroup data={assets.slice(0, 4)} maxVisible={4} />
|
|
@@ -94,10 +111,12 @@ export const WithOverflow: Story = {
|
|
|
94
111
|
};
|
|
95
112
|
|
|
96
113
|
export const Disabled: Story = {
|
|
114
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
97
115
|
args: { data: assets, maxVisible: 4, disabled: true },
|
|
98
116
|
};
|
|
99
117
|
|
|
100
118
|
export const DisabledItem: Story = {
|
|
119
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
101
120
|
args: {
|
|
102
121
|
data: assets.map((asset) => ({ ...asset, disabled: asset.id === 'eth' })),
|
|
103
122
|
maxVisible: 4,
|
|
@@ -105,17 +124,30 @@ export const DisabledItem: Story = {
|
|
|
105
124
|
};
|
|
106
125
|
|
|
107
126
|
export const WithFallback: Story = {
|
|
127
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
108
128
|
args: { data: fallbackItems },
|
|
109
129
|
};
|
|
110
130
|
|
|
111
131
|
export const WithRenderItem: Story = {
|
|
112
|
-
args: { data: assets },
|
|
113
132
|
render: () => (
|
|
114
133
|
<MediaImageGroup
|
|
115
|
-
data={
|
|
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
|
+
]}
|
|
116
142
|
size={40}
|
|
143
|
+
maxVisible={4}
|
|
117
144
|
renderItem={(asset, { size, shape }) => (
|
|
118
|
-
<
|
|
145
|
+
<CryptoIcon
|
|
146
|
+
ledgerId={asset.ledgerId}
|
|
147
|
+
ticker={asset.ticker}
|
|
148
|
+
size={size}
|
|
149
|
+
shape={shape}
|
|
150
|
+
/>
|
|
119
151
|
)}
|
|
120
152
|
/>
|
|
121
153
|
),
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
|
|
29
29
|
### Appearance
|
|
30
30
|
|
|
31
|
-
`MenuListItem` supports two appearances: `base` (default) for standard actions and `red` for irreversible or dangerous operations such as deleting or unlinking. The red appearance renders the label and icon in the error
|
|
31
|
+
`MenuListItem` supports two appearances: `base` (default) for standard actions and `red` for irreversible or dangerous operations such as deleting or unlinking. The red appearance renders the label and icon in the error color.
|
|
32
32
|
|
|
33
33
|
Place `red` items **last** in the list. Both the Apple HIG and Material guidelines put destructive actions at the bottom, away from the items a user reaches for by habit. `MenuList` does not enforce the order.
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ Place `red` items **last** in the list. Both the Apple HIG and Material guidelin
|
|
|
36
36
|
|
|
37
37
|
### Disabled
|
|
38
38
|
|
|
39
|
-
Set `disabled` on individual `MenuListItem`s to prevent interaction. The label and icon are rendered in the disabled
|
|
39
|
+
Set `disabled` on individual `MenuListItem`s to prevent interaction. The label and icon are rendered in the disabled color and the press handler is suppressed.
|
|
40
40
|
|
|
41
41
|
<Canvas of={MenuListStories.DisabledShowcase} />
|
|
42
42
|
|
|
@@ -17,7 +17,7 @@ const meta = {
|
|
|
17
17
|
subcomponents: { MenuListItem, MenuListSwitchItem },
|
|
18
18
|
parameters: {
|
|
19
19
|
docs: {
|
|
20
|
-
source: { language: 'tsx', format: true, type: '
|
|
20
|
+
source: { language: 'tsx', format: true, type: 'code' },
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
} satisfies Meta<typeof MenuList>;
|
|
@@ -41,6 +41,12 @@ export const Base: Story = {
|
|
|
41
41
|
|
|
42
42
|
export const ItemShowcase: StoryObj<typeof MenuListItem> = {
|
|
43
43
|
parameters: {
|
|
44
|
+
docs: { source: { type: 'dynamic' } },
|
|
45
|
+
jsx: {
|
|
46
|
+
functionValue: (fn: unknown) =>
|
|
47
|
+
Object.entries(iconMap).find(([, icon]) => icon === fn)?.[0] ??
|
|
48
|
+
'() => {}',
|
|
49
|
+
},
|
|
44
50
|
layout: 'centered',
|
|
45
51
|
backgrounds: { default: 'light' },
|
|
46
52
|
},
|
|
@@ -89,6 +95,12 @@ export const AppearanceShowcase: Story = {
|
|
|
89
95
|
|
|
90
96
|
export const SwitchItemShowcase: StoryObj<typeof MenuListSwitchItem> = {
|
|
91
97
|
parameters: {
|
|
98
|
+
docs: { source: { type: 'dynamic' } },
|
|
99
|
+
jsx: {
|
|
100
|
+
functionValue: (fn: unknown) =>
|
|
101
|
+
Object.entries(iconMap).find(([, icon]) => icon === fn)?.[0] ??
|
|
102
|
+
'() => {}',
|
|
103
|
+
},
|
|
92
104
|
layout: 'centered',
|
|
93
105
|
backgrounds: { default: 'light' },
|
|
94
106
|
},
|
|
@@ -3,7 +3,7 @@ import { PageIndicator } from './PageIndicator';
|
|
|
3
3
|
|
|
4
4
|
figma.connect(
|
|
5
5
|
PageIndicator,
|
|
6
|
-
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=
|
|
6
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=11227-7095',
|
|
7
7
|
{
|
|
8
8
|
imports: ["import { PageIndicator } from '@ledgerhq/lumen-ui-rnative'"],
|
|
9
9
|
example: () => <PageIndicator currentPage={2} totalPages={5} />,
|
|
@@ -12,6 +12,13 @@ const meta = {
|
|
|
12
12
|
parameters: {
|
|
13
13
|
layout: 'centered',
|
|
14
14
|
backgrounds: { default: 'light' },
|
|
15
|
+
docs: {
|
|
16
|
+
source: {
|
|
17
|
+
language: 'tsx',
|
|
18
|
+
format: true,
|
|
19
|
+
type: 'code',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
15
22
|
},
|
|
16
23
|
argTypes: {
|
|
17
24
|
currentPage: { control: 'number' },
|
|
@@ -24,56 +31,52 @@ export default meta;
|
|
|
24
31
|
type Story = StoryObj<typeof PageIndicator>;
|
|
25
32
|
|
|
26
33
|
export const Base: Story = {
|
|
34
|
+
parameters: { docs: { source: { type: 'dynamic' } } },
|
|
27
35
|
args: {
|
|
28
36
|
currentPage: 1,
|
|
29
37
|
totalPages: 5,
|
|
30
38
|
},
|
|
31
39
|
};
|
|
32
40
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
export const Interactive: Story = {
|
|
42
|
+
render: () => {
|
|
43
|
+
const totalPages = 9;
|
|
44
|
+
const [page, setPage] = useState(1);
|
|
45
|
+
const { theme } = useTheme();
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
>
|
|
47
|
-
<IconButton
|
|
48
|
-
icon={ArrowLeft}
|
|
49
|
-
size='xs'
|
|
50
|
-
accessibilityLabel='Previous page'
|
|
51
|
-
appearance='transparent'
|
|
52
|
-
onPress={() => setPage((v) => Math.max(1, v - 1))}
|
|
53
|
-
/>
|
|
54
|
-
<Text
|
|
55
|
-
lx={{ color: 'base', width: 's28', textAlign: 'center' }}
|
|
56
|
-
style={{ ...theme.typographies.heading2SemiBold }}
|
|
47
|
+
return (
|
|
48
|
+
<Box lx={{ gap: 's16', alignItems: 'center', width: 'full' }}>
|
|
49
|
+
<Box
|
|
50
|
+
lx={{
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
gap: 's16',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
}}
|
|
57
56
|
>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
<IconButton
|
|
58
|
+
icon={ArrowLeft}
|
|
59
|
+
size='xs'
|
|
60
|
+
accessibilityLabel='Previous page'
|
|
61
|
+
appearance='transparent'
|
|
62
|
+
onPress={() => setPage((v) => Math.max(1, v - 1))}
|
|
63
|
+
/>
|
|
64
|
+
<Text
|
|
65
|
+
lx={{ color: 'base', width: 's28', textAlign: 'center' }}
|
|
66
|
+
style={{ ...theme.typographies.heading2SemiBold }}
|
|
67
|
+
>
|
|
68
|
+
{page}
|
|
69
|
+
</Text>
|
|
70
|
+
<IconButton
|
|
71
|
+
icon={ArrowRight}
|
|
72
|
+
size='xs'
|
|
73
|
+
accessibilityLabel='Next page'
|
|
74
|
+
appearance='transparent'
|
|
75
|
+
onPress={() => setPage((v) => Math.min(totalPages, v + 1))}
|
|
76
|
+
/>
|
|
77
|
+
</Box>
|
|
78
|
+
<PageIndicator currentPage={page} totalPages={totalPages} />
|
|
67
79
|
</Box>
|
|
68
|
-
|
|
69
|
-
</Box>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Interactive: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
currentPage: 1,
|
|
76
|
-
totalPages: 9,
|
|
80
|
+
);
|
|
77
81
|
},
|
|
78
|
-
render: (args) => <InteractiveComponent totalPages={args.totalPages} />,
|
|
79
82
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Pagination } from './Pagination';
|
|
3
|
+
|
|
4
|
+
figma.connect(
|
|
5
|
+
Pagination,
|
|
6
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=11768-12849',
|
|
7
|
+
{
|
|
8
|
+
imports: ["import { Pagination } from '@ledgerhq/lumen-ui-rnative'"],
|
|
9
|
+
props: {
|
|
10
|
+
density: figma.enum('content', {
|
|
11
|
+
number: 'expanded',
|
|
12
|
+
text: 'compact',
|
|
13
|
+
none: 'compact',
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
example: (props) => (
|
|
17
|
+
<Pagination
|
|
18
|
+
page={2}
|
|
19
|
+
totalPages={8}
|
|
20
|
+
density={props.density}
|
|
21
|
+
onPageChange={() => {}}
|
|
22
|
+
/>
|
|
23
|
+
),
|
|
24
|
+
},
|
|
25
|
+
);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { CustomTabs, Tab } from '../../../../../.storybook/components';
|
|
3
|
+
import * as PaginationStories from './Pagination.stories';
|
|
4
|
+
|
|
5
|
+
<Meta title='Core/Pagination' of={PaginationStories} />
|
|
6
|
+
|
|
7
|
+
# Pagination
|
|
8
|
+
|
|
9
|
+
<CustomTabs>
|
|
10
|
+
<Tab label="Overview">
|
|
11
|
+
|
|
12
|
+
## Introduction
|
|
13
|
+
|
|
14
|
+
Pagination provides page navigation for lists and other paginated content. It renders previous and next controls, numbered page buttons, and ellipsis markers when the page count is large.
|
|
15
|
+
|
|
16
|
+
Use it as a **standalone** component: wire `page`, `totalPages`, and `onPageChange` from your data layer.
|
|
17
|
+
|
|
18
|
+
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=11768-12849&m=dev).
|
|
19
|
+
|
|
20
|
+
<Canvas of={PaginationStories.Base} />
|
|
21
|
+
<Controls of={PaginationStories.Base} />
|
|
22
|
+
|
|
23
|
+
## Anatomy
|
|
24
|
+
|
|
25
|
+
The Pagination consists of:
|
|
26
|
+
|
|
27
|
+
- **Previous control**: `IconButton` with a chevron left icon; disabled on the first page
|
|
28
|
+
- **Page buttons**: circular buttons for each visible page, in a horizontal scroll area; the active page uses a filled background
|
|
29
|
+
- **Ellipsis**: non-interactive marker when pages are collapsed
|
|
30
|
+
- **Next control**: `IconButton` with a chevron right icon; disabled on the last page
|
|
31
|
+
|
|
32
|
+
In `compact` density, the page buttons and ellipsis are replaced by a "current of total" label.
|
|
33
|
+
|
|
34
|
+
### Few pages
|
|
35
|
+
|
|
36
|
+
When all pages fit in the visible range, every page is shown without ellipsis.
|
|
37
|
+
|
|
38
|
+
<Canvas of={PaginationStories.FewPages} />
|
|
39
|
+
|
|
40
|
+
### First and last page
|
|
41
|
+
|
|
42
|
+
On the first page, the previous control is disabled. On the last page, the next control is disabled.
|
|
43
|
+
|
|
44
|
+
<Canvas of={PaginationStories.FirstPage} />
|
|
45
|
+
|
|
46
|
+
<Canvas of={PaginationStories.LastPage} />
|
|
47
|
+
|
|
48
|
+
### Density
|
|
49
|
+
|
|
50
|
+
Use `density='compact'` where space is tight. It keeps the previous and next controls and shows the current position as a localized "current of total" label instead of page buttons.
|
|
51
|
+
|
|
52
|
+
In `expanded` density, the page buttons scroll horizontally between fixed previous and next controls when they don't fit, and the active page is kept in view. Prefer `compact` when you don't need direct access to each page.
|
|
53
|
+
|
|
54
|
+
<Canvas of={PaginationStories.DensityShowcase} />
|
|
55
|
+
|
|
56
|
+
## Accessibility
|
|
57
|
+
|
|
58
|
+
- The root view exposes an accessible name
|
|
59
|
+
- Previous and next controls expose dedicated `accessibilityLabel`s
|
|
60
|
+
- Each page button has an `accessibilityLabel` and the active page sets `accessibilityState.selected`
|
|
61
|
+
- Ellipsis markers are hidden from assistive technology
|
|
62
|
+
- In `compact` density, the "current of total" label is a polite live region on Android, so page changes are announced
|
|
63
|
+
|
|
64
|
+
</Tab>
|
|
65
|
+
<Tab label="Implementation">
|
|
66
|
+
|
|
67
|
+
## Setup
|
|
68
|
+
|
|
69
|
+
Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
|
|
70
|
+
|
|
71
|
+
## Basic usage
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Pagination } from '@ledgerhq/lumen-ui-rnative';
|
|
75
|
+
import { useState } from 'react';
|
|
76
|
+
|
|
77
|
+
function MyComponent() {
|
|
78
|
+
const [page, setPage] = useState(1);
|
|
79
|
+
const totalPages = 10;
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Pagination page={page} totalPages={totalPages} onPageChange={setPage} />
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Compact
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { Pagination } from '@ledgerhq/lumen-ui-rnative';
|
|
91
|
+
import { useState } from 'react';
|
|
92
|
+
|
|
93
|
+
function MyComponent() {
|
|
94
|
+
const [page, setPage] = useState(1);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Pagination
|
|
98
|
+
page={page}
|
|
99
|
+
totalPages={8}
|
|
100
|
+
density='compact'
|
|
101
|
+
onPageChange={setPage}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
</Tab>
|
|
108
|
+
</CustomTabs>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Box } from '../../primitives/Box';
|
|
4
|
+
import { Pagination } from './Pagination';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
id: 'rnative-pagination',
|
|
8
|
+
title: 'Core/Pagination',
|
|
9
|
+
component: Pagination,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
backgrounds: { default: 'light' },
|
|
13
|
+
docs: { source: { language: 'tsx', format: true, type: 'code' } },
|
|
14
|
+
actions: { disable: true },
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
page: 1,
|
|
18
|
+
totalPages: 10,
|
|
19
|
+
onPageChange: () => {},
|
|
20
|
+
},
|
|
21
|
+
argTypes: {
|
|
22
|
+
page: { control: 'number' },
|
|
23
|
+
totalPages: { control: 'number' },
|
|
24
|
+
siblingCount: { control: 'number' },
|
|
25
|
+
density: { control: 'radio', options: ['expanded', 'compact'] },
|
|
26
|
+
onPageChange: { control: false },
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta<typeof Pagination>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof Pagination>;
|
|
32
|
+
|
|
33
|
+
export const Base: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
page: 5,
|
|
36
|
+
totalPages: 10,
|
|
37
|
+
siblingCount: 1,
|
|
38
|
+
},
|
|
39
|
+
render: (args) => {
|
|
40
|
+
const [page, setPage] = useState(args.page);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setPage(args.page);
|
|
44
|
+
}, [args.page]);
|
|
45
|
+
|
|
46
|
+
return <Pagination {...args} page={page} onPageChange={setPage} />;
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const FewPages: Story = {
|
|
51
|
+
render: () => {
|
|
52
|
+
const [page, setPage] = useState(2);
|
|
53
|
+
|
|
54
|
+
return <Pagination page={page} totalPages={3} onPageChange={setPage} />;
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const FirstPage: Story = {
|
|
59
|
+
render: () => {
|
|
60
|
+
const [page, setPage] = useState(1);
|
|
61
|
+
|
|
62
|
+
return <Pagination page={page} totalPages={20} onPageChange={setPage} />;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const LastPage: Story = {
|
|
67
|
+
render: () => {
|
|
68
|
+
const [page, setPage] = useState(20);
|
|
69
|
+
|
|
70
|
+
return <Pagination page={page} totalPages={20} onPageChange={setPage} />;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const DensityShowcase: Story = {
|
|
75
|
+
render: () => {
|
|
76
|
+
const [page, setPage] = useState(2);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Box lx={{ alignItems: 'center', gap: 's16' }}>
|
|
80
|
+
<Pagination page={page} totalPages={8} onPageChange={setPage} />
|
|
81
|
+
<Pagination
|
|
82
|
+
page={page}
|
|
83
|
+
totalPages={8}
|
|
84
|
+
density='compact'
|
|
85
|
+
onPageChange={setPage}
|
|
86
|
+
/>
|
|
87
|
+
</Box>
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
};
|