@ledgerhq/lumen-ui-rnative 0.1.13 → 0.1.15
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/AmountDisplay/AmountDisplay.test.js +0 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.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/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/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/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/Tag/Tag.js +1 -0
- package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.mdx +6 -0
- package/dist/module/lib/Components/Tag/Tag.stories.js +10 -0
- package/dist/module/lib/Components/Tag/Tag.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/Symbols/Icons/Csv.js +1 -1
- package/dist/module/lib/Symbols/Icons/Csv.js.map +1 -1
- package/dist/module/lib/Symbols/Icons/TriangleDown.js +47 -0
- package/dist/module/lib/Symbols/Icons/TriangleDown.js.map +1 -0
- package/dist/module/lib/Symbols/Icons/TriangleUp.js +47 -0
- package/dist/module/lib/Symbols/Icons/TriangleUp.js.map +1 -0
- package/dist/module/lib/Symbols/index.js +2 -0
- package/dist/module/lib/Symbols/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/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/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/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/Tag/Tag.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/Symbols/Icons/TriangleDown.d.ts +35 -0
- package/dist/typescript/src/lib/Symbols/Icons/TriangleDown.d.ts.map +1 -0
- package/dist/typescript/src/lib/Symbols/Icons/TriangleUp.d.ts +35 -0
- package/dist/typescript/src/lib/Symbols/Icons/TriangleUp.d.ts.map +1 -0
- package/dist/typescript/src/lib/Symbols/index.d.ts +2 -0
- package/dist/typescript/src/lib/Symbols/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/AmountDisplay/AmountDisplay.test.tsx +0 -1
- 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/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/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/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/Tag/Tag.mdx +6 -0
- package/src/lib/Components/Tag/Tag.stories.tsx +8 -0
- package/src/lib/Components/Tag/Tag.tsx +3 -1
- 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/Symbols/Icons/Csv.tsx +1 -1
- package/src/lib/Symbols/Icons/TriangleDown.tsx +42 -0
- package/src/lib/Symbols/Icons/TriangleUp.tsx +42 -0
- package/src/lib/Symbols/index.ts +2 -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'>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, jest } from '@jest/globals';
|
|
2
2
|
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
3
|
import { render, screen, fireEvent } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import {
|
|
7
6
|
NavBar,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
-
import
|
|
2
|
+
import { Children, isValidElement, ReactNode } from 'react';
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { useCommonTranslation } from '../../../i18n';
|
|
5
5
|
import { useStyleSheet } from '../../../styles';
|
|
@@ -35,8 +35,8 @@ function extractSlots(children: ReactNode): Slots {
|
|
|
35
35
|
trailing: null,
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
if (!
|
|
38
|
+
Children.forEach(children, (child) => {
|
|
39
|
+
if (!isValidElement(child)) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
|
2
2
|
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
3
|
import { render, screen } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
5
|
+
import { createRef } from 'react';
|
|
6
6
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
7
|
import { PageIndicator } from './PageIndicator';
|
|
8
8
|
|
|
@@ -162,7 +162,7 @@ describe('PageIndicator Component', () => {
|
|
|
162
162
|
|
|
163
163
|
describe('Props', () => {
|
|
164
164
|
it('should accept ref prop', () => {
|
|
165
|
-
const ref =
|
|
165
|
+
const ref = createRef<React.ElementRef<typeof PageIndicator>>();
|
|
166
166
|
renderWithProvider(
|
|
167
167
|
<PageIndicator
|
|
168
168
|
ref={ref}
|
|
@@ -61,7 +61,6 @@ Use the library as part of `@ledgerhq/lumen-ui-rnative`. See the [Setup Guide
|
|
|
61
61
|
Control selected value in state at the top level and pass it to SegmentedControl. Buttons use value to identify themselves; selected state is derived from context.
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
import React from 'react';
|
|
65
64
|
import { SegmentedControl, SegmentedControlButton } from '@ledgerhq/lumen-ui-rnative';
|
|
66
65
|
|
|
67
66
|
export default function Example() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
-
import
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { Coins, Nft, TransferHorizontal, Settings } from '../../Symbols';
|
|
4
4
|
import { Box } from '../Utility';
|
|
5
5
|
import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
|
|
@@ -14,29 +14,22 @@ const meta = {
|
|
|
14
14
|
layout: 'centered',
|
|
15
15
|
backgrounds: { default: 'light' },
|
|
16
16
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
selectedValue: {
|
|
32
|
-
control: 'text',
|
|
33
|
-
},
|
|
34
|
-
children: {
|
|
35
|
-
control: false,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<Box
|
|
20
|
+
lx={{
|
|
21
|
+
width: 's320',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<Story />
|
|
27
|
+
</Box>
|
|
28
|
+
),
|
|
29
|
+
],
|
|
38
30
|
args: {
|
|
39
31
|
appearance: 'background',
|
|
32
|
+
tabLayout: 'fixed',
|
|
40
33
|
},
|
|
41
34
|
} satisfies Meta<typeof SegmentedControl>;
|
|
42
35
|
|
|
@@ -49,20 +42,16 @@ export const Base: Story = {
|
|
|
49
42
|
const [state, setState] = useState('send');
|
|
50
43
|
|
|
51
44
|
return (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</SegmentedControlButton>
|
|
63
|
-
<SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
|
|
64
|
-
</SegmentedControl>
|
|
65
|
-
</Box>
|
|
45
|
+
<SegmentedControl
|
|
46
|
+
{...args}
|
|
47
|
+
selectedValue={state}
|
|
48
|
+
onSelectedChange={setState}
|
|
49
|
+
accessibilityLabel='Transaction type'
|
|
50
|
+
>
|
|
51
|
+
<SegmentedControlButton value='send'>Send</SegmentedControlButton>
|
|
52
|
+
<SegmentedControlButton value='receive'>Receive</SegmentedControlButton>
|
|
53
|
+
<SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
|
|
54
|
+
</SegmentedControl>
|
|
66
55
|
);
|
|
67
56
|
},
|
|
68
57
|
};
|
|
@@ -96,23 +85,60 @@ export const WithIcons: Story = {
|
|
|
96
85
|
},
|
|
97
86
|
};
|
|
98
87
|
|
|
88
|
+
export const TabLayoutShowcase: Story = {
|
|
89
|
+
args: {} as React.ComponentProps<typeof SegmentedControl>,
|
|
90
|
+
render: (args) => {
|
|
91
|
+
const [fitState, setFitState] = useState('send');
|
|
92
|
+
const [fixedState, setFixedState] = useState('send');
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Box lx={{ gap: 's24' }} style={{ width: '100%' }}>
|
|
96
|
+
<SegmentedControl
|
|
97
|
+
{...args}
|
|
98
|
+
tabLayout='fit'
|
|
99
|
+
selectedValue={fitState}
|
|
100
|
+
onSelectedChange={setFitState}
|
|
101
|
+
accessibilityLabel='Fit layout'
|
|
102
|
+
>
|
|
103
|
+
<SegmentedControlButton value='send'>Send</SegmentedControlButton>
|
|
104
|
+
<SegmentedControlButton value='receive'>
|
|
105
|
+
Receive
|
|
106
|
+
</SegmentedControlButton>
|
|
107
|
+
<SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
|
|
108
|
+
</SegmentedControl>
|
|
109
|
+
<SegmentedControl
|
|
110
|
+
{...args}
|
|
111
|
+
tabLayout='fixed'
|
|
112
|
+
selectedValue={fixedState}
|
|
113
|
+
onSelectedChange={setFixedState}
|
|
114
|
+
accessibilityLabel='Fixed layout'
|
|
115
|
+
>
|
|
116
|
+
<SegmentedControlButton value='send'>Send</SegmentedControlButton>
|
|
117
|
+
<SegmentedControlButton value='receive'>
|
|
118
|
+
Receive
|
|
119
|
+
</SegmentedControlButton>
|
|
120
|
+
<SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
|
|
121
|
+
</SegmentedControl>
|
|
122
|
+
</Box>
|
|
123
|
+
);
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
99
127
|
export const Disabled: Story = {
|
|
100
128
|
args: {} as React.ComponentProps<typeof SegmentedControl>,
|
|
101
129
|
render: (args) => (
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</SegmentedControl>
|
|
116
|
-
</Box>
|
|
130
|
+
<SegmentedControl
|
|
131
|
+
{...args}
|
|
132
|
+
selectedValue='receive'
|
|
133
|
+
onSelectedChange={() => {
|
|
134
|
+
/* empty */
|
|
135
|
+
}}
|
|
136
|
+
accessibilityLabel='Transaction type (disabled)'
|
|
137
|
+
disabled
|
|
138
|
+
>
|
|
139
|
+
<SegmentedControlButton value='send'>Send</SegmentedControlButton>
|
|
140
|
+
<SegmentedControlButton value='receive'>Receive</SegmentedControlButton>
|
|
141
|
+
<SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
|
|
142
|
+
</SegmentedControl>
|
|
117
143
|
),
|
|
118
144
|
};
|