@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
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { View, Text } from 'react-native';
2
+ import { LUMEN_VIEW_STYLE_PROPS } from '../../../styles/resolveStyle/resolveConfig';
3
3
  import { Settings, PenEdit, DeleteCircleFill, MoreVertical, } from '../../Symbols';
4
+ import { Box, Text } from '../Utility';
4
5
  import { InteractiveIcon } from './InteractiveIcon';
5
6
  const meta = {
6
7
  component: InteractiveIcon,
@@ -13,6 +14,9 @@ const meta = {
13
14
  type: 'code',
14
15
  },
15
16
  },
17
+ controls: {
18
+ exclude: Array.from(LUMEN_VIEW_STYLE_PROPS),
19
+ },
16
20
  },
17
21
  argTypes: {
18
22
  children: {
@@ -27,17 +31,17 @@ const meta = {
27
31
  },
28
32
  };
29
33
  export default meta;
30
- export const Filled = {
34
+ export const Base = {
31
35
  args: {
32
36
  iconType: 'filled',
33
37
  children: _jsx(DeleteCircleFill, {}),
34
- 'aria-label': 'Delete',
38
+ accessibilityLabel: 'Delete',
35
39
  },
36
40
  parameters: {
37
41
  docs: {
38
42
  source: {
39
43
  code: `
40
- <InteractiveIcon iconType="filled" aria-label="Delete">
44
+ <InteractiveIcon iconType="filled" accessibilityLabel="Delete">
41
45
  <DeleteCircleFill />
42
46
  </InteractiveIcon>
43
47
  `,
@@ -49,13 +53,13 @@ export const Stroked = {
49
53
  args: {
50
54
  iconType: 'stroked',
51
55
  children: _jsx(MoreVertical, {}),
52
- 'aria-label': 'More actions',
56
+ accessibilityLabel: 'More actions',
53
57
  },
54
58
  parameters: {
55
59
  docs: {
56
60
  source: {
57
61
  code: `
58
- <InteractiveIcon iconType="stroked" aria-label="More actions">
62
+ <InteractiveIcon iconType="stroked" accessibilityLabel="More actions">
59
63
  <MoreVertical />
60
64
  </InteractiveIcon>
61
65
  `,
@@ -65,17 +69,26 @@ export const Stroked = {
65
69
  };
66
70
  export const IconTypeShowcase = {
67
71
  render: () => {
68
- return (_jsxs(View, { className: 'flex flex-row gap-16 p-8', children: [_jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Filled" }), _jsx(InteractiveIcon, { iconType: 'filled', "aria-label": 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Stroked" }), _jsx(InteractiveIcon, { iconType: 'stroked', "aria-label": 'More actions', children: _jsx(MoreVertical, {}) })] })] }));
72
+ return (_jsxs(Box, { lx: { flexDirection: 'row', gap: 's16', padding: 's8' }, children: [_jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', children: _jsx(MoreVertical, {}) })] })] }));
69
73
  },
70
74
  };
71
75
  export const SizesShowcase = {
72
76
  render: () => {
73
77
  const iconSizes = [16, 20, 24, 40];
74
- return (_jsx(View, { className: 'flex flex-col gap-16 p-8', children: iconSizes.map((size) => (_jsxs(View, { className: 'flex flex-row gap-16', children: [_jsx(View, { className: 'flex w-72 items-center justify-center', children: _jsx(InteractiveIcon, { iconType: 'stroked', "aria-label": 'More', children: _jsx(MoreVertical, { size: size }) }, size) }), _jsxs(Text, { className: 'body-3', children: [size, "px"] })] }, size))) }));
78
+ return (_jsx(Box, { lx: { flexDirection: 'row', gap: 's12', padding: 's8' }, children: iconSizes.map((size) => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16' }, children: [_jsx(Box, { lx: {
79
+ width: 's72',
80
+ alignItems: 'center',
81
+ justifyContent: 'center',
82
+ }, children: _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More', children: _jsx(DeleteCircleFill, { size: size }) }, size) }), _jsxs(Text, { lx: { textAlign: 'center' }, typography: 'body3', children: [size, "px"] })] }, size))) }));
75
83
  },
76
84
  };
77
85
  export const StatesShowcase = {
78
86
  render: () => {
79
- return (_jsxs(View, { className: 'flex flex-row gap-16 bg-base p-8', children: [_jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Filled enabled" }), _jsx(InteractiveIcon, { iconType: 'filled', "aria-label": 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Stroked enabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', "aria-label": 'More actions', children: _jsx(MoreVertical, {}) })] }), _jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Filled disabled" }), _jsx(InteractiveIcon, { iconType: 'filled', "aria-label": 'Delete', disabled: true, children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(View, { className: 'flex flex-col items-center gap-4', children: [_jsx(Text, { className: 'text-muted body-3', children: "Stroked disabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', "aria-label": 'More actions', disabled: true, children: _jsx(MoreVertical, {}) })] })] }));
87
+ return (_jsxs(Box, { lx: {
88
+ flexDirection: 'row',
89
+ gap: 's16',
90
+ backgroundColor: 'base',
91
+ padding: 's8',
92
+ }, children: [_jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled enabled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked enabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', children: _jsx(MoreVertical, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled disabled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', disabled: true, children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked disabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', disabled: true, children: _jsx(MoreVertical, {}) })] })] }));
80
93
  },
81
94
  };
@@ -1,14 +1,10 @@
1
- import { ReactNode } from 'react';
2
- import { PressableProps } from 'react-native';
1
+ import { PropsWithChildren } from 'react';
2
+ import { StyledPressableProps } from '../../../styles';
3
3
  export type InteractiveIconProps = {
4
4
  /**
5
5
  * The visual style of the icon button.
6
6
  * Choose 'filled' for icons with solid backgrounds or 'stroked' for outlined icons.
7
7
  */
8
8
  iconType: 'filled' | 'stroked';
9
- /**
10
- * The icon component to display inside the button. Should be a single icon element from the design system.
11
- */
12
- children: ReactNode;
13
- } & PressableProps;
9
+ } & PropsWithChildren & Omit<StyledPressableProps, 'children'>;
14
10
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,GAAG,iBAAiB,GACnB,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC"}
@@ -1,48 +1,6 @@
1
1
  import React from 'react';
2
- import { PressableProps, View } from 'react-native';
2
+ import { View } from 'react-native';
3
3
  import { IconSize } from '../Icon';
4
- export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
5
- /**
6
- * The visual style of the link.
7
- * @default base
8
- */
9
- appearance?: 'base' | 'accent';
10
- /**
11
- * The size variant of the link.
12
- * @default md
13
- */
14
- size?: 'sm' | 'md';
15
- /**
16
- * Whether to underline the link text.
17
- * @default true
18
- */
19
- underline?: boolean;
20
- /**
21
- * An optional icon component to render inside the link.
22
- * The icon styles are defined by the link. Please do not override them.
23
- */
24
- icon?: React.ComponentType<{
25
- size?: IconSize;
26
- className?: string;
27
- }>;
28
- /**
29
- * If true, displays an external link icon next to the link text.
30
- * @default false
31
- */
32
- isExternal?: boolean;
33
- /**
34
- * The URL to navigate to
35
- */
36
- href?: string;
37
- /**
38
- * Custom press handler (overrides default href navigation)
39
- */
40
- onPress?: () => void;
41
- /**
42
- * The link's content, typically text.
43
- */
44
- children: React.ReactNode;
45
- };
46
4
  /**
47
5
  * A customizable link component that supports base and accent color appearances, optional underline, sizes, icons, and external link handling.
48
6
  * Opens URLs using React Native's Linking API.
@@ -50,7 +8,7 @@ export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
50
8
  * @see {@link https://ldls.vercel.app/?path=/docs/components-link-overview--docs Storybook}
51
9
  * @see {@link https://ldls.vercel.app/?path=/docs/components-link-implementation--docs#dos-and-donts Guidelines}
52
10
  *
53
- * @warning The `className` prop should only be used for layout adjustments like margins or positioning.
11
+ * @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
54
12
  * Do not use it to modify the link's core appearance (colors, padding, etc). Use the `appearance` and `underline` props instead.
55
13
  *
56
14
  * @example
@@ -78,46 +36,18 @@ export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
78
36
  * Dashboard
79
37
  * </Link>
80
38
  */
81
- export declare const Link: React.ForwardRefExoticComponent<Omit<PressableProps, "children" | "onPress"> & {
82
- /**
83
- * The visual style of the link.
84
- * @default base
85
- */
39
+ export declare const Link: React.ForwardRefExoticComponent<{
86
40
  appearance?: "base" | "accent";
87
- /**
88
- * The size variant of the link.
89
- * @default md
90
- */
91
41
  size?: "sm" | "md";
92
- /**
93
- * Whether to underline the link text.
94
- * @default true
95
- */
96
42
  underline?: boolean;
97
- /**
98
- * An optional icon component to render inside the link.
99
- * The icon styles are defined by the link. Please do not override them.
100
- */
101
43
  icon?: React.ComponentType<{
102
44
  size?: IconSize;
103
- className?: string;
45
+ style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
104
46
  }>;
105
- /**
106
- * If true, displays an external link icon next to the link text.
107
- * @default false
108
- */
109
47
  isExternal?: boolean;
110
- /**
111
- * The URL to navigate to
112
- */
113
48
  href?: string;
114
- /**
115
- * Custom press handler (overrides default href navigation)
116
- */
117
49
  onPress?: () => void;
118
- /**
119
- * The link's content, typically text.
120
- */
121
- children: React.ReactNode;
122
- } & React.RefAttributes<View>>;
50
+ } & {
51
+ children?: React.ReactNode | undefined;
52
+ } & Omit<import("../../../styles").StyledPressableProps, "children" | "onPress"> & React.RefAttributes<View>>;
123
53
  //# sourceMappingURL=Link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,cAAc,EAAQ,IAAI,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAmDnC,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IACrE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,IAAI;IA1Ef;;;OAGG;iBACU,MAAM,GAAG,QAAQ;IAC9B;;;OAGG;WACI,IAAI,GAAG,IAAI;IAClB;;;OAGG;gBACS,OAAO;IACnB;;;OAGG;WACI,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE;;;OAGG;iBACU,OAAO;IACpB;;OAEG;WACI,MAAM;IACb;;OAEG;cACO,MAAM,IAAI;IACpB;;OAEG;cACO,KAAK,CAAC,SAAS;8BAuI1B,CAAC"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,IAAI,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,IAAI;;;;;YAhFI,CAAC;aACd,CAAA;;;;;;;6GAmIP,CAAC"}
@@ -1,57 +1,51 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '@ledgerhq/lumen-utils-shared';
3
- import { cva } from 'class-variance-authority';
4
2
  import React from 'react';
5
- import { Linking, Pressable, Text, View } from 'react-native';
3
+ import { Linking, Text, View } from 'react-native';
4
+ import { LumenStyleSheet, mergeStyles } from '../../../styles';
6
5
  import { ExternalLink } from '../../Symbols';
7
- const linkTextVariants = cva('', {
8
- variants: {
9
- appearance: {
10
- base: '',
11
- accent: '',
12
- },
13
- underline: {
14
- true: 'underline underline-offset-2',
15
- false: '',
16
- },
17
- size: {
18
- sm: 'body-2-semi-bold',
19
- md: 'body-1-semi-bold',
20
- },
21
- pressed: {
22
- true: '',
23
- false: '',
24
- },
25
- },
26
- compoundVariants: [
27
- {
28
- appearance: 'base',
29
- pressed: false,
30
- className: 'text-base',
31
- },
32
- {
33
- appearance: 'base',
34
- pressed: true,
35
- className: 'text-base-pressed',
36
- },
37
- {
38
- appearance: 'accent',
39
- pressed: false,
40
- className: 'text-interactive',
41
- },
42
- {
43
- appearance: 'accent',
44
- pressed: true,
45
- className: 'text-interactive-pressed',
46
- },
47
- ],
48
- defaultVariants: {
49
- appearance: 'base',
50
- size: 'md',
51
- underline: true,
52
- pressed: false,
53
- },
54
- });
6
+ import { Pressable } from '../Utility';
7
+ const iconSizeMap = {
8
+ sm: 16,
9
+ md: 20,
10
+ };
11
+ const useStyles = ({ appearance, size, underline, pressed }) => {
12
+ return LumenStyleSheet.useCreate((t) => {
13
+ const textColors = {
14
+ base: t.colors.text.base,
15
+ accent: t.colors.text.interactive,
16
+ };
17
+ const pressedTextColors = {
18
+ base: t.colors.text.basePressed,
19
+ accent: t.colors.text.interactivePressed,
20
+ };
21
+ const typography = size === 'sm'
22
+ ? t.typographies.body2SemiBold
23
+ : t.typographies.body1SemiBold;
24
+ const gap = size === 'sm' ? t.spacings.s4 : t.spacings.s8;
25
+ return {
26
+ container: {
27
+ flexDirection: 'row',
28
+ alignItems: 'center',
29
+ gap,
30
+ },
31
+ textWrapper: {
32
+ flexShrink: 1,
33
+ },
34
+ text: mergeStyles(typography, {
35
+ color: pressed
36
+ ? pressedTextColors[appearance]
37
+ : textColors[appearance],
38
+ textDecorationLine: underline ? 'underline' : 'none',
39
+ }),
40
+ icon: {
41
+ flexShrink: 0,
42
+ color: pressed
43
+ ? pressedTextColors[appearance]
44
+ : textColors[appearance],
45
+ },
46
+ };
47
+ }, [appearance, size, underline, pressed]);
48
+ };
55
49
  /**
56
50
  * A customizable link component that supports base and accent color appearances, optional underline, sizes, icons, and external link handling.
57
51
  * Opens URLs using React Native's Linking API.
@@ -59,7 +53,7 @@ const linkTextVariants = cva('', {
59
53
  * @see {@link https://ldls.vercel.app/?path=/docs/components-link-overview--docs Storybook}
60
54
  * @see {@link https://ldls.vercel.app/?path=/docs/components-link-implementation--docs#dos-and-donts Guidelines}
61
55
  *
62
- * @warning The `className` prop should only be used for layout adjustments like margins or positioning.
56
+ * @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
63
57
  * Do not use it to modify the link's core appearance (colors, padding, etc). Use the `appearance` and `underline` props instead.
64
58
  *
65
59
  * @example
@@ -87,13 +81,7 @@ const linkTextVariants = cva('', {
87
81
  * Dashboard
88
82
  * </Link>
89
83
  */
90
- export const Link = React.forwardRef(({ className, children, appearance, size, underline = true, icon, isExternal = false, href, onPress, ...props }, ref) => {
91
- const iconSizeMap = {
92
- sm: 16,
93
- md: 20,
94
- };
95
- const calculatedIconSize = size ? iconSizeMap[size] : 20;
96
- const IconComponent = icon;
84
+ export const Link = React.forwardRef(({ lx, style, children, appearance = 'base', size = 'md', underline = true, icon, isExternal = false, href, onPress, ...props }, ref) => {
97
85
  const handlePress = async () => {
98
86
  if (onPress) {
99
87
  onPress();
@@ -102,21 +90,17 @@ export const Link = React.forwardRef(({ className, children, appearance, size, u
102
90
  await Linking.openURL(href);
103
91
  }
104
92
  };
105
- return (_jsx(Pressable, { ref: ref, className: cn('shrink', className), onPress: handlePress, accessibilityRole: 'link', ...props, children: ({ pressed }) => (_jsxs(View, { className: cn('flex-row items-center gap-8', size === 'sm' && 'gap-4'), children: [IconComponent && (_jsx(IconComponent, { className: cn('flex-shrink-0', linkTextVariants({
106
- appearance,
107
- size,
108
- underline,
109
- pressed,
110
- })), size: calculatedIconSize })), _jsx(View, { className: 'shrink', children: _jsx(Text, { numberOfLines: 1, className: linkTextVariants({
111
- appearance,
112
- size,
113
- underline,
114
- pressed,
115
- }), children: children }) }), isExternal && (_jsx(ExternalLink, { size: calculatedIconSize, className: cn('flex-shrink-0', linkTextVariants({
116
- appearance,
117
- size,
118
- underline,
119
- pressed,
120
- })), accessible: false }))] })) }));
93
+ return (_jsx(Pressable, { ref: ref, lx: lx, style: [style, { flexShrink: 1 }], onPress: handlePress, accessibilityRole: 'link', ...props, children: ({ pressed }) => (_jsx(LinkContent, { appearance: appearance, size: size, underline: underline, pressed: pressed, icon: icon, isExternal: isExternal, children: children })) }));
121
94
  });
95
+ const LinkContent = ({ appearance, size, underline, pressed, icon, isExternal, children, }) => {
96
+ const calculatedIconSize = iconSizeMap[size];
97
+ const IconComponent = icon;
98
+ const styles = useStyles({
99
+ appearance,
100
+ size,
101
+ underline,
102
+ pressed,
103
+ });
104
+ return (_jsxs(View, { style: styles.container, testID: 'link-content', children: [IconComponent && (_jsx(IconComponent, { size: calculatedIconSize, style: styles.icon })), _jsx(View, { style: styles.textWrapper, children: _jsx(Text, { style: styles.text, numberOfLines: 1, children: children }) }), isExternal && (_jsx(ExternalLink, { size: calculatedIconSize, style: styles.icon, accessible: false }))] }));
105
+ };
122
106
  Link.displayName = 'Link';
@@ -1 +1 @@
1
- {"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA+C3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA0BlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA6C3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAW5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAoB9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAyDlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA2EzB,CAAC"}
1
+ {"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA+C3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA0BlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA2D3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KA8B9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAyDlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA2EzB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { View, Text } from 'react-native';
3
2
  import { Settings, Information, ArrowRight } from '../../Symbols';
3
+ import { Box, Text } from '../Utility';
4
4
  import { Link } from './Link';
5
5
  const meta = {
6
6
  component: Link,
@@ -149,20 +149,43 @@ export const AppearanceShowcase = {
149
149
  { name: 'Base', appearance: 'base' },
150
150
  { name: 'Accent', appearance: 'accent' },
151
151
  ];
152
- return (_jsx(View, { className: 'flex-row gap-32 p-8', children: appearances.map(({ name, appearance }) => (_jsx(Link, { size: 'md', appearance: appearance, href: 'https://ledger.com', icon: Information, isExternal: true, children: name }, appearance))) }));
152
+ return (_jsx(Box, { lx: { flexDirection: 'row', gap: 's32', padding: 's8' }, children: appearances.map(({ name, appearance }) => (_jsx(Link, { size: 'md', appearance: appearance, href: 'https://ledger.com', icon: Information, isExternal: true, children: name }, appearance))) }));
153
153
  },
154
154
  };
155
155
  export const UnderlineShowcase = {
156
- render: () => (_jsxs(View, { className: 'flex-col gap-16 p-8', children: [_jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', children: "With underline" }), _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com', children: "Without underline" })] })),
156
+ render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16', padding: 's8' }, children: [_jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', children: "With underline" }), _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com', children: "Without underline" })] })),
157
157
  };
158
158
  export const SizesShowcase = {
159
- render: () => (_jsxs(View, { className: 'flex-col gap-16', children: [_jsxs(View, { className: 'flex-row items-center gap-32 p-8', children: [_jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small" }), _jsx(Link, { appearance: 'base', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium" })] }), _jsxs(View, { className: 'flex-row items-center gap-32 p-8', children: [_jsx(Link, { appearance: 'accent', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small Accent" }), _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium Accent" })] })] })),
159
+ render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16' }, children: [_jsxs(Box, { lx: {
160
+ flexDirection: 'row',
161
+ alignItems: 'center',
162
+ gap: 's32',
163
+ padding: 's8',
164
+ }, children: [_jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small" }), _jsx(Link, { appearance: 'base', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium" })] }), _jsxs(Box, { lx: {
165
+ flexDirection: 'row',
166
+ alignItems: 'center',
167
+ gap: 's32',
168
+ padding: 's8',
169
+ }, children: [_jsx(Link, { appearance: 'accent', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small Accent" }), _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium Accent" })] })] })),
160
170
  };
161
171
  export const StatesShowcase = {
162
- render: () => (_jsxs(View, { className: 'flex-row items-center gap-16 p-8', children: [_jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "Default" }), _jsx(Link, { appearance: 'accent', href: 'https://ledger.com', icon: ArrowRight, children: "With Icon" })] })),
172
+ render: () => (_jsxs(Box, { lx: {
173
+ flexDirection: 'row',
174
+ alignItems: 'center',
175
+ gap: 's16',
176
+ padding: 's8',
177
+ }, children: [_jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "Default" }), _jsx(Link, { appearance: 'accent', href: 'https://ledger.com', icon: ArrowRight, children: "With Icon" })] })),
163
178
  };
164
179
  export const ResponsiveLayout = {
165
- render: () => (_jsxs(View, { className: 'w-256 flex-col gap-8 rounded-sm bg-muted p-8', children: [_jsx(Link, { underline: true, href: 'https://ledger.com', children: "Short Link" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "This is a longer link text that will be truncated with ellipsis when it exceeds the container width" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Base with long text that is cut off" })] })),
180
+ render: () => (_jsxs(Box, { lx: {
181
+ width: 's256',
182
+ flexDirection: 'column',
183
+ gap: 's8',
184
+ borderRadius: 'sm',
185
+ borderColor: 'mutedSubtle',
186
+ borderWidth: 's1',
187
+ padding: 's8',
188
+ }, children: [_jsx(Link, { underline: true, href: 'https://ledger.com', children: "Short Link" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "This is a longer link text that will be truncated with ellipsis when it exceeds the container width" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Base with long text that is cut off" })] })),
166
189
  };
167
190
  export const WithCustomNavigation = {
168
191
  render: () => {
@@ -170,7 +193,7 @@ export const WithCustomNavigation = {
170
193
  console.log('Custom navigation triggered');
171
194
  // In a real app: navigation.navigate('Dashboard')
172
195
  };
173
- return (_jsxs(View, { className: 'flex-col gap-16 p-8', children: [_jsx(Link, { appearance: 'base', size: 'md', onPress: handlePress, children: "Navigate to Dashboard" }), _jsx(Link, { appearance: 'accent', size: 'md', icon: ArrowRight, onPress: handlePress, children: "Continue to Next Screen" })] }));
196
+ return (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16', padding: 's8' }, children: [_jsx(Link, { appearance: 'base', size: 'md', onPress: handlePress, children: "Navigate to Dashboard" }), _jsx(Link, { appearance: 'accent', size: 'md', icon: ArrowRight, onPress: handlePress, children: "Continue to Next Screen" })] }));
174
197
  },
175
198
  parameters: {
176
199
  docs: {
@@ -208,13 +231,13 @@ function MyComponent() {
208
231
  },
209
232
  };
210
233
  export const InTextUsage = {
211
- render: () => (_jsxs(View, { className: 'flex-col gap-32 p-8', children: [_jsxs(Text, { className: 'text-base body-2', children: ["By continuing, you agree to our", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/terms', children: "Terms & Conditions" }), ' ', "and", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/privacy', children: "Privacy Policy" }), "."] }), _jsxs(Text, { className: 'text-interactive body-1-semi-bold', children: ["Need help?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com/support', children: "Contact Support" })] }), _jsxs(Text, { className: 'text-base body-1-semi-bold', children: ["Already have an account?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com/signin', children: "Sign in" })] })] })),
234
+ render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's32', padding: 's8' }, children: [_jsxs(Text, { typography: 'body2', lx: { color: 'base' }, children: ["By continuing, you agree to our", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/terms', children: "Terms & Conditions" }), ' ', "and", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/privacy', children: "Privacy Policy" }), "."] }), _jsxs(Text, { typography: 'body1SemiBold', lx: { color: 'interactive' }, children: ["Need help?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com/support', children: "Contact Support" })] }), _jsxs(Text, { typography: 'body1SemiBold', lx: { color: 'base' }, children: ["Already have an account?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com/signin', children: "Sign in" })] })] })),
212
235
  parameters: {
213
236
  docs: {
214
237
  source: {
215
238
  code: `
216
239
  // Links within text content
217
- <Text className='text-base body-2'>
240
+ <Text typography='body2' lx={{ color: 'base' }}>
218
241
  By continuing, you agree to our{' '}
219
242
  <Link appearance='base' size='sm' href='https://ledger.com/terms'>
220
243
  Terms & Conditions
@@ -226,7 +249,7 @@ export const InTextUsage = {
226
249
  </Text>
227
250
 
228
251
  // Heading with inline link
229
- <Text className='text-interactive body-1-semi-bold'>
252
+ <Text typography='body1SemiBold' lx={{ color: 'interactive' }}>
230
253
  Need help?{' '}
231
254
  <Link appearance='accent' size='md' href='https://ledger.com/support'>
232
255
  Contact Support
@@ -234,7 +257,7 @@ export const InTextUsage = {
234
257
  </Text>
235
258
 
236
259
  // Bold text with ununderlined link
237
- <Text className='text-base body-1-semi-bold'>
260
+ <Text typography='body1SemiBold' lx={{ color: 'base' }}>
238
261
  Already have an account?{' '}
239
262
  <Link
240
263
  appearance='accent'
@@ -1,2 +1,3 @@
1
1
  export * from './Link';
2
+ export * from './types';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './Link';
2
+ export * from './types';
@@ -0,0 +1,43 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { StyledPressableProps } from '../../../styles';
4
+ import { IconSize } from '../Icon';
5
+ export type LinkProps = {
6
+ /**
7
+ * The visual style of the link.
8
+ * @default base
9
+ */
10
+ appearance?: 'base' | 'accent';
11
+ /**
12
+ * The size variant of the link.
13
+ * @default md
14
+ */
15
+ size?: 'sm' | 'md';
16
+ /**
17
+ * Whether to underline the link text.
18
+ * @default true
19
+ */
20
+ underline?: boolean;
21
+ /**
22
+ * An optional icon component to render inside the link.
23
+ * The icon styles are defined by the link. Please do not override them.
24
+ */
25
+ icon?: React.ComponentType<{
26
+ size?: IconSize;
27
+ style?: StyleProp<ViewStyle>;
28
+ }>;
29
+ /**
30
+ * If true, displays an external link icon next to the link text.
31
+ * @default false
32
+ */
33
+ isExternal?: boolean;
34
+ /**
35
+ * The URL to navigate to
36
+ */
37
+ href?: string;
38
+ /**
39
+ * Custom press handler (overrides default href navigation)
40
+ */
41
+ onPress?: () => void;
42
+ } & PropsWithChildren & Omit<StyledPressableProps, 'onPress' | 'children'>;
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B,CAAC,CAAC;IACH;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,iBAAiB,GACnB,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -3,5 +3,10 @@ import { Search } from './Search';
3
3
  declare const meta: Meta<typeof Search>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Search>;
6
- export declare const WebPreviewWarning: Story;
6
+ export declare const Base: Story;
7
+ export declare const WithContent: Story;
8
+ export declare const WithError: Story;
9
+ export declare const DisabledSearch: Story;
10
+ export declare const WithHiddenClearButton: Story;
11
+ export declare const WithClearCallback: Story;
7
12
  //# sourceMappingURL=Search.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Search/Search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAY7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC"}
1
+ {"version":3,"file":"Search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Search/Search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AAEpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA8B7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAmBrC,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAOnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAa/B,CAAC"}