@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
@@ -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
 
@@ -1,67 +1,33 @@
1
- import React, { forwardRef, memo, MemoExoticComponent } from 'react';
2
- import type { View, ViewProps, ViewStyle } from 'react-native';
1
+ import React, { forwardRef, memo } from 'react';
2
+ import { StyleSheet, View, type ViewProps } from 'react-native';
3
3
  import { useTheme } from '../Provider/useTheme';
4
- import {
5
- resolveViewStyle,
6
- extractLumenViewStyleProps,
7
- } from '../resolveStyle/resolveStyle';
8
- import type { LumenViewProps } from '../types';
4
+ import { resolveViewStyle } from '../resolveStyle/resolveStyle';
5
+ import type { LumenViewStyleLX } from '../types';
6
+ import { areLxPropsEqual } from './areLxPropsEqual';
9
7
 
10
8
  type ViewRef = React.ElementRef<typeof View>;
11
- type ReturnComponentType = MemoExoticComponent<
12
- React.ForwardRefExoticComponent<
13
- React.PropsWithoutRef<LumenViewProps> & React.RefAttributes<ViewRef>
14
- >
15
- >;
9
+ export type StyledViewProps = LumenViewStyleLX & ViewProps;
10
+
16
11
  /**
17
12
  * Factory function to create a styled View component.
18
13
  *
19
- * Creates a component that accepts token-constrained style props directly,
20
- * resolving them to actual values at runtime using the current theme.
21
- *
22
- * @param Component - The base View-like component to wrap
23
- *
24
- * @example
25
14
  * ```tsx
26
- * import { View } from 'react-native';
27
- * import { createStyledView } from '@ledgerhq/lumen-ui-rnative/styles';
28
- *
29
- * // Create a basic Box
30
- * const Box = createStyledView(View);
31
- *
32
- * // Usage - token props are resolved to actual values
33
- * <Box width='s400' marginTop='s4' gap='s12' alignItems='center' />
34
- * <Box padding='s16' backgroundColor='surface' borderRadius='md'>
35
- * Content
36
- * </Box>
37
- *
38
- * // style prop for escape hatch
39
- * <Box marginTop='s4' style={{ width: 127 }} />
15
+ * // Create a basic View
16
+ * const StyledView = createStyledView(View);
40
17
  * ```
41
18
  */
