@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,61 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, memo } from 'react';
3
+ import { StyleSheet } from 'react-native';
4
+ import { useTheme } from '../Provider/useTheme';
5
+ import { resolveViewStyle } from '../resolveStyle/resolveStyle';
6
+ import { areLxPropsEqual } from './areLxPropsEqual';
7
+ /**
8
+ * Check if any style item (including nested arrays) is a function
9
+ */
10
+ const hasStyleFunction = (style) => {
11
+ if (Array.isArray(style)) {
12
+ return style.some((s) => hasStyleFunction(s));
13
+ }
14
+ return typeof style === 'function';
15
+ };
16
+ /**
17
+ * Resolve all style functions in a style tree
18
+ */
19
+ const resolveStyleFunctions = (style, state) => {
20
+ if (Array.isArray(style)) {
21
+ return style.map((s) => resolveStyleFunctions(s, state));
22
+ }
23
+ return typeof style === 'function' ? style(state) : style;
24
+ };
25
+ /**
26
+ * Factory function to create a styled Pressable component.
27
+ *
28
+ * Supports `style` as an object, function, or array of objects/functions (including nested).
29
+ *
30
+ * ```tsx
31
+ * // Create a styled Pressable
32
+ * const Pressable = createStyledPressable(RNPressable);
33
+ *
34
+ * // Usage with array of styles
35
+ * <Pressable style={[props.style, ({ pressed }) => ({ opacity: pressed ? 0.8 : 1 })]} />
36
+ * ```
37
+ */
38
+ export const createStyledPressable = (Component) => {
39
+ const StyledComponent = memo(forwardRef(({ lx = {}, style, ...props }, ref) => {
40
+ const { theme } = useTheme();
41
+ const resolvedLxStyle = resolveViewStyle(theme, lx);
42
+ if (!hasStyleFunction(style)) {
43
+ const finalStyle = StyleSheet.flatten([
44
+ resolvedLxStyle,
45
+ style,
46
+ ]);
47
+ return _jsx(Component, { ref: ref, ...props, style: finalStyle });
48
+ }
49
+ const mergedStyle = (state) => {
50
+ const resolvedStyle = resolveStyleFunctions(style, state);
51
+ return StyleSheet.flatten([resolvedLxStyle, resolvedStyle]);
52
+ };
53
+ return _jsx(Component, { ref: ref, ...props, style: mergedStyle });
54
+ }), areLxPropsEqual);
55
+ // Set display name for debugging
56
+ const componentName = Component.displayName ||
57
+ Component.name ||
58
+ 'Component';
59
+ StyledComponent.displayName = `StyledPressable(${componentName})`;
60
+ return StyledComponent;
61
+ };
@@ -1,35 +1,24 @@
1
- import React, { MemoExoticComponent } from 'react';
2
- import type { Text } from 'react-native';
3
- import type { LumenTextProps } from '../types';
4
- type TextRef = React.ElementRef<typeof Text>;
5
- type ReturnComponentType = MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithoutRef<LumenTextProps> & React.RefAttributes<TextRef>>>;
1
+ import React from 'react';
2
+ import type { Text, TextProps } from 'react-native';
3
+ import type { LumenStyleSheetTheme, LumenTextStyleLX } from '../types';
4
+ export type StyledTextProps = LumenTextStyleLX & TextProps & {
5
+ /**
6
+ * Typography preset
7
+ */
8
+ typography?: keyof LumenStyleSheetTheme['typographies'];
9
+ };
6
10
  /**
7
11
  * Factory function to create a styled Text component.
8
12
  *
9
- * Creates a component that accepts token-constrained style props directly,
10
- * plus a `typo` prop for typography presets, resolving them to actual
11
- * values at runtime using the current theme.
12
- *
13
- * @param Component - The base Text-like component to wrap
14
- *
15
- * @example
16
13
  * ```tsx
17
- * import { Text } from 'react-native';
18
- * import { createStyledText } from '@ledgerhq/lumen-ui-rnative/styles';
19
- *
20
14
  * // Create a basic Text
21
15
  * const StyledText = createStyledText(Text);
22
- *
23
- * // Usage - token props and typo are resolved
24
- * <StyledText typo='body1'>Hello World</StyledText>
25
- * <StyledText typo='heading2SemiBold' marginTop='s8' color='muted'>
26
- * Subtitle
27
- * </StyledText>
28
- *
29
- * // style prop for escape hatch
30
- * <StyledText typo='body1' style={{ letterSpacing: 2 }} />
31
16
  * ```
32
17
  */
