@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 { AmountInput } from './AmountInput';
2
+ import { useState } from 'react';
3
+ import { View } from 'react-native';
4
+ import { AmountInput, type AmountInputProps } from './AmountInput';
4
5
 
5
6
  const meta: Meta<typeof AmountInput> = {
6
7
  component: AmountInput,
@@ -14,25 +15,187 @@ const meta: Meta<typeof AmountInput> = {
14
15
  },
15
16
  },
16
17
  },
18
+ argTypes: {
19
+ currencyText: {
20
+ control: 'text',
21
+ description: 'Currency text to display (e.g. USD, EUR, $)',
22
+ },
23
+ currencyPosition: {
24
+ control: 'radio',
25
+ options: ['left', 'right'],
26
+ description: 'Position of the currency text',
27
+ },
28
+ allowDecimals: {
29
+ control: 'boolean',
30
+ description: 'Whether to allow decimal values',
31
+ },
32
+ thousandsSeparator: {
33
+ control: 'boolean',
34
+ description: 'Whether to display thousands separator',
35
+ },
36
+ maxIntegerLength: {
37
+ control: 'number',
38
+ description: 'Maximum digits for integer part',
39
+ },
40
+ maxDecimalLength: {
41
+ control: 'number',
42
+ description: 'Maximum digits for decimal part',
43
+ },
44
+ isInvalid: {
45
+ control: 'boolean',
46
+ description: 'Whether the input is in error state',
47
+ },
48
+ editable: {
49
+ control: 'boolean',
50
+ description: 'Whether the input is editable',
51
+ },
52
+ },
17
53
  };
18
54
 
19
55
  export default meta;
20
56
  type Story = StoryObj<typeof AmountInput>;
