@metamask/design-system-react-native 0.11.0 → 0.12.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 (187) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  3. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  4. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  5. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  6. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  7. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  8. package/dist/components/BannerAlert/BannerAlert.cjs +23 -0
  9. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
  10. package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
  11. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
  12. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
  13. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
  14. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
  15. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
  16. package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
  17. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
  18. package/dist/components/BannerAlert/BannerAlert.d.cts +4 -0
  19. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
  20. package/dist/components/BannerAlert/BannerAlert.d.mts +4 -0
  21. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
  22. package/dist/components/BannerAlert/BannerAlert.mjs +23 -0
  23. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
  24. package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
  25. package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
  26. package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
  27. package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
  28. package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
  29. package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
  30. package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
  31. package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
  32. package/dist/components/BannerAlert/index.cjs +8 -0
  33. package/dist/components/BannerAlert/index.cjs.map +1 -0
  34. package/dist/components/BannerAlert/index.d.cts +4 -0
  35. package/dist/components/BannerAlert/index.d.cts.map +1 -0
  36. package/dist/components/BannerAlert/index.d.mts +4 -0
  37. package/dist/components/BannerAlert/index.d.mts.map +1 -0
  38. package/dist/components/BannerAlert/index.mjs +3 -0
  39. package/dist/components/BannerAlert/index.mjs.map +1 -0
  40. package/dist/components/Icon/assets/candlestick.svg +1 -1
  41. package/dist/components/Input/Input.cjs +4 -3
  42. package/dist/components/Input/Input.cjs.map +1 -1
  43. package/dist/components/Input/Input.constants.cjs +69 -0
  44. package/dist/components/Input/Input.constants.cjs.map +1 -0
  45. package/dist/components/Input/Input.constants.d.cts +11 -0
  46. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  47. package/dist/components/Input/Input.constants.d.mts +11 -0
  48. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  49. package/dist/components/Input/Input.constants.mjs +66 -0
  50. package/dist/components/Input/Input.constants.mjs.map +1 -0
  51. package/dist/components/Input/Input.d.cts.map +1 -1
  52. package/dist/components/Input/Input.d.mts.map +1 -1
  53. package/dist/components/Input/Input.mjs +4 -3
  54. package/dist/components/Input/Input.mjs.map +1 -1
  55. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
  56. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  57. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
  58. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  59. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
  60. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  61. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
  62. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  63. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
  64. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  65. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
  66. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  67. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
  68. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  69. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
  70. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  71. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  72. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  73. package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
  74. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  75. package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
  76. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  77. package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
  78. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  79. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  80. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  81. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  82. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  83. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  84. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  85. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  86. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  87. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  88. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  89. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  90. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  91. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  92. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  93. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  94. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  95. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
  96. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  97. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
  98. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  99. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
  100. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  101. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
  102. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  103. package/dist/components/KeyValueRow/index.cjs +15 -0
  104. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  105. package/dist/components/KeyValueRow/index.d.cts +3 -0
  106. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  107. package/dist/components/KeyValueRow/index.d.mts +3 -0
  108. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  109. package/dist/components/KeyValueRow/index.mjs +3 -0
  110. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  111. package/dist/components/TextButton/TextButton.cjs +12 -36
  112. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  113. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  114. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  115. package/dist/components/TextButton/TextButton.mjs +14 -38
  116. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  117. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  118. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  119. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  120. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  121. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  122. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  123. package/dist/components/TextButton/index.cjs +1 -3
  124. package/dist/components/TextButton/index.cjs.map +1 -1
  125. package/dist/components/TextButton/index.d.cts +0 -1
  126. package/dist/components/TextButton/index.d.cts.map +1 -1
  127. package/dist/components/TextButton/index.d.mts +0 -1
  128. package/dist/components/TextButton/index.d.mts.map +1 -1
  129. package/dist/components/TextButton/index.mjs +0 -1
  130. package/dist/components/TextButton/index.mjs.map +1 -1
  131. package/dist/components/TextField/TextField.cjs +22 -8
  132. package/dist/components/TextField/TextField.cjs.map +1 -1
  133. package/dist/components/TextField/TextField.d.cts +0 -2
  134. package/dist/components/TextField/TextField.d.cts.map +1 -1
  135. package/dist/components/TextField/TextField.d.mts +0 -2
  136. package/dist/components/TextField/TextField.d.mts.map +1 -1
  137. package/dist/components/TextField/TextField.mjs +22 -8
  138. package/dist/components/TextField/TextField.mjs.map +1 -1
  139. package/dist/components/TextField/TextField.types.cjs +0 -10
  140. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  141. package/dist/components/TextField/TextField.types.d.cts +0 -14
  142. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  143. package/dist/components/TextField/TextField.types.d.mts +0 -14
  144. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  145. package/dist/components/TextField/TextField.types.mjs +1 -9
  146. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  147. package/dist/components/TextField/index.cjs +1 -3
  148. package/dist/components/TextField/index.cjs.map +1 -1
  149. package/dist/components/TextField/index.d.cts +0 -1
  150. package/dist/components/TextField/index.d.cts.map +1 -1
  151. package/dist/components/TextField/index.d.mts +0 -1
  152. package/dist/components/TextField/index.d.mts.map +1 -1
  153. package/dist/components/TextField/index.mjs +0 -1
  154. package/dist/components/TextField/index.mjs.map +1 -1
  155. package/dist/components/index.cjs +4 -3
  156. package/dist/components/index.cjs.map +1 -1
  157. package/dist/components/index.d.cts +4 -2
  158. package/dist/components/index.d.cts.map +1 -1
  159. package/dist/components/index.d.mts +4 -2
  160. package/dist/components/index.d.mts.map +1 -1
  161. package/dist/components/index.mjs +3 -2
  162. package/dist/components/index.mjs.map +1 -1
  163. package/dist/types/index.cjs +1 -11
  164. package/dist/types/index.cjs.map +1 -1
  165. package/dist/types/index.d.cts +0 -9
  166. package/dist/types/index.d.cts.map +1 -1
  167. package/dist/types/index.d.mts +0 -9
  168. package/dist/types/index.d.mts.map +1 -1
  169. package/dist/types/index.mjs +0 -10
  170. package/dist/types/index.mjs.map +1 -1
  171. package/package.json +2 -2
  172. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  173. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  174. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  175. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  176. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  177. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  178. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  179. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  180. package/dist/components/TextField/TextField.constants.cjs +0 -13
  181. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  182. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  183. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  184. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  185. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  186. package/dist/components/TextField/TextField.constants.mjs +0 -10
  187. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.0]
