@ledgerhq/lumen-ui-rnative 0.0.43 → 0.0.45

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 (337) hide show
  1. package/.storybook/Decorator.tsx +78 -13
  2. package/.storybook/docs/getting-started/ThemeProvider.mdx +1 -1
  3. package/.storybook/docs/style-system/lx.mdx +144 -0
  4. package/.storybook/docs/style-system/useCreate.mdx +95 -0
  5. package/.storybook/docs/style-system/useTheme.mdx +52 -0
  6. package/.storybook/preview-head.html +2 -2
  7. package/.storybook/{preview.ts → preview.tsx} +6 -1
  8. package/dist/package.json +2 -3
  9. package/dist/src/lib/Components/AddressInput/AddressInput.js +1 -1
  10. package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts +7 -1
  11. package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts.map +1 -1
  12. package/dist/src/lib/Components/AddressInput/AddressInput.stories.js +98 -9
  13. package/dist/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  14. package/dist/src/lib/Components/AmountInput/AmountInput.js +3 -3
  15. package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts +10 -1
  16. package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts.map +1 -1
  17. package/dist/src/lib/Components/AmountInput/AmountInput.stories.js +162 -9
  18. package/dist/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  19. package/dist/src/lib/Components/BaseInput/BaseInput.js +2 -19
  20. package/dist/src/lib/Components/BottomSheet/BottomSheet.js +1 -1
  21. package/dist/src/lib/Components/BottomSheet/BottomSheet.stories.js +8 -8
  22. package/dist/src/lib/Components/Button/BaseButton.d.ts +3 -3
  23. package/dist/src/lib/Components/Button/BaseButton.d.ts.map +1 -1
  24. package/dist/src/lib/Components/Button/BaseButton.js +99 -119
  25. package/dist/src/lib/Components/Button/Button.d.ts +4 -26
  26. package/dist/src/lib/Components/Button/Button.d.ts.map +1 -1
  27. package/dist/src/lib/Components/Button/Button.js +2 -2
  28. package/dist/src/lib/Components/Button/Button.stories.d.ts +1 -1
  29. package/dist/src/lib/Components/Button/Button.stories.d.ts.map +1 -1
  30. package/dist/src/lib/Components/Button/Button.stories.js +25 -48
  31. package/dist/src/lib/Components/Button/index.d.ts +1 -1
  32. package/dist/src/lib/Components/Button/index.d.ts.map +1 -1
  33. package/dist/src/lib/Components/Button/index.js +1 -1
  34. package/dist/src/lib/Components/Button/{BaseButton.types.d.ts → types.d.ts} +15 -10
  35. package/dist/src/lib/Components/Button/types.d.ts.map +1 -0
  36. package/dist/src/lib/Components/CardButton/CardButton.d.ts +4 -3
  37. package/dist/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
  38. package/dist/src/lib/Components/CardButton/CardButton.js +65 -71
  39. package/dist/src/lib/Components/CardButton/CardButton.stories.d.ts.map +1 -1
  40. package/dist/src/lib/Components/CardButton/CardButton.stories.js +28 -15
  41. package/dist/src/lib/Components/CardButton/index.d.ts +1 -1
  42. package/dist/src/lib/Components/CardButton/index.d.ts.map +1 -1
  43. package/dist/src/lib/Components/CardButton/index.js +1 -1
  44. package/dist/src/lib/Components/CardButton/{CardButton.types.d.ts → types.d.ts} +5 -4
  45. package/dist/src/lib/Components/CardButton/types.d.ts.map +1 -0
  46. package/dist/src/lib/Components/Icon/Icon.d.ts +6 -3
  47. package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
  48. package/dist/src/lib/Components/Icon/Icon.js +24 -25
  49. package/dist/src/lib/Components/Icon/Icon.stories.d.ts +2 -2
  50. package/dist/src/lib/Components/Icon/Icon.stories.d.ts.map +1 -1
  51. package/dist/src/lib/Components/Icon/Icon.stories.js +73 -19
  52. package/dist/src/lib/Components/Icon/createIcon.d.ts +1 -1
  53. package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  54. package/dist/src/lib/Components/Icon/createIcon.js +1 -2
  55. package/dist/src/lib/Components/Icon/index.d.ts +1 -1
  56. package/dist/src/lib/Components/Icon/index.d.ts.map +1 -1
  57. package/dist/src/lib/Components/Icon/index.js +1 -1
  58. package/dist/src/lib/Components/Icon/{Icon.types.d.ts → types.d.ts} +7 -4
  59. package/dist/src/lib/Components/Icon/types.d.ts.map +1 -0
  60. package/dist/src/lib/Components/IconButton/IconButton.d.ts +2 -19
  61. package/dist/src/lib/Components/IconButton/IconButton.d.ts.map +1 -1
  62. package/dist/src/lib/Components/IconButton/IconButton.stories.d.ts.map +1 -1
  63. package/dist/src/lib/Components/IconButton/IconButton.stories.js +9 -11
  64. package/dist/src/lib/Components/IconButton/index.d.ts +1 -0
  65. package/dist/src/lib/Components/IconButton/index.d.ts.map +1 -1
  66. package/dist/src/lib/Components/IconButton/index.js +1 -0
  67. package/dist/src/lib/Components/IconButton/types.d.ts +12 -0
  68. package/dist/src/lib/Components/IconButton/types.d.ts.map +1 -0
  69. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +2 -2
  70. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
  71. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.js +1 -1
  72. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.js +34 -34
  73. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts +1 -1
  74. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts.map +1 -1
  75. package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +22 -9
  76. package/dist/src/lib/Components/InteractiveIcon/types.d.ts +3 -7
  77. package/dist/src/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
  78. package/dist/src/lib/Components/Link/Link.d.ts +7 -77
  79. package/dist/src/lib/Components/Link/Link.d.ts.map +1 -1
  80. package/dist/src/lib/Components/Link/Link.js +59 -75
  81. package/dist/src/lib/Components/Link/Link.stories.d.ts.map +1 -1
  82. package/dist/src/lib/Components/Link/Link.stories.js +34 -11
  83. package/dist/src/lib/Components/Link/index.d.ts +1 -0
  84. package/dist/src/lib/Components/Link/index.d.ts.map +1 -1
  85. package/dist/src/lib/Components/Link/index.js +1 -0
  86. package/dist/src/lib/Components/Link/types.d.ts +43 -0
  87. package/dist/src/lib/Components/Link/types.d.ts.map +1 -0
  88. package/dist/src/lib/Components/Link/types.js +1 -0
  89. package/dist/src/lib/Components/Search/Search.stories.d.ts +6 -1
  90. package/dist/src/lib/Components/Search/Search.stories.d.ts.map +1 -1
  91. package/dist/src/lib/Components/Search/Search.stories.js +71 -9
  92. package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
  93. package/dist/src/lib/Components/Select/Select.js +1 -17
  94. package/dist/src/lib/Components/Spinner/Spinner.d.ts +13 -16
  95. package/dist/src/lib/Components/Spinner/Spinner.d.ts.map +1 -1
  96. package/dist/src/lib/Components/Spinner/Spinner.js +33 -5
  97. package/dist/src/lib/Components/Spinner/Spinner.stories.d.ts.map +1 -1
  98. package/dist/src/lib/Components/Spinner/Spinner.stories.js +1 -1
  99. package/dist/src/lib/Components/Spinner/index.d.ts +1 -0
  100. package/dist/src/lib/Components/Spinner/index.d.ts.map +1 -1
  101. package/dist/src/lib/Components/Spinner/index.js +1 -0
  102. package/dist/src/lib/Components/Spinner/types.d.ts +15 -0
  103. package/dist/src/lib/Components/Spinner/types.d.ts.map +1 -0
  104. package/dist/src/lib/Components/Spinner/types.js +1 -0
  105. package/dist/src/lib/Components/Tag/Tag.d.ts +2 -1
  106. package/dist/src/lib/Components/Tag/Tag.d.ts.map +1 -1
  107. package/dist/src/lib/Components/Tag/Tag.js +15 -4
  108. package/dist/src/lib/Components/Tag/Tag.stories.js +1 -1
  109. package/dist/src/lib/Components/Tag/Tag.types.d.ts +7 -1
  110. package/dist/src/lib/Components/Tag/Tag.types.d.ts.map +1 -1
  111. package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts +8 -1
  112. package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts.map +1 -1
  113. package/dist/src/lib/Components/TextInput/TextInput.stories.js +104 -9
  114. package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
  115. package/dist/src/lib/Components/Tile/Tile.js +54 -8
  116. package/dist/src/lib/Components/Tile/types.d.ts +14 -1
  117. package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
  118. package/dist/src/lib/Components/Tooltip/Tooltip.stories.js +2 -2
  119. package/dist/src/lib/Components/Utility/Box/Box.d.ts +39 -0
  120. package/dist/src/lib/Components/Utility/Box/Box.d.ts.map +1 -0
  121. package/dist/src/lib/Components/{Box → Utility/Box}/Box.js +10 -11
  122. package/dist/src/lib/Components/Utility/Box/Box.stories.d.ts.map +1 -0
  123. package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.js +13 -12
  124. package/dist/src/lib/Components/Utility/Box/index.d.ts +2 -0
  125. package/dist/src/lib/Components/Utility/Box/index.d.ts.map +1 -0
  126. package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts +34 -0
  127. package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts.map +1 -0
  128. package/dist/src/lib/Components/Utility/Pressable/Pressable.js +33 -0
  129. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts +7 -0
  130. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts.map +1 -0
  131. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.js +47 -0
  132. package/dist/src/lib/Components/Utility/Pressable/index.d.ts +3 -0
  133. package/dist/src/lib/Components/Utility/Pressable/index.d.ts.map +1 -0
  134. package/dist/src/lib/Components/Utility/Pressable/index.js +1 -0
  135. package/dist/src/lib/Components/Utility/Pressable/types.d.ts +3 -0
  136. package/dist/src/lib/Components/Utility/Pressable/types.d.ts.map +1 -0
  137. package/dist/src/lib/Components/Utility/Pressable/types.js +1 -0
  138. package/dist/src/lib/Components/Utility/Text/Text.d.ts +40 -0
  139. package/dist/src/lib/Components/Utility/Text/Text.d.ts.map +1 -0
  140. package/dist/src/lib/Components/{Text → Utility/Text}/Text.js +13 -9
  141. package/dist/src/lib/Components/Utility/Text/Text.stories.d.ts.map +1 -0
  142. package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.js +3 -3
  143. package/dist/src/lib/Components/Utility/Text/index.d.ts.map +1 -0
  144. package/dist/src/lib/Components/Utility/index.d.ts +4 -0
  145. package/dist/src/lib/Components/Utility/index.d.ts.map +1 -0
  146. package/dist/src/lib/Components/Utility/index.js +3 -0
  147. package/dist/src/lib/Components/index.d.ts +1 -3
  148. package/dist/src/lib/Components/index.d.ts.map +1 -1
  149. package/dist/src/lib/Components/index.js +1 -3
  150. package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts +6 -5
  151. package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts.map +1 -1
  152. package/dist/src/lib/utils/components/InjectStylesIntoChildren.js +6 -6
  153. package/dist/src/styles/LumenStyleSheet.d.ts +1 -1
  154. package/dist/src/styles/LumenStyleSheet.d.ts.map +1 -1
  155. package/dist/src/styles/Provider/createStylesheetTheme.d.ts +0 -1
  156. package/dist/src/styles/Provider/createStylesheetTheme.d.ts.map +1 -1
  157. package/dist/src/styles/Provider/createStylesheetTheme.js +0 -1
  158. package/dist/src/styles/create/useCreate.d.ts +2 -1
  159. package/dist/src/styles/create/useCreate.d.ts.map +1 -1
  160. package/dist/src/styles/create/useCreate.js +5 -5
  161. package/dist/src/styles/factories/areLxPropsEqual.d.ts +3 -0
  162. package/dist/src/styles/factories/areLxPropsEqual.d.ts.map +1 -0
  163. package/dist/src/styles/factories/areLxPropsEqual.js +15 -0
  164. package/dist/src/styles/factories/createStyledPressable.d.ts +26 -0
  165. package/dist/src/styles/factories/createStyledPressable.d.ts.map +1 -0
  166. package/dist/src/styles/factories/createStyledPressable.js +61 -0
  167. package/dist/src/styles/factories/createStyledText.d.ts +15 -26
  168. package/dist/src/styles/factories/createStyledText.d.ts.map +1 -1
  169. package/dist/src/styles/factories/createStyledText.js +13 -29
  170. package/dist/src/styles/factories/createStyledView.d.ts +7 -27
  171. package/dist/src/styles/factories/createStyledView.d.ts.map +1 -1
  172. package/dist/src/styles/factories/createStyledView.js +10 -30
  173. package/dist/src/styles/factories/index.d.ts +4 -0
  174. package/dist/src/styles/factories/index.d.ts.map +1 -0
  175. package/dist/src/styles/factories/index.js +3 -0
  176. package/dist/src/styles/index.d.ts +2 -3
  177. package/dist/src/styles/index.d.ts.map +1 -1
  178. package/dist/src/styles/index.js +2 -3
  179. package/dist/src/styles/resolveStyle/resolveConfig.d.ts +7 -7
  180. package/dist/src/styles/resolveStyle/resolveConfig.d.ts.map +1 -1
  181. package/dist/src/styles/resolveStyle/resolveConfig.js +9 -9
  182. package/dist/src/styles/resolveStyle/resolveStyle.d.ts +6 -20
  183. package/dist/src/styles/resolveStyle/resolveStyle.d.ts.map +1 -1
  184. package/dist/src/styles/resolveStyle/resolveStyle.js +4 -29
  185. package/dist/src/styles/types/create.types.d.ts +1 -1
  186. package/dist/src/styles/types/create.types.d.ts.map +1 -1
  187. package/dist/src/styles/types/styled.types.d.ts +72 -50
  188. package/dist/src/styles/types/styled.types.d.ts.map +1 -1
  189. package/dist/src/styles/types/utility.types.d.ts.map +1 -1
  190. package/dist/src/styles/utils/index.d.ts +2 -0
  191. package/dist/src/styles/utils/index.d.ts.map +1 -0
  192. package/dist/src/styles/utils/index.js +1 -0
  193. package/dist/src/styles/utils/mergeStyles.d.ts +16 -0
  194. package/dist/src/styles/utils/mergeStyles.d.ts.map +1 -0
  195. package/dist/src/styles/utils/mergeStyles.js +20 -0
  196. package/package.json +3 -4
  197. package/src/lib/Components/AddressInput/AddressInput.mdx +15 -4
  198. package/src/lib/Components/AddressInput/AddressInput.stories.tsx +133 -17
  199. package/src/lib/Components/AddressInput/AddressInput.tsx +1 -1
  200. package/src/lib/Components/AmountInput/AmountInput.mdx +20 -1
  201. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +180 -17
  202. package/src/lib/Components/AmountInput/AmountInput.tsx +24 -15
  203. package/src/lib/Components/Banner/Banner.test.tsx +48 -15
  204. package/src/lib/Components/BaseInput/BaseInput.tsx +6 -35
  205. package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +8 -8
  206. package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
  207. package/src/lib/Components/Button/BaseButton.test.tsx +149 -0
  208. package/src/lib/Components/Button/BaseButton.tsx +193 -148
  209. package/src/lib/Components/Button/Button.mdx +34 -31
  210. package/src/lib/Components/Button/Button.stories.tsx +37 -58
  211. package/src/lib/Components/Button/Button.tsx +4 -11
  212. package/src/lib/Components/Button/index.ts +1 -1
  213. package/src/lib/Components/Button/{BaseButton.types.ts → types.ts} +14 -8
  214. package/src/lib/Components/CardButton/CardButton.mdx +15 -25
  215. package/src/lib/Components/CardButton/CardButton.stories.tsx +48 -22
  216. package/src/lib/Components/CardButton/CardButton.test.tsx +141 -0
  217. package/src/lib/Components/CardButton/CardButton.tsx +142 -108
  218. package/src/lib/Components/CardButton/index.ts +1 -1
  219. package/src/lib/Components/CardButton/{CardButton.types.ts → types.ts} +4 -3
  220. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
  221. package/src/lib/Components/Checkbox/Checkbox.test.tsx +42 -17
  222. package/src/lib/Components/Icon/Icon.stories.tsx +143 -73
  223. package/src/lib/Components/Icon/Icon.test.tsx +84 -0
  224. package/src/lib/Components/Icon/Icon.tsx +32 -28
  225. package/src/lib/Components/Icon/createIcon.ts +2 -3
  226. package/src/lib/Components/Icon/index.ts +1 -1
  227. package/src/lib/Components/Icon/{Icon.types.ts → types.ts} +4 -3
  228. package/src/lib/Components/IconButton/IconButton.mdx +13 -10
  229. package/src/lib/Components/IconButton/IconButton.stories.tsx +12 -14
  230. package/src/lib/Components/IconButton/IconButton.test.tsx +141 -0
  231. package/src/lib/Components/IconButton/IconButton.tsx +3 -13
  232. package/src/lib/Components/IconButton/index.ts +1 -0
  233. package/src/lib/Components/IconButton/types.ts +12 -0
  234. package/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.tsx +1 -1
  235. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +25 -27
  236. package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +82 -43
  237. package/src/lib/Components/InteractiveIcon/InteractiveIcon.test.tsx +30 -19
  238. package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +78 -45
  239. package/src/lib/Components/InteractiveIcon/types.ts +4 -7
  240. package/src/lib/Components/Link/Link.mdx +8 -18
  241. package/src/lib/Components/Link/Link.stories.tsx +56 -25
  242. package/src/lib/Components/Link/Link.test.tsx +141 -51
  243. package/src/lib/Components/Link/Link.tsx +128 -150
  244. package/src/lib/Components/Link/index.ts +1 -0
  245. package/src/lib/Components/Link/types.ts +44 -0
  246. package/src/lib/Components/Search/Search.mdx +14 -1
  247. package/src/lib/Components/Search/Search.stories.tsx +94 -15
  248. package/src/lib/Components/Select/Select.test.tsx +8 -4
  249. package/src/lib/Components/Select/Select.tsx +4 -31
  250. package/src/lib/Components/Spinner/Spinner.stories.tsx +1 -5
  251. package/src/lib/Components/Spinner/Spinner.tsx +60 -34
  252. package/src/lib/Components/Spinner/index.ts +1 -0
  253. package/src/lib/Components/Spinner/types.ts +15 -0
  254. package/src/lib/Components/Switch/Switch.mdx +1 -1
  255. package/src/lib/Components/Tag/Tag.stories.tsx +2 -2
  256. package/src/lib/Components/Tag/Tag.tsx +22 -6
  257. package/src/lib/Components/Tag/Tag.types.ts +7 -8
  258. package/src/lib/Components/TextInput/TextInput.mdx +24 -4
  259. package/src/lib/Components/TextInput/TextInput.stories.tsx +131 -15
  260. package/src/lib/Components/Tile/Tile.test.tsx +100 -63
  261. package/src/lib/Components/Tile/Tile.tsx +64 -13
  262. package/src/lib/Components/Tile/types.ts +14 -1
  263. package/src/lib/Components/Tooltip/Tooltip.stories.tsx +2 -2
  264. package/src/lib/Components/Tooltip/Tooltip.test.tsx +8 -4
  265. package/src/lib/Components/{Box → Utility/Box}/Box.mdx +15 -13
  266. package/src/lib/Components/{Box → Utility/Box}/Box.stories.tsx +13 -11
  267. package/src/lib/Components/{Box → Utility/Box}/Box.tsx +11 -12
  268. package/src/lib/Components/Utility/Box/index.ts +1 -0
  269. package/src/lib/Components/Utility/Pressable/Pressable.mdx +103 -0
  270. package/src/lib/Components/Utility/Pressable/Pressable.stories.tsx +51 -0
  271. package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +221 -0
  272. package/src/lib/Components/Utility/Pressable/Pressable.tsx +34 -0
  273. package/src/lib/Components/Utility/Pressable/index.ts +2 -0
  274. package/src/lib/Components/Utility/Pressable/types.ts +3 -0
  275. package/src/lib/Components/{Text → Utility/Text}/Text.mdx +15 -7
  276. package/src/lib/Components/{Text → Utility/Text}/Text.stories.tsx +3 -3
  277. package/src/lib/Components/Utility/Text/Text.tsx +39 -0
  278. package/src/lib/Components/Utility/index.ts +3 -0
  279. package/src/lib/Components/index.ts +1 -3
  280. package/src/lib/utils/components/InjectStylesIntoChildren.tsx +23 -14
  281. package/src/styles/Provider/createStylesheetTheme.ts +0 -1
  282. package/src/styles/create/useCreate.ts +8 -4
  283. package/src/styles/factories/areLxPropsEqual.ts +32 -0
  284. package/src/styles/factories/createStyledPressable.test.tsx +253 -0
  285. package/src/styles/factories/createStyledPressable.tsx +97 -0
  286. package/src/styles/factories/createStyledText.test.tsx +28 -20
  287. package/src/styles/factories/createStyledText.tsx +29 -49
  288. package/src/styles/factories/createStyledView.test.tsx +22 -16
  289. package/src/styles/factories/createStyledView.tsx +19 -53
  290. package/src/styles/factories/index.ts +3 -0
  291. package/src/styles/index.ts +2 -3
  292. package/src/styles/resolveStyle/resolveConfig.ts +16 -15
  293. package/src/styles/resolveStyle/resolveStyle.test.ts +13 -141
  294. package/src/styles/resolveStyle/resolveStyle.ts +10 -60
  295. package/src/styles/types/create.types.ts +1 -1
  296. package/src/styles/types/styled.types.ts +73 -105
  297. package/src/styles/types/utility.types.ts +1 -0
  298. package/src/styles/utils/index.ts +1 -0
  299. package/src/styles/utils/mergeStyles.test.ts +45 -0
  300. package/src/styles/utils/mergeStyles.ts +25 -0
  301. package/.storybook/docs/getting-started/StyleSystem.mdx +0 -133
  302. package/dist/src/lib/Components/Box/Box.d.ts +0 -592
  303. package/dist/src/lib/Components/Box/Box.d.ts.map +0 -1
  304. package/dist/src/lib/Components/Box/Box.stories.d.ts.map +0 -1
  305. package/dist/src/lib/Components/Box/Box.types.d.ts +0 -3
  306. package/dist/src/lib/Components/Box/Box.types.d.ts.map +0 -1
  307. package/dist/src/lib/Components/Box/index.d.ts +0 -3
  308. package/dist/src/lib/Components/Box/index.d.ts.map +0 -1
  309. package/dist/src/lib/Components/Button/BaseButton.types.d.ts.map +0 -1
  310. package/dist/src/lib/Components/CardButton/CardButton.types.d.ts.map +0 -1
  311. package/dist/src/lib/Components/Icon/Icon.types.d.ts.map +0 -1
  312. package/dist/src/lib/Components/Text/Text.d.ts +0 -602
  313. package/dist/src/lib/Components/Text/Text.d.ts.map +0 -1
  314. package/dist/src/lib/Components/Text/Text.stories.d.ts.map +0 -1
  315. package/dist/src/lib/Components/Text/index.d.ts.map +0 -1
  316. package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts +0 -9
  317. package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts.map +0 -1
  318. package/dist/src/lib/Components/_ToRemove/ToRemove.js +0 -43
  319. package/dist/src/styles/utils/styleVarianceAuthority.d.ts +0 -30
  320. package/dist/src/styles/utils/styleVarianceAuthority.d.ts.map +0 -1
  321. package/dist/src/styles/utils/styleVarianceAuthority.js +0 -97
  322. package/src/lib/Components/Box/Box.types.ts +0 -3
  323. package/src/lib/Components/Box/index.ts +0 -2
  324. package/src/lib/Components/Text/Text.tsx +0 -35
  325. package/src/lib/Components/_ToRemove/ToRemove.tsx +0 -65
  326. package/src/styles/utils/styleVarianceAuthority.test.ts +0 -302
  327. package/src/styles/utils/styleVarianceAuthority.ts +0 -154
  328. /package/dist/src/lib/Components/{Box/Box.types.js → Button/types.js} +0 -0
  329. /package/dist/src/lib/Components/{Button/BaseButton.types.js → CardButton/types.js} +0 -0
  330. /package/dist/src/lib/Components/{CardButton/CardButton.types.js → Icon/types.js} +0 -0
  331. /package/dist/src/lib/Components/{Icon/Icon.types.js → IconButton/types.js} +0 -0
  332. /package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.d.ts +0 -0
  333. /package/dist/src/lib/Components/{Box → Utility/Box}/index.js +0 -0
  334. /package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.d.ts +0 -0
  335. /package/dist/src/lib/Components/{Text → Utility/Text}/index.d.ts +0 -0
  336. /package/dist/src/lib/Components/{Text → Utility/Text}/index.js +0 -0
  337. /package/src/lib/Components/{Text → Utility/Text}/index.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import { Banner } from '../Banner';
