sapo-components-ui-rn 1.0.0

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 (215) hide show
  1. package/README.md +69 -0
  2. package/dist/assets/error.png +0 -0
  3. package/dist/assets/icon-checkbox-active.svg +4 -0
  4. package/dist/assets/icon-checkbox.svg +3 -0
  5. package/dist/assets/image_default.png +0 -0
  6. package/dist/assets/images/error.png +0 -0
  7. package/dist/assets/images/image_default.png +0 -0
  8. package/dist/assets/images/info.png +0 -0
  9. package/dist/assets/images/success.png +0 -0
  10. package/dist/assets/images/warning.png +0 -0
  11. package/dist/assets/info.png +0 -0
  12. package/dist/assets/success.png +0 -0
  13. package/dist/assets/svg/icon-checkbox-active.svg +4 -0
  14. package/dist/assets/svg/icon-checkbox.svg +3 -0
  15. package/dist/assets/warning.png +0 -0
  16. package/dist/components/ActivityIndicator.d.ts +28 -0
  17. package/dist/components/Avatar/index.d.ts +17 -0
  18. package/dist/components/Badge/index.d.ts +13 -0
  19. package/dist/components/Button/index.d.ts +23 -0
  20. package/dist/components/ButtonIcon/index.d.ts +18 -0
  21. package/dist/components/Checkbox/index.d.ts +14 -0
  22. package/dist/components/ChipBar/index.d.ts +16 -0
  23. package/dist/components/CountingDot/index.d.ts +13 -0
  24. package/dist/components/FloatingButton/index.d.ts +17 -0
  25. package/dist/components/Icon/index.d.ts +17 -0
  26. package/dist/components/IconSvg/index.d.ts +12 -0
  27. package/dist/components/Image/index.d.ts +14 -0
  28. package/dist/components/ProgressBar.d.ts +42 -0
  29. package/dist/components/RadioButton/index.d.ts +13 -0
  30. package/dist/components/ScaleButton/index.d.ts +4 -0
  31. package/dist/components/SelectionField/index.d.ts +24 -0
  32. package/dist/components/Spacer/index.d.ts +9 -0
  33. package/dist/components/Switch/Switch.d.ts +47 -0
  34. package/dist/components/Switch/utils.d.ts +14 -0
  35. package/dist/components/Text/index.d.ts +14 -0
  36. package/dist/components/TextInput/Addons/Outline.d.ts +15 -0
  37. package/dist/components/TextInput/Addons/Underline.d.ts +19 -0
  38. package/dist/components/TextInput/Adornment/TextInputAdornment.d.ts +43 -0
  39. package/dist/components/TextInput/Adornment/TextInputAffix.d.ts +72 -0
  40. package/dist/components/TextInput/Adornment/enums.d.ts +12 -0
  41. package/dist/components/TextInput/Adornment/types.d.ts +11 -0
  42. package/dist/components/TextInput/Adornment/utils.d.ts +11 -0
  43. package/dist/components/TextInput/Label/InputLabel.d.ts +4 -0
  44. package/dist/components/TextInput/Label/LabelBackground.d.ts +4 -0
  45. package/dist/components/TextInput/TextInput.d.ts +171 -0
  46. package/dist/components/TextInput/TextInputDefault.d.ts +4 -0
  47. package/dist/components/TextInput/TextInputFlat.d.ts +4 -0
  48. package/dist/components/TextInput/constants.d.ts +31 -0
  49. package/dist/components/TextInput/helpers.d.ts +95 -0
  50. package/dist/components/TextInput/types.d.ts +154 -0
  51. package/dist/components/Toast/ToastProvider.d.ts +21 -0
  52. package/dist/components/Toast/index.d.ts +3 -0
  53. package/dist/components/Typography/AnimatedText.d.ts +34 -0
  54. package/dist/components/Typography/StyledText.d.ts +12 -0
  55. package/dist/components/Typography/Text.d.ts +35 -0
  56. package/dist/components/Typography/types.d.ts +2 -0
  57. package/dist/components/View/index.d.ts +38 -0
  58. package/dist/components/ViewVisibleAnimated/index.d.ts +25 -0
  59. package/dist/constants.d.ts +1 -0
  60. package/dist/core/theming.d.ts +43 -0
  61. package/dist/icons/IconArrowDown.d.ts +4 -0
  62. package/dist/icons/IconCheckbox.d.ts +4 -0
  63. package/dist/icons/IconCheckboxActive.d.ts +4 -0
  64. package/dist/icons/IconClearText.d.ts +4 -0
  65. package/dist/icons/IconRadio.d.ts +4 -0
  66. package/dist/icons/IconRadioActive.d.ts +4 -0
  67. package/dist/icons/IconRadioDisable.d.ts +4 -0
  68. package/dist/index.d.ts +33 -0
  69. package/dist/index.esm.js +6758 -0
  70. package/dist/index.esm.js.map +1 -0
  71. package/dist/index.js +6823 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/styles/fonts.d.ts +78 -0
  74. package/dist/styles/overlay.d.ts +3 -0
  75. package/dist/styles/shadow.d.ts +18 -0
  76. package/dist/styles/themes/DarkTheme.d.ts +2 -0
  77. package/dist/styles/themes/LightTheme.d.ts +2 -0
  78. package/dist/styles/themes/index.d.ts +2 -0
  79. package/dist/styles/themes/tokens.d.ts +830 -0
  80. package/dist/theme/blue.d.ts +14 -0
  81. package/dist/theme/colors.d.ts +99 -0
  82. package/dist/theme/container-styles.d.ts +124 -0
  83. package/dist/theme/dimensions.d.ts +36 -0
  84. package/dist/theme/green.d.ts +15 -0
  85. package/dist/theme/icon.d.ts +5 -0
  86. package/dist/theme/ink.d.ts +11 -0
  87. package/dist/theme/orange.d.ts +14 -0
  88. package/dist/theme/purple.d.ts +6 -0
  89. package/dist/theme/red.d.ts +15 -0
  90. package/dist/theme/themes.d.ts +277 -0
  91. package/dist/theme/white.d.ts +10 -0
  92. package/dist/theme/yellow.d.ts +15 -0
  93. package/dist/types/index.d.ts +65 -0
  94. package/dist/types.d.ts +220 -0
  95. package/dist/utils/BackHandler/BackHandler.d.ts +9 -0
  96. package/dist/utils/BackHandler/BackHandler.native.d.ts +2 -0
  97. package/dist/utils/addEventListener.d.ts +12 -0
  98. package/dist/utils/forwardRef.d.ts +11 -0
  99. package/dist/utils/function-utils.d.ts +12 -0
  100. package/dist/utils/getContrastingColor.d.ts +2 -0
  101. package/dist/utils/hasTouchHandler.d.ts +5 -0
  102. package/dist/utils/roundLayoutSize.d.ts +1 -0
  103. package/dist/utils/splitStyles.d.ts +19 -0
  104. package/dist/utils/toast-manager.d.ts +21 -0
  105. package/dist/utils/useAnimatedValue.d.ts +2 -0
  106. package/dist/utils/useAnimatedValueArray.d.ts +2 -0
  107. package/dist/utils/useIsKeyboardShown.d.ts +6 -0
  108. package/dist/utils/useLayout.d.ts +6 -0
  109. package/dist/utils/useLazyRef.d.ts +2 -0
  110. package/package.json +104 -0
  111. package/src/.DS_Store +0 -0
  112. package/src/assets/images/error.png +0 -0
  113. package/src/assets/images/image_default.png +0 -0
  114. package/src/assets/images/info.png +0 -0
  115. package/src/assets/images/success.png +0 -0
  116. package/src/assets/images/warning.png +0 -0
  117. package/src/assets/svg/icon-checkbox-active.svg +4 -0
  118. package/src/assets/svg/icon-checkbox.svg +3 -0
  119. package/src/babel/.eslintrc +7 -0
  120. package/src/babel/index.js +63 -0
  121. package/src/components/.DS_Store +0 -0
  122. package/src/components/ActivityIndicator.tsx +238 -0
  123. package/src/components/Avatar/index.tsx +102 -0
  124. package/src/components/Badge/index.tsx +55 -0
  125. package/src/components/Button/index.tsx +162 -0
  126. package/src/components/ButtonIcon/index.tsx +98 -0
  127. package/src/components/Checkbox/index.tsx +107 -0
  128. package/src/components/ChipBar/index.tsx +112 -0
  129. package/src/components/CountingDot/index.tsx +63 -0
  130. package/src/components/FloatingButton/index.tsx +99 -0
  131. package/src/components/Icon/index.tsx +135 -0
  132. package/src/components/IconSvg/index.tsx +42 -0
  133. package/src/components/Image/index.tsx +127 -0
  134. package/src/components/ProgressBar.tsx +272 -0
  135. package/src/components/RadioButton/index.tsx +105 -0
  136. package/src/components/ScaleButton/index.tsx +17 -0
  137. package/src/components/SelectionField/index.tsx +166 -0
  138. package/src/components/Spacer/index.tsx +19 -0
  139. package/src/components/Switch/Switch.tsx +110 -0
  140. package/src/components/Switch/utils.ts +96 -0
  141. package/src/components/Text/index.tsx +69 -0
  142. package/src/components/TextInput/.DS_Store +0 -0
  143. package/src/components/TextInput/Addons/Outline.tsx +62 -0
  144. package/src/components/TextInput/Addons/Underline.tsx +71 -0
  145. package/src/components/TextInput/Adornment/TextInputAdornment.tsx +191 -0
  146. package/src/components/TextInput/Adornment/TextInputAffix.tsx +212 -0
  147. package/src/components/TextInput/Adornment/enums.tsx +12 -0
  148. package/src/components/TextInput/Adornment/types.tsx +11 -0
  149. package/src/components/TextInput/Adornment/utils.ts +39 -0
  150. package/src/components/TextInput/Label/InputLabel.tsx +216 -0
  151. package/src/components/TextInput/Label/LabelBackground.tsx +100 -0
  152. package/src/components/TextInput/TextInput.tsx +564 -0
  153. package/src/components/TextInput/TextInputDefault.tsx +187 -0
  154. package/src/components/TextInput/TextInputFlat.tsx +452 -0
  155. package/src/components/TextInput/constants.tsx +48 -0
  156. package/src/components/TextInput/helpers.tsx +546 -0
  157. package/src/components/TextInput/types.tsx +155 -0
  158. package/src/components/Toast/ToastProvider.tsx +69 -0
  159. package/src/components/Toast/index.tsx +239 -0
  160. package/src/components/Typography/AnimatedText.tsx +84 -0
  161. package/src/components/Typography/StyledText.tsx +53 -0
  162. package/src/components/Typography/Text.tsx +189 -0
  163. package/src/components/Typography/types.tsx +5 -0
  164. package/src/components/View/index.tsx +175 -0
  165. package/src/components/ViewVisibleAnimated/index.tsx +199 -0
  166. package/src/constants.tsx +16 -0
  167. package/src/core/theming.tsx +144 -0
  168. package/src/icons/IconArrowDown.tsx +14 -0
  169. package/src/icons/IconCheckbox.tsx +20 -0
  170. package/src/icons/IconCheckboxActive.tsx +18 -0
  171. package/src/icons/IconClearText.tsx +14 -0
  172. package/src/icons/IconRadio.tsx +11 -0
  173. package/src/icons/IconRadioActive.tsx +12 -0
  174. package/src/icons/IconRadioDisable.tsx +12 -0
  175. package/src/index.ts +51 -0
  176. package/src/index.tsx +50 -0
  177. package/src/styles/fonts.tsx +89 -0
  178. package/src/styles/overlay.tsx +69 -0
  179. package/src/styles/shadow.tsx +47 -0
  180. package/src/styles/themes/DarkTheme.tsx +157 -0
  181. package/src/styles/themes/LightTheme.tsx +160 -0
  182. package/src/styles/themes/index.ts +3 -0
  183. package/src/styles/themes/tokens.tsx +481 -0
  184. package/src/theme/blue.ts +25 -0
  185. package/src/theme/colors.ts +21 -0
  186. package/src/theme/container-styles.tsx +126 -0
  187. package/src/theme/dimensions.ts +44 -0
  188. package/src/theme/green.ts +27 -0
  189. package/src/theme/icon.ts +7 -0
  190. package/src/theme/ink.ts +18 -0
  191. package/src/theme/orange.ts +24 -0
  192. package/src/theme/purple.ts +8 -0
  193. package/src/theme/red.ts +26 -0
  194. package/src/theme/themes.tsx +287 -0
  195. package/src/theme/white.ts +16 -0
  196. package/src/theme/yellow.ts +26 -0
  197. package/src/types/index.ts +71 -0
  198. package/src/types/svg.d.ts +5 -0
  199. package/src/types.ts +259 -0
  200. package/src/types.tsx +284 -0
  201. package/src/utils/BackHandler/BackHandler.native.tsx +3 -0
  202. package/src/utils/BackHandler/BackHandler.tsx +11 -0
  203. package/src/utils/addEventListener.tsx +56 -0
  204. package/src/utils/forwardRef.tsx +23 -0
  205. package/src/utils/function-utils.tsx +108 -0
  206. package/src/utils/getContrastingColor.tsx +15 -0
  207. package/src/utils/hasTouchHandler.tsx +23 -0
  208. package/src/utils/roundLayoutSize.ts +2 -0
  209. package/src/utils/splitStyles.ts +60 -0
  210. package/src/utils/toast-manager.tsx +46 -0
  211. package/src/utils/useAnimatedValue.tsx +9 -0
  212. package/src/utils/useAnimatedValueArray.tsx +13 -0
  213. package/src/utils/useIsKeyboardShown.tsx +55 -0
  214. package/src/utils/useLayout.tsx +29 -0
  215. package/src/utils/useLazyRef.tsx +11 -0
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # sapo-components-ui-rn
2
+
3
+ Thư viện UI Components cho React Native được phát triển bởi Sapo.
4
+
5
+ ## Cài đặt
6
+
7
+ ```bash
8
+ npm install sapo-components-ui-rn
9
+ # or
10
+ yarn add sapo-components-ui-rn
11
+ ```
12
+
13
+ ## Yêu cầu
14
+
15
+ Thư viện này yêu cầu các peer dependencies sau:
16
+
17
+ ```json
18
+ {
19
+ "react": ">=18.0.0",
20
+ "react-native": ">=0.70.0",
21
+ "@react-native-community/masked-view": "*",
22
+ "react-native-gesture-handler": "*",
23
+ "react-native-reanimated": "*",
24
+ "react-native-safe-area-context": "*",
25
+ "react-native-screens": "*"
26
+ }
27
+ ```
28
+
29
+ ## Sử dụng
30
+
31
+ ```tsx
32
+ import { Button, Text } from 'sapo-components-ui-rn';
33
+
34
+ function MyComponent() {
35
+ return (
36
+ <Button onPress={() => console.log('Pressed')}>
37
+ <Text>Click me</Text>
38
+ </Button>
39
+ );
40
+ }
41
+ ```
42
+
43
+ ## Components
44
+
45
+ Thư viện bao gồm các components sau:
46
+
47
+ - [Button](Button.md)
48
+ - [ButtonIcon](ButtonIcon.md)
49
+ - [Text](Text.md)
50
+ - [TextInput](TextInput.md)
51
+ - [Avatar](Avatar.md)
52
+ - [Badge](Badge.md)
53
+ - [Checkbox](Checkbox.md)
54
+ - [ChipBar](ChipBar.md)
55
+ - [RadioButton](RadioButton.md)
56
+ - [Switch](Switch.md)
57
+ - [CountingDot](CountingDot.md)
58
+ - [FloatingButton](FloatingButton.md)
59
+ - [Image](Image.md)
60
+ - [Spacer](Spacer.md)
61
+ - [View](View.md)
62
+ <!--
63
+ ## Đóng góp
64
+
65
+ Chúng tôi rất hoan nghênh mọi đóng góp! Vui lòng xem [hướng dẫn đóng góp](CONTRIBUTING.md) để biết thêm chi tiết. -->
66
+
67
+ ## Giấy phép
68
+
69
+ Sapo.vn
Binary file
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2" y="2" width="20" height="20" rx="6" fill="#0088FF"/>
3
+ <path d="M17.7745 8.32544L10.4245 15.6751L6.74951 12.0004" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2.75" y="2.75" width="18.5" height="18.5" rx="5.25" fill="white" stroke="#A1A5AB" stroke-width="1.5"/>
3
+ </svg>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2" y="2" width="20" height="20" rx="6" fill="#0088FF"/>
3
+ <path d="M17.7745 8.32544L10.4245 15.6751L6.74951 12.0004" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2.75" y="2.75" width="18.5" height="18.5" rx="5.25" fill="white" stroke="#A1A5AB" stroke-width="1.5"/>
3
+ </svg>
Binary file
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { StyleProp, View, ViewStyle } from "react-native";
3
+ import type { ThemeProp } from "../types";
4
+ export type Props = React.ComponentPropsWithRef<typeof View> & {
5
+ /**
6
+ * Whether to show the indicator or hide it.
7
+ */
8
+ animating?: boolean;
9
+ /**
10
+ * The color of the spinner.
11
+ */
12
+ color?: string;
13
+ /**
14
+ * Size of the indicator.
15
+ */
16
+ size?: "small" | "large" | number;
17
+ /**
18
+ * Whether the indicator should hide when not animating.
19
+ */
20
+ hidesWhenStopped?: boolean;
21
+ style?: StyleProp<ViewStyle>;
22
+ /**
23
+ * @optional
24
+ */
25
+ theme?: ThemeProp;
26
+ };
27
+ declare const ActivityIndicator: ({ animating, color: indicatorColor, hidesWhenStopped, size: indicatorSize, style, theme: themeOverrides, ...rest }: Props) => React.JSX.Element;
28
+ export default ActivityIndicator;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle, ImageStyle } from "react-native";
3
+ interface AvatarProps {
4
+ children?: React.ReactNode;
5
+ name?: string;
6
+ borderColor?: string;
7
+ backgroundColor?: string;
8
+ style?: StyleProp<ViewStyle>;
9
+ textColor?: string;
10
+ size: 64 | 48 | 24;
11
+ source?: string;
12
+ onPress?: () => void;
13
+ textStyle?: StyleProp<TextStyle>;
14
+ imageStyle?: StyleProp<ImageStyle>;
15
+ }
16
+ declare const Avatar: ({ children, name, backgroundColor, style, textColor, size, source, onPress, textStyle, imageStyle, }: AvatarProps) => React.JSX.Element;
17
+ export default Avatar;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ interface BadgeProps {
4
+ children?: React.ReactNode;
5
+ value: string;
6
+ borderColor?: string;
7
+ backgroundColor?: string;
8
+ style?: StyleProp<ViewStyle>;
9
+ textColor?: string;
10
+ textStyle?: StyleProp<TextStyle>;
11
+ }
12
+ declare const Badge: ({ children, value, borderColor, backgroundColor, style, textColor, textStyle, }: BadgeProps) => React.JSX.Element;
13
+ export default Badge;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TouchableOpacityProps, TextStyle } from "react-native";
3
+ import { ThemeProp } from "../../types";
4
+ export interface ButtonProps extends TouchableOpacityProps {
5
+ style?: StyleProp<ViewStyle>;
6
+ borderColor?: string;
7
+ title?: string;
8
+ backgroundColor?: string;
9
+ isLoading?: boolean;
10
+ left?: React.ReactNode;
11
+ right?: React.ReactNode;
12
+ small?: boolean;
13
+ textColor?: string;
14
+ bold?: boolean;
15
+ size?: number;
16
+ textStyle?: TextStyle;
17
+ medium?: boolean;
18
+ mode?: "outlined" | "contained" | "transparent";
19
+ onPress?: (res?: any) => void;
20
+ theme?: ThemeProp;
21
+ }
22
+ declare const _default: React.MemoExoticComponent<({ style, title, borderColor, isLoading, left, right, small, textStyle, onPress, disabled, backgroundColor, textColor, bold, size, medium, mode, theme: themeOverrides, ...props }: ButtonProps) => React.JSX.Element>;
23
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ export interface ButtonIconProps {
4
+ isLoading?: boolean;
5
+ disabled?: boolean;
6
+ onPress?: (val?: any) => void;
7
+ style?: StyleProp<ViewStyle>;
8
+ children?: React.ReactNode;
9
+ size?: number;
10
+ hiddenBackground?: boolean;
11
+ props?: object;
12
+ border?: boolean;
13
+ circle?: boolean;
14
+ backgroundColor?: string;
15
+ borderColor?: string;
16
+ }
17
+ declare const _default: React.MemoExoticComponent<React.ComponentType<ButtonIconProps>>;
18
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ interface CheckboxProps {
4
+ style?: StyleProp<ViewStyle>;
5
+ content: string;
6
+ onPress?: (val?: any) => void;
7
+ textStyle?: StyleProp<TextStyle>;
8
+ disabled?: boolean;
9
+ leftIcon?: React.ReactNode;
10
+ checked?: boolean;
11
+ iconSize?: number;
12
+ }
13
+ declare const Checkbox: ({ style, content, textStyle, onPress, disabled, leftIcon, checked, iconSize, }: CheckboxProps) => React.JSX.Element;
14
+ export default Checkbox;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ interface ChipBarProps {
4
+ style?: StyleProp<ViewStyle>;
5
+ title: string;
6
+ borderRadius?: number;
7
+ onPress?: (val?: any) => void;
8
+ textStyle?: StyleProp<TextStyle>;
9
+ disabled?: boolean;
10
+ leftIcon?: React.ReactNode;
11
+ rightIcon?: React.ReactNode;
12
+ badge?: number;
13
+ isActive?: boolean;
14
+ }
15
+ declare const ChipBar: ({ style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, badge, isActive, }: ChipBarProps) => React.JSX.Element;
16
+ export default ChipBar;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ interface CountingDotProps {
4
+ children?: React.ReactNode;
5
+ value: string | number;
6
+ borderColor?: string;
7
+ backgroundColor?: string;
8
+ style?: StyleProp<ViewStyle>;
9
+ textColor?: string;
10
+ textStyle?: StyleProp<TextStyle>;
11
+ }
12
+ declare const CountingDot: ({ children, value, backgroundColor, style, textColor, textStyle, }: CountingDotProps) => React.JSX.Element;
13
+ export default CountingDot;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ export interface FloatingButtonProps {
4
+ isLoading?: boolean;
5
+ disabled?: boolean;
6
+ onPress?: (val?: any) => void;
7
+ style?: StyleProp<ViewStyle>;
8
+ children?: React.ReactNode;
9
+ size?: number;
10
+ hiddenBackground?: boolean;
11
+ props?: object;
12
+ backgroundColor?: string;
13
+ top?: number;
14
+ right?: number;
15
+ }
16
+ declare const _default: React.MemoExoticComponent<React.ComponentType<FloatingButtonProps>>;
17
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { StyleProp, TextStyle } from "react-native";
3
+ export type IconType = "FontAwesome" | "Image" | "MaterialIcons" | "Feather" | "MaterialCommunityIcons" | "Svg";
4
+ export interface IconProps {
5
+ name: "IconCheckboxActive" | "IconCheckbox" | "IconRadio" | "IconRadioActive" | "IconRadioDisable" | "IconArrowDown" | "IconClearText";
6
+ backgroundColor?: string;
7
+ size?: number;
8
+ color?: string;
9
+ style?: StyleProp<TextStyle>;
10
+ showBackground?: boolean;
11
+ onPress?: () => void;
12
+ type?: IconType;
13
+ tintColor?: string;
14
+ animatedProps?: Record<string, unknown>;
15
+ }
16
+ declare const _default: React.NamedExoticComponent<IconProps>;
17
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface SvgIconProps {
3
+ name: any;
4
+ width?: number;
5
+ height?: number;
6
+ color?: string;
7
+ style?: any;
8
+ onPress?: () => void;
9
+ disabled?: boolean;
10
+ }
11
+ declare const SvgIcon: React.FC<SvgIconProps>;
12
+ export default SvgIcon;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { ImageProps, StyleProp, ImageStyle } from "react-native";
3
+ interface PropsCustomImage extends ImageProps {
4
+ useFastImage?: boolean;
5
+ disableDefaultImage?: boolean;
6
+ children?: React.ReactNode;
7
+ resizeMode?: "cover" | "contain" | "stretch" | "center";
8
+ source: any;
9
+ style?: StyleProp<ImageStyle>;
10
+ loadingColor?: string;
11
+ showLoading?: boolean;
12
+ }
13
+ declare const _default: React.MemoExoticComponent<React.ComponentType<PropsCustomImage>>;
14
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ import { Animated, StyleProp, View, ViewStyle } from "react-native";
3
+ import type { ThemeProp } from "../types";
4
+ export type Props = React.ComponentPropsWithRef<typeof View> & {
5
+ /**
6
+ * Animated value (between 0 and 1). This tells the progress bar to rely on this value to animate it.
7
+ * Note: It should not be used in parallel with the `progress` prop.
8
+ */
9
+ animatedValue?: number;
10
+ /**
11
+ * Progress value (between 0 and 1).
12
+ * Note: It should not be used in parallel with the `animatedValue` prop.
13
+ */
14
+ progress?: number;
15
+ /**
16
+ * Color of the progress bar. The background color will be calculated based on this but you can change it by passing `backgroundColor` to `style` prop.
17
+ */
18
+ color?: string;
19
+ /**
20
+ * If the progress bar will show indeterminate progress.
21
+ */
22
+ indeterminate?: boolean;
23
+ /**
24
+ * Whether to show the ProgressBar (true, the default) or hide it (false).
25
+ */
26
+ visible?: boolean;
27
+ /**
28
+ * Style of filled part of the ProgresBar.
29
+ */
30
+ fillStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
31
+ style?: StyleProp<ViewStyle>;
32
+ /**
33
+ * @optional
34
+ */
35
+ theme?: ThemeProp;
36
+ /**
37
+ * testID to be used on tests.
38
+ */
39
+ testID?: string;
40
+ };
41
+ declare const ProgressBar: ({ color, indeterminate, progress, visible, theme: themeOverrides, animatedValue, style, fillStyle, testID, ...rest }: Props) => React.JSX.Element;
42
+ export default ProgressBar;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ interface RadioButtonProps {
4
+ style?: StyleProp<ViewStyle>;
5
+ content: string;
6
+ onPress?: (val?: any) => void;
7
+ textStyle?: StyleProp<TextStyle>;
8
+ disabled?: boolean;
9
+ leftIcon?: React.ReactNode;
10
+ checked?: boolean;
11
+ }
12
+ declare const RadioButton: ({ style, content, textStyle, onPress, disabled, leftIcon, checked, }: RadioButtonProps) => React.JSX.Element;
13
+ export default RadioButton;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TouchableOpacityProps } from "react-native";
3
+ declare const _default: React.MemoExoticComponent<({ children, style, onPress, ...rest }: TouchableOpacityProps) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle, TouchableOpacityProps, TextStyle } from "react-native";
3
+ import { IText } from "../Text";
4
+ import { ThemeProp } from "../../types";
5
+ export interface SelectionFieldProps extends TouchableOpacityProps {
6
+ style?: StyleProp<ViewStyle>;
7
+ borderColor?: string;
8
+ content?: string;
9
+ label?: string;
10
+ error?: string;
11
+ left?: React.ReactNode;
12
+ right?: React.ReactNode;
13
+ textProps?: IText;
14
+ textColor?: string;
15
+ labelColor?: string;
16
+ size?: number;
17
+ textStyle?: TextStyle;
18
+ labelStyle?: TextStyle;
19
+ disabled?: boolean;
20
+ onPress?: (res?: any) => void;
21
+ theme?: ThemeProp;
22
+ }
23
+ declare const _default: React.MemoExoticComponent<({ style, content, label, error, borderColor, left, right, textStyle, labelStyle, textProps, onPress, disabled, textColor, labelColor, size, theme: themeOverrides, ...props }: SelectionFieldProps) => React.JSX.Element>;
24
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ interface SpacerProps {
4
+ width?: number;
5
+ height?: number;
6
+ style?: StyleProp<ViewStyle>;
7
+ }
8
+ declare const Spacer: ({ style, width, height, }: SpacerProps) => React.JSX.Element;
9
+ export default Spacer;
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ import { StyleProp, Switch as NativeSwitch, ViewStyle } from "react-native";
3
+ import type { ThemeProp } from "../../types";
4
+ export type Props = React.ComponentPropsWithRef<typeof NativeSwitch> & {
5
+ /**
6
+ * Disable toggling the switch.
7
+ */
8
+ disabled?: boolean;
9
+ /**
10
+ * Value of the switch, true means 'on', false means 'off'.
11
+ */
12
+ value?: boolean;
13
+ /**
14
+ * Custom color for switch.
15
+ */
16
+ color?: string;
17
+ /**
18
+ * Callback called with the new value when it changes.
19
+ */
20
+ onValueChange?: Function;
21
+ style?: StyleProp<ViewStyle>;
22
+ /**
23
+ * @optional
24
+ */
25
+ theme?: ThemeProp;
26
+ };
27
+ /**
28
+ * Switch is a visual toggle between two mutually exclusive states — on and off.
29
+ *
30
+ * ## Usage
31
+ * ```js
32
+ * import * as React from 'react';
33
+ * import { Switch } from 'react-native-paper';
34
+ *
35
+ * const MyComponent = () => {
36
+ * const [isSwitchOn, setIsSwitchOn] = React.useState(false);
37
+ *
38
+ * const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);
39
+ *
40
+ * return <Switch value={isSwitchOn} onValueChange={onToggleSwitch} />;
41
+ * };
42
+ *
43
+ * export default MyComponent;
44
+ * ```
45
+ */
46
+ declare const Switch: ({ value, disabled, onValueChange, color, theme: themeOverrides, ...rest }: Props) => React.JSX.Element;
47
+ export default Switch;
@@ -0,0 +1,14 @@
1
+ import type { InternalTheme } from "../../types";
2
+ type BaseProps = {
3
+ theme: InternalTheme;
4
+ disabled?: boolean;
5
+ value?: boolean;
6
+ };
7
+ export declare const getSwitchColor: ({ theme, disabled, value, color, }: BaseProps & {
8
+ color?: string;
9
+ }) => {
10
+ onTintColor: string;
11
+ thumbTintColor: string | undefined;
12
+ checkedColor: string;
13
+ };
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { TextProps } from "react-native";
3
+ import { ThemeProp } from "../../types";
4
+ export interface IText extends TextProps {
5
+ size?: number;
6
+ color?: string;
7
+ center?: boolean;
8
+ bold?: boolean;
9
+ medium?: boolean;
10
+ children?: any;
11
+ theme?: ThemeProp;
12
+ }
13
+ declare const _default: React.MemoExoticComponent<React.ComponentType<IText>>;
14
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { ColorValue, StyleProp, ViewStyle } from "react-native";
3
+ import { TextInputLabelProp } from "../types";
4
+ type OutlineProps = {
5
+ activeColor: string;
6
+ backgroundColor: ColorValue | any;
7
+ hasActiveOutline?: boolean;
8
+ focused?: boolean;
9
+ outlineColor?: string;
10
+ roundness?: number;
11
+ label?: TextInputLabelProp;
12
+ style?: StyleProp<ViewStyle>;
13
+ };
14
+ export declare const Outline: ({ label, activeColor, backgroundColor, hasActiveOutline, focused, outlineColor, roundness, style, }: OutlineProps) => React.JSX.Element;
15
+ export {};
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ import { ThemeProp } from "../../../types";
4
+ type UnderlineProps = {
5
+ parentState: {
6
+ focused: boolean;
7
+ };
8
+ error?: boolean;
9
+ colors?: {
10
+ error?: string;
11
+ };
12
+ activeColor: string;
13
+ underlineColorCustom?: string;
14
+ hasActiveOutline?: boolean;
15
+ style?: StyleProp<ViewStyle>;
16
+ theme?: ThemeProp;
17
+ };
18
+ export declare const Underline: ({ parentState, error, colors, activeColor, underlineColorCustom, hasActiveOutline, style, }: UnderlineProps) => React.JSX.Element;
19
+ export {};
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import type { LayoutChangeEvent, TextStyle, StyleProp, Animated, DimensionValue } from "react-native";
3
+ import { AdornmentSide, AdornmentType } from "./enums";
4
+ import type { AdornmentConfig, AdornmentStyleAdjustmentForNativeInput } from "./types";
5
+ import { ThemeProp } from "../../../types";
6
+ export declare function getAdornmentConfig({ left, right, }: {
7
+ left?: React.ReactNode;
8
+ right?: React.ReactNode;
9
+ }): Array<AdornmentConfig>;
10
+ export declare function getAdornmentStyleAdjustmentForNativeInput({ adornmentConfig, leftAffixWidth, rightAffixWidth, paddingHorizontal, inputOffset, mode, }: {
11
+ inputOffset?: number;
12
+ adornmentConfig: AdornmentConfig[];
13
+ leftAffixWidth: number;
14
+ rightAffixWidth: number;
15
+ mode?: "outlined" | "flat";
16
+ paddingHorizontal?: DimensionValue;
17
+ }): AdornmentStyleAdjustmentForNativeInput | {};
18
+ export interface TextInputAdornmentProps {
19
+ forceFocus: () => void;
20
+ adornmentConfig: AdornmentConfig[];
21
+ topPosition: {
22
+ [AdornmentType.Affix]: {
23
+ [AdornmentSide.Left]: number | null;
24
+ [AdornmentSide.Right]: number | null;
25
+ };
26
+ [AdornmentType.Icon]: number;
27
+ };
28
+ onAffixChange: {
29
+ [AdornmentSide.Left]: (event: LayoutChangeEvent) => void;
30
+ [AdornmentSide.Right]: (event: LayoutChangeEvent) => void;
31
+ };
32
+ left?: React.ReactNode;
33
+ right?: React.ReactNode;
34
+ textStyle?: StyleProp<TextStyle>;
35
+ visible?: Animated.Value;
36
+ isTextInputFocused: boolean;
37
+ paddingHorizontal?: DimensionValue;
38
+ maxFontSizeMultiplier?: number | undefined | null;
39
+ theme?: ThemeProp;
40
+ disabled?: boolean;
41
+ }
42
+ declare const TextInputAdornment: React.FunctionComponent<TextInputAdornmentProps>;
43
+ export default TextInputAdornment;