@metamask-previews/design-system-react-native 0.0.0-preview.bf69b6b → 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 (226) 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.map +1 -0
  98. package/dist/components/Icon/Icon.assets.js.map +1 -0
  99. package/dist/components/{Icons/Icon → Icon}/Icon.constants.d.ts +0 -2
  100. package/dist/components/Icon/Icon.constants.d.ts.map +1 -0
  101. package/dist/components/Icon/Icon.constants.js +15 -0
  102. package/dist/components/Icon/Icon.constants.js.map +1 -0
  103. package/dist/components/Icon/Icon.d.ts +5 -0
  104. package/dist/components/Icon/Icon.d.ts.map +1 -0
  105. package/dist/components/{Icons/Icon → Icon}/Icon.js +10 -6
  106. package/dist/components/Icon/Icon.js.map +1 -0
  107. package/dist/components/{Icons/Icon → Icon}/Icon.types.d.ts +42 -30
  108. package/dist/components/Icon/Icon.types.d.ts.map +1 -0
  109. package/dist/components/{Icons/Icon → Icon}/Icon.types.js +42 -30
  110. package/dist/components/Icon/Icon.types.js.map +1 -0
  111. package/dist/components/Icon/Icon.utilities.d.ts.map +1 -0
  112. package/dist/components/{Icons/Icon → Icon}/Icon.utilities.js +1 -1
  113. package/dist/components/Icon/Icon.utilities.js.map +1 -0
  114. package/dist/components/Icon/index.d.ts.map +1 -0
  115. package/dist/components/Icon/index.js.map +1 -0
  116. package/dist/components/Text/Text.d.ts +3 -10
  117. package/dist/components/Text/Text.d.ts.map +1 -1
  118. package/dist/components/Text/Text.js +1 -1
  119. package/dist/components/Text/Text.js.map +1 -1
  120. package/dist/components/Text/Text.types.d.ts +39 -29
  121. package/dist/components/Text/Text.types.d.ts.map +1 -1
  122. package/dist/components/Text/Text.types.js +39 -29
  123. package/dist/components/Text/Text.types.js.map +1 -1
  124. package/dist/components/Text/Text.utilities.js +1 -1
  125. package/dist/components/Text/Text.utilities.js.map +1 -1
  126. package/dist/components/Text/index.d.ts +1 -0
  127. package/dist/components/Text/index.d.ts.map +1 -1
  128. package/dist/components/Text/index.js.map +1 -1
  129. package/dist/components/TextButton/TextButton.constants.d.ts +3 -0
  130. package/dist/components/TextButton/TextButton.constants.d.ts.map +1 -0
  131. package/dist/components/TextButton/TextButton.constants.js +29 -0
  132. package/dist/components/TextButton/TextButton.constants.js.map +1 -0
  133. package/dist/components/TextButton/TextButton.d.ts +5 -0
  134. package/dist/components/TextButton/TextButton.d.ts.map +1 -0
  135. package/dist/components/TextButton/TextButton.js +187 -0
  136. package/dist/components/TextButton/TextButton.js.map +1 -0
  137. package/dist/components/TextButton/TextButton.types.d.ts +73 -0
  138. package/dist/components/TextButton/TextButton.types.d.ts.map +1 -0
  139. package/dist/components/TextButton/TextButton.types.js +3 -0
  140. package/dist/components/TextButton/TextButton.types.js.map +1 -0
  141. package/dist/components/TextButton/TextButton.utilities.d.ts +55 -0
  142. package/dist/components/TextButton/TextButton.utilities.d.ts.map +1 -0
  143. package/dist/components/TextButton/TextButton.utilities.js +77 -0
  144. package/dist/components/TextButton/TextButton.utilities.js.map +1 -0
  145. package/dist/components/TextButton/index.d.ts +3 -0
  146. package/dist/components/TextButton/index.d.ts.map +1 -0
  147. package/dist/components/TextButton/index.js +9 -0
  148. package/dist/components/TextButton/index.js.map +1 -0
  149. package/dist/index.d.ts +2 -2
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/primitives/ButtonAnimated/ButtonAnimated.d.ts +5 -0
  152. package/dist/primitives/ButtonAnimated/ButtonAnimated.d.ts.map +1 -0
  153. package/dist/primitives/ButtonAnimated/ButtonAnimated.js +58 -0
  154. package/dist/primitives/ButtonAnimated/ButtonAnimated.js.map +1 -0
  155. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.d.ts +6 -0
  156. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.d.ts.map +1 -0
  157. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.js +3 -0
  158. package/dist/primitives/ButtonAnimated/ButtonAnimated.types.js.map +1 -0
  159. package/dist/primitives/ButtonAnimated/index.d.ts +2 -0
  160. package/dist/primitives/ButtonAnimated/index.d.ts.map +1 -0
  161. package/dist/primitives/ButtonAnimated/index.js +9 -0
  162. package/dist/primitives/ButtonAnimated/index.js.map +1 -0
  163. package/dist/primitives/ButtonBase/ButtonBase.constants.d.ts +3 -0
  164. package/dist/primitives/ButtonBase/ButtonBase.constants.d.ts.map +1 -0
  165. package/dist/primitives/ButtonBase/ButtonBase.constants.js +32 -0
  166. package/dist/primitives/ButtonBase/ButtonBase.constants.js.map +1 -0
  167. package/dist/primitives/ButtonBase/ButtonBase.d.ts +5 -0
  168. package/dist/primitives/ButtonBase/ButtonBase.d.ts.map +1 -0
  169. package/dist/primitives/ButtonBase/ButtonBase.js +84 -0
  170. package/dist/primitives/ButtonBase/ButtonBase.js.map +1 -0
  171. package/dist/primitives/ButtonBase/ButtonBase.types.d.ts +93 -0
  172. package/dist/primitives/ButtonBase/ButtonBase.types.d.ts.map +1 -0
  173. package/dist/primitives/ButtonBase/ButtonBase.types.js +19 -0
  174. package/dist/primitives/ButtonBase/ButtonBase.types.js.map +1 -0
  175. package/dist/primitives/ButtonBase/ButtonBase.utilities.d.ts +28 -0
  176. package/dist/primitives/ButtonBase/ButtonBase.utilities.d.ts.map +1 -0
  177. package/dist/primitives/ButtonBase/ButtonBase.utilities.js +41 -0
  178. package/dist/primitives/ButtonBase/ButtonBase.utilities.js.map +1 -0
  179. package/dist/primitives/ButtonBase/index.d.ts +4 -0
  180. package/dist/primitives/ButtonBase/index.d.ts.map +1 -0
  181. package/dist/primitives/ButtonBase/index.js +11 -0
  182. package/dist/primitives/ButtonBase/index.js.map +1 -0
  183. package/dist/primitives/TextOrChildren/TextOrChildren.d.ts +5 -0
  184. package/dist/primitives/TextOrChildren/TextOrChildren.d.ts.map +1 -0
  185. package/dist/primitives/TextOrChildren/TextOrChildren.js +15 -0
  186. package/dist/primitives/TextOrChildren/TextOrChildren.js.map +1 -0
  187. package/dist/primitives/TextOrChildren/TextOrChildren.types.d.ts +15 -0
  188. package/dist/primitives/TextOrChildren/TextOrChildren.types.d.ts.map +1 -0
  189. package/dist/primitives/TextOrChildren/TextOrChildren.types.js +3 -0
  190. package/dist/primitives/TextOrChildren/TextOrChildren.types.js.map +1 -0
  191. package/dist/temp-components/Spinner/Spinner.constants.d.ts +3 -0
  192. package/dist/temp-components/Spinner/Spinner.constants.d.ts.map +1 -0
  193. package/dist/temp-components/Spinner/Spinner.constants.js +21 -0
  194. package/dist/temp-components/Spinner/Spinner.constants.js.map +1 -0
  195. package/dist/temp-components/Spinner/Spinner.d.ts +5 -0
  196. package/dist/temp-components/Spinner/Spinner.d.ts.map +1 -0
  197. package/dist/temp-components/Spinner/Spinner.js +68 -0
  198. package/dist/temp-components/Spinner/Spinner.js.map +1 -0
  199. package/dist/temp-components/Spinner/Spinner.types.d.ts +30 -0
  200. package/dist/temp-components/Spinner/Spinner.types.d.ts.map +1 -0
  201. package/dist/temp-components/Spinner/Spinner.types.js +3 -0
  202. package/dist/temp-components/Spinner/Spinner.types.js.map +1 -0
  203. package/dist/temp-components/Spinner/index.d.ts +3 -0
  204. package/dist/temp-components/Spinner/index.d.ts.map +1 -0
  205. package/dist/temp-components/Spinner/index.js +9 -0
  206. package/dist/temp-components/Spinner/index.js.map +1 -0
  207. package/package.json +5 -4
  208. package/dist/components/Icons/Icon/Icon.assets.d.ts.map +0 -1
  209. package/dist/components/Icons/Icon/Icon.assets.js.map +0 -1
  210. package/dist/components/Icons/Icon/Icon.constants.d.ts.map +0 -1
  211. package/dist/components/Icons/Icon/Icon.constants.js +0 -39
  212. package/dist/components/Icons/Icon/Icon.constants.js.map +0 -1
  213. package/dist/components/Icons/Icon/Icon.d.ts +0 -9
  214. package/dist/components/Icons/Icon/Icon.d.ts.map +0 -1
  215. package/dist/components/Icons/Icon/Icon.js.map +0 -1
  216. package/dist/components/Icons/Icon/Icon.types.d.ts.map +0 -1
  217. package/dist/components/Icons/Icon/Icon.types.js.map +0 -1
  218. package/dist/components/Icons/Icon/Icon.utilities.d.ts.map +0 -1
  219. package/dist/components/Icons/Icon/Icon.utilities.js.map +0 -1
  220. package/dist/components/Icons/Icon/index.d.ts.map +0 -1
  221. package/dist/components/Icons/Icon/index.js.map +0 -1
  222. /package/dist/components/{Icons/Icon → Icon}/Icon.assets.d.ts +0 -0
  223. /package/dist/components/{Icons/Icon → Icon}/Icon.assets.js +0 -0
  224. /package/dist/components/{Icons/Icon → Icon}/Icon.utilities.d.ts +0 -0
  225. /package/dist/components/{Icons/Icon → Icon}/index.d.ts +0 -0
  226. /package/dist/components/{Icons/Icon → Icon}/index.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextButton.types.js","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport type { TextProps } from 'src/components/Text/Text.types';\n\nimport type { SpinnerProps } from '../../temp-components/Spinner';\nimport type { IconProps, IconName } from '../Icon';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: 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 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 to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n * @default false\n */\n isInverse?: 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} & Omit<PressableProps, 'disabled'>;\n"]}
