@ledgerhq/lumen-ui-rnative 0.1.57 → 0.1.59

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 (348) hide show
  1. package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js +9 -0
  2. package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js.map +1 -1
  3. package/dist/module/lib/Components/animations/Spin/Spin.stories.js +3 -0
  4. package/dist/module/lib/Components/animations/Spin/Spin.stories.js.map +1 -1
  5. package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js +4 -0
  6. package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js.map +1 -1
  7. package/dist/module/lib/Components/core/AddressInput/AddressInput.js +18 -6
  8. package/dist/module/lib/Components/core/AddressInput/AddressInput.js.map +1 -1
  9. package/dist/module/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
  10. package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js +30 -0
  11. package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js.map +1 -1
  12. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js +6 -0
  13. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js.map +1 -1
  14. package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js +64 -44
  15. package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js.map +1 -1
  16. package/dist/module/lib/Components/core/Banner/Banner.stories.js.map +1 -1
  17. package/dist/module/lib/Components/core/Button/Button.stories.js +21 -0
  18. package/dist/module/lib/Components/core/Button/Button.stories.js.map +1 -1
  19. package/dist/module/lib/Components/core/Card/Card.figma.js +17 -1
  20. package/dist/module/lib/Components/core/Card/Card.figma.js.map +1 -1
  21. package/dist/module/lib/Components/core/Card/Card.js +36 -24
  22. package/dist/module/lib/Components/core/Card/Card.js.map +1 -1
  23. package/dist/module/lib/Components/core/Card/Card.mdx +10 -1
  24. package/dist/module/lib/Components/core/Card/Card.stories.js +78 -2
  25. package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
  26. package/dist/module/lib/Components/core/Card/Card.test.js +31 -3
  27. package/dist/module/lib/Components/core/Card/Card.test.js.map +1 -1
  28. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js +15 -0
  29. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js.map +1 -1
  30. package/dist/module/lib/Components/core/Checkbox/Checkbox.stories.js.map +1 -1
  31. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +13 -0
  32. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
  33. package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js +11 -0
  34. package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js.map +1 -1
  35. package/dist/module/lib/Components/core/Divider/Divider.stories.js.map +1 -1
  36. package/dist/module/lib/Components/core/IconButton/IconButton.stories.js +10 -0
  37. package/dist/module/lib/Components/core/IconButton/IconButton.stories.js.map +1 -1
  38. package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js +12 -0
  39. package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
  40. package/dist/module/lib/Components/core/Link/Link.stories.js.map +1 -1
  41. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +21 -3
  42. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
  43. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js +18 -1
  44. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js.map +1 -1
  45. package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js +9 -0
  46. package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js.map +1 -1
  47. package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js +13 -0
  48. package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js.map +1 -1
  49. package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js +13 -0
  50. package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js.map +1 -1
  51. package/dist/module/lib/Components/core/NavBar/NavBar.stories.js.map +1 -1
  52. package/dist/module/lib/Components/core/OptionList/OptionList.stories.js +52 -0
  53. package/dist/module/lib/Components/core/OptionList/OptionList.stories.js.map +1 -1
  54. package/dist/module/lib/Components/core/SearchInput/SearchInput.stories.js.map +1 -1
  55. package/dist/module/lib/Components/core/SectionHeader/SectionHeader.stories.js.map +1 -1
  56. package/dist/module/lib/Components/core/Skeleton/Skeleton.stories.js.map +1 -1
  57. package/dist/module/lib/Components/core/Spinner/Spinner.stories.js.map +1 -1
  58. package/dist/module/lib/Components/core/Spot/Spot.stories.js +20 -0
  59. package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
  60. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js +4 -0
  61. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js.map +1 -1
  62. package/dist/module/lib/Components/core/Subheader/Subheader.stories.js.map +1 -1
  63. package/dist/module/lib/Components/core/Switch/Switch.stories.js.map +1 -1
  64. package/dist/module/lib/Components/core/Tag/Tag.stories.js +12 -0
  65. package/dist/module/lib/Components/core/Tag/Tag.stories.js.map +1 -1
  66. package/dist/module/lib/Components/core/TextInput/TextInput.figma.js +4 -0
  67. package/dist/module/lib/Components/core/TextInput/TextInput.figma.js.map +1 -1
  68. package/dist/module/lib/Components/core/TextInput/TextInput.mdx +25 -0
  69. package/dist/module/lib/Components/core/TextInput/TextInput.stories.js +29 -0
  70. package/dist/module/lib/Components/core/TextInput/TextInput.stories.js.map +1 -1
  71. package/dist/module/lib/Components/core/TextInput/TextInput.test.js +125 -2
  72. package/dist/module/lib/Components/core/TextInput/TextInput.test.js.map +1 -1
  73. package/dist/module/lib/Components/core/Tile/Tile.stories.js +23 -1
  74. package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
  75. package/dist/module/lib/Components/core/TileButton/TileButton.stories.js +24 -0
  76. package/dist/module/lib/Components/core/TileButton/TileButton.stories.js.map +1 -1
  77. package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js +12 -0
  78. package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js.map +1 -1
  79. package/dist/module/lib/Components/core/Trend/Trend.js +1 -2
  80. package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
  81. package/dist/module/lib/Components/core/Trend/Trend.stories.js +9 -0
  82. package/dist/module/lib/Components/core/Trend/Trend.stories.js.map +1 -1
  83. package/dist/module/lib/Components/core/Trend/Trend.test.js +5 -5
  84. package/dist/module/lib/Components/core/Trend/Trend.test.js.map +1 -1
  85. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +114 -201
  86. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
  87. package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js +32 -0
  88. package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js.map +1 -0
  89. package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js +60 -0
  90. package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js.map +1 -0
  91. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js +126 -0
  92. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js.map +1 -0
  93. package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js +34 -0
  94. package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js.map +1 -0
  95. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js +46 -0
  96. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js.map +1 -0
  97. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js +111 -0
  98. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js.map +1 -0
  99. package/dist/module/lib/Components/primitives/Box/Box.stories.js.map +1 -1
  100. package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js +14 -0
  101. package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
  102. package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js +8 -0
  103. package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
  104. package/dist/module/lib/Components/primitives/Pressable/Pressable.stories.js.map +1 -1
  105. package/dist/module/lib/Components/primitives/Text/Text.stories.js.map +1 -1
  106. package/dist/module/lib/Components/symbols/Icon/Icon.stories.js.map +1 -1
  107. package/dist/module/lib/Components/symbols/icons/CalendarRefresh.js +50 -0
  108. package/dist/module/lib/Components/symbols/icons/CalendarRefresh.js.map +1 -0
  109. package/dist/module/lib/Components/symbols/icons/CodeShield.js +50 -0
  110. package/dist/module/lib/Components/symbols/icons/CodeShield.js.map +1 -0
  111. package/dist/module/lib/Components/symbols/icons/CoinStacked.js +50 -0
  112. package/dist/module/lib/Components/symbols/icons/CoinStacked.js.map +1 -0
  113. package/dist/module/lib/Components/symbols/icons/Craft.js +50 -0
  114. package/dist/module/lib/Components/symbols/icons/Craft.js.map +1 -0
  115. package/dist/module/lib/Components/symbols/icons/Equal.js +49 -0
  116. package/dist/module/lib/Components/symbols/icons/Equal.js.map +1 -0
  117. package/dist/module/lib/Components/symbols/icons/File.js +50 -0
  118. package/dist/module/lib/Components/symbols/icons/File.js.map +1 -0
  119. package/dist/module/lib/Components/symbols/icons/FileShield.js +50 -0
  120. package/dist/module/lib/Components/symbols/icons/FileShield.js.map +1 -0
  121. package/dist/module/lib/Components/symbols/icons/Fire.js +51 -0
  122. package/dist/module/lib/Components/symbols/icons/Fire.js.map +1 -0
  123. package/dist/module/lib/Components/symbols/icons/Handshake.js +50 -0
  124. package/dist/module/lib/Components/symbols/icons/Handshake.js.map +1 -0
  125. package/dist/module/lib/Components/symbols/icons/MailShield.js +50 -0
  126. package/dist/module/lib/Components/symbols/icons/MailShield.js.map +1 -0
  127. package/dist/module/lib/Components/symbols/icons/Merge.js +50 -0
  128. package/dist/module/lib/Components/symbols/icons/Merge.js.map +1 -0
  129. package/dist/module/lib/Components/symbols/icons/Minimize.js +50 -0
  130. package/dist/module/lib/Components/symbols/icons/Minimize.js.map +1 -0
  131. package/dist/module/lib/Components/symbols/icons/Nested.js +50 -0
  132. package/dist/module/lib/Components/symbols/icons/Nested.js.map +1 -0
  133. package/dist/module/lib/Components/symbols/icons/NotEqual.js +49 -0
  134. package/dist/module/lib/Components/symbols/icons/NotEqual.js.map +1 -0
  135. package/dist/module/lib/Components/symbols/icons/PeopleShield.js +50 -0
  136. package/dist/module/lib/Components/symbols/icons/PeopleShield.js.map +1 -0
  137. package/dist/module/lib/Components/symbols/icons/Pin.js +50 -0
  138. package/dist/module/lib/Components/symbols/icons/Pin.js.map +1 -0
  139. package/dist/module/lib/Components/symbols/icons/PinFill.js +47 -0
  140. package/dist/module/lib/Components/symbols/icons/PinFill.js.map +1 -0
  141. package/dist/module/lib/Components/symbols/icons/Receive.js +50 -0
  142. package/dist/module/lib/Components/symbols/icons/Receive.js.map +1 -0
  143. package/dist/module/lib/Components/symbols/icons/Retry.js +50 -0
  144. package/dist/module/lib/Components/symbols/icons/Retry.js.map +1 -0
  145. package/dist/module/lib/Components/symbols/icons/Send.js +50 -0
  146. package/dist/module/lib/Components/symbols/icons/Send.js.map +1 -0
  147. package/dist/module/lib/Components/symbols/icons/Servers.js +50 -0
  148. package/dist/module/lib/Components/symbols/icons/Servers.js.map +1 -0
  149. package/dist/module/lib/Components/symbols/icons/SubArrow.js +50 -0
  150. package/dist/module/lib/Components/symbols/icons/SubArrow.js.map +1 -0
  151. package/dist/module/lib/Components/symbols/icons/UsbCircleFill.js +52 -0
  152. package/dist/module/lib/Components/symbols/icons/UsbCircleFill.js.map +1 -0
  153. package/dist/module/lib/Components/symbols/icons/WarningCircleFill.js +47 -0
  154. package/dist/module/lib/Components/symbols/icons/WarningCircleFill.js.map +1 -0
  155. package/dist/module/lib/Components/symbols/index.js +24 -0
  156. package/dist/module/lib/Components/symbols/index.js.map +1 -1
  157. package/dist/module/lib/utils/index.js +0 -1
  158. package/dist/module/lib/utils/index.js.map +1 -1
  159. package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts +1 -1
  160. package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts.map +1 -1
  161. package/dist/typescript/src/lib/Components/core/Card/Card.d.ts +1 -1
  162. package/dist/typescript/src/lib/Components/core/Card/Card.d.ts.map +1 -1
  163. package/dist/typescript/src/lib/Components/core/Card/types.d.ts +6 -0
  164. package/dist/typescript/src/lib/Components/core/Card/types.d.ts.map +1 -1
  165. package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts +1 -1
  166. package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts.map +1 -1
  167. package/dist/typescript/src/lib/Components/core/Trend/Trend.d.ts.map +1 -1
  168. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts +1 -1
  169. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts.map +1 -1
  170. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts +8 -0
  171. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts.map +1 -0
  172. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts +8 -0
  173. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts.map +1 -0
  174. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts +8 -0
  175. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -0
  176. package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts +27 -0
  177. package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts.map +1 -0
  178. package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts +48 -1
  179. package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts.map +1 -1
  180. package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts +27 -0
  181. package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts.map +1 -0
  182. package/dist/typescript/src/lib/Components/symbols/icons/CalendarRefresh.d.ts +35 -0
  183. package/dist/typescript/src/lib/Components/symbols/icons/CalendarRefresh.d.ts.map +1 -0
  184. package/dist/typescript/src/lib/Components/symbols/icons/CodeShield.d.ts +35 -0
  185. package/dist/typescript/src/lib/Components/symbols/icons/CodeShield.d.ts.map +1 -0
  186. package/dist/typescript/src/lib/Components/symbols/icons/CoinStacked.d.ts +35 -0
  187. package/dist/typescript/src/lib/Components/symbols/icons/CoinStacked.d.ts.map +1 -0
  188. package/dist/typescript/src/lib/Components/symbols/icons/Craft.d.ts +35 -0
  189. package/dist/typescript/src/lib/Components/symbols/icons/Craft.d.ts.map +1 -0
  190. package/dist/typescript/src/lib/Components/symbols/icons/Equal.d.ts +35 -0
  191. package/dist/typescript/src/lib/Components/symbols/icons/Equal.d.ts.map +1 -0
  192. package/dist/typescript/src/lib/Components/symbols/icons/File.d.ts +35 -0
  193. package/dist/typescript/src/lib/Components/symbols/icons/File.d.ts.map +1 -0
  194. package/dist/typescript/src/lib/Components/symbols/icons/FileShield.d.ts +35 -0
  195. package/dist/typescript/src/lib/Components/symbols/icons/FileShield.d.ts.map +1 -0
  196. package/dist/typescript/src/lib/Components/symbols/icons/Fire.d.ts +35 -0
  197. package/dist/typescript/src/lib/Components/symbols/icons/Fire.d.ts.map +1 -0
  198. package/dist/typescript/src/lib/Components/symbols/icons/Handshake.d.ts +35 -0
  199. package/dist/typescript/src/lib/Components/symbols/icons/Handshake.d.ts.map +1 -0
  200. package/dist/typescript/src/lib/Components/symbols/icons/MailShield.d.ts +35 -0
  201. package/dist/typescript/src/lib/Components/symbols/icons/MailShield.d.ts.map +1 -0
  202. package/dist/typescript/src/lib/Components/symbols/icons/Merge.d.ts +35 -0
  203. package/dist/typescript/src/lib/Components/symbols/icons/Merge.d.ts.map +1 -0
  204. package/dist/typescript/src/lib/Components/symbols/icons/Minimize.d.ts +35 -0
  205. package/dist/typescript/src/lib/Components/symbols/icons/Minimize.d.ts.map +1 -0
  206. package/dist/typescript/src/lib/Components/symbols/icons/Nested.d.ts +35 -0
  207. package/dist/typescript/src/lib/Components/symbols/icons/Nested.d.ts.map +1 -0
  208. package/dist/typescript/src/lib/Components/symbols/icons/NotEqual.d.ts +35 -0
  209. package/dist/typescript/src/lib/Components/symbols/icons/NotEqual.d.ts.map +1 -0
  210. package/dist/typescript/src/lib/Components/symbols/icons/PeopleShield.d.ts +35 -0
  211. package/dist/typescript/src/lib/Components/symbols/icons/PeopleShield.d.ts.map +1 -0
  212. package/dist/typescript/src/lib/Components/symbols/icons/Pin.d.ts +35 -0
  213. package/dist/typescript/src/lib/Components/symbols/icons/Pin.d.ts.map +1 -0
  214. package/dist/typescript/src/lib/Components/symbols/icons/PinFill.d.ts +35 -0
  215. package/dist/typescript/src/lib/Components/symbols/icons/PinFill.d.ts.map +1 -0
  216. package/dist/typescript/src/lib/Components/symbols/icons/Receive.d.ts +35 -0
  217. package/dist/typescript/src/lib/Components/symbols/icons/Receive.d.ts.map +1 -0
  218. package/dist/typescript/src/lib/Components/symbols/icons/Retry.d.ts +35 -0
  219. package/dist/typescript/src/lib/Components/symbols/icons/Retry.d.ts.map +1 -0
  220. package/dist/typescript/src/lib/Components/symbols/icons/Send.d.ts +35 -0
  221. package/dist/typescript/src/lib/Components/symbols/icons/Send.d.ts.map +1 -0
  222. package/dist/typescript/src/lib/Components/symbols/icons/Servers.d.ts +35 -0
  223. package/dist/typescript/src/lib/Components/symbols/icons/Servers.d.ts.map +1 -0
  224. package/dist/typescript/src/lib/Components/symbols/icons/SubArrow.d.ts +35 -0
  225. package/dist/typescript/src/lib/Components/symbols/icons/SubArrow.d.ts.map +1 -0
  226. package/dist/typescript/src/lib/Components/symbols/icons/UsbCircleFill.d.ts +35 -0
  227. package/dist/typescript/src/lib/Components/symbols/icons/UsbCircleFill.d.ts.map +1 -0
  228. package/dist/typescript/src/lib/Components/symbols/icons/WarningCircleFill.d.ts +35 -0
  229. package/dist/typescript/src/lib/Components/symbols/icons/WarningCircleFill.d.ts.map +1 -0
  230. package/dist/typescript/src/lib/Components/symbols/index.d.ts +24 -0
  231. package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
  232. package/dist/typescript/src/lib/utils/index.d.ts +0 -1
  233. package/dist/typescript/src/lib/utils/index.d.ts.map +1 -1
  234. package/dist/typescript/src/styles/types/create.types.d.ts +1 -3
  235. package/dist/typescript/src/styles/types/create.types.d.ts.map +1 -1
  236. package/package.json +3 -3
  237. package/src/lib/Components/animations/Pulse/Pulse.stories.tsx +7 -2
  238. package/src/lib/Components/animations/Spin/Spin.stories.tsx +5 -2
  239. package/src/lib/Components/core/AddressInput/AddressInput.figma.tsx +4 -0
  240. package/src/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
  241. package/src/lib/Components/core/AddressInput/AddressInput.stories.tsx +30 -2
  242. package/src/lib/Components/core/AddressInput/AddressInput.tsx +24 -8
  243. package/src/lib/Components/core/AmountDisplay/AmountDisplay.stories.tsx +8 -2
  244. package/src/lib/Components/core/AmountInput/AmountInput.stories.tsx +33 -13
  245. package/src/lib/Components/core/Avatar/Avatar.stories.tsx +1 -1
  246. package/src/lib/Components/core/AvatarButton/AvatarButton.stories.tsx +1 -1
  247. package/src/lib/Components/core/Banner/Banner.stories.tsx +2 -2
  248. package/src/lib/Components/core/Button/Button.stories.tsx +23 -2
  249. package/src/lib/Components/core/Card/Card.figma.tsx +20 -0
  250. package/src/lib/Components/core/Card/Card.mdx +10 -1
  251. package/src/lib/Components/core/Card/Card.stories.tsx +63 -2
  252. package/src/lib/Components/core/Card/Card.test.tsx +35 -3
  253. package/src/lib/Components/core/Card/Card.tsx +46 -26
  254. package/src/lib/Components/core/Card/types.ts +7 -0
  255. package/src/lib/Components/core/CardButton/CardButton.stories.tsx +17 -2
  256. package/src/lib/Components/core/Checkbox/Checkbox.stories.tsx +3 -3
  257. package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +15 -2
  258. package/src/lib/Components/core/DescriptionItem/DescriptionItem.stories.tsx +13 -2
  259. package/src/lib/Components/core/Divider/Divider.stories.tsx +2 -2
  260. package/src/lib/Components/core/DotCount/DotCount.stories.tsx +1 -1
  261. package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +1 -1
  262. package/src/lib/Components/core/DotIndicator/DotIndicator.stories.tsx +1 -1
  263. package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +1 -1
  264. package/src/lib/Components/core/IconButton/IconButton.stories.tsx +12 -2
  265. package/src/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.tsx +14 -2
  266. package/src/lib/Components/core/Link/Link.stories.tsx +2 -2
  267. package/src/lib/Components/core/ListItem/ListItem.stories.tsx +18 -0
  268. package/src/lib/Components/core/MediaBanner/MediaBanner.stories.tsx +19 -2
  269. package/src/lib/Components/core/MediaButton/MediaButton.stories.tsx +11 -2
  270. package/src/lib/Components/core/MediaCard/MediaCard.stories.tsx +13 -0
  271. package/src/lib/Components/core/MediaImage/MediaImage.stories.tsx +1 -1
  272. package/src/lib/Components/core/MediaTag/MediaTag.stories.tsx +15 -2
  273. package/src/lib/Components/core/NavBar/NavBar.stories.tsx +2 -2
  274. package/src/lib/Components/core/OptionList/OptionList.stories.tsx +52 -0
  275. package/src/lib/Components/core/PageIndicator/PageIndicator.stories.tsx +1 -1
  276. package/src/lib/Components/core/SearchInput/SearchInput.stories.tsx +2 -2
  277. package/src/lib/Components/core/SearchInput/types.ts +4 -1
  278. package/src/lib/Components/core/SectionHeader/SectionHeader.stories.tsx +2 -2
  279. package/src/lib/Components/core/SegmentedControl/SegmentedControl.stories.tsx +1 -1
  280. package/src/lib/Components/core/Skeleton/Skeleton.stories.tsx +2 -2
  281. package/src/lib/Components/core/Spinner/Spinner.stories.tsx +2 -2
  282. package/src/lib/Components/core/Spot/Spot.stories.tsx +22 -2
  283. package/src/lib/Components/core/Stepper/Stepper.stories.tsx +6 -2
  284. package/src/lib/Components/core/Subheader/Subheader.stories.tsx +2 -2
  285. package/src/lib/Components/core/Switch/Switch.stories.tsx +3 -3
  286. package/src/lib/Components/core/TabBar/TabBar.stories.tsx +1 -1
  287. package/src/lib/Components/core/Tag/Tag.stories.tsx +14 -2
  288. package/src/lib/Components/core/TextInput/TextInput.figma.tsx +4 -0
  289. package/src/lib/Components/core/TextInput/TextInput.mdx +25 -0
  290. package/src/lib/Components/core/TextInput/TextInput.stories.tsx +29 -2
  291. package/src/lib/Components/core/TextInput/TextInput.test.tsx +129 -2
  292. package/src/lib/Components/core/Tile/Tile.stories.tsx +24 -2
  293. package/src/lib/Components/core/TileButton/TileButton.stories.tsx +26 -2
  294. package/src/lib/Components/core/Tooltip/Tooltip.stories.tsx +14 -2
  295. package/src/lib/Components/core/Trend/Trend.stories.tsx +11 -2
  296. package/src/lib/Components/core/Trend/Trend.test.tsx +4 -5
  297. package/src/lib/Components/core/Trend/Trend.tsx +1 -3
  298. package/src/lib/Components/internal/BaseInput/BaseInput.tsx +123 -242
  299. package/src/lib/Components/internal/BaseInput/BaseInputCounter.tsx +35 -0
  300. package/src/lib/Components/internal/BaseInput/BaseInputHelperText.tsx +57 -0
  301. package/src/lib/Components/internal/BaseInput/BaseInputLabel.tsx +137 -0
  302. package/src/lib/Components/internal/BaseInput/multilineLayout.ts +49 -0
  303. package/src/lib/Components/internal/BaseInput/types.ts +49 -1
  304. package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.ts +110 -0
  305. package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.ts +72 -0
  306. package/src/lib/Components/primitives/Box/Box.stories.tsx +2 -2
  307. package/src/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.tsx +6 -2
  308. package/src/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.tsx +5 -2
  309. package/src/lib/Components/primitives/Pressable/Pressable.stories.tsx +2 -2
  310. package/src/lib/Components/primitives/Text/Text.stories.tsx +2 -2
  311. package/src/lib/Components/symbols/Icon/Icon.stories.tsx +2 -2
  312. package/src/lib/Components/symbols/icons/CalendarRefresh.tsx +45 -0
  313. package/src/lib/Components/symbols/icons/CodeShield.tsx +45 -0
  314. package/src/lib/Components/symbols/icons/CoinStacked.tsx +45 -0
  315. package/src/lib/Components/symbols/icons/Craft.tsx +45 -0
  316. package/src/lib/Components/symbols/icons/Equal.tsx +44 -0
  317. package/src/lib/Components/symbols/icons/File.tsx +45 -0
  318. package/src/lib/Components/symbols/icons/FileShield.tsx +45 -0
  319. package/src/lib/Components/symbols/icons/Fire.tsx +46 -0
  320. package/src/lib/Components/symbols/icons/Handshake.tsx +45 -0
  321. package/src/lib/Components/symbols/icons/MailShield.tsx +45 -0
  322. package/src/lib/Components/symbols/icons/Merge.tsx +45 -0
  323. package/src/lib/Components/symbols/icons/Minimize.tsx +45 -0
  324. package/src/lib/Components/symbols/icons/Nested.tsx +45 -0
  325. package/src/lib/Components/symbols/icons/NotEqual.tsx +44 -0
  326. package/src/lib/Components/symbols/icons/PeopleShield.tsx +45 -0
  327. package/src/lib/Components/symbols/icons/Pin.tsx +45 -0
  328. package/src/lib/Components/symbols/icons/PinFill.tsx +42 -0
  329. package/src/lib/Components/symbols/icons/Receive.tsx +45 -0
  330. package/src/lib/Components/symbols/icons/Retry.tsx +45 -0
  331. package/src/lib/Components/symbols/icons/Send.tsx +45 -0
  332. package/src/lib/Components/symbols/icons/Servers.tsx +45 -0
  333. package/src/lib/Components/symbols/icons/SubArrow.tsx +45 -0
  334. package/src/lib/Components/symbols/icons/UsbCircleFill.tsx +48 -0
  335. package/src/lib/Components/symbols/icons/WarningCircleFill.tsx +42 -0
  336. package/src/lib/Components/symbols/index.ts +24 -0
  337. package/src/lib/utils/index.ts +0 -1
  338. package/src/styles/types/create.types.ts +6 -6
  339. package/dist/module/lib/utils/react/extractTextFromChildren.js +0 -23
  340. package/dist/module/lib/utils/react/extractTextFromChildren.js.map +0 -1
  341. package/dist/module/lib/utils/react/index.js +0 -4
  342. package/dist/module/lib/utils/react/index.js.map +0 -1
  343. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts +0 -8
  344. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts.map +0 -1
  345. package/dist/typescript/src/lib/utils/react/index.d.ts +0 -2
  346. package/dist/typescript/src/lib/utils/react/index.d.ts.map +0 -1
  347. package/src/lib/utils/react/extractTextFromChildren.ts +0 -32
  348. package/src/lib/utils/react/index.ts +0 -1
