@metamask-previews/design-system-react-native 0.0.0-preview.ff8ed96 → 0.2.0-preview.a7d80d5

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 (166) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/dist/components/AvatarBase/AvatarBase.types.d.cts +0 -1
  3. package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
  4. package/dist/components/AvatarBase/AvatarBase.types.d.mts +0 -1
  5. package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
  6. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  7. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  8. package/dist/components/AvatarGroup/AvatarGroup.cjs +2 -2
  9. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  10. package/dist/components/AvatarGroup/AvatarGroup.mjs +3 -3
  11. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  12. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  13. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  14. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  15. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  16. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +1 -1
  17. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  18. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
  19. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  20. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +0 -1
  21. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
  22. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +0 -1
  23. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
  24. package/dist/components/Box/Box.cjs +22 -5
  25. package/dist/components/Box/Box.cjs.map +1 -1
  26. package/dist/components/Box/Box.constants.cjs +218 -1
  27. package/dist/components/Box/Box.constants.cjs.map +1 -1
  28. package/dist/components/Box/Box.constants.d.cts +16 -1
  29. package/dist/components/Box/Box.constants.d.cts.map +1 -1
  30. package/dist/components/Box/Box.constants.d.mts +16 -1
  31. package/dist/components/Box/Box.constants.d.mts.map +1 -1
  32. package/dist/components/Box/Box.constants.mjs +217 -0
  33. package/dist/components/Box/Box.constants.mjs.map +1 -1
  34. package/dist/components/Box/Box.d.cts +1 -1
  35. package/dist/components/Box/Box.d.cts.map +1 -1
  36. package/dist/components/Box/Box.d.mts +1 -1
  37. package/dist/components/Box/Box.d.mts.map +1 -1
  38. package/dist/components/Box/Box.mjs +23 -6
  39. package/dist/components/Box/Box.mjs.map +1 -1
  40. package/dist/components/Box/Box.types.cjs.map +1 -1
  41. package/dist/components/Box/Box.types.d.cts +84 -1
  42. package/dist/components/Box/Box.types.d.cts.map +1 -1
  43. package/dist/components/Box/Box.types.d.mts +84 -1
  44. package/dist/components/Box/Box.types.d.mts.map +1 -1
  45. package/dist/components/Box/Box.types.mjs.map +1 -1
  46. package/dist/components/Box/index.cjs.map +1 -1
  47. package/dist/components/Box/index.d.cts +1 -1
  48. package/dist/components/Box/index.d.cts.map +1 -1
  49. package/dist/components/Box/index.d.mts +1 -1
  50. package/dist/components/Box/index.d.mts.map +1 -1
  51. package/dist/components/Box/index.mjs.map +1 -1
  52. package/dist/components/Button/Button.cjs +1 -1
  53. package/dist/components/Button/Button.cjs.map +1 -1
  54. package/dist/components/Button/Button.mjs +1 -1
  55. package/dist/components/Button/Button.mjs.map +1 -1
  56. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +29 -57
  57. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
  58. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts +1 -1
  59. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
  60. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts +1 -1
  61. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
  62. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +30 -58
  63. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
  64. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +46 -53
  65. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
  66. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts +1 -1
  67. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
  68. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts +1 -1
  69. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
  70. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +47 -54
  71. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
  72. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +53 -59
  73. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
  74. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts +1 -1
  75. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
  76. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts +1 -1
  77. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
  78. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +54 -60
  79. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
  80. package/dist/components/ButtonBase/ButtonBase.cjs +110 -28
  81. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  82. package/dist/components/ButtonBase/ButtonBase.constants.cjs +10 -0
  83. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -0
  84. package/dist/components/ButtonBase/ButtonBase.constants.d.cts +3 -0
  85. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -0
  86. package/dist/components/ButtonBase/ButtonBase.constants.d.mts +3 -0
  87. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -0
  88. package/dist/components/ButtonBase/ButtonBase.constants.mjs +7 -0
  89. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -0
  90. package/dist/components/ButtonBase/ButtonBase.d.cts +1 -1
  91. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  92. package/dist/components/ButtonBase/ButtonBase.d.mts +1 -1
  93. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  94. package/dist/components/ButtonBase/ButtonBase.mjs +88 -26
  95. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  96. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  97. package/dist/components/ButtonBase/ButtonBase.types.d.cts +42 -3
  98. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  99. package/dist/components/ButtonBase/ButtonBase.types.d.mts +42 -3
  100. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  101. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  102. package/dist/components/ButtonBase/index.cjs +3 -1
  103. package/dist/components/ButtonBase/index.cjs.map +1 -1
  104. package/dist/components/ButtonBase/index.d.cts +1 -0
  105. package/dist/components/ButtonBase/index.d.cts.map +1 -1
  106. package/dist/components/ButtonBase/index.d.mts +1 -0
  107. package/dist/components/ButtonBase/index.d.mts.map +1 -1
  108. package/dist/components/ButtonBase/index.mjs +1 -0
  109. package/dist/components/ButtonBase/index.mjs.map +1 -1
  110. package/dist/components/ButtonIcon/ButtonIcon.cjs +9 -1
  111. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  112. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  113. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  114. package/dist/components/ButtonIcon/ButtonIcon.mjs +9 -1
  115. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  116. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  117. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  118. package/dist/components/Checkbox/Checkbox.mjs +1 -1
  119. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  120. package/dist/components/Checkbox/Checkbox.types.d.cts +0 -1
  121. package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
  122. package/dist/components/Checkbox/Checkbox.types.d.mts +0 -1
  123. package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
  124. package/dist/components/Icon/Icon.assets.cjs +2 -3
  125. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  126. package/dist/components/Icon/Icon.assets.mjs +2 -3
  127. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  128. package/dist/components/Text/Text.constants.cjs +9 -0
  129. package/dist/components/Text/Text.constants.cjs.map +1 -1
  130. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  131. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  132. package/dist/components/Text/Text.constants.mjs +9 -0
  133. package/dist/components/Text/Text.constants.mjs.map +1 -1
  134. package/dist/components/Text/Text.types.cjs.map +1 -1
  135. package/dist/components/Text/Text.types.d.cts +1 -2
  136. package/dist/components/Text/Text.types.d.cts.map +1 -1
  137. package/dist/components/Text/Text.types.d.mts +1 -2
  138. package/dist/components/Text/Text.types.d.mts.map +1 -1
  139. package/dist/components/Text/Text.types.mjs.map +1 -1
  140. package/dist/components/TextButton/TextButton.cjs +1 -0
  141. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  142. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  143. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  144. package/dist/components/TextButton/TextButton.mjs +1 -0
  145. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  146. package/dist/components/TextButton/TextButton.types.d.cts +0 -1
  147. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  148. package/dist/components/TextButton/TextButton.types.d.mts +0 -1
  149. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  150. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts +0 -1
  151. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts.map +1 -1
  152. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts +0 -1
  153. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts.map +1 -1
  154. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +0 -1
  155. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
  156. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +0 -1
  157. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
  158. package/dist/types/index.cjs +143 -4
  159. package/dist/types/index.cjs.map +1 -1
  160. package/dist/types/index.d.cts +141 -4
  161. package/dist/types/index.d.cts.map +1 -1
  162. package/dist/types/index.d.mts +141 -4
  163. package/dist/types/index.d.mts.map +1 -1
  164. package/dist/types/index.mjs +142 -3
  165. package/dist/types/index.mjs.map +1 -1
  166. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"Box.types.cjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxBorderWidth,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * The margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n margin?: BoxSpacing;\n /**\n * The top margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginTop?: BoxSpacing;\n /**\n * The right margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginRight?: BoxSpacing;\n /**\n * The bottom margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginBottom?: BoxSpacing;\n /**\n * The left margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginLeft?: BoxSpacing;\n /**\n * The horizontal margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginHorizontal?: BoxSpacing;\n /**\n * The vertical margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginVertical?: BoxSpacing;\n /**\n * The padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n padding?: BoxSpacing;\n /**\n * The top padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingTop?: BoxSpacing;\n /**\n * The right padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingRight?: BoxSpacing;\n /**\n * The bottom padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingBottom?: BoxSpacing;\n /**\n * The left padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingLeft?: BoxSpacing;\n /**\n * The horizontal padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingHorizontal?: BoxSpacing;\n /**\n * The vertical padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingVertical?: BoxSpacing;\n /**\n * The border width of the component.\n * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.\n */\n borderWidth?: BoxBorderWidth;\n /**\n * The border color of the component.\n */\n borderColor?: BoxBorderColor;\n /**\n * The background color of the component.\n */\n backgroundColor?: BoxBackgroundColor;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps } from "react-native/index.js";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.cjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.cjs";
