@ledgerhq/lumen-ui-rnative 0.1.46 → 0.1.48

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.
Files changed (425) hide show
  1. package/README.md +1 -1
  2. package/dist/module/lib/Animations/Pulse/Pulse.mdx +1 -1
  3. package/dist/module/lib/Animations/Pulse/Pulse.stories.js +2 -1
  4. package/dist/module/lib/Animations/Pulse/Pulse.stories.js.map +1 -1
  5. package/dist/module/lib/Animations/Spin/Spin.mdx +1 -1
  6. package/dist/module/lib/Animations/Spin/Spin.stories.js +2 -1
  7. package/dist/module/lib/Animations/Spin/Spin.stories.js.map +1 -1
  8. package/dist/module/lib/Components/AddressInput/AddressInput.mdx +2 -2
  9. package/dist/module/lib/Components/AddressInput/AddressInput.stories.js +2 -1
  10. package/dist/module/lib/Components/AddressInput/AddressInput.stories.js.map +1 -1
  11. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +1 -2
  12. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
  13. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +1 -1
  14. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js +2 -1
  15. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js.map +1 -1
  16. package/dist/module/lib/Components/AmountInput/AmountInput.js +3 -1
  17. package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
  18. package/dist/module/lib/Components/AmountInput/AmountInput.mdx +1 -1
  19. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +17 -1
  20. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
  21. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js +1 -1
  22. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js.map +1 -1
  23. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js +20 -1
  24. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js.map +1 -1
  25. package/dist/module/lib/Components/Avatar/Avatar.js +2 -2
  26. package/dist/module/lib/Components/Avatar/Avatar.mdx +1 -1
  27. package/dist/module/lib/Components/Avatar/Avatar.stories.js +2 -1
  28. package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
  29. package/dist/module/lib/Components/Banner/Banner.js +1 -2
  30. package/dist/module/lib/Components/Banner/Banner.js.map +1 -1
  31. package/dist/module/lib/Components/Banner/Banner.mdx +1 -1
  32. package/dist/module/lib/Components/Banner/Banner.stories.js +2 -1
  33. package/dist/module/lib/Components/Banner/Banner.stories.js.map +1 -1
  34. package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  35. package/dist/module/lib/Components/BottomSheet/BottomSheet.stories.js +2 -1
  36. package/dist/module/lib/Components/BottomSheet/BottomSheet.stories.js.map +1 -1
  37. package/dist/module/lib/Components/Button/Button.js +1 -2
  38. package/dist/module/lib/Components/Button/Button.js.map +1 -1
  39. package/dist/module/lib/Components/Button/Button.mdx +3 -3
  40. package/dist/module/lib/Components/Button/Button.stories.js +2 -1
  41. package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
  42. package/dist/module/lib/Components/Card/Card.js +1 -1
  43. package/dist/module/lib/Components/Card/Card.mdx +1 -1
  44. package/dist/module/lib/Components/Card/Card.stories.js +2 -1
  45. package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
  46. package/dist/module/lib/Components/CardButton/CardButton.js +1 -2
  47. package/dist/module/lib/Components/CardButton/CardButton.js.map +1 -1
  48. package/dist/module/lib/Components/CardButton/CardButton.mdx +1 -1
  49. package/dist/module/lib/Components/CardButton/CardButton.stories.js +2 -1
  50. package/dist/module/lib/Components/CardButton/CardButton.stories.js.map +1 -1
  51. package/dist/module/lib/Components/Checkbox/Checkbox.js +1 -2
  52. package/dist/module/lib/Components/Checkbox/Checkbox.js.map +1 -1
  53. package/dist/module/lib/Components/Checkbox/Checkbox.mdx +1 -1
  54. package/dist/module/lib/Components/Checkbox/Checkbox.stories.js +2 -1
  55. package/dist/module/lib/Components/Checkbox/Checkbox.stories.js.map +1 -1
  56. package/dist/module/lib/Components/ContentBanner/ContentBanner.js +1 -1
  57. package/dist/module/lib/Components/ContentBanner/ContentBanner.mdx +1 -1
  58. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js +2 -1
  59. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js.map +1 -1
  60. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js +1 -1
  61. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.mdx +1 -1
  62. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js +2 -1
  63. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js.map +1 -1
  64. package/dist/module/lib/Components/Divider/Divider.js +1 -1
  65. package/dist/module/lib/Components/Divider/Divider.mdx +1 -1
  66. package/dist/module/lib/Components/Divider/Divider.stories.js +2 -1
  67. package/dist/module/lib/Components/Divider/Divider.stories.js.map +1 -1
  68. package/dist/module/lib/Components/DotCount/DotCount.mdx +1 -1
  69. package/dist/module/lib/Components/DotCount/DotCount.stories.js +2 -1
  70. package/dist/module/lib/Components/DotCount/DotCount.stories.js.map +1 -1
  71. package/dist/module/lib/Components/DotIcon/DotIcon.mdx +1 -1
  72. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +2 -1
  73. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
  74. package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +1 -1
  75. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +2 -1
  76. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js.map +1 -1
  77. package/dist/module/lib/Components/DotSymbol/DotSymbol.mdx +1 -1
  78. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +2 -1
  79. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
  80. package/dist/module/lib/Components/Icon/Icon.mdx +211 -0
  81. package/dist/module/lib/Components/Icon/Icon.stories.js +3 -2
  82. package/dist/module/lib/Components/Icon/Icon.stories.js.map +1 -1
  83. package/dist/module/lib/Components/IconButton/IconButton.mdx +1 -1
  84. package/dist/module/lib/Components/IconButton/IconButton.stories.js +2 -1
  85. package/dist/module/lib/Components/IconButton/IconButton.stories.js.map +1 -1
  86. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js +1 -2
  87. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js.map +1 -1
  88. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  89. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +2 -1
  90. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
  91. package/dist/module/lib/Components/Link/Link.js +1 -2
  92. package/dist/module/lib/Components/Link/Link.js.map +1 -1
  93. package/dist/module/lib/Components/Link/Link.mdx +1 -1
  94. package/dist/module/lib/Components/Link/Link.stories.js +2 -1
  95. package/dist/module/lib/Components/Link/Link.stories.js.map +1 -1
  96. package/dist/module/lib/Components/ListItem/ListItem.js +1 -2
  97. package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
  98. package/dist/module/lib/Components/ListItem/ListItem.mdx +1 -1
  99. package/dist/module/lib/Components/ListItem/ListItem.stories.js +2 -1
  100. package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
  101. package/dist/module/lib/Components/MediaBanner/MediaBanner.js +1 -1
  102. package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  103. package/dist/module/lib/Components/MediaBanner/MediaBanner.stories.js +2 -1
  104. package/dist/module/lib/Components/MediaBanner/MediaBanner.stories.js.map +1 -1
  105. package/dist/module/lib/Components/MediaButton/MediaButton.mdx +2 -2
  106. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +2 -1
  107. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
  108. package/dist/module/lib/Components/MediaCard/MediaCard.mdx +1 -1
  109. package/dist/module/lib/Components/MediaCard/MediaCard.stories.js +2 -1
  110. package/dist/module/lib/Components/MediaCard/MediaCard.stories.js.map +1 -1
  111. package/dist/module/lib/Components/MediaImage/MediaImage.mdx +1 -1
  112. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +2 -1
  113. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
  114. package/dist/module/lib/Components/MediaTag/MediaTag.js +1 -2
  115. package/dist/module/lib/Components/MediaTag/MediaTag.js.map +1 -1
  116. package/dist/module/lib/Components/MediaTag/MediaTag.mdx +2 -2
  117. package/dist/module/lib/Components/MediaTag/MediaTag.stories.js +2 -1
  118. package/dist/module/lib/Components/MediaTag/MediaTag.stories.js.map +1 -1
  119. package/dist/module/lib/Components/NavBar/NavBar.mdx +1 -1
  120. package/dist/module/lib/Components/NavBar/NavBar.stories.js +2 -1
  121. package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
  122. package/dist/module/lib/Components/OptionList/OptionList.js +16 -1
  123. package/dist/module/lib/Components/OptionList/OptionList.js.map +1 -1
  124. package/dist/module/lib/Components/OptionList/OptionList.mdx +46 -1
  125. package/dist/module/lib/Components/OptionList/OptionList.stories.js +63 -2
  126. package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
  127. package/dist/module/lib/Components/OptionList/OptionList.test.js +43 -1
  128. package/dist/module/lib/Components/OptionList/OptionList.test.js.map +1 -1
  129. package/dist/module/lib/Components/OptionList/useOptionList/useOptionListItems.js.map +1 -1
  130. package/dist/module/lib/Components/PageIndicator/PageIndicator.mdx +1 -1
  131. package/dist/module/lib/Components/PageIndicator/PageIndicator.stories.js +2 -1
  132. package/dist/module/lib/Components/PageIndicator/PageIndicator.stories.js.map +1 -1
  133. package/dist/module/lib/Components/SearchInput/SearchInput.mdx +1 -1
  134. package/dist/module/lib/Components/SearchInput/SearchInput.stories.js +2 -1
  135. package/dist/module/lib/Components/SearchInput/SearchInput.stories.js.map +1 -1
  136. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +7 -1
  137. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
  138. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +29 -1
  139. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +26 -2
  140. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
  141. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +28 -1
  142. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
  143. package/dist/module/lib/Components/Skeleton/Skeleton.mdx +1 -1
  144. package/dist/module/lib/Components/Skeleton/Skeleton.stories.js +2 -1
  145. package/dist/module/lib/Components/Skeleton/Skeleton.stories.js.map +1 -1
  146. package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -1
  147. package/dist/module/lib/Components/Spinner/Spinner.stories.js +2 -1
  148. package/dist/module/lib/Components/Spinner/Spinner.stories.js.map +1 -1
  149. package/dist/module/lib/Components/Spot/Spot.js +1 -1
  150. package/dist/module/lib/Components/Spot/Spot.mdx +1 -1
  151. package/dist/module/lib/Components/Spot/Spot.stories.js +2 -1
  152. package/dist/module/lib/Components/Spot/Spot.stories.js.map +1 -1
  153. package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -1
  154. package/dist/module/lib/Components/Stepper/Stepper.stories.js +2 -1
  155. package/dist/module/lib/Components/Stepper/Stepper.stories.js.map +1 -1
  156. package/dist/module/lib/Components/Subheader/Subheader.mdx +1 -1
  157. package/dist/module/lib/Components/Subheader/Subheader.stories.js +2 -1
  158. package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
  159. package/dist/module/lib/Components/Switch/Switch.js +1 -2
  160. package/dist/module/lib/Components/Switch/Switch.js.map +1 -1
  161. package/dist/module/lib/Components/Switch/Switch.mdx +1 -1
  162. package/dist/module/lib/Components/Switch/Switch.stories.js +2 -1
  163. package/dist/module/lib/Components/Switch/Switch.stories.js.map +1 -1
  164. package/dist/module/lib/Components/TabBar/TabBar.js +8 -6
  165. package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
  166. package/dist/module/lib/Components/TabBar/TabBar.mdx +30 -1
  167. package/dist/module/lib/Components/TabBar/TabBar.stories.js +37 -2
  168. package/dist/module/lib/Components/TabBar/TabBar.stories.js.map +1 -1
  169. package/dist/module/lib/Components/TabBar/TabBar.test.js +28 -1
  170. package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
  171. package/dist/module/lib/Components/TabBar/index.js +2 -1
  172. package/dist/module/lib/Components/TabBar/index.js.map +1 -1
  173. package/dist/module/lib/Components/Tag/Tag.js +1 -2
  174. package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
  175. package/dist/module/lib/Components/Tag/Tag.mdx +1 -1
  176. package/dist/module/lib/Components/Tag/Tag.stories.js +2 -1
  177. package/dist/module/lib/Components/Tag/Tag.stories.js.map +1 -1
  178. package/dist/module/lib/Components/TextInput/TextInput.mdx +1 -1
  179. package/dist/module/lib/Components/TextInput/TextInput.stories.js +2 -1
  180. package/dist/module/lib/Components/TextInput/TextInput.stories.js.map +1 -1
  181. package/dist/module/lib/Components/Tile/Tile.js +1 -2
  182. package/dist/module/lib/Components/Tile/Tile.js.map +1 -1
  183. package/dist/module/lib/Components/Tile/Tile.mdx +1 -1
  184. package/dist/module/lib/Components/Tile/Tile.stories.js +2 -1
  185. package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
  186. package/dist/module/lib/Components/TileButton/TileButton.js +1 -1
  187. package/dist/module/lib/Components/TileButton/TileButton.mdx +1 -1
  188. package/dist/module/lib/Components/TileButton/TileButton.stories.js +2 -1
  189. package/dist/module/lib/Components/TileButton/TileButton.stories.js.map +1 -1
  190. package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js +1 -1
  191. package/dist/module/lib/Components/Tooltip/Tooltip.js +1 -1
  192. package/dist/module/lib/Components/Tooltip/Tooltip.mdx +1 -1
  193. package/dist/module/lib/Components/Tooltip/Tooltip.stories.js +2 -1
  194. package/dist/module/lib/Components/Tooltip/Tooltip.stories.js.map +1 -1
  195. package/dist/module/lib/Components/Trend/Trend.mdx +1 -1
  196. package/dist/module/lib/Components/Trend/Trend.stories.js +2 -1
  197. package/dist/module/lib/Components/Trend/Trend.stories.js.map +1 -1
  198. package/dist/module/lib/Components/Utility/Box/Box.js +1 -1
  199. package/dist/module/lib/Components/Utility/Box/Box.mdx +1 -1
  200. package/dist/module/lib/Components/Utility/Box/Box.stories.js +2 -1
  201. package/dist/module/lib/Components/Utility/Box/Box.stories.js.map +1 -1
  202. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.js +1 -1
  203. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.mdx +1 -1
  204. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js +2 -1
  205. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
  206. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.js +1 -1
  207. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.mdx +1 -1
  208. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js +2 -1
  209. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
  210. package/dist/module/lib/Components/Utility/Pressable/Pressable.js +1 -1
  211. package/dist/module/lib/Components/Utility/Pressable/Pressable.mdx +1 -1
  212. package/dist/module/lib/Components/Utility/Pressable/Pressable.stories.js +2 -1
  213. package/dist/module/lib/Components/Utility/Pressable/Pressable.stories.js.map +1 -1
  214. package/dist/module/lib/Components/Utility/Text/Text.js +1 -1
  215. package/dist/module/lib/Components/Utility/Text/Text.mdx +1 -1
  216. package/dist/module/lib/Components/Utility/Text/Text.stories.js +2 -1
  217. package/dist/module/lib/Components/Utility/Text/Text.stories.js.map +1 -1
  218. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -2
  219. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  220. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  221. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  222. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +8 -0
  223. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
  224. package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts +1 -0
  225. package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts.map +1 -1
  226. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +2 -2
  227. package/dist/typescript/src/lib/Components/Banner/Banner.d.ts +1 -2
  228. package/dist/typescript/src/lib/Components/Banner/Banner.d.ts.map +1 -1
  229. package/dist/typescript/src/lib/Components/Button/Button.d.ts +1 -2
  230. package/dist/typescript/src/lib/Components/Button/Button.d.ts.map +1 -1
  231. package/dist/typescript/src/lib/Components/Card/Card.d.ts +1 -1
  232. package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts +1 -2
  233. package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
  234. package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts +1 -2
  235. package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
  236. package/dist/typescript/src/lib/Components/ContentBanner/ContentBanner.d.ts +1 -1
  237. package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts +1 -1
  238. package/dist/typescript/src/lib/Components/Divider/Divider.d.ts +1 -1
  239. package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -2
  240. package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
  241. package/dist/typescript/src/lib/Components/Link/Link.d.ts +1 -2
  242. package/dist/typescript/src/lib/Components/Link/Link.d.ts.map +1 -1
  243. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +1 -2
  244. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  245. package/dist/typescript/src/lib/Components/MediaBanner/MediaBanner.d.ts +1 -1
  246. package/dist/typescript/src/lib/Components/MediaTag/MediaTag.d.ts +1 -2
  247. package/dist/typescript/src/lib/Components/MediaTag/MediaTag.d.ts.map +1 -1
  248. package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts +18 -4
  249. package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts.map +1 -1
  250. package/dist/typescript/src/lib/Components/OptionList/types.d.ts +16 -15
  251. package/dist/typescript/src/lib/Components/OptionList/types.d.ts.map +1 -1
  252. package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts +9 -9
  253. package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts.map +1 -1
  254. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
  255. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  256. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +6 -5
  257. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  258. package/dist/typescript/src/lib/Components/Spot/Spot.d.ts +1 -1
  259. package/dist/typescript/src/lib/Components/Switch/Switch.d.ts +1 -2
  260. package/dist/typescript/src/lib/Components/Switch/Switch.d.ts.map +1 -1
  261. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts +8 -4
  262. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
  263. package/dist/typescript/src/lib/Components/TabBar/index.d.ts +2 -2
  264. package/dist/typescript/src/lib/Components/TabBar/index.d.ts.map +1 -1
  265. package/dist/typescript/src/lib/Components/TabBar/types.d.ts +17 -16
  266. package/dist/typescript/src/lib/Components/TabBar/types.d.ts.map +1 -1
  267. package/dist/typescript/src/lib/Components/Tag/Tag.d.ts +1 -2
  268. package/dist/typescript/src/lib/Components/Tag/Tag.d.ts.map +1 -1
  269. package/dist/typescript/src/lib/Components/Tile/Tile.d.ts +1 -2
  270. package/dist/typescript/src/lib/Components/Tile/Tile.d.ts.map +1 -1
  271. package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts +1 -1
  272. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts +1 -1
  273. package/dist/typescript/src/lib/Components/Tooltip/Tooltip.d.ts +1 -1
  274. package/dist/typescript/src/lib/Components/Utility/Box/Box.d.ts +1 -1
  275. package/dist/typescript/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.d.ts +1 -1
  276. package/dist/typescript/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.d.ts +1 -1
  277. package/dist/typescript/src/lib/Components/Utility/Pressable/Pressable.d.ts +1 -1
  278. package/dist/typescript/src/lib/Components/Utility/Text/Text.d.ts +1 -1
  279. package/package.json +3 -3
  280. package/src/lib/Animations/Pulse/Pulse.mdx +1 -1
  281. package/src/lib/Animations/Pulse/Pulse.stories.tsx +2 -1
  282. package/src/lib/Animations/Spin/Spin.mdx +1 -1
  283. package/src/lib/Animations/Spin/Spin.stories.tsx +2 -1
  284. package/src/lib/Components/AddressInput/AddressInput.mdx +2 -2
  285. package/src/lib/Components/AddressInput/AddressInput.stories.tsx +2 -1
  286. package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +1 -1
  287. package/src/lib/Components/AmountDisplay/AmountDisplay.stories.tsx +2 -1
  288. package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +1 -2
  289. package/src/lib/Components/AmountInput/AmountInput.mdx +1 -1
  290. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +16 -1
  291. package/src/lib/Components/AmountInput/AmountInput.tsx +2 -0
  292. package/src/lib/Components/AmountInput/types.ts +8 -0
  293. package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.ts +20 -0
  294. package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.ts +2 -0
  295. package/src/lib/Components/Avatar/Avatar.mdx +1 -1
  296. package/src/lib/Components/Avatar/Avatar.stories.tsx +2 -1
  297. package/src/lib/Components/Avatar/Avatar.tsx +2 -2
  298. package/src/lib/Components/Banner/Banner.mdx +1 -1
  299. package/src/lib/Components/Banner/Banner.stories.tsx +2 -1
  300. package/src/lib/Components/Banner/Banner.tsx +1 -2
  301. package/src/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  302. package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +2 -1
  303. package/src/lib/Components/Button/Button.mdx +3 -3
  304. package/src/lib/Components/Button/Button.stories.tsx +2 -1
  305. package/src/lib/Components/Button/Button.tsx +1 -2
  306. package/src/lib/Components/Card/Card.mdx +1 -1
  307. package/src/lib/Components/Card/Card.stories.tsx +2 -1
  308. package/src/lib/Components/Card/Card.tsx +1 -1
  309. package/src/lib/Components/CardButton/CardButton.mdx +1 -1
  310. package/src/lib/Components/CardButton/CardButton.stories.tsx +2 -1
  311. package/src/lib/Components/CardButton/CardButton.tsx +1 -2
  312. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
  313. package/src/lib/Components/Checkbox/Checkbox.stories.tsx +2 -1
  314. package/src/lib/Components/Checkbox/Checkbox.tsx +1 -2
  315. package/src/lib/Components/ContentBanner/ContentBanner.mdx +1 -1
  316. package/src/lib/Components/ContentBanner/ContentBanner.stories.tsx +2 -1
  317. package/src/lib/Components/ContentBanner/ContentBanner.tsx +1 -1
  318. package/src/lib/Components/DescriptionItem/DescriptionItem.mdx +1 -1
  319. package/src/lib/Components/DescriptionItem/DescriptionItem.stories.tsx +2 -1
  320. package/src/lib/Components/DescriptionItem/DescriptionItem.tsx +1 -1
  321. package/src/lib/Components/Divider/Divider.mdx +1 -1
  322. package/src/lib/Components/Divider/Divider.stories.tsx +2 -1
  323. package/src/lib/Components/Divider/Divider.tsx +1 -1
  324. package/src/lib/Components/DotCount/DotCount.mdx +1 -1
  325. package/src/lib/Components/DotCount/DotCount.stories.tsx +2 -1
  326. package/src/lib/Components/DotIcon/DotIcon.mdx +1 -1
  327. package/src/lib/Components/DotIcon/DotIcon.stories.tsx +2 -1
  328. package/src/lib/Components/DotIndicator/DotIndicator.mdx +1 -1
  329. package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +2 -1
  330. package/src/lib/Components/DotSymbol/DotSymbol.mdx +1 -1
  331. package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +2 -1
  332. package/src/lib/Components/Icon/Icon.mdx +211 -0
  333. package/src/lib/Components/Icon/Icon.stories.tsx +3 -2
  334. package/src/lib/Components/IconButton/IconButton.mdx +1 -1
  335. package/src/lib/Components/IconButton/IconButton.stories.tsx +2 -1
  336. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  337. package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +2 -1
  338. package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +1 -2
  339. package/src/lib/Components/Link/Link.mdx +1 -1
  340. package/src/lib/Components/Link/Link.stories.tsx +2 -1
  341. package/src/lib/Components/Link/Link.tsx +1 -2
  342. package/src/lib/Components/ListItem/ListItem.mdx +1 -1
  343. package/src/lib/Components/ListItem/ListItem.stories.tsx +2 -1
  344. package/src/lib/Components/ListItem/ListItem.tsx +1 -2
  345. package/src/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  346. package/src/lib/Components/MediaBanner/MediaBanner.stories.tsx +2 -1
  347. package/src/lib/Components/MediaBanner/MediaBanner.tsx +1 -1
  348. package/src/lib/Components/MediaButton/MediaButton.mdx +2 -2
  349. package/src/lib/Components/MediaButton/MediaButton.stories.tsx +2 -1
  350. package/src/lib/Components/MediaCard/MediaCard.mdx +1 -1
  351. package/src/lib/Components/MediaCard/MediaCard.stories.tsx +2 -1
  352. package/src/lib/Components/MediaImage/MediaImage.mdx +1 -1
  353. package/src/lib/Components/MediaImage/MediaImage.stories.tsx +2 -1
  354. package/src/lib/Components/MediaTag/MediaTag.mdx +2 -2
  355. package/src/lib/Components/MediaTag/MediaTag.stories.tsx +2 -1
  356. package/src/lib/Components/MediaTag/MediaTag.tsx +1 -2
  357. package/src/lib/Components/NavBar/NavBar.mdx +1 -1
  358. package/src/lib/Components/NavBar/NavBar.stories.tsx +2 -1
  359. package/src/lib/Components/OptionList/OptionList.mdx +46 -1
  360. package/src/lib/Components/OptionList/OptionList.stories.tsx +65 -1
  361. package/src/lib/Components/OptionList/OptionList.test.tsx +40 -0
  362. package/src/lib/Components/OptionList/OptionList.tsx +57 -10
  363. package/src/lib/Components/OptionList/types.ts +34 -15
  364. package/src/lib/Components/OptionList/useOptionList/useOptionListItems.ts +28 -13
  365. package/src/lib/Components/PageIndicator/PageIndicator.mdx +1 -1
  366. package/src/lib/Components/PageIndicator/PageIndicator.stories.tsx +2 -1
  367. package/src/lib/Components/SearchInput/SearchInput.mdx +1 -1
  368. package/src/lib/Components/SearchInput/SearchInput.stories.tsx +2 -1
  369. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +29 -1
  370. package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +36 -2
  371. package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +32 -1
  372. package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +22 -5
  373. package/src/lib/Components/SegmentedControl/types.ts +11 -5
  374. package/src/lib/Components/Skeleton/Skeleton.mdx +1 -1
  375. package/src/lib/Components/Skeleton/Skeleton.stories.tsx +2 -1
  376. package/src/lib/Components/Spinner/Spinner.mdx +1 -1
  377. package/src/lib/Components/Spinner/Spinner.stories.tsx +2 -1
  378. package/src/lib/Components/Spot/Spot.mdx +1 -1
  379. package/src/lib/Components/Spot/Spot.stories.tsx +2 -1
  380. package/src/lib/Components/Spot/Spot.tsx +1 -1
  381. package/src/lib/Components/Stepper/Stepper.mdx +1 -1
  382. package/src/lib/Components/Stepper/Stepper.stories.tsx +2 -1
  383. package/src/lib/Components/Subheader/Subheader.mdx +1 -1
  384. package/src/lib/Components/Subheader/Subheader.stories.tsx +2 -1
  385. package/src/lib/Components/Switch/Switch.mdx +1 -1
  386. package/src/lib/Components/Switch/Switch.stories.tsx +2 -1
  387. package/src/lib/Components/Switch/Switch.tsx +1 -2
  388. package/src/lib/Components/TabBar/TabBar.mdx +30 -1
  389. package/src/lib/Components/TabBar/TabBar.stories.tsx +36 -2
  390. package/src/lib/Components/TabBar/TabBar.test.tsx +23 -1
  391. package/src/lib/Components/TabBar/TabBar.tsx +18 -11
  392. package/src/lib/Components/TabBar/index.ts +2 -2
  393. package/src/lib/Components/TabBar/types.ts +19 -17
  394. package/src/lib/Components/Tag/Tag.mdx +1 -1
  395. package/src/lib/Components/Tag/Tag.stories.tsx +2 -1
  396. package/src/lib/Components/Tag/Tag.tsx +1 -2
  397. package/src/lib/Components/TextInput/TextInput.mdx +1 -1
  398. package/src/lib/Components/TextInput/TextInput.stories.tsx +2 -1
  399. package/src/lib/Components/Tile/Tile.mdx +1 -1
  400. package/src/lib/Components/Tile/Tile.stories.tsx +2 -1
  401. package/src/lib/Components/Tile/Tile.tsx +1 -2
  402. package/src/lib/Components/TileButton/TileButton.mdx +1 -1
  403. package/src/lib/Components/TileButton/TileButton.stories.tsx +2 -1
  404. package/src/lib/Components/TileButton/TileButton.tsx +1 -1
  405. package/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.tsx +1 -1
  406. package/src/lib/Components/Tooltip/Tooltip.mdx +1 -1
  407. package/src/lib/Components/Tooltip/Tooltip.stories.tsx +2 -1
  408. package/src/lib/Components/Tooltip/Tooltip.tsx +1 -1
  409. package/src/lib/Components/Trend/Trend.mdx +1 -1
  410. package/src/lib/Components/Trend/Trend.stories.tsx +2 -1
  411. package/src/lib/Components/Utility/Box/Box.mdx +1 -1
  412. package/src/lib/Components/Utility/Box/Box.stories.tsx +2 -1
  413. package/src/lib/Components/Utility/Box/Box.tsx +1 -1
  414. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.mdx +1 -1
  415. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +2 -1
  416. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.tsx +1 -1
  417. package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.mdx +1 -1
  418. package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.tsx +2 -1
  419. package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.tsx +1 -1
  420. package/src/lib/Components/Utility/Pressable/Pressable.mdx +1 -1
  421. package/src/lib/Components/Utility/Pressable/Pressable.stories.tsx +2 -1
  422. package/src/lib/Components/Utility/Pressable/Pressable.tsx +1 -1
  423. package/src/lib/Components/Utility/Text/Text.mdx +1 -1
  424. package/src/lib/Components/Utility/Text/Text.stories.tsx +2 -1
  425. package/src/lib/Components/Utility/Text/Text.tsx +1 -1
