@bigbinary/neetoui-rn 2.3.4 → 3.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 (280) hide show
  1. package/README.md +118 -0
  2. package/lib/typescript/src/components/Alert/Alert.d.ts +32 -0
  3. package/lib/typescript/src/components/Alert/Alert.d.ts.map +1 -0
  4. package/lib/typescript/src/components/Alert/index.d.ts +2 -0
  5. package/lib/typescript/src/components/Alert/index.d.ts.map +1 -0
  6. package/lib/typescript/src/components/Avatar/Avatar.d.ts +21 -0
  7. package/lib/typescript/src/components/Avatar/Avatar.d.ts.map +1 -0
  8. package/lib/typescript/src/components/Avatar/index.d.ts +2 -0
  9. package/lib/typescript/src/components/Avatar/index.d.ts.map +1 -0
  10. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +61 -0
  11. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
  12. package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
  13. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
  14. package/lib/typescript/src/components/BottomSheetMenu/BottomSheetMenu.d.ts +28 -0
  15. package/lib/typescript/src/components/BottomSheetMenu/BottomSheetMenu.d.ts.map +1 -0
  16. package/lib/typescript/src/components/BottomSheetMenu/index.d.ts +2 -0
  17. package/lib/typescript/src/components/BottomSheetMenu/index.d.ts.map +1 -0
  18. package/lib/typescript/src/components/Button/Button.d.ts +79 -0
  19. package/lib/typescript/src/components/Button/Button.d.ts.map +1 -0
  20. package/lib/typescript/src/components/Button/index.d.ts +2 -0
  21. package/lib/typescript/src/components/Button/index.d.ts.map +1 -0
  22. package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts +11 -0
  23. package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts.map +1 -0
  24. package/lib/typescript/src/components/ChatInput/ChatInput.d.ts +78 -0
  25. package/lib/typescript/src/components/ChatInput/ChatInput.d.ts.map +1 -0
  26. package/lib/typescript/src/components/ChatInput/IconButton.d.ts +16 -0
  27. package/lib/typescript/src/components/ChatInput/IconButton.d.ts.map +1 -0
  28. package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts +13 -0
  29. package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts.map +1 -0
  30. package/lib/typescript/src/components/ChatInput/constants.d.ts +9 -0
  31. package/lib/typescript/src/components/ChatInput/constants.d.ts.map +1 -0
  32. package/lib/typescript/src/components/ChatInput/index.d.ts +4 -0
  33. package/lib/typescript/src/components/ChatInput/index.d.ts.map +1 -0
  34. package/lib/typescript/src/components/ChatInput/mentions.d.ts +26 -0
  35. package/lib/typescript/src/components/ChatInput/mentions.d.ts.map +1 -0
  36. package/lib/typescript/src/components/CheckBox/CheckBox.d.ts +13 -0
  37. package/lib/typescript/src/components/CheckBox/CheckBox.d.ts.map +1 -0
  38. package/lib/typescript/src/components/CheckBox/index.d.ts +2 -0
  39. package/lib/typescript/src/components/CheckBox/index.d.ts.map +1 -0
  40. package/lib/typescript/src/components/Container/Container.d.ts +9 -0
  41. package/lib/typescript/src/components/Container/Container.d.ts.map +1 -0
  42. package/lib/typescript/src/components/Container/index.d.ts +2 -0
  43. package/lib/typescript/src/components/Container/index.d.ts.map +1 -0
  44. package/lib/typescript/src/components/Divider/Divider.d.ts +7 -0
  45. package/lib/typescript/src/components/Divider/Divider.d.ts.map +1 -0
  46. package/lib/typescript/src/components/Divider/index.d.ts +2 -0
  47. package/lib/typescript/src/components/Divider/index.d.ts.map +1 -0
  48. package/lib/typescript/src/components/EmptyView/EmptyView.d.ts +26 -0
  49. package/lib/typescript/src/components/EmptyView/EmptyView.d.ts.map +1 -0
  50. package/lib/typescript/src/components/EmptyView/index.d.ts +2 -0
  51. package/lib/typescript/src/components/EmptyView/index.d.ts.map +1 -0
  52. package/lib/typescript/src/components/FlashList/FlashList.d.ts +14 -0
  53. package/lib/typescript/src/components/FlashList/FlashList.d.ts.map +1 -0
  54. package/lib/typescript/src/components/FlashList/index.d.ts +2 -0
  55. package/lib/typescript/src/components/FlashList/index.d.ts.map +1 -0
  56. package/lib/typescript/src/components/Header/BaseHeader.d.ts +5 -0
  57. package/lib/typescript/src/components/Header/BaseHeader.d.ts.map +1 -0
  58. package/lib/typescript/src/components/Header/Header.d.ts +21 -0
  59. package/lib/typescript/src/components/Header/Header.d.ts.map +1 -0
  60. package/lib/typescript/src/components/Header/ScreenHeader.d.ts +11 -0
  61. package/lib/typescript/src/components/Header/ScreenHeader.d.ts.map +1 -0
  62. package/lib/typescript/src/components/Header/index.d.ts +4 -0
  63. package/lib/typescript/src/components/Header/index.d.ts.map +1 -0
  64. package/lib/typescript/src/components/Input/Input.d.ts +15 -0
  65. package/lib/typescript/src/components/Input/Input.d.ts.map +1 -0
  66. package/lib/typescript/src/components/Input/index.d.ts +2 -0
  67. package/lib/typescript/src/components/Input/index.d.ts.map +1 -0
  68. package/lib/typescript/src/components/Loader/Loader.d.ts +12 -0
  69. package/lib/typescript/src/components/Loader/Loader.d.ts.map +1 -0
  70. package/lib/typescript/src/components/Loader/index.d.ts +2 -0
  71. package/lib/typescript/src/components/Loader/index.d.ts.map +1 -0
  72. package/lib/typescript/src/components/NeetoUIProvider/NeetoUIProvider.d.ts +16 -0
  73. package/lib/typescript/src/components/NeetoUIProvider/NeetoUIProvider.d.ts.map +1 -0
  74. package/lib/typescript/src/components/NeetoUIProvider/index.d.ts +2 -0
  75. package/lib/typescript/src/components/NeetoUIProvider/index.d.ts.map +1 -0
  76. package/lib/typescript/src/components/OnBoarding/OnBoarding.d.ts +22 -0
  77. package/lib/typescript/src/components/OnBoarding/OnBoarding.d.ts.map +1 -0
  78. package/lib/typescript/src/components/OnBoarding/index.d.ts +2 -0
  79. package/lib/typescript/src/components/OnBoarding/index.d.ts.map +1 -0
  80. package/lib/typescript/src/components/ParentView/ParentView.d.ts +13 -0
  81. package/lib/typescript/src/components/ParentView/ParentView.d.ts.map +1 -0
  82. package/lib/typescript/src/components/ParentView/index.d.ts +2 -0
  83. package/lib/typescript/src/components/ParentView/index.d.ts.map +1 -0
  84. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +12 -0
  85. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts.map +1 -0
  86. package/lib/typescript/src/components/RadioButton/index.d.ts +2 -0
  87. package/lib/typescript/src/components/RadioButton/index.d.ts.map +1 -0
  88. package/lib/typescript/src/components/ScrollView/ScrollView.d.ts +8 -0
  89. package/lib/typescript/src/components/ScrollView/ScrollView.d.ts.map +1 -0
  90. package/lib/typescript/src/components/ScrollView/index.d.ts +2 -0
  91. package/lib/typescript/src/components/ScrollView/index.d.ts.map +1 -0
  92. package/lib/typescript/src/components/SearchBar/SearchBar.d.ts +12 -0
  93. package/lib/typescript/src/components/SearchBar/SearchBar.d.ts.map +1 -0
  94. package/lib/typescript/src/components/SearchBar/index.d.ts +2 -0
  95. package/lib/typescript/src/components/SearchBar/index.d.ts.map +1 -0
  96. package/lib/typescript/src/components/Skeleton/Skeleton.d.ts +41 -0
  97. package/lib/typescript/src/components/Skeleton/Skeleton.d.ts.map +1 -0
  98. package/lib/typescript/src/components/Skeleton/index.d.ts +2 -0
  99. package/lib/typescript/src/components/Skeleton/index.d.ts.map +1 -0
  100. package/lib/typescript/src/components/TextWithUrl/TextWithUrl.d.ts +11 -0
  101. package/lib/typescript/src/components/TextWithUrl/TextWithUrl.d.ts.map +1 -0
  102. package/lib/typescript/src/components/TextWithUrl/index.d.ts +2 -0
  103. package/lib/typescript/src/components/TextWithUrl/index.d.ts.map +1 -0
  104. package/lib/typescript/src/components/Toast/Toast.d.ts +13 -0
  105. package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -0
  106. package/lib/typescript/src/components/Toast/ToastGlyph.d.ts +4 -0
  107. package/lib/typescript/src/components/Toast/ToastGlyph.d.ts.map +1 -0
  108. package/lib/typescript/src/components/Toast/index.d.ts +2 -0
  109. package/lib/typescript/src/components/Toast/index.d.ts.map +1 -0
  110. package/lib/typescript/src/components/Touchable/Touchable.d.ts +23 -0
  111. package/lib/typescript/src/components/Touchable/Touchable.d.ts.map +1 -0
  112. package/lib/typescript/src/components/Touchable/index.d.ts +2 -0
  113. package/lib/typescript/src/components/Touchable/index.d.ts.map +1 -0
  114. package/lib/typescript/src/components/Typography/Typography.d.ts +64 -0
  115. package/lib/typescript/src/components/Typography/Typography.d.ts.map +1 -0
  116. package/lib/typescript/src/components/Typography/index.d.ts +2 -0
  117. package/lib/typescript/src/components/Typography/index.d.ts.map +1 -0
  118. package/lib/typescript/src/hooks/index.d.ts +4 -0
  119. package/lib/typescript/src/hooks/index.d.ts.map +1 -0
  120. package/lib/typescript/src/hooks/useDebounce.d.ts +2 -0
  121. package/lib/typescript/src/hooks/useDebounce.d.ts.map +1 -0
  122. package/lib/typescript/src/hooks/useNeetoTheme.d.ts +8 -0
  123. package/lib/typescript/src/hooks/useNeetoTheme.d.ts.map +1 -0
  124. package/lib/typescript/src/hooks/useRefreshByUser.d.ts +5 -0
  125. package/lib/typescript/src/hooks/useRefreshByUser.d.ts.map +1 -0
  126. package/lib/typescript/src/index.d.ts +31 -0
  127. package/lib/typescript/src/index.d.ts.map +1 -0
  128. package/lib/typescript/src/theme/palette.d.ts +28 -0
  129. package/lib/typescript/src/theme/palette.d.ts.map +1 -0
  130. package/lib/typescript/src/theme/palette.generated.d.ts +134 -0
  131. package/lib/typescript/src/theme/palette.generated.d.ts.map +1 -0
  132. package/lib/typescript/src/theme/tokens.d.ts +184 -0
  133. package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
  134. package/lib/typescript/src/unistyles-init.d.ts +2 -0
  135. package/lib/typescript/src/unistyles-init.d.ts.map +1 -0
  136. package/lib/typescript/src/unistyles.d.ts +21 -0
  137. package/lib/typescript/src/unistyles.d.ts.map +1 -0
  138. package/lib/typescript/src/utils/index.d.ts +18 -0
  139. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  140. package/lib/typescript/src/utils/scale.d.ts +2 -0
  141. package/lib/typescript/src/utils/scale.d.ts.map +1 -0
  142. package/package.json +125 -51
  143. package/src/components/Alert/Alert.tsx +222 -0
  144. package/src/components/Alert/index.ts +1 -0
  145. package/src/components/Avatar/Avatar.tsx +123 -0
  146. package/src/components/Avatar/index.ts +1 -0
  147. package/src/components/BottomSheet/BottomSheet.tsx +468 -0
  148. package/src/components/BottomSheet/index.ts +5 -0
  149. package/src/components/BottomSheetMenu/BottomSheetMenu.tsx +150 -0
  150. package/src/components/BottomSheetMenu/index.ts +5 -0
  151. package/src/components/Button/Button.tsx +134 -0
  152. package/src/components/Button/index.ts +1 -0
  153. package/src/components/ChatInput/AttachmentsView.tsx +68 -0
  154. package/src/components/ChatInput/ChatInput.tsx +393 -0
  155. package/src/components/ChatInput/IconButton.tsx +52 -0
  156. package/src/components/ChatInput/MentionsInput.tsx +126 -0
  157. package/src/components/ChatInput/constants.ts +18 -0
  158. package/src/components/ChatInput/index.ts +11 -0
  159. package/src/components/ChatInput/mentions.ts +91 -0
  160. package/src/components/CheckBox/CheckBox.tsx +86 -0
  161. package/src/components/CheckBox/index.ts +1 -0
  162. package/src/components/Container/Container.tsx +14 -0
  163. package/src/components/Container/index.ts +1 -0
  164. package/src/components/Divider/Divider.tsx +32 -0
  165. package/src/components/Divider/index.ts +1 -0
  166. package/src/components/EmptyView/EmptyView.tsx +80 -0
  167. package/src/components/EmptyView/index.ts +1 -0
  168. package/src/components/FlashList/FlashList.tsx +162 -0
  169. package/src/components/FlashList/index.ts +1 -0
  170. package/src/components/Header/BaseHeader.tsx +19 -0
  171. package/src/components/Header/Header.tsx +114 -0
  172. package/src/components/Header/ScreenHeader.tsx +34 -0
  173. package/src/components/Header/index.ts +3 -0
  174. package/src/components/Input/Input.tsx +122 -0
  175. package/src/components/Input/index.ts +1 -0
  176. package/src/components/Loader/Loader.tsx +93 -0
  177. package/src/components/Loader/index.ts +1 -0
  178. package/src/components/NeetoUIProvider/NeetoUIProvider.tsx +43 -0
  179. package/src/components/NeetoUIProvider/index.ts +1 -0
  180. package/src/components/OnBoarding/OnBoarding.tsx +177 -0
  181. package/src/components/OnBoarding/index.ts +5 -0
  182. package/src/components/ParentView/ParentView.tsx +98 -0
  183. package/src/components/ParentView/index.ts +1 -0
  184. package/src/components/RadioButton/RadioButton.tsx +80 -0
  185. package/src/components/RadioButton/index.ts +1 -0
  186. package/src/components/ScrollView/ScrollView.tsx +30 -0
  187. package/src/components/ScrollView/index.ts +1 -0
  188. package/src/components/SearchBar/SearchBar.tsx +122 -0
  189. package/src/components/SearchBar/index.ts +1 -0
  190. package/src/components/Skeleton/Skeleton.tsx +121 -0
  191. package/src/components/Skeleton/index.ts +1 -0
  192. package/src/components/TextWithUrl/TextWithUrl.tsx +54 -0
  193. package/src/components/TextWithUrl/index.ts +1 -0
  194. package/src/components/Toast/Toast.tsx +157 -0
  195. package/src/components/Toast/ToastGlyph.tsx +53 -0
  196. package/src/components/Toast/index.ts +1 -0
  197. package/src/components/Touchable/Touchable.tsx +54 -0
  198. package/src/components/Touchable/index.ts +1 -0
  199. package/src/components/Typography/Typography.tsx +76 -0
  200. package/src/components/Typography/index.ts +1 -0
  201. package/src/hooks/index.ts +3 -0
  202. package/src/hooks/useDebounce.ts +17 -0
  203. package/src/hooks/useNeetoTheme.ts +10 -0
  204. package/src/hooks/useRefreshByUser.ts +17 -0
  205. package/src/index.ts +68 -0
  206. package/src/theme/palette.generated.ts +141 -0
  207. package/src/theme/palette.ts +34 -0
  208. package/src/theme/tokens.ts +205 -0
  209. package/src/types/neeto-icons-rn.d.ts +33 -0
  210. package/src/unistyles-init.ts +16 -0
  211. package/src/unistyles.ts +34 -0
  212. package/src/utils/index.ts +41 -0
  213. package/src/utils/scale.ts +16 -0
  214. package/components/Accordion.js +0 -1
  215. package/components/ActionIcon.js +0 -1
  216. package/components/Alert.js +0 -1
  217. package/components/Avatar.js +0 -1
  218. package/components/Badge.js +0 -1
  219. package/components/BottomSheet.js +0 -1
  220. package/components/BottomTabBar.js +0 -1
  221. package/components/Button.js +0 -1
  222. package/components/ButtonGroup.js +0 -1
  223. package/components/Calendar.js +0 -1
  224. package/components/Card.js +0 -1
  225. package/components/Carousel.js +0 -1
  226. package/components/ChatInput/AttachmentsView.js +0 -1
  227. package/components/ChatInput/Badge.js +0 -1
  228. package/components/ChatInput/ChatInput.js +0 -1
  229. package/components/ChatInput/EmailFields.js +0 -1
  230. package/components/ChatInput/IconButton.js +0 -1
  231. package/components/ChatInput/MentionsInputWrapper.js +0 -1
  232. package/components/CheckBox.js +0 -1
  233. package/components/Chip.js +0 -1
  234. package/components/Container.js +0 -1
  235. package/components/Divider.js +0 -1
  236. package/components/FAB.js +0 -1
  237. package/components/FlashList.js +0 -1
  238. package/components/FlatList.js +0 -1
  239. package/components/Input.js +0 -1
  240. package/components/InputEmailChip.js +0 -1
  241. package/components/LineLoader.js +0 -1
  242. package/components/ListItem.js +0 -1
  243. package/components/Loader.js +0 -1
  244. package/components/MultiSelect.js +0 -1
  245. package/components/NotificationIcon.js +0 -1
  246. package/components/NotificationPreferenceList.js +0 -1
  247. package/components/OnBoarding.js +0 -1
  248. package/components/OrganizationItem.js +0 -1
  249. package/components/OtpInputs.js +0 -1
  250. package/components/ParentView.js +0 -1
  251. package/components/Popover.js +0 -1
  252. package/components/RadioButton.js +0 -1
  253. package/components/RichTextEditor.js +0 -1
  254. package/components/Ripple.js +0 -1
  255. package/components/ScrollView.js +0 -1
  256. package/components/SearchBar.js +0 -1
  257. package/components/SegmentedTopBar/Indicator.js +0 -1
  258. package/components/SegmentedTopBar/Tab.js +0 -1
  259. package/components/SegmentedTopBar/index.js +0 -1
  260. package/components/SocialButton.js +0 -1
  261. package/components/Toast.js +0 -1
  262. package/components/ToggleSwitch.js +0 -1
  263. package/components/TopBar.js +0 -1
  264. package/components/Touchable.js +0 -1
  265. package/components/TouchableWithoutFeedback.js +0 -1
  266. package/components/Typography.js +0 -1
  267. package/components/index.js +0 -1
  268. package/config/index.js +0 -1
  269. package/config/toasterConfig.js +0 -1
  270. package/contexts/index.js +0 -1
  271. package/hooks/index.js +0 -1
  272. package/hooks/useDebounce.js +0 -1
  273. package/hooks/useKeyboard.js +0 -1
  274. package/hooks/useRefreshByUser.js +0 -1
  275. package/index.d.ts +0 -630
  276. package/index.js +0 -1
  277. package/react-native.config.js +0 -10
  278. package/theme/index.js +0 -1
  279. package/utils/index.js +0 -1
  280. package/utils/scale.js +0 -1
