@metamask-previews/design-system-react-native 0.5.1-preview.89a2095 → 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 (204) 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/AvatarIcon/AvatarIcon.cjs +5 -6
  23. package/dist/components/AvatarIcon/AvatarIcon.cjs.map +1 -1
  24. package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
  25. package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
  26. package/dist/components/AvatarIcon/AvatarIcon.mjs +5 -6
  27. package/dist/components/AvatarIcon/AvatarIcon.mjs.map +1 -1
  28. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +2 -2
  29. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  30. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts +1 -1
  31. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
  32. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts +1 -1
  33. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
  34. package/dist/components/AvatarNetwork/AvatarNetwork.mjs +2 -2
  35. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  36. package/dist/components/AvatarToken/AvatarToken.cjs +2 -2
  37. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  38. package/dist/components/AvatarToken/AvatarToken.d.cts +1 -1
  39. package/dist/components/AvatarToken/AvatarToken.d.cts.map +1 -1
  40. package/dist/components/AvatarToken/AvatarToken.d.mts +1 -1
  41. package/dist/components/AvatarToken/AvatarToken.d.mts.map +1 -1
  42. package/dist/components/AvatarToken/AvatarToken.mjs +2 -2
  43. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  44. package/dist/components/BadgeCount/BadgeCount.cjs +5 -10
  45. package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
  46. package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
  47. package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
  48. package/dist/components/BadgeCount/BadgeCount.mjs +5 -10
  49. package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
  50. package/dist/components/BadgeIcon/BadgeIcon.cjs +5 -10
  51. package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
  52. package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
  53. package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
  54. package/dist/components/BadgeIcon/BadgeIcon.mjs +5 -10
  55. package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
  56. package/dist/components/BadgeStatus/BadgeStatus.cjs +6 -6
  57. package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
  58. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +8 -8
  59. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
  60. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts +1 -1
  61. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts.map +1 -1
  62. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts +1 -1
  63. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts.map +1 -1
  64. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
  65. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
  66. package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
  67. package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
  68. package/dist/components/BadgeStatus/BadgeStatus.mjs +6 -6
  69. package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
  70. package/dist/components/BadgeStatus/BadgeStatus.types.cjs.map +1 -1
  71. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +5 -29
  72. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
  73. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +5 -29
  74. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
  75. package/dist/components/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
  76. package/dist/components/BadgeStatus/index.cjs +4 -4
  77. package/dist/components/BadgeStatus/index.cjs.map +1 -1
  78. package/dist/components/BadgeStatus/index.d.cts +1 -1
  79. package/dist/components/BadgeStatus/index.d.cts.map +1 -1
  80. package/dist/components/BadgeStatus/index.d.mts +1 -1
  81. package/dist/components/BadgeStatus/index.d.mts.map +1 -1
  82. package/dist/components/BadgeStatus/index.mjs +1 -1
  83. package/dist/components/BadgeStatus/index.mjs.map +1 -1
  84. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +3 -3
  85. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  86. package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
  87. package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
  88. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +3 -3
  89. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  90. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +51 -0
  91. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -0
  92. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.cjs +7 -0
  93. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.cjs.map +1 -0
  94. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.cts +3 -0
  95. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.cts.map +1 -0
  96. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.mts +3 -0
  97. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.d.mts.map +1 -0
  98. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.mjs +4 -0
  99. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.constants.mjs.map +1 -0
  100. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.cts +4 -0
  101. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.cts.map +1 -0
  102. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.mts +4 -0
  103. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.mts.map +1 -0
  104. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs +31 -0
  105. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs.map +1 -0
  106. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.cjs +3 -0
  107. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.cjs.map +1 -0
  108. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts +20 -0
  109. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts.map +1 -0
  110. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts +20 -0
  111. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts.map +1 -0
  112. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.mjs +2 -0
  113. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.mjs.map +1 -0
  114. package/dist/components/BottomSheetOverlay/index.cjs +6 -0
  115. package/dist/components/BottomSheetOverlay/index.cjs.map +1 -0
  116. package/dist/components/BottomSheetOverlay/index.d.cts +3 -0
  117. package/dist/components/BottomSheetOverlay/index.d.cts.map +1 -0
  118. package/dist/components/BottomSheetOverlay/index.d.mts +3 -0
  119. package/dist/components/BottomSheetOverlay/index.d.mts.map +1 -0
  120. package/dist/components/BottomSheetOverlay/index.mjs +2 -0
  121. package/dist/components/BottomSheetOverlay/index.mjs.map +1 -0
  122. package/dist/components/Box/Box.cjs +12 -27
  123. package/dist/components/Box/Box.cjs.map +1 -1
  124. package/dist/components/Box/Box.d.cts.map +1 -1
  125. package/dist/components/Box/Box.d.mts.map +1 -1
  126. package/dist/components/Box/Box.mjs +12 -27
  127. package/dist/components/Box/Box.mjs.map +1 -1
  128. package/dist/components/ButtonBase/ButtonBase.cjs +50 -41
  129. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  130. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  131. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  132. package/dist/components/ButtonBase/ButtonBase.mjs +50 -41
  133. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  134. package/dist/components/ButtonIcon/ButtonIcon.cjs +5 -10
  135. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  136. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  137. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  138. package/dist/components/ButtonIcon/ButtonIcon.mjs +5 -10
  139. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  140. package/dist/components/Checkbox/Checkbox.cjs +4 -4
  141. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  142. package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
  143. package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
  144. package/dist/components/Checkbox/Checkbox.mjs +4 -4
  145. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  146. package/dist/components/Icon/Icon.cjs +4 -32
  147. package/dist/components/Icon/Icon.cjs.map +1 -1
  148. package/dist/components/Icon/Icon.d.cts.map +1 -1
  149. package/dist/components/Icon/Icon.d.mts.map +1 -1
  150. package/dist/components/Icon/Icon.mjs +2 -10
  151. package/dist/components/Icon/Icon.mjs.map +1 -1
  152. package/dist/components/Text/Text.cjs +9 -14
  153. package/dist/components/Text/Text.cjs.map +1 -1
  154. package/dist/components/Text/Text.d.cts.map +1 -1
  155. package/dist/components/Text/Text.d.mts.map +1 -1
  156. package/dist/components/Text/Text.mjs +10 -15
  157. package/dist/components/Text/Text.mjs.map +1 -1
  158. package/dist/components/index.cjs +4 -2
  159. package/dist/components/index.cjs.map +1 -1
  160. package/dist/components/index.d.cts +2 -0
  161. package/dist/components/index.d.cts.map +1 -1
  162. package/dist/components/index.d.mts +2 -0
  163. package/dist/components/index.d.mts.map +1 -1
  164. package/dist/components/index.mjs +1 -0
  165. package/dist/components/index.mjs.map +1 -1
  166. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +17 -9
  167. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
  168. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts +1 -1
  169. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts.map +1 -1
  170. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts +1 -1
  171. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts.map +1 -1
  172. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +17 -6
  173. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs.map +1 -1
  174. package/dist/components/temp-components/Spinner/Spinner.cjs +2 -2
  175. package/dist/components/temp-components/Spinner/Spinner.cjs.map +1 -1
  176. package/dist/components/temp-components/Spinner/Spinner.d.cts.map +1 -1
  177. package/dist/components/temp-components/Spinner/Spinner.d.mts.map +1 -1
  178. package/dist/components/temp-components/Spinner/Spinner.mjs +2 -2
  179. package/dist/components/temp-components/Spinner/Spinner.mjs.map +1 -1
  180. package/dist/types/index.cjs +16 -41
  181. package/dist/types/index.cjs.map +1 -1
  182. package/dist/types/index.d.cts +15 -38
  183. package/dist/types/index.d.cts.map +1 -1
  184. package/dist/types/index.d.mts +15 -38
  185. package/dist/types/index.d.mts.map +1 -1
  186. package/dist/types/index.mjs +15 -40
  187. package/dist/types/index.mjs.map +1 -1
  188. package/package.json +13 -9
  189. package/dist/components/Icon/Icon.utilities.cjs +0 -31
  190. package/dist/components/Icon/Icon.utilities.cjs.map +0 -1
  191. package/dist/components/Icon/Icon.utilities.d.cts +0 -22
  192. package/dist/components/Icon/Icon.utilities.d.cts.map +0 -1
  193. package/dist/components/Icon/Icon.utilities.d.mts +0 -22
  194. package/dist/components/Icon/Icon.utilities.d.mts.map +0 -1
  195. package/dist/components/Icon/Icon.utilities.mjs +0 -27
  196. package/dist/components/Icon/Icon.utilities.mjs.map +0 -1
  197. package/dist/components/Text/Text.utilities.cjs +0 -46
  198. package/dist/components/Text/Text.utilities.cjs.map +0 -1
  199. package/dist/components/Text/Text.utilities.d.cts +0 -32
  200. package/dist/components/Text/Text.utilities.d.cts.map +0 -1
  201. package/dist/components/Text/Text.utilities.d.mts +0 -32
  202. package/dist/components/Text/Text.utilities.d.mts.map +0 -1
  203. package/dist/components/Text/Text.utilities.mjs +0 -42
  204. package/dist/components/Text/Text.utilities.mjs.map +0 -1
@@ -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,QAAQ,EAC9D,eAAe,GAAG,C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E;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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+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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,mBAAmB,EACnB,QAAQ,GAAG,oBAAoB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AI,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,sDAAsD;AAC5E,OAAO,QAAO,EAAE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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"]}
@@ -8,34 +8,19 @@ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-t
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const react_native_1 = require("react-native/index.js");
10
10
  const Box_constants_1 = require("./Box.constants.cjs");
11
- const Box = ({ flexDirection, flexWrap, gap, alignItems, justifyContent, margin, marginTop, marginRight, marginBottom, marginLeft, marginHorizontal, marginVertical, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingHorizontal, paddingVertical, borderWidth, borderColor, backgroundColor, twClassName = '', style, children, ...props }) => {
11
+ const Box = ({ flexDirection, flexWrap, gap, alignItems, justifyContent, margin, marginTop, marginRight, marginBottom, marginLeft, marginHorizontal, marginVertical, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingHorizontal, paddingVertical, borderWidth, borderColor, backgroundColor, twClassName, style, children, ...props }) => {
12
12
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
13
- const twContainerClassNames = tw `
14
- flex
15
- ${flexDirection ?? ''}
16
- ${flexWrap ?? ''}
17
- ${gap !== undefined ? Box_constants_1.TWCLASSMAP_BOX_GAP[gap] : ''}
18
- ${alignItems ?? ''}
19
- ${justifyContent ?? ''}
20
- ${margin !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN[margin] : ''}
21
- ${marginTop !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_TOP[marginTop] : ''}
22
- ${marginRight !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight] : ''}
23
- ${marginBottom !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom] : ''}
24
- ${marginLeft !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft] : ''}
25
- ${marginHorizontal !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal] : ''}
26
- ${marginVertical !== undefined ? Box_constants_1.TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical] : ''}
27
- ${padding !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING[padding] : ''}
28
- ${paddingTop !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_TOP[paddingTop] : ''}
29
- ${paddingRight !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight] : ''}
30
- ${paddingBottom !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom] : ''}
31
- ${paddingLeft !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft] : ''}
32
- ${paddingHorizontal !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal] : ''}
33
- ${paddingVertical !== undefined ? Box_constants_1.TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical] : ''}
34
- ${borderWidth !== undefined ? Box_constants_1.TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth] : ''}
35
- ${borderColor ?? ''}
36
- ${backgroundColor ?? ''}
37
- ${twClassName}`;
38
- return (<react_native_1.View style={[twContainerClassNames, style]} {...props}>
13
+ return (<react_native_1.View {...props} style={[
14
+ tw.style('flex', flexDirection, flexWrap, gap !== undefined && Box_constants_1.TWCLASSMAP_BOX_GAP[gap], alignItems, justifyContent, margin !== undefined && Box_constants_1.TWCLASSMAP_BOX_MARGIN[margin], marginTop !== undefined && Box_constants_1.TWCLASSMAP_BOX_MARGIN_TOP[marginTop], marginRight !== undefined && Box_constants_1.TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight], marginBottom !== undefined &&
15
+ Box_constants_1.TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom], marginLeft !== undefined && Box_constants_1.TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft], marginHorizontal !== undefined &&
16
+ Box_constants_1.TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal], marginVertical !== undefined &&
17
+ Box_constants_1.TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical], padding !== undefined && Box_constants_1.TWCLASSMAP_BOX_PADDING[padding], paddingTop !== undefined && Box_constants_1.TWCLASSMAP_BOX_PADDING_TOP[paddingTop], paddingRight !== undefined &&
18
+ Box_constants_1.TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight], paddingBottom !== undefined &&
19
+ Box_constants_1.TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom], paddingLeft !== undefined && Box_constants_1.TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft], paddingHorizontal !== undefined &&
20
+ Box_constants_1.TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal], paddingVertical !== undefined &&
21
+ Box_constants_1.TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical], borderWidth !== undefined && Box_constants_1.TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth], borderColor, backgroundColor, twClassName),
22
+ style,
23
+ ]}>
39
24
  {children}