@@ -0,0 +1,55 @@
1
+ import type { TextButtonProps } from './TextButton.types';
2
+ /**
3
+ * Generates a Tailwind class name for the text button container based on its state and optional additional classes.
4
+ *
5
+ * This function computes the appropriate background class name for a text button's container, considering its
6
+ * `isPressed` and `isLoading` states. Additional Tailwind class names can also be appended using the `twClassName` parameter.
7
+ *
8
+ * @param isPressed - Indicates whether the button is currently being pressed.
9
+ * @param isLoading - Indicates whether the button is in a loading state.
10
+ * @param isDisabled - Indicates whether the button is in a disabled state.
11
+ * @param twClassName - Additional Tailwind class names for customization.
12
+ * @returns A combined string of Tailwind class names for the container's background styling.
13
+ *
14
+ * Example:
15
+ * ```
16
+ * const classNames = generateTextButtonContainerClassNames({
17
+ * isPressed: true,
18
+ * isLoading: false,
19
+ * twClassName: 'rounded-full',
20
+ * });
21
+ *
22
+ * console.log(classNames);
23
+ * // Output: "bg-background-pressed rounded-full"
24
+ * ```
25
+ */
26
+ export declare const generateTextButtonContainerClassNames: ({ isPressed, isLoading, isDisabled, twClassName, }: Partial<TextButtonProps> & {
27
+ isPressed?: boolean | undefined;
28
+ }) => string;
29
+ /**
30
+ * Generates a Tailwind class name for the text button's text based on its state.
31
+ *
32
+ * This function computes the appropriate text color and style class names for a text button,
33
+ * considering its `isPressed`, `isInverse`, and `isLoading` states.
34
+ *
35
+ * @param isPressed - Indicates whether the button is currently being pressed.
36
+ * @param isInverse - Indicates whether the button is using an "inverse" theme.
37
+ * @param isLoading - Indicates whether the button is in a loading state.
38
+ * @returns A combined string of Tailwind class names for the text's color and style.
39
+ *
40
+ * Example:
41
+ * ```
42
+ * const classNames = generateTextButtonTextClassNames({
43
+ * isPressed: true,
44
+ * isInverse: false,
45
+ * isLoading: false,
46
+ * });
47
+ *
48
+ * console.log(classNames);
49
+ * // Output: "text-primary-defaultPressed underline"
50
+ * ```
51
+ */
52
+ export declare const generateTextButtonTextClassNames: ({ isPressed, isInverse, isLoading, }: Partial<TextButtonProps> & {
53
+ isPressed?: boolean | undefined;
54
+ }) => string;
55
+ //# sourceMappingURL=TextButton.utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextButton.utilities.d.ts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.utilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,qCAAqC;;MAO9C,MAQH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gCAAgC;;MAMzC,MAeH,CAAC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateTextButtonTextClassNames = exports.generateTextButtonContainerClassNames = void 0;
4
+ /**
5
+ * Generates a Tailwind class name for the text button container based on its state and optional additional classes.
6
+ *
7
+ * This function computes the appropriate background class name for a text button's container, considering its
8
+ * `isPressed` and `isLoading` states. Additional Tailwind class names can also be appended using the `twClassName` parameter.
9
+ *
10
+ * @param isPressed - Indicates whether the button is currently being pressed.
11
+ * @param isLoading - Indicates whether the button is in a loading state.
12
+ * @param isDisabled - Indicates whether the button is in a disabled state.
13
+ * @param twClassName - Additional Tailwind class names for customization.
14
+ * @returns A combined string of Tailwind class names for the container's background styling.
15
+ *
16
+ * Example:
17
+ * ```
18
+ * const classNames = generateTextButtonContainerClassNames({
19
+ * isPressed: true,
20
+ * isLoading: false,
21
+ * twClassName: 'rounded-full',
22
+ * });
23
+ *
24
+ * console.log(classNames);
25
+ * // Output: "bg-background-pressed rounded-full"
26
+ * ```
27
+ */
28
+ const generateTextButtonContainerClassNames = ({ isPressed = false, isLoading = false, isDisabled = false, twClassName = '', }) => {
29
+ const isPressedOrLoading = isPressed || isLoading;
30
+ const backgroundStyle = isPressedOrLoading
31
+ ? 'bg-background-pressed'
32
+ : 'bg-transparent';
33
+ const opacityStyle = `opacity-${isDisabled ? 50 : 100}`;
34
+ return `${backgroundStyle} ${opacityStyle} ${twClassName}`;
35
+ };
36
+ exports.generateTextButtonContainerClassNames = generateTextButtonContainerClassNames;
37
+ /**
38
+ * Generates a Tailwind class name for the text button's text based on its state.
39
+ *
40
+ * This function computes the appropriate text color and style class names for a text button,
41
+ * considering its `isPressed`, `isInverse`, and `isLoading` states.
42
+ *
43
+ * @param isPressed - Indicates whether the button is currently being pressed.
44
+ * @param isInverse - Indicates whether the button is using an "inverse" theme.
45
+ * @param isLoading - Indicates whether the button is in a loading state.
46
+ * @returns A combined string of Tailwind class names for the text's color and style.
47
+ *
48
+ * Example:
49
+ * ```
50
+ * const classNames = generateTextButtonTextClassNames({
51
+ * isPressed: true,
52
+ * isInverse: false,
53
+ * isLoading: false,
54
+ * });
55
+ *
56
+ * console.log(classNames);
57
+ * // Output: "text-primary-defaultPressed underline"
58
+ * ```
59
+ */
60
+ const generateTextButtonTextClassNames = ({ isPressed = false, isInverse = false, isLoading = false, }) => {
61
+ let textColor, textStyle;
62
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
63
+ const isPressedOrLoading = isPressed || isLoading;
64
+ if (isInverse) {
65
+ textColor = 'text-primary-inverse';
66
+ textStyle = 'underline';
67
+ }
68
+ else {
69
+ textColor = isPressedOrLoading
70
+ ? 'text-primary-defaultPressed'
71
+ : 'text-primary-default';
72
+ textStyle = isPressedOrLoading ? 'underline' : 'no-underline';
73
+ }
74
+ return `${textColor} ${textStyle}`;
75
+ };
76
+ exports.generateTextButtonTextClassNames = generateTextButtonTextClassNames;
77
+ //# sourceMappingURL=TextButton.utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextButton.utilities.js","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.utilities.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,MAAM,qCAAqC,GAAG,CAAC,EACpD,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,EAAE,GAGjB,EAAU,EAAE;IACX,MAAM,kBAAkB,GAAG,SAAS,IAAI,SAAS,CAAC;IAClD,MAAM,eAAe,GAAG,kBAAkB;QACxC,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,gBAAgB,CAAC;IACrB,MAAM,YAAY,GAAG,WAAW,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAExD,OAAO,GAAG,eAAe,IAAI,YAAY,IAAI,WAAW,EAAE,CAAC;AAC7D,CAAC,CAAC;AAfW,QAAA,qCAAqC,yCAehD;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,gCAAgC,GAAG,CAAC,EAC/C,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,GAGlB,EAAU,EAAE;IACX,IAAI,SAAS,EAAE,SAAS,CAAC;IACzB,wEAAwE;IACxE,MAAM,kBAAkB,GAAG,SAAS,IAAI,SAAS,CAAC;IAClD,IAAI,SAAS,EAAE;QACb,SAAS,GAAG,sBAAsB,CAAC;QACnC,SAAS,GAAG,WAAW,CAAC;KACzB;SAAM;QACL,SAAS,GAAG,kBAAkB;YAC5B,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,sBAAsB,CAAC;QAC3B,SAAS,GAAG,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;KAC/D;IAED,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;AACrC,CAAC,CAAC;AArBW,QAAA,gCAAgC,oCAqB3C","sourcesContent":["/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable jsdoc/require-param */\nimport type { TextButtonProps } from './TextButton.types';\n\n/**\n * Generates a Tailwind class name for the text button container based on its state and optional additional classes.\n *\n * This function computes the appropriate background class name for a text button's container, considering its\n * `isPressed` and `isLoading` states. Additional Tailwind class names can also be appended using the `twClassName` parameter.\n *\n * @param isPressed - Indicates whether the button is currently being pressed.\n * @param isLoading - Indicates whether the button is in a loading state.\n * @param isDisabled - Indicates whether the button is in a disabled state.\n * @param twClassName - Additional Tailwind class names for customization.\n * @returns A combined string of Tailwind class names for the container's background styling.\n *\n * Example:\n * ```\n * const classNames = generateTextButtonContainerClassNames({\n * isPressed: true,\n * isLoading: false,\n * twClassName: 'rounded-full',\n * });\n *\n * console.log(classNames);\n * // Output: \"bg-background-pressed rounded-full\"\n * ```\n */\nexport const generateTextButtonContainerClassNames = ({\n isPressed = false,\n isLoading = false,\n isDisabled = false,\n twClassName = '',\n}: Partial<TextButtonProps> & {\n isPressed?: boolean;\n}): string => {\n const isPressedOrLoading = isPressed || isLoading;\n const backgroundStyle = isPressedOrLoading\n ? 'bg-background-pressed'\n : 'bg-transparent';\n const opacityStyle = `opacity-${isDisabled ? 50 : 100}`;\n\n return `${backgroundStyle} ${opacityStyle} ${twClassName}`;\n};\n\n/**\n * Generates a Tailwind class name for the text button's text based on its state.\n *\n * This function computes the appropriate text color and style class names for a text button,\n * considering its `isPressed`, `isInverse`, and `isLoading` states.\n *\n * @param isPressed - Indicates whether the button is currently being pressed.\n * @param isInverse - Indicates whether the button is using an \"inverse\" theme.\n * @param isLoading - Indicates whether the button is in a loading state.\n * @returns A combined string of Tailwind class names for the text's color and style.\n *\n * Example:\n * ```\n * const classNames = generateTextButtonTextClassNames({\n * isPressed: true,\n * isInverse: false,\n * isLoading: false,\n * });\n *\n * console.log(classNames);\n * // Output: \"text-primary-defaultPressed underline\"\n * ```\n */\nexport const generateTextButtonTextClassNames = ({\n isPressed = false,\n isInverse = false,\n isLoading = false,\n}: Partial<TextButtonProps> & {\n isPressed?: boolean;\n}): string => {\n let textColor, textStyle;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const isPressedOrLoading = isPressed || isLoading;\n if (isInverse) {\n textColor = 'text-primary-inverse';\n textStyle = 'underline';\n } else {\n textColor = isPressedOrLoading\n ? 'text-primary-defaultPressed'\n : 'text-primary-default';\n textStyle = isPressedOrLoading ? 'underline' : 'no-underline';\n }\n\n return `${textColor} ${textStyle}`;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './TextButton';
2
+ export type { TextButtonProps } from './TextButton.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,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 TextButton_1 = require("./TextButton");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(TextButton_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAuC;AAA9B,sHAAA,OAAO,OAAA","sourcesContent":["export { default } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export declare const Text: import("react").ForwardRefExoticComponent<Omit<{
1
+ export declare const Text: import("react").ForwardRefExoticComponent<{
2
2
  variant?: import("./components/Text").TextVariant | undefined;
3
3
  children: import("react").ReactNode;
4
4
  color?: import("./components/Text").TextColor | undefined;
5
5
  fontWeight?: import("./components/Text").FontWeight | undefined;
6
6
  fontStyle?: import("./components/Text").FontStyle | undefined;
7
7
  twClassName?: string | undefined;
8
- } & import("react-native").TextProps & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<any>>;
8
+ } & import("react-native").TextProps & import("react").RefAttributes<any>>;
9
9
  export { TextVariant, TextColor, FontWeight, FontStyle, } from './components/Text';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;uHAAmC,CAAC;AACrD,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;0EAAmC,CAAC;AACrD,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ButtonAnimatedProps } from './ButtonAnimated.types';
