rn-vs-lb 1.0.55 → 1.0.57

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 +79 -4
  2. package/app/(pages)/index.tsx +20 -0
  3. package/app/(storybook)/index.tsx +7 -0
  4. package/app/_layout.tsx +19 -0
  5. package/app.json +45 -0
  6. package/assets/adaptive-icon.png +0 -0
  7. package/assets/favicon.png +0 -0
  8. package/assets/icon-storybook.png +0 -0
  9. package/assets/icon.png +0 -0
  10. package/assets/splash-icon.png +0 -0
  11. package/assets/splash.png +0 -0
  12. package/babel.config.js +11 -0
  13. package/components/Button/Button.stories.tsx +131 -0
  14. package/components/Button/Button.tsx +146 -0
  15. package/components/Button/DeleteAccountButton.stories.tsx +26 -0
  16. package/components/Button/DeleteAccountButton.tsx +84 -0
  17. package/components/Button/PostButton.stories.tsx +36 -0
  18. package/components/Button/PostButton.tsx +45 -0
  19. package/components/Button/TelegramFeedbackLink.stories.tsx +28 -0
  20. package/components/Button/TelegramFeedbackLink.tsx +44 -0
  21. package/{dist/types/components/buttons/index.d.ts → components/Button/index.ts} +2 -0
  22. package/components/Cards/EventCard.stories.tsx +128 -0
  23. package/components/Cards/EventCard.tsx +193 -0
  24. package/components/Cards/PlaceCard.stories.tsx +87 -0
  25. package/components/Cards/PlaceCard.tsx +83 -0
  26. package/components/Cards/index.tsx +4 -0
  27. package/components/Chat/ChatItem.stories.tsx +174 -0
  28. package/components/Chat/ChatItem.styles.ts +72 -0
  29. package/components/Chat/ChatItem.tsx +133 -0
  30. package/components/Chat/ChatTab/ChatTabs.stories.tsx +68 -0
  31. package/components/Chat/ChatTab/ChatTabs.tsx +90 -0
  32. package/components/Chat/ChatTab/SubTabButton.stories.tsx +30 -0
  33. package/components/Chat/ChatTab/SubTabButton.tsx +52 -0
  34. package/components/Chat/InputMessage.stories.tsx +200 -0
  35. package/components/Chat/InputMessage.tsx +290 -0
  36. package/components/Chat/MessageItem/ImagesStrip.tsx +26 -0
  37. package/components/Chat/MessageItem/LinkyText.tsx +43 -0
  38. package/components/Chat/MessageItem/MessageItem.stories.tsx +292 -0
  39. package/components/Chat/MessageItem/MessageItem.tsx +139 -0
  40. package/components/Chat/MessageItem/ReplyBox.tsx +27 -0
  41. package/components/Chat/MessageItem/index.ts +4 -0
  42. package/components/Chat/MessageItem/styles.ts +138 -0
  43. package/components/Chat/MessageItem/types.ts +47 -0
  44. package/components/Chat/PinnedMessagesBar/PinnedChip.tsx +82 -0
  45. package/components/Chat/PinnedMessagesBar/PinnedMessagesBar.stories.tsx +168 -0
  46. package/components/Chat/PinnedMessagesBar/PinnedMessagesBar.tsx +191 -0
  47. package/components/Chat/PinnedMessagesBar/PinnedModal.tsx +81 -0
  48. package/components/Chat/PinnedMessagesBar/index.ts +3 -0
  49. package/components/Chat/PinnedMessagesBar/styles.ts +116 -0
  50. package/components/Chat/PinnedMessagesBar/types.ts +34 -0
  51. package/components/Chat/index.ts +21 -0
  52. package/components/Header/HeaderDefault.stories.tsx +79 -0
  53. package/components/Header/HeaderDefault.tsx +74 -0
  54. package/components/Header/HeaderEdit.stories.tsx +45 -0
  55. package/components/Header/HeaderEdit.tsx +74 -0
  56. package/components/Header/HeaderHome.stories.tsx +63 -0
  57. package/components/Header/HeaderHome.tsx +63 -0
  58. package/components/Header/HeaderSwitcher.stories.tsx +73 -0
  59. package/components/Header/HeaderSwitcher.tsx +47 -0
  60. package/components/Header/HeaderWithImg.stories.tsx +84 -0
  61. package/components/Header/HeaderWithImg.tsx +171 -0
  62. package/components/Header/index.ts +5 -0
  63. package/components/Modals/GalleryModal.stories.tsx +40 -0
  64. package/components/Modals/GalleryModal.tsx +51 -0
  65. package/components/Modals/ReportModal.stories.tsx +191 -0
  66. package/components/Modals/ReportModal.tsx +200 -0
  67. package/components/Modals/index.ts +2 -0
  68. package/components/Poll/CommentItem.stories.tsx +154 -0
  69. package/components/Poll/CommentItem.tsx +132 -0
  70. package/components/Poll/PollCardList.stories.tsx +60 -0
  71. package/components/Poll/PollCardList.tsx +60 -0
  72. package/components/Poll/index.ts +2 -0
  73. package/components/Posts/EventCardList.stories.tsx +128 -0
  74. package/components/Posts/EventCardList.tsx +153 -0
  75. package/components/Posts/PlaceCardList.stories.tsx +43 -0
  76. package/components/Posts/PlaceCardList.tsx +58 -0
  77. package/components/Posts/index.ts +2 -0
  78. package/components/Profile/ModalProfilePhoto.stories.tsx +62 -0
  79. package/components/Profile/ModalProfilePhoto.tsx +98 -0
  80. package/components/Profile/ProfileCard/ProfileCard.stories.tsx +60 -0
  81. package/components/Profile/ProfileCard/ProfileCard.tsx +208 -0
  82. package/components/Profile/ProfileCard/useProfileCardStyles.ts +76 -0
  83. package/components/Profile/ProfilePhotoBanner.stories.tsx +73 -0
  84. package/components/Profile/ProfilePhotoBanner.tsx +52 -0
  85. package/components/Profile/ProfilePhotoUpload/ProfilePhotoUpload.stories.tsx +60 -0
  86. package/components/Profile/ProfilePhotoUpload/ProfilePhotoUpload.tsx +245 -0
  87. package/components/Profile/ProfileTabs/UserProfileTabs.stories.tsx +44 -0
  88. package/components/Profile/ProfileTabs/UserProfileTabs.tsx +108 -0
  89. package/components/Profile/index.ts +8 -0
  90. package/components/Specialist/Hero.stories.tsx +61 -0
  91. package/components/Specialist/Hero.tsx +101 -0
  92. package/components/Specialist/PortfolioCarousel.stories.tsx +33 -0
  93. package/components/Specialist/PortfolioCarousel.tsx +54 -0
  94. package/components/Specialist/ServicesList.stories.tsx +58 -0
  95. package/components/Specialist/ServicesList.tsx +81 -0
  96. package/components/Specialist/SpecialistProfileScreen.tsx +79 -0
  97. package/components/Specialist/index.ts +6 -0
  98. package/components/Tooltip/DangerTooltip.stories.tsx +101 -0
  99. package/components/Tooltip/DangerTooltip.tsx +25 -0
  100. package/components/Tooltip/InfoTooltip.stories.tsx +98 -0
  101. package/components/Tooltip/InfoTooltip.tsx +24 -0
  102. package/components/Tooltip/InfoTooltipBase.stories.tsx +114 -0
  103. package/components/Tooltip/InfoTooltipBase.tsx +242 -0
  104. package/components/Tooltip/SucceedTooltip.stories.tsx +95 -0
  105. package/components/Tooltip/SucceedTooltip.tsx +25 -0
  106. package/components/Tooltip/WarningTooltip.stories.tsx +103 -0
  107. package/components/Tooltip/WarningTooltip.tsx +25 -0
  108. package/components/Tooltip/index.tsx +5 -0
  109. package/components/UI/CardContainer.stories.tsx +49 -0
  110. package/components/UI/CardContainer.tsx +44 -0
  111. package/components/UI/DeletedState.stories.tsx +24 -0
  112. package/components/UI/DeletedState.tsx +36 -0
  113. package/components/UI/DescriptionMore.stories.tsx +43 -0
  114. package/components/UI/DescriptionMore.tsx +40 -0
  115. package/components/UI/DetailsCard/AddressBlock.stories.tsx +62 -0
  116. package/components/UI/DetailsCard/AddressBlock.tsx +37 -0
  117. package/components/UI/DetailsCard/IconLabel.stories.tsx +86 -0
  118. package/components/UI/DetailsCard/IconLabel.tsx +45 -0
  119. package/components/UI/DetailsCard/InfoNotification.stories.tsx +81 -0
  120. package/components/UI/DetailsCard/InfoNotification.tsx +44 -0
  121. package/components/UI/DetailsCard/PriceBlock.stories.tsx +53 -0
  122. package/components/UI/DetailsCard/PriceBlock.tsx +20 -0
  123. package/components/UI/DetailsCard/index.ts +4 -0
  124. package/components/UI/Dot.stories.tsx +42 -0
  125. package/components/UI/Dot.tsx +26 -0
  126. package/components/UI/EmptyState.stories.tsx +14 -0
  127. package/components/UI/EmptyState.tsx +33 -0
  128. package/components/UI/Hr.stories.tsx +45 -0
  129. package/components/UI/Hr.tsx +31 -0
  130. package/components/UI/LinkPreview.stories.tsx +82 -0
  131. package/components/UI/LinkPreview.tsx +81 -0
  132. package/components/UI/ListBlockItem.stories.tsx +69 -0
  133. package/components/UI/ListBlockItem.tsx +90 -0
  134. package/components/UI/ListItem.stories.tsx +67 -0
  135. package/components/UI/ListItem.tsx +64 -0
  136. package/components/UI/LoadingScreen.stories.tsx +14 -0
  137. package/components/UI/LoadingScreen.tsx +25 -0
  138. package/components/UI/NoAuth.stories.tsx +21 -0
  139. package/components/UI/NoAuth.tsx +34 -0
  140. package/components/UI/ParticipantItem.stories.tsx +67 -0
  141. package/components/UI/ParticipantItem.tsx +107 -0
  142. package/components/UI/Social/SocialIconsRow.stories.tsx +28 -0
  143. package/components/UI/Social/SocialIconsRow.tsx +59 -0
  144. package/components/UI/Social/SocialStatsEvent.stories.tsx +89 -0
  145. package/components/UI/Social/SocialStatsEvent.tsx +64 -0
  146. package/components/UI/Social/SocialStatsPlace.stories.tsx +84 -0
  147. package/components/UI/Social/SocialStatsPlace.tsx +61 -0
  148. package/components/UI/Social/index.ts +4 -0
  149. package/components/UI/Spacer.stories.tsx +35 -0
  150. package/components/UI/Spacer.tsx +23 -0
  151. package/components/UI/StatusFilter/StatusFilter.stories.tsx +67 -0
  152. package/components/UI/StatusFilter/StatusFilter.tsx +85 -0
  153. package/components/UI/TabBar/TabBar.stories.tsx +76 -0
  154. package/components/UI/TabBar/TabBar.tsx +84 -0
  155. package/components/UI/TabButton/TabButton.stories.tsx +220 -0
  156. package/components/UI/TabButton/TabButton.tsx +60 -0
  157. package/components/UI/TextWithLinks.stories.tsx +69 -0
  158. package/components/UI/TextWithLinks.tsx +58 -0
  159. package/components/UI/ThemeSwitcher.stories.tsx +22 -0
  160. package/components/UI/ThemeSwitcher.tsx +46 -0
  161. package/components/UI/ThreeDotsMenu.stories.tsx +65 -0
  162. package/components/UI/ThreeDotsMenu.tsx +113 -0
  163. package/components/UI/TripleSwitch.stories.tsx +66 -0
  164. package/components/UI/TripleSwitch.tsx +77 -0
  165. package/components/UI/index.ts +27 -0
  166. package/components/UserCards/Organazer.tsx +40 -0
  167. package/components/UserCards/Organizer.stories.tsx +54 -0
  168. package/components/UserCards/SpecialistCard.stories.tsx +101 -0
  169. package/components/UserCards/SpecialistCard.tsx +146 -0
  170. package/components/UserCards/StoryCard.stories.tsx +173 -0
  171. package/components/UserCards/StoryCard.tsx +187 -0
  172. package/components/UserCards/UserProfileCard.stories.tsx +62 -0
  173. package/components/UserCards/UserProfileCard.tsx +248 -0
  174. package/components/UserCards/UserRow.stories.tsx +64 -0
  175. package/components/UserCards/UserRow.tsx +44 -0
  176. package/components/UserCards/index.ts +5 -0
  177. package/components/index.ts +12 -0
  178. package/expo-env.d.ts +3 -0
  179. package/index.ts +1 -0
  180. package/metro.config.js +14 -0
  181. package/package.json +97 -72
  182. package/theme/index.ts +12 -0
  183. package/theme/styles/commonFormStyles.ts +41 -0
  184. package/theme/styles/style.ts +102 -0
  185. package/theme/styles/styleSheet.ts +212 -0
  186. package/theme/theme.ts +252 -0
  187. package/theme/themeContext.tsx +102 -0
  188. package/theme/types.ts +4 -0
  189. package/tsconfig.json +13 -0
  190. package/types/Icon.ts +1 -0
  191. package/types/event.ts +9 -0
  192. package/types/message.ts +21 -0
  193. package/types/svg.d.ts +6 -0
  194. package/dist/components/bottomsheet/DefaultSheet.js +0 -65
  195. package/dist/components/bottomsheet/DefaultSheetLong.js +0 -66
  196. package/dist/components/bottomsheet/PostOptionSheet copy.js +0 -67
  197. package/dist/components/bottomsheet/PostOptionSheet.js +0 -116
  198. package/dist/components/bottomsheet/index.js +0 -12
  199. package/dist/components/buttons/Button.js +0 -72
  200. package/dist/components/buttons/PostButton.js +0 -34
  201. package/dist/components/buttons/index.js +0 -10
  202. package/dist/components/eventCard/Tag.js +0 -36
  203. package/dist/components/eventCard/index.js +0 -12
  204. package/dist/components/eventCard/vsCard/EventCard.js +0 -76
  205. package/dist/components/eventCard/vsCard/Footer.js +0 -81
  206. package/dist/components/eventCard/vsCard/OrganizerContainer.js +0 -51
  207. package/dist/components/footer/Footer copy.js +0 -114
  208. package/dist/components/footer/Footer.js +0 -118
  209. package/dist/components/footer/index.js +0 -6
  210. package/dist/components/header/headerHome.js +0 -25
  211. package/dist/components/header/index.js +0 -5
  212. package/dist/components/icon/Icon.js +0 -33
  213. package/dist/components/icon/index.js +0 -6
  214. package/dist/components/index.js +0 -24
  215. package/dist/components/listItem/index.js +0 -8
  216. package/dist/components/listItem/listItem.js +0 -50
  217. package/dist/components/profile/ProfileCard.js +0 -82
  218. package/dist/components/profile/index.js +0 -10
  219. package/dist/components/profile/meetProfileCard.js +0 -112
  220. package/dist/constants/index.js +0 -25
  221. package/dist/constants/styleSheet.js +0 -256
  222. package/dist/constants/theme copy.js +0 -214
  223. package/dist/constants/theme.js +0 -89
  224. package/dist/constants/themeContext.js +0 -5
  225. package/dist/form/AutoComplete.js +0 -159
  226. package/dist/form/DatePicker.js +0 -86
  227. package/dist/form/ImageUploader.js +0 -181
  228. package/dist/form/MultiSelect.js +0 -85
  229. package/dist/form/PasswordInput.js +0 -61
  230. package/dist/form/Select.js +0 -53
  231. package/dist/form/TextArea.js +0 -56
  232. package/dist/form/TextInput.js +0 -38
  233. package/dist/form/commonFormStyles.js +0 -30
  234. package/dist/form/index.js +0 -20
  235. package/dist/index.js +0 -19
  236. package/dist/types/components/bottomsheet/DefaultSheet.d.ts +0 -10
  237. package/dist/types/components/bottomsheet/DefaultSheetLong.d.ts +0 -10
  238. package/dist/types/components/bottomsheet/PostOptionSheet copy.d.ts +0 -0
  239. package/dist/types/components/bottomsheet/PostOptionSheet.d.ts +0 -8
  240. package/dist/types/components/bottomsheet/index.d.ts +0 -3
  241. package/dist/types/components/buttons/Button.d.ts +0 -10
  242. package/dist/types/components/buttons/PostButton.d.ts +0 -10
  243. package/dist/types/components/eventCard/Tag.d.ts +0 -8
  244. package/dist/types/components/eventCard/index.d.ts +0 -3
  245. package/dist/types/components/eventCard/vsCard/EventCard.d.ts +0 -20
  246. package/dist/types/components/eventCard/vsCard/Footer.d.ts +0 -10
  247. package/dist/types/components/eventCard/vsCard/OrganizerContainer.d.ts +0 -8
  248. package/dist/types/components/footer/Footer copy.d.ts +0 -0
  249. package/dist/types/components/footer/Footer.d.ts +0 -20
  250. package/dist/types/components/footer/index.d.ts +0 -1
  251. package/dist/types/components/header/headerHome.d.ts +0 -8
  252. package/dist/types/components/header/index.d.ts +0 -1
  253. package/dist/types/components/icon/Icon.d.ts +0 -15
  254. package/dist/types/components/icon/index.d.ts +0 -1
  255. package/dist/types/components/index.d.ts +0 -8
  256. package/dist/types/components/listItem/index.d.ts +0 -1
  257. package/dist/types/components/listItem/listItem.d.ts +0 -10
  258. package/dist/types/components/profile/ProfileCard.d.ts +0 -12
  259. package/dist/types/components/profile/index.d.ts +0 -2
  260. package/dist/types/components/profile/meetProfileCard.d.ts +0 -12
  261. package/dist/types/constants/index.d.ts +0 -3
  262. package/dist/types/constants/styleSheet.d.ts +0 -309
  263. package/dist/types/constants/theme copy.d.ts +0 -0
  264. package/dist/types/constants/theme.d.ts +0 -229
  265. package/dist/types/constants/themeContext.d.ts +0 -2
  266. package/dist/types/form/AutoComplete.d.ts +0 -13
  267. package/dist/types/form/DatePicker.d.ts +0 -14
  268. package/dist/types/form/ImageUploader.d.ts +0 -14
  269. package/dist/types/form/MultiSelect.d.ts +0 -18
  270. package/dist/types/form/PasswordInput.d.ts +0 -10
  271. package/dist/types/form/Select.d.ts +0 -19
  272. package/dist/types/form/TextArea.d.ts +0 -17
  273. package/dist/types/form/TextInput.d.ts +0 -17
  274. package/dist/types/form/commonFormStyles.d.ts +0 -26
  275. package/dist/types/form/index.d.ts +0 -8
  276. package/dist/types/index.d.ts +0 -3
  277. package/dist/types/utils/formatDate.d.ts +0 -1
  278. package/dist/types/utils/index.d.ts +0 -2
  279. package/dist/utils/formatDate.js +0 -15
  280. package/dist/utils/index.js +0 -5