33
- export declare const createStyledText: (Component: React.ComponentType<LumenTextProps>) => ReturnComponentType;
34
- export {};
18
+ export declare const createStyledText: (Component: typeof Text) => React.MemoExoticComponent<React.ForwardRefExoticComponent<LumenTextStyleLX & TextProps & {
19
+ /**
20
+ * Typography preset
21
+ */
22
+ typography?: keyof LumenStyleSheetTheme["typographies"];
23
+ } & React.RefAttributes<Text>>>;
35
24
  //# sourceMappingURL=createStyledText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledText.d.ts","sourceRoot":"","sources":["../../../../src/styles/factories/createStyledText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAM/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AAC7C,KAAK,mBAAmB,GAAG,mBAAmB,CAC5C,KAAK,CAAC,yBAAyB,CAC7B,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CACrE,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAC7C,mBA8BF,CAAC"}
1
+ {"version":3,"file":"createStyledText.d.ts","sourceRoot":"","sources":["../../../../src/styles/factories/createStyledText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAG/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIvE,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAC5C,SAAS,GAAG;IACV;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,oBAAoB,CAAC,cAAc,CAAC,CAAC;CACzD,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,OAAO,IAAI;IAdnD;;OAEG;iBACU,MAAM,oBAAoB,CAAC,cAAc,CAAC;+BAyC1D,CAAC"}
@@ -1,45 +1,29 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, memo } from 'react';
3
+ import { StyleSheet } from 'react-native';
3
4
  import { useTheme } from '../Provider/useTheme';
4
- import { resolveTextStyle, extractLumenTextStyleProps, } from '../resolveStyle/resolveStyle';
5
+ import { resolveTextStyle } from '../resolveStyle/resolveStyle';
6
+ import { areLxPropsEqual } from './areLxPropsEqual';
5
7
  /**
6
8
  * Factory function to create a styled Text component.
7
9
  *
8
- * Creates a component that accepts token-constrained style props directly,
9
- * plus a `typo` prop for typography presets, resolving them to actual
10
- * values at runtime using the current theme.
11
- *
12
- * @param Component - The base Text-like component to wrap
13
- *
14
- * @example
15
10
  * ```tsx
16
- * import { Text } from 'react-native';
17
- * import { createStyledText } from '@ledgerhq/lumen-ui-rnative/styles';
18
- *
19
11
  * // Create a basic Text
20
12
  * const StyledText = createStyledText(Text);
21
- *
22
- * // Usage - token props and typo are resolved
23
- * <StyledText typo='body1'>Hello World</StyledText>
24
- * <StyledText typo='heading2SemiBold' marginTop='s8' color='muted'>
25
- * Subtitle
26
- * </StyledText>
27
- *
28
- * // style prop for escape hatch
29
- * <StyledText typo='body1' style={{ letterSpacing: 2 }} />
30
13
  * ```
31
14
  */
