@metamask/design-system-react-native 0.20.0 → 0.22.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 (243) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/dist/components/AvatarIcon/AvatarIcon.cjs +2 -1
  3. package/dist/components/AvatarIcon/AvatarIcon.cjs.map +1 -1
  4. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +16 -16
  5. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
  6. package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts +1 -1
  7. package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts.map +1 -1
  8. package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts +1 -1
  9. package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts.map +1 -1
  10. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +1 -1
  11. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
  12. package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
  13. package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
  14. package/dist/components/AvatarIcon/AvatarIcon.mjs +2 -1
  15. package/dist/components/AvatarIcon/AvatarIcon.mjs.map +1 -1
  16. package/dist/components/AvatarIcon/AvatarIcon.types.cjs.map +1 -1
  17. package/dist/components/AvatarIcon/AvatarIcon.types.d.cts +3 -13
  18. package/dist/components/AvatarIcon/AvatarIcon.types.d.cts.map +1 -1
  19. package/dist/components/AvatarIcon/AvatarIcon.types.d.mts +3 -13
  20. package/dist/components/AvatarIcon/AvatarIcon.types.d.mts.map +1 -1
  21. package/dist/components/AvatarIcon/AvatarIcon.types.mjs.map +1 -1
  22. package/dist/components/AvatarIcon/index.cjs +4 -4
  23. package/dist/components/AvatarIcon/index.cjs.map +1 -1
  24. package/dist/components/AvatarIcon/index.d.cts +1 -1
  25. package/dist/components/AvatarIcon/index.d.cts.map +1 -1
  26. package/dist/components/AvatarIcon/index.d.mts +1 -1
  27. package/dist/components/AvatarIcon/index.d.mts.map +1 -1
  28. package/dist/components/AvatarIcon/index.mjs +1 -1
  29. package/dist/components/AvatarIcon/index.mjs.map +1 -1
  30. package/dist/components/BadgeIcon/BadgeIcon.cjs +2 -1
  31. package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
  32. package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
  33. package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
  34. package/dist/components/BadgeIcon/BadgeIcon.mjs +2 -1
  35. package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
  36. package/dist/components/BadgeIcon/BadgeIcon.types.cjs.map +1 -1
  37. package/dist/components/BadgeIcon/BadgeIcon.types.d.cts +5 -7
  38. package/dist/components/BadgeIcon/BadgeIcon.types.d.cts.map +1 -1
  39. package/dist/components/BadgeIcon/BadgeIcon.types.d.mts +5 -7
  40. package/dist/components/BadgeIcon/BadgeIcon.types.d.mts.map +1 -1
  41. package/dist/components/BadgeIcon/BadgeIcon.types.mjs.map +1 -1
  42. package/dist/components/BannerBase/BannerBase.cjs +2 -3
  43. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  44. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  45. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  46. package/dist/components/BannerBase/BannerBase.mjs +1 -2
  47. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  48. package/dist/components/Button/Button.cjs +6 -6
  49. package/dist/components/Button/Button.cjs.map +1 -1
  50. package/dist/components/Button/Button.d.cts.map +1 -1
  51. package/dist/components/Button/Button.d.mts.map +1 -1
  52. package/dist/components/Button/Button.mjs +1 -1
  53. package/dist/components/Button/Button.mjs.map +1 -1
  54. package/dist/components/Button/Button.types.cjs.map +1 -1
  55. package/dist/components/Button/Button.types.d.cts +2 -7
  56. package/dist/components/Button/Button.types.d.cts.map +1 -1
  57. package/dist/components/Button/Button.types.d.mts +2 -7
  58. package/dist/components/Button/Button.types.d.mts.map +1 -1
  59. package/dist/components/Button/Button.types.mjs.map +1 -1
  60. package/dist/components/Button/index.cjs +3 -3
  61. package/dist/components/Button/index.cjs.map +1 -1
  62. package/dist/components/Button/index.d.cts +1 -1
  63. package/dist/components/Button/index.d.cts.map +1 -1
  64. package/dist/components/Button/index.d.mts +1 -1
  65. package/dist/components/Button/index.d.mts.map +1 -1
  66. package/dist/components/Button/index.mjs +1 -1
  67. package/dist/components/Button/index.mjs.map +1 -1
  68. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +2 -0
  69. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
  70. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
  71. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
  72. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +2 -0
  73. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
  74. package/dist/components/Button/variants/ButtonPrimary/index.cjs +1 -3
  75. package/dist/components/Button/variants/ButtonPrimary/index.cjs.map +1 -1
  76. package/dist/components/Button/variants/ButtonPrimary/index.d.cts +0 -1
  77. package/dist/components/Button/variants/ButtonPrimary/index.d.cts.map +1 -1
  78. package/dist/components/Button/variants/ButtonPrimary/index.d.mts +0 -1
  79. package/dist/components/Button/variants/ButtonPrimary/index.d.mts.map +1 -1
  80. package/dist/components/Button/variants/ButtonPrimary/index.mjs +0 -1
  81. package/dist/components/Button/variants/ButtonPrimary/index.mjs.map +1 -1
  82. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +2 -0
  83. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
  84. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
  85. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
  86. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +2 -0
  87. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
  88. package/dist/components/Button/variants/ButtonSecondary/index.cjs +1 -3
  89. package/dist/components/Button/variants/ButtonSecondary/index.cjs.map +1 -1
  90. package/dist/components/Button/variants/ButtonSecondary/index.d.cts +0 -1
  91. package/dist/components/Button/variants/ButtonSecondary/index.d.cts.map +1 -1
  92. package/dist/components/Button/variants/ButtonSecondary/index.d.mts +0 -1
  93. package/dist/components/Button/variants/ButtonSecondary/index.d.mts.map +1 -1
  94. package/dist/components/Button/variants/ButtonSecondary/index.mjs +0 -1
  95. package/dist/components/Button/variants/ButtonSecondary/index.mjs.map +1 -1
  96. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +2 -0
  97. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
  98. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
  99. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
  100. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +2 -0
  101. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
  102. package/dist/components/Button/variants/ButtonTertiary/index.cjs +1 -3
  103. package/dist/components/Button/variants/ButtonTertiary/index.cjs.map +1 -1
  104. package/dist/components/Button/variants/ButtonTertiary/index.d.cts +0 -1
  105. package/dist/components/Button/variants/ButtonTertiary/index.d.cts.map +1 -1
  106. package/dist/components/Button/variants/ButtonTertiary/index.d.mts +0 -1
  107. package/dist/components/Button/variants/ButtonTertiary/index.d.mts.map +1 -1
  108. package/dist/components/Button/variants/ButtonTertiary/index.mjs +0 -1
  109. package/dist/components/Button/variants/ButtonTertiary/index.mjs.map +1 -1
  110. package/dist/components/ButtonBase/ButtonBase.cjs +2 -2
  111. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  112. package/dist/components/ButtonBase/ButtonBase.constants.cjs +4 -4
  113. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
  114. package/dist/components/ButtonBase/ButtonBase.constants.d.cts +1 -1
  115. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
  116. package/dist/components/ButtonBase/ButtonBase.constants.d.mts +1 -1
  117. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
  118. package/dist/components/ButtonBase/ButtonBase.constants.mjs +1 -1
  119. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
  120. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  121. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  122. package/dist/components/ButtonBase/ButtonBase.mjs +1 -1
  123. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  124. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  125. package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -32
  126. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  127. package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -32
  128. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  129. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  130. package/dist/components/ButtonBase/index.cjs +2 -2
  131. package/dist/components/ButtonBase/index.cjs.map +1 -1
  132. package/dist/components/ButtonBase/index.d.cts +1 -1
  133. package/dist/components/ButtonBase/index.d.cts.map +1 -1
  134. package/dist/components/ButtonBase/index.d.mts +1 -1
  135. package/dist/components/ButtonBase/index.d.mts.map +1 -1
  136. package/dist/components/ButtonBase/index.mjs +1 -1
  137. package/dist/components/ButtonBase/index.mjs.map +1 -1
  138. package/dist/components/ButtonHero/index.cjs +2 -2
  139. package/dist/components/ButtonHero/index.cjs.map +1 -1
  140. package/dist/components/ButtonHero/index.d.cts +1 -1
  141. package/dist/components/ButtonHero/index.d.cts.map +1 -1
  142. package/dist/components/ButtonHero/index.d.mts +1 -1
  143. package/dist/components/ButtonHero/index.d.mts.map +1 -1
  144. package/dist/components/ButtonHero/index.mjs +1 -1
  145. package/dist/components/ButtonHero/index.mjs.map +1 -1
  146. package/dist/components/ButtonIcon/ButtonIcon.cjs +6 -6
  147. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  148. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs +7 -8
  149. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs.map +1 -1
  150. package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts +1 -2
  151. package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
  152. package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts +1 -2
  153. package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
  154. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs +1 -2
  155. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs.map +1 -1
  156. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  157. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  158. package/dist/components/ButtonIcon/ButtonIcon.mjs +1 -1
  159. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  160. package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
  161. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +3 -26
  162. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
  163. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +3 -26
  164. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
  165. package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
  166. package/dist/components/ButtonIcon/index.cjs +3 -3
  167. package/dist/components/ButtonIcon/index.cjs.map +1 -1
  168. package/dist/components/ButtonIcon/index.d.cts +1 -1
  169. package/dist/components/ButtonIcon/index.d.cts.map +1 -1
  170. package/dist/components/ButtonIcon/index.d.mts +1 -1
  171. package/dist/components/ButtonIcon/index.d.mts.map +1 -1
  172. package/dist/components/ButtonIcon/index.mjs +1 -1
  173. package/dist/components/ButtonIcon/index.mjs.map +1 -1
  174. package/dist/components/Icon/Icon.assets.cjs +2 -0
  175. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  176. package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
  177. package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
  178. package/dist/components/Icon/Icon.assets.mjs +2 -0
  179. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  180. package/dist/components/Icon/assets/telegram.svg +3 -0
  181. package/dist/components/Input/Input.cjs +2 -2
  182. package/dist/components/Input/Input.cjs.map +1 -1
  183. package/dist/components/Input/Input.d.cts +1 -1
  184. package/dist/components/Input/Input.d.mts +1 -1
  185. package/dist/components/Input/Input.mjs +2 -2
  186. package/dist/components/Input/Input.mjs.map +1 -1
  187. package/dist/components/Input/Input.types.cjs.map +1 -1
  188. package/dist/components/Input/Input.types.d.cts +1 -1
  189. package/dist/components/Input/Input.types.d.mts +1 -1
  190. package/dist/components/Input/Input.types.mjs.map +1 -1
  191. package/dist/components/KeyValueColumn/KeyValueColumn.cjs +2 -2
  192. package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
  193. package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
  194. package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
  195. package/dist/components/KeyValueColumn/KeyValueColumn.mjs +2 -2
  196. package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
  197. package/dist/components/KeyValueRow/KeyValueRow.cjs +2 -2
  198. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
  199. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
  200. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
  201. package/dist/components/KeyValueRow/KeyValueRow.mjs +2 -2
  202. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
  203. package/dist/components/TabEmptyState/TabEmptyState.cjs +1 -1
  204. package/dist/components/TabEmptyState/TabEmptyState.cjs.map +1 -1
  205. package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -1
  206. package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -1
  207. package/dist/components/TabEmptyState/TabEmptyState.mjs +1 -1
  208. package/dist/components/TabEmptyState/TabEmptyState.mjs.map +1 -1
  209. package/dist/components/TextField/TextField.cjs +10 -30
  210. package/dist/components/TextField/TextField.cjs.map +1 -1
  211. package/dist/components/TextField/TextField.d.cts +159 -7
  212. package/dist/components/TextField/TextField.d.cts.map +1 -1
  213. package/dist/components/TextField/TextField.d.mts +159 -7
  214. package/dist/components/TextField/TextField.d.mts.map +1 -1
  215. package/dist/components/TextField/TextField.mjs +12 -32
  216. package/dist/components/TextField/TextField.mjs.map +1 -1
  217. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  218. package/dist/components/TextField/TextField.types.d.cts +41 -16
  219. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  220. package/dist/components/TextField/TextField.types.d.mts +41 -16
  221. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  222. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  223. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -1
  224. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +160 -8
  225. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
  226. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +160 -8
  227. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
  228. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -1
  229. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  230. package/dist/components/Toast/Toast.types.d.cts +1 -2
  231. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  232. package/dist/components/Toast/Toast.types.d.mts +1 -2
  233. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  234. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  235. package/dist/types/index.cjs +3 -71
  236. package/dist/types/index.cjs.map +1 -1
  237. package/dist/types/index.d.cts +0 -66
  238. package/dist/types/index.d.cts.map +1 -1
  239. package/dist/types/index.d.mts +0 -66
  240. package/dist/types/index.d.mts.map +1 -1
  241. package/dist/types/index.mjs +0 -72
  242. package/dist/types/index.mjs.map +1 -1
  243. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.22.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** Updated `Button`, `ButtonBase`, and `ButtonHero` size and variant exports to use shared const-object + string-union types rather than platform-local enum-based definitions, aligning React Native with the shared cross-platform type contracts ([#1034](https://github.com/MetaMask/metamask-design-system/pull/1034))
15
+ - No migration required for typical usage; continue importing from `@metamask/design-system-react-native` as before.
16
+ - Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
17
+ - **BREAKING:** Updated `ButtonIconSize` and `ButtonIconVariant` to use shared const-object + string-union types rather than platform-local enum-based definitions, aligning React Native with the shared cross-platform type contracts ([#1038](https://github.com/MetaMask/metamask-design-system/pull/1038))
18
+ - No migration required for typical usage; continue importing from `@metamask/design-system-react-native` as before.
19
+ - Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
20
+ - **BREAKING:** `TextField` and `TextFieldSearch` now use a root `Box`/`View`, require native `TextInput` props under `inputProps`, rename `isReadonly` to `isReadOnly`, and use `inputRef` for the inner input ref. See [Migration Guide](./MIGRATION.md#from-version-0210-to-0220) ([#1081](https://github.com/MetaMask/metamask-design-system/pull/1081))
21
+ - Updated Figma Code Connect to the live `MMDS Components` file and aligned `ButtonIcon` and `TextButton` mappings with the current component APIs shown in Dev Mode ([#1109](https://github.com/MetaMask/metamask-design-system/pull/1109))
22
+
23
+ ## [0.21.0]
24
+
25
+ ### Added
26
+
27
+ - Added `Telegram` to the `IconName` set for use anywhere the React Native package accepts design system icons ([#1122](https://github.com/MetaMask/metamask-design-system/pull/1122))
28
+
29
+ ### Changed
30
+
31
+ - **BREAKING:** Updated `AvatarIcon` exports to use shared const-object + string-union types rather than local enum-based definitions, aligning React Native with the shared cross-platform type contracts ([#996](https://github.com/MetaMask/metamask-design-system/pull/996))
32
+ - No migration required for typical usage; continue importing from `@metamask/design-system-react-native` as before.
33
+ - Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
34
+
10
35
  ## [0.20.0]
11
36
 
12
37
  ### Added
@@ -361,7 +386,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
361
386
  - Full TypeScript support with type definitions and enums
362
387
  - React Native integration with TWRNC preset support
363
388
 
364
- [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.20.0...HEAD
389
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.22.0...HEAD
390
+ [0.22.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.21.0...@metamask/design-system-react-native@0.22.0
391
+ [0.21.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.20.0...@metamask/design-system-react-native@0.21.0
365
392
  [0.20.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.19.0...@metamask/design-system-react-native@0.20.0
366
393
  [0.19.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.18.0...@metamask/design-system-react-native@0.19.0
367
394
  [0.18.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.17.0...@metamask/design-system-react-native@0.18.0
@@ -4,13 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AvatarIcon = void 0;
7
+ const design_system_shared_1 = require("@metamask/design-system-shared");
7
8
  const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
8
9
  const react_1 = __importDefault(require("react"));
9
10
  const types_1 = require("../../types/index.cjs");
10
11
  const AvatarBase_1 = require("../AvatarBase/index.cjs");
11
12
  const Icon_1 = require("../Icon/index.cjs");
12
13
  const AvatarIcon_constants_1 = require("./AvatarIcon.constants.cjs");
13
- const AvatarIcon = ({ size = types_1.AvatarIconSize.Md, shape = types_1.AvatarBaseShape.Circle, severity = types_1.AvatarIconSeverity.Neutral, iconName, iconProps, twClassName, style, ...props }) => {
14
+ const AvatarIcon = ({ size = design_system_shared_1.AvatarIconSize.Md, shape = types_1.AvatarBaseShape.Circle, severity = design_system_shared_1.AvatarIconSeverity.Neutral, iconName, iconProps, twClassName, style, ...props }) => {
14
15
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
15
16
  return (<AvatarBase_1.AvatarBase size={size} shape={shape} accessibilityRole="image" {...props} style={[
16
17
  tw.style(AvatarIcon_constants_1.TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[severity], twClassName),
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,qFAAmE;AACnE,kDAA0B;AAE1B,iDAIqB;AACrB,wDAA2C;AAC3C,4CAA+B;AAE/B,qEAIgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,KAAK,GAAG,uBAAe,CAAC,MAAM,EAC9B,QAAQ,GAAG,0BAAkB,CAAC,OAAO,EACrC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,qEAA8C,CAAC,QAAQ,CAAC,EACxD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,mDAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,KAAK,CAAC,CAAC,wDAAiC,CAAC,QAAQ,CAAC,CAAC,CACnD,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,UAAU,cAkCrB","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport {\n AvatarIconSize,\n AvatarBaseShape,\n AvatarIconSeverity,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_AVATARICON_SIZE_ICONSIZE,\n MAP_AVATARICON_SEVERITY_ICONCOLOR,\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR,\n} from './AvatarIcon.constants';\nimport type { AvatarIconProps } from './AvatarIcon.types';\n\nexport const AvatarIcon = ({\n size = AvatarIconSize.Md,\n shape = AvatarBaseShape.Circle,\n severity = AvatarIconSeverity.Neutral,\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: AvatarIconProps) => {\n const tw = useTailwind();\n\n return (\n <AvatarBase\n size={size}\n shape={shape}\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[severity],\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n size={MAP_AVATARICON_SIZE_ICONSIZE[size]}\n color={MAP_AVATARICON_SEVERITY_ICONCOLOR[severity]}\n {...iconProps}\n />\n </AvatarBase>\n );\n};\n"]}
1
+ {"version":3,"file":"AvatarIcon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAGwC;AACxC,qFAAmE;AACnE,kDAA0B;AAE1B,iDAA8C;AAC9C,wDAA2C;AAC3C,4CAA+B;AAE/B,qEAIgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,KAAK,GAAG,uBAAe,CAAC,MAAM,EAC9B,QAAQ,GAAG,yCAAkB,CAAC,OAAO,EACrC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,qEAA8C,CAAC,QAAQ,CAAC,EACxD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,mDAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,KAAK,CAAC,CAAC,wDAAiC,CAAC,QAAQ,CAAC,CAAC,CACnD,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,UAAU,cAkCrB","sourcesContent":["import {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { AvatarBaseShape } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_AVATARICON_SIZE_ICONSIZE,\n MAP_AVATARICON_SEVERITY_ICONCOLOR,\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR,\n} from './AvatarIcon.constants';\nimport type { AvatarIconProps } from './AvatarIcon.types';\n\nexport const AvatarIcon = ({\n size = AvatarIconSize.Md,\n shape = AvatarBaseShape.Circle,\n severity = AvatarIconSeverity.Neutral,\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: AvatarIconProps) => {\n const tw = useTailwind();\n\n return (\n <AvatarBase\n size={size}\n shape={shape}\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[severity],\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n size={MAP_AVATARICON_SIZE_ICONSIZE[size]}\n color={MAP_AVATARICON_SEVERITY_ICONCOLOR[severity]}\n {...iconProps}\n />\n </AvatarBase>\n );\n};\n"]}
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MAP_AVATARICON_SEVERITY_ICONCOLOR = exports.MAP_AVATARICON_SIZE_ICONSIZE = exports.TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR = void 0;
4
- const types_1 = require("../../types/index.cjs");
4
+ const design_system_shared_1 = require("@metamask/design-system-shared");
5
5
  const Icon_1 = require("../Icon/index.cjs");
6
6
  // Mappings
7
7
  exports.TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR = {
8
- [types_1.AvatarIconSeverity.Neutral]: 'bg-muted',
9
- [types_1.AvatarIconSeverity.Info]: 'bg-info-muted',
10
- [types_1.AvatarIconSeverity.Success]: 'bg-success-muted',
11
- [types_1.AvatarIconSeverity.Error]: 'bg-error-muted',
12
- [types_1.AvatarIconSeverity.Warning]: 'bg-warning-muted',
8
+ [design_system_shared_1.AvatarIconSeverity.Neutral]: 'bg-muted',
9
+ [design_system_shared_1.AvatarIconSeverity.Info]: 'bg-info-muted',
10
+ [design_system_shared_1.AvatarIconSeverity.Success]: 'bg-success-muted',
11
+ [design_system_shared_1.AvatarIconSeverity.Error]: 'bg-error-muted',
12
+ [design_system_shared_1.AvatarIconSeverity.Warning]: 'bg-warning-muted',
13
13
  };
14
14
  exports.MAP_AVATARICON_SIZE_ICONSIZE = {
15
- [types_1.AvatarIconSize.Xs]: Icon_1.IconSize.Xs,
16
- [types_1.AvatarIconSize.Sm]: Icon_1.IconSize.Sm,
17
- [types_1.AvatarIconSize.Md]: Icon_1.IconSize.Md,
18
- [types_1.AvatarIconSize.Lg]: Icon_1.IconSize.Lg,
19
- [types_1.AvatarIconSize.Xl]: Icon_1.IconSize.Xl, // 48px avatar -> 32px icon
15
+ [design_system_shared_1.AvatarIconSize.Xs]: Icon_1.IconSize.Xs,
16
+ [design_system_shared_1.AvatarIconSize.Sm]: Icon_1.IconSize.Sm,
17
+ [design_system_shared_1.AvatarIconSize.Md]: Icon_1.IconSize.Md,
18
+ [design_system_shared_1.AvatarIconSize.Lg]: Icon_1.IconSize.Lg,
19
+ [design_system_shared_1.AvatarIconSize.Xl]: Icon_1.IconSize.Xl, // 48px avatar -> 32px icon
20
20
  };
21
21
  exports.MAP_AVATARICON_SEVERITY_ICONCOLOR = {
22
- [types_1.AvatarIconSeverity.Neutral]: Icon_1.IconColor.IconAlternative,
23
- [types_1.AvatarIconSeverity.Info]: Icon_1.IconColor.InfoDefault,
24
- [types_1.AvatarIconSeverity.Success]: Icon_1.IconColor.SuccessDefault,
25
- [types_1.AvatarIconSeverity.Error]: Icon_1.IconColor.ErrorDefault,
26
- [types_1.AvatarIconSeverity.Warning]: Icon_1.IconColor.WarningDefault,
22
+ [design_system_shared_1.AvatarIconSeverity.Neutral]: Icon_1.IconColor.IconAlternative,
23
+ [design_system_shared_1.AvatarIconSeverity.Info]: Icon_1.IconColor.InfoDefault,
24
+ [design_system_shared_1.AvatarIconSeverity.Success]: Icon_1.IconColor.SuccessDefault,
25
+ [design_system_shared_1.AvatarIconSeverity.Error]: Icon_1.IconColor.ErrorDefault,
26
+ [design_system_shared_1.AvatarIconSeverity.Warning]: Icon_1.IconColor.WarningDefault,
27
27
  };
28
28
  //# sourceMappingURL=AvatarIcon.constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":";;;AAAA,iDAAiE;AACjE,4CAA8C;AAE9C,WAAW;AACE,QAAA,8CAA8C,GAGvD;IACF,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,UAAU;IACxC,CAAC,0BAAkB,CAAC,IAAI,CAAC,EAAE,eAAe;IAC1C,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;IAChD,CAAC,0BAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB;IAC5C,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;CACjD,CAAC;AACW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE,EAAE,2BAA2B;CAC9D,CAAC;AACW,QAAA,iCAAiC,GAG1C;IACF,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,eAAe;IACvD,CAAC,0BAAkB,CAAC,IAAI,CAAC,EAAE,gBAAS,CAAC,WAAW;IAChD,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,cAAc;IACtD,CAAC,0BAAkB,CAAC,KAAK,CAAC,EAAE,gBAAS,CAAC,YAAY;IAClD,CAAC,0BAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,cAAc;CACvD,CAAC","sourcesContent":["import { AvatarIconSize, AvatarIconSeverity } from '../../types';\nimport { IconSize, IconColor } from '../Icon';\n\n// Mappings\nexport const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<\n AvatarIconSeverity,\n string\n> = {\n [AvatarIconSeverity.Neutral]: 'bg-muted',\n [AvatarIconSeverity.Info]: 'bg-info-muted',\n [AvatarIconSeverity.Success]: 'bg-success-muted',\n [AvatarIconSeverity.Error]: 'bg-error-muted',\n [AvatarIconSeverity.Warning]: 'bg-warning-muted',\n};\nexport const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize> = {\n [AvatarIconSize.Xs]: IconSize.Xs, // 16px avatar -> 12px icon\n [AvatarIconSize.Sm]: IconSize.Sm, // 24px avatar -> 16px icon\n [AvatarIconSize.Md]: IconSize.Md, // 32px avatar -> 20px icon\n [AvatarIconSize.Lg]: IconSize.Lg, // 40px avatar -> 24px icon\n [AvatarIconSize.Xl]: IconSize.Xl, // 48px avatar -> 32px icon\n};\nexport const MAP_AVATARICON_SEVERITY_ICONCOLOR: Record<\n AvatarIconSeverity,\n IconColor\n> = {\n [AvatarIconSeverity.Neutral]: IconColor.IconAlternative,\n [AvatarIconSeverity.Info]: IconColor.InfoDefault,\n [AvatarIconSeverity.Success]: IconColor.SuccessDefault,\n [AvatarIconSeverity.Error]: IconColor.ErrorDefault,\n [AvatarIconSeverity.Warning]: IconColor.WarningDefault,\n};\n"]}
1
+ {"version":3,"file":"AvatarIcon.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":";;;AAAA,yEAGwC;AAExC,4CAA8C;AAE9C,WAAW;AACE,QAAA,8CAA8C,GAGvD;IACF,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,UAAU;IACxC,CAAC,yCAAkB,CAAC,IAAI,CAAC,EAAE,eAAe;IAC1C,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;IAChD,CAAC,yCAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB;IAC5C,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;CACjD,CAAC;AACW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,eAAQ,CAAC,EAAE,EAAE,2BAA2B;CAC9D,CAAC;AACW,QAAA,iCAAiC,GAG1C;IACF,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,eAAe;IACvD,CAAC,yCAAkB,CAAC,IAAI,CAAC,EAAE,gBAAS,CAAC,WAAW;IAChD,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,cAAc;IACtD,CAAC,yCAAkB,CAAC,KAAK,CAAC,EAAE,gBAAS,CAAC,YAAY;IAClD,CAAC,yCAAkB,CAAC,OAAO,CAAC,EAAE,gBAAS,CAAC,cAAc;CACvD,CAAC","sourcesContent":["import {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\n\nimport { IconSize, IconColor } from '../Icon';\n\n// Mappings\nexport const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<\n AvatarIconSeverity,\n string\n> = {\n [AvatarIconSeverity.Neutral]: 'bg-muted',\n [AvatarIconSeverity.Info]: 'bg-info-muted',\n [AvatarIconSeverity.Success]: 'bg-success-muted',\n [AvatarIconSeverity.Error]: 'bg-error-muted',\n [AvatarIconSeverity.Warning]: 'bg-warning-muted',\n};\nexport const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize> = {\n [AvatarIconSize.Xs]: IconSize.Xs, // 16px avatar -> 12px icon\n [AvatarIconSize.Sm]: IconSize.Sm, // 24px avatar -> 16px icon\n [AvatarIconSize.Md]: IconSize.Md, // 32px avatar -> 20px icon\n [AvatarIconSize.Lg]: IconSize.Lg, // 40px avatar -> 24px icon\n [AvatarIconSize.Xl]: IconSize.Xl, // 48px avatar -> 32px icon\n};\nexport const MAP_AVATARICON_SEVERITY_ICONCOLOR: Record<\n AvatarIconSeverity,\n IconColor\n> = {\n [AvatarIconSeverity.Neutral]: IconColor.IconAlternative,\n [AvatarIconSeverity.Info]: IconColor.InfoDefault,\n [AvatarIconSeverity.Success]: IconColor.SuccessDefault,\n [AvatarIconSeverity.Error]: IconColor.ErrorDefault,\n [AvatarIconSeverity.Warning]: IconColor.WarningDefault,\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { AvatarIconSize, AvatarIconSeverity } from "../../types/index.cjs";
1
+ import { AvatarIconSeverity, AvatarIconSize } from "@metamask/design-system-shared";
2
2
  import { IconSize, IconColor } from "../Icon/index.cjs";
3
3
  export declare const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<AvatarIconSeverity, string>;
4
4
  export declare const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize>;
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAG9C,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,kBAAkB,EAClB,MAAM,CAOP,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAMzE,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,kBAAkB,EAClB,SAAS,CAOV,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,uCAAuC;AAExC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAG9C,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,kBAAkB,EAClB,MAAM,CAOP,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAMzE,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,kBAAkB,EAClB,SAAS,CAOV,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AvatarIconSize, AvatarIconSeverity } from "../../types/index.mjs";
1
+ import { AvatarIconSeverity, AvatarIconSize } from "@metamask/design-system-shared";
2
2
  import { IconSize, IconColor } from "../Icon/index.mjs";
3
3
  export declare const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<AvatarIconSeverity, string>;
4
4
  export declare const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize>;
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAG9C,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,kBAAkB,EAClB,MAAM,CAOP,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAMzE,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,kBAAkB,EAClB,SAAS,CAOV,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,uCAAuC;AAExC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAG9C,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,kBAAkB,EAClB,MAAM,CAOP,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAMzE,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,kBAAkB,EAClB,SAAS,CAOV,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AvatarIconSize, AvatarIconSeverity } from "../../types/index.mjs";
1
+ import { AvatarIconSeverity, AvatarIconSize } from "@metamask/design-system-shared";
2
2
  import { IconSize, IconColor } from "../Icon/index.mjs";
3
3
  // Mappings
4
4
  export const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR = {
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAE9C,WAAW;AACX,MAAM,CAAC,MAAM,8CAA8C,GAGvD;IACF,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU;IACxC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,eAAe;IAC1C,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;IAChD,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB;IAC5C,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;CACjD,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,2BAA2B;CAC9D,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAG1C;IACF,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,eAAe;IACvD,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;IAChD,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IACtD,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY;IAClD,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;CACvD,CAAC","sourcesContent":["import { AvatarIconSize, AvatarIconSeverity } from '../../types';\nimport { IconSize, IconColor } from '../Icon';\n\n// Mappings\nexport const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<\n AvatarIconSeverity,\n string\n> = {\n [AvatarIconSeverity.Neutral]: 'bg-muted',\n [AvatarIconSeverity.Info]: 'bg-info-muted',\n [AvatarIconSeverity.Success]: 'bg-success-muted',\n [AvatarIconSeverity.Error]: 'bg-error-muted',\n [AvatarIconSeverity.Warning]: 'bg-warning-muted',\n};\nexport const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize> = {\n [AvatarIconSize.Xs]: IconSize.Xs, // 16px avatar -> 12px icon\n [AvatarIconSize.Sm]: IconSize.Sm, // 24px avatar -> 16px icon\n [AvatarIconSize.Md]: IconSize.Md, // 32px avatar -> 20px icon\n [AvatarIconSize.Lg]: IconSize.Lg, // 40px avatar -> 24px icon\n [AvatarIconSize.Xl]: IconSize.Xl, // 48px avatar -> 32px icon\n};\nexport const MAP_AVATARICON_SEVERITY_ICONCOLOR: Record<\n AvatarIconSeverity,\n IconColor\n> = {\n [AvatarIconSeverity.Neutral]: IconColor.IconAlternative,\n [AvatarIconSeverity.Info]: IconColor.InfoDefault,\n [AvatarIconSeverity.Success]: IconColor.SuccessDefault,\n [AvatarIconSeverity.Error]: IconColor.ErrorDefault,\n [AvatarIconSeverity.Warning]: IconColor.WarningDefault,\n};\n"]}
1
+ {"version":3,"file":"AvatarIcon.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,uCAAuC;AAExC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAE9C,WAAW;AACX,MAAM,CAAC,MAAM,8CAA8C,GAGvD;IACF,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU;IACxC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,eAAe;IAC1C,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;IAChD,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB;IAC5C,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,kBAAkB;CACjD,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,2BAA2B;CAC9D,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAG1C;IACF,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,eAAe;IACvD,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;IAChD,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IACtD,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY;IAClD,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;CACvD,CAAC","sourcesContent":["import {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\n\nimport { IconSize, IconColor } from '../Icon';\n\n// Mappings\nexport const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<\n AvatarIconSeverity,\n string\n> = {\n [AvatarIconSeverity.Neutral]: 'bg-muted',\n [AvatarIconSeverity.Info]: 'bg-info-muted',\n [AvatarIconSeverity.Success]: 'bg-success-muted',\n [AvatarIconSeverity.Error]: 'bg-error-muted',\n [AvatarIconSeverity.Warning]: 'bg-warning-muted',\n};\nexport const MAP_AVATARICON_SIZE_ICONSIZE: Record<AvatarIconSize, IconSize> = {\n [AvatarIconSize.Xs]: IconSize.Xs, // 16px avatar -> 12px icon\n [AvatarIconSize.Sm]: IconSize.Sm, // 24px avatar -> 16px icon\n [AvatarIconSize.Md]: IconSize.Md, // 32px avatar -> 20px icon\n [AvatarIconSize.Lg]: IconSize.Lg, // 40px avatar -> 24px icon\n [AvatarIconSize.Xl]: IconSize.Xl, // 48px avatar -> 32px icon\n};\nexport const MAP_AVATARICON_SEVERITY_ICONCOLOR: Record<\n AvatarIconSeverity,\n IconColor\n> = {\n [AvatarIconSeverity.Neutral]: IconColor.IconAlternative,\n [AvatarIconSeverity.Info]: IconColor.InfoDefault,\n [AvatarIconSeverity.Success]: IconColor.SuccessDefault,\n [AvatarIconSeverity.Error]: IconColor.ErrorDefault,\n [AvatarIconSeverity.Warning]: IconColor.WarningDefault,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAe1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,iFASpB,eAAe,sBAyBjB,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,iFASpB,eAAe,sBAyBjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAe1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,iFASpB,eAAe,sBAyBjB,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,iFASpB,eAAe,sBAyBjB,CAAC"}
@@ -4,10 +4,11 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { AvatarIconSeverity, AvatarIconSize } from "@metamask/design-system-shared";
7
8
  import { useTailwind } from "@metamask/design-system-twrnc-preset";
8
9
  import $React from "react";
9
10
  const React = $importDefault($React);
10
- import { AvatarIconSize, AvatarBaseShape, AvatarIconSeverity } from "../../types/index.mjs";
11
+ import { AvatarBaseShape } from "../../types/index.mjs";
11
12
  import { AvatarBase } from "../AvatarBase/index.mjs";
12
13
  import { Icon } from "../Icon/index.mjs";
13
14
  import { MAP_AVATARICON_SIZE_ICONSIZE, MAP_AVATARICON_SEVERITY_ICONCOLOR, TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR } from "./AvatarIcon.constants.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAE1B,OAAO,EACL,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,8BAAoB;AACrB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,EACjC,8CAA8C,EAC/C,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,KAAK,GAAG,eAAe,CAAC,MAAM,EAC9B,QAAQ,GAAG,kBAAkB,CAAC,OAAO,EACrC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,8CAA8C,CAAC,QAAQ,CAAC,EACxD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,KAAK,CAAC,CAAC,iCAAiC,CAAC,QAAQ,CAAC,CAAC,CACnD,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport {\n AvatarIconSize,\n AvatarBaseShape,\n AvatarIconSeverity,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_AVATARICON_SIZE_ICONSIZE,\n MAP_AVATARICON_SEVERITY_ICONCOLOR,\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR,\n} from './AvatarIcon.constants';\nimport type { AvatarIconProps } from './AvatarIcon.types';\n\nexport const AvatarIcon = ({\n size = AvatarIconSize.Md,\n shape = AvatarBaseShape.Circle,\n severity = AvatarIconSeverity.Neutral,\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: AvatarIconProps) => {\n const tw = useTailwind();\n\n return (\n <AvatarBase\n size={size}\n shape={shape}\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[severity],\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n size={MAP_AVATARICON_SIZE_ICONSIZE[size]}\n color={MAP_AVATARICON_SEVERITY_ICONCOLOR[severity]}\n {...iconProps}\n />\n </AvatarBase>\n );\n};\n"]}
1
+ {"version":3,"file":"AvatarIcon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,eAAe,EAAE,8BAAoB;AAC9C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,EACjC,8CAA8C,EAC/C,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,KAAK,GAAG,eAAe,CAAC,MAAM,EAC9B,QAAQ,GAAG,kBAAkB,CAAC,OAAO,EACrC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,8CAA8C,CAAC,QAAQ,CAAC,EACxD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,KAAK,CAAC,CAAC,iCAAiC,CAAC,QAAQ,CAAC,CAAC,CACnD,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { AvatarBaseShape } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_AVATARICON_SIZE_ICONSIZE,\n MAP_AVATARICON_SEVERITY_ICONCOLOR,\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR,\n} from './AvatarIcon.constants';\nimport type { AvatarIconProps } from './AvatarIcon.types';\n\nexport const AvatarIcon = ({\n size = AvatarIconSize.Md,\n shape = AvatarBaseShape.Circle,\n severity = AvatarIconSeverity.Neutral,\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: AvatarIconProps) => {\n const tw = useTailwind();\n\n return (\n <AvatarBase\n size={size}\n shape={shape}\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[severity],\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n size={MAP_AVATARICON_SIZE_ICONSIZE[size]}\n color={MAP_AVATARICON_SEVERITY_ICONCOLOR[severity]}\n {...iconProps}\n />\n </AvatarBase>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarIconSeverity } from '../../types';\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { IconName, IconProps } from '../Icon';\n\n/**\n * AvatarIcon component props.\n */\nexport type AvatarIconProps = {\n /**\n * Optional prop to control the severity of the avatar\n *\n * @default AvatarIconSeverity.Neutral\n */\n severity?: AvatarIconSeverity;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n} & Omit<AvatarBaseProps, 'children' | 'fallbackText' | 'fallbackTextProps'>;\n"]}
1
+ {"version":3,"file":"AvatarIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarIconPropsShared } from '@metamask/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { IconProps } from '../Icon';\n\n/**\n * AvatarIcon component props.\n */\nexport type AvatarIconProps = AvatarIconPropsShared & {\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n} & Omit<AvatarBaseProps, 'children' | 'fallbackText' | 'fallbackTextProps'>;\n"]}
@@ -1,20 +1,10 @@
1
- import type { AvatarIconSeverity } from "../../types/index.cjs";
1
+ import type { AvatarIconPropsShared } from "@metamask/design-system-shared";
2
2
  import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
3
- import type { IconName, IconProps } from "../Icon/index.cjs";
3
+ import type { IconProps } from "../Icon/index.cjs";
4
4
  /**
5
5
  * AvatarIcon component props.
6
6
  */
7
- export type AvatarIconProps = {
8
- /**
9
- * Optional prop to control the severity of the avatar
10
- *
11
- * @default AvatarIconSeverity.Neutral
12
- */
13
- severity?: AvatarIconSeverity;
14
- /**
15
- * Optional prop to specify an icon to show
16
- */
17
- iconName: IconName;
7
+ export type AvatarIconProps = AvatarIconPropsShared & {
18
8
  /**
19
9
  * Optional prop to pass additional properties to the icon
20
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAAoB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAEnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAAC"}
@@ -1,20 +1,10 @@
1
- import type { AvatarIconSeverity } from "../../types/index.mjs";
1
+ import type { AvatarIconPropsShared } from "@metamask/design-system-shared";
2
2
  import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
3
- import type { IconName, IconProps } from "../Icon/index.mjs";
3
+ import type { IconProps } from "../Icon/index.mjs";
4
4
  /**
5
5
  * AvatarIcon component props.
6
6
  */
7
- export type AvatarIconProps = {
8
- /**
9
- * Optional prop to control the severity of the avatar
10
- *
11
- * @default AvatarIconSeverity.Neutral
12
- */
13
- severity?: AvatarIconSeverity;
14
- /**
15
- * Optional prop to specify an icon to show
16
- */
17
- iconName: IconName;
7
+ export type AvatarIconProps = AvatarIconPropsShared & {
18
8
  /**
19
9
  * Optional prop to pass additional properties to the icon
20
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAAoB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAEnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarIconSeverity } from '../../types';\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { IconName, IconProps } from '../Icon';\n\n/**\n * AvatarIcon component props.\n */\nexport type AvatarIconProps = {\n /**\n * Optional prop to control the severity of the avatar\n *\n * @default AvatarIconSeverity.Neutral\n */\n severity?: AvatarIconSeverity;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n} & Omit<AvatarBaseProps, 'children' | 'fallbackText' | 'fallbackTextProps'>;\n"]}
1
+ {"version":3,"file":"AvatarIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/AvatarIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarIconPropsShared } from '@metamask/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { IconProps } from '../Icon';\n\n/**\n * AvatarIcon component props.\n */\nexport type AvatarIconProps = AvatarIconPropsShared & {\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n} & Omit<AvatarBaseProps, 'children' | 'fallbackText' | 'fallbackTextProps'>;\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AvatarIcon = exports.AvatarIconSeverity = exports.AvatarIconSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "AvatarIconSize", { enumerable: true, get: function () { return types_1.AvatarIconSize; } });
6
- Object.defineProperty(exports, "AvatarIconSeverity", { enumerable: true, get: function () { return types_1.AvatarIconSeverity; } });
3
+ exports.AvatarIcon = exports.AvatarIconSize = exports.AvatarIconSeverity = void 0;
4
+ var design_system_shared_1 = require("@metamask/design-system-shared");
5
+ Object.defineProperty(exports, "AvatarIconSeverity", { enumerable: true, get: function () { return design_system_shared_1.AvatarIconSeverity; } });
6
+ Object.defineProperty(exports, "AvatarIconSize", { enumerable: true, get: function () { return design_system_shared_1.AvatarIconSize; } });
7
7
  var AvatarIcon_1 = require("./AvatarIcon.cjs");
8
8
  Object.defineProperty(exports, "AvatarIcon", { enumerable: true, get: function () { return AvatarIcon_1.AvatarIcon; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAAxD,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { AvatarIconSize, AvatarIconSeverity } from '../../types';\nexport { AvatarIcon } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":";;;AAAA,uEAGwC;AAFtC,0HAAA,kBAAkB,OAAA;AAClB,sHAAA,cAAc,OAAA;AAEhB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\nexport { AvatarIcon } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { AvatarIconSize, AvatarIconSeverity } from "../../types/index.cjs";
1
+ export { AvatarIconSeverity, AvatarIconSize, } from "@metamask/design-system-shared";
2
2
  export { AvatarIcon } from "./AvatarIcon.cjs";
3
3
  export type { AvatarIconProps } from "./AvatarIcon.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,GACf,uCAAuC;AACxC,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,4 +1,4 @@
1
- export { AvatarIconSize, AvatarIconSeverity } from "../../types/index.mjs";
1
+ export { AvatarIconSeverity, AvatarIconSize, } from "@metamask/design-system-shared";
2
2
  export { AvatarIcon } from "./AvatarIcon.mjs";
3
3
  export type { AvatarIconProps } from "./AvatarIcon.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,GACf,uCAAuC;AACxC,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,3 @@
1
- export { AvatarIconSize, AvatarIconSeverity } from "../../types/index.mjs";
1
+ export { AvatarIconSeverity, AvatarIconSize } from "@metamask/design-system-shared";
2
2
  export { AvatarIcon } from "./AvatarIcon.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAAoB;AACjE,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { AvatarIconSize, AvatarIconSeverity } from '../../types';\nexport { AvatarIcon } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,uCAAuC;AACxC,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export {\n AvatarIconSeverity,\n AvatarIconSize,\n} from '@metamask/design-system-shared';\nexport { AvatarIcon } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon.types';\n"]}
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BadgeIcon = void 0;
7
+ const design_system_shared_1 = require("@metamask/design-system-shared");
7
8
  const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
8
9
  const react_1 = __importDefault(require("react"));
9
10
  const react_native_1 = require("react-native/index.js");
@@ -14,7 +15,7 @@ const BadgeIcon = ({ iconName, iconProps, twClassName, style, ...props }) => {
14
15
  tw.style('h-4 w-4 bg-icon-default rounded-full items-center justify-center', twClassName),
15
16
  style,
16
17
  ]}>
17
- <Icon_1.Icon color={Icon_1.IconColor.PrimaryInverse} {...iconProps} size={Icon_1.IconSize.Xs} name={iconName}/>
18
+ <Icon_1.Icon color={design_system_shared_1.IconColor.PrimaryInverse} {...iconProps} size={design_system_shared_1.IconSize.Xs} name={iconName}/>
18
19
  </react_native_1.View>);
19
20
  };
20
21
  exports.BadgeIcon = BadgeIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.cjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAoC;AAEpC,4CAAoD;AAI7C,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACO,EAAE,EAAE;IACnB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,kEAAkE,EAClE,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,KAAK,CAAC,CAAC,gBAAS,CAAC,cAAc,CAAC,CAChC,IAAI,SAAS,CAAC,CACd,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAEnB;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,SAAS,aA6BpB","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon, IconSize, IconColor } from '../Icon';\n\nimport type { BadgeIconProps } from './BadgeIcon.types';\n\nexport const BadgeIcon = ({\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: BadgeIconProps) => {\n const tw = useTailwind();\n\n return (\n <View\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n 'h-4 w-4 bg-icon-default rounded-full items-center justify-center',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n color={IconColor.PrimaryInverse}\n {...iconProps}\n size={IconSize.Xs}\n name={iconName}\n />\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeIcon.cjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAAqE;AACrE,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAoC;AAEpC,4CAA+B;AAIxB,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACO,EAAE,EAAE;IACnB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,kEAAkE,EAClE,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,KAAK,CAAC,CAAC,gCAAS,CAAC,cAAc,CAAC,CAChC,IAAI,SAAS,CAAC,CACd,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAEnB;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,SAAS,aA6BpB","sourcesContent":["import { IconColor, IconSize } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\n\nimport type { BadgeIconProps } from './BadgeIcon.types';\n\nexport const BadgeIcon = ({\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: BadgeIconProps) => {\n const tw = useTailwind();\n\n return (\n <View\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n 'h-4 w-4 bg-icon-default rounded-full items-center justify-center',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n color={IconColor.PrimaryInverse}\n {...iconProps}\n size={IconSize.Xs}\n name={iconName}\n />\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AAExD,eAAO,MAAM,SAAS,0DAMnB,cAAc,sBAuBhB,CAAC"}
1
+ {"version":3,"file":"BadgeIcon.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AAExD,eAAO,MAAM,SAAS,0DAMnB,cAAc,sBAuBhB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AAExD,eAAO,MAAM,SAAS,0DAMnB,cAAc,sBAuBhB,CAAC"}
1
+ {"version":3,"file":"BadgeIcon.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AAExD,eAAO,MAAM,SAAS,0DAMnB,cAAc,sBAuBhB,CAAC"}
@@ -4,11 +4,12 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { IconColor, IconSize } from "@metamask/design-system-shared";
7
8
  import { useTailwind } from "@metamask/design-system-twrnc-preset";
8
9
  import $React from "react";
9
10
  const React = $importDefault($React);
10
11
  import { View } from "react-native/index.js";
11
- import { Icon, IconSize, IconColor } from "../Icon/index.mjs";
12
+ import { Icon } from "../Icon/index.mjs";
12
13
  export const BadgeIcon = ({ iconName, iconProps, twClassName, style, ...props }) => {
13
14
  const tw = useTailwind();
14
15
  return (<View accessibilityRole="image" {...props} style={[
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.mjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAIpD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACO,EAAE,EAAE;IACnB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,kEAAkE,EAClE,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAChC,IAAI,SAAS,CAAC,CACd,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAEnB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon, IconSize, IconColor } from '../Icon';\n\nimport type { BadgeIconProps } from './BadgeIcon.types';\n\nexport const BadgeIcon = ({\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: BadgeIconProps) => {\n const tw = useTailwind();\n\n return (\n <View\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n 'h-4 w-4 bg-icon-default rounded-full items-center justify-center',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n color={IconColor.PrimaryInverse}\n {...iconProps}\n size={IconSize.Xs}\n name={iconName}\n />\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeIcon.mjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,uCAAuC;AACrE,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACO,EAAE,EAAE;IACnB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,iBAAiB,CAAC,OAAO,CACzB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,kEAAkE,EAClE,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAChC,IAAI,SAAS,CAAC,CACd,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAEnB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { IconColor, IconSize } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\n\nimport type { BadgeIconProps } from './BadgeIcon.types';\n\nexport const BadgeIcon = ({\n iconName,\n iconProps,\n twClassName,\n style,\n ...props\n}: BadgeIconProps) => {\n const tw = useTailwind();\n\n return (\n <View\n accessibilityRole=\"image\"\n {...props}\n style={[\n tw.style(\n 'h-4 w-4 bg-icon-default rounded-full items-center justify-center',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n color={IconColor.PrimaryInverse}\n {...iconProps}\n size={IconSize.Xs}\n name={iconName}\n />\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type { IconName, IconProps } from '../Icon';\n\n/**\n * BadgeIcon component props.\n */\nexport type BadgeIconProps = {\n /**\n * Required prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
1
+ {"version":3,"file":"BadgeIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeIconPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { IconProps } from '../Icon';\n\n/**\n * BadgeIcon component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeIconProps = BadgeIconPropsShared & {\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
@@ -1,13 +1,11 @@
1
+ import type { BadgeIconPropsShared } from "@metamask/design-system-shared";
1
2
  import type { ViewProps } from "react-native/index.js";
2
- import type { IconName, IconProps } from "../Icon/index.cjs";
3
+ import type { IconProps } from "../Icon/index.cjs";
3
4
  /**
4
- * BadgeIcon component props.
5
+ * BadgeIcon 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 BadgeIconProps = {
7
- /**
8
- * Required prop to specify an icon to show
9
- */
10
- iconName: IconName;
8
+ export type BadgeIconProps = BadgeIconPropsShared & {
11
9
  /**
12
10
  * Optional prop to pass additional properties to the icon
13
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAEnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"BadgeIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,uCAAuC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG;IAClD;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
@@ -1,13 +1,11 @@
1
+ import type { BadgeIconPropsShared } from "@metamask/design-system-shared";
1
2
  import type { ViewProps } from "react-native/index.js";
2
- import type { IconName, IconProps } from "../Icon/index.mjs";
3
+ import type { IconProps } from "../Icon/index.mjs";
3
4
  /**
4
- * BadgeIcon component props.
5
+ * BadgeIcon 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 BadgeIconProps = {
7
- /**
8
- * Required prop to specify an icon to show
9
- */
10
- iconName: IconName;
8
+ export type BadgeIconProps = BadgeIconPropsShared & {
11
9
  /**
12
10
  * Optional prop to pass additional properties to the icon
13
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AAEnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"BadgeIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,uCAAuC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG;IAClD;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type { IconName, IconProps } from '../Icon';\n\n/**\n * BadgeIcon component props.\n */\nexport type BadgeIconProps = {\n /**\n * Required prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
1
+ {"version":3,"file":"BadgeIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeIcon/BadgeIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeIconPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { IconProps } from '../Icon';\n\n/**\n * BadgeIcon component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeIconProps = BadgeIconPropsShared & {\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Omit<IconProps, 'name'>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BannerBase = void 0;
7
7
  const design_system_shared_1 = require("@metamask/design-system-shared");
8
8
  const react_1 = __importDefault(require("react"));
9
- const types_1 = require("../../types/index.cjs");
10
9
  const Box_1 = require("../Box/index.cjs");
11
10
  const Button_1 = require("../Button/index.cjs");
12
11
  const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
@@ -51,13 +50,13 @@ const BannerBase = ({ title, titleProps, description, descriptionProps, children
51
50
  </Text_1.Text>) : (children))}
52
51
 
53
52
  {shouldShowActionButton && (<Box_1.Box twClassName="mt-4">
54
- <Button_1.Button size={types_1.ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
53
+ <Button_1.Button size={design_system_shared_1.ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
55
54
  {actionButtonLabel}
56
55
  </Button_1.Button>
57
56
  </Box_1.Box>)}
58
57
  </Box_1.Box>
59
58
 
60
- {shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={types_1.IconName.Close} size={types_1.ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={handleClosePress} {...resolvedCloseButtonProps}/>)}
59
+ {shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={design_system_shared_1.IconName.Close} size={design_system_shared_1.ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={handleClosePress} {...resolvedCloseButtonProps}/>)}
61
60
  </Box_1.Box>);
62
61
  };
63
62
  exports.BannerBase = BannerBase;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n FontWeight,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\nimport { GestureResponderEvent } from 'react-native';\n\nimport { ButtonIconSize, ButtonSize, IconName } from '../../types';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n onPress: closeButtonPropsOnPress,\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const handleClosePress =\n onClose || closeButtonPropsOnPress\n ? (event: GestureResponderEvent) => {\n if (onClose) {\n onClose();\n return;\n }\n closeButtonPropsOnPress?.(event);\n }\n : undefined;\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={handleClosePress}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
1
+ {"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n IconName,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\nimport { GestureResponderEvent } from 'react-native';\n\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n onPress: closeButtonPropsOnPress,\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const handleClosePress =\n onClose || closeButtonPropsOnPress\n ? (event: GestureResponderEvent) => {\n if (onClose) {\n onClose();\n return;\n }\n closeButtonPropsOnPress?.(event);\n }\n : undefined;\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={handleClosePress}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmHhD,CAAC"}
1
+ {"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmHhD,CAAC"}