@metamask-previews/design-system-react-native 0.5.1-preview.ab80aae → 0.6.0-preview.3dc70e1

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 (210) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/components/AvatarBase/AvatarBase.cjs +9 -11
  3. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  4. package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
  5. package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
  6. package/dist/components/AvatarBase/AvatarBase.mjs +9 -11
  7. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  8. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +2 -2
  9. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  10. package/dist/components/AvatarFavicon/AvatarFavicon.d.cts +1 -1
  11. package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
  12. package/dist/components/AvatarFavicon/AvatarFavicon.d.mts +1 -1
  13. package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
  14. package/dist/components/AvatarFavicon/AvatarFavicon.mjs +2 -2
  15. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  16. package/dist/components/AvatarGroup/AvatarGroup.cjs +4 -5
  17. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  18. package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
  19. package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
  20. package/dist/components/AvatarGroup/AvatarGroup.mjs +4 -5
  21. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  22. package/dist/components/AvatarGroup/AvatarGroup.types.cjs.map +1 -1
  23. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +5 -5
  24. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
  25. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +5 -5
  26. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
  27. package/dist/components/AvatarGroup/AvatarGroup.types.mjs.map +1 -1
  28. package/dist/components/AvatarIcon/AvatarIcon.cjs +5 -6
  29. package/dist/components/AvatarIcon/AvatarIcon.cjs.map +1 -1
  30. package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
  31. package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
  32. package/dist/components/AvatarIcon/AvatarIcon.mjs +5 -6
  33. package/dist/components/AvatarIcon/AvatarIcon.mjs.map +1 -1
  34. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +2 -2
  35. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  36. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts +1 -1
  37. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
  38. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts +1 -1
  39. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
  40. package/dist/components/AvatarNetwork/AvatarNetwork.mjs +2 -2
  41. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  42. package/dist/components/AvatarToken/AvatarToken.cjs +2 -2
  43. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  44. package/dist/components/AvatarToken/AvatarToken.d.cts +1 -1
  45. package/dist/components/AvatarToken/AvatarToken.d.cts.map +1 -1
  46. package/dist/components/AvatarToken/AvatarToken.d.mts +1 -1
  47. package/dist/components/AvatarToken/AvatarToken.d.mts.map +1 -1
  48. package/dist/components/AvatarToken/AvatarToken.mjs +2 -2
  49. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  50. package/dist/components/BadgeCount/BadgeCount.cjs +5 -10
  51. package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
  52. package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
  53. package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
  54. package/dist/components/BadgeCount/BadgeCount.mjs +5 -10
  55. package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
  56. package/dist/components/BadgeIcon/BadgeIcon.cjs +5 -10
  57. package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
  58. package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
  59. package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
  60. package/dist/components/BadgeIcon/BadgeIcon.mjs +5 -10
  61. package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
  62. package/dist/components/BadgeStatus/BadgeStatus.cjs +6 -6
  63. package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
  64. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +8 -8
  65. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
  66. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts +1 -1
  67. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts.map +1 -1
  68. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts +1 -1
  69. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts.map +1 -1
  70. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
  71. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
  72. package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
  73. package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
  74. package/dist/components/BadgeStatus/BadgeStatus.mjs +6 -6
  75. package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
  76. package/dist/components/BadgeStatus/BadgeStatus.types.cjs.map +1 -1
  77. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +5 -29
  78. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
  79. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +5 -29
  80. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
  81. package/dist/components/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
  82. package/dist/components/BadgeStatus/index.cjs +4 -4
  83. package/dist/components/BadgeStatus/index.cjs.map +1 -1
  84. package/dist/components/BadgeStatus/index.d.cts +1 -1
  85. package/dist/components/BadgeStatus/index.d.cts.map +1 -1
  86. package/dist/components/BadgeStatus/index.d.mts +1 -1
  87. package/dist/components/BadgeStatus/index.d.mts.map +1 -1
  88. package/dist/components/BadgeStatus/index.mjs +1 -1
  89. package/dist/components/BadgeStatus/index.mjs.map +1 -1
  90. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +3 -3
  91. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  92. package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
  93. package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
  94. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +3 -3
  95. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  96. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +51 -0
  97. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -0
  98. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.cjs +7 -0
  99. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.cjs.map +1 -0
  100. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.cts +3 -0
  101. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.cts.map +1 -0
  102. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.mts +3 -0
  103. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.mts.map +1 -0
  104. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.mjs +4 -0
  105. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.mjs.map +1 -0
  106. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.cts +4 -0
  107. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.cts.map +1 -0
  108. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.mts +4 -0
  109. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.mts.map +1 -0
  110. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs +31 -0
  111. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs.map +1 -0
  112. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.cjs +3 -0
  113. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.cjs.map +1 -0
  114. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts +20 -0
  115. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts.map +1 -0
  116. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts +20 -0
  117. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts.map +1 -0
  118. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.mjs +2 -0
  119. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.mjs.map +1 -0
  120. package/dist/components/BottomSheetOverlay/index.cjs +6 -0
  121. package/dist/components/BottomSheetOverlay/index.cjs.map +1 -0
  122. package/dist/components/BottomSheetOverlay/index.d.cts +3 -0
  123. package/dist/components/BottomSheetOverlay/index.d.cts.map +1 -0
  124. package/dist/components/BottomSheetOverlay/index.d.mts +3 -0
  125. package/dist/components/BottomSheetOverlay/index.d.mts.map +1 -0
  126. package/dist/components/BottomSheetOverlay/index.mjs +2 -0
  127. package/dist/components/BottomSheetOverlay/index.mjs.map +1 -0
  128. package/dist/components/Box/Box.cjs +12 -27
  129. package/dist/components/Box/Box.cjs.map +1 -1
  130. package/dist/components/Box/Box.d.cts.map +1 -1
  131. package/dist/components/Box/Box.d.mts.map +1 -1
  132. package/dist/components/Box/Box.mjs +12 -27
  133. package/dist/components/Box/Box.mjs.map +1 -1
  134. package/dist/components/ButtonBase/ButtonBase.cjs +50 -41
  135. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  136. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  137. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  138. package/dist/components/ButtonBase/ButtonBase.mjs +50 -41
  139. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  140. package/dist/components/ButtonIcon/ButtonIcon.cjs +5 -10
  141. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  142. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  143. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  144. package/dist/components/ButtonIcon/ButtonIcon.mjs +5 -10
  145. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  146. package/dist/components/Checkbox/Checkbox.cjs +4 -4
  147. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  148. package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
  149. package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
  150. package/dist/components/Checkbox/Checkbox.mjs +4 -4
  151. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  152. package/dist/components/Icon/Icon.cjs +4 -32
  153. package/dist/components/Icon/Icon.cjs.map +1 -1
  154. package/dist/components/Icon/Icon.d.cts.map +1 -1
  155. package/dist/components/Icon/Icon.d.mts.map +1 -1
  156. package/dist/components/Icon/Icon.mjs +2 -10
  157. package/dist/components/Icon/Icon.mjs.map +1 -1
  158. package/dist/components/Text/Text.cjs +9 -14
  159. package/dist/components/Text/Text.cjs.map +1 -1
  160. package/dist/components/Text/Text.d.cts.map +1 -1
  161. package/dist/components/Text/Text.d.mts.map +1 -1
  162. package/dist/components/Text/Text.mjs +10 -15
  163. package/dist/components/Text/Text.mjs.map +1 -1
  164. package/dist/components/index.cjs +4 -2
  165. package/dist/components/index.cjs.map +1 -1
  166. package/dist/components/index.d.cts +2 -0
  167. package/dist/components/index.d.cts.map +1 -1
  168. package/dist/components/index.d.mts +2 -0
  169. package/dist/components/index.d.mts.map +1 -1
  170. package/dist/components/index.mjs +1 -0
  171. package/dist/components/index.mjs.map +1 -1
  172. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +17 -9
  173. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
  174. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts +1 -1
  175. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts.map +1 -1
  176. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts +1 -1
  177. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts.map +1 -1
  178. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +17 -6
  179. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs.map +1 -1
  180. package/dist/components/temp-components/Spinner/Spinner.cjs +2 -2
  181. package/dist/components/temp-components/Spinner/Spinner.cjs.map +1 -1
  182. package/dist/components/temp-components/Spinner/Spinner.d.cts.map +1 -1
  183. package/dist/components/temp-components/Spinner/Spinner.d.mts.map +1 -1
  184. package/dist/components/temp-components/Spinner/Spinner.mjs +2 -2
  185. package/dist/components/temp-components/Spinner/Spinner.mjs.map +1 -1
  186. package/dist/types/index.cjs +337 -265
  187. package/dist/types/index.cjs.map +1 -1
  188. package/dist/types/index.d.cts +235 -285
  189. package/dist/types/index.d.cts.map +1 -1
  190. package/dist/types/index.d.mts +235 -285
  191. package/dist/types/index.d.mts.map +1 -1
  192. package/dist/types/index.mjs +336 -252
  193. package/dist/types/index.mjs.map +1 -1
  194. package/package.json +13 -9
  195. package/dist/components/Icon/Icon.utilities.cjs +0 -31
  196. package/dist/components/Icon/Icon.utilities.cjs.map +0 -1
  197. package/dist/components/Icon/Icon.utilities.d.cts +0 -22
  198. package/dist/components/Icon/Icon.utilities.d.cts.map +0 -1
  199. package/dist/components/Icon/Icon.utilities.d.mts +0 -22
  200. package/dist/components/Icon/Icon.utilities.d.mts.map +0 -1
  201. package/dist/components/Icon/Icon.utilities.mjs +0 -27
  202. package/dist/components/Icon/Icon.utilities.mjs.map +0 -1
  203. package/dist/components/Text/Text.utilities.cjs +0 -46
  204. package/dist/components/Text/Text.utilities.cjs.map +0 -1
  205. package/dist/components/Text/Text.utilities.d.cts +0 -32
  206. package/dist/components/Text/Text.utilities.d.cts.map +0 -1
  207. package/dist/components/Text/Text.utilities.d.mts +0 -32
  208. package/dist/components/Text/Text.utilities.d.mts.map +0 -1
  209. package/dist/components/Text/Text.utilities.mjs +0 -42
  210. package/dist/components/Text/Text.utilities.mjs.map +0 -1
@@ -1,37 +1,13 @@
1
+ import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ViewProps } from "react-native/index.js";
2
- import type { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.cjs";
3
3
  /**
4
- * BadgeStatus component props.
4
+ * BadgeStatus component props (React Native platform-specific)
5
+ * Extends shared props with React Native-specific platform concerns
5
6
  */
6
- export type BadgeStatusProps = {
7
- /**
8
- * Optional prop to control the status of the badge
9
- * Possible values:
10
- * - BadgeStatusStatus.Active. (Connected)
11
- * - BadgeStatusStatus.Inactive. (Connected)
12
- * - BadgeStatusStatus.Disconnected.
13
- * - BadgeStatusStatus.New.
14
- * - BadgeStatusStatus.Attention.
15
- */
16
- status: BadgeStatusStatus;
17
- /**
18
- * Optional prop to determine whether the badge should display a border
19
- *
20
- * @default true
21
- */
22
- hasBorder?: boolean;
23
- /**
24
- * Optional prop to control the size of the BadgeStatus
25
- * Possible values:
26
- * - BadgeStatusSize.Md (8px),
27
- * - BadgeStatusSize.Lg (10px),
28
- *
29
- * @default AvatarBaseSize.Md
30
- */
31
- size?: BadgeStatusSize;
7
+ export type BadgeStatusProps = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
32
8
  /**
33
9
  * Optional prop to add twrnc overriding classNames.
34
10
  */
35
11
  twClassName?: string;
36
- } & Omit<ViewProps, 'children'>;
12
+ };
37
13
  //# sourceMappingURL=BadgeStatus.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,8BAAoB;AAEtE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;;;OAQG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1,37 +1,13 @@