package/README.md CHANGED
@@ -1,7 +1,82 @@
1
- in package.json change "main": "expo/AppEntry.js", to "main": "dist/index.js", and back when publish files
1
+ ![picture of storybook](https://github.com/user-attachments/assets/cf98766d-8b90-44ab-b718-94ab16e63205)
2
2
 
3
- delete "extends": "expo/tsconfig.base" from tsconfig.json before npm publish
3
+ # getting started
4
4
 
5
- change version on package.json "version": "1.0.5", +one
5
+ ```sh
6
+ npx create-expo-app --template expo-template-storybook AwesomeStorybook
7
+ ```
6
8
 
7
- run "npm publish"
9
+ or
10
+
11
+ ```sh
12
+ yarn create expo-app --template expo-template-storybook AwesomeStorybook
13
+ ```
14
+
15
+ # app
16
+
17
+ ```sh
18
+ yarn start
19
+ ```
20
+
21
+ # RN Storybook (ondevice)
22
+
23
+ In this template you can now run `yarn storybook` to start ondevice storybook or `yarn start` to start your expo app.
24
+ This works via env variables and expo constants.
25
+
26
+ ```sh
27
+ # either
28
+ yarn storybook
29
+
30
+ # ios
31
+ yarn storybook:ios
32
+
33
+ # android
34
+ yarn storybook:android
35
+ ```
36
+
37
+ If you add new stories on the native (ondevice version) you either need to have the watcher running or run the stories loader
38
+
39
+ To update the stories one time
40
+
41
+ ```sh
42
+ yarn storybook-generate
43
+ ```
44
+
45
+ # Web
46
+
47
+ Start react native web storybook:
48
+
49
+ ```
50
+ yarn storybook:web
51
+ ```
52
+
53
+ build react native web storybook:
54
+
55
+ ```sh
56
+ yarn build-storybook
57
+ ```
58
+
59
+ ## Публикация в npm
60
+
61
+ 1. **Проверьте метаданные**. Обновите поля `name`, `version`, `description`, `keywords`, `author`, `repository` и `homepage` в `package.json`, чтобы они отражали вашу организацию и назначение пакета.
62
+ 2. **Подготовьте содержимое пакета**. В корне проекта уже настроено поле `files`, которое ограничивает набор публикуемых файлов. При необходимости добавьте или удалите пути, чтобы в npm попали только нужные артефакты.
63
+ 3. **Соберите и протестируйте**. Запустите важные проверки перед публикацией, например:
64
+ ```sh
65
+ npm install
66
+ npm run storybook-generate
67
+ npm run build-storybook
68
+ ```
69
+ Убедитесь, что команда `npm pack` создаёт корректный архив.
70
+ 4. **Авторизуйтесь в npm**. Выполните вход под своей учётной записью и убедитесь, что у вас есть права на публикацию пакета:
71
+ ```sh
72
+ npm login
73
+ ```
74
+ 5. **Проведите пробную упаковку** (опционально). Запустите dry‑run, чтобы убедиться, что публикуемый состав выглядит корректно:
75
+ ```sh
76
+ npm publish --access public --dry-run
77
+ ```
78
+ 6. **Опубликуйте релиз**. Убедившись, что версия не занята, выполните:
79
+ ```sh
80
+ npm publish --access public
81
+ ```
82
+ 7. **Проверьте публикацию**. После успешной публикации обновите теги в git (`git tag vX.Y.Z && git push --tags`) и убедитесь, что пакет появился на npmjs.com.
@@ -0,0 +1,20 @@
1
+ import { Link } from "expo-router";
2
+ import { Text, View } from "react-native";
3
+
4
+ export default function Index() {
5
+ return (
6
+ <View
7
+ style={{
8
+ flex: 1,
9
+ justifyContent: "center",
10
+ alignItems: "center",
11
+ }}
12
+ >
13
+ {process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true" ? (
14
+ <Link href="/(storybook)">Open Storybook</Link>
15
+ ) : (
16
+ <Text>Hello World (storybook disabled)</Text>
17
+ )}
18
+ </View>
19
+ );
20
+ }
@@ -0,0 +1,7 @@
1
+ let StorybookUI = () => <></>;
2
+
3
+ if (process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true") {
4
+ StorybookUI = require("../../.rnstorybook").default;
5
+ }
6
+
7
+ export default StorybookUI;
@@ -0,0 +1,19 @@
1
+ import { Stack } from "expo-router";
2
+
3
+ const StorybookEnabled = process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true";
4
+
5
+ export const unstable_settings = {
6
+ initialRouteName: StorybookEnabled ? "(storybook)/index" : "(pages)/index",
7
+ };
8
+
9
+ export default function RootLayout() {
10
+ return (
11
+ <Stack screenOptions={{ headerShown: false }}>
12
+ <Stack.Protected guard={StorybookEnabled}>
13
+ <Stack.Screen name="(storybook)/index" />
14
+ </Stack.Protected>
15
+
16
+ <Stack.Screen name="(pages)/index" />
17
+ </Stack>
18
+ );
19
+ }
package/app.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "rn-vs-lb",
3
+ "slug": "rn-vs-lb",
4
+ "scheme": "rnvslb",
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "icon": "./assets/icon.png",
8
+ "newArchEnabled": true,
9
+ "userInterfaceStyle": "automatic",
10
+ "ios": {
11
+ "supportsTablet": true,
12
+ "infoPlist": {
13
+ "ITSAppUsesNonExemptEncryption": false
14
+ }
15
+ },
16
+ "android": {
17
+ "adaptiveIcon": {
18
+ "foregroundImage": "./assets/adaptive-icon.png",
19
+ "backgroundColor": "#FFFFFF"
20
+ },
21
+ "edgeToEdgeEnabled": true
22
+ },
23
+ "web": {
24
+ "favicon": "./assets/favicon.png",
25
+ "bundler": "metro",
26
+ "output": "single"
27
+ },
28
+ "plugins": [
29
+ "expo-router",
30
+ [
31
+ "expo-splash-screen",
32
+ {
33
+ "image": "./assets/splash-icon.png",
34
+ "imageWidth": 200,
35
+ "resizeMode": "contain",
36
+ "backgroundColor": "#ffffff"
37
+ }
38
+ ]
39
+ ],
40
+ "experiments": {
41
+ "reactCompiler": true,
42
+ "typedRoutes": true,
43
+ "tsconfigPaths": true
44
+ }
45
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: ["babel-preset-expo"],
5
+ plugins: [
6
+ ["babel-plugin-react-docgen-typescript", { exclude: "node_modules" }],
7
+ "@babel/plugin-transform-class-static-block",
8
+ "react-native-worklets/plugin",
9
+ ],
10
+ };
11
+ };
@@ -0,0 +1,131 @@
1
+ // stories/Button/Button.stories.tsx
2
+ import React from 'react';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+ import { View } from 'react-native';
5
+ import { MaterialIcons } from '@expo/vector-icons';
6
+ import Button, { MyButtonProps } from './Button';
7
+
8
+ const meta: Meta<MyButtonProps> = {
9
+ title: 'Button/Base',
10
+ component: Button,
11
+ decorators: [
12
+ (Story) => (
13
+ <View style={{ padding: 16 }}>
14
+ <View>
15
+ <Story />
16
+ </View>
17
+ </View>
18
+ ),
19
+ ],
20
+ parameters: {
21
+ actions: { argTypesRegex: '^on[A-Z].*' },
22
+ },
23
+ argTypes: {
24
+ title: { control: 'text', description: 'Text displayed on the button' },
25
+ type: {
26
+ control: { type: 'select' },
27
+ options: ['primary', 'gray', 'primary-outline', 'gray-outline', 'report-outline'],
28
+ description: 'Visual style of the button',
29
+ },
30
+ loading: { control: 'boolean', description: 'Shows a loading indicator and disables the button' },
31
+ disabled: { control: 'boolean', description: 'Disables the button interaction' },
32
+ iconGap: { control: { type: 'number', min: 0, step: 1 }, description: 'Gap between icon and text' },
33
+ onPress: { action: 'onPress' },
34
+ },
35
+ args: {
36
+ title: 'Press me',
37
+ type: 'primary',
38
+ loading: false,
39
+ disabled: false,
40
+ iconGap: 8,
41
+ },
42
+ } satisfies Meta<typeof Button>;
43
+
44
+ export default meta;
45
+ type S = StoryObj<typeof Button>;
46
+
47
+ /* Базовые */
48
+ export const Primary: S = { args: { title: 'Continue', type: 'primary' } };
49
+ export const Outline: S = { args: { title: 'Learn more', type: 'primary-outline' } };
50
+ export const Gray: S = { args: { title: 'Cancel', type: 'gray' } };
51
+ export const DangerOutline: S = { args: { title: 'Report content', type: 'report-outline' } };
52
+ export const LoadingState: S = { args: { title: 'Submitting...', type: 'primary', loading: true } };
53
+
54
+ /* Варианты с иконками — через render (React-ноды нельзя класть в args) */
55
+ export const WithLeftIcon: S = {
56
+ render: (args) => (
57
+ <Button
58
+ {...args}
59
+ title="Upload"
60
+ type="primary"
61
+ leftIcon={<MaterialIcons name="cloud-upload" size={20} color="#fff" />}
62
+ />
63
+ ),
64
+ };
65
+
66
+ export const WithRightIcon: S = {
67
+ render: (args) => (
68
+ <Button
69
+ {...args}
70
+ title="Next"
71
+ type="primary-outline"
72
+ rightIcon={<MaterialIcons name="arrow-forward" size={20} color="#6f2da8" />}
73
+ />
74
+ ),
75
+ };
76
+
77
+ export const WithBothIcons: S = {
78
+ render: (args) => (
79
+ <Button
80
+ {...args}
81
+ title="Share"
82
+ type="gray"
83
+ leftIcon={<MaterialIcons name="share" size={20} color="#fff" />}
84
+ rightIcon={<MaterialIcons name="keyboard-arrow-right" size={20} color="#fff" />}
85
+ iconGap={6}
86
+ />
87
+ ),
88
+ };
89
+
90
+ /* Только иконка (icon-only) */
91
+ export const IconOnlyPrimary: S = {
92
+ render: (args) => (
93
+ <View style={{ width: 64 }}>
94
+ <Button
95
+ {...args}
96
+ title={undefined}
97
+ type="primary"
98
+ leftIcon={<MaterialIcons name="settings" size={20} color="#fff" />}
99
+ accessibilityLabel="Open settings"
100
+ // title не передаём
101
+ />
102
+ </View>
103
+ ),
104
+ };
105
+
106
+ export const IconOnlyOutline: S = {
107
+ render: (args) => (
108
+ <View style={{ width: 64 }}>
109
+ <Button
110
+ {...args}
111
+ title={undefined}
112
+ type="primary-outline"
113
+ leftIcon={<MaterialIcons name="favorite-border" size={20} color="#6f2da8" />}
114
+ accessibilityLabel="Add to favorites"
115
+ />
116
+ </View>
117
+ ),
118
+ };
119
+
120
+ /* Disabled + Icon */
121
+ export const DisabledWithIcon: S = {
122
+ render: (args) => (
123
+ <Button
124
+ {...args}
125
+ title="Download"
126
+ type="gray-outline"
127
+ disabled
128
+ leftIcon={<MaterialIcons name="download" size={20} color="#777" />}
129
+ />
130
+ ),
131
+ };
@@ -0,0 +1,146 @@
1
+ import React from 'react';
2
+ import {
3
+ TouchableOpacity,
4
+ Text,
5
+ StyleSheet,
6
+ ViewStyle,
7
+ TextStyle,
8
+ ActivityIndicator,
9
+ TouchableOpacityProps,
10
+ StyleProp,
11
+ View,
12
+ } from 'react-native';
13
+ import { ThemeType, useTheme } from '../../theme';
14
+
15
+ export interface MyButtonProps extends TouchableOpacityProps {
16
+ title?: string; // ← стал необязательным для icon-only
17
+ type?: 'primary' | 'gray' | 'primary-outline' | 'gray-outline' | 'report-outline';
18
+ style?: StyleProp<ViewStyle>;
19
+ textStyle?: StyleProp<TextStyle>;
20
+ loading?: boolean;
21
+
22
+ /** Иконки */
23
+ leftIcon?: React.ReactNode;
24
+ rightIcon?: React.ReactNode;
25
+ /** Отступ между иконкой и текстом */
26
+ iconGap?: number;
27
+ }
28
+
29
+ const Button: React.FC<MyButtonProps> = ({
30
+ title,
31
+ onPress,
32
+ type = 'primary',
33
+ style,
34
+ textStyle,
35
+ loading = false,
36
+ leftIcon,
37
+ rightIcon,
38
+ iconGap = 8,
39
+ ...props
40
+ }) => {
41
+ const { theme } = useTheme();
42
+ const styles = getStyles({ theme });
43
+
44
+ const isIconOnly = !title && (leftIcon || rightIcon);
45
+
46
+ const buttonStyles = [
47
+ styles.button,
48
+ type === 'primary' && styles.primaryButton,
49
+ type === 'gray' && styles.grayButton,
50
+ type === 'primary-outline' && styles.primaryOutlineButton,
51
+ type === 'gray-outline' && styles.grayOutlineButton,
52
+ type === 'report-outline' && styles.reportOutlineButton,
53
+ isIconOnly && styles.iconOnlyButton,
54
+ style,
55
+ (loading || props.disabled) && styles.disabledButton,
56
+ ];
57
+
58
+ const textStyles = [
59
+ styles.buttonText,
60
+ type === 'primary' && styles.primaryButtonText,
61
+ type === 'gray' && styles.grayButtonText,
62
+ type === 'primary-outline' && styles.primaryOutlineButtonText,
63
+ type === 'gray-outline' && styles.grayOutlineButtonText,
64
+ type === 'report-outline' && styles.reportOutlineButtonText,
65
+ textStyle,
66
+ ];
67
+
68
+ return (
69
+ <TouchableOpacity
70
+ style={buttonStyles}
71
+ onPress={loading ? undefined : onPress}
72
+ disabled={loading || props.disabled}
73
+ {...props}
74
+ >
75
+ {loading ? (
76
+ <ActivityIndicator color={type.includes('outline') ? theme.primary : theme.white} />
77
+ ) : isIconOnly ? (
78
+ // Только иконка
79
+ leftIcon ? <View pointerEvents="none">{leftIcon}</View> : <View pointerEvents="none">{rightIcon}</View>
80
+ ) : (
81
+ // Иконка + текст (или просто текст)
82
+ <View style={[styles.contentRow, { columnGap: iconGap }]}>
83
+ {leftIcon ? <View pointerEvents="none">{leftIcon}</View> : null}
84
+ {title ? <Text style={textStyles}>{title}</Text> : null}
85
+ {rightIcon ? <View pointerEvents="none">{rightIcon}</View> : null}
86
+ </View>
87
+ )}
88
+ </TouchableOpacity>
89
+ );
90
+ };
91
+
92
+ const getStyles = ({ theme }: { theme: ThemeType }) =>
93
+ StyleSheet.create({
94
+ button: {
95
+ minHeight: 50,
96
+ justifyContent: 'center',
97
+ alignItems: 'center',
98
+ borderRadius: 6,
99
+ paddingHorizontal: 16,
100
+ width: '100%',
101
+ },
102
+ contentRow: {
103
+ flexDirection: 'row',
104
+ alignItems: 'center',
105
+ justifyContent: 'center',
106
+ },
107
+
108
+ // Варианты
109
+ primaryButton: { backgroundColor: theme.primary },
110
+ primaryOutlineButton: {
111
+ backgroundColor: theme.white,
112
+ borderWidth: 1,
113
+ borderColor: theme.primary,
114
+ },
115
+ grayButton: { backgroundColor: theme.backgroundBtn },
116
+ grayOutlineButton: {
117
+ backgroundColor: theme.backgroundBtn,
118
+ borderColor: theme.border,
119
+ borderWidth: 1,
120
+ },
121
+ reportOutlineButton: {
122
+ borderColor: theme.red,
123
+ borderWidth: 1,
124
+ backgroundColor: theme.white,
125
+ },
126
+
127
+ // Текст
128
+ buttonText: { fontSize: 16, fontWeight: '500' },
129
+ primaryButtonText: { color: 'white' },
130
+ primaryOutlineButtonText: { color: theme.primary },
131
+ grayButtonText: { color: theme.greyBtnText },
132
+ grayOutlineButtonText: { color: theme.greyBtnText },
133
+ reportOutlineButtonText: { color: theme.red },
134
+
135
+ // Состояния
136
+ disabledButton: { opacity: 0.7 },
137
+
138
+ // Icon-only
139
+ iconOnlyButton: {
140
+ width: 50,
141
+ minHeight: 50,
142
+ paddingHorizontal: 0,
143
+ },
144
+ });
145
+
146
+ export default Button;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Meta, StoryFn } from '@storybook/react';
3
+ import { DeleteAccountButton, DeleteAccountButtonProps } from './DeleteAccountButton';
4
+
5
+ const meta: Meta<DeleteAccountButtonProps> = {
6
+ title: 'Button/DeleteAccountButton',
7
+ component: DeleteAccountButton,
8
+ };
9
+
10
+ export default meta;
11
+
12
+ const Template: StoryFn<DeleteAccountButtonProps> = (args) => <DeleteAccountButton {...args} />;
13
+
14
+ const createMockDelete = (delay = 800) => async () => {
15
+ await new Promise((resolve) => setTimeout(resolve, delay));
16
+ };
17
+
18
+ export const Default = Template.bind({});
19
+ Default.args = {
20
+ deleteAccount: createMockDelete(),
21
+ };
22
+
23
+ export const SlowNetwork = Template.bind({});
24
+ SlowNetwork.args = {
25
+ deleteAccount: createMockDelete(2000),
26
+ };
@@ -0,0 +1,84 @@
1
+ import React, { FC, useState } from 'react';
2
+ import { View, Text, Modal, StyleSheet, TouchableOpacity } from 'react-native';
3
+ import Spacer from '../UI/Spacer';
4
+ import Button from './Button';
5
+ import { ThemeType, useTheme } from '../../theme';
6
+
7
+ export type DeleteAccountButtonProps = {
8
+ deleteAccount: () => Promise<void>;
9
+ }
10
+
11
+ export const DeleteAccountButton: FC<DeleteAccountButtonProps> = ({ deleteAccount }) => {
12
+ const [modalVisible, setModalVisible] = useState(false);
13
+ const { theme, typography } = useTheme();
14
+ const styles = getStyles({ theme });
15
+
16
+ const handleDeleteAccount = async () => {
17
+ deleteAccount()
18
+ setModalVisible(false);
19
+ };
20
+
21
+ return (
22
+ <View style={styles.container}>
23
+ <TouchableOpacity style={styles.deleteButton} onPress={() => setModalVisible(true)}>
24
+ <Text style={[typography.titleH6, { color: theme.red }]}>Delete account</Text>
25
+ </TouchableOpacity>
26
+
27
+ <Modal
28
+ transparent
29
+ visible={modalVisible}
30
+ animationType="slide"
31
+ onRequestClose={() => setModalVisible(false)}
32
+ >
33
+ <View style={styles.modalOverlay}>
34
+ <View style={styles.modalContent}>
35
+ <Text style={typography.titleH5}>Confirm Deletion</Text>
36
+ <Spacer size="xxs" />
37
+ <Text style={[typography.body, { textAlign: "center" }]}>
38
+ All your data, including profile, events, and chat history, will be permanently deleted.
39
+ This process is irreversible and will be completed within 24 hours.
40
+ Are you sure you want to proceed?
41
+ </Text>
42
+ <Spacer size="lg" />
43
+ <View style={styles.buttonRow}>
44
+ <Button onPress={() => setModalVisible(false)} style={styles.cancelButton} type="gray-outline" title="Cancel" />
45
+ <Button onPress={handleDeleteAccount} type="report-outline" style={styles.confirmButton} title="Delete" />
46
+ </View>
47
+ </View>
48
+ </View>
49
+ </Modal>
50
+ </View>
51
+ );
52
+ }
53
+
54
+ const getStyles = ({ theme }: { theme: ThemeType }) =>
55
+ StyleSheet.create({
56
+ container: {
57
+ alignItems: 'center',
58
+ },
59
+ deleteButton: {
60
+ paddingVertical: 6,
61
+ },
62
+ modalOverlay: {
63
+ flex: 1,
64
+ backgroundColor: theme.backgroundSemiTransparent,
65
+ justifyContent: 'center',
66
+ padding: 20,
67
+ },
68
+ modalContent: {
69
+ backgroundColor: theme.white,
70
+ borderRadius: 10,
71
+ padding: 20,
72
+ alignItems: 'center',
73
+ },
74
+ buttonRow: {
75
+ flexDirection: 'row',
76
+ gap: 10,
77
+ },
78
+ confirmButton: {
79
+ width: '50%',
80
+ },
81
+ cancelButton: {
82
+ width: '50%',
83
+ },
84
+ });
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Meta, StoryFn } from '@storybook/react';
3
+ import PostButton from './PostButton';
4
+
5
+ const meta: Meta = {
6
+ title: 'Button/PostButton',
7
+ component: PostButton,
8
+ argTypes: {
9
+ title: {
10
+ control: 'text',
11
+ defaultValue: 'Create new event',
12
+ },
13
+ onPress: { action: 'press' },
14
+ },
15
+ };
16
+
17
+ export default meta;
18
+
19
+ const Template: StoryFn<React.ComponentProps<typeof PostButton>> = (args) => <PostButton {...args} />;
20
+
21
+ export const Default = Template.bind({});
22
+ Default.args = {
23
+ title: 'Create post',
24
+ };
25
+
26
+ export const CustomStyling = Template.bind({});
27
+ CustomStyling.args = {
28
+ title: 'Invite a friend',
29
+ buttonStyle: {
30
+ backgroundColor: '#FFE8D6',
31
+ borderRadius: 20,
32
+ },
33
+ textStyle: {
34
+ fontWeight: '700',
35
+ },
36
+ };
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity, Text, StyleSheet, ViewStyle, TextStyle } from 'react-native';
3
+ import { MaterialIcons } from '@expo/vector-icons';
4
+ import { ThemeType, useTheme } from '../../theme';
5
+
6
+ interface PostButtonProps {
7
+ title: string;
8
+ onPress: () => void;
9
+ buttonStyle?: ViewStyle;
10
+ textStyle?: TextStyle;
11
+ }
12
+
13
+ const PostButton: React.FC<PostButtonProps> = ({ title, onPress, buttonStyle, textStyle }) => {
14
+ const { theme } = useTheme();
15
+ const styles = getStyles({ theme });
16
+
17
+ return (
18
+ <TouchableOpacity style={[styles.button, buttonStyle]} onPress={onPress}>
19
+ <MaterialIcons name="add-circle-outline" size={20} color={theme.primaryLight} />
20
+ <Text style={[styles.buttonText, textStyle]}>{title}</Text>
21
+ </TouchableOpacity>
22
+ );
23
+ };
24
+
25
+ const getStyles = ({ theme }: { theme: ThemeType }) => StyleSheet.create({
26
+ button: {
27
+ backgroundColor: theme.backgroundThird, // light grey background
28
+ paddingVertical: 13,
29
+ paddingHorizontal: 20,
30
+ borderRadius: 8,
31
+ width: "100%",
32
+ alignItems: 'center',
33
+ display: "flex",
34
+ flexDirection: "row",
35
+ justifyContent: "center",
36
+ },
37
+ buttonText: {
38
+ color: theme.primaryLight,
39
+ fontSize: 16,
40
+ fontWeight: '500',
41
+ marginLeft: 4,
42
+ },
43
+ });
44
+
45
+ export default PostButton;