@metamask-previews/design-system-react-native 0.0.0-preview.f4da8f1 → 0.0.0-preview.fbd1fe9

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 (221) hide show
  1. package/dist/components/Button/Button.constants.d.ts +2 -0
  2. package/dist/components/Button/Button.constants.d.ts.map +1 -0
  3. package/dist/components/Button/Button.constants.js +7 -0
  4. package/dist/components/Button/Button.constants.js.map +1 -0
  5. package/dist/components/Button/Button.d.ts +5 -0
  6. package/dist/components/Button/Button.d.ts.map +1 -0
  7. package/dist/components/Button/Button.js +25 -0
  8. package/dist/components/Button/Button.js.map +1 -0
  9. package/dist/components/Button/Button.types.d.ts +23 -0
  10. package/dist/components/Button/Button.types.d.ts.map +1 -0
  11. package/dist/components/Button/Button.types.js +15 -0
  12. package/dist/components/Button/Button.types.js.map +1 -0
  13. package/dist/components/Button/index.d.ts +4 -0
  14. package/dist/components/Button/index.d.ts.map +1 -0
  15. package/dist/components/Button/index.js +12 -0
  16. package/dist/components/Button/index.js.map +1 -0
  17. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.constants.d.ts +3 -0
  18. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.constants.d.ts.map +1 -0
  19. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.constants.js +29 -0
  20. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.constants.js.map +1 -0
  21. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.ts +5 -0
  22. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.ts.map +1 -0
  23. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.js +97 -0
  24. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.js.map +1 -0
  25. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.types.d.ts +17 -0
  26. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.types.d.ts.map +1 -0
  27. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.types.js +3 -0
  28. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.types.js.map +1 -0
  29. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.utilities.d.ts +78 -0
  30. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.utilities.d.ts.map +1 -0
  31. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.utilities.js +122 -0
  32. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.utilities.js.map +1 -0
  33. package/dist/components/Button/variants/ButtonPrimary/index.d.ts +4 -0
  34. package/dist/components/Button/variants/ButtonPrimary/index.d.ts.map +1 -0
  35. package/dist/components/Button/variants/ButtonPrimary/index.js +11 -0
  36. package/dist/components/Button/variants/ButtonPrimary/index.js.map +1 -0
  37. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.constants.d.ts +3 -0
  38. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.constants.d.ts.map +1 -0
  39. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.constants.js +29 -0
  40. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.constants.js.map +1 -0
  41. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.ts +5 -0
  42. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.ts.map +1 -0
  43. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.js +90 -0
  44. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.js.map +1 -0
  45. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.types.d.ts +17 -0
  46. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.types.d.ts.map +1 -0
  47. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.types.js +3 -0
  48. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.types.js.map +1 -0
  49. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.utilities.d.ts +90 -0
  50. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.utilities.d.ts.map +1 -0
  51. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.utilities.js +145 -0
  52. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.utilities.js.map +1 -0
  53. package/dist/components/Button/variants/ButtonSecondary/index.d.ts +4 -0
  54. package/dist/components/Button/variants/ButtonSecondary/index.d.ts.map +1 -0
  55. package/dist/components/Button/variants/ButtonSecondary/index.js +11 -0
  56. package/dist/components/Button/variants/ButtonSecondary/index.js.map +1 -0
  57. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.constants.d.ts +3 -0
  58. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.constants.d.ts.map +1 -0
  59. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.constants.js +29 -0
  60. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.constants.js.map +1 -0
  61. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.ts +5 -0
  62. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.ts.map +1 -0
  63. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.js +90 -0
  64. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.js.map +1 -0
  65. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.types.d.ts +17 -0
  66. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.types.d.ts.map +1 -0
  67. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.types.js +3 -0
  68. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.types.js.map +1 -0
  69. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.utilities.d.ts +88 -0
  70. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.utilities.d.ts.map +1 -0
  71. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.utilities.js +147 -0
  72. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.utilities.js.map +1 -0
  73. package/dist/components/Button/variants/ButtonTertiary/index.d.ts +4 -0
  74. package/dist/components/Button/variants/ButtonTertiary/index.d.ts.map +1 -0
  75. package/dist/components/Button/variants/ButtonTertiary/index.js +11 -0
  76. package/dist/components/Button/variants/ButtonTertiary/index.js.map +1 -0
  77. package/dist/components/ButtonIcon/ButtonIcon.constants.d.ts +6 -0
  78. package/dist/components/ButtonIcon/ButtonIcon.constants.d.ts.map +1 -0
  79. package/dist/components/ButtonIcon/ButtonIcon.constants.js +20 -0
  80. package/dist/components/ButtonIcon/ButtonIcon.constants.js.map +1 -0
  81. package/dist/components/ButtonIcon/ButtonIcon.d.ts +5 -0
  82. package/dist/components/ButtonIcon/ButtonIcon.d.ts.map +1 -0
  83. package/dist/components/ButtonIcon/ButtonIcon.js +72 -0
  84. package/dist/components/ButtonIcon/ButtonIcon.js.map +1 -0
  85. package/dist/components/ButtonIcon/ButtonIcon.types.d.ts +60 -0
  86. package/dist/components/ButtonIcon/ButtonIcon.types.d.ts.map +1 -0
  87. package/dist/components/ButtonIcon/ButtonIcon.types.js +19 -0
  88. package/dist/components/ButtonIcon/ButtonIcon.types.js.map +1 -0
  89. package/dist/components/ButtonIcon/ButtonIcon.utilities.d.ts +55 -0
  90. package/dist/components/ButtonIcon/ButtonIcon.utilities.d.ts.map +1 -0
  91. package/dist/components/ButtonIcon/ButtonIcon.utilities.js +73 -0
  92. package/dist/components/ButtonIcon/ButtonIcon.utilities.js.map +1 -0
  93. package/dist/components/ButtonIcon/index.d.ts +4 -0
  94. package/dist/components/ButtonIcon/index.d.ts.map +1 -0
  95. package/dist/components/ButtonIcon/index.js +11 -0
  96. package/dist/components/ButtonIcon/index.js.map +1 -0
  97. package/dist/components/Icon/Icon.assets.d.ts +6 -0
  98. package/dist/components/Icon/Icon.assets.d.ts.map +1 -0
  99. package/dist/components/Icon/Icon.assets.js +324 -0
  100. package/dist/components/Icon/Icon.assets.js.map +1 -0
  101. package/dist/components/Icon/Icon.constants.d.ts +7 -0
  102. package/dist/components/Icon/Icon.constants.d.ts.map +1 -0
  103. package/dist/components/Icon/Icon.constants.js +15 -0
  104. package/dist/components/Icon/Icon.constants.js.map +1 -0
  105. package/dist/components/Icon/Icon.d.ts +5 -0
  106. package/dist/components/Icon/Icon.d.ts.map +1 -0
  107. package/dist/components/Icon/Icon.js +45 -0
  108. package/dist/components/Icon/Icon.js.map +1 -0
  109. package/dist/components/Icon/Icon.types.d.ts +254 -0
  110. package/dist/components/Icon/Icon.types.d.ts.map +1 -0
  111. package/dist/components/Icon/Icon.types.js +229 -0
  112. package/dist/components/Icon/Icon.types.js.map +1 -0
  113. package/dist/components/Icon/Icon.utilities.d.ts +22 -0
  114. package/dist/components/Icon/Icon.utilities.d.ts.map +1 -0
  115. package/dist/components/Icon/Icon.utilities.js +31 -0
  116. package/dist/components/Icon/Icon.utilities.js.map +1 -0
  117. package/dist/components/Icon/index.d.ts +4 -0
  118. package/dist/components/Icon/index.d.ts.map +1 -0
  119. package/dist/components/Icon/index.js +13 -0
  120. package/dist/components/Icon/index.js.map +1 -0
  121. package/dist/components/Text/Text.constants.d.ts +9 -0
  122. package/dist/components/Text/Text.constants.d.ts.map +1 -0
  123. package/dist/components/Text/Text.constants.js +21 -0
  124. package/dist/components/Text/Text.constants.js.map +1 -0
  125. package/dist/components/Text/Text.d.ts +5 -0
  126. package/dist/components/Text/Text.d.ts.map +1 -0
  127. package/dist/components/Text/Text.js +26 -0
  128. package/dist/components/Text/Text.js.map +1 -0
  129. package/dist/components/Text/Text.types.d.ts +110 -0
  130. package/dist/components/Text/Text.types.d.ts.map +1 -0
  131. package/dist/components/Text/Text.types.js +89 -0
  132. package/dist/components/Text/Text.types.js.map +1 -0
  133. package/dist/components/Text/Text.utilities.d.ts +30 -0
  134. package/dist/components/Text/Text.utilities.d.ts.map +1 -0
  135. package/dist/components/Text/Text.utilities.js +45 -0
  136. package/dist/components/Text/Text.utilities.js.map +1 -0
  137. package/dist/components/Text/index.d.ts +4 -0
  138. package/dist/components/Text/index.d.ts.map +1 -0
  139. package/dist/components/Text/index.js +14 -0
  140. package/dist/components/Text/index.js.map +1 -0
  141. package/dist/components/TextButton/TextButton.constants.d.ts +3 -0
  142. package/dist/components/TextButton/TextButton.constants.d.ts.map +1 -0
  143. package/dist/components/TextButton/TextButton.constants.js +29 -0
  144. package/dist/components/TextButton/TextButton.constants.js.map +1 -0
  145. package/dist/components/TextButton/TextButton.d.ts +5 -0
  146. package/dist/components/TextButton/TextButton.d.ts.map +1 -0
  147. package/dist/components/TextButton/TextButton.js +187 -0
  148. package/dist/components/TextButton/TextButton.js.map +1 -0
  149. package/dist/components/TextButton/TextButton.types.d.ts +73 -0
  150. package/dist/components/TextButton/TextButton.types.d.ts.map +1 -0
  151. package/dist/components/TextButton/TextButton.types.js +3 -0
  152. package/dist/components/TextButton/TextButton.types.js.map +1 -0
  153. package/dist/components/TextButton/TextButton.utilities.d.ts +55 -0
  154. package/dist/components/TextButton/TextButton.utilities.d.ts.map +1 -0
  155. package/dist/components/TextButton/TextButton.utilities.js +77 -0
  156. package/dist/components/TextButton/TextButton.utilities.js.map +1 -0
  157. package/dist/components/TextButton/index.d.ts +3 -0
  158. package/dist/components/TextButton/index.d.ts.map +1 -0
  159. package/dist/components/TextButton/index.js +9 -0
  160. package/dist/components/TextButton/index.js.map +1 -0
  161. package/dist/index.d.ts +10 -0
  162. package/dist/index.d.ts.map +1 -0
  163. package/dist/index.js +15 -0
  164. package/dist/index.js.map +1 -0
  165. package/dist/primitives/ButtonAnimated/ButtonAnimated.d.ts +5 -0
  166. package/dist/primitives/ButtonAnimated/ButtonAnimated.d.ts.map +1 -0
  167. package/dist/primitives/ButtonAnimated/ButtonAnimated.js +58 -0
  168. package/dist/primitives/ButtonAnimated/ButtonAnimated.js.map +1 -0
  169. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.d.ts +6 -0
  170. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.d.ts.map +1 -0
  171. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.js +3 -0
  172. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.js.map +1 -0
  173. package/dist/primitives/ButtonAnimated/index.d.ts +2 -0
  174. package/dist/primitives/ButtonAnimated/index.d.ts.map +1 -0
  175. package/dist/primitives/ButtonAnimated/index.js +9 -0
  176. package/dist/primitives/ButtonAnimated/index.js.map +1 -0
  177. package/dist/primitives/ButtonBase/ButtonBase.constants.d.ts +3 -0
  178. package/dist/primitives/ButtonBase/ButtonBase.constants.d.ts.map +1 -0
  179. package/dist/primitives/ButtonBase/ButtonBase.constants.js +32 -0
  180. package/dist/primitives/ButtonBase/ButtonBase.constants.js.map +1 -0
  181. package/dist/primitives/ButtonBase/ButtonBase.d.ts +5 -0
  182. package/dist/primitives/ButtonBase/ButtonBase.d.ts.map +1 -0
  183. package/dist/primitives/ButtonBase/ButtonBase.js +84 -0
  184. package/dist/primitives/ButtonBase/ButtonBase.js.map +1 -0
  185. package/dist/primitives/ButtonBase/ButtonBase.types.d.ts +93 -0
  186. package/dist/primitives/ButtonBase/ButtonBase.types.d.ts.map +1 -0
  187. package/dist/primitives/ButtonBase/ButtonBase.types.js +19 -0
  188. package/dist/primitives/ButtonBase/ButtonBase.types.js.map +1 -0
  189. package/dist/primitives/ButtonBase/ButtonBase.utilities.d.ts +28 -0
  190. package/dist/primitives/ButtonBase/ButtonBase.utilities.d.ts.map +1 -0
  191. package/dist/primitives/ButtonBase/ButtonBase.utilities.js +41 -0
  192. package/dist/primitives/ButtonBase/ButtonBase.utilities.js.map +1 -0
  193. package/dist/primitives/ButtonBase/index.d.ts +4 -0
  194. package/dist/primitives/ButtonBase/index.d.ts.map +1 -0
  195. package/dist/primitives/ButtonBase/index.js +11 -0
  196. package/dist/primitives/ButtonBase/index.js.map +1 -0
  197. package/dist/primitives/TextOrChildren/TextOrChildren.d.ts +5 -0
  198. package/dist/primitives/TextOrChildren/TextOrChildren.d.ts.map +1 -0
  199. package/dist/primitives/TextOrChildren/TextOrChildren.js +15 -0
  200. package/dist/primitives/TextOrChildren/TextOrChildren.js.map +1 -0
  201. package/dist/primitives/TextOrChildren/TextOrChildren.types.d.ts +15 -0
  202. package/dist/primitives/TextOrChildren/TextOrChildren.types.d.ts.map +1 -0
  203. package/dist/primitives/TextOrChildren/TextOrChildren.types.js +3 -0
  204. package/dist/primitives/TextOrChildren/TextOrChildren.types.js.map +1 -0
  205. package/dist/temp-components/Spinner/Spinner.constants.d.ts +3 -0
  206. package/dist/temp-components/Spinner/Spinner.constants.d.ts.map +1 -0
  207. package/dist/temp-components/Spinner/Spinner.constants.js +21 -0
  208. package/dist/temp-components/Spinner/Spinner.constants.js.map +1 -0
  209. package/dist/temp-components/Spinner/Spinner.d.ts +5 -0
  210. package/dist/temp-components/Spinner/Spinner.d.ts.map +1 -0
  211. package/dist/temp-components/Spinner/Spinner.js +68 -0
  212. package/dist/temp-components/Spinner/Spinner.js.map +1 -0
  213. package/dist/temp-components/Spinner/Spinner.types.d.ts +30 -0
  214. package/dist/temp-components/Spinner/Spinner.types.d.ts.map +1 -0
  215. package/dist/temp-components/Spinner/Spinner.types.js +3 -0
  216. package/dist/temp-components/Spinner/Spinner.types.js.map +1 -0
  217. package/dist/temp-components/Spinner/index.d.ts +3 -0
  218. package/dist/temp-components/Spinner/index.d.ts.map +1 -0
  219. package/dist/temp-components/Spinner/index.js +9 -0
  220. package/dist/temp-components/Spinner/index.js.map +1 -0
  221. package/package.json +12 -6
