@effijs/templates 0.0.0-stage → 1.0.0-alpha.1

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 (367) hide show
  1. package/CONTRIBUTING.md +27 -0
  2. package/LICENSE +22 -0
  3. package/README.md +32 -2
  4. package/ai/SETUP.md +5 -0
  5. package/docs/catalog.md +85 -0
  6. package/forge.manifest.js +75 -0
  7. package/lib/compat.js +40 -0
  8. package/lib/docs/build.js +146 -0
  9. package/lib/install.js +51 -0
  10. package/lib/journal.js +40 -0
  11. package/lib/jsonConfig.js +33 -0
  12. package/lib/migration.js +35 -0
  13. package/lib/names.js +42 -0
  14. package/lib/patch.js +62 -0
  15. package/lib/paths.js +12 -0
  16. package/lib/project.js +48 -0
  17. package/lib/registry.js +99 -0
  18. package/package.json +46 -4
  19. package/platforms/react-native/CATALOG.md +391 -0
  20. package/platforms/react-native/ORIGIN.md +42 -0
  21. package/platforms/react-native/README.md +78 -0
  22. package/platforms/react-native/ai/AGENTS.md.hbs +36 -0
  23. package/platforms/react-native/ai/SETUP.md +89 -0
  24. package/platforms/react-native/compat/matrix.js +150 -0
  25. package/platforms/react-native/configs/babel.js +63 -0
  26. package/platforms/react-native/configs/forgeConfig.js +35 -0
  27. package/platforms/react-native/configs/jsConfigs.js +96 -0
  28. package/platforms/react-native/configs/metro.js +86 -0
  29. package/platforms/react-native/generators/add/generator.js +12 -0
  30. package/platforms/react-native/generators/add/run.js +64 -0
  31. package/platforms/react-native/generators/component/generator.js +75 -0
  32. package/platforms/react-native/generators/component/render.js +69 -0
  33. package/platforms/react-native/generators/component/templates/Common.tsx.hbs +13 -0
  34. package/platforms/react-native/generators/component/templates/index.ts.hbs +13 -0
  35. package/platforms/react-native/generators/component/templates/pm.ts.hbs +7 -0
  36. package/platforms/react-native/generators/component/templates/types.ts.hbs +3 -0
  37. package/platforms/react-native/generators/demo/files/api/app.http +8 -0
  38. package/platforms/react-native/generators/demo/files/api/environment/http-client.env.json +5 -0
  39. package/platforms/react-native/generators/demo/files/entity/category/category.api.ts +18 -0
  40. package/platforms/react-native/generators/demo/files/entity/category/category.dto.ts +15 -0
  41. package/platforms/react-native/generators/demo/files/entity/category/category.service.ts +42 -0
  42. package/platforms/react-native/generators/demo/files/entity/category/category.store.ts +26 -0
  43. package/platforms/react-native/generators/demo/files/entity/category/index.ts +2 -0
  44. package/platforms/react-native/generators/demo/files/entity/product/index.ts +2 -0
  45. package/platforms/react-native/generators/demo/files/entity/product/product.api.ts +49 -0
  46. package/platforms/react-native/generators/demo/files/entity/product/product.dto.ts +120 -0
  47. package/platforms/react-native/generators/demo/files/entity/product/product.service.ts +139 -0
  48. package/platforms/react-native/generators/demo/files/entity/product/product.store.ts +37 -0
  49. package/platforms/react-native/generators/demo/files/feature/product/components/Product.CategorySelect.tsx +36 -0
  50. package/platforms/react-native/generators/demo/files/feature/product/detail/Product.Detail.Screen.tsx +100 -0
  51. package/platforms/react-native/generators/demo/files/feature/product/detail/product.detail.service.ts +33 -0
  52. package/platforms/react-native/generators/demo/files/feature/product/filter/Product.Filter.Screen.tsx +59 -0
  53. package/platforms/react-native/generators/demo/files/feature/product/filter/product.filter.service.ts +78 -0
  54. package/platforms/react-native/generators/demo/files/feature/product/form/Product.Form.Screen.tsx +71 -0
  55. package/platforms/react-native/generators/demo/files/feature/product/form/product.form.service.ts +142 -0
  56. package/platforms/react-native/generators/demo/files/feature/product/index.ts +7 -0
  57. package/platforms/react-native/generators/demo/files/feature/product/list/Product.List.Item.tsx +34 -0
  58. package/platforms/react-native/generators/demo/files/feature/product/list/Product.List.Screen.tsx +106 -0
  59. package/platforms/react-native/generators/demo/files/feature/product/list/product.list.service.ts +47 -0
  60. package/platforms/react-native/generators/demo/files/feature/product/product.feature.ts +29 -0
  61. package/platforms/react-native/generators/demo/files/feature/product/product.hooks.ts +7 -0
  62. package/platforms/react-native/generators/demo/files/feature/product/search/Product.Search.Screen.tsx +82 -0
  63. package/platforms/react-native/generators/demo/files/feature/product/search/product.search.service.ts +97 -0
  64. package/platforms/react-native/generators/demo/files/navigation/navigation.product.ts +46 -0
  65. package/platforms/react-native/generators/demo/generator.js +93 -0
  66. package/platforms/react-native/generators/entity/generator.js +68 -0
  67. package/platforms/react-native/generators/feature/generator.js +224 -0
  68. package/platforms/react-native/generators/feature/render.js +163 -0
  69. package/platforms/react-native/generators/feature/templates/detail.screen.tsx.hbs +25 -0
  70. package/platforms/react-native/generators/feature/templates/detail.service.ts.hbs +14 -0
  71. package/platforms/react-native/generators/feature/templates/feature.ts.hbs +18 -0
  72. package/platforms/react-native/generators/feature/templates/filter.screen.tsx.hbs +17 -0
  73. package/platforms/react-native/generators/feature/templates/filter.service.ts.hbs +14 -0
  74. package/platforms/react-native/generators/feature/templates/form.screen.tsx.hbs +21 -0
  75. package/platforms/react-native/generators/feature/templates/form.service.ts.hbs +37 -0
  76. package/platforms/react-native/generators/feature/templates/hooks.ts.hbs +7 -0
  77. package/platforms/react-native/generators/feature/templates/index.ts.hbs +2 -0
  78. package/platforms/react-native/generators/feature/templates/list.item.tsx.hbs +16 -0
  79. package/platforms/react-native/generators/feature/templates/list.screen.tsx.hbs +34 -0
  80. package/platforms/react-native/generators/feature/templates/list.service.ts.hbs +15 -0
  81. package/platforms/react-native/generators/feature/templates/navigation.ts.hbs +12 -0
  82. package/platforms/react-native/generators/feature/templates/search.screen.tsx.hbs +24 -0
  83. package/platforms/react-native/generators/feature/templates/search.service.ts.hbs +13 -0
  84. package/platforms/react-native/generators/feature/templates/tab.tsx.hbs +8 -0
  85. package/platforms/react-native/generators/init/files/app/app.controller.ts +41 -0
  86. package/platforms/react-native/generators/init/files/app/app.error.ts +1 -0
  87. package/platforms/react-native/generators/init/files/app/app.store.ts +12 -0
  88. package/platforms/react-native/generators/init/files/app/index.ts +19 -0
  89. package/platforms/react-native/generators/init/files/app/splash/Onboarding.Screen.tsx +31 -0
  90. package/platforms/react-native/generators/init/files/app/splash/Splash.Screen.tsx +14 -0
  91. package/platforms/react-native/generators/init/files/app/tabs/home/Home.tab.tsx +24 -0
  92. package/platforms/react-native/generators/init/files/app/tabs/profile/Profile.tab.tsx +1 -0
  93. package/platforms/react-native/generators/init/files/configs/dev.ts.hbs +5 -0
  94. package/platforms/react-native/generators/init/files/configs/index.ts +4 -0
  95. package/platforms/react-native/generators/init/files/configs/prod.ts.hbs +5 -0
  96. package/platforms/react-native/generators/init/files/entity/auth/auth.api.ts +36 -0
  97. package/platforms/react-native/generators/init/files/entity/auth/auth.dto.ts +26 -0
  98. package/platforms/react-native/generators/init/files/entity/auth/auth.service.ts +94 -0
  99. package/platforms/react-native/generators/init/files/entity/auth/auth.session.store.ts +14 -0
  100. package/platforms/react-native/generators/init/files/entity/auth/auth.store.ts +20 -0
  101. package/platforms/react-native/generators/init/files/entity/auth/index.ts +2 -0
  102. package/platforms/react-native/generators/init/files/entity/index.ts +2 -0
  103. package/platforms/react-native/generators/init/files/feature/auth/auth.feature.ts +10 -0
  104. package/platforms/react-native/generators/init/files/feature/auth/auth.hooks.ts +7 -0
  105. package/platforms/react-native/generators/init/files/feature/auth/index.ts +1 -0
  106. package/platforms/react-native/generators/init/files/feature/auth/sign-in/SignIn.Screen.tsx +39 -0
  107. package/platforms/react-native/generators/init/files/feature/auth/sign-in/signIn.service.ts +54 -0
  108. package/platforms/react-native/generators/init/files/feature/auth/sign-up/SignUp.Screen.tsx +64 -0
  109. package/platforms/react-native/generators/init/files/feature/auth/sign-up/signUp.service.ts +73 -0
  110. package/platforms/react-native/generators/init/files/feature/feature.hooks.ts +15 -0
  111. package/platforms/react-native/generators/init/files/feature/index.ts +3 -0
  112. package/platforms/react-native/generators/init/files/feature/profile/Profile.Screen.tsx +52 -0
  113. package/platforms/react-native/generators/init/files/feature/profile/index.ts +1 -0
  114. package/platforms/react-native/generators/init/files/feature/profile/profile.feature.ts +18 -0
  115. package/platforms/react-native/generators/init/files/feature/profile/profile.hooks.ts +7 -0
  116. package/platforms/react-native/generators/init/files/index.ts +16 -0
  117. package/platforms/react-native/generators/init/files/navigation/index.ts +18 -0
  118. package/platforms/react-native/generators/init/files/navigation/navigation.app.ts +58 -0
  119. package/platforms/react-native/generators/init/files/navigation/navigation.features.ts +9 -0
  120. package/platforms/react-native/generators/init/files/navigation/navigation.hooks.ts +5 -0
  121. package/platforms/react-native/generators/init/files/navigation/navigation.tabs.ts +55 -0
  122. package/platforms/react-native/generators/init/files/navigation/navigation.widgets.ts +23 -0
  123. package/platforms/react-native/generators/init/files/services/http/http.base.ts +69 -0
  124. package/platforms/react-native/generators/init/files/services/http/http.error.ts +10 -0
  125. package/platforms/react-native/generators/init/files/services/http/http.service.ts +24 -0
  126. package/platforms/react-native/generators/init/files/services/http/middleware/index.ts +12 -0
  127. package/platforms/react-native/generators/init/files/services/http/middleware/middleware.error.ts +36 -0
  128. package/platforms/react-native/generators/init/files/services/http/middleware/middleware.registry.ts +3 -0
  129. package/platforms/react-native/generators/init/files/services/http/middleware/middleware.token.ts +97 -0
  130. package/platforms/react-native/generators/init/files/services/index.ts +15 -0
  131. package/platforms/react-native/generators/init/files/ui/components/Box/Common.tsx +19 -0
  132. package/platforms/react-native/generators/init/files/ui/components/Box/box.pm.ts +111 -0
  133. package/platforms/react-native/generators/init/files/ui/components/Box/box.types.ts +8 -0
  134. package/platforms/react-native/generators/init/files/ui/components/Box/index.ts +13 -0
  135. package/platforms/react-native/generators/init/files/ui/components/Button/Common.tsx +50 -0
  136. package/platforms/react-native/generators/init/files/ui/components/Button/Touchable.tsx +19 -0
  137. package/platforms/react-native/generators/init/files/ui/components/Button/button.pm.ts +197 -0
  138. package/platforms/react-native/generators/init/files/ui/components/Button/button.types.ts +22 -0
  139. package/platforms/react-native/generators/init/files/ui/components/Button/button.utils.ts +16 -0
  140. package/platforms/react-native/generators/init/files/ui/components/Button/index.ts +19 -0
  141. package/platforms/react-native/generators/init/files/ui/components/Form/Colours.tsx +50 -0
  142. package/platforms/react-native/generators/init/files/ui/components/Form/Common.tsx +38 -0
  143. package/platforms/react-native/generators/init/files/ui/components/Form/ErrorText.tsx +11 -0
  144. package/platforms/react-native/generators/init/files/ui/components/Form/Input.tsx +115 -0
  145. package/platforms/react-native/generators/init/files/ui/components/Form/InputArea.tsx +70 -0
  146. package/platforms/react-native/generators/init/files/ui/components/Form/Label.tsx +18 -0
  147. package/platforms/react-native/generators/init/files/ui/components/Form/Select.tsx +86 -0
  148. package/platforms/react-native/generators/init/files/ui/components/Form/components/SecureTextEntry.tsx +19 -0
  149. package/platforms/react-native/generators/init/files/ui/components/Form/form.error.ts +18 -0
  150. package/platforms/react-native/generators/init/files/ui/components/Form/form.pm.ts +134 -0
  151. package/platforms/react-native/generators/init/files/ui/components/Form/form.types.ts +59 -0
  152. package/platforms/react-native/generators/init/files/ui/components/Form/index.ts +67 -0
  153. package/platforms/react-native/generators/init/files/ui/components/Grid/Common.tsx +11 -0
  154. package/platforms/react-native/generators/init/files/ui/components/Grid/grid.pm.ts +93 -0
  155. package/platforms/react-native/generators/init/files/ui/components/Grid/grid.types.ts +79 -0
  156. package/platforms/react-native/generators/init/files/ui/components/Grid/index.ts +13 -0
  157. package/platforms/react-native/generators/init/files/ui/components/Icon/Common.tsx +19 -0
  158. package/platforms/react-native/generators/init/files/ui/components/Icon/icons.pm.ts +74 -0
  159. package/platforms/react-native/generators/init/files/ui/components/Icon/icons.types.ts +19 -0
  160. package/platforms/react-native/generators/init/files/ui/components/Icon/index.ts +3 -0
  161. package/platforms/react-native/generators/init/files/ui/components/Loading/Loading.tsx +10 -0
  162. package/platforms/react-native/generators/init/files/ui/components/Loading/loading.hook.ts +5 -0
  163. package/platforms/react-native/generators/init/files/ui/components/Loading/loading.service.ts +22 -0
  164. package/platforms/react-native/generators/init/files/ui/components/Loading/loading.store.ts +8 -0
  165. package/platforms/react-native/generators/init/files/ui/components/Screen/Common.tsx +87 -0
  166. package/platforms/react-native/generators/init/files/ui/components/Screen/Content.tsx +77 -0
  167. package/platforms/react-native/generators/init/files/ui/components/Screen/Header.tsx +80 -0
  168. package/platforms/react-native/generators/init/files/ui/components/Screen/HeaderTab.tsx +17 -0
  169. package/platforms/react-native/generators/init/files/ui/components/Screen/SafeAreaHOC.tsx +9 -0
  170. package/platforms/react-native/generators/init/files/ui/components/Screen/index.ts +22 -0
  171. package/platforms/react-native/generators/init/files/ui/components/Text/Common.tsx +20 -0
  172. package/platforms/react-native/generators/init/files/ui/components/Text/index.ts +13 -0
  173. package/platforms/react-native/generators/init/files/ui/components/Text/text.pm.ts +55 -0
  174. package/platforms/react-native/generators/init/files/ui/components/Text/text.types.ts +27 -0
  175. package/platforms/react-native/generators/init/files/ui/components/TextInput/Common.tsx +19 -0
  176. package/platforms/react-native/generators/init/files/ui/components/TextInput/index.ts +15 -0
  177. package/platforms/react-native/generators/init/files/ui/components/TextInput/textInput.pm.ts +65 -0
  178. package/platforms/react-native/generators/init/files/ui/components/TextInput/textInput.types.ts +16 -0
  179. package/platforms/react-native/generators/init/files/ui/components/ThemePicker/ThemePicker.tsx +92 -0
  180. package/platforms/react-native/generators/init/files/ui/components/ThemePicker/index.ts +1 -0
  181. package/platforms/react-native/generators/init/files/ui/components/index.ts +27 -0
  182. package/platforms/react-native/generators/init/files/ui/components/utils/color.ts +19 -0
  183. package/platforms/react-native/generators/init/files/ui/components/utils/index.ts +3 -0
  184. package/platforms/react-native/generators/init/files/ui/components/utils/useLoading.hook.spec.tsx +202 -0
  185. package/platforms/react-native/generators/init/files/ui/components/utils/useLoading.hook.ts +172 -0
  186. package/platforms/react-native/generators/init/files/ui/components/utils/useStore.ts +34 -0
  187. package/platforms/react-native/generators/init/files/ui/fonts/font-icons.ttf +0 -0
  188. package/platforms/react-native/generators/init/files/ui/icons/font-icons.json +53 -0
  189. package/platforms/react-native/generators/init/files/ui/icons/logo.png +0 -0
  190. package/platforms/react-native/generators/init/files/ui/icons/logo.svg +304 -0
  191. package/platforms/react-native/generators/init/files/ui/icons/tabs/icon-1.png +0 -0
  192. package/platforms/react-native/generators/init/files/ui/icons/tabs/icon-2.png +0 -0
  193. package/platforms/react-native/generators/init/files/ui/theme/black/black.color.ts +8 -0
  194. package/platforms/react-native/generators/init/files/ui/theme/black/index.ts +10 -0
  195. package/platforms/react-native/generators/init/files/ui/theme/blue/blue.color.ts +8 -0
  196. package/platforms/react-native/generators/init/files/ui/theme/blue/index.ts +10 -0
  197. package/platforms/react-native/generators/init/files/ui/theme/green/green.color.ts +8 -0
  198. package/platforms/react-native/generators/init/files/ui/theme/green/index.ts +10 -0
  199. package/platforms/react-native/generators/init/files/ui/theme/index.ts +11 -0
  200. package/platforms/react-native/generators/init/files/ui/theme/pink/index.ts +10 -0
  201. package/platforms/react-native/generators/init/files/ui/theme/pink/pink.color.ts +8 -0
  202. package/platforms/react-native/generators/init/files/ui/theme/scheme/index.ts +23 -0
  203. package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.color.ts +139 -0
  204. package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.radius.ts +21 -0
  205. package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.spacing.ts +24 -0
  206. package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.ts +25 -0
  207. package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.typography.ts +98 -0
  208. package/platforms/react-native/generators/init/files/ui/theme/shared/index.ts +4 -0
  209. package/platforms/react-native/generators/init/files/ui/theme/shared/shared.color.base.ts +79 -0
  210. package/platforms/react-native/generators/init/files/ui/theme/shared/shared.radius.ts +8 -0
  211. package/platforms/react-native/generators/init/files/ui/theme/shared/shared.spacing.ts +9 -0
  212. package/platforms/react-native/generators/init/files/ui/theme/shared/shared.typography.ts +105 -0
  213. package/platforms/react-native/generators/init/files/ui/theme/theme.hooks.ts +7 -0
  214. package/platforms/react-native/generators/init/files/ui/theme/theme.meta.ts +10 -0
  215. package/platforms/react-native/generators/init/files/ui/theme/theme.provider.tsx +19 -0
  216. package/platforms/react-native/generators/init/files/ui/theme/theme.service.ts +36 -0
  217. package/platforms/react-native/generators/init/files/ui/theme/theme.ts +27 -0
  218. package/platforms/react-native/generators/init/files/ui/widgets/index.ts +1 -0
  219. package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Item.tsx +175 -0
  220. package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Overlay.tsx +46 -0
  221. package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Stack.tsx +75 -0
  222. package/platforms/react-native/generators/init/files/ui/widgets/toast/index.ts +7 -0
  223. package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.hooks.ts +18 -0
  224. package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.service.ts +39 -0
  225. package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.store.ts +59 -0
  226. package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.types.ts +18 -0
  227. package/platforms/react-native/generators/init/files/ui/widgets/widgets.feature.ts +14 -0
  228. package/platforms/react-native/generators/init/files/utils/date.ts +11 -0
  229. package/platforms/react-native/generators/init/files/utils/index.ts +12 -0
  230. package/platforms/react-native/generators/init/files/utils/store.persistent.ts +103 -0
  231. package/platforms/react-native/generators/init/files/utils/store.registry.ts +14 -0
  232. package/platforms/react-native/generators/init/files/utils/string.ts +100 -0
  233. package/platforms/react-native/generators/init/generator.js +86 -0
  234. package/platforms/react-native/generators/init/kit.js +23 -0
  235. package/platforms/react-native/generators/init/navigators/expo-router/index.ts +18 -0
  236. package/platforms/react-native/generators/init/navigators/expo-router/navigation.app.ts +8 -0
  237. package/platforms/react-native/generators/init/navigators/expo-router/navigation.features.ts +9 -0
  238. package/platforms/react-native/generators/init/navigators/expo-router/navigation.hooks.ts +5 -0
  239. package/platforms/react-native/generators/init/navigators/expo-router/navigation.tabs.ts +7 -0
  240. package/platforms/react-native/generators/init/navigators/expo-router/navigation.widgets.ts +5 -0
  241. package/platforms/react-native/generators/init/navigators/react-navigation/index.ts +18 -0
  242. package/platforms/react-native/generators/init/navigators/react-navigation/navigation.app.ts +8 -0
  243. package/platforms/react-native/generators/init/navigators/react-navigation/navigation.features.ts +9 -0
  244. package/platforms/react-native/generators/init/navigators/react-navigation/navigation.hooks.ts +5 -0
  245. package/platforms/react-native/generators/init/navigators/react-navigation/navigation.tabs.ts +7 -0
  246. package/platforms/react-native/generators/init/navigators/react-navigation/navigation.widgets.ts +5 -0
  247. package/platforms/react-native/generators/setup/generator.js +225 -0
  248. package/platforms/react-native/generators/util/generator.js +12 -0
  249. package/platforms/react-native/platform.js +32 -0
  250. package/platforms/react-native/runtime.js +57 -0
  251. package/platforms/react-native/solutions/components/BottomSheet/README.md +29 -0
  252. package/platforms/react-native/solutions/components/BottomSheet/files/Common.tsx +120 -0
  253. package/platforms/react-native/solutions/components/BottomSheet/files/Content.tsx +57 -0
  254. package/platforms/react-native/solutions/components/BottomSheet/files/Context.tsx +22 -0
  255. package/platforms/react-native/solutions/components/BottomSheet/files/FlatList.tsx +50 -0
  256. package/platforms/react-native/solutions/components/BottomSheet/files/Header.tsx +57 -0
  257. package/platforms/react-native/solutions/components/BottomSheet/files/Search.tsx +24 -0
  258. package/platforms/react-native/solutions/components/BottomSheet/files/bottomSheet.constants.ts +13 -0
  259. package/platforms/react-native/solutions/components/BottomSheet/files/bottomSheet.types.ts +31 -0
  260. package/platforms/react-native/solutions/components/BottomSheet/files/index.ts +33 -0
  261. package/platforms/react-native/solutions/components/BottomSheet/solution.js +38 -0
  262. package/platforms/react-native/solutions/components/BottomSheetWidgets/README.md +29 -0
  263. package/platforms/react-native/solutions/components/BottomSheetWidgets/files/SelectPicker.tsx +47 -0
  264. package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/Content.BottomSheet.tsx +22 -0
  265. package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/DateTimePicker.BottomSheet.tsx +74 -0
  266. package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/List.BottomSheet.tsx +62 -0
  267. package/platforms/react-native/solutions/components/BottomSheetWidgets/solution.js +49 -0
  268. package/platforms/react-native/solutions/components/Calendar/README.md +29 -0
  269. package/platforms/react-native/solutions/components/Calendar/files/Common.tsx +16 -0
  270. package/platforms/react-native/solutions/components/Calendar/files/Context.tsx +466 -0
  271. package/platforms/react-native/solutions/components/Calendar/files/DayCell.tsx +89 -0
  272. package/platforms/react-native/solutions/components/Calendar/files/MonthView.tsx +41 -0
  273. package/platforms/react-native/solutions/components/Calendar/files/MonthYearOverlay.tsx +51 -0
  274. package/platforms/react-native/solutions/components/Calendar/files/SwipeablePeriod.tsx +44 -0
  275. package/platforms/react-native/solutions/components/Calendar/files/WeekDayTitles.tsx +31 -0
  276. package/platforms/react-native/solutions/components/Calendar/files/WeekView.tsx +40 -0
  277. package/platforms/react-native/solutions/components/Calendar/files/calendar.styles.ts +142 -0
  278. package/platforms/react-native/solutions/components/Calendar/files/calendar.types.ts +126 -0
  279. package/platforms/react-native/solutions/components/Calendar/files/calendar.utils.ts +143 -0
  280. package/platforms/react-native/solutions/components/Calendar/files/index.ts +40 -0
  281. package/platforms/react-native/solutions/components/Calendar/solution.js +38 -0
  282. package/platforms/react-native/solutions/components/Chart/README.md +29 -0
  283. package/platforms/react-native/solutions/components/Chart/files/Cilcular.tsx +140 -0
  284. package/platforms/react-native/solutions/components/Chart/files/index.ts +3 -0
  285. package/platforms/react-native/solutions/components/Chart/solution.js +38 -0
  286. package/platforms/react-native/solutions/components/CheckBox/README.md +29 -0
  287. package/platforms/react-native/solutions/components/CheckBox/files/Common.tsx +55 -0
  288. package/platforms/react-native/solutions/components/CheckBox/files/checkbox.pm.ts +71 -0
  289. package/platforms/react-native/solutions/components/CheckBox/files/index.ts +9 -0
  290. package/platforms/react-native/solutions/components/CheckBox/form/Checkbox.tsx +22 -0
  291. package/platforms/react-native/solutions/components/CheckBox/solution.js +57 -0
  292. package/platforms/react-native/solutions/components/DateTimePicker/README.md +29 -0
  293. package/platforms/react-native/solutions/components/DateTimePicker/files/DateTimePicker.tsx +44 -0
  294. package/platforms/react-native/solutions/components/DateTimePicker/solution.js +45 -0
  295. package/platforms/react-native/solutions/components/Image/README.md +29 -0
  296. package/platforms/react-native/solutions/components/Image/files/SVG.tsx +74 -0
  297. package/platforms/react-native/solutions/components/Image/files/image.pm.ts +25 -0
  298. package/platforms/react-native/solutions/components/Image/files/image.utils.ts +35 -0
  299. package/platforms/react-native/solutions/components/Image/files/index.ts +5 -0
  300. package/platforms/react-native/solutions/components/Image/solution.js +40 -0
  301. package/platforms/react-native/solutions/components/InputSecurity/README.md +29 -0
  302. package/platforms/react-native/solutions/components/InputSecurity/files/InputSecurity.ts +142 -0
  303. package/platforms/react-native/solutions/components/InputSecurity/solution.js +28 -0
  304. package/platforms/react-native/solutions/components/OTP/README.md +29 -0
  305. package/platforms/react-native/solutions/components/OTP/files/Item.tsx +16 -0
  306. package/platforms/react-native/solutions/components/OTP/files/Items.tsx +33 -0
  307. package/platforms/react-native/solutions/components/OTP/files/index.tsx +120 -0
  308. package/platforms/react-native/solutions/components/OTP/files/otp.pm.ts +30 -0
  309. package/platforms/react-native/solutions/components/OTP/solution.js +38 -0
  310. package/platforms/react-native/solutions/components/ProgressIndicator/README.md +29 -0
  311. package/platforms/react-native/solutions/components/ProgressIndicator/files/Circular.tsx +154 -0
  312. package/platforms/react-native/solutions/components/ProgressIndicator/files/Linear.tsx +133 -0
  313. package/platforms/react-native/solutions/components/ProgressIndicator/files/circular.pm.ts +34 -0
  314. package/platforms/react-native/solutions/components/ProgressIndicator/files/index.ts +16 -0
  315. package/platforms/react-native/solutions/components/ProgressIndicator/solution.js +39 -0
  316. package/platforms/react-native/solutions/components/Ruler/README.md +29 -0
  317. package/platforms/react-native/solutions/components/Ruler/files/Common.tsx +44 -0
  318. package/platforms/react-native/solutions/components/Ruler/files/Context.tsx +210 -0
  319. package/platforms/react-native/solutions/components/Ruler/files/Track.tsx +686 -0
  320. package/platforms/react-native/solutions/components/Ruler/files/Value.tsx +60 -0
  321. package/platforms/react-native/solutions/components/Ruler/files/index.ts +23 -0
  322. package/platforms/react-native/solutions/components/Ruler/files/ruler.constants.ts +70 -0
  323. package/platforms/react-native/solutions/components/Ruler/files/ruler.types.ts +98 -0
  324. package/platforms/react-native/solutions/components/Ruler/files/ruler.utils.ts +332 -0
  325. package/platforms/react-native/solutions/components/Ruler/solution.js +38 -0
  326. package/platforms/react-native/solutions/components/Section/README.md +29 -0
  327. package/platforms/react-native/solutions/components/Section/files/Common.tsx +144 -0
  328. package/platforms/react-native/solutions/components/Section/solution.js +37 -0
  329. package/platforms/react-native/solutions/components/Slider/README.md +29 -0
  330. package/platforms/react-native/solutions/components/Slider/files/Container.tsx +5 -0
  331. package/platforms/react-native/solutions/components/Slider/files/Content.tsx +44 -0
  332. package/platforms/react-native/solutions/components/Slider/files/Context.tsx +30 -0
  333. package/platforms/react-native/solutions/components/Slider/files/Pagination.Dot.tsx +61 -0
  334. package/platforms/react-native/solutions/components/Slider/files/index.ts +22 -0
  335. package/platforms/react-native/solutions/components/Slider/solution.js +38 -0
  336. package/platforms/react-native/solutions/components/Switch/README.md +29 -0
  337. package/platforms/react-native/solutions/components/Switch/files/Common.tsx +38 -0
  338. package/platforms/react-native/solutions/components/Switch/files/index.ts +9 -0
  339. package/platforms/react-native/solutions/components/Switch/files/switch.pm.ts +53 -0
  340. package/platforms/react-native/solutions/components/Switch/solution.js +38 -0
  341. package/platforms/react-native/solutions/install.js +97 -0
  342. package/platforms/react-native/solutions/services/firebase-core/README.md +31 -0
  343. package/platforms/react-native/solutions/services/firebase-core/files/index.ts +5 -0
  344. package/platforms/react-native/solutions/services/firebase-core/solution.js +39 -0
  345. package/platforms/react-native/solutions/services/firebase-messaging/README.md +31 -0
  346. package/platforms/react-native/solutions/services/firebase-messaging/files/index.ts +20 -0
  347. package/platforms/react-native/solutions/services/firebase-messaging/solution.js +42 -0
  348. package/platforms/react-native/solutions/utils/permissions/README.md +29 -0
  349. package/platforms/react-native/solutions/utils/permissions/files/permissions.ts +10 -0
  350. package/platforms/react-native/solutions/utils/permissions/solution.js +32 -0
  351. package/presets/react-native-fsd/index.js +25 -0
  352. package/shared/generators/entity/render.js +88 -0
  353. package/shared/generators/entity/templates/crud/api.ts.hbs +36 -0
  354. package/shared/generators/entity/templates/crud/dto.ts.hbs +36 -0
  355. package/shared/generators/entity/templates/crud/service.ts.hbs +73 -0
  356. package/shared/generators/entity/templates/crud/store.ts.hbs +27 -0
  357. package/shared/generators/entity/templates/index.ts.hbs +2 -0
  358. package/shared/generators/entity/templates/simple/api.ts.hbs +16 -0
  359. package/shared/generators/entity/templates/simple/dto.ts.hbs +5 -0
  360. package/shared/generators/entity/templates/simple/service.ts.hbs +26 -0
  361. package/shared/generators/entity/templates/simple/store.ts.hbs +18 -0
  362. package/shared/solutions/utils/date/README.md +29 -0
  363. package/shared/solutions/utils/date/files/date.ts +11 -0
  364. package/shared/solutions/utils/date/solution.js +27 -0
  365. package/shared/solutions/utils/string/README.md +29 -0
  366. package/shared/solutions/utils/string/files/string.ts +100 -0
  367. package/shared/solutions/utils/string/solution.js +27 -0