3
3
  export type BoxProps = {
4
4
  /**
5
5
  * The flexDirection style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = {
22
22
  * The justifyContent style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 1-12 for margin of 4px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 1-12 for margin of 4px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 1-12 for margin of 4px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 1-12 for margin of 4px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 1-12 for margin of 4px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 1-12 for margin of 4px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 1-12 for margin of 4px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 1-12 for padding of 4px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 1-12 for padding of 4px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 1-12 for padding of 4px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 1-12 for padding of 4px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 1-12 for padding of 4px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 1-12 for padding of 4px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 1-12 for padding of 4px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop to add twrnc overriding classNames.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Box.types.d.cts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps } from "react-native/index.js";
2
- import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxAlignItems, BoxJustifyContent } from "../../types/index.mjs";
2
+ import type { BoxFlexDirection, BoxFlexWrap, BoxSpacing, BoxBorderWidth, BoxAlignItems, BoxJustifyContent, BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
3
3
  export type BoxProps = {
4
4
  /**
5
5
  * The flexDirection style of the component.
@@ -22,6 +22,89 @@ export type BoxProps = {
22
22
  * The justifyContent style of the component.
23
23
  */
24
24
  justifyContent?: BoxJustifyContent;
25
+ /**
26
+ * The margin of the component.
27
+ * Use 1-12 for margin of 4px-48px.
28
+ */
29
+ margin?: BoxSpacing;
30
+ /**
31
+ * The top margin of the component.
32
+ * Use 1-12 for margin of 4px-48px.
33
+ */
34
+ marginTop?: BoxSpacing;
35
+ /**
36
+ * The right margin of the component.
37
+ * Use 1-12 for margin of 4px-48px.
38
+ */
39
+ marginRight?: BoxSpacing;
40
+ /**
41
+ * The bottom margin of the component.
42
+ * Use 1-12 for margin of 4px-48px.
43
+ */
44
+ marginBottom?: BoxSpacing;
45
+ /**
46
+ * The left margin of the component.
47
+ * Use 1-12 for margin of 4px-48px.
48
+ */
49
+ marginLeft?: BoxSpacing;
50
+ /**
51
+ * The horizontal margin of the component.
52
+ * Use 1-12 for margin of 4px-48px.
53
+ */
54
+ marginHorizontal?: BoxSpacing;
55
+ /**
56
+ * The vertical margin of the component.
57
+ * Use 1-12 for margin of 4px-48px.
58
+ */
59
+ marginVertical?: BoxSpacing;
60
+ /**
61
+ * The padding of the component.
62
+ * Use 1-12 for padding of 4px-48px.
63
+ */
64
+ padding?: BoxSpacing;
65
+ /**
66
+ * The top padding of the component.
67
+ * Use 1-12 for padding of 4px-48px.
68
+ */
69
+ paddingTop?: BoxSpacing;
70
+ /**
71
+ * The right padding of the component.
72
+ * Use 1-12 for padding of 4px-48px.
73
+ */
74
+ paddingRight?: BoxSpacing;
75
+ /**
76
+ * The bottom padding of the component.
77
+ * Use 1-12 for padding of 4px-48px.
78
+ */
79
+ paddingBottom?: BoxSpacing;
80
+ /**
81
+ * The left padding of the component.
82
+ * Use 1-12 for padding of 4px-48px.
83
+ */
84
+ paddingLeft?: BoxSpacing;
85
+ /**
86
+ * The horizontal padding of the component.
87
+ * Use 1-12 for padding of 4px-48px.
88
+ */
89
+ paddingHorizontal?: BoxSpacing;
90
+ /**
91
+ * The vertical padding of the component.
92
+ * Use 1-12 for padding of 4px-48px.
93
+ */
94
+ paddingVertical?: BoxSpacing;
95
+ /**
96
+ * The border width of the component.
97
+ * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.
98
+ */
99
+ borderWidth?: BoxBorderWidth;
100
+ /**
101
+ * The border color of the component.
102
+ */
103
+ borderColor?: BoxBorderColor;
104
+ /**
105
+ * The background color of the component.
106
+ */
107
+ backgroundColor?: BoxBackgroundColor;
25
108
  /**
26
109
  * Optional prop to add twrnc overriding classNames.
27
110
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Box.types.d.mts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,8BAAoB;AAErB,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"Box.types.mjs","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxSpacing,\n BoxBorderWidth,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from '../../types';\n\nexport type BoxProps = {\n /**\n * The flexDirection style of the component.\n */\n flexDirection?: BoxFlexDirection;\n /**\n * The flexWrap style of the component.\n */\n flexWrap?: BoxFlexWrap;\n /**\n * The gap between the component's children.\n * Use 1-12 for a gap of 4px-48px.\n */\n gap?: BoxSpacing;\n /**\n * The alignItems style of the component.\n */\n alignItems?: BoxAlignItems;\n /**\n * The justifyContent style of the component.\n */\n justifyContent?: BoxJustifyContent;\n /**\n * The margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n margin?: BoxSpacing;\n /**\n * The top margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginTop?: BoxSpacing;\n /**\n * The right margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginRight?: BoxSpacing;\n /**\n * The bottom margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginBottom?: BoxSpacing;\n /**\n * The left margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginLeft?: BoxSpacing;\n /**\n * The horizontal margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginHorizontal?: BoxSpacing;\n /**\n * The vertical margin of the component.\n * Use 1-12 for margin of 4px-48px.\n */\n marginVertical?: BoxSpacing;\n /**\n * The padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n padding?: BoxSpacing;\n /**\n * The top padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingTop?: BoxSpacing;\n /**\n * The right padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingRight?: BoxSpacing;\n /**\n * The bottom padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingBottom?: BoxSpacing;\n /**\n * The left padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingLeft?: BoxSpacing;\n /**\n * The horizontal padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingHorizontal?: BoxSpacing;\n /**\n * The vertical padding of the component.\n * Use 1-12 for padding of 4px-48px.\n */\n paddingVertical?: BoxSpacing;\n /**\n * The border width of the component.\n * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px.\n */\n borderWidth?: BoxBorderWidth;\n /**\n * The border color of the component.\n */\n borderColor?: BoxBorderColor;\n /**\n * The background color of the component.\n */\n backgroundColor?: BoxBackgroundColor;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAKqB;AAJnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAGnB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":";;;AAAA,+CAKqB;AAJnB,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAGnB,iCAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing, BoxBorderWidth } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -1,5 +1,5 @@
1
1
  export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.cjs";