40
25
  </react_native_1.View>);
41
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Box.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,uDAiByB;AAGlB,MAAM,GAAG,GAAG,CAAC,EAClB,aAAa,EACb,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACC,EAAE,EAAE;IACb,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,qBAAqB,GAAG,EAAE,CAAA;;MAE5B,aAAa,IAAI,EAAE;MACnB,QAAQ,IAAI,EAAE;MACd,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,kCAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;MAChD,UAAU,IAAI,EAAE;MAChB,cAAc,IAAI,EAAE;MACpB,M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AAS,CAAC,CAAC,CAAC,+CAA+B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;MACrF,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,2CAA2B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;MACzE,WAAW,IAAI,EAAE;MACjB,eAAe,IAAI,EAAE;MACrB,WAAW,EAAE,CAAC;IAElB,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACrD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA5DW,QAAA,GAAG,OA4Dd","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BOX_GAP,\n TWCLASSMAP_BOX_MARGIN,\n TWCLASSMAP_BOX_MARGIN_TOP,\n TWCLASSMAP_BOX_MARGIN_RIGHT,\n TWCLASSMAP_BOX_MARGIN_BOTTOM,\n TWCLASSMAP_BOX_MARGIN_LEFT,\n TWCLASSMAP_BOX_MARGIN_HORIZONTAL,\n TWCLASSMAP_BOX_MARGIN_VERTICAL,\n TWCLASSMAP_BOX_PADDING,\n TWCLASSMAP_BOX_PADDING_TOP,\n TWCLASSMAP_BOX_PADDING_RIGHT,\n TWCLASSMAP_BOX_PADDING_BOTTOM,\n TWCLASSMAP_BOX_PADDING_LEFT,\n TWCLASSMAP_BOX_PADDING_HORIZONTAL,\n TWCLASSMAP_BOX_PADDING_VERTICAL,\n TWCLASSMAP_BOX_BORDER_WIDTH,\n} from './Box.constants';\nimport type { BoxProps } from './Box.types';\n\nexport const Box = ({\n flexDirection,\n flexWrap,\n gap,\n alignItems,\n justifyContent,\n margin,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n marginHorizontal,\n marginVertical,\n padding,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n paddingHorizontal,\n paddingVertical,\n borderWidth,\n borderColor,\n backgroundColor,\n twClassName = '',\n style,\n children,\n ...props\n}: BoxProps) => {\n const tw = useTailwind();\n const twContainerClassNames = tw`\n flex\n ${flexDirection ?? ''} \n ${flexWrap ?? ''} \n ${gap !== undefined ? TWCLASSMAP_BOX_GAP[gap] : ''} \n ${alignItems ?? ''} \n ${justifyContent ?? ''}\n ${margin !== undefined ? TWCLASSMAP_BOX_MARGIN[margin] : ''}\n ${marginTop !== undefined ? TWCLASSMAP_BOX_MARGIN_TOP[marginTop] : ''}\n ${marginRight !== undefined ? TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight] : ''}\n ${marginBottom !== undefined ? TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom] : ''}\n ${marginLeft !== undefined ? TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft] : ''}\n ${marginHorizontal !== undefined ? TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal] : ''}\n ${marginVertical !== undefined ? TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical] : ''}\n ${padding !== undefined ? TWCLASSMAP_BOX_PADDING[padding] : ''}\n ${paddingTop !== undefined ? TWCLASSMAP_BOX_PADDING_TOP[paddingTop] : ''}\n ${paddingRight !== undefined ? TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight] : ''}\n ${paddingBottom !== undefined ? TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom] : ''}\n ${paddingLeft !== undefined ? TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft] : ''}\n ${paddingHorizontal !== undefined ? TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal] : ''}\n ${paddingVertical !== undefined ? TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical] : ''}\n ${borderWidth !== undefined ? TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth] : ''}\n ${borderColor ?? ''}\n ${backgroundColor ?? ''}\n ${twClassName}`;\n\n return (\n <View style={[twContainerClassNames, style]} {...props}>\n {children}\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"Box.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,uDAiByB;AAGlB,MAAM,GAAG,GAAG,CAAC,EAClB,aAAa,EACb,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACC,EAAE,EAAE;IACb,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,MAAM,EACN,aAAa,EACb,QAAQ,EACR,GAAG,KAAK,SAAS,IAAI,kCAAkB,CAAC,GAAG,CAAC,EAC5C,UAAU,EACV,cAAc,EACd,MAAM,KAAK,SAAS,IAAI,qCAAqB,CAAC,MAAM,CAAC,EACrD,SAAS,KAAK,SAAS,IAAI,yCAAyB,CAAC,SAAS,CAAC,EAC/D,WAAW,KAAK,SAAS,IAAI,2CAA2B,CAAC,WAAW,CAAC,EACrE,YAAY,KAAK,SAAS;gBACxB,4CAA4B,CAAC,YAAY,CAAC,EAC5C,UAAU,KAAK,SAAS,IAAI,0CAA0B,CAAC,UAAU,CAAC,EAClE,gBAAgB,KAAK,SAAS;gBAC5B,gDAAgC,CAAC,gBAAgB,CAAC,EACpD,cAAc,KAAK,SAAS;gBAC1B,8CAA8B,CAAC,cAAc,CAAC,EAChD,OAAO,KAAK,SAAS,IAAI,sCAAsB,CAAC,OAAO,CAAC,EACxD,UAAU,KAAK,SAAS,IAAI,0CAA0B,CAAC,UAAU,CAAC,EAClE,YAAY,KAAK,SAAS;gBACxB,4CAA4B,CAAC,YAAY,CAAC,EAC5C,aAAa,KAAK,SAAS;gBACzB,6CAA6B,CAAC,aAAa,CAAC,EAC9C,WAAW,KAAK,SAAS,IAAI,2CAA2B,CAAC,WAAW,CAAC,EACrE,iBAAiB,KAAK,SAAS;gBAC7B,iDAAiC,CAAC,iBAAiB,CAAC,EACtD,eAAe,KAAK,SAAS;gBAC3B,+CAA+B,CAAC,eAAe,CAAC,EAClD,WAAW,KAAK,SAAS,IAAI,2CAA2B,CAAC,WAAW,CAAC,EACrE,WAAW,EACX,eAAe,EACf,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAzEW,QAAA,GAAG,OAyEd","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BOX_GAP,\n TWCLASSMAP_BOX_MARGIN,\n TWCLASSMAP_BOX_MARGIN_TOP,\n TWCLASSMAP_BOX_MARGIN_RIGHT,\n TWCLASSMAP_BOX_MARGIN_BOTTOM,\n TWCLASSMAP_BOX_MARGIN_LEFT,\n TWCLASSMAP_BOX_MARGIN_HORIZONTAL,\n TWCLASSMAP_BOX_MARGIN_VERTICAL,\n TWCLASSMAP_BOX_PADDING,\n TWCLASSMAP_BOX_PADDING_TOP,\n TWCLASSMAP_BOX_PADDING_RIGHT,\n TWCLASSMAP_BOX_PADDING_BOTTOM,\n TWCLASSMAP_BOX_PADDING_LEFT,\n TWCLASSMAP_BOX_PADDING_HORIZONTAL,\n TWCLASSMAP_BOX_PADDING_VERTICAL,\n TWCLASSMAP_BOX_BORDER_WIDTH,\n} from './Box.constants';\nimport type { BoxProps } from './Box.types';\n\nexport const Box = ({\n flexDirection,\n flexWrap,\n gap,\n alignItems,\n justifyContent,\n margin,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n marginHorizontal,\n marginVertical,\n padding,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n paddingHorizontal,\n paddingVertical,\n borderWidth,\n borderColor,\n backgroundColor,\n twClassName,\n style,\n children,\n ...props\n}: BoxProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'flex',\n flexDirection,\n flexWrap,\n gap !== undefined && TWCLASSMAP_BOX_GAP[gap],\n alignItems,\n justifyContent,\n margin !== undefined && TWCLASSMAP_BOX_MARGIN[margin],\n marginTop !== undefined && TWCLASSMAP_BOX_MARGIN_TOP[marginTop],\n marginRight !== undefined && TWCLASSMAP_BOX_MARGIN_RIGHT[marginRight],\n marginBottom !== undefined &&\n TWCLASSMAP_BOX_MARGIN_BOTTOM[marginBottom],\n marginLeft !== undefined && TWCLASSMAP_BOX_MARGIN_LEFT[marginLeft],\n marginHorizontal !== undefined &&\n TWCLASSMAP_BOX_MARGIN_HORIZONTAL[marginHorizontal],\n marginVertical !== undefined &&\n TWCLASSMAP_BOX_MARGIN_VERTICAL[marginVertical],\n padding !== undefined && TWCLASSMAP_BOX_PADDING[padding],\n paddingTop !== undefined && TWCLASSMAP_BOX_PADDING_TOP[paddingTop],\n paddingRight !== undefined &&\n TWCLASSMAP_BOX_PADDING_RIGHT[paddingRight],\n paddingBottom !== undefined &&\n TWCLASSMAP_BOX_PADDING_BOTTOM[paddingBottom],\n paddingLeft !== undefined && TWCLASSMAP_BOX_PADDING_LEFT[paddingLeft],\n paddingHorizontal !== undefined &&\n TWCLASSMAP_BOX_PADDING_HORIZONTAL[paddingHorizontal],\n paddingVertical !== undefined &&\n TWCLASSMAP_BOX_PADDING_VERTICAL[paddingVertical],\n borderWidth !== undefined && TWCLASSMAP_BOX_BORDER_WIDTH[borderWidth],\n borderColor,\n backgroundColor,\n twClassName,\n ),\n style,\n ]}\n >\n {children}\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBAiCV,CAAC"}
1
+ {"version":3,"file":"Box.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBA8CV,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBAiCV,CAAC"}
1
+ {"version":3,"file":"Box.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAqB1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,mVA2Bb,QAAQ,sBA8CV,CAAC"}