@ledgerhq/lumen-ui-rnative 0.0.44 → 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 (333) 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.js +2 -2
  115. package/dist/src/lib/Components/Tooltip/Tooltip.stories.js +2 -2
  116. package/dist/src/lib/Components/Utility/Box/Box.d.ts +39 -0
  117. package/dist/src/lib/Components/Utility/Box/Box.d.ts.map +1 -0
  118. package/dist/src/lib/Components/{Box → Utility/Box}/Box.js +10 -11
  119. package/dist/src/lib/Components/Utility/Box/Box.stories.d.ts.map +1 -0
  120. package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.js +13 -12
  121. package/dist/src/lib/Components/Utility/Box/index.d.ts +2 -0
  122. package/dist/src/lib/Components/Utility/Box/index.d.ts.map +1 -0
  123. package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts +34 -0
  124. package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts.map +1 -0
  125. package/dist/src/lib/Components/Utility/Pressable/Pressable.js +33 -0
  126. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts +7 -0
  127. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts.map +1 -0
  128. package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.js +47 -0
  129. package/dist/src/lib/Components/Utility/Pressable/index.d.ts +3 -0
  130. package/dist/src/lib/Components/Utility/Pressable/index.d.ts.map +1 -0
  131. package/dist/src/lib/Components/Utility/Pressable/index.js +1 -0
  132. package/dist/src/lib/Components/Utility/Pressable/types.d.ts +3 -0
  133. package/dist/src/lib/Components/Utility/Pressable/types.d.ts.map +1 -0
  134. package/dist/src/lib/Components/Utility/Pressable/types.js +1 -0
  135. package/dist/src/lib/Components/Utility/Text/Text.d.ts +40 -0
  136. package/dist/src/lib/Components/Utility/Text/Text.d.ts.map +1 -0
  137. package/dist/src/lib/Components/{Text → Utility/Text}/Text.js +13 -9
  138. package/dist/src/lib/Components/Utility/Text/Text.stories.d.ts.map +1 -0
  139. package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.js +3 -3
  140. package/dist/src/lib/Components/Utility/Text/index.d.ts.map +1 -0
  141. package/dist/src/lib/Components/Utility/index.d.ts +4 -0
  142. package/dist/src/lib/Components/Utility/index.d.ts.map +1 -0
  143. package/dist/src/lib/Components/Utility/index.js +3 -0
  144. package/dist/src/lib/Components/index.d.ts +1 -3
  145. package/dist/src/lib/Components/index.d.ts.map +1 -1
  146. package/dist/src/lib/Components/index.js +1 -3
  147. package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts +6 -5
  148. package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts.map +1 -1
  149. package/dist/src/lib/utils/components/InjectStylesIntoChildren.js +6 -6
  150. package/dist/src/styles/LumenStyleSheet.d.ts +1 -1
  151. package/dist/src/styles/LumenStyleSheet.d.ts.map +1 -1
  152. package/dist/src/styles/Provider/createStylesheetTheme.d.ts +0 -1
  153. package/dist/src/styles/Provider/createStylesheetTheme.d.ts.map +1 -1
  154. package/dist/src/styles/Provider/createStylesheetTheme.js +0 -1
  155. package/dist/src/styles/create/useCreate.d.ts +2 -1
  156. package/dist/src/styles/create/useCreate.d.ts.map +1 -1
  157. package/dist/src/styles/create/useCreate.js +5 -5
  158. package/dist/src/styles/factories/areLxPropsEqual.d.ts +3 -0
  159. package/dist/src/styles/factories/areLxPropsEqual.d.ts.map +1 -0
  160. package/dist/src/styles/factories/areLxPropsEqual.js +15 -0
  161. package/dist/src/styles/factories/createStyledPressable.d.ts +26 -0
  162. package/dist/src/styles/factories/createStyledPressable.d.ts.map +1 -0
  163. package/dist/src/styles/factories/createStyledPressable.js +61 -0
  164. package/dist/src/styles/factories/createStyledText.d.ts +15 -26
  165. package/dist/src/styles/factories/createStyledText.d.ts.map +1 -1
  166. package/dist/src/styles/factories/createStyledText.js +13 -29
  167. package/dist/src/styles/factories/createStyledView.d.ts +7 -27
  168. package/dist/src/styles/factories/createStyledView.d.ts.map +1 -1
  169. package/dist/src/styles/factories/createStyledView.js +10 -30
  170. package/dist/src/styles/factories/index.d.ts +4 -0
  171. package/dist/src/styles/factories/index.d.ts.map +1 -0
  172. package/dist/src/styles/factories/index.js +3 -0
  173. package/dist/src/styles/index.d.ts +2 -3
  174. package/dist/src/styles/index.d.ts.map +1 -1
  175. package/dist/src/styles/index.js +2 -3
  176. package/dist/src/styles/resolveStyle/resolveConfig.d.ts +7 -7
  177. package/dist/src/styles/resolveStyle/resolveConfig.d.ts.map +1 -1
  178. package/dist/src/styles/resolveStyle/resolveConfig.js +9 -9
  179. package/dist/src/styles/resolveStyle/resolveStyle.d.ts +6 -20
  180. package/dist/src/styles/resolveStyle/resolveStyle.d.ts.map +1 -1
  181. package/dist/src/styles/resolveStyle/resolveStyle.js +4 -29
  182. package/dist/src/styles/types/create.types.d.ts +1 -1
  183. package/dist/src/styles/types/create.types.d.ts.map +1 -1
  184. package/dist/src/styles/types/styled.types.d.ts +72 -50
  185. package/dist/src/styles/types/styled.types.d.ts.map +1 -1
  186. package/dist/src/styles/types/utility.types.d.ts.map +1 -1
  187. package/dist/src/styles/utils/index.d.ts +2 -0
  188. package/dist/src/styles/utils/index.d.ts.map +1 -0
  189. package/dist/src/styles/utils/index.js +1 -0
  190. package/dist/src/styles/utils/mergeStyles.d.ts +16 -0
  191. package/dist/src/styles/utils/mergeStyles.d.ts.map +1 -0
  192. package/dist/src/styles/utils/mergeStyles.js +20 -0
  193. package/package.json +3 -4
  194. package/src/lib/Components/AddressInput/AddressInput.mdx +15 -4
  195. package/src/lib/Components/AddressInput/AddressInput.stories.tsx +133 -17
  196. package/src/lib/Components/AddressInput/AddressInput.tsx +1 -1
  197. package/src/lib/Components/AmountInput/AmountInput.mdx +20 -1
  198. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +180 -17
  199. package/src/lib/Components/AmountInput/AmountInput.tsx +24 -15
  200. package/src/lib/Components/Banner/Banner.test.tsx +48 -15
  201. package/src/lib/Components/BaseInput/BaseInput.tsx +6 -35
  202. package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +8 -8
  203. package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
  204. package/src/lib/Components/Button/BaseButton.test.tsx +149 -0
  205. package/src/lib/Components/Button/BaseButton.tsx +193 -148
  206. package/src/lib/Components/Button/Button.mdx +34 -31
  207. package/src/lib/Components/Button/Button.stories.tsx +37 -58
  208. package/src/lib/Components/Button/Button.tsx +4 -11
  209. package/src/lib/Components/Button/index.ts +1 -1
  210. package/src/lib/Components/Button/{BaseButton.types.ts → types.ts} +14 -8
  211. package/src/lib/Components/CardButton/CardButton.mdx +15 -25
  212. package/src/lib/Components/CardButton/CardButton.stories.tsx +48 -22
  213. package/src/lib/Components/CardButton/CardButton.test.tsx +141 -0
  214. package/src/lib/Components/CardButton/CardButton.tsx +142 -108
  215. package/src/lib/Components/CardButton/index.ts +1 -1
  216. package/src/lib/Components/CardButton/{CardButton.types.ts → types.ts} +4 -3
  217. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
  218. package/src/lib/Components/Checkbox/Checkbox.test.tsx +42 -17
  219. package/src/lib/Components/Icon/Icon.stories.tsx +143 -73
  220. package/src/lib/Components/Icon/Icon.test.tsx +84 -0
  221. package/src/lib/Components/Icon/Icon.tsx +32 -28
  222. package/src/lib/Components/Icon/createIcon.ts +2 -3
  223. package/src/lib/Components/Icon/index.ts +1 -1
  224. package/src/lib/Components/Icon/{Icon.types.ts → types.ts} +4 -3
  225. package/src/lib/Components/IconButton/IconButton.mdx +13 -10
  226. package/src/lib/Components/IconButton/IconButton.stories.tsx +12 -14
  227. package/src/lib/Components/IconButton/IconButton.test.tsx +141 -0
  228. package/src/lib/Components/IconButton/IconButton.tsx +3 -13
  229. package/src/lib/Components/IconButton/index.ts +1 -0
  230. package/src/lib/Components/IconButton/types.ts +12 -0
  231. package/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.tsx +1 -1
  232. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +25 -27
  233. package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +82 -43
  234. package/src/lib/Components/InteractiveIcon/InteractiveIcon.test.tsx +30 -19
  235. package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +78 -45
  236. package/src/lib/Components/InteractiveIcon/types.ts +4 -7
  237. package/src/lib/Components/Link/Link.mdx +8 -18
  238. package/src/lib/Components/Link/Link.stories.tsx +56 -25
  239. package/src/lib/Components/Link/Link.test.tsx +141 -51
  240. package/src/lib/Components/Link/Link.tsx +128 -150
  241. package/src/lib/Components/Link/index.ts +1 -0
  242. package/src/lib/Components/Link/types.ts +44 -0
  243. package/src/lib/Components/Search/Search.mdx +14 -1
  244. package/src/lib/Components/Search/Search.stories.tsx +94 -15
  245. package/src/lib/Components/Select/Select.test.tsx +8 -4
  246. package/src/lib/Components/Select/Select.tsx +4 -31
  247. package/src/lib/Components/Spinner/Spinner.stories.tsx +1 -5
  248. package/src/lib/Components/Spinner/Spinner.tsx +60 -34
  249. package/src/lib/Components/Spinner/index.ts +1 -0
  250. package/src/lib/Components/Spinner/types.ts +15 -0
  251. package/src/lib/Components/Switch/Switch.mdx +1 -1
  252. package/src/lib/Components/Tag/Tag.stories.tsx +2 -2
  253. package/src/lib/Components/Tag/Tag.tsx +22 -6
  254. package/src/lib/Components/Tag/Tag.types.ts +7 -8
  255. package/src/lib/Components/TextInput/TextInput.mdx +24 -4
  256. package/src/lib/Components/TextInput/TextInput.stories.tsx +131 -15
  257. package/src/lib/Components/Tile/Tile.test.tsx +100 -63
  258. package/src/lib/Components/Tile/Tile.tsx +2 -2
  259. package/src/lib/Components/Tooltip/Tooltip.stories.tsx +2 -2
  260. package/src/lib/Components/Tooltip/Tooltip.test.tsx +8 -4
  261. package/src/lib/Components/{Box → Utility/Box}/Box.mdx +15 -13
  262. package/src/lib/Components/{Box → Utility/Box}/Box.stories.tsx +13 -11
  263. package/src/lib/Components/{Box → Utility/Box}/Box.tsx +11 -12
  264. package/src/lib/Components/Utility/Box/index.ts +1 -0
  265. package/src/lib/Components/Utility/Pressable/Pressable.mdx +103 -0
  266. package/src/lib/Components/Utility/Pressable/Pressable.stories.tsx +51 -0
  267. package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +221 -0
  268. package/src/lib/Components/Utility/Pressable/Pressable.tsx +34 -0
  269. package/src/lib/Components/Utility/Pressable/index.ts +2 -0
  270. package/src/lib/Components/Utility/Pressable/types.ts +3 -0
  271. package/src/lib/Components/{Text → Utility/Text}/Text.mdx +15 -7
  272. package/src/lib/Components/{Text → Utility/Text}/Text.stories.tsx +3 -3
  273. package/src/lib/Components/Utility/Text/Text.tsx +39 -0
  274. package/src/lib/Components/Utility/index.ts +3 -0
  275. package/src/lib/Components/index.ts +1 -3
  276. package/src/lib/utils/components/InjectStylesIntoChildren.tsx +23 -14
  277. package/src/styles/Provider/createStylesheetTheme.ts +0 -1
  278. package/src/styles/create/useCreate.ts +8 -4
  279. package/src/styles/factories/areLxPropsEqual.ts +32 -0
  280. package/src/styles/factories/createStyledPressable.test.tsx +253 -0
  281. package/src/styles/factories/createStyledPressable.tsx +97 -0
  282. package/src/styles/factories/createStyledText.test.tsx +28 -20
  283. package/src/styles/factories/createStyledText.tsx +29 -49
  284. package/src/styles/factories/createStyledView.test.tsx +22 -16
  285. package/src/styles/factories/createStyledView.tsx +19 -53
  286. package/src/styles/factories/index.ts +3 -0
  287. package/src/styles/index.ts +2 -3
  288. package/src/styles/resolveStyle/resolveConfig.ts +16 -15
  289. package/src/styles/resolveStyle/resolveStyle.test.ts +13 -141
  290. package/src/styles/resolveStyle/resolveStyle.ts +10 -60
  291. package/src/styles/types/create.types.ts +1 -1
  292. package/src/styles/types/styled.types.ts +73 -105
  293. package/src/styles/types/utility.types.ts +1 -0
  294. package/src/styles/utils/index.ts +1 -0
  295. package/src/styles/utils/mergeStyles.test.ts +45 -0
  296. package/src/styles/utils/mergeStyles.ts +25 -0
  297. package/.storybook/docs/getting-started/StyleSystem.mdx +0 -133
  298. package/dist/src/lib/Components/Box/Box.d.ts +0 -592
  299. package/dist/src/lib/Components/Box/Box.d.ts.map +0 -1
  300. package/dist/src/lib/Components/Box/Box.stories.d.ts.map +0 -1
  301. package/dist/src/lib/Components/Box/Box.types.d.ts +0 -3
  302. package/dist/src/lib/Components/Box/Box.types.d.ts.map +0 -1
  303. package/dist/src/lib/Components/Box/index.d.ts +0 -3
  304. package/dist/src/lib/Components/Box/index.d.ts.map +0 -1
  305. package/dist/src/lib/Components/Button/BaseButton.types.d.ts.map +0 -1
  306. package/dist/src/lib/Components/CardButton/CardButton.types.d.ts.map +0 -1
  307. package/dist/src/lib/Components/Icon/Icon.types.d.ts.map +0 -1
  308. package/dist/src/lib/Components/Text/Text.d.ts +0 -602
  309. package/dist/src/lib/Components/Text/Text.d.ts.map +0 -1
  310. package/dist/src/lib/Components/Text/Text.stories.d.ts.map +0 -1
  311. package/dist/src/lib/Components/Text/index.d.ts.map +0 -1
  312. package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts +0 -9
  313. package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts.map +0 -1
  314. package/dist/src/lib/Components/_ToRemove/ToRemove.js +0 -43
  315. package/dist/src/styles/utils/styleVarianceAuthority.d.ts +0 -30
  316. package/dist/src/styles/utils/styleVarianceAuthority.d.ts.map +0 -1
  317. package/dist/src/styles/utils/styleVarianceAuthority.js +0 -97
  318. package/src/lib/Components/Box/Box.types.ts +0 -3
  319. package/src/lib/Components/Box/index.ts +0 -2
  320. package/src/lib/Components/Text/Text.tsx +0 -35
  321. package/src/lib/Components/_ToRemove/ToRemove.tsx +0 -65
  322. package/src/styles/utils/styleVarianceAuthority.test.ts +0 -302
  323. package/src/styles/utils/styleVarianceAuthority.ts +0 -154
  324. /package/dist/src/lib/Components/{Box/Box.types.js → Button/types.js} +0 -0
  325. /package/dist/src/lib/Components/{Button/BaseButton.types.js → CardButton/types.js} +0 -0
  326. /package/dist/src/lib/Components/{CardButton/CardButton.types.js → Icon/types.js} +0 -0
  327. /package/dist/src/lib/Components/{Icon/Icon.types.js → IconButton/types.js} +0 -0
  328. /package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.d.ts +0 -0
  329. /package/dist/src/lib/Components/{Box → Utility/Box}/index.js +0 -0
  330. /package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.d.ts +0 -0
  331. /package/dist/src/lib/Components/{Text → Utility/Text}/index.d.ts +0 -0
  332. /package/dist/src/lib/Components/{Text → Utility/Text}/index.js +0 -0
  333. /package/src/lib/Components/{Text → Utility/Text}/index.ts +0 -0