@@ -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,
@@ -30,7 +31,8 @@ import type { OptionListItemData } from './types';
30
31
 
31
32
  const meta = {
32
33
  component: OptionList,
33
- title: 'Selection/OptionList',
34
+ id: 'rnative-optionlist',
35
+ title: 'Core/OptionList',
34
36
  subcomponents: {
35
37
  OptionListContent,
36
38
  OptionListItem,
@@ -1007,3 +1009,65 @@ export const WithDefaultValue: Story = {
1007
1009
  </Box>
1008
1010
  ),
1009
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
  });
@@ -3,7 +3,7 @@ import {
3
3
  useDisabledContext,
4
4
  DisabledProvider,
5
5
  } from '@ledgerhq/lumen-utils-shared';
6
- import { Fragment, type ReactNode } from 'react';
6
+ import { Fragment, type ReactElement, type ReactNode } from 'react';
7
7
  import { StyleSheet, View } from 'react-native';
8
8
  import { useStyleSheet } from '../../../styles';
9
9
  import { Check, ChevronDown } from '../../Symbols';
@@ -27,13 +27,17 @@ import type {
27
27
  OptionListSearchProps,
28
28
  OptionListTriggerProps,
29
29
  OptionListLabelProps,
30
+ OptionListValue,
30
31
  } from './types';
