@metamask/design-system-react 0.24.0 → 0.26.0

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 (296) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/dist/components/AvatarBase/AvatarBase.cjs +1 -1
  3. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  4. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  5. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  6. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -1
  7. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  8. package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -1
  9. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  10. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +2 -2
  11. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
  12. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +2 -2
  13. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
  14. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +2 -3
  15. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  16. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
  17. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
  18. package/dist/components/AvatarNetwork/AvatarNetwork.mjs +2 -3
  19. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  20. package/dist/components/AvatarNetwork/index.cjs +2 -2
  21. package/dist/components/AvatarNetwork/index.cjs.map +1 -1
  22. package/dist/components/AvatarNetwork/index.d.cts +1 -1
  23. package/dist/components/AvatarNetwork/index.d.cts.map +1 -1
  24. package/dist/components/AvatarNetwork/index.d.mts +1 -1
  25. package/dist/components/AvatarNetwork/index.d.mts.map +1 -1
  26. package/dist/components/AvatarNetwork/index.mjs +1 -1
  27. package/dist/components/AvatarNetwork/index.mjs.map +1 -1
  28. package/dist/components/AvatarToken/AvatarToken.cjs +2 -2
  29. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  30. package/dist/components/AvatarToken/AvatarToken.mjs +2 -2
  31. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  32. package/dist/components/BannerAlert/BannerAlert.cjs +1 -2
  33. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
  34. package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -9
  35. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
  36. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +1 -2
  37. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
  38. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +1 -2
  39. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
  40. package/dist/components/BannerAlert/BannerAlert.constants.mjs +1 -2
  41. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
  42. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
  43. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
  44. package/dist/components/BannerAlert/BannerAlert.mjs +1 -2
  45. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
  46. package/dist/components/FormTextField/FormTextField.cjs +38 -0
  47. package/dist/components/FormTextField/FormTextField.cjs.map +1 -0
  48. package/dist/components/FormTextField/FormTextField.d.cts +4 -0
  49. package/dist/components/FormTextField/FormTextField.d.cts.map +1 -0
  50. package/dist/components/FormTextField/FormTextField.d.mts +4 -0
  51. package/dist/components/FormTextField/FormTextField.d.mts.map +1 -0
  52. package/dist/components/FormTextField/FormTextField.mjs +19 -0
  53. package/dist/components/FormTextField/FormTextField.mjs.map +1 -0
  54. package/dist/components/FormTextField/FormTextField.types.cjs +3 -0
  55. package/dist/components/FormTextField/FormTextField.types.cjs.map +1 -0
  56. package/dist/components/FormTextField/FormTextField.types.d.cts +50 -0
  57. package/dist/components/FormTextField/FormTextField.types.d.cts.map +1 -0
  58. package/dist/components/FormTextField/FormTextField.types.d.mts +50 -0
  59. package/dist/components/FormTextField/FormTextField.types.d.mts.map +1 -0
  60. package/dist/components/FormTextField/FormTextField.types.mjs +2 -0
  61. package/dist/components/FormTextField/FormTextField.types.mjs.map +1 -0
  62. package/dist/components/FormTextField/index.cjs +6 -0
  63. package/dist/components/FormTextField/index.cjs.map +1 -0
  64. package/dist/components/FormTextField/index.d.cts +3 -0
  65. package/dist/components/FormTextField/index.d.cts.map +1 -0
  66. package/dist/components/FormTextField/index.d.mts +3 -0
  67. package/dist/components/FormTextField/index.d.mts.map +1 -0
  68. package/dist/components/FormTextField/index.mjs +2 -0
  69. package/dist/components/FormTextField/index.mjs.map +1 -0
  70. package/dist/components/Icon/Icon.cjs +2 -2
  71. package/dist/components/Icon/Icon.cjs.map +1 -1
  72. package/dist/components/Icon/Icon.constants.cjs +6 -6
  73. package/dist/components/Icon/Icon.constants.cjs.map +1 -1
  74. package/dist/components/Icon/Icon.constants.d.cts +1 -1
  75. package/dist/components/Icon/Icon.constants.d.cts.map +1 -1
  76. package/dist/components/Icon/Icon.constants.d.mts +1 -1
  77. package/dist/components/Icon/Icon.constants.d.mts.map +1 -1
  78. package/dist/components/Icon/Icon.constants.mjs +1 -1
  79. package/dist/components/Icon/Icon.constants.mjs.map +1 -1
  80. package/dist/components/Icon/Icon.d.cts.map +1 -1
  81. package/dist/components/Icon/Icon.d.mts.map +1 -1
  82. package/dist/components/Icon/Icon.mjs +1 -1
  83. package/dist/components/Icon/Icon.mjs.map +1 -1
  84. package/dist/components/Icon/index.cjs +4 -4
  85. package/dist/components/Icon/index.cjs.map +1 -1
  86. package/dist/components/Icon/index.d.cts +1 -1
  87. package/dist/components/Icon/index.d.cts.map +1 -1
  88. package/dist/components/Icon/index.d.mts +1 -1
  89. package/dist/components/Icon/index.d.mts.map +1 -1
  90. package/dist/components/Icon/index.mjs +1 -1
  91. package/dist/components/Icon/index.mjs.map +1 -1
  92. package/dist/components/Popover/Popover.cjs +129 -0
  93. package/dist/components/Popover/Popover.cjs.map +1 -0
  94. package/dist/components/Popover/Popover.constants.cjs +28 -0
  95. package/dist/components/Popover/Popover.constants.cjs.map +1 -0
  96. package/dist/components/Popover/Popover.constants.d.cts +12 -0
  97. package/dist/components/Popover/Popover.constants.d.cts.map +1 -0
  98. package/dist/components/Popover/Popover.constants.d.mts +12 -0
  99. package/dist/components/Popover/Popover.constants.d.mts.map +1 -0
  100. package/dist/components/Popover/Popover.constants.mjs +25 -0
  101. package/dist/components/Popover/Popover.constants.mjs.map +1 -0
  102. package/dist/components/Popover/Popover.d.cts +4 -0
  103. package/dist/components/Popover/Popover.d.cts.map +1 -0
  104. package/dist/components/Popover/Popover.d.mts +4 -0
  105. package/dist/components/Popover/Popover.d.mts.map +1 -0
  106. package/dist/components/Popover/Popover.mjs +110 -0
  107. package/dist/components/Popover/Popover.mjs.map +1 -0
  108. package/dist/components/Popover/Popover.types.cjs +33 -0
  109. package/dist/components/Popover/Popover.types.cjs.map +1 -0
  110. package/dist/components/Popover/Popover.types.d.cts +128 -0
  111. package/dist/components/Popover/Popover.types.d.cts.map +1 -0
  112. package/dist/components/Popover/Popover.types.d.mts +128 -0
  113. package/dist/components/Popover/Popover.types.d.mts.map +1 -0
  114. package/dist/components/Popover/Popover.types.mjs +30 -0
  115. package/dist/components/Popover/Popover.types.mjs.map +1 -0
  116. package/dist/components/Popover/index.cjs +9 -0
  117. package/dist/components/Popover/index.cjs.map +1 -0
  118. package/dist/components/Popover/index.d.cts +4 -0
  119. package/dist/components/Popover/index.d.cts.map +1 -0
  120. package/dist/components/Popover/index.d.mts +4 -0
  121. package/dist/components/Popover/index.d.mts.map +1 -0
  122. package/dist/components/Popover/index.mjs +3 -0
  123. package/dist/components/Popover/index.mjs.map +1 -0
  124. package/dist/components/Tag/Tag.cjs +51 -0
  125. package/dist/components/Tag/Tag.cjs.map +1 -0
  126. package/dist/components/Tag/Tag.constants.cjs +26 -0
  127. package/dist/components/Tag/Tag.constants.cjs.map +1 -0
  128. package/dist/components/Tag/Tag.constants.d.cts +5 -0
  129. package/dist/components/Tag/Tag.constants.d.cts.map +1 -0
  130. package/dist/components/Tag/Tag.constants.d.mts +5 -0
  131. package/dist/components/Tag/Tag.constants.d.mts.map +1 -0
  132. package/dist/components/Tag/Tag.constants.mjs +23 -0
  133. package/dist/components/Tag/Tag.constants.mjs.map +1 -0
  134. package/dist/components/Tag/Tag.d.cts +4 -0
  135. package/dist/components/Tag/Tag.d.cts.map +1 -0
  136. package/dist/components/Tag/Tag.d.mts +4 -0
  137. package/dist/components/Tag/Tag.d.mts.map +1 -0
  138. package/dist/components/Tag/Tag.mjs +32 -0
  139. package/dist/components/Tag/Tag.mjs.map +1 -0
  140. package/dist/components/Tag/Tag.types.cjs +3 -0
  141. package/dist/components/Tag/Tag.types.cjs.map +1 -0
  142. package/dist/components/Tag/Tag.types.d.cts +31 -0
  143. package/dist/components/Tag/Tag.types.d.cts.map +1 -0
  144. package/dist/components/Tag/Tag.types.d.mts +31 -0
  145. package/dist/components/Tag/Tag.types.d.mts.map +1 -0
  146. package/dist/components/Tag/Tag.types.mjs +2 -0
  147. package/dist/components/Tag/Tag.types.mjs.map +1 -0
  148. package/dist/components/Tag/index.cjs +8 -0
  149. package/dist/components/Tag/index.cjs.map +1 -0
  150. package/dist/components/Tag/index.d.cts +4 -0
  151. package/dist/components/Tag/index.d.cts.map +1 -0
  152. package/dist/components/Tag/index.d.mts +4 -0
  153. package/dist/components/Tag/index.d.mts.map +1 -0
  154. package/dist/components/Tag/index.mjs +3 -0
  155. package/dist/components/Tag/index.mjs.map +1 -0
  156. package/dist/components/TextArea/TextArea.cjs +37 -0
  157. package/dist/components/TextArea/TextArea.cjs.map +1 -0
  158. package/dist/components/TextArea/TextArea.constants.cjs +35 -0
  159. package/dist/components/TextArea/TextArea.constants.cjs.map +1 -0
  160. package/dist/components/TextArea/TextArea.constants.d.cts +28 -0
  161. package/dist/components/TextArea/TextArea.constants.d.cts.map +1 -0
  162. package/dist/components/TextArea/TextArea.constants.d.mts +28 -0
  163. package/dist/components/TextArea/TextArea.constants.d.mts.map +1 -0
  164. package/dist/components/TextArea/TextArea.constants.mjs +32 -0
  165. package/dist/components/TextArea/TextArea.constants.mjs.map +1 -0
  166. package/dist/components/TextArea/TextArea.d.cts +9 -0
  167. package/dist/components/TextArea/TextArea.d.cts.map +1 -0
  168. package/dist/components/TextArea/TextArea.d.mts +9 -0
  169. package/dist/components/TextArea/TextArea.d.mts.map +1 -0
  170. package/dist/components/TextArea/TextArea.mjs +18 -0
  171. package/dist/components/TextArea/TextArea.mjs.map +1 -0
  172. package/dist/components/TextArea/TextArea.types.cjs +3 -0
  173. package/dist/components/TextArea/TextArea.types.cjs.map +1 -0
  174. package/dist/components/TextArea/TextArea.types.d.cts +33 -0
  175. package/dist/components/TextArea/TextArea.types.d.cts.map +1 -0
  176. package/dist/components/TextArea/TextArea.types.d.mts +33 -0
  177. package/dist/components/TextArea/TextArea.types.d.mts.map +1 -0
  178. package/dist/components/TextArea/TextArea.types.mjs +2 -0
  179. package/dist/components/TextArea/TextArea.types.mjs.map +1 -0
  180. package/dist/components/TextArea/index.cjs +8 -0
  181. package/dist/components/TextArea/index.cjs.map +1 -0
  182. package/dist/components/TextArea/index.d.cts +4 -0
  183. package/dist/components/TextArea/index.d.cts.map +1 -0
  184. package/dist/components/TextArea/index.d.mts +4 -0
  185. package/dist/components/TextArea/index.d.mts.map +1 -0
  186. package/dist/components/TextArea/index.mjs +3 -0
  187. package/dist/components/TextArea/index.mjs.map +1 -0
  188. package/dist/components/TextButton/TextButton.cjs +7 -28
  189. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  190. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  191. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  192. package/dist/components/TextButton/TextButton.mjs +7 -28
  193. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  194. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  195. package/dist/components/TextButton/TextButton.types.d.cts +9 -25
  196. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  197. package/dist/components/TextButton/TextButton.types.d.mts +9 -25
  198. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  199. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  200. package/dist/components/TextButton/index.cjs +1 -3
  201. package/dist/components/TextButton/index.cjs.map +1 -1
  202. package/dist/components/TextButton/index.d.cts +0 -1
  203. package/dist/components/TextButton/index.d.cts.map +1 -1
  204. package/dist/components/TextButton/index.d.mts +0 -1
  205. package/dist/components/TextButton/index.d.mts.map +1 -1
  206. package/dist/components/TextButton/index.mjs +0 -1
  207. package/dist/components/TextButton/index.mjs.map +1 -1
  208. package/dist/components/TextFieldSearch/TextFieldSearch.cjs +40 -0
  209. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
  210. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +6 -0
  211. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
  212. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +6 -0
  213. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
  214. package/dist/components/TextFieldSearch/TextFieldSearch.mjs +21 -0
  215. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
  216. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
  217. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
  218. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
  219. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
  220. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
  221. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
  222. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
  223. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
  224. package/dist/components/TextFieldSearch/index.cjs +6 -0
  225. package/dist/components/TextFieldSearch/index.cjs.map +1 -0
  226. package/dist/components/TextFieldSearch/index.d.cts +3 -0
  227. package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
  228. package/dist/components/TextFieldSearch/index.d.mts +3 -0
  229. package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
  230. package/dist/components/TextFieldSearch/index.mjs +2 -0
  231. package/dist/components/TextFieldSearch/index.mjs.map +1 -0
  232. package/dist/components/Toast/Toast.cjs +73 -0
  233. package/dist/components/Toast/Toast.cjs.map +1 -0
  234. package/dist/components/Toast/Toast.constants.cjs +24 -0
  235. package/dist/components/Toast/Toast.constants.cjs.map +1 -0
  236. package/dist/components/Toast/Toast.constants.d.cts +16 -0
  237. package/dist/components/Toast/Toast.constants.d.cts.map +1 -0
  238. package/dist/components/Toast/Toast.constants.d.mts +16 -0
  239. package/dist/components/Toast/Toast.constants.d.mts.map +1 -0
  240. package/dist/components/Toast/Toast.constants.mjs +19 -0
  241. package/dist/components/Toast/Toast.constants.mjs.map +1 -0
  242. package/dist/components/Toast/Toast.d.cts +4 -0
  243. package/dist/components/Toast/Toast.d.cts.map +1 -0
  244. package/dist/components/Toast/Toast.d.mts +4 -0
  245. package/dist/components/Toast/Toast.d.mts.map +1 -0
  246. package/dist/components/Toast/Toast.mjs +54 -0
  247. package/dist/components/Toast/Toast.mjs.map +1 -0
  248. package/dist/components/Toast/Toast.types.cjs +3 -0
  249. package/dist/components/Toast/Toast.types.cjs.map +1 -0
  250. package/dist/components/Toast/Toast.types.d.cts +60 -0
  251. package/dist/components/Toast/Toast.types.d.cts.map +1 -0
  252. package/dist/components/Toast/Toast.types.d.mts +60 -0
  253. package/dist/components/Toast/Toast.types.d.mts.map +1 -0
  254. package/dist/components/Toast/Toast.types.mjs +2 -0
  255. package/dist/components/Toast/Toast.types.mjs.map +1 -0
  256. package/dist/components/Toast/Toaster.cjs +210 -0
  257. package/dist/components/Toast/Toaster.cjs.map +1 -0
  258. package/dist/components/Toast/Toaster.d.cts +11 -0
  259. package/dist/components/Toast/Toaster.d.cts.map +1 -0
  260. package/dist/components/Toast/Toaster.d.mts +11 -0
  261. package/dist/components/Toast/Toaster.d.mts.map +1 -0
  262. package/dist/components/Toast/Toaster.mjs +191 -0
  263. package/dist/components/Toast/Toaster.mjs.map +1 -0
  264. package/dist/components/Toast/index.cjs +11 -0
  265. package/dist/components/Toast/index.cjs.map +1 -0
  266. package/dist/components/Toast/index.d.cts +5 -0
  267. package/dist/components/Toast/index.d.cts.map +1 -0
  268. package/dist/components/Toast/index.d.mts +5 -0
  269. package/dist/components/Toast/index.d.mts.map +1 -0
  270. package/dist/components/Toast/index.mjs +4 -0
  271. package/dist/components/Toast/index.mjs.map +1 -0
  272. package/dist/components/index.cjs +21 -2
  273. package/dist/components/index.cjs.map +1 -1
  274. package/dist/components/index.d.cts +13 -1
  275. package/dist/components/index.d.cts.map +1 -1
  276. package/dist/components/index.d.mts +13 -1
  277. package/dist/components/index.d.mts.map +1 -1
  278. package/dist/components/index.mjs +7 -1
  279. package/dist/components/index.mjs.map +1 -1
  280. package/dist/types/index.cjs +2 -23
  281. package/dist/types/index.cjs.map +1 -1
  282. package/dist/types/index.d.cts +1 -14
  283. package/dist/types/index.d.cts.map +1 -1
  284. package/dist/types/index.d.mts +1 -14
  285. package/dist/types/index.d.mts.map +1 -1
  286. package/dist/types/index.mjs +1 -15
  287. package/dist/types/index.mjs.map +1 -1
  288. package/package.json +7 -5
  289. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  290. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  291. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  292. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  293. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  294. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  295. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  296. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