42
- export const createStyledView = (
43
- Component: React.ComponentType<LumenViewProps>,
44
- ): ReturnComponentType => {
19
+ export const createStyledView = (Component: typeof View) => {
45
20
  const StyledComponent = memo(
46
- forwardRef<ViewRef, LumenViewProps>((props, ref) => {
47
- const { theme } = useTheme();
48
-
49
- const { lumenStyle, rest } = extractLumenViewStyleProps(props);
50
- const resolvedStyle = resolveViewStyle(theme, lumenStyle);
51
-
52
- const { style: propsStyle, ...componentProps } = rest;
53
- const style = propsStyle
54
- ? ([resolvedStyle, propsStyle] as ViewStyle[])
55
- : resolvedStyle;
21
+ forwardRef<ViewRef, StyledViewProps>(
22
+ ({ lx = {}, style, ...props }, ref) => {
23
+ const { theme } = useTheme();
24
+ const resolvedStyle = resolveViewStyle(theme, lx);
25
+ const finalStyle = StyleSheet.flatten([resolvedStyle, style]);
56
26
 
57
- return (
58
- <Component
59
- {...({ ...componentProps, ref, style } as ViewProps & {
60
- ref: React.Ref<View>;
61
- })}
62
- />
63
- );
64
- }),
27
+ return <Component ref={ref} {...props} style={finalStyle} />;
28
+ },
29
+ ),
30
+ areLxPropsEqual,
65
31
  );
66
32
 
67
33
  // Set display name for debugging
@@ -0,0 +1,3 @@
1
+ export * from './createStyledPressable';
2
+ export * from './createStyledText';
3
+ export * from './createStyledView';
@@ -1,6 +1,5 @@
1
1
  export { LumenStyleSheetProvider } from './Provider/LumenStyleSheetProvider';
2
2
  export { LumenStyleSheet } from './LumenStyleSheet';
3
3
  export * from './types';
4
- export * from './factories/createStyledText';
5
- export * from './factories/createStyledView';
6
- export * from './utils/styleVarianceAuthority';
4
+ export * from './factories';
5
+ export * from './utils';
@@ -1,9 +1,9 @@
1
- import { LumenTextStyleProps, LumenViewStyleProps } from '../types';
1
+ import { LumenTextStyle, LumenViewStyle } from '../types';
2
2
 
3
3
  /**
4
4
  * Configuration for each style prop
5
5
  * - path: Theme path for token lookup (array of keys)
6
- * - spread: true for props that spread into multiple style properties (typo)
6
+ * - spread: true for props that spread into multiple style properties (typography)
7
7
  * - No path = passthrough prop (value passed as-is)
8
8
  */
9
9
  export type PropConfig = {
@@ -14,7 +14,7 @@ export type PropConfig = {
14
14
  /**
15
15
  * View style props configuration
16
16
  */
17
- export const VIEW_PROP_CONFIG: Record<keyof LumenViewStyleProps, PropConfig> = {
17
+ export const VIEW_PROP_CONFIG: Record<keyof LumenViewStyle, PropConfig> = {
18
18
  // Spacing props
19
19
  padding: { path: ['spacings'] },
20
20
  paddingTop: { path: ['spacings'] },
@@ -37,6 +37,13 @@ export const VIEW_PROP_CONFIG: Record<keyof LumenViewStyleProps, PropConfig> = {
37
37
  gap: { path: ['spacings'] },
38
38
  rowGap: { path: ['spacings'] },
39
39
  columnGap: { path: ['spacings'] },
40
+ position: {},
41
+ top: { path: ['spacings'] },
42
+ bottom: { path: ['spacings'] },
43
+ left: { path: ['spacings'] },
44
+ right: { path: ['spacings'] },
45
+ start: { path: ['spacings'] },
46
+ end: { path: ['spacings'] },
40
47
 
41
48
  // Size props
42
49
  width: { path: ['sizes'] },
@@ -88,13 +95,7 @@ export const VIEW_PROP_CONFIG: Record<keyof LumenViewStyleProps, PropConfig> = {
88
95
  flexGrow: {},
89
96
  flexShrink: {},
90
97
  flexBasis: {},
91
- position: {},
92
- top: {},
93
- bottom: {},
94
- left: {},
95
- right: {},
96
- start: {},
97
- end: {},
98
+
98
99
  zIndex: {},
99
100
  overflow: {},
100
101
  display: {},
@@ -105,12 +106,12 @@ export const VIEW_PROP_CONFIG: Record<keyof LumenViewStyleProps, PropConfig> = {
105
106
  } as const;
106
107
 
107
108
  /**
108
- * Text style props configuration (extends view props + color + typo)
109
+ * Text style props configuration (extends view props + color + typography)
109
110
  */
110
- export const TEXT_PROP_CONFIG: Record<keyof LumenTextStyleProps, PropConfig> = {
111
+ export const TEXT_PROP_CONFIG: Record<keyof LumenTextStyle, PropConfig> = {
111
112
  ...VIEW_PROP_CONFIG,
112
113
  color: { path: ['colors', 'text'] },
113
- typo: { path: ['typographies'], spread: true },
114
+ typography: { path: ['typographies'], spread: true },
114
115
  textAlign: {},
115
116
  textTransform: {},
116
117
  textDecorationLine: {},
@@ -121,11 +122,11 @@ export const TEXT_PROP_CONFIG: Record<keyof LumenTextStyleProps, PropConfig> = {
121
122
  */
122
123
  export const LUMEN_VIEW_STYLE_PROPS = new Set(
123
124
  Object.keys(VIEW_PROP_CONFIG),
124
- ) as Set<keyof LumenViewStyleProps>;
125
+ ) as Set<keyof LumenViewStyle>;
125
126
 
126
127
  /**
127
128
  * Set for O(1) text prop lookup
128
129
  */
129
130
  export const LUMEN_TEXT_STYLE_PROPS = new Set(
130
131
  Object.keys(TEXT_PROP_CONFIG),
131
- ) as Set<keyof LumenTextStyleProps>;
132
+ ) as Set<keyof LumenTextStyle>;
@@ -2,12 +2,7 @@ import { describe, expect, it } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import type { BoxShadowValue } from 'react-native';
4
4
  import { createStylesheetTheme } from '../Provider/createStylesheetTheme';
5
- import {
6
- resolveViewStyle,
7
- resolveTextStyle,
8
- extractLumenViewStyleProps,
9
- extractLumenTextStyleProps,
10
- } from './resolveStyle';
5
+ import { resolveViewStyle, resolveTextStyle } from './resolveStyle';
11
6
 
12
7
  /**
13
8
  * Use actual theme from design-core for type-safe testing
@@ -306,17 +301,17 @@ describe('resolve-style', () => {
306
301
  it('should pass through position props unchanged', () => {
307
302
  const result = resolveViewStyle(mockTheme, {
308
303
  position: 'absolute',
309
- top: 10,
310
- bottom: 20,
311
- left: 30,
312
- right: 40,
304
+ top: 's10',
305
+ bottom: 's20',
306
+ left: 's32',
307
+ right: 's40',
313
308
  zIndex: 100,
314
309
  });
315
310
 
316
311
  expect(result.position).toBe('absolute');
317
312
  expect(result.top).toBe(10);
318
313
  expect(result.bottom).toBe(20);
319
- expect(result.left).toBe(30);
314
+ expect(result.left).toBe(32);
320
315
  expect(result.right).toBe(40);
321
316
  expect(result.zIndex).toBe(100);
322
317
  });
@@ -324,8 +319,8 @@ describe('resolve-style', () => {
324
319
  it('should pass through RTL position props unchanged', () => {
325
320
  const result = resolveViewStyle(mockTheme, {
326
321
  position: 'absolute',
327
- start: 10,
328
- end: 20,
322
+ start: 's10',
323
+ end: 's20',
329
324
  });
330
325
 
331
326
  expect(result.position).toBe('absolute');
@@ -440,8 +435,8 @@ describe('resolve-style', () => {
440
435
  expect(result.color).toBe(mockTheme.colors.text.muted);
441
436
  });
442
437
 
443
- it('should resolve typography typo', () => {
444
- const result = resolveTextStyle(mockTheme, { typo: 'body1' });
438
+ it('should resolve typography typography', () => {
439
+ const result = resolveTextStyle(mockTheme, { typography: 'body1' });
445
440
 
446
441
  expect(result.fontSize).toBe(mockTheme.typographies.body1.fontSize);
447
442
  expect(result.fontWeight).toBe(mockTheme.typographies.body1.fontWeight);
@@ -456,7 +451,7 @@ describe('resolve-style', () => {
456
451
  color: 'active',
457
452
  marginTop: 's8',
458
453
  padding: 's4',
459
- typo: 'heading1',
454
+ typography: 'heading1',
460
455
  });
461
456
 
462
457
  expect(result.color).toBe(mockTheme.colors.text.active);
@@ -471,7 +466,7 @@ describe('resolve-style', () => {
471
466
  );
472
467
  });
473
468
 
474
- it('should handle text without typo', () => {
469
+ it('should handle text without typography', () => {
475
470
  const result = resolveTextStyle(mockTheme, {
476
471
  color: 'base',
477
472
  padding: 's8',
@@ -509,7 +504,7 @@ describe('resolve-style', () => {
509
504
  it('should combine all text style props', () => {
510
505
  const result = resolveTextStyle(mockTheme, {
511
506
  color: 'active',
512
- typo: 'body1',
507
+ typography: 'body1',
513
508
  textAlign: 'center',
514
509
  textTransform: 'uppercase',
515
510
  textDecorationLine: 'underline',
@@ -522,127 +517,4 @@ describe('resolve-style', () => {
522
517
  expect(result.textDecorationLine).toBe('underline');
523
518
  });
524
519
  });
525
-
526
- describe('extractLumenViewStyleProps', () => {
527
- it('should extract spacing props from mixed props', () => {
528
- const props = {
529
- padding: 's16',
530
- marginTop: 's8',
531
- customProp: 'test-value',
532
- callback: () => 'result',
533
- } as const;
534
-
535
- const { lumenStyle, rest } = extractLumenViewStyleProps(props);
536
-
537
- expect(lumenStyle.padding).toBe('s16');
538
- expect(lumenStyle.marginTop).toBe('s8');
539
- expect(rest).toEqual({
540
- customProp: 'test-value',
541
- callback: expect.any(Function),
542
- });
543
- });
544
-
545
- it('should extract all style props', () => {
546
- const props = {
547
- padding: 's16',
548
- width: 's192',
549
- backgroundColor: 'surface',
550
- borderColor: 'muted',
551
- borderRadius: 'md',
552
- boxShadow: 'sm',
553
- flex: 1,
554
- flexDirection: 'row',
555
- customProp: 'test',
556
- } as const;
557
-
558
- const { lumenStyle, rest } = extractLumenViewStyleProps(props);
559
-
560
- expect(lumenStyle).toEqual({
561
- padding: 's16',
562
- width: 's192',
563
- backgroundColor: 'surface',
564
- borderColor: 'muted',
565
- borderRadius: 'md',
566
- boxShadow: 'sm',
567
- flex: 1,
568
- flexDirection: 'row',
569
- });
570
- expect(rest).toEqual({ customProp: 'test' });
571
- });
572
-
573
- it('should handle empty props', () => {
574
- const { lumenStyle, rest } = extractLumenViewStyleProps({});
575
-
576
- expect(lumenStyle).toEqual({});
577
- expect(rest).toEqual({});
578
- });
579
-
580
- it('should handle props with no style props', () => {
581
- const props = {
582
- customProp: 'test',
583
- anotherProp: true,
584
- padding: undefined,
585
- };
586
-
587
- const { lumenStyle, rest } = extractLumenViewStyleProps(props);
588
-
589
- expect(lumenStyle).toEqual({ padding: undefined });
590
- expect(rest).toEqual({
591
- customProp: 'test',
592
- anotherProp: true,
593
- });
594
- });
595
- });
596
-
597
- describe('extractLumenTextStyleProps', () => {
598
- it('should extract color prop in addition to view style props', () => {
599
- const props = {
600
- color: 'muted',
601
- padding: 's8',
602
- customProp: 'test-text',
603
- } as const;
604
-
605
- const { lumenStyle, rest } = extractLumenTextStyleProps(props);
606
-
607
- expect(lumenStyle.color).toBe('muted');
608
- expect(lumenStyle.padding).toBe('s8');
609
- expect(rest).toEqual({ customProp: 'test-text' });
610
- });
611
-
612
- it('should extract typo prop', () => {
613
- const props = {
614
- typo: 'body1',
615
- color: 'muted',
616
- customProp: 'test',
617
- } as const;
618
-
619
- const { lumenStyle, rest } = extractLumenTextStyleProps(props);
620
-
621
- expect(lumenStyle.typo).toBe('body1');
622
- expect(lumenStyle.color).toBe('muted');
623
- expect(rest).toEqual({ customProp: 'test' });
624
- });
625
-
626
- it('should extract all text style props', () => {
627
- const props = {
628
- typo: 'heading1',
629
- color: 'active',
630
- padding: 's16',
631
- marginTop: 's8',
632
- backgroundColor: 'surface',
633
- customProp: 2,
634
- } as const;
635
-
636
- const { lumenStyle, rest } = extractLumenTextStyleProps(props);
637
-
638
- expect(lumenStyle).toEqual({
639
- typo: 'heading1',
640
- color: 'active',
641
- padding: 's16',
642
- marginTop: 's8',
643
- backgroundColor: 'surface',
644
- });
645
- expect(rest).toEqual({ customProp: 2 });
646
- });
647
- });
648
520
  });
@@ -1,16 +1,11 @@
1
1
  import { getObjectPath } from '@ledgerhq/lumen-utils-shared';
2
- import type { ViewStyle, TextStyle, ViewProps, TextProps } from 'react-native';
2
+ import type { ViewStyle, TextStyle } from 'react-native';
3
3
  import type {
4
4
  LumenStyleSheetTheme,
5
- LumenTextStyleProps,
6
- LumenViewStyleProps,
5
+ LumenTextStyle,
6
+ LumenViewStyle,
7
7
  } from '../types';
8
- import {
9
- VIEW_PROP_CONFIG,
10
- TEXT_PROP_CONFIG,
11
- LUMEN_VIEW_STYLE_PROPS,
12
- LUMEN_TEXT_STYLE_PROPS,
13
- } from './resolveConfig';
8
+ import { VIEW_PROP_CONFIG, TEXT_PROP_CONFIG } from './resolveConfig';
14
9
 
15
10
  /**
16
11
  * Unified style resolver
@@ -18,7 +13,7 @@ import {
18
13
  */
19
14
  const resolveStyle = <T extends ViewStyle | TextStyle>(
20
15
  theme: LumenStyleSheetTheme,
21
- lumenStyle: LumenViewStyleProps | LumenTextStyleProps,
16
+ lumenStyle: LumenViewStyle | LumenTextStyle,
22
17
  config: typeof VIEW_PROP_CONFIG | typeof TEXT_PROP_CONFIG,
23
18
  ): T => {
24
19
  const resolved: Record<string, unknown> = {};
@@ -39,7 +34,7 @@ const resolveStyle = <T extends ViewStyle | TextStyle>(
39
34
  value as string,
40
35
  ]);
41
36
 
42
- // Spread props (like typo) merge into resolved styles
37
+ // Spread props (like typography) merge into resolved styles
43
38
  if (propConfig.spread && resolvedValue) {
44
39
  Object.assign(resolved, resolvedValue);
45
40
  } else {
@@ -51,62 +46,17 @@ const resolveStyle = <T extends ViewStyle | TextStyle>(
51
46
  };
52
47
 
53
48
  /**
54
- * Resolve LumenViewStyleProps to React Native ViewStyle
49
+ * Transform lx props to StyleSheet style object for View
55
50
  */
56
51
  export const resolveViewStyle = (
57
52
  theme: LumenStyleSheetTheme,
58
- lumenStyle: LumenViewStyleProps,
53
+ lumenStyle: LumenViewStyle,
59
54
  ): ViewStyle => resolveStyle<ViewStyle>(theme, lumenStyle, VIEW_PROP_CONFIG);
60
55
 
61
56
  /**
62
- * Resolve LumenTextStyleProps to React Native TextStyle
57
+ * Transform lx props to StyleSheet style object for Text
63
58
  */
64
59
  export const resolveTextStyle = (
65
60
  theme: LumenStyleSheetTheme,
66
- lumenStyle: LumenTextStyleProps,
61
+ lumenStyle: LumenTextStyle,
67
62
  ): TextStyle => resolveStyle<TextStyle>(theme, lumenStyle, TEXT_PROP_CONFIG);
68
-
69
- /**
70
- * Unified style props extractor
71
- * Loops only through input props with O(1) Set lookup
72
- */
73
- const extractStyleProps = <
74
- StyleProps,
75
- RestProps,
76
- ReturnType = {
77
- lumenStyle: StyleProps;
78
- rest: RestProps;
79
- },
80
- >(
81
- props: Record<string, unknown>,
82
- stylePropsSet: Set<string>,
83
- ): ReturnType => {
84
- const lumenStyle: Record<string, unknown> = {};
85
- const rest: Record<string, unknown> = {};
86
-
87
- for (const key of Object.keys(props)) {
88
- if (stylePropsSet.has(key)) {
89
- lumenStyle[key] = props[key];
90
- } else {
91
- rest[key] = props[key];
92
- }
93
- }
94
-
95
- return { lumenStyle, rest } as ReturnType;
96
- };
97
-
98
- /**
99
- * Extract styled view props from component props
100
- */
101
- export const extractLumenViewStyleProps = (
102
- props: LumenViewStyleProps,
103
- ): { lumenStyle: LumenViewStyleProps; rest: ViewProps } =>
104
- extractStyleProps(props as Record<string, unknown>, LUMEN_VIEW_STYLE_PROPS);
105
-
106
- /**
107
- * Extract styled text props from component props
108
- */
109
- export const extractLumenTextStyleProps = (
110
- props: LumenTextStyleProps,
111
- ): { lumenStyle: LumenTextStyleProps; rest: TextProps } =>
112
- extractStyleProps(props as Record<string, unknown>, LUMEN_TEXT_STYLE_PROPS);
@@ -8,7 +8,7 @@ type FlatLumensValues = {
8
8
  [propName in AllAvailableKeys]?: AllAvailableStyles[propName];
9
9
  };
10
10
 
11
- type LumensValues = FlatLumensValues;
11
+ type LumensValues = FlatLumensValues | FlatLumensValues[];
12
12
 
13
13
  export type LumenStyleSheet = {
14
14
  [styleName: string]: