@ronas-it/nx-generators 0.21.0 → 0.22.0-alpha.2
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/README.md +1 -1
- package/package.json +1 -1
- package/src/generators/expo-app/app-files/README.md.template +13 -0
- package/src/generators/expo-app/app-files/app/_layout.tsx.template +23 -6
- package/src/generators/expo-app/easignore.d.ts +2 -0
- package/src/generators/expo-app/easignore.js +67 -0
- package/src/generators/expo-app/easignore.js.map +1 -0
- package/src/generators/expo-app/generator.js +3 -0
- package/src/generators/expo-app/generator.js.map +1 -1
- package/src/generators/repo-config/files/AGENTS.md.template +58 -0
- package/src/generators/repo-config/generator.js +1 -0
- package/src/generators/repo-config/generator.js.map +1 -1
- package/src/shared/dependencies.d.ts +4 -0
- package/src/shared/dependencies.js +4 -0
- package/src/shared/dependencies.js.map +1 -1
- package/src/shared/generators/index.d.ts +1 -0
- package/src/shared/generators/index.js +1 -0
- package/src/shared/generators/index.js.map +1 -1
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/Gilroy-Bold.ttf.template +0 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/Gilroy-Regular.ttf.template +0 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/Gilroy-Semibold.ttf.template +0 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/fonts.ts.template +7 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/index.ts.template +1 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/index.ts.template +1 -0
- package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/variables.ts.template +3 -3
- package/src/shared/generators/ui-kit/app-files/.babelrc.js.template +16 -0
- package/src/shared/generators/ui-kit/generator.d.ts +6 -0
- package/src/shared/generators/ui-kit/generator.js +40 -0
- package/src/shared/generators/ui-kit/generator.js.map +1 -0
- package/src/shared/generators/ui-kit/index.d.ts +1 -0
- package/src/shared/generators/ui-kit/index.js +5 -0
- package/src/shared/generators/ui-kit/index.js.map +1 -0
- package/src/shared/generators/ui-kit/layout-files/index.tsx.template +51 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/assets/icons/eye-off.svg.template +23 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/assets/icons/eye.svg.template +13 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/assets/icons/index.ts.template +7 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/assets/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/button/component.tsx.template +122 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/button/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/component.tsx.template +21 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/types/icon-name.ts.template +3 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/types/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/index.ts.template +9 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable/component.tsx.template +26 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable-icon/component.tsx.template +17 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable-icon/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/screen/component.tsx.template +61 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/screen/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/spinner/component.tsx.template +29 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/spinner/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text/component.tsx.template +107 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text-input/component.tsx.template +156 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text-input/hooks/index.ts.template +1 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text-input/hooks/use-animated-label.ts.template +32 -0
- package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text-input/index.ts.template +1 -0
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ Configures code checks and formatting with pre-commit hook.
|
|
|
102
102
|
### 3. `expo-app`
|
|
103
103
|
|
|
104
104
|
Generates and configures an Expo React Native app.
|
|
105
|
-
Also generates [navigation utilities](#navigation-utilities).
|
|
105
|
+
Also generates [navigation utilities](#navigation-utilities) and `.easignore` file for optimized [EAS Build](https://docs.expo.dev/build-reference/easignore/) uploads.
|
|
106
106
|
|
|
107
107
|
#### Options
|
|
108
108
|
|
package/package.json
CHANGED
|
@@ -55,6 +55,19 @@ Create builds using [EAS Build](https://docs.expo.dev/build/introduction/):
|
|
|
55
55
|
|
|
56
56
|
**Tip**: you can [create builds locally](https://docs.expo.dev/build-reference/local-builds/) by passing `--local` flag when starting build command.
|
|
57
57
|
|
|
58
|
+
#### EAS Ignore
|
|
59
|
+
|
|
60
|
+
The `.easignore` file in the repository root controls which files are uploaded to [EAS Build](https://docs.expo.dev/build-reference/easignore/) servers.
|
|
61
|
+
It uses a whitelist approach — everything is ignored by default, and only files required for the mobile build are included:
|
|
62
|
+
|
|
63
|
+
- App directory (`apps/{app-name}`)
|
|
64
|
+
- App-specific and shared libraries (`libs/{app-name}`, `libs/shared`)
|
|
65
|
+
- Translations (`i18n/{app-name}`, `i18n/shared`)
|
|
66
|
+
- Dependency patches and root config files
|
|
67
|
+
|
|
68
|
+
The file is generated automatically by the `expo-app` generator and supports multiple apps in a monorepo.
|
|
69
|
+
When a new app is added, only its app-specific entries are appended — common entries are not duplicated.
|
|
70
|
+
|
|
58
71
|
### 3. Distribute
|
|
59
72
|
|
|
60
73
|
#### Internal
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<% if(isStoreEnabled) { %> import { store } from '<%= libPath %>/shared/data-access/store';<% } %>
|
|
2
|
-
import '<%= libPath %>/shared/ui/styles';
|
|
2
|
+
import { fonts } from '<%= libPath %>/shared/ui/styles';
|
|
3
3
|
import { setLanguage } from '@ronas-it/react-native-common-modules/i18n';
|
|
4
|
+
import { useFonts } from 'expo-font';
|
|
4
5
|
import { Stack } from 'expo-router';
|
|
6
|
+
import * as SplashScreen from 'expo-splash-screen';
|
|
5
7
|
import { StatusBar } from 'expo-status-bar';
|
|
6
|
-
import { ReactElement } from 'react';
|
|
8
|
+
import { ReactElement, useEffect } from 'react';
|
|
7
9
|
<% if(isStoreEnabled) { %>import { Provider } from 'react-redux';<% } %>
|
|
8
10
|
|
|
9
11
|
export { ErrorBoundary } from 'expo-router';
|
|
@@ -17,10 +19,8 @@ const translations = {
|
|
|
17
19
|
|
|
18
20
|
const useLanguage = setLanguage(translations, 'en');
|
|
19
21
|
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
initialRouteName: 'index',
|
|
23
|
-
};
|
|
22
|
+
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
|
23
|
+
SplashScreen.preventAutoHideAsync();
|
|
24
24
|
|
|
25
25
|
function App(): ReactElement {
|
|
26
26
|
useLanguage('en');
|
|
@@ -33,6 +33,23 @@ function App(): ReactElement {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export default function RootLayout(): ReactElement | null {
|
|
36
|
+
const [loaded, error] = useFonts(fonts);
|
|
37
|
+
|
|
38
|
+
// Expo Router uses Error Boundaries to catch errors in the navigation tree.
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (error) throw error;
|
|
41
|
+
}, [error]);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (loaded) {
|
|
45
|
+
SplashScreen.hideAsync();
|
|
46
|
+
}
|
|
47
|
+
}, [loaded]);
|
|
48
|
+
|
|
49
|
+
if (!loaded) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
return (
|
|
37
54
|
<% if(isStoreEnabled) { %><Provider store={store}><% } %>
|
|
38
55
|
<StatusBar style='light' />
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateEasignore = generateEasignore;
|
|
4
|
+
const EASIGNORE_PATH = '.easignore';
|
|
5
|
+
const COMMON_LINES = `# Whitelist — ignore everything except what's needed for the mobile EAS build
|
|
6
|
+
|
|
7
|
+
# Ignore everything
|
|
8
|
+
*
|
|
9
|
+
.*
|
|
10
|
+
|
|
11
|
+
# Mobile apps
|
|
12
|
+
!apps
|
|
13
|
+
apps/*
|
|
14
|
+
|
|
15
|
+
# Shared libraries
|
|
16
|
+
!libs
|
|
17
|
+
libs/*
|
|
18
|
+
!libs/shared
|
|
19
|
+
!libs/shared/**
|
|
20
|
+
|
|
21
|
+
# i18n translations
|
|
22
|
+
!i18n
|
|
23
|
+
i18n/*
|
|
24
|
+
!i18n/shared
|
|
25
|
+
!i18n/shared/**
|
|
26
|
+
|
|
27
|
+
# Dependency patches for React Native packages
|
|
28
|
+
!patches
|
|
29
|
+
!patches/**
|
|
30
|
+
|
|
31
|
+
# Root config files required for the build
|
|
32
|
+
!package.json
|
|
33
|
+
!package-lock.json
|
|
34
|
+
!tsconfig.json
|
|
35
|
+
!tsconfig.base.json
|
|
36
|
+
!babel.config.json
|
|
37
|
+
!jest.config.ts
|
|
38
|
+
!jest.preset.js
|
|
39
|
+
!types.d.ts`;
|
|
40
|
+
function getAppSpecificLines(directory) {
|
|
41
|
+
return `
|
|
42
|
+
# Mobile app: ${directory}
|
|
43
|
+
!apps/${directory}
|
|
44
|
+
!apps/${directory}/**
|
|
45
|
+
apps/${directory}/.expo
|
|
46
|
+
|
|
47
|
+
# Libraries: ${directory}
|
|
48
|
+
!libs/${directory}
|
|
49
|
+
!libs/${directory}/**
|
|
50
|
+
|
|
51
|
+
# i18n: ${directory}
|
|
52
|
+
!i18n/${directory}
|
|
53
|
+
!i18n/${directory}/**`;
|
|
54
|
+
}
|
|
55
|
+
function generateEasignore(tree, directory) {
|
|
56
|
+
const appSpecificLines = getAppSpecificLines(directory);
|
|
57
|
+
if (!tree.exists(EASIGNORE_PATH)) {
|
|
58
|
+
tree.write(EASIGNORE_PATH, COMMON_LINES + '\n' + appSpecificLines + '\n');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const existingContent = tree.read(EASIGNORE_PATH, 'utf-8');
|
|
62
|
+
if (existingContent.includes(`!apps/${directory}\n`)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
tree.write(EASIGNORE_PATH, existingContent.trimEnd() + '\n' + appSpecificLines + '\n');
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=easignore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easignore.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/expo-app/easignore.ts"],"names":[],"mappings":";;AAwDA,8CAgBC;AAtED,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkCT,CAAC;AAEb,SAAS,mBAAmB,CAAC,SAAiB;IAC5C,OAAO;gBACO,SAAS;QACjB,SAAS;QACT,SAAS;OACV,SAAS;;eAED,SAAS;QAChB,SAAS;QACT,SAAS;;UAEP,SAAS;QACX,SAAS;QACT,SAAS,KAAK,CAAC;AACvB,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAU,EAAE,SAAiB;IAC7D,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAExD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,YAAY,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAAC,CAAC;QAE1E,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAE,CAAC;IAE5D,IAAI,eAAe,CAAC,QAAQ,CAAC,SAAS,SAAS,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO;IACT,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -10,6 +10,7 @@ const dependencies_1 = require("../../shared/dependencies");
|
|
|
10
10
|
const enums_1 = require("../../shared/enums");
|
|
11
11
|
const generators_1 = require("../../shared/generators");
|
|
12
12
|
const utils_1 = require("../../shared/utils");
|
|
13
|
+
const easignore_1 = require("./easignore");
|
|
13
14
|
const scripts_1 = require("./scripts");
|
|
14
15
|
function expoAppGenerator(tree, options) {
|
|
15
16
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -29,6 +30,7 @@ function expoAppGenerator(tree, options) {
|
|
|
29
30
|
yield (0, generators_1.runAppEnvGenerator)(tree, options);
|
|
30
31
|
yield (0, generators_1.runStorageGenerator)(tree, options);
|
|
31
32
|
yield (0, generators_1.runRNStylesGenerator)(tree, options);
|
|
33
|
+
yield (0, generators_1.runUiKitGenerator)(tree, options);
|
|
32
34
|
yield (0, generators_1.runNavigationUtilsGenerator)(tree, {
|
|
33
35
|
appDirectory: options.directory,
|
|
34
36
|
baseGeneratorType: enums_1.BaseGeneratorType.EXPO_APP,
|
|
@@ -70,6 +72,7 @@ function expoAppGenerator(tree, options) {
|
|
|
70
72
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'app-files'), appRoot, Object.assign(Object.assign({}, options), { formatName: utils_1.formatName,
|
|
71
73
|
formatAppIdentifier: utils_1.formatAppIdentifier,
|
|
72
74
|
libPath, isStoreEnabled: options.withStore, appDirectory: options.directory }));
|
|
75
|
+
(0, easignore_1.generateEasignore)(tree, options.directory);
|
|
73
76
|
tree.delete(`${appRoot}/tsconfig.app.json`);
|
|
74
77
|
(0, utils_1.addNxAppTag)(tree, options.directory);
|
|
75
78
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'i18n'), i18nRoot, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/expo-app/generator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/expo-app/generator.ts"],"names":[],"mappings":";;AA8BA,4CAwHC;;AAtJD,iDAAyC;AACzC,2BAAwC;AACxC,6BAA6B;AAC7B,uCASoB;AACpB,4DAA0E;AAC1E,8CAAuD;AACvD,wDASiC;AACjC,8CAAgH;AAChH,2CAAgD;AAEhD,uCAAgC;AAEhC,SAAsB,gBAAgB,CAAC,IAAU,EAAE,OAA+B;;QAChF,MAAM,0BAA0B,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,MAAM,IAAA,eAAO,EAAC,uCAAuC,CAAC,CAAC,CAAC;QACjH,MAAM,sBAAsB,GAAG,0BAA0B,IAAI,CAAC,MAAM,IAAA,eAAO,EAAC,iCAAiC,CAAC,CAAC,CAAC;QAEhH,MAAM,OAAO,GAAG,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,QAAQ,GAAG,QAAQ,OAAO,CAAC,SAAS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AAe,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;QAE1G,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,GAAS,EAAE;YAChB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;YAE1B,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,IAAA,wBAAQ,EAAC,6BAA6B,OAAO,CAAC,SAAS,WAAW,yBAAiB,CAAC,QAAQ,EAAE,EAAE;oBAC9F,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAC;YACL,CAAC;YAED,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,IAAA,wBAAQ,EAAC,+BAA+B,OAAO,EAAE,EAAE;oBACjD,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAC;YACL,CAAC;YAED,IAAA,wBAAQ,EAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YACpE,IAAA,wBAAQ,EAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Instructions for AI Assistants
|
|
2
|
+
|
|
3
|
+
## Basic Guidelines
|
|
4
|
+
|
|
5
|
+
- Always ask questions before implementation if something is unclear
|
|
6
|
+
- Always read existing files before modifying them
|
|
7
|
+
- Check for lint errors after making changes and fix them
|
|
8
|
+
- When adding new features, follow existing patterns in the codebase
|
|
9
|
+
- Suggest updates to this `AGENTS.md` file when discovering new patterns, but only apply after user confirmation
|
|
10
|
+
- Do not leave obvious comments in code
|
|
11
|
+
- Do not create new documentation until I asked to do so
|
|
12
|
+
|
|
13
|
+
## Using the Open WebUI Knowledge MCP Server
|
|
14
|
+
|
|
15
|
+
When working in this workspace, use the **open-webui-knowledge** MCP server to search company knowledge bases whenever relevant. Prefer it over generic answers for internal standards, architecture, and Ronas IT context.
|
|
16
|
+
|
|
17
|
+
### When to Query Knowledge Bases
|
|
18
|
+
|
|
19
|
+
Use the MCP tools **list_knowledge_bases**, **search_knowledge_base**, and **get_knowledge_base_info** (server: `user-open-webui-knowledge`) in these cases:
|
|
20
|
+
|
|
21
|
+
1. **User mentions a knowledge base**
|
|
22
|
+
e.g. “knowledge base”, “check the docs”, “per our guidelines”, “in our documentation”.
|
|
23
|
+
|
|
24
|
+
2. **Question is about architecture, standards, or recommended solutions** for:
|
|
25
|
+
- **React** → search **Frontend Docs**
|
|
26
|
+
- **React Native** → search **Frontend Docs**
|
|
27
|
+
- **Next.js** → search **Frontend Docs**
|
|
28
|
+
- **PHP / Laravel** → search **Backend Docs**
|
|
29
|
+
|
|
30
|
+
3. **User mentions Ronas (Ronas IT, the company, our product)**
|
|
31
|
+
Use **Frontend Docs**, **Backend Docs**, or **Ronas IT Dribbble Portfolio** depending on whether the question is about frontend, backend, or design references.
|
|
32
|
+
|
|
33
|
+
4. **Sales, marketing, or task templates**
|
|
34
|
+
Use **Sales Documentation**, **Sales**, **Marketing**, or **Tasks Templates** when the question is about processes, sales materials, or task formats.
|
|
35
|
+
|
|
36
|
+
### Knowledge Base IDs (for search_knowledge_base)
|
|
37
|
+
|
|
38
|
+
| Knowledge base | ID |
|
|
39
|
+
|---------------------------|----|
|
|
40
|
+
| Backend Docs (Laravel) | `60603f2d-1318-4e81-adbd-681b47b22b3a` |
|
|
41
|
+
| Frontend Docs (RN, Next) | `7de525d2-a308-41e4-ab15-42d527549703` |
|
|
42
|
+
| Sales Documentation | `b0d7f492-cf20-442b-a767-2255113f036f` |
|
|
43
|
+
| Ronas IT Dribbble | `e64d0850-bd4d-4e68-9ca4-4e2211d795d4` |
|
|
44
|
+
| Sales | `8f8bb651-a5dc-43e5-a650-a3a145543690` |
|
|
45
|
+
| Marketing | `5006584c-28f5-4a5b-8fa8-0f61e3c7f981` |
|
|
46
|
+
| Tasks Templates | `44fc3e2e-c0eb-4700-bb51-4d80cadbf0f9` |
|
|
47
|
+
|
|
48
|
+
**Keeping the table up to date:** If you call **list_knowledge_bases** and the result shows new bases, different IDs, or missing entries compared to the table above, update the "Knowledge Base IDs" table in this file (AGENTS.md) so it matches the current list. That keeps the reference accurate for future sessions.
|
|
49
|
+
|
|
50
|
+
If in doubt, call **list_knowledge_bases** first to get the current list and descriptions.
|
|
51
|
+
|
|
52
|
+
### How to Search
|
|
53
|
+
|
|
54
|
+
- Use **search_knowledge_base** with `knowledge_base_id` and `query` (and optionally `k` for number of results).
|
|
55
|
+
- Formulate `query` from the user’s question (architecture, tech stack, “how we do X”, naming, etc.).
|
|
56
|
+
- Prefer the most specific base (e.g. Frontend Docs for React/Next/RN, Backend Docs for Laravel) and optionally search multiple bases when the question spans domains or company practices.
|
|
57
|
+
|
|
58
|
+
Cite retrieved snippets and, when they conflict with generic best practices, prefer the knowledge base content for this project.
|
|
@@ -13,6 +13,7 @@ function repoConfigGenerator(tree) {
|
|
|
13
13
|
const projectPackagePath = 'package.json';
|
|
14
14
|
// Remove unnecessary files and files that will be replaced
|
|
15
15
|
tree.delete('README.md');
|
|
16
|
+
tree.delete('AGENTS.md');
|
|
16
17
|
tree.delete('packages');
|
|
17
18
|
// Update project package.json
|
|
18
19
|
const projectPackageJson = (0, devkit_1.readJson)(tree, projectPackagePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/repo-config/generator.ts"],"names":[],"mappings":";;AAcA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/repo-config/generator.ts"],"names":[],"mappings":";;AAcA,kDA6BC;;AA3CD,6BAA6B;AAC7B,uCAQoB;AACpB,4DAA4D;AAC5D,8CAAgE;AAChE,uCAAgC;AAEhC,SAAsB,mBAAmB,CAAC,IAAU;;QAClD,MAAM,WAAW,GAAG,GAAG,CAAC;QACxB,MAAM,kBAAkB,GAAG,cAAc,CAAC;QAE1C,2DAA2D;QAC3D,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAExB,8BAA8B;QAC9B,MAAM,kBAAkB,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC9D,kBAAkB,CAAC,UAAU,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC3C,kBAAkB,CAAC,OAAO,GAAG,iBAAO,CAAC;QACrC,IAAA,kBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QAExD,oBAAoB;QACpB,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE;YAC9D,IAAI,EAAE,IAAA,sBAAc,EAAC,kBAAkB,CAAC,IAAI,CAAC;YAC7C,UAAU,EAAV,kBAAU;SACX,CAAC,CAAC;QAEH,mBAAmB;QACnB,IAAA,qCAA4B,EAAC,IAAI,EAAE,EAAE,EAAE,8BAAe,CAAC,aAAa,CAAC,CAAC,CAAC;QAEvE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,GAAS,EAAE;YAChB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -43,6 +43,10 @@ export declare const dependencies: {
|
|
|
43
43
|
'react-native-edge-to-edge': string;
|
|
44
44
|
'react-native-nitro-modules': string;
|
|
45
45
|
};
|
|
46
|
+
'ui-kit': {
|
|
47
|
+
'react-native-reanimated': string;
|
|
48
|
+
'react-native-worklets': string;
|
|
49
|
+
};
|
|
46
50
|
store: {
|
|
47
51
|
'@ronas-it/rtkq-entity-api': string;
|
|
48
52
|
'react-redux': string;
|
|
@@ -46,6 +46,10 @@ exports.dependencies = {
|
|
|
46
46
|
'react-native-edge-to-edge': '^1.7.0',
|
|
47
47
|
'react-native-nitro-modules': '0.33.2',
|
|
48
48
|
},
|
|
49
|
+
'ui-kit': {
|
|
50
|
+
'react-native-reanimated': '^4.1.5',
|
|
51
|
+
'react-native-worklets': '0.7.1',
|
|
52
|
+
},
|
|
49
53
|
store: {
|
|
50
54
|
'@ronas-it/rtkq-entity-api': '^0.5.0',
|
|
51
55
|
'react-redux': '^9.2.0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../plugin/src/shared/dependencies.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,UAAU,EAAE;QACV,uCAAuC,EAAE,QAAQ;QACjD,mBAAmB,EAAE,QAAQ;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,iBAAiB,EAAE,SAAS;QAC5B,aAAa,EAAE,SAAS;QACxB,gCAAgC,EAAE,QAAQ;QAC1C,sBAAsB,EAAE,SAAS;QACjC,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,QAAQ;QACxB,iBAAiB,EAAE,QAAQ;QAC3B,cAAc,EAAE,UAAU;QAC1B,eAAe,EAAE,SAAS;QAC1B,mBAAmB,EAAE,SAAS;QAC9B,SAAS,EAAE,QAAQ;QACnB,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,SAAS;QACtB,cAAc,EAAE,SAAS;QACzB,kBAAkB,EAAE,UAAU;QAC9B,8BAA8B,EAAE,QAAQ;KACzC;IACD,UAAU,EAAE;QACV,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,UAAU;QACvB,mBAAmB,EAAE,QAAQ;QAC7B,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,SAAS;KACvB;IACD,YAAY,EAAE;QACZ,4BAA4B,EAAE,QAAQ;KACvC;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E,UAAU;QAC9B,WAAW,EAAE,UAAU;QACvB,yBAAyB,EAAE,SAAS;QACpC,kBAAkB,EAAE,QAAQ;QAC5B,KAAK,EAAE,SAAS;QAChB,cAAc,EAAE,SAAS;KAC1B;IACD,UAAU,EAAE;QACV,oBAAoB,EAAE,SAAS;QAC/B,kBAAkB,EAAE,UAAU;QAC9B,cAAc,EAAE,UAAU;QAC1B,kBAAkB,EAAE,UAAU;QAC9B,6BAA6B,EAAE,QAAQ;KACxC;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,SAAS;KACvB;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,OAAO;KACxB;IACD,WAAW,EAAE;QACX,kBAAkB,EAAE,QAAQ;KAC7B;CACF,CAAC"}
|
|
@@ -10,4 +10,5 @@ tslib_1.__exportStar(require("./rn-styles"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./form-utils"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./i18n-next"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./navigation-utils"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./ui-kit"), exports);
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../plugin/src/shared/generators/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,uDAA6B;AAC7B,iDAAuB;AACvB,oDAA0B;AAC1B,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,6DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../plugin/src/shared/generators/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,uDAA6B;AAC7B,iDAAuB;AACvB,oDAA0B;AAC1B,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,6DAAmC;AACnC,mDAAyB"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/shared/generators/rn-styles/lib-files/shared/ui/styles/src/lib/fonts/index.ts.template
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fonts';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = function (api) {
|
|
2
|
+
api.cache(true);
|
|
3
|
+
return {
|
|
4
|
+
presets: ['babel-preset-expo'],
|
|
5
|
+
plugins: [
|
|
6
|
+
[
|
|
7
|
+
'react-native-unistyles/plugin',
|
|
8
|
+
{
|
|
9
|
+
root: 'app',
|
|
10
|
+
autoProcessImports: '<%= libPath %>',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
['react-native-worklets/plugin'],
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runUiKitGenerator = runUiKitGenerator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const dependencies_1 = require("../../dependencies");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
function runUiKitGenerator(tree, options) {
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const appRoot = `apps/${options.directory}`;
|
|
14
|
+
const libRoot = `libs/${options.directory}`;
|
|
15
|
+
const libPath = `${(0, utils_1.getImportPathPrefix)(tree)}/${options.directory}`;
|
|
16
|
+
const appPackagePath = `${appRoot}/package.json`;
|
|
17
|
+
const appLayoutPath = `${appRoot}/app`;
|
|
18
|
+
// Generate ui-kit lib
|
|
19
|
+
(0, child_process_1.execSync)(`npx nx g react-lib --app=${options.directory} --scope=shared --type=ui --name=ui-kit --withComponent=false`, {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
});
|
|
22
|
+
// Remove unnecessary files
|
|
23
|
+
tree.delete(`${libRoot}/shared/ui/ui-kit/src/index.ts`);
|
|
24
|
+
tree.delete(`${appLayoutPath}/index.tsx`);
|
|
25
|
+
// Add lib files
|
|
26
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'lib-files'), libRoot, Object.assign(Object.assign({}, options), { libPath }));
|
|
27
|
+
// Add app files
|
|
28
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'app-files'), appRoot, Object.assign(Object.assign({}, options), { libPath }));
|
|
29
|
+
// Add layout files
|
|
30
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'layout-files'), appLayoutPath, Object.assign(Object.assign({}, options), { libPath }));
|
|
31
|
+
// Add dependencies
|
|
32
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, dependencies_1.dependencies['ui-kit'], {});
|
|
33
|
+
if ((0, fs_1.existsSync)(appPackagePath)) {
|
|
34
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, dependencies_1.dependencies['ui-kit'], {}, appPackagePath);
|
|
35
|
+
}
|
|
36
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.default = runUiKitGenerator;
|
|
40
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugin/src/shared/generators/ui-kit/generator.ts"],"names":[],"mappings":";;AAOA,8CA8CC;;AArDD,iDAAyC;AACzC,2BAAgC;AAChC,6BAA6B;AAC7B,uCAA4F;AAC5F,qDAAkD;AAClD,uCAAkD;AAElD,SAAsB,iBAAiB,CAAC,IAAU,EAAE,OAA4C;;QAC9F,MAAM,OAAO,GAAG,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,QAAQ,OAA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AI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../plugin/src/shared/generators/ui-kit/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AppButton, AppScreen, AppSpinner, AppText, AppTextInput } from '<%= libPath %>/shared/ui/ui-kit';
|
|
2
|
+
import { ReactElement, useState } from 'react';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
|
|
5
|
+
export default function RootScreen(): ReactElement {
|
|
6
|
+
const [username, setUsername] = useState<string>('');
|
|
7
|
+
const [password, setPassword] = useState<string>('');
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<AppScreen style={styles.container}>
|
|
11
|
+
<AppText>Title H1</AppText>
|
|
12
|
+
<AppText>Title H2</AppText>
|
|
13
|
+
<AppText>Title H3</AppText>
|
|
14
|
+
<AppText>Title H4</AppText>
|
|
15
|
+
<AppText>Title H5</AppText>
|
|
16
|
+
<AppText>Title H6</AppText>
|
|
17
|
+
<AppText>Body Large</AppText>
|
|
18
|
+
<AppText>Body Large Bold</AppText>
|
|
19
|
+
<AppText>Body Default</AppText>
|
|
20
|
+
<AppText>Body Default Bold</AppText>
|
|
21
|
+
<AppText>Body Small</AppText>
|
|
22
|
+
<AppText>Body Small Bold</AppText>
|
|
23
|
+
<AppText>Body Extra Small</AppText>
|
|
24
|
+
<AppText>Body Extra Small Bold</AppText>
|
|
25
|
+
<AppTextInput
|
|
26
|
+
label='Username'
|
|
27
|
+
autoCapitalize='none'
|
|
28
|
+
autoCorrect={false}
|
|
29
|
+
value={username}
|
|
30
|
+
onChangeText={setUsername}
|
|
31
|
+
/>
|
|
32
|
+
<AppTextInput isPassword={true} label='Password' value={password} onChangeText={setPassword} />
|
|
33
|
+
<AppButton text='Button Primary Regular' />
|
|
34
|
+
<AppButton text='Button Primary Small' size='small' />
|
|
35
|
+
<AppButton text='Button Secondary Regular' variant='secondary' />
|
|
36
|
+
<AppButton text='Button Secondary Small' variant='secondary' size='small' />
|
|
37
|
+
<AppButton text='Button Tertiary Regular' variant='tertiary' />
|
|
38
|
+
<AppButton text='Button Tertiary Small' variant='tertiary' size='small' />
|
|
39
|
+
<AppButton text='Button Danger Regular' variant='danger' />
|
|
40
|
+
<AppButton text='Button Danger Small' variant='danger' size='small' />
|
|
41
|
+
<AppSpinner />
|
|
42
|
+
</AppScreen>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const styles = StyleSheet.create(({ spacings }) => ({
|
|
47
|
+
container: {
|
|
48
|
+
gap: spacings.xs,
|
|
49
|
+
paddingVertical: spacings.md,
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_944_8975)">
|
|
3
|
+
<mask id="mask0_944_8975" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"
|
|
4
|
+
width="26" height="24">
|
|
5
|
+
<path d="M26 24H0V0H26V24ZM4 19.8496L6.7002 22.5498L21.5498 7.7002L18.8496 5L4 19.8496Z"
|
|
6
|
+
fill="white" />
|
|
7
|
+
</mask>
|
|
8
|
+
<g mask="url(#mask0_944_8975)">
|
|
9
|
+
<mask id="path-2-inside-1_944_8975" fill="white">
|
|
10
|
+
<path
|
|
11
|
+
d="M12 6C16.6993 6 20.799 8.55443 22.9951 12.3486C20.7992 16.1435 16.6998 18.6992 12 18.6992C7.30007 18.6992 3.19976 16.1437 1.00391 12.3486C3.19993 8.5542 7.30057 6 12 6Z" />
|
|
12
|
+
</mask>
|
|
13
|
+
<path
|
|
14
|
+
d="M12 6L12 4.4H12V6ZM22.9951 12.3486L24.38 13.15L24.8437 12.3485L24.3799 11.5471L22.9951 12.3486ZM12 18.6992V20.2992H12L12 18.6992ZM1.00391 12.3486L-0.380895 11.5472L-0.844675 12.3485L-0.380983 13.1499L1.00391 12.3486ZM12 6L12 7.6C16.1042 7.6 19.6881 9.82899 21.6103 13.1501L22.9951 12.3486L24.3799 11.5471C21.91 7.27987 17.2943 4.4 12 4.4L12 6ZM22.9951 12.3486L21.6103 11.5473C19.688 14.8693 16.1044 17.0992 12 17.0992L12 18.6992L12 20.2992C17.2951 20.2992 21.9104 17.4177 24.38 13.15L22.9951 12.3486ZM12 18.6992V17.0992C7.89525 17.0992 4.31091 14.8693 2.3888 11.5473L1.00391 12.3486L-0.380983 13.1499C2.08861 17.4181 6.7049 20.2992 12 20.2992V18.6992ZM1.00391 12.3486L2.38871 13.1501C4.31083 9.82891 7.89541 7.6 12 7.6V6V4.4C6.70574 4.4 2.08903 7.27948 -0.380895 11.5472L1.00391 12.3486Z"
|
|
15
|
+
fill="currentColor" mask="url(#path-2-inside-1_944_8975)" />
|
|
16
|
+
<path
|
|
17
|
+
d="M12.1289 9.00293C12.0465 9.23685 12 9.48789 12 9.75C12 10.9926 13.0074 12 14.25 12C14.5119 12 14.7623 11.9524 14.9961 11.8701C14.9979 11.9132 15 11.9565 15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C12.0432 9 12.0862 9.00112 12.1289 9.00293Z"
|
|
18
|
+
fill="currentColor" />
|
|
19
|
+
</g>
|
|
20
|
+
<path d="M20.5 3L3 20.5" stroke="currentColor" stroke-width="1.6" />
|
|
21
|
+
</g>
|
|
22
|
+
</svg>
|
|
23
|
+
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/assets/icons/eye.svg.template
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<mask id="path-1-inside-1_28393_1814" fill="white">
|
|
3
|
+
<path
|
|
4
|
+
d="M12 6C16.6993 6 20.799 8.55443 22.9951 12.3486C20.7992 16.1435 16.6998 18.6992 12 18.6992C7.30007 18.6992 3.19976 16.1437 1.00391 12.3486C3.19993 8.5542 7.30057 6 12 6Z" />
|
|
5
|
+
</mask>
|
|
6
|
+
<path
|
|
7
|
+
d="M12 6L12 4.4H12V6ZM22.9951 12.3486L24.38 13.15L24.8437 12.3485L24.3799 11.5471L22.9951 12.3486ZM12 18.6992V20.2992H12L12 18.6992ZM1.00391 12.3486L-0.380895 11.5472L-0.844675 12.3485L-0.380983 13.1499L1.00391 12.3486ZM12 6L12 7.6C16.1042 7.6 19.6881 9.82899 21.6103 13.1501L22.9951 12.3486L24.3799 11.5471C21.91 7.27987 17.2943 4.4 12 4.4L12 6ZM22.9951 12.3486L21.6103 11.5473C19.688 14.8693 16.1044 17.0992 12 17.0992L12 18.6992L12 20.2992C17.2951 20.2992 21.9104 17.4177 24.38 13.15L22.9951 12.3486ZM12 18.6992V17.0992C7.89525 17.0992 4.31091 14.8693 2.3888 11.5473L1.00391 12.3486L-0.380983 13.1499C2.08861 17.4181 6.7049 20.2992 12 20.2992V18.6992ZM1.00391 12.3486L2.38871 13.1501C4.31083 9.82891 7.89541 7.6 12 7.6V6V4.4C6.70574 4.4 2.08903 7.27948 -0.380895 11.5472L1.00391 12.3486Z"
|
|
8
|
+
fill="currentColor" mask="url(#path-1-inside-1_28393_1814)" />
|
|
9
|
+
<path
|
|
10
|
+
d="M12.1289 9.00293C12.0465 9.23685 12 9.48789 12 9.75C12 10.9926 13.0074 12 14.25 12C14.5119 12 14.7623 11.9524 14.9961 11.8701C14.9979 11.9132 15 11.9565 15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C12.0432 9 12.0862 9.00112 12.1289 9.00293Z"
|
|
11
|
+
fill="currentColor" />
|
|
12
|
+
</svg>
|
|
13
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icons';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/button/component.tsx.template
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Fragment, ReactElement } from 'react';
|
|
2
|
+
import { Pressable, PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { UnistylesVariants, StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { colors, rem, spacings } from '<%= libPath %>/shared/ui/styles';
|
|
5
|
+
import { AppSpinner } from '../spinner';
|
|
6
|
+
import { AppText } from '../text';
|
|
7
|
+
|
|
8
|
+
type AppButtonProps = UnistylesVariants<typeof buttonStyles> &
|
|
9
|
+
Omit<PressableProps, 'style'> & {
|
|
10
|
+
accessoryLeft?: ReactElement;
|
|
11
|
+
accessoryRight?: ReactElement;
|
|
12
|
+
text?: string;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isFilled?: boolean;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const AppButton = ({
|
|
19
|
+
variant = 'primary',
|
|
20
|
+
size = 'regular',
|
|
21
|
+
disabled,
|
|
22
|
+
text,
|
|
23
|
+
isLoading,
|
|
24
|
+
isFilled,
|
|
25
|
+
style,
|
|
26
|
+
accessoryLeft,
|
|
27
|
+
accessoryRight,
|
|
28
|
+
...props
|
|
29
|
+
}: AppButtonProps): ReactElement => {
|
|
30
|
+
buttonStyles.useVariants({ variant, size });
|
|
31
|
+
textStyles.useVariants({ variant });
|
|
32
|
+
|
|
33
|
+
const buttonDisabled = disabled || isLoading;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Pressable
|
|
37
|
+
style={({ pressed }) => [buttonStyles.button(pressed, !!isFilled), style]}
|
|
38
|
+
disabled={buttonDisabled}
|
|
39
|
+
{...props}>
|
|
40
|
+
{({ pressed }): ReactElement =>
|
|
41
|
+
isLoading ? (
|
|
42
|
+
<AppSpinner size='small' color={variant === 'primary' ? colors.backgroundPrimary : colors.textPrimary} />
|
|
43
|
+
) : (
|
|
44
|
+
<Fragment>
|
|
45
|
+
{accessoryLeft}
|
|
46
|
+
<AppText
|
|
47
|
+
variant={size === 'regular' ? 'bodyDefaultBold' : 'bodySmallBold'}
|
|
48
|
+
style={textStyles.text(!!buttonDisabled, pressed)}>
|
|
49
|
+
{text}
|
|
50
|
+
</AppText>
|
|
51
|
+
{accessoryRight}
|
|
52
|
+
</Fragment>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
</Pressable>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const buttonStyles = StyleSheet.create(({ colors }) => ({
|
|
60
|
+
button: (pressed: boolean, filled: boolean) => ({
|
|
61
|
+
flex: filled ? 1 : 0,
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
gap: spacings.xs,
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'center',
|
|
66
|
+
borderWidth: 1,
|
|
67
|
+
borderColor: 'transparent',
|
|
68
|
+
variants: {
|
|
69
|
+
variant: {
|
|
70
|
+
primary: {
|
|
71
|
+
backgroundColor: colors.primary,
|
|
72
|
+
},
|
|
73
|
+
secondary: {
|
|
74
|
+
backgroundColor: colors.backgroundSecondary,
|
|
75
|
+
},
|
|
76
|
+
tertiary: {
|
|
77
|
+
backgroundColor: 'transparent',
|
|
78
|
+
borderColor: pressed ? colors.textTertiary : 'transparent',
|
|
79
|
+
},
|
|
80
|
+
danger: {
|
|
81
|
+
backgroundColor: 'transparent',
|
|
82
|
+
borderColor: pressed ? colors.textTertiary : 'transparent',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
regular: {
|
|
87
|
+
borderRadius: 1 * rem,
|
|
88
|
+
minHeight: 3.5 * rem,
|
|
89
|
+
paddingHorizontal: 2.625 * rem,
|
|
90
|
+
},
|
|
91
|
+
small: {
|
|
92
|
+
borderRadius: 1 * rem,
|
|
93
|
+
minHeight: 2 * rem,
|
|
94
|
+
paddingHorizontal: 1 * rem,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const textStyles = StyleSheet.create(({ colors }) => ({
|
|
102
|
+
text: (disabled: boolean, pressed: boolean) => ({
|
|
103
|
+
variants: {
|
|
104
|
+
variant: {
|
|
105
|
+
primary: {
|
|
106
|
+
color: colors.textPrimary,
|
|
107
|
+
opacity: disabled ? 0.4 : pressed ? 0.8 : 1,
|
|
108
|
+
},
|
|
109
|
+
secondary: {
|
|
110
|
+
color: disabled ? colors.textSecondary : pressed ? colors.primary : colors.textPrimary,
|
|
111
|
+
},
|
|
112
|
+
tertiary: {
|
|
113
|
+
color: disabled ? colors.textSecondary : colors.textPrimary,
|
|
114
|
+
},
|
|
115
|
+
danger: {
|
|
116
|
+
color: colors.error,
|
|
117
|
+
opacity: disabled ? 0.4 : pressed ? 0.8 : 1,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/component.tsx.template
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SvgProps } from 'react-native-svg';
|
|
3
|
+
import { colors } from '<%= libPath %>/shared/ui/styles';
|
|
4
|
+
import { Icons } from '../assets';
|
|
5
|
+
import { IconName } from './types';
|
|
6
|
+
|
|
7
|
+
export interface IconProps extends SvgProps {
|
|
8
|
+
name: IconName;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const defaultColor = colors.textPrimary;
|
|
12
|
+
|
|
13
|
+
export function Icon({ name, ...restProps }: IconProps): ReactNode {
|
|
14
|
+
const props: SvgProps = {
|
|
15
|
+
color: defaultColor,
|
|
16
|
+
...restProps,
|
|
17
|
+
};
|
|
18
|
+
const Component = name in Icons && Icons[name];
|
|
19
|
+
|
|
20
|
+
return Component ? <Component {...props} /> : null;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/icon/types/index.ts.template
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icon-name';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable/component.tsx.template
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ForwardedRef, ReactElement } from 'react';
|
|
2
|
+
import { Pressable, PressableProps, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface AppPressableProps extends PressableProps {
|
|
5
|
+
pressedOpacity?: number;
|
|
6
|
+
ref?: ForwardedRef<View>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function AppPressable({
|
|
10
|
+
children,
|
|
11
|
+
style,
|
|
12
|
+
pressedOpacity = 0.4,
|
|
13
|
+
ref,
|
|
14
|
+
...props
|
|
15
|
+
}: AppPressableProps): ReactElement {
|
|
16
|
+
return (
|
|
17
|
+
<Pressable
|
|
18
|
+
ref={ref}
|
|
19
|
+
style={({ pressed }) =>
|
|
20
|
+
StyleSheet.flatten([{ opacity: pressed ? pressedOpacity : 1 }, style as StyleProp<ViewStyle>])
|
|
21
|
+
}
|
|
22
|
+
{...props}>
|
|
23
|
+
{children}
|
|
24
|
+
</Pressable>
|
|
25
|
+
);
|
|
26
|
+
}
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable/index.ts.template
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { Icon, IconProps } from '../icon';
|
|
4
|
+
import { AppPressable } from '../pressable';
|
|
5
|
+
|
|
6
|
+
export interface AppPressableIconProps extends IconProps {
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
layoutStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function AppPressableIcon({ onPress, layoutStyle, disabled, ...props }: AppPressableIconProps): ReactElement {
|
|
12
|
+
return (
|
|
13
|
+
<AppPressable onPress={onPress} style={layoutStyle} hitSlop={10} disabled={disabled}>
|
|
14
|
+
<Icon {...props} />
|
|
15
|
+
</AppPressable>
|
|
16
|
+
);
|
|
17
|
+
}
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/pressable-icon/index.ts.template
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/screen/component.tsx.template
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactElement, useMemo } from 'react';
|
|
2
|
+
import { ScrollView, ScrollViewProps, View, ViewProps } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { commonStyle, spacings } from '<%= libPath %>/shared/ui/styles';
|
|
5
|
+
|
|
6
|
+
export interface AppScreenProps {
|
|
7
|
+
scrollDisabled?: boolean;
|
|
8
|
+
noOutsideSpacing?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface NonScrollableScreenProps extends ViewProps {
|
|
12
|
+
scrollDisabled: true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ScrollableScreenProps extends ScrollViewProps {
|
|
16
|
+
scrollDisabled?: false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function AppScreen(props: AppScreenProps & (ScrollableScreenProps | NonScrollableScreenProps)): ReactElement {
|
|
20
|
+
const { children, style: elementStyle = {}, testID, scrollDisabled, noOutsideSpacing, ...restProps } = props;
|
|
21
|
+
|
|
22
|
+
const [ViewComponent, viewComponentProps] = useMemo(
|
|
23
|
+
(): [typeof View, ViewProps] | [typeof ScrollView, ScrollViewProps] =>
|
|
24
|
+
scrollDisabled
|
|
25
|
+
? [
|
|
26
|
+
View,
|
|
27
|
+
{
|
|
28
|
+
style: [commonStyle.fullFlex, !noOutsideSpacing && styles.spacingsContainer, elementStyle],
|
|
29
|
+
...restProps,
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
: [
|
|
33
|
+
ScrollView,
|
|
34
|
+
{
|
|
35
|
+
contentContainerStyle: [styles.scroll, !noOutsideSpacing && styles.spacingsContainer, elementStyle],
|
|
36
|
+
showsVerticalScrollIndicator: false,
|
|
37
|
+
keyboardShouldPersistTaps: 'handled',
|
|
38
|
+
...restProps,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
[scrollDisabled, restProps, noOutsideSpacing],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View style={[styles.container, commonStyle.fullFlex]}>
|
|
46
|
+
<ViewComponent {...viewComponentProps}>{children}</ViewComponent>
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const styles = StyleSheet.create(({ colors }) => ({
|
|
52
|
+
container: {
|
|
53
|
+
backgroundColor: colors.backgroundPrimary,
|
|
54
|
+
},
|
|
55
|
+
spacingsContainer: {
|
|
56
|
+
paddingHorizontal: spacings.md,
|
|
57
|
+
},
|
|
58
|
+
scroll: {
|
|
59
|
+
minHeight: '100%',
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/spinner/component.tsx.template
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { StyleProp, View, ViewStyle, ActivityIndicator, ActivityIndicatorProps } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { commonStyle, colors } from '<%= libPath %>/shared/ui/styles';
|
|
5
|
+
|
|
6
|
+
export interface AppSpinnerProps extends ActivityIndicatorProps {
|
|
7
|
+
isFullScreen?: boolean;
|
|
8
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function AppSpinner({
|
|
12
|
+
isFullScreen,
|
|
13
|
+
size = 'large',
|
|
14
|
+
containerStyle,
|
|
15
|
+
...restProps
|
|
16
|
+
}: AppSpinnerProps): ReactElement {
|
|
17
|
+
return (
|
|
18
|
+
<View style={[styles.container, isFullScreen && commonStyle.fullFlex, containerStyle]}>
|
|
19
|
+
<ActivityIndicator color={colors.primary} size={size} {...restProps} />
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
container: {
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text/component.tsx.template
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Text, type TextProps } from 'react-native';
|
|
3
|
+
import { UnistylesVariants, StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { fontFamily, rem } from '<%= libPath %>/shared/ui/styles';
|
|
5
|
+
|
|
6
|
+
export type AppTextProps = UnistylesVariants<typeof textStyles> & TextProps;
|
|
7
|
+
|
|
8
|
+
export const AppText = ({ variant = 'bodyDefault', children, style, ...props }: AppTextProps): ReactElement => {
|
|
9
|
+
textStyles.useVariants({ variant });
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Text style={[textStyles.text, style]} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</Text>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const textStyles = StyleSheet.create(({ colors }) => ({
|
|
19
|
+
text: {
|
|
20
|
+
color: colors.textPrimary,
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
// Titles
|
|
24
|
+
h1: {
|
|
25
|
+
fontFamily: fontFamily.regular,
|
|
26
|
+
fontSize: 1.5 * rem, // 24px
|
|
27
|
+
lineHeight: 1.875 * rem, // 30px
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
},
|
|
30
|
+
h2: {
|
|
31
|
+
fontFamily: fontFamily.regular,
|
|
32
|
+
fontSize: 1.375 * rem, // 22px
|
|
33
|
+
lineHeight: 1.75 * rem, // 28px
|
|
34
|
+
},
|
|
35
|
+
h3: {
|
|
36
|
+
fontFamily: fontFamily.regular,
|
|
37
|
+
fontSize: 1.1875 * rem, // 19px
|
|
38
|
+
lineHeight: 1.5 * rem, // 24px
|
|
39
|
+
},
|
|
40
|
+
h4: {
|
|
41
|
+
fontFamily: fontFamily.regular,
|
|
42
|
+
fontSize: 1.1875 * rem, // 19px
|
|
43
|
+
lineHeight: 1.5 * rem, // 24px
|
|
44
|
+
fontWeight: 500,
|
|
45
|
+
},
|
|
46
|
+
h5: {
|
|
47
|
+
fontFamily: fontFamily.regular,
|
|
48
|
+
fontSize: 1 * rem, // 16px
|
|
49
|
+
lineHeight: 1.25 * rem, // 20px
|
|
50
|
+
fontWeight: 500,
|
|
51
|
+
},
|
|
52
|
+
h6: {
|
|
53
|
+
fontFamily: fontFamily.regular,
|
|
54
|
+
fontSize: 1 * rem, // 16px
|
|
55
|
+
lineHeight: 1.25 * rem, // 20px
|
|
56
|
+
fontWeight: 500,
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Body
|
|
60
|
+
bodyLarge: {
|
|
61
|
+
fontFamily: fontFamily.regular,
|
|
62
|
+
fontSize: 1.0625 * rem, // 17px
|
|
63
|
+
lineHeight: 1.5 * rem, // 24px
|
|
64
|
+
},
|
|
65
|
+
bodyLargeBold: {
|
|
66
|
+
fontFamily: fontFamily.bold,
|
|
67
|
+
fontSize: 1.0625 * rem, // 17px
|
|
68
|
+
lineHeight: 1.5 * rem, // 24px
|
|
69
|
+
fontWeight: 500,
|
|
70
|
+
},
|
|
71
|
+
bodyDefault: {
|
|
72
|
+
fontFamily: fontFamily.regular,
|
|
73
|
+
fontSize: 1 * rem, // 16px
|
|
74
|
+
lineHeight: 1.4375 * rem, // 23px
|
|
75
|
+
},
|
|
76
|
+
bodyDefaultBold: {
|
|
77
|
+
fontFamily: fontFamily.bold,
|
|
78
|
+
fontSize: 1 * rem, // 16px
|
|
79
|
+
lineHeight: 1.4375 * rem, // 23px
|
|
80
|
+
fontWeight: 500,
|
|
81
|
+
},
|
|
82
|
+
bodySmall: {
|
|
83
|
+
fontFamily: fontFamily.regular,
|
|
84
|
+
fontSize: 0.8125 * rem, // 13px
|
|
85
|
+
lineHeight: 1.1875 * rem, // 19px
|
|
86
|
+
},
|
|
87
|
+
bodySmallBold: {
|
|
88
|
+
fontFamily: fontFamily.semiBold,
|
|
89
|
+
fontSize: 0.8125 * rem, // 13px
|
|
90
|
+
lineHeight: 1.1875 * rem, // 19px
|
|
91
|
+
fontWeight: 500,
|
|
92
|
+
},
|
|
93
|
+
bodyExtraSmall: {
|
|
94
|
+
fontFamily: fontFamily.regular,
|
|
95
|
+
fontSize: 0.6875 * rem, // 11px
|
|
96
|
+
lineHeight: 0.875 * rem, // 14px
|
|
97
|
+
},
|
|
98
|
+
bodyExtraSmallBold: {
|
|
99
|
+
fontFamily: fontFamily.semiBold,
|
|
100
|
+
fontSize: 0.6875 * rem, // 11px
|
|
101
|
+
lineHeight: 0.875 * rem, // 14px
|
|
102
|
+
fontWeight: 500,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { ReactElement, RefObject, useRef, useState } from 'react';
|
|
2
|
+
import { TextInput, FocusEvent, TextInputProps, View, Platform, TouchableWithoutFeedback } from 'react-native';
|
|
3
|
+
import Animated, { useSharedValue } from 'react-native-reanimated';
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
+
import { colors, commonStyle, rem, spacings } from '<%= libPath %>/shared/ui/styles';
|
|
6
|
+
import { AppPressableIcon } from '../pressable-icon';
|
|
7
|
+
import { AppText, textStyles as appTextStyles } from '../text';
|
|
8
|
+
import { useAnimatedLabel } from './hooks';
|
|
9
|
+
|
|
10
|
+
export interface AppTextInputProps extends TextInputProps {
|
|
11
|
+
accessoryRight?: ReactElement;
|
|
12
|
+
label?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
isPassword?: boolean;
|
|
16
|
+
ref?: RefObject<TextInput | null>;
|
|
17
|
+
nextInputRef?: RefObject<TextInput | null>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const AppTextInput = ({
|
|
21
|
+
disabled,
|
|
22
|
+
label,
|
|
23
|
+
error,
|
|
24
|
+
style,
|
|
25
|
+
accessoryRight,
|
|
26
|
+
value,
|
|
27
|
+
isPassword,
|
|
28
|
+
onFocus,
|
|
29
|
+
onBlur,
|
|
30
|
+
ref,
|
|
31
|
+
nextInputRef,
|
|
32
|
+
onSubmitEditing,
|
|
33
|
+
returnKeyType,
|
|
34
|
+
placeholder,
|
|
35
|
+
...props
|
|
36
|
+
}: AppTextInputProps): ReactElement => {
|
|
37
|
+
appTextStyles.useVariants({ variant: 'bodyDefault' });
|
|
38
|
+
const isIos = Platform.OS === 'ios';
|
|
39
|
+
const inputRef = ref || useRef<TextInput>(null);
|
|
40
|
+
const labelWidth = useSharedValue(0);
|
|
41
|
+
|
|
42
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
43
|
+
const [isSecured, setIsSecured] = useState(true);
|
|
44
|
+
|
|
45
|
+
const isLabelFloated = (isFocused || !!value) && !!label;
|
|
46
|
+
|
|
47
|
+
const { labelAnimatedStyle } = useAnimatedLabel(isLabelFloated, labelWidth);
|
|
48
|
+
|
|
49
|
+
const handleOnFocus = (e: FocusEvent) => {
|
|
50
|
+
setIsFocused(true);
|
|
51
|
+
onFocus?.(e);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const handleBlur = (e: FocusEvent): void => {
|
|
55
|
+
setIsFocused(false);
|
|
56
|
+
onBlur?.(e);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const goToNextRef = (): void => nextInputRef?.current?.focus();
|
|
60
|
+
|
|
61
|
+
const handleInputPress = (): void => inputRef.current?.focus();
|
|
62
|
+
|
|
63
|
+
const accessoryRightComponent = isPassword ? (
|
|
64
|
+
<AppPressableIcon name={isSecured ? 'eye' : 'eyeOff'} onPress={() => setIsSecured(!isSecured)} />
|
|
65
|
+
) : (
|
|
66
|
+
accessoryRight
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<View style={styles.wrapper}>
|
|
71
|
+
<View style={inputStyles.container(isFocused, !!disabled, !!error)}>
|
|
72
|
+
<TouchableWithoutFeedback onPress={handleInputPress}>
|
|
73
|
+
<View style={commonStyle.fullFlex}>
|
|
74
|
+
{label && (
|
|
75
|
+
<Animated.View style={labelAnimatedStyle} pointerEvents='none'>
|
|
76
|
+
<AppText
|
|
77
|
+
variant='bodyDefault'
|
|
78
|
+
style={textStyles.label}
|
|
79
|
+
onLayout={(e) => {
|
|
80
|
+
labelWidth.value = e.nativeEvent.layout.width;
|
|
81
|
+
}}>
|
|
82
|
+
{label}
|
|
83
|
+
</AppText>
|
|
84
|
+
</Animated.View>
|
|
85
|
+
)}
|
|
86
|
+
<TextInput
|
|
87
|
+
ref={inputRef}
|
|
88
|
+
editable={!disabled}
|
|
89
|
+
value={value}
|
|
90
|
+
onFocus={handleOnFocus}
|
|
91
|
+
onBlur={handleBlur}
|
|
92
|
+
style={[appTextStyles.text, textStyles.input(!!disabled, isIos), inputStyles.input]}
|
|
93
|
+
cursorColor={colors.textPrimary}
|
|
94
|
+
selectionColor={colors.textPrimary}
|
|
95
|
+
hitSlop={{ top: 40 }}
|
|
96
|
+
secureTextEntry={isSecured && isPassword}
|
|
97
|
+
onSubmitEditing={nextInputRef ? goToNextRef : onSubmitEditing}
|
|
98
|
+
returnKeyType={nextInputRef ? 'next' : returnKeyType}
|
|
99
|
+
placeholder={label ? undefined : placeholder}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
</TouchableWithoutFeedback>
|
|
104
|
+
{accessoryRightComponent}
|
|
105
|
+
</View>
|
|
106
|
+
{error && (
|
|
107
|
+
<AppText variant='bodySmall' style={textStyles.error}>
|
|
108
|
+
{error}
|
|
109
|
+
</AppText>
|
|
110
|
+
)}
|
|
111
|
+
</View>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const styles = StyleSheet.create({
|
|
116
|
+
wrapper: {
|
|
117
|
+
gap: spacings.xs,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const inputStyles = StyleSheet.create(({ colors }) => ({
|
|
122
|
+
container: (focused: boolean, disabled: boolean, errored: boolean) => ({
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
gap: spacings.xs,
|
|
126
|
+
borderWidth: 1,
|
|
127
|
+
backgroundColor: disabled ? colors.backgroundPrimary : colors.backgroundSecondary,
|
|
128
|
+
borderColor: focused || disabled ? colors.textTertiary : errored ? colors.error : 'transparent',
|
|
129
|
+
borderRadius: spacings.md,
|
|
130
|
+
minHeight: 3.5 * rem,
|
|
131
|
+
paddingHorizontal: spacings.md,
|
|
132
|
+
paddingVertical: 0.375 * rem,
|
|
133
|
+
}),
|
|
134
|
+
input: {
|
|
135
|
+
padding: 0,
|
|
136
|
+
marginTop: 1.4375 * rem * 0.8,
|
|
137
|
+
flex: 1,
|
|
138
|
+
},
|
|
139
|
+
}));
|
|
140
|
+
|
|
141
|
+
const textStyles = StyleSheet.create(({ colors }) => ({
|
|
142
|
+
label: {
|
|
143
|
+
color: colors.textSecondary,
|
|
144
|
+
},
|
|
145
|
+
input: (disabled: boolean, isIos: boolean) => ({
|
|
146
|
+
color: disabled ? colors.textSecondary : colors.textPrimary,
|
|
147
|
+
lineHeight: isIos ? 0 : 1.4375 * rem,
|
|
148
|
+
// NOTE: Needs to fix Android spacings
|
|
149
|
+
// https://reactnative.dev/docs/text-style-props#includefontpadding-android
|
|
150
|
+
includeFontPadding: false,
|
|
151
|
+
textAlignVertical: 'center',
|
|
152
|
+
}),
|
|
153
|
+
error: {
|
|
154
|
+
color: colors.error,
|
|
155
|
+
},
|
|
156
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-animated-label';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { AnimatedStyle, SharedValue, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
3
|
+
|
|
4
|
+
interface UseAnimatedLabelResult {
|
|
5
|
+
labelAnimatedStyle: AnimatedStyle;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function useAnimatedLabel(isLabelFloated: boolean, labelWidth: SharedValue<number>): UseAnimatedLabelResult {
|
|
9
|
+
const labelTop = useSharedValue(8);
|
|
10
|
+
const labelScale = useSharedValue(1);
|
|
11
|
+
|
|
12
|
+
const labelAnimatedStyle = useAnimatedStyle(() => {
|
|
13
|
+
const scale = labelScale.value;
|
|
14
|
+
const width = labelWidth.value;
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
zIndex: 999,
|
|
19
|
+
top: labelTop.value,
|
|
20
|
+
transform: [{ translateX: -width / 2 }, { scale }, { translateX: width / 2 }],
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
labelTop.value = withTiming(isLabelFloated ? -2 : 8, { duration: 180 });
|
|
26
|
+
labelScale.value = withTiming(isLabelFloated ? 0.8 : 1, { duration: 180 });
|
|
27
|
+
}, [isLabelFloated]);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
labelAnimatedStyle,
|
|
31
|
+
};
|
|
32
|
+
}
|
package/src/shared/generators/ui-kit/lib-files/shared/ui/ui-kit/src/text-input/index.ts.template
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|