@@ -0,0 +1,141 @@
1
+ import { describe, expect, it, jest } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
+ import { fireEvent, render, screen } from '@testing-library/react-native';
4
+ import React from 'react';
5
+
6
+ import { Settings, Plus } from '../../Symbols';
7
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
8
+ import { CardButton } from './CardButton';
9
+
10
+ const renderWithProvider = (component: React.ReactElement) => {
11
+ return render(
12
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
13
+ {component}
14
+ </ThemeProvider>,
15
+ );
16
+ };
17
+
18
+ describe('CardButton Component', () => {
19
+ describe('Rendering', () => {
20
+ it('should render with required props', () => {
21
+ renderWithProvider(
22
+ <CardButton testID='card-button' title='Test Card Button' />,
23
+ );
24
+ expect(screen.getByTestId('card-button')).toBeTruthy();
25
+ });
26
+
27
+ it('should render the title', () => {
28
+ renderWithProvider(<CardButton title='Test Title' />);
29
+ expect(screen.getByText('Test Title')).toBeTruthy();
30
+ });
31
+
32
+ it('should render description when provided', () => {
33
+ renderWithProvider(
34
+ <CardButton title='Test Title' description='Test Description' />,
35
+ );
36
+ expect(screen.getByText('Test Description')).toBeTruthy();
37
+ });
38
+
39
+ it('should have correct accessibility role', () => {
40
+ renderWithProvider(
41
+ <CardButton testID='card-button' title='Test Card Button' />,
42
+ );
43
+ const button = screen.getByTestId('card-button');
44
+ expect(button.props.accessibilityRole).toBe('button');
45
+ });
46
+ });
47
+
48
+ describe('Appearances', () => {
49
+ it.each(['base', 'outline'] as const)(
50
+ 'should render with %s appearance',
51
+ (appearance) => {
52
+ renderWithProvider(
53
+ <CardButton
54
+ testID='card-button'
55
+ title='Test Card Button'
56
+ appearance={appearance}
57
+ />,
58
+ );
59
+ expect(screen.getByTestId('card-button')).toBeTruthy();
60
+ },
61
+ );
62
+ });
63
+
64
+ describe('Icon', () => {
65
+ it('should render with icon when provided', () => {
66
+ renderWithProvider(
67
+ <CardButton testID='card-button' title='Settings' icon={Settings} />,
68
+ );
69
+ expect(screen.getByTestId('card-button')).toBeTruthy();
70
+ });
71
+
72
+ it('should render different icons', () => {
73
+ renderWithProvider(
74
+ <CardButton testID='card-button' title='Add' icon={Plus} />,
75
+ );
76
+ expect(screen.getByTestId('card-button')).toBeTruthy();
77
+ });
78
+ });
79
+
80
+ describe('Chevron', () => {
81
+ it('should render chevron by default', () => {
82
+ renderWithProvider(
83
+ <CardButton testID='card-button' title='Test Card Button' />,
84
+ );
85
+ // The chevron is rendered inside card-button-content
86
+ expect(screen.getByTestId('card-button-content')).toBeTruthy();
87
+ });
88
+
89
+ it('should hide chevron when hideChevron is true', () => {
90
+ renderWithProvider(
91
+ <CardButton
92
+ testID='card-button'
93
+ title='Test Card Button'
94
+ hideChevron
95
+ />,
96
+ );
97
+ expect(screen.getByTestId('card-button')).toBeTruthy();
98
+ });
99
+ });
100
+
101
+ describe('States', () => {
102
+ it('should be disabled when disabled prop is true', () => {
103
+ renderWithProvider(
104
+ <CardButton testID='card-button' title='Test Card Button' disabled />,
105
+ );
106
+ const button = screen.getByTestId('card-button');
107
+ expect(button.props.accessibilityState.disabled).toBe(true);
108
+ });
109
+ });
110
+
111
+ describe('Interactions', () => {
112
+ it('should call onPress when pressed', () => {
113
+ const handlePress = jest.fn();
114
+ renderWithProvider(
115
+ <CardButton
116
+ testID='card-button'
117
+ title='Test Card Button'
118
+ onPress={handlePress}
119
+ />,
120
+ );
121
+
122
+ fireEvent.press(screen.getByTestId('card-button'));
123
+ expect(handlePress).toHaveBeenCalledTimes(1);
124
+ });
125
+
126
+ it('should not call onPress when disabled', () => {
127
+ const handlePress = jest.fn();
128
+ renderWithProvider(
129
+ <CardButton
130
+ testID='card-button'
131
+ title='Test Card Button'
132
+ onPress={handlePress}
133
+ disabled
134
+ />,
135
+ );
136
+
137
+ fireEvent.press(screen.getByTestId('card-button'));
138
+ expect(handlePress).not.toHaveBeenCalled();
139
+ });
140
+ });
141
+ });
@@ -1,78 +1,89 @@
1
- import { cva } from 'class-variance-authority';
2
1
  import React from 'react';