@@ -0,0 +1,37 @@
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.TextArea = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const tw_merge_1 = require("../../utils/tw-merge.cjs");
29
+ const TextArea_constants_1 = require("./TextArea.constants.cjs");
30
+ exports.TextArea = (0, react_1.forwardRef)(({ value, placeholder, autoFocus = false, isDisabled = false, isReadOnly = false, isError = false, onBlur, onChange, onFocus, resize = TextArea_constants_1.TextAreaResize.None, className, ...props }, ref) => {
31
+ const textAreaClassName = (0, tw_merge_1.twMerge)('m-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors', 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md', 'placeholder:text-alternative', TextArea_constants_1.CLASSMAP_TEXTAREA_RESIZE[resize], 'border-muted', isDisabled && 'cursor-not-allowed border-muted opacity-50', !isDisabled && isError && 'border-error-default', !isDisabled &&
32
+ !isError &&
33
+ 'focus:border-default read-only:focus:border-muted', className);
34
+ return (react_1.default.createElement("textarea", { ...props, ref: ref, value: value, placeholder: placeholder, className: textAreaClassName, disabled: isDisabled, readOnly: isReadOnly, autoFocus: autoFocus, "aria-invalid": isError || undefined, onChange: onChange, onFocus: onFocus, onBlur: onBlur }));
35
+ });
36
+ exports.TextArea.displayName = 'TextArea';
37
+ //# sourceMappingURL=TextArea.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,uDAA+C;AAE/C,iEAAgF;AAGnE,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,mCAAc,CAAC,IAAI,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,iBAAiB,GAAG,IAAA,kBAAO,EAC/B,4GAA4G,EAC5G,+HAA+H,EAC/H,8BAA8B,EAC9B,6CAAwB,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,UAAU,IAAI,4CAA4C,EAC1D,CAAC,UAAU,IAAI,OAAO,IAAI,sBAAsB,EAChD,CAAC,UAAU;QACT,CAAC,OAAO;QACR,mDAAmD,EACrD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,+CACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,SAAS,kBACN,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from './TextArea.constants';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n value,\n placeholder,\n autoFocus = false,\n isDisabled = false,\n isReadOnly = false,\n isError = false,\n onBlur,\n onChange,\n onFocus,\n resize = TextAreaResize.None,\n className,\n ...props\n },\n ref,\n ) => {\n const textAreaClassName = twMerge(\n 'm-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors',\n 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n 'placeholder:text-alternative',\n CLASSMAP_TEXTAREA_RESIZE[resize],\n 'border-muted',\n isDisabled && 'cursor-not-allowed border-muted opacity-50',\n !isDisabled && isError && 'border-error-default',\n !isDisabled &&\n !isError &&\n 'focus:border-default read-only:focus:border-muted',\n className,\n );\n\n return (\n <textarea\n {...props}\n ref={ref}\n value={value}\n placeholder={placeholder}\n className={textAreaClassName}\n disabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n aria-invalid={isError || undefined}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n"]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLASSMAP_TEXTAREA_RESIZE = exports.TextAreaResize = void 0;
4
+ /**
5
+ * TextAreaResize - resize
6
+ * Controls the resize behavior of the textarea element.
7
+ */
8
+ exports.TextAreaResize = {
9
+ /**
10
+ * The textarea cannot be resized.
11
+ */
12
+ None: 'none',
13
+ /**
14
+ * The textarea can be resized both horizontally and vertically.
15
+ */
16
+ Both: 'both',
17
+ /**
18
+ * The textarea can only be resized horizontally.
19
+ */
20
+ Horizontal: 'horizontal',
21
+ /**
22
+ * The textarea can only be resized vertically.
23
+ */
24
+ Vertical: 'vertical',
25
+ };
26
+ /**
27
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
28
+ */
29
+ exports.CLASSMAP_TEXTAREA_RESIZE = {
30
+ [exports.TextAreaResize.None]: 'resize-none',
31
+ [exports.TextAreaResize.Both]: 'resize',
32
+ [exports.TextAreaResize.Horizontal]: 'resize-x',
33
+ [exports.TextAreaResize.Vertical]: 'resize-y',
34
+ };
35
+ //# sourceMappingURL=TextArea.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,cAAc,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIX;;GAEG;AACU,QAAA,wBAAwB,GAAmC;IACtE,CAAC,sBAAc,CAAC,IAAI,CAAC,EAAE,aAAa;IACpC,CAAC,sBAAc,CAAC,IAAI,CAAC,EAAE,QAAQ;IAC/B,CAAC,sBAAc,CAAC,UAAU,CAAC,EAAE,UAAU;IACvC,CAAC,sBAAc,CAAC,QAAQ,CAAC,EAAE,UAAU;CACtC,CAAC","sourcesContent":["/**\n * TextAreaResize - resize\n * Controls the resize behavior of the textarea element.\n */\nexport const TextAreaResize = {\n /**\n * The textarea cannot be resized.\n */\n None: 'none',\n /**\n * The textarea can be resized both horizontally and vertically.\n */\n Both: 'both',\n /**\n * The textarea can only be resized horizontally.\n */\n Horizontal: 'horizontal',\n /**\n * The textarea can only be resized vertically.\n */\n Vertical: 'vertical',\n} as const;\nexport type TextAreaResize =\n (typeof TextAreaResize)[keyof typeof TextAreaResize];\n\n/**\n * Maps TextAreaResize values to Tailwind CSS resize classes.\n */\nexport const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string> = {\n [TextAreaResize.None]: 'resize-none',\n [TextAreaResize.Both]: 'resize',\n [TextAreaResize.Horizontal]: 'resize-x',\n [TextAreaResize.Vertical]: 'resize-y',\n};\n"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export declare const TextAreaResize: {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ readonly None: "none";
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ readonly Both: "both";
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ readonly Horizontal: "horizontal";
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ readonly Vertical: "vertical";
22
+ };
23
+ export type TextAreaResize = (typeof TextAreaResize)[keyof typeof TextAreaResize];
24
+ /**
25
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
26
+ */
27
+ export declare const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string>;
28
+ //# sourceMappingURL=TextArea.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnE,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export declare const TextAreaResize: {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ readonly None: "none";
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ readonly Both: "both";
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ readonly Horizontal: "horizontal";
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ readonly Vertical: "vertical";
22
+ };
23
+ export type TextAreaResize = (typeof TextAreaResize)[keyof typeof TextAreaResize];
24
+ /**
25
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
26
+ */
27
+ export declare const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string>;
28
+ //# sourceMappingURL=TextArea.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnE,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * TextAreaResize - resize
3
+ * Controls the resize behavior of the textarea element.
4
+ */
5
+ export const TextAreaResize = {
6
+ /**
7
+ * The textarea cannot be resized.
8
+ */
9
+ None: 'none',
10
+ /**
11
+ * The textarea can be resized both horizontally and vertically.
12
+ */
13
+ Both: 'both',
14
+ /**
15
+ * The textarea can only be resized horizontally.
16
+ */
17
+ Horizontal: 'horizontal',
18
+ /**
19
+ * The textarea can only be resized vertically.
20
+ */
21
+ Vertical: 'vertical',
22
+ };
23
+ /**
24
+ * Maps TextAreaResize values to Tailwind CSS resize classes.
25
+ */
26
+ export const CLASSMAP_TEXTAREA_RESIZE = {
27
+ [TextAreaResize.None]: 'resize-none',
28
+ [TextAreaResize.Both]: 'resize',
29
+ [TextAreaResize.Horizontal]: 'resize-x',
30
+ [TextAreaResize.Vertical]: 'resize-y',
31
+ };
32
+ //# sourceMappingURL=TextArea.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.constants.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmC;IACtE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,aAAa;IACpC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ;IAC/B,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU;IACvC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU;CACtC,CAAC","sourcesContent":["/**\n * TextAreaResize - resize\n * Controls the resize behavior of the textarea element.\n */\nexport const TextAreaResize = {\n /**\n * The textarea cannot be resized.\n */\n None: 'none',\n /**\n * The textarea can be resized both horizontally and vertically.\n */\n Both: 'both',\n /**\n * The textarea can only be resized horizontally.\n */\n Horizontal: 'horizontal',\n /**\n * The textarea can only be resized vertically.\n */\n Vertical: 'vertical',\n} as const;\nexport type TextAreaResize =\n (typeof TextAreaResize)[keyof typeof TextAreaResize];\n\n/**\n * Maps TextAreaResize values to Tailwind CSS resize classes.\n */\nexport const CLASSMAP_TEXTAREA_RESIZE: Record<TextAreaResize, string> = {\n [TextAreaResize.None]: 'resize-none',\n [TextAreaResize.Both]: 'resize',\n [TextAreaResize.Horizontal]: 'resize-x',\n [TextAreaResize.Vertical]: 'resize-y',\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { TextAreaResize } from "./TextArea.constants.cjs";
3
+ export declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "value" | "disabled" | "placeholder" | "readOnly" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange"> & Omit<import("@metamask/design-system-shared").TextAreaPropsShared, "textVariant"> & {
4
+ resize?: TextAreaResize | undefined;
5
+ onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement, Element>) => void) | undefined;
6
+ onFocus?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
7
+ onBlur?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
8
+ } & React.RefAttributes<HTMLTextAreaElement>>;
9
+ //# sourceMappingURL=TextArea.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,EAA4B,cAAc,EAAE,iCAA6B;AAGhF,eAAO,MAAM,QAAQ;;;;;6CAiDpB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { TextAreaResize } from "./TextArea.constants.mjs";
3
+ export declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "value" | "disabled" | "placeholder" | "readOnly" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange"> & Omit<import("@metamask/design-system-shared").TextAreaPropsShared, "textVariant"> & {
4
+ resize?: TextAreaResize | undefined;
5
+ onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement, Element>) => void) | undefined;
6
+ onFocus?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
7
+ onBlur?: ((event: React.FocusEvent<HTMLTextAreaElement, Element>) => void) | undefined;
8
+ } & React.RefAttributes<HTMLTextAreaElement>>;
9
+ //# sourceMappingURL=TextArea.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,EAA4B,cAAc,EAAE,iCAA6B;AAGhF,eAAO,MAAM,QAAQ;;;;;6CAiDpB,CAAC"}
@@ -0,0 +1,18 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import $React, { forwardRef } from "react";
8
+ const React = $importDefault($React);
9
+ import { twMerge } from "../../utils/tw-merge.mjs";
10
+ import { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from "./TextArea.constants.mjs";
11
+ export const TextArea = forwardRef(({ value, placeholder, autoFocus = false, isDisabled = false, isReadOnly = false, isError = false, onBlur, onChange, onFocus, resize = TextAreaResize.None, className, ...props }, ref) => {
12
+ const textAreaClassName = twMerge('m-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors', 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md', 'placeholder:text-alternative', CLASSMAP_TEXTAREA_RESIZE[resize], 'border-muted', isDisabled && 'cursor-not-allowed border-muted opacity-50', !isDisabled && isError && 'border-error-default', !isDisabled &&
13
+ !isError &&
14
+ 'focus:border-default read-only:focus:border-muted', className);
15
+ return (React.createElement("textarea", { ...props, ref: ref, value: value, placeholder: placeholder, className: textAreaClassName, disabled: isDisabled, readOnly: isReadOnly, autoFocus: autoFocus, "aria-invalid": isError || undefined, onChange: onChange, onFocus: onFocus, onBlur: onBlur }));
16
+ });
17
+ TextArea.displayName = 'TextArea';
18
+ //# sourceMappingURL=TextArea.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,iCAA6B;AAGhF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,cAAc,CAAC,IAAI,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,iBAAiB,GAAG,OAAO,CAC/B,4GAA4G,EAC5G,+HAA+H,EAC/H,8BAA8B,EAC9B,wBAAwB,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,UAAU,IAAI,4CAA4C,EAC1D,CAAC,UAAU,IAAI,OAAO,IAAI,sBAAsB,EAChD,CAAC,UAAU;QACT,CAAC,OAAO;QACR,mDAAmD,EACrD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,qCACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,SAAS,kBACN,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport { CLASSMAP_TEXTAREA_RESIZE, TextAreaResize } from './TextArea.constants';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n value,\n placeholder,\n autoFocus = false,\n isDisabled = false,\n isReadOnly = false,\n isError = false,\n onBlur,\n onChange,\n onFocus,\n resize = TextAreaResize.None,\n className,\n ...props\n },\n ref,\n ) => {\n const textAreaClassName = twMerge(\n 'm-0 block min-h-24 w-full rounded-lg border bg-muted px-4 py-3 text-default outline-none transition-colors',\n 'text-s-body-md font-regular leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n 'placeholder:text-alternative',\n CLASSMAP_TEXTAREA_RESIZE[resize],\n 'border-muted',\n isDisabled && 'cursor-not-allowed border-muted opacity-50',\n !isDisabled && isError && 'border-error-default',\n !isDisabled &&\n !isError &&\n 'focus:border-default read-only:focus:border-muted',\n className,\n );\n\n return (\n <textarea\n {...props}\n ref={ref}\n value={value}\n placeholder={placeholder}\n className={textAreaClassName}\n disabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n aria-invalid={isError || undefined}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TextArea.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextAreaPropsShared } from '@metamask/design-system-shared';\nimport type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from 'react';\n\nimport type { TextAreaResize } from './TextArea.constants';\n\n/**\n * TextArea component props (React platform-specific)\n * Extends shared props from @metamask/design-system-shared with React-specific platform concerns\n */\nexport type TextAreaProps = Omit<\n ComponentPropsWithoutRef<'textarea'>,\n | 'autoFocus'\n | 'defaultValue'\n | 'disabled'\n | 'onBlur'\n | 'onChange'\n | 'onFocus'\n | 'placeholder'\n | 'readOnly'\n | 'value'\n> &\n Omit<TextAreaPropsShared, 'textVariant'> & {\n /**\n * Optional prop to control the resize behavior of the textarea.\n * Possible values:\n * - TextAreaResize.None\n * - TextAreaResize.Both\n * - TextAreaResize.Horizontal\n * - TextAreaResize.Vertical\n *\n * @default TextAreaResize.None\n */\n resize?: TextAreaResize;\n /**\n * Called when the textarea value changes.\n */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea receives focus.\n */\n onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea loses focus.\n */\n onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n };\n"]}
@@ -0,0 +1,33 @@
1
+ import type { TextAreaPropsShared } from "@metamask/design-system-shared";
2
+ import type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from "react";
3
+ import type { TextAreaResize } from "./TextArea.constants.cjs";
4
+ /**
5
+ * TextArea component props (React platform-specific)
6
+ * Extends shared props from @metamask/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type TextAreaProps = Omit<ComponentPropsWithoutRef<'textarea'>, 'autoFocus' | 'defaultValue' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'readOnly' | 'value'> & Omit<TextAreaPropsShared, 'textVariant'> & {
9
+ /**
10
+ * Optional prop to control the resize behavior of the textarea.
11
+ * Possible values:
12
+ * - TextAreaResize.None
13
+ * - TextAreaResize.Both
14
+ * - TextAreaResize.Horizontal
15
+ * - TextAreaResize.Vertical
16
+ *
17
+ * @default TextAreaResize.None
18
+ */
19
+ resize?: TextAreaResize;
20
+ /**
21
+ * Called when the textarea value changes.
22
+ */
23
+ onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
24
+ /**
25
+ * Called when the textarea receives focus.
26
+ */
27
+ onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;
28
+ /**
29
+ * Called when the textarea loses focus.
30
+ */
31
+ onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
32
+ };
33
+ //# sourceMappingURL=TextArea.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,cAAc;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,iCAA6B;AAE3D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,wBAAwB,CAAC,UAAU,CAAC,EAClC,WAAW,GACX,cAAc,GACd,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,GACV,OAAO,CACV,GACC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAAG;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { TextAreaPropsShared } from "@metamask/design-system-shared";
2
+ import type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from "react";
3
+ import type { TextAreaResize } from "./TextArea.constants.mjs";
4
+ /**
5
+ * TextArea component props (React platform-specific)
6
+ * Extends shared props from @metamask/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type TextAreaProps = Omit<ComponentPropsWithoutRef<'textarea'>, 'autoFocus' | 'defaultValue' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'readOnly' | 'value'> & Omit<TextAreaPropsShared, 'textVariant'> & {
9
+ /**
10
+ * Optional prop to control the resize behavior of the textarea.
11
+ * Possible values:
12
+ * - TextAreaResize.None
13
+ * - TextAreaResize.Both
14
+ * - TextAreaResize.Horizontal
15
+ * - TextAreaResize.Vertical
16
+ *
17
+ * @default TextAreaResize.None
18
+ */
19
+ resize?: TextAreaResize;
20
+ /**
21
+ * Called when the textarea value changes.
22
+ */
23
+ onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
24
+ /**
25
+ * Called when the textarea receives focus.
26
+ */
27
+ onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;
28
+ /**
29
+ * Called when the textarea loses focus.
30
+ */
31
+ onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
32
+ };
33
+ //# sourceMappingURL=TextArea.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,cAAc;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,iCAA6B;AAE3D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,wBAAwB,CAAC,UAAU,CAAC,EAClC,WAAW,GACX,cAAc,GACd,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,GACV,OAAO,CACV,GACC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAAG;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TextArea.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.types.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextAreaPropsShared } from '@metamask/design-system-shared';\nimport type { ChangeEvent, ComponentPropsWithoutRef, FocusEvent } from 'react';\n\nimport type { TextAreaResize } from './TextArea.constants';\n\n/**\n * TextArea component props (React platform-specific)\n * Extends shared props from @metamask/design-system-shared with React-specific platform concerns\n */\nexport type TextAreaProps = Omit<\n ComponentPropsWithoutRef<'textarea'>,\n | 'autoFocus'\n | 'defaultValue'\n | 'disabled'\n | 'onBlur'\n | 'onChange'\n | 'onFocus'\n | 'placeholder'\n | 'readOnly'\n | 'value'\n> &\n Omit<TextAreaPropsShared, 'textVariant'> & {\n /**\n * Optional prop to control the resize behavior of the textarea.\n * Possible values:\n * - TextAreaResize.None\n * - TextAreaResize.Both\n * - TextAreaResize.Horizontal\n * - TextAreaResize.Vertical\n *\n * @default TextAreaResize.None\n */\n resize?: TextAreaResize;\n /**\n * Called when the textarea value changes.\n */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea receives focus.\n */\n onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n /**\n * Called when the textarea loses focus.\n */\n onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n };\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextArea = exports.TextAreaResize = void 0;
4
+ var TextArea_constants_1 = require("./TextArea.constants.cjs");
5
+ Object.defineProperty(exports, "TextAreaResize", { enumerable: true, get: function () { return TextArea_constants_1.TextAreaResize; } });
6
+ var TextArea_1 = require("./TextArea.cjs");
7
+ Object.defineProperty(exports, "TextArea", { enumerable: true, get: function () { return TextArea_1.TextArea; } });
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAA7C,oHAAA,cAAc,OAAA;AACvB,2CAAsC;AAA7B,oGAAA,QAAQ,OAAA","sourcesContent":["export { TextAreaResize } from './TextArea.constants';\nexport { TextArea } from './TextArea';\nexport type { TextAreaProps } from './TextArea.types';\n"]}
@@ -0,0 +1,4 @@
1
+ export { TextAreaResize } from "./TextArea.constants.cjs";
2
+ export { TextArea } from "./TextArea.cjs";
3
+ export type { TextAreaProps } from "./TextArea.types.cjs";
4
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
@@ -0,0 +1,4 @@
1
+ export { TextAreaResize } from "./TextArea.constants.mjs";
2
+ export { TextArea } from "./TextArea.mjs";
3
+ export type { TextAreaProps } from "./TextArea.types.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
@@ -0,0 +1,3 @@
1
+ export { TextAreaResize } from "./TextArea.constants.mjs";
2
+ export { TextArea } from "./TextArea.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iCAA6B;AACtD,OAAO,EAAE,QAAQ,EAAE,uBAAmB","sourcesContent":["export { TextAreaResize } from './TextArea.constants';\nexport { TextArea } from './TextArea';\nexport type { TextAreaProps } from './TextArea.types';\n"]}
@@ -24,36 +24,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.TextButton = void 0;
27
+ const design_system_shared_1 = require("@metamask/design-system-shared");
28
+ const react_slot_1 = require("@radix-ui/react-slot");
27
29
  const react_1 = __importStar(require("react"));
