@compsych-ui-components/react-native 3.2.5 → 4.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compsych-ui-components/react-native",
3
- "version": "3.2.5",
3
+ "version": "4.0.4",
4
4
  "description": "React Native UI components for compsych",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -18,5 +18,6 @@
18
18
  "@compsych-ui-components/shared": "*",
19
19
  "react": ">=18.0.0",
20
20
  "react-native": ">=0.73.0"
21
- }
22
- }
21
+ },
22
+ "type": "commonjs"
23
+ }
@@ -1,2 +1,2 @@
1
- export { Button } from './lib/button';
2
- export type { ButtonProps } from './lib/button';
1
+ export { Button } from './lib/button';
2
+ export type { ButtonProps } from './lib/button';
package/src/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Button", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _button.Button;
9
+ }
10
+ });
11
+ const _button = require("./lib/button");
12
+
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../packages/react-native/src/index.ts"],"sourcesContent":["export { Button } from './lib/button';\r\nexport type { ButtonProps } from './lib/button';\r\n"],"names":["Button"],"mappings":";;;;+BAASA;;;eAAAA,cAAM;;;wBAAQ"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface ButtonProps {
3
+ label?: string;
4
+ alertMessage?: string;
5
+ onPress?: () => void;
6
+ }
7
+ export declare function Button({ label, alertMessage, onPress, }: ButtonProps): React.JSX.Element;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Button", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return Button;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
+ const _reactnative = require("react-native");
14
+ const _shared = require("@compsych-ui-components/shared");
15
+ function _interop_require_default(obj) {
16
+ return obj && obj.__esModule ? obj : {
17
+ default: obj
18
+ };
19
+ }
20
+ function Button({ label = 'Click me', alertMessage = 'Hello from @compsych/react-native!', onPress }) {
21
+ const handlePress = ()=>{
22
+ if (onPress) {
23
+ onPress();
24
+ } else {
25
+ (0, _shared.showAlert)(alertMessage);
26
+ }
27
+ };
28
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactnative.Pressable, {
29
+ style: ({ pressed })=>[
30
+ styles.button,
31
+ pressed && styles.pressed
32
+ ],
33
+ onPress: handlePress,
34
+ accessibilityRole: "button",
35
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactnative.Text, {
36
+ style: styles.label,
37
+ children: label
38
+ })
39
+ });
40
+ }
41
+ const styles = _reactnative.StyleSheet.create({
42
+ button: {
43
+ paddingVertical: 8,
44
+ paddingHorizontal: 16,
45
+ backgroundColor: '#1976d2',
46
+ borderRadius: 4,
47
+ alignItems: 'center'
48
+ },
49
+ pressed: {
50
+ backgroundColor: '#1565c0'
51
+ },
52
+ label: {
53
+ color: '#ffffff',
54
+ fontSize: 14
55
+ }
56
+ });
57
+
58
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../packages/react-native/src/lib/button.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Pressable, StyleSheet, Text } from 'react-native';\r\nimport { showAlert } from '@compsych-ui-components/shared';\r\n\r\nexport interface ButtonProps {\r\n label?: string;\r\n alertMessage?: string;\r\n onPress?: () => void;\r\n}\r\n\r\nexport function Button({\r\n label = 'Click me',\r\n alertMessage = 'Hello from @compsych/react-native!',\r\n onPress,\r\n}: ButtonProps) {\r\n const handlePress = () => {\r\n if (onPress) {\r\n onPress();\r\n } else {\r\n showAlert(alertMessage);\r\n }\r\n };\r\n\r\n return (\r\n <Pressable\r\n style={({ pressed }) => [styles.button, pressed && styles.pressed]}\r\n onPress={handlePress}\r\n accessibilityRole=\"button\"\r\n >\r\n <Text style={styles.label}>{label}</Text>\r\n </Pressable>\r\n );\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n button: {\r\n paddingVertical: 8,\r\n paddingHorizontal: 16,\r\n backgroundColor: '#1976d2',\r\n borderRadius: 4,\r\n alignItems: 'center',\r\n },\r\n pressed: {\r\n backgroundColor: '#1565c0',\r\n },\r\n label: {\r\n color: '#ffffff',\r\n fontSize: 14,\r\n },\r\n});\r\n"],"names":["Button","label","alertMessage","onPress","handlePress","showAlert","Pressable","style","pressed","styles","button","accessibilityRole","Text","StyleSheet","create","paddingVertical","paddingHorizontal","backgroundColor","borderRadius","alignItems","color","fontSize"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;8DAVE;6BAC0B;wBAClB;;;;;;AAQnB,SAASA,OAAO,EACrBC,QAAQ,UAAU,EAClBC,eAAe,oCAAoC,EACnDC,OAAO,EACK;IACZ,MAAMC,cAAc;QAClB,IAAID,SAAS;YACXA;QACF,OAAO;YACLE,IAAAA,iBAAS,EAACH;QACZ;IACF;IAEA,qBACE,qBAACI,sBAAS;QACRC,OAAO,CAAC,EAAEC,OAAO,EAAE,GAAK;gBAACC,OAAOC,MAAM;gBAAEF,WAAWC,OAAOD,OAAO;aAAC;QAClEL,SAASC;QACTO,mBAAkB;kBAElB,cAAA,qBAACC,iBAAI;YAACL,OAAOE,OAAOR,KAAK;sBAAGA;;;AAGlC;AAEA,MAAMQ,SAASI,uBAAU,CAACC,MAAM,CAAC;IAC/BJ,QAAQ;QACNK,iBAAiB;QACjBC,mBAAmB;QACnBC,iBAAiB;QACjBC,cAAc;QACdC,YAAY;IACd;IACAX,SAAS;QACPS,iBAAiB;IACnB;IACAhB,OAAO;QACLmB,OAAO;QACPC,UAAU;IACZ;AACF"}
package/.gitkeep DELETED
File without changes
package/.swcrc DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "jsc": {
3
- "target": "es2022",
4
- "parser": {
5
- "syntax": "typescript",
6
- "tsx": true,
7
- "decorators": false,
8
- "dynamicImport": true
9
- },
10
- "transform": {
11
- "react": {
12
- "runtime": "automatic"
13
- }
14
- }
15
- },
16
- "module": {
17
- "type": "nodenext"
18
- },
19
- "sourceMaps": true,
20
- "exclude": [".*\\.spec\\.tsx?$"]
21
- }
package/project.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "name": "react-native",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/react-native/src",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "executor": "@nx/js:swc",
9
- "outputs": ["{options.outputPath}"],
10
- "options": {
11
- "outputPath": "dist/packages/react-native",
12
- "main": "packages/react-native/src/index.ts",
13
- "tsConfig": "packages/react-native/tsconfig.lib.json"
14
- },
15
- "dependsOn": ["^build"]
16
- }
17
- },
18
- "implicitDependencies": ["shared"]
19
- }
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { Pressable, StyleSheet, Text } from 'react-native';
3
- import { showAlert } from '@compsych/shared';
4
-
5
- export interface ButtonProps {
6
- label?: string;
7
- alertMessage?: string;
8
- onPress?: () => void;
9
- }
10
-
11
- export function Button({
12
- label = 'Click me',
13
- alertMessage = 'Hello from @compsych/react-native!',
14
- onPress,
15
- }: ButtonProps) {
16
- const handlePress = () => {
17
- if (onPress) {
18
- onPress();
19
- } else {
20
- showAlert(alertMessage);
21
- }
22
- };
23
-
24
- return (
25
- <Pressable
26
- style={({ pressed }) => [styles.button, pressed && styles.pressed]}
27
- onPress={handlePress}
28
- accessibilityRole="button"
29
- >
30
- <Text style={styles.label}>{label}</Text>
31
- </Pressable>
32
- );
33
- }
34
-
35
- const styles = StyleSheet.create({
36
- button: {
37
- paddingVertical: 8,
38
- paddingHorizontal: 16,
39
- backgroundColor: '#1976d2',
40
- borderRadius: 4,
41
- alignItems: 'center',
42
- },
43
- pressed: {
44
- backgroundColor: '#1565c0',
45
- },
46
- label: {
47
- color: '#ffffff',
48
- fontSize: 14,
49
- },
50
- });
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "declarationDir": "../../dist/out-tsc",
6
- "jsx": "react-native",
7
- "moduleResolution": "node"
8
- },
9
- "include": ["src/**/*.ts", "src/**/*.tsx"]
10
- }
package/tsconfig.lib.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "types": []
6
- },
7
- "exclude": ["**/*.spec.ts", "**/*.spec.tsx"]
8
- }