@effijs/templates 0.0.0-stage → 1.0.0-alpha.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.
- package/CONTRIBUTING.md +27 -0
- package/LICENSE +22 -0
- package/README.md +32 -2
- package/ai/SETUP.md +5 -0
- package/docs/catalog.md +85 -0
- package/forge.manifest.js +75 -0
- package/lib/compat.js +40 -0
- package/lib/docs/build.js +146 -0
- package/lib/install.js +51 -0
- package/lib/journal.js +40 -0
- package/lib/jsonConfig.js +33 -0
- package/lib/migration.js +35 -0
- package/lib/names.js +42 -0
- package/lib/patch.js +62 -0
- package/lib/paths.js +12 -0
- package/lib/project.js +48 -0
- package/lib/registry.js +99 -0
- package/package.json +46 -4
- package/platforms/react-native/CATALOG.md +391 -0
- package/platforms/react-native/ORIGIN.md +42 -0
- package/platforms/react-native/README.md +78 -0
- package/platforms/react-native/ai/AGENTS.md.hbs +36 -0
- package/platforms/react-native/ai/SETUP.md +89 -0
- package/platforms/react-native/compat/matrix.js +150 -0
- package/platforms/react-native/configs/babel.js +63 -0
- package/platforms/react-native/configs/forgeConfig.js +35 -0
- package/platforms/react-native/configs/jsConfigs.js +96 -0
- package/platforms/react-native/configs/metro.js +86 -0
- package/platforms/react-native/generators/add/generator.js +12 -0
- package/platforms/react-native/generators/add/run.js +64 -0
- package/platforms/react-native/generators/component/generator.js +75 -0
- package/platforms/react-native/generators/component/render.js +69 -0
- package/platforms/react-native/generators/component/templates/Common.tsx.hbs +13 -0
- package/platforms/react-native/generators/component/templates/index.ts.hbs +13 -0
- package/platforms/react-native/generators/component/templates/pm.ts.hbs +7 -0
- package/platforms/react-native/generators/component/templates/types.ts.hbs +3 -0
- package/platforms/react-native/generators/demo/files/api/app.http +8 -0
- package/platforms/react-native/generators/demo/files/api/environment/http-client.env.json +5 -0
- package/platforms/react-native/generators/demo/files/entity/category/category.api.ts +18 -0
- package/platforms/react-native/generators/demo/files/entity/category/category.dto.ts +15 -0
- package/platforms/react-native/generators/demo/files/entity/category/category.service.ts +42 -0
- package/platforms/react-native/generators/demo/files/entity/category/category.store.ts +26 -0
- package/platforms/react-native/generators/demo/files/entity/category/index.ts +2 -0
- package/platforms/react-native/generators/demo/files/entity/product/index.ts +2 -0
- package/platforms/react-native/generators/demo/files/entity/product/product.api.ts +49 -0
- package/platforms/react-native/generators/demo/files/entity/product/product.dto.ts +120 -0
- package/platforms/react-native/generators/demo/files/entity/product/product.service.ts +139 -0
- package/platforms/react-native/generators/demo/files/entity/product/product.store.ts +37 -0
- package/platforms/react-native/generators/demo/files/feature/product/components/Product.CategorySelect.tsx +36 -0
- package/platforms/react-native/generators/demo/files/feature/product/detail/Product.Detail.Screen.tsx +100 -0
- package/platforms/react-native/generators/demo/files/feature/product/detail/product.detail.service.ts +33 -0
- package/platforms/react-native/generators/demo/files/feature/product/filter/Product.Filter.Screen.tsx +59 -0
- package/platforms/react-native/generators/demo/files/feature/product/filter/product.filter.service.ts +78 -0
- package/platforms/react-native/generators/demo/files/feature/product/form/Product.Form.Screen.tsx +71 -0
- package/platforms/react-native/generators/demo/files/feature/product/form/product.form.service.ts +142 -0
- package/platforms/react-native/generators/demo/files/feature/product/index.ts +7 -0
- package/platforms/react-native/generators/demo/files/feature/product/list/Product.List.Item.tsx +34 -0
- package/platforms/react-native/generators/demo/files/feature/product/list/Product.List.Screen.tsx +106 -0
- package/platforms/react-native/generators/demo/files/feature/product/list/product.list.service.ts +47 -0
- package/platforms/react-native/generators/demo/files/feature/product/product.feature.ts +29 -0
- package/platforms/react-native/generators/demo/files/feature/product/product.hooks.ts +7 -0
- package/platforms/react-native/generators/demo/files/feature/product/search/Product.Search.Screen.tsx +82 -0
- package/platforms/react-native/generators/demo/files/feature/product/search/product.search.service.ts +97 -0
- package/platforms/react-native/generators/demo/files/navigation/navigation.product.ts +46 -0
- package/platforms/react-native/generators/demo/generator.js +93 -0
- package/platforms/react-native/generators/entity/generator.js +68 -0
- package/platforms/react-native/generators/feature/generator.js +224 -0
- package/platforms/react-native/generators/feature/render.js +163 -0
- package/platforms/react-native/generators/feature/templates/detail.screen.tsx.hbs +25 -0
- package/platforms/react-native/generators/feature/templates/detail.service.ts.hbs +14 -0
- package/platforms/react-native/generators/feature/templates/feature.ts.hbs +18 -0
- package/platforms/react-native/generators/feature/templates/filter.screen.tsx.hbs +17 -0
- package/platforms/react-native/generators/feature/templates/filter.service.ts.hbs +14 -0
- package/platforms/react-native/generators/feature/templates/form.screen.tsx.hbs +21 -0
- package/platforms/react-native/generators/feature/templates/form.service.ts.hbs +37 -0
- package/platforms/react-native/generators/feature/templates/hooks.ts.hbs +7 -0
- package/platforms/react-native/generators/feature/templates/index.ts.hbs +2 -0
- package/platforms/react-native/generators/feature/templates/list.item.tsx.hbs +16 -0
- package/platforms/react-native/generators/feature/templates/list.screen.tsx.hbs +34 -0
- package/platforms/react-native/generators/feature/templates/list.service.ts.hbs +15 -0
- package/platforms/react-native/generators/feature/templates/navigation.ts.hbs +12 -0
- package/platforms/react-native/generators/feature/templates/search.screen.tsx.hbs +24 -0
- package/platforms/react-native/generators/feature/templates/search.service.ts.hbs +13 -0
- package/platforms/react-native/generators/feature/templates/tab.tsx.hbs +8 -0
- package/platforms/react-native/generators/init/files/app/app.controller.ts +41 -0
- package/platforms/react-native/generators/init/files/app/app.error.ts +1 -0
- package/platforms/react-native/generators/init/files/app/app.store.ts +12 -0
- package/platforms/react-native/generators/init/files/app/index.ts +19 -0
- package/platforms/react-native/generators/init/files/app/splash/Onboarding.Screen.tsx +31 -0
- package/platforms/react-native/generators/init/files/app/splash/Splash.Screen.tsx +14 -0
- package/platforms/react-native/generators/init/files/app/tabs/home/Home.tab.tsx +24 -0
- package/platforms/react-native/generators/init/files/app/tabs/profile/Profile.tab.tsx +1 -0
- package/platforms/react-native/generators/init/files/configs/dev.ts.hbs +5 -0
- package/platforms/react-native/generators/init/files/configs/index.ts +4 -0
- package/platforms/react-native/generators/init/files/configs/prod.ts.hbs +5 -0
- package/platforms/react-native/generators/init/files/entity/auth/auth.api.ts +36 -0
- package/platforms/react-native/generators/init/files/entity/auth/auth.dto.ts +26 -0
- package/platforms/react-native/generators/init/files/entity/auth/auth.service.ts +94 -0
- package/platforms/react-native/generators/init/files/entity/auth/auth.session.store.ts +14 -0
- package/platforms/react-native/generators/init/files/entity/auth/auth.store.ts +20 -0
- package/platforms/react-native/generators/init/files/entity/auth/index.ts +2 -0
- package/platforms/react-native/generators/init/files/entity/index.ts +2 -0
- package/platforms/react-native/generators/init/files/feature/auth/auth.feature.ts +10 -0
- package/platforms/react-native/generators/init/files/feature/auth/auth.hooks.ts +7 -0
- package/platforms/react-native/generators/init/files/feature/auth/index.ts +1 -0
- package/platforms/react-native/generators/init/files/feature/auth/sign-in/SignIn.Screen.tsx +39 -0
- package/platforms/react-native/generators/init/files/feature/auth/sign-in/signIn.service.ts +54 -0
- package/platforms/react-native/generators/init/files/feature/auth/sign-up/SignUp.Screen.tsx +64 -0
- package/platforms/react-native/generators/init/files/feature/auth/sign-up/signUp.service.ts +73 -0
- package/platforms/react-native/generators/init/files/feature/feature.hooks.ts +15 -0
- package/platforms/react-native/generators/init/files/feature/index.ts +3 -0
- package/platforms/react-native/generators/init/files/feature/profile/Profile.Screen.tsx +52 -0
- package/platforms/react-native/generators/init/files/feature/profile/index.ts +1 -0
- package/platforms/react-native/generators/init/files/feature/profile/profile.feature.ts +18 -0
- package/platforms/react-native/generators/init/files/feature/profile/profile.hooks.ts +7 -0
- package/platforms/react-native/generators/init/files/index.ts +16 -0
- package/platforms/react-native/generators/init/files/navigation/index.ts +18 -0
- package/platforms/react-native/generators/init/files/navigation/navigation.app.ts +58 -0
- package/platforms/react-native/generators/init/files/navigation/navigation.features.ts +9 -0
- package/platforms/react-native/generators/init/files/navigation/navigation.hooks.ts +5 -0
- package/platforms/react-native/generators/init/files/navigation/navigation.tabs.ts +55 -0
- package/platforms/react-native/generators/init/files/navigation/navigation.widgets.ts +23 -0
- package/platforms/react-native/generators/init/files/services/http/http.base.ts +69 -0
- package/platforms/react-native/generators/init/files/services/http/http.error.ts +10 -0
- package/platforms/react-native/generators/init/files/services/http/http.service.ts +24 -0
- package/platforms/react-native/generators/init/files/services/http/middleware/index.ts +12 -0
- package/platforms/react-native/generators/init/files/services/http/middleware/middleware.error.ts +36 -0
- package/platforms/react-native/generators/init/files/services/http/middleware/middleware.registry.ts +3 -0
- package/platforms/react-native/generators/init/files/services/http/middleware/middleware.token.ts +97 -0
- package/platforms/react-native/generators/init/files/services/index.ts +15 -0
- package/platforms/react-native/generators/init/files/ui/components/Box/Common.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Box/box.pm.ts +111 -0
- package/platforms/react-native/generators/init/files/ui/components/Box/box.types.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/components/Box/index.ts +13 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/Common.tsx +50 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/Touchable.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/button.pm.ts +197 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/button.types.ts +22 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/button.utils.ts +16 -0
- package/platforms/react-native/generators/init/files/ui/components/Button/index.ts +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/Colours.tsx +50 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/Common.tsx +38 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/ErrorText.tsx +11 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/Input.tsx +115 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/InputArea.tsx +70 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/Label.tsx +18 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/Select.tsx +86 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/components/SecureTextEntry.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/form.error.ts +18 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/form.pm.ts +134 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/form.types.ts +59 -0
- package/platforms/react-native/generators/init/files/ui/components/Form/index.ts +67 -0
- package/platforms/react-native/generators/init/files/ui/components/Grid/Common.tsx +11 -0
- package/platforms/react-native/generators/init/files/ui/components/Grid/grid.pm.ts +93 -0
- package/platforms/react-native/generators/init/files/ui/components/Grid/grid.types.ts +79 -0
- package/platforms/react-native/generators/init/files/ui/components/Grid/index.ts +13 -0
- package/platforms/react-native/generators/init/files/ui/components/Icon/Common.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Icon/icons.pm.ts +74 -0
- package/platforms/react-native/generators/init/files/ui/components/Icon/icons.types.ts +19 -0
- package/platforms/react-native/generators/init/files/ui/components/Icon/index.ts +3 -0
- package/platforms/react-native/generators/init/files/ui/components/Loading/Loading.tsx +10 -0
- package/platforms/react-native/generators/init/files/ui/components/Loading/loading.hook.ts +5 -0
- package/platforms/react-native/generators/init/files/ui/components/Loading/loading.service.ts +22 -0
- package/platforms/react-native/generators/init/files/ui/components/Loading/loading.store.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/Common.tsx +87 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/Content.tsx +77 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/Header.tsx +80 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/HeaderTab.tsx +17 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/SafeAreaHOC.tsx +9 -0
- package/platforms/react-native/generators/init/files/ui/components/Screen/index.ts +22 -0
- package/platforms/react-native/generators/init/files/ui/components/Text/Common.tsx +20 -0
- package/platforms/react-native/generators/init/files/ui/components/Text/index.ts +13 -0
- package/platforms/react-native/generators/init/files/ui/components/Text/text.pm.ts +55 -0
- package/platforms/react-native/generators/init/files/ui/components/Text/text.types.ts +27 -0
- package/platforms/react-native/generators/init/files/ui/components/TextInput/Common.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/components/TextInput/index.ts +15 -0
- package/platforms/react-native/generators/init/files/ui/components/TextInput/textInput.pm.ts +65 -0
- package/platforms/react-native/generators/init/files/ui/components/TextInput/textInput.types.ts +16 -0
- package/platforms/react-native/generators/init/files/ui/components/ThemePicker/ThemePicker.tsx +92 -0
- package/platforms/react-native/generators/init/files/ui/components/ThemePicker/index.ts +1 -0
- package/platforms/react-native/generators/init/files/ui/components/index.ts +27 -0
- package/platforms/react-native/generators/init/files/ui/components/utils/color.ts +19 -0
- package/platforms/react-native/generators/init/files/ui/components/utils/index.ts +3 -0
- package/platforms/react-native/generators/init/files/ui/components/utils/useLoading.hook.spec.tsx +202 -0
- package/platforms/react-native/generators/init/files/ui/components/utils/useLoading.hook.ts +172 -0
- package/platforms/react-native/generators/init/files/ui/components/utils/useStore.ts +34 -0
- package/platforms/react-native/generators/init/files/ui/fonts/font-icons.ttf +0 -0
- package/platforms/react-native/generators/init/files/ui/icons/font-icons.json +53 -0
- package/platforms/react-native/generators/init/files/ui/icons/logo.png +0 -0
- package/platforms/react-native/generators/init/files/ui/icons/logo.svg +304 -0
- package/platforms/react-native/generators/init/files/ui/icons/tabs/icon-1.png +0 -0
- package/platforms/react-native/generators/init/files/ui/icons/tabs/icon-2.png +0 -0
- package/platforms/react-native/generators/init/files/ui/theme/black/black.color.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/theme/black/index.ts +10 -0
- package/platforms/react-native/generators/init/files/ui/theme/blue/blue.color.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/theme/blue/index.ts +10 -0
- package/platforms/react-native/generators/init/files/ui/theme/green/green.color.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/theme/green/index.ts +10 -0
- package/platforms/react-native/generators/init/files/ui/theme/index.ts +11 -0
- package/platforms/react-native/generators/init/files/ui/theme/pink/index.ts +10 -0
- package/platforms/react-native/generators/init/files/ui/theme/pink/pink.color.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/index.ts +23 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.color.ts +139 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.radius.ts +21 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.spacing.ts +24 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.ts +25 -0
- package/platforms/react-native/generators/init/files/ui/theme/scheme/theme.scheme.typography.ts +98 -0
- package/platforms/react-native/generators/init/files/ui/theme/shared/index.ts +4 -0
- package/platforms/react-native/generators/init/files/ui/theme/shared/shared.color.base.ts +79 -0
- package/platforms/react-native/generators/init/files/ui/theme/shared/shared.radius.ts +8 -0
- package/platforms/react-native/generators/init/files/ui/theme/shared/shared.spacing.ts +9 -0
- package/platforms/react-native/generators/init/files/ui/theme/shared/shared.typography.ts +105 -0
- package/platforms/react-native/generators/init/files/ui/theme/theme.hooks.ts +7 -0
- package/platforms/react-native/generators/init/files/ui/theme/theme.meta.ts +10 -0
- package/platforms/react-native/generators/init/files/ui/theme/theme.provider.tsx +19 -0
- package/platforms/react-native/generators/init/files/ui/theme/theme.service.ts +36 -0
- package/platforms/react-native/generators/init/files/ui/theme/theme.ts +27 -0
- package/platforms/react-native/generators/init/files/ui/widgets/index.ts +1 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Item.tsx +175 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Overlay.tsx +46 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/Toast.Stack.tsx +75 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/index.ts +7 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.hooks.ts +18 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.service.ts +39 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.store.ts +59 -0
- package/platforms/react-native/generators/init/files/ui/widgets/toast/toast.types.ts +18 -0
- package/platforms/react-native/generators/init/files/ui/widgets/widgets.feature.ts +14 -0
- package/platforms/react-native/generators/init/files/utils/date.ts +11 -0
- package/platforms/react-native/generators/init/files/utils/index.ts +12 -0
- package/platforms/react-native/generators/init/files/utils/store.persistent.ts +103 -0
- package/platforms/react-native/generators/init/files/utils/store.registry.ts +14 -0
- package/platforms/react-native/generators/init/files/utils/string.ts +100 -0
- package/platforms/react-native/generators/init/generator.js +86 -0
- package/platforms/react-native/generators/init/kit.js +23 -0
- package/platforms/react-native/generators/init/navigators/expo-router/index.ts +18 -0
- package/platforms/react-native/generators/init/navigators/expo-router/navigation.app.ts +8 -0
- package/platforms/react-native/generators/init/navigators/expo-router/navigation.features.ts +9 -0
- package/platforms/react-native/generators/init/navigators/expo-router/navigation.hooks.ts +5 -0
- package/platforms/react-native/generators/init/navigators/expo-router/navigation.tabs.ts +7 -0
- package/platforms/react-native/generators/init/navigators/expo-router/navigation.widgets.ts +5 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/index.ts +18 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/navigation.app.ts +8 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/navigation.features.ts +9 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/navigation.hooks.ts +5 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/navigation.tabs.ts +7 -0
- package/platforms/react-native/generators/init/navigators/react-navigation/navigation.widgets.ts +5 -0
- package/platforms/react-native/generators/setup/generator.js +225 -0
- package/platforms/react-native/generators/util/generator.js +12 -0
- package/platforms/react-native/platform.js +32 -0
- package/platforms/react-native/runtime.js +57 -0
- package/platforms/react-native/solutions/components/BottomSheet/README.md +29 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/Common.tsx +120 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/Content.tsx +57 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/Context.tsx +22 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/FlatList.tsx +50 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/Header.tsx +57 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/Search.tsx +24 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/bottomSheet.constants.ts +13 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/bottomSheet.types.ts +31 -0
- package/platforms/react-native/solutions/components/BottomSheet/files/index.ts +33 -0
- package/platforms/react-native/solutions/components/BottomSheet/solution.js +38 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/README.md +29 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/files/SelectPicker.tsx +47 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/Content.BottomSheet.tsx +22 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/DateTimePicker.BottomSheet.tsx +74 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/files/bottomSheet/List.BottomSheet.tsx +62 -0
- package/platforms/react-native/solutions/components/BottomSheetWidgets/solution.js +49 -0
- package/platforms/react-native/solutions/components/Calendar/README.md +29 -0
- package/platforms/react-native/solutions/components/Calendar/files/Common.tsx +16 -0
- package/platforms/react-native/solutions/components/Calendar/files/Context.tsx +466 -0
- package/platforms/react-native/solutions/components/Calendar/files/DayCell.tsx +89 -0
- package/platforms/react-native/solutions/components/Calendar/files/MonthView.tsx +41 -0
- package/platforms/react-native/solutions/components/Calendar/files/MonthYearOverlay.tsx +51 -0
- package/platforms/react-native/solutions/components/Calendar/files/SwipeablePeriod.tsx +44 -0
- package/platforms/react-native/solutions/components/Calendar/files/WeekDayTitles.tsx +31 -0
- package/platforms/react-native/solutions/components/Calendar/files/WeekView.tsx +40 -0
- package/platforms/react-native/solutions/components/Calendar/files/calendar.styles.ts +142 -0
- package/platforms/react-native/solutions/components/Calendar/files/calendar.types.ts +126 -0
- package/platforms/react-native/solutions/components/Calendar/files/calendar.utils.ts +143 -0
- package/platforms/react-native/solutions/components/Calendar/files/index.ts +40 -0
- package/platforms/react-native/solutions/components/Calendar/solution.js +38 -0
- package/platforms/react-native/solutions/components/Chart/README.md +29 -0
- package/platforms/react-native/solutions/components/Chart/files/Cilcular.tsx +140 -0
- package/platforms/react-native/solutions/components/Chart/files/index.ts +3 -0
- package/platforms/react-native/solutions/components/Chart/solution.js +38 -0
- package/platforms/react-native/solutions/components/CheckBox/README.md +29 -0
- package/platforms/react-native/solutions/components/CheckBox/files/Common.tsx +55 -0
- package/platforms/react-native/solutions/components/CheckBox/files/checkbox.pm.ts +71 -0
- package/platforms/react-native/solutions/components/CheckBox/files/index.ts +9 -0
- package/platforms/react-native/solutions/components/CheckBox/form/Checkbox.tsx +22 -0
- package/platforms/react-native/solutions/components/CheckBox/solution.js +57 -0
- package/platforms/react-native/solutions/components/DateTimePicker/README.md +29 -0
- package/platforms/react-native/solutions/components/DateTimePicker/files/DateTimePicker.tsx +44 -0
- package/platforms/react-native/solutions/components/DateTimePicker/solution.js +45 -0
- package/platforms/react-native/solutions/components/Image/README.md +29 -0
- package/platforms/react-native/solutions/components/Image/files/SVG.tsx +74 -0
- package/platforms/react-native/solutions/components/Image/files/image.pm.ts +25 -0
- package/platforms/react-native/solutions/components/Image/files/image.utils.ts +35 -0
- package/platforms/react-native/solutions/components/Image/files/index.ts +5 -0
- package/platforms/react-native/solutions/components/Image/solution.js +40 -0
- package/platforms/react-native/solutions/components/InputSecurity/README.md +29 -0
- package/platforms/react-native/solutions/components/InputSecurity/files/InputSecurity.ts +142 -0
- package/platforms/react-native/solutions/components/InputSecurity/solution.js +28 -0
- package/platforms/react-native/solutions/components/OTP/README.md +29 -0
- package/platforms/react-native/solutions/components/OTP/files/Item.tsx +16 -0
- package/platforms/react-native/solutions/components/OTP/files/Items.tsx +33 -0
- package/platforms/react-native/solutions/components/OTP/files/index.tsx +120 -0
- package/platforms/react-native/solutions/components/OTP/files/otp.pm.ts +30 -0
- package/platforms/react-native/solutions/components/OTP/solution.js +38 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/README.md +29 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/files/Circular.tsx +154 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/files/Linear.tsx +133 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/files/circular.pm.ts +34 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/files/index.ts +16 -0
- package/platforms/react-native/solutions/components/ProgressIndicator/solution.js +39 -0
- package/platforms/react-native/solutions/components/Ruler/README.md +29 -0
- package/platforms/react-native/solutions/components/Ruler/files/Common.tsx +44 -0
- package/platforms/react-native/solutions/components/Ruler/files/Context.tsx +210 -0
- package/platforms/react-native/solutions/components/Ruler/files/Track.tsx +686 -0
- package/platforms/react-native/solutions/components/Ruler/files/Value.tsx +60 -0
- package/platforms/react-native/solutions/components/Ruler/files/index.ts +23 -0
- package/platforms/react-native/solutions/components/Ruler/files/ruler.constants.ts +70 -0
- package/platforms/react-native/solutions/components/Ruler/files/ruler.types.ts +98 -0
- package/platforms/react-native/solutions/components/Ruler/files/ruler.utils.ts +332 -0
- package/platforms/react-native/solutions/components/Ruler/solution.js +38 -0
- package/platforms/react-native/solutions/components/Section/README.md +29 -0
- package/platforms/react-native/solutions/components/Section/files/Common.tsx +144 -0
- package/platforms/react-native/solutions/components/Section/solution.js +37 -0
- package/platforms/react-native/solutions/components/Slider/README.md +29 -0
- package/platforms/react-native/solutions/components/Slider/files/Container.tsx +5 -0
- package/platforms/react-native/solutions/components/Slider/files/Content.tsx +44 -0
- package/platforms/react-native/solutions/components/Slider/files/Context.tsx +30 -0
- package/platforms/react-native/solutions/components/Slider/files/Pagination.Dot.tsx +61 -0
- package/platforms/react-native/solutions/components/Slider/files/index.ts +22 -0
- package/platforms/react-native/solutions/components/Slider/solution.js +38 -0
- package/platforms/react-native/solutions/components/Switch/README.md +29 -0
- package/platforms/react-native/solutions/components/Switch/files/Common.tsx +38 -0
- package/platforms/react-native/solutions/components/Switch/files/index.ts +9 -0
- package/platforms/react-native/solutions/components/Switch/files/switch.pm.ts +53 -0
- package/platforms/react-native/solutions/components/Switch/solution.js +38 -0
- package/platforms/react-native/solutions/install.js +97 -0
- package/platforms/react-native/solutions/services/firebase-core/README.md +31 -0
- package/platforms/react-native/solutions/services/firebase-core/files/index.ts +5 -0
- package/platforms/react-native/solutions/services/firebase-core/solution.js +39 -0
- package/platforms/react-native/solutions/services/firebase-messaging/README.md +31 -0
- package/platforms/react-native/solutions/services/firebase-messaging/files/index.ts +20 -0
- package/platforms/react-native/solutions/services/firebase-messaging/solution.js +42 -0
- package/platforms/react-native/solutions/utils/permissions/README.md +29 -0
- package/platforms/react-native/solutions/utils/permissions/files/permissions.ts +10 -0
- package/platforms/react-native/solutions/utils/permissions/solution.js +32 -0
- package/presets/react-native-fsd/index.js +25 -0
- package/shared/generators/entity/render.js +88 -0
- package/shared/generators/entity/templates/crud/api.ts.hbs +36 -0
- package/shared/generators/entity/templates/crud/dto.ts.hbs +36 -0
- package/shared/generators/entity/templates/crud/service.ts.hbs +73 -0
- package/shared/generators/entity/templates/crud/store.ts.hbs +27 -0
- package/shared/generators/entity/templates/index.ts.hbs +2 -0
- package/shared/generators/entity/templates/simple/api.ts.hbs +16 -0
- package/shared/generators/entity/templates/simple/dto.ts.hbs +5 -0
- package/shared/generators/entity/templates/simple/service.ts.hbs +26 -0
- package/shared/generators/entity/templates/simple/store.ts.hbs +18 -0
- package/shared/solutions/utils/date/README.md +29 -0
- package/shared/solutions/utils/date/files/date.ts +11 -0
- package/shared/solutions/utils/date/solution.js +27 -0
- package/shared/solutions/utils/string/README.md +29 -0
- package/shared/solutions/utils/string/files/string.ts +100 -0
- package/shared/solutions/utils/string/solution.js +27 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Prop, PropertyManager, Node, Static } from '@effijs/props-manager';
|
|
2
|
+
|
|
3
|
+
import iconCodes from '@icons/font-icons.json';
|
|
4
|
+
|
|
5
|
+
function getIconType(icon: string) {
|
|
6
|
+
if (isFontBasedIcon(icon)) {
|
|
7
|
+
return 'font';
|
|
8
|
+
} else if (typeof icon === 'string') {
|
|
9
|
+
return 'text';
|
|
10
|
+
}
|
|
11
|
+
return 'component';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isFontBasedIcon(icon: string) {
|
|
15
|
+
return Object.prototype.hasOwnProperty.call(iconCodes, icon);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type TObject = Record<string, any>;
|
|
19
|
+
|
|
20
|
+
export const IconsPM = PropertyManager.create('Icons').node(
|
|
21
|
+
Node('container')
|
|
22
|
+
.extends('Grid')
|
|
23
|
+
.keys(
|
|
24
|
+
Static({
|
|
25
|
+
allowFontScaling: false,
|
|
26
|
+
}),
|
|
27
|
+
Prop('icon', ({ icon }: { icon: keyof typeof iconCodes | string }) => {
|
|
28
|
+
const type = getIconType(icon);
|
|
29
|
+
const res = {
|
|
30
|
+
type,
|
|
31
|
+
} as TObject;
|
|
32
|
+
if (type === 'font') {
|
|
33
|
+
res.children = String.fromCharCode(iconCodes[icon as keyof typeof iconCodes]);
|
|
34
|
+
}
|
|
35
|
+
return res;
|
|
36
|
+
}),
|
|
37
|
+
)
|
|
38
|
+
.keys(
|
|
39
|
+
'style',
|
|
40
|
+
Prop('style', ({ style }) => style),
|
|
41
|
+
Prop(
|
|
42
|
+
['color', 'icon', 'theme'],
|
|
43
|
+
({ color, icon, theme: themeName }, { theme }) => {
|
|
44
|
+
const res = {} as TObject;
|
|
45
|
+
if (isFontBasedIcon(icon)) {
|
|
46
|
+
res.color = theme.get(`color.${color}`, themeName) ?? color;
|
|
47
|
+
}
|
|
48
|
+
return res;
|
|
49
|
+
},
|
|
50
|
+
{ providers: ['theme'] },
|
|
51
|
+
),
|
|
52
|
+
Prop(['icon', 'size'], (props: { icon: string; size: number | undefined } | TObject) => {
|
|
53
|
+
const type = getIconType(props.icon);
|
|
54
|
+
|
|
55
|
+
const baseSize = props.size || 24;
|
|
56
|
+
const scale = Math.min(1, 1);
|
|
57
|
+
const size = Math.round(baseSize * scale);
|
|
58
|
+
|
|
59
|
+
const res = {
|
|
60
|
+
width: size,
|
|
61
|
+
height: size,
|
|
62
|
+
} as TObject;
|
|
63
|
+
if (type === 'font') {
|
|
64
|
+
res.fontFamily = 'font-icons';
|
|
65
|
+
res.fontWeight = 'normal';
|
|
66
|
+
res.fontStyle = 'normal';
|
|
67
|
+
res.fontSize = size;
|
|
68
|
+
res.textAlign = 'center';
|
|
69
|
+
res.textAlignVertical = 'center';
|
|
70
|
+
}
|
|
71
|
+
return res;
|
|
72
|
+
}),
|
|
73
|
+
),
|
|
74
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import iconCodes from '@icons/font-icons.json';
|
|
2
|
+
|
|
3
|
+
export type TIconNames = keyof typeof iconCodes;
|
|
4
|
+
|
|
5
|
+
export interface IIconProps extends Record<string, unknown> {
|
|
6
|
+
icon: TIconNames;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Accessibility label for the icon. If not provided, the icon will be hidden from screen readers.
|
|
11
|
+
* Only provide this if the icon conveys important information not available elsewhere.
|
|
12
|
+
*/
|
|
13
|
+
accessibilityLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Marks the icon as decorative. Decorative icons are hidden from screen readers.
|
|
16
|
+
* Defaults to true when no accessibilityLabel is provided.
|
|
17
|
+
*/
|
|
18
|
+
isDecorative?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProgressIndicator } from '@components';
|
|
2
|
+
import { loadingService } from '@components/Loading/loading.service.ts';
|
|
3
|
+
|
|
4
|
+
export default function Loading({ key }: { key: string }) {
|
|
5
|
+
const loading = loadingService.isLoading(key);
|
|
6
|
+
|
|
7
|
+
if (!loading) return null;
|
|
8
|
+
|
|
9
|
+
return <ProgressIndicator.Circular />;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LoadingStore } from '@components/Loading/loading.store';
|
|
2
|
+
|
|
3
|
+
class LoadingService {
|
|
4
|
+
private readonly store = new LoadingStore();
|
|
5
|
+
|
|
6
|
+
async withLoading(handler: (...args: any[]) => Promise<any>, key: string) {
|
|
7
|
+
this.store.set(`loading.${key}`, true);
|
|
8
|
+
try {
|
|
9
|
+
await handler();
|
|
10
|
+
} catch (e) {
|
|
11
|
+
this.store.set(`error.${key}`, e?.message || '');
|
|
12
|
+
} finally {
|
|
13
|
+
this.store.set(`loading.${key}`, false);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
isLoading(key: string) {
|
|
18
|
+
return this.store.getByPath(`loading.${key}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const loadingService = new LoadingService();
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useNavigation } from '@effijs/navigation-react-native';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { Keyboard } from 'react-native';
|
|
4
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
5
|
+
import { KeyboardProvider } from 'react-native-keyboard-controller';
|
|
6
|
+
import { Navigation } from 'react-native-navigation';
|
|
7
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
8
|
+
|
|
9
|
+
import { Box, Grid, Text } from '@components';
|
|
10
|
+
import configs from '@configs';
|
|
11
|
+
import { Theme } from '@theme';
|
|
12
|
+
|
|
13
|
+
interface ICommonScreenProps {
|
|
14
|
+
label?: string;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
withVisibility?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function CommonScreen({ label, withVisibility, children }: ICommonScreenProps) {
|
|
20
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
21
|
+
|
|
22
|
+
const { componentId } = useNavigation();
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!componentId) return;
|
|
26
|
+
|
|
27
|
+
const listener = {
|
|
28
|
+
componentDidAppear: () => {
|
|
29
|
+
console.log('RNN', `componentDidAppear`);
|
|
30
|
+
setIsVisible(true);
|
|
31
|
+
},
|
|
32
|
+
componentDidDisappear: () => {
|
|
33
|
+
console.log('RNN', `componentDidDisappear`);
|
|
34
|
+
setIsVisible(false);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const unsubscribe = Navigation.events().registerComponentListener(listener, componentId);
|
|
38
|
+
return () => {
|
|
39
|
+
unsubscribe.remove();
|
|
40
|
+
};
|
|
41
|
+
}, [componentId]);
|
|
42
|
+
|
|
43
|
+
if (withVisibility && !isVisible) return null;
|
|
44
|
+
|
|
45
|
+
const handleStartShouldSetResponder = () => {
|
|
46
|
+
Keyboard.dismiss();
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<SafeAreaProvider>
|
|
52
|
+
<KeyboardProvider>
|
|
53
|
+
<GestureHandlerRootView>
|
|
54
|
+
<Theme>
|
|
55
|
+
<Grid flex={1} row>
|
|
56
|
+
{label ? <ScreenLabel title={label} /> : null}
|
|
57
|
+
<Box flex={1} color="background" onStartShouldSetResponder={handleStartShouldSetResponder}>
|
|
58
|
+
{children}
|
|
59
|
+
</Box>
|
|
60
|
+
</Grid>
|
|
61
|
+
</Theme>
|
|
62
|
+
</GestureHandlerRootView>
|
|
63
|
+
</KeyboardProvider>
|
|
64
|
+
</SafeAreaProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function ScreenLabel({ title }: { title: string }) {
|
|
69
|
+
return (
|
|
70
|
+
<Box width={48} row align-start color="primary">
|
|
71
|
+
<Text
|
|
72
|
+
family="Athena"
|
|
73
|
+
weight={300}
|
|
74
|
+
fontSize={24}
|
|
75
|
+
color="onPrimary"
|
|
76
|
+
mb-l
|
|
77
|
+
style={{
|
|
78
|
+
position: 'absolute',
|
|
79
|
+
top: 0,
|
|
80
|
+
left: -24,
|
|
81
|
+
transform: [{ rotate: '-90deg' }, { translateX: -100 }],
|
|
82
|
+
}}>
|
|
83
|
+
{title}
|
|
84
|
+
</Text>
|
|
85
|
+
</Box>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import { type LayoutChangeEvent, Platform } from 'react-native';
|
|
3
|
+
import { useAnimatedKeyboard } from 'react-native-keyboard-controller';
|
|
4
|
+
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
|
|
7
|
+
import { Grid } from '@components';
|
|
8
|
+
import { GridPM } from '@components/Grid/grid.pm.ts';
|
|
9
|
+
|
|
10
|
+
export default function ScreenContent({
|
|
11
|
+
children,
|
|
12
|
+
scrollable,
|
|
13
|
+
'sa-t': safeAreaTop,
|
|
14
|
+
'sa-b': safeAreaBottom,
|
|
15
|
+
...screenProps
|
|
16
|
+
}: {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
scrollable?: boolean;
|
|
19
|
+
'sa-t'?: boolean;
|
|
20
|
+
'sa-b'?: boolean;
|
|
21
|
+
'mh-s'?: boolean;
|
|
22
|
+
}) {
|
|
23
|
+
const props = GridPM.get({ flexGrow: 1, ...screenProps });
|
|
24
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
25
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
26
|
+
const animatedKeyboard = useAnimatedKeyboard();
|
|
27
|
+
const { top, bottom } = useSafeAreaInsets();
|
|
28
|
+
|
|
29
|
+
const onContainerLayout = useCallback(
|
|
30
|
+
({
|
|
31
|
+
nativeEvent: {
|
|
32
|
+
layout: { height },
|
|
33
|
+
},
|
|
34
|
+
}: LayoutChangeEvent) => {
|
|
35
|
+
setContainerHeight(height);
|
|
36
|
+
},
|
|
37
|
+
[],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const autoScrollable = useMemo(() => contentHeight > containerHeight, [contentHeight, containerHeight]);
|
|
41
|
+
const isScrollable = scrollable ?? autoScrollable;
|
|
42
|
+
|
|
43
|
+
const keyboardHeight = useAnimatedStyle(
|
|
44
|
+
() => ({
|
|
45
|
+
height:
|
|
46
|
+
(Platform.OS === 'ios' ? animatedKeyboard.height.value : 0) ||
|
|
47
|
+
(safeAreaBottom ? bottom : 0) ||
|
|
48
|
+
(Platform.OS === 'android' ? 24 : 0) ||
|
|
49
|
+
0,
|
|
50
|
+
}),
|
|
51
|
+
[safeAreaBottom, bottom],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (scrollable === false) {
|
|
55
|
+
return (
|
|
56
|
+
<Grid flex={1} onLayout={onContainerLayout} pt={safeAreaTop ? top : 0} style={props.container?.style}>
|
|
57
|
+
{children}
|
|
58
|
+
<Animated.View style={keyboardHeight} />
|
|
59
|
+
</Grid>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Grid flex={1} onLayout={onContainerLayout} pt={safeAreaTop ? top : 0}>
|
|
65
|
+
<Animated.ScrollView
|
|
66
|
+
scrollEnabled={isScrollable}
|
|
67
|
+
showsVerticalScrollIndicator={false}
|
|
68
|
+
showsHorizontalScrollIndicator={false}
|
|
69
|
+
keyboardShouldPersistTaps="handled"
|
|
70
|
+
contentContainerStyle={props.container?.style}
|
|
71
|
+
onContentSizeChange={(_, height) => setContentHeight(height)}>
|
|
72
|
+
{children}
|
|
73
|
+
<Animated.View style={keyboardHeight} />
|
|
74
|
+
</Animated.ScrollView>
|
|
75
|
+
</Grid>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useNavigation } from '@effijs/navigation-react-native';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { Button, Grid, Text } from '@components';
|
|
6
|
+
import { theme, useTheme } from '@theme';
|
|
7
|
+
|
|
8
|
+
export default function Header({
|
|
9
|
+
type = 'modal',
|
|
10
|
+
title,
|
|
11
|
+
logo,
|
|
12
|
+
onBack,
|
|
13
|
+
}: {
|
|
14
|
+
type?: 'modal' | 'tab' | 'push';
|
|
15
|
+
title?: string;
|
|
16
|
+
logo?: boolean;
|
|
17
|
+
onBack?: () => boolean | Promise<boolean>;
|
|
18
|
+
}) {
|
|
19
|
+
const { top } = useSafeAreaInsets();
|
|
20
|
+
const { close } = useNavigation();
|
|
21
|
+
const themeName = useTheme();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Grid row>
|
|
25
|
+
<Grid min-height={60} flex={1} width="100%" mt={top} pt-s={Platform.OS === 'android'} center mb-l={!!logo}>
|
|
26
|
+
<Grid absolute center pt-s={Platform.OS === 'android'}>
|
|
27
|
+
<Text fontSize={22} color="outline">
|
|
28
|
+
{title}
|
|
29
|
+
</Text>
|
|
30
|
+
</Grid>
|
|
31
|
+
<Grid absolute center pt-s={Platform.OS === 'android'}>
|
|
32
|
+
<Grid>
|
|
33
|
+
{logo
|
|
34
|
+
? null
|
|
35
|
+
: /*<Image.Native
|
|
36
|
+
source={require('@images/logo.png')}
|
|
37
|
+
tintColor={theme.color.primary}
|
|
38
|
+
style={{ width: 60, height: 60 }}
|
|
39
|
+
width={60}
|
|
40
|
+
height={60}
|
|
41
|
+
/>*/
|
|
42
|
+
null}
|
|
43
|
+
{/*{logo ? <Image.SVG image={require('@icons/logo.svg')} width={60} height={60} color="primary" /> : null}*/}
|
|
44
|
+
</Grid>
|
|
45
|
+
</Grid>
|
|
46
|
+
|
|
47
|
+
<Grid row space-between ph-s>
|
|
48
|
+
<Grid>
|
|
49
|
+
{type === 'push' ? (
|
|
50
|
+
<Button
|
|
51
|
+
type="text"
|
|
52
|
+
leadingIcon="back"
|
|
53
|
+
withoutLoadingIndicator
|
|
54
|
+
size={40}
|
|
55
|
+
onPress={async () => {
|
|
56
|
+
if ((onBack && (await onBack?.())) || !onBack) {
|
|
57
|
+
close?.();
|
|
58
|
+
}
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
62
|
+
</Grid>
|
|
63
|
+
<Grid flex={1} />
|
|
64
|
+
<Grid>
|
|
65
|
+
{type === 'modal' ? (
|
|
66
|
+
<Button
|
|
67
|
+
type="filled"
|
|
68
|
+
leadingIcon="close"
|
|
69
|
+
withoutLoadingIndicator
|
|
70
|
+
round="xxl"
|
|
71
|
+
size={40}
|
|
72
|
+
onPress={() => close?.()}
|
|
73
|
+
/>
|
|
74
|
+
) : null}
|
|
75
|
+
</Grid>
|
|
76
|
+
</Grid>
|
|
77
|
+
</Grid>
|
|
78
|
+
</Grid>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { Box, Grid } from '@components';
|
|
6
|
+
|
|
7
|
+
export default function HeaderTab({ children }: { children: React.ReactNode }) {
|
|
8
|
+
const { top } = useSafeAreaInsets();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Box shadow-s width="100%" color="onBackgroundSecondVariant" style={{ zIndex: 100 }}>
|
|
12
|
+
<Grid min-height={60} mt={top} pt-s={Platform.OS === 'android'} pb-s>
|
|
13
|
+
{children}
|
|
14
|
+
</Grid>
|
|
15
|
+
</Box>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Common from './Common';
|
|
2
|
+
import Content from './Content';
|
|
3
|
+
import Header from './Header';
|
|
4
|
+
import HeaderTab from './HeaderTab';
|
|
5
|
+
|
|
6
|
+
type TCommon = typeof Common;
|
|
7
|
+
type THeader = typeof Header;
|
|
8
|
+
type THeaderTab = typeof HeaderTab;
|
|
9
|
+
type TContent = typeof Content;
|
|
10
|
+
|
|
11
|
+
interface IScreen extends TCommon {
|
|
12
|
+
Content: TContent;
|
|
13
|
+
Header: THeader;
|
|
14
|
+
HeaderTab: THeaderTab;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Screen = Common as IScreen;
|
|
18
|
+
Screen.Content = Content;
|
|
19
|
+
Screen.Header = Header;
|
|
20
|
+
Screen.HeaderTab = HeaderTab;
|
|
21
|
+
|
|
22
|
+
export default Screen;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Text, TextProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme, TThemeColor } from '@theme';
|
|
5
|
+
|
|
6
|
+
import { TGridProps } from '../Grid/grid.types';
|
|
7
|
+
|
|
8
|
+
import { TextPM } from './text.pm';
|
|
9
|
+
import { TTextProps } from './text.types';
|
|
10
|
+
|
|
11
|
+
const TextCommon = forwardRef<Text, TTextProps<TThemeColor> & TGridProps & TextProps>(
|
|
12
|
+
({ children, ...commonProps }, ref) => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const { container } = TextPM.get({ theme, ...commonProps });
|
|
15
|
+
|
|
16
|
+
return <Text ref={ref} {...container} children={children} />;
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default TextCommon;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Pattern, Prop, Node, PropertyManager, Static } from '@effijs/props-manager';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export const TextPM = PropertyManager.create('Text').node(
|
|
5
|
+
Node('container')
|
|
6
|
+
.extends('Grid')
|
|
7
|
+
.keys(
|
|
8
|
+
'style',
|
|
9
|
+
Prop('style', ({ style }) => style),
|
|
10
|
+
Pattern('{n}', ({ theme }) => theme?.typography, { providers: ['theme'] }).key(
|
|
11
|
+
'{n}',
|
|
12
|
+
v => v as Record<string, unknown>,
|
|
13
|
+
),
|
|
14
|
+
Prop(
|
|
15
|
+
['color', 'theme'],
|
|
16
|
+
({ color, theme: themeName }, { theme }) => ({
|
|
17
|
+
color: theme.get(`color.${color}`, themeName) ?? color,
|
|
18
|
+
}),
|
|
19
|
+
{ providers: ['theme'] },
|
|
20
|
+
),
|
|
21
|
+
Prop('center', { textAlign: 'center', textAlignVertical: 'center' }),
|
|
22
|
+
// Prop('flex', { flex: 1 }),
|
|
23
|
+
Prop('weight', ({ weight }: { weight: number | 'bold' | 'normal' }) => ({
|
|
24
|
+
fontWeight: weight,
|
|
25
|
+
})),
|
|
26
|
+
Prop('fontSize', 'fontSize'),
|
|
27
|
+
Prop('lineHeight', 'lineHeight'),
|
|
28
|
+
Prop('underline', {
|
|
29
|
+
textDecorationLine: 'underline',
|
|
30
|
+
textDecorationStyle: 'solid',
|
|
31
|
+
}),
|
|
32
|
+
Prop(
|
|
33
|
+
'family',
|
|
34
|
+
({ family }) => {
|
|
35
|
+
const fontFamily =
|
|
36
|
+
family === 'Athena'
|
|
37
|
+
? Platform.OS === 'ios'
|
|
38
|
+
? 'Athena'
|
|
39
|
+
: 'Athena-Light'
|
|
40
|
+
: Platform.OS === 'ios'
|
|
41
|
+
? 'SF Pro Display'
|
|
42
|
+
: undefined;
|
|
43
|
+
|
|
44
|
+
return fontFamily ? { fontFamily } : {};
|
|
45
|
+
},
|
|
46
|
+
{ nullWhenFirstKeyNull: false },
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
.keys(
|
|
50
|
+
Static({
|
|
51
|
+
allowFontScaling: false,
|
|
52
|
+
}),
|
|
53
|
+
Prop('onPress', 'onPress'),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type TTextSizes = 's' | 'm' | 'l';
|
|
2
|
+
type TFontWeight = 'bold' | 'normal' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
3
|
+
|
|
4
|
+
type TSpacingProps<Prefix extends string> = {
|
|
5
|
+
[Size in TTextSizes as `${Prefix}-${Size}`]?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type TFontFamily = 'SF Pro Display' | 'Athena';
|
|
9
|
+
|
|
10
|
+
export interface TTextProps<TThemeColor>
|
|
11
|
+
extends
|
|
12
|
+
TSpacingProps<'title'>,
|
|
13
|
+
TSpacingProps<'label'>,
|
|
14
|
+
TSpacingProps<'body'>,
|
|
15
|
+
TSpacingProps<'display'>,
|
|
16
|
+
TSpacingProps<'headline'> {
|
|
17
|
+
color?: TThemeColor;
|
|
18
|
+
weight?: TFontWeight;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
error?: boolean;
|
|
21
|
+
center?: boolean;
|
|
22
|
+
family?: TFontFamily;
|
|
23
|
+
|
|
24
|
+
fontSize?: number;
|
|
25
|
+
lineHeight?: number;
|
|
26
|
+
underline?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput, TextInputProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '@theme';
|
|
5
|
+
|
|
6
|
+
import { TextInputPM } from './textInput.pm';
|
|
7
|
+
import type { TTextProps } from './textInput.types';
|
|
8
|
+
|
|
9
|
+
export default function TextInputCommon<TThemeColor>({
|
|
10
|
+
onChangeText,
|
|
11
|
+
...textInputProps
|
|
12
|
+
}: TextInputProps & TTextProps<TThemeColor>) {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const { container } = TextInputPM.get({ theme, ...textInputProps });
|
|
15
|
+
|
|
16
|
+
delete container.style.lineHeight;
|
|
17
|
+
|
|
18
|
+
return <TextInput numberOfLines={1} multiline={false} {...container} onChangeText={onChangeText} />;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Common from './Common';
|
|
2
|
+
import { TextInputPM } from './textInput.pm';
|
|
3
|
+
// forge:text-input-import
|
|
4
|
+
|
|
5
|
+
type TCommon = typeof Common;
|
|
6
|
+
|
|
7
|
+
interface ITextInput extends TCommon {
|
|
8
|
+
PM: typeof TextInputPM;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const TextInput = Common as ITextInput;
|
|
12
|
+
TextInput.PM = TextInputPM;
|
|
13
|
+
// forge:text-input-slots
|
|
14
|
+
|
|
15
|
+
export default TextInput;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { PropertyManager, Static, Node, Prop } from '@effijs/props-manager';
|
|
2
|
+
|
|
3
|
+
export const TextInputPM = PropertyManager.create('TextInput').node(
|
|
4
|
+
Node('container')
|
|
5
|
+
.extends('Text')
|
|
6
|
+
.keys(
|
|
7
|
+
'style',
|
|
8
|
+
Prop('style', ({ style }) => style),
|
|
9
|
+
Static({
|
|
10
|
+
textDecorationLine: 'none',
|
|
11
|
+
textAlignVertical: 'center',
|
|
12
|
+
// lineHeight: 32,
|
|
13
|
+
color: '#363636',
|
|
14
|
+
// cursor: 'none',
|
|
15
|
+
}),
|
|
16
|
+
)
|
|
17
|
+
.keys(
|
|
18
|
+
Static({
|
|
19
|
+
flex: 1,
|
|
20
|
+
allowFontScaling: false,
|
|
21
|
+
placeholderTextColor: '#8A8A8A',
|
|
22
|
+
family: 'SF Pro Display',
|
|
23
|
+
underlineColorAndroid: 'transparent',
|
|
24
|
+
}),
|
|
25
|
+
Prop(
|
|
26
|
+
['placeholderColor', 'theme'],
|
|
27
|
+
({ placeholderColor, theme: themeName }, { theme }) => ({
|
|
28
|
+
placeholderTextColor: theme.get(`color.${placeholderColor || 'onSurfaceVariant'}`, themeName) ?? undefined,
|
|
29
|
+
}),
|
|
30
|
+
{ nullWhenFirstKeyNull: false, providers: ['theme'] },
|
|
31
|
+
),
|
|
32
|
+
Prop(
|
|
33
|
+
'theme',
|
|
34
|
+
({ theme: themeName }, { theme }) => {
|
|
35
|
+
const color = theme.get(`color.outline`, themeName) ?? undefined;
|
|
36
|
+
if (color) {
|
|
37
|
+
return {
|
|
38
|
+
cursorColor: color,
|
|
39
|
+
// selectionColor: `${color}80`,
|
|
40
|
+
color: 'outline',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
color: 'outline',
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
{ providers: ['theme'], nullWhenFirstKeyNull: false },
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
/*.styles(
|
|
52
|
+
Provider('theme', theme =>
|
|
53
|
+
Pattern('{n}', theme.typography).key(
|
|
54
|
+
'{n}',
|
|
55
|
+
v => v as Record<string, unknown>,
|
|
56
|
+
),
|
|
57
|
+
),
|
|
58
|
+
Provider('theme', theme =>
|
|
59
|
+
Prop('color', ({ color }: TObject) => ({
|
|
60
|
+
color: theme.color.hasKey(color) ? theme.color[color] : color,
|
|
61
|
+
})),
|
|
62
|
+
),
|
|
63
|
+
Prop('center', { textAlign: 'center', textAlignVertical: 'center' }),
|
|
64
|
+
Prop('flex', { flex: 1 }),
|
|
65
|
+
)*/
|