21
57
 
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.'
28
- />
29
- ),
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
- },
58
+ const AmountInputStory = (args: AmountInputProps) => {
59
+ const [value, setValue] = useState(args.value?.toString() ?? '');
60
+
61
+ return (
62
+ <View className='flex min-h-400 items-center justify-center p-24'>
63
+ <View className='w-full max-w-320'>
64
+ <AmountInput {...args} value={value} onChangeText={setValue} />
65
+ </View>
66
+ </View>
67
+ );
68
+ };
69
+
70
+ export const Base: Story = {
71
+ render: (args) => <AmountInputStory {...args} />,
72
+ args: {
73
+ currencyText: 'USD',
74
+ currencyPosition: 'left',
75
+ allowDecimals: true,
76
+ thousandsSeparator: true,
77
+ maxIntegerLength: 9,
78
+ maxDecimalLength: 9,
79
+ isInvalid: false,
80
+ editable: true,
81
+ },
82
+ };
83
+
84
+ export const WithValue: Story = {
85
+ render: (args) => <AmountInputStory {...args} />,
86
+ args: {
87
+ value: '1234.56',
88
+ currencyText: 'USD',
89
+ currencyPosition: 'left',
90
+ allowDecimals: true,
91
+ thousandsSeparator: true,
92
+ isInvalid: false,
93
+ editable: true,
94
+ },
95
+ };
96
+
97
+ export const CurrencyPositionLeft: Story = {
98
+ render: (args) => <AmountInputStory {...args} />,
99
+ args: {
100
+ value: '1000',
101
+ currencyText: '$',
102
+ currencyPosition: 'left',
103
+ allowDecimals: true,
104
+ thousandsSeparator: true,
105
+ isInvalid: false,
106
+ editable: true,
107
+ },
108
+ };
109
+
110
+ export const CurrencyPositionRight: Story = {
111
+ render: (args) => <AmountInputStory {...args} />,
112
+ args: {
113
+ value: '1000',
114
+ currencyText: 'ETH',
115
+ currencyPosition: 'right',
116
+ allowDecimals: true,
117
+ thousandsSeparator: true,
118
+ isInvalid: false,
119
+ editable: true,
120
+ },
121
+ };
122
+
123
+ export const IntegerOnly: Story = {
124
+ render: (args) => <AmountInputStory {...args} />,
125
+ args: {
126
+ value: '1234',
127
+ currencyText: 'items',
128
+ currencyPosition: 'right',
129
+ allowDecimals: false,
130
+ thousandsSeparator: true,
131
+ isInvalid: false,
132
+ editable: true,
133
+ },
134
+ };
135
+
136
+ export const WithThousandsSeparator: Story = {
137
+ render: (args) => <AmountInputStory {...args} />,
138
+ args: {
139
+ value: '1000000',
140
+ currencyText: 'USD',
141
+ currencyPosition: 'left',
142
+ allowDecimals: true,
143
+ thousandsSeparator: true,
144
+ isInvalid: false,
145
+ editable: true,
146
+ },
147
+ };
148
+
149
+ export const WithoutThousandsSeparator: Story = {
150
+ render: (args) => <AmountInputStory {...args} />,
151
+ args: {
152
+ value: '1000000',
153
+ currencyText: 'USD',
154
+ currencyPosition: 'left',
155
+ allowDecimals: true,
156
+ thousandsSeparator: false,
157
+ isInvalid: false,
158
+ editable: true,
159
+ },
160
+ };
161
+
162
+ export const ErrorState: Story = {
163
+ render: (args) => <AmountInputStory {...args} />,
164
+ args: {
165
+ value: '1234.56',
166
+ currencyText: 'USD',
167
+ currencyPosition: 'left',
168
+ allowDecimals: true,
169
+ thousandsSeparator: true,
170
+ isInvalid: true,
171
+ editable: true,
172
+ },
173
+ };
174
+
175
+ export const DisabledAmountInput: Story = {
176
+ render: (args) => <AmountInputStory {...args} />,
177
+ args: {
178
+ value: '1234.56',
179
+ currencyText: 'USD',
180
+ currencyPosition: 'left',
181
+ allowDecimals: true,
182
+ thousandsSeparator: true,
183
+ isInvalid: false,
184
+ editable: false,
185
+ },
186
+ };
187
+
188
+ export const CustomLengthLimits: Story = {
189
+ render: (args) => <AmountInputStory {...args} />,
190
+ args: {
191
+ value: '123',
192
+ currencyText: '$',
193
+ currencyPosition: 'left',
194
+ allowDecimals: true,
195
+ thousandsSeparator: true,
196
+ maxIntegerLength: 6,
197
+ maxDecimalLength: 2,
198
+ isInvalid: false,
199
+ editable: true,
37
200
  },
38
201
  };
