@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,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, fireEvent } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
|
|
7
6
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
2
3
|
import Animated from 'react-native-reanimated';
|
|
3
4
|
import { useStyleSheet } from '../../../styles';
|
|
4
5
|
import type { LumenTextStyle, LumenTypographyTokenName } from '../../../styles';
|
|
@@ -23,10 +24,15 @@ export function SegmentedControlButton({
|
|
|
23
24
|
onPress,
|
|
24
25
|
...props
|
|
25
26
|
}: SegmentedControlButtonProps) {
|
|
26
|
-
const {
|
|
27
|
-
|
|
27
|
+
const {
|
|
28
|
+
selectedValue,
|
|
29
|
+
onSelectedChange,
|
|
30
|
+
disabled,
|
|
31
|
+
tabLayout,
|
|
32
|
+
registerButtonLayout,
|
|
33
|
+
} = useSegmentedControlContext();
|
|
28
34
|
const selected = selectedValue === value;
|
|
29
|
-
const styles = useButtonStyles({ selected, disabled });
|
|
35
|
+
const styles = useButtonStyles({ selected, disabled, tabLayout });
|
|
30
36
|
|
|
31
37
|
function handlePress() {
|
|
32
38
|
if (!disabled) {
|
|
@@ -35,9 +41,17 @@ export function SegmentedControlButton({
|
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
|
|
44
|
+
function handleLayout(e: LayoutChangeEvent) {
|
|
45
|
+
if (tabLayout === 'fit') {
|
|
46
|
+
const { x, width } = e.nativeEvent.layout;
|
|
47
|
+
registerButtonLayout(value, { x, width });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
38
51
|
return (
|
|
39
52
|
<Pressable
|
|
40
53
|
onPress={handlePress}
|
|
54
|
+
onLayout={handleLayout}
|
|
41
55
|
disabled={disabled}
|
|
42
56
|
accessibilityState={{ selected, disabled }}
|
|
43
57
|
style={styles.button}
|
|
@@ -53,6 +67,7 @@ export function SegmentedControlButton({
|
|
|
53
67
|
typography={styles.typography}
|
|
54
68
|
lx={{ color: styles.textColor }}
|
|
55
69
|
style={styles.label}
|
|
70
|
+
numberOfLines={1}
|
|
56
71
|
>
|
|
57
72
|
{children}
|
|
58
73
|
</Text>
|
|
@@ -66,14 +81,16 @@ SegmentedControlButton.displayName = 'SegmentedControlButton';
|
|
|
66
81
|
function useButtonStyles({
|
|
67
82
|
selected,
|
|
68
83
|
disabled,
|
|
84
|
+
tabLayout,
|
|
69
85
|
}: {
|
|
70
86
|
selected: boolean;
|
|
71
87
|
disabled?: boolean;
|
|
88
|
+
tabLayout: 'fit' | 'fixed';
|
|
72
89
|
}) {
|
|
73
90
|
const styles = useStyleSheet(
|
|
74
91
|
(t) => ({
|
|
75
92
|
button: {
|
|
76
|
-
flex: 1,
|
|
93
|
+
flex: tabLayout === 'fixed' ? 1 : undefined,
|
|
77
94
|
flexDirection: 'row',
|
|
78
95
|
alignItems: 'center',
|
|
79
96
|
justifyContent: 'center',
|
|
@@ -91,13 +108,15 @@ function useButtonStyles({
|
|
|
91
108
|
label: {
|
|
92
109
|
textAlign: 'center',
|
|
93
110
|
includeFontPadding: false,
|
|
111
|
+
flexShrink: 1,
|
|
94
112
|
},
|
|
95
113
|
iconWrap: {
|
|
96
114
|
flexDirection: 'row',
|
|
97
115
|
alignItems: 'center',
|
|
116
|
+
flexShrink: 0,
|
|
98
117
|
},
|
|
99
118
|
}),
|
|
100
|
-
[],
|
|
119
|
+
[tabLayout],
|
|
101
120
|
);
|
|
102
121
|
const typography: LumenTypographyTokenName = selected
|
|
103
122
|
? 'body2SemiBold'
|
|
@@ -114,6 +133,7 @@ export function SegmentedControl({
|
|
|
114
133
|
children,
|
|
115
134
|
disabled: disabledProp,
|
|
116
135
|
appearance = 'background',
|
|
136
|
+
tabLayout = 'fixed',
|
|
117
137
|
...props
|
|
118
138
|
}: SegmentedControlProps) {
|
|
119
139
|
const disabled = useDisabledContext({
|
|
@@ -123,19 +143,28 @@ export function SegmentedControl({
|
|
|
123
143
|
const styles = useRootStyles({
|
|
124
144
|
disabled: Boolean(disabled),
|
|
125
145
|
appearance,
|
|
146
|
+
tabLayout,
|
|
126
147
|
});
|
|
127
148
|
const selectedIndex = useSegmentedControlSelectedIndex(
|
|
128
149
|
selectedValue,
|
|
129
150
|
children,
|
|
130
151
|
);
|
|
131
|
-
const { onLayout, animatedPillStyle } = usePillLayout({
|
|
152
|
+
const { onLayout, animatedPillStyle, registerButtonLayout } = usePillLayout({
|
|
132
153
|
selectedIndex,
|
|
154
|
+
selectedValue,
|
|
133
155
|
children,
|
|
156
|
+
tabLayout,
|
|
134
157
|
});
|
|
135
158
|
|
|
136
159
|
return (
|
|
137
160
|
<SegmentedControlContextProvider
|
|
138
|
-
value={{
|
|
161
|
+
value={{
|
|
162
|
+
selectedValue,
|
|
163
|
+
onSelectedChange,
|
|
164
|
+
disabled,
|
|
165
|
+
tabLayout,
|
|
166
|
+
registerButtonLayout,
|
|
167
|
+
}}
|
|
139
168
|
>
|
|
140
169
|
<Box
|
|
141
170
|
accessibilityRole='radiogroup'
|
|
@@ -160,9 +189,11 @@ SegmentedControl.displayName = 'SegmentedControl';
|
|
|
160
189
|
function useRootStyles({
|
|
161
190
|
disabled,
|
|
162
191
|
appearance,
|
|
192
|
+
tabLayout,
|
|
163
193
|
}: {
|
|
164
194
|
disabled: boolean;
|
|
165
195
|
appearance: 'background' | 'no-background';
|
|
196
|
+
tabLayout: 'fit' | 'fixed';
|
|
166
197
|
}) {
|
|
167
198
|
return useStyleSheet(
|
|
168
199
|
(t) => ({
|
|
@@ -170,7 +201,9 @@ function useRootStyles({
|
|
|
170
201
|
flexDirection: 'row',
|
|
171
202
|
alignItems: 'center',
|
|
172
203
|
position: 'relative',
|
|
173
|
-
|
|
204
|
+
...(tabLayout === 'fixed'
|
|
205
|
+
? { width: '100%' }
|
|
206
|
+
: { alignSelf: 'flex-start' }),
|
|
174
207
|
borderRadius: t.borderRadius.md,
|
|
175
208
|
backgroundColor:
|
|
176
209
|
appearance === 'background' ? t.colors.bg.surface : 'transparent',
|
|
@@ -186,6 +219,6 @@ function useRootStyles({
|
|
|
186
219
|
zIndex: 0,
|
|
187
220
|
},
|
|
188
221
|
}),
|
|
189
|
-
[disabled, appearance],
|
|
222
|
+
[disabled, appearance, tabLayout],
|
|
190
223
|
);
|
|
191
224
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
2
|
|
|
3
|
+
export type ButtonLayout = { x: number; width: number };
|
|
4
|
+
|
|
3
5
|
export type SegmentedControlContextValue = {
|
|
4
6
|
selectedValue: string;
|
|
5
7
|
onSelectedChange: (value: string) => void;
|
|
6
8
|
disabled: boolean;
|
|
9
|
+
tabLayout: 'fit' | 'fixed';
|
|
10
|
+
registerButtonLayout: (value: string, layout: ButtonLayout) => void;
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
const [SegmentedControlContextProvider, _useSegmentedControlSafeContext] =
|
|
@@ -21,6 +21,13 @@ export type SegmentedControlProps = {
|
|
|
21
21
|
* @default 'background'
|
|
22
22
|
*/
|
|
23
23
|
appearance?: 'background' | 'no-background';
|
|
24
|
+
/**
|
|
25
|
+
* Controls how tab widths are calculated.
|
|
26
|
+
* - "fit": each tab sizes to its content
|
|
27
|
+
* - "fixed": all tabs share equal width, filling the container
|
|
28
|
+
* @default 'fixed'
|
|
29
|
+
*/
|
|
30
|
+
tabLayout?: 'fit' | 'fixed';
|
|
24
31
|
/**
|
|
25
32
|
* Accessible label for the control (e.g. "File view").
|
|
26
33
|
*/
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
Children,
|
|
3
|
+
isValidElement,
|
|
4
|
+
ReactNode,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useMemo,
|
|
8
|
+
useRef,
|
|
9
|
+
} from 'react';
|
|
2
10
|
import { LayoutChangeEvent } from 'react-native';
|
|
3
11
|
import {
|
|
4
12
|
useAnimatedStyle,
|
|
@@ -6,15 +14,16 @@ import {
|
|
|
6
14
|
withTiming,
|
|
7
15
|
} from 'react-native-reanimated';
|
|
8
16
|
import { useTimingConfig } from '../../Animations/useTimingConfig';
|
|
17
|
+
import type { ButtonLayout } from './SegmentedControlContext';
|
|
9
18
|
|
|
10
19
|
export function useSegmentedControlSelectedIndex(
|
|
11
20
|
selectedValue: string,
|
|
12
|
-
children:
|
|
21
|
+
children: ReactNode,
|
|
13
22
|
): number {
|
|
14
23
|
return useMemo(
|
|
15
24
|
() =>
|
|
16
|
-
|
|
17
|
-
if (
|
|
25
|
+
Children.toArray(children).findIndex((child) => {
|
|
26
|
+
if (isValidElement(child) && child.props != null) {
|
|
18
27
|
return (child.props as { value?: string }).value === selectedValue;
|
|
19
28
|
}
|
|
20
29
|
return false;
|
|
@@ -25,17 +34,22 @@ export function useSegmentedControlSelectedIndex(
|
|
|
25
34
|
|
|
26
35
|
type UsePillLayoutParams = {
|
|
27
36
|
selectedIndex: number;
|
|
37
|
+
selectedValue: string;
|
|
28
38
|
children: React.ReactNode;
|
|
39
|
+
tabLayout: 'fit' | 'fixed';
|
|
29
40
|
};
|
|
30
41
|
|
|
31
42
|
export function usePillLayout({
|
|
32
43
|
selectedIndex,
|
|
44
|
+
selectedValue,
|
|
33
45
|
children,
|
|
46
|
+
tabLayout,
|
|
34
47
|
}: UsePillLayoutParams) {
|
|
35
48
|
const pillTranslateX = useSharedValue(0);
|
|
36
49
|
const pillWidth = useSharedValue(0);
|
|
37
50
|
const pillHeight = useSharedValue(0);
|
|
38
51
|
const hasLayoutRef = useRef(false);
|
|
52
|
+
const buttonLayoutsRef = useRef(new Map<string, ButtonLayout>());
|
|
39
53
|
|
|
40
54
|
const timingConfig = useTimingConfig({
|
|
41
55
|
duration: 300,
|
|
@@ -44,29 +58,62 @@ export function usePillLayout({
|
|
|
44
58
|
|
|
45
59
|
const onLayout = (e: LayoutChangeEvent): void => {
|
|
46
60
|
const { width, height } = e.nativeEvent.layout;
|
|
47
|
-
const count = React.Children.count(children);
|
|
48
|
-
const slotWidth = count > 0 ? width / count : 0;
|
|
49
|
-
|
|
50
|
-
pillWidth.value = slotWidth;
|
|
51
61
|
pillHeight.value = height;
|
|
52
62
|
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
if (tabLayout === 'fixed') {
|
|
64
|
+
const count = React.Children.count(children);
|
|
65
|
+
const slotWidth = count > 0 ? width / count : 0;
|
|
66
|
+
pillWidth.value = slotWidth;
|
|
67
|
+
|
|
68
|
+
if (!hasLayoutRef.current) {
|
|
69
|
+
hasLayoutRef.current = true;
|
|
70
|
+
if (selectedIndex >= 0) {
|
|
71
|
+
pillTranslateX.value = selectedIndex * slotWidth;
|
|
72
|
+
}
|
|
57
73
|
}
|
|
58
74
|
}
|
|
59
75
|
};
|
|
60
76
|
|
|
77
|
+
const registerButtonLayout = useCallback(
|
|
78
|
+
(value: string, layout: ButtonLayout): void => {
|
|
79
|
+
buttonLayoutsRef.current.set(value, layout);
|
|
80
|
+
|
|
81
|
+
if (tabLayout === 'fit' && !hasLayoutRef.current) {
|
|
82
|
+
hasLayoutRef.current = true;
|
|
83
|
+
if (value === selectedValue) {
|
|
84
|
+
pillTranslateX.value = layout.x;
|
|
85
|
+
pillWidth.value = layout.width;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
[tabLayout, selectedValue, pillTranslateX, pillWidth],
|
|
90
|
+
);
|
|
91
|
+
|
|
61
92
|
useEffect(() => {
|
|
62
93
|
if (!hasLayoutRef.current) return;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
94
|
+
|
|
95
|
+
if (tabLayout === 'fit') {
|
|
96
|
+
const layout = buttonLayoutsRef.current.get(selectedValue);
|
|
97
|
+
if (layout) {
|
|
98
|
+
pillTranslateX.value = withTiming(layout.x, timingConfig);
|
|
99
|
+
pillWidth.value = withTiming(layout.width, timingConfig);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
if (selectedIndex >= 0 && pillWidth.value > 0) {
|
|
103
|
+
pillTranslateX.value = withTiming(
|
|
104
|
+
selectedIndex * pillWidth.value,
|
|
105
|
+
timingConfig,
|
|
106
|
+
);
|
|
107
|
+
}
|
|
68
108
|
}
|
|
69
|
-
}, [
|
|
109
|
+
}, [
|
|
110
|
+
selectedIndex,
|
|
111
|
+
selectedValue,
|
|
112
|
+
tabLayout,
|
|
113
|
+
pillWidth,
|
|
114
|
+
pillTranslateX,
|
|
115
|
+
timingConfig,
|
|
116
|
+
]);
|
|
70
117
|
|
|
71
118
|
const animatedPillStyle = useAnimatedStyle(
|
|
72
119
|
() => ({
|
|
@@ -77,5 +124,5 @@ export function usePillLayout({
|
|
|
77
124
|
[pillTranslateX, pillWidth, pillHeight],
|
|
78
125
|
);
|
|
79
126
|
|
|
80
|
-
return { onLayout, animatedPillStyle };
|
|
127
|
+
return { onLayout, animatedPillStyle, registerButtonLayout };
|
|
81
128
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useMemo, ReactNode } from 'react';
|
|
3
3
|
import { SelectData } from './types';
|
|
4
4
|
|
|
5
5
|
type GlobalSelectBottomSheetContextValue = {
|
|
@@ -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, fireEvent } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { GlobalSelectBottomSheet } from './GlobalSelectBottomSheet';
|
|
7
6
|
import { GlobalSelectProvider } from './GlobalSelectContext';
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
useCallback,
|
|
6
|
+
useId,
|
|
7
|
+
Children,
|
|
8
|
+
isValidElement,
|
|
9
|
+
ReactNode,
|
|
10
|
+
} from 'react';
|
|
3
11
|
import { StyleSheet, View } from 'react-native';
|
|
4
12
|
import { useStyleSheet } from '../../../styles';
|
|
5
13
|
import { ChevronDown } from '../../Symbols';
|
|
@@ -328,9 +336,9 @@ export const SelectContent = ({ children }: SelectContentProps) => {
|
|
|
328
336
|
useEffect(() => {
|
|
329
337
|
const items: SelectContentItem[] = [];
|
|
330
338
|
|
|
331
|
-
const extractItems = (child:
|
|
332
|
-
|
|
333
|
-
if (!
|
|
339
|
+
const extractItems = (child: ReactNode): void => {
|
|
340
|
+
Children.forEach(child, (element) => {
|
|
341
|
+
if (!isValidElement(element)) return;
|
|
334
342
|
|
|
335
343
|
if (element.type === SelectItem) {
|
|
336
344
|
const props = element.props as SelectItemProps;
|
|
@@ -344,12 +352,10 @@ export const SelectContent = ({ children }: SelectContentProps) => {
|
|
|
344
352
|
disabled: props.disabled,
|
|
345
353
|
});
|
|
346
354
|
} else if (element.type === SelectGroup) {
|
|
347
|
-
extractItems(
|
|
348
|
-
(element.props as { children?: React.ReactNode }).children,
|
|
349
|
-
);
|
|
355
|
+
extractItems((element.props as { children?: ReactNode }).children);
|
|
350
356
|
} else if (element.type === SelectLabel) {
|
|
351
357
|
const labelText = extractTextFromChildren(
|
|
352
|
-
(element.props as { children?:
|
|
358
|
+
(element.props as { children?: ReactNode }).children,
|
|
353
359
|
SelectItemText,
|
|
354
360
|
);
|
|
355
361
|
items.push({
|
|
@@ -360,12 +366,8 @@ export const SelectContent = ({ children }: SelectContentProps) => {
|
|
|
360
366
|
items.push({
|
|
361
367
|
type: 'separator',
|
|
362
368
|
});
|
|
363
|
-
} else if (
|
|
364
|
-
(element.props as { children?:
|
|
365
|
-
) {
|
|
366
|
-
extractItems(
|
|
367
|
-
(element.props as { children?: React.ReactNode }).children,
|
|
368
|
-
);
|
|
369
|
+
} else if ((element.props as { children?: ReactNode })?.children) {
|
|
370
|
+
extractItems((element.props as { children?: ReactNode }).children);
|
|
369
371
|
}
|
|
370
372
|
});
|
|
371
373
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from '@jest/globals';
|
|
2
2
|
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
3
|
import { render } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { Skeleton } from './Skeleton';
|
|
7
6
|
|
|
@@ -27,6 +27,7 @@ const SlotPressable = ({
|
|
|
27
27
|
const { children, ...pressableSlotProps } = props;
|
|
28
28
|
|
|
29
29
|
if (!isValidElement(children)) {
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
30
31
|
console.error('Slot.Pressable - Invalid asChild element', children);
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
@@ -49,6 +50,7 @@ const SlotView = ({
|
|
|
49
50
|
const { children, ...viewSlotProps } = props;
|
|
50
51
|
|
|
51
52
|
if (!isValidElement(children)) {
|
|
53
|
+
// eslint-disable-next-line no-console
|
|
52
54
|
console.error('Slot.View - Invalid asChild element', children);
|
|
53
55
|
return null;
|
|
54
56
|
}
|
|
@@ -71,6 +73,7 @@ const SlotText = ({
|
|
|
71
73
|
const { children, ...textSlotProps } = props;
|
|
72
74
|
|
|
73
75
|
if (!isValidElement(children)) {
|
|
76
|
+
// eslint-disable-next-line no-console
|
|
74
77
|
console.error('Slot.Text - Invalid asChild element', children);
|
|
75
78
|
return null;
|
|
76
79
|
}
|
|
@@ -94,6 +97,7 @@ const SlotImage = ({ ref, ...props }: SlotImageSlotProps) => {
|
|
|
94
97
|
const { children, ...imageSlotProps } = props;
|
|
95
98
|
|
|
96
99
|
if (!isValidElement(children)) {
|
|
100
|
+
// eslint-disable-next-line no-console
|
|
97
101
|
console.error('Slot.Image - Invalid asChild element', children);
|
|
98
102
|
return null;
|
|
99
103
|
}
|
|
@@ -69,7 +69,7 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
69
69
|
Import and use the Spinner component:
|
|
70
70
|
|
|
71
71
|
```tsx
|
|
72
|
-
import
|
|
72
|
+
import { useState } from 'react';
|
|
73
73
|
import { View } from 'react-native';
|
|
74
74
|
import { Spinner } from '@ledgerhq/lumen-ui-rnative';
|
|
75
75
|
|
|
@@ -85,7 +85,6 @@ function MyComponent() {
|
|
|
85
85
|
Spinners support predefined size variants that ensure consistent visual hierarchy:
|
|
86
86
|
|
|
87
87
|
```tsx
|
|
88
|
-
import React from 'react';
|
|
89
88
|
import { Box, Spinner } from '@ledgerhq/lumen-ui-rnative';
|
|
90
89
|
|
|
91
90
|
function MyComponent() {
|
|
@@ -104,7 +103,6 @@ function MyComponent() {
|
|
|
104
103
|
Use the `color` property with design token values to set spinner color.
|
|
105
104
|
|
|
106
105
|
```tsx
|
|
107
|
-
import React from 'react';
|
|
108
106
|
import { Spinner } from '@ledgerhq/lumen-ui-rnative';
|
|
109
107
|
|
|
110
108
|
function MyComponent() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
2
|
import { StyledViewProps } from '../../../styles';
|
|
3
3
|
import { IconProps } from '../Icon';
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ type IconSpotProps = {
|
|
|
20
20
|
/**
|
|
21
21
|
* A React component to be rendered as the icon. Required when appearance is 'icon'.
|
|
22
22
|
*/
|
|
23
|
-
icon:
|
|
23
|
+
icon: ComponentType<IconProps>;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
type NumberSpotProps = {
|
|
@@ -87,7 +87,7 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
87
87
|
Import and use the Stepper component:
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
|
-
import
|
|
90
|
+
import { useState } from 'react';
|
|
91
91
|
import { View } from 'react-native';
|
|
92
92
|
import { Stepper } from '@ledgerhq/lumen-ui-rnative';
|
|
93
93
|
|
|
@@ -109,7 +109,6 @@ function OnboardingFlow() {
|
|
|
109
109
|
Control the visual state based on step completion:
|
|
110
110
|
|
|
111
111
|
```tsx
|
|
112
|
-
import React from 'react';
|
|
113
112
|
import { Box, Stepper } from '@ledgerhq/lumen-ui-rnative';
|
|
114
113
|
|
|
115
114
|
function MultiStepForm() {
|
|
@@ -128,7 +127,6 @@ function MultiStepForm() {
|
|
|
128
127
|
Provide custom labels for localized or descriptive text:
|
|
129
128
|
|
|
130
129
|
```tsx
|
|
131
|
-
import React from 'react';
|
|
132
130
|
import { Stepper } from '@ledgerhq/lumen-ui-rnative';
|
|
133
131
|
|
|
134
132
|
function LocalizedStepper() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from '@jest/globals';
|
|
2
2
|
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
3
|
import { render } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { Stepper } from './Stepper';
|
|
7
6
|
|
|
@@ -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
|
Subheader,
|
|
@@ -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, fireEvent, waitFor } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { Switch } from './Switch';
|
|
7
6
|
|
|
@@ -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, fireEvent } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { HomeFill, Settings, BasketPutIn } from '../../Symbols';
|
|
6
5
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
6
|
import { TabBar, TabBarItem } from './TabBar';
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
Children,
|
|
4
|
+
isValidElement,
|
|
5
|
+
ReactNode,
|
|
6
|
+
useCallback,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
} from 'react';
|
|
3
10
|
import {
|
|
4
11
|
LayoutChangeEvent,
|
|
5
12
|
Platform,
|
|
@@ -98,7 +105,7 @@ const useTabBarPillLayout = ({
|
|
|
98
105
|
children,
|
|
99
106
|
}: {
|
|
100
107
|
active: string;
|
|
101
|
-
children:
|
|
108
|
+
children: ReactNode;
|
|
102
109
|
}) => {
|
|
103
110
|
const pillProgress = useSharedValue(0);
|
|
104
111
|
const itemWidth = useSharedValue(0);
|
|
@@ -111,8 +118,8 @@ const useTabBarPillLayout = ({
|
|
|
111
118
|
});
|
|
112
119
|
|
|
113
120
|
const getActiveIndex = useCallback((): number => {
|
|
114
|
-
return
|
|
115
|
-
if (
|
|
121
|
+
return Children.toArray(children).findIndex((child) => {
|
|
122
|
+
if (isValidElement<TabBarItemProps>(child)) {
|
|
116
123
|
return child.props.value === active;
|
|
117
124
|
}
|
|
118
125
|
return false;
|
|
@@ -121,7 +128,7 @@ const useTabBarPillLayout = ({
|
|
|
121
128
|
|
|
122
129
|
const onLayout = (e: LayoutChangeEvent): void => {
|
|
123
130
|
const { width, height } = e.nativeEvent.layout;
|
|
124
|
-
const count =
|
|
131
|
+
const count = Children.count(children);
|
|
125
132
|
const slotWidth = (width - PILL_INSET * 2) / count;
|
|
126
133
|
|
|
127
134
|
itemWidth.value = slotWidth;
|
|
@@ -47,6 +47,12 @@ Tags can be displayed with or without an icon.
|
|
|
47
47
|
|
|
48
48
|
<Canvas of={TagStories.ContentTypeShowcase} />
|
|
49
49
|
|
|
50
|
+
### Truncation
|
|
51
|
+
|
|
52
|
+
When a tag's label exceeds the available space, the text is automatically truncated with an ellipsis.
|
|
53
|
+
|
|
54
|
+
<Canvas of={TagStories.TruncateShowcase} />
|
|
55
|
+
|
|
50
56
|
### Accessibility
|
|
51
57
|
|
|
52
58
|
To be implemented:
|
|
@@ -155,7 +155,9 @@ export const Tag = ({
|
|
|
155
155
|
{...props}
|
|
156
156
|
>
|
|
157
157
|
{IconComponent && <IconComponent size={iconSize} style={styles.icon} />}
|
|
158
|
-
<Text style={styles.text}
|
|
158
|
+
<Text style={styles.text} numberOfLines={1}>
|
|
159
|
+
{label}
|
|
160
|
+
</Text>
|
|
159
161
|
</Box>
|
|
160
162
|
);
|
|
161
163
|
};
|