3
- import { TextInput } from './TextInput';
2
+ import { useState } from 'react';
3
+ import { View } from 'react-native';
4
+ import { TextInput, type TextInputProps } from './TextInput';
4
5
 
5
6
  const meta: Meta<typeof TextInput> = {
6
7
  component: TextInput,
@@ -14,25 +15,140 @@ const meta: Meta<typeof TextInput> = {
14
15
  },
15
16
  },
16
17
  },
18
+ argTypes: {
19
+ label: {
20
+ control: 'text',
21
+ description: 'Floating label text',
22
+ },
23
+ placeholder: {
24
+ control: 'text',
25
+ description: 'Placeholder text when input is empty',
26
+ },
27
+ errorMessage: {
28
+ control: 'text',
29
+ description: 'Error message to display below input',
30
+ },
31
+ editable: {
32
+ control: 'boolean',
33
+ description: 'Whether the input is editable',
34
+ },
35
+ hideClearButton: {
36
+ control: 'boolean',
37
+ description: 'Hide the clear button',
38
+ },
39
+ keyboardType: {
40
+ control: 'select',
41
+ options: ['default', 'email-address', 'numeric', 'phone-pad', 'url'],
42
+ description: 'Keyboard type for input',
43
+ },
44
+ },
17
45
  };