@@ -3,36 +3,20 @@ import {
3
3
  resolveBaseInputPlaceholder,
4
4
  useDisabledContext,
5
5
  } from '@ledgerhq/lumen-utils-shared';
6
- import {
7
- useCallback,
8
- useEffect,
9
- useImperativeHandle,
10
- useRef,
11
- useState,
12
- } from 'react';
13
- import { StyleSheet, Text, TextInput, View } from 'react-native';
14
- import Animated, {
15
- interpolate,
16
- useSharedValue,
17
- useAnimatedStyle,
18
- withTiming,
19
- cancelAnimation,
20
- } from 'react-native-reanimated';
6
+ import { useState } from 'react';
7
+ import { StyleSheet, TextInput, View } from 'react-native';
21
8
  import { useCommonTranslation } from '../../../../i18n';
22
- import type { LumenStyleSheetTheme } from '../../../../styles';
23
9
  import { useStyleSheet, useTheme } from '../../../../styles';
24
10
  import { RuntimeConstants } from '../../../utils';
25
- import { useTimingConfig } from '../../animations/useTimingConfig';
26
11
  import { InteractiveIcon } from '../../core/InteractiveIcon';
27
12
  import { Box, Pressable } from '../../primitives';
28
- import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
29
13
  import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
30
- import { InformationFill } from '../../symbols/icons/InformationFill';
31
- import {
32
- type BaseInputCounterProps,
33
- type BaseInputHelperTextProps,
34
- type BaseInputProps,
35
- } from './types';
14
+ import { BaseInputCounter } from './BaseInputCounter';
15
+ import { BaseInputHelperText } from './BaseInputHelperText';
16
+ import { BaseInputLabel } from './BaseInputLabel';
17
+ import { getMultilineLayout, getMultilineMinHeight } from './multilineLayout';
18
+ import { type BaseInputProps, type BaseInputStatus } from './types';
19
+ import { useBaseInputValue } from './useBaseInputValue/useBaseInputValue';
36
20
 
