@ledgerhq/lumen-ui-rnative 0.1.14 → 0.1.16
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/i18n/i18n.js +2 -0
- package/dist/module/i18n/i18n.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/Animations/Spin/Spin.js +3 -1
- package/dist/module/lib/Animations/Spin/Spin.js.map +1 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.js +21 -10
- package/dist/module/lib/Components/AddressInput/AddressInput.js.map +1 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.mdx +18 -2
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js +1 -23
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js +0 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +7 -6
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +5 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +1 -36
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.figma.js +26 -0
- package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -0
- package/dist/module/lib/Components/Avatar/Avatar.stories.js +0 -1
- package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.test.js +0 -1
- package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.stories.js +3 -3
- package/dist/module/lib/Components/Banner/Banner.stories.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.test.js +0 -1
- package/dist/module/lib/Components/Banner/Banner.test.js.map +1 -1
- package/dist/module/lib/Components/BaseInput/BaseInput.js +54 -48
- package/dist/module/lib/Components/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.js +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js +0 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js +0 -2
- package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/CustomHandle.js +0 -1
- package/dist/module/lib/Components/BottomSheet/CustomHandle.js.map +1 -1
- package/dist/module/lib/Components/Button/BaseButton.test.js +0 -1
- package/dist/module/lib/Components/Button/BaseButton.test.js.map +1 -1
- package/dist/module/lib/Components/Button/Button.stories.js +2 -2
- package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.js +3 -3
- package/dist/module/lib/Components/Card/Card.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.test.js +0 -1
- package/dist/module/lib/Components/Card/Card.test.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.test.js +0 -1
- package/dist/module/lib/Components/CardButton/CardButton.test.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/BaseCheckbox.js +1 -1
- package/dist/module/lib/Components/Checkbox/BaseCheckbox.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.test.js +0 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.test.js.map +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js +2 -2
- package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js +0 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js.map +1 -1
- package/dist/module/lib/Components/Divider/Divider.test.js +0 -1
- package/dist/module/lib/Components/Divider/Divider.test.js.map +1 -1
- package/dist/module/lib/Components/Icon/Icon.js +2 -1
- package/dist/module/lib/Components/Icon/Icon.js.map +1 -1
- package/dist/module/lib/Components/Icon/Icon.test.js +0 -1
- package/dist/module/lib/Components/Icon/Icon.test.js.map +1 -1
- package/dist/module/lib/Components/Icon/createIcon.js +4 -2
- package/dist/module/lib/Components/Icon/createIcon.js.map +1 -1
- package/dist/module/lib/Components/IconButton/IconButton.test.js +0 -1
- package/dist/module/lib/Components/IconButton/IconButton.test.js.map +1 -1
- package/dist/module/lib/Components/Link/Link.test.js +3 -3
- package/dist/module/lib/Components/Link/Link.test.js.map +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.js +64 -179
- package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.mdx +53 -49
- package/dist/module/lib/Components/ListItem/ListItem.stories.js +65 -59
- package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.js +102 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +103 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +91 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.test.js +204 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.test.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/index.js +5 -0
- package/dist/module/lib/Components/MediaImage/index.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/types.js +4 -0
- package/dist/module/lib/Components/MediaImage/types.js.map +1 -0
- package/dist/module/lib/Components/NavBar/NavBar.js +3 -3
- package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.test.js +0 -1
- package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +2 -2
- package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.js +11 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.mdx +14 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js +1 -19
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +46 -14
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +90 -64
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +0 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControlContext.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/usePillLayout.js +40 -16
- package/dist/module/lib/Components/SegmentedControl/usePillLayout.js.map +1 -1
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +1 -1
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +1 -1
- package/dist/module/lib/Components/Select/GlobalSelectContext.js +1 -1
- package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +1 -1
- package/dist/module/lib/Components/Select/Select.js +3 -3
- package/dist/module/lib/Components/Select/Select.js.map +1 -1
- package/dist/module/lib/Components/Select/Select.test.js +0 -1
- package/dist/module/lib/Components/Select/Select.test.js.map +1 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.test.js +0 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.test.js.map +1 -1
- package/dist/module/lib/Components/Slot/Slot.js +4 -0
- package/dist/module/lib/Components/Slot/Slot.js.map +1 -1
- package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -3
- package/dist/module/lib/Components/Spot/Spot.stories.js +0 -1
- package/dist/module/lib/Components/Spot/Spot.stories.js.map +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -3
- package/dist/module/lib/Components/Stepper/Stepper.test.js +0 -1
- package/dist/module/lib/Components/Stepper/Stepper.test.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.stories.js +0 -1
- package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.test.js +0 -1
- package/dist/module/lib/Components/Subheader/Subheader.test.js.map +1 -1
- package/dist/module/lib/Components/Switch/BaseSwitch.js +1 -1
- package/dist/module/lib/Components/Switch/BaseSwitch.js.map +1 -1
- package/dist/module/lib/Components/Switch/Switch.test.js +0 -1
- package/dist/module/lib/Components/Switch/Switch.test.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.js +8 -8
- package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js +0 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.mdx +14 -2
- package/dist/module/lib/Components/TextInput/TextInput.stories.js +1 -28
- package/dist/module/lib/Components/TextInput/TextInput.stories.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.stories.js +0 -1
- package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.test.js +0 -1
- package/dist/module/lib/Components/Tile/Tile.test.js.map +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.test.js +0 -1
- package/dist/module/lib/Components/TileButton/TileButton.test.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js +1 -1
- package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js +1 -1
- package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.test.js +0 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.test.js.map +1 -1
- package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js +1 -1
- package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js.map +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js +1 -1
- package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js.map +1 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js +1 -1
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js.map +1 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js +1 -1
- package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js.map +1 -1
- package/dist/module/lib/Components/index.js +1 -0
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/module/lib/utils/react/extractTextFromChildren.js +3 -3
- package/dist/module/lib/utils/react/extractTextFromChildren.js.map +1 -1
- package/dist/module/lib/utils/useControllableState/useControllableState.js +5 -5
- package/dist/module/lib/utils/useControllableState/useControllableState.js.map +1 -1
- package/dist/module/lib/utils/useEvent/useGet.js +3 -3
- package/dist/module/lib/utils/useEvent/useGet.js.map +1 -1
- package/dist/module/styles/hooks/useStyleSheet.test.js +1 -1
- package/dist/module/styles/hooks/useStyleSheet.test.js.map +1 -1
- package/dist/module/styles/lx/createStyledPressable.test.js +1 -1
- package/dist/module/styles/lx/createStyledPressable.test.js.map +1 -1
- package/dist/module/styles/lx/createStyledText.test.js +1 -1
- package/dist/module/styles/lx/createStyledText.test.js.map +1 -1
- package/dist/module/styles/lx/createStyledView.test.js +1 -1
- package/dist/module/styles/lx/createStyledView.test.js.map +1 -1
- package/dist/module/styles/lx/resolveStyle.test.js +0 -1
- package/dist/module/styles/lx/resolveStyle.test.js.map +1 -1
- package/dist/module/styles/provider/LumenStyleSheetProvider.test.js +2 -4
- package/dist/module/styles/provider/LumenStyleSheetProvider.test.js.map +1 -1
- package/dist/module/utils/icon-template.js +3 -0
- package/dist/module/utils/icon-template.js.map +1 -1
- package/dist/typescript/src/i18n/i18n.d.ts.map +1 -1
- package/dist/typescript/src/index.d.ts +0 -1
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Animations/Spin/Spin.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.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 +7 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts +2 -0
- package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/types.d.ts +7 -0
- package/dist/typescript/src/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts +0 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Card/Card.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CardButton/types.d.ts +0 -1
- package/dist/typescript/src/lib/Components/CardButton/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts +0 -1
- package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts +1 -2
- package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +21 -40
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ListItem/types.d.ts +10 -37
- package/dist/typescript/src/lib/Components/ListItem/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +18 -0
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaImage/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/MediaImage/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +25 -0
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +7 -0
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts +7 -3
- package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Slot/Slot.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Spot/types.d.ts +2 -2
- package/dist/typescript/src/lib/Components/Spot/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts +0 -1
- package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts +0 -1
- package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/index.d.ts +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/types/index.d.ts +6 -6
- package/dist/typescript/src/lib/types/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts +2 -2
- package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts +3 -3
- package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -1
- package/dist/typescript/src/utils/icon-template.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/i18n/i18n.ts +2 -0
- package/src/index.ts +0 -1
- package/src/lib/Animations/Spin/Spin.tsx +5 -1
- package/src/lib/Components/AddressInput/AddressInput.mdx +18 -2
- package/src/lib/Components/AddressInput/AddressInput.stories.tsx +1 -23
- package/src/lib/Components/AddressInput/AddressInput.tsx +15 -7
- package/src/lib/Components/AmountDisplay/AmountDisplay.test.tsx +0 -1
- package/src/lib/Components/AmountInput/AmountInput.mdx +5 -1
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +1 -36
- package/src/lib/Components/AmountInput/AmountInput.tsx +4 -3
- package/src/lib/Components/AmountInput/types.ts +7 -0
- package/src/lib/Components/Avatar/Avatar.figma.tsx +29 -0
- package/src/lib/Components/Avatar/Avatar.stories.tsx +0 -1
- package/src/lib/Components/Avatar/Avatar.test.tsx +0 -1
- package/src/lib/Components/Banner/Banner.stories.tsx +3 -3
- package/src/lib/Components/Banner/Banner.test.tsx +0 -1
- package/src/lib/Components/BaseInput/BaseInput.tsx +66 -60
- package/src/lib/Components/BaseInput/types.ts +7 -0
- package/src/lib/Components/BottomSheet/BottomSheet.test.tsx +0 -1
- package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
- package/src/lib/Components/BottomSheet/CustomBackdrop.tsx +0 -2
- package/src/lib/Components/BottomSheet/CustomHandle.tsx +1 -1
- package/src/lib/Components/Button/BaseButton.test.tsx +0 -1
- package/src/lib/Components/Button/Button.stories.tsx +2 -2
- package/src/lib/Components/Card/Card.test.tsx +0 -1
- package/src/lib/Components/Card/Card.tsx +3 -2
- package/src/lib/Components/CardButton/CardButton.test.tsx +0 -1
- package/src/lib/Components/CardButton/types.ts +0 -1
- package/src/lib/Components/Checkbox/BaseCheckbox.tsx +1 -1
- package/src/lib/Components/Checkbox/Checkbox.test.tsx +0 -1
- package/src/lib/Components/ContentBanner/ContentBanner.stories.tsx +2 -2
- package/src/lib/Components/ContentBanner/ContentBanner.test.tsx +0 -1
- package/src/lib/Components/ContentBanner/types.ts +0 -1
- package/src/lib/Components/Divider/Divider.test.tsx +0 -1
- package/src/lib/Components/Icon/Icon.test.tsx +0 -1
- package/src/lib/Components/Icon/Icon.tsx +1 -1
- package/src/lib/Components/Icon/createIcon.ts +3 -2
- package/src/lib/Components/IconButton/IconButton.test.tsx +0 -1
- package/src/lib/Components/Link/Link.test.tsx +3 -3
- package/src/lib/Components/ListItem/ListItem.mdx +53 -49
- package/src/lib/Components/ListItem/ListItem.stories.tsx +51 -54
- package/src/lib/Components/ListItem/ListItem.tsx +80 -210
- package/src/lib/Components/ListItem/types.ts +10 -41
- package/src/lib/Components/MediaImage/MediaImage.mdx +103 -0
- package/src/lib/Components/MediaImage/MediaImage.stories.tsx +55 -0
- package/src/lib/Components/MediaImage/MediaImage.test.tsx +179 -0
- package/src/lib/Components/MediaImage/MediaImage.tsx +117 -0
- package/src/lib/Components/MediaImage/index.ts +2 -0
- package/src/lib/Components/MediaImage/types.ts +27 -0
- package/src/lib/Components/NavBar/NavBar.test.tsx +0 -1
- package/src/lib/Components/NavBar/NavBar.tsx +3 -3
- package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +2 -2
- package/src/lib/Components/SearchInput/SearchInput.mdx +14 -2
- package/src/lib/Components/SearchInput/SearchInput.stories.tsx +1 -19
- package/src/lib/Components/SearchInput/SearchInput.tsx +8 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +77 -51
- package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +0 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +42 -9
- package/src/lib/Components/SegmentedControl/SegmentedControlContext.tsx +4 -0
- package/src/lib/Components/SegmentedControl/types.ts +7 -0
- package/src/lib/Components/SegmentedControl/usePillLayout.ts +66 -19
- package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +1 -1
- package/src/lib/Components/Select/GlobalSelectContext.tsx +1 -1
- package/src/lib/Components/Select/Select.test.tsx +0 -1
- package/src/lib/Components/Select/Select.tsx +16 -14
- package/src/lib/Components/Skeleton/Skeleton.test.tsx +0 -1
- package/src/lib/Components/Slot/Slot.tsx +4 -0
- package/src/lib/Components/Spinner/Spinner.mdx +1 -3
- package/src/lib/Components/Spot/Spot.stories.tsx +0 -1
- package/src/lib/Components/Spot/types.ts +2 -2
- package/src/lib/Components/Stepper/Stepper.mdx +1 -3
- package/src/lib/Components/Stepper/Stepper.test.tsx +0 -1
- package/src/lib/Components/Subheader/Subheader.stories.tsx +0 -1
- package/src/lib/Components/Subheader/Subheader.test.tsx +0 -1
- package/src/lib/Components/Switch/BaseSwitch.tsx +1 -1
- package/src/lib/Components/Switch/Switch.test.tsx +0 -1
- package/src/lib/Components/TabBar/TabBar.test.tsx +0 -1
- package/src/lib/Components/TabBar/TabBar.tsx +12 -5
- package/src/lib/Components/TextInput/TextInput.mdx +14 -2
- package/src/lib/Components/TextInput/TextInput.stories.tsx +1 -28
- package/src/lib/Components/Tile/Tile.stories.tsx +0 -1
- package/src/lib/Components/Tile/Tile.test.tsx +0 -1
- package/src/lib/Components/TileButton/TileButton.test.tsx +0 -1
- package/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.tsx +1 -1
- package/src/lib/Components/Tooltip/GlobalTooltipContext.tsx +1 -7
- package/src/lib/Components/Tooltip/Tooltip.test.tsx +0 -1
- package/src/lib/Components/TriggerButton/TriggerButton.test.tsx +1 -1
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +1 -1
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.tsx +1 -1
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.tsx +1 -1
- package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +1 -1
- package/src/lib/Components/index.ts +1 -0
- package/src/lib/types/index.ts +7 -7
- package/src/lib/utils/react/extractTextFromChildren.ts +4 -4
- package/src/lib/utils/useControllableState/useControllableState.ts +7 -9
- package/src/lib/utils/useEvent/useGet.ts +3 -3
- package/src/styles/hooks/useStyleSheet.test.tsx +1 -1
- package/src/styles/lx/createStyledPressable.test.tsx +1 -1
- package/src/styles/lx/createStyledText.test.tsx +1 -1
- package/src/styles/lx/createStyledView.test.tsx +1 -1
- package/src/styles/lx/resolveStyle.test.tsx +0 -1
- package/src/styles/provider/LumenStyleSheetProvider.test.tsx +2 -2
- package/src/utils/icon-template.ts +2 -0
- package/dist/module/lib/Patterns/index.js +0 -4
- package/dist/module/lib/Patterns/index.js.map +0 -1
- package/dist/typescript/src/lib/Patterns/index.d.ts +0 -3
- package/dist/typescript/src/lib/Patterns/index.d.ts.map +0 -1
- package/src/lib/Patterns/index.ts +0 -1
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSafeContext,
|
|
3
3
|
DisabledProvider,
|
|
4
|
-
isTextChildren,
|
|
5
4
|
useDisabledContext,
|
|
6
5
|
} from '@ledgerhq/lumen-utils-shared';
|
|
7
|
-
import
|
|
6
|
+
import { ElementRef, ReactNode, Ref } from 'react';
|
|
8
7
|
import { StyleSheet, View } from 'react-native';
|
|
9
|
-
import { useStyleSheet
|
|
10
|
-
import { Spot } from '../Spot';
|
|
8
|
+
import { useStyleSheet } from '../../../styles';
|
|
11
9
|
import { Box, Pressable, Text } from '../Utility';
|
|
12
10
|
import {
|
|
13
11
|
ListItemContentProps,
|
|
12
|
+
ListItemContentRowProps,
|
|
14
13
|
ListItemDescriptionProps,
|
|
15
|
-
ListItemIconProps,
|
|
16
14
|
ListItemLeadingProps,
|
|
17
15
|
ListItemProps,
|
|
18
|
-
ListItemSpotProps,
|
|
19
16
|
ListItemTitleProps,
|
|
20
17
|
ListItemTrailingProps,
|
|
21
|
-
ListItemTruncateProps,
|
|
22
18
|
} from './types';
|
|
23
19
|
|
|
24
20
|
const [ListItemTrailingProvider, useListItemTrailingContext] =
|
|
@@ -64,17 +60,17 @@ const useRootStyles = ({ pressed }: { pressed: boolean }) => {
|
|
|
64
60
|
* import {
|
|
65
61
|
* ListItem,
|
|
66
62
|
* ListItemLeading,
|
|
67
|
-
* ListItemSpot,
|
|
68
63
|
* ListItemContent,
|
|
69
64
|
* ListItemTitle,
|
|
70
65
|
* ListItemDescription,
|
|
71
66
|
* ListItemTrailing,
|
|
67
|
+
* Spot,
|
|
72
68
|
* } from '@ledgerhq/lumen-ui-rnative';
|
|
73
69
|
* import { Wallet, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
74
70
|
*
|
|
75
71
|
* <ListItem onPress={() => console.log('Clicked!')}>
|
|
76
72
|
* <ListItemLeading>
|
|
77
|
-
* <
|
|
73
|
+
* <Spot size={48} appearance="icon" icon={Wallet} />
|
|
78
74
|
* <ListItemContent>
|
|
79
75
|
* <ListItemTitle>Balance</ListItemTitle>
|
|
80
76
|
* <ListItemDescription>Optional description</ListItemDescription>
|
|
@@ -127,7 +123,7 @@ const ListItemInner = ({
|
|
|
127
123
|
children,
|
|
128
124
|
}: {
|
|
129
125
|
pressed: boolean;
|
|
130
|
-
children:
|
|
126
|
+
children: ReactNode;
|
|
131
127
|
}) => {
|
|
132
128
|
const styles = useRootStyles({ pressed });
|
|
133
129
|
return (
|
|
@@ -139,7 +135,7 @@ const ListItemInner = ({
|
|
|
139
135
|
|
|
140
136
|
/**
|
|
141
137
|
* Container for the leading (left) part of the list item.
|
|
142
|
-
* Contains the visual element (
|
|
138
|
+
* Contains the visual element (Spot, Avatar, Icon) and the content (title + description).
|
|
143
139
|
*/
|
|
144
140
|
export const ListItemLeading = ({
|
|
145
141
|
children,
|
|
@@ -195,8 +191,8 @@ export const ListItemContent = ({
|
|
|
195
191
|
content: {
|
|
196
192
|
flex: isInTrailing ? 0 : 1,
|
|
197
193
|
minWidth: 0,
|
|
198
|
-
flexDirection: 'column',
|
|
199
194
|
gap: t.spacings.s4,
|
|
195
|
+
alignItems: isInTrailing ? 'flex-end' : 'flex-start',
|
|
200
196
|
},
|
|
201
197
|
}),
|
|
202
198
|
[isInTrailing],
|
|
@@ -217,16 +213,52 @@ export const ListItemContent = ({
|
|
|
217
213
|
ListItemContent.displayName = 'ListItemContent';
|
|
218
214
|
|
|
219
215
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
216
|
+
* Horizontal row container within ListItemContent to place a title or description
|
|
217
|
+
* alongside additional inline content (e.g. Tag) while preserving text truncation.
|
|
222
218
|
*/
|
|
223
|
-
export const
|
|
219
|
+
export const ListItemContentRow = ({
|
|
224
220
|
children,
|
|
225
221
|
lx = {},
|
|
226
222
|
style,
|
|
227
223
|
ref,
|
|
228
224
|
...viewProps
|
|
229
|
-
}:
|
|
225
|
+
}: ListItemContentRowProps & { ref?: Ref<View> }) => {
|
|
226
|
+
const styles = useStyleSheet(
|
|
227
|
+
(t) => ({
|
|
228
|
+
row: {
|
|
229
|
+
flexDirection: 'row',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
minWidth: 0,
|
|
232
|
+
gap: t.spacings.s8,
|
|
233
|
+
},
|
|
234
|
+
}),
|
|
235
|
+
[],
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<Box
|
|
240
|
+
ref={ref}
|
|
241
|
+
lx={lx}
|
|
242
|
+
style={StyleSheet.flatten([styles.row, style])}
|
|
243
|
+
{...viewProps}
|
|
244
|
+
>
|
|
245
|
+
{children}
|
|
246
|
+
</Box>
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
ListItemContentRow.displayName = 'ListItemContentRow';
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The main title of the list item.
|
|
254
|
+
*/
|
|
255
|
+
export const ListItemTitle = ({
|
|
256
|
+
children,
|
|
257
|
+
lx = {},
|
|
258
|
+
style,
|
|
259
|
+
ref,
|
|
260
|
+
...textProps
|
|
261
|
+
}: ListItemTitleProps & { ref?: Ref<ElementRef<typeof Text>> }) => {
|
|
230
262
|
const disabled = useDisabledContext({
|
|
231
263
|
consumerName: 'ListItemTitle',
|
|
232
264
|
contextRequired: true,
|
|
@@ -237,65 +269,37 @@ export const ListItemTitle = ({
|
|
|
237
269
|
});
|
|
238
270
|
|
|
239
271
|
const styles = useStyleSheet(
|
|
240
|
-
(t) => {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
gap: t.spacings.s4,
|
|
246
|
-
width: '100%',
|
|
272
|
+
(t) => ({
|
|
273
|
+
title: StyleSheet.flatten([
|
|
274
|
+
t.typographies.body2SemiBold,
|
|
275
|
+
{
|
|
276
|
+
minWidth: 0,
|
|
247
277
|
textAlign: isInTrailing ? 'right' : 'left',
|
|
248
|
-
|
|
278
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
249
279
|
} as const,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
asBox: boxStyle,
|
|
254
|
-
asText: StyleSheet.flatten([
|
|
255
|
-
t.typographies.body2SemiBold,
|
|
256
|
-
{
|
|
257
|
-
...boxStyle,
|
|
258
|
-
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
259
|
-
},
|
|
260
|
-
]),
|
|
261
|
-
};
|
|
262
|
-
},
|
|
263
|
-
[disabled],
|
|
280
|
+
]),
|
|
281
|
+
}),
|
|
282
|
+
[disabled, isInTrailing],
|
|
264
283
|
);
|
|
265
284
|
|
|
266
|
-
// If children is a string, render it directly as Text with truncation
|
|
267
|
-
if (isTextChildren(children)) {
|
|
268
|
-
return (
|
|
269
|
-
<Text
|
|
270
|
-
ref={ref as Ref<React.ElementRef<typeof Text>>}
|
|
271
|
-
lx={lx}
|
|
272
|
-
style={StyleSheet.flatten([styles.asText, style])}
|
|
273
|
-
numberOfLines={1}
|
|
274
|
-
ellipsizeMode='tail'
|
|
275
|
-
>
|
|
276
|
-
{children}
|
|
277
|
-
</Text>
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Otherwise, render as a row container for ListItemTruncate + Tag
|
|
282
285
|
return (
|
|
283
|
-
<
|
|
286
|
+
<Text
|
|
284
287
|
ref={ref}
|
|
285
288
|
lx={lx}
|
|
286
|
-
style={StyleSheet.flatten([styles.
|
|
287
|
-
{
|
|
289
|
+
style={StyleSheet.flatten([styles.title, style])}
|
|
290
|
+
numberOfLines={1}
|
|
291
|
+
ellipsizeMode='tail'
|
|
292
|
+
{...textProps}
|
|
288
293
|
>
|
|
289
294
|
{children}
|
|
290
|
-
</
|
|
295
|
+
</Text>
|
|
291
296
|
);
|
|
292
297
|
};
|
|
293
298
|
|
|
294
299
|
ListItemTitle.displayName = 'ListItemTitle';
|
|
295
300
|
|
|
296
301
|
/**
|
|
297
|
-
* Optional description below the title.
|
|
298
|
-
* ListItemTruncate + Tag for more complex layouts.
|
|
302
|
+
* Optional description text below the title.
|
|
299
303
|
* Automatically applies disabled styling when the parent ListItem is disabled.
|
|
300
304
|
*/
|
|
301
305
|
export const ListItemDescription = ({
|
|
@@ -303,8 +307,8 @@ export const ListItemDescription = ({
|
|
|
303
307
|
lx = {},
|
|
304
308
|
style,
|
|
305
309
|
ref,
|
|
306
|
-
...
|
|
307
|
-
}: ListItemDescriptionProps & { ref?: Ref<
|
|
310
|
+
...textProps
|
|
311
|
+
}: ListItemDescriptionProps & { ref?: Ref<ElementRef<typeof Text>> }) => {
|
|
308
312
|
const disabled = useDisabledContext({
|
|
309
313
|
consumerName: 'ListItemDescription',
|
|
310
314
|
contextRequired: true,
|
|
@@ -315,57 +319,30 @@ export const ListItemDescription = ({
|
|
|
315
319
|
});
|
|
316
320
|
|
|
317
321
|
const styles = useStyleSheet(
|
|
318
|
-
(t) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
gap: t.spacings.s4,
|
|
324
|
-
width: '100%',
|
|
322
|
+
(t) => ({
|
|
323
|
+
description: StyleSheet.flatten([
|
|
324
|
+
t.typographies.body3,
|
|
325
|
+
{
|
|
326
|
+
minWidth: 0,
|
|
325
327
|
textAlign: isInTrailing ? 'right' : 'left',
|
|
326
|
-
|
|
328
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.muted,
|
|
327
329
|
} as const,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return {
|
|
331
|
-
asBox: boxStyle,
|
|
332
|
-
asText: StyleSheet.flatten([
|
|
333
|
-
t.typographies.body3,
|
|
334
|
-
{
|
|
335
|
-
...boxStyle,
|
|
336
|
-
color: disabled ? t.colors.text.disabled : t.colors.text.muted,
|
|
337
|
-
},
|
|
338
|
-
]),
|
|
339
|
-
};
|
|
340
|
-
},
|
|
330
|
+
]),
|
|
331
|
+
}),
|
|
341
332
|
[disabled, isInTrailing],
|
|
342
333
|
);
|
|
343
334
|
|
|
344
|
-
// If children is a string, render it directly as Text with truncation
|
|
345
|
-
if (isTextChildren(children)) {
|
|
346
|
-
return (
|
|
347
|
-
<Text
|
|
348
|
-
ref={ref as Ref<React.ElementRef<typeof Text>>}
|
|
349
|
-
lx={lx}
|
|
350
|
-
style={StyleSheet.flatten([styles.asText, style])}
|
|
351
|
-
numberOfLines={1}
|
|
352
|
-
ellipsizeMode='tail'
|
|
353
|
-
>
|
|
354
|
-
{children}
|
|
355
|
-
</Text>
|
|
356
|
-
);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// Otherwise, render as a row container for ListItemTruncate + Tag
|
|
360
335
|
return (
|
|
361
|
-
<
|
|
336
|
+
<Text
|
|
362
337
|
ref={ref}
|
|
363
338
|
lx={lx}
|
|
364
|
-
style={StyleSheet.flatten([styles.
|
|
365
|
-
{
|
|
339
|
+
style={StyleSheet.flatten([styles.description, style])}
|
|
340
|
+
numberOfLines={1}
|
|
341
|
+
ellipsizeMode='tail'
|
|
342
|
+
{...textProps}
|
|
366
343
|
>
|
|
367
344
|
{children}
|
|
368
|
-
</
|
|
345
|
+
</Text>
|
|
369
346
|
);
|
|
370
347
|
};
|
|
371
348
|
|
|
@@ -386,7 +363,6 @@ export const ListItemTrailing = ({
|
|
|
386
363
|
() => ({
|
|
387
364
|
trailing: {
|
|
388
365
|
flexShrink: 0,
|
|
389
|
-
flexDirection: 'row',
|
|
390
366
|
alignItems: 'center',
|
|
391
367
|
},
|
|
392
368
|
}),
|
|
@@ -408,109 +384,3 @@ export const ListItemTrailing = ({
|
|
|
408
384
|
};
|
|
409
385
|
|
|
410
386
|
ListItemTrailing.displayName = 'ListItemTrailing';
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Spot adapter for ListItem. Automatically inherits disabled state from parent ListItem.
|
|
414
|
-
* Fixed at size 48 for consistent list item appearance.
|
|
415
|
-
*/
|
|
416
|
-
export const ListItemSpot = (props: ListItemSpotProps) => {
|
|
417
|
-
const disabled = useDisabledContext({
|
|
418
|
-
consumerName: 'ListItemSpot',
|
|
419
|
-
contextRequired: true,
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
return <Spot {...props} size={48} disabled={disabled} />;
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
ListItemSpot.displayName = 'ListItemSpot';
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Icon adapter for ListItem. Automatically inherits disabled state from parent ListItem.
|
|
429
|
-
* Fixed at size 24 for consistent list item appearance.
|
|
430
|
-
*/
|
|
431
|
-
export const ListItemIcon = ({
|
|
432
|
-
icon: Icon,
|
|
433
|
-
color,
|
|
434
|
-
lx = {},
|
|
435
|
-
style,
|
|
436
|
-
...viewProps
|
|
437
|
-
}: ListItemIconProps) => {
|
|
438
|
-
const { theme } = useTheme();
|
|
439
|
-
const disabled = useDisabledContext({
|
|
440
|
-
consumerName: 'ListItemIcon',
|
|
441
|
-
contextRequired: true,
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
return (
|
|
445
|
-
<Box
|
|
446
|
-
lx={lx}
|
|
447
|
-
style={StyleSheet.flatten([{ flexShrink: 0 }, style])}
|
|
448
|
-
{...viewProps}
|
|
449
|
-
>
|
|
450
|
-
<Icon
|
|
451
|
-
size={24}
|
|
452
|
-
style={{
|
|
453
|
-
color: disabled
|
|
454
|
-
? theme.colors.text.disabled
|
|
455
|
-
: (color ?? theme.colors.text.base),
|
|
456
|
-
}}
|
|
457
|
-
/>
|
|
458
|
-
</Box>
|
|
459
|
-
);
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
ListItemIcon.displayName = 'ListItemIcon';
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Text wrapper that truncates when space is limited.
|
|
466
|
-
* Use inside ListItemTitle or ListItemDescription when combining text with a Tag.
|
|
467
|
-
* Set variant='title' for title styling or variant='description' (default) for description styling.
|
|
468
|
-
*/
|
|
469
|
-
export const ListItemTruncate = ({
|
|
470
|
-
children,
|
|
471
|
-
variant = 'description',
|
|
472
|
-
lx = {},
|
|
473
|
-
style,
|
|
474
|
-
ref,
|
|
475
|
-
...textProps
|
|
476
|
-
}: ListItemTruncateProps & { ref?: Ref<React.ElementRef<typeof Text>> }) => {
|
|
477
|
-
const disabled = useDisabledContext({
|
|
478
|
-
consumerName: 'ListItemTruncate',
|
|
479
|
-
contextRequired: true,
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
const styles = useStyleSheet(
|
|
483
|
-
(t) => ({
|
|
484
|
-
truncate: StyleSheet.flatten([
|
|
485
|
-
variant === 'title'
|
|
486
|
-
? t.typographies.body2SemiBold
|
|
487
|
-
: t.typographies.body3,
|
|
488
|
-
{
|
|
489
|
-
color: disabled
|
|
490
|
-
? t.colors.text.disabled
|
|
491
|
-
: variant === 'title'
|
|
492
|
-
? t.colors.text.base
|
|
493
|
-
: t.colors.text.muted,
|
|
494
|
-
minWidth: 0,
|
|
495
|
-
flexShrink: 1,
|
|
496
|
-
},
|
|
497
|
-
]),
|
|
498
|
-
}),
|
|
499
|
-
[disabled, variant],
|
|
500
|
-
);
|
|
501
|
-
|
|
502
|
-
return (
|
|
503
|
-
<Text
|
|
504
|
-
ref={ref}
|
|
505
|
-
lx={lx}
|
|
506
|
-
style={StyleSheet.flatten([styles.truncate, style])}
|
|
507
|
-
numberOfLines={1}
|
|
508
|
-
ellipsizeMode='tail'
|
|
509
|
-
{...textProps}
|
|
510
|
-
>
|
|
511
|
-
{children}
|
|
512
|
-
</Text>
|
|
513
|
-
);
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
ListItemTruncate.displayName = 'ListItemTruncate';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {
|
|
3
|
-
LumenTextStyle,
|
|
4
2
|
StyledPressableProps,
|
|
5
3
|
StyledTextProps,
|
|
6
4
|
StyledViewProps,
|
|
7
5
|
} from '../../../styles';
|
|
8
|
-
import { DiscriminatedSpotProps } from '../Spot';
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* Context value for passing state to sub-components
|
|
@@ -52,6 +49,16 @@ export type ListItemContentProps = {
|
|
|
52
49
|
children: React.ReactNode;
|
|
53
50
|
} & Omit<StyledViewProps, 'children'>;
|
|
54
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Props for the ListItemContentRow component
|
|
54
|
+
*/
|
|
55
|
+
export type ListItemContentRowProps = {
|
|
56
|
+
/**
|
|
57
|
+
* The row content (ListItemTitle or ListItemDescription alongside inline elements like Tag)
|
|
58
|
+
*/
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
61
|
+
|
|
55
62
|
/**
|
|
56
63
|
* Props for the ListItemTitle component
|
|
57
64
|
*/
|
|
@@ -81,41 +88,3 @@ export type ListItemTrailingProps = {
|
|
|
81
88
|
*/
|
|
82
89
|
children: React.ReactNode;
|
|
83
90
|
} & Omit<StyledViewProps, 'children'>;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Props for the ListItemTruncate component
|
|
87
|
-
* Used to truncate text that should when ListItemDescription or ListItemTitle contain custom content
|
|
88
|
-
*/
|
|
89
|
-
export type ListItemTruncateProps = {
|
|
90
|
-
/**
|
|
91
|
-
* The text content to truncate
|
|
92
|
-
*/
|
|
93
|
-
children: string;
|
|
94
|
-
/**
|
|
95
|
-
* The variant determines typography and color styling.
|
|
96
|
-
* Use 'title' inside ListItemTitle and 'description' inside ListItemDescription.
|
|
97
|
-
* @default 'description'
|
|
98
|
-
*/
|
|
99
|
-
variant?: 'title' | 'description';
|
|
100
|
-
} & Omit<StyledTextProps, 'children'>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Props for the ListItemSpot component
|
|
104
|
-
* Spot adapter that inherits disabled state from parent ListItem
|
|
105
|
-
*/
|
|
106
|
-
export type ListItemSpotProps = DiscriminatedSpotProps &
|
|
107
|
-
Omit<StyledViewProps, 'children'>;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Props for the ListItemIcon component
|
|
111
|
-
*/
|
|
112
|
-
export type ListItemIconProps = {
|
|
113
|
-
/**
|
|
114
|
-
* The icon component to render
|
|
115
|
-
*/
|
|
116
|
-
icon: React.ComponentType<any>;
|
|
117
|
-
/**
|
|
118
|
-
* Optional color override. If not provided, uses theme color with disabled state handling.
|
|
119
|
-
*/
|
|
120
|
-
color?: LumenTextStyle['color'];
|
|
121
|
-
} & Omit<StyledViewProps, 'children'>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as MediaImageStories from './MediaImage.stories';
|
|
3
|
+
import { MediaImage } from './MediaImage';
|
|
4
|
+
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
5
|
+
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<Meta title='Communication/MediaImage' of={MediaImageStories} />
|
|
9
|
+
|
|
10
|
+
# MediaImage
|
|
11
|
+
|
|
12
|
+
<CustomTabs>
|
|
13
|
+
<Tab label="Overview">
|
|
14
|
+
|
|
15
|
+
## Introduction
|
|
16
|
+
|
|
17
|
+
MediaImage displays an image with consistent sizing and shape. When the image fails to load or no source is provided, a background placeholder is shown automatically. This React Native implementation ensures consistent behavior across mobile platforms.
|
|
18
|
+
|
|
19
|
+
> View in [Figma](https://www.figma.com/design/zSkvGGiqcnhywp2l3HTHxA/1.-Symbol-Library?node-id=6159-1866).
|
|
20
|
+
|
|
21
|
+
## Anatomy
|
|
22
|
+
|
|
23
|
+
<Canvas of={MediaImageStories.Base} />
|
|
24
|
+
|
|
25
|
+
- **Container**: Sized wrapper with rounded corners and overflow clipping
|
|
26
|
+
- **Image**: Fills the container using React Native's `Image` component
|
|
27
|
+
- **Fallback**: Background placeholder shown on missing or broken source
|
|
28
|
+
|
|
29
|
+
## Properties
|
|
30
|
+
|
|
31
|
+
### Overview
|
|
32
|
+
|
|
33
|
+
<Canvas of={MediaImageStories.Base} />
|
|
34
|
+
<Controls of={MediaImageStories.Base} />
|
|
35
|
+
|
|
36
|
+
### Sizes
|
|
37
|
+
|
|
38
|
+
Eight sizes are available (12, 16, 20, 24, 32, 40, 48, 56). Border radius scales with size.
|
|
39
|
+
|
|
40
|
+
<Canvas of={MediaImageStories.SizeShowcase} />
|
|
41
|
+
|
|
42
|
+
### Shapes
|
|
43
|
+
|
|
44
|
+
<Canvas of={MediaImageStories.ShapeShowcase} />
|
|
45
|
+
|
|
46
|
+
- **square** (default): Rounded corners that scale with size
|
|
47
|
+
- **circle**: Fully rounded
|
|
48
|
+
|
|
49
|
+
## Accessibility
|
|
50
|
+
|
|
51
|
+
- The root element uses `accessibilityRole="image"` with `accessibilityLabel` derived from `alt`.
|
|
52
|
+
- The inner `Image` is marked `accessible={false}` to avoid duplicate announcements.
|
|
53
|
+
- Always provide a meaningful `alt` prop so screen readers can announce the image.
|
|
54
|
+
|
|
55
|
+
</Tab>
|
|
56
|
+
<Tab label="Implementation">
|
|
57
|
+
|
|
58
|
+
## Setup
|
|
59
|
+
|
|
60
|
+
Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
|
|
61
|
+
|
|
62
|
+
### Basic Usage
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { MediaImage } from '@ledgerhq/lumen-ui-rnative';
|
|
66
|
+
|
|
67
|
+
function MyComponent() {
|
|
68
|
+
return <MediaImage src='https://example.com/icon.png' alt='Bitcoin' size={32} />;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### With Circle Shape
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<MediaImage src='https://example.com/icon.png' alt='Ethereum' size={48} shape='circle' />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Custom Styling
|
|
79
|
+
|
|
80
|
+
Use the `lx` prop for token-based layout adjustments:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
<MediaImage
|
|
84
|
+
src='https://example.com/icon.png'
|
|
85
|
+
alt='Token'
|
|
86
|
+
size={40}
|
|
87
|
+
lx={{ marginRight: 's8' }}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
You can also use the `style` prop for escape-hatch styling:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<MediaImage
|
|
95
|
+
src='https://example.com/icon.png'
|
|
96
|
+
alt='Token'
|
|
97
|
+
size={40}
|
|
98
|
+
style={{ marginRight: 8 }}
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
</Tab>
|
|
103
|
+
</CustomTabs>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
+
import { Box } from '../Utility';
|
|
3
|
+
import { MediaImage } from './MediaImage';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
component: MediaImage,
|
|
7
|
+
title: 'Communication/MediaImage',
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
source: {
|
|
11
|
+
language: 'tsx',
|
|
12
|
+
format: true,
|
|
13
|
+
type: 'code',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof MediaImage>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
const exampleSrc = 'https://crypto-icons.ledger.com/ADA.png';
|
|
23
|
+
|
|
24
|
+
export const Base: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
src: exampleSrc,
|
|
27
|
+
alt: 'Cardano',
|
|
28
|
+
size: 40,
|
|
29
|
+
shape: 'square',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const SizeShowcase: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<Box lx={{ flexDirection: 'row', alignItems: 'flex-end', gap: 's16' }}>
|
|
36
|
+
<MediaImage src={exampleSrc} alt='Size 12' size={12} />
|
|
37
|
+
<MediaImage src={exampleSrc} alt='Size 16' size={16} />
|
|
38
|
+
<MediaImage src={exampleSrc} alt='Size 20' size={20} />
|
|
39
|
+
<MediaImage src={exampleSrc} alt='Size 24' size={24} />
|
|
40
|
+
<MediaImage src={exampleSrc} alt='Size 32' size={32} />
|
|
41
|
+
<MediaImage src={exampleSrc} alt='Size 40' size={40} />
|
|
42
|
+
<MediaImage src={exampleSrc} alt='Size 48' size={48} />
|
|
43
|
+
<MediaImage src={exampleSrc} alt='Size 56' size={56} />
|
|
44
|
+
</Box>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const ShapeShowcase: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's24' }}>
|
|
51
|
+
<MediaImage src={exampleSrc} alt='Square' size={48} shape='square' />
|
|
52
|
+
<MediaImage src={exampleSrc} alt='Circle' size={48} shape='circle' />
|
|
53
|
+
</Box>
|
|
54
|
+
),
|
|
55
|
+
};
|