18
46
 
19
47
  export default meta;
20
48
  type Story = StoryObj<typeof TextInput>;
21
49
 
22
- export const WebPreviewWarning: Story = {
23
- render: () => (
24
- <Banner
25
- appearance='warning'
26
- title='Unsupported previews on web'
27
- description='For this component, previewing stories is currently only supported on mobile. Reanimated causes compatibility issues with the web preview, so for now, please test on-device. We plan to add screenshots or embed Expo Snack in the future.'
50
+ const TextInputStory = (args: TextInputProps & { initialValue?: string }) => {
51
+ const [value, setValue] = useState(args.initialValue ?? '');
52
+
53
+ return (
54
+ <View className='flex min-h-400 items-center justify-center p-24'>
55
+ <View className='w-full max-w-320'>
56
+ <TextInput
57
+ {...args}
58
+ value={value}
59
+ onChangeText={setValue}
60
+ onClear={args.onClear}
61
+ />
62
+ </View>
63
+ </View>
64
+ );
65
+ };
66
+
67
+ export const Base: Story = {
68
+ render: (args) => <TextInputStory {...args} />,
69
+ args: {
70
+ label: 'Username',
71
+ editable: true,
72
+ hideClearButton: false,
73
+ keyboardType: 'default',
74
+ },
75
+ };
76
+
77
+ export const WithContent: Story = {
78
+ render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
79
+ args: {
80
+ label: 'Username',
81
+ editable: true,
82
+ hideClearButton: false,
83
+ keyboardType: 'default',
84
+ },
85
+ };
86
+
87
+ export const WithError: Story = {
88
+ render: (args) => <TextInputStory {...args} initialValue='ab' />,
89
+ args: {
90
+ label: 'Username',
91
+ errorMessage: 'Username must be at least 3 characters',
92
+ editable: true,
93
+ hideClearButton: false,
94
+ keyboardType: 'default',
95
+ },
96
+ };
97
+
98
+ export const DisabledTextInput: Story = {
99
+ render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
100
+ args: {
101
+ label: 'Username',
102
+ editable: false,
103
+ hideClearButton: false,
104
+ keyboardType: 'default',
105
+ },
106
+ };
107
+
108
+ export const WithHiddenClearButton: Story = {
109
+ render: (args) => (
110
+ <TextInputStory {...args} initialValue='Content with hidden clear' />
111
+ ),
112
+ args: {
113
+ label: 'Label',
114
+ editable: true,
115
+ hideClearButton: true,
116
+ keyboardType: 'default',
117
+ },
118
+ };
119
+
120
+ export const WithClearCallback: Story = {
121
+ render: (args) => (
122
+ <TextInputStory
123
+ {...args}
124
+ initialValue='Click clear to see callback'
125
+ onClear={() => alert('Input cleared!')}
28
126
  />
29
127
  ),
30
- parameters: {
31
- docs: {
32
- description: {
33
- story:
34
- '⚠️ This component requires testing on a physical device or emulator due to Reanimated compatibility issues with web previews.',
35
- },
36
- },
128
+ args: {
129
+ label: 'Label',
130
+ editable: true,
131
+ hideClearButton: false,
132
+ keyboardType: 'default',
133
+ },
134
+ };
135
+
136
+ export const EmailKeyboard: Story = {
137
+ render: (args) => <TextInputStory {...args} />,
138
+ args: {
139
+ label: 'Email',
140
+ editable: true,
141
+ hideClearButton: false,
142
+ keyboardType: 'email-address',
143
+ },
144
+ };
145
+
146
+ export const PhoneKeyboard: Story = {
147
+ render: (args) => <TextInputStory {...args} />,
148
+ args: {
149
+ label: 'Phone Number',
150
+ editable: true,
151
+ hideClearButton: false,
152
+ keyboardType: 'phone-pad',
37
153
  },
38
154
  };
@@ -1,19 +1,30 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
2
3
  import { render, fireEvent } from '@testing-library/react-native';
4
+ import React from 'react';
3
5
  import { Text } from 'react-native';
4
6
 
5
7
  import { Settings } from '../../Symbols';
6
8
  import { Spot } from '../Spot';
7
9
  import { Tag } from '../Tag';
10
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
8
11
  import { Tile } from './Tile';
9
12
 
13
+ const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
14
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
15
+ {children}
16
+ </ThemeProvider>
17
+ );
18
+
10
19
  describe('Tile Component', () => {
11
20
  const mockSpot = <Spot appearance='icon' icon={Settings} />;
12
21
  const mockTitle = 'Test Item';
13
22
 
14
23
  it('should render correctly with required props', () => {
15
24
  const { getByText, getByTestId } = render(
16
- <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />,
25
+ <TestWrapper>
26
+ <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
27
+ </TestWrapper>,
17
28
  );
18
29
 
19
30
  expect(getByTestId('tile')).toBeTruthy();
@@ -23,12 +34,14 @@ describe('Tile Component', () => {
23
34
  it('should render description when provided', () => {
24
35
  const description = 'Test description';
25
36
  const { getByText } = render(
26
- <Tile
27
- leadingContent={mockSpot}
28
- title={mockTitle}
29
- description={description}
30
- testID='tile'
31
- />,
37
+ <TestWrapper>
38
+ <Tile
39
+ leadingContent={mockSpot}
40
+ title={mockTitle}
41
+ description={description}
42
+ testID='tile'
43
+ />
44
+ </TestWrapper>,
32
45
  );
33
46
 
34
47
  expect(getByText(mockTitle)).toBeTruthy();
@@ -37,7 +50,9 @@ describe('Tile Component', () => {
37
50
 
38
51
  it('should render without description when not provided', () => {
39
52
  const { getByText, queryByText } = render(
40
- <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />,
53
+ <TestWrapper>
54
+ <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
55
+ </TestWrapper>,
41
56
  );
42
57
 
43
58
  expect(getByText(mockTitle)).toBeTruthy();
@@ -49,12 +64,14 @@ describe('Tile Component', () => {
49
64
  const tagText = 'Test Tag';
50
65
  const mockTag = <Tag label={tagText} />;
51
66
  const { getByText } = render(
52
- <Tile
53
- leadingContent={mockSpot}
54
- title={mockTitle}
55
- trailingContent={mockTag}
56
- testID='tile'
57
- />,
67
+ <TestWrapper>
68
+ <Tile
69
+ leadingContent={mockSpot}
70
+ title={mockTitle}
71
+ trailingContent={mockTag}
72
+ testID='tile'
73
+ />
74
+ </TestWrapper>,
58
75
  );
59
76
 
60
77
  expect(getByText(mockTitle)).toBeTruthy();
@@ -65,12 +82,14 @@ describe('Tile Component', () => {
65
82
  const trailingText = 'Custom Trailing';
66
83
  const mockTrailing = <Text testID='custom-trailing'>{trailingText}</Text>;
67
84
  const { getByTestId } = render(
68
- <Tile
69
- leadingContent={mockSpot}
70
- title={mockTitle}
71
- trailingContent={mockTrailing}
72
- testID='tile'
73
- />,
85
+ <TestWrapper>
86
+ <Tile
87
+ leadingContent={mockSpot}
88
+ title={mockTitle}
89
+ trailingContent={mockTrailing}
90
+ testID='tile'
91
+ />
92
+ </TestWrapper>,
74
93
  );
75
94
 
76
95
  expect(getByTestId('custom-trailing')).toBeTruthy();
@@ -79,12 +98,14 @@ describe('Tile Component', () => {
79
98
  it('should call onPress handler when pressed', () => {
80
99
  const handlePress = jest.fn();
81
100
  const { getByTestId } = render(
82
- <Tile
83
- leadingContent={mockSpot}
84
- title={mockTitle}
85
- onPress={handlePress}
86
- testID='tile'
87
- />,
101
+ <TestWrapper>
102
+ <Tile
103
+ leadingContent={mockSpot}
104
+ title={mockTitle}
105
+ onPress={handlePress}
106
+ testID='tile'
107
+ />
108
+ </TestWrapper>,
88
109
  );
89
110
 
90
111
  fireEvent.press(getByTestId('tile'));
@@ -94,7 +115,9 @@ describe('Tile Component', () => {
94
115
 
95
116
  it('should not call onPress when not provided', () => {
96
117
  const { getByTestId } = render(
97
- <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />,
118
+ <TestWrapper>
119
+ <Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
120
+ </TestWrapper>,
98
121
  );
99
122
 
100
123
  // Should not throw error when pressing without onPress handler
@@ -106,12 +129,14 @@ describe('Tile Component', () => {
106
129
  it('should call onLongPress handler when long pressed', () => {
107
130
  const handleLongPress = jest.fn();
108
131
  const { getByTestId } = render(
109
- <Tile
110
- leadingContent={mockSpot}
111
- title={mockTitle}
112
- onLongPress={handleLongPress}
113
- testID='tile'
114
- />,
132
+ <TestWrapper>
133
+ <Tile
134
+ leadingContent={mockSpot}
135
+ title={mockTitle}
136
+ onLongPress={handleLongPress}
137
+ testID='tile'
138
+ />
139
+ </TestWrapper>,
115
140
  );
116
141
 
117
142
  fireEvent(getByTestId('tile'), 'onLongPress');
@@ -123,13 +148,15 @@ describe('Tile Component', () => {
123
148
  const handlePress = jest.fn();
124
149
  const handleLongPress = jest.fn();
125
150
  const { getByTestId } = render(
126
- <Tile
127
- leadingContent={mockSpot}
128
- title={mockTitle}
129
- onPress={handlePress}
130
- onLongPress={handleLongPress}
131
- testID='tile'
132
- />,
151
+ <TestWrapper>
152
+ <Tile
153
+ leadingContent={mockSpot}
154
+ title={mockTitle}
155
+ onPress={handlePress}
156
+ onLongPress={handleLongPress}
157
+ testID='tile'
158
+ />
159
+ </TestWrapper>,
133
160
  );
134
161
 
135
162
  fireEvent.press(getByTestId('tile'));
@@ -144,7 +171,9 @@ describe('Tile Component', () => {
144
171
  it('should forward testID prop to Pressable', () => {
145
172
  const testId = 'custom-tile-id';
146
173
  const { getByTestId } = render(
147
- <Tile leadingContent={mockSpot} title={mockTitle} testID={testId} />,
174
+ <TestWrapper>
175
+ <Tile leadingContent={mockSpot} title={mockTitle} testID={testId} />
176
+ </TestWrapper>,
148
177
  );
149
178
 
150
179
  expect(getByTestId(testId)).toBeTruthy();
@@ -152,12 +181,14 @@ describe('Tile Component', () => {
152
181
 
153
182
  it('should forward additional Pressable props', () => {
154
183
  const { getByTestId } = render(
155
- <Tile
156
- leadingContent={mockSpot}
157
- title={mockTitle}
158
- testID='tile'
159
- disabled={true}
160
- />,
184
+ <TestWrapper>
185
+ <Tile
186
+ leadingContent={mockSpot}
187
+ title={mockTitle}
188
+ testID='tile'
189
+ disabled={true}
190
+ />
191
+ </TestWrapper>,
161
192
  );
162
193
 
163
194
  const pressable = getByTestId('tile');
@@ -167,12 +198,14 @@ describe('Tile Component', () => {
167
198
  it('should support custom accessibility label', () => {
168
199
  const customLabel = 'Custom accessibility label';
169
200
  const { getByTestId } = render(
170
- <Tile
171
- leadingContent={mockSpot}
172
- title={mockTitle}
173
- testID='tile'
174
- accessibilityLabel={customLabel}
175
- />,
201
+ <TestWrapper>
202
+ <Tile
203
+ leadingContent={mockSpot}
204
+ title={mockTitle}
205
+ testID='tile'
206
+ accessibilityLabel={customLabel}
207
+ />
208
+ </TestWrapper>,
176
209
  );
177
210
 
178
211
  const pressable = getByTestId('tile');
@@ -184,7 +217,9 @@ describe('Tile Component', () => {
184
217
  <Text testID='custom-leading'>Custom Leading Content</Text>
185
218
  );
186
219
  const { getByTestId } = render(
187
- <Tile leadingContent={customLeading} title={mockTitle} testID='tile' />,
220
+ <TestWrapper>
221
+ <Tile leadingContent={customLeading} title={mockTitle} testID='tile' />
222
+ </TestWrapper>,
188
223
  );
189
224
 
190
225
  expect(getByTestId('custom-leading')).toBeTruthy();
@@ -196,15 +231,17 @@ describe('Tile Component', () => {
196
231
  const mockTag = <Tag label={tagText} />;
197
232
 
198
233
  const { getByText, getByTestId } = render(
199
- <Tile
200
- leadingContent={mockSpot}
201
- title={mockTitle}
202
- description={description}
203
- trailingContent={mockTag}
204
- onPress={jest.fn()}
205
- onLongPress={jest.fn()}
206
- testID='tile'
207
- />,
234
+ <TestWrapper>
235
+ <Tile
236
+ leadingContent={mockSpot}
237
+ title={mockTitle}
238
+ description={description}
239
+ trailingContent={mockTag}
240
+ onPress={jest.fn()}
241
+ onLongPress={jest.fn()}
242
+ testID='tile'
243
+ />
244
+ </TestWrapper>,
208
245
  );
209
246
 
210
247
  expect(getByTestId('tile')).toBeTruthy();
@@ -6,19 +6,65 @@ import { TileProps } from './types';
6
6
 
7
7
  const tileVariants = {
8
8
  root: cva(
9
- [
10
- 'relative flex w-full items-center gap-8 p-8',
11
- 'rounded-sm bg-base-transparent text-base transition-colors',
12
- ],
9
+ ['relative flex w-full items-center gap-8 p-8', 'rounded-sm text-base'],
13
10
  {
14
11
  variants: {
12
+ appearance: {
13
+ 'no-background': 'bg-base-transparent',
14
+ card: 'bg-surface',
15
+ },
15
16
  pressed: {
16
- true: 'bg-base-transparent-pressed',
17
- false: 'bg-base-transparent',
17
+ true: '',
18
+ false: '',
19
+ },
20
+ disabled: {
21
+ true: '',
22
+ false: '',
23
+ },
24
+ },
25
+ compoundVariants: [
26
+ {
27
+ appearance: 'no-background',
28
+ pressed: true,
29
+ disabled: false,
30
+ className: 'bg-base-transparent-pressed',
31
+ },
32
+ {
33
+ appearance: 'card',
34
+ pressed: true,
35
+ disabled: false,
36
+ className: 'bg-surface-pressed',
18
37
  },
38
+ ],
39
+ defaultVariants: {
40
+ appearance: 'no-background',
41
+ pressed: false,
42
+ disabled: false,
19
43
  },
20
44
  },
21
45
  ),
46
+ title: cva('w-full truncate text-center body-3-semi-bold', {
47
+ variants: {
48
+ disabled: {
49
+ true: 'text-disabled',
50
+ false: 'text-base',
51
+ },
52
+ },
53
+ defaultVariants: {
54
+ disabled: false,
55
+ },
56
+ }),
57
+ description: cva('w-full overflow-hidden truncate text-center body-3', {
58
+ variants: {
59
+ disabled: {
60
+ true: 'text-disabled',
61
+ false: 'text-muted',
62
+ },
63
+ },
64
+ defaultVariants: {
65
+ disabled: false,
66
+ },
67
+ }),
22
68
  };
23
69
 
24
70
  /**
@@ -49,6 +95,8 @@ export const Tile: FC<TileProps> = forwardRef<PressableRef, TileProps>(
49
95
  description,
50
96
  leadingContent,
51
97
  trailingContent,
98
+ appearance = 'no-background',
99
+ disabled = false,
52
100
  onPress,
53
101
  onLongPress,
54
102
  ...props
@@ -60,26 +108,29 @@ export const Tile: FC<TileProps> = forwardRef<PressableRef, TileProps>(
60
108
  ref={ref}
61
109
  onPress={onPress}
62
110
  onLongPress={onLongPress}
111
+ disabled={disabled}
63
112
  {...props}
64
113
  >
65
114
  {({ pressed }) => (
66
- <View className={tileVariants.root({ pressed })}>
67
- <View className='flex w-full items-center gap-8'>
68
- <View className='flex items-center justify-center'>
115
+ <View
116
+ className={tileVariants.root({ appearance, pressed, disabled })}
117
+ >
118
+ <View className='w-full items-center gap-8'>
119
+ <View className='items-center justify-center'>
69
120
  {leadingContent}
70
121
  </View>
71
- <View className='flex w-full items-center gap-4'>
72
- <View className='flex w-full items-center'>
122
+ <View className='w-full items-center gap-4'>
123
+ <View className='w-full items-center'>
73
124
  <Text
74
125
  numberOfLines={1}
75
- className='w-full truncate text-center text-base body-3-semi-bold'
126
+ className={tileVariants.title({ disabled })}
76
127
  >
77
128
  {title}
78
129
  </Text>
79
130
  {description && (
80
131
  <Text
81
132
  numberOfLines={1}
82
- className='w-full overflow-hidden truncate text-center text-muted body-3'
133
+ className={tileVariants.description({ disabled })}
83
134
  >
84
135
  {description}
85
136
  </Text>
@@ -20,6 +20,19 @@ export type TileProps = {
20
20
  * Accepts ReactNode such as <Tag label="New" appearance="base" />
21
21
  */
22
22
  trailingContent?: ReactNode;
23
+ /**
24
+ * The visual style of the tile.
25
+ * - `no-background`: Transparent background with pressed state
26
+ * - `card`: Surface background with pressed state
27
+ * @default 'no-background'
28
+ */
29
+ appearance?: 'no-background' | 'card';
30
+ /**
31
+ * Whether the tile is disabled.
32
+ * When disabled, the tile will not respond to press events and will appear dimmed.
33
+ * @default false
34
+ */
35
+ disabled?: boolean;
23
36
  /**
24
37
  * Callback function when the tile is pressed.
25
38
  */
@@ -29,4 +42,4 @@ export type TileProps = {
29
42
  * Can be used to perform secondary actions.
30
43
  */
31
44
  onLongPress?: PressableProps['onLongPress'];
32
- } & Omit<PressableProps, 'onPress' | 'onLongPress'>;
45
+ } & Omit<PressableProps, 'onPress' | 'onLongPress' | 'disabled'>;
@@ -53,7 +53,7 @@ export const WithCustomContent: Story = {
53
53
  Ut enim ad minim veniam, quis nostrud exercitation ullamco
54
54
  laboris nisi ut aliquip ex ea commodo consequat.
55
55
  </Text>
56
- <Button size='xs' appearance='accent'>
56
+ <Button size='sm' appearance='accent'>
57
57
  Custom tooltip action
58
58
  </Button>
59
59
  </View>
@@ -92,7 +92,7 @@ export const WithMultipleTooltips: Story = {
92
92
 
93
93
  <Tooltip>
94
94
  <TooltipTrigger asChild>
95
- <InteractiveIcon iconType='filled' aria-label='Info'>
95
+ <InteractiveIcon iconType='filled' accessibilityLabel='Info'>
96
96
  <Information />
97
97
  </InteractiveIcon>
98
98
  </TooltipTrigger>
@@ -1,16 +1,20 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
2
3
  import { render, fireEvent } from '@testing-library/react-native';
3
4
  import React from 'react';
4
5
  import { Text, View } from 'react-native';
6
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
5
7
  import { GlobalTooltipBottomSheet } from './GlobalTooltipBottomSheet';
6
8
  import { GlobalTooltipProvider } from './GlobalTooltipContext';
7
9
  import { Tooltip, TooltipTrigger, TooltipContent } from './Tooltip';
8
10
 
9
11
  const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
10
- <GlobalTooltipProvider>
11
- {children}
12
- <GlobalTooltipBottomSheet />
13
- </GlobalTooltipProvider>
12
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
13
+ <GlobalTooltipProvider>
14
+ {children}
15
+ <GlobalTooltipBottomSheet />
16
+ </GlobalTooltipProvider>
17
+ </ThemeProvider>
14
18
  );
15
19
 
16
20
  describe('Tooltip', () => {
@@ -1,11 +1,16 @@
1
1
  import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
2
  import * as BoxStories from './Box.stories';
3
+ import { CustomTabs, Tab } from '../../../../../.storybook/components';
3
4
 
4
5
  <Meta title='Utility/Box' of={BoxStories} />
5
6
 
6
7
  # Box
7
8
 
8
- Box is a utility primitive that wraps React Native's `View` component with token-constrained style props from the design system theme.
9
+ <CustomTabs>
10
+ <Tab label="Overview ">
11
+ Box is a utility primitive that wraps React Native's `View` component with token-constrained style props from the design system theme.
12
+
13
+ Box exposes the `lx` property to consume tokens from the `ledgerLiveTheme`, see [lx documentation](/?path=/docs/style-system-lx--docs).
9
14
 
10
15
  ## Interactive Example
11
16
 
@@ -20,10 +25,12 @@ import { Box, Text } from '@ledgerhq/lumen-ui-rnative';
20
25
  function Card() {
21
26
  return (
22
27
  <Box
23
- padding='s16'
24
- backgroundColor='accent'
25
- borderRadius='md'
26
- gap='s8'
28
+ lx={{
29
+ padding: 's16',
30
+ backgroundColor: 'accent',
31
+ borderRadius: 'md',
32
+ gap: 's8',
33
+ }}
27
34
  >
28
35
  <Text>Card content</Text>
29
36
  </Box>
@@ -31,18 +38,13 @@ function Card() {
31
38
  }
32
39
  ```
33
40
 
34
- ## Theme Tokens
35
-
36
- Box consumes tokens from the `ledgerLiveTheme` for spacing, sizes, colors, and border radius.
37
-
38
41
  ## Escape Hatch
39
42
 
40
43
  For values not covered by tokens, use raw numbers or the `style` prop:
41
44
 
42
45
  ```tsx
43
- // Raw number for one-off values
44
- <Box width={127} marginTop='s4' />
45
-
46
46
  // Style prop for complete override
47
- <Box marginTop='s4' style={{ width: 127 }} />
47
+ <Box lx={{ marginTop: 's4' }} style={{ width: 127 }} />
48
48
  ```
49
+ </Tab>
50
+ </CustomTabs>