@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,253 @@
1
+ import { describe, expect, it, jest } from '@jest/globals';
2
+ import { fireEvent, render, screen } from '@testing-library/react-native';
3
+ import React, { createRef } from 'react';
4
+ import {
5
+ Pressable,
6
+ PressableProps,
7
+ PressableStateCallbackType,
8
+ View,
9
+ } from 'react-native';
10
+ import { LumenStyleSheetProvider } from '../Provider/LumenStyleSheetProvider';
11
+ import { createStyledPressable } from './createStyledPressable';
12
+
13
+ const testThemes: any = {
14
+ light: {
15
+ spacings: { s8: 8, s16: 16 },
16
+ sizes: { s48: 48, full: '100%' },
17
+ colors: { bg: { surface: '#F0F0F0', accent: '#6B21A8' }, border: {} },
18
+ borderRadius: { md: 12 },
19
+ shadows: {},
20
+ typographies: { sm: {} },
21
+ },
22
+ dark: {
23
+ spacings: { s8: 8, s16: 16 },
24
+ sizes: { s48: 48, full: '100%' },
25
+ colors: { bg: { surface: '#1C1C1E', accent: '#A855F7' }, border: {} },
26
+ borderRadius: { md: 12 },
27
+ shadows: {},
28
+ typographies: { sm: {} },
29
+ },
30
+ };
31
+
32
+ const renderWithProvider = (children: React.ReactElement) =>
33
+ render(
34
+ <LumenStyleSheetProvider themes={testThemes}>
35
+ {children}
36
+ </LumenStyleSheetProvider>,
37
+ );
38
+
39
+ describe('createStyledPressable', () => {
40
+ const StyledPressable = createStyledPressable(Pressable);
41
+
42
+ it('should have correct display name', () => {
43
+ expect(StyledPressable.displayName).toBe('StyledPressable(Pressable)');
44
+ });
45
+
46
+ it('should resolve token props to styles', () => {
47
+ renderWithProvider(
48
+ <StyledPressable
49
+ testID='pressable'
50
+ lx={{
51
+ padding: 's16',
52
+ width: 's48',
53
+ backgroundColor: 'surface',
54
+ borderRadius: 'md',
55
+ }}
56
+ />,
57
+ );
58
+
59
+ const pressable = screen.getByTestId('pressable');
60
+ expect(pressable.props.style).toMatchObject({
61
+ padding: 16,
62
+ width: 48,
63
+ backgroundColor: '#F0F0F0',
64
+ borderRadius: 12,
65
+ });
66
+ });
67
+
68
+ it('should resolve full size token to 100%', () => {
69
+ renderWithProvider(
70
+ <StyledPressable testID='pressable' lx={{ width: 'full' }} />,
71
+ );
72
+
73
+ const pressable = screen.getByTestId('pressable');
74
+ expect(pressable.props.style.width).toBe('100%');
75
+ });
76
+
77
+ it('should merge static style prop with resolved tokens', () => {
78
+ renderWithProvider(
79
+ <StyledPressable
80
+ testID='pressable'
81
+ lx={{ padding: 's16' }}
82
+ style={{ opacity: 0.5 }}
83
+ />,
84
+ );
85
+
86
+ const pressable = screen.getByTestId('pressable');
87
+ expect(pressable.props.style.padding).toBe(16);
88
+ expect(pressable.props.style.opacity).toBe(0.5);
89
+ });
90
+
91
+ it('should merge style prop with resolved tokens', () => {
92
+ renderWithProvider(
93
+ <StyledPressable
94
+ testID='pressable'
95
+ lx={{ backgroundColor: 'surface' }}
96
+ style={{ opacity: 0.8 }}
97
+ />,
98
+ );
99
+
100
+ const pressable = screen.getByTestId('pressable');
101
+ expect(pressable.props.style.backgroundColor).toBe('#F0F0F0');
102
+ expect(pressable.props.style.opacity).toBe(0.8);
103
+ });
104
+
105
+ it('should support function-based style prop', () => {
106
+ renderWithProvider(
107
+ <StyledPressable
108
+ testID='pressable'
109
+ lx={{ backgroundColor: 'surface' }}
110
+ style={({ pressed }) => ({
111
+ opacity: pressed ? 0.7 : 1,
112
+ })}
113
+ />,
114
+ );
115
+
116
+ const pressable = screen.getByTestId('pressable');
117
+ expect(pressable.props.style.backgroundColor).toBe('#F0F0F0');
118
+ expect(pressable.props.style.opacity).toBe(1);
119
+ });
120
+
121
+ describe('array style support', () => {
122
+ it('should support array of static styles', () => {
123
+ renderWithProvider(
124
+ <StyledPressable
125
+ testID='pressable'
126
+ lx={{ padding: 's16' }}
127
+ style={[{ opacity: 0.5 }, { flex: 1 }]}
128
+ />,
129
+ );
130
+
131
+ const pressable = screen.getByTestId('pressable');
132
+ expect(pressable.props.style.padding).toBe(16);
133
+ expect(pressable.props.style.opacity).toBe(0.5);
134
+ expect(pressable.props.style.flex).toBe(1);
135
+ });
136
+
137
+ it('should support array with function-based style', () => {
138
+ renderWithProvider(
139
+ <StyledPressable
140
+ testID='pressable'
141
+ lx={{ backgroundColor: 'surface' }}
142
+ style={[
143
+ { flex: 1 },
144
+ ({ pressed }: PressableStateCallbackType) => ({
145
+ opacity: pressed ? 0.7 : 1,
146
+ }),
147
+ ]}
148
+ />,
149
+ );
150
+
151
+ const pressable = screen.getByTestId('pressable');
152
+ expect(pressable.props.style.backgroundColor).toBe('#F0F0F0');
153
+ expect(pressable.props.style.flex).toBe(1);
154
+ expect(pressable.props.style.opacity).toBe(1);
155
+ });
156
+
157
+ it('should support array with mixed static and function styles', () => {
158
+ renderWithProvider(
159
+ <StyledPressable
160
+ testID='pressable'
161
+ style={[
162
+ { padding: 10 },
163
+ ({ pressed }: PressableStateCallbackType) => ({
164
+ opacity: pressed ? 0.5 : 1,
165
+ }),
166
+ { margin: 5 },
167
+ ]}
168
+ />,
169
+ );
170
+
171
+ const pressable = screen.getByTestId('pressable');
172
+ expect(pressable.props.style.padding).toBe(10);
173
+ expect(pressable.props.style.margin).toBe(5);
174
+ expect(pressable.props.style.opacity).toBe(1);
175
+ });
176
+
177
+ it('should handle null/undefined in style array', () => {
178
+ renderWithProvider(
179
+ <StyledPressable
180
+ testID='pressable'
181
+ style={[null, { opacity: 0.8 }, undefined]}
182
+ />,
183
+ );
184
+
185
+ const pressable = screen.getByTestId('pressable');
186
+ expect(pressable.props.style.opacity).toBe(0.8);
187
+ });
188
+ });
189
+
190
+ it('should forward ref', () => {
191
+ const ref = createRef<View>();
192
+ renderWithProvider(<StyledPressable ref={ref} testID='pressable' />);
193
+ expect(ref.current).toBeTruthy();
194
+ });
195
+
196
+ it('should handle onPress callback', () => {
197
+ const onPress = jest.fn();
198
+ renderWithProvider(
199
+ <StyledPressable testID='pressable' onPress={onPress} />,
200
+ );
201
+
202
+ fireEvent.press(screen.getByTestId('pressable'));
203
+ expect(onPress).toHaveBeenCalledTimes(1);
204
+ });
205
+
206
+ describe('performance (memo)', () => {
207
+ it('should not re-render when props are unchanged', () => {
208
+ const renderCount = jest.fn();
209
+ const TrackedPressable = (props: PressableProps) => {
210
+ renderCount();
211
+ return <Pressable {...props} />;
212
+ };
213
+ const StyledTracked = createStyledPressable(TrackedPressable as any);
214
+
215
+ const { rerender } = renderWithProvider(
216
+ <StyledTracked testID='pressable' lx={{ padding: 's16' }} />,
217
+ );
218
+
219
+ expect(renderCount).toHaveBeenCalledTimes(1);
220
+
221
+ rerender(
222
+ <LumenStyleSheetProvider themes={testThemes}>
223
+ <StyledTracked testID='pressable' lx={{ padding: 's16' }} />
224
+ </LumenStyleSheetProvider>,
225
+ );
226
+
227
+ expect(renderCount).toHaveBeenCalledTimes(1);
228
+ });
229
+
230
+ it('should re-render when token props change', () => {
231
+ const renderCount = jest.fn();
232
+ const TrackedPressable = (props: PressableProps) => {
233
+ renderCount();
234
+ return <Pressable {...props} />;
235
+ };
236
+ const StyledTracked = createStyledPressable(TrackedPressable as any);
237
+
238
+ const { rerender } = renderWithProvider(
239
+ <StyledTracked testID='pressable' lx={{ padding: 's16' }} />,
240
+ );
241
+
242
+ expect(renderCount).toHaveBeenCalledTimes(1);
243
+
244
+ rerender(
245
+ <LumenStyleSheetProvider themes={testThemes}>
246
+ <StyledTracked testID='pressable' lx={{ width: 's48' }} />
247
+ </LumenStyleSheetProvider>,
248
+ );
249
+
250
+ expect(renderCount).toHaveBeenCalledTimes(2);
251
+ });
252
+ });
253
+ });
@@ -0,0 +1,97 @@
1
+ import React, { forwardRef, memo } from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import type {
4
+ Pressable,
5
+ PressableProps,
6
+ PressableStateCallbackType,
7
+ ViewStyle,
8
+ } from 'react-native';
9
+ import { useTheme } from '../Provider/useTheme';
10
+ import { resolveViewStyle } from '../resolveStyle/resolveStyle';
11
+ import { LumenPressableStyleLX } from '../types';
12
+ import { areLxPropsEqual } from './areLxPropsEqual';
13
+
14
+ type PressableRef = React.ElementRef<typeof Pressable>;
15
+ type StyleFn = (state: PressableStateCallbackType) => ViewStyle;
16
+ type StyleItem = ViewStyle | StyleFn | StyleItem[] | null | undefined;
17
+
18
+ export type StyledPressableProps = LumenPressableStyleLX &
19
+ Omit<PressableProps, 'style'> & {
20
+ style?: StyleItem;
21
+ };
22
+
23
+ /**
24
+ * Check if any style item (including nested arrays) is a function
25
+ */
26
+ const hasStyleFunction = (style: StyleItem): boolean => {
27
+ if (Array.isArray(style)) {
28
+ return style.some((s) => hasStyleFunction(s));
29
+ }
30
+ return typeof style === 'function';
31
+ };
32
+
33
+ /**
34
+ * Resolve all style functions in a style tree
35
+ */
36
+ const resolveStyleFunctions = (
37
+ style: StyleItem,
38
+ state: PressableStateCallbackType,
39
+ ): ViewStyle | (ViewStyle | null | undefined)[] | null | undefined => {
40
+ if (Array.isArray(style)) {
41
+ return style.map((s) => resolveStyleFunctions(s, state)) as (
42
+ | ViewStyle
43
+ | null
44
+ | undefined
45
+ )[];
46
+ }
47
+ return typeof style === 'function' ? style(state) : style;
48
+ };
49
+
50
+ /**
51
+ * Factory function to create a styled Pressable component.
52
+ *
53
+ * Supports `style` as an object, function, or array of objects/functions (including nested).
54
+ *
55
+ * ```tsx
56
+ * // Create a styled Pressable
57
+ * const Pressable = createStyledPressable(RNPressable);
58
+ *
59
+ * // Usage with array of styles
60
+ * <Pressable style={[props.style, ({ pressed }) => ({ opacity: pressed ? 0.8 : 1 })]} />
61
+ * ```
62
+ */
63
+ export const createStyledPressable = (Component: typeof Pressable) => {
64
+ const StyledComponent = memo(
65
+ forwardRef<PressableRef, StyledPressableProps>(
66
+ ({ lx = {}, style, ...props }, ref) => {
67
+ const { theme } = useTheme();
68
+ const resolvedLxStyle = resolveViewStyle(theme, lx);
69
+
70
+ if (!hasStyleFunction(style)) {
71
+ const finalStyle = StyleSheet.flatten([
72
+ resolvedLxStyle,
73
+ style as ViewStyle,
74
+ ]);
75
+ return <Component ref={ref} {...props} style={finalStyle} />;
76
+ }
77
+
78
+ const mergedStyle = (state: PressableStateCallbackType): ViewStyle => {
79
+ const resolvedStyle = resolveStyleFunctions(style, state);
80
+ return StyleSheet.flatten([resolvedLxStyle, resolvedStyle]);
81
+ };
82
+
83
+ return <Component ref={ref} {...props} style={mergedStyle} />;
84
+ },
85
+ ),
86
+ areLxPropsEqual,
87
+ );
88
+
89
+ // Set display name for debugging
90
+ const componentName =
91
+ (Component as { displayName?: string }).displayName ||
92
+ (Component as { name?: string }).name ||
93
+ 'Component';
94
+ StyledComponent.displayName = `StyledPressable(${componentName})`;
95
+
96
+ return StyledComponent;
97
+ };
@@ -64,9 +64,9 @@ describe('createStyledText', () => {
64
64
  expect(StyledText.displayName).toBe('StyledText(Text)');
65
65
  });
