@spelyco/react-native 0.0.1-1d82fe58-alpha

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 ADDED
@@ -0,0 +1,74 @@
1
+ # @spelyco/react-native
2
+
3
+ React Native UI components for Spelyco mobile projects.
4
+
5
+ ---
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ bun add @spelyco/react-native @spelyco/react-lib react react-native
11
+ ```
12
+
13
+ ---
14
+
15
+ ## Components
16
+
17
+ ### `Button`
18
+
19
+ A basic button built on React Native's `Pressable`. Supports variants and sizes.
20
+
21
+ ```tsx
22
+ import { Button } from "@spelyco/react-native";
23
+
24
+ // Default
25
+ <Button label="Tap me" />
26
+
27
+ // Variants
28
+ <Button label="Primary" variant="primary" />
29
+ <Button label="Secondary" variant="secondary" />
30
+ <Button label="Ghost" variant="ghost" />
31
+
32
+ // Sizes
33
+ <Button label="Small" size="sm" />
34
+ <Button label="Large" size="lg" />
35
+
36
+ // Disabled
37
+ <Button label="Disabled" disabled />
38
+
39
+ // With onPress
40
+ <Button label="Save" onPress={() => console.log("saved")} />
41
+ ```
42
+
43
+ **Props:**
44
+
45
+ | Prop | Type | Default | Description |
46
+ | --- | --- | --- | --- |
47
+ | `label` | `string` | required | The button text |
48
+ | `variant` | `"primary" \| "secondary" \| "ghost"` | `"primary"` | Visual style |
49
+ | `size` | `"sm" \| "md" \| "lg"` | `"md"` | Padding size |
50
+ | `disabled` | `boolean` | `false` | Disable the button |
51
+ | `...rest` | `PressableProps` | — | Any React Native Pressable prop |
52
+
53
+ **Variants:**
54
+
55
+ | Variant | Background |
56
+ | --- | --- |
57
+ | `primary` | Indigo (`#6366f1`) |
58
+ | `secondary` | Light gray (`#e5e7eb`) |
59
+ | `ghost` | Transparent |
60
+
61
+ ---
62
+
63
+ ## Peer dependencies
64
+
65
+ | Package | Version |
66
+ | --- | --- |
67
+ | `react` | `>=18` |
68
+ | `react-native` | `>=0.73` |
69
+
70
+ ---
71
+
72
+ ## License
73
+
74
+ MIT
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { PressableProps } from 'react-native';
3
+
4
+ interface ButtonProps extends PressableProps {
5
+ variant?: "primary" | "secondary" | "ghost";
6
+ size?: "sm" | "md" | "lg";
7
+ label: string;
8
+ }
9
+ declare function Button({ variant, size, label, style, ...props }: ButtonProps): react.JSX.Element;
10
+
11
+ export { Button };
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { PressableProps } from 'react-native';
3
+
4
+ interface ButtonProps extends PressableProps {
5
+ variant?: "primary" | "secondary" | "ghost";
6
+ size?: "sm" | "md" | "lg";
7
+ label: string;
8
+ }
9
+ declare function Button({ variant, size, label, style, ...props }: ButtonProps): react.JSX.Element;
10
+
11
+ export { Button };
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var reactNative = require('react-native');
4
+
5
+ // src/components/Button/Button.tsx
6
+ function Button({ variant = "primary", size = "md", label, style, ...props }) {
7
+ return /* @__PURE__ */ React.createElement(reactNative.Pressable, { style: [styles.base, styles[variant], styles[size], style], ...props }, /* @__PURE__ */ React.createElement(reactNative.Text, { style: styles.label }, label));
8
+ }
9
+ var styles = reactNative.StyleSheet.create({
10
+ base: {
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ borderRadius: 8
14
+ },
15
+ label: {
16
+ fontWeight: "600"
17
+ },
18
+ primary: { backgroundColor: "#6366f1" },
19
+ secondary: { backgroundColor: "#e5e7eb" },
20
+ ghost: { backgroundColor: "transparent" },
21
+ sm: { paddingHorizontal: 12, paddingVertical: 6 },
22
+ md: { paddingHorizontal: 16, paddingVertical: 10 },
23
+ lg: { paddingHorizontal: 24, paddingVertical: 14 }
24
+ });
25
+
26
+ exports.Button = Button;
27
+ //# sourceMappingURL=index.js.map
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Button/Button.tsx"],"names":["Pressable","Text","StyleSheet"],"mappings":";;;;;AASO,SAAS,MAAA,CAAO,EAAE,OAAA,GAAU,SAAA,EAAW,IAAA,GAAO,MAAM,KAAA,EAAO,KAAA,EAAO,GAAG,KAAA,EAAM,EAAgB;AAChG,EAAA,uBACE,KAAA,CAAA,aAAA,CAACA,yBAAU,KAAA,EAAO,CAAC,OAAO,IAAA,EAAM,MAAA,CAAO,OAAO,CAAA,EAAG,MAAA,CAAO,IAAI,GAAG,KAAkB,CAAA,EAAI,GAAG,KAAA,EAAA,kBACtF,KAAA,CAAA,aAAA,CAACC,oBAAK,KAAA,EAAO,MAAA,CAAO,KAAA,EAAA,EAAQ,KAAM,CACpC,CAAA;AAEJ;AAEA,IAAM,MAAA,GAASC,uBAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB,QAAA;AAAA,IAChB,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACL,UAAA,EAAY;AAAA,GACd;AAAA,EACA,OAAA,EAAS,EAAE,eAAA,EAAiB,SAAA,EAAU;AAAA,EACtC,SAAA,EAAW,EAAE,eAAA,EAAiB,SAAA,EAAU;AAAA,EACxC,KAAA,EAAO,EAAE,eAAA,EAAiB,aAAA,EAAc;AAAA,EACxC,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,CAAA,EAAE;AAAA,EAChD,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,EAAA,EAAG;AAAA,EACjD,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,EAAA;AAChD,CAAC,CAAA","file":"index.js","sourcesContent":["import type { PressableProps, TextStyle, ViewStyle } from \"react-native\";\nimport { Pressable, StyleSheet, Text } from \"react-native\";\n\nexport interface ButtonProps extends PressableProps {\n variant?: \"primary\" | \"secondary\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n label: string;\n}\n\nexport function Button({ variant = \"primary\", size = \"md\", label, style, ...props }: ButtonProps) {\n return (\n <Pressable style={[styles.base, styles[variant], styles[size], style as ViewStyle]} {...props}>\n <Text style={styles.label}>{label}</Text>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n base: {\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 8,\n },\n label: {\n fontWeight: \"600\",\n } as TextStyle,\n primary: { backgroundColor: \"#6366f1\" } as ViewStyle,\n secondary: { backgroundColor: \"#e5e7eb\" } as ViewStyle,\n ghost: { backgroundColor: \"transparent\" } as ViewStyle,\n sm: { paddingHorizontal: 12, paddingVertical: 6 } as ViewStyle,\n md: { paddingHorizontal: 16, paddingVertical: 10 } as ViewStyle,\n lg: { paddingHorizontal: 24, paddingVertical: 14 } as ViewStyle,\n});\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,26 @@
1
+ import { StyleSheet, Pressable, Text } from 'react-native';
2
+
3
+ // src/components/Button/Button.tsx
4
+ function Button({ variant = "primary", size = "md", label, style, ...props }) {
5
+ return /* @__PURE__ */ React.createElement(Pressable, { style: [styles.base, styles[variant], styles[size], style], ...props }, /* @__PURE__ */ React.createElement(Text, { style: styles.label }, label));
6
+ }
7
+ var styles = StyleSheet.create({
8
+ base: {
9
+ alignItems: "center",
10
+ justifyContent: "center",
11
+ borderRadius: 8
12
+ },
13
+ label: {
14
+ fontWeight: "600"
15
+ },
16
+ primary: { backgroundColor: "#6366f1" },
17
+ secondary: { backgroundColor: "#e5e7eb" },
18
+ ghost: { backgroundColor: "transparent" },
19
+ sm: { paddingHorizontal: 12, paddingVertical: 6 },
20
+ md: { paddingHorizontal: 16, paddingVertical: 10 },
21
+ lg: { paddingHorizontal: 24, paddingVertical: 14 }
22
+ });
23
+
24
+ export { Button };
25
+ //# sourceMappingURL=index.mjs.map
26
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Button/Button.tsx"],"names":[],"mappings":";;;AASO,SAAS,MAAA,CAAO,EAAE,OAAA,GAAU,SAAA,EAAW,IAAA,GAAO,MAAM,KAAA,EAAO,KAAA,EAAO,GAAG,KAAA,EAAM,EAAgB;AAChG,EAAA,uBACE,KAAA,CAAA,aAAA,CAAC,aAAU,KAAA,EAAO,CAAC,OAAO,IAAA,EAAM,MAAA,CAAO,OAAO,CAAA,EAAG,MAAA,CAAO,IAAI,GAAG,KAAkB,CAAA,EAAI,GAAG,KAAA,EAAA,kBACtF,KAAA,CAAA,aAAA,CAAC,QAAK,KAAA,EAAO,MAAA,CAAO,KAAA,EAAA,EAAQ,KAAM,CACpC,CAAA;AAEJ;AAEA,IAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB,QAAA;AAAA,IAChB,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACL,UAAA,EAAY;AAAA,GACd;AAAA,EACA,OAAA,EAAS,EAAE,eAAA,EAAiB,SAAA,EAAU;AAAA,EACtC,SAAA,EAAW,EAAE,eAAA,EAAiB,SAAA,EAAU;AAAA,EACxC,KAAA,EAAO,EAAE,eAAA,EAAiB,aAAA,EAAc;AAAA,EACxC,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,CAAA,EAAE;AAAA,EAChD,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,EAAA,EAAG;AAAA,EACjD,EAAA,EAAI,EAAE,iBAAA,EAAmB,EAAA,EAAI,iBAAiB,EAAA;AAChD,CAAC,CAAA","file":"index.mjs","sourcesContent":["import type { PressableProps, TextStyle, ViewStyle } from \"react-native\";\nimport { Pressable, StyleSheet, Text } from \"react-native\";\n\nexport interface ButtonProps extends PressableProps {\n variant?: \"primary\" | \"secondary\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n label: string;\n}\n\nexport function Button({ variant = \"primary\", size = \"md\", label, style, ...props }: ButtonProps) {\n return (\n <Pressable style={[styles.base, styles[variant], styles[size], style as ViewStyle]} {...props}>\n <Text style={styles.label}>{label}</Text>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n base: {\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 8,\n },\n label: {\n fontWeight: \"600\",\n } as TextStyle,\n primary: { backgroundColor: \"#6366f1\" } as ViewStyle,\n secondary: { backgroundColor: \"#e5e7eb\" } as ViewStyle,\n ghost: { backgroundColor: \"transparent\" } as ViewStyle,\n sm: { paddingHorizontal: 12, paddingVertical: 6 } as ViewStyle,\n md: { paddingHorizontal: 16, paddingVertical: 10 } as ViewStyle,\n lg: { paddingHorizontal: 24, paddingVertical: 14 } as ViewStyle,\n});\n"]}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@spelyco/react-native",
3
+ "version": "0.0.1-1d82fe58-alpha",
4
+ "description": "React Native UI components for Spelyco",
5
+ "keywords": [
6
+ "react-native",
7
+ "ui",
8
+ "components",
9
+ "spelyco"
10
+ ],
11
+ "license": "MIT",
12
+ "main": "./dist/index.js",
13
+ "module": "./dist/index.mjs",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.mjs",
19
+ "require": "./dist/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "scripts": {
26
+ "build": "tsup",
27
+ "dev": "tsup --watch",
28
+ "lint": "biome check src/",
29
+ "lint:fix": "biome check --write src/",
30
+ "test": "vitest run --passWithNoTests",
31
+ "test:watch": "vitest",
32
+ "clean": "rm -rf dist"
33
+ },
34
+ "peerDependencies": {
35
+ "react": ">=18",
36
+ "react-native": ">=0.73"
37
+ },
38
+ "dependencies": {
39
+ "@spelyco/react-lib": "1.2.0"
40
+ },
41
+ "devDependencies": {
42
+ "@spelyco/tsconfig": "*",
43
+ "@types/react": "^19.2.14",
44
+ "react": "^19.2.4",
45
+ "react-native": "^0.84.1",
46
+ "tsup": "^8.3.5",
47
+ "vitest": "^4.1.1"
48
+ }
49
+ }