28
- const types_1 = require("../../types/index.cjs");
29
30
  const tw_merge_1 = require("../../utils/tw-merge.cjs");
30
- const ButtonBase_1 = require("../ButtonBase/index.cjs");
31
- const TextButton_constants_1 = require("./TextButton.constants.cjs");
32
- exports.TextButton = (0, react_1.forwardRef)(({ className, isInverse, isDisabled, size = types_1.TextButtonSize.BodyMd, textProps, ...props }, ref) => {
33
- const mergedClassName = (0, tw_merge_1.twMerge)(
34
- // Reset padding, height and animations
35
- 'h-auto rounded-none bg-transparent px-0', 'transform-none transition-none active:scale-100',
36
- // Default text button styles
37
- !isInverse && 'text-primary-default',
38
- // Inverse styles
39
- isInverse && 'text-primary-inverse',
40
- // Hover/Active states - only applied when interactive
41
- !isDisabled && [
42
- !isInverse && [
43
- 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',
44
- 'active:text-primary-default-pressed active:decoration-primary-default-pressed',
45
- ],
46
- isInverse && [
47
- 'hover:text-primary-inverse hover:underline hover:decoration-primary-inverse hover:decoration-2 hover:underline-offset-4',
48
- 'active:text-primary-inverse active:decoration-primary-inverse',
49
- ],
50
- ],
51
- // Disabled styles
52
- isDisabled && ['opacity-50', 'cursor-not-allowed'], className);
53
- return (react_1.default.createElement(ButtonBase_1.ButtonBase, { ref: ref, className: mergedClassName, isDisabled: isDisabled, textProps: {
54
- variant: TextButton_constants_1.MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size],
55
- ...textProps,
56
- }, ...props }));
31
+ const Text_1 = require("../Text/index.cjs");
32
+ exports.TextButton = (0, react_1.forwardRef)(({ children, className, variant = design_system_shared_1.TextVariant.BodyMd, fontWeight = design_system_shared_1.FontWeight.Medium, fontFamily, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, style, onClick, asChild, type = 'button', ...rest }, ref) => {
33
+ const mergedClassName = (0, tw_merge_1.twMerge)('inline cursor-pointer appearance-none border-0 bg-transparent p-0 text-primary-default', 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4', 'active:text-primary-default-pressed active:decoration-primary-default-pressed', className);
34
+ const textButtonContent = asChild ? (react_1.default.createElement(react_slot_1.Slot, { ref: ref, onClick: onClick, ...rest }, children)) : (react_1.default.createElement("button", { ref: ref, type: type, onClick: onClick, ...rest }, children));
35
+ return (react_1.default.createElement(Text_1.Text, { asChild: true, variant: variant, fontWeight: fontWeight, fontFamily: fontFamily, fontStyle: fontStyle, textTransform: textTransform, textAlign: textAlign, overflowWrap: overflowWrap, ellipsis: ellipsis, color: design_system_shared_1.TextColor.PrimaryDefault, className: mergedClassName, style: style }, textButtonContent));
57
36
  });
58
37
  exports.TextButton.displayName = 'TextButton';
59
38
  //# sourceMappingURL=TextButton.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAA6C;AAC7C,uDAA+C;AAC/C,wDAA2C;AAE3C,qEAAyE;AAG5D,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,SAAS,EACT,SAAS,EACT,UAAU,EACV,IAAI,GAAG,sBAAc,CAAC,MAAM,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,uCAAuC;IACvC,yCAAyC,EACzC,iDAAiD;IACjD,6BAA6B;IAC7B,CAAC,SAAS,IAAI,sBAAsB;IACpC,iBAAiB;IACjB,SAAS,IAAI,sBAAsB;IACnC,sDAAsD;IACtD,CAAC,UAAU,IAAI;QACb,CAAC,SAAS,IAAI;YACZ,qIAAqI;YACrI,+EAA+E;SAChF;QACD,SAAS,IAAI;YACX,yHAAyH;YACzH,+DAA+D;SAChE;KACF;IACD,kBAAkB;IAClB,UAAU,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAClD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE;YACT,OAAO,EAAE,sDAA+B,CAAC,IAAI,CAAC;YAC9C,GAAG,SAAS;SACb,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextButtonSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from './TextButton.constants';\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(\n (\n {\n className,\n isInverse,\n isDisabled,\n size = TextButtonSize.BodyMd,\n textProps,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Reset padding, height and animations\n 'h-auto rounded-none bg-transparent px-0',\n 'transform-none transition-none active:scale-100',\n // Default text button styles\n !isInverse && 'text-primary-default',\n // Inverse styles\n isInverse && 'text-primary-inverse',\n // Hover/Active states - only applied when interactive\n !isDisabled && [\n !isInverse && [\n 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-default-pressed active:decoration-primary-default-pressed',\n ],\n isInverse && [\n 'hover:text-primary-inverse hover:underline hover:decoration-primary-inverse hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-inverse active:decoration-primary-inverse',\n ],\n ],\n // Disabled styles\n isDisabled && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n textProps={{\n variant: MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size],\n ...textProps,\n }}\n {...props}\n />\n );\n },\n);\n\nTextButton.displayName = 'TextButton';\n"]}
1
+ {"version":3,"file":"TextButton.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAIwC;AACxC,qDAA4C;AAC5C,+CAA0C;AAE1C,uDAA+C;AAC/C,4CAA+B;AAIlB,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,kCAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,iCAAU,CAAC,MAAM,EAC9B,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,wFAAwF,EACxF,qIAAqI,EACrI,+EAA+E,EAC/E,SAAS,CACV,CAAC;IAEF,MAAM,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAClC,8BAAC,iBAAI,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,KAAM,IAAI,IACvC,QAAQ,CACJ,CACR,CAAC,CAAC,CAAC,CACF,0CAAQ,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,KAAM,IAAI,IACrD,QAAQ,CACF,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,WAAI,IACH,OAAO,QACP,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,gCAAS,CAAC,cAAc,EAC/B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,IAEX,iBAAiB,CACb,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(\n (\n {\n children,\n className,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n fontFamily,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n style,\n onClick,\n asChild,\n type = 'button',\n ...rest\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n 'inline cursor-pointer appearance-none border-0 bg-transparent p-0 text-primary-default',\n 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-default-pressed active:decoration-primary-default-pressed',\n className,\n );\n\n const textButtonContent = asChild ? (\n <Slot ref={ref} onClick={onClick} {...rest}>\n {children}\n </Slot>\n ) : (\n <button ref={ref} type={type} onClick={onClick} {...rest}>\n {children}\n </button>\n );\n\n return (\n <Text\n asChild\n variant={variant}\n fontWeight={fontWeight}\n fontFamily={fontFamily}\n fontStyle={fontStyle}\n textTransform={textTransform}\n textAlign={textAlign}\n overflowWrap={overflowWrap}\n ellipsis={ellipsis}\n color={TextColor.PrimaryDefault}\n className={mergedClassName}\n style={style}\n >\n {textButtonContent}\n </Text>\n );\n },\n);\n\nTextButton.displayName = 'TextButton';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,wGAiDtB,CAAC"}
1
+ {"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,wGAyDtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,wGAiDtB,CAAC"}
1
+ {"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,wGAyDtB,CAAC"}
@@ -4,37 +4,16 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { FontWeight, TextColor, TextVariant } from "@metamask/design-system-shared";
8
+ import { Slot } from "@radix-ui/react-slot";
7
9
  import $React, { forwardRef } from "react";
8
10
  const React = $importDefault($React);
9
- import { TextButtonSize } from "../../types/index.mjs";
10
11
  import { twMerge } from "../../utils/tw-merge.mjs";
11
- import { ButtonBase } from "../ButtonBase/index.mjs";
12
- import { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from "./TextButton.constants.mjs";
13
- export const TextButton = forwardRef(({ className, isInverse, isDisabled, size = TextButtonSize.BodyMd, textProps, ...props }, ref) => {
14
- const mergedClassName = twMerge(
15
- // Reset padding, height and animations
16
- 'h-auto rounded-none bg-transparent px-0', 'transform-none transition-none active:scale-100',
17
- // Default text button styles
18
- !isInverse && 'text-primary-default',
19
- // Inverse styles
20
- isInverse && 'text-primary-inverse',
21
- // Hover/Active states - only applied when interactive
22
- !isDisabled && [
23
- !isInverse && [
24
- 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',
25
- 'active:text-primary-default-pressed active:decoration-primary-default-pressed',
26
- ],
27
- isInverse && [
28
- 'hover:text-primary-inverse hover:underline hover:decoration-primary-inverse hover:decoration-2 hover:underline-offset-4',
29
- 'active:text-primary-inverse active:decoration-primary-inverse',
30
- ],
31
- ],
32
- // Disabled styles
33
- isDisabled && ['opacity-50', 'cursor-not-allowed'], className);
34
- return (React.createElement(ButtonBase, { ref: ref, className: mergedClassName, isDisabled: isDisabled, textProps: {
35
- variant: MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size],
36
- ...textProps,
37
- }, ...props }));
12
+ import { Text } from "../Text/index.mjs";
13
+ export const TextButton = forwardRef(({ children, className, variant = TextVariant.BodyMd, fontWeight = FontWeight.Medium, fontFamily, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, style, onClick, asChild, type = 'button', ...rest }, ref) => {
14
+ const mergedClassName = twMerge('inline cursor-pointer appearance-none border-0 bg-transparent p-0 text-primary-default', 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4', 'active:text-primary-default-pressed active:decoration-primary-default-pressed', className);
15
+ const textButtonContent = asChild ? (React.createElement(Slot, { ref: ref, onClick: onClick, ...rest }, children)) : (React.createElement("button", { ref: ref, type: type, onClick: onClick, ...rest }, children));
16
+ return (React.createElement(Text, { asChild: true, variant: variant, fontWeight: fontWeight, fontFamily: fontFamily, fontStyle: fontStyle, textTransform: textTransform, textAlign: textAlign, overflowWrap: overflowWrap, ellipsis: ellipsis, color: TextColor.PrimaryDefault, className: mergedClassName, style: style }, textButtonContent));
38
17
  });
39
18
  TextButton.displayName = 'TextButton';
40
19
  //# sourceMappingURL=TextButton.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAE3C,OAAO,EAAE,+BAA+B,EAAE,mCAA+B;AAGzE,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,SAAS,EACT,UAAU,EACV,IAAI,GAAG,cAAc,CAAC,MAAM,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,OAAO;IAC7B,uCAAuC;IACvC,yCAAyC,EACzC,iDAAiD;IACjD,6BAA6B;IAC7B,CAAC,SAAS,IAAI,sBAAsB;IACpC,iBAAiB;IACjB,SAAS,IAAI,sBAAsB;IACnC,sDAAsD;IACtD,CAAC,UAAU,IAAI;QACb,CAAC,SAAS,IAAI;YACZ,qIAAqI;YACrI,+EAA+E;SAChF;QACD,SAAS,IAAI;YACX,yHAAyH;YACzH,+DAA+D;SAChE;KACF;IACD,kBAAkB;IAClB,UAAU,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAClD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE;YACT,OAAO,EAAE,+BAA+B,CAAC,IAAI,CAAC;YAC9C,GAAG,SAAS;SACb,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextButtonSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from './TextButton.constants';\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(\n (\n {\n className,\n isInverse,\n isDisabled,\n size = TextButtonSize.BodyMd,\n textProps,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Reset padding, height and animations\n 'h-auto rounded-none bg-transparent px-0',\n 'transform-none transition-none active:scale-100',\n // Default text button styles\n !isInverse && 'text-primary-default',\n // Inverse styles\n isInverse && 'text-primary-inverse',\n // Hover/Active states - only applied when interactive\n !isDisabled && [\n !isInverse && [\n 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-default-pressed active:decoration-primary-default-pressed',\n ],\n isInverse && [\n 'hover:text-primary-inverse hover:underline hover:decoration-primary-inverse hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-inverse active:decoration-primary-inverse',\n ],\n ],\n // Disabled styles\n isDisabled && ['opacity-50', 'cursor-not-allowed'],\n className,\n );\n\n return (\n <ButtonBase\n ref={ref}\n className={mergedClassName}\n isDisabled={isDisabled}\n textProps={{\n variant: MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size],\n ...textProps,\n }}\n {...props}\n />\n );\n },\n);\n\nTextButton.displayName = 'TextButton';\n"]}
1
+ {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,UAAU,CAAC,MAAM,EAC9B,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,OAAO,CAC7B,wFAAwF,EACxF,qIAAqI,EACrI,+EAA+E,EAC/E,SAAS,CACV,CAAC;IAEF,MAAM,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAClC,oBAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,KAAM,IAAI,IACvC,QAAQ,CACJ,CACR,CAAC,CAAC,CAAC,CACF,gCAAQ,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,KAAM,IAAI,IACrD,QAAQ,CACF,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,IAAI,IACH,OAAO,QACP,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,CAAC,cAAc,EAC/B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,IAEX,iBAAiB,CACb,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(\n (\n {\n children,\n className,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n fontFamily,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n style,\n onClick,\n asChild,\n type = 'button',\n ...rest\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n 'inline cursor-pointer appearance-none border-0 bg-transparent p-0 text-primary-default',\n 'hover:text-primary-default-hover hover:underline hover:decoration-primary-default-hover hover:decoration-2 hover:underline-offset-4',\n 'active:text-primary-default-pressed active:decoration-primary-default-pressed',\n className,\n );\n\n const textButtonContent = asChild ? (\n <Slot ref={ref} onClick={onClick} {...rest}>\n {children}\n </Slot>\n ) : (\n <button ref={ref} type={type} onClick={onClick} {...rest}>\n {children}\n </button>\n );\n\n return (\n <Text\n asChild\n variant={variant}\n fontWeight={fontWeight}\n fontFamily={fontFamily}\n fontStyle={fontStyle}\n textTransform={textTransform}\n textAlign={textAlign}\n overflowWrap={overflowWrap}\n ellipsis={ellipsis}\n color={TextColor.PrimaryDefault}\n className={mergedClassName}\n style={style}\n >\n {textButtonContent}\n </Text>\n );\n },\n);\n\nTextButton.displayName = 'TextButton';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextButtonSize } from '../../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type TextButtonProps = Omit<\n ButtonBaseProps,\n // We handle these props in TextButton\n | 'className'\n | 'isDisabled'\n | 'isLoading'\n | 'loadingIconProps'\n | 'loadingTextProps'\n | 'style'\n | 'size'\n> & {\n /**\n * Optional prop for additional CSS classes to be applied to the TextButton component\n */\n className?: string;\n /**\n * Optional prop that when true, applies inverse styling to the button\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to specify the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n};\n"]}
1
+ {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextButtonPropsShared } from '@metamask/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { TextProps } from '../Text';\n\nexport type TextButtonProps = TextButtonPropsShared &\n Omit<TextProps, 'asChild' | 'children' | 'color'> &\n Omit<\n ComponentProps<'button'>,\n 'children' | 'color' | 'disabled' | 'onClick'\n > & {\n /**\n * Called when the user clicks the label. Primary interaction for this control.\n */\n onClick?: ComponentProps<'button'>['onClick'];\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a button element.\n *\n * @default false\n */\n asChild?: boolean;\n };\n"]}