@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.
Files changed (362) hide show
  1. package/dist/module/i18n/locales/de.json +1 -3
  2. package/dist/module/i18n/locales/en.json +1 -3
  3. package/dist/module/i18n/locales/es.json +1 -3
  4. package/dist/module/i18n/locales/fr.json +1 -3
  5. package/dist/module/i18n/locales/ja.json +1 -3
  6. package/dist/module/i18n/locales/ko.json +1 -3
  7. package/dist/module/i18n/locales/pt.json +1 -3
  8. package/dist/module/i18n/locales/ru.json +1 -3
  9. package/dist/module/i18n/locales/th.json +1 -3
  10. package/dist/module/i18n/locales/tr.json +1 -3
  11. package/dist/module/i18n/locales/zh.json +1 -3
  12. package/dist/module/lib/Animations/Pulse/Pulse.js +3 -3
  13. package/dist/module/lib/Animations/Pulse/Pulse.js.map +1 -1
  14. package/dist/module/lib/Animations/Pulse/Pulse.mdx +0 -1
  15. package/dist/module/lib/Animations/Spin/Spin.js +3 -3
  16. package/dist/module/lib/Animations/Spin/Spin.js.map +1 -1
  17. package/dist/module/lib/Animations/Spin/Spin.mdx +0 -1
  18. package/dist/module/lib/Components/AddressInput/AddressInput.figma.js +36 -0
  19. package/dist/module/lib/Components/AddressInput/AddressInput.figma.js.map +1 -0
  20. package/dist/module/lib/Components/AddressInput/AddressInput.mdx +0 -183
  21. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.figma.js +31 -0
  22. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.figma.js.map +1 -0
  23. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +0 -90
  24. package/dist/module/lib/Components/AmountInput/AmountInput.figma.js +70 -0
  25. package/dist/module/lib/Components/AmountInput/AmountInput.figma.js.map +1 -0
  26. package/dist/module/lib/Components/AmountInput/AmountInput.js +3 -1
  27. package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
  28. package/dist/module/lib/Components/AmountInput/AmountInput.mdx +0 -190
  29. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +15 -0
  30. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
  31. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js +1 -1
  32. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.js.map +1 -1
  33. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js +20 -1
  34. package/dist/module/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.js.map +1 -1
  35. package/dist/module/lib/Components/Avatar/Avatar.figma.js +15 -12
  36. package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -1
  37. package/dist/module/lib/Components/Avatar/Avatar.js +4 -27
  38. package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
  39. package/dist/module/lib/Components/Avatar/Avatar.mdx +53 -69
  40. package/dist/module/lib/Components/Avatar/Avatar.stories.js +27 -33
  41. package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
  42. package/dist/module/lib/Components/Avatar/Avatar.test.js +21 -39
  43. package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
  44. package/dist/module/lib/Components/Banner/Banner.figma.js +107 -0
  45. package/dist/module/lib/Components/Banner/Banner.figma.js.map +1 -0
  46. package/dist/module/lib/Components/Banner/Banner.mdx +0 -86
  47. package/dist/module/lib/Components/BottomSheet/BottomSheet.figma.js +49 -0
  48. package/dist/module/lib/Components/BottomSheet/BottomSheet.figma.js.map +1 -0
  49. package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +0 -119
  50. package/dist/module/lib/Components/Button/Button.figma.js +45 -0
  51. package/dist/module/lib/Components/Button/Button.figma.js.map +1 -0
  52. package/dist/module/lib/Components/Button/Button.mdx +25 -224
  53. package/dist/module/lib/Components/Button/Button.stories.js +4 -36
  54. package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
  55. package/dist/module/lib/Components/Card/Card.figma.js +143 -0
  56. package/dist/module/lib/Components/Card/Card.figma.js.map +1 -0
  57. package/dist/module/lib/Components/Card/Card.mdx +0 -160
  58. package/dist/module/lib/Components/CardButton/CardButton.figma.js +38 -0
  59. package/dist/module/lib/Components/CardButton/CardButton.figma.js.map +1 -0
  60. package/dist/module/lib/Components/CardButton/CardButton.mdx +0 -48
  61. package/dist/module/lib/Components/Checkbox/Checkbox.figma.js +48 -0
  62. package/dist/module/lib/Components/Checkbox/Checkbox.figma.js.map +1 -0
  63. package/dist/module/lib/Components/Checkbox/Checkbox.mdx +0 -73
  64. package/dist/module/lib/Components/ContentBanner/ContentBanner.figma.js +91 -0
  65. package/dist/module/lib/Components/ContentBanner/ContentBanner.figma.js.map +1 -0
  66. package/dist/module/lib/Components/ContentBanner/ContentBanner.mdx +0 -2
  67. package/dist/module/lib/Components/CryptoIcon/CryptoIcon.figma.js +17 -0
  68. package/dist/module/lib/Components/CryptoIcon/CryptoIcon.figma.js.map +1 -0
  69. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.figma.js +29 -0
  70. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.figma.js.map +1 -0
  71. package/dist/module/lib/Components/Divider/Divider.figma.js +10 -0
  72. package/dist/module/lib/Components/Divider/Divider.figma.js.map +1 -0
  73. package/dist/module/lib/Components/Divider/Divider.mdx +0 -2
  74. package/dist/module/lib/Components/DotCount/DotCount.figma.js +29 -0
  75. package/dist/module/lib/Components/DotCount/DotCount.figma.js.map +1 -0
  76. package/dist/module/lib/Components/DotIndicator/DotIndicator.figma.js +29 -0
  77. package/dist/module/lib/Components/DotIndicator/DotIndicator.figma.js.map +1 -0
  78. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +6 -3
  79. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js.map +1 -1
  80. package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.js +17 -0
  81. package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.js.map +1 -0
  82. package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.test.js +17 -0
  83. package/dist/module/lib/Components/DotIndicator/getDotIndicatorProps.test.js.map +1 -0
  84. package/dist/module/lib/Components/DotIndicator/index.js +1 -0
  85. package/dist/module/lib/Components/DotIndicator/index.js.map +1 -1
  86. package/dist/module/lib/Components/Icon/Icon.figma.js +1840 -0
  87. package/dist/module/lib/Components/Icon/Icon.figma.js.map +1 -0
  88. package/dist/module/lib/Components/Icon/Icon.mdx +0 -62
  89. package/dist/module/lib/Components/IconButton/IconButton.figma.js +42 -0
  90. package/dist/module/lib/Components/IconButton/IconButton.figma.js.map +1 -0
  91. package/dist/module/lib/Components/IconButton/IconButton.mdx +0 -68
  92. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.figma.js +51 -0
  93. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.figma.js.map +1 -0
  94. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +0 -107
  95. package/dist/module/lib/Components/Link/Link.figma.js +41 -0
  96. package/dist/module/lib/Components/Link/Link.figma.js.map +1 -0
  97. package/dist/module/lib/Components/Link/Link.mdx +0 -102
  98. package/dist/module/lib/Components/ListItem/ListItem.figma.js +416 -0
  99. package/dist/module/lib/Components/ListItem/ListItem.figma.js.map +1 -0
  100. package/dist/module/lib/Components/ListItem/ListItem.mdx +0 -129
  101. package/dist/module/lib/Components/MediaBanner/MediaBanner.figma.js +25 -0
  102. package/dist/module/lib/Components/MediaBanner/MediaBanner.figma.js.map +1 -0
  103. package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +0 -3
  104. package/dist/module/lib/Components/MediaButton/MediaButton.figma.js +72 -0
  105. package/dist/module/lib/Components/MediaButton/MediaButton.figma.js.map +1 -0
  106. package/dist/module/lib/Components/MediaCard/MediaCard.figma.js +28 -0
  107. package/dist/module/lib/Components/MediaCard/MediaCard.figma.js.map +1 -0
  108. package/dist/module/lib/Components/MediaCard/MediaCard.mdx +0 -2
  109. package/dist/module/lib/Components/MediaImage/MediaImage.mdx +0 -1
  110. package/dist/module/lib/Components/MediaTag/MediaTag.figma.js +100 -0
  111. package/dist/module/lib/Components/MediaTag/MediaTag.figma.js.map +1 -0
  112. package/dist/module/lib/Components/MediaTag/MediaTag.mdx +0 -2
  113. package/dist/module/lib/Components/NavBar/NavBar.figma.js +79 -0
  114. package/dist/module/lib/Components/NavBar/NavBar.figma.js.map +1 -0
  115. package/dist/module/lib/Components/NavBar/NavBar.mdx +0 -2
  116. package/dist/module/lib/Components/OptionList/OptionList.js +16 -1
  117. package/dist/module/lib/Components/OptionList/OptionList.js.map +1 -1
  118. package/dist/module/lib/Components/OptionList/OptionList.mdx +45 -90
  119. package/dist/module/lib/Components/OptionList/OptionList.stories.js +61 -1
  120. package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
  121. package/dist/module/lib/Components/OptionList/OptionList.test.js +43 -1
  122. package/dist/module/lib/Components/OptionList/OptionList.test.js.map +1 -1
  123. package/dist/module/lib/Components/OptionList/useOptionList/useOptionListItems.js.map +1 -1
  124. package/dist/module/lib/Components/PageIndicator/PageIndicator.figma.js +13 -0
  125. package/dist/module/lib/Components/PageIndicator/PageIndicator.figma.js.map +1 -0
  126. package/dist/module/lib/Components/PageIndicator/PageIndicator.mdx +0 -2
  127. package/dist/module/lib/Components/SearchInput/SearchInput.figma.js +31 -0
  128. package/dist/module/lib/Components/SearchInput/SearchInput.figma.js.map +1 -0
  129. package/dist/module/lib/Components/SearchInput/SearchInput.mdx +0 -199
  130. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.figma.js +35 -0
  131. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.figma.js.map +1 -0
  132. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +7 -1
  133. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
  134. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +28 -1
  135. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +24 -1
  136. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
  137. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +28 -1
  138. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
  139. package/dist/module/lib/Components/Skeleton/Skeleton.figma.js +18 -0
  140. package/dist/module/lib/Components/Skeleton/Skeleton.figma.js.map +1 -0
  141. package/dist/module/lib/Components/Skeleton/Skeleton.mdx +0 -71
  142. package/dist/module/lib/Components/Spinner/Spinner.figma.js +13 -0
  143. package/dist/module/lib/Components/Spinner/Spinner.figma.js.map +1 -0
  144. package/dist/module/lib/Components/Spinner/Spinner.mdx +0 -100
  145. package/dist/module/lib/Components/Spot/Spot.figma.js +37 -0
  146. package/dist/module/lib/Components/Spot/Spot.figma.js.map +1 -0
  147. package/dist/module/lib/Components/Spot/Spot.mdx +0 -94
  148. package/dist/module/lib/Components/Stepper/Stepper.figma.js +13 -0
  149. package/dist/module/lib/Components/Stepper/Stepper.figma.js.map +1 -0
  150. package/dist/module/lib/Components/Stepper/Stepper.mdx +0 -67
  151. package/dist/module/lib/Components/Subheader/Subheader.figma.js +67 -0
  152. package/dist/module/lib/Components/Subheader/Subheader.figma.js.map +1 -0
  153. package/dist/module/lib/Components/Subheader/Subheader.mdx +0 -116
  154. package/dist/module/lib/Components/Switch/Switch.figma.js +58 -0
  155. package/dist/module/lib/Components/Switch/Switch.figma.js.map +1 -0
  156. package/dist/module/lib/Components/Switch/Switch.mdx +0 -39
  157. package/dist/module/lib/Components/TabBar/TabBar.figma.js +98 -0
  158. package/dist/module/lib/Components/TabBar/TabBar.figma.js.map +1 -0
  159. package/dist/module/lib/Components/TabBar/TabBar.js +7 -4
  160. package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
  161. package/dist/module/lib/Components/TabBar/TabBar.mdx +29 -5
  162. package/dist/module/lib/Components/TabBar/TabBar.stories.js +35 -1
  163. package/dist/module/lib/Components/TabBar/TabBar.stories.js.map +1 -1
  164. package/dist/module/lib/Components/TabBar/TabBar.test.js +28 -1
  165. package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
  166. package/dist/module/lib/Components/TabBar/index.js +2 -1
  167. package/dist/module/lib/Components/TabBar/index.js.map +1 -1
  168. package/dist/module/lib/Components/Tag/Tag.figma.js +41 -0
  169. package/dist/module/lib/Components/Tag/Tag.figma.js.map +1 -0
  170. package/dist/module/lib/Components/Tag/Tag.mdx +0 -2
  171. package/dist/module/lib/Components/TextInput/TextInput.figma.js +37 -0
  172. package/dist/module/lib/Components/TextInput/TextInput.figma.js.map +1 -0
  173. package/dist/module/lib/Components/TextInput/TextInput.mdx +0 -178
  174. package/dist/module/lib/Components/Tile/Tile.figma.js +111 -0
  175. package/dist/module/lib/Components/Tile/Tile.figma.js.map +1 -0
  176. package/dist/module/lib/Components/Tile/Tile.mdx +0 -53
  177. package/dist/module/lib/Components/TileButton/TileButton.figma.js +23 -0
  178. package/dist/module/lib/Components/TileButton/TileButton.figma.js.map +1 -0
  179. package/dist/module/lib/Components/TileButton/TileButton.mdx +0 -40
  180. package/dist/module/lib/Components/Tooltip/Tooltip.figma.js +26 -0
  181. package/dist/module/lib/Components/Tooltip/Tooltip.figma.js.map +1 -0
  182. package/dist/module/lib/Components/Tooltip/Tooltip.mdx +0 -183
  183. package/dist/module/lib/Components/Trend/Trend.figma.js +29 -0
  184. package/dist/module/lib/Components/Trend/Trend.figma.js.map +1 -0
  185. package/dist/module/lib/Components/Trend/Trend.mdx +0 -2
  186. package/dist/module/lib/Components/Utility/Text/Text.mdx +0 -1
  187. package/dist/module/lib/Symbols/Icons/ChevronAscending.js +1 -1
  188. package/dist/module/lib/Symbols/Icons/ChevronDescending.js +1 -1
  189. package/dist/module/lib/Symbols/Icons/Contact.js +50 -0
  190. package/dist/module/lib/Symbols/Icons/Contact.js.map +1 -0
  191. package/dist/module/lib/Symbols/index.js +1 -0
  192. package/dist/module/lib/Symbols/index.js.map +1 -1
  193. package/dist/typescript/src/lib/Animations/Pulse/Pulse.d.ts.map +1 -1
  194. package/dist/typescript/src/lib/Animations/Spin/Spin.d.ts.map +1 -1
  195. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  196. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  197. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +8 -0
  198. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
  199. package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts +1 -0
  200. package/dist/typescript/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.d.ts.map +1 -1
  201. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +1 -4
  202. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  203. package/dist/typescript/src/lib/Components/Avatar/types.d.ts +0 -6
  204. package/dist/typescript/src/lib/Components/Avatar/types.d.ts.map +1 -1
  205. package/dist/typescript/src/lib/Components/DotIndicator/getDotIndicatorProps.d.ts +24 -0
  206. package/dist/typescript/src/lib/Components/DotIndicator/getDotIndicatorProps.d.ts.map +1 -0
  207. package/dist/typescript/src/lib/Components/DotIndicator/index.d.ts +1 -0
  208. package/dist/typescript/src/lib/Components/DotIndicator/index.d.ts.map +1 -1
  209. package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts +18 -4
  210. package/dist/typescript/src/lib/Components/OptionList/OptionList.d.ts.map +1 -1
  211. package/dist/typescript/src/lib/Components/OptionList/types.d.ts +16 -15
  212. package/dist/typescript/src/lib/Components/OptionList/types.d.ts.map +1 -1
  213. package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts +9 -9
  214. package/dist/typescript/src/lib/Components/OptionList/useOptionList/useOptionListItems.d.ts.map +1 -1
  215. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
  216. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  217. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +6 -5
  218. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  219. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts +7 -2
  220. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
  221. package/dist/typescript/src/lib/Components/TabBar/index.d.ts +2 -2
  222. package/dist/typescript/src/lib/Components/TabBar/index.d.ts.map +1 -1
  223. package/dist/typescript/src/lib/Components/TabBar/types.d.ts +17 -16
  224. package/dist/typescript/src/lib/Components/TabBar/types.d.ts.map +1 -1
  225. package/dist/typescript/src/lib/Symbols/Icons/Contact.d.ts +35 -0
  226. package/dist/typescript/src/lib/Symbols/Icons/Contact.d.ts.map +1 -0
  227. package/dist/typescript/src/lib/Symbols/index.d.ts +1 -0
  228. package/dist/typescript/src/lib/Symbols/index.d.ts.map +1 -1
  229. package/package.json +3 -3
  230. package/src/i18n/locales/de.json +1 -3
  231. package/src/i18n/locales/en.json +1 -3
  232. package/src/i18n/locales/es.json +1 -3
  233. package/src/i18n/locales/fr.json +1 -3
  234. package/src/i18n/locales/ja.json +1 -3
  235. package/src/i18n/locales/ko.json +1 -3
  236. package/src/i18n/locales/pt.json +1 -3
  237. package/src/i18n/locales/ru.json +1 -3
  238. package/src/i18n/locales/th.json +1 -3
  239. package/src/i18n/locales/tr.json +1 -3
  240. package/src/i18n/locales/zh.json +1 -3
  241. package/src/lib/Animations/Pulse/Pulse.mdx +0 -1
  242. package/src/lib/Animations/Pulse/Pulse.tsx +8 -1
  243. package/src/lib/Animations/Spin/Spin.mdx +0 -1
  244. package/src/lib/Animations/Spin/Spin.tsx +8 -1
  245. package/src/lib/Components/AddressInput/AddressInput.figma.tsx +39 -0
  246. package/src/lib/Components/AddressInput/AddressInput.mdx +0 -183
  247. package/src/lib/Components/AmountDisplay/AmountDisplay.figma.tsx +37 -0
  248. package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +0 -90
  249. package/src/lib/Components/AmountInput/AmountInput.figma.tsx +78 -0
  250. package/src/lib/Components/AmountInput/AmountInput.mdx +0 -190
  251. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +14 -0
  252. package/src/lib/Components/AmountInput/AmountInput.tsx +2 -0
  253. package/src/lib/Components/AmountInput/types.ts +8 -0
  254. package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.test.ts +20 -0
  255. package/src/lib/Components/AmountInput/useAmountInputFormatting/useAmountInputFormatting.ts +2 -0
  256. package/src/lib/Components/Avatar/Avatar.figma.tsx +24 -14
  257. package/src/lib/Components/Avatar/Avatar.mdx +53 -69
  258. package/src/lib/Components/Avatar/Avatar.stories.tsx +16 -50
  259. package/src/lib/Components/Avatar/Avatar.test.tsx +12 -32
  260. package/src/lib/Components/Avatar/Avatar.tsx +4 -34
  261. package/src/lib/Components/Avatar/types.ts +0 -6
  262. package/src/lib/Components/Banner/Banner.figma.tsx +115 -0
  263. package/src/lib/Components/Banner/Banner.mdx +0 -86
  264. package/src/lib/Components/BottomSheet/BottomSheet.figma.tsx +52 -0
  265. package/src/lib/Components/BottomSheet/BottomSheet.mdx +0 -119
  266. package/src/lib/Components/Button/Button.figma.tsx +57 -0
  267. package/src/lib/Components/Button/Button.mdx +25 -224
  268. package/src/lib/Components/Button/Button.stories.tsx +3 -35
  269. package/src/lib/Components/Card/Card.figma.tsx +149 -0
  270. package/src/lib/Components/Card/Card.mdx +0 -160
  271. package/src/lib/Components/CardButton/CardButton.figma.tsx +49 -0
  272. package/src/lib/Components/CardButton/CardButton.mdx +0 -48
  273. package/src/lib/Components/Checkbox/Checkbox.figma.tsx +54 -0
  274. package/src/lib/Components/Checkbox/Checkbox.mdx +0 -73
  275. package/src/lib/Components/ContentBanner/ContentBanner.figma.tsx +108 -0
  276. package/src/lib/Components/ContentBanner/ContentBanner.mdx +0 -2
  277. package/src/lib/Components/CryptoIcon/CryptoIcon.figma.tsx +20 -0
  278. package/src/lib/Components/DescriptionItem/DescriptionItem.figma.tsx +36 -0
  279. package/src/lib/Components/Divider/Divider.figma.tsx +11 -0
  280. package/src/lib/Components/Divider/Divider.mdx +0 -2
  281. package/src/lib/Components/DotCount/DotCount.figma.tsx +32 -0
  282. package/src/lib/Components/DotIndicator/DotIndicator.figma.tsx +32 -0
  283. package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +4 -1
  284. package/src/lib/Components/DotIndicator/getDotIndicatorProps.test.ts +15 -0
  285. package/src/lib/Components/DotIndicator/getDotIndicatorProps.ts +10 -0
  286. package/src/lib/Components/DotIndicator/index.ts +1 -0
  287. package/src/lib/Components/Icon/Icon.figma.tsx +3085 -0
  288. package/src/lib/Components/Icon/Icon.mdx +0 -62
  289. package/src/lib/Components/IconButton/IconButton.figma.tsx +53 -0
  290. package/src/lib/Components/IconButton/IconButton.mdx +0 -68
  291. package/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.tsx +52 -0
  292. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +0 -107
  293. package/src/lib/Components/Link/Link.figma.tsx +53 -0
  294. package/src/lib/Components/Link/Link.mdx +0 -102
  295. package/src/lib/Components/ListItem/ListItem.figma.tsx +431 -0
  296. package/src/lib/Components/ListItem/ListItem.mdx +0 -129
  297. package/src/lib/Components/MediaBanner/MediaBanner.figma.tsx +32 -0
  298. package/src/lib/Components/MediaBanner/MediaBanner.mdx +0 -3
  299. package/src/lib/Components/MediaButton/MediaButton.figma.tsx +60 -0
  300. package/src/lib/Components/MediaCard/MediaCard.figma.tsx +27 -0
  301. package/src/lib/Components/MediaCard/MediaCard.mdx +0 -2
  302. package/src/lib/Components/MediaImage/MediaImage.mdx +0 -1
  303. package/src/lib/Components/MediaTag/MediaTag.figma.tsx +116 -0
  304. package/src/lib/Components/MediaTag/MediaTag.mdx +0 -2
  305. package/src/lib/Components/NavBar/NavBar.figma.tsx +84 -0
  306. package/src/lib/Components/NavBar/NavBar.mdx +0 -2
  307. package/src/lib/Components/OptionList/OptionList.mdx +45 -90
  308. package/src/lib/Components/OptionList/OptionList.stories.tsx +63 -0
  309. package/src/lib/Components/OptionList/OptionList.test.tsx +40 -0
  310. package/src/lib/Components/OptionList/OptionList.tsx +57 -10
  311. package/src/lib/Components/OptionList/types.ts +34 -15
  312. package/src/lib/Components/OptionList/useOptionList/useOptionListItems.ts +28 -13
  313. package/src/lib/Components/PageIndicator/PageIndicator.figma.tsx +11 -0
  314. package/src/lib/Components/PageIndicator/PageIndicator.mdx +0 -2
  315. package/src/lib/Components/SearchInput/SearchInput.figma.tsx +34 -0
  316. package/src/lib/Components/SearchInput/SearchInput.mdx +0 -199
  317. package/src/lib/Components/SegmentedControl/SegmentedControl.figma.tsx +34 -0
  318. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +28 -1
  319. package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +34 -1
  320. package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +32 -1
  321. package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +22 -5
  322. package/src/lib/Components/SegmentedControl/types.ts +11 -5
  323. package/src/lib/Components/Skeleton/Skeleton.figma.tsx +17 -0
  324. package/src/lib/Components/Skeleton/Skeleton.mdx +0 -71
  325. package/src/lib/Components/Spinner/Spinner.figma.tsx +12 -0
  326. package/src/lib/Components/Spinner/Spinner.mdx +0 -100
  327. package/src/lib/Components/Spot/Spot.figma.tsx +50 -0
  328. package/src/lib/Components/Spot/Spot.mdx +0 -94
  329. package/src/lib/Components/Stepper/Stepper.figma.tsx +11 -0
  330. package/src/lib/Components/Stepper/Stepper.mdx +0 -67
  331. package/src/lib/Components/Subheader/Subheader.figma.tsx +72 -0
  332. package/src/lib/Components/Subheader/Subheader.mdx +0 -116
  333. package/src/lib/Components/Switch/Switch.figma.tsx +66 -0
  334. package/src/lib/Components/Switch/Switch.mdx +0 -39
  335. package/src/lib/Components/TabBar/TabBar.figma.tsx +70 -0
  336. package/src/lib/Components/TabBar/TabBar.mdx +29 -5
  337. package/src/lib/Components/TabBar/TabBar.stories.tsx +34 -1
  338. package/src/lib/Components/TabBar/TabBar.test.tsx +23 -1
  339. package/src/lib/Components/TabBar/TabBar.tsx +17 -9
  340. package/src/lib/Components/TabBar/index.ts +2 -2
  341. package/src/lib/Components/TabBar/types.ts +19 -17
  342. package/src/lib/Components/Tag/Tag.figma.tsx +52 -0
  343. package/src/lib/Components/Tag/Tag.mdx +0 -2
  344. package/src/lib/Components/TextInput/TextInput.figma.tsx +40 -0
  345. package/src/lib/Components/TextInput/TextInput.mdx +0 -178
  346. package/src/lib/Components/Tile/Tile.figma.tsx +113 -0
  347. package/src/lib/Components/Tile/Tile.mdx +0 -53
  348. package/src/lib/Components/TileButton/TileButton.figma.tsx +35 -0
  349. package/src/lib/Components/TileButton/TileButton.mdx +0 -40
  350. package/src/lib/Components/Tooltip/Tooltip.figma.tsx +30 -0
  351. package/src/lib/Components/Tooltip/Tooltip.mdx +0 -183
  352. package/src/lib/Components/Trend/Trend.figma.tsx +28 -0
  353. package/src/lib/Components/Trend/Trend.mdx +0 -2
  354. package/src/lib/Components/Utility/Text/Text.mdx +0 -1
  355. package/src/lib/Symbols/Icons/ChevronAscending.tsx +1 -1
  356. package/src/lib/Symbols/Icons/ChevronDescending.tsx +1 -1
  357. package/src/lib/Symbols/Icons/Contact.tsx +45 -0
  358. package/src/lib/Symbols/index.ts +1 -0
  359. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts +0 -2
  360. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts.map +0 -1
  361. package/dist/typescript/src/lib/Components/OptionList/OptionList.figma.d.ts +0 -2
  362. 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
  });