11
+
12
+ ### Added
13
+
14
+ - Added `BannerAlert` component ([#966](https://github.com/MetaMask/metamask-design-system/pull/966))
15
+ - Added `KeyValueRow` component ([#959](https://github.com/MetaMask/metamask-design-system/pull/959))
16
+
17
+ ### Changed
18
+
19
+ - **BREAKING:** Simplified `TextButton` to a text-only control and removed `size`/`TextButtonSize`, inverse/disabled props, and icon/accessory props ([#1001](https://github.com/MetaMask/metamask-design-system/pull/1001))
20
+ - See [Migration Guide](./MIGRATION.md#from-version-0110-to-0120)
21
+ - **BREAKING:** Removed `TextFieldSize` and the `size` prop; `TextField` is now a single fixed-height (48px) row ([#1000](https://github.com/MetaMask/metamask-design-system/pull/1000))
22
+ - See [Migration Guide](./MIGRATION.md#from-version-0110-to-0120)
23
+ - Updated `Candlestick` icon asset with smaller size variant ([#998](https://github.com/MetaMask/metamask-design-system/pull/998))
24
+
25
+ ### Fixed
26
+
27
+ - Improved `Input` single-line typography alignment (including iOS placeholder behavior) ([#1000](https://github.com/MetaMask/metamask-design-system/pull/1000))
28
+
10
29
  ## [0.11.0]
11
30
 
12
31
  ### Added
@@ -235,7 +254,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
235
254
  - Full TypeScript support with type definitions and enums
236
255
  - React Native integration with TWRNC preset support
237
256
 
238
- [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.11.0...HEAD
257
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.12.0...HEAD
258
+ [0.12.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.11.0...@metamask/design-system-react-native@0.12.0
239
259
  [0.11.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.10.0...@metamask/design-system-react-native@0.11.0
240
260
  [0.10.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.9.0...@metamask/design-system-react-native@0.10.0
241
261
  [0.9.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.8.0...@metamask/design-system-react-native@0.9.0
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props.\n */\nexport type AvatarNetworkProps = {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional props for network name, to be used to calculate the fallbackText.\n */\n name?: string;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n} & Omit<AvatarBaseProps, 'children'>;\n"]}
1
+ {"version":3,"file":"AvatarNetwork.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarNetworkPropsShared } from '@metamask/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native-specific platform concerns\n */\nexport type AvatarNetworkProps = AvatarNetworkPropsShared &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element.\n * Useful for overriding the default alt text which is the network name.\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n };\n"]}
@@ -1,21 +1,19 @@
1
+ import type { AvatarNetworkPropsShared } from "@metamask/design-system-shared";
1
2
  import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
2
3
  import type { ImageOrSvgProps, ImageOrSvgSrc } from "../temp-components/ImageOrSvg/index.cjs";
3
4
  /**
4
- * AvatarNetwork component props.
5
+ * AvatarNetwork component props (React Native platform-specific)
6
+ * Extends shared props from @metamask/design-system-shared with React Native-specific platform concerns
5
7
  */
6
- export type AvatarNetworkProps = {
8
+ export type AvatarNetworkProps = AvatarNetworkPropsShared & Omit<AvatarBaseProps, 'children'> & {
7
9
  /**
8
10
  * Optional prop for the source of the image or SVG.
9
11
  */
10
12
  src?: ImageOrSvgSrc;
11
13
  /**
12
- * Optional props for network name, to be used to calculate the fallbackText.
13
- */
14
- name?: string;
15
- /**
16
- * Optional prop to pass to the underlying ImageOrSvg element
17
- * Useful for overriding the default alt text which is the dapp name
14
+ * Optional prop to pass to the underlying ImageOrSvg element.
15
+ * Useful for overriding the default alt text which is the network name.
18
16
  */
19
17
  imageOrSvgProps?: Partial<ImageOrSvgProps>;
20
- } & Omit<AvatarBaseProps, 'children'>;
18
+ };
21
19
  //# sourceMappingURL=AvatarNetwork.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarNetwork.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAuC;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC"}
@@ -1,21 +1,19 @@
1
+ import type { AvatarNetworkPropsShared } from "@metamask/design-system-shared";
1
2
  import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
2
3
  import type { ImageOrSvgProps, ImageOrSvgSrc } from "../temp-components/ImageOrSvg/index.mjs";
3
4
  /**
4
- * AvatarNetwork component props.
5
+ * AvatarNetwork component props (React Native platform-specific)
6
+ * Extends shared props from @metamask/design-system-shared with React Native-specific platform concerns
5
7
  */
6
- export type AvatarNetworkProps = {
8
+ export type AvatarNetworkProps = AvatarNetworkPropsShared & Omit<AvatarBaseProps, 'children'> & {
7
9
  /**
8
10
  * Optional prop for the source of the image or SVG.
9
11
  */
10
12
  src?: ImageOrSvgSrc;
11
13
  /**
12
- * Optional props for network name, to be used to calculate the fallbackText.
13
- */
14
- name?: string;
15
- /**
16
- * Optional prop to pass to the underlying ImageOrSvg element
17
- * Useful for overriding the default alt text which is the dapp name
14
+ * Optional prop to pass to the underlying ImageOrSvg element.
15
+ * Useful for overriding the default alt text which is the network name.
18
16
  */
19
17
  imageOrSvgProps?: Partial<ImageOrSvgProps>;
20
- } & Omit<AvatarBaseProps, 'children'>;
18
+ };
21
19
  //# sourceMappingURL=AvatarNetwork.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarNetwork.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAuC;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props.\n */\nexport type AvatarNetworkProps = {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional props for network name, to be used to calculate the fallbackText.\n */\n name?: string;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n} & Omit<AvatarBaseProps, 'children'>;\n"]}
1
+ {"version":3,"file":"AvatarNetwork.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarNetworkPropsShared } from '@metamask/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native-specific platform concerns\n */\nexport type AvatarNetworkProps = AvatarNetworkPropsShared &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element.\n * Useful for overriding the default alt text which is the network name.\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n };\n"]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BannerAlert = void 0;
7
+ const design_system_shared_1 = require("@metamask/design-system-shared");
8
+ const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
9
+ const react_1 = __importDefault(require("react"));
10
+ const types_1 = require("../../types/index.cjs");
11
+ const BannerBase_1 = require("../BannerBase/index.cjs");
12
+ const Icon_1 = require("../Icon/index.cjs");
13
+ const BannerAlert_constants_1 = require("./BannerAlert.constants.cjs");
14
+ const BannerAlert = ({ severity = design_system_shared_1.BannerAlertSeverity.Info, iconProps, style, ...props }) => {
15
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
16
+ const iconName = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];
17
+ const iconColor = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];
18
+ const backgroundColor = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];
19
+ const borderColorClass = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];
20
+ return (<BannerBase_1.BannerBase startAccessory={<Icon_1.Icon name={iconName} color={iconColor} size={types_1.IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} paddingLeft={2} style={[tw.style(`border-l-4 ${borderColorClass}`), style]} {...props}/>);
21
+ };
22
+ exports.BannerAlert = BannerAlert;
23
+ //# sourceMappingURL=BannerAlert.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAAqE;AACrE,qFAAmE;AACnE,kDAA0B;AAE1B,iDAAuC;AACvC,wDAA2C;AAC3C,4CAA+B;AAE/B,uEAKiC;AAG1B,MAAM,WAAW,GAA+B,CAAC,EACtD,QAAQ,GAAG,0CAAmB,CAAC,IAAI,EACnC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,2DAAmC,CAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,4DAAoC,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,eAAe,GAAG,kEAA0C,CAAC,QAAQ,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,8DAAsC,CAAC,QAAQ,CAAC,CAAC;IAC1E,OAAO,CACL,CAAC,uBAAU,CACT,cAAc,CAAC,CACb,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,gBAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,SAAS,CAAC,EACd,CACH,CACD,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,gBAAgB,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAC3D,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,WAAW,eA2BtB","sourcesContent":["import { BannerAlertSeverity } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { IconSize } from '../../types';\nimport { BannerBase } from '../BannerBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_NAME,\n MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR,\n} from './BannerAlert.constants';\nimport type { BannerAlertProps } from './BannerAlert.types';\n\nexport const BannerAlert: React.FC<BannerAlertProps> = ({\n severity = BannerAlertSeverity.Info,\n iconProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];\n const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];\n const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];\n const borderColorClass = MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];\n return (\n <BannerBase\n startAccessory={\n <Icon\n name={iconName}\n color={iconColor}\n size={IconSize.Lg}\n {...iconProps}\n />\n }\n backgroundColor={backgroundColor}\n paddingLeft={2}\n style={[tw.style(`border-l-4 ${borderColorClass}`), style]}\n {...props}\n />\n );\n};\n"]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = exports.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = exports.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = exports.MAP_BANNER_ALERT_SEVERITY_ICON_NAME = void 0;
4
+ const design_system_shared_1 = require("@metamask/design-system-shared");
5
+ const types_1 = require("../../types/index.cjs");
6
+ exports.MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
7
+ info: types_1.IconName.Info,
8
+ success: types_1.IconName.Confirmation,
9
+ warning: types_1.IconName.Danger,
10
+ danger: types_1.IconName.Danger,
11
+ };
12
+ exports.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = {
13
+ info: types_1.IconColor.PrimaryDefault,
14
+ success: types_1.IconColor.SuccessDefault,
15
+ warning: types_1.IconColor.WarningDefault,
16
+ danger: types_1.IconColor.ErrorDefault,
17
+ };
18
+ exports.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = {
19
+ info: types_1.BoxBackgroundColor.PrimaryMuted,
20
+ success: types_1.BoxBackgroundColor.SuccessMuted,
21
+ warning: types_1.BoxBackgroundColor.WarningMuted,
22
+ danger: types_1.BoxBackgroundColor.ErrorMuted,
23
+ };
24
+ exports.MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = {
25
+ info: types_1.BoxBorderColor.PrimaryDefault,
26
+ success: types_1.BoxBorderColor.SuccessDefault,
27
+ warning: types_1.BoxBorderColor.WarningDefault,
28
+ danger: types_1.BoxBorderColor.ErrorDefault,
29
+ };
30
+ //# sourceMappingURL=BannerAlert.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.constants.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":";;;AAAA,yEAAqE;AAErE,iDAKqB;AAER,QAAA,mCAAmC,GAG5C;IACF,IAAI,EAAE,gBAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,gBAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,gBAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,gBAAQ,CAAC,MAAM;CACxB,CAAC;AAEW,QAAA,oCAAoC,GAG7C;IACF,IAAI,EAAE,iBAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,iBAAS,CAAC,cAAc;IACjC,OAAO,EAAE,iBAAS,CAAC,cAAc;IACjC,MAAM,EAAE,iBAAS,CAAC,YAAY;CAC/B,CAAC;AAEW,QAAA,0CAA0C,GAGnD;IACF,IAAI,EAAE,0BAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,0BAAkB,CAAC,UAAU;CACtC,CAAC;AAEW,QAAA,sCAAsC,GAG/C;IACF,IAAI,EAAE,sBAAc,CAAC,cAAc;IACnC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,MAAM,EAAE,sBAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask/design-system-shared';\n\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n IconColor,\n IconName,\n} from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.cjs";
3
+ export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
4
+ export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
5
+ export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
6
+ export declare const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBorderColor>;
7
+ //# sourceMappingURL=BannerAlert.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AAErE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.mjs";
3
+ export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
4
+ export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
5
+ export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
6
+ export declare const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBorderColor>;
7
+ //# sourceMappingURL=BannerAlert.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AAErE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.mjs";
3
+ export const MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
4
+ info: IconName.Info,
5
+ success: IconName.Confirmation,
6
+ warning: IconName.Danger,
7
+ danger: IconName.Danger,
8
+ };
9
+ export const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = {
10
+ info: IconColor.PrimaryDefault,
11
+ success: IconColor.SuccessDefault,
12
+ warning: IconColor.WarningDefault,
13
+ danger: IconColor.ErrorDefault,
14
+ };
15
+ export const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = {
16
+ info: BoxBackgroundColor.PrimaryMuted,
17
+ success: BoxBackgroundColor.SuccessMuted,
18
+ warning: BoxBackgroundColor.WarningMuted,
19
+ danger: BoxBackgroundColor.ErrorMuted,
20
+ };
21
+ export const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = {
22
+ info: BoxBorderColor.PrimaryDefault,
23
+ success: BoxBorderColor.SuccessDefault,
24
+ warning: BoxBorderColor.WarningDefault,
25
+ danger: BoxBorderColor.ErrorDefault,
26
+ };
27
+ //# sourceMappingURL=BannerAlert.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.constants.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AAErE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,MAAM,CAAC,MAAM,mCAAmC,GAG5C;IACF,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,QAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,IAAI,EAAE,SAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,MAAM,EAAE,SAAS,CAAC,YAAY;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAGnD;IACF,IAAI,EAAE,kBAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,kBAAkB,CAAC,UAAU;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAG/C;IACF,IAAI,EAAE,cAAc,CAAC,cAAc;IACnC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,MAAM,EAAE,cAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask/design-system-shared';\n\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n IconColor,\n IconName,\n} from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BannerAlertProps } from "./BannerAlert.types.cjs";
3
+ export declare const BannerAlert: React.FC<BannerAlertProps>;
4
+ //# sourceMappingURL=BannerAlert.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2BlD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BannerAlertProps } from "./BannerAlert.types.mjs";
3
+ export declare const BannerAlert: React.FC<BannerAlertProps>;
4
+ //# sourceMappingURL=BannerAlert.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2BlD,CAAC"}
@@ -0,0 +1,23 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { BannerAlertSeverity } from "@metamask/design-system-shared";
8
+ import { useTailwind } from "@metamask/design-system-twrnc-preset";
9
+ import $React from "react";
10
+ const React = $importDefault($React);
11
+ import { IconSize } from "../../types/index.mjs";
12
+ import { BannerBase } from "../BannerBase/index.mjs";
13
+ import { Icon } from "../Icon/index.mjs";
14
+ import { MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_NAME, MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR } from "./BannerAlert.constants.mjs";
15
+ export const BannerAlert = ({ severity = BannerAlertSeverity.Info, iconProps, style, ...props }) => {
16
+ const tw = useTailwind();
17
+ const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];
18
+ const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];
19
+ const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];
20
+ const borderColorClass = MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];
21
+ return (<BannerBase startAccessory={<Icon name={iconName} color={iconColor} size={IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} paddingLeft={2} style={[tw.style(`border-l-4 ${borderColorClass}`), style]} {...props}/>);
22
+ };
23
+ //# sourceMappingURL=BannerAlert.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AACrE,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,QAAQ,EAAE,8BAAoB;AACvC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EACL,0CAA0C,EAC1C,oCAAoC,EACpC,mCAAmC,EACnC,sCAAsC,EACvC,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,QAAQ,GAAG,mBAAmB,CAAC,IAAI,EACnC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,eAAe,GAAG,0CAA0C,CAAC,QAAQ,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,sCAAsC,CAAC,QAAQ,CAAC,CAAC;IAC1E,OAAO,CACL,CAAC,UAAU,CACT,cAAc,CAAC,CACb,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,SAAS,CAAC,EACd,CACH,CACD,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,gBAAgB,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAC3D,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { IconSize } from '../../types';\nimport { BannerBase } from '../BannerBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_NAME,\n MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR,\n} from './BannerAlert.constants';\nimport type { BannerAlertProps } from './BannerAlert.types';\n\nexport const BannerAlert: React.FC<BannerAlertProps> = ({\n severity = BannerAlertSeverity.Info,\n iconProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];\n const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];\n const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];\n const borderColorClass = MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];\n return (\n <BannerBase\n startAccessory={\n <Icon\n name={iconName}\n color={iconColor}\n size={IconSize.Lg}\n {...iconProps}\n />\n }\n backgroundColor={backgroundColor}\n paddingLeft={2}\n style={[tw.style(`border-l-4 ${borderColorClass}`), style]}\n {...props}\n />\n );\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BannerAlert.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerAlertPropsShared } from '@metamask/design-system-shared';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\n/**\n * BannerAlert component props (React Native platform-specific).\n */\nexport type BannerAlertProps = BannerAlertPropsShared &\n BannerBaseProps & {\n iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;\n };\n"]}
@@ -0,0 +1,10 @@
1
+ import type { BannerAlertPropsShared } from "@metamask/design-system-shared";
2
+ import type { BannerBaseProps } from "../BannerBase/index.cjs";
3
+ import type { IconProps } from "../Icon/Icon.types.cjs";
4
+ /**
5
+ * BannerAlert component props (React Native platform-specific).
6
+ */
7
+ export type BannerAlertProps = BannerAlertPropsShared & BannerBaseProps & {
8
+ iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;
9
+ };
10
+ //# sourceMappingURL=BannerAlert.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,eAAe,GAAG;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACxD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BannerAlertPropsShared } from "@metamask/design-system-shared";
2
+ import type { BannerBaseProps } from "../BannerBase/index.mjs";
3
+ import type { IconProps } from "../Icon/Icon.types.mjs";
4
+ /**
5
+ * BannerAlert component props (React Native platform-specific).
6
+ */
7
+ export type BannerAlertProps = BannerAlertPropsShared & BannerBaseProps & {
8
+ iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;
9
+ };
10
+ //# sourceMappingURL=BannerAlert.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,eAAe,GAAG;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BannerAlert.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerAlert.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerAlertPropsShared } from '@metamask/design-system-shared';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\n/**\n * BannerAlert component props (React Native platform-specific).\n */\nexport type BannerAlertProps = BannerAlertPropsShared &\n BannerBaseProps & {\n iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;\n };\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BannerAlert = exports.BannerAlertSeverity = void 0;
4
+ var design_system_shared_1 = require("@metamask/design-system-shared");
5
+ Object.defineProperty(exports, "BannerAlertSeverity", { enumerable: true, get: function () { return design_system_shared_1.BannerAlertSeverity; } });
6
+ var BannerAlert_1 = require("./BannerAlert.cjs");
7
+ Object.defineProperty(exports, "BannerAlert", { enumerable: true, get: function () { return BannerAlert_1.BannerAlert; } });
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":";;;AAAA,uEAAqE;AAA5D,2HAAA,mBAAmB,OAAA;AAC5B,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export { BannerAlertSeverity } from '@metamask/design-system-shared';\nexport { BannerAlert } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert.types';\n"]}
@@ -0,0 +1,4 @@
1
+ export { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ export { BannerAlert } from "./BannerAlert.cjs";
3
+ export type { BannerAlertProps } from "./BannerAlert.types.cjs";
4
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AACrE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -0,0 +1,4 @@
1
+ export { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ export { BannerAlert } from "./BannerAlert.mjs";
3
+ export type { BannerAlertProps } from "./BannerAlert.types.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AACrE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -0,0 +1,3 @@
1
+ export { BannerAlertSeverity } from "@metamask/design-system-shared";
2
+ export { BannerAlert } from "./BannerAlert.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uCAAuC;AACrE,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export { BannerAlertSeverity } from '@metamask/design-system-shared';\nexport { BannerAlert } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert.types';\n"]}
@@ -1 +1 @@
1
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m9 4h-2v2h-2v12h2v2h2v-2h2v-12h-2zm0 12h-2v-8h2z"/><path d="m19 8h-2v-4h-2v4h-2v7h2v5h2v-5h2zm-2 5h-2v-3h2z"/></svg>
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g><path d="m9.49932 5.33142h-1.66714v1.66714h-1.66714v10.00284h1.66714v1.6672h1.66714v-1.6672h1.66718v-10.00284h-1.66718zm0 10.00288h-1.66714v-6.66859h1.66714z"/><path d="m17.835 8.66571h-1.6671v-3.33429h-1.6671v3.33429h-1.6672v5.83499h1.6672v4.1679h1.6671v-4.1679h1.6671zm-1.6671 4.16789h-1.6671v-2.5008h1.6671z"/></g></svg>
@@ -7,6 +7,7 @@ const react_1 = require("react");
7
7
  const react_native_1 = require("react-native/index.js");
8
8
  const types_1 = require("../../types/index.cjs");
9
9
  const Text_constants_1 = require("../Text/Text.constants.cjs");
10
+ const Input_constants_1 = require("./Input.constants.cjs");
10
11
  exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
11
12
  const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
12
13
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
@@ -22,11 +23,10 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVari
22
23
  // the controlled value is empty. This keeps the iOS lineHeight workaround
23
24
  // scoped to the placeholder-visible state without affecting typed text.
24
25
  const isPlaceholderVisible = hasPlaceholder && value === '';
25
- const inputStyle = (0, react_1.useMemo)(() => tw.style(`text-${textVariant}`, fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
26
+ const inputStyle = (0, react_1.useMemo)(() => tw.style(fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
26
27
  !isDisabled &&
27
28
  isFocused &&
28
29
  'border-primary-default', twClassName), [
29
- textVariant,
30
30
  fontClass,
31
31
  isStateStylesDisabled,
32
32
  isDisabled,
@@ -34,6 +34,7 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVari
34
34
  twClassName,
35
35
  tw,
36
36
  ]);
37
+ const variantTextStyle = (0, react_1.useMemo)(() => Input_constants_1.MAP_TEXT_VARIANT_INPUT_METRICS[textVariant], [textVariant]);
37
38
  /* istanbul ignore next: handler body covered by focus/blur tests */
38
39
  const onBlurHandler = (0, react_1.useCallback)((e) => {
39
40
  if (!isDisabled) {
@@ -50,12 +51,12 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVari
50
51
  }, [isDisabled, onFocus]);
51
52
  const resolvedStyle = [
52
53
  inputStyle,
54
+ variantTextStyle,
53
55
  // iOS-only workaround: when a placeholder is visible, native iOS
54
56
  // TextInput can render placeholder text vertically offset.
55
57
  // Keep this iOS-only because lineHeight: 0 can collapse text on Android.
56
58
  react_native_1.Platform.OS === 'ios' &&
57
59
  isPlaceholderVisible && { lineHeight: 0 },
58
- react_native_1.Platform.OS === 'ios' && { textAlignVertical: 'center' },
59
60
  style,
60
61
  ].filter(Boolean);
61
62
  return (<react_native_1.TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
@@ -1 +1 @@
1
- {"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n `text-${textVariant}`,\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n textVariant,\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const resolvedStyle = [\n inputStyle,\n // iOS-only workaround: when a placeholder is visible, native iOS\n // TextInput can render placeholder text vertically offset.\n // Keep this iOS-only because lineHeight: 0 can collapse text on Android.\n Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const },\n Platform.OS === 'ios' && { textAlignVertical: 'center' as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n placeholder={placeholder}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
1
+ {"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport { MAP_TEXT_VARIANT_INPUT_METRICS } from './Input.constants';\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n const variantTextStyle = useMemo(\n () => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant],\n [textVariant],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n const resolvedStyle = [\n inputStyle,\n variantTextStyle,\n // iOS-only workaround: when a placeholder is visible, native iOS\n // TextInput can render placeholder text vertically offset.\n // Keep this iOS-only because lineHeight: 0 can collapse text on Android.\n Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n placeholder={placeholder}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAP_TEXT_VARIANT_INPUT_METRICS = void 0;
4
+ const design_tokens_1 = require("@metamask/design-tokens");
5
+ const types_1 = require("../../types/index.cjs");
6
+ /**
7
+ * Typographic metrics for Input: same tokens as `text-*` utilities but **without** `lineHeight`.
8
+ * React Native `TextInput` aligns single-line text more predictably when line height is not set
9
+ * from the design-system paragraph specs (matches legacy / temp Input.styles behavior).
10
+ */
11
+ exports.MAP_TEXT_VARIANT_INPUT_METRICS = {
12
+ [types_1.TextVariant.DisplayLg]: {
13
+ fontSize: design_tokens_1.typography.sDisplayLG.fontSize,
14
+ letterSpacing: design_tokens_1.typography.sDisplayLG.letterSpacing,
15
+ },
16
+ [types_1.TextVariant.DisplayMd]: {
17
+ fontSize: design_tokens_1.typography.sDisplayMD.fontSize,
18
+ letterSpacing: design_tokens_1.typography.sDisplayMD.letterSpacing,
19
+ },
20
+ [types_1.TextVariant.HeadingLg]: {
21
+ fontSize: design_tokens_1.typography.sHeadingLG.fontSize,
22
+ letterSpacing: design_tokens_1.typography.sHeadingLG.letterSpacing,
23
+ },
24
+ [types_1.TextVariant.HeadingMd]: {
25
+ fontSize: design_tokens_1.typography.sHeadingMD.fontSize,
26
+ letterSpacing: design_tokens_1.typography.sHeadingMD.letterSpacing,
27
+ },
28
+ [types_1.TextVariant.HeadingSm]: {
29
+ fontSize: design_tokens_1.typography.sHeadingSM.fontSize,
30
+ letterSpacing: design_tokens_1.typography.sHeadingSM.letterSpacing,
31
+ },
32
+ [types_1.TextVariant.BodyLg]: {
33
+ fontSize: design_tokens_1.typography.sBodyLGMedium.fontSize,
34
+ letterSpacing: design_tokens_1.typography.sBodyLGMedium.letterSpacing,
35
+ },
36
+ [types_1.TextVariant.BodyMd]: {
37
+ fontSize: design_tokens_1.typography.sBodyMD.fontSize,
38
+ letterSpacing: design_tokens_1.typography.sBodyMD.letterSpacing,
39
+ },
40
+ [types_1.TextVariant.BodySm]: {
41
+ fontSize: design_tokens_1.typography.sBodySM.fontSize,
42
+ letterSpacing: design_tokens_1.typography.sBodySM.letterSpacing,
43
+ },
44
+ [types_1.TextVariant.BodyXs]: {
45
+ fontSize: design_tokens_1.typography.sBodyXS.fontSize,
46
+ letterSpacing: design_tokens_1.typography.sBodyXS.letterSpacing,
47
+ },
48
+ [types_1.TextVariant.PageHeading]: {
49
+ fontSize: design_tokens_1.typography.sPageHeading.fontSize,
50
+ letterSpacing: design_tokens_1.typography.sPageHeading.letterSpacing,
51
+ },
52
+ [types_1.TextVariant.SectionHeading]: {
53
+ fontSize: design_tokens_1.typography.sSectionHeading.fontSize,
54
+ letterSpacing: design_tokens_1.typography.sSectionHeading.letterSpacing,
55
+ },
56
+ [types_1.TextVariant.ButtonLabelMd]: {
57
+ fontSize: design_tokens_1.typography.sButtonLabelMd.fontSize,
58
+ letterSpacing: design_tokens_1.typography.sButtonLabelMd.letterSpacing,
59
+ },
60
+ [types_1.TextVariant.ButtonLabelLg]: {
61
+ fontSize: design_tokens_1.typography.sButtonLabelLg.fontSize,
62
+ letterSpacing: design_tokens_1.typography.sButtonLabelLg.letterSpacing,
63
+ },
64
+ [types_1.TextVariant.AmountDisplayLg]: {
65
+ fontSize: design_tokens_1.typography.sAmountDisplayLg.fontSize,
66
+ letterSpacing: design_tokens_1.typography.sAmountDisplayLg.letterSpacing,
67
+ },
68
+ };
69
+ //# sourceMappingURL=Input.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.constants.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.constants.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AAErD,iDAA0C;AAE1C;;;;GAIG;AACU,QAAA,8BAA8B,GAGvC;IACF,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE;QACvB,QAAQ,EAAE,0BAAU,CAAC,UAAU,CAAC,QAAQ;QACxC,aAAa,EAAE,0BAAU,CAAC,UAAU,CAAC,aAAa;KACnD;IACD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE;QACvB,QAAQ,EAAE,0BAAU,CAAC,UAAU,CAAC,QAAQ;QACxC,aAAa,EAAE,0BAAU,CAAC,UAAU,CAAC,aAAa;KACnD;IACD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE;QACvB,QAAQ,EAAE,0BAAU,CAAC,UAAU,CAAC,QAAQ;QACxC,aAAa,EAAE,0BAAU,CAAC,UAAU,CAAC,aAAa;KACnD;IACD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE;QACvB,QAAQ,EAAE,0BAAU,CAAC,UAAU,CAAC,QAAQ;QACxC,aAAa,EAAE,0BAAU,CAAC,UAAU,CAAC,aAAa;KACnD;IACD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE;QACvB,QAAQ,EAAE,0BAAU,CAAC,UAAU,CAAC,QAAQ;QACxC,aAAa,EAAE,0BAAU,CAAC,UAAU,CAAC,aAAa;KACnD;IACD,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,QAAQ,EAAE,0BAAU,CAAC,aAAa,CAAC,QAAQ;QAC3C,aAAa,EAAE,0BAAU,CAAC,aAAa,CAAC,aAAa;KACtD;IACD,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,QAAQ,EAAE,0BAAU,CAAC,OAAO,CAAC,QAAQ;QACrC,aAAa,EAAE,0BAAU,CAAC,OAAO,CAAC,aAAa;KAChD;IACD,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,QAAQ,EAAE,0BAAU,CAAC,OAAO,CAAC,QAAQ;QACrC,aAAa,EAAE,0BAAU,CAAC,OAAO,CAAC,aAAa;KAChD;IACD,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,QAAQ,EAAE,0BAAU,CAAC,OAAO,CAAC,QAAQ;QACrC,aAAa,EAAE,0BAAU,CAAC,OAAO,CAAC,aAAa;KAChD;IACD,CAAC,mBAAW,CAAC,WAAW,CAAC,EAAE;QACzB,QAAQ,EAAE,0BAAU,CAAC,YAAY,CAAC,QAAQ;QAC1C,aAAa,EAAE,0BAAU,CAAC,YAAY,CAAC,aAAa;KACrD;IACD,CAAC,mBAAW,CAAC,cAAc,CAAC,EAAE;QAC5B,QAAQ,EAAE,0BAAU,CAAC,eAAe,CAAC,QAAQ;QAC7C,aAAa,EAAE,0BAAU,CAAC,eAAe,CAAC,aAAa;KACxD;IACD,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE;QAC3B,QAAQ,EAAE,0BAAU,CAAC,cAAc,CAAC,QAAQ;QAC5C,aAAa,EAAE,0BAAU,CAAC,cAAc,CAAC,aAAa;KACvD;IACD,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE;QAC3B,QAAQ,EAAE,0BAAU,CAAC,cAAc,CAAC,QAAQ;QAC5C,aAAa,EAAE,0BAAU,CAAC,cAAc,CAAC,aAAa;KACvD;IACD,CAAC,mBAAW,CAAC,eAAe,CAAC,EAAE;QAC7B,QAAQ,EAAE,0BAAU,CAAC,gBAAgB,CAAC,QAAQ;QAC9C,aAAa,EAAE,0BAAU,CAAC,gBAAgB,CAAC,aAAa;KACzD;CACF,CAAC","sourcesContent":["import { typography } from '@metamask/design-tokens';\n\nimport { TextVariant } from '../../types';\n\n/**\n * Typographic metrics for Input: same tokens as `text-*` utilities but **without** `lineHeight`.\n * React Native `TextInput` aligns single-line text more predictably when line height is not set\n * from the design-system paragraph specs (matches legacy / temp Input.styles behavior).\n */\nexport const MAP_TEXT_VARIANT_INPUT_METRICS: Record<\n TextVariant,\n { fontSize: number; letterSpacing: number }\n> = {\n [TextVariant.DisplayLg]: {\n fontSize: typography.sDisplayLG.fontSize,\n letterSpacing: typography.sDisplayLG.letterSpacing,\n },\n [TextVariant.DisplayMd]: {\n fontSize: typography.sDisplayMD.fontSize,\n letterSpacing: typography.sDisplayMD.letterSpacing,\n },\n [TextVariant.HeadingLg]: {\n fontSize: typography.sHeadingLG.fontSize,\n letterSpacing: typography.sHeadingLG.letterSpacing,\n },\n [TextVariant.HeadingMd]: {\n fontSize: typography.sHeadingMD.fontSize,\n letterSpacing: typography.sHeadingMD.letterSpacing,\n },\n [TextVariant.HeadingSm]: {\n fontSize: typography.sHeadingSM.fontSize,\n letterSpacing: typography.sHeadingSM.letterSpacing,\n },\n [TextVariant.BodyLg]: {\n fontSize: typography.sBodyLGMedium.fontSize,\n letterSpacing: typography.sBodyLGMedium.letterSpacing,\n },\n [TextVariant.BodyMd]: {\n fontSize: typography.sBodyMD.fontSize,\n letterSpacing: typography.sBodyMD.letterSpacing,\n },\n [TextVariant.BodySm]: {\n fontSize: typography.sBodySM.fontSize,\n letterSpacing: typography.sBodySM.letterSpacing,\n },\n [TextVariant.BodyXs]: {\n fontSize: typography.sBodyXS.fontSize,\n letterSpacing: typography.sBodyXS.letterSpacing,\n },\n [TextVariant.PageHeading]: {\n fontSize: typography.sPageHeading.fontSize,\n letterSpacing: typography.sPageHeading.letterSpacing,\n },\n [TextVariant.SectionHeading]: {\n fontSize: typography.sSectionHeading.fontSize,\n letterSpacing: typography.sSectionHeading.letterSpacing,\n },\n [TextVariant.ButtonLabelMd]: {\n fontSize: typography.sButtonLabelMd.fontSize,\n letterSpacing: typography.sButtonLabelMd.letterSpacing,\n },\n [TextVariant.ButtonLabelLg]: {\n fontSize: typography.sButtonLabelLg.fontSize,\n letterSpacing: typography.sButtonLabelLg.letterSpacing,\n },\n [TextVariant.AmountDisplayLg]: {\n fontSize: typography.sAmountDisplayLg.fontSize,\n letterSpacing: typography.sAmountDisplayLg.letterSpacing,\n },\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import { TextVariant } from "../../types/index.cjs";
2
+ /**
3
+ * Typographic metrics for Input: same tokens as `text-*` utilities but **without** `lineHeight`.
4
+ * React Native `TextInput` aligns single-line text more predictably when line height is not set
5
+ * from the design-system paragraph specs (matches legacy / temp Input.styles behavior).
6
+ */
7
+ export declare const MAP_TEXT_VARIANT_INPUT_METRICS: Record<TextVariant, {
8
+ fontSize: number;
9
+ letterSpacing: number;
10
+ }>;
11
+ //# sourceMappingURL=Input.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,WAAW,EACX;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CA0D5C,CAAC"}