mi-ui-kit-publico 0.1.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 +20 -0
- package/README.md +104 -0
- package/lib/module/index.js +39 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/index.d.ts +9 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +160 -0
- package/src/index.tsx +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bryanmpwr-blip
|
|
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,104 @@
|
|
|
1
|
+
# mi-ui-kit-publico
|
|
2
|
+
|
|
3
|
+
Biblioteca de componentes UI reutilizables para React Native.
|
|
4
|
+
|
|
5
|
+
## Instalación
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install mi-ui-kit-publico
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
o con yarn:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
yarn add mi-ui-kit-publico
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Componentes
|
|
18
|
+
|
|
19
|
+
### MiBoton
|
|
20
|
+
|
|
21
|
+
Componente de botón personalizable con soporte para diferentes colores y estilos.
|
|
22
|
+
|
|
23
|
+
#### Uso Básico
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { MiBoton } from 'mi-ui-kit-publico';
|
|
27
|
+
|
|
28
|
+
function MiApp() {
|
|
29
|
+
return (
|
|
30
|
+
<MiBoton
|
|
31
|
+
titulo="Presióname"
|
|
32
|
+
onPress={() => console.log('Botón presionado')}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Ejemplos
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// Botón con color personalizado
|
|
42
|
+
<MiBoton
|
|
43
|
+
titulo="Guardar"
|
|
44
|
+
color="#4CAF50"
|
|
45
|
+
onPress={() => handleSave()}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
// Botón de peligro
|
|
49
|
+
<MiBoton
|
|
50
|
+
titulo="Eliminar"
|
|
51
|
+
color="#F44336"
|
|
52
|
+
onPress={() => handleDelete()}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
// Botón con estilos adicionales
|
|
56
|
+
<MiBoton
|
|
57
|
+
titulo="Acción"
|
|
58
|
+
color="#FF9800"
|
|
59
|
+
style={{ marginTop: 20 }}
|
|
60
|
+
onPress={() => handleAction()}
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Propiedades
|
|
65
|
+
|
|
66
|
+
| Prop | Tipo | Descripción | Por defecto | Requerido |
|
|
67
|
+
|------|------|-------------|-------------|-----------|
|
|
68
|
+
| `titulo` | `string` | Texto que se muestra en el botón | - | ✅ |
|
|
69
|
+
| `onPress` | `() => void` | Función que se ejecuta al presionar el botón | - | ✅ |
|
|
70
|
+
| `color` | `string` | Color de fondo del botón (hex, rgb, o nombre) | `#2196F3` | ❌ |
|
|
71
|
+
| `style` | `ViewStyle` | Estilos adicionales para el contenedor del botón | - | ❌ |
|
|
72
|
+
|
|
73
|
+
#### Características
|
|
74
|
+
|
|
75
|
+
- ✅ Color personalizable
|
|
76
|
+
- ✅ Padding y spacing consistentes
|
|
77
|
+
- ✅ Bordes redondeados (8px)
|
|
78
|
+
- ✅ Texto en negrita y blanco
|
|
79
|
+
- ✅ Compatible con iOS y Android
|
|
80
|
+
- ✅ TypeScript support
|
|
81
|
+
|
|
82
|
+
## Próximos Componentes
|
|
83
|
+
|
|
84
|
+
Estamos trabajando en agregar más componentes a esta biblioteca:
|
|
85
|
+
- Inputs de texto
|
|
86
|
+
- Cards
|
|
87
|
+
- Modales
|
|
88
|
+
- Y más...
|
|
89
|
+
|
|
90
|
+
## Contribuir
|
|
91
|
+
|
|
92
|
+
Las contribuciones son bienvenidas. Por favor lee:
|
|
93
|
+
- [Workflow de desarrollo](CONTRIBUTING.md#development-workflow)
|
|
94
|
+
- [Enviar un pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
95
|
+
- [Código de conducta](CODE_OF_CONDUCT.md)
|
|
96
|
+
|
|
97
|
+
## Licencia
|
|
98
|
+
|
|
99
|
+
MIT
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
Hecho con ❤️ usando [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
104
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// Definimos qué propiedades acepta nuestro botón
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function MiBoton({
|
|
8
|
+
titulo,
|
|
9
|
+
onPress,
|
|
10
|
+
color = '#2196F3',
|
|
11
|
+
style
|
|
12
|
+
}) {
|
|
13
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
14
|
+
style: [styles.boton, {
|
|
15
|
+
backgroundColor: color
|
|
16
|
+
}, style],
|
|
17
|
+
onPress: onPress,
|
|
18
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
19
|
+
style: styles.texto,
|
|
20
|
+
children: titulo
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
boton: {
|
|
26
|
+
paddingVertical: 12,
|
|
27
|
+
paddingHorizontal: 24,
|
|
28
|
+
borderRadius: 8,
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
marginVertical: 10
|
|
32
|
+
},
|
|
33
|
+
texto: {
|
|
34
|
+
color: 'white',
|
|
35
|
+
fontSize: 16,
|
|
36
|
+
fontWeight: 'bold'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TouchableOpacity","Text","StyleSheet","jsx","_jsx","MiBoton","titulo","onPress","color","style","styles","boton","backgroundColor","children","texto","create","paddingVertical","paddingHorizontal","borderRadius","alignItems","justifyContent","marginVertical","fontSize","fontWeight"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;;AAGjE;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAQA,OAAO,SAASC,OAAOA,CAAC;EAAEC,MAAM;EAAEC,OAAO;EAAEC,KAAK,GAAG,SAAS;EAAEC;AAAoB,CAAC,EAAE;EACnF,oBACEL,IAAA,CAACJ,gBAAgB;IACfS,KAAK,EAAE,CAACC,MAAM,CAACC,KAAK,EAAE;MAAEC,eAAe,EAAEJ;IAAM,CAAC,EAAEC,KAAK,CAAE;IACzDF,OAAO,EAAEA,OAAQ;IAAAM,QAAA,eAEjBT,IAAA,CAACH,IAAI;MAACQ,KAAK,EAAEC,MAAM,CAACI,KAAM;MAAAD,QAAA,EAAEP;IAAM,CAAO;EAAC,CAC1B,CAAC;AAEvB;AAEA,MAAMI,MAAM,GAAGR,UAAU,CAACa,MAAM,CAAC;EAC/BJ,KAAK,EAAE;IACLK,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE,CAAC;IACfC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,cAAc,EAAE;EAClB,CAAC;EACDP,KAAK,EAAE;IACLN,KAAK,EAAE,OAAO;IACdc,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
export interface MiBotonProps {
|
|
3
|
+
titulo: string;
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
color?: string;
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
}
|
|
8
|
+
export declare function MiBoton({ titulo, onPress, color, style }: MiBotonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAiB,EAAE,KAAK,EAAE,EAAE,YAAY,2CASlF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mi-ui-kit-publico",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Mis componentes compartidos",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
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 mi-ui-kit-publico-example",
|
|
36
|
+
"clean": "del-cli lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"release": "release-it --only-version"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react-native",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/bryanmpwr-blip/mi-ui-kit-publico.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "bryanmpwr-blip <bryan.mpwr@gmail.com> (https://github.com/bryanmpwr-blip)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/bryanmpwr-blip/mi-ui-kit-publico/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/bryanmpwr-blip/mi-ui-kit-publico#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
63
|
+
"@eslint/compat": "^1.3.2",
|
|
64
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
65
|
+
"@eslint/js": "^9.35.0",
|
|
66
|
+
"@react-native/babel-preset": "0.83.0",
|
|
67
|
+
"@react-native/eslint-config": "0.83.0",
|
|
68
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
69
|
+
"@types/jest": "^29.5.14",
|
|
70
|
+
"@types/react": "^19.1.12",
|
|
71
|
+
"commitlint": "^19.8.1",
|
|
72
|
+
"del-cli": "^6.0.0",
|
|
73
|
+
"eslint": "^9.35.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.8",
|
|
75
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"lefthook": "^2.0.3",
|
|
78
|
+
"prettier": "^2.8.8",
|
|
79
|
+
"react": "19.1.0",
|
|
80
|
+
"react-native": "0.81.5",
|
|
81
|
+
"react-native-builder-bob": "^0.40.17",
|
|
82
|
+
"release-it": "^19.0.4",
|
|
83
|
+
"typescript": "^5.9.2"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"react": "*",
|
|
87
|
+
"react-native": "*"
|
|
88
|
+
},
|
|
89
|
+
"workspaces": [
|
|
90
|
+
"example"
|
|
91
|
+
],
|
|
92
|
+
"packageManager": "yarn@4.11.0",
|
|
93
|
+
"react-native-builder-bob": {
|
|
94
|
+
"source": "src",
|
|
95
|
+
"output": "lib",
|
|
96
|
+
"targets": [
|
|
97
|
+
[
|
|
98
|
+
"module",
|
|
99
|
+
{
|
|
100
|
+
"esm": true
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"typescript",
|
|
105
|
+
{
|
|
106
|
+
"project": "tsconfig.build.json"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"prettier": {
|
|
112
|
+
"quoteProps": "consistent",
|
|
113
|
+
"singleQuote": true,
|
|
114
|
+
"tabWidth": 2,
|
|
115
|
+
"trailingComma": "es5",
|
|
116
|
+
"useTabs": false
|
|
117
|
+
},
|
|
118
|
+
"jest": {
|
|
119
|
+
"preset": "react-native",
|
|
120
|
+
"modulePathIgnorePatterns": [
|
|
121
|
+
"<rootDir>/example/node_modules",
|
|
122
|
+
"<rootDir>/lib/"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"commitlint": {
|
|
126
|
+
"extends": [
|
|
127
|
+
"@commitlint/config-conventional"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"release-it": {
|
|
131
|
+
"git": {
|
|
132
|
+
"commitMessage": "chore: release ${version}",
|
|
133
|
+
"tagName": "v${version}"
|
|
134
|
+
},
|
|
135
|
+
"npm": {
|
|
136
|
+
"publish": true
|
|
137
|
+
},
|
|
138
|
+
"github": {
|
|
139
|
+
"release": true
|
|
140
|
+
},
|
|
141
|
+
"plugins": {
|
|
142
|
+
"@release-it/conventional-changelog": {
|
|
143
|
+
"preset": {
|
|
144
|
+
"name": "angular"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"create-react-native-library": {
|
|
150
|
+
"type": "library",
|
|
151
|
+
"languages": "js",
|
|
152
|
+
"tools": [
|
|
153
|
+
"eslint",
|
|
154
|
+
"jest",
|
|
155
|
+
"lefthook",
|
|
156
|
+
"release-it"
|
|
157
|
+
],
|
|
158
|
+
"version": "0.56.0"
|
|
159
|
+
}
|
|
160
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
2
|
+
import type { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// Definimos qué propiedades acepta nuestro botón
|
|
5
|
+
export interface MiBotonProps {
|
|
6
|
+
titulo: string;
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
color?: string;
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function MiBoton({ titulo, onPress, color = '#2196F3', style }: MiBotonProps) {
|
|
13
|
+
return (
|
|
14
|
+
<TouchableOpacity
|
|
15
|
+
style={[styles.boton, { backgroundColor: color }, style]}
|
|
16
|
+
onPress={onPress}
|
|
17
|
+
>
|
|
18
|
+
<Text style={styles.texto}>{titulo}</Text>
|
|
19
|
+
</TouchableOpacity>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
boton: {
|
|
25
|
+
paddingVertical: 12,
|
|
26
|
+
paddingHorizontal: 24,
|
|
27
|
+
borderRadius: 8,
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
marginVertical: 10,
|
|
31
|
+
},
|
|
32
|
+
texto: {
|
|
33
|
+
color: 'white',
|
|
34
|
+
fontSize: 16,
|
|
35
|
+
fontWeight: 'bold',
|
|
36
|
+
},
|
|
37
|
+
});
|