2
- export type { BoxSpacing } from "../../types/index.cjs";
2
+ export type { BoxSpacing, BoxBorderWidth } from "../../types/index.cjs";
3
3
  export { Box } from "./Box.cjs";
4
4
  export type { BoxProps } from "./Box.types.cjs";
5
5
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,8BAAoB;AAC9D,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1,5 +1,5 @@
1
1
  export { BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, } from "../../types/index.mjs";
2
- export type { BoxSpacing } from "../../types/index.mjs";
2
+ export type { BoxSpacing, BoxBorderWidth } from "../../types/index.mjs";
3
3
  export { Box } from "./Box.mjs";
4
4
  export type { BoxProps } from "./Box.types.mjs";
5
5
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,8BAAoB;AAC9C,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,8BAAoB;AACrB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,8BAAoB;AAC9D,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,YAAY,EAAE,QAAQ,EAAE,wBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,8BAAoB;AAErB,OAAO,EAAE,GAAG,EAAE,kBAAc","sourcesContent":["export {\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n} from '../../types';\nexport type { BoxSpacing, BoxBorderWidth } from '../../types';\nexport { Box } from './Box';\nexport type { BoxProps } from './Box.types';\n"]}
@@ -19,7 +19,7 @@ const Button = (buttonProps) => {
19
19
  case types_1.ButtonVariant.Secondary:
20
20
  return <ButtonSecondary_1.ButtonSecondary {...restProps}/>;
21
21
  default:
22
- throw new Error(`Invalid Button Variant: ${variant}. Expected one of: ${Object.values(types_1.ButtonVariant).join(', ')}`);
22
+ throw new Error(`Invalid Button Variant: ${String(variant)}. Expected one of: ${Object.values(types_1.ButtonVariant).join(', ')}`);
23
23
  }