@@ -0,0 +1,29 @@
1
+ # Chart
2
+
3
+ Chart from the previous template kit. Treat the API as experimental until it is wired into a screen.
4
+
5
+ ## API
6
+
7
+ Default export from ui/components/Chart.
8
+
9
+ ## Example
10
+
11
+ ```tsx
12
+ import Chart from '@components/Chart';
13
+ ```
14
+
15
+ ## Dependencies
16
+
17
+ None beyond the setup baseline.
18
+
19
+ No other solutions are required.
20
+
21
+ ## Manual steps
22
+
23
+ None.
24
+
25
+ ## Added in
26
+
27
+ 1.0.0 (`experimental`).
28
+
29
+ Install with `forge g add --id component:Chart`.
@@ -0,0 +1,140 @@
1
+ import { Canvas, Path, Skia, SkPath } from '@shopify/react-native-skia';
2
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';
4
+ import { Easing, useSharedValue, withTiming } from 'react-native-reanimated';
5
+
6
+ import { theme, useTheme } from '@theme';
7
+
8
+ export type CircularProgressProps = {
9
+ /** Progress value from 0 to 1 (e.g. 0.65 = 65%). */
10
+ progress: number;
11
+ /** Thickness of the ring's border/stroke. Fully configurable. Default: 12 */
12
+ strokeWidth?: number;
13
+ /** Color of the filled progress arc. */
14
+ color?: string;
15
+ /** Color of the background track (the "unfilled" part of the ring). */
16
+ trackColor?: string;
17
+ /** End cap style for the progress arc. */
18
+ strokeCap?: 'butt' | 'round' | 'square';
19
+ /** Animation duration in ms. Default: 800 */
20
+ duration?: number;
21
+ /**
22
+ * Optional fixed diameter. If omitted (recommended), the component
23
+ * measures its parent and stretches to fill the available free space.
24
+ */
25
+ size?: number;
26
+ /** Optional content rendered centered inside the ring (e.g. a percentage label). */
27
+ children?: React.ReactNode;
28
+ /** Style applied to the outer wrapping View. */
29
+ style?: ViewStyle;
30
+ };
31
+
32
+ export const CircularChart: React.FC<CircularProgressProps> = ({
33
+ progress,
34
+ strokeWidth = 8,
35
+ color: _color = '#4F46E5',
36
+ trackColor: _trackColor = '#E5E7EB',
37
+ strokeCap = 'round',
38
+ duration = 800,
39
+ size,
40
+ children,
41
+ style,
42
+ }) => {
43
+ const themeKey = useTheme();
44
+ const color = theme.hasKey(`color.${_color}`) ? theme.get(`color.${_color}`, themeKey) : _color;
45
+ const trackColor = theme.hasKey(`color.${_trackColor}`) ? theme.get(`color.${_trackColor}`, themeKey) : _trackColor;
46
+
47
+ const [measured, setMeasured] = useState({ width: size ?? 0, height: size ?? 0 });
48
+
49
+ const onLayout = useCallback(
50
+ (e: LayoutChangeEvent) => {
51
+ if (size) return; // fixed size was given, no need to measure
52
+ const { width, height } = e.nativeEvent.layout;
53
+ if (width !== measured.width || height !== measured.height) {
54
+ setMeasured({ width, height });
55
+ }
56
+ },
57
+ [size, measured.width, measured.height],
58
+ );
59
+
60
+ // Stretch to fill whatever free space is available, staying a perfect
61
+ // circle by using the smaller of the two dimensions.
62
+ const diameter = size ?? Math.min(measured.width, measured.height);
63
+ const radius = Math.max(0, diameter / 2 - strokeWidth / 2);
64
+ const cx = diameter / 2;
65
+ const cy = diameter / 2;
66
+
67
+ // Build the circular path (starts at 12 o'clock, sweeps clockwise).
68
+ const path: SkPath = useMemo(() => {
69
+ const p = Skia.Path.Make();
70
+ if (diameter > 0 && radius > 0) {
71
+ const rect = Skia.XYWHRect(cx - radius, cy - radius, radius * 2, radius * 2);
72
+ p.addArc(rect, -90, 360);
73
+ }
74
+ return p;
75
+ }, [diameter, radius, cx, cy]);
76
+
77
+ // Drives the `end` trim of the progress Path. Skia components accept
78
+ // Reanimated shared values directly as props and update on the UI thread.
79
+ const animatedEnd = useSharedValue(0);
80
+
81
+ useEffect(() => {
82
+ const clamped = Math.max(0, Math.min(1, progress));
83
+ animatedEnd.value = withTiming(clamped, {
84
+ duration,
85
+ easing: Easing.out(Easing.cubic),
86
+ });
87
+ }, [progress, duration, animatedEnd]);
88
+
89
+ if (diameter <= 0) {
90
+ // First render before layout is known — just render the measuring container.
91
+ return <View style={[styles.container, style]} onLayout={onLayout} />;
92
+ }
93
+
94
+ return (
95
+ <View style={[styles.container, style]} onLayout={onLayout}>
96
+ <Canvas style={{ width: diameter, height: diameter }}>
97
+ <Path
98
+ path={path}
99
+ style="stroke"
100
+ strokeWidth={strokeWidth}
101
+ strokeCap={strokeCap}
102
+ color={trackColor}
103
+ opacity={0.8}
104
+ />
105
+ <Path
106
+ path={path}
107
+ style="stroke"
108
+ strokeWidth={strokeWidth}
109
+ strokeCap={strokeCap}
110
+ color={color}
111
+ start={0}
112
+ end={animatedEnd}
113
+ />
114
+ </Canvas>
115
+
116
+ {children ? (
117
+ <View pointerEvents="none" style={styles.centerContent}>
118
+ {children}
119
+ </View>
120
+ ) : null}
121
+ </View>
122
+ );
123
+ };
124
+
125
+ const styles = StyleSheet.create({
126
+ container: {
127
+ flex: 1,
128
+ width: '100%',
129
+ height: '100%',
130
+ alignItems: 'center',
131
+ justifyContent: 'center',
132
+ },
133
+ centerContent: {
134
+ position: 'absolute',
135
+ alignItems: 'center',
136
+ justifyContent: 'center',
137
+ },
138
+ });
139
+
140
+ export default CircularChart;
@@ -0,0 +1,3 @@
1
+ import Circular from './Cilcular';
2
+
3
+ export default { Circular };
@@ -0,0 +1,38 @@
1
+ export default {
2
+ "id": "component:Chart",
3
+ "type": "component",
4
+ "platforms": [
5
+ "react-native"
6
+ ],
7
+ "title": "Chart",
8
+ "description": "Chart from the previous template kit. Treat the API as experimental until it is wired into a screen.",
9
+ "status": "experimental",
10
+ "since": "1.0.0",
11
+ "tags": [
12
+ "ui",
13
+ "kit"
14
+ ],
15
+ "requires": [],
16
+ "dependencies": [],
17
+ "files": [
18
+ {
19
+ "from": "files",
20
+ "to": "ui/components/Chart"
21
+ }
22
+ ],
23
+ "register": [
24
+ {
25
+ "file": "ui/components/index.ts",
26
+ "marker": "components-import",
27
+ "code": "import Chart from './Chart';\n"
28
+ },
29
+ {
30
+ "file": "ui/components/index.ts",
31
+ "marker": "components-export",
32
+ "code": " Chart,\n"
33
+ }
34
+ ],
35
+ "manual": [],
36
+ "api": "Default export from ui/components/Chart.",
37
+ "example": "import Chart from '@components/Chart';"
38
+ };
@@ -0,0 +1,29 @@
1
+ # CheckBox
2
+
3
+ Themed checkbox and the matching form element.
4
+
5
+ ## API
6
+
7
+ CheckBox and Form.Element.Checkbox.
8
+
9
+ ## Example
10
+
11
+ ```tsx
12
+ <Form.Item name="agree"><Form.Element.Checkbox label="Agree" /></Form.Item>
13
+ ```
14
+
15
+ ## Dependencies
16
+
17
+ None beyond the setup baseline.
18
+
19
+ No other solutions are required.
20
+
21
+ ## Manual steps
22
+
23
+ None.
24
+
25
+ ## Added in
26
+
27
+ 1.0.0 (`stable`).
28
+
29
+ Install with `forge g add --id component:CheckBox`.
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { Pressable, Text, View } from 'react-native';
3
+ // import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
4
+
5
+ import { Icon } from '@components';
6
+ import { CheckBoxPM } from '@components/CheckBox/checkbox.pm';
7
+ import { TGridProps } from '@components/Grid/grid.types';
8
+ import { useLoading } from '@components/utils/useLoading.hook';
9
+
10
+ // const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
11
+
12
+ interface ICheckBoxProps {
13
+ loading?: boolean;
14
+ value?: boolean;
15
+ label?: string | React.ReactNode;
16
+ onChange?: (value: boolean) => void | Promise<void>;
17
+ disabled?: boolean;
18
+ reverse?: boolean;
19
+ round?: boolean;
20
+ stretched?: boolean;
21
+ color?: string;
22
+ }
23
+
24
+ export default function Common({
25
+ value,
26
+ onChange,
27
+ loading,
28
+ stretched = true,
29
+ color = 'outline',
30
+ ...checkBoxProps
31
+ }: ICheckBoxProps & TGridProps) {
32
+ const { loading: internalLoading, handle } = useLoading(() => onChange?.(!value));
33
+
34
+ const props = CheckBoxPM.get({
35
+ value,
36
+ loading: internalLoading || loading,
37
+ color,
38
+ stretched,
39
+ ...checkBoxProps,
40
+ });
41
+
42
+ return (
43
+ <Pressable {...props.container} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }} onPress={handle}>
44
+ <View {...props.checkbox}>
45
+ {value ? (
46
+ <View>
47
+ <Icon {...props.icon} />
48
+ {/*{loading ? <ProgressIndicator.Circular size={14} /> : null}*/}
49
+ </View>
50
+ ) : null}
51
+ </View>
52
+ {props.label?.children ? <Text {...props.label} /> : null}
53
+ </Pressable>
54
+ );
55
+ }
@@ -0,0 +1,71 @@
1
+ import { Prop, Node, PropertyManager, Static } from '@effijs/props-manager';
2
+
3
+ import { TTheme, ThemeScheme } from '@theme';
4
+
5
+ export const CheckBoxPM = PropertyManager.create('CheckBox').node(
6
+ Node('container')
7
+ .extends('Grid')
8
+ .keys(
9
+ Static({ row: true, 'gap-s': true, 'align-center': true }),
10
+ Prop('reverse'),
11
+ Prop(['label', 'stretched'], ({ label, stretched }) => ({ flex: stretched && label ? 1 : 0 })),
12
+ ),
13
+ Node('label')
14
+ .extends('Text')
15
+ .pickKeys('label', 'stretched')
16
+ .keys(
17
+ 'style',
18
+ Prop(['label', 'stretched'], ({ label, stretched }) => ({ flex: stretched && label ? 1 : 0 })),
19
+ )
20
+ .keys(
21
+ Static({ 'body-m': true }),
22
+ Prop(['label'], ({ label }) => ({ children: label })),
23
+ ),
24
+
25
+ Node('icon')
26
+ // .extends('Text')
27
+ .pickKeys('color')
28
+ .keys(
29
+ Static({ icon: 'check', size: 20 }),
30
+ Prop(['color'], ({ color }) => ({ color: `on${color.charAt(0).toUpperCase()}${color.slice(1)}` })),
31
+ ),
32
+ Node('checkbox')
33
+ .keys(
34
+ 'style',
35
+ Prop('style', ({ style }) => style),
36
+ Static({
37
+ width: 18,
38
+ height: 18,
39
+ alignItems: 'center',
40
+ justifyContent: 'center',
41
+ borderWidth: 2,
42
+ borderRadius: 4,
43
+ }),
44
+ Prop('round', {
45
+ width: 20,
46
+ height: 20,
47
+ borderRadius: 10,
48
+ }),
49
+ Prop(
50
+ ['color', 'value', 'theme'],
51
+ ({ color, value, theme: themeName }, { theme }: { theme: TTheme }) => {
52
+ const clr = theme.get(`color.${color as keyof ThemeScheme['color']}`, themeName) ?? color;
53
+
54
+ return {
55
+ borderColor: clr,
56
+ backgroundColor: value ? clr : 'transparent',
57
+ };
58
+ },
59
+ { nullWhenFirstKeyNull: true, providers: ['theme'] },
60
+ ),
61
+ Prop(
62
+ ['borderColor', 'theme'],
63
+ ({ borderColor, theme: themeName }, { theme }) => ({
64
+ borderColor: theme.get(`color.${borderColor}`, themeName) ?? borderColor,
65
+ }),
66
+ { nullWhenFirstKeyNull: true, providers: ['theme'] },
67
+ ),
68
+ Prop('borderWidth'),
69
+ )
70
+ .keys(Prop('disabled')),
71
+ );
@@ -0,0 +1,9 @@
1
+ import Common from './Common';
2
+
3
+ type TCommon = typeof Common;
4
+
5
+ interface ICheckBox extends TCommon {}
6
+
7
+ const CheckBox = Common as ICheckBox;
8
+
9
+ export default CheckBox;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+
3
+ import { CheckBox } from '@components';
4
+
5
+ import Common from './Common';
6
+ import type { TFormCheckboxProps } from './form.types';
7
+
8
+ export default function FormCheckbox({
9
+ label,
10
+ value,
11
+ onChange,
12
+ disabled,
13
+ type,
14
+ stretched,
15
+ ...rest
16
+ }: TFormCheckboxProps<boolean>) {
17
+ return (
18
+ <Common disabled={disabled} focusable={!disabled} type={type} {...rest}>
19
+ <CheckBox label={label} disabled={disabled} onChange={onChange} value={value} stretched={stretched} />
20
+ </Common>
21
+ );
22
+ }
@@ -0,0 +1,57 @@
1
+ export default {
2
+ "id": "component:CheckBox",
3
+ "type": "component",
4
+ "platforms": [
5
+ "react-native"
6
+ ],
7
+ "title": "CheckBox",
8
+ "description": "Themed checkbox and the matching form element.",
9
+ "status": "stable",
10
+ "since": "1.0.0",
11
+ "tags": [
12
+ "ui",
13
+ "form"
14
+ ],
15
+ "requires": [],
16
+ "dependencies": [],
17
+ "files": [
18
+ {
19
+ "from": "files",
20
+ "to": "ui/components/CheckBox"
21
+ },
22
+ {
23
+ "from": "form/Checkbox.tsx",
24
+ "to": "ui/components/Form/Checkbox.tsx"
25
+ }
26
+ ],
27
+ "register": [
28
+ {
29
+ "file": "ui/components/index.ts",
30
+ "marker": "components-import",
31
+ "code": "import CheckBox from './CheckBox';\n"
32
+ },
33
+ {
34
+ "file": "ui/components/index.ts",
35
+ "marker": "components-export",
36
+ "code": " CheckBox,\n"
37
+ },
38
+ {
39
+ "file": "ui/components/Form/index.ts",
40
+ "marker": "form-imports",
41
+ "code": "import FormCheckbox from './Checkbox';\n"
42
+ },
43
+ {
44
+ "file": "ui/components/Form/index.ts",
45
+ "marker": "form-types",
46
+ "code": " Checkbox: typeof FormCheckbox;\n"
47
+ },
48
+ {
49
+ "file": "ui/components/Form/index.ts",
50
+ "marker": "form-elements",
51
+ "code": " Checkbox: FormCheckbox,\n"
52
+ }
53
+ ],
54
+ "manual": [],
55
+ "api": "CheckBox and Form.Element.Checkbox.",
56
+ "example": "<Form.Item name=\"agree\"><Form.Element.Checkbox label=\"Agree\" /></Form.Item>"
57
+ };
@@ -0,0 +1,29 @@
1
+ # DateTimePicker
2
+
3
+ Form date field that opens the bottom-sheet picker.
4
+
5
+ ## API
6
+
7
+ Form.Element.DateTimePicker. format, minimumDate, maximumDate, mode.
8
+
9
+ ## Example
10
+
11
+ ```tsx
12
+ <Form.Item name="date"><Form.Element.DateTimePicker mode="date" /></Form.Item>
13
+ ```
14
+
15
+ ## Dependencies
16
+
17
+ None beyond the setup baseline.
18
+
19
+ Requires: `component:BottomSheetWidgets`.
20
+
21
+ ## Manual steps
22
+
23
+ None.
24
+
25
+ ## Added in
26
+
27
+ 1.0.0 (`stable`).
28
+
29
+ Install with `forge g add --id component:DateTimePicker`.
@@ -0,0 +1,44 @@
1
+ import dayjs from 'dayjs';
2
+
3
+ import type { TFormSelectProps } from '@components/Form/form.types';
4
+ import FormSelect from '@components/Form/Select';
5
+ import { useNavigation } from '@navigation/navigation.hooks';
6
+ import { IDateTimePickerBottomSheetProps } from '@widgets/bottomSheet/DateTimePicker.BottomSheet.tsx';
7
+
8
+ type TFormSelectPossibleProps = Omit<TFormSelectProps<Date>, 'onSelect' | 'value' | 'getTitleForValue' | 'onChange'>;
9
+
10
+ interface IDateTimePickerProps extends TFormSelectPossibleProps, IDateTimePickerBottomSheetProps {
11
+ format?: string;
12
+ emptyValueTitle?: string;
13
+ }
14
+
15
+ export default function DateTimePicker({
16
+ format,
17
+ minimumDate,
18
+ maximumDate,
19
+ mode,
20
+ title,
21
+ description,
22
+ emptyValueTitle,
23
+ canClear,
24
+ ...props
25
+ }: IDateTimePickerProps) {
26
+ const navigation = useNavigation();
27
+
28
+ const getTitleForValue = (value?: Date) =>
29
+ value ? dayjs(value).format(format || 'DD MMM YYYY HH:mm') : emptyValueTitle ? emptyValueTitle : '';
30
+
31
+ const onSelect: TFormSelectProps<Date>['onSelect'] = (value, onSelectChange) =>
32
+ navigation.widgets.showDateTime({
33
+ value,
34
+ minimumDate,
35
+ maximumDate,
36
+ mode,
37
+ title,
38
+ description,
39
+ canClear,
40
+ onChange: value => onSelectChange(value, getTitleForValue(value) || 'Title '),
41
+ });
42
+
43
+ return <FormSelect {...props} onSelect={onSelect} getTitleForValue={getTitleForValue} />;
44
+ }
@@ -0,0 +1,45 @@
1
+ export default {
2
+ "id": "component:DateTimePicker",
3
+ "type": "component",
4
+ "platforms": [
5
+ "react-native"
6
+ ],
7
+ "title": "DateTimePicker",
8
+ "description": "Form date field that opens the bottom-sheet picker.",
9
+ "status": "stable",
10
+ "since": "1.0.0",
11
+ "tags": [
12
+ "ui",
13
+ "form"
14
+ ],
15
+ "requires": [
16
+ "component:BottomSheetWidgets"
17
+ ],
18
+ "dependencies": [],
19
+ "files": [
20
+ {
21
+ "from": "files/DateTimePicker.tsx",
22
+ "to": "ui/components/Form/DateTimePicker.tsx"
23
+ }
24
+ ],
25
+ "register": [
26
+ {
27
+ "file": "ui/components/Form/index.ts",
28
+ "marker": "form-imports",
29
+ "code": "import DateTimePicker from './DateTimePicker';\n"
30
+ },
31
+ {
32
+ "file": "ui/components/Form/index.ts",
33
+ "marker": "form-types",
34
+ "code": " DateTimePicker: typeof DateTimePicker;\n"
35
+ },
36
+ {
37
+ "file": "ui/components/Form/index.ts",
38
+ "marker": "form-elements",
39
+ "code": " DateTimePicker,\n"
40
+ }
41
+ ],
42
+ "manual": [],
43
+ "api": "Form.Element.DateTimePicker. format, minimumDate, maximumDate, mode.",
44
+ "example": "<Form.Item name=\"date\"><Form.Element.DateTimePicker mode=\"date\" /></Form.Item>"
45
+ };
@@ -0,0 +1,29 @@
1
+ # Image
2
+
3
+ Native and SVG image with theme sizing. SVG rendering uses Skia.
4
+
5
+ ## API
6
+
7
+ Image.Native and Image.SVG.
8
+
9
+ ## Example
10
+
11
+ ```tsx
12
+ <Image.Native source={{ uri }} width={96} height={96} />
13
+ ```
14
+
15
+ ## Dependencies
16
+
17
+ - matrix key `skia`
18
+
19
+ No other solutions are required.
20
+
21
+ ## Manual steps
22
+
23
+ None.
24
+
25
+ ## Added in
26
+
27
+ 1.0.0 (`stable`).
28
+
29
+ Install with `forge g add --id component:Image`.
@@ -0,0 +1,74 @@
1
+ import {
2
+ Canvas,
3
+ ImageSVG,
4
+ rect,
5
+ fitbox,
6
+ useSVG,
7
+ Group,
8
+ type DataSourceParam,
9
+ Paint,
10
+ BlendColor,
11
+ } from '@shopify/react-native-skia';
12
+ import React, { useEffect } from 'react';
13
+ import { StyleSheet, View } from 'react-native';
14
+
15
+ import { TGridProps } from '@components/Grid/grid.types.ts';
16
+ import { ImagePM } from '@components/Image/image.pm.ts';
17
+
18
+ export default function SVG({
19
+ image,
20
+ ...svgProps
21
+ }: {
22
+ image: DataSourceParam;
23
+ width?: number;
24
+ height?: number;
25
+ color?: string;
26
+ } & TGridProps) {
27
+ const props = ImagePM.get(svgProps);
28
+ return (
29
+ <View {...props.container}>
30
+ <Content image={image} {...props.svg} />
31
+ </View>
32
+ );
33
+ }
34
+
35
+ function Content({
36
+ image,
37
+ width = 375,
38
+ height = 375,
39
+ color,
40
+ }: {
41
+ image: DataSourceParam;
42
+ width?: number;
43
+ height?: number;
44
+ color?: string;
45
+ }) {
46
+ const svg = useSVG(image);
47
+
48
+ // useEffect(() => () => svg?.dispose(), [svg]);
49
+
50
+ if (!svg) {
51
+ return null;
52
+ }
53
+
54
+ const src = rect(0, 0, svg.width(), svg.height());
55
+ const dst = rect(0, 0, width, height);
56
+
57
+ return (
58
+ <View style={{ width, height }}>
59
+ <Canvas style={{ width, height }}>
60
+ <Group
61
+ transform={fitbox('contain', src, dst)}
62
+ layer={
63
+ color ? (
64
+ <Paint>
65
+ <BlendColor color={color} mode="srcIn" />
66
+ </Paint>
67
+ ) : undefined
68
+ }>
69
+ <ImageSVG svg={svg} x={0} y={0} width={width} height={height} />
70
+ </Group>
71
+ </Canvas>
72
+ </View>
73
+ );
74
+ }