react-native-shared-components 0.2.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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ndd2509
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ <<<<<<< HEAD
2
+ # shared-components
3
+ shared-components
4
+ =======
5
+ # react-native-shared-components
6
+
7
+ shared-components
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ npm install react-native-shared-components
13
+ ```
14
+
15
+ ## Usage
16
+
17
+
18
+ ```js
19
+ import { multiply } from 'react-native-shared-components';
20
+
21
+ // ...
22
+
23
+ const result = await multiply(3, 7);
24
+ ```
25
+
26
+
27
+ ## Contributing
28
+
29
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
30
+
31
+ ## License
32
+
33
+ MIT
34
+
35
+ ---
36
+
37
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
38
+ >>>>>>> 0b1af12 (chore: initial commit)
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ import { Text, TouchableOpacity } from 'react-native';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export const Button = ({
6
+ onPress,
7
+ title,
8
+ textBtnStyles
9
+ }) => {
10
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
11
+ onPress: onPress,
12
+ children: /*#__PURE__*/_jsx(Text, {
13
+ style: {
14
+ // color: typography?.['Text_text-primary_(700)'] ?? 'white',
15
+ // fontSize: typography?.text1_fontSize ?? 15,
16
+ // fontWeight: typography?.text1_fontWeight ?? '600',
17
+ // lineHeight: typography?.text1_lineHeight ?? 18,
18
+ ...textBtnStyles
19
+ },
20
+ children: title
21
+ })
22
+ });
23
+ };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Text","TouchableOpacity","jsx","_jsx","Button","onPress","title","textBtnStyles","children","style"],"sourceRoot":"../../../../src","sources":["components/Button/index.tsx"],"mappings":";;AAAA,SACEA,IAAI,EACJC,gBAAgB,QAIX,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAStB,OAAO,MAAMC,MAAM,GAAGA,CAAC;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAuB,CAAC,KAAK;EACpE,oBACEJ,IAAA,CAACF,gBAAgB;IAACI,OAAO,EAAEA,OAAQ;IAAAG,QAAA,eACjCL,IAAA,CAACH,IAAI;MACHS,KAAK,EAAE;QACL;QACA;QACA;QACA;QACA,GAAGF;MACL,CAAE;MAAAC,QAAA,EAEDF;IAAK,CACF;EAAC,CACS,CAAC;AAEvB,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from "./Button/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.tsx"],"mappings":";;AAAA,cAAc,mBAAU","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export function multiply(a, b) {
4
+ return a * b;
5
+ }
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["multiply","a","b"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAO,SAASA,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOD,CAAC,GAAGC,CAAC;AACd","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,11 @@
1
+ import { type GestureResponderEvent, type TextStyle, type ViewStyle } from 'react-native';
2
+ export interface IButton {
3
+ title: string;
4
+ buttonStyles?: ViewStyle;
5
+ textBtnStyles?: TextStyle;
6
+ isLoading?: boolean;
7
+ onPress?: (e: GestureResponderEvent) => void;
8
+ type?: 'primary' | 'secondary';
9
+ }
10
+ export declare const Button: ({ onPress, title, textBtnStyles }: IButton) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CAChC;AACD,eAAO,MAAM,MAAM,GAAI,mCAAmC,OAAO,4CAgBhE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Button';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function multiply(a: number, b: number): number;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
package/package.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "react-native-shared-components",
3
+ "version": "0.2.0",
4
+ "description": "shared-components",
5
+ "source": "./src/index.tsx",
6
+ "main": "./lib/module/index.js",
7
+ "types": "./lib/typescript/src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-shared-components-example",
36
+ "test": "jest",
37
+ "typecheck": "tsc",
38
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
+ "clean": "del-cli lib",
40
+ "prepare": "bob build",
41
+ "release": "release-it"
42
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/ndd2509/react-native-shared-components.git"
51
+ },
52
+ "author": "ndd2509 <dinhdung250998@gmail.com> (https://github.com/ndd2509)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/ndd2509/react-native-shared-components/issues"
56
+ },
57
+ "homepage": "https://github.com/ndd2509/react-native-shared-components#readme",
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/config-conventional": "^19.6.0",
63
+ "@eslint/compat": "^1.2.7",
64
+ "@eslint/eslintrc": "^3.3.0",
65
+ "@eslint/js": "^9.22.0",
66
+ "@evilmartians/lefthook": "^1.5.0",
67
+ "@react-native/eslint-config": "^0.78.0",
68
+ "@release-it/conventional-changelog": "^9.0.2",
69
+ "@types/jest": "^29.5.5",
70
+ "@types/react": "^19.0.12",
71
+ "commitlint": "^19.6.1",
72
+ "del-cli": "^5.1.0",
73
+ "eslint": "^9.22.0",
74
+ "eslint-config-prettier": "^10.1.1",
75
+ "eslint-plugin-prettier": "^5.2.3",
76
+ "jest": "^29.7.0",
77
+ "prettier": "^3.0.3",
78
+ "react": "18.3.1",
79
+ "react-native": "0.76.9",
80
+ "react-native-builder-bob": "^0.40.6",
81
+ "release-it": "^17.10.0",
82
+ "typescript": "^5.2.2"
83
+ },
84
+ "peerDependencies": {
85
+ "react": "*",
86
+ "react-native": "*"
87
+ },
88
+ "workspaces": [
89
+ "example"
90
+ ],
91
+ "packageManager": "yarn@3.6.1",
92
+ "jest": {
93
+ "preset": "react-native",
94
+ "modulePathIgnorePatterns": [
95
+ "<rootDir>/example/node_modules",
96
+ "<rootDir>/lib/"
97
+ ]
98
+ },
99
+ "commitlint": {
100
+ "extends": [
101
+ "@commitlint/config-conventional"
102
+ ]
103
+ },
104
+ "release-it": {
105
+ "git": {
106
+ "commitMessage": "chore: release ${version}",
107
+ "tagName": "v${version}"
108
+ },
109
+ "npm": {
110
+ "publish": true
111
+ },
112
+ "github": {
113
+ "release": true
114
+ },
115
+ "plugins": {
116
+ "@release-it/conventional-changelog": {
117
+ "preset": {
118
+ "name": "angular"
119
+ }
120
+ }
121
+ }
122
+ },
123
+ "prettier": {
124
+ "quoteProps": "consistent",
125
+ "singleQuote": true,
126
+ "tabWidth": 2,
127
+ "trailingComma": "es5",
128
+ "useTabs": false
129
+ },
130
+ "react-native-builder-bob": {
131
+ "source": "src",
132
+ "output": "lib",
133
+ "targets": [
134
+ [
135
+ "module",
136
+ {
137
+ "esm": true
138
+ }
139
+ ],
140
+ [
141
+ "typescript",
142
+ {
143
+ "project": "tsconfig.build.json"
144
+ }
145
+ ]
146
+ ]
147
+ },
148
+ "create-react-native-library": {
149
+ "languages": "js",
150
+ "type": "library",
151
+ "version": "0.49.8"
152
+ }
153
+ }
@@ -0,0 +1,32 @@
1
+ import {
2
+ Text,
3
+ TouchableOpacity,
4
+ type GestureResponderEvent,
5
+ type TextStyle,
6
+ type ViewStyle,
7
+ } from 'react-native';
8
+ export interface IButton {
9
+ title: string;
10
+ buttonStyles?: ViewStyle;
11
+ textBtnStyles?: TextStyle;
12
+ isLoading?: boolean;
13
+ onPress?: (e: GestureResponderEvent) => void;
14
+ type?: 'primary' | 'secondary';
15
+ }
16
+ export const Button = ({ onPress, title, textBtnStyles }: IButton) => {
17
+ return (
18
+ <TouchableOpacity onPress={onPress}>
19
+ <Text
20
+ style={{
21
+ // color: typography?.['Text_text-primary_(700)'] ?? 'white',
22
+ // fontSize: typography?.text1_fontSize ?? 15,
23
+ // fontWeight: typography?.text1_fontWeight ?? '600',
24
+ // lineHeight: typography?.text1_lineHeight ?? 18,
25
+ ...textBtnStyles,
26
+ }}
27
+ >
28
+ {title}
29
+ </Text>
30
+ </TouchableOpacity>
31
+ );
32
+ };
@@ -0,0 +1 @@
1
+ export * from './Button';
package/src/index.tsx ADDED
@@ -0,0 +1,3 @@
1
+ export function multiply(a: number, b: number): number {
2
+ return a * b;
3
+ }