@@ -0,0 +1,93 @@
1
+ import type { PressableProps, StyleProp, ViewStyle } from 'react-native';
2
+ import type { TextProps } from 'src/components/Text/Text.types';
3
+ import type { IconProps, IconName } from '../../components/Icon';
4
+ import type { SpinnerProps } from '../../temp-components/Spinner';
5
+ export declare enum ButtonBaseSize {
6
+ /**
7
+ * Represents a small button size (32px).
8
+ */
9
+ Sm = "32",
10
+ /**
11
+ * Represents a medium button size (40px).
12
+ */
13
+ Md = "40",
14
+ /**
15
+ * Represents a large button size (48px).
16
+ */
17
+ Lg = "48"
18
+ }
19
+ /**
20
+ * ButtonBase component props.
21
+ */
22
+ export type ButtonBaseProps = {
23
+ /**
24
+ * Required prop for the content to be rendered within the ButtonBase
25
+ */
26
+ children: React.ReactNode | string;
27
+ /**
28
+ * Optional props to be passed to the Text component when children is a string
29
+ */
30
+ textProps?: Omit<Partial<TextProps>, 'children'>;
31
+ /**
32
+ * Optional prop to control the size of the ButtonBase
33
+ * Possible values: ButtonBaseSize.Sm (32px), ButtonBaseSize.Md (40px), ButtonBaseSize.Lg (48px)
34
+ * @default ButtonBaseSize.Lg
35
+ */
36
+ size?: ButtonBaseSize;
37
+ /**
38
+ * Optional prop that when true, shows a loading spinner
39
+ * @default false
40
+ */
41
+ isLoading?: boolean;
42
+ /**
43
+ * Optional prop for text to display when button is in loading state
44
+ */
45
+ loadingText?: string;
46
+ /**
47
+ * Optional prop to pass additional properties to the end icon
48
+ */
49
+ spinnerProps?: Partial<SpinnerProps>;
50
+ /**
51
+ * Optional prop to specify an icon to show at the start of the button
52
+ */
53
+ startIconName?: IconName;
54
+ /**
55
+ * Optional prop to pass additional properties to the start icon
56
+ */
57
+ startIconProps?: Partial<IconProps>;
58
+ /**
59
+ * Optional prop for a custom element to show at the start of the button
60
+ */
61
+ startAccessory?: React.ReactNode;
62
+ /**
63
+ * Optional prop to specify an icon to show at the end of the button
64
+ */
65
+ endIconName?: IconName;
66
+ /**
67
+ * Optional prop to pass additional properties to the end icon
68
+ */
69
+ endIconProps?: Partial<IconProps>;
70
+ /**
71
+ * Optional prop for a custom element to show at the end of the button
72
+ */
73
+ endAccessory?: React.ReactNode;
74
+ /**
75
+ * Optional prop that when true, disables the button
76
+ * @default false
77
+ */
78
+ isDisabled?: boolean;
79
+ /**
80
+ * Optional prop that when true, makes the button take up the full width of its container
81
+ * @default false
82
+ */
83
+ isFullWidth?: boolean;
84
+ /**
85
+ * Optional prop to add twrnc overriding classNames.
86
+ */
87
+ twClassName?: string;
88
+ /**
89
+ * Optional prop to control the style.
90
+ */
91
+ style?: StyleProp<ViewStyle>;
92
+ } & PressableProps;
93
+ //# sourceMappingURL=ButtonBase.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,oBAAY,cAAc;IACxB;;OAEG;IACH,EAAE,OAAO;IACT;;OAEG;IACH,EAAE,OAAO;IACT;;OAEG;IACH,EAAE,OAAO;CACV;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonBaseSize = void 0;
4
+ var ButtonBaseSize;
5
+ (function (ButtonBaseSize) {
6
+ /**
7
+ * Represents a small button size (32px).
8
+ */
9
+ ButtonBaseSize["Sm"] = "32";
10
+ /**
11
+ * Represents a medium button size (40px).
12
+ */
13
+ ButtonBaseSize["Md"] = "40";
14
+ /**
15
+ * Represents a large button size (48px).
16
+ */
17
+ ButtonBaseSize["Lg"] = "48";
18
+ })(ButtonBaseSize || (exports.ButtonBaseSize = ButtonBaseSize = {}));
19
+ //# sourceMappingURL=ButtonBase.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.types.js","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":";;;AAMA,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB;;OAEG;IACH,2BAAS,CAAA;IACT;;OAEG;IACH,2BAAS,CAAA;IACT;;OAEG;IACH,2BAAS,CAAA;AACX,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport type { TextProps } from 'src/components/Text/Text.types';\n\nimport type { IconProps, IconName } from '../../components/Icon';\nimport type { SpinnerProps } from '../../temp-components/Spinner';\n\nexport enum ButtonBaseSize {\n /**\n * Represents a small button size (32px).\n */\n Sm = '32',\n /**\n * Represents a medium button size (40px).\n */\n Md = '40',\n /**\n * Represents a large button size (48px).\n */\n Lg = '48',\n}\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to control the size of the ButtonBase\n * Possible values: ButtonBaseSize.Sm (32px), ButtonBaseSize.Md (40px), ButtonBaseSize.Lg (48px)\n * @default ButtonBaseSize.Lg\n */\n size?: ButtonBaseSize;\n /**\n * Optional prop that when true, shows a loading spinner\n * @default false\n */\n isLoading?: boolean;\n /**\n * Optional prop for text to display when button is in loading state\n */\n loadingText?: string;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop that when true, makes the button take up the full width of its container\n * @default false\n */\n isFullWidth?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & PressableProps;\n"]}
@@ -0,0 +1,28 @@
1
+ import type { ButtonBaseProps } from './ButtonBase.types';
2
+ /**
3
+ * Generates a Tailwind class name string for the base container of a button.
4
+ *
5
+ * This function constructs a class name string based on the button's `size`,
6
+ * `isDisabled`, `isFullWidth`, and optional additional Tailwind class names.
7
+ *
8
+ * @param size - The size of the button, defaulting to `DEFAULT_BUTTONBASE_PROPS.size`.
9
+ * @param isDisabled - A boolean indicating whether the button is disabled, affecting opacity.
10
+ * @param isFullWidth - A boolean indicating whether the button should stretch to full width.
11
+ * @param twClassName - Additional Tailwind class names for customization.
12
+ * @returns A string of Tailwind class names representing the button's container styles.
13
+ *
14
+ * Example:
15
+ * ```
16
+ * const classNames = generateButtonBaseContainerClassNames({
17
+ * size: 'md',
18
+ * isDisabled: true,
19
+ * isFullWidth: false,
20
+ * twClassName: 'border border-red-500',
21
+ * });
22
+ *
23
+ * console.log(classNames);
24
+ * // Output: "md-class flex-row items-center justify-center rounded-full bg-background-muted px-4 opacity-50 self-start border border-red-500"
25
+ * ```
26
+ */
27
+ export declare const generateButtonBaseContainerClassNames: ({ size, isDisabled, isFullWidth, twClassName, }: Partial<ButtonBaseProps>) => string;
28
+ //# sourceMappingURL=ButtonBase.utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.utilities.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.utilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,qCAAqC,oDAK/C,QAAQ,eAAe,CAAC,KAAG,MAQ7B,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateButtonBaseContainerClassNames = void 0;
4
+ /* eslint-disable jsdoc/check-param-names */
5
+ /* eslint-disable jsdoc/require-param */
6
+ const ButtonBase_constants_1 = require("./ButtonBase.constants");
7
+ /**
8
+ * Generates a Tailwind class name string for the base container of a button.
9
+ *
10
+ * This function constructs a class name string based on the button's `size`,
11
+ * `isDisabled`, `isFullWidth`, and optional additional Tailwind class names.
12
+ *
13
+ * @param size - The size of the button, defaulting to `DEFAULT_BUTTONBASE_PROPS.size`.
14
+ * @param isDisabled - A boolean indicating whether the button is disabled, affecting opacity.
15
+ * @param isFullWidth - A boolean indicating whether the button should stretch to full width.
16
+ * @param twClassName - Additional Tailwind class names for customization.
17
+ * @returns A string of Tailwind class names representing the button's container styles.
18
+ *
19
+ * Example:
20
+ * ```
21
+ * const classNames = generateButtonBaseContainerClassNames({
22
+ * size: 'md',
23
+ * isDisabled: true,
24
+ * isFullWidth: false,
25
+ * twClassName: 'border border-red-500',
26
+ * });
27
+ *
28
+ * console.log(classNames);
29
+ * // Output: "md-class flex-row items-center justify-center rounded-full bg-background-muted px-4 opacity-50 self-start border border-red-500"
30
+ * ```
31
+ */
32
+ const generateButtonBaseContainerClassNames = ({ size = ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.size, isDisabled, isFullWidth, twClassName = '', }) => {
33
+ const baseStyle = 'flex-row items-center justify-center rounded-full bg-background-muted px-4';
34
+ const sizeStyle = `h-[${size}px]`;
35
+ const disabledStyle = isDisabled ? 'opacity-50' : 'opacity-100';
36
+ const widthStyle = isFullWidth ? 'self-stretch' : 'self-start';
37
+ const mergedClassnames = `${sizeStyle} ${baseStyle} ${disabledStyle} ${widthStyle} ${twClassName}`;
38
+ return mergedClassnames;
39
+ };
40
+ exports.generateButtonBaseContainerClassNames = generateButtonBaseContainerClassNames;
41
+ //# sourceMappingURL=ButtonBase.utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.utilities.js","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.utilities.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,wCAAwC;AACxC,iEAAkE;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,qCAAqC,GAAG,CAAC,EACpD,IAAI,GAAG,+CAAwB,CAAC,IAAI,EACpC,UAAU,EACV,WAAW,EACX,WAAW,GAAG,EAAE,GACS,EAAU,EAAE;IACrC,MAAM,SAAS,GACb,4EAA4E,CAAC;IAC/E,MAAM,SAAS,GAAG,MAAM,IAAI,KAAK,CAAC;IAClC,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAChE,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IAC/D,MAAM,gBAAgB,GAAG,GAAG,SAAS,IAAI,SAAS,IAAI,aAAa,IAAI,UAAU,IAAI,WAAW,EAAE,CAAC;IACnG,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAbW,QAAA,qCAAqC,yCAahD","sourcesContent":["/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable jsdoc/require-param */\nimport { DEFAULT_BUTTONBASE_PROPS } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\n/**\n * Generates a Tailwind class name string for the base container of a button.\n *\n * This function constructs a class name string based on the button's `size`,\n * `isDisabled`, `isFullWidth`, and optional additional Tailwind class names.\n *\n * @param size - The size of the button, defaulting to `DEFAULT_BUTTONBASE_PROPS.size`.\n * @param isDisabled - A boolean indicating whether the button is disabled, affecting opacity.\n * @param isFullWidth - A boolean indicating whether the button should stretch to full width.\n * @param twClassName - Additional Tailwind class names for customization.\n * @returns A string of Tailwind class names representing the button's container styles.\n *\n * Example:\n * ```\n * const classNames = generateButtonBaseContainerClassNames({\n * size: 'md',\n * isDisabled: true,\n * isFullWidth: false,\n * twClassName: 'border border-red-500',\n * });\n *\n * console.log(classNames);\n * // Output: \"md-class flex-row items-center justify-center rounded-full bg-background-muted px-4 opacity-50 self-start border border-red-500\"\n * ```\n */\nexport const generateButtonBaseContainerClassNames = ({\n size = DEFAULT_BUTTONBASE_PROPS.size,\n isDisabled,\n isFullWidth,\n twClassName = '',\n}: Partial<ButtonBaseProps>): string => {\n const baseStyle =\n 'flex-row items-center justify-center rounded-full bg-background-muted px-4';\n const sizeStyle = `h-[${size}px]`;\n const disabledStyle = isDisabled ? 'opacity-50' : 'opacity-100';\n const widthStyle = isFullWidth ? 'self-stretch' : 'self-start';\n const mergedClassnames = `${sizeStyle} ${baseStyle} ${disabledStyle} ${widthStyle} ${twClassName}`;\n return mergedClassnames;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export { default } from './ButtonBase';
2
+ export type { ButtonBaseProps } from './ButtonBase.types';
3
+ export { ButtonBaseSize } from './ButtonBase.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ButtonBaseSize = exports.default = void 0;
7
+ var ButtonBase_1 = require("./ButtonBase");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ButtonBase_1).default; } });
9
+ var ButtonBase_types_1 = require("./ButtonBase.types");
10
+ Object.defineProperty(exports, "ButtonBaseSize", { enumerable: true, get: function () { return ButtonBase_types_1.ButtonBaseSize; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAuC;AAA9B,sHAAA,OAAO,OAAA;AAEhB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA","sourcesContent":["export { default } from './ButtonBase';\nexport type { ButtonBaseProps } from './ButtonBase.types';\nexport { ButtonBaseSize } from './ButtonBase.types';\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { TextOrChildrenProps } from './TextOrChildren.types';
3
+ declare const TextOrChildren: ({ children, textProps }: TextOrChildrenProps) => React.JSX.Element;
4
+ export default TextOrChildren;
5
+ //# sourceMappingURL=TextOrChildren.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextOrChildren.d.ts","sourceRoot":"","sources":["../../../src/primitives/TextOrChildren/TextOrChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,QAAA,MAAM,cAAc,4BAA6B,mBAAmB,sBAKnE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const Text_1 = __importDefault(require("../../components/Text"));
8
+ const TextOrChildren = ({ children, textProps }) => {
9
+ if (typeof children === 'string') {
10
+ return <Text_1.default {...textProps}>{children}</Text_1.default>;
11
+ }
12
+ return <>{children}</>;
13
+ };
14
+ exports.default = TextOrChildren;
15
+ //# sourceMappingURL=TextOrChildren.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextOrChildren.js","sourceRoot":"","sources":["../../../src/primitives/TextOrChildren/TextOrChildren.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,iEAAyC;AAGzC,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAuB,EAAE,EAAE;IACtE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,CAAC,cAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAI,CAAC,CAAC;KAC/C;IACD,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzB,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC","sourcesContent":["import React from 'react';\n\nimport Text from '../../components/Text';\nimport type { TextOrChildrenProps } from './TextOrChildren.types';\n\nconst TextOrChildren = ({ children, textProps }: TextOrChildrenProps) => {\n if (typeof children === 'string') {\n return <Text {...textProps}>{children}</Text>;\n }\n return <>{children}</>;\n};\n\nexport default TextOrChildren;\n"]}
@@ -0,0 +1,15 @@
1
+ import type { TextProps } from '../../components/Text/Text.types';
2
+ /**
3
+ * TextOrChildren component props.
4
+ */
5
+ export type TextOrChildrenProps = {
6
+ /**
7
+ * Required prop for the content to be rendered
8
+ */
9
+ children: React.ReactNode | string;
10
+ /**
11
+ * Optional props to be passed to the Text component when children is a string
12
+ */
13
+ textProps?: Omit<Partial<TextProps>, 'children'>;
14
+ };
15
+ //# sourceMappingURL=TextOrChildren.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextOrChildren.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/TextOrChildren/TextOrChildren.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;CAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TextOrChildren.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextOrChildren.types.js","sourceRoot":"","sources":["../../../src/primitives/TextOrChildren/TextOrChildren.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../../components/Text/Text.types';\n\n/**\n * TextOrChildren component props.\n */\nexport type TextOrChildrenProps = {\n /**\n * Required prop for the content to be rendered\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ import type { SpinnerProps } from './Spinner.types';
2
+ export declare const DEFAULT_SPINNER_PROPS: Partial<SpinnerProps>;
3
+ //# sourceMappingURL=Spinner.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.constants.d.ts","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,YAAY,CAavD,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_SPINNER_PROPS = void 0;
4
+ const Icon_1 = require("../../components/Icon");
5
+ const Text_1 = require("../../components/Text");
6
+ // Defaults
7
+ exports.DEFAULT_SPINNER_PROPS = {
8
+ color: Icon_1.IconColor.IconDefault,
9
+ spinnerIconProps: {
10
+ size: Icon_1.IconSize.Md,
11
+ testID: 'spinner-icon',
12
+ },
13
+ loadingText: 'Loading',
14
+ loadingTextProps: {
15
+ variant: Text_1.TextVariant.BodyMd,
16
+ color: Text_1.TextColor.TextDefault,
17
+ testID: 'spinner-text',
18
+ },
19
+ twClassName: '',
20
+ };
21
+ //# sourceMappingURL=Spinner.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.constants.js","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.constants.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,gDAA+D;AAG/D,WAAW;AACE,QAAA,qBAAqB,GAA0B;IAC1D,KAAK,EAAE,gBAAS,CAAC,WAAW;IAC5B,gBAAgB,EAAE;QAChB,IAAI,EAAE,eAAQ,CAAC,EAAE;QACjB,MAAM,EAAE,cAAc;KACvB;IACD,WAAW,EAAE,SAAS;IACtB,gBAAgB,EAAE;QAChB,OAAO,EAAE,kBAAW,CAAC,MAAM;QAC3B,KAAK,EAAE,gBAAS,CAAC,WAAW;QAC5B,MAAM,EAAE,cAAc;KACvB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC","sourcesContent":["import { IconColor, IconSize } from '../../components/Icon';\nimport { TextVariant, TextColor } from '../../components/Text';\nimport type { SpinnerProps } from './Spinner.types';\n\n// Defaults\nexport const DEFAULT_SPINNER_PROPS: Partial<SpinnerProps> = {\n color: IconColor.IconDefault,\n spinnerIconProps: {\n size: IconSize.Md,\n testID: 'spinner-icon',\n },\n loadingText: 'Loading',\n loadingTextProps: {\n variant: TextVariant.BodyMd,\n color: TextColor.TextDefault,\n testID: 'spinner-text',\n },\n twClassName: '',\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { SpinnerProps } from './Spinner.types';
3
+ declare const Spinner: ({ color, spinnerIconProps, loadingText, loadingTextProps, twClassName, ...props }: SpinnerProps) => React.JSX.Element;
4
+ export default Spinner;
5
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAezC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,QAAA,MAAM,OAAO,sFAOV,YAAY,sBA4Cd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,68 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
30
+ const react_1 = __importStar(require("react"));
31
+ const react_native_1 = require("react-native");
32
+ const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
33
+ const Icon_1 = __importStar(require("../../components/Icon"));
34
+ const Text_1 = __importDefault(require("../../components/Text"));
35
+ const Spinner_constants_1 = require("./Spinner.constants");
36
+ const Spinner = ({ color = Spinner_constants_1.DEFAULT_SPINNER_PROPS.color, spinnerIconProps, loadingText, loadingTextProps, twClassName = '', ...props }) => {
37
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
38
+ // Create a shared value for rotation
39
+ const rotation = (0, react_native_reanimated_1.useSharedValue)(0);
40
+ // Start the animation when the component mounts
41
+ (0, react_1.useEffect)(() => {
42
+ rotation.value = (0, react_native_reanimated_1.withRepeat)((0, react_native_reanimated_1.withTiming)(360, { duration: 1000, easing: react_native_reanimated_1.Easing.linear }), // Complete a full spin in 1 second
43
+ -1, // Infinite repetitions
44
+ false);
45
+ }, []);
46
+ // Define the animated style
47
+ const animatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
48
+ transform: [{ rotate: `${rotation.value % 360}deg` }],
49
+ }));
50
+ const finalSpinnerIconProps = {
51
+ ...Spinner_constants_1.DEFAULT_SPINNER_PROPS.spinnerIconProps,
52
+ name: Icon_1.IconName.Loading,
53
+ color,
54
+ ...spinnerIconProps,
55
+ };
56
+ const finalLoadingTextProps = {
57
+ ...Spinner_constants_1.DEFAULT_SPINNER_PROPS.loadingTextProps,
58
+ ...loadingTextProps,
59
+ };
60
+ return (<react_native_1.View style={tw `flex-row gap-x-2 items-center ${twClassName}`} testID="spinner" {...props}>
61
+ <react_native_reanimated_1.default.View style={[animatedStyle]} testID="spinner-animated-view">
62
+ <Icon_1.default {...finalSpinnerIconProps}/>
63
+ </react_native_reanimated_1.default.View>
64
+ {loadingText && <Text_1.default {...finalLoadingTextProps}>{loadingText}</Text_1.default>}
65
+ </react_native_1.View>);
66
+ };
67
+ exports.default = Spinner;
68
+ //# sourceMappingURL=Spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAyC;AACzC,+CAAoC;AACpC,mFAMiC;AAGjC,8DAAuD;AAEvD,iEAAyC;AACzC,2DAA4D;AAG5D,MAAM,OAAO,GAAG,CAAC,EACf,KAAK,GAAG,yCAAqB,CAAC,KAAK,EACnC,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACK,EAAE,EAAE;IACjB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,qCAAqC;IACrC,MAAM,QAAQ,GAAG,IAAA,wCAAc,EAAC,CAAC,CAAC,CAAC;IAEnC,gDAAgD;IAChD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,KAAK,GAAG,IAAA,oCAAU,EACzB,IAAA,oCAAU,EAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,gCAAM,CAAC,MAAM,EAAE,CAAC,EAAE,mCAAmC;QAC/F,CAAC,CAAC,EAAE,uBAAuB;QAC3B,KAAK,CACN,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,4BAA4B;IAC5B,MAAM,aAAa,GAAG,IAAA,0CAAgB,EAAC,GAAG,EAAE,CAAC,CAAC;QAC5C,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,GAAG,GAAG,KAAK,EAAE,CAAC;KACtD,CAAC,CAAC,CAAC;IAEJ,MAAM,qBAAqB,GAAc;QACvC,GAAG,yCAAqB,CAAC,gBAAgB;QACzC,IAAI,EAAE,eAAQ,CAAC,OAAO;QACtB,KAAK;QACL,GAAG,gBAAgB;KACpB,CAAC;IAEF,MAAM,qBAAqB,GAAuB;QAChD,GAAG,yCAAqB,CAAC,gBAAgB;QACzC,GAAG,gBAAgB;KACpB,CAAC;IAEF,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,EAAE,CAAA,iCAAiC,WAAW,EAAE,CAAC,CACxD,MAAM,CAAC,SAAS,CAChB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,iCAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,uBAAuB,CACnE;QAAA,CAAC,cAAI,CAAC,IAAI,qBAAqB,CAAC,EAClC;MAAA,EAAE,iCAAQ,CAAC,IAAI,CACf;MAAA,CAAC,WAAW,IAAI,CAAC,cAAI,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,cAAI,CAAC,CACvE;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useEffect } from 'react';\nimport { View } from 'react-native';\nimport Animated, {\n useSharedValue,\n useAnimatedStyle,\n withRepeat,\n withTiming,\n Easing,\n} from 'react-native-reanimated';\n\nimport type { IconProps } from '../../components/Icon';\nimport Icon, { IconName } from '../../components/Icon';\nimport type { TextProps } from '../../components/Text';\nimport Text from '../../components/Text';\nimport { DEFAULT_SPINNER_PROPS } from './Spinner.constants';\nimport type { SpinnerProps } from './Spinner.types';\n\nconst Spinner = ({\n color = DEFAULT_SPINNER_PROPS.color,\n spinnerIconProps,\n loadingText,\n loadingTextProps,\n twClassName = '',\n ...props\n}: SpinnerProps) => {\n const tw = useTailwind();\n\n // Create a shared value for rotation\n const rotation = useSharedValue(0);\n\n // Start the animation when the component mounts\n useEffect(() => {\n rotation.value = withRepeat(\n withTiming(360, { duration: 1000, easing: Easing.linear }), // Complete a full spin in 1 second\n -1, // Infinite repetitions\n false, // Do not reverse the animation\n );\n }, []);\n\n // Define the animated style\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotation.value % 360}deg` }],\n }));\n\n const finalSpinnerIconProps: IconProps = {\n ...DEFAULT_SPINNER_PROPS.spinnerIconProps,\n name: IconName.Loading,\n color,\n ...spinnerIconProps,\n };\n\n const finalLoadingTextProps: Partial<TextProps> = {\n ...DEFAULT_SPINNER_PROPS.loadingTextProps,\n ...loadingTextProps,\n };\n\n return (\n <View\n style={tw`flex-row gap-x-2 items-center ${twClassName}`}\n testID=\"spinner\"\n {...props}\n >\n <Animated.View style={[animatedStyle]} testID=\"spinner-animated-view\">\n <Icon {...finalSpinnerIconProps} />\n </Animated.View>\n {loadingText && <Text {...finalLoadingTextProps}>{loadingText}</Text>}\n </View>\n );\n};\n\nexport default Spinner;\n"]}
@@ -0,0 +1,30 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { IconProps, IconColor } from '../../components/Icon';
3
+ import type { TextProps } from '../../components/Text/Text.types';
4
+ /**
5
+ * Spinner component props.
6
+ */
7
+ export type SpinnerProps = {
8
+ /**
9
+ * Optional prop that sets the color of the spinner icon using predefined theme colors
10
+ * @default IconColor.IconDefault
11
+ */
12
+ color?: IconColor;
13
+ /**
14
+ * Optional props to be passed to the loadingText element
15
+ */
16
+ spinnerIconProps?: Partial<IconProps>;
17
+ /**
18
+ * Optional text to display on the right of the spinner, providing additional context or information about the loading state.
19
+ */
20
+ loadingText?: string;
21
+ /**
22
+ * Optional props to be passed to the loadingText element
23
+ */
24
+ loadingTextProps?: Omit<Partial<TextProps>, 'children'>;
25
+ /**
26
+ * Optional prop to add twrnc overriding classNames.
27
+ */
28
+ twClassName?: string;
29
+ } & ViewProps;
30
+ //# sourceMappingURL=Spinner.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.types.d.ts","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Spinner.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.types.js","sourceRoot":"","sources":["../../../src/temp-components/Spinner/Spinner.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from 'react-native';\n\nimport type { IconProps, IconColor } from '../../components/Icon';\nimport type { TextProps } from '../../components/Text/Text.types';\n\n/**\n * Spinner component props.\n */\nexport type SpinnerProps = {\n /**\n * Optional prop that sets the color of the spinner icon using predefined theme colors\n * @default IconColor.IconDefault\n */\n color?: IconColor;\n /**\n * Optional props to be passed to the loadingText element\n */\n spinnerIconProps?: Partial<IconProps>;\n /**\n * Optional text to display on the right of the spinner, providing additional context or information about the loading state.\n */\n loadingText?: string;\n /**\n * Optional props to be passed to the loadingText element\n */\n loadingTextProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Spinner';
2
+ export type { SpinnerProps } from './Spinner.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/temp-components/Spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var Spinner_1 = require("./Spinner");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Spinner_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/temp-components/Spinner/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAoC;AAA3B,mHAAA,OAAO,OAAA","sourcesContent":["export { default } from './Spinner';\nexport type { SpinnerProps } from './Spinner.types';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/design-system-react-native",
3
- "version": "0.0.0-preview.f4da8f1",
3
+ "version": "0.0.0-preview.fbd1fe9",
4
4
  "description": "Design System React Native",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -31,9 +31,10 @@