31
32
  import { useOptionListItems } from './useOptionList/useOptionListItems';
32
33
 
33
34
  const [OptionListProvider, useOptionListContext] =
34
35
  createSafeContext<OptionListContextValue>('OptionList');
35
36
 
36
- export const OptionList = <TMeta extends MetaShape = MetaShape>({
37
+ export const OptionList = <
38
+ T extends OptionListValue = OptionListValue,
39
+ TMeta extends MetaShape = MetaShape,
40
+ >({
37
41
  items,
38
42
  value,
39
43
  defaultValue,
@@ -45,7 +49,7 @@ export const OptionList = <TMeta extends MetaShape = MetaShape>({
45
49
  defaultSearchValue,
46
50
  onSearchValueChange,
47
51
  children,
48
- }: OptionListProps<TMeta>) => {
52
+ }: OptionListProps<T, TMeta>) => {
49
53
  const disabled = useDisabledContext({
50
54
  consumerName: 'OptionList',
51
55
  mergeWith: { disabled: disabledProp },
@@ -55,7 +59,7 @@ export const OptionList = <TMeta extends MetaShape = MetaShape>({
55
59
  {
56
60
  prop: value,
57
61
  defaultProp: defaultValue ?? null,
58
- onChange: onValueChange,
62
+ onChange: (next: string | null) => onValueChange?.(next as T | null),
59
63
  },
60
64
  );
61
65
 
@@ -65,7 +69,7 @@ export const OptionList = <TMeta extends MetaShape = MetaShape>({
65
69
  flatItems,
66
70
  resolvedSearchValue,
67
71
  handleSearchValueChange,
68
- } = useOptionListItems<TMeta>({
72
+ } = useOptionListItems<T, TMeta>({
69
73
  items,
70
74
  filter,
71
75
  filteredItems,
@@ -93,20 +97,26 @@ export const OptionList = <TMeta extends MetaShape = MetaShape>({
93
97
  );
94
98
  };
95
99
 
96
- export const OptionListContent = <TMeta extends MetaShape = MetaShape>({
100
+ export const OptionListContent = <
101
+ T extends OptionListValue = OptionListValue,
102
+ TMeta extends MetaShape = MetaShape,
103
+ >({
97
104
  renderItem,
98
105
  lx,
99
106
  style,
100
107
  ref,
101
108
  ...props
102
- }: OptionListContentProps<TMeta>) => {
109
+ }: OptionListContentProps<T, TMeta>) => {
103
110
  const { selectedValue, isGrouped, groups, flatItems } = useOptionListContext({
104
111
  consumerName: 'OptionListContent',
105
112
  contextRequired: true,
106
113
  });
107
114
 
108
115
  const renderItemWithState = (item: OptionListItemData) =>
109
- renderItem(item as OptionListItemData<TMeta>, selectedValue === item.value);
116
+ renderItem(
117
+ item as OptionListItemData<T, TMeta>,
118
+ selectedValue === item.value,
119
+ );
110
120
 
111
121
  if (isGrouped) {
112
122
  return (
@@ -161,7 +171,7 @@ const useItemStyles = ({
161
171
  );
162
172
  };
163
173
 
164
- export const OptionListItem = ({
174
+ export const OptionListItem = <T extends OptionListValue = OptionListValue>({
165
175
  value,
166
176
  disabled: disabledProp = false,
167
177
  children,
@@ -169,7 +179,7 @@ export const OptionListItem = ({
169
179
  style,
170
180
  ref,
171
181
  ...props
172
- }: OptionListItemProps) => {
182
+ }: OptionListItemProps<T>) => {
173
183
  const { selectedValue, onValueChange } = useOptionListContext({
174
184
  consumerName: 'OptionListItem',
175
185
  contextRequired: true,
@@ -576,3 +586,40 @@ export const OptionListTrigger = ({
576
586
  </Pressable>
577
587
  );
578
588
  };
589
+
590
+ export function createOptionList<
591
+ T extends OptionListValue = never,
592
+ TMeta extends MetaShape = MetaShape,
593
+ >(): {
594
+ OptionList: (props: OptionListProps<T, TMeta>) => ReactElement;
595
+ OptionListContent: (props: OptionListContentProps<T, TMeta>) => ReactElement;
596
+ OptionListItem: (props: OptionListItemProps<T>) => ReactElement;
597
+ OptionListItemText: (props: OptionListItemTextProps) => ReactElement;
598
+ OptionListItemDescription: (
599
+ props: OptionListItemDescriptionProps,
600
+ ) => ReactElement;
601
+ OptionListItemContent: (props: OptionListItemContentProps) => ReactElement;
602
+ OptionListItemContentRow: (
603
+ props: OptionListItemContentRowProps,
604
+ ) => ReactElement;
605
+ OptionListItemLeading: (props: OptionListItemLeadingProps) => ReactElement;
606
+ OptionListSearch: (props: OptionListSearchProps) => ReactElement;
607
+ OptionListEmptyState: (
608
+ props: OptionListEmptyStateProps,
609
+ ) => ReactElement | null;
610
+ OptionListTrigger: (props: OptionListTriggerProps) => ReactElement;
611
+ } {
612
+ return {
613
+ OptionList,
614
+ OptionListContent,
615
+ OptionListItem,
616
+ OptionListItemText,
617
+ OptionListItemDescription,
618
+ OptionListItemContent,
619
+ OptionListItemContentRow,
620
+ OptionListItemLeading,
621
+ OptionListSearch,
622
+ OptionListEmptyState,
623
+ OptionListTrigger,
624
+ };
625
+ }
@@ -8,9 +8,14 @@ import type { SearchInputProps } from '../SearchInput';
8
8
 
9
9
  export type MetaShape = Record<string, unknown>;
10
10
 
11
- export type OptionListItemData<TMeta extends MetaShape = MetaShape> = {
11
+ export type OptionListValue = string;
12
+
13
+ export type OptionListItemData<
14
+ T extends OptionListValue = OptionListValue,
15
+ TMeta extends MetaShape = MetaShape,
16
+ > = {
12
17
  /** Unique string identifier for this item, used for selection tracking. */
13
- value: string;
18
+ value: T;
14
19
  /** Display text. */
15
20
  label: string;
16
21
  /** Secondary text displayed below the label inside the item. */
@@ -43,29 +48,35 @@ export type OptionListContextValue = {
43
48
  };
44
49
 
45
50
  /** Internal type -- consumers never construct this directly. */
46
- export type OptionListItemGroup<TMeta extends MetaShape = MetaShape> = {
51
+ export type OptionListItemGroup<
52
+ T extends OptionListValue = OptionListValue,
53
+ TMeta extends MetaShape = MetaShape,
54
+ > = {
47
55
  label: string;
48
- items: OptionListItemData<TMeta>[];
56
+ items: OptionListItemData<T, TMeta>[];
49
57
  };
50
58
 
51
- export type OptionListProps<TMeta extends MetaShape = MetaShape> = {
59
+ export type OptionListProps<
60
+ T extends OptionListValue = OptionListValue,
61
+ TMeta extends MetaShape = MetaShape,
62
+ > = {
52
63
  /**
53
64
  * Flat array of items.
54
65
  * Use the `group` field on each item for automatic grouping.
55
66
  */
56
- items: OptionListItemData<TMeta>[];
67
+ items: OptionListItemData<T, TMeta>[];
57
68
  /**
58
69
  * The controlled selected value.
59
70
  */
60
- value?: string | null;
71
+ value?: T | null;
61
72
  /**
62
73
  * The default selected value (uncontrolled)
63
74
  */
64
- defaultValue?: string | null;
75
+ defaultValue?: T | null;
65
76
  /**
66
77
  * Called when the selected value changes.
67
78
  */
68
- onValueChange?: (value: string | null) => void;
79
+ onValueChange?: (value: T | null) => void;
69
80
  /**
70
81
  * When true, prevents interaction with the entire list.
71
82
  */
@@ -74,12 +85,14 @@ export type OptionListProps<TMeta extends MetaShape = MetaShape> = {
74
85
  * Custom item/query matcher.
75
86
  * Defaults to case-insensitive label match; `null` disables filtering.
76
87
  */
77
- filter?: null | ((item: OptionListItemData<TMeta>, query: string) => boolean);
88
+ filter?:
89
+ | null
90
+ | ((item: OptionListItemData<T, TMeta>, query: string) => boolean);
78
91
  /**
79
92
  * Pre-filtered items for async/remote search.
80
93
  * Bypasses internal filtering.
81
94
  */
82
- filteredItems?: OptionListItemData<TMeta>[];
95
+ filteredItems?: OptionListItemData<T, TMeta>[];
83
96
  /**
84
97
  * Controlled search input value.
85
98
  */
@@ -95,14 +108,20 @@ export type OptionListProps<TMeta extends MetaShape = MetaShape> = {
95
108
  children: ReactNode;
96
109
  };
97
110
 
98
- export type OptionListContentProps<TMeta extends MetaShape = MetaShape> = {
111
+ export type OptionListContentProps<
112
+ T extends OptionListValue = OptionListValue,
113
+ TMeta extends MetaShape = MetaShape,
114
+ > = {
99
115
  /** Render function called for each item. Receives the item data and selection/disabled state. */
100
- renderItem: (item: OptionListItemData<TMeta>, selected: boolean) => ReactNode;
116
+ renderItem: (
117
+ item: OptionListItemData<T, TMeta>,
118
+ selected: boolean,
119
+ ) => ReactNode;
101
120
  } & Omit<StyledViewProps, 'children'>;
102
121
 
103
- export type OptionListItemProps = {
122
+ export type OptionListItemProps<T extends OptionListValue = OptionListValue> = {
104
123
  /** The value associated with this item, used for selection matching. */
105
- value: string;
124
+ value: T;
106
125
  /** Whether the item is disabled. */
107
126
  disabled?: boolean;
108
127
  children: ReactNode;
@@ -4,13 +4,17 @@ import type {
4
4
  MetaShape,
5
5
  OptionListItemData,
6
6
  OptionListItemGroup,
7
+ OptionListValue,
7
8
  } from '../types';
8
9
 
9
- const groupByField = <TMeta extends MetaShape = MetaShape>(
10
- items: OptionListItemData<TMeta>[],
11
- ): OptionListItemGroup<TMeta>[] => {
10
+ const groupByField = <
11
+ T extends OptionListValue = OptionListValue,
12
+ TMeta extends MetaShape = MetaShape,
13
+ >(
14
+ items: OptionListItemData<T, TMeta>[],
15
+ ): OptionListItemGroup<T, TMeta>[] => {
12
16
  const order: string[] = [];
13
- const map: Record<string, OptionListItemData<TMeta>[]> = {};
17
+ const map: Record<string, OptionListItemData<T, TMeta>[]> = {};
14
18
  for (const item of items) {
15
19
  const key = item.group ?? '';
16
20
  if (!map[key]) {
@@ -30,31 +34,42 @@ export const defaultLabelFilter = (
30
34
  query: string,
31
35
  ): boolean => item.label.toLowerCase().includes(query.toLowerCase());
32
36
 
33
- type UseOptionListItemsParams<TMeta extends MetaShape = MetaShape> = {
34
- items: OptionListItemData<TMeta>[];
35
- filter?: null | ((item: OptionListItemData<TMeta>, query: string) => boolean);
36
- filteredItems?: OptionListItemData<TMeta>[];
37
+ type UseOptionListItemsParams<
38
+ T extends OptionListValue = OptionListValue,
39
+ TMeta extends MetaShape = MetaShape,
40
+ > = {
41
+ items: OptionListItemData<T, TMeta>[];
42
+ filter?:
43
+ | null
44
+ | ((item: OptionListItemData<T, TMeta>, query: string) => boolean);
45
+ filteredItems?: OptionListItemData<T, TMeta>[];
37
46
  searchValue?: string;
38
47
  defaultSearchValue?: string;
39
48
  onSearchValueChange?: (value: string) => void;
40
49
  };
41
50
 
42
- type UseOptionListItemsResult<TMeta extends MetaShape = MetaShape> = {
51
+ type UseOptionListItemsResult<
52
+ T extends OptionListValue = OptionListValue,
53
+ TMeta extends MetaShape = MetaShape,
54
+ > = {
43
55
  isGrouped: boolean;
44
- groups: OptionListItemGroup<TMeta>[];
45
- flatItems: OptionListItemData<TMeta>[];
56
+ groups: OptionListItemGroup<T, TMeta>[];
57
+ flatItems: OptionListItemData<T, TMeta>[];
46
58
  resolvedSearchValue: string;
47
59
  handleSearchValueChange: (val: string) => void;
48
60
  };
49
61
 
50
- export const useOptionListItems = <TMeta extends MetaShape = MetaShape>({
62
+ export const useOptionListItems = <
63
+ T extends OptionListValue = OptionListValue,
64
+ TMeta extends MetaShape = MetaShape,
65
+ >({
51
66
  items,
52
67
  filter,
53
68
  filteredItems,
54
69
  searchValue: searchValueProp,
55
70
  defaultSearchValue,
56
71
  onSearchValueChange,
57
- }: UseOptionListItemsParams<TMeta>): UseOptionListItemsResult<TMeta> => {
72
+ }: UseOptionListItemsParams<T, TMeta>): UseOptionListItemsResult<T, TMeta> => {
58
73
  const [searchValue, handleSearchValueChange] = useControllableState<string>({
59
74
  prop: searchValueProp,
60
75
  defaultProp: defaultSearchValue ?? '',
@@ -4,7 +4,7 @@ import { PageIndicator } from './PageIndicator';
4
4
  import { CustomTabs, Tab } from '../../../../.storybook/components';
5
5
  import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
6
6
 
7
- <Meta title='Communication/PageIndicator' of={PageIndicatorStories} />
7
+ <Meta title='Core/PageIndicator' of={PageIndicatorStories} />
8
8
 
9
9
  # PageIndicator
10
10
 
@@ -6,7 +6,8 @@ import { ArrowLeft, ArrowRight } from '../../Symbols';
6
6
  import { PageIndicator } from './PageIndicator';
7
7
 
8
8
  const meta = {
9
- title: 'Communication/PageIndicator',
9
+ id: 'rnative-pageindicator',
10
+ title: 'Core/PageIndicator',
10
11
  component: PageIndicator,
11
12
  parameters: {
12
13
  layout: 'centered',
@@ -5,7 +5,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
5
5
  import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
6
6
  import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
7
7
 
8
- <Meta title='Input/SearchInput' of={SearchInputStories} />
8
+ <Meta title='Core/SearchInput' of={SearchInputStories} />
9
9
 
10
10
  # SearchInput
11
11
 
@@ -6,7 +6,8 @@ import type { SearchInputProps } from './types';
6
6
 
7
7
  const meta: Meta<typeof SearchInput> = {
8
8
  component: SearchInput,
9
- title: 'Input/SearchInput',
9
+ id: 'rnative-searchinput',
10
+ title: 'Core/SearchInput',
10
11
  args: {
11
12
  appearance: 'plain',
12
13
  },
@@ -5,7 +5,7 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
5
5
  import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
6
6
  import { Box } from '../Utility';
7
7
 
8
- <Meta title='Navigation/SegmentedControl' of={SegmentedControlStories} />
8
+ <Meta title='Core/SegmentedControl' of={SegmentedControlStories} />
9
9
 
10
10
  # SegmentedControl
11
11
 
@@ -67,6 +67,8 @@ Use the library as part of `@ledgerhq/lumen-ui-rnative`. See the [Setup Guide
67
67
 
68
68
  Control selected value in state at the top level and pass it to SegmentedControl. Buttons use value to identify themselves; selected state is derived from context.
69
69
 
70
+ > **Recommended:** prefer the [type-safe variant](#type-safe-variant) below. It shares a single literal union across the root and every button.
71
+
70
72
  ```tsx
71
73
  import { SegmentedControl, SegmentedControlButton } from '@ledgerhq/lumen-ui-rnative';
72
74
 
@@ -87,6 +89,32 @@ export default function Example() {
87
89
  }
88
90
  ```
89
91
 
92
+ ## Type-safe variant
93
+
94
+ `SegmentedControl` and `SegmentedControlButton` communicate via context, so TypeScript cannot connect the root's `selectedValue` to each button's `value` on its own. A typo compiles, and the pill silently never moves to that segment.
95
+
96
+ `createSegmentedControl<T>()` ties both components to one literal union. Call it once at module scope; the returned pair are typed against your `T`.
97
+
98
+ ```tsx
99
+ import { createSegmentedControl } from '@ledgerhq/lumen-ui-rnative';
100
+
101
+ type View = 'preview' | 'raw' | 'blame';
102
+
103
+ const { SegmentedControl, SegmentedControlButton } = createSegmentedControl<View>();
104
+
105
+ function Example() {
106
+ const [view, setView] = React.useState<View>('preview');
107
+
108
+ return (
109
+ <SegmentedControl selectedValue={view} onSelectedChange={setView}>
110
+ <SegmentedControlButton value='preview'>Preview</SegmentedControlButton>
111
+ <SegmentedControlButton value='raw'>Raw</SegmentedControlButton>
112
+ <SegmentedControlButton value='blame'>Blame</SegmentedControlButton>
113
+ </SegmentedControl>
114
+ );
115
+ }
116
+ ```
117
+
90
118
  ## With trailing content
91
119
 
92
120
  Pass any node via `trailingContent` to render it to the right of the label. Use it for badges like `DotCount` to surface counts per segment.
@@ -3,10 +3,15 @@ import { useState } from 'react';
3
3
  import { Coins, Nft, TransferHorizontal } from '../../Symbols';
4
4
  import { DotCount } from '../DotCount';
5
5
  import { Box } from '../Utility';
6
- import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
6
+ import {
7
+ createSegmentedControl,
8
+ SegmentedControl,
9
+ SegmentedControlButton,
10
+ } from './SegmentedControl';
7
11
 
8
12
  const meta = {
9
- title: 'Navigation/SegmentedControl',
13
+ id: 'rnative-segmentedcontrol',
14
+ title: 'Core/SegmentedControl',
10
15
  component: SegmentedControl,
11
16
  subcomponents: {
12
17
  SegmentedControlButton,
@@ -170,3 +175,32 @@ export const WithTrailingContent: Story = {
170
175
  );
171
176
  },
172
177
  };
178
+
179
+ type View = 'preview' | 'raw' | 'blame';
180
+ const TypedSegmentedControl = createSegmentedControl<View>();
181
+
182
+ export const TypesafeFactory: Story = {
183
+ args: {} as React.ComponentProps<typeof SegmentedControl>,
184
+ render: (args) => {
185
+ const [view, setView] = useState<View>('preview');
186
+
187
+ return (
188
+ <TypedSegmentedControl.SegmentedControl
189
+ {...args}
190
+ selectedValue={view}
191
+ onSelectedChange={setView}
192
+ accessibilityLabel='File view'
193
+ >
194
+ <TypedSegmentedControl.SegmentedControlButton value='preview'>
195
+ Preview
196
+ </TypedSegmentedControl.SegmentedControlButton>
197
+ <TypedSegmentedControl.SegmentedControlButton value='raw'>
198
+ Raw
199
+ </TypedSegmentedControl.SegmentedControlButton>
200
+ <TypedSegmentedControl.SegmentedControlButton value='blame'>
201
+ Blame
202
+ </TypedSegmentedControl.SegmentedControlButton>
203
+ </TypedSegmentedControl.SegmentedControl>
204
+ );
205
+ },
206
+ };
@@ -3,7 +3,11 @@ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, fireEvent } from '@testing-library/react-native';
4
4
  import { DotCount } from '../DotCount';
5
5
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
- import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
6
+ import {
7
+ SegmentedControl,
8
+ SegmentedControlButton,
9
+ createSegmentedControl,
10
+ } from './SegmentedControl';
7
11
 
8
12
  const TestWrapper = ({ children }: { children: React.ReactNode }) => (
9
13
  <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
@@ -172,4 +176,31 @@ describe('SegmentedControl', () => {
172
176
  expect(onSelectedChange).toHaveBeenCalledWith('preview');
173
177
  });
174
178
  });
179
+
180
+ describe('createSegmentedControl', () => {
181
+ it('returns typed components that render and select like the originals', () => {
182
+ const {
183
+ SegmentedControl: TypedControl,
184
+ SegmentedControlButton: TypedButton,
185
+ } = createSegmentedControl<'send' | 'receive'>();
186
+ const onSelectedChange = jest.fn();
187
+
188
+ const { getByText } = render(
189
+ <TestWrapper>
190
+ <TypedControl
191
+ selectedValue='send'
192
+ onSelectedChange={onSelectedChange}
193
+ accessibilityLabel='Transaction type'
194
+ >
195
+ <TypedButton value='send'>Send</TypedButton>
196
+ <TypedButton value='receive'>Receive</TypedButton>
197
+ </TypedControl>
198
+ </TestWrapper>,
199
+ );
200
+
201
+ fireEvent.press(getByText('Receive'));
202
+
203
+ expect(onSelectedChange).toHaveBeenCalledWith('receive');
204
+ });
205
+ });
175
206
  });