@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import figma from '@figma/code-connect';
|
|
4
4
|
import { PageIndicator } from "./PageIndicator.js";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
figma.connect(PageIndicator, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=
|
|
6
|
+
figma.connect(PageIndicator, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=11227-7095', {
|
|
7
7
|
imports: ["import { PageIndicator } from '@ledgerhq/lumen-ui-rnative'"],
|
|
8
8
|
example: () => /*#__PURE__*/_jsx(PageIndicator, {
|
|
9
9
|
currentPage: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","PageIndicator","jsx","_jsx","connect","imports","example","currentPage","totalPages"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/PageIndicator/PageIndicator.figma.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,qBAAqB;AACvC,SAASC,aAAa,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhDH,KAAK,CAACI,OAAO,CACXH,aAAa,EACb,
|
|
1
|
+
{"version":3,"names":["figma","PageIndicator","jsx","_jsx","connect","imports","example","currentPage","totalPages"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/PageIndicator/PageIndicator.figma.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,qBAAqB;AACvC,SAASC,aAAa,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhDH,KAAK,CAACI,OAAO,CACXH,aAAa,EACb,wEAAwE,EACxE;EACEI,OAAO,EAAE,CAAC,4DAA4D,CAAC;EACvEC,OAAO,EAAEA,CAAA,kBAAMH,IAAA,CAACF,aAAa;IAACM,WAAW,EAAE,CAAE;IAACC,UAAU,EAAE;EAAE,CAAE;AAChE,CACF,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,13 @@ const meta = {
|
|
|
14
14
|
layout: 'centered',
|
|
15
15
|
backgrounds: {
|
|
16
16
|
default: 'light'
|
|
17
|
+
},
|
|
18
|
+
docs: {
|
|
19
|
+
source: {
|
|
20
|
+
language: 'tsx',
|
|
21
|
+
format: true,
|
|
22
|
+
type: 'code'
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
},
|
|
19
26
|
argTypes: {
|
|
@@ -27,67 +34,66 @@ const meta = {
|
|
|
27
34
|
};
|
|
28
35
|
export default meta;
|
|
29
36
|
export const Base = {
|
|
37
|
+
parameters: {
|
|
38
|
+
docs: {
|
|
39
|
+
source: {
|
|
40
|
+
type: 'dynamic'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
30
44
|
args: {
|
|
31
45
|
currentPage: 1,
|
|
32
46
|
totalPages: 5
|
|
33
47
|
}
|
|
34
48
|
};
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
lx: {
|
|
44
|
-
gap: 's16',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
width: 'full'
|
|
47
|
-
},
|
|
48
|
-
children: [/*#__PURE__*/_jsxs(Box, {
|
|
49
|
+
export const Interactive = {
|
|
50
|
+
render: () => {
|
|
51
|
+
const totalPages = 9;
|
|
52
|
+
const [page, setPage] = useState(1);
|
|
53
|
+
const {
|
|
54
|
+
theme
|
|
55
|
+
} = useTheme();
|
|
56
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
49
57
|
lx: {
|
|
50
|
-
flexDirection: 'row',
|
|
51
58
|
gap: 's16',
|
|
52
59
|
alignItems: 'center',
|
|
53
|
-
|
|
60
|
+
width: 'full'
|
|
54
61
|
},
|
|
55
|
-
children: [/*#__PURE__*/
|
|
56
|
-
icon: ArrowLeft,
|
|
57
|
-
size: "xs",
|
|
58
|
-
accessibilityLabel: "Previous page",
|
|
59
|
-
appearance: "transparent",
|
|
60
|
-
onPress: () => setPage(v => Math.max(1, v - 1))
|
|
61
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
62
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
62
63
|
lx: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
style: {
|
|
68
|
-
...theme.typographies.heading2SemiBold
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
gap: 's16',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
justifyContent: 'center'
|
|
69
68
|
},
|
|
70
|
-
children:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
70
|
+
icon: ArrowLeft,
|
|
71
|
+
size: "xs",
|
|
72
|
+
accessibilityLabel: "Previous page",
|
|
73
|
+
appearance: "transparent",
|
|
74
|
+
onPress: () => setPage(v => Math.max(1, v - 1))
|
|
75
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
76
|
+
lx: {
|
|
77
|
+
color: 'base',
|
|
78
|
+
width: 's28',
|
|
79
|
+
textAlign: 'center'
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
...theme.typographies.heading2SemiBold
|
|
83
|
+
},
|
|
84
|
+
children: page
|
|
85
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
86
|
+
icon: ArrowRight,
|
|
87
|
+
size: "xs",
|
|
88
|
+
accessibilityLabel: "Next page",
|
|
89
|
+
appearance: "transparent",
|
|
90
|
+
onPress: () => setPage(v => Math.min(totalPages, v + 1))
|
|
91
|
+
})]
|
|
92
|
+
}), /*#__PURE__*/_jsx(PageIndicator, {
|
|
93
|
+
currentPage: page,
|
|
94
|
+
totalPages: totalPages
|
|
77
95
|
})]
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
totalPages: totalPages
|
|
81
|
-
})]
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
export const Interactive = {
|
|
85
|
-
args: {
|
|
86
|
-
currentPage: 1,
|
|
87
|
-
totalPages: 9
|
|
88
|
-
},
|
|
89
|
-
render: args => /*#__PURE__*/_jsx(InteractiveComponent, {
|
|
90
|
-
totalPages: args.totalPages
|
|
91
|
-
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
92
98
|
};
|
|
93
99
|
//# sourceMappingURL=PageIndicator.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","Box","Text","IconButton","useTheme","ArrowLeft","ArrowRight","PageIndicator","jsx","_jsx","jsxs","_jsxs","meta","id","title","component","parameters","layout","backgrounds","default","argTypes","currentPage","control","totalPages","Base","args","
|
|
1
|
+
{"version":3,"names":["useState","Box","Text","IconButton","useTheme","ArrowLeft","ArrowRight","PageIndicator","jsx","_jsx","jsxs","_jsxs","meta","id","title","component","parameters","layout","backgrounds","default","docs","source","language","format","type","argTypes","currentPage","control","totalPages","Base","args","Interactive","render","page","setPage","theme","lx","gap","alignItems","width","children","flexDirection","justifyContent","icon","size","accessibilityLabel","appearance","onPress","v","Math","max","color","textAlign","style","typographies","heading2SemiBold","min"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/PageIndicator/PageIndicator.stories.tsx"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,GAAG,EAAEC,IAAI,EAAEC,UAAU,QAAQ,gBAAO;AAC7C,SAASC,QAAQ,QAAQ,6BAAoB;AAC7C,SAASC,SAAS,EAAEC,UAAU,QAAQ,wBAAe;AACrD,SAASC,aAAa,QAAQ,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AAK;UACVC,UAAU,EAAE,QAAQ;UACpBI,cAAc,EAAE;QAClB,CAAE;QAAAF,QAAA,gBAEF/B,IAAA,CAACN,UAAU;UACTwC,IAAI,EAAEtC,SAAU;UAChBuC,IAAI,EAAC,IAAI;UACTC,kBAAkB,EAAC,eAAe;UAClCC,UAAU,EAAC,aAAa;UACxBC,OAAO,EAAEA,CAAA,KAAMb,OAAO,CAAEc,CAAC,IAAKC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEF,CAAC,GAAG,CAAC,CAAC;QAAE,CACnD,CAAC,eACFvC,IAAA,CAACP,IAAI;UACHkC,EAAE,EAAE;YAAEe,KAAK,EAAE,MAAM;YAAEZ,KAAK,EAAE,KAAK;YAAEa,SAAS,EAAE;UAAS,CAAE;UACzDC,KAAK,EAAE;YAAE,GAAGlB,KAAK,CAACmB,YAAY,CAACC;UAAiB,CAAE;UAAAf,QAAA,EAEjDP;QAAI,CACD,CAAC,eACPxB,IAAA,CAACN,UAAU;UACTwC,IAAI,EAAErC,UAAW;UACjBsC,IAAI,EAAC,IAAI;UACTC,kBAAkB,EAAC,WAAW;UAC9BC,UAAU,EAAC,aAAa;UACxBC,OAAO,EAAEA,CAAA,KAAMb,OAAO,CAAEc,CAAC,IAAKC,IAAI,CAACO,GAAG,CAAC5B,UAAU,EAAEoB,CAAC,GAAG,CAAC,CAAC;QAAE,CAC5D,CAAC;MAAA,CACC,CAAC,eACNvC,IAAA,CAACF,aAAa;QAACmB,WAAW,EAAEO,IAAK;QAACL,UAAU,EAAEA;MAAW,CAAE,CAAC;IAAA,CACzD,CAAC;EAEV;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import figma from '@figma/code-connect';
|
|
4
|
+
import { Pagination } from "./Pagination.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
figma.connect(Pagination, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=11768-12849', {
|
|
7
|
+
imports: ["import { Pagination } from '@ledgerhq/lumen-ui-rnative'"],
|
|
8
|
+
props: {
|
|
9
|
+
density: figma.enum('content', {
|
|
10
|
+
number: 'expanded',
|
|
11
|
+
text: 'compact',
|
|
12
|
+
none: 'compact'
|
|
13
|
+
})
|
|
14
|
+
},
|
|
15
|
+
example: props => /*#__PURE__*/_jsx(Pagination, {
|
|
16
|
+
page: 2,
|
|
17
|
+
totalPages: 8,
|
|
18
|
+
density: props.density,
|
|
19
|
+
onPageChange: () => {}
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=Pagination.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","Pagination","jsx","_jsx","connect","imports","props","density","enum","number","text","none","example","page","totalPages","onPageChange"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/Pagination/Pagination.figma.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,qBAAqB;AACvC,SAASC,UAAU,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1CH,KAAK,CAACI,OAAO,CACXH,UAAU,EACV,yEAAyE,EACzE;EACEI,OAAO,EAAE,CAAC,yDAAyD,CAAC;EACpEC,KAAK,EAAE;IACLC,OAAO,EAAEP,KAAK,CAACQ,IAAI,CAAC,SAAS,EAAE;MAC7BC,MAAM,EAAE,UAAU;MAClBC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAE;IACR,CAAC;EACH,CAAC;EACDC,OAAO,EAAGN,KAAK,iBACbH,IAAA,CAACF,UAAU;IACTY,IAAI,EAAE,CAAE;IACRC,UAAU,EAAE,CAAE;IACdP,OAAO,EAAED,KAAK,CAACC,OAAQ;IACvBQ,YAAY,EAAEA,CAAA,KAAM,CAAC;EAAE,CACxB;AAEL,CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getPaginationRange } from '@ledgerhq/lumen-utils-shared';
|
|
4
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
5
|
+
import { ScrollView } from 'react-native';
|
|
6
|
+
import { useStyleSheet } from "../../../../styles/index.js";
|
|
7
|
+
import { useCommonTranslation } from "../../../../translations/index.js";
|
|
8
|
+
import { Box } from "../../primitives/Box/index.js";
|
|
9
|
+
import { Text } from "../../primitives/Text/index.js";
|
|
10
|
+
import { ChevronLeft, ChevronRight } from "../../symbols/index.js";
|
|
11
|
+
import { Button } from "../Button/index.js";
|
|
12
|
+
import { IconButton } from "../IconButton/index.js";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const usePaginationStyles = () => useStyleSheet(t => ({
|
|
15
|
+
root: {
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
maxWidth: '100%',
|
|
19
|
+
gap: t.spacings.s8,
|
|
20
|
+
padding: t.spacings.s4
|
|
21
|
+
},
|
|
22
|
+
scroll: {
|
|
23
|
+
flexGrow: 0,
|
|
24
|
+
flexShrink: 1
|
|
25
|
+
},
|
|
26
|
+
scrollContent: {
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
gap: t.spacings.s8
|
|
30
|
+
},
|
|
31
|
+
pageOfTotal: {
|
|
32
|
+
...t.typographies.body2SemiBold,
|
|
33
|
+
color: t.colors.text.base,
|
|
34
|
+
paddingHorizontal: t.spacings.s4
|
|
35
|
+
},
|
|
36
|
+
ellipsis: {
|
|
37
|
+
width: t.sizes.s40,
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center'
|
|
40
|
+
},
|
|
41
|
+
ellipsisText: {
|
|
42
|
+
...t.typographies.body2,
|
|
43
|
+
color: t.colors.text.muted
|
|
44
|
+
}
|
|
45
|
+
}), []);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Keeps the active page centered in the scrollable range, so navigating with
|
|
49
|
+
* the arrows never leaves it off-screen.
|
|
50
|
+
*/
|
|
51
|
+
const useScrollToActivePage = activePage => {
|
|
52
|
+
const scrollRef = useRef(null);
|
|
53
|
+
const viewportWidth = useRef(0);
|
|
54
|
+
const pageLayouts = useRef(new Map());
|
|
55
|
+
const scrollToActivePage = useCallback(() => {
|
|
56
|
+
const layout = pageLayouts.current.get(activePage);
|
|
57
|
+
if (!layout || !viewportWidth.current) return;
|
|
58
|
+
scrollRef.current?.scrollTo({
|
|
59
|
+
x: Math.max(0, layout.x + layout.width / 2 - viewportWidth.current / 2),
|
|
60
|
+
animated: false
|
|
61
|
+
});
|
|
62
|
+
}, [activePage]);
|
|
63
|
+
useEffect(scrollToActivePage, [scrollToActivePage]);
|
|
64
|
+
const onViewportLayout = event => {
|
|
65
|
+
viewportWidth.current = event.nativeEvent.layout.width;
|
|
66
|
+
scrollToActivePage();
|
|
67
|
+
};
|
|
68
|
+
const onPageLayout = (page, event) => {
|
|
69
|
+
pageLayouts.current.set(page, event.nativeEvent.layout);
|
|
70
|
+
if (page === activePage) scrollToActivePage();
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
scrollRef,
|
|
74
|
+
onViewportLayout,
|
|
75
|
+
onPageLayout
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Pagination navigation for lists and other paginated content.
|
|
81
|
+
*
|
|
82
|
+
* @see [Figma – Pagination](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=11768-12849&m=dev)
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* <Pagination
|
|
86
|
+
* page={page}
|
|
87
|
+
* totalPages={10}
|
|
88
|
+
* onPageChange={setPage}
|
|
89
|
+
* />
|
|
90
|
+
*/
|
|
91
|
+
export const Pagination = ({
|
|
92
|
+
page,
|
|
93
|
+
totalPages,
|
|
94
|
+
onPageChange,
|
|
95
|
+
siblingCount = 1,
|
|
96
|
+
density = 'expanded',
|
|
97
|
+
lx,
|
|
98
|
+
style,
|
|
99
|
+
ref,
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const {
|
|
103
|
+
t
|
|
104
|
+
} = useCommonTranslation();
|
|
105
|
+
const styles = usePaginationStyles();
|
|
106
|
+
const clampedPage = Math.min(Math.max(page, 1), Math.max(totalPages, 1));
|
|
107
|
+
const {
|
|
108
|
+
scrollRef,
|
|
109
|
+
onViewportLayout,
|
|
110
|
+
onPageLayout
|
|
111
|
+
} = useScrollToActivePage(clampedPage);
|
|
112
|
+
if (totalPages <= 0) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const isCompact = density === 'compact';
|
|
116
|
+
const items = isCompact ? [] : getPaginationRange(clampedPage, totalPages, Math.max(siblingCount, 0));
|
|
117
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
118
|
+
ref: ref,
|
|
119
|
+
accessibilityLabel: t('components.pagination.navigationAriaLabel'),
|
|
120
|
+
lx: lx,
|
|
121
|
+
style: [styles.root, style],
|
|
122
|
+
...props,
|
|
123
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
124
|
+
icon: ChevronLeft,
|
|
125
|
+
size: "sm",
|
|
126
|
+
appearance: "gray",
|
|
127
|
+
disabled: clampedPage <= 1,
|
|
128
|
+
accessibilityLabel: t('components.pagination.previousPageAriaLabel'),
|
|
129
|
+
onPress: () => onPageChange(clampedPage - 1)
|
|
130
|
+
}), isCompact && /*#__PURE__*/_jsx(Text, {
|
|
131
|
+
accessibilityLiveRegion: "polite",
|
|
132
|
+
numberOfLines: 1,
|
|
133
|
+
style: styles.pageOfTotal,
|
|
134
|
+
children: t('components.pagination.pageOfTotal', {
|
|
135
|
+
current: clampedPage,
|
|
136
|
+
total: totalPages
|
|
137
|
+
})
|
|
138
|
+
}), !isCompact && /*#__PURE__*/_jsx(ScrollView, {
|
|
139
|
+
ref: scrollRef,
|
|
140
|
+
horizontal: true,
|
|
141
|
+
showsHorizontalScrollIndicator: false,
|
|
142
|
+
style: styles.scroll,
|
|
143
|
+
contentContainerStyle: styles.scrollContent,
|
|
144
|
+
onLayout: onViewportLayout,
|
|
145
|
+
children: items.map(item => {
|
|
146
|
+
if (typeof item === 'string') {
|
|
147
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
148
|
+
importantForAccessibility: "no-hide-descendants",
|
|
149
|
+
accessibilityElementsHidden: true,
|
|
150
|
+
style: styles.ellipsis,
|
|
151
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
152
|
+
style: styles.ellipsisText,
|
|
153
|
+
children: "\u2026"
|
|
154
|
+
})
|
|
155
|
+
}, item);
|
|
156
|
+
}
|
|
157
|
+
const isActive = item === clampedPage;
|
|
158
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
159
|
+
size: "sm",
|
|
160
|
+
appearance: isActive ? 'gray' : 'no-background',
|
|
161
|
+
accessibilityLabel: t('components.pagination.pageAriaLabel', {
|
|
162
|
+
page: item
|
|
163
|
+
}),
|
|
164
|
+
accessibilityState: {
|
|
165
|
+
selected: isActive
|
|
166
|
+
},
|
|
167
|
+
onLayout: event => onPageLayout(item, event),
|
|
168
|
+
onPress: () => onPageChange(item),
|
|
169
|
+
children: item
|
|
170
|
+
}, item);
|
|
171
|
+
})
|
|
172
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
173
|
+
icon: ChevronRight,
|
|
174
|
+
size: "sm",
|
|
175
|
+
appearance: "gray",
|
|
176
|
+
disabled: clampedPage >= totalPages,
|
|
177
|
+
accessibilityLabel: t('components.pagination.nextPageAriaLabel'),
|
|
178
|
+
onPress: () => onPageChange(clampedPage + 1)
|
|
179
|
+
})]
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getPaginationRange","useCallback","useEffect","useRef","ScrollView","useStyleSheet","useCommonTranslation","Box","Text","ChevronLeft","ChevronRight","Button","IconButton","jsx","_jsx","jsxs","_jsxs","usePaginationStyles","t","root","flexDirection","alignItems","maxWidth","gap","spacings","s8","padding","s4","scroll","flexGrow","flexShrink","scrollContent","pageOfTotal","typographies","body2SemiBold","color","colors","text","base","paddingHorizontal","ellipsis","width","sizes","s40","justifyContent","ellipsisText","body2","muted","useScrollToActivePage","activePage","scrollRef","viewportWidth","pageLayouts","Map","scrollToActivePage","layout","current","get","scrollTo","x","Math","max","animated","onViewportLayout","event","nativeEvent","onPageLayout","page","set","Pagination","totalPages","onPageChange","siblingCount","density","lx","style","ref","props","styles","clampedPage","min","isCompact","items","accessibilityLabel","children","icon","size","appearance","disabled","onPress","accessibilityLiveRegion","numberOfLines","total","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","onLayout","map","item","importantForAccessibility","accessibilityElementsHidden","isActive","accessibilityState","selected"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/Pagination/Pagination.tsx"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEtD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,6BAAoB;AAClD,SAASC,oBAAoB,QAAQ,mCAA0B;AAC/D,SAASC,GAAG,QAAQ,+BAAsB;AAC1C,SAASC,IAAI,QAAQ,gCAAuB;AAC5C,SAASC,WAAW,EAAEC,YAAY,QAAQ,wBAAe;AACzD,SAASC,MAAM,QAAQ,oBAAW;AAClC,SAASC,UAAU,QAAQ,wBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG3C,MAAMC,mBAAmB,GAAGA,CAAA,KAC1BZ,aAAa,CACVa,CAAC,KAAM;EACNC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,QAAQ,EAAE,M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,EAAET,WAAW,IAAIT,UAAW;MACpCa,kBAAkB,EAAEjE,CAAC,CAAC,yCAAyC,CAAE;MACjEuE,OAAO,EAAEA,CAAA,KAAMlB,YAAY,CAACQ,WAAW,GAAG,CAAC;IAAE,CAC9C,CAAC;EAAA,CACC,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -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,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { Box } from "../../primitives/Box/index.js";
|
|
5
|
+
import { Pagination } from "./Pagination.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const meta = {
|
|
8
|
+
id: 'rnative-pagination',
|
|
9
|
+
title: 'Core/Pagination',
|
|
10
|
+
component: Pagination,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
backgrounds: {
|
|
14
|
+
default: 'light'
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
source: {
|
|
18
|
+
language: 'tsx',
|
|
19
|
+
format: true,
|
|
20
|
+
type: 'code'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
actions: {
|
|
24
|
+
disable: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
page: 1,
|
|
29
|
+
totalPages: 10,
|
|
30
|
+
onPageChange: () => {}
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
page: {
|
|
34
|
+
control: 'number'
|
|
35
|
+
},
|
|
36
|
+
totalPages: {
|
|
37
|
+
control: 'number'
|
|
38
|
+
},
|
|
39
|
+
siblingCount: {
|
|
40
|
+
control: 'number'
|
|
41
|
+
},
|
|
42
|
+
density: {
|
|
43
|
+
control: 'radio',
|
|
44
|
+
options: ['expanded', 'compact']
|
|
45
|
+
},
|
|
46
|
+
onPageChange: {
|
|
47
|
+
control: false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export default meta;
|
|
52
|
+
export const Base = {
|
|
53
|
+
args: {
|
|
54
|
+
page: 5,
|
|
55
|
+
totalPages: 10,
|
|
56
|
+
siblingCount: 1
|
|
57
|
+
},
|
|
58
|
+
render: args => {
|
|
59
|
+
const [page, setPage] = useState(args.page);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setPage(args.page);
|
|
62
|
+
}, [args.page]);
|
|
63
|
+
return /*#__PURE__*/_jsx(Pagination, {
|
|
64
|
+
...args,
|
|
65
|
+
page: page,
|
|
66
|
+
onPageChange: setPage
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export const FewPages = {
|
|
71
|
+
render: () => {
|
|
72
|
+
const [page, setPage] = useState(2);
|
|
73
|
+
return /*#__PURE__*/_jsx(Pagination, {
|
|
74
|
+
page: page,
|
|
75
|
+
totalPages: 3,
|
|
76
|
+
onPageChange: setPage
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export const FirstPage = {
|
|
81
|
+
render: () => {
|
|
82
|
+
const [page, setPage] = useState(1);
|
|
83
|
+
return /*#__PURE__*/_jsx(Pagination, {
|
|
84
|
+
page: page,
|
|
85
|
+
totalPages: 20,
|
|
86
|
+
onPageChange: setPage
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export const LastPage = {
|
|
91
|
+
render: () => {
|
|
92
|
+
const [page, setPage] = useState(20);
|
|
93
|
+
return /*#__PURE__*/_jsx(Pagination, {
|
|
94
|
+
page: page,
|
|
95
|
+
totalPages: 20,
|
|
96
|
+
onPageChange: setPage
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export const DensityShowcase = {
|
|
101
|
+
render: () => {
|
|
102
|
+
const [page, setPage] = useState(2);
|
|
103
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
104
|
+
lx: {
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
gap: 's16'
|
|
107
|
+
},
|
|
108
|
+
children: [/*#__PURE__*/_jsx(Pagination, {
|
|
109
|
+
page: page,
|
|
110
|
+
totalPages: 8,
|
|
111
|
+
onPageChange: setPage
|
|
112
|
+
}), /*#__PURE__*/_jsx(Pagination, {
|
|
113
|
+
page: page,
|
|
114
|
+
totalPages: 8,
|
|
115
|
+
density: "compact",
|
|
116
|
+
onPageChange: setPage
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=Pagination.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","Box","Pagination","jsx","_jsx","jsxs","_jsxs","meta","id","title","component","parameters","layout","backgrounds","default","docs","source","language","format","type","actions","disable","args","page","totalPages","onPageChange","argTypes","control","siblingCount","density","options","Base","render","setPage","FewPages","FirstPage","LastPage","DensityShowcase","lx","alignItems","gap","children"],"sourceRoot":"../../../../../../src","sources":["lib/Components/core/Pagination/Pagination.stories.tsx"],"mappings":";;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,GAAG,QAAQ,+BAAsB;AAC1C,SAASC,UAAU,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,MAAMC,IAAI,GAAG;E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