66
66
 
67
- it('should apply typography typo', () => {
67
+ it('should apply typography typography', () => {
68
68
  renderWithProvider(
69
- <StyledText testID='text' typo='body1'>
69
+ <StyledText testID='text' typography='body1'>
70
70
  Hello
71
71
  </StyledText>,
72
72
  );
@@ -81,25 +81,34 @@ describe('createStyledText', () => {
81
81
 
82
82
  it('should apply color token', () => {
83
83
  renderWithProvider(
84
- <StyledText testID='text' color='muted'>
84
+ <StyledText testID='text' lx={{ color: 'muted' }}>
85
85
  Muted
86
86
  </StyledText>,
87
87
  );
88
+
88
89
  expect(screen.getByTestId('text').props.style.color).toBe('#666666');
89
90
  });
90
91
 
91
- it('should combine typo, color and spacing', () => {
92
+ it('should combine typography, color and spacing', () => {
92
93
  renderWithProvider(
93
- <StyledText testID='text' typo='body1' color='base' marginTop='s8'>
94
+ <StyledText
95
+ testID='text'
96
+ typography='body1'
97
+ lx={{ color: 'base', marginTop: 's8' }}
98
+ >
94
99
  Styled
95
100
  </StyledText>,
96
101
  );
97
102
 
98
103
  const style = screen.getByTestId('text').props.style;
104
+
99
105
  expect(style).toMatchObject({
100
- fontSize: 16,
101
106
  color: '#000000',
102
107
  marginTop: 8,
108
+ fontSize: 16,
109
+ fontWeight: '500',
110
+ lineHeight: 24,
111
+ letterSpacing: 0,
103
112
  });
104
113
  });
105
114
 
@@ -107,18 +116,17 @@ describe('createStyledText', () => {
107
116
  renderWithProvider(
108
117
  <StyledText
109
118
  testID='text'
110
- typo='body1'
119
+ typography='body1'
111
120
  style={{ textDecorationLine: 'underline' }}
112
121
  >
113
122
  Underlined
114
123
  </StyledText>,
115
124
  );
116
125
 
117
- const [stylesFromProps, otherStyles] =
118
- screen.getByTestId('text').props.style;
126
+ const style = screen.getByTestId('text').props.style;
119
127
 
120
- expect(stylesFromProps.fontSize).toBe(16);
121
- expect(otherStyles.textDecorationLine).toBe('underline');
128
+ expect(style.fontSize).toBe(16);
129
+ expect(style.textDecorationLine).toBe('underline');
122
130
  });
123
131
 
124
132
  it('should forward ref', () => {
@@ -138,10 +146,10 @@ describe('createStyledText', () => {
138
146
  renderCount();
139
147
  return <Text {...props} />;
140
148
  };
141
- const StyledTracked = createStyledText(TrackedText);
149
+ const StyledTracked = createStyledText(TrackedText as any);
142
150
 
143
151
  const { rerender } = renderWithProvider(
144
- <StyledTracked testID='text' typo='body1'>
152
+ <StyledTracked testID='text' typography='body1'>
145
153
  Hello
146
154
  </StyledTracked>,
147
155
  );
@@ -151,7 +159,7 @@ describe('createStyledText', () => {
151
159
  // Re-render with same props
152
160
  rerender(
153
161
  <LumenStyleSheetProvider themes={testThemes}>
154
- <StyledTracked testID='text' typo='body1'>
162
+ <StyledTracked testID='text' typography='body1'>
155
163
  Hello
156
164
  </StyledTracked>
157
165
  </LumenStyleSheetProvider>,
@@ -167,10 +175,10 @@ describe('createStyledText', () => {
167
175
  renderCount();
168
176
  return <Text {...props} />;
169
177
  };
170
- const StyledTracked = createStyledText(TrackedText);
178
+ const StyledTracked = createStyledText(TrackedText as any);
171
179
 
172
180
  const { rerender } = renderWithProvider(
173
- <StyledTracked testID='text' typo='body1'>
181
+ <StyledTracked testID='text' typography='body1'>
174
182
  Hello
175
183
  </StyledTracked>,
176
184
  );
@@ -180,7 +188,7 @@ describe('createStyledText', () => {
180
188
  // Re-render with different props
181
189
  rerender(
182
190
  <LumenStyleSheetProvider themes={testThemes}>
183
- <StyledTracked testID='text' color='muted'>
191
+ <StyledTracked testID='text' lx={{ color: 'muted' }}>
184
192
  Hello
185
193
  </StyledTracked>
186
194
  </LumenStyleSheetProvider>,
@@ -196,10 +204,10 @@ describe('createStyledText', () => {
196
204
  renderCount();
197
205
  return <Text {...props} />;
198
206
  };
199
- const StyledTracked = createStyledText(TrackedText);
207
+ const StyledTracked = createStyledText(TrackedText as any);
200
208
 
201
209
  const { rerender } = renderWithProvider(
202
- <StyledTracked testID='text' typo='body1'>
210
+ <StyledTracked testID='text' typography='body1'>
203
211
  Hello
204
212
  </StyledTracked>,
205
213
  );
@@ -209,7 +217,7 @@ describe('createStyledText', () => {
209
217
  // Re-render with different children
210
218
  rerender(
211
219
  <LumenStyleSheetProvider themes={testThemes}>
212
- <StyledTracked testID='text' typo='body1'>
220
+ <StyledTracked testID='text' typography='body1'>
213
221
  World
214
222
  </StyledTracked>
215
223
  </LumenStyleSheetProvider>,
@@ -1,68 +1,48 @@
1
- import React, { forwardRef, memo, MemoExoticComponent } from 'react';
1
+ import React, { forwardRef, memo } from 'react';
2
+ import { StyleSheet } from 'react-native';
2
3
  import type { Text, TextProps, TextStyle } from 'react-native';
3
4
  import { useTheme } from '../Provider/useTheme';
4
- import {
5
- resolveTextStyle,
6
- extractLumenTextStyleProps,
7
- } from '../resolveStyle/resolveStyle';
8
- import type { LumenTextProps } from '../types';
5
+ import { resolveTextStyle } from '../resolveStyle/resolveStyle';
6
+ import type { LumenStyleSheetTheme, LumenTextStyleLX } from '../types';
7
+ import { areLxPropsEqual } from './areLxPropsEqual';
9
8
 
10
9
  type TextRef = React.ElementRef<typeof Text>;
11
- type ReturnComponentType = MemoExoticComponent<
12
- React.ForwardRefExoticComponent<
13
- React.PropsWithoutRef<LumenTextProps> & React.RefAttributes<TextRef>
14
- >
15
- >;
10
+ export type StyledTextProps = LumenTextStyleLX &
11
+ TextProps & {
12
+ /**
13
+ * Typography preset
14
+ */
15
+ typography?: keyof LumenStyleSheetTheme['typographies'];
16
+ };
16
17
 
17
18
  /**
18
19
  * Factory function to create a styled Text component.
19
20
  *
20
- * Creates a component that accepts token-constrained style props directly,
21
- * plus a `typo` prop for typography presets, resolving them to actual
22
- * values at runtime using the current theme.
23
- *
24
- * @param Component - The base Text-like component to wrap
25
- *
26
- * @example
27
21
  * ```tsx
28
- * import { Text } from 'react-native';
29
- * import { createStyledText } from '@ledgerhq/lumen-ui-rnative/styles';
30
- *
31
22
  * // Create a basic Text
32
23
  * const StyledText = createStyledText(Text);
33
- *
34
- * // Usage - token props and typo are resolved
35
- * <StyledText typo='body1'>Hello World</StyledText>
36
- * <StyledText typo='heading2SemiBold' marginTop='s8' color='muted'>
37
- * Subtitle
38
- * </StyledText>
39
- *
40
- * // style prop for escape hatch
41
- * <StyledText typo='body1' style={{ letterSpacing: 2 }} />
42
24
  * ```
43
25
  */
44
- export const createStyledText = (
45
- Component: React.ComponentType<LumenTextProps>,
46
- ): ReturnComponentType => {
26
+ export const createStyledText = (Component: typeof Text) => {
47
27
  const StyledComponent = memo(
48
- forwardRef<TextRef, LumenTextProps>((props, ref) => {
49
- const { theme } = useTheme();
50
- const { lumenStyle, rest } = extractLumenTextStyleProps(props);
51
- const resolvedStyle = resolveTextStyle(theme, lumenStyle);
28
+ forwardRef<TextRef, StyledTextProps>(
29
+ ({ typography = 'body3', lx = {}, style, ...props }, ref) => {
30
+ const { theme } = useTheme();
31
+ const resolvedStyle = resolveTextStyle(theme, lx);
32
+ const resolvedTypographyStyles = theme.typographies[
33
+ typography
34
+ ] as TextStyle;
52
35
 
53
- const { style: propsStyle, ...componentProps } = rest;
54
- const finalStyle = propsStyle
55
- ? ([resolvedStyle, propsStyle] as TextStyle[])
56
- : resolvedStyle;
36
+ const finalStyle = StyleSheet.flatten([
37
+ resolvedStyle,
38
+ resolvedTypographyStyles,
39
+ style,
40
+ ]);
57
41
 
58
- return (
59
- <Component
60
- {...({ ...componentProps, ref, style: finalStyle } as TextProps & {
61
- ref: React.Ref<Text>;
62
- })}
63
- />
64
- );
65
- }),
42
+ return <Component ref={ref} {...props} style={finalStyle} />;
43
+ },
44
+ ),
45
+ areLxPropsEqual,
66
46
  );
67
47
 
68
48
  // Set display name for debugging
@@ -42,10 +42,12 @@ describe('createStyledView', () => {
42
42
  renderWithProvider(
43
43
  <StyledView
44
44
  testID='view'
45
- padding='s16'
46
- width='s48'
47
- backgroundColor='surface'
48
- borderRadius='md'
45
+ lx={{
46
+ padding: 's16',
47
+ width: 's48',
48
+ backgroundColor: 'surface',
49
+ borderRadius: 'md',
50
+ }}
49
51
  />,
50
52
  );
51
53
 
@@ -59,20 +61,23 @@ describe('createStyledView', () => {
59
61
  });
60
62
 
61
63
  it('should resolve full size token to 100%', () => {
62
- renderWithProvider(<StyledView testID='view' width='full' />);
64
+ renderWithProvider(<StyledView testID='view' lx={{ width: 'full' }} />);
63
65
  expect(screen.getByTestId('view').props.style.width).toBe('100%');
64
66
  });
65
67
 
66
68
  it('should merge style prop with resolved tokens', () => {
67
69
  renderWithProvider(
68
- <StyledView testID='view' padding='s16' style={{ opacity: 0.5 }} />,
70
+ <StyledView
71
+ testID='view'
72
+ lx={{ padding: 's16' }}
73
+ style={{ opacity: 0.5 }}
74
+ />,
69
75
  );
70
76
 
71
- const [stylesFromProps, otherStyles] =
72
- screen.getByTestId('view').props.style;
77
+ const style = screen.getByTestId('view').props.style;
73
78
 
74
- expect(stylesFromProps.padding).toBe(16);
75
- expect(otherStyles.opacity).toBe(0.5);
79
+ expect(style.padding).toBe(16);
80
+ expect(style.opacity).toBe(0.5);
76
81
  });
77
82
 
78
83
  it('should forward ref', () => {
@@ -88,10 +93,10 @@ describe('createStyledView', () => {
88
93
  renderCount();
89
94
  return <View {...props} />;
90
95
  };
91
- const StyledTracked = createStyledView(TrackedView);
96
+ const StyledTracked = createStyledView(TrackedView as any);
92
97
 
93
98
  const { rerender } = renderWithProvider(
94
- <StyledTracked testID='view' padding='s16' />,
99
+ <StyledTracked testID='view' lx={{ padding: 's16' }} />,
95
100
  );
96
101
 
97
102
  expect(renderCount).toHaveBeenCalledTimes(1);
@@ -99,7 +104,7 @@ describe('createStyledView', () => {
99
104
  // Re-render with same props
100
105
  rerender(
101
106
  <LumenStyleSheetProvider themes={testThemes}>
102
- <StyledTracked testID='view' padding='s16' />
107
+ <StyledTracked testID='view' lx={{ padding: 's16' }} />
103
108
  </LumenStyleSheetProvider>,
104
109
  );
105
110
 
@@ -113,10 +118,11 @@ describe('createStyledView', () => {
113
118
  renderCount();
114
119
  return <View {...props} />;
115
120
  };
116
- const StyledTracked = createStyledView(TrackedView);
121
+
122
+ const StyledTracked = createStyledView(TrackedView as any);
117
123
 
118
124
  const { rerender } = renderWithProvider(
119
- <StyledTracked testID='view' padding='s16' />,
125
+ <StyledTracked testID='view' lx={{ padding: 's16' }} />,
120
126
  );
121
127
 
122
128
  expect(renderCount).toHaveBeenCalledTimes(1);
@@ -124,7 +130,7 @@ describe('createStyledView', () => {
124
130
  // Re-render with different props
125
131
  rerender(
126
132
  <LumenStyleSheetProvider themes={testThemes}>
127
- <StyledTracked testID='view' width='s48' />
133
+ <StyledTracked testID='view' lx={{ width: 's48' }} />
128
134
  </LumenStyleSheetProvider>,
129
135
  );
130
136