@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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
type ChangeCb<T> = ((next: T) => void) |
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
type ChangeCb<T> = ((next: T) => void) | Dispatch<SetStateAction<T>>;
|
|
3
3
|
/**
|
|
4
4
|
* Allow to use a controlled or uncontrolled state.
|
|
5
5
|
* @see {@link https://github.com/tamagui/tamagui/blob/02f3e4c2fd76d5dc17815cf83842c05a3aade54c/code/core/use-controllable-state/src/useControllableState.ts}
|
|
@@ -10,6 +10,6 @@ export declare function useControllableState<T>({ prop, defaultProp, onChange, s
|
|
|
10
10
|
onChange?: ChangeCb<T>;
|
|
11
11
|
strategy?: 'prop-wins' | 'most-recent-wins';
|
|
12
12
|
transition?: boolean;
|
|
13
|
-
}): [T,
|
|
13
|
+
}): [T, Dispatch<SetStateAction<T>>];
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=useControllableState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControllableState.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/useControllableState/useControllableState.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useControllableState.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/useControllableState/useControllableState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAO9E,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAIrE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAsB,EACtB,UAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,GAAG,kBAAkB,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAsCnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-template.d.ts","sourceRoot":"","sources":["../../../../src/utils/icon-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon-template.d.ts","sourceRoot":"","sources":["../../../../src/utils/icon-template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,QAAA,MAAM,QAAQ,EAAE,QA4Cf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@types/react": "^19.0.0",
|
|
54
54
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
55
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
55
|
+
"@ledgerhq/lumen-design-core": "0.1.8",
|
|
56
56
|
"react": "^19.0.0",
|
|
57
57
|
"react-native": "~0.79.7",
|
|
58
58
|
"react-native-reanimated": "^4.1.0",
|
package/src/i18n/i18n.ts
CHANGED
|
@@ -52,6 +52,7 @@ const initializeI18n = (): I18nInstance => {
|
|
|
52
52
|
},
|
|
53
53
|
})
|
|
54
54
|
.catch((error: unknown) => {
|
|
55
|
+
// eslint-disable-next-line no-console
|
|
55
56
|
console.error('Failed to initialize i18next:', error);
|
|
56
57
|
});
|
|
57
58
|
|
|
@@ -81,6 +82,7 @@ export const loadLocale = async (locale: SupportedLocale): Promise<void> => {
|
|
|
81
82
|
|
|
82
83
|
loadedLocales.add(locale);
|
|
83
84
|
} catch (error) {
|
|
85
|
+
// eslint-disable-next-line no-console
|
|
84
86
|
console.error(`Failed to load locale ${locale}`, error);
|
|
85
87
|
throw error;
|
|
86
88
|
}
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,10 @@ export const Spin = memo(({ children, timing }: SpinProps) => {
|
|
|
35
35
|
[sv],
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
return
|
|
38
|
+
return (
|
|
39
|
+
<Animated.View style={[{ alignSelf: 'flex-start' }, animatedStyle]}>
|
|
40
|
+
{children}
|
|
41
|
+
</Animated.View>
|
|
42
|
+
);
|
|
39
43
|
});
|
|
40
44
|
Spin.displayName = 'Spin';
|
|
@@ -68,10 +68,14 @@ The error message will be automatically:
|
|
|
68
68
|
|
|
69
69
|
### Disabled State
|
|
70
70
|
|
|
71
|
-
The input can be disabled using the `
|
|
71
|
+
The input can be fully disabled using the `disabled` prop, which prevents interaction and applies a muted visual style.
|
|
72
72
|
|
|
73
73
|
<Canvas of={AddressInputStories.DisabledAddressInput} />
|
|
74
74
|
|
|
75
|
+
### Read-Only State
|
|
76
|
+
|
|
77
|
+
Alternatively, use `editable={false}` to prevent editing without applying the muted visual style. This is useful for displaying confirmed addresses that should still look like regular inputs.
|
|
78
|
+
|
|
75
79
|
## Controlled vs Uncontrolled
|
|
76
80
|
|
|
77
81
|
The AddressInput component supports both controlled and uncontrolled usage.
|
|
@@ -333,7 +337,19 @@ Use the `keyboardType` prop to show the appropriate keyboard:
|
|
|
333
337
|
|
|
334
338
|
### Disabled State
|
|
335
339
|
|
|
336
|
-
Use the `
|
|
340
|
+
Use the `disabled` prop to disable the input with a muted visual style:
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
<AddressInput
|
|
344
|
+
placeholder='Enter address or ENS'
|
|
345
|
+
value='0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb27'
|
|
346
|
+
disabled
|
|
347
|
+
/>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Read-Only State
|
|
351
|
+
|
|
352
|
+
Use the `editable` prop to make the input non-editable without the muted visual style:
|
|
337
353
|
|
|
338
354
|
```tsx
|
|
339
355
|
<AddressInput
|
|
@@ -16,28 +16,6 @@ const meta: Meta<typeof AddressInput> = {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
placeholder: {
|
|
21
|
-
control: 'text',
|
|
22
|
-
description: 'Placeholder text when input is empty',
|
|
23
|
-
},
|
|
24
|
-
prefix: {
|
|
25
|
-
control: 'text',
|
|
26
|
-
description: 'Custom prefix text (default: "To:")',
|
|
27
|
-
},
|
|
28
|
-
errorMessage: {
|
|
29
|
-
control: 'text',
|
|
30
|
-
description: 'Error message to display below input',
|
|
31
|
-
},
|
|
32
|
-
editable: {
|
|
33
|
-
control: 'boolean',
|
|
34
|
-
description: 'Whether the input is editable',
|
|
35
|
-
},
|
|
36
|
-
hideClearButton: {
|
|
37
|
-
control: 'boolean',
|
|
38
|
-
description: 'Hide the clear button',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
19
|
};
|
|
42
20
|
|
|
43
21
|
export default meta;
|
|
@@ -154,7 +132,7 @@ export const DisabledAddressInput: Story = {
|
|
|
154
132
|
placeholder: 'Enter address or ENS',
|
|
155
133
|
value: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb27',
|
|
156
134
|
prefix: 'To:',
|
|
157
|
-
|
|
135
|
+
disabled: true,
|
|
158
136
|
hideClearButton: false,
|
|
159
137
|
},
|
|
160
138
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
1
2
|
import { Text } from 'react-native';
|
|
2
3
|
import { useCommonTranslation } from '../../../i18n';
|
|
3
4
|
import { useStyleSheet } from '../../../styles';
|
|
@@ -10,11 +11,16 @@ export const AddressInput = ({
|
|
|
10
11
|
prefix = 'To:',
|
|
11
12
|
suffix,
|
|
12
13
|
onQrCodeClick,
|
|
14
|
+
disabled: disabledProp,
|
|
13
15
|
ref,
|
|
14
16
|
...props
|
|
15
17
|
}: AddressInputProps) => {
|
|
18
|
+
const disabled = useDisabledContext({
|
|
19
|
+
consumerName: 'AddressInput',
|
|
20
|
+
mergeWith: { disabled: disabledProp },
|
|
21
|
+
});
|
|
16
22
|
const { t } = useCommonTranslation();
|
|
17
|
-
const styles = useStyles();
|
|
23
|
+
const styles = useStyles({ disabled });
|
|
18
24
|
|
|
19
25
|
const actualPrefix = (
|
|
20
26
|
<Text accessible={false} style={styles.prefix}>
|
|
@@ -39,20 +45,22 @@ export const AddressInput = ({
|
|
|
39
45
|
ref={ref}
|
|
40
46
|
prefix={actualPrefix}
|
|
41
47
|
suffix={actualSuffix}
|
|
48
|
+
disabled={disabledProp}
|
|
42
49
|
{...props}
|
|
43
50
|
/>
|
|
44
51
|
);
|
|
45
52
|
};
|
|
46
53
|
|
|
47
|
-
const useStyles = () => {
|
|
48
|
-
return useStyleSheet(
|
|
49
|
-
|
|
54
|
+
const useStyles = ({ disabled }: { disabled: boolean }) => {
|
|
55
|
+
return useStyleSheet(
|
|
56
|
+
(t) => ({
|
|
50
57
|
prefix: {
|
|
51
58
|
...t.typographies.body1,
|
|
52
|
-
color: t.colors.text.base,
|
|
59
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
53
60
|
},
|
|
54
|
-
}
|
|
55
|
-
|
|
61
|
+
}),
|
|
62
|
+
[disabled],
|
|
63
|
+
);
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
AddressInput.displayName = 'AddressInput';
|
|
@@ -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, screen } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { AmountDisplay } from './AmountDisplay';
|
|
7
6
|
import { FormattedValue } from './types';
|
|
@@ -76,10 +76,14 @@ The input supports error handling through `isInvalid` prop which controls the er
|
|
|
76
76
|
|
|
77
77
|
### Disabled State
|
|
78
78
|
|
|
79
|
-
The
|
|
79
|
+
The input can be fully disabled using the `disabled` prop, which prevents interaction and applies a muted visual style.
|
|
80
80
|
|
|
81
81
|
<Canvas of={AmountInputStories.DisabledAmountInput} />
|
|
82
82
|
|
|
83
|
+
### Read-Only State
|
|
84
|
+
|
|
85
|
+
Alternatively, use `editable={false}` to prevent editing without applying the muted visual style. This is useful for displaying non-editable values that should still look like regular inputs.
|
|
86
|
+
|
|
83
87
|
## Animations
|
|
84
88
|
|
|
85
89
|
The AmountInput features several sophisticated animations:
|
|
@@ -16,41 +16,6 @@ const meta: Meta<typeof AmountInput> = {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
currencyText: {
|
|
21
|
-
control: 'text',
|
|
22
|
-
description: 'Currency text to display (e.g. USD, EUR, $)',
|
|
23
|
-
},
|
|
24
|
-
currencyPosition: {
|
|
25
|
-
control: 'radio',
|
|
26
|
-
options: ['left', 'right'],
|
|
27
|
-
description: 'Position of the currency text',
|
|
28
|
-
},
|
|
29
|
-
allowDecimals: {
|
|
30
|
-
control: 'boolean',
|
|
31
|
-
description: 'Whether to allow decimal values',
|
|
32
|
-
},
|
|
33
|
-
thousandsSeparator: {
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
description: 'Whether to display thousands separator',
|
|
36
|
-
},
|
|
37
|
-
maxIntegerLength: {
|
|
38
|
-
control: 'number',
|
|
39
|
-
description: 'Maximum digits for integer part',
|
|
40
|
-
},
|
|
41
|
-
maxDecimalLength: {
|
|
42
|
-
control: 'number',
|
|
43
|
-
description: 'Maximum digits for decimal part',
|
|
44
|
-
},
|
|
45
|
-
isInvalid: {
|
|
46
|
-
control: 'boolean',
|
|
47
|
-
description: 'Whether the input is in error state',
|
|
48
|
-
},
|
|
49
|
-
editable: {
|
|
50
|
-
control: 'boolean',
|
|
51
|
-
description: 'Whether the input is editable',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
19
|
};
|
|
55
20
|
|
|
56
21
|
export default meta;
|
|
@@ -190,7 +155,7 @@ export const DisabledAmountInput: Story = {
|
|
|
190
155
|
allowDecimals: true,
|
|
191
156
|
thousandsSeparator: true,
|
|
192
157
|
isInvalid: false,
|
|
193
|
-
|
|
158
|
+
disabled: true,
|
|
194
159
|
},
|
|
195
160
|
};
|
|
196
161
|
|
|
@@ -27,7 +27,8 @@ export const AmountInput = ({
|
|
|
27
27
|
style,
|
|
28
28
|
currencyText,
|
|
29
29
|
currencyPosition = 'left',
|
|
30
|
-
editable
|
|
30
|
+
editable,
|
|
31
|
+
disabled: disabledProp = false,
|
|
31
32
|
maxIntegerLength = 9,
|
|
32
33
|
maxDecimalLength = 9,
|
|
33
34
|
allowDecimals = true,
|
|
@@ -43,7 +44,7 @@ export const AmountInput = ({
|
|
|
43
44
|
const [isFocused, setIsFocused] = useState(false);
|
|
44
45
|
const disabled = useDisabledContext({
|
|
45
46
|
consumerName: 'AmountInput',
|
|
46
|
-
mergeWith: { disabled:
|
|
47
|
+
mergeWith: { disabled: disabledProp },
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
const translateX = useSharedValue(0);
|
|
@@ -146,7 +147,7 @@ export const AmountInput = ({
|
|
|
146
147
|
<TextInput
|
|
147
148
|
ref={inputRef}
|
|
148
149
|
keyboardType='decimal-pad'
|
|
149
|
-
editable={!disabled}
|
|
150
|
+
editable={editable !== false && !disabled}
|
|
150
151
|
value={inputValue}
|
|
151
152
|
onChangeText={handleChangeText}
|
|
152
153
|
onFocus={(e) => {
|
|
@@ -39,6 +39,13 @@ export type AmountInputProps = Omit<
|
|
|
39
39
|
* @default true
|
|
40
40
|
*/
|
|
41
41
|
allowDecimals?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the input is disabled.
|
|
44
|
+
* When true, the input is not editable and displays a muted visual style.
|
|
45
|
+
* This differs from `editable={false}` which only prevents interaction.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
42
49
|
/**
|
|
43
50
|
* Additional style
|
|
44
51
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Avatar } from './Avatar';
|
|
3
|
+
|
|
4
|
+
figma.connect(
|
|
5
|
+
Avatar,
|
|
6
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=11097-8',
|
|
7
|
+
{
|
|
8
|
+
imports: ["import { Avatar } from '@ledgerhq/lumen-ui-rnative'"],
|
|
9
|
+
props: {
|
|
10
|
+
size: figma.enum('size', {
|
|
11
|
+
sm: 'sm',
|
|
12
|
+
md: 'md',
|
|
13
|
+
lg: 'lg',
|
|
14
|
+
}),
|
|
15
|
+
showNotification: figma.boolean('show-notification', {
|
|
16
|
+
true: true,
|
|
17
|
+
false: false,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
example: (props) => (
|
|
21
|
+
<Avatar
|
|
22
|
+
src='https://example-image.com'
|
|
23
|
+
size={props.size}
|
|
24
|
+
alt="John Doe's Avatar"
|
|
25
|
+
showNotification={props.showNotification}
|
|
26
|
+
/>
|
|
27
|
+
),
|
|
28
|
+
},
|
|
29
|
+
);
|
|
@@ -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, waitFor } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
6
5
|
import { Avatar } from './Avatar';
|
|
7
6
|
|
|
@@ -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 { Button } from '../Button';
|
|
4
4
|
import { Box, Text } from '../Utility';
|
|
5
5
|
import { Banner } from './Banner';
|
|
@@ -437,7 +437,7 @@ export const ResponsiveLayout: Story = {
|
|
|
437
437
|
|
|
438
438
|
export const InteractiveDismiss: Story = {
|
|
439
439
|
render: (args) => {
|
|
440
|
-
const [visible, setVisible] =
|
|
440
|
+
const [visible, setVisible] = useState(true);
|
|
441
441
|
|
|
442
442
|
if (!visible) return <Text typography='body2'>Banner dismissed</Text>;
|
|
443
443
|
|
|
@@ -456,7 +456,7 @@ export const InteractiveDismiss: Story = {
|
|
|
456
456
|
|
|
457
457
|
export const InteractiveActions: Story = {
|
|
458
458
|
render: (args) => {
|
|
459
|
-
const [state, setState] =
|
|
459
|
+
const [state, setState] = useState('idle');
|
|
460
460
|
|
|
461
461
|
const handleAccept = () => {
|
|
462
462
|
setState('success');
|
|
@@ -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 { fireEvent, render } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { Button } from '../Button';
|
|
6
5
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
6
|
import { Banner } from './Banner';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DisabledProvider,
|
|
3
|
+
useDisabledContext,
|
|
4
|
+
} from '@ledgerhq/lumen-utils-shared';
|
|
2
5
|
import {
|
|
3
6
|
useCallback,
|
|
4
7
|
useEffect,
|
|
@@ -33,7 +36,8 @@ export const BaseInput = ({
|
|
|
33
36
|
errorMessage,
|
|
34
37
|
hideClearButton,
|
|
35
38
|
onChangeText: onChangeTextProp,
|
|
36
|
-
editable
|
|
39
|
+
editable,
|
|
40
|
+
disabled: disabledProp = false,
|
|
37
41
|
prefix,
|
|
38
42
|
suffix,
|
|
39
43
|
ref,
|
|
@@ -41,7 +45,7 @@ export const BaseInput = ({
|
|
|
41
45
|
}: BaseInputProps) => {
|
|
42
46
|
const disabled = useDisabledContext({
|
|
43
47
|
consumerName: 'BaseInput',
|
|
44
|
-
mergeWith: { disabled:
|
|
48
|
+
mergeWith: { disabled: disabledProp },
|
|
45
49
|
});
|
|
46
50
|
const { t } = useCommonTranslation();
|
|
47
51
|
const { theme } = useTheme();
|
|
@@ -97,68 +101,70 @@ export const BaseInput = ({
|
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
return (
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
<DisabledProvider value={{ disabled }}>
|
|
105
|
+
<Box lx={lx} style={style}>
|
|
106
|
+
<Pressable
|
|
107
|
+
style={StyleSheet.flatten([styles.container, containerStyle])}
|
|
108
|
+
onPress={() => inputRef.current?.focus()}
|
|
109
|
+
disabled={disabled}
|
|
110
|
+
>
|
|
111
|
+
{prefix}
|
|
107
112
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
<TextInput
|
|
114
|
+
ref={inputRef}
|
|
115
|
+
value={value}
|
|
116
|
+
style={StyleSheet.flatten([styles.input, inputStyle])}
|
|
117
|
+
onFocus={() => setIsFocused(true)}
|
|
118
|
+
onBlur={() => setIsFocused(false)}
|
|
119
|
+
onChangeText={handleChangeText}
|
|
120
|
+
editable={editable !== false && !disabled}
|
|
121
|
+
autoCapitalize='none'
|
|
122
|
+
autoCorrect={false}
|
|
123
|
+
selectionColor={theme.colors.text.active}
|
|
124
|
+
placeholderTextColor={theme.colors.text.muted}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
122
127
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
{label && (
|
|
129
|
+
<Animated.Text
|
|
130
|
+
style={[
|
|
131
|
+
floatingLabelStyles.label,
|
|
132
|
+
floatingLabelStyles.animatedStyle,
|
|
133
|
+
labelStyle,
|
|
134
|
+
]}
|
|
135
|
+
numberOfLines={1}
|
|
136
|
+
>
|
|
137
|
+
{label}
|
|
138
|
+
</Animated.Text>
|
|
139
|
+
)}
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
{(suffix || (!hideClearButton && !disabled)) && (
|
|
142
|
+
<View style={styles.suffixContainer}>
|
|
143
|
+
{showClearButton ? (
|
|
144
|
+
<InteractiveIcon
|
|
145
|
+
iconType='stroked'
|
|
146
|
+
onPress={handleClear}
|
|
147
|
+
accessibilityLabel={t(
|
|
148
|
+
'components.baseInput.clearInputAriaLabel',
|
|
149
|
+
)}
|
|
150
|
+
>
|
|
151
|
+
<DeleteCircleFill size={20} />
|
|
152
|
+
</InteractiveIcon>
|
|
153
|
+
) : (
|
|
154
|
+
suffix
|
|
155
|
+
)}
|
|
156
|
+
</View>
|
|
157
|
+
)}
|
|
158
|
+
</Pressable>
|
|
159
|
+
|
|
160
|
+
{errorMessage && (
|
|
161
|
+
<View style={styles.errorContainer}>
|
|
162
|
+
<DeleteCircleFill size={16} color='error' />
|
|
163
|
+
<Text style={styles.errorText}>{errorMessage}</Text>
|
|
151
164
|
</View>
|
|
152
165
|
)}
|
|
153
|
-
</
|
|
154
|
-
|
|
155
|
-
{errorMessage && (
|
|
156
|
-
<View style={styles.errorContainer}>
|
|
157
|
-
<DeleteCircleFill size={16} color='error' />
|
|
158
|
-
<Text style={styles.errorText}>{errorMessage}</Text>
|
|
159
|
-
</View>
|
|
160
|
-
)}
|
|
161
|
-
</Box>
|
|
166
|
+
</Box>
|
|
167
|
+
</DisabledProvider>
|
|
162
168
|
);
|
|
163
169
|
};
|
|
164
170
|
|
|
@@ -11,6 +11,13 @@ export type BaseInputProps = {
|
|
|
11
11
|
* The label text that floats above the input when focused or filled.
|
|
12
12
|
*/
|
|
13
13
|
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the input is disabled.
|
|
16
|
+
* When true, the input is not editable and displays a muted visual style.
|
|
17
|
+
* This differs from `editable={false}` which only prevents interaction.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
14
21
|
/**
|
|
15
22
|
* Additional styles to apply to the outer wrapper element.
|
|
16
23
|
*/
|
|
@@ -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, RenderOptions } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { Text, View } from 'react-native';
|
|
6
5
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
7
6
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
SNAP_POINT_TYPE,
|
|
4
4
|
} from '@gorhom/bottom-sheet';
|
|
5
5
|
import { createSafeContext, useMergedRef } from '@ledgerhq/lumen-utils-shared';
|
|
6
|
-
import
|
|
6
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { StyleSheet } from 'react-native';
|
|
8
8
|
import { useStyleSheet } from '../../../styles';
|
|
9
9
|
import { RuntimeConstants } from '../../utils';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BottomSheetBackdrop as GorhomBottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { useStyleSheet } from '../../../styles';
|
|
4
3
|
import { BottomSheetProps } from './types';
|
|
5
4
|
|
|
@@ -35,7 +34,6 @@ export const CustomBackdrop = ({
|
|
|
35
34
|
disappearsOnIndex={-1}
|
|
36
35
|
pressBehavior={backdropPressBehavior}
|
|
37
36
|
onPress={() => {
|
|
38
|
-
console.log('onPress');
|
|
39
37
|
onPress?.();
|
|
40
38
|
}}
|
|
41
39
|
/>
|
|
@@ -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 { ViewStyle } from 'react-native';
|
|
6
5
|
|
|
7
6
|
import { Plus, Settings } from '../../Symbols';
|
|
@@ -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 { Plus, Settings } from '../../Symbols';
|
|
4
4
|
import { Box, Text } from '../Utility';
|
|
5
5
|
import { Button } from './Button';
|
|
@@ -210,7 +210,7 @@ export const LabelTruncate: Story = {
|
|
|
210
210
|
|
|
211
211
|
export const InteractiveLoadingStates: Story = {
|
|
212
212
|
render: () => {
|
|
213
|
-
const [states, setStates] =
|
|
213
|
+
const [states, setStates] = useState<
|
|
214
214
|
Record<'text' | 'withIcon' | 'iconOnly', 'idle' | 'loading' | 'red'>
|
|
215
215
|
>({
|
|
216
216
|
text: 'idle',
|
|
@@ -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, screen } from '@testing-library/react-native';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import { Text as RNText } from 'react-native';
|
|
6
5
|
|
|
7
6
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|