@@ -0,0 +1,76 @@
1
+ import { Text, type TextProps } from "react-native";
2
+ import { StyleSheet, type UnistylesVariants } from "react-native-unistyles";
3
+
4
+ type TypographyVariants = UnistylesVariants<typeof styles>;
5
+
6
+ export type TypographyProps = TextProps &
7
+ TypographyVariants & {
8
+ color?: string;
9
+ };
10
+
11
+ export const Typography = ({
12
+ variant,
13
+ size,
14
+ weight,
15
+ color,
16
+ style,
17
+ children,
18
+ ...rest
19
+ }: TypographyProps) => {
20
+ styles.useVariants({ variant, size, weight });
21
+
22
+ return (
23
+ <Text {...rest} style={[styles.text, !!color && { color }, style]}>
24
+ {children}
25
+ </Text>
26
+ );
27
+ };
28
+
29
+ const styles = StyleSheet.create(theme => ({
30
+ text: {
31
+ color: theme.colors.text.primary,
32
+ fontFamily: theme.fonts.regular,
33
+ fontSize: theme.fontSizes.s,
34
+ variants: {
35
+ variant: {
36
+ body: {
37
+ color: theme.colors.text.muted,
38
+ },
39
+ header: {
40
+ fontFamily: theme.fonts.semibold,
41
+ fontSize: theme.fontSizes["3xl"],
42
+ },
43
+ modalHeader: {
44
+ fontFamily: theme.fonts.semibold,
45
+ fontSize: theme.fontSizes.xl,
46
+ },
47
+ subtext: {
48
+ fontSize: theme.fontSizes["2xs"],
49
+ },
50
+ default: {},
51
+ },
52
+ size: {
53
+ "4xs": { fontSize: theme.fontSizes["4xs"] },
54
+ "3xs": { fontSize: theme.fontSizes["3xs"] },
55
+ "2xs": { fontSize: theme.fontSizes["2xs"] },
56
+ xs: { fontSize: theme.fontSizes.xs },
57
+ s: { fontSize: theme.fontSizes.s },
58
+ m: { fontSize: theme.fontSizes.m },
59
+ l: { fontSize: theme.fontSizes.l },
60
+ xl: { fontSize: theme.fontSizes.xl },
61
+ "2xl": { fontSize: theme.fontSizes["2xl"] },
62
+ "3xl": { fontSize: theme.fontSizes["3xl"] },
63
+ "4xl": { fontSize: theme.fontSizes["4xl"] },
64
+ "5xl": { fontSize: theme.fontSizes["5xl"] },
65
+ default: {},
66
+ },
67
+ weight: {
68
+ regular: { fontFamily: theme.fonts.regular },
69
+ medium: { fontFamily: theme.fonts.medium },
70
+ semibold: { fontFamily: theme.fonts.semibold },
71
+ bold: { fontFamily: theme.fonts.bold },
72
+ default: {},
73
+ },
74
+ },
75
+ },
76
+ }));
@@ -0,0 +1 @@
1
+ export { Typography, type TypographyProps } from "./Typography";
@@ -0,0 +1,3 @@
1
+ export { useDebounce } from "./useDebounce";
2
+ export { useNeetoTheme } from "./useNeetoTheme";
3
+ export { useRefreshByUser } from "./useRefreshByUser";
@@ -0,0 +1,17 @@
1
+ import { useEffect, useState } from "react";
2
+
3
+ export function useDebounce<T>(value: T, delay: number): T {
4
+ const [debouncedValue, setDebouncedValue] = useState(value);
5
+
6
+ useEffect(() => {
7
+ const handler = setTimeout(() => {
8
+ setDebouncedValue(value);
9
+ }, delay);
10
+
11
+ return () => {
12
+ clearTimeout(handler);
13
+ };
14
+ }, [value, delay]);
15
+
16
+ return debouncedValue;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { useUnistyles } from "react-native-unistyles";
2
+
3
+ import { type NeetoTheme } from "../theme/tokens";
4
+
5
+ /**
6
+ * Reactive, fully-typed access to the active theme for app code:
7
+ * `theme.colors.border.primary`, `theme.spacing.md`, … Re-renders on
8
+ * theme change (adaptive dark mode included).
9
+ */
10
+ export const useNeetoTheme = (): NeetoTheme => useUnistyles().theme;
@@ -0,0 +1,17 @@
1
+ import { useState } from "react";
2
+
3
+ export function useRefreshByUser(refetch: () => Promise<unknown> | unknown) {
4
+ const [isRefetchingByUser, setIsRefetchingByUser] = useState(false);
5
+
6
+ async function refetchByUser() {
7
+ setIsRefetchingByUser(true);
8
+
9
+ try {
10
+ await refetch();
11
+ } finally {
12
+ setIsRefetchingByUser(false);
13
+ }
14
+ }
15
+
16
+ return { isRefetchingByUser, refetchByUser };
17
+ }
package/src/index.ts ADDED
@@ -0,0 +1,68 @@
1
+ // Must stay the first import — see unistyles-init.ts.
2
+ import "./unistyles-init";
3
+
4
+ export { Alert, type AlertButton, type AlertParams } from "./components/Alert";
5
+ export { Avatar, getAvatarColor, type AvatarProps } from "./components/Avatar";
6
+ export {
7
+ BottomSheet,
8
+ type BottomSheetProps,
9
+ type BottomSheetContentRowProps,
10
+ } from "./components/BottomSheet";
11
+ export {
12
+ BottomSheetMenu,
13
+ type BottomSheetMenuItem,
14
+ type BottomSheetMenuProps,
15
+ } from "./components/BottomSheetMenu";
16
+ export { Button, type ButtonProps } from "./components/Button";
17
+ export {
18
+ ChatInput,
19
+ OPTION_TYPES,
20
+ convertMentionsToHTMLAndPlainText,
21
+ type ChatInputOption,
22
+ type ChatInputPayload,
23
+ type ChatInputProps,
24
+ type ChatInputRef,
25
+ type MentionSuggestion,
26
+ } from "./components/ChatInput";
27
+ export { CheckBox, type CheckBoxProps } from "./components/CheckBox";
28
+ export { FlashList, type FlashListProps } from "./components/FlashList";
29
+ export { Skeleton, type SkeletonProps } from "./components/Skeleton";
30
+ export { Toast, defaultToasterConfig } from "./components/Toast";
31
+ export { Container, type ContainerProps } from "./components/Container";
32
+ export { Divider, type DividerProps } from "./components/Divider";
33
+ export { EmptyView, type EmptyViewProps } from "./components/EmptyView";
34
+ export {
35
+ BaseHeader,
36
+ Header,
37
+ ScreenHeader,
38
+ type BaseHeaderProps,
39
+ type HeaderProps,
40
+ type ScreenHeaderProps,
41
+ } from "./components/Header";
42
+ export { Input, type InputProps } from "./components/Input";
43
+ export { Loader, type LoaderProps } from "./components/Loader";
44
+ export {
45
+ NeetoUIProvider,
46
+ type NeetoUIProviderProps,
47
+ } from "./components/NeetoUIProvider";
48
+ export {
49
+ OnBoarding,
50
+ type OnBoardingProps,
51
+ type OnBoardingSlide,
52
+ } from "./components/OnBoarding";
53
+ export { ParentView, type ParentViewProps } from "./components/ParentView";
54
+ export { RadioButton, type RadioButtonProps } from "./components/RadioButton";
55
+ export { ScrollView, type ScrollViewProps } from "./components/ScrollView";
56
+ export { SearchBar, type SearchBarProps } from "./components/SearchBar";
57
+ export { TextWithUrl, type TextWithUrlProps } from "./components/TextWithUrl";
58
+ export { Touchable, type TouchableProps } from "./components/Touchable";
59
+ export { Typography, type TypographyProps } from "./components/Typography";
60
+ export { useDebounce, useNeetoTheme, useRefreshByUser } from "./hooks";
61
+ export {
62
+ breakpoints,
63
+ darkTheme,
64
+ lightTheme,
65
+ type NeetoTheme,
66
+ } from "./theme/tokens";
67
+ export { configureNeetoUI } from "./unistyles";
68
+ export { getShadowStyles, isValidEmail, moderateScale } from "./utils";
@@ -0,0 +1,141 @@
1
+ // GENERATED FILE — do not edit by hand.
2
+ // Source: web neetoUI SCSS tokens (src/styles/abstracts/_variables.scss + _theme.scss).
3
+ // Regenerate with: yarn generate:tokens
4
+
5
+ export const webPalette = {
6
+ light: {
7
+ white: "#ffffff",
8
+ black: "#0c111d",
9
+ gray800: "#101828",
10
+ gray700: "#1d2939",
11
+ gray600: "#344054",
12
+ gray500: "#87929d",
13
+ gray400: "#c2c8cc",
14
+ gray300: "#d8dcde",
15
+ gray200: "#e9ebed",
16
+ gray100: "#f6f7f8",
17
+ gray50: "#fafafa",
18
+ primary800: "#006653",
19
+ primary600: "#007a64",
20
+ primary500: "#008068",
21
+ primary100: "#e1f3ee",
22
+ primary50: "#f0f9f7",
23
+ accent800: "#095aba",
24
+ accent600: "#0d66d0",
25
+ accent500: "#1473e6",
26
+ accent100: "#e6f4ff",
27
+ accent50: "#eff8ff",
28
+ success800: "#01795d",
29
+ success600: "#018d6d",
30
+ success500: "#02a27c",
31
+ success100: "#ebfffa",
32
+ error800: "#bb121a",
33
+ error600: "#c9252d",
34
+ error500: "#d7373f",
35
+ error100: "#feecf0",
36
+ info800: "#095aba",
37
+ info600: "#0d66d0",
38
+ info500: "#1473e6",
39
+ info100: "#e2f2ff",
40
+ warning800: "#bd640d",
41
+ warning600: "#cb6f10",
42
+ warning500: "#da7b11",
43
+ warning100: "#fbf2e1",
44
+ pastelSilver: "#e8e9ed",
45
+ pastelRed: "#ffe5e5",
46
+ pastelYellow: "#fef3c5",
47
+ pastelGreen: "#d3f9e8",
48
+ pastelBlue: "#ecf4ff",
49
+ pastelPurple: "#eeebff",
50
+ pastelPink: "#fde2f1",
51
+ },
52
+ dark: {
53
+ white: "#121212",
54
+ black: "#e0e0e0",
55
+ gray800: "#c8c8c8",
56
+ gray700: "#a2a2a2",
57
+ gray600: "#7c7c7c",
58
+ gray500: "#5c5c5c",
59
+ gray400: "#494949",
60
+ gray300: "#393939",
61
+ gray200: "#2c2c2c",
62
+ gray100: "#1e1e1e",
63
+ gray50: "#0a0a0a",
64
+ primary800: "#00e0b7",
65
+ primary600: "#06cf9c",
66
+ primary500: "#00a884",
67
+ primary100: "#003d31",
68
+ primary50: "#002921",
69
+ accent800: "#8ebdf5",
70
+ accent600: "#69a7f2",
71
+ accent500: "#4390ef",
72
+ accent100: "#111a2c",
73
+ accent50: "#0b111d",
74
+ success800: "#00e0b7",
75
+ success600: "#06cf9c",
76
+ success500: "#00a884",
77
+ success100: "#162312",
78
+ error800: "#f76d74",
79
+ error600: "#ec5b62",
80
+ error500: "#e34850",
81
+ error100: "#2c1618",
82
+ info800: "#8ebdf5",
83
+ info600: "#69a7f2",
84
+ info500: "#4390ef",
85
+ info100: "#111a2c",
86
+ warning800: "#f9a43f",
87
+ warning600: "#f29423",
88
+ warning500: "#e68619",
89
+ warning100: "#2b2111",
90
+ pastelSilver: "#40424a",
91
+ pastelRed: "#732d2d",
92
+ pastelYellow: "#826414",
93
+ pastelGreen: "#327d6e",
94
+ pastelBlue: "#2d5078",
95
+ pastelPurple: "#4b3c7d",
96
+ pastelPink: "#7d325a",
97
+ },
98
+ };
99
+
100
+ export const webRadii = {
101
+ none: 0,
102
+ sm: 3,
103
+ "": 5,
104
+ md: 6,
105
+ lg: 8,
106
+ xl: 12,
107
+ full: 999,
108
+ };
109
+
110
+ export const webFontSizes = {
111
+ xxs: 10,
112
+ xs: 12,
113
+ sm: 14,
114
+ base: 16,
115
+ lg: 18,
116
+ xl: 20,
117
+ "2xl": 24,
118
+ "3xl": 32,
119
+ "4xl": 48,
120
+ };
121
+
122
+ export const webFontWeights = {
123
+ thin: 100,
124
+ extralight: 200,
125
+ light: 300,
126
+ normal: 400,
127
+ medium: 500,
128
+ semibold: 600,
129
+ bold: 700,
130
+ extrabold: 800,
131
+ black: 900,
132
+ };
133
+
134
+ export const webLineHeights = {
135
+ none: 1,
136
+ tight: 1.25,
137
+ snug: 1.375,
138
+ normal: 1.5,
139
+ relaxed: 1.625,
140
+ loose: 2,
141
+ };
@@ -0,0 +1,34 @@
1
+ // Raw color ramps carried over from the v2 theme. Values are the parity source
2
+ // until the web-Tailwind token-generation script lands (Phase A spike item).
3
+ export const palette = {
4
+ white: "#ffffff",
5
+ base: "#008068",
6
+ danger: "#D7373F",
7
+ success: "#018d6d",
8
+ menubackground: "#F6F6FA",
9
+
10
+ grey: "#828282",
11
+ grey100: "#f8f9f9",
12
+ grey200: "#e9ebed",
13
+ grey300: "#d8dcde",
14
+ grey400: "#c2c8cc",
15
+ grey500: "#87929d",
16
+ grey600: "#68737d",
17
+ grey700: "#2f3941",
18
+ grey800: "#1f1f1f",
19
+
20
+ darkBlue100: "#0B4885",
21
+
22
+ lightBlue100: "#EAF3FC",
23
+ lightBlue400: "#4558F9",
24
+
25
+ purple100: "#F2F4FF",
26
+ purple200: "#ECF4FF",
27
+ purple500: "#4557F8",
28
+ purple700: "#342DF4",
29
+
30
+ green500: "#34C759",
31
+ green600: "#33C8A0",
32
+ green700: "#00BA88",
33
+ green800: "#00956D",
34
+ };
@@ -0,0 +1,205 @@
1
+ import { moderateScale } from "../utils/scale";
2
+ import { palette } from "./palette";
3
+ import { webPalette } from "./palette.generated";
4
+
5
+ const fonts = {
6
+ regular: "SFProText-Regular",
7
+ medium: "SFProText-Medium",
8
+ semibold: "SFProText-Semibold",
9
+ bold: "SFProText-Bold",
10
+ };
11
+
12
+ // Size scale absorbs v2's react-native-size-matters usage: values are
13
+ // moderateScale'd once at startup, exactly as the v2 theme did.
14
+ const fontSizes = {
15
+ "4xs": moderateScale(10),
16
+ "3xs": moderateScale(11),
17
+ "2xs": moderateScale(12),
18
+ xs: moderateScale(13),
19
+ s: moderateScale(14),
20
+ m: moderateScale(15),
21
+ l: moderateScale(16),
22
+ xl: moderateScale(17),
23
+ "2xl": moderateScale(18),
24
+ "3xl": moderateScale(20),
25
+ "4xl": moderateScale(22),
26
+ "5xl": moderateScale(30),
27
+ };
28
+
29
+ const spacing = {
30
+ none: 0,
31
+ xxs: 2,
32
+ xs: 4,
33
+ sm: 8,
34
+ md: 12,
35
+ lg: 16,
36
+ xl: 24,
37
+ "2xl": 32,
38
+ "3xl": 48,
39
+ };
40
+
41
+ const radii = {
42
+ none: 0,
43
+ sm: 2,
44
+ md: 6,
45
+ lg: 8,
46
+ xl: 12,
47
+ full: 9999,
48
+ };
49
+
50
+ // Token elevations absorb v2's getShadowStyles util.
51
+ const elevation = {
52
+ none: {},
53
+ low: {
54
+ shadowColor: "#000000",
55
+ shadowOffset: { width: 0, height: 1 },
56
+ shadowOpacity: 0.18,
57
+ shadowRadius: 1,
58
+ elevation: 2,
59
+ },
60
+ medium: {
61
+ shadowColor: "#000000",
62
+ shadowOffset: { width: 0, height: 2 },
63
+ shadowOpacity: 0.2,
64
+ shadowRadius: 3,
65
+ elevation: 4,
66
+ },
67
+ high: {
68
+ shadowColor: "#000000",
69
+ shadowOffset: { width: 0, height: 4 },
70
+ shadowOpacity: 0.25,
71
+ shadowRadius: 6,
72
+ elevation: 8,
73
+ },
74
+ };
75
+
76
+ export const breakpoints = {
77
+ xs: 0,
78
+ sm: 576,
79
+ md: 768,
80
+ lg: 992,
81
+ xl: 1200,
82
+ };
83
+
84
+ // Dark counterpart of the raw v2 ramp. The web library flips EVERY
85
+ // variable in .neeto-ui-theme--dark — including the gray ramp, whose
86
+ // meaning inverts (gray800 becomes light text on dark surfaces). A dark
87
+ // theme that keeps the light ramp glares: light-grey borders and
88
+ // unreadable muted text on #121212 (the original v3 dark-mode bug).
89
+ const darkPalette: typeof palette = {
90
+ white: webPalette.dark.white,
91
+ base: webPalette.dark.primary500,
92
+ danger: webPalette.dark.error500,
93
+ success: webPalette.dark.success500,
94
+ menubackground: webPalette.dark.gray100,
95
+
96
+ grey: webPalette.dark.gray600,
97
+ grey100: webPalette.dark.gray100,
98
+ grey200: webPalette.dark.gray200,
99
+ grey300: webPalette.dark.gray300,
100
+ grey400: webPalette.dark.gray400,
101
+ grey500: webPalette.dark.gray500,
102
+ grey600: webPalette.dark.gray600,
103
+ grey700: webPalette.dark.gray700,
104
+ grey800: webPalette.dark.gray800,
105
+
106
+ darkBlue100: webPalette.dark.accent800,
107
+
108
+ lightBlue100: webPalette.dark.accent100,
109
+ lightBlue400: webPalette.dark.accent500,
110
+
111
+ // v2's purple is an accent role; the web dark theme's accent ramp is
112
+ // its closest semantic counterpart.
113
+ purple100: webPalette.dark.accent50,
114
+ purple200: webPalette.dark.accent100,
115
+ purple500: webPalette.dark.accent500,
116
+ purple700: webPalette.dark.accent600,
117
+
118
+ green500: webPalette.dark.success600,
119
+ green600: webPalette.dark.success600,
120
+ green700: webPalette.dark.success500,
121
+ green800: webPalette.dark.primary600,
122
+ };
123
+
124
+ export const lightTheme = {
125
+ colors: {
126
+ white: "#ffffff",
127
+ primary: palette.base,
128
+ danger: palette.danger,
129
+ success: palette.success,
130
+ text: {
131
+ primary: "#2F3941",
132
+ secondary: "#49545C",
133
+ muted: palette.grey500,
134
+ inverse: palette.white,
135
+ },
136
+ background: {
137
+ primary: palette.white,
138
+ secondary: palette.menubackground,
139
+ oldLace: "#FDF6E5",
140
+ },
141
+ border: {
142
+ primary: "#E9EBED",
143
+ secondary: "#C2C8CC",
144
+ },
145
+ toast: {
146
+ success: "#00BA88",
147
+ error: "#F56A58",
148
+ info: "#276EF1",
149
+ warning: "#F3CD82",
150
+ },
151
+ palette,
152
+ // The complete web neetoUI ramp (44 tokens, generated — see
153
+ // scripts/generate-tokens.mjs). Theme-aware: reading
154
+ // theme.colors.web.gray600 yields the dark value in dark mode, which
155
+ // importing webPalette directly would not. This is the source of truth
156
+ // for new code; `palette` above is the frozen v2 subset.
157
+ web: webPalette.light,
158
+ },
159
+ fonts,
160
+ fontSizes,
161
+ spacing,
162
+ radii,
163
+ elevation,
164
+ };
165
+
166
+ export type NeetoTheme = typeof lightTheme;
167
+
168
+ // Dark palette generated from the web neetoUI dark theme
169
+ // (scripts/generate-tokens.mjs). oldLace has no web equivalent — kept as a
170
+ // hand-tuned dark approximation.
171
+ export const darkTheme: NeetoTheme = {
172
+ ...lightTheme,
173
+ colors: {
174
+ ...lightTheme.colors,
175
+ white: "#ffffff",
176
+ primary: webPalette.dark.primary500,
177
+ danger: webPalette.dark.error500,
178
+ success: webPalette.dark.success500,
179
+ text: {
180
+ primary: webPalette.dark.gray800,
181
+ secondary: webPalette.dark.gray700,
182
+ // gray600, not gray500: the dark gray500 (#5c5c5c) is unreadable
183
+ // on #121212 — web uses the 600+ range for muted copy.
184
+ muted: webPalette.dark.gray600,
185
+ inverse: webPalette.dark.white,
186
+ },
187
+ background: {
188
+ primary: webPalette.dark.white,
189
+ secondary: webPalette.dark.gray100,
190
+ oldLace: "#2F2A1D",
191
+ },
192
+ border: {
193
+ primary: webPalette.dark.gray300,
194
+ secondary: webPalette.dark.gray400,
195
+ },
196
+ toast: {
197
+ success: webPalette.dark.success500,
198
+ error: webPalette.dark.error500,
199
+ info: webPalette.dark.info500,
200
+ warning: webPalette.dark.warning500,
201
+ },
202
+ palette: darkPalette,
203
+ web: webPalette.dark,
204
+ },
205
+ };
@@ -0,0 +1,33 @@
1
+ // @bigbinary/neeto-icons-rn ships no TypeScript types (and an exports map
2
+ // whose "." entry is an extensionless directory only the metro resolver
3
+ // accepts). Minimal ambient typing until the icons package ships its own.
4
+ declare module "@bigbinary/neeto-icons-rn" {
5
+ import { type ComponentType } from "react";
6
+
7
+ export type NeetoIconProps = {
8
+ size?: number;
9
+ color?: string;
10
+ strokeWidth?: number;
11
+ };
12
+
13
+ export const Attachment: ComponentType<NeetoIconProps>;
14
+ export const BookOpen: ComponentType<NeetoIconProps>;
15
+ export const CannedResponses: ComponentType<NeetoIconProps>;
16
+ export const ChatBubble: ComponentType<NeetoIconProps>;
17
+ export const Check: ComponentType<NeetoIconProps>;
18
+ export const Delete: ComponentType<NeetoIconProps>;
19
+ export const Down: ComponentType<NeetoIconProps>;
20
+ export const Edit: ComponentType<NeetoIconProps>;
21
+ export const Expand: ComponentType<NeetoIconProps>;
22
+ export const Forward: ComponentType<NeetoIconProps>;
23
+ export const LeftArrow: ComponentType<NeetoIconProps>;
24
+ export const Minimize: ComponentType<NeetoIconProps>;
25
+ export const Notes: ComponentType<NeetoIconProps>;
26
+ export const Radio: ComponentType<NeetoIconProps>;
27
+ export const SendPlane: ComponentType<NeetoIconProps>;
28
+ export const RadioInactive: ComponentType<NeetoIconProps>;
29
+ export const Checkbox: ComponentType<NeetoIconProps>;
30
+ export const CheckboxInactive: ComponentType<NeetoIconProps>;
31
+ export const Search: ComponentType<NeetoIconProps>;
32
+ export const Close: ComponentType<NeetoIconProps>;
33
+ }
@@ -0,0 +1,16 @@
1
+ // Imported for its side effect as src/index.ts's FIRST import.
2
+ //
3
+ // Unistyles hard-requires StyleSheet.configure to run before any
4
+ // StyleSheet.create, and every component module calls create at module
5
+ // scope. Configuring inside NeetoUIProvider's render loses that race the
6
+ // moment a bundler evaluates the library module before the provider
7
+ // renders — release-mode inline requires on native and ESM import
8
+ // hoisting on web both do exactly that. Evaluating the root entry
9
+ // therefore registers the themes itself; the provider's explicit call
10
+ // stays as an idempotent fallback for deep-import edge cases.
11
+ //
12
+ // This file (and only this file) is declared in package.json
13
+ // "sideEffects" so bundlers never tree-shake the bare import away.
14
+ import { configureNeetoUI } from "./unistyles";
15
+
16
+ configureNeetoUI();
@@ -0,0 +1,34 @@
1
+ import { StyleSheet } from "react-native-unistyles";
2
+
3
+ import { breakpoints, darkTheme, lightTheme } from "./theme/tokens";
4
+
5
+ type AppThemes = {
6
+ light: typeof lightTheme;
7
+ dark: typeof darkTheme;
8
+ };
9
+
10
+ type AppBreakpoints = typeof breakpoints;
11
+
12
+ declare module "react-native-unistyles" {
13
+ export interface UnistylesThemes extends AppThemes {}
14
+ export interface UnistylesBreakpoints extends AppBreakpoints {}
15
+ }
16
+
17
+ let isConfigured = false;
18
+
19
+ /**
20
+ * One-time Unistyles registration, idempotent. Runs automatically when the
21
+ * library root is imported (src/unistyles-init.ts) because Unistyles
22
+ * requires configure() before any module-scope StyleSheet.create;
23
+ * NeetoUIProvider and tests may call it again safely.
24
+ */
25
+ export const configureNeetoUI = () => {
26
+ if (isConfigured) return;
27
+ isConfigured = true;
28
+
29
+ StyleSheet.configure({
30
+ themes: { light: lightTheme, dark: darkTheme },
31
+ breakpoints,
32
+ settings: { adaptiveThemes: true },
33
+ });
34
+ };