24
24
  };
25
25
  exports.Button = Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA4C;AAG5C,sEAAyD;AACzD,0EAA6D;AAC7D,wEAA2D;AAEpD,MAAM,MAAM,GAAG,CAAC,WAAwB,EAAE,EAAE;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;IAE9C,QAAQ,OAAO,EAAE;QACf,KAAK,qBAAa,CAAC,QAAQ;YACzB,OAAO,CAAC,+BAAc,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC3C,KAAK,qBAAa,CAAC,OAAO;YACxB,OAAO,CAAC,6BAAa,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC1C,KAAK,qBAAa,CAAC,SAAS;YAC1B,OAAO,CAAC,iCAAe,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC5C;YACE,MAAM,IAAI,KAAK,CACb,2BAA2B,OAAO,sBAAsB,MAAM,CAAC,MAAM,CAAC,qBAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClG,CAAC;KACL;AACH,CAAC,CAAC;AAfW,QAAA,MAAM,UAejB","sourcesContent":["import React from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\n\nexport const Button = (buttonProps: ButtonProps) => {\n const { variant, ...restProps } = buttonProps;\n\n switch (variant) {\n case ButtonVariant.Tertiary:\n return <ButtonTertiary {...restProps} />;\n case ButtonVariant.Primary:\n return <ButtonPrimary {...restProps} />;\n case ButtonVariant.Secondary:\n return <ButtonSecondary {...restProps} />;\n default:\n throw new Error(\n `Invalid Button Variant: ${variant}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`,\n );\n }\n};\n"]}
1
+ {"version":3,"file":"Button.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA4C;AAG5C,sEAAyD;AACzD,0EAA6D;AAC7D,wEAA2D;AAEpD,MAAM,MAAM,GAAG,CAAC,WAAwB,EAAE,EAAE;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;IAE9C,QAAQ,OAAO,EAAE;QACf,KAAK,qBAAa,CAAC,QAAQ;YACzB,OAAO,CAAC,+BAAc,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC3C,KAAK,qBAAa,CAAC,OAAO;YACxB,OAAO,CAAC,6BAAa,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC1C,KAAK,qBAAa,CAAC,SAAS;YAC1B,OAAO,CAAC,iCAAe,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC5C;YACE,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,CAAC,sBAAsB,MAAM,CAAC,MAAM,CAAC,qBAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1G,CAAC;KACL;AACH,CAAC,CAAC;AAfW,QAAA,MAAM,UAejB","sourcesContent":["import React from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\n\nexport const Button = (buttonProps: ButtonProps) => {\n const { variant, ...restProps } = buttonProps;\n\n switch (variant) {\n case ButtonVariant.Tertiary:\n return <ButtonTertiary {...restProps} />;\n case ButtonVariant.Primary:\n return <ButtonPrimary {...restProps} />;\n case ButtonVariant.Secondary:\n return <ButtonSecondary {...restProps} />;\n default:\n throw new Error(\n `Invalid Button Variant: ${String(variant)}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`,\n );\n }\n};\n"]}
@@ -20,7 +20,7 @@ export const Button = (buttonProps) => {
20
20
  case ButtonVariant.Secondary:
21
21
  return <ButtonSecondary {...restProps}/>;
22
22
  default:
23
- throw new Error(`Invalid Button Variant: ${variant}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`);
23
+ throw new Error(`Invalid Button Variant: ${String(variant)}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`);
24
24
  }