32
15
  export const createStyledText = (Component) => {
33
- const StyledComponent = memo(forwardRef((props, ref) => {
16
+ const StyledComponent = memo(forwardRef(({ typography = 'body3', lx = {}, style, ...props }, ref) => {
34
17
  const { theme } = useTheme();
35
- const { lumenStyle, rest } = extractLumenTextStyleProps(props);
36
- const resolvedStyle = resolveTextStyle(theme, lumenStyle);
37
- const { style: propsStyle, ...componentProps } = rest;
38
- const finalStyle = propsStyle
39
- ? [resolvedStyle, propsStyle]
40
- : resolvedStyle;
41
- return (_jsx(Component, { ...{ ...componentProps, ref, style: finalStyle } }));
42
- }));
18
+ const resolvedStyle = resolveTextStyle(theme, lx);
19
+ const resolvedTypographyStyles = theme.typographies[typography];
20
+ const finalStyle = StyleSheet.flatten([
21
+ resolvedStyle,
22
+ resolvedTypographyStyles,
23
+ style,
24
+ ]);
25
+ return _jsx(Component, { ref: ref, ...props, style: finalStyle });
26
+ }), areLxPropsEqual);
43
27
  // Set display name for debugging
44
28
  const componentName = Component.displayName ||
45
29
  Component.name ||
@@ -1,34 +1,14 @@
1
- import React, { MemoExoticComponent } from 'react';
2
- import type { View } from 'react-native';
3
- import type { LumenViewProps } from '../types';
4
- type ViewRef = React.ElementRef<typeof View>;
5
- type ReturnComponentType = MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithoutRef<LumenViewProps> & React.RefAttributes<ViewRef>>>;
1
+ import React from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import type { LumenViewStyleLX } from '../types';
4
+ export type StyledViewProps = LumenViewStyleLX & ViewProps;
6
5
  /**
7
6
  * Factory function to create a styled View component.
8
7
  *
9
- * Creates a component that accepts token-constrained style props directly,
10
- * resolving them to actual values at runtime using the current theme.
11
- *
12
- * @param Component - The base View-like component to wrap
13
- *
14
- * @example
15
8
  * ```tsx
16
- * import { View } from 'react-native';
17
- * import { createStyledView } from '@ledgerhq/lumen-ui-rnative/styles';
18
- *
19
- * // Create a basic Box
20
- * const Box = createStyledView(View);
21
- *
22
- * // Usage - token props are resolved to actual values
23
- * <Box width='s400' marginTop='s4' gap='s12' alignItems='center' />
24
- * <Box padding='s16' backgroundColor='surface' borderRadius='md'>
25
- * Content
26
- * </Box>
27
- *
28
- * // style prop for escape hatch
29
- * <Box marginTop='s4' style={{ width: 127 }} />
9
+ * // Create a basic View
10
+ * const StyledView = createStyledView(View);
30
11
  * ```
31
12
  */
32
- export declare const createStyledView: (Component: React.ComponentType<LumenViewProps>) => ReturnComponentType;
33
- export {};
13
+ export declare const createStyledView: (Component: typeof View) => React.MemoExoticComponent<React.ForwardRefExoticComponent<LumenViewStyleLX & ViewProps & React.RefAttributes<View>>>;
34
14
  //# sourceMappingURL=createStyledView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledView.d.ts","sourceRoot":"","sources":["../../../../src/styles/factories/createStyledView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAM/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AAC7C,KAAK,mBAAmB,GAAG,mBAAmB,CAC5C,KAAK,CAAC,yBAAyB,CAC7B,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CACrE,CACF,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAC7C,mBA+BF,CAAC"}
1
+ {"version":3,"file":"createStyledView.d.ts","sourceRoot":"","sources":["../../../../src/styles/factories/createStyledView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAc,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIjD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,OAAO,IAAI,yHAsBtD,CAAC"}
@@ -1,44 +1,24 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, memo } from 'react';
3
+ import { StyleSheet } from 'react-native';
3
4
  import { useTheme } from '../Provider/useTheme';
4
- import { resolveViewStyle, extractLumenViewStyleProps, } from '../resolveStyle/resolveStyle';
5
+ import { resolveViewStyle } from '../resolveStyle/resolveStyle';
6
+ import { areLxPropsEqual } from './areLxPropsEqual';
5
7
  /**
6
8
  * Factory function to create a styled View component.
7
9
  *
8
- * Creates a component that accepts token-constrained style props directly,
9
- * resolving them to actual values at runtime using the current theme.
10
- *
11
- * @param Component - The base View-like component to wrap
12
- *
13
- * @example
14
10
  * ```tsx
15
- * import { View } from 'react-native';
16
- * import { createStyledView } from '@ledgerhq/lumen-ui-rnative/styles';
17
- *
18
- * // Create a basic Box
19
- * const Box = createStyledView(View);
20
- *
21
- * // Usage - token props are resolved to actual values
22
- * <Box width='s400' marginTop='s4' gap='s12' alignItems='center' />
23
- * <Box padding='s16' backgroundColor='surface' borderRadius='md'>
24
- * Content
25
- * </Box>
26
- *
27
- * // style prop for escape hatch
28
- * <Box marginTop='s4' style={{ width: 127 }} />
11
+ * // Create a basic View
12
+ * const StyledView = createStyledView(View);
29
13
  * ```
30
14
  */
31
15
  export const createStyledView = (Component) => {
32
- const StyledComponent = memo(forwardRef((props, ref) => {
16
+ const StyledComponent = memo(forwardRef(({ lx = {}, style, ...props }, ref) => {
33
17
  const { theme } = useTheme();
34
- const { lumenStyle, rest } = extractLumenViewStyleProps(props);
35
- const resolvedStyle = resolveViewStyle(theme, lumenStyle);
36
- const { style: propsStyle, ...componentProps } = rest;
37
- const style = propsStyle
38
- ? [resolvedStyle, propsStyle]
39
- : resolvedStyle;
40
- return (_jsx(Component, { ...{ ...componentProps, ref, style } }));
41
- }));
18
+ const resolvedStyle = resolveViewStyle(theme, lx);
19
+ const finalStyle = StyleSheet.flatten([resolvedStyle, style]);
20
+ return _jsx(Component, { ref: ref, ...props, style: finalStyle });
21
+ }), areLxPropsEqual);
42
22
  // Set display name for debugging
43
23
  const componentName = Component.displayName ||
44
24
  Component.name ||
@@ -0,0 +1,4 @@
1
+ export * from './createStyledPressable';
2
+ export * from './createStyledText';
3
+ export * from './createStyledView';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/styles/factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './createStyledPressable';
2
+ export * from './createStyledText';
3
+ export * from './createStyledView';
@@ -1,7 +1,6 @@
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';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,SAAS,CAAC;AACxB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -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,8 +1,8 @@
1
- import { LumenTextStyleProps, LumenViewStyleProps } from '../types';
1
+ import { LumenTextStyle, LumenViewStyle } from '../types';
2
2
  /**
3
3
  * Configuration for each style prop
4
4
  * - path: Theme path for token lookup (array of keys)
5
- * - spread: true for props that spread into multiple style properties (typo)
5
+ * - spread: true for props that spread into multiple style properties (typography)
6
6
  * - No path = passthrough prop (value passed as-is)
7
7
  */
8
8
  export type PropConfig = {
@@ -12,17 +12,17 @@ export type PropConfig = {
12
12
  /**
13
13
  * View style props configuration
14
14
  */
15
- export declare const VIEW_PROP_CONFIG: Record<keyof LumenViewStyleProps, PropConfig>;
15
+ export declare const VIEW_PROP_CONFIG: Record<keyof LumenViewStyle, PropConfig>;
16
16
  /**
17
- * Text style props configuration (extends view props + color + typo)
17
+ * Text style props configuration (extends view props + color + typography)
18
18
  */
19
- export declare const TEXT_PROP_CONFIG: Record<keyof LumenTextStyleProps, PropConfig>;
19
+ export declare const TEXT_PROP_CONFIG: Record<keyof LumenTextStyle, PropConfig>;
20
20
  /**
21
21
  * Set for O(1) view prop lookup
22
22
  */
23
- export declare const LUMEN_VIEW_STYLE_PROPS: Set<keyof LumenViewStyleProps>;
23
+ export declare const LUMEN_VIEW_STYLE_PROPS: Set<keyof LumenViewStyle>;
24
24
  /**
25
25
  * Set for O(1) text prop lookup
26
26
  */
27
- export declare const LUMEN_TEXT_STYLE_PROPS: Set<keyof LumenTextStyleProps>;
27
+ export declare const LUMEN_TEXT_STYLE_PROPS: Set<keyof LumenTextStyle>;
28
28
  //# sourceMappingURL=resolveConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveConfig.d.ts","sourceRoot":"","sources":["../../../../src/styles/resolveStyle/resolveConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,mBAAmB,EAAE,UAAU,CAwFjE,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,mBAAmB,EAAE,UAAU,CAOjE,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAE9B,GAAG,CAAC,MAAM,mBAAmB,CAAC,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAE9B,GAAG,CAAC,MAAM,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"resolveConfig.d.ts","sourceRoot":"","sources":["../../../../src/styles/resolveStyle/resolveConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,cAAc,EAAE,UAAU,CAyF5D,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,cAAc,EAAE,UAAU,CAO5D,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAE9B,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAE9B,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC"}
@@ -24,6 +24,13 @@ export const VIEW_PROP_CONFIG = {
24
24
  gap: { path: ['spacings'] },
25
25
  rowGap: { path: ['spacings'] },
26
26
  columnGap: { path: ['spacings'] },
27
+ position: {},
28
+ top: { path: ['spacings'] },
29
+ bottom: { path: ['spacings'] },
30
+ left: { path: ['spacings'] },
31
+ right: { path: ['spacings'] },
32
+ start: { path: ['spacings'] },
33
+ end: { path: ['spacings'] },
27
34
  // Size props
28
35
  width: { path: ['sizes'] },
29
36
  height: { path: ['sizes'] },
@@ -68,13 +75,6 @@ export const VIEW_PROP_CONFIG = {
68
75
  flexGrow: {},
69
76
  flexShrink: {},
70
77
  flexBasis: {},
71
- position: {},
72
- top: {},
73
- bottom: {},
74
- left: {},
75
- right: {},
76
- start: {},
77
- end: {},
78
78
  zIndex: {},
79
79
  overflow: {},
80
80
  display: {},
@@ -84,12 +84,12 @@ export const VIEW_PROP_CONFIG = {
84
84
  transform: {},
85
85
  };
86
86
  /**
87
- * Text style props configuration (extends view props + color + typo)
87
+ * Text style props configuration (extends view props + color + typography)
88
88
  */
89
89
  export const TEXT_PROP_CONFIG = {
90
90
  ...VIEW_PROP_CONFIG,
91
91
  color: { path: ['colors', 'text'] },
92
- typo: { path: ['typographies'], spread: true },
92
+ typography: { path: ['typographies'], spread: true },
93
93
  textAlign: {},
94
94
  textTransform: {},
95
95
  textDecorationLine: {},
@@ -1,25 +1,11 @@
1
- import type { ViewStyle, TextStyle, ViewProps, TextProps } from 'react-native';
2
- import type { LumenStyleSheetTheme, LumenTextStyleProps, LumenViewStyleProps } from '../types';
1
+ import type { ViewStyle, TextStyle } from 'react-native';
2
+ import type { LumenStyleSheetTheme, LumenTextStyle, LumenViewStyle } from '../types';
3
3
  /**
4
- * Resolve LumenViewStyleProps to React Native ViewStyle
4
+ * Transform lx props to StyleSheet style object for View
5
5
  */
6
- export declare const resolveViewStyle: (theme: LumenStyleSheetTheme, lumenStyle: LumenViewStyleProps) => ViewStyle;
6
+ export declare const resolveViewStyle: (theme: LumenStyleSheetTheme, lumenStyle: LumenViewStyle) => ViewStyle;
7
7
  /**
8
- * Resolve LumenTextStyleProps to React Native TextStyle
8
+ * Transform lx props to StyleSheet style object for Text
9
9
  */
10
- export declare const resolveTextStyle: (theme: LumenStyleSheetTheme, lumenStyle: LumenTextStyleProps) => TextStyle;
11
- /**
12
- * Extract styled view props from component props
13
- */
14
- export declare const extractLumenViewStyleProps: (props: LumenViewStyleProps) => {
15
- lumenStyle: LumenViewStyleProps;
16
- rest: ViewProps;
17
- };
18
- /**
19
- * Extract styled text props from component props
20
- */
21
- export declare const extractLumenTextStyleProps: (props: LumenTextStyleProps) => {
22
- lumenStyle: LumenTextStyleProps;
23
- rest: TextProps;
24
- };
10
+ export declare const resolveTextStyle: (theme: LumenStyleSheetTheme, lumenStyle: LumenTextStyle) => TextStyle;
25
11
  //# sourceMappingURL=resolveStyle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveStyle.d.ts","sourceRoot":"","sources":["../../../../src/styles/resolveStyle/resolveStyle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AA8ClB;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,oBAAoB,EAC3B,YAAY,mBAAmB,KAC9B,SAAyE,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,oBAAoB,EAC3B,YAAY,mBAAmB,KAC9B,SAAyE,CAAC;AA+B7E;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,mBAAmB,KACzB;IAAE,UAAU,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CACwB,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,mBAAmB,KACzB;IAAE,UAAU,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CACwB,CAAC"}
1
+ {"version":3,"file":"resolveStyle.d.ts","sourceRoot":"","sources":["../../../../src/styles/resolveStyle/resolveStyle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAyClB;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,oBAAoB,EAC3B,YAAY,cAAc,KACzB,SAAyE,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,oBAAoB,EAC3B,YAAY,cAAc,KACzB,SAAyE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { getObjectPath } from '@ledgerhq/lumen-utils-shared';
2
- import { VIEW_PROP_CONFIG, TEXT_PROP_CONFIG, LUMEN_VIEW_STYLE_PROPS, LUMEN_TEXT_STYLE_PROPS, } from './resolveConfig';
2
+ import { VIEW_PROP_CONFIG, TEXT_PROP_CONFIG } from './resolveConfig';
3
3
  /**
4
4
  * Unified style resolver
5
5
  * Config-driven: single loop resolves all props via provided config
@@ -20,7 +20,7 @@ const resolveStyle = (theme, lumenStyle, config) => {
20
20
  ...propConfig.path,
21
21
  value,
22
22
  ]);
23
- // Spread props (like typo) merge into resolved styles
23
+ // Spread props (like typography) merge into resolved styles
24
24
  if (propConfig.spread && resolvedValue) {
25
25
  Object.assign(resolved, resolvedValue);
26
26
  }
@@ -31,35 +31,10 @@ const resolveStyle = (theme, lumenStyle, config) => {
31
31
  return resolved;
32
32
  };
33
33
  /**
34
- * Resolve LumenViewStyleProps to React Native ViewStyle
34
+ * Transform lx props to StyleSheet style object for View
35
35
  */
36
36
  export const resolveViewStyle = (theme, lumenStyle) => resolveStyle(theme, lumenStyle, VIEW_PROP_CONFIG);
37
37
  /**
38
- * Resolve LumenTextStyleProps to React Native TextStyle
38
+ * Transform lx props to StyleSheet style object for Text
39
39
  */
40
40
  export const resolveTextStyle = (theme, lumenStyle) => resolveStyle(theme, lumenStyle, TEXT_PROP_CONFIG);
41
- /**
42
- * Unified style props extractor
43
- * Loops only through input props with O(1) Set lookup
44
- */
45
- const extractStyleProps = (props, stylePropsSet) => {
46
- const lumenStyle = {};
47
- const rest = {};
48
- for (const key of Object.keys(props)) {
49
- if (stylePropsSet.has(key)) {
50
- lumenStyle[key] = props[key];
51
- }
52
- else {
53
- rest[key] = props[key];
54
- }
55
- }
56
- return { lumenStyle, rest };
57
- };
58
- /**
59
- * Extract styled view props from component props
60
- */
61
- export const extractLumenViewStyleProps = (props) => extractStyleProps(props, LUMEN_VIEW_STYLE_PROPS);
62
- /**
63
- * Extract styled text props from component props
64
- */
65
- export const extractLumenTextStyleProps = (props) => extractStyleProps(props, LUMEN_TEXT_STYLE_PROPS);
@@ -5,7 +5,7 @@ type AllAvailableKeys = keyof (ViewStyle & TextStyle & ImageStyle);
5
5
  type FlatLumensValues = {
6
6
  [propName in AllAvailableKeys]?: AllAvailableStyles[propName];
7
7
  };
8
- type LumensValues = FlatLumensValues;
8
+ type LumensValues = FlatLumensValues | FlatLumensValues[];
9
9
  export type LumenStyleSheet = {
10
10
  [styleName: string]: LumensValues | ((...args: any) => LumensValues);
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/styles/types/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAC7D,KAAK,gBAAgB,GAAG,MAAM,CAAC,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEnE,KAAK,gBAAgB,GAAG;KACrB,QAAQ,IAAI,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;CAC9D,CAAC;AAEF,KAAK,YAAY,GAAG,gBAAgB,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,SAAS,EAAE,MAAM,GACd,YAAY,GAEZ,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,YAAY,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,eAAe,IACzD,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,CAAC,CAAC,GACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/styles/types/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAC7D,KAAK,gBAAgB,GAAG,MAAM,CAAC,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEnE,KAAK,gBAAgB,GAAG;KACrB,QAAQ,IAAI,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;CAC9D,CAAC;AAEF,KAAK,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,SAAS,EAAE,MAAM,GACd,YAAY,GAEZ,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,YAAY,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,eAAe,IACzD,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,CAAC,CAAC,GACpC,CAAC,CAAC"}