3
- import { Text, Pressable, View } from 'react-native';
2
+ import { Text, View } from 'react-native';
3
+ import { LumenStyleSheet, mergeStyles } from '../../../styles';
4
4
  import { ChevronRight } from '../../Symbols';
5
- import { cn } from '../../utils';
5
+ import { Pressable } from '../Utility';
6
6
 
7
- import { CardButtonProps } from './CardButton.types';
7
+ import { CardButtonProps } from './types';
8
8
 
9
- const cardButtonVariants = {
10
- root: cva(
11
- 'inline-flex h-fit w-full flex-row items-center gap-12 rounded-sm p-12 transition-colors',
12
- {
13
- variants: {
14
- appearance: {
15
- base: '',
16
- outline: 'outline-dashed outline-1',
17
- },
18
- disabled: {
19
- true: 'text-disabled',
20
- false: 'text-base',
21
- },
22
- },
23
- compoundVariants: [
24
- {
25
- appearance: 'base',
26
- disabled: true,
27
- className: 'bg-disabled',
28
- },
29
- {
30
- appearance: 'base',
31
- disabled: false,
32
- className: 'bg-muted active:bg-muted-pressed',
33
- },
34
- {
35
- appearance: 'outline',
36
- disabled: true,
37
- className: 'bg-base-transparent outline-disabled',
9
+ type Appearance = NonNullable<CardButtonProps['appearance']>;
10
+
11
+ const useStyles = ({
12
+ appearance,
13
+ disabled,
14
+ pressed,
15
+ }: {
16
+ appearance: Appearance;
17
+ disabled: boolean;
18
+ pressed: boolean;
19
+ }) => {
20
+ return LumenStyleSheet.useCreate(
21
+ (t) => {
22
+ const bgColors: Record<Appearance, string> = {
23
+ base: t.colors.bg.muted,
24
+ outline: 'transparent',
25
+ };
26
+
27
+ const pressedBgColors: Record<Appearance, string> = {
28
+ base: t.colors.bg.mutedPressed,
29
+ outline: t.colors.bg.baseTransparentPressed,
30
+ };
31
+
32
+ return {
33
+ container: mergeStyles(
34
+ {
35
+ flexDirection: 'row',
36
+ alignItems: 'center',
37
+ width: t.sizes.full,
38
+ gap: t.spacings.s12,
39
+ padding: t.spacings.s12,
40
+ borderRadius: t.borderRadius.sm,
41
+ backgroundColor: bgColors[appearance],
42
+ },
43
+ appearance === 'outline' && {
44
+ borderStyle: 'dashed',
45
+ borderWidth: t.borderWidth.s1,
46
+ borderColor: t.colors.border.mutedSubtle,
47
+ },
48
+ pressed && {
49
+ backgroundColor: pressedBgColors[appearance],
50
+ },
51
+ pressed &&
52
+ appearance === 'outline' && {
53
+ borderColor: t.colors.border.mutedSubtlePressed,
54
+ },
55
+ disabled && {
56
+ backgroundColor:
57
+ appearance === 'outline' ? 'transparent' : t.colors.bg.disabled,
58
+ },
59
+ disabled &&
60
+ appearance === 'outline' && {
61
+ borderColor: t.colors.border.disabled,
62
+ },
63
+ ),
64
+ contentWrapper: {
65
+ flex: 1,
66
+ minWidth: 0,
67
+ flexDirection: 'column',
68
+ gap: t.spacings.s4,
38
69
  },
39
- {
40
- appearance: 'outline',
41
- disabled: false,
42
- className:
43
- 'bg-base-transparent outline-muted-subtle active:bg-base-transparent-pressed active:outline-muted-subtle-pressed',
70
+ title: mergeStyles(t.typographies.body1SemiBold, {
71
+ color: disabled ? t.colors.text.disabled : t.colors.text.base,
72
+ minWidth: 0,
73
+ textAlign: 'left',
74
+ }),
75
+ description: mergeStyles(t.typographies.body2, {
76
+ color: disabled ? t.colors.text.disabled : t.colors.text.base,
77
+ minWidth: 0,
78
+ }),
79
+ icon: {
80
+ flexShrink: 0,
81
+ color: disabled ? t.colors.text.disabled : t.colors.text.base,
44
82
  },
45
- ],
46
- defaultVariants: {
47
- appearance: 'base',
48
- disabled: false,
49
- },
83
+ };
50
84
  },
51
- ),
52
- title: cva('min-w-0 body-1-semi-bold', {
53
- variants: {
54
- disabled: {
55
- true: 'text-disabled',
56
- false: 'text-base',
57
- },
58
- },
59
- }),
60
- description: cva('min-w-0 body-2', {
61
- variants: {
62
- disabled: {
63
- true: 'text-disabled',
64
- false: 'text-base',
65
- },
66
- },
67
- }),
68
- icon: cva('shrink-0', {
69
- variants: {
70
- disabled: {
71
- true: 'text-disabled',
72
- false: 'text-base',
73
- },
74
- },
75
- }),
85
+ [appearance, disabled, pressed],
86
+ );
76
87
  };
77
88
 
78
89
  /**
@@ -83,7 +94,7 @@ const cardButtonVariants = {
83
94
  * @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs Storybook}
84
95
  * @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs#dos-and-donts Guidelines}
85
96
  *
86
- * @warning The `className` prop should only be used for layout adjustments like margins or positioning.
97
+ * @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
87
98
  * Do not use it to modify the card button's core appearance (colors, padding, etc). Use the `appearance` prop instead.
88
99
  *
89
100
  * @example
@@ -92,6 +103,7 @@ const cardButtonVariants = {
92
103
  *
93
104
  * <CardButton title="Click Me" onPress={() => console.log('Clicked!')} />
94
105
  *
106
+ * @example
95
107
  * // Card button with icon and description
96
108
  * import { CardButton } from '@ledgerhq/lumen-ui-rnative';
97
109
  * import { Info } from '@ledgerhq/lumen-ui-rnative/symbols';
@@ -109,8 +121,9 @@ export const CardButton = React.forwardRef<
109
121
  >(
110
122
  (
111
123
  {
112
- className,
113
- appearance,
124
+ lx,
125
+ style,
126
+ appearance = 'base',
114
127
  icon,
115
128
  title,
116
129
  description,
@@ -120,53 +133,74 @@ export const CardButton = React.forwardRef<
120
133
  },
121
134
  ref,
122
135
  ) => {
123
- const IconComponent = icon;
124
-
125
136
  return (
126
137
  <Pressable
127
138
  ref={ref}
128
- className={cn(
129
- className,
130
- cardButtonVariants.root({
131
- appearance,
132
- disabled,
133
- }),
134
- )}
135
- disabled={disabled ?? false}
139
+ lx={lx}
140
+ style={[style, { flex: 1 }]}
141
+ disabled={disabled}
142
+ accessibilityRole='button'
143
+ accessibilityState={{ disabled }}
136
144
  {...props}
137
145
  >
138
- {IconComponent && (
139
- <IconComponent
140
- size={24}
141
- className={cardButtonVariants.icon({ disabled })}
146
+ {({ pressed }) => (
147
+ <CardButtonContent
148
+ appearance={appearance}
149
+ disabled={disabled}
150
+ pressed={pressed}
151
+ icon={icon}
152
+ title={title}
153
+ description={description}
154
+ hideChevron={hideChevron}
142
155
  />
143
156
  )}
144
- <View className='flex min-w-0 flex-1 flex-col gap-4 text-left body-1-semi-bold'>
157
+ </Pressable>
158
+ );
159
+ },
160
+ );
161
+
162
+ type CardButtonContentProps = {
163
+ appearance: Appearance;
164
+ disabled: boolean;
165
+ pressed: boolean;
166
+ icon: CardButtonProps['icon'];
167
+ title: string;
168
+ description?: string;
169
+ hideChevron?: boolean;
170
+ };
171
+
172
+ const CardButtonContent: React.FC<CardButtonContentProps> = ({
173
+ appearance,
174
+ disabled,
175
+ pressed,
176
+ icon,
177
+ title,
178
+ description,
179
+ hideChevron,
180
+ }) => {
181
+ const IconComponent = icon;
182
+ const styles = useStyles({ appearance, disabled, pressed });
183
+
184
+ return (
185
+ <View style={styles.container} testID='card-button-content'>
186
+ {IconComponent && <IconComponent size={24} style={styles.icon} />}
187
+ <View style={styles.contentWrapper}>
188
+ <Text style={styles.title} numberOfLines={1} ellipsizeMode='tail'>
189
+ {title}
190
+ </Text>
191
+ {description && (
145
192
  <Text
146
- className={cardButtonVariants.title({ disabled })}
147
- numberOfLines={1}
193
+ style={styles.description}
194
+ numberOfLines={2}
148
195
  ellipsizeMode='tail'
149
196
  >
150
- {title}
197
+ {description}
151
198
  </Text>
152
- {description && (
153
- <Text
154
- className={cardButtonVariants.description({ disabled })}
155
- numberOfLines={2}
156
- ellipsizeMode='tail'
157
- >
158
- {description}
159
- </Text>
160
- )}
161
- </View>
162
- {!hideChevron && (
163
- <ChevronRight
164
- size={24}
165
- className={cardButtonVariants.icon({ disabled })}
166
- />
167
199
  )}
168
- </Pressable>
169
- );
170
- },
171
- );
200
+ </View>
201
+ {!hideChevron && <ChevronRight size={24} style={styles.icon} />}
202
+ </View>
203
+ );
204
+ };
205
+
172
206
  CardButton.displayName = 'CardButton';
@@ -1,2 +1,2 @@
1
1
  export * from './CardButton';
2
- export * from './CardButton.types';
2
+ export * from './types';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { PressableProps } from 'react-native';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { StyledPressableProps } from '../../../styles';
3
4
  import { IconSize } from '../Icon';
4
5
 
5
6
  export type CardButtonProps = {
@@ -14,7 +15,7 @@ export type CardButtonProps = {
14
15
  /**
15
16
  * An optional icon component to render on the left side.
16
17
  */
17
- icon?: React.ComponentType<{ size?: IconSize; className?: string }>;
18
+ icon?: React.ComponentType<{ size?: IconSize; style?: StyleProp<ViewStyle> }>;
18
19
  /**
19
20
  * The main title of the card button.
20
21
  */
@@ -27,4 +28,4 @@ export type CardButtonProps = {
27
28
  * If true, hides the chevron arrow on the right side.
28
29
  */
29
30
  hideChevron?: boolean;
30
- } & Omit<PressableProps, 'disabled'>;
31
+ } & Omit<StyledPressableProps, 'disabled'>;
@@ -119,7 +119,7 @@ Use `defaultChecked` for simple cases:
119
119
  </div>
120
120
 
121
121
  // ✅ ARIA label for standalone checkbox
122
- <Checkbox aria-label="Select all items" />
122
+ <Checkbox accessibilityLabel="Select all items" />
123
123
 
124
124
  // ✅ ARIA described by for complex descriptions
125
125
  <div>
@@ -1,11 +1,22 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
2
3
  import { render, fireEvent, waitFor } from '@testing-library/react-native';
4
+ import React from 'react';
5
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
3
6
  import { Checkbox } from './Checkbox';
4
7
 
8
+ const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
9
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
10
+ {children}
11
+ </ThemeProvider>
12
+ );
13
+
5
14
  describe('Checkbox', () => {
6
15
  it('uncontrolled: toggles on press and reflects checked state', async () => {
7
16
  const { getByTestId } = render(
8
- <Checkbox defaultChecked={false} testID='checkbox' />,
17
+ <TestWrapper>
18
+ <Checkbox defaultChecked={false} testID='checkbox' />
19
+ </TestWrapper>,
9
20
  );
10
21
 
11
22
  expect(getByTestId('checkbox').props.accessibilityState?.checked).toBe(
@@ -24,7 +35,13 @@ describe('Checkbox', () => {
24
35
  it('controlled: calls onCheckedChange but state is controlled by parent', async () => {
25
36
  const onChange = jest.fn();
26
37
  const { getByTestId, rerender } = render(
27
- <Checkbox checked={false} onCheckedChange={onChange} testID='checkbox' />,
38
+ <TestWrapper>
39
+ <Checkbox
40
+ checked={false}
41
+ onCheckedChange={onChange}
42
+ testID='checkbox'
43
+ />
44
+ </TestWrapper>,
28
45
  );
29
46
 
30
47
  expect(getByTestId('checkbox').props.accessibilityState?.checked).toBe(
@@ -41,7 +58,9 @@ describe('Checkbox', () => {
41
58
  );
42
59
 
43
60
  rerender(
44
- <Checkbox checked={true} onCheckedChange={onChange} testID='checkbox' />,
61
+ <TestWrapper>
62
+ <Checkbox checked={true} onCheckedChange={onChange} testID='checkbox' />
63
+ </TestWrapper>,
45
64
  );
46
65
 
47
66
  await waitFor(() =>
@@ -54,12 +73,14 @@ describe('Checkbox', () => {
54
73
  it('label: renders and toggles when pressed', async () => {
55
74
  const onChange = jest.fn();
56
75
  const { getByText, getByTestId } = render(
57
- <Checkbox
58
- defaultChecked={false}
59
- label='Accept'
60
- onCheckedChange={onChange}
61
- testID='checkbox'
62
- />,
76
+ <TestWrapper>
77
+ <Checkbox
78
+ defaultChecked={false}
79
+ label='Accept'
80
+ onCheckedChange={onChange}
81
+ testID='checkbox'
82
+ />
83
+ </TestWrapper>,
63
84
  );
64
85
 
65
86
  fireEvent.press(getByText('Accept'));
@@ -75,13 +96,15 @@ describe('Checkbox', () => {
75
96
  it('disabled: does not toggle on trigger or label press', async () => {
76
97
  const onChange = jest.fn();
77
98
  const { getByText, getByTestId } = render(
78
- <Checkbox
79
- disabled
80
- defaultChecked={false}
81
- label='Terms'
82
- onCheckedChange={onChange}
83
- testID='checkbox'
84
- />,
99
+ <TestWrapper>
100
+ <Checkbox
101
+ disabled
102
+ defaultChecked={false}
103
+ label='Terms'
104
+ onCheckedChange={onChange}
105
+ testID='checkbox'
106
+ />
107
+ </TestWrapper>,
85
108
  );
86
109
 
87
110
  const trigger = getByTestId('checkbox');
@@ -95,7 +118,9 @@ describe('Checkbox', () => {
95
118
 
96
119
  it('passes through nativeID to trigger for a11y mapping', () => {
97
120
  const { getByTestId } = render(
98
- <Checkbox defaultChecked={false} nativeID='check-1' testID='checkbox' />,
121
+ <TestWrapper>
122
+ <Checkbox defaultChecked={false} nativeID='check-1' testID='checkbox' />
123
+ </TestWrapper>,
99
124
  );
100
125
 
101
126
  expect(getByTestId('checkbox').props.nativeID).toBe('check-1');