1
+ import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ViewProps } from "react-native/index.js";
2
- import type { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.mjs";
3
3
  /**
4
- * BadgeStatus component props.
4
+ * BadgeStatus component props (React Native platform-specific)
5
+ * Extends shared props with React Native-specific platform concerns
5
6
  */
6
- export type BadgeStatusProps = {
7
- /**
8
- * Optional prop to control the status of the badge
9
- * Possible values:
10
- * - BadgeStatusStatus.Active. (Connected)
11
- * - BadgeStatusStatus.Inactive. (Connected)
12
- * - BadgeStatusStatus.Disconnected.
13
- * - BadgeStatusStatus.New.
14
- * - BadgeStatusStatus.Attention.
15
- */
16
- status: BadgeStatusStatus;
17
- /**
18
- * Optional prop to determine whether the badge should display a border
19
- *
20
- * @default true
21
- */
22
- hasBorder?: boolean;
23
- /**
24
- * Optional prop to control the size of the BadgeStatus
25
- * Possible values:
26
- * - BadgeStatusSize.Md (8px),
27
- * - BadgeStatusSize.Lg (10px),
28
- *
29
- * @default AvatarBaseSize.Md
30
- */
31
- size?: BadgeStatusSize;
7
+ export type BadgeStatusProps = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
32
8
  /**
33
9
  * Optional prop to add twrnc overriding classNames.
34
10
  */
35
11
  twClassName?: string;
36
- } & Omit<ViewProps, 'children'>;
12
+ };
37
13
  //# sourceMappingURL=BadgeStatus.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,8BAAoB;AAEtE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;;;OAQG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type { BadgeStatusStatus, BadgeStatusSize } from '../../types';\n\n/**\n * BadgeStatus component props.\n */\nexport type BadgeStatusProps = {\n /**\n * Optional prop to control the status of the badge\n * Possible values:\n * - BadgeStatusStatus.Active. (Connected)\n * - BadgeStatusStatus.Inactive. (Connected)\n * - BadgeStatusStatus.Disconnected.\n * - BadgeStatusStatus.New.\n * - BadgeStatusStatus.Attention.\n */\n status: BadgeStatusStatus;\n /**\n * Optional prop to determine whether the badge should display a border\n *\n * @default true\n */\n hasBorder?: boolean;\n /**\n * Optional prop to control the size of the BadgeStatus\n * Possible values:\n * - BadgeStatusSize.Md (8px),\n * - BadgeStatusSize.Lg (10px),\n *\n * @default AvatarBaseSize.Md\n */\n size?: BadgeStatusSize;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