25
25
  };
26
26
  //# sourceMappingURL=Button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,aAAa,EAAE,8BAAoB;AAG5C,OAAO,EAAE,aAAa,EAAE,2CAAiC;AACzD,OAAO,EAAE,eAAe,EAAE,6CAAmC;AAC7D,OAAO,EAAE,cAAc,EAAE,4CAAkC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAwB,EAAE,EAAE;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;IAE9C,QAAQ,OAAO,EAAE;QACf,KAAK,aAAa,CAAC,QAAQ;YACzB,OAAO,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC3C,KAAK,aAAa,CAAC,OAAO;YACxB,OAAO,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC1C,KAAK,aAAa,CAAC,SAAS;YAC1B,OAAO,CAAC,eAAe,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC5C;YACE,MAAM,IAAI,KAAK,CACb,2BAA2B,OAAO,sBAAsB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClG,CAAC;KACL;AACH,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\n\nexport const Button = (buttonProps: ButtonProps) => {\n const { variant, ...restProps } = buttonProps;\n\n switch (variant) {\n case ButtonVariant.Tertiary:\n return <ButtonTertiary {...restProps} />;\n case ButtonVariant.Primary:\n return <ButtonPrimary {...restProps} />;\n case ButtonVariant.Secondary:\n return <ButtonSecondary {...restProps} />;\n default:\n throw new Error(\n `Invalid Button Variant: ${variant}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`,\n );\n }\n};\n"]}
1
+ {"version":3,"file":"Button.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,aAAa,EAAE,8BAAoB;AAG5C,OAAO,EAAE,aAAa,EAAE,2CAAiC;AACzD,OAAO,EAAE,eAAe,EAAE,6CAAmC;AAC7D,OAAO,EAAE,cAAc,EAAE,4CAAkC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAwB,EAAE,EAAE;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;IAE9C,QAAQ,OAAO,EAAE;QACf,KAAK,aAAa,CAAC,QAAQ;YACzB,OAAO,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC3C,KAAK,aAAa,CAAC,OAAO;YACxB,OAAO,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC1C,KAAK,aAAa,CAAC,SAAS;YAC1B,OAAO,CAAC,eAAe,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;QAC5C;YACE,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,CAAC,sBAAsB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1G,CAAC;KACL;AACH,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\n\nexport const Button = (buttonProps: ButtonProps) => {\n const { variant, ...restProps } = buttonProps;\n\n switch (variant) {\n case ButtonVariant.Tertiary:\n return <ButtonTertiary {...restProps} />;\n case ButtonVariant.Primary:\n return <ButtonPrimary {...restProps} />;\n case ButtonVariant.Secondary:\n return <ButtonSecondary {...restProps} />;\n default:\n throw new Error(\n `Invalid Button Variant: ${String(variant)}. Expected one of: ${Object.values(ButtonVariant).join(', ')}`,\n );\n }\n};\n"]}
@@ -24,83 +24,55 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ButtonPrimary = void 0;
27
- const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
28
27
  const react_1 = __importStar(require("react"));
29
28
  const ButtonBase_1 = require("../../../ButtonBase/index.cjs");
30
29
  const Icon_1 = require("../../../Icon/index.cjs");
31
30
  const Text_1 = require("../../../Text/index.cjs");