3
+ declare const ButtonAnimated: ({ onPressIn, onPressOut, disabled, ...props }: ButtonAnimatedProps) => React.JSX.Element;
4
+ export default ButtonAnimated;
5
+ //# sourceMappingURL=ButtonAnimated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonAnimated.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/ButtonAnimated.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,QAAA,MAAM,cAAc,kDAKjB,mBAAmB,sBAoCrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,58 @@
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 react_1 = __importDefault(require("react"));
30
+ const react_native_1 = require("react-native");
31
+ const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
32
+ const ButtonAnimated = ({ onPressIn, onPressOut, disabled, ...props }) => {
33
+ const animation = (0, react_native_reanimated_1.useSharedValue)(1);
34
+ const scaleStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
35
+ return {
36
+ transform: [{ scale: animation.value }],
37
+ };
38
+ });
39
+ const onPressInHandler = (event) => {
40
+ animation.value = (0, react_native_reanimated_1.withTiming)(0.97, {
41
+ duration: 100,
42
+ easing: react_native_reanimated_1.Easing.bezier(0.3, 0.8, 0.3, 1),
43
+ });
44
+ onPressIn?.(event);
45
+ };
46
+ const onPressOutHandler = (event) => {
47
+ animation.value = (0, react_native_reanimated_1.withTiming)(1, {
48
+ duration: 100,
49
+ easing: react_native_reanimated_1.Easing.bezier(0.3, 0.8, 0.3, 1),
50
+ });
51
+ onPressOut?.(event);
52
+ };
53
+ return (<react_native_reanimated_1.default.View style={[scaleStyle, { alignItems: 'center', justifyContent: 'center' }]}>
54
+ <react_native_1.Pressable onPressIn={onPressInHandler} onPressOut={onPressOutHandler} disabled={disabled} {...props}/>
55
+ </react_native_reanimated_1.default.View>);
56
+ };
57
+ exports.default = ButtonAnimated;
58
+ //# sourceMappingURL=ButtonAnimated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonAnimated.js","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/ButtonAnimated.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAE1B,+CAAyC;AACzC,mFAKiC;AAIjC,MAAM,cAAc,GAAG,CAAC,EACtB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACY,EAAE,EAAE;IACxB,MAAM,SAAS,GAAG,IAAA,wCAAc,EAAC,CAAC,CAAC,CAAC;IACpC,MAAM,UAAU,GAAG,IAAA,0CAAgB,EAAC,GAAG,EAAE;QACvC,OAAO;YACL,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC;SACxC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;QACxD,SAAS,CAAC,KAAK,GAAG,IAAA,oCAAU,EAAC,IAAI,EAAE;YACjC,QAAQ,EAAE,GAAG;YACb,MAAM,EAAE,gCAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;SACxC,CAAC,CAAC;QACH,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;QACzD,SAAS,CAAC,KAAK,GAAG,IAAA,oCAAU,EAAC,CAAC,EAAE;YAC9B,QAAQ,EAAE,GAAG;YACb,MAAM,EAAE,gCAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;SACxC,CAAC,CAAC;QACH,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,iCAAQ,CAAC,IAAI,CACZ,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,CAExE;MAAA,CAAC,wBAAS,CACR,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAC9B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,IAAI,KAAK,CAAC,EAEd;IAAA,EAAE,iCAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC","sourcesContent":["import React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { Pressable } from 'react-native';\nimport Animated, {\n useSharedValue,\n useAnimatedStyle,\n withTiming,\n Easing,\n} from 'react-native-reanimated';\n\nimport type { ButtonAnimatedProps } from './ButtonAnimated.types';\n\nconst ButtonAnimated = ({\n onPressIn,\n onPressOut,\n disabled,\n ...props\n}: ButtonAnimatedProps) => {\n const animation = useSharedValue(1);\n const scaleStyle = useAnimatedStyle(() => {\n return {\n transform: [{ scale: animation.value }],\n };\n });\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n animation.value = withTiming(0.97, {\n duration: 100,\n easing: Easing.bezier(0.3, 0.8, 0.3, 1),\n });\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n animation.value = withTiming(1, {\n duration: 100,\n easing: Easing.bezier(0.3, 0.8, 0.3, 1),\n });\n onPressOut?.(event);\n };\n\n return (\n <Animated.View\n style={[scaleStyle, { alignItems: 'center', justifyContent: 'center' }]}\n >\n <Pressable\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n disabled={disabled}\n {...props}\n />\n </Animated.View>\n );\n};\n\nexport default ButtonAnimated;\n"]}
@@ -0,0 +1,6 @@
1
+ import type { PressableProps } from 'react-native';
2
+ /**
3
+ * ButtonAnimated component props.
4
+ */
5
+ export type ButtonAnimatedProps = PressableProps;
6
+ //# sourceMappingURL=ButtonAnimated.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonAnimated.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/ButtonAnimated.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ButtonAnimated.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonAnimated.types.js","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/ButtonAnimated.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps } from 'react-native';\n\n/**\n * ButtonAnimated component props.\n */\nexport type ButtonAnimatedProps = PressableProps;\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './ButtonAnimated';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,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 ButtonAnimated_1 = require("./ButtonAnimated");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ButtonAnimated_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/ButtonAnimated/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA2C;AAAlC,0HAAA,OAAO,OAAA","sourcesContent":["export { default } from './ButtonAnimated';\n"]}
@@ -0,0 +1,3 @@
1
+ import type { ButtonBaseProps } from './ButtonBase.types';
2
+ export declare const DEFAULT_BUTTONBASE_PROPS: Pick<ButtonBaseProps, 'textProps' | 'size' | 'isLoading' | 'spinnerProps' | 'startIconProps' | 'endIconProps' | 'isDisabled' | 'isFullWidth'>;
3
+ //# sourceMappingURL=ButtonBase.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.constants.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,eAAO,MAAM,wBAAwB,EAAE,IAAI,CACzC,eAAe,EACb,WAAW,GACX,MAAM,GACN,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,aAAa,CAwBhB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_BUTTONBASE_PROPS = void 0;
4
+ const Icon_1 = require("../../components/Icon");
5
+ const Text_1 = require("../../components/Text");
6
+ const ButtonBase_types_1 = require("./ButtonBase.types");
7
+ // Defaults
8
+ exports.DEFAULT_BUTTONBASE_PROPS = {
9
+ textProps: {
10
+ variant: Text_1.TextVariant.BodyMd,
11
+ fontWeight: Text_1.FontWeight.Medium,
12
+ color: Text_1.TextColor.TextDefault,
13
+ numberOfLines: 1,
14
+ ellipsizeMode: 'clip',
15
+ },
16
+ size: ButtonBase_types_1.ButtonBaseSize.Lg,
17
+ isLoading: false,
18
+ spinnerProps: {
19
+ color: Icon_1.IconColor.IconDefault,
20
+ },
21
+ startIconProps: {
22
+ size: Icon_1.IconSize.Sm,
23
+ testID: 'start-icon',
24
+ },
25
+ endIconProps: {
26
+ size: Icon_1.IconSize.Sm,
27
+ testID: 'end-icon',
28
+ },
29
+ isDisabled: false,
30
+ isFullWidth: false,
31
+ };
32
+ //# sourceMappingURL=ButtonBase.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.constants.js","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,gDAA2E;AAE3E,yDAAoD;AAEpD,WAAW;AACE,QAAA,wBAAwB,GAUjC;IACF,SAAS,EAAE;QACT,OAAO,EAAE,kBAAW,CAAC,MAAM;QAC3B,UAAU,EAAE,iBAAU,CAAC,MAAM;QAC7B,KAAK,EAAE,gBAAS,CAAC,WAAW;QAC5B,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE,iCAAc,CAAC,EAAE;IACvB,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE;QACZ,KAAK,EAAE,gBAAS,CAAC,WAAW;KAC7B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,eAAQ,CAAC,EAAE;QACjB,MAAM,EAAE,YAAY;KACrB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,eAAQ,CAAC,EAAE;QACjB,MAAM,EAAE,UAAU;KACnB;IACD,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,KAAK;CACnB,CAAC","sourcesContent":["import { IconSize, IconColor } from '../../components/Icon';\nimport { TextColor, TextVariant, FontWeight } from '../../components/Text';\nimport type { ButtonBaseProps } from './ButtonBase.types';\nimport { ButtonBaseSize } from './ButtonBase.types';\n\n// Defaults\nexport const DEFAULT_BUTTONBASE_PROPS: Pick<\n ButtonBaseProps,\n | 'textProps'\n | 'size'\n | 'isLoading'\n | 'spinnerProps'\n | 'startIconProps'\n | 'endIconProps'\n | 'isDisabled'\n | 'isFullWidth'\n> = {\n textProps: {\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n },\n size: ButtonBaseSize.Lg,\n isLoading: false,\n spinnerProps: {\n color: IconColor.IconDefault,\n },\n startIconProps: {\n size: IconSize.Sm,\n testID: 'start-icon',\n },\n endIconProps: {\n size: IconSize.Sm,\n testID: 'end-icon',\n },\n isDisabled: false,\n isFullWidth: false,\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ButtonBaseProps } from './ButtonBase.types';
3
+ declare const ButtonBase: ({ children, textProps, size, isLoading, loadingText, spinnerProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, style, ...props }: ButtonBaseProps) => React.JSX.Element;
4
+ export default ButtonBase;
5
+ //# sourceMappingURL=ButtonBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAWvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,QAAA,MAAM,UAAU,uNAkBb,eAAe,sBAyEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,84 @@
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
+ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
30
+ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
31
+ const react_1 = __importStar(require("react"));
32
+ const react_native_1 = require("react-native");
33
+ const Icon_1 = __importDefault(require("../../components/Icon"));
34
+ const Spinner_1 = __importDefault(require("../../temp-components/Spinner"));
35
+ const ButtonAnimated_1 = __importDefault(require("../ButtonAnimated"));
36
+ const TextOrChildren_1 = __importDefault(require("../TextOrChildren/TextOrChildren"));
37
+ const ButtonBase_constants_1 = require("./ButtonBase.constants");
38
+ const ButtonBase_utilities_1 = require("./ButtonBase.utilities");
39
+ const ButtonBase = ({ children, textProps, size = ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.size, isLoading, loadingText, spinnerProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, style, ...props }) => {
40
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
41
+ const twContainerClassNames = (0, react_1.useMemo)(() => {
42
+ return (0, ButtonBase_utilities_1.generateButtonBaseContainerClassNames)({
43
+ size,
44
+ twClassName,
45
+ isLoading,
46
+ isDisabled,
47
+ isFullWidth,
48
+ });
49
+ }, [size, twClassName, isLoading, isDisabled, isFullWidth]);
50
+ const finalTextProps = {
51
+ ...ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.textProps,
52
+ ...textProps,
53
+ };
54
+ const finalStartIconName = startIconName ?? startIconProps?.name;
55
+ const finalStartIconProps = {
56
+ ...ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.startIconProps,
57
+ ...startIconProps,
58
+ };
59
+ const finalEndIconName = endIconName ?? endIconProps?.name;
60
+ const finalEndIconProps = {
61
+ ...ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.endIconProps,
62
+ ...endIconProps,
63
+ };
64
+ const finalSpinnerProps = {
65
+ ...ButtonBase_constants_1.DEFAULT_BUTTONBASE_PROPS.spinnerProps,
66
+ loadingText,
67
+ loadingTextProps: {
68
+ numberOfLines: 1,
69
+ },
70
+ ...spinnerProps,
71
+ };
72
+ return (<ButtonAnimated_1.default disabled={isDisabled || isLoading} accessibilityRole="button" accessible style={[tw `${twContainerClassNames}`, style]} {...props}>
73
+ <react_native_1.View style={tw `absolute inset-0 flex items-center justify-center ${isLoading ? 'opacity-100' : 'opacity-0'}`} testID="spinner-container">
74
+ <Spinner_1.default {...finalSpinnerProps}/>
75
+ </react_native_1.View>
76
+ <react_native_1.View style={tw `flex-row items-center justify-center gap-x-2 ${isLoading ? 'opacity-0' : 'opacity-100'}`} testID="content-container">
77
+ {finalStartIconName ? (<Icon_1.default name={finalStartIconName} {...finalStartIconProps}/>) : (startAccessory)}
78
+ <TextOrChildren_1.default textProps={finalTextProps}>{children}</TextOrChildren_1.default>
79
+ {finalEndIconName ? (<Icon_1.default name={finalEndIconName} {...finalEndIconProps}/>) : (endAccessory)}
80
+ </react_native_1.View>
81
+ </ButtonAnimated_1.default>);
82
+ };
83
+ exports.default = ButtonBase;
84
+ //# sourceMappingURL=ButtonBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/primitives/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAiE;AACjE,8FAA4E;AAC5E,+CAAuC;AACvC,+CAAoC;AAGpC,iEAAyC;AAGzC,4EAAoD;AACpD,uEAA+C;AAC/C,sFAA8D;AAC9D,iEAAkE;AAElE,iEAA+E;AAE/E,MAAM,UAAU,GAAG,CAAC,EAClB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,+CAAwB,CAAC,IAAI,EACpC,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,qBAAqB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACzC,OAAO,IAAA,4DAAqC,EAAC;YAC3C,IAAI;YACJ,WAAW;YACX,SAAS;YACT,UAAU;YACV,WAAW;SACZ,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5D,MAAM,cAAc,GAAyC;QAC3D,GAAG,+CAAwB,CAAC,SAAS;QACrC,GAAG,SAAS;KACb,CAAC;IACF,MAAM,kBAAkB,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;IACjE,MAAM,mBAAmB,GAAuB;QAC9C,GAAG,+CAAwB,CAAC,cAAc;QAC1C,GAAG,cAAc;KAClB,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;IAC3D,MAAM,iBAAiB,GAAuB;QAC5C,GAAG,+CAAwB,CAAC,YAAY;QACxC,GAAG,YAAY;KAChB,CAAC;IAEF,MAAM,iBAAiB,GAAiB;QACtC,GAAG,+CAAwB,CAAC,YAAY;QACxC,WAAW;QACX,gBAAgB,EAAE;YAChB,aAAa,EAAE,CAAC;SACjB;QACD,GAAG,YAAY;KAChB,CAAC;IAEF,OAAO,CACL,CAAC,wBAAc,CACb,QAAQ,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAClC,iBAAiB,CAAC,QAAQ,CAC1B,UAAU,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA,GAAG,qBAAqB,EAAE,EAAE,KAAK,CAAC,CAAC,CAC7C,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,EAAE,CAAA,qDACP,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAC9B,EAAE,CAAC,CACH,MAAM,CAAC,mBAAmB,CAE1B;QAAA,CAAC,iBAAO,CAAC,IAAI,iBAAiB,CAAC,EACjC;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,EAAE,CAAA,gDACP,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAC5B,EAAE,CAAC,CACH,MAAM,CAAC,mBAAmB,CAE1B;QAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACpB,CAAC,cAAI,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,CAAC,IAAI,mBAAmB,CAAC,EAAG,CAC5D,CAAC,CAAC,CAAC,CACF,cAAc,CACf,CACD;QAAA,CAAC,wBAAc,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,wBAAc,CACrE;QAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,cAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,iBAAiB,CAAC,EAAG,CACxD,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,wBAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\n\nimport type { IconProps } from '../../components/Icon';\nimport Icon from '../../components/Icon';\nimport type { TextProps } from '../../components/Text/Text.types';\nimport type { SpinnerProps } from '../../temp-components/Spinner';\nimport Spinner from '../../temp-components/Spinner';\nimport ButtonAnimated from '../ButtonAnimated';\nimport TextOrChildren from '../TextOrChildren/TextOrChildren';\nimport { DEFAULT_BUTTONBASE_PROPS } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\nimport { generateButtonBaseContainerClassNames } from './ButtonBase.utilities';\n\nconst ButtonBase = ({\n children,\n textProps,\n size = DEFAULT_BUTTONBASE_PROPS.size,\n isLoading,\n loadingText,\n spinnerProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n style,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n const twContainerClassNames = useMemo(() => {\n return generateButtonBaseContainerClassNames({\n size,\n twClassName,\n isLoading,\n isDisabled,\n isFullWidth,\n });\n }, [size, twClassName, isLoading, isDisabled, isFullWidth]);\n\n const finalTextProps: Omit<Partial<TextProps>, 'children'> = {\n ...DEFAULT_BUTTONBASE_PROPS.textProps,\n ...textProps,\n };\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalStartIconProps: Partial<IconProps> = {\n ...DEFAULT_BUTTONBASE_PROPS.startIconProps,\n ...startIconProps,\n };\n\n const finalEndIconName = endIconName ?? endIconProps?.name;\n const finalEndIconProps: Partial<IconProps> = {\n ...DEFAULT_BUTTONBASE_PROPS.endIconProps,\n ...endIconProps,\n };\n\n const finalSpinnerProps: SpinnerProps = {\n ...DEFAULT_BUTTONBASE_PROPS.spinnerProps,\n loadingText,\n loadingTextProps: {\n numberOfLines: 1,\n },\n ...spinnerProps,\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole=\"button\"\n accessible\n style={[tw`${twContainerClassNames}`, style]}\n {...props}\n >\n <View\n style={tw`absolute inset-0 flex items-center justify-center ${\n isLoading ? 'opacity-100' : 'opacity-0'\n }`}\n testID=\"spinner-container\"\n >\n <Spinner {...finalSpinnerProps} />\n </View>\n <View\n style={tw`flex-row items-center justify-center gap-x-2 ${\n isLoading ? 'opacity-0' : 'opacity-100'\n }`}\n testID=\"content-container\"\n >\n {finalStartIconName ? (\n <Icon name={finalStartIconName} {...finalStartIconProps} />\n ) : (\n startAccessory\n )}\n <TextOrChildren textProps={finalTextProps}>{children}</TextOrChildren>\n {finalEndIconName ? (\n <Icon name={finalEndIconName} {...finalEndIconProps} />\n ) : (\n endAccessory\n )}\n </View>\n </ButtonAnimated>\n );\n};\n\nexport default ButtonBase;\n"]}
@@ -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"]}