@ledgerhq/lumen-ui-rnative 0.1.47 → 0.1.49
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/locales/de.json +1 -3
- package/dist/module/i18n/locales/en.json +1 -3
- package/dist/module/i18n/locales/es.json +1 -3
- package/dist/module/i18n/locales/fr.json +1 -3
- package/dist/module/i18n/locales/ja.json +1 -3
- package/dist/module/i18n/locales/ko.json +1 -3
- package/dist/module/i18n/locales/pt.json +1 -3
- package/dist/module/i18n/locales/ru.json +1 -3
- package/dist/module/i18n/locales/th.json +1 -3
- package/dist/module/i18n/locales/tr.json +1 -3
- package/dist/module/i18n/locales/zh.json +1 -3
- package/dist/module/lib/Animations/Pulse/Pulse.js +3 -3
- package/dist/module/lib/Animations/Pulse/Pulse.js.map +1 -1
- package/dist/module/lib/Animations/Pulse/Pulse.mdx +0 -1
- package/dist/module/lib/Animations/Spin/Spin.js +3 -3
- package/dist/module/lib/Animations/Spin/Spin.js.map +1 -1
- package/dist/module/lib/Animations/Spin/Spin.mdx +0 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.figma.js +36 -0
- package/dist/module/lib/Components/AddressInput/AddressInput.figma.js.map +1 -0
- package/dist/module/lib/Components/AddressInput/AddressInput.mdx +0 -183
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.figma.js +31 -0
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.figma.js.map +1 -0
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +0 -90
- package/dist/module/lib/Components/AmountInput/AmountInput.figma.js +70 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.figma.js.map +1 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.js +3 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +0 -190
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +15 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js +20 -1
- package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.figma.js +15 -12
- package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.js +4 -27
- package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.mdx +53 -69
- package/dist/module/lib/Components/Avatar/Avatar.stories.js +27 -33
- package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.test.js +21 -39
- package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.figma.js +107 -0
- package/dist/module/lib/Components/Banner/Banner.figma.js.map +1 -0
- package/dist/module/lib/Components/Banner/Banner.mdx +0 -86
- package/dist/module/lib/Components/BottomSheet/BottomSheet.figma.js +49 -0
- package/dist/module/lib/Components/BottomSheet/BottomSheet.figma.js.map +1 -0
- package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +0 -119
- package/dist/module/lib/Components/Button/Button.figma.js +45 -0
- package/dist/module/lib/Components/Button/Button.figma.js.map +1 -0
- package/dist/module/lib/Components/Button/Button.mdx +25 -224
- package/dist/module/lib/Components/Button/Button.stories.js +4 -36
- package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.figma.js +143 -0
- package/dist/module/lib/Components/Card/Card.figma.js.map +1 -0
- package/dist/module/lib/Components/Card/Card.mdx +0 -160
- package/dist/module/lib/Components/CardButton/CardButton.figma.js +38 -0
- package/dist/module/lib/Components/CardButton/CardButton.figma.js.map +1 -0
- package/dist/module/lib/Components/CardButton/CardButton.mdx +0 -48
- package/dist/module/lib/Components/Checkbox/Checkbox.figma.js +48 -0
- package/dist/module/lib/Components/Checkbox/Checkbox.figma.js.map +1 -0
- package/dist/module/lib/Components/Checkbox/Checkbox.mdx +0 -73
- package/dist/module/lib/Components/ContentBanner/ContentBanner.figma.js +91 -0
- package/dist/module/lib/Components/ContentBanner/ContentBanner.figma.js.map +1 -0
- package/dist/module/lib/Components/ContentBanner/ContentBanner.mdx +0 -2
- package/dist/module/lib/Components/CryptoIcon/CryptoIcon.figma.js +17 -0
- package/dist/module/lib/Components/CryptoIcon/CryptoIcon.figma.js.map +1 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.figma.js +29 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.figma.js.map +1 -0
- package/dist/module/lib/Components/Divider/Divider.figma.js +10 -0
- package/dist/module/lib/Components/Divider/Divider.figma.js.map +1 -0
- package/dist/module/lib/Components/Divider/Divider.mdx +0 -2
- package/dist/module/lib/Components/DotCount/DotCount.figma.js +29 -0
- package/dist/module/lib/Components/DotCount/DotCount.figma.js.map +1 -0
- package/dist/module/lib/Components/DotIndicator/DotIndicator.figma.js +29 -0
- package/dist/module/lib/Components/DotIndicator/DotIndicator.figma.js.map +1 -0
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +6 -3
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.js +17 -0
- package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.js.map +1 -0
- package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.test.js +17 -0
- package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.test.js.map +1 -0
- package/dist/module/lib/Components/DotIndicator/index.js +1 -0
- package/dist/module/lib/Components/DotIndicator/index.js.map +1 -1
- package/dist/module/lib/Components/Icon/Icon.figma.js +1840 -0
- package/dist/module/lib/Components/Icon/Icon.figma.js.map +1 -0
- package/dist/module/lib/Components/Icon/Icon.mdx +0 -62
- package/dist/module/lib/Components/IconButton/IconButton.figma.js +42 -0
- package/dist/module/lib/Components/IconButton/IconButton.figma.js.map +1 -0
- package/dist/module/lib/Components/IconButton/IconButton.mdx +0 -68
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.figma.js +51 -0
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.figma.js.map +1 -0
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +0 -107
- package/dist/module/lib/Components/Link/Link.figma.js +41 -0
- package/dist/module/lib/Components/Link/Link.figma.js.map +1 -0
- package/dist/module/lib/Components/Link/Link.mdx +0 -102
- package/dist/module/lib/Components/ListItem/ListItem.figma.js +416 -0
- package/dist/module/lib/Components/ListItem/ListItem.figma.js.map +1 -0
- package/dist/module/lib/Components/ListItem/ListItem.mdx +0 -129
- package/dist/module/lib/Components/MediaBanner/MediaBanner.figma.js +25 -0
- package/dist/module/lib/Components/MediaBanner/MediaBanner.figma.js.map +1 -0
- package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +0 -3
- package/dist/module/lib/Components/MediaButton/MediaButton.figma.js +72 -0
- package/dist/module/lib/Components/MediaButton/MediaButton.figma.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.figma.js +28 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.figma.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.mdx +0 -2
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +0 -1
- package/dist/module/lib/Components/MediaTag/MediaTag.figma.js +100 -0
- package/dist/module/lib/Components/MediaTag/MediaTag.figma.js.map +1 -0
- package/dist/module/lib/Components/MediaTag/MediaTag.mdx +0 -2
- package/dist/module/lib/Components/NavBar/NavBar.figma.js +79 -0
- package/dist/module/lib/Components/NavBar/NavBar.figma.js.map +1 -0
- package/dist/module/lib/Components/NavBar/NavBar.mdx +0 -2
- package/dist/module/lib/Components/OptionList/OptionList.js +16 -1
- package/dist/module/lib/Components/OptionList/OptionList.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.mdx +45 -90
- package/dist/module/lib/Components/OptionList/OptionList.stories.js +61 -1
- package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.test.js +43 -1
- package/dist/module/lib/Components/OptionList/OptionList.test.js.map +1 -1
- package/dist/module/lib/Components/OptionList/useOptionList/useOptionListItems.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.figma.js +13 -0
- package/dist/module/lib/Components/PageIndicator/PageIndicator.figma.js.map +1 -0
- package/dist/module/lib/Components/PageIndicator/PageIndicator.mdx +0 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.figma.js +31 -0
- package/dist/module/lib/Components/SearchInput/SearchInput.figma.js.map +1 -0
- package/dist/module/lib/Components/SearchInput/SearchInput.mdx +0 -199
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.figma.js +35 -0
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.figma.js.map +1 -0
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +7 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +28 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +24 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +28 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.figma.js +18 -0
- package/dist/module/lib/Components/Skeleton/Skeleton.figma.js.map +1 -0
- package/dist/module/lib/Components/Skeleton/Skeleton.mdx +0 -71
- package/dist/module/lib/Components/Spinner/Spinner.figma.js +13 -0
- package/dist/module/lib/Components/Spinner/Spinner.figma.js.map +1 -0
- package/dist/module/lib/Components/Spinner/Spinner.mdx +0 -100
- package/dist/module/lib/Components/Spot/Spot.figma.js +37 -0
- package/dist/module/lib/Components/Spot/Spot.figma.js.map +1 -0
- package/dist/module/lib/Components/Spot/Spot.mdx +0 -94
- package/dist/module/lib/Components/Stepper/Stepper.figma.js +13 -0
- package/dist/module/lib/Components/Stepper/Stepper.figma.js.map +1 -0
- package/dist/module/lib/Components/Stepper/Stepper.mdx +0 -67
- package/dist/module/lib/Components/Subheader/Subheader.figma.js +67 -0
- package/dist/module/lib/Components/Subheader/Subheader.figma.js.map +1 -0
- package/dist/module/lib/Components/Subheader/Subheader.mdx +0 -116
- package/dist/module/lib/Components/Switch/Switch.figma.js +58 -0
- package/dist/module/lib/Components/Switch/Switch.figma.js.map +1 -0
- package/dist/module/lib/Components/Switch/Switch.mdx +0 -39
- package/dist/module/lib/Components/TabBar/TabBar.figma.js +98 -0
- package/dist/module/lib/Components/TabBar/TabBar.figma.js.map +1 -0
- package/dist/module/lib/Components/TabBar/TabBar.js +7 -4
- package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.mdx +29 -5
- package/dist/module/lib/Components/TabBar/TabBar.stories.js +35 -1
- package/dist/module/lib/Components/TabBar/TabBar.stories.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js +28 -1
- package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
- package/dist/module/lib/Components/TabBar/index.js +2 -1
- package/dist/module/lib/Components/TabBar/index.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.figma.js +41 -0
- package/dist/module/lib/Components/Tag/Tag.figma.js.map +1 -0
- package/dist/module/lib/Components/Tag/Tag.mdx +0 -2
- package/dist/module/lib/Components/TextInput/TextInput.figma.js +37 -0
- package/dist/module/lib/Components/TextInput/TextInput.figma.js.map +1 -0
- package/dist/module/lib/Components/TextInput/TextInput.mdx +0 -178
- package/dist/module/lib/Components/Tile/Tile.figma.js +111 -0
- package/dist/module/lib/Components/Tile/Tile.figma.js.map +1 -0
- package/dist/module/lib/Components/Tile/Tile.mdx +0 -53
- package/dist/module/lib/Components/TileButton/TileButton.figma.js +23 -0
- package/dist/module/lib/Components/TileButton/TileButton.figma.js.map +1 -0
- package/dist/module/lib/Components/TileButton/TileButton.mdx +0 -40
- package/dist/module/lib/Components/Tooltip/Tooltip.figma.js +26 -0
- package/dist/module/lib/Components/Tooltip/Tooltip.figma.js.map +1 -0
- package/dist/module/lib/Components/Tooltip/Tooltip.mdx +0 -183
- package/dist/module/lib/Components/Trend/Trend.figma.js +29 -0
- package/dist/module/lib/Components/Trend/Trend.figma.js.map +1 -0
- package/dist/module/lib/Components/Trend/Trend.mdx +0 -2
- package/dist/module/lib/Components/Utility/Text/Text.mdx +0 -1
- package/dist/module/lib/Symbols/Icons/ChevronAscending.js +1 -1
- package/dist/module/lib/Symbols/Icons/ChevronDescending.js +1 -1
- package/dist/module/lib/Symbols/Icons/Contact.js +50 -0
- package/dist/module/lib/Symbols/Icons/Contact.js.map +1 -0
- package/dist/module/lib/Symbols/index.js +1 -0
- package/dist/module/lib/Symbols/index.js.map +1 -1
- package/dist/typescript/src/lib/Animations/Pulse/Pulse.d.ts.map +1 -1
- package/dist/typescript/src/lib/Animations/Spin/Spin.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +8 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts +1 -0
- package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/types.d.ts +0 -6
- package/dist/typescript/src/lib/Components/Avatar/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIndicator/getDotIndicatorProps.d.ts +24 -0
- package/dist/typescript/src/lib/Components/DotIndicator/getDotIndicatorProps.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/DotIndicator/index.d.ts +1 -0
- package/dist/typescript/src/lib/Components/DotIndicator/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts +18 -4
- package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/types.d.ts +16 -15
- package/dist/typescript/src/lib/Components/OptionList/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts +9 -9
- package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +6 -5
- package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts +7 -2
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/index.d.ts +2 -2
- package/dist/typescript/src/lib/Components/TabBar/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/types.d.ts +17 -16
- package/dist/typescript/src/lib/Components/TabBar/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Symbols/Icons/Contact.d.ts +35 -0
- package/dist/typescript/src/lib/Symbols/Icons/Contact.d.ts.map +1 -0
- package/dist/typescript/src/lib/Symbols/index.d.ts +1 -0
- package/dist/typescript/src/lib/Symbols/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/i18n/locales/de.json +1 -3
- package/src/i18n/locales/en.json +1 -3
- package/src/i18n/locales/es.json +1 -3
- package/src/i18n/locales/fr.json +1 -3
- package/src/i18n/locales/ja.json +1 -3
- package/src/i18n/locales/ko.json +1 -3
- package/src/i18n/locales/pt.json +1 -3
- package/src/i18n/locales/ru.json +1 -3
- package/src/i18n/locales/th.json +1 -3
- package/src/i18n/locales/tr.json +1 -3
- package/src/i18n/locales/zh.json +1 -3
- package/src/lib/Animations/Pulse/Pulse.mdx +0 -1
- package/src/lib/Animations/Pulse/Pulse.tsx +8 -1
- package/src/lib/Animations/Spin/Spin.mdx +0 -1
- package/src/lib/Animations/Spin/Spin.tsx +8 -1
- package/src/lib/Components/AddressInput/AddressInput.figma.tsx +39 -0
- package/src/lib/Components/AddressInput/AddressInput.mdx +0 -183
- package/src/lib/Components/AmountDisplay/AmountDisplay.figma.tsx +37 -0
- package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +0 -90
- package/src/lib/Components/AmountInput/AmountInput.figma.tsx +78 -0
- package/src/lib/Components/AmountInput/AmountInput.mdx +0 -190
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +14 -0
- package/src/lib/Components/AmountInput/AmountInput.tsx +2 -0
- package/src/lib/Components/AmountInput/types.ts +8 -0
- package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.ts +20 -0
- package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.ts +2 -0
- package/src/lib/Components/Avatar/Avatar.figma.tsx +24 -14
- package/src/lib/Components/Avatar/Avatar.mdx +53 -69
- package/src/lib/Components/Avatar/Avatar.stories.tsx +16 -50
- package/src/lib/Components/Avatar/Avatar.test.tsx +12 -32
- package/src/lib/Components/Avatar/Avatar.tsx +4 -34
- package/src/lib/Components/Avatar/types.ts +0 -6
- package/src/lib/Components/Banner/Banner.figma.tsx +115 -0
- package/src/lib/Components/Banner/Banner.mdx +0 -86
- package/src/lib/Components/BottomSheet/BottomSheet.figma.tsx +52 -0
- package/src/lib/Components/BottomSheet/BottomSheet.mdx +0 -119
- package/src/lib/Components/Button/Button.figma.tsx +57 -0
- package/src/lib/Components/Button/Button.mdx +25 -224
- package/src/lib/Components/Button/Button.stories.tsx +3 -35
- package/src/lib/Components/Card/Card.figma.tsx +149 -0
- package/src/lib/Components/Card/Card.mdx +0 -160
- package/src/lib/Components/CardButton/CardButton.figma.tsx +49 -0
- package/src/lib/Components/CardButton/CardButton.mdx +0 -48
- package/src/lib/Components/Checkbox/Checkbox.figma.tsx +54 -0
- package/src/lib/Components/Checkbox/Checkbox.mdx +0 -73
- package/src/lib/Components/ContentBanner/ContentBanner.figma.tsx +108 -0
- package/src/lib/Components/ContentBanner/ContentBanner.mdx +0 -2
- package/src/lib/Components/CryptoIcon/CryptoIcon.figma.tsx +20 -0
- package/src/lib/Components/DescriptionItem/DescriptionItem.figma.tsx +36 -0
- package/src/lib/Components/Divider/Divider.figma.tsx +11 -0
- package/src/lib/Components/Divider/Divider.mdx +0 -2
- package/src/lib/Components/DotCount/DotCount.figma.tsx +32 -0
- package/src/lib/Components/DotIndicator/DotIndicator.figma.tsx +32 -0
- package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +4 -1
- package/src/lib/Components/DotIndicator/getDotIndicatorProps.test.ts +15 -0
- package/src/lib/Components/DotIndicator/getDotIndicatorProps.ts +10 -0
- package/src/lib/Components/DotIndicator/index.ts +1 -0
- package/src/lib/Components/Icon/Icon.figma.tsx +3085 -0
- package/src/lib/Components/Icon/Icon.mdx +0 -62
- package/src/lib/Components/IconButton/IconButton.figma.tsx +53 -0
- package/src/lib/Components/IconButton/IconButton.mdx +0 -68
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.tsx +52 -0
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +0 -107
- package/src/lib/Components/Link/Link.figma.tsx +53 -0
- package/src/lib/Components/Link/Link.mdx +0 -102
- package/src/lib/Components/ListItem/ListItem.figma.tsx +431 -0
- package/src/lib/Components/ListItem/ListItem.mdx +0 -129
- package/src/lib/Components/MediaBanner/MediaBanner.figma.tsx +32 -0
- package/src/lib/Components/MediaBanner/MediaBanner.mdx +0 -3
- package/src/lib/Components/MediaButton/MediaButton.figma.tsx +60 -0
- package/src/lib/Components/MediaCard/MediaCard.figma.tsx +27 -0
- package/src/lib/Components/MediaCard/MediaCard.mdx +0 -2
- package/src/lib/Components/MediaImage/MediaImage.mdx +0 -1
- package/src/lib/Components/MediaTag/MediaTag.figma.tsx +116 -0
- package/src/lib/Components/MediaTag/MediaTag.mdx +0 -2
- package/src/lib/Components/NavBar/NavBar.figma.tsx +84 -0
- package/src/lib/Components/NavBar/NavBar.mdx +0 -2
- package/src/lib/Components/OptionList/OptionList.mdx +45 -90
- package/src/lib/Components/OptionList/OptionList.stories.tsx +63 -0
- package/src/lib/Components/OptionList/OptionList.test.tsx +40 -0
- package/src/lib/Components/OptionList/OptionList.tsx +57 -10
- package/src/lib/Components/OptionList/types.ts +34 -15
- package/src/lib/Components/OptionList/useOptionList/useOptionListItems.ts +28 -13
- package/src/lib/Components/PageIndicator/PageIndicator.figma.tsx +11 -0
- package/src/lib/Components/PageIndicator/PageIndicator.mdx +0 -2
- package/src/lib/Components/SearchInput/SearchInput.figma.tsx +34 -0
- package/src/lib/Components/SearchInput/SearchInput.mdx +0 -199
- package/src/lib/Components/SegmentedControl/SegmentedControl.figma.tsx +34 -0
- package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +28 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +34 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +32 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +22 -5
- package/src/lib/Components/SegmentedControl/types.ts +11 -5
- package/src/lib/Components/Skeleton/Skeleton.figma.tsx +17 -0
- package/src/lib/Components/Skeleton/Skeleton.mdx +0 -71
- package/src/lib/Components/Spinner/Spinner.figma.tsx +12 -0
- package/src/lib/Components/Spinner/Spinner.mdx +0 -100
- package/src/lib/Components/Spot/Spot.figma.tsx +50 -0
- package/src/lib/Components/Spot/Spot.mdx +0 -94
- package/src/lib/Components/Stepper/Stepper.figma.tsx +11 -0
- package/src/lib/Components/Stepper/Stepper.mdx +0 -67
- package/src/lib/Components/Subheader/Subheader.figma.tsx +72 -0
- package/src/lib/Components/Subheader/Subheader.mdx +0 -116
- package/src/lib/Components/Switch/Switch.figma.tsx +66 -0
- package/src/lib/Components/Switch/Switch.mdx +0 -39
- package/src/lib/Components/TabBar/TabBar.figma.tsx +70 -0
- package/src/lib/Components/TabBar/TabBar.mdx +29 -5
- package/src/lib/Components/TabBar/TabBar.stories.tsx +34 -1
- package/src/lib/Components/TabBar/TabBar.test.tsx +23 -1
- package/src/lib/Components/TabBar/TabBar.tsx +17 -9
- package/src/lib/Components/TabBar/index.ts +2 -2
- package/src/lib/Components/TabBar/types.ts +19 -17
- package/src/lib/Components/Tag/Tag.figma.tsx +52 -0
- package/src/lib/Components/Tag/Tag.mdx +0 -2
- package/src/lib/Components/TextInput/TextInput.figma.tsx +40 -0
- package/src/lib/Components/TextInput/TextInput.mdx +0 -178
- package/src/lib/Components/Tile/Tile.figma.tsx +113 -0
- package/src/lib/Components/Tile/Tile.mdx +0 -53
- package/src/lib/Components/TileButton/TileButton.figma.tsx +35 -0
- package/src/lib/Components/TileButton/TileButton.mdx +0 -40
- package/src/lib/Components/Tooltip/Tooltip.figma.tsx +30 -0
- package/src/lib/Components/Tooltip/Tooltip.mdx +0 -183
- package/src/lib/Components/Trend/Trend.figma.tsx +28 -0
- package/src/lib/Components/Trend/Trend.mdx +0 -2
- package/src/lib/Components/Utility/Text/Text.mdx +0 -1
- package/src/lib/Symbols/Icons/ChevronAscending.tsx +1 -1
- package/src/lib/Symbols/Icons/ChevronDescending.tsx +1 -1
- package/src/lib/Symbols/Icons/Contact.tsx +45 -0
- package/src/lib/Symbols/index.ts +1 -0
- package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts +0 -2
- package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/OptionList/OptionList.figma.d.ts +0 -2
- package/dist/typescript/src/lib/Components/OptionList/OptionList.figma.d.ts.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Tag } from '../Tag';
|
|
3
|
+
import { MediaCard, MediaCardTitle } from './MediaCard';
|
|
4
|
+
|
|
5
|
+
figma.connect(
|
|
6
|
+
MediaCard,
|
|
7
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=15160-2853',
|
|
8
|
+
{
|
|
9
|
+
imports: [
|
|
10
|
+
"import { MediaCard, MediaCardTitle } from '@ledgerhq/lumen-ui-rnative'",
|
|
11
|
+
"import { Tag } from '@ledgerhq/lumen-ui-rnative'",
|
|
12
|
+
],
|
|
13
|
+
props: {
|
|
14
|
+
title: figma.string('title'),
|
|
15
|
+
tag: figma.boolean('show-tag', {
|
|
16
|
+
true: <Tag label='Label' appearance='base' />,
|
|
17
|
+
false: undefined,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
example: (props) => (
|
|
21
|
+
<MediaCard imageUrl='/image.jpg' onPress={() => {}} onClose={() => {}}>
|
|
22
|
+
{props.tag}
|
|
23
|
+
<MediaCardTitle>{props.title}</MediaCardTitle>
|
|
24
|
+
</MediaCard>
|
|
25
|
+
),
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as MediaCardStories from './MediaCard.stories';
|
|
3
3
|
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
4
|
-
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
5
4
|
|
|
6
5
|
<Meta title='Core/MediaCard' of={MediaCardStories} />
|
|
7
6
|
|
|
@@ -105,7 +104,6 @@ Use the `lx` prop for layout adjustments like margins or positioning:
|
|
|
105
104
|
</MediaCard>
|
|
106
105
|
```
|
|
107
106
|
|
|
108
|
-
<CommonRulesDoAndDont />
|
|
109
107
|
|
|
110
108
|
</Tab>
|
|
111
109
|
</CustomTabs>
|
|
@@ -2,7 +2,6 @@ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
|
2
2
|
import * as MediaImageStories from './MediaImage.stories';
|
|
3
3
|
import { MediaImage } from './MediaImage';
|
|
4
4
|
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
5
|
-
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
<Meta title='Core/MediaImage' of={MediaImageStories} />
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import CryptoIcon from '@ledgerhq/crypto-icons/native';
|
|
3
|
+
import { MediaTag } from './MediaTag';
|
|
4
|
+
|
|
5
|
+
figma.connect(
|
|
6
|
+
MediaTag,
|
|
7
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=16793-36383',
|
|
8
|
+
{
|
|
9
|
+
imports: [
|
|
10
|
+
"import { MediaTag } from '@ledgerhq/lumen-ui-rnative'",
|
|
11
|
+
"import CryptoIcon from '@ledgerhq/crypto-icons/native'",
|
|
12
|
+
],
|
|
13
|
+
variant: { 'leading-icon': 'coin' },
|
|
14
|
+
props: {
|
|
15
|
+
label: figma.string('label'),
|
|
16
|
+
appearance: figma.enum('appearance', {
|
|
17
|
+
base: 'base',
|
|
18
|
+
gray: 'gray',
|
|
19
|
+
accent: 'accent',
|
|
20
|
+
'accent-subtle': 'accent-subtle',
|
|
21
|
+
success: 'success',
|
|
22
|
+
error: 'error',
|
|
23
|
+
warning: 'warning',
|
|
24
|
+
white: 'white',
|
|
25
|
+
}),
|
|
26
|
+
size: figma.enum('size', {
|
|
27
|
+
md: 'md',
|
|
28
|
+
sm: 'sm',
|
|
29
|
+
}),
|
|
30
|
+
tagSize: figma.enum('size', {
|
|
31
|
+
md: 16,
|
|
32
|
+
sm: 12,
|
|
33
|
+
}),
|
|
34
|
+
disabled: figma.enum('appearance', {
|
|
35
|
+
disabled: true,
|
|
36
|
+
}),
|
|
37
|
+
coin: figma.nestedProps('coin', {
|
|
38
|
+
asset: figma.enum('asset', {
|
|
39
|
+
btc: 'btc',
|
|
40
|
+
eth: 'eth',
|
|
41
|
+
}),
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
example: (props) => (
|
|
45
|
+
<MediaTag
|
|
46
|
+
disabled={props.disabled}
|
|
47
|
+
label={props.label}
|
|
48
|
+
appearance={props.appearance}
|
|
49
|
+
size={props.size}
|
|
50
|
+
leadingContent={
|
|
51
|
+
<CryptoIcon
|
|
52
|
+
ticker={props.coin.asset}
|
|
53
|
+
ledgerId={props.coin.asset}
|
|
54
|
+
size={props.tagSize}
|
|
55
|
+
/>
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
figma.connect(
|
|
63
|
+
MediaTag,
|
|
64
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=16793-36383',
|
|
65
|
+
{
|
|
66
|
+
imports: [
|
|
67
|
+
"import { MediaTag } from '@ledgerhq/lumen-ui-rnative'",
|
|
68
|
+
"import CryptoIcon from '@ledgerhq/crypto-icons/native'",
|
|
69
|
+
],
|
|
70
|
+
variant: { 'leading-icon': 'network' },
|
|
71
|
+
props: {
|
|
72
|
+
label: figma.string('label'),
|
|
73
|
+
appearance: figma.enum('appearance', {
|
|
74
|
+
base: 'base',
|
|
75
|
+
gray: 'gray',
|
|
76
|
+
accent: 'accent',
|
|
77
|
+
'accent-subtle': 'accent-subtle',
|
|
78
|
+
success: 'success',
|
|
79
|
+
error: 'error',
|
|
80
|
+
warning: 'warning',
|
|
81
|
+
white: 'white',
|
|
82
|
+
}),
|
|
83
|
+
size: figma.enum('size', {
|
|
84
|
+
md: 'md',
|
|
85
|
+
sm: 'sm',
|
|
86
|
+
}),
|
|
87
|
+
tagSize: figma.enum('size', {
|
|
88
|
+
md: 16,
|
|
89
|
+
sm: 12,
|
|
90
|
+
}),
|
|
91
|
+
disabled: figma.enum('appearance', {
|
|
92
|
+
disabled: true,
|
|
93
|
+
}),
|
|
94
|
+
network: figma.nestedProps('network', {
|
|
95
|
+
ticker: figma.enum('network', {
|
|
96
|
+
eth: 'eth',
|
|
97
|
+
}),
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
example: (props) => (
|
|
101
|
+
<MediaTag
|
|
102
|
+
disabled={props.disabled}
|
|
103
|
+
label={props.label}
|
|
104
|
+
appearance={props.appearance}
|
|
105
|
+
size={props.size}
|
|
106
|
+
leadingContent={
|
|
107
|
+
<CryptoIcon
|
|
108
|
+
ticker={props.network.ticker}
|
|
109
|
+
ledgerId={props.network.ticker}
|
|
110
|
+
size={props.tagSize}
|
|
111
|
+
/>
|
|
112
|
+
}
|
|
113
|
+
/>
|
|
114
|
+
),
|
|
115
|
+
},
|
|
116
|
+
);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as MediaTagStories from './MediaTag.stories';
|
|
3
3
|
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
4
|
-
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
5
|
-
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
6
4
|
import { Box } from '../Utility/Box';
|
|
7
5
|
|
|
8
6
|
<Meta title='Core/MediaTag' of={MediaTagStories} />
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import CryptoIcon from '@ledgerhq/crypto-icons/native';
|
|
3
|
+
import {
|
|
4
|
+
IconButton,
|
|
5
|
+
NavBarCoinCapsule,
|
|
6
|
+
NavBarTrailing,
|
|
7
|
+
TileDescription,
|
|
8
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
9
|
+
import { Settings } from '../../Symbols';
|
|
10
|
+
import { NavBar, NavBarBackButton, NavBarContent, NavBarTitle } from './NavBar';
|
|
11
|
+
|
|
12
|
+
figma.connect(
|
|
13
|
+
NavBar,
|
|
14
|
+
'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=1426-4697',
|
|
15
|
+
{
|
|
16
|
+
imports: [
|
|
17
|
+
"import { NavBar, NavBarBackButton, NavBarContent, NavBarTitle } from '@ledgerhq/lumen-ui-rnative'",
|
|
18
|
+
],
|
|
19
|
+
props: {
|
|
20
|
+
density: figma.enum('density', {
|
|
21
|
+
compact: 'compact',
|
|
22
|
+
expanded: 'expanded',
|
|
23
|
+
}),
|
|
24
|
+
backButton: figma.boolean('show-back', {
|
|
25
|
+
true: <NavBarBackButton onPress={() => {}} />,
|
|
26
|
+
false: undefined,
|
|
27
|
+
}),
|
|
28
|
+
title: figma.boolean('show-title', {
|
|
29
|
+
true: <NavBarTitle>Title</NavBarTitle>,
|
|
30
|
+
false: undefined,
|
|
31
|
+
}),
|
|
32
|
+
description: figma.boolean('show-description', {
|
|
33
|
+
true: figma.boolean('show-network', {
|
|
34
|
+
true: (
|
|
35
|
+
<TileDescription>
|
|
36
|
+
Description{' '}
|
|
37
|
+
<CryptoIcon ledgerId='ethereum' ticker='ETH' size={20} />
|
|
38
|
+
</TileDescription>
|
|
39
|
+
),
|
|
40
|
+
false: <TileDescription>Description</TileDescription>,
|
|
41
|
+
}),
|
|
42
|
+
false: undefined,
|
|
43
|
+
}),
|
|
44
|
+
coinCapsule: figma.enum('content', {
|
|
45
|
+
asset: (
|
|
46
|
+
<NavBarCoinCapsule
|
|
47
|
+
ticker='Bitcoin'
|
|
48
|
+
leadingContent={
|
|
49
|
+
<CryptoIcon ledgerId='bitcoin' ticker='BTC' size={24} />
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
),
|
|
53
|
+
}),
|
|
54
|
+
trailing: figma.boolean('show-trailing-icon', {
|
|
55
|
+
true: (
|
|
56
|
+
<NavBarTrailing>
|
|
57
|
+
<IconButton icon={Settings} accessibilityLabel='Settings' />
|
|
58
|
+
</NavBarTrailing>
|
|
59
|
+
),
|
|
60
|
+
false: undefined,
|
|
61
|
+
}),
|
|
62
|
+
secondaryTrailing: figma.boolean('show-second-trailing-icon', {
|
|
63
|
+
true: (
|
|
64
|
+
<NavBarTrailing>
|
|
65
|
+
<IconButton icon={Settings} accessibilityLabel='Settings' />
|
|
66
|
+
</NavBarTrailing>
|
|
67
|
+
),
|
|
68
|
+
false: undefined,
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
example: (props) => (
|
|
72
|
+
<NavBar density={props.density}>
|
|
73
|
+
{props.backButton}
|
|
74
|
+
<NavBarContent>
|
|
75
|
+
{props.title}
|
|
76
|
+
{props.description}
|
|
77
|
+
</NavBarContent>
|
|
78
|
+
{props.coinCapsule}
|
|
79
|
+
{props.trailing}
|
|
80
|
+
{props.secondaryTrailing}
|
|
81
|
+
</NavBar>
|
|
82
|
+
),
|
|
83
|
+
},
|
|
84
|
+
);
|
|
@@ -3,7 +3,6 @@ import { Box } from '../Utility';
|
|
|
3
3
|
import * as NavBarStories from './NavBar.stories';
|
|
4
4
|
import { NavBar, NavBarBackButton, NavBarContent } from './NavBar';
|
|
5
5
|
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
6
|
-
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
7
6
|
|
|
8
7
|
<Meta title='Core/NavBar' of={NavBarStories} />
|
|
9
8
|
|
|
@@ -253,7 +252,6 @@ export default function DetailsScreen() {
|
|
|
253
252
|
}
|
|
254
253
|
```
|
|
255
254
|
|
|
256
|
-
<CommonRulesDoAndDont />
|
|
257
255
|
|
|
258
256
|
</Tab>
|
|
259
257
|
</CustomTabs>
|
|
@@ -3,9 +3,6 @@ import * as OptionListStories from './OptionList.stories';
|
|
|
3
3
|
import {
|
|
4
4
|
CustomTabs,
|
|
5
5
|
Tab,
|
|
6
|
-
DoVsDontRow,
|
|
7
|
-
DoBlockItem,
|
|
8
|
-
DontBlockItem,
|
|
9
6
|
} from '../../../../.storybook/components';
|
|
10
7
|
|
|
11
8
|
<Meta title='Core/OptionList' of={OptionListStories} />
|
|
@@ -97,6 +94,8 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
97
94
|
|
|
98
95
|
## Basic usage
|
|
99
96
|
|
|
97
|
+
> **Recommended:** prefer the [type-safe variant](#type-safe-variant) below. It ties `value`, `items[].value`, `OptionListItem.value`, and the `renderItem(item).meta` shape to one literal union plus an optional `TMeta`, dropping the `as Meta` casts in `renderItem`.
|
|
98
|
+
|
|
100
99
|
```tsx
|
|
101
100
|
import {
|
|
102
101
|
OptionList,
|
|
@@ -130,6 +129,49 @@ function MyList() {
|
|
|
130
129
|
}
|
|
131
130
|
```
|
|
132
131
|
|
|
132
|
+
## Type-safe variant
|
|
133
|
+
|
|
134
|
+
`OptionList` and its subcomponents communicate via context, so TypeScript cannot connect `value` / `items[].value` / `OptionListItem.value` on its own. A typo compiles. `createOptionList<T, TMeta>()` ties them together via one literal union (`T`) and an optional meta shape (`TMeta`) that flows into `renderItem(item)`, removing the `as` cast on `item.meta`.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { createOptionList } from '@ledgerhq/lumen-ui-rnative';
|
|
138
|
+
import type { OptionListItemData } from '@ledgerhq/lumen-ui-rnative';
|
|
139
|
+
|
|
140
|
+
type Network = 'eth' | 'sol' | 'btc';
|
|
141
|
+
type NetworkMeta = { ticker: string; ledgerId: string };
|
|
142
|
+
|
|
143
|
+
const NetworkList = createOptionList<Network, NetworkMeta>();
|
|
144
|
+
|
|
145
|
+
const NETWORKS: OptionListItemData<Network, NetworkMeta>[] = [
|
|
146
|
+
{ value: 'eth', label: 'Ethereum', meta: { ticker: 'ETH', ledgerId: 'ethereum' } },
|
|
147
|
+
{ value: 'sol', label: 'Solana', meta: { ticker: 'SOL', ledgerId: 'solana' } },
|
|
148
|
+
{ value: 'btc', label: 'Bitcoin', meta: { ticker: 'BTC', ledgerId: 'bitcoin' } },
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
function Example() {
|
|
152
|
+
const [value, setValue] = React.useState<Network | null>('eth');
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<NetworkList.OptionList items={NETWORKS} value={value} onValueChange={setValue}>
|
|
156
|
+
<NetworkList.OptionListContent
|
|
157
|
+
renderItem={({ value, label, meta }) =>
|
|
158
|
+
meta ? (
|
|
159
|
+
<NetworkList.OptionListItem value={value}>
|
|
160
|
+
<NetworkList.OptionListItemContent>
|
|
161
|
+
<NetworkList.OptionListItemText>{label}</NetworkList.OptionListItemText>
|
|
162
|
+
<NetworkList.OptionListItemDescription>
|
|
163
|
+
{meta.ticker}
|
|
164
|
+
</NetworkList.OptionListItemDescription>
|
|
165
|
+
</NetworkList.OptionListItemContent>
|
|
166
|
+
</NetworkList.OptionListItem>
|
|
167
|
+
) : null
|
|
168
|
+
}
|
|
169
|
+
/>
|
|
170
|
+
</NetworkList.OptionList>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
133
175
|
## Inside a BottomSheet
|
|
134
176
|
|
|
135
177
|
Use `OptionListTrigger` as the input-style trigger — it provides a floating label that animates up when a value is selected, and a chevron indicator. Pass children only when a value is selected so the label stays centered when empty.
|
|
@@ -231,93 +273,6 @@ const items = [
|
|
|
231
273
|
/>
|
|
232
274
|
```
|
|
233
275
|
|
|
234
|
-
## Do's and Don'ts
|
|
235
|
-
|
|
236
|
-
<div className='flex flex-col gap-24'>
|
|
237
|
-
|
|
238
|
-
<DoVsDontRow>
|
|
239
|
-
<DoBlockItem
|
|
240
|
-
title='Pass items as a flat array'
|
|
241
|
-
description='Use the group field for grouping — the component handles labels and separators automatically.'
|
|
242
|
-
>
|
|
243
|
-
|
|
244
|
-
{/* prettier-ignore */}
|
|
245
|
-
```tsx
|
|
246
|
-
<OptionList
|
|
247
|
-
items={[
|
|
248
|
-
{ value: 'a', label: 'A', group: 'Group 1' },
|
|
249
|
-
{ value: 'b', label: 'B', group: 'Group 2' },
|
|
250
|
-
]}
|
|
251
|
-
value={value}
|
|
252
|
-
onValueChange={setValue}
|
|
253
|
-
>
|
|
254
|
-
<OptionListContent renderItem={...} />
|
|
255
|
-
</OptionList>
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
</DoBlockItem>
|
|
259
|
-
<DontBlockItem
|
|
260
|
-
title="Don't manually render group labels or separators"
|
|
261
|
-
description='OptionListContent handles group rendering internally based on item data.'
|
|
262
|
-
>
|
|
263
|
-
|
|
264
|
-
{/* prettier-ignore */}
|
|
265
|
-
```tsx
|
|
266
|
-
<OptionList
|
|
267
|
-
items={items}
|
|
268
|
-
value={value}
|
|
269
|
-
onValueChange={setValue}
|
|
270
|
-
>
|
|
271
|
-
<Text>Group 1</Text>
|
|
272
|
-
<OptionListContent renderItem={...} />
|
|
273
|
-
<Divider />
|
|
274
|
-
<Text>Group 2</Text>
|
|
275
|
-
<OptionListContent renderItem={...} />
|
|
276
|
-
</OptionList>
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
</DontBlockItem>
|
|
280
|
-
</DoVsDontRow>
|
|
281
|
-
|
|
282
|
-
<DoVsDontRow>
|
|
283
|
-
<DoBlockItem
|
|
284
|
-
title='Compose OptionList inside your own container'
|
|
285
|
-
description='OptionList is display-only — wrap it in a BottomSheet, screen, or any layout.'
|
|
286
|
-
>
|
|
287
|
-
|
|
288
|
-
{/* prettier-ignore */}
|
|
289
|
-
```tsx
|
|
290
|
-
<BottomSheet ref={ref}>
|
|
291
|
-
<BottomSheetView>
|
|
292
|
-
<OptionList items={items} value={value} onValueChange={setValue}>
|
|
293
|
-
<OptionListContent renderItem={...} />
|
|
294
|
-
</OptionList>
|
|
295
|
-
</BottomSheetView>
|
|
296
|
-
</BottomSheet>
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
</DoBlockItem>
|
|
300
|
-
<DontBlockItem
|
|
301
|
-
title="Don't expect OptionList to manage the BottomSheet"
|
|
302
|
-
description='Use OptionListTrigger to open the sheet yourself — OptionList only handles selection state, not the container.'
|
|
303
|
-
>
|
|
304
|
-
|
|
305
|
-
{/* prettier-ignore */}
|
|
306
|
-
```tsx
|
|
307
|
-
<OptionList
|
|
308
|
-
items={items}
|
|
309
|
-
value={value}
|
|
310
|
-
onValueChange={setValue}
|
|
311
|
-
trigger={<Button>Open</Button>}
|
|
312
|
-
>
|
|
313
|
-
<OptionListContent renderItem={...} />
|
|
314
|
-
</OptionList>
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
</DontBlockItem>
|
|
318
|
-
</DoVsDontRow>
|
|
319
|
-
|
|
320
|
-
</div>
|
|
321
276
|
|
|
322
277
|
</Tab>
|
|
323
278
|
</CustomTabs>
|
|
@@ -14,6 +14,7 @@ import { Spot } from '../Spot';
|
|
|
14
14
|
import { Tag } from '../Tag/Tag';
|
|
15
15
|
import { Box, Text } from '../Utility';
|
|
16
16
|
import {
|
|
17
|
+
createOptionList,
|
|
17
18
|
OptionList,
|
|
18
19
|
OptionListContent,
|
|
19
20
|
OptionListEmptyState,
|
|
@@ -1008,3 +1009,65 @@ export const WithDefaultValue: Story = {
|
|
|
1008
1009
|
</Box>
|
|
1009
1010
|
),
|
|
1010
1011
|
};
|
|
1012
|
+
|
|
1013
|
+
type TypedNetwork = 'eth' | 'sol' | 'btc';
|
|
1014
|
+
type TypedNetworkMeta = { ticker: string; ledgerId: string };
|
|
1015
|
+
const NetworkList = createOptionList<TypedNetwork, TypedNetworkMeta>();
|
|
1016
|
+
|
|
1017
|
+
const TYPED_NETWORKS: OptionListItemData<TypedNetwork, TypedNetworkMeta>[] = [
|
|
1018
|
+
{
|
|
1019
|
+
value: 'eth',
|
|
1020
|
+
label: 'Ethereum',
|
|
1021
|
+
meta: { ticker: 'ETH', ledgerId: 'ethereum' },
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
value: 'sol',
|
|
1025
|
+
label: 'Solana',
|
|
1026
|
+
meta: { ticker: 'SOL', ledgerId: 'solana' },
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
value: 'btc',
|
|
1030
|
+
label: 'Bitcoin',
|
|
1031
|
+
meta: { ticker: 'BTC', ledgerId: 'bitcoin' },
|
|
1032
|
+
},
|
|
1033
|
+
];
|
|
1034
|
+
|
|
1035
|
+
export const TypesafeFactory: Story = {
|
|
1036
|
+
render: () => {
|
|
1037
|
+
const [value, setValue] = useState<TypedNetwork | null>('eth');
|
|
1038
|
+
|
|
1039
|
+
return (
|
|
1040
|
+
<Box lx={{ width: 's320' }}>
|
|
1041
|
+
<NetworkList.OptionList
|
|
1042
|
+
items={TYPED_NETWORKS}
|
|
1043
|
+
value={value}
|
|
1044
|
+
onValueChange={setValue}
|
|
1045
|
+
>
|
|
1046
|
+
<NetworkList.OptionListContent
|
|
1047
|
+
renderItem={({ value, label, meta }) =>
|
|
1048
|
+
meta ? (
|
|
1049
|
+
<NetworkList.OptionListItem value={value}>
|
|
1050
|
+
<NetworkList.OptionListItemLeading>
|
|
1051
|
+
<CryptoIcon
|
|
1052
|
+
ledgerId={meta.ledgerId}
|
|
1053
|
+
ticker={meta.ticker}
|
|
1054
|
+
size={32}
|
|
1055
|
+
/>
|
|
1056
|
+
</NetworkList.OptionListItemLeading>
|
|
1057
|
+
<NetworkList.OptionListItemContent>
|
|
1058
|
+
<NetworkList.OptionListItemText>
|
|
1059
|
+
{label}
|
|
1060
|
+
</NetworkList.OptionListItemText>
|
|
1061
|
+
<NetworkList.OptionListItemDescription>
|
|
1062
|
+
{meta.ticker}
|
|
1063
|
+
</NetworkList.OptionListItemDescription>
|
|
1064
|
+
</NetworkList.OptionListItemContent>
|
|
1065
|
+
</NetworkList.OptionListItem>
|
|
1066
|
+
) : null
|
|
1067
|
+
}
|
|
1068
|
+
/>
|
|
1069
|
+
</NetworkList.OptionList>
|
|
1070
|
+
</Box>
|
|
1071
|
+
);
|
|
1072
|
+
},
|
|
1073
|
+
};
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
OptionListEmptyState,
|
|
16
16
|
OptionListSearch,
|
|
17
17
|
OptionListTrigger,
|
|
18
|
+
createOptionList,
|
|
18
19
|
} from './OptionList';
|
|
19
20
|
import type { OptionListItemData } from './types';
|
|
20
21
|
|
|
@@ -552,4 +553,43 @@ describe('OptionList', () => {
|
|
|
552
553
|
expect(queryByText('Selected value')).toBeTruthy();
|
|
553
554
|
});
|
|
554
555
|
});
|
|
556
|
+
|
|
557
|
+
describe('createOptionList', () => {
|
|
558
|
+
it('returns typed components that render and select', () => {
|
|
559
|
+
type Value = 'a' | 'b' | 'c';
|
|
560
|
+
const typedItems: OptionListItemData<Value>[] = [
|
|
561
|
+
{ value: 'a', label: 'Alpha' },
|
|
562
|
+
{ value: 'b', label: 'Beta' },
|
|
563
|
+
{ value: 'c', label: 'Gamma' },
|
|
564
|
+
];
|
|
565
|
+
const {
|
|
566
|
+
OptionList: TypedList,
|
|
567
|
+
OptionListContent: TypedContent,
|
|
568
|
+
OptionListItem: TypedItem,
|
|
569
|
+
OptionListItemContent: TypedItemContent,
|
|
570
|
+
OptionListItemText: TypedItemText,
|
|
571
|
+
} = createOptionList<Value>();
|
|
572
|
+
const onValueChange = jest.fn();
|
|
573
|
+
|
|
574
|
+
const { getByText } = render(
|
|
575
|
+
<TestWrapper>
|
|
576
|
+
<TypedList items={typedItems} onValueChange={onValueChange}>
|
|
577
|
+
<TypedContent
|
|
578
|
+
renderItem={(item) => (
|
|
579
|
+
<TypedItem value={item.value}>
|
|
580
|
+
<TypedItemContent>
|
|
581
|
+
<TypedItemText>{item.label}</TypedItemText>
|
|
582
|
+
</TypedItemContent>
|
|
583
|
+
</TypedItem>
|
|
584
|
+
)}
|
|
585
|
+
/>
|
|
586
|
+
</TypedList>
|
|
587
|
+
</TestWrapper>,
|
|
588
|
+
);
|
|
589
|
+
|
|
590
|
+
fireEvent.press(getByText('Beta'));
|
|
591
|
+
|
|
592
|
+
expect(onValueChange).toHaveBeenCalledWith('b');
|
|
593
|
+
});
|
|
594
|
+
});
|
|
555
595
|
});
|