@metamask-previews/design-system-react-native 0.11.0-preview.fa05289 → 0.13.0-preview.b4e6ece

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 (419) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/components/AvatarAccount/AvatarAccount.cjs +4 -3
  3. package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
  4. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
  5. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
  6. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
  7. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
  8. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
  9. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
  10. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
  11. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
  12. package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
  13. package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
  14. package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
  15. package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
  16. package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
  17. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  18. package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
  19. package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
  20. package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
  21. package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
  22. package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
  23. package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
  24. package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
  25. package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
  26. package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
  27. package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
  28. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  29. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  30. package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
  31. package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
  32. package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
  33. package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
  34. package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
  35. package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
  36. package/dist/components/AvatarBase/index.cjs +3 -3
  37. package/dist/components/AvatarBase/index.cjs.map +1 -1
  38. package/dist/components/AvatarBase/index.d.cts +1 -1
  39. package/dist/components/AvatarBase/index.d.cts.map +1 -1
  40. package/dist/components/AvatarBase/index.d.mts +1 -1
  41. package/dist/components/AvatarBase/index.d.mts.map +1 -1
  42. package/dist/components/AvatarBase/index.mjs +1 -1
  43. package/dist/components/AvatarBase/index.mjs.map +1 -1
  44. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  45. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  46. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  47. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  48. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  49. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  50. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +8 -8
  51. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  52. package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
  53. package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
  54. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
  55. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  56. package/dist/components/BadgeWrapper/BadgeWrapper.types.cjs.map +1 -1
  57. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +4 -51
  58. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
  59. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +4 -51
  60. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
  61. package/dist/components/BadgeWrapper/BadgeWrapper.types.mjs.map +1 -1
  62. package/dist/components/BadgeWrapper/index.cjs +3 -3
  63. package/dist/components/BadgeWrapper/index.cjs.map +1 -1
  64. package/dist/components/BadgeWrapper/index.d.cts +1 -2
  65. package/dist/components/BadgeWrapper/index.d.cts.map +1 -1
  66. package/dist/components/BadgeWrapper/index.d.mts +1 -2
  67. package/dist/components/BadgeWrapper/index.d.mts.map +1 -1
  68. package/dist/components/BadgeWrapper/index.mjs +1 -1
  69. package/dist/components/BadgeWrapper/index.mjs.map +1 -1
  70. package/dist/components/BottomSheet/BottomSheet.cjs +7 -10
  71. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  72. package/dist/components/BottomSheet/BottomSheet.d.cts +31 -2
  73. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
  74. package/dist/components/BottomSheet/BottomSheet.d.mts +31 -2
  75. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
  76. package/dist/components/BottomSheet/BottomSheet.mjs +6 -6
  77. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
  78. package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -1
  79. package/dist/components/BottomSheet/BottomSheet.types.d.cts +3 -8
  80. package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -1
  81. package/dist/components/BottomSheet/BottomSheet.types.d.mts +3 -8
  82. package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -1
  83. package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -1
  84. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +3 -3
  85. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  86. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +31 -2
  87. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
  88. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +31 -2
  89. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
  90. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +2 -3
  91. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  92. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -1
  93. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +7 -0
  94. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
  95. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +7 -0
  96. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
  97. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -1
  98. package/dist/components/BottomSheetDialog/index.cjs +2 -5
  99. package/dist/components/BottomSheetDialog/index.cjs.map +1 -1
  100. package/dist/components/BottomSheetDialog/index.d.cts +1 -1
  101. package/dist/components/BottomSheetDialog/index.d.cts.map +1 -1
  102. package/dist/components/BottomSheetDialog/index.d.mts +1 -1
  103. package/dist/components/BottomSheetDialog/index.d.mts.map +1 -1
  104. package/dist/components/BottomSheetDialog/index.mjs +1 -1
  105. package/dist/components/BottomSheetDialog/index.mjs.map +1 -1
  106. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +2 -2
  107. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
  108. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +2 -2
  109. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
  110. package/dist/components/BoxHorizontal/BoxHorizontal.cjs +18 -0
  111. package/dist/components/BoxHorizontal/BoxHorizontal.cjs.map +1 -0
  112. package/dist/components/BoxHorizontal/BoxHorizontal.d.cts +7 -0
  113. package/dist/components/BoxHorizontal/BoxHorizontal.d.cts.map +1 -0
  114. package/dist/components/BoxHorizontal/BoxHorizontal.d.mts +7 -0
  115. package/dist/components/BoxHorizontal/BoxHorizontal.d.mts.map +1 -0
  116. package/dist/components/BoxHorizontal/BoxHorizontal.mjs +18 -0
  117. package/dist/components/BoxHorizontal/BoxHorizontal.mjs.map +1 -0
  118. package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs +3 -0
  119. package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs.map +1 -0
  120. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts +13 -0
  121. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts.map +1 -0
  122. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts +13 -0
  123. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts.map +1 -0
  124. package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs +2 -0
  125. package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs.map +1 -0
  126. package/dist/components/BoxHorizontal/index.cjs +6 -0
  127. package/dist/components/BoxHorizontal/index.cjs.map +1 -0
  128. package/dist/components/BoxHorizontal/index.d.cts +3 -0
  129. package/dist/components/BoxHorizontal/index.d.cts.map +1 -0
  130. package/dist/components/BoxHorizontal/index.d.mts +3 -0
  131. package/dist/components/BoxHorizontal/index.d.mts.map +1 -0
  132. package/dist/components/BoxHorizontal/index.mjs +2 -0
  133. package/dist/components/BoxHorizontal/index.mjs.map +1 -0
  134. package/dist/components/BoxVertical/BoxVertical.cjs +18 -0
  135. package/dist/components/BoxVertical/BoxVertical.cjs.map +1 -0
  136. package/dist/components/BoxVertical/BoxVertical.d.cts +7 -0
  137. package/dist/components/BoxVertical/BoxVertical.d.cts.map +1 -0
  138. package/dist/components/BoxVertical/BoxVertical.d.mts +7 -0
  139. package/dist/components/BoxVertical/BoxVertical.d.mts.map +1 -0
  140. package/dist/components/BoxVertical/BoxVertical.mjs +18 -0
  141. package/dist/components/BoxVertical/BoxVertical.mjs.map +1 -0
  142. package/dist/components/BoxVertical/BoxVertical.types.cjs +3 -0
  143. package/dist/components/BoxVertical/BoxVertical.types.cjs.map +1 -0
  144. package/dist/components/BoxVertical/BoxVertical.types.d.cts +13 -0
  145. package/dist/components/BoxVertical/BoxVertical.types.d.cts.map +1 -0
  146. package/dist/components/BoxVertical/BoxVertical.types.d.mts +13 -0
  147. package/dist/components/BoxVertical/BoxVertical.types.d.mts.map +1 -0
  148. package/dist/components/BoxVertical/BoxVertical.types.mjs +2 -0
  149. package/dist/components/BoxVertical/BoxVertical.types.mjs.map +1 -0
  150. package/dist/components/BoxVertical/index.cjs +6 -0
  151. package/dist/components/BoxVertical/index.cjs.map +1 -0
  152. package/dist/components/BoxVertical/index.d.cts +3 -0
  153. package/dist/components/BoxVertical/index.d.cts.map +1 -0
  154. package/dist/components/BoxVertical/index.d.mts +3 -0
  155. package/dist/components/BoxVertical/index.d.mts.map +1 -0
  156. package/dist/components/BoxVertical/index.mjs +2 -0
  157. package/dist/components/BoxVertical/index.mjs.map +1 -0
  158. package/dist/components/HeaderRoot/HeaderRoot.cjs +61 -0
  159. package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -0
  160. package/dist/components/HeaderRoot/HeaderRoot.d.cts +7 -0
  161. package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -0
  162. package/dist/components/HeaderRoot/HeaderRoot.d.mts +7 -0
  163. package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -0
  164. package/dist/components/HeaderRoot/HeaderRoot.mjs +61 -0
  165. package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -0
  166. package/dist/components/HeaderRoot/HeaderRoot.types.cjs +3 -0
  167. package/dist/components/HeaderRoot/HeaderRoot.types.cjs.map +1 -0
  168. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +60 -0
  169. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -0
  170. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +60 -0
  171. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -0
  172. package/dist/components/HeaderRoot/HeaderRoot.types.mjs +2 -0
  173. package/dist/components/HeaderRoot/HeaderRoot.types.mjs.map +1 -0
  174. package/dist/components/HeaderRoot/index.cjs +6 -0
  175. package/dist/components/HeaderRoot/index.cjs.map +1 -0
  176. package/dist/components/HeaderRoot/index.d.cts +3 -0
  177. package/dist/components/HeaderRoot/index.d.cts.map +1 -0
  178. package/dist/components/HeaderRoot/index.d.mts +3 -0
  179. package/dist/components/HeaderRoot/index.d.mts.map +1 -0
  180. package/dist/components/HeaderRoot/index.mjs +2 -0
  181. package/dist/components/HeaderRoot/index.mjs.map +1 -0
  182. package/dist/components/HeaderStandard/HeaderStandard.cjs +101 -0
  183. package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -0
  184. package/dist/components/HeaderStandard/HeaderStandard.d.cts +4 -0
  185. package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -0
  186. package/dist/components/HeaderStandard/HeaderStandard.d.mts +4 -0
  187. package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -0
  188. package/dist/components/HeaderStandard/HeaderStandard.mjs +81 -0
  189. package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -0
  190. package/dist/components/HeaderStandard/HeaderStandard.types.cjs +8 -0
  191. package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -0
  192. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +55 -0
  193. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -0
  194. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +55 -0
  195. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -0
  196. package/dist/components/HeaderStandard/HeaderStandard.types.mjs +10 -0
  197. package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -0
  198. package/dist/components/HeaderStandard/index.cjs +6 -0
  199. package/dist/components/HeaderStandard/index.cjs.map +1 -0
  200. package/dist/components/HeaderStandard/index.d.cts +3 -0
  201. package/dist/components/HeaderStandard/index.d.cts.map +1 -0
  202. package/dist/components/HeaderStandard/index.d.mts +3 -0
  203. package/dist/components/HeaderStandard/index.d.mts.map +1 -0
  204. package/dist/components/HeaderStandard/index.mjs +2 -0
  205. package/dist/components/HeaderStandard/index.mjs.map +1 -0
  206. package/dist/components/Icon/assets/candlestick.svg +1 -1
  207. package/dist/components/Input/Input.cjs +4 -3
  208. package/dist/components/Input/Input.cjs.map +1 -1
  209. package/dist/components/Input/Input.constants.cjs +69 -0
  210. package/dist/components/Input/Input.constants.cjs.map +1 -0
  211. package/dist/components/Input/Input.constants.d.cts +11 -0
  212. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  213. package/dist/components/Input/Input.constants.d.mts +11 -0
  214. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  215. package/dist/components/Input/Input.constants.mjs +66 -0
  216. package/dist/components/Input/Input.constants.mjs.map +1 -0
  217. package/dist/components/Input/Input.d.cts.map +1 -1
  218. package/dist/components/Input/Input.d.mts.map +1 -1
  219. package/dist/components/Input/Input.mjs +4 -3
  220. package/dist/components/Input/Input.mjs.map +1 -1
  221. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +34 -0
  222. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  223. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +13 -0
  224. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  225. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +13 -0
  226. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  227. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +34 -0
  228. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  229. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +40 -0
  230. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  231. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +24 -0
  232. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  233. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +24 -0
  234. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  235. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +40 -0
  236. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  237. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  238. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  239. package/dist/components/KeyValueRow/KeyValueRow.d.cts +24 -0
  240. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  241. package/dist/components/KeyValueRow/KeyValueRow.d.mts +24 -0
  242. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  243. package/dist/components/KeyValueRow/KeyValueRow.mjs +76 -0
  244. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  245. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  246. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  247. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  248. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  249. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  250. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  251. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  252. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  253. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  254. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  255. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  256. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  257. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  258. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  259. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  260. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  261. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +30 -0
  262. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  263. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +16 -0
  264. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  265. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +16 -0
  266. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  267. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +30 -0
  268. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  269. package/dist/components/KeyValueRow/index.cjs +12 -0
  270. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  271. package/dist/components/KeyValueRow/index.d.cts +3 -0
  272. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  273. package/dist/components/KeyValueRow/index.d.mts +3 -0
  274. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  275. package/dist/components/KeyValueRow/index.mjs +3 -0
  276. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  277. package/dist/components/Skeleton/Skeleton.cjs +2 -1
  278. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  279. package/dist/components/Skeleton/Skeleton.d.cts +1 -2
  280. package/dist/components/Skeleton/Skeleton.d.cts.map +1 -1
  281. package/dist/components/Skeleton/Skeleton.d.mts +1 -2
  282. package/dist/components/Skeleton/Skeleton.d.mts.map +1 -1
  283. package/dist/components/Skeleton/Skeleton.mjs +1 -2
  284. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  285. package/dist/components/Skeleton/index.cjs +1 -4
  286. package/dist/components/Skeleton/index.cjs.map +1 -1
  287. package/dist/components/Skeleton/index.d.cts +1 -1
  288. package/dist/components/Skeleton/index.d.cts.map +1 -1
  289. package/dist/components/Skeleton/index.d.mts +1 -1
  290. package/dist/components/Skeleton/index.d.mts.map +1 -1
  291. package/dist/components/Skeleton/index.mjs +1 -1
  292. package/dist/components/Skeleton/index.mjs.map +1 -1
  293. package/dist/components/Text/Text.types.cjs.map +1 -1
  294. package/dist/components/Text/Text.types.d.cts +1 -1
  295. package/dist/components/Text/Text.types.d.mts +1 -1
  296. package/dist/components/Text/Text.types.mjs.map +1 -1
  297. package/dist/components/TextButton/TextButton.cjs +12 -36
  298. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  299. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  300. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  301. package/dist/components/TextButton/TextButton.mjs +14 -38
  302. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  303. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  304. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  305. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  306. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  307. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  308. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  309. package/dist/components/TextButton/index.cjs +1 -3
  310. package/dist/components/TextButton/index.cjs.map +1 -1
  311. package/dist/components/TextButton/index.d.cts +0 -1
  312. package/dist/components/TextButton/index.d.cts.map +1 -1
  313. package/dist/components/TextButton/index.d.mts +0 -1
  314. package/dist/components/TextButton/index.d.mts.map +1 -1
  315. package/dist/components/TextButton/index.mjs +0 -1
  316. package/dist/components/TextButton/index.mjs.map +1 -1
  317. package/dist/components/TextField/TextField.cjs +22 -8
  318. package/dist/components/TextField/TextField.cjs.map +1 -1
  319. package/dist/components/TextField/TextField.d.cts +0 -2
  320. package/dist/components/TextField/TextField.d.cts.map +1 -1
  321. package/dist/components/TextField/TextField.d.mts +0 -2
  322. package/dist/components/TextField/TextField.d.mts.map +1 -1
  323. package/dist/components/TextField/TextField.mjs +22 -8
  324. package/dist/components/TextField/TextField.mjs.map +1 -1
  325. package/dist/components/TextField/TextField.types.cjs +0 -10
  326. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  327. package/dist/components/TextField/TextField.types.d.cts +0 -14
  328. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  329. package/dist/components/TextField/TextField.types.d.mts +0 -14
  330. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  331. package/dist/components/TextField/TextField.types.mjs +1 -9
  332. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  333. package/dist/components/TextField/index.cjs +1 -3
  334. package/dist/components/TextField/index.cjs.map +1 -1
  335. package/dist/components/TextField/index.d.cts +0 -1
  336. package/dist/components/TextField/index.d.cts.map +1 -1
  337. package/dist/components/TextField/index.d.mts +0 -1
  338. package/dist/components/TextField/index.d.mts.map +1 -1
  339. package/dist/components/TextField/index.mjs +0 -1
  340. package/dist/components/TextField/index.mjs.map +1 -1
  341. package/dist/components/TextFieldSearch/TextFieldSearch.cjs +45 -0
  342. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
  343. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +14 -0
  344. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
  345. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +14 -0
  346. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
  347. package/dist/components/TextFieldSearch/TextFieldSearch.mjs +26 -0
  348. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
  349. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
  350. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
  351. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
  352. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
  353. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
  354. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
  355. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
  356. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
  357. package/dist/components/TextFieldSearch/index.cjs +6 -0
  358. package/dist/components/TextFieldSearch/index.cjs.map +1 -0
  359. package/dist/components/TextFieldSearch/index.d.cts +3 -0
  360. package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
  361. package/dist/components/TextFieldSearch/index.d.mts +3 -0
  362. package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
  363. package/dist/components/TextFieldSearch/index.mjs +2 -0
  364. package/dist/components/TextFieldSearch/index.mjs.map +1 -0
  365. package/dist/components/Toast/Toast.cjs +2 -2
  366. package/dist/components/Toast/Toast.cjs.map +1 -1
  367. package/dist/components/Toast/Toast.d.cts +1 -2
  368. package/dist/components/Toast/Toast.d.cts.map +1 -1
  369. package/dist/components/Toast/Toast.d.mts +1 -2
  370. package/dist/components/Toast/Toast.d.mts.map +1 -1
  371. package/dist/components/Toast/Toast.mjs +1 -2
  372. package/dist/components/Toast/Toast.mjs.map +1 -1
  373. package/dist/components/Toast/index.cjs +1 -4
  374. package/dist/components/Toast/index.cjs.map +1 -1
  375. package/dist/components/Toast/index.d.cts +1 -1
  376. package/dist/components/Toast/index.d.cts.map +1 -1
  377. package/dist/components/Toast/index.d.mts +1 -1
  378. package/dist/components/Toast/index.d.mts.map +1 -1
  379. package/dist/components/Toast/index.mjs +1 -1
  380. package/dist/components/Toast/index.mjs.map +1 -1
  381. package/dist/components/index.cjs +14 -8
  382. package/dist/components/index.cjs.map +1 -1
  383. package/dist/components/index.d.cts +13 -3
  384. package/dist/components/index.d.cts.map +1 -1
  385. package/dist/components/index.d.mts +13 -3
  386. package/dist/components/index.d.mts.map +1 -1
  387. package/dist/components/index.mjs +8 -3
  388. package/dist/components/index.mjs.map +1 -1
  389. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  390. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +2 -5
  391. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
  392. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +2 -5
  393. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
  394. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  395. package/dist/types/index.cjs +20 -71
  396. package/dist/types/index.cjs.map +1 -1
  397. package/dist/types/index.d.cts +10 -82
  398. package/dist/types/index.d.cts.map +1 -1
  399. package/dist/types/index.d.mts +10 -82
  400. package/dist/types/index.d.mts.map +1 -1
  401. package/dist/types/index.mjs +10 -78
  402. package/dist/types/index.mjs.map +1 -1
  403. package/package.json +7 -8
  404. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  405. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  406. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  407. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  408. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  409. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  410. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  411. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  412. package/dist/components/TextField/TextField.constants.cjs +0 -13
  413. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  414. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  415. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  416. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  417. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  418. package/dist/components/TextField/TextField.constants.mjs +0 -10
  419. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextButtonSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: string;\n /**\n * Optional prop to control the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<PressableProps, 'disabled'>;\n"]}
1
+ {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextButton = exports.TextButtonSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "TextButtonSize", { enumerable: true, get: function () { return types_1.TextButtonSize; } });
3
+ exports.TextButton = void 0;
6
4
  var TextButton_1 = require("./TextButton.cjs");
7
5
  Object.defineProperty(exports, "TextButton", { enumerable: true, get: function () { return TextButton_1.TextButton; } });
8
6
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,uGAAA,cAAc,OAAA;AACvB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.cjs";
2
1
  export { TextButton } from "./TextButton.cjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.cjs";
4
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.mjs";
4
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,2 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
@@ -6,14 +6,25 @@ const react_1 = require("react");
6
6
  const react_native_1 = require("react-native/index.js");
7
7
  const types_1 = require("../../types/index.cjs");
8
8
  const Input_1 = require("../Input/index.cjs");
9
- const TextField_constants_1 = require("./TextField.constants.cjs");
10
- const TextField_types_1 = require("./TextField.types.cjs");
11
- exports.TextField = (0, react_1.forwardRef)(({ style, size = TextField_types_1.TextFieldSize.Md, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
9
+ function getContainerBorderColorClass(isDisabled, isFocused, isError) {
10
+ if (isDisabled) {
11
+ return 'border-muted';
12
+ }
13
+ if (isError) {
14
+ return 'border-error-default';
15
+ }
16
+ if (isFocused) {
17
+ return 'border-default';
18
+ }
19
+ return 'border-muted';
20
+ }
21
+ exports.TextField = (0, react_1.forwardRef)(({ style, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
12
22
  const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
13
23
  const inputRef = (0, react_1.useRef)(null);
14
24
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
15
25
  (0, react_1.useImperativeHandle)(ref, () => inputRef.current, []);
16
- const containerStyle = (0, react_1.useMemo)(() => tw.style('flex-row', 'items-center', 'rounded-lg', TextField_constants_1.TWCLASSMAP_TEXTFIELD_SIZE[size], 'border', 'px-4', 'bg-default', 'border-default', isError && 'border-error-default', !isDisabled && isFocused && 'border-primary-default', isDisabled && 'opacity-50', twClassName), [size, isError, isFocused, isDisabled, twClassName, tw]);
26
+ const borderColorClass = getContainerBorderColorClass(isDisabled, isFocused, isError);
27
+ const containerStyle = (0, react_1.useMemo)(() => tw.style('flex-row', 'items-center', 'gap-3', 'rounded-lg', 'h-12', 'border', borderColorClass, 'px-4', 'bg-muted', isDisabled && 'opacity-50', twClassName), [borderColorClass, isDisabled, twClassName, tw]);
17
28
  const onBlurHandler = (0, react_1.useCallback)((e) => {
18
29
  if (!isDisabled) {
19
30
  setIsFocused(false);
@@ -32,11 +43,14 @@ exports.TextField = (0, react_1.forwardRef)(({ style, size = TextField_types_1.T
32
43
  }
33
44
  }, [isDisabled]);
34
45
  return (<react_native_1.Pressable testID={testID} style={[containerStyle, style]} onPress={onPressHandler} accessible={false}>
35
- {startAccessory && (<react_native_1.View style={tw.style('mr-2')}>{startAccessory}</react_native_1.View>)}
36
- <react_native_1.View style={tw.style('flex-1')}>
37
- {inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={types_1.TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled twClassName="bg-transparent border-0"/>)}
46
+ {startAccessory}
47
+ <react_native_1.View style={tw.style('min-h-0 flex-1 justify-center')}>
48
+ {inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={types_1.TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled
49
+ // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput
50
+ // uses 46px height so the field matches a 48px-tall control without vertical overflow.
51
+ twClassName="h-[46px] bg-transparent border-0" numberOfLines={1} multiline={false}/>)}
38
52
  </react_native_1.View>
39
- {endAccessory && <react_native_1.View style={tw.style('ml-2')}>{endAccessory}</react_native_1.View>}
53
+ {endAccessory}
40
54
  </react_native_1.Pressable>);
41
55
  });
42
56
  //# sourceMappingURL=TextField.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;AAAA,8FAA4E;AAC5E,iCAOe;AACf,wDAA0D;AAE1D,iDAA0C;AAC1C,8CAAiC;AAEjC,mEAAkE;AAClE,2DAAkD;AAGrC,QAAA,SAAS,GAAG,IAAA,kBAAU,EACjC,CACE,EACE,KAAK,EACL,IAAI,GAAG,+BAAa,CAAC,EAAE,EACvB,cAAc,EACd,YAAY,EACZ,OAAO,GAAG,KAAK,EACf,YAAY,EACZ,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAY,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,IAAA,2BAAmB,EACjB,GAAG,EACH,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EACtB,EAAE,CACH,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,eAAO,EAC5B,GAAG,EAAE,CACH,EAAE,CAAC,KAAK,CACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,+CAAyB,CAAC,IAAI,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,OAAO,IAAI,sBAAsB,EACjC,CAAC,UAAU,IAAI,SAAS,IAAI,wBAAwB,EACpD,UAAU,IAAI,YAAY,EAC1B,WAAW,CACZ,EACH,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC,CACxD,CAAC;IAEF,MAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,CAAC,CAAuD,EAAE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AAM,CAAC,CAChC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,qBAAqB,CACrB,WAAW,CAAC,yBAAyB,EACrC,CACH,CACH;QAAA,EAAE,mBAAI,CACN;QAAA,CAAC,YAAY,IAAI,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,mBAAI,CAAC,CACvE;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport { TWCLASSMAP_TEXTFIELD_SIZE } from './TextField.constants';\nimport { TextFieldSize } from './TextField.types';\nimport type { TextFieldProps } from './TextField.types';\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n size = TextFieldSize.Md,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'rounded-lg',\n TWCLASSMAP_TEXTFIELD_SIZE[size],\n 'border',\n 'px-4',\n 'bg-default',\n 'border-default',\n isError && 'border-error-default',\n !isDisabled && isFocused && 'border-primary-default',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [size, isError, isFocused, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory && (\n <View style={tw.style('mr-2')}>{startAccessory}</View>\n )}\n <View style={tw.style('flex-1')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n twClassName=\"bg-transparent border-0\"\n />\n )}\n </View>\n {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}\n </Pressable>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"TextField.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;AAAA,8FAA4E;AAC5E,iCAOe;AACf,wDAA0D;AAE1D,iDAA0C;AAC1C,8CAAiC;AAIjC,SAAS,4BAA4B,CACnC,UAAmB,EACnB,SAAkB,EAClB,OAAgB;IAEhB,IAAI,UAAU,EAAE;QACd,OAAO,cAAc,CAAC;KACvB;IACD,IAAI,OAAO,EAAE;QACX,OAAO,sBAAsB,CAAC;KAC/B;IACD,IAAI,SAAS,EAAE;QACb,OAAO,gBAAgB,CAAC;KACzB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAEY,QA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C;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport type { TextFieldProps } from './TextField.types';\n\nfunction getContainerBorderColorClass(\n isDisabled: boolean,\n isFocused: boolean,\n isError: boolean,\n): string {\n if (isDisabled) {\n return 'border-muted';\n }\n if (isError) {\n return 'border-error-default';\n }\n if (isFocused) {\n return 'border-default';\n }\n return 'border-muted';\n}\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const borderColorClass = getContainerBorderColorClass(\n isDisabled,\n isFocused,\n isError,\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'gap-3',\n 'rounded-lg',\n 'h-12',\n 'border',\n borderColorClass,\n 'px-4',\n 'bg-muted',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [borderColorClass, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory}\n <View style={tw.style('min-h-0 flex-1 justify-center')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput\n // uses 46px height so the field matches a 48px-tall control without vertical overflow.\n twClassName=\"h-[46px] bg-transparent border-0\"\n numberOfLines={1}\n multiline={false}\n />\n )}\n </View>\n {endAccessory}\n </Pressable>\n );\n },\n);\n"]}
@@ -1,7 +1,5 @@
1
1
  import { TextInput } from "react-native/index.js";
2
- import { TextFieldSize } from "./TextField.types.cjs";
3
2
  export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("../Input/index.cjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
- size?: TextFieldSize | undefined;
5
3
  startAccessory?: import("react").ReactNode;
6
4
  endAccessory?: import("react").ReactNode;
7
5
  isError?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAM1D,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAGlD,eAAO,MAAM,SAAS;;;;;;;;6CAuGrB,CAAC"}
1
+ {"version":3,"file":"TextField.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAwB1D,eAAO,MAAM,SAAS;;;;;;;6CA6GrB,CAAC"}
@@ -1,7 +1,5 @@
1
1
  import { TextInput } from "react-native/index.js";
2
- import { TextFieldSize } from "./TextField.types.mjs";
3
2
  export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("../Input/index.mjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
- size?: TextFieldSize | undefined;
5
3
  startAccessory?: import("react").ReactNode;
6
4
  endAccessory?: import("react").ReactNode;
7
5
  isError?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAM1D,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAGlD,eAAO,MAAM,SAAS;;;;;;;;6CAuGrB,CAAC"}
1
+ {"version":3,"file":"TextField.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAwB1D,eAAO,MAAM,SAAS;;;;;;;6CA6GrB,CAAC"}
@@ -3,14 +3,25 @@ import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState
3
3
  import { Pressable, TextInput, View } from "react-native/index.js";
4
4
  import { TextVariant } from "../../types/index.mjs";
5
5
  import { Input } from "../Input/index.mjs";
6
- import { TWCLASSMAP_TEXTFIELD_SIZE } from "./TextField.constants.mjs";
7
- import { TextFieldSize } from "./TextField.types.mjs";
8
- export const TextField = forwardRef(({ style, size = TextFieldSize.Md, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
6
+ function getContainerBorderColorClass(isDisabled, isFocused, isError) {
7
+ if (isDisabled) {
8
+ return 'border-muted';
9
+ }
10
+ if (isError) {
11
+ return 'border-error-default';
12
+ }
13
+ if (isFocused) {
14
+ return 'border-default';
15
+ }
16
+ return 'border-muted';
17
+ }
18
+ export const TextField = forwardRef(({ style, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
9
19
  const [isFocused, setIsFocused] = useState(autoFocus);
10
20
  const inputRef = useRef(null);
11
21
  const tw = useTailwind();
12
22
  useImperativeHandle(ref, () => inputRef.current, []);
13
- const containerStyle = useMemo(() => tw.style('flex-row', 'items-center', 'rounded-lg', TWCLASSMAP_TEXTFIELD_SIZE[size], 'border', 'px-4', 'bg-default', 'border-default', isError && 'border-error-default', !isDisabled && isFocused && 'border-primary-default', isDisabled && 'opacity-50', twClassName), [size, isError, isFocused, isDisabled, twClassName, tw]);
23
+ const borderColorClass = getContainerBorderColorClass(isDisabled, isFocused, isError);
24
+ const containerStyle = useMemo(() => tw.style('flex-row', 'items-center', 'gap-3', 'rounded-lg', 'h-12', 'border', borderColorClass, 'px-4', 'bg-muted', isDisabled && 'opacity-50', twClassName), [borderColorClass, isDisabled, twClassName, tw]);
14
25
  const onBlurHandler = useCallback((e) => {
15
26
  if (!isDisabled) {
16
27
  setIsFocused(false);
@@ -29,11 +40,14 @@ export const TextField = forwardRef(({ style, size = TextFieldSize.Md, startAcce
29
40
  }
30
41
  }, [isDisabled]);
31
42
  return (<Pressable testID={testID} style={[containerStyle, style]} onPress={onPressHandler} accessible={false}>
32
- {startAccessory && (<View style={tw.style('mr-2')}>{startAccessory}</View>)}
33
- <View style={tw.style('flex-1')}>
34
- {inputElement ?? (<Input {...props} ref={inputRef} textVariant={TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled twClassName="bg-transparent border-0"/>)}
43
+ {startAccessory}
44
+ <View style={tw.style('min-h-0 flex-1 justify-center')}>
45
+ {inputElement ?? (<Input {...props} ref={inputRef} textVariant={TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled
46
+ // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput
47
+ // uses 46px height so the field matches a 48px-tall control without vertical overflow.
48
+ twClassName="h-[46px] bg-transparent border-0" numberOfLines={1} multiline={false}/>)}
35
49
  </View>
36
- {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}
50
+ {endAccessory}
37
51
  </Pressable>);
38
52
  });
39
53
  //# sourceMappingURL=TextField.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,EACL,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,EACT,cAAc;AACf,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,8BAAqB;AAE1D,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAC1C,OAAO,EAAE,KAAK,EAAE,2BAAiB;AAEjC,OAAO,EAAE,yBAAyB,EAAE,kCAA8B;AAClE,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAGlD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CACjC,CACE,EACE,KAAK,EACL,IAAI,GAAG,aAAa,CAAC,EAAE,EACvB,cAAc,EACd,YAAY,EACZ,OAAO,GAAG,KAAK,EACf,YAAY,EACZ,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAY,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,mBAAmB,CACjB,GAAG,EACH,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EACtB,EAAE,CACH,CAAC;IAEF,MAAM,cAAc,GAAG,OA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K,CAAC,CAElB;QAAA,CAAC,cAAc,IAAI,CACjB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,CACvD,CACD;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAC9B;UAAA,CAAC,YAAY,IAAI,CACf,CAAC,KAAK,CACJ,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,QAAQ,CAAC,CACd,WAAW,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAChC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,qBAAqB,CACrB,WAAW,CAAC,yBAAyB,EACrC,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,CACvE;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport { TWCLASSMAP_TEXTFIELD_SIZE } from './TextField.constants';\nimport { TextFieldSize } from './TextField.types';\nimport type { TextFieldProps } from './TextField.types';\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n size = TextFieldSize.Md,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'rounded-lg',\n TWCLASSMAP_TEXTFIELD_SIZE[size],\n 'border',\n 'px-4',\n 'bg-default',\n 'border-default',\n isError && 'border-error-default',\n !isDisabled && isFocused && 'border-primary-default',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [size, isError, isFocused, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory && (\n <View style={tw.style('mr-2')}>{startAccessory}</View>\n )}\n <View style={tw.style('flex-1')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n twClassName=\"bg-transparent border-0\"\n />\n )}\n </View>\n {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}\n </Pressable>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"TextField.m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AAC,CACrD;UAAA,CAAC,YAAY,IAAI,CACf,CAAC,KAAK,CACJ,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,QAAQ,CAAC,CACd,WAAW,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAChC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,qBAAqB;QACrB,0FAA0F;QAC1F,uFAAuF;QACvF,WAAW,CAAC,kCAAkC,CAC9C,aAAa,CAAC,CAAC,CAAC,CAAC,CACjB,SAAS,CAAC,CAAC,KAAK,CAAC,EACjB,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,YAAY,CACf;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport type { TextFieldProps } from './TextField.types';\n\nfunction getContainerBorderColorClass(\n isDisabled: boolean,\n isFocused: boolean,\n isError: boolean,\n): string {\n if (isDisabled) {\n return 'border-muted';\n }\n if (isError) {\n return 'border-error-default';\n }\n if (isFocused) {\n return 'border-default';\n }\n return 'border-muted';\n}\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const borderColorClass = getContainerBorderColorClass(\n isDisabled,\n isFocused,\n isError,\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'gap-3',\n 'rounded-lg',\n 'h-12',\n 'border',\n borderColorClass,\n 'px-4',\n 'bg-muted',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [borderColorClass, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory}\n <View style={tw.style('min-h-0 flex-1 justify-center')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput\n // uses 46px height so the field matches a 48px-tall control without vertical overflow.\n twClassName=\"h-[46px] bg-transparent border-0\"\n numberOfLines={1}\n multiline={false}\n />\n )}\n </View>\n {endAccessory}\n </Pressable>\n );\n },\n);\n"]}
@@ -1,13 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextFieldSize = void 0;
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- var TextFieldSize;
8
- (function (TextFieldSize) {
9
- TextFieldSize["Sm"] = "sm";
10
- TextFieldSize["Md"] = "md";
11
- TextFieldSize["Lg"] = "lg";
12
- })(TextFieldSize || (exports.TextFieldSize = TextFieldSize = {}));
13
3
  //# sourceMappingURL=TextField.types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,0BAAS,CAAA;AACX,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextFieldSize enum.\n */\nexport enum TextFieldSize {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n}\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional prop for size of the TextField.\n *\n * @default TextFieldSize.Md\n */\n size?: TextFieldSize;\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
1
+ {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
@@ -1,24 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { InputProps } from "../Input/Input.types.cjs";
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- export declare enum TextFieldSize {
8
- Sm = "sm",
9
- Md = "md",
10
- Lg = "lg"
11
- }
12
4
  /**
13
5
  * TextField component props.
14
6
  */
15
7
  export type TextFieldProps = Omit<InputProps, 'textVariant' | 'isStateStylesDisabled' | 'style'> & {
16
- /**
17
- * Optional prop for size of the TextField.
18
- *
19
- * @default TextFieldSize.Md
20
- */
21
- size?: TextFieldSize;
22
8
  /**
23
9
  * Optional content to display before the Input.
24
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,oBAAY,aAAa;IACvB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -1,24 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { InputProps } from "../Input/Input.types.mjs";
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- export declare enum TextFieldSize {
8
- Sm = "sm",
9
- Md = "md",
10
- Lg = "lg"
11
- }
12
4
  /**
13
5
  * TextField component props.
14
6
  */
15
7
  export type TextFieldProps = Omit<InputProps, 'textVariant' | 'isStateStylesDisabled' | 'style'> & {
16
- /**
17
- * Optional prop for size of the TextField.
18
- *
19
- * @default TextFieldSize.Md
20
- */
21
- size?: TextFieldSize;
22
8
  /**
23
9
  * Optional content to display before the Input.
24
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,oBAAY,aAAa;IACvB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -1,10 +1,2 @@
1
- /**
2
- * TextFieldSize enum.
3
- */
4
- export var TextFieldSize;
5
- (function (TextFieldSize) {
6
- TextFieldSize["Sm"] = "sm";
7
- TextFieldSize["Md"] = "md";
8
- TextFieldSize["Lg"] = "lg";
9
- })(TextFieldSize || (TextFieldSize = {}));
1
+ export {};
10
2
  //# sourceMappingURL=TextField.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,0BAAS,CAAA;AACX,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextFieldSize enum.\n */\nexport enum TextFieldSize {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n}\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional prop for size of the TextField.\n *\n * @default TextFieldSize.Md\n */\n size?: TextFieldSize;\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
1
+ {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextFieldSize = exports.TextField = void 0;
3
+ exports.TextField = void 0;
4
4
  var TextField_1 = require("./TextField.cjs");
5
5
  Object.defineProperty(exports, "TextField", { enumerable: true, get: function () { return TextField_1.TextField; } });
6
- var TextField_types_1 = require("./TextField.types.cjs");
7
- Object.defineProperty(exports, "TextFieldSize", { enumerable: true, get: function () { return TextField_types_1.TextFieldSize; } });
8
6
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,yDAAkD;AAAzC,gHAAA,aAAa,OAAA","sourcesContent":["export { TextField } from './TextField';\nexport { TextFieldSize } from './TextField.types';\nexport type { TextFieldProps } from './TextField.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAA/B,sGAAA,SAAS,OAAA","sourcesContent":["export { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField.types';\n"]}
@@ -1,4 +1,3 @@
1
1
  export { TextField } from "./TextField.cjs";
2
- export { TextFieldSize } from "./TextField.types.cjs";
3
2
  export type { TextFieldProps } from "./TextField.types.cjs";
4
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAClD,YAAY,EAAE,cAAc,EAAE,8BAA0B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,YAAY,EAAE,cAAc,EAAE,8BAA0B"}
@@ -1,4 +1,3 @@
1
1
  export { TextField } from "./TextField.mjs";
2
- export { TextFieldSize } from "./TextField.types.mjs";
3
2
  export type { TextFieldProps } from "./TextField.types.mjs";
4
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAClD,YAAY,EAAE,cAAc,EAAE,8BAA0B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,YAAY,EAAE,cAAc,EAAE,8BAA0B"}
@@ -1,3 +1,2 @@
1
1
  export { TextField } from "./TextField.mjs";
2
- export { TextFieldSize } from "./TextField.types.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB;AACxC,OAAO,EAAE,aAAa,EAAE,8BAA0B","sourcesContent":["export { TextField } from './TextField';\nexport { TextFieldSize } from './TextField.types';\nexport type { TextFieldProps } from './TextField.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAoB","sourcesContent":["export { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField.types';\n"]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TextFieldSearch = void 0;
27
+ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
28
+ const react_1 = __importStar(require("react"));
29
+ const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
30
+ const Icon_1 = require("../Icon/index.cjs");
31
+ const TextField_1 = require("../TextField/index.cjs");
32
+ exports.TextFieldSearch = (0, react_1.forwardRef)(({ onPressClearButton, clearButtonProps, value, style, startAccessory, endAccessory, ...props }, ref) => {
33
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
34
+ const containerStyle = tw.style('rounded-full');
35
+ const searchIcon = (<Icon_1.Icon name={Icon_1.IconName.Search} size={Icon_1.IconSize.Md} color={Icon_1.IconColor.IconAlternative}/>);
36
+ const clearButtonHandler = (0, react_1.useCallback)(() => {
37
+ onPressClearButton();
38
+ }, [onPressClearButton]);
39
+ const clearButton = (<ButtonIcon_1.ButtonIcon size={ButtonIcon_1.ButtonIconSize.Md} iconName={Icon_1.IconName.CircleX} iconProps={{ color: Icon_1.IconColor.IconAlternative }} onPress={clearButtonHandler} {...clearButtonProps}/>);
40
+ return (<TextField_1.TextField ref={ref} {...props} value={value} startAccessory={startAccessory !== undefined ? startAccessory : searchIcon} endAccessory={endAccessory !== undefined
41
+ ? endAccessory
42
+ : Boolean(value) && clearButton} testID="textfieldsearch" style={[containerStyle, style]}/>);
43
+ });
44
+ exports.TextFieldSearch.displayName = 'TextFieldSearch';
45
+ //# sourceMappingURL=TextFieldSearch.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldSearch.cjs","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":";;;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,UAAU,CAC3D,CACD,YAAY,CAAC,CACX,YAAY,KAAK,SAAS;YACxB,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAClC,CACD,MAAM,CAAC,iBAAiB,CACxB,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { forwardRef, useCallback } from 'react';\nimport type { TextInput } from 'react-native';\n\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Icon, IconColor, IconName, IconSize } from '../Icon';\nimport { TextField } from '../TextField';\n\nimport type { TextFieldSearchProps } from './TextFieldSearch.types';\n\nexport const TextFieldSearch = forwardRef<TextInput, TextFieldSearchProps>(\n (\n {\n onPressClearButton,\n clearButtonProps,\n value,\n style,\n startAccessory,\n endAccessory,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const containerStyle = tw.style('rounded-full');\n\n const searchIcon = (\n <Icon\n name={IconName.Search}\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n />\n );\n\n const clearButtonHandler = useCallback(() => {\n onPressClearButton();\n }, [onPressClearButton]);\n\n const clearButton = (\n <ButtonIcon\n size={ButtonIconSize.Md}\n iconName={IconName.CircleX}\n iconProps={{ color: IconColor.IconAlternative }}\n onPress={clearButtonHandler}\n {...clearButtonProps}\n />\n );\n\n return (\n <TextField\n ref={ref}\n {...props}\n value={value}\n startAccessory={\n startAccessory !== undefined ? startAccessory : searchIcon\n }\n endAccessory={\n endAccessory !== undefined\n ? endAccessory\n : Boolean(value) && clearButton\n }\n testID=\"textfieldsearch\"\n style={[containerStyle, style]}\n />\n );\n },\n);\n\nTextFieldSearch.displayName = 'TextFieldSearch';\n"]}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { TextInput } from "react-native/index.js";
3
+ export declare const TextFieldSearch: React.ForwardRefExoticComponent<Omit<import("../index.cjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
+ startAccessory?: React.ReactNode;
5
+ endAccessory?: React.ReactNode;
6
+ isError?: boolean | undefined;
7
+ inputElement?: React.ReactNode;
8
+ twClassName?: string | undefined;
9
+ style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
10
+ } & {
11
+ clearButtonProps?: Partial<import("../ButtonIcon/index.cjs").ButtonIconProps> | undefined;
12
+ onPressClearButton: () => void;
13
+ } & React.RefAttributes<TextInput>>;
14
+ //# sourceMappingURL=TextFieldSearch.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldSearch.d.cts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAQ9C,eAAO,MAAM,eAAe;;;;;;;;;;mCAwD3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { TextInput } from "react-native/index.js";
3
+ export declare const TextFieldSearch: React.ForwardRefExoticComponent<Omit<import("../index.mjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
+ startAccessory?: React.ReactNode;
5
+ endAccessory?: React.ReactNode;
6
+ isError?: boolean | undefined;
7
+ inputElement?: React.ReactNode;
8
+ twClassName?: string | undefined;
9
+ style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
10
+ } & {
11
+ clearButtonProps?: Partial<import("../ButtonIcon/index.mjs").ButtonIconProps> | undefined;
12
+ onPressClearButton: () => void;
13
+ } & React.RefAttributes<TextInput>>;
14
+ //# sourceMappingURL=TextFieldSearch.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldSearch.d.mts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAQ9C,eAAO,MAAM,eAAe;;;;;;;;;;mCAwD3B,CAAC"}
@@ -0,0 +1,26 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
+ import $React, { forwardRef, useCallback } from "react";
9
+ const React = $importDefault($React);
10
+ import { ButtonIcon, ButtonIconSize } from "../ButtonIcon/index.mjs";
11
+ import { Icon, IconColor, IconName, IconSize } from "../Icon/index.mjs";
12
+ import { TextField } from "../TextField/index.mjs";
13
+ export const TextFieldSearch = forwardRef(({ onPressClearButton, clearButtonProps, value, style, startAccessory, endAccessory, ...props }, ref) => {
14
+ const tw = useTailwind();
15
+ const containerStyle = tw.style('rounded-full');
16
+ const searchIcon = (<Icon name={IconName.Search} size={IconSize.Md} color={IconColor.IconAlternative}/>);
17
+ const clearButtonHandler = useCallback(() => {
18
+ onPressClearButton();
19
+ }, [onPressClearButton]);
20
+ const clearButton = (<ButtonIcon size={ButtonIconSize.Md} iconName={IconName.CircleX} iconProps={{ color: IconColor.IconAlternative }} onPress={clearButtonHandler} {...clearButtonProps}/>);
21
+ return (<TextField ref={ref} {...props} value={value} startAccessory={startAccessory !== undefined ? startAccessory : searchIcon} endAccessory={endAccessory !== undefined
22
+ ? endAccessory
23
+ : Boolean(value) && clearButton} testID="textfieldsearch" style={[containerStyle, style]}/>);
24
+ });
25
+ TextFieldSearch.displayName = 'TextFieldSearch';
26
+ //# sourceMappingURL=TextFieldSearch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldSearch.mjs","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,UAAU,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AAc,CAAC,CACb,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAC3D,CACD,YAAY,CAAC,CACX,YAAY,KAAK,SAAS;YACxB,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAClC,CACD,MAAM,CAAC,iBAAiB,CACxB,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { forwardRef, useCallback } from 'react';\nimport type { TextInput } from 'react-native';\n\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Icon, IconColor, IconName, IconSize } from '../Icon';\nimport { TextField } from '../TextField';\n\nimport type { TextFieldSearchProps } from './TextFieldSearch.types';\n\nexport const TextFieldSearch = forwardRef<TextInput, TextFieldSearchProps>(\n (\n {\n onPressClearButton,\n clearButtonProps,\n value,\n style,\n startAccessory,\n endAccessory,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const containerStyle = tw.style('rounded-full');\n\n const searchIcon = (\n <Icon\n name={IconName.Search}\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n />\n );\n\n const clearButtonHandler = useCallback(() => {\n onPressClearButton();\n }, [onPressClearButton]);\n\n const clearButton = (\n <ButtonIcon\n size={ButtonIconSize.Md}\n iconName={IconName.CircleX}\n iconProps={{ color: IconColor.IconAlternative }}\n onPress={clearButtonHandler}\n {...clearButtonProps}\n />\n );\n\n return (\n <TextField\n ref={ref}\n {...props}\n value={value}\n startAccessory={\n startAccessory !== undefined ? startAccessory : searchIcon\n }\n endAccessory={\n endAccessory !== undefined\n ? endAccessory\n : Boolean(value) && clearButton\n }\n testID=\"textfieldsearch\"\n style={[containerStyle, style]}\n />\n );\n },\n);\n\nTextFieldSearch.displayName = 'TextFieldSearch';\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TextFieldSearch.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldSearch.types.cjs","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.types.ts"],"names":[],"mappings":"","sourcesContent":["// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextFieldProps } from '../TextField';\n\n/**\n * TextFieldSearch component props.\n */\nexport type TextFieldSearchProps = TextFieldProps & {\n /**\n * Optional prop to pass any additional props to the clear button.\n */\n clearButtonProps?: Partial<ButtonIconProps>;\n /**\n * Function to trigger when pressing the clear button.\n * The clear button is automatically shown when the input has a value.\n */\n onPressClearButton: () => void;\n};\n"]}