32
- const ButtonPrimaryBase = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse, isLoading = false, onPressIn, onPressOut, twClassName = '', style, ...props }) => {
33
- const [isPressed, setIsPressed] = (0, react_1.useState)(false);
34
- const tw = (0, design_system_twrnc_preset_1.useTailwind)();
35
- const twContainerClassNames = `
36
- ${isInverse && isDanger
37
- ? isPressed || isLoading
38
- ? 'bg-default-pressed'
39
- : 'bg-default'
40
- : isDanger
41
- ? isPressed || isLoading
42
- ? 'bg-error-default-pressed'
43
- : 'bg-error-default'
44
- : isInverse
45
- ? isPressed || isLoading
46
- ? 'bg-default-pressed'
47
- : 'bg-default'
48
- : isPressed || isLoading
49
- ? 'bg-primary-default-pressed'
50
- : 'bg-primary-default'}
51
- ${twClassName}
52
- `;
53
- const twTextClassNames = isInverse && isDanger
54
- ? isPressed || isLoading
55
- ? 'text-error-default-pressed'
56
- : 'text-error-default'
57
- : isDanger
58
- ? 'text-primary-inverse'
59
- : isInverse
60
- ? 'text-default'
61
- : 'text-primary-inverse';
62
- const onPressInHandler = (event) => {
63
- setIsPressed(true);
64
- onPressIn?.(event);
65
- };
66
- const onPressOutHandler = (event) => {
67
- setIsPressed(false);
68
- onPressOut?.(event);
69
- };
31
+ const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
32
+ const getContainerClassName = (0, react_1.useCallback)((pressed) => {
33
+ const classNameStr = typeof twClassName === 'function' ? twClassName(pressed) : twClassName;
34
+ if (isInverse && isDanger) {
35
+ return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;
36
+ }
37
+ if (isDanger) {
38
+ return `${pressed || isLoading ? 'bg-error-default-pressed' : 'bg-error-default'} ${classNameStr}`;
39
+ }
40
+ if (isInverse) {
41
+ return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;
42
+ }
43
+ return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${classNameStr}`;
44
+ }, [isInverse, isDanger, isLoading, twClassName]);
45
+ const getTextClassName = (0, react_1.useCallback)((pressed) => {
46
+ if (isInverse && isDanger) {
47
+ return pressed || isLoading
48
+ ? 'text-error-default-pressed'
49
+ : 'text-error-default';
50
+ }
51
+ if (isDanger) {
52
+ return 'text-primary-inverse';
53
+ }
54
+ if (isInverse) {
55
+ return 'text-default';
56
+ }
57
+ return 'text-primary-inverse';
58
+ }, [isInverse, isDanger, isLoading]);
70
59
  return (<ButtonBase_1.ButtonBase textProps={{
71
60
  variant: Text_1.TextVariant.BodyMd,
72
61
  fontWeight: Text_1.FontWeight.Medium,
73
62
  numberOfLines: 1,
74
63
  ellipsizeMode: 'clip',
75
64
  ...textProps,
76
- twClassName: `${twTextClassNames} ${textProps?.twClassName ?? ''}`,
77
65
  }} spinnerProps={{
78
- color: twTextClassNames,
79
- loadingTextProps: {
80
- twClassName: twTextClassNames,
81
- },
82
66
  ...spinnerProps,
83
67
  }} startIconProps={{
84
68
  size: Icon_1.IconSize.Sm,
85
69
  ...startIconProps,
86
- twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,
87
70
  }} endIconProps={{
88
71
  size: Icon_1.IconSize.Sm,
89
72
  ...endIconProps,
90
- twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,
91
- }} isLoading={isLoading} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} style={[tw `${twContainerClassNames}`, style]} {...props}>
73
+ }} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
92
74
  {children}
93
75
  </ButtonBase_1.ButtonBase>);
94
76
  };
95
- const ButtonPrimary = ({ isInverse = false, ...props }) => {
96
- // If inverse, use the current theme context
97
- if (isInverse) {
98
- return <ButtonPrimaryBase isInverse {...props}/>;
99
- }
100
- // Otherwise, force light theme
101
- return (<design_system_twrnc_preset_1.ThemeProvider theme={design_system_twrnc_preset_1.Theme.Light}>
102
- <ButtonPrimaryBase isInverse={false} {...props}/>
103
- </design_system_twrnc_preset_1.ThemeProvider>);
104
- };
105
77
  exports.ButtonPrimary = ButtonPrimary;
106
78
  //# sourceMappingURL=ButtonPrimary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n useTailwind,\n ThemeProvider,\n Theme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { ButtonBase } from '../../../ButtonBase';\nimport type { IconColor } from '../../../Icon';\nimport { IconSize } from '../../../Icon';\nimport { TextVariant, FontWeight } from '../../../Text';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\nconst ButtonPrimaryBase = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse,\n isLoading = false,\n onPressIn,\n onPressOut,\n twClassName = '',\n style,\n ...props\n}: ButtonPrimaryProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n const twContainerClassNames = `\n ${\n isInverse && isDanger\n ? isPressed || isLoading\n ? 'bg-default-pressed'\n : 'bg-default'\n : isDanger\n ? isPressed || isLoading\n ? 'bg-error-default-pressed'\n : 'bg-error-default'\n : isInverse\n ? isPressed || isLoading\n ? 'bg-default-pressed'\n : 'bg-default'\n : isPressed || isLoading\n ? 'bg-primary-default-pressed'\n : 'bg-primary-default'\n }\n ${twClassName}\n `;\n\n const twTextClassNames =\n isInverse && isDanger\n ? isPressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default'\n : isDanger\n ? 'text-primary-inverse'\n : isInverse\n ? 'text-default'\n : 'text-primary-inverse';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonBase\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: `${twTextClassNames} ${textProps?.twClassName ?? ''}`,\n }}\n spinnerProps={{\n color: twTextClassNames as IconColor,\n loadingTextProps: {\n twClassName: twTextClassNames,\n },\n ...spinnerProps,\n }}\n startIconProps={{\n size: IconSize.Sm,\n ...startIconProps,\n twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,\n }}\n endIconProps={{\n size: IconSize.Sm,\n ...endIconProps,\n twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,\n }}\n isLoading={isLoading}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n style={[tw`${twContainerClassNames}`, style]}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n\nexport const ButtonPrimary = ({\n isInverse = false,\n ...props\n}: ButtonPrimaryProps) => {\n // If inverse, use the current theme context\n if (isInverse) {\n return <ButtonPrimaryBase isInverse {...props} />;\n }\n // Otherwise, force light theme\n return (\n <ThemeProvider theme={Theme.Light}>\n <ButtonPrimaryBase isInverse={false} {...props} />\n </ThemeProvider>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C,8DAAiD;AACjD,kDAAyC;AACzC,kDAAwD;AAIjD,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,CAAC,OAAgB,EAAU,EAAE;QAC3B,MAAM,YAAY,GAChB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAEzE,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,IAAI,YAAY,EAAE,CAAC;SACxF;QACD,IAAI,QAAQ,EAAE;YACZ,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,kBAAkB,IAAI,YAAY,EAAE,CAAC;SACpG;QACD,IAAI,SAAS,EAAE;YACb,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,IAAI,YAAY,EAAE,CAAC;SACxF;QACD,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,iBAAiB,IAAI,YAAY,EAAE,CAAC;IACnG,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAC9C,CAAC;IAEF,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAgB,EAAU,EAAE;QAC3B,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,OAAO,OAAO,IAAI,SAAS;gBACzB,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,oBAAoB,CAAC;SAC1B;QACD,IAAI,QAAQ,EAAE;YACZ,OAAO,sBAAsB,CAAC;SAC/B;QACD,IAAI,SAAS,EAAE;YACb,OAAO,cAAc,CAAC;SACvB;QACD,OAAO,sBAAsB,CAAC;IAChC,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CACT,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,kBAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,iBAAU,CAAC,MAAM;YAC7B,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,SAAS;SACb,CAAC,CACF,YAAY,CAAC,CAAC;YACZ,GAAG,YAAY;SAChB,CAAC,CACF,cAAc,CAAC,CAAC;YACd,IAAI,EAAE,eAAQ,CAAC,EAAE;YACjB,GAAG,cAAc;SAClB,CAAC,CACF,YAAY,CAAC,CAAC;YACZ,IAAI,EAAE,eAAQ,CAAC,EAAE;YACjB,GAAG,YAAY;SAChB,CAAC,CACF,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAhFW,QAAA,aAAa,iBAgFxB","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\nimport { IconSize } from '../../../Icon';\nimport { TextVariant, FontWeight } from '../../../Text';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\nexport const ButtonPrimary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonPrimaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n if (isInverse && isDanger) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n if (isDanger) {\n return `${pressed || isLoading ? 'bg-error-default-pressed' : 'bg-error-default'} ${classNameStr}`;\n }\n if (isInverse) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${classNameStr}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isInverse && isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isDanger) {\n return 'text-primary-inverse';\n }\n if (isInverse) {\n return 'text-default';\n }\n return 'text-primary-inverse';\n },\n [isInverse, isDanger, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n }}\n spinnerProps={{\n ...spinnerProps,\n }}\n startIconProps={{\n size: IconSize.Sm,\n ...startIconProps,\n }}\n endIconProps={{\n size: IconSize.Sm,\n ...endIconProps,\n }}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { ButtonPrimaryProps } from "./ButtonPrimary.types.cjs";
3
- export declare const ButtonPrimary: ({ isInverse, ...props }: ButtonPrimaryProps) => React.JSX.Element;
3
+ export declare const ButtonPrimary: ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger, isInverse, isLoading, twClassName, style, ...props }: ButtonPrimaryProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=ButtonPrimary.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonPrimary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,cAAc;AAQxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAoGhE,eAAO,MAAM,aAAa,4BAGvB,kBAAkB,sBAWpB,CAAC"}
1
+ {"version":3,"file":"ButtonPrimary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAM3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,sIAYvB,kBAAkB,sBAoEpB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { ButtonPrimaryProps } from "./ButtonPrimary.types.mjs";
3
- export declare const ButtonPrimary: ({ isInverse, ...props }: ButtonPrimaryProps) => React.JSX.Element;
3
+ export declare const ButtonPrimary: ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger, isInverse, isLoading, twClassName, style, ...props }: ButtonPrimaryProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=ButtonPrimary.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonPrimary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,cAAc;AAQxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAoGhE,eAAO,MAAM,aAAa,4BAGvB,kBAAkB,sBAWpB,CAAC"}
1
+ {"version":3,"file":"ButtonPrimary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAM3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,sIAYvB,kBAAkB,sBAoEpB,CAAC"}
@@ -4,83 +4,55 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { useTailwind, ThemeProvider, Theme } from "@metamask-previews/design-system-twrnc-preset";
8
- import $React, { useState } from "react";
7
+ import $React, { useCallback } from "react";
9
8
  const React = $importDefault($React);
10
9
  import { ButtonBase } from "../../../ButtonBase/index.mjs";
11
10
  import { IconSize } from "../../../Icon/index.mjs";
12
11
  import { TextVariant, FontWeight } from "../../../Text/index.mjs";
13
- const ButtonPrimaryBase = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse, isLoading = false, onPressIn, onPressOut, twClassName = '', style, ...props }) => {
14
- const [isPressed, setIsPressed] = useState(false);
15
- const tw = useTailwind();
16
- const twContainerClassNames = `
17
- ${isInverse && isDanger
18
- ? isPressed || isLoading
19
- ? 'bg-default-pressed'
20
- : 'bg-default'
21
- : isDanger
22
- ? isPressed || isLoading
23
- ? 'bg-error-default-pressed'
24
- : 'bg-error-default'
25
- : isInverse
26
- ? isPressed || isLoading
27
- ? 'bg-default-pressed'
28
- : 'bg-default'
29
- : isPressed || isLoading
30
- ? 'bg-primary-default-pressed'
31
- : 'bg-primary-default'}
32
- ${twClassName}
33
- `;
34
- const twTextClassNames = isInverse && isDanger
35
- ? isPressed || isLoading
36
- ? 'text-error-default-pressed'
37
- : 'text-error-default'
38
- : isDanger
39
- ? 'text-primary-inverse'
40
- : isInverse
41
- ? 'text-default'
42
- : 'text-primary-inverse';
43
- const onPressInHandler = (event) => {
44
- setIsPressed(true);
45
- onPressIn?.(event);
46
- };
47
- const onPressOutHandler = (event) => {
48
- setIsPressed(false);
49
- onPressOut?.(event);
50
- };
12
+ export const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
13
+ const getContainerClassName = useCallback((pressed) => {
14
+ const classNameStr = typeof twClassName === 'function' ? twClassName(pressed) : twClassName;
15
+ if (isInverse && isDanger) {
16
+ return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;
17
+ }
18
+ if (isDanger) {
19
+ return `${pressed || isLoading ? 'bg-error-default-pressed' : 'bg-error-default'} ${classNameStr}`;
20
+ }
21
+ if (isInverse) {
22
+ return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;
23
+ }
24
+ return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${classNameStr}`;
25
+ }, [isInverse, isDanger, isLoading, twClassName]);
26
+ const getTextClassName = useCallback((pressed) => {
27
+ if (isInverse && isDanger) {
28
+ return pressed || isLoading
29
+ ? 'text-error-default-pressed'
30
+ : 'text-error-default';
31
+ }
32
+ if (isDanger) {
33
+ return 'text-primary-inverse';
34
+ }
35
+ if (isInverse) {
36
+ return 'text-default';
37
+ }
38
+ return 'text-primary-inverse';
39
+ }, [isInverse, isDanger, isLoading]);
51
40
  return (<ButtonBase textProps={{
52
41
  variant: TextVariant.BodyMd,
53
42
  fontWeight: FontWeight.Medium,
54
43
  numberOfLines: 1,
55
44
  ellipsizeMode: 'clip',
56
45
  ...textProps,
57
- twClassName: `${twTextClassNames} ${textProps?.twClassName ?? ''}`,
58
46
  }} spinnerProps={{
59
- color: twTextClassNames,
60
- loadingTextProps: {
61
- twClassName: twTextClassNames,
62
- },
63
47
  ...spinnerProps,
64
48
  }} startIconProps={{
65
49
  size: IconSize.Sm,
66
50
  ...startIconProps,
67
- twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,
68
51
  }} endIconProps={{
69
52
  size: IconSize.Sm,
70
53
  ...endIconProps,
71
- twClassName: `${twTextClassNames} ${startIconProps?.twClassName ?? ''}`,
72
- }} isLoading={isLoading} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} style={[tw `${twContainerClassNames}`, style]} {...props}>
54
+ }} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
73
55
  {children}
74
56
  </ButtonBase>);
75
57
  };
76
- export const ButtonPrimary = ({ isInverse = false, ...props }) => {
77
- // If inverse, use the current theme context
78
- if (isInverse) {
79
- return <ButtonPrimaryBase isInverse {...props}/>;
80
- }
81
- // Otherwise, force light theme
82
- return (<ThemeProvider theme={Theme.Light}>
83
- <ButtonPrimaryBase isInverse={false} {...props}/>
84
- </ThemeProvider>);
85
- };
86
58
  //# sourceMappingURL=ButtonPrimary.mjs.map