1
+ {"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["// Import shared type for extension\nimport type { BadgeStatusPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n/**\n * BadgeStatus component props (React Native platform-specific)\n * Extends shared props with React Native-specific platform concerns\n */\nexport type BadgeStatusProps = BadgeStatusPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BadgeStatus = exports.BadgeStatusSize = exports.BadgeStatusStatus = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "BadgeStatusStatus", { enumerable: true, get: function () { return types_1.BadgeStatusStatus; } });
6
- Object.defineProperty(exports, "BadgeStatusSize", { enumerable: true, get: function () { return types_1.BadgeStatusSize; } });
3
+ exports.BadgeStatus = exports.BadgeStatusStatus = exports.BadgeStatusSize = void 0;
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "BadgeStatusSize", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusSize; } });
6
+ Object.defineProperty(exports, "BadgeStatusStatus", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusStatus; } });
7
7
  var BadgeStatus_1 = require("./BadgeStatus.cjs");
8
8
  Object.defineProperty(exports, "BadgeStatus", { enumerable: true, get: function () { return BadgeStatus_1.BadgeStatus; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAAxD,0GAAA,iBAAiB,OAAA;AAAE,wGAAA,eAAe,OAAA;AAC3C,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export { BadgeStatusStatus, BadgeStatusSize } from '../../types';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA,gFAGiD;AAF/C,uHAAA,eAAe,OAAA;AACf,yHAAA,iBAAiB,OAAA;AAEnB,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.cjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.cjs";
3
3
  export type { BadgeStatusProps } from "./BadgeStatus.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -1,4 +1,4 @@
1
- export { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.mjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.mjs";
3
3
  export type { BadgeStatusProps } from "./BadgeStatus.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -1,3 +1,3 @@
1
- export { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.mjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export { BadgeStatusStatus, BadgeStatusSize } from '../../types';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
@@ -28,7 +28,7 @@ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-t
28
28
  const react_1 = __importStar(require("react"));
29
29
  const react_native_1 = require("react-native/index.js");
30
30
  const types_1 = require("../../types/index.cjs");
31
- const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = types_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = types_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName = '', style, ...props }) => {
31
+ const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = types_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = types_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
32
32
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
33
33
  const [anchorWidth, setAnchorWidth] = (0, react_1.useState)(0);
34
34
  const [anchorHeight, setAnchorHeight] = (0, react_1.useState)(0);
@@ -97,11 +97,11 @@ const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerP
97
97
  positionYOffset,
98
98
  customPosition,
99
99
  ]);
100
- return (<react_native_1.View style={[tw `relative self-start ${twClassName}`, style]} {...props}>
100
+ return (<react_native_1.View {...props} style={[tw.style('relative self-start', twClassName), style]}>
101
101
  <react_native_1.View onLayout={getAnchorSize} {...childrenContainerProps}>
102
102
  {children}
103
103
  </react_native_1.View>
104
- <react_native_1.View onLayout={getBadgeSize} style={[tw `absolute`, { ...finalPositions }]} {...badgeContainerProps}>
104
+ <react_native_1.View onLayout={getBadgeSize} style={[tw.style('absolute'), { ...finalPositions }]} {...badgeContainerProps}>
105
105
  {badge}
106
106
  </react_native_1.View>
107
107
  </react_native_1.View>);
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAA8D;AAE9D,wDAAoC;AAEpC,iDAGqB;AAId,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,4BAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,uCAA+B,CAAC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,CAAC,IAAI,KAAK,CAAC,CACtE;MAAA,CAAC,mBAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA,UAAU,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CAC7C,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAxGW,QAAA,YAAY,gBAwGvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName = '',\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View style={[tw`relative self-start ${twClassName}`, style]} {...props}>\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw`absolute`, { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,eAAe;QACf,eAAe;QACf,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,mBAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA2FnB,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA2FnB,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
@@ -9,7 +9,7 @@ import $React, { useCallback, useState, useMemo } from "react";
9
9
  const React = $importDefault($React);
10
10
  import { View } from "react-native/index.js";
11
11
  import { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "../../types/index.mjs";
12
- export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = BadgeWrapperPosition.BottomRight, positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName = '', style, ...props }) => {
12
+ export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = BadgeWrapperPosition.BottomRight, positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
13
13
  const tw = useTailwind();
14
14
  const [anchorWidth, setAnchorWidth] = useState(0);
15
15
  const [anchorHeight, setAnchorHeight] = useState(0);
@@ -78,11 +78,11 @@ export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeCon
78
78
  positionYOffset,
79
79
  customPosition,
80
80
  ]);
81
- return (<View style={[tw `relative self-start ${twClassName}`, style]} {...props}>
81
+ return (<View {...props} style={[tw.style('relative self-start', twClassName), style]}>
82
82
  <View onLayout={getAnchorSize} {...childrenContainerProps}>
83
83
  {children}
84
84
  </View>
85
- <View onLayout={getBadgeSize} style={[tw `absolute`, { ...finalPositions }]} {...badgeContainerProps}>
85
+ <View onLayout={getBadgeSize} style={[tw.style('absolute'), { ...finalPositions }]} {...badgeContainerProps}>
86
86
  {badge}
87
87
  </View>
88
88
  </View>);
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,8BAAoB;AAIrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAm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E,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACtE;MAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA,UAAU,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CAC7C,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName = '',\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View style={[tw`relative self-start ${twClassName}`, style]} {...props}>\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw`absolute`, { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDA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iBACpB,CAAC;SACL;IACH,CAAC,EAAE;QACD,QAAQ;QACR,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,eAAe;QACf,eAAe;QACf,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BottomSheetOverlay = void 0;
27
+ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
28
+ const react_1 = __importStar(require("react"));
29
+ const react_native_1 = require("react-native/index.js");
30
+ const BottomSheetOverlay_constants_1 = require("./BottomSheetOverlay.constants.cjs");
31
+ const BottomSheetOverlay = ({ style, twClassName, onPress, touchableOpacityProps, ...props }) => {
32
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
33
+ const opacityVal = (0, react_native_1.useAnimatedValue)(0);
34
+ (0, react_1.useEffect)(() => {
35
+ react_native_1.Animated.timing(opacityVal, {
36
+ toValue: 1,
37
+ duration: BottomSheetOverlay_constants_1.DEFAULT_OVERLAY_ANIMATION_DURATION,
38
+ easing: react_native_1.Easing.linear,
39
+ useNativeDriver: true,
40
+ }).start();
41
+ }, [opacityVal]);
42
+ return (<react_native_1.Animated.View style={[
43
+ tw.style('absolute inset-0 bg-overlay-default', twClassName),
44
+ style,
45
+ { opacity: opacityVal },
46
+ ]} {...props}>
47
+ {onPress && (<react_native_1.TouchableOpacity onPress={onPress} {...touchableOpacityProps} style={tw.style('flex-1')}/>)}
48
+ </react_native_1.Animated.View>);
49
+ };
50
+ exports.BottomSheetOverlay = BottomSheetOverlay;
51
+ //# sourceMappingURL=BottomSheetOverlay.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAyC;AACzC,wDAKsB;AAEtB,qFAAoF;AAG7E,MAAM,kBAAkB,GAAsC,CAAC,EACpE,KAAK,EACL,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,+BAAgB,EAAC,CAAC,CAAC,CAAC;IAEvC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,uBAAQ,CAAC,MAAM,CAAC,UAAU,EAAE;YAC1B,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,iEAAkC;YAC5C,MAAM,EAAE,qBAAM,CAAC,MAAM;YACrB,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC,KAAK,EAAE,CAAC;IACb,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,CAAC,uBAAQ,CAAC,IAAI,CACZ,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CAAC,qCAAqC,EAAE,WAAW,CAAC;YAC5D,KAAK;YACL,EAAE,OAAO,EAAE,UAAU,EAAE;SACxB,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,OAAO,IAAI,CACV,CAAC,+BAAgB,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,qBAAqB,CAAC,CAC1B,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAC1B,CACH,CACH;IAAA,EAAE,uBAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,kBAAkB,sBAqC7B","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useEffect } from 'react';\nimport {\n Animated,\n Easing,\n TouchableOpacity,\n useAnimatedValue,\n} from 'react-native';\n\nimport { DEFAULT_OVERLAY_ANIMATION_DURATION } from './BottomSheetOverlay.constants';\nimport { BottomSheetOverlayProps } from './BottomSheetOverlay.types';\n\nexport const BottomSheetOverlay: React.FC<BottomSheetOverlayProps> = ({\n style,\n twClassName,\n onPress,\n touchableOpacityProps,\n ...props\n}) => {\n const tw = useTailwind();\n const opacityVal = useAnimatedValue(0);\n\n useEffect(() => {\n Animated.timing(opacityVal, {\n toValue: 1,\n duration: DEFAULT_OVERLAY_ANIMATION_DURATION,\n easing: Easing.linear,\n useNativeDriver: true,\n }).start();\n }, [opacityVal]);\n\n return (\n <Animated.View\n style={[\n tw.style('absolute inset-0 bg-overlay-default', twClassName),\n style,\n { opacity: opacityVal },\n ]}\n {...props}\n >\n {onPress && (\n <TouchableOpacity\n onPress={onPress}\n {...touchableOpacityProps}\n style={tw.style('flex-1')}\n />\n )}\n </Animated.View>\n );\n};\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_OVERLAY_ANIMATION_DURATION = void 0;
4
+ const design_tokens_1 = require("@metamask-previews/design-tokens");
5
+ // Defaults
6
+ exports.DEFAULT_OVERLAY_ANIMATION_DURATION = design_tokens_1.AnimationDuration.Fast;
7
+ //# sourceMappingURL=BottomSheetOverlay.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.constants.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.constants.ts"],"names":[],"mappings":";;;AAAA,oEAAqE;AAErE,WAAW;AACE,QAAA,kCAAkC,GAAG,iCAAiB,CAAC,IAAI,CAAC","sourcesContent":["import { AnimationDuration } from '@metamask-previews/design-tokens';\n\n// Defaults\nexport const DEFAULT_OVERLAY_ANIMATION_DURATION = AnimationDuration.Fast;\n"]}
@@ -0,0 +1,3 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ export declare const DEFAULT_OVERLAY_ANIMATION_DURATION = AnimationDuration.Fast;
3
+ //# sourceMappingURL=BottomSheetOverlay.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAGrE,eAAO,MAAM,kCAAkC,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ export declare const DEFAULT_OVERLAY_ANIMATION_DURATION = AnimationDuration.Fast;
3
+ //# sourceMappingURL=BottomSheetOverlay.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAGrE,eAAO,MAAM,kCAAkC,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ // Defaults
3
+ export const DEFAULT_OVERLAY_ANIMATION_DURATION = AnimationDuration.Fast;
4
+ //# sourceMappingURL=BottomSheetOverlay.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.constants.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE,WAAW;AACX,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC,IAAI,CAAC","sourcesContent":["import { AnimationDuration } from '@metamask-previews/design-tokens';\n\n// Defaults\nexport const DEFAULT_OVERLAY_ANIMATION_DURATION = AnimationDuration.Fast;\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { BottomSheetOverlayProps } from "./BottomSheetOverlay.types.cjs";
3
+ export declare const BottomSheetOverlay: React.FC<BottomSheetOverlayProps>;
4
+ //# sourceMappingURL=BottomSheetOverlay.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,cAAc;AASzC,OAAO,EAAE,uBAAuB,EAAE,uCAAmC;AAErE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqChE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { BottomSheetOverlayProps } from "./BottomSheetOverlay.types.mjs";
3
+ export declare const BottomSheetOverlay: React.FC<BottomSheetOverlayProps>;
4
+ //# sourceMappingURL=BottomSheetOverlay.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,cAAc;AASzC,OAAO,EAAE,uBAAuB,EAAE,uCAAmC;AAErE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqChE,CAAC"}
@@ -0,0 +1,31 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
+ import $React, { useEffect } from "react";
9
+ const React = $importDefault($React);
10
+ import { Animated, Easing, TouchableOpacity, useAnimatedValue } from "react-native/index.js";
11
+ import { DEFAULT_OVERLAY_ANIMATION_DURATION } from "./BottomSheetOverlay.constants.mjs";
12
+ export const BottomSheetOverlay = ({ style, twClassName, onPress, touchableOpacityProps, ...props }) => {
13
+ const tw = useTailwind();
14
+ const opacityVal = useAnimatedValue(0);
15
+ useEffect(() => {
16
+ Animated.timing(opacityVal, {
17
+ toValue: 1,
18
+ duration: DEFAULT_OVERLAY_ANIMATION_DURATION,
19
+ easing: Easing.linear,
20
+ useNativeDriver: true,
21
+ }).start();
22
+ }, [opacityVal]);
23
+ return (<Animated.View style={[
24
+ tw.style('absolute inset-0 bg-overlay-default', twClassName),
25
+ style,
26
+ { opacity: opacityVal },
27
+ ]} {...props}>
28
+ {onPress && (<TouchableOpacity onPress={onPress} {...touchableOpacityProps} style={tw.style('flex-1')}/>)}
29
+ </Animated.View>);
30
+ };
31
+ //# sourceMappingURL=BottomSheetOverlay.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,SAAS,EAAE,cAAc;;AACzC,OAAO,EACL,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EACjB,8BAAqB;AAEtB,OAAO,EAAE,kCAAkC,EAAE,2CAAuC;AAGpF,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,KAAK,EACL,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAEvC,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE;YAC1B,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,kCAAkC;YAC5C,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC,KAAK,EAAE,CAAC;IACb,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CACZ,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CAAC,qCAAqC,EAAE,WAAW,CAAC;YAC5D,KAAK;YACL,EAAE,OAAO,EAAE,UAAU,EAAE;SACxB,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,OAAO,IAAI,CACV,CAAC,gBAAgB,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,qBAAqB,CAAC,CAC1B,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAC1B,CACH,CACH;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useEffect } from 'react';\nimport {\n Animated,\n Easing,\n TouchableOpacity,\n useAnimatedValue,\n} from 'react-native';\n\nimport { DEFAULT_OVERLAY_ANIMATION_DURATION } from './BottomSheetOverlay.constants';\nimport { BottomSheetOverlayProps } from './BottomSheetOverlay.types';\n\nexport const BottomSheetOverlay: React.FC<BottomSheetOverlayProps> = ({\n style,\n twClassName,\n onPress,\n touchableOpacityProps,\n ...props\n}) => {\n const tw = useTailwind();\n const opacityVal = useAnimatedValue(0);\n\n useEffect(() => {\n Animated.timing(opacityVal, {\n toValue: 1,\n duration: DEFAULT_OVERLAY_ANIMATION_DURATION,\n easing: Easing.linear,\n useNativeDriver: true,\n }).start();\n }, [opacityVal]);\n\n return (\n <Animated.View\n style={[\n tw.style('absolute inset-0 bg-overlay-default', twClassName),\n style,\n { opacity: opacityVal },\n ]}\n {...props}\n >\n {onPress && (\n <TouchableOpacity\n onPress={onPress}\n {...touchableOpacityProps}\n style={tw.style('flex-1')}\n />\n )}\n </Animated.View>\n );\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BottomSheetOverlay.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TouchableOpacityProps, ViewProps } from 'react-native';\n\n/**\n * Overlay component props.\n */\nexport type BottomSheetOverlayProps = {\n /**\n * Tailwind CSS classes for the overlay container.\n */\n twClassName?: string;\n /**\n * Callback function triggered when the overlay is pressed.\n */\n onPress?: () => void;\n /**\n * Props spread to the TouchableOpacity component (e.g., testID for the button).\n * Note: onPress should be passed as a top-level prop, not through this object.\n */\n touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style'>;\n} & ViewProps;\n"]}
@@ -0,0 +1,20 @@
1
+ import type { TouchableOpacityProps, ViewProps } from "react-native/index.js";
2
+ /**
3
+ * Overlay component props.
4
+ */
5
+ export type BottomSheetOverlayProps = {
6
+ /**
7
+ * Tailwind CSS classes for the overlay container.
8
+ */
9
+ twClassName?: string;
10
+ /**
11
+ * Callback function triggered when the overlay is pressed.
12
+ */
13
+ onPress?: () => void;
14
+ /**
15
+ * Props spread to the TouchableOpacity component (e.g., testID for the button).
16
+ * Note: onPress should be passed as a top-level prop, not through this object.
17
+ */
18
+ touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style'>;
19
+ } & ViewProps;
20
+ //# sourceMappingURL=BottomSheetOverlay.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,8BAAqB;AAErE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;CAC1E,GAAG,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { TouchableOpacityProps, ViewProps } from "react-native/index.js";
2
+ /**
3
+ * Overlay component props.
4
+ */
5
+ export type BottomSheetOverlayProps = {
6
+ /**
7
+ * Tailwind CSS classes for the overlay container.
8
+ */
9
+ twClassName?: string;
10
+ /**
11
+ * Callback function triggered when the overlay is pressed.
12
+ */
13
+ onPress?: () => void;
14
+ /**
15
+ * Props spread to the TouchableOpacity component (e.g., testID for the button).
16
+ * Note: onPress should be passed as a top-level prop, not through this object.
17
+ */
18
+ touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style'>;
19
+ } & ViewProps;
20
+ //# sourceMappingURL=BottomSheetOverlay.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,8BAAqB;AAErE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;CAC1E,GAAG,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BottomSheetOverlay.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetOverlay.types.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/BottomSheetOverlay.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TouchableOpacityProps, ViewProps } from 'react-native';\n\n/**\n * Overlay component props.\n */\nexport type BottomSheetOverlayProps = {\n /**\n * Tailwind CSS classes for the overlay container.\n */\n twClassName?: string;\n /**\n * Callback function triggered when the overlay is pressed.\n */\n onPress?: () => void;\n /**\n * Props spread to the TouchableOpacity component (e.g., testID for the button).\n * Note: onPress should be passed as a top-level prop, not through this object.\n */\n touchableOpacityProps?: Omit<TouchableOpacityProps, 'onPress' | 'style'>;\n} & ViewProps;\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BottomSheetOverlay = void 0;
4
+ var BottomSheetOverlay_1 = require("./BottomSheetOverlay.cjs");
5
+ Object.defineProperty(exports, "BottomSheetOverlay", { enumerable: true, get: function () { return BottomSheetOverlay_1.BottomSheetOverlay; } });
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["export { BottomSheetOverlay } from './BottomSheetOverlay';\nexport type { BottomSheetOverlayProps } from './BottomSheetOverlay.types';\n"]}
@@ -0,0 +1,3 @@
1
+ export { BottomSheetOverlay } from "./BottomSheetOverlay.cjs";
2
+ export type { BottomSheetOverlayProps } from "./BottomSheetOverlay.types.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iCAA6B;AAC1D,YAAY,EAAE,uBAAuB,EAAE,uCAAmC"}
@@ -0,0 +1,3 @@
1
+ export { BottomSheetOverlay } from "./BottomSheetOverlay.mjs";
2
+ export type { BottomSheetOverlayProps } from "./BottomSheetOverlay.types.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iCAA6B;AAC1D,YAAY,EAAE,uBAAuB,EAAE,uCAAmC"}
@@ -0,0 +1,2 @@
1
+ export { BottomSheetOverlay } from "./BottomSheetOverlay.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetOverlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iCAA6B","sourcesContent":["export { BottomSheetOverlay } from './BottomSheetOverlay';\nexport type { BottomSheetOverlayProps } from './BottomSheetOverlay.types';\n"]}