@ledgerhq/lumen-ui-rnative 0.1.46 → 0.1.48
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/README.md +1 -1
- package/dist/module/lib/Animations/Pulse/Pulse.mdx +1 -1
- package/dist/module/lib/Animations/Pulse/Pulse.stories.js +2 -1
- package/dist/module/lib/Animations/Pulse/Pulse.stories.js.map +1 -1
- package/dist/module/lib/Animations/Spin/Spin.mdx +1 -1
- package/dist/module/lib/Animations/Spin/Spin.stories.js +2 -1
- package/dist/module/lib/Animations/Spin/Spin.stories.js.map +1 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.mdx +2 -2
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js +2 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +1 -2
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js +2 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +3 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +17 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js +20 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.js +2 -2
- package/dist/module/lib/Components/Avatar/Avatar.mdx +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.stories.js +2 -1
- package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.js +1 -2
- package/dist/module/lib/Components/Banner/Banner.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.mdx +1 -1
- package/dist/module/lib/Components/Banner/Banner.stories.js +2 -1
- package/dist/module/lib/Components/Banner/Banner.stories.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.stories.js +2 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.stories.js.map +1 -1
- package/dist/module/lib/Components/Button/Button.js +1 -2
- package/dist/module/lib/Components/Button/Button.js.map +1 -1
- package/dist/module/lib/Components/Button/Button.mdx +3 -3
- package/dist/module/lib/Components/Button/Button.stories.js +2 -1
- package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.js +1 -1
- package/dist/module/lib/Components/Card/Card.mdx +1 -1
- package/dist/module/lib/Components/Card/Card.stories.js +2 -1
- package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.js +1 -2
- package/dist/module/lib/Components/CardButton/CardButton.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.mdx +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.stories.js +2 -1
- package/dist/module/lib/Components/CardButton/CardButton.stories.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.js +1 -2
- package/dist/module/lib/Components/Checkbox/Checkbox.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.mdx +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.stories.js +2 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.stories.js.map +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.js +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.mdx +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js +2 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js +1 -1
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.mdx +1 -1
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js +2 -1
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js.map +1 -1
- package/dist/module/lib/Components/Divider/Divider.js +1 -1
- package/dist/module/lib/Components/Divider/Divider.mdx +1 -1
- package/dist/module/lib/Components/Divider/Divider.stories.js +2 -1
- package/dist/module/lib/Components/Divider/Divider.stories.js.map +1 -1
- package/dist/module/lib/Components/DotCount/DotCount.mdx +1 -1
- package/dist/module/lib/Components/DotCount/DotCount.stories.js +2 -1
- package/dist/module/lib/Components/DotCount/DotCount.stories.js.map +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.mdx +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +2 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +2 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js.map +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.mdx +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +2 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/Icon/Icon.mdx +211 -0
- package/dist/module/lib/Components/Icon/Icon.stories.js +3 -2
- package/dist/module/lib/Components/Icon/Icon.stories.js.map +1 -1
- package/dist/module/lib/Components/IconButton/IconButton.mdx +1 -1
- package/dist/module/lib/Components/IconButton/IconButton.stories.js +2 -1
- package/dist/module/lib/Components/IconButton/IconButton.stories.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js +1 -2
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +2 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/Link/Link.js +1 -2
- package/dist/module/lib/Components/Link/Link.js.map +1 -1
- package/dist/module/lib/Components/Link/Link.mdx +1 -1
- package/dist/module/lib/Components/Link/Link.stories.js +2 -1
- package/dist/module/lib/Components/Link/Link.stories.js.map +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.js +1 -2
- package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.mdx +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.stories.js +2 -1
- package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.js +1 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.stories.js +2 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.mdx +2 -2
- package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +2 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaCard/MediaCard.mdx +1 -1
- package/dist/module/lib/Components/MediaCard/MediaCard.stories.js +2 -1
- package/dist/module/lib/Components/MediaCard/MediaCard.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +2 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaTag/MediaTag.js +1 -2
- package/dist/module/lib/Components/MediaTag/MediaTag.js.map +1 -1
- package/dist/module/lib/Components/MediaTag/MediaTag.mdx +2 -2
- package/dist/module/lib/Components/MediaTag/MediaTag.stories.js +2 -1
- package/dist/module/lib/Components/MediaTag/MediaTag.stories.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.mdx +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.stories.js +2 -1
- package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.js +16 -1
- package/dist/module/lib/Components/OptionList/OptionList.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.mdx +46 -1
- package/dist/module/lib/Components/OptionList/OptionList.stories.js +63 -2
- package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.test.js +43 -1
- package/dist/module/lib/Components/OptionList/OptionList.test.js.map +1 -1
- package/dist/module/lib/Components/OptionList/useOptionList/useOptionListItems.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.mdx +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.stories.js +2 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.stories.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.mdx +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js +2 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +7 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +29 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +26 -2
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +28 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.mdx +1 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.stories.js +2 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.stories.js.map +1 -1
- package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -1
- package/dist/module/lib/Components/Spinner/Spinner.stories.js +2 -1
- package/dist/module/lib/Components/Spinner/Spinner.stories.js.map +1 -1
- package/dist/module/lib/Components/Spot/Spot.js +1 -1
- package/dist/module/lib/Components/Spot/Spot.mdx +1 -1
- package/dist/module/lib/Components/Spot/Spot.stories.js +2 -1
- package/dist/module/lib/Components/Spot/Spot.stories.js.map +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.stories.js +2 -1
- package/dist/module/lib/Components/Stepper/Stepper.stories.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.mdx +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.stories.js +2 -1
- package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
- package/dist/module/lib/Components/Switch/Switch.js +1 -2
- package/dist/module/lib/Components/Switch/Switch.js.map +1 -1
- package/dist/module/lib/Components/Switch/Switch.mdx +1 -1
- package/dist/module/lib/Components/Switch/Switch.stories.js +2 -1
- package/dist/module/lib/Components/Switch/Switch.stories.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.js +8 -6
- package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.mdx +30 -1
- package/dist/module/lib/Components/TabBar/TabBar.stories.js +37 -2
- package/dist/module/lib/Components/TabBar/TabBar.stories.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js +28 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
- package/dist/module/lib/Components/TabBar/index.js +2 -1
- package/dist/module/lib/Components/TabBar/index.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.js +1 -2
- package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.mdx +1 -1
- package/dist/module/lib/Components/Tag/Tag.stories.js +2 -1
- package/dist/module/lib/Components/Tag/Tag.stories.js.map +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.mdx +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.stories.js +2 -1
- package/dist/module/lib/Components/TextInput/TextInput.stories.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.js +1 -2
- package/dist/module/lib/Components/Tile/Tile.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.mdx +1 -1
- package/dist/module/lib/Components/Tile/Tile.stories.js +2 -1
- package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.js +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.mdx +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.stories.js +2 -1
- package/dist/module/lib/Components/TileButton/TileButton.stories.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.js +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.mdx +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.stories.js +2 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/module/lib/Components/Trend/Trend.mdx +1 -1
- package/dist/module/lib/Components/Trend/Trend.stories.js +2 -1
- package/dist/module/lib/Components/Trend/Trend.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Box/Box.js +1 -1
- package/dist/module/lib/Components/Utility/Box/Box.mdx +1 -1
- package/dist/module/lib/Components/Utility/Box/Box.stories.js +2 -1
- package/dist/module/lib/Components/Utility/Box/Box.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.js +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.mdx +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js +2 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.js +1 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.mdx +1 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js +2 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.js +1 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.mdx +1 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.stories.js +2 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Text/Text.js +1 -1
- package/dist/module/lib/Components/Utility/Text/Text.mdx +1 -1
- package/dist/module/lib/Components/Utility/Text/Text.stories.js +2 -1
- package/dist/module/lib/Components/Utility/Text/Text.stories.js.map +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -2
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +8 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts +1 -0
- package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +2 -2
- package/dist/typescript/src/lib/Components/Banner/Banner.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Banner/Banner.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Button/Button.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Button/Button.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Card/Card.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts +1 -2
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ContentBanner/ContentBanner.d.ts +1 -1
- package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Divider/Divider.d.ts +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -2
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Link/Link.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +1 -2
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaBanner/MediaBanner.d.ts +1 -1
- package/dist/typescript/src/lib/Components/MediaTag/MediaTag.d.ts +1 -2
- package/dist/typescript/src/lib/Components/MediaTag/MediaTag.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts +18 -4
- package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/types.d.ts +16 -15
- package/dist/typescript/src/lib/Components/OptionList/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts +9 -9
- package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +6 -5
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Spot/Spot.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts +8 -4
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/index.d.ts +2 -2
- package/dist/typescript/src/lib/Components/TabBar/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/types.d.ts +17 -16
- package/dist/typescript/src/lib/Components/TabBar/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Utility/Box/Box.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Utility/Pressable/Pressable.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Utility/Text/Text.d.ts +1 -1
- package/package.json +3 -3
- package/src/lib/Animations/Pulse/Pulse.mdx +1 -1
- package/src/lib/Animations/Pulse/Pulse.stories.tsx +2 -1
- package/src/lib/Animations/Spin/Spin.mdx +1 -1
- package/src/lib/Animations/Spin/Spin.stories.tsx +2 -1
- package/src/lib/Components/AddressInput/AddressInput.mdx +2 -2
- package/src/lib/Components/AddressInput/AddressInput.stories.tsx +2 -1
- package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +1 -1
- package/src/lib/Components/AmountDisplay/AmountDisplay.stories.tsx +2 -1
- package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +1 -2
- package/src/lib/Components/AmountInput/AmountInput.mdx +1 -1
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +16 -1
- package/src/lib/Components/AmountInput/AmountInput.tsx +2 -0
- package/src/lib/Components/AmountInput/types.ts +8 -0
- package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.ts +20 -0
- package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.ts +2 -0
- package/src/lib/Components/Avatar/Avatar.mdx +1 -1
- package/src/lib/Components/Avatar/Avatar.stories.tsx +2 -1
- package/src/lib/Components/Avatar/Avatar.tsx +2 -2
- package/src/lib/Components/Banner/Banner.mdx +1 -1
- package/src/lib/Components/Banner/Banner.stories.tsx +2 -1
- package/src/lib/Components/Banner/Banner.tsx +1 -2
- package/src/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
- package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +2 -1
- package/src/lib/Components/Button/Button.mdx +3 -3
- package/src/lib/Components/Button/Button.stories.tsx +2 -1
- package/src/lib/Components/Button/Button.tsx +1 -2
- package/src/lib/Components/Card/Card.mdx +1 -1
- package/src/lib/Components/Card/Card.stories.tsx +2 -1
- package/src/lib/Components/Card/Card.tsx +1 -1
- package/src/lib/Components/CardButton/CardButton.mdx +1 -1
- package/src/lib/Components/CardButton/CardButton.stories.tsx +2 -1
- package/src/lib/Components/CardButton/CardButton.tsx +1 -2
- package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
- package/src/lib/Components/Checkbox/Checkbox.stories.tsx +2 -1
- package/src/lib/Components/Checkbox/Checkbox.tsx +1 -2
- package/src/lib/Components/ContentBanner/ContentBanner.mdx +1 -1
- package/src/lib/Components/ContentBanner/ContentBanner.stories.tsx +2 -1
- package/src/lib/Components/ContentBanner/ContentBanner.tsx +1 -1
- package/src/lib/Components/DescriptionItem/DescriptionItem.mdx +1 -1
- package/src/lib/Components/DescriptionItem/DescriptionItem.stories.tsx +2 -1
- package/src/lib/Components/DescriptionItem/DescriptionItem.tsx +1 -1
- package/src/lib/Components/Divider/Divider.mdx +1 -1
- package/src/lib/Components/Divider/Divider.stories.tsx +2 -1
- package/src/lib/Components/Divider/Divider.tsx +1 -1
- package/src/lib/Components/DotCount/DotCount.mdx +1 -1
- package/src/lib/Components/DotCount/DotCount.stories.tsx +2 -1
- package/src/lib/Components/DotIcon/DotIcon.mdx +1 -1
- package/src/lib/Components/DotIcon/DotIcon.stories.tsx +2 -1
- package/src/lib/Components/DotIndicator/DotIndicator.mdx +1 -1
- package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +2 -1
- package/src/lib/Components/DotSymbol/DotSymbol.mdx +1 -1
- package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +2 -1
- package/src/lib/Components/Icon/Icon.mdx +211 -0
- package/src/lib/Components/Icon/Icon.stories.tsx +3 -2
- package/src/lib/Components/IconButton/IconButton.mdx +1 -1
- package/src/lib/Components/IconButton/IconButton.stories.tsx +2 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +2 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +1 -2
- package/src/lib/Components/Link/Link.mdx +1 -1
- package/src/lib/Components/Link/Link.stories.tsx +2 -1
- package/src/lib/Components/Link/Link.tsx +1 -2
- package/src/lib/Components/ListItem/ListItem.mdx +1 -1
- package/src/lib/Components/ListItem/ListItem.stories.tsx +2 -1
- package/src/lib/Components/ListItem/ListItem.tsx +1 -2
- package/src/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
- package/src/lib/Components/MediaBanner/MediaBanner.stories.tsx +2 -1
- package/src/lib/Components/MediaBanner/MediaBanner.tsx +1 -1
- package/src/lib/Components/MediaButton/MediaButton.mdx +2 -2
- package/src/lib/Components/MediaButton/MediaButton.stories.tsx +2 -1
- package/src/lib/Components/MediaCard/MediaCard.mdx +1 -1
- package/src/lib/Components/MediaCard/MediaCard.stories.tsx +2 -1
- package/src/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/src/lib/Components/MediaImage/MediaImage.stories.tsx +2 -1
- package/src/lib/Components/MediaTag/MediaTag.mdx +2 -2
- package/src/lib/Components/MediaTag/MediaTag.stories.tsx +2 -1
- package/src/lib/Components/MediaTag/MediaTag.tsx +1 -2
- package/src/lib/Components/NavBar/NavBar.mdx +1 -1
- package/src/lib/Components/NavBar/NavBar.stories.tsx +2 -1
- package/src/lib/Components/OptionList/OptionList.mdx +46 -1
- package/src/lib/Components/OptionList/OptionList.stories.tsx +65 -1
- package/src/lib/Components/OptionList/OptionList.test.tsx +40 -0
- package/src/lib/Components/OptionList/OptionList.tsx +57 -10
- package/src/lib/Components/OptionList/types.ts +34 -15
- package/src/lib/Components/OptionList/useOptionList/useOptionListItems.ts +28 -13
- package/src/lib/Components/PageIndicator/PageIndicator.mdx +1 -1
- package/src/lib/Components/PageIndicator/PageIndicator.stories.tsx +2 -1
- package/src/lib/Components/SearchInput/SearchInput.mdx +1 -1
- package/src/lib/Components/SearchInput/SearchInput.stories.tsx +2 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +29 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +36 -2
- package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +32 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +22 -5
- package/src/lib/Components/SegmentedControl/types.ts +11 -5
- package/src/lib/Components/Skeleton/Skeleton.mdx +1 -1
- package/src/lib/Components/Skeleton/Skeleton.stories.tsx +2 -1
- package/src/lib/Components/Spinner/Spinner.mdx +1 -1
- package/src/lib/Components/Spinner/Spinner.stories.tsx +2 -1
- package/src/lib/Components/Spot/Spot.mdx +1 -1
- package/src/lib/Components/Spot/Spot.stories.tsx +2 -1
- package/src/lib/Components/Spot/Spot.tsx +1 -1
- package/src/lib/Components/Stepper/Stepper.mdx +1 -1
- package/src/lib/Components/Stepper/Stepper.stories.tsx +2 -1
- package/src/lib/Components/Subheader/Subheader.mdx +1 -1
- package/src/lib/Components/Subheader/Subheader.stories.tsx +2 -1
- package/src/lib/Components/Switch/Switch.mdx +1 -1
- package/src/lib/Components/Switch/Switch.stories.tsx +2 -1
- package/src/lib/Components/Switch/Switch.tsx +1 -2
- package/src/lib/Components/TabBar/TabBar.mdx +30 -1
- package/src/lib/Components/TabBar/TabBar.stories.tsx +36 -2
- package/src/lib/Components/TabBar/TabBar.test.tsx +23 -1
- package/src/lib/Components/TabBar/TabBar.tsx +18 -11
- package/src/lib/Components/TabBar/index.ts +2 -2
- package/src/lib/Components/TabBar/types.ts +19 -17
- package/src/lib/Components/Tag/Tag.mdx +1 -1
- package/src/lib/Components/Tag/Tag.stories.tsx +2 -1
- package/src/lib/Components/Tag/Tag.tsx +1 -2
- package/src/lib/Components/TextInput/TextInput.mdx +1 -1
- package/src/lib/Components/TextInput/TextInput.stories.tsx +2 -1
- package/src/lib/Components/Tile/Tile.mdx +1 -1
- package/src/lib/Components/Tile/Tile.stories.tsx +2 -1
- package/src/lib/Components/Tile/Tile.tsx +1 -2
- package/src/lib/Components/TileButton/TileButton.mdx +1 -1
- package/src/lib/Components/TileButton/TileButton.stories.tsx +2 -1
- package/src/lib/Components/TileButton/TileButton.tsx +1 -1
- package/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.tsx +1 -1
- package/src/lib/Components/Tooltip/Tooltip.mdx +1 -1
- package/src/lib/Components/Tooltip/Tooltip.stories.tsx +2 -1
- package/src/lib/Components/Tooltip/Tooltip.tsx +1 -1
- package/src/lib/Components/Trend/Trend.mdx +1 -1
- package/src/lib/Components/Trend/Trend.stories.tsx +2 -1
- package/src/lib/Components/Utility/Box/Box.mdx +1 -1
- package/src/lib/Components/Utility/Box/Box.stories.tsx +2 -1
- package/src/lib/Components/Utility/Box/Box.tsx +1 -1
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.mdx +1 -1
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +2 -1
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.tsx +1 -1
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.mdx +1 -1
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.tsx +2 -1
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.tsx +1 -1
- package/src/lib/Components/Utility/Pressable/Pressable.mdx +1 -1
- package/src/lib/Components/Utility/Pressable/Pressable.stories.tsx +2 -1
- package/src/lib/Components/Utility/Pressable/Pressable.tsx +1 -1
- package/src/lib/Components/Utility/Text/Text.mdx +1 -1
- package/src/lib/Components/Utility/Text/Text.stories.tsx +2 -1
- package/src/lib/Components/Utility/Text/Text.tsx +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
2
3
|
import type { LayoutChangeEvent } from 'react-native';
|
|
3
4
|
import Animated from 'react-native-reanimated';
|
|
4
5
|
import { useStyleSheet } from '../../../styles';
|
|
@@ -11,20 +12,23 @@ import {
|
|
|
11
12
|
import type {
|
|
12
13
|
SegmentedControlButtonProps,
|
|
13
14
|
SegmentedControlProps,
|
|
15
|
+
SegmentedControlValue,
|
|
14
16
|
} from './types';
|
|
15
17
|
import {
|
|
16
18
|
usePillLayout,
|
|
17
19
|
useSegmentedControlSelectedIndex,
|
|
18
20
|
} from './usePillLayout';
|
|
19
21
|
|
|
20
|
-
export function SegmentedControlButton
|
|
22
|
+
export function SegmentedControlButton<
|
|
23
|
+
T extends SegmentedControlValue = SegmentedControlValue,
|
|
24
|
+
>({
|
|
21
25
|
value,
|
|
22
26
|
children,
|
|
23
27
|
icon: Icon,
|
|
24
28
|
trailingContent,
|
|
25
29
|
onPress,
|
|
26
30
|
...props
|
|
27
|
-
}: SegmentedControlButtonProps) {
|
|
31
|
+
}: SegmentedControlButtonProps<T>) {
|
|
28
32
|
const {
|
|
29
33
|
selectedValue,
|
|
30
34
|
onSelectedChange,
|
|
@@ -126,7 +130,9 @@ function useButtonStyles({
|
|
|
126
130
|
return { ...styles, typography, textColor };
|
|
127
131
|
}
|
|
128
132
|
|
|
129
|
-
export function SegmentedControl
|
|
133
|
+
export function SegmentedControl<
|
|
134
|
+
T extends SegmentedControlValue = SegmentedControlValue,
|
|
135
|
+
>({
|
|
130
136
|
selectedValue,
|
|
131
137
|
onSelectedChange,
|
|
132
138
|
accessibilityLabel,
|
|
@@ -135,7 +141,7 @@ export function SegmentedControl({
|
|
|
135
141
|
appearance = 'background',
|
|
136
142
|
tabLayout = 'fixed',
|
|
137
143
|
...props
|
|
138
|
-
}: SegmentedControlProps) {
|
|
144
|
+
}: SegmentedControlProps<T>) {
|
|
139
145
|
const disabled = useDisabledContext({
|
|
140
146
|
consumerName: 'SegmentedControl',
|
|
141
147
|
mergeWith: { disabled: disabledProp },
|
|
@@ -160,7 +166,7 @@ export function SegmentedControl({
|
|
|
160
166
|
<SegmentedControlContextProvider
|
|
161
167
|
value={{
|
|
162
168
|
selectedValue,
|
|
163
|
-
onSelectedChange,
|
|
169
|
+
onSelectedChange: onSelectedChange as (value: string) => void,
|
|
164
170
|
disabled,
|
|
165
171
|
tabLayout,
|
|
166
172
|
registerButtonLayout,
|
|
@@ -220,3 +226,14 @@ function useRootStyles({
|
|
|
220
226
|
[disabled, appearance, tabLayout],
|
|
221
227
|
);
|
|
222
228
|
}
|
|
229
|
+
|
|
230
|
+
export function createSegmentedControl<
|
|
231
|
+
T extends SegmentedControlValue = never,
|
|
232
|
+
>(): {
|
|
233
|
+
SegmentedControl: (props: SegmentedControlProps<T>) => ReactElement;
|
|
234
|
+
SegmentedControlButton: (
|
|
235
|
+
props: SegmentedControlButtonProps<T>,
|
|
236
|
+
) => ReactElement;
|
|
237
|
+
} {
|
|
238
|
+
return { SegmentedControl, SegmentedControlButton };
|
|
239
|
+
}
|
|
@@ -3,15 +3,19 @@ import type { LumenTextStyle, StyledPressableProps } from '../../../styles';
|
|
|
3
3
|
import type { IconSize } from '../Icon';
|
|
4
4
|
import type { BoxProps } from '../Utility';
|
|
5
5
|
|
|
6
|
-
export type
|
|
6
|
+
export type SegmentedControlValue = string;
|
|
7
|
+
|
|
8
|
+
export type SegmentedControlProps<
|
|
9
|
+
T extends SegmentedControlValue = SegmentedControlValue,
|
|
10
|
+
> = {
|
|
7
11
|
/**
|
|
8
12
|
* The value of the currently selected segment (drives the sliding pill).
|
|
9
13
|
*/
|
|
10
|
-
selectedValue:
|
|
14
|
+
selectedValue: T;
|
|
11
15
|
/**
|
|
12
16
|
* Callback when the selected segment value changes.
|
|
13
17
|
*/
|
|
14
|
-
onSelectedChange: (value:
|
|
18
|
+
onSelectedChange: (value: T) => void;
|
|
15
19
|
/**
|
|
16
20
|
* When true, the entire control is disabled (no interaction, selected uses muted styling).
|
|
17
21
|
*/
|
|
@@ -43,11 +47,13 @@ type IconComponent = ComponentType<{
|
|
|
43
47
|
color?: LumenTextStyle['color'];
|
|
44
48
|
}>;
|
|
45
49
|
|
|
46
|
-
export type SegmentedControlButtonProps
|
|
50
|
+
export type SegmentedControlButtonProps<
|
|
51
|
+
T extends SegmentedControlValue = SegmentedControlValue,
|
|
52
|
+
> = {
|
|
47
53
|
/**
|
|
48
54
|
* Value for this segment (must be unique among siblings).
|
|
49
55
|
*/
|
|
50
|
-
value:
|
|
56
|
+
value: T;
|
|
51
57
|
/**
|
|
52
58
|
* Button label (e.g. "Preview", "Raw").
|
|
53
59
|
*/
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '../../../../.storybook/components';
|
|
11
11
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
12
12
|
|
|
13
|
-
<Meta title='
|
|
13
|
+
<Meta title='Core/Skeleton' of={SkeletonStories} />
|
|
14
14
|
|
|
15
15
|
# Skeleton
|
|
16
16
|
|
|
@@ -3,7 +3,8 @@ import { Box } from '../Utility/Box';
|
|
|
3
3
|
import { Skeleton } from './Skeleton';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Skeleton> = {
|
|
6
|
-
|
|
6
|
+
id: 'rnative-skeleton',
|
|
7
|
+
title: 'Core/Skeleton',
|
|
7
8
|
component: Skeleton,
|
|
8
9
|
parameters: {
|
|
9
10
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
|
|
|
6
6
|
import { Box } from '../Utility/Box';
|
|
7
7
|
import { Text } from '../Utility/Text';
|
|
8
8
|
|
|
9
|
-
<Meta title='
|
|
9
|
+
<Meta title='Core/Spinner' of={SpinnerStories} />
|
|
10
10
|
|
|
11
11
|
# Spinner
|
|
12
12
|
|
|
@@ -4,7 +4,8 @@ import { Text } from '../Utility/Text';
|
|
|
4
4
|
import { Spinner } from './Spinner';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Spinner> = {
|
|
7
|
-
|
|
7
|
+
id: 'rnative-spinner',
|
|
8
|
+
title: 'Core/Spinner',
|
|
8
9
|
component: Spinner,
|
|
9
10
|
parameters: {
|
|
10
11
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
6
6
|
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
7
7
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
8
8
|
|
|
9
|
-
<Meta title='
|
|
9
|
+
<Meta title='Core/Spot' of={SpotStories} />
|
|
10
10
|
|
|
11
11
|
# Spot
|
|
12
12
|
|
|
@@ -103,7 +103,7 @@ const useStyles = ({
|
|
|
103
103
|
* - `'number'` appearance requires a `number` prop
|
|
104
104
|
* - All other appearances are self-contained
|
|
105
105
|
*
|
|
106
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
106
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-spot--docs Storybook}
|
|
107
107
|
*
|
|
108
108
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
109
109
|
* Do not use it to modify the spot's core appearance (colors, size, etc). Use the `appearance` prop instead.
|
|
@@ -6,7 +6,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
|
|
|
6
6
|
import { Box } from '../Utility/Box';
|
|
7
7
|
import { Text } from '../Utility/Text';
|
|
8
8
|
|
|
9
|
-
<Meta title='
|
|
9
|
+
<Meta title='Core/Stepper' of={StepperStories} />
|
|
10
10
|
|
|
11
11
|
# Stepper
|
|
12
12
|
|
|
@@ -4,7 +4,8 @@ import { Text } from '../Utility/Text';
|
|
|
4
4
|
import { Stepper } from './Stepper';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Stepper> = {
|
|
7
|
-
|
|
7
|
+
id: 'rnative-stepper',
|
|
8
|
+
title: 'Core/Stepper',
|
|
8
9
|
component: Stepper,
|
|
9
10
|
parameters: {
|
|
10
11
|
actions: { disable: true },
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from '../../../../.storybook/components';
|
|
20
20
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
21
21
|
|
|
22
|
-
<Meta title='
|
|
22
|
+
<Meta title='Core/Subheader' of={SubheaderStories} />
|
|
23
23
|
|
|
24
24
|
# Subheader
|
|
25
25
|
|
|
@@ -20,7 +20,8 @@ const Container = ({ children }: { children: React.ReactNode }) => (
|
|
|
20
20
|
|
|
21
21
|
const meta: Meta<typeof Subheader> = {
|
|
22
22
|
component: Subheader,
|
|
23
|
-
|
|
23
|
+
id: 'rnative-subheader',
|
|
24
|
+
title: 'Core/Subheader',
|
|
24
25
|
subcomponents: {
|
|
25
26
|
SubheaderRow,
|
|
26
27
|
SubheaderTitle,
|
|
@@ -6,7 +6,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
6
6
|
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
7
7
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
8
8
|
|
|
9
|
-
<Meta title=
|
|
9
|
+
<Meta title='Core/Switch' of={SwitchStories} />
|
|
10
10
|
|
|
11
11
|
# Switch
|
|
12
12
|
|
|
@@ -107,8 +107,7 @@ const useAnimatedThumb = (checked: boolean, translate: number) => {
|
|
|
107
107
|
* The switch follows the design system tokens and supports checked, unchecked,
|
|
108
108
|
* disabled, and focus states with proper active interactions.
|
|
109
109
|
*
|
|
110
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
111
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_selection-switch--docs#dos-and-donts Guidelines}
|
|
110
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-switch--docs Guidelines}
|
|
112
111
|
*
|
|
113
112
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
114
113
|
* Do not use it to modify the switch's core appearance.
|
|
@@ -6,7 +6,7 @@ import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/
|
|
|
6
6
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
7
7
|
import { Box } from '../Utility';
|
|
8
8
|
|
|
9
|
-
<Meta title='
|
|
9
|
+
<Meta title='Core/TabBar' of={TabBarStories} />
|
|
10
10
|
|
|
11
11
|
# TabBar
|
|
12
12
|
|
|
@@ -69,6 +69,8 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
69
69
|
|
|
70
70
|
### Basic Usage
|
|
71
71
|
|
|
72
|
+
> **Recommended:** prefer the [type-safe variant](#type-safe-variant) below. It shares one literal union across `active` and every `TabBarItem.value`.
|
|
73
|
+
|
|
72
74
|
```tsx
|
|
73
75
|
import { useState } from 'react';
|
|
74
76
|
import { TabBar, TabBarItem } from '@ledgerhq/lumen-ui-rnative';
|
|
@@ -86,6 +88,33 @@ function MyComponent() {
|
|
|
86
88
|
}
|
|
87
89
|
```
|
|
88
90
|
|
|
91
|
+
### Type-safe variant
|
|
92
|
+
|
|
93
|
+
`TabBar` and `TabBarItem` communicate via context, so TypeScript cannot connect the root's `active` to each item's `value` on its own. A typo compiles, and the wrong tab (or none) is highlighted.
|
|
94
|
+
|
|
95
|
+
`createTabBar<T>()` ties both components to one literal union. Call it once at module scope; the returned pair are typed against your `T`.
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
import { createTabBar } from '@ledgerhq/lumen-ui-rnative';
|
|
99
|
+
import { Home, HomeFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
100
|
+
|
|
101
|
+
type Route = 'home' | 'swap' | 'settings';
|
|
102
|
+
|
|
103
|
+
const { TabBar, TabBarItem } = createTabBar<Route>();
|
|
104
|
+
|
|
105
|
+
function Example() {
|
|
106
|
+
const [active, setActive] = React.useState<Route>('home');
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<TabBar active={active} onTabPress={setActive}>
|
|
110
|
+
<TabBarItem value='home' label='Home' icon={Home} activeIcon={HomeFill} />
|
|
111
|
+
<TabBarItem value='swap' label='Swap' icon={Settings} />
|
|
112
|
+
<TabBarItem value='settings' label='Settings' icon={Settings} />
|
|
113
|
+
</TabBar>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
89
118
|
### With Active Icons
|
|
90
119
|
|
|
91
120
|
Provide different icons for active and inactive states:
|
|
@@ -15,10 +15,11 @@ import {
|
|
|
15
15
|
CreditCard,
|
|
16
16
|
CreditCardFill,
|
|
17
17
|
} from '../../Symbols';
|
|
18
|
-
import { TabBar, TabBarItem } from './TabBar';
|
|
18
|
+
import { createTabBar, TabBar, TabBarItem } from './TabBar';
|
|
19
19
|
|
|
20
20
|
const meta = {
|
|
21
|
-
|
|
21
|
+
id: 'rnative-tabbar',
|
|
22
|
+
title: 'Core/TabBar',
|
|
22
23
|
component: TabBar,
|
|
23
24
|
subcomponents: {
|
|
24
25
|
TabBarItem,
|
|
@@ -118,3 +119,36 @@ export const MissingLabel: Story = {
|
|
|
118
119
|
);
|
|
119
120
|
},
|
|
120
121
|
};
|
|
122
|
+
|
|
123
|
+
type Route = 'home' | 'swap' | 'card' | 'help';
|
|
124
|
+
const Nav = createTabBar<Route>();
|
|
125
|
+
|
|
126
|
+
export const TypesafeFactory: Story = {
|
|
127
|
+
args: {} as React.ComponentProps<typeof TabBar>,
|
|
128
|
+
render: () => {
|
|
129
|
+
const [active, setActive] = useState<Route>('home');
|
|
130
|
+
return (
|
|
131
|
+
<Nav.TabBar active={active} onTabPress={setActive} lx={{ width: 's320' }}>
|
|
132
|
+
<Nav.TabBarItem
|
|
133
|
+
value='home'
|
|
134
|
+
label='Home'
|
|
135
|
+
icon={Home}
|
|
136
|
+
activeIcon={HomeFill}
|
|
137
|
+
/>
|
|
138
|
+
<Nav.TabBarItem value='swap' label='Swap' icon={CoinPercent} />
|
|
139
|
+
<Nav.TabBarItem
|
|
140
|
+
value='card'
|
|
141
|
+
label='Card'
|
|
142
|
+
icon={CreditCard}
|
|
143
|
+
activeIcon={CreditCardFill}
|
|
144
|
+
/>
|
|
145
|
+
<Nav.TabBarItem
|
|
146
|
+
value='help'
|
|
147
|
+
label='Help'
|
|
148
|
+
icon={LifeRing}
|
|
149
|
+
activeIcon={LifeRingFill}
|
|
150
|
+
/>
|
|
151
|
+
</Nav.TabBar>
|
|
152
|
+
);
|
|
153
|
+
},
|
|
154
|
+
};
|
|
@@ -3,7 +3,7 @@ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
|
3
3
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
4
4
|
import { HomeFill, Settings, BasketPutIn } from '../../Symbols';
|
|
5
5
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
|
-
import { TabBar, TabBarItem } from './TabBar';
|
|
6
|
+
import { TabBar, TabBarItem, createTabBar } from './TabBar';
|
|
7
7
|
|
|
8
8
|
const renderWithProvider = (component: React.ReactElement) => {
|
|
9
9
|
return render(
|
|
@@ -54,4 +54,26 @@ describe('TabBar', () => {
|
|
|
54
54
|
expect(getByText('Shop')).toBeTruthy();
|
|
55
55
|
expect(getByText('Settings')).toBeTruthy();
|
|
56
56
|
});
|
|
57
|
+
|
|
58
|
+
describe('createTabBar', () => {
|
|
59
|
+
it('returns typed components that render and respond to presses', () => {
|
|
60
|
+
const { TabBar: TypedTabBar, TabBarItem: TypedItem } = createTabBar<
|
|
61
|
+
'home' | 'settings'
|
|
62
|
+
>();
|
|
63
|
+
const onTabPress = jest.fn();
|
|
64
|
+
|
|
65
|
+
const { getByText } = renderWithProvider(
|
|
66
|
+
<TypedTabBar active='home' onTabPress={onTabPress}>
|
|
67
|
+
<TypedItem value='home' label='Home' icon={HomeFill} />
|
|
68
|
+
<TypedItem value='settings' label='Settings' icon={Settings} />
|
|
69
|
+
</TypedTabBar>,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
expect(getByText('Home')).toBeTruthy();
|
|
73
|
+
|
|
74
|
+
fireEvent.press(getByText('Settings'));
|
|
75
|
+
|
|
76
|
+
expect(onTabPress).toHaveBeenCalledWith('settings');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
57
79
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
3
|
import { Children, isValidElement, useEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import type { LayoutChangeEvent } from 'react-native';
|
|
5
5
|
import { StyleSheet, Text, View } from 'react-native';
|
|
@@ -18,7 +18,7 @@ import { Placeholder } from '../../Symbols';
|
|
|
18
18
|
import { RuntimeConstants } from '../../utils';
|
|
19
19
|
import { Box, Pressable } from '../Utility';
|
|
20
20
|
import { TabBarContextProvider, useTabBarContext } from './TabBarContext';
|
|
21
|
-
import type { TabBarItemProps, TabBarProps } from './types';
|
|
21
|
+
import type { TabBarItemProps, TabBarProps, TabBarValue } from './types';
|
|
22
22
|
|
|
23
23
|
export const TAB_BAR_HEIGHT = 60;
|
|
24
24
|
const PILL_INSET = 4;
|
|
@@ -227,8 +227,7 @@ export function TabBarItem({
|
|
|
227
227
|
* A horizontal tab bar with animated pill background and icon transitions.
|
|
228
228
|
* Provides smooth animations for active state changes and press interactions.
|
|
229
229
|
*
|
|
230
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
231
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_navigation-tabbar--docs#dos-and-donts Guidelines}
|
|
230
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-tabbar--docs Guidelines}
|
|
232
231
|
*
|
|
233
232
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
234
233
|
*
|
|
@@ -242,12 +241,12 @@ export function TabBarItem({
|
|
|
242
241
|
* <TabBarItem value="settings" label="Settings" icon={Settings} />
|
|
243
242
|
* </TabBar>
|
|
244
243
|
*/
|
|
245
|
-
export function TabBar({
|
|
244
|
+
export function TabBar<T extends TabBarValue = TabBarValue>({
|
|
246
245
|
active,
|
|
247
246
|
onTabPress,
|
|
248
247
|
children,
|
|
249
248
|
...props
|
|
250
|
-
}: TabBarProps) {
|
|
249
|
+
}: TabBarProps<T>) {
|
|
251
250
|
const styles = useStyles();
|
|
252
251
|
const { theme, colorScheme } = useTheme();
|
|
253
252
|
|
|
@@ -256,12 +255,13 @@ export function TabBar({
|
|
|
256
255
|
children,
|
|
257
256
|
});
|
|
258
257
|
|
|
259
|
-
function handleTabPress(value: string) {
|
|
260
|
-
onTabPress?.(value);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
258
|
return (
|
|
264
|
-
<TabBarContextProvider
|
|
259
|
+
<TabBarContextProvider
|
|
260
|
+
value={{
|
|
261
|
+
active,
|
|
262
|
+
onTabPress: (value) => onTabPress(value as T),
|
|
263
|
+
}}
|
|
264
|
+
>
|
|
265
265
|
<Box
|
|
266
266
|
style={styles.container}
|
|
267
267
|
onLayout={onLayout}
|
|
@@ -349,3 +349,10 @@ const useStyles = () =>
|
|
|
349
349
|
}),
|
|
350
350
|
[],
|
|
351
351
|
);
|
|
352
|
+
|
|
353
|
+
export function createTabBar<T extends TabBarValue = never>(): {
|
|
354
|
+
TabBar: (props: TabBarProps<T>) => ReactElement;
|
|
355
|
+
TabBarItem: (props: TabBarItemProps<T>) => ReactElement;
|
|
356
|
+
} {
|
|
357
|
+
return { TabBar, TabBarItem };
|
|
358
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './TabBar';
|
|
2
|
+
export * from './types';
|
|
@@ -7,11 +7,28 @@ type IconComponent = ComponentType<{
|
|
|
7
7
|
size?: IconSize;
|
|
8
8
|
}>;
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type TabBarValue = string;
|
|
11
|
+
|
|
12
|
+
export type TabBarProps<T extends TabBarValue = TabBarValue> = {
|
|
13
|
+
/**
|
|
14
|
+
* The value of the currently active tab.
|
|
15
|
+
*/
|
|
16
|
+
active: T;
|
|
17
|
+
/**
|
|
18
|
+
* The callback function called when a tab is pressed.
|
|
19
|
+
*/
|
|
20
|
+
onTabPress: (active: T) => void;
|
|
21
|
+
/**
|
|
22
|
+
* The tab items to display.
|
|
23
|
+
*/
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
} & Omit<BoxProps, 'children'>;
|
|
26
|
+
|
|
27
|
+
export type TabBarItemProps<T extends TabBarValue = TabBarValue> = {
|
|
11
28
|
/**
|
|
12
29
|
* The unique identifier for the tab item.
|
|
13
30
|
*/
|
|
14
|
-
value:
|
|
31
|
+
value: T;
|
|
15
32
|
/**
|
|
16
33
|
* The display label for the tab item.
|
|
17
34
|
* If not provided, the icon will be centered.
|
|
@@ -27,18 +44,3 @@ export type TabBarItemProps = {
|
|
|
27
44
|
*/
|
|
28
45
|
activeIcon?: IconComponent;
|
|
29
46
|
} & Omit<StyledViewProps, 'children'>;
|
|
30
|
-
|
|
31
|
-
export type TabBarProps = {
|
|
32
|
-
/**
|
|
33
|
-
* The value of the currently active tab.
|
|
34
|
-
*/
|
|
35
|
-
active: string;
|
|
36
|
-
/**
|
|
37
|
-
* The callback function called when a tab is pressed.
|
|
38
|
-
*/
|
|
39
|
-
onTabPress: (active: string) => void;
|
|
40
|
-
/**
|
|
41
|
-
* The tab items to display.
|
|
42
|
-
*/
|
|
43
|
-
children: ReactNode;
|
|
44
|
-
} & Omit<BoxProps, 'children'>;
|
|
@@ -5,7 +5,7 @@ import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/
|
|
|
5
5
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
6
6
|
import { Box } from '../Utility/Box';
|
|
7
7
|
|
|
8
|
-
<Meta title='
|
|
8
|
+
<Meta title='Core/Tag' of={TagStories} />
|
|
9
9
|
|
|
10
10
|
# Tag
|
|
11
11
|
|
|
@@ -14,8 +14,7 @@ const iconSizeMap: Record<Size, IconSize> = {
|
|
|
14
14
|
*
|
|
15
15
|
* The appearance determines the color scheme used.
|
|
16
16
|
*
|
|
17
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
18
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/communication-tag-implementation--docs#dos-and-donts Guidelines}
|
|
17
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-tag--docs Guidelines}
|
|
19
18
|
*
|
|
20
19
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
21
20
|
* Do not use it to modify the tag's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
@@ -5,7 +5,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
5
5
|
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
6
6
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
7
7
|
|
|
8
|
-
<Meta title='
|
|
8
|
+
<Meta title='Core/TextInput' of={TextInputStories} />
|
|
9
9
|
|
|
10
10
|
# TextInput
|
|
11
11
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
12
12
|
import { Box } from '../Utility';
|
|
13
13
|
|
|
14
|
-
<Meta title='
|
|
14
|
+
<Meta title='Core/Tile' of={TileStories} />
|
|
15
15
|
|
|
16
16
|
# Tile
|
|
17
17
|
|
|
@@ -73,8 +73,7 @@ const useRootStyles = ({
|
|
|
73
73
|
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
74
74
|
* Displays content in a vertical layout with support for spots, text, and custom content.
|
|
75
75
|
*
|
|
76
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
77
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-tile--docs#dos-and-donts Guidelines}
|
|
76
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-tile--docs Guidelines}
|
|
78
77
|
*
|
|
79
78
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
80
79
|
* Do not use it to modify the tile's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
@@ -5,7 +5,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
5
5
|
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
6
6
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
7
7
|
|
|
8
|
-
<Meta title='
|
|
8
|
+
<Meta title='Core/TileButton' of={TileButtonStories} />
|
|
9
9
|
|
|
10
10
|
# TileButton
|
|
11
11
|
|
|
@@ -67,7 +67,7 @@ const useStyles = ({
|
|
|
67
67
|
* A compact button component displaying an icon above a label in a vertical layout.
|
|
68
68
|
* Ideal for grids, toolbars, or quick action menus.
|
|
69
69
|
*
|
|
70
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
70
|
+
* @see {@link https://ldls-react-native.vercel.app/?path=/docs/rnative-tilebutton--docs Storybook}
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* import { TileButton } from '@ledgerhq/lumen-ui-rnative';
|