37
21
  export const BaseInput = ({
38
22
  lx,
@@ -53,6 +37,10 @@ export const BaseInput = ({
53
37
  suffix,
54
38
  ref,
55
39
  placeholder: placeholderProp,
40
+ onClear,
41
+ multiline = false,
42
+ minLines = 1,
43
+ maxLines,
56
44
  ...props
57
45
  }: BaseInputProps) => {
58
46
  const disabled = useDisabledContext({
@@ -61,18 +49,23 @@ export const BaseInput = ({
61
49
  });
62
50
  const { t } = useCommonTranslation();
63
51
  const { theme } = useTheme();
64
- const inputRef = useRef<TextInput>(null);
65
- useImperativeHandle(ref, () => inputRef.current as TextInput);
66
-
67
- const [uncontrolledValue, setUncontrolledValue] = useState(
68
- props.defaultValue || '',
69
- );
70
- const [isFocused, setIsFocused] = useState(false);
71
52
 
72
- const isControlled = props.value !== undefined;
73
- const value = isControlled ? props.value : uncontrolledValue;
53
+ const {
54
+ inputRef,
55
+ composedRef,
56
+ value,
57
+ hasContent,
58
+ handleChangeText,
59
+ handleClear,
60
+ } = useBaseInputValue({
61
+ value: props.value,
62
+ defaultValue: props.defaultValue,
63
+ onChangeText: onChangeTextProp,
64
+ onClear,
65
+ ref,
66
+ });
74
67
 
75
- const hasContent = (value ?? '').length > 0;
68
+ const [isFocused, setIsFocused] = useState(false);
76
69
 
77
70
  const { inputPlaceholder, labelStaysFloatedWithPlaceholder } =
78
71
  resolveBaseInputPlaceholder({
@@ -87,42 +80,19 @@ export const BaseInput = ({
87
80
  const showCount = Boolean(maxCount && maxCount > 0);
88
81
  const showHelper = !!helperText;
89
82
 
90
- const handleChangeText = useCallback(
91
- (text: string) => {
92
- if (!isControlled) {
93
- setUncontrolledValue(text);
94
- }
95
- onChangeTextProp?.(text);
96
- },
97
- [isControlled, onChangeTextProp],
98
- );
99
-
100
- const handleClear = () => {
101
- if (isControlled) {
102
- onChangeTextProp?.('');
103
- } else {
104
- setUncontrolledValue('');
105
- }
106
- props.onClear?.();
107
- };
108
-
109
83
  // Both properties can be used to determine if the input is editable.
110
84
  const isEditable = editable !== false && !readOnly && !disabled;
111
85
 
86
+ const hasLabel = !!label;
87
+
112
88
  const styles = useStyles({
113
89
  status,
114
90
  isFocused,
115
91
  isEditable: !disabled,
116
- hasLabel: !!label,
117
- });
118
-
119
- const floatingLabelStyles = useFloatingLabelStyles({
120
- hasContent,
121
- isFocused,
122
- showClearButton,
123
- status,
124
- isEditable: !disabled,
125
- labelStaysFloatedWithPlaceholder,
92
+ hasLabel,
93
+ multiline,
94
+ minLines,
95
+ maxLines,
126
96
  });
127
97
 
128
98
  return (
@@ -136,7 +106,7 @@ export const BaseInput = ({
136
106
  {prefix}
137
107
 
138
108
  <TextInput
139
- ref={inputRef}
109
+ ref={composedRef}
140
110
  value={value}
141
111
  placeholder={inputPlaceholder}
142
112
  style={StyleSheet.flatten([styles.input, inputStyle])}
@@ -148,20 +118,27 @@ export const BaseInput = ({
148
118
  autoCorrect={false}
149
119
  selectionColor={theme.colors.text.active}
150
120
  placeholderTextColor={theme.colors.text.muted}
121
+ multiline={multiline}
122
+ // iOS hands the drag to the parent by default and the container Pressable
123
+ // claims it, which stops a clamped field from scrolling.
124
+ rejectResponderTermination={!multiline}
151
125
  {...props}
152
126
  />
153
127
 
154
128
  {label && (
155
- <Animated.Text
156
- style={[
157
- floatingLabelStyles.label,
158
- floatingLabelStyles.animatedStyle,
159
- labelStyle,
160
- ]}
161
- numberOfLines={1}
129
+ <BaseInputLabel
130
+ isFocused={isFocused}
131
+ hasContent={hasContent}
132
+ showClearButton={showClearButton}
133
+ status={status}
134
+ isEditable={!disabled}
135
+ labelStaysFloatedWithPlaceholder={
136
+ labelStaysFloatedWithPlaceholder
137
+ }
138
+ style={labelStyle}
162
139
  >
163
140
  {label}
164
- </Animated.Text>
141
+ </BaseInputLabel>
165
142
  )}
166
143
 
167
144
  {(suffix || (!hideClearButton && !disabled)) && (
@@ -200,53 +177,36 @@ export const BaseInput = ({
200
177
  );
201
178
  };
202
179
 
203
- const BaseInputHelperText = ({
204
- helperText,
205
- status,
206
- }: BaseInputHelperTextProps) => {
207
- const styles = useHelperTextStyles({ status });
208
-
209
- return (
210
- <View style={styles.helperContainer}>
211
- {!status && <InformationFill size={16} color='muted' />}
212
- {status === 'error' && <DeleteCircleFill size={16} color='error' />}
213
- {status === 'success' && (
214
- <CheckmarkCircleFill size={16} color='success' />
215
- )}
216
- <Text style={styles.helperText}>{helperText}</Text>
217
- </View>
218
- );
219
- };
220
-
221
- const BaseInputCounter = ({ count, maxCount }: BaseInputCounterProps) => {
222
- const styles = useCounterStyles();
223
-
224
- return (
225
- <Text style={styles.counterText} accessibilityLiveRegion='polite'>
226
- {`${count}/${maxCount}`}
227
- </Text>
228
- );
180
+ type StyleParams = {
181
+ status: BaseInputStatus | undefined;
182
+ isFocused: boolean;
183
+ isEditable: boolean;
184
+ hasLabel: boolean;
185
+ multiline: boolean;
186
+ minLines: number;
187
+ maxLines: number | undefined;
229
188
  };
230
189
 
231
- const useStyles = ({
190
+ const useRowStyles = ({
232
191
  status,
233
192
  isFocused,
234
193
  isEditable,
235
194
  hasLabel,
236
- }: {
237
- status: 'error' | 'success' | undefined;
238
- isFocused: boolean;
239
- isEditable: boolean;
240
- hasLabel: boolean;
241
- }) => {
195
+ multiline,
196
+ minLines,
197
+ maxLines,
198
+ }: StyleParams) => {
242
199
  return useStyleSheet(
243
200
  (t) => {
244
- const hasStatusBorder = status === 'error' || status === 'success';
245
201
  const statusBorderColors = {
246
202
  error: t.colors.border.error,
247
203
  success: t.colors.border.success,
248
204
  } as const;
249
205
  const statusBorderColor = status ? statusBorderColors[status] : undefined;
206
+ const borderWidth =
207
+ statusBorderColor && !isFocused ? t.borderWidth.s1 : t.borderWidth.s2;
208
+
209
+ const { paddingVertical } = getMultilineLayout(t, hasLabel);
250
210
 
251
211
  return {
252
212
  container: StyleSheet.flatten([
@@ -260,22 +220,52 @@ const useStyles = ({
260
220
  paddingHorizontal: t.spacings.s16,
261
221
  borderRadius: t.borderRadius.sm,
262
222
  backgroundColor: t.colors.bg.muted,
263
- borderWidth: t.borderWidth.s2,
223
+ borderWidth,
264
224
  borderColor: 'transparent',
265
225
  overflow: 'hidden',
266
226
  },
267
- hasStatusBorder &&
268
- statusBorderColor && {
269
- borderWidth: isFocused ? t.borderWidth.s2 : t.borderWidth.s1,
270
- borderColor: statusBorderColor,
271
- },
227
+ statusBorderColor && { borderColor: statusBorderColor },
272
228
  !isEditable && {
273
229
  backgroundColor: t.colors.bg.disabled,
274
230
  },
275
231
  isFocused &&
276
- !hasStatusBorder &&
232
+ !statusBorderColor &&
277
233
  isEditable && { borderColor: t.colors.border.active },
234
+ multiline && {
235
+ alignItems: 'flex-start',
236
+ paddingVertical,
237
+ minHeight: getMultilineMinHeight(t, {
238
+ hasLabel,
239
+ minLines,
240
+ maxLines,
241
+ }),
242
+ },
278
243
  ]),
244
+ suffixContainer: StyleSheet.flatten([
245
+ {
246
+ minWidth: t.sizes.s20,
247
+ alignItems: 'center',
248
+ justifyContent: 'center',
249
+ },
250
+ multiline && { marginTop: t.spacings.s2 },
251
+ ]),
252
+ };
253
+ },
254
+ [status, isFocused, isEditable, hasLabel, multiline, minLines, maxLines],
255
+ );
256
+ };
257
+
258
+ const useInputStyles = ({
259
+ isEditable,
260
+ hasLabel,
261
+ multiline,
262
+ maxLines,
263
+ }: Omit<StyleParams, 'status' | 'isFocused' | 'minLines'>) => {
264
+ return useStyleSheet(
265
+ (t) => {
266
+ const { lineHeight, labelRowHeight } = getMultilineLayout(t, hasLabel);
267
+
268
+ return {
279
269
  input: StyleSheet.flatten([
280
270
  {
281
271
  position: 'relative',
@@ -300,149 +290,40 @@ const useStyles = ({
300
290
  backgroundColor: t.colors.bg.disabled,
301
291
  color: t.colors.text.disabled,
302
292
  },
293
+ multiline && {
294
+ paddingTop: 0,
295
+ paddingBottom: 0,
296
+ marginTop: labelRowHeight,
297
+ minHeight: lineHeight,
298
+ maxHeight: maxLines ? maxLines * lineHeight : undefined,
299
+ },
300
+ multiline && RuntimeConstants.isAndroid && { lineHeight },
303
301
  ]),
304
- footerContainer: {
305
- marginTop: t.spacings.s8,
306
- flexDirection: 'row',
307
- alignItems: 'flex-start',
308
- justifyContent: 'space-between',
309
- gap: t.spacings.s8,
310
- },
311
- suffixContainer: {
312
- minWidth: t.sizes.s20,
313
- alignItems: 'center',
314
- justifyContent: 'center',
315
- },
316
302
  };
317
303
  },
318
- [status, isFocused, isEditable, hasLabel],
304
+ [isEditable, hasLabel, multiline, maxLines],
319
305
  );
320
306
  };
321
307
 
322
- const useHelperTextStyles = ({
323
- status,
324
- }: {
325
- status: BaseInputProps['status'];
326
- }) => {
308
+ const useFooterStyles = () => {
327
309
  return useStyleSheet(
328
310
  (t) => ({
329
- helperContainer: {
330
- flex: 1,
311
+ footerContainer: {
312
+ marginTop: t.spacings.s8,
331
313
  flexDirection: 'row',
332
- alignItems: 'center',
333
- gap: t.spacings.s2,
334
- },
335
- helperText: {
336
- ...t.typographies.body3,
337
- flex: 1,
338
- color: {
339
- error: t.colors.text.error,
340
- success: t.colors.text.success,
341
- default: t.colors.text.muted,
342
- }[status ?? 'default'],
343
- },
344
- }),
345
- [status],
346
- );
347
- };
348
-
349
- const useCounterStyles = () => {
350
- return useStyleSheet(
351
- (t) => ({
352
- counterText: {
353
- ...t.typographies.body3,
354
- flexShrink: 0,
355
- color: t.colors.text.muted,
314
+ alignItems: 'flex-start',
315
+ justifyContent: 'space-between',
316
+ gap: t.spacings.s8,
356
317
  },
357
318
  }),
358
319
  [],
359
320
  );
360
321
  };
361
322
 
362
- const useAnimatedFloatingLabel = ({
363
- isFloatingLabel,
364
- theme,
365
- }: {
366
- isFloatingLabel: boolean;
367
- theme: LumenStyleSheetTheme;
368
- }) => {
369
- const floatingAnimation = useSharedValue(isFloatingLabel ? 1 : 0);
370
- const timingConfig = useTimingConfig({
371
- duration: 150,
372
- easing: 'linear',
373
- });
374
-
375
- useEffect(() => {
376
- floatingAnimation.value = withTiming(isFloatingLabel ? 1 : 0, timingConfig);
377
-
378
- return () => cancelAnimation(floatingAnimation);
379
- }, [isFloatingLabel, timingConfig, floatingAnimation]);
380
-
381
- const animatedStyle = useAnimatedStyle(
382
- () => ({
383
- top: interpolate(
384
- floatingAnimation.value,
385
- [0, 1],
386
- [theme.spacings.s14, theme.spacings.s6],
387
- ),
388
- fontSize: interpolate(
389
- floatingAnimation.value,
390
- [0, 1],
391
- [theme.typographies.body2.fontSize, theme.typographies.body4.fontSize],
392
- ),
393
- }),
394
- [floatingAnimation, theme],
395
- );
396
-
397
- return { animatedStyle };
398
- };
399
-
400
- const useFloatingLabelStyles = ({
401
- isFocused,
402
- hasContent,
403
- showClearButton,
404
- status,
405
- isEditable,
406
- labelStaysFloatedWithPlaceholder,
407
- }: {
408
- isFocused: boolean;
409
- hasContent: boolean;
410
- showClearButton: boolean;
411
- status: 'error' | 'success' | undefined;
412
- isEditable: boolean;
413
- labelStaysFloatedWithPlaceholder: boolean;
414
- }) => {
415
- const { theme } = useTheme();
416
-
417
- const { label } = useStyleSheet(
418
- (t) => ({
419
- label: StyleSheet.flatten([
420
- {
421
- position: 'absolute',
422
- left: t.spacings.s16,
423
- width: t.sizes.full,
424
- color: t.colors.text.muted,
425
- },
426
- hasContent &&
427
- showClearButton && {
428
- width: '92%',
429
- },
430
- status === 'error' && {
431
- color: t.colors.text.error,
432
- },
433
- !isEditable && {
434
- color: t.colors.text.disabled,
435
- },
436
- ]),
437
- }),
438
- [hasContent, showClearButton, status, isEditable],
439
- );
440
-
441
- const { animatedStyle } = useAnimatedFloatingLabel({
442
- theme,
443
- isFloatingLabel:
444
- isFocused || hasContent || labelStaysFloatedWithPlaceholder,
445
- });
323
+ const useStyles = (params: StyleParams) => {
324
+ const { container, suffixContainer } = useRowStyles(params);
325
+ const { input } = useInputStyles(params);
326
+ const { footerContainer } = useFooterStyles();
446
327
 
447
- return { label, animatedStyle };
328
+ return { container, input, suffixContainer, footerContainer };
448
329
  };
@@ -0,0 +1,35 @@
1
+ import type { TextStyle } from 'react-native';
2
+ import { Text } from 'react-native';
3
+ import { useStyleSheet } from '../../../../styles';
4
+ import type { BaseInputCounterProps } from './types';
5
+
6
+ const useCounterStyles = (): { counterText: TextStyle } => {
7
+ return useStyleSheet(
8
+ (t) => ({
9
+ counterText: {
10
+ ...t.typographies.body3,
11
+ flexShrink: 0,
12
+ color: t.colors.text.muted,
13
+ },
14
+ }),
15
+ [],
16
+ );
17
+ };
18
+
19
+ /**
20
+ * Character counter rendered below the control inside `BaseInput`.
21
+ *
22
+ * @internal
23
+ */
24
+ export const BaseInputCounter = ({
25
+ count,
26
+ maxCount,
27
+ }: BaseInputCounterProps) => {
28
+ const styles = useCounterStyles();
29
+
30
+ return (
31
+ <Text style={styles.counterText} accessibilityLiveRegion='polite'>
32
+ {`${count}/${maxCount}`}
33
+ </Text>
34
+ );
35
+ };
@@ -0,0 +1,57 @@
1
+ import type { TextStyle, ViewStyle } from 'react-native';
2
+ import { Text, View } from 'react-native';
3
+ import { useStyleSheet } from '../../../../styles';
4
+ import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
5
+ import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
6
+ import { InformationFill } from '../../symbols/icons/InformationFill';
7
+ import type { BaseInputHelperTextProps, BaseInputProps } from './types';
8
+
9
+ const useHelperTextStyles = ({
10
+ status,
11
+ }: {
12
+ status: BaseInputProps['status'];
13
+ }): { helperContainer: ViewStyle; helperText: TextStyle } => {
14
+ return useStyleSheet(
15
+ (t) => ({
16
+ helperContainer: {
17
+ flex: 1,
18
+ flexDirection: 'row',
19
+ alignItems: 'flex-start',
20
+ gap: t.spacings.s2,
21
+ },
22
+ helperText: {
23
+ ...t.typographies.body3,
24
+ flex: 1,
25
+ color: {
26
+ error: t.colors.text.error,
27
+ success: t.colors.text.success,
28
+ default: t.colors.text.muted,
29
+ }[status ?? 'default'],
30
+ },
31
+ }),
32
+ [status],
33
+ );
34
+ };
35
+
36
+ /**
37
+ * Hint, error or success copy rendered below the control inside `BaseInput`.
38
+ *
39
+ * @internal
40
+ */
41
+ export const BaseInputHelperText = ({
42
+ helperText,
43
+ status,
44
+ }: BaseInputHelperTextProps) => {
45
+ const styles = useHelperTextStyles({ status });
46
+
47
+ return (
48
+ <View style={styles.helperContainer}>
49
+ {!status && <InformationFill size={16} color='muted' />}
50
+ {status === 'error' && <DeleteCircleFill size={16} color='error' />}
51
+ {status === 'success' && (
52
+ <CheckmarkCircleFill size={16} color='success' />
53
+ )}
54
+ <Text style={styles.helperText}>{helperText}</Text>
55
+ </View>
56
+ );
57
+ };