@@ -102,21 +102,30 @@ export const AmountInput = React.forwardRef<TextInput, AmountInputProps>(
102
102
 
103
103
  useImperativeHandle(ref, () => inputRef.current as TextInput, []);
104
104
 
105
- const animatedInputStyle = useAnimatedStyle(() => ({
106
- transform: [{ translateX: translateX.value }],
107
- fontSize: animatedFontSize.value,
108
- letterSpacing: 0,
109
- }));
110
-
111
- const animatedCurrencyStyle = useAnimatedStyle(() => ({
112
- fontSize: animatedFontSize.value,
113
- letterSpacing: 0,
114
- }));
115
-
116
- const animatedCaretStyle = useAnimatedStyle(() => ({
117
- opacity: caretOpacity.value,
118
- height: animatedFontSize.value,
119
- }));
105
+ const animatedInputStyle = useAnimatedStyle(
106
+ () => ({
107
+ transform: [{ translateX: translateX.value }],
108
+ fontSize: animatedFontSize.value,
109
+ letterSpacing: 0,
110
+ }),
111
+ [translateX, animatedFontSize],
112
+ );
113
+
114
+ const animatedCurrencyStyle = useAnimatedStyle(
115
+ () => ({
116
+ fontSize: animatedFontSize.value,
117
+ letterSpacing: 0,
118
+ }),
119
+ [animatedFontSize],
120
+ );
121
+
122
+ const animatedCaretStyle = useAnimatedStyle(
123
+ () => ({
124
+ opacity: caretOpacity.value,
125
+ height: animatedFontSize.value,
126
+ }),
127
+ [caretOpacity, animatedFontSize],
128
+ );
120
129
 
121
130
  useEffect(() => {
122
131
  const newSize = getFontSize(inputValue);
@@ -1,12 +1,23 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
2
3
  import { fireEvent, render } from '@testing-library/react-native';
4
+ import React from 'react';
3
5
  import { Button } from '../Button';
6
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
4
7
  import { Banner } from './Banner';
5
8
 
9
+ const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
10
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
11
+ {children}
12
+ </ThemeProvider>
13
+ );
14
+
6
15
  describe('Banner Component', () => {
7
16
  it('should render correctly with minimal props', () => {
8
17
  const { getByText } = render(
9
- <Banner title='banner-title' description='banner-description' />,
18
+ <TestWrapper>
19
+ <Banner title='banner-title' description='banner-description' />
20
+ </TestWrapper>,
10
21
  );
11
22
  getByText('banner-title');
12
23
  getByText('banner-description');
@@ -14,33 +25,51 @@ describe('Banner Component', () => {
14
25
 
15
26
  it('should render with different appearances', () => {
16
27
  const { getByTestId, rerender } = render(
17
- <Banner testID='banner-id' title='Info Banner' appearance='info' />,
28
+ <TestWrapper>
29
+ <Banner testID='banner-id' title='Info Banner' appearance='info' />
30
+ </TestWrapper>,
18
31
  );
19
32
  expect(getByTestId('banner-id').props.className).toContain('bg-surface');
20
33
 
21
34
  rerender(
22
- <Banner testID='banner-id' title='Success Banner' appearance='success' />,
35
+ <TestWrapper>
36
+ <Banner
37
+ testID='banner-id'
38
+ title='Success Banner'
39
+ appearance='success'
40
+ />
41
+ </TestWrapper>,
23
42
  );
24
43
  expect(getByTestId('banner-id').props.className).toContain('bg-success');
25
44
 
26
45
  rerender(
27
- <Banner testID='banner-id' title='Warning Banner' appearance='warning' />,
46
+ <TestWrapper>
47
+ <Banner
48
+ testID='banner-id'
49
+ title='Warning Banner'
50
+ appearance='warning'
51
+ />
52
+ </TestWrapper>,
28
53
  );
29
54
  expect(getByTestId('banner-id').props.className).toContain('bg-warning');
30
55
 
31
56
  rerender(
32
- <Banner testID='banner-id' title='Error Banner' appearance='error' />,
57
+ <TestWrapper>
58
+ <Banner testID='banner-id' title='Error Banner' appearance='error' />
59
+ </TestWrapper>,
33
60
  );
34
61
  expect(getByTestId('banner-id').props.className).toContain('bg-error');
35
62
  });
36
63
 
37
64
  it('should render primary and secondary actions', () => {
38
65
  const { getByText } = render(
39
- <Banner
40
- title='Banner with Primary'
41
- primaryAction={<Button>Primary</Button>}
42
- secondaryAction={<Button>Secondary</Button>}
43
- />,
66
+ <TestWrapper>
67
+ <Banner
68
+ title='Banner with Primary'
69
+ primaryAction={<Button>Primary</Button>}
70
+ secondaryAction={<Button>Secondary</Button>}
71
+ />
72
+ </TestWrapper>,
44
73
  );
45
74
 
46
75
  getByText('Primary');
@@ -50,10 +79,12 @@ describe('Banner Component', () => {
50
79
  it('should handle primaryAction button clicks', () => {
51
80
  const onPressMock = jest.fn();
52
81
  const { getByText } = render(
53
- <Banner
54
- title='Banner with Primary'
55
- primaryAction={<Button onPress={onPressMock}>Primary</Button>}
56
- />,
82
+ <TestWrapper>
83
+ <Banner
84
+ title='Banner with Primary'
85
+ primaryAction={<Button onPress={onPressMock}>Primary</Button>}
86
+ />
87
+ </TestWrapper>,
57
88
  );
58
89
 
59
90
  expect(onPressMock).not.toHaveBeenCalled();
@@ -64,7 +95,9 @@ describe('Banner Component', () => {
64
95
  it('should handle onClose button clicks', () => {
65
96
  const onCloseMock = jest.fn();
66
97
  const { getByTestId } = render(
67
- <Banner title='Banner with Primary' onClose={onCloseMock} />,
98
+ <TestWrapper>
99
+ <Banner title='Banner with Primary' onClose={onCloseMock} />
100
+ </TestWrapper>,
68
101
  );
69
102
 
70
103
  expect(onCloseMock).not.toHaveBeenCalled();
@@ -1,7 +1,6 @@
1
1
  import { cn } from '@ledgerhq/lumen-utils-shared';
2
2
  import React, {
3
3
  useCallback,
4
- useEffect,
5
4
  useImperativeHandle,
6
5
  useRef,
7
6
  useState,
@@ -13,11 +12,6 @@ import {
13
12
  type TextInputProps,
14
13
  View,
15
14
  } from 'react-native';
16
- import Animated, {
17
- useAnimatedStyle,
18
- useSharedValue,
19
- withTiming,
20
- } from 'react-native-reanimated';
21
15
  import { useCommonTranslation } from '../../../i18n';
22
16
  import { DeleteCircleFill } from '../../Symbols/Icons/DeleteCircleFill';
23
17
  import { InteractiveIcon } from '../InteractiveIcon';
@@ -71,8 +65,6 @@ const baseInputStyles = cn(
71
65
  'relative flex-1 pt-16 pb-2 size-full text-base transition-colors bg-muted outline-none',
72
66
  );
73
67
 
74
- const AnimatedLabel = Animated.createAnimatedComponent(Animated.Text);
75
-
76
68
  export const BaseInput = React.forwardRef<TextInput, BaseInputProps>(
77
69
  (
78
70
  {
@@ -106,30 +98,9 @@ export const BaseInput = React.forwardRef<TextInput, BaseInputProps>(
106
98
  ? !!props.value && props.value.length > 0
107
99
  : uncontrolledValue.length > 0;
108
100
 
109
- // floating label styling
110
- const labelFontSize = useSharedValue(14);
111
- const labelTop = useSharedValue(14);
112
101
  const isFloatingLabel = isFocused || hasContent;
113
-
114
- const animatedLabelStyle = useAnimatedStyle(
115
- () => ({
116
- fontSize: labelFontSize.value,
117
- top: labelTop.value,
118
- }),
119
- [],
120
- );
121
-
122
102
  const showClearButton = hasContent && editable && !hideClearButton;
123
103
 
124
- useEffect(() => {
125
- labelFontSize.value = withTiming(isFloatingLabel ? 10 : 14, {
126
- duration: 200,
127
- });
128
- labelTop.value = withTiming(isFloatingLabel ? 8 : 14, {
129
- duration: 200,
130
- });
131
- }, [isFloatingLabel, labelFontSize, labelTop]);
132
-
133
104
  const handleChangeText = useCallback(
134
105
  (text: string) => {
135
106
  if (!isControlled) {
@@ -185,24 +156,24 @@ export const BaseInput = React.forwardRef<TextInput, BaseInputProps>(
185
156
  />
186
157
 
187
158
  {label && (
188
- <AnimatedLabel
159
+ <Text
189
160
  className={cn(
190
- 'absolute left-16 text-muted w-full',
161
+ 'absolute left-16 text-muted w-full transition-all duration-200',
162
+ isFloatingLabel ? 'top-6 body-4' : 'top-12 body-2',
191
163
  hasContent && showClearButton && 'w-[92%]',
192
164
  !editable && 'text-disabled',
193
165
  errorMessage && 'text-error',
194
166
  labelClassName,
195
167
  )}
196
- style={animatedLabelStyle}
197
168
  numberOfLines={1}
198
169
  >
199
170
  {label}
200
- </AnimatedLabel>
171
+ </Text>
201
172
  )}
202
173
 
203
174
  {showClearButton && (
204
175
  <InteractiveIcon
205
- iconType='filled'
176
+ iconType='stroked'
206
177
  onPress={handleClear}
207
178
  accessibilityLabel={t('components.baseInput.clearInputAriaLabel')}
208
179
  >
@@ -215,7 +186,7 @@ export const BaseInput = React.forwardRef<TextInput, BaseInputProps>(
215
186
 
216
187
  {errorMessage && (
217
188
  <View className='mt-8 flex-row items-center gap-2'>
218
- <DeleteCircleFill size={16} className='shrink-0 text-error' />
189
+ <DeleteCircleFill size={16} className='text-error shrink-0' />
219
190
  <Text className='text-error body-3'>{errorMessage}</Text>
220
191
  </View>
221
192
  )}
@@ -98,7 +98,7 @@ export const Base: Story = {
98
98
 
99
99
  return (
100
100
  <View className='h-320 w-full items-center justify-center pt-32'>
101
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
101
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
102
102
  Toggle open
103
103
  </Button>
104
104
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -140,7 +140,7 @@ export const TitleExpanded: Story = {
140
140
 
141
141
  return (
142
142
  <View className='h-320 w-full items-center justify-center pt-32'>
143
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
143
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
144
144
  Toggle open
145
145
  </Button>
146
146
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -178,7 +178,7 @@ export const DynamicSizingWithoutSnapPoints: Story = {
178
178
 
179
179
  return (
180
180
  <View className='h-320 w-full items-center justify-center'>
181
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
181
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
182
182
  Toggle open
183
183
  </Button>
184
184
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -214,7 +214,7 @@ export const DynamicSizingWithSnapPoints: Story = {
214
214
  return (
215
215
  <View className='h-320 w-full items-center justify-center'>
216
216
  <Button
217
- size='xs'
217
+ size='sm'
218
218
  onPress={() => bottomSheetRef.current?.snapToIndex(1)}
219
219
  >
220
220
  Toggle open
@@ -253,7 +253,7 @@ export const PreventClose: Story = {
253
253
 
254
254
  return (
255
255
  <View className='h-320 w-full items-center justify-center pt-32'>
256
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
256
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
257
257
  Toggle open
258
258
  </Button>
259
259
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -288,7 +288,7 @@ export const ScrollView: Story = {
288
288
 
289
289
  return (
290
290
  <View className='h-320 w-full items-center justify-center bg-base pt-32'>
291
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
291
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
292
292
  Toggle open
293
293
  </Button>
294
294
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -336,7 +336,7 @@ export const VirtualList: Story = {
336
336
 
337
337
  return (
338
338
  <View className='h-320 w-full items-center justify-center pt-32'>
339
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
339
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
340
340
  Toggle open
341
341
  </Button>
342
342
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -396,7 +396,7 @@ export const VirtualizedList: Story = {
396
396
 
397
397
  return (
398
398
  <View className='h-320 w-full items-center justify-center pt-32'>
399
- <Button size='xs' onPress={() => bottomSheetRef.current?.expand()}>
399
+ <Button size='sm' onPress={() => bottomSheetRef.current?.expand()}>
400
400
  Toggle open
401
401
  </Button>
402
402
  <BottomSheet {...args} ref={bottomSheetRef}>
@@ -33,7 +33,7 @@ const bottomSheetVariants = {
33
33
  root: cva('mb-16 w-full flex-1 rounded-t-xl bg-canvas-sheet', {
34
34
  variants: {
35
35
  shadow: {
36
- true: 'shadow-lg shadow-base',
36
+ true: 'shadow-base shadow-lg',
37
37
  false: '',
38
38
  },
39
39
  },