31
31
  "dist/"
32
32
  ],
33
33
  "scripts": {
34
- "build": "rm -rf tsconfig.build.tsbuildinfo dist && tsc --project tsconfig.build.json",
34
+ "build": "node scripts/build.js",
35
35
  "changelog:update": "../../scripts/update-changelog.sh @metamask/design-system-react-native",
36
36
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/design-system-react-native",
37
+ "generate-icons": "ts-node scripts/generate-icons.ts",
37
38
  "publish:preview": "yarn npm publish --tag preview",
38
39
  "since-latest-release": "../../scripts/since-latest-release.sh",
39
40
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
@@ -42,28 +43,33 @@
42
43
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
43
44
  },
44
45
  "dependencies": {
45
- "@metamask-previews/design-system-twrnc-preset": "0.0.0-preview.f4da8f1",
46
- "@types/react": "^18.2.0",
46
+ "@metamask-previews/design-system-twrnc-preset": "0.0.0-preview.fbd1fe9",
47
47
  "react": "^18.2.0",
48
- "react-native": "^0.72.15"
48
+ "react-native": "^0.72.15",
49
+ "react-native-reanimated": "3.3.0"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@babel/core": "^7.23.5",
52
53
  "@babel/preset-env": "^7.26.0",
53
54
  "@babel/preset-react": "^7.25.9",
54
55
  "@babel/preset-typescript": "^7.23.3",
55
- "@metamask/auto-changelog": "^3.4.4",
56
+ "@metamask/auto-changelog": "^4.1.0",
56
57
  "@storybook/react-native": "6.5",
57
58
  "@testing-library/react-native": "^12.8.1",
58
59
  "@types/babel__preset-env": "^7",
59
60
  "@types/jest": "^27.4.1",
61
+ "@types/node": "^16.18.54",
62
+ "@types/react": "^18.2.0",
60
63
  "@types/react-test-renderer": "^18",
61
64
  "babel-jest": "^29.7.0",
62
65
  "deepmerge": "^4.2.2",
63
66
  "jest": "^29.7.0",
64
67
  "metro-react-native-babel-preset": "^0.77.0",
68
+ "react-native-svg": "^15.10.1",
69
+ "react-native-svg-transformer": "^1.5.0",
65
70
  "react-test-renderer": "^18.3.1",
66
71
  "ts-jest": "^29.2.5",
72
+ "ts-node": "^10.9.1",
67
73
  "typescript": "~5.2.2"
68
74
  },
69
75
  "engines": {