corekit-ui 0.1.5 → 0.1.8
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 +1 -1
- package/README.md +8 -8
- package/package.json +120 -132
- package/dist/index.d.ts +0 -119
- package/dist/index.js +0 -922
- package/dist/index.js.map +0 -1
- package/dist/index.umd.cjs +0 -3
- package/dist/index.umd.cjs.map +0 -1
- package/dist/vite.svg +0 -1
package/LICENSE
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
```text
|
|
6
6
|
MIT License
|
|
7
7
|
|
|
8
|
-
Copyright (c)
|
|
8
|
+
Copyright (c) 2026 PC Soluciones en epidemiología y salud ocupacional
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# PC Soluciones – React Library Lab
|
|
2
2
|
|
|
3
|
-
[]()
|
|
4
|
+
[![Storybook deploy]()
|
|
5
5
|
[](#licencia)
|
|
6
6
|
|
|
7
|
-
>
|
|
8
|
-
> Este proyecto sirve
|
|
7
|
+
> Repositorio para crear y validar una **librería de componentes React** de PC Soluciones en epidemiología y salud ocupacional.
|
|
8
|
+
> Este proyecto sirve para testear funcionalidades, procesos de build/release, documentación y calidad, mientras se prueba y define estándares.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
## Demo & Docs
|
|
13
13
|
|
|
14
14
|
- **Storybook (docs y ejemplos):**
|
|
15
|
-
https
|
|
15
|
+
https://<>.github.io/<>/
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
- ⚡ **Vite** + **pnpm** → desarrollo y builds rápidos.
|
|
22
22
|
- 🧩 **TypeScript** + **React 18/19** → DX moderna.
|
|
23
23
|
- 🧪 **Vitest** + **Testing Library** → tests unitarios y de componentes.
|
|
24
|
-
- 🎨 **CSS Modules
|
|
24
|
+
- 🎨 **CSS Modules**.
|
|
25
25
|
- 📚 **Storybook** → documentación interactiva de componentes.
|
|
26
26
|
- ✅ **ESLint** + **Stylelint** + **Prettier** → estilo consistente y chequeos automáticos.
|
|
27
27
|
- 🧰 **Husky + lint-staged** → calidad antes de cada commit.
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
## Objetivos
|
|
32
|
+
## Objetivos de corekit-ui
|
|
33
33
|
|
|
34
|
-
1. Definir **estándares** de código, estilos y testing para la
|
|
34
|
+
1. Definir **estándares** de código, estilos y testing para la librería de PC.
|
|
35
35
|
2. Probar el **ciclo de vida completo**: scaffold → dev → test → docs → build → publish.
|
|
36
36
|
3. Medir y ajustar **ergonomía DX** (scripts, tareas de VS Code, hooks, etc).
|
|
37
37
|
4. Asegurar **tree-shaking** y empaquetado correcto para consumidores (apps web, microfronts, etc).
|
package/package.json
CHANGED
|
@@ -1,132 +1,120 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "corekit-ui",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"eslint
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"test:sb": "vitest --browser",
|
|
122
|
-
"test:sb:ci": "vitest run --browser --reporter=dot",
|
|
123
|
-
"test:ci": "npm-run-all2 -s test:unit:ci test:sb:ci",
|
|
124
|
-
"preview": "vite preview",
|
|
125
|
-
"start:docs": "storybook dev -p 6006",
|
|
126
|
-
"build:docs": "storybook build",
|
|
127
|
-
"generate:component": "npx generate-react-cli component",
|
|
128
|
-
"check": "npm-run-all2 -s lint:code lint:style lint:types test:ci",
|
|
129
|
-
"format:all": "npm-run-all2 -s format fix:style fix:code",
|
|
130
|
-
"lint-staged": "lint-staged"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "corekit-ui",
|
|
3
|
+
"description": "CoreKit UI Component Library - Enterprise Grade",
|
|
4
|
+
"version": "0.1.8",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"homepage": "https://corekit-ui.yoursite.com",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"main": "./dist/index.umd.cjs",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"**/*.css"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.umd.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite --port 3000",
|
|
29
|
+
"build": "vite build",
|
|
30
|
+
"preview": "vite preview",
|
|
31
|
+
"storybook": "storybook dev -p 6006",
|
|
32
|
+
"build:storybook": "storybook build",
|
|
33
|
+
"lint": "eslint . --fix",
|
|
34
|
+
"lint:css": "stylelint \"src/**/*.{css,scss}\" --fix",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"format": "prettier --write .",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"test:ui": "vitest --ui",
|
|
40
|
+
"test:coverage": "vitest run --coverage",
|
|
41
|
+
"check": "npm run typecheck && npm run lint && npm run lint:css && npm run test",
|
|
42
|
+
"prepare": "is-ci || husky",
|
|
43
|
+
"gen": "plop"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
47
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@floating-ui/react": "^0.27.16",
|
|
51
|
+
"@tanstack/react-router": "^1.139.7",
|
|
52
|
+
"@tanstack/react-table": "^8.21.3",
|
|
53
|
+
"@tanstack/react-virtual": "^3.13.12",
|
|
54
|
+
"@uidotdev/usehooks": "^2.4.1",
|
|
55
|
+
"class-variance-authority": "^0.7.1",
|
|
56
|
+
"clsx": "^2.1.1",
|
|
57
|
+
"nanoid": "^5.1.6",
|
|
58
|
+
"zustand": "^5.0.1"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@eslint/js": "^9.14.0",
|
|
62
|
+
"@storybook/addon-a11y": "^8.6.0",
|
|
63
|
+
"@storybook/addon-docs": "^8.6.0",
|
|
64
|
+
"@storybook/addon-essentials": "^8.6.0",
|
|
65
|
+
"@storybook/addon-interactions": "^8.6.0",
|
|
66
|
+
"@storybook/addon-themes": "^8.6.0",
|
|
67
|
+
"@storybook/blocks": "^8.6.0",
|
|
68
|
+
"@storybook/react": "^8.6.0",
|
|
69
|
+
"@storybook/react-vite": "^8.6.0",
|
|
70
|
+
"@storybook/test": "^8.6.0",
|
|
71
|
+
"@testing-library/dom": "^10.4.0",
|
|
72
|
+
"@testing-library/jest-dom": "^6.6.0",
|
|
73
|
+
"@testing-library/react": "^16.1.0",
|
|
74
|
+
"@types/react": "^19.0.0",
|
|
75
|
+
"@types/react-dom": "^19.0.0",
|
|
76
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
77
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
78
|
+
"@vitest/ui": "^2.1.8",
|
|
79
|
+
"eslint": "^9.17.0",
|
|
80
|
+
"eslint-config-prettier": "^9.1.0",
|
|
81
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
82
|
+
"eslint-plugin-import": "^2.31.0",
|
|
83
|
+
"eslint-plugin-react": "^7.37.2",
|
|
84
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
85
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
86
|
+
"globals": "^15.14.0",
|
|
87
|
+
"husky": "^9.1.7",
|
|
88
|
+
"is-ci": "^3.0.1",
|
|
89
|
+
"jsdom": "^25.0.1",
|
|
90
|
+
"lint-staged": "^15.3.0",
|
|
91
|
+
"plop": "^4.0.1",
|
|
92
|
+
"postcss": "^8.4.49",
|
|
93
|
+
"postcss-preset-env": "^10.1.1",
|
|
94
|
+
"prettier": "^3.4.2",
|
|
95
|
+
"react": "^19.0.0",
|
|
96
|
+
"react-dom": "^19.0.0",
|
|
97
|
+
"storybook": "^8.6.0",
|
|
98
|
+
"stylelint": "^16.12.0",
|
|
99
|
+
"stylelint-config-standard": "^36.0.1",
|
|
100
|
+
"stylelint-order": "^6.0.4",
|
|
101
|
+
"typescript": "^5.9.3",
|
|
102
|
+
"typescript-eslint": "^8.18.0",
|
|
103
|
+
"vite": "^6.0.3",
|
|
104
|
+
"vite-plugin-dts": "^4.3.0",
|
|
105
|
+
"vitest": "^2.1.8"
|
|
106
|
+
},
|
|
107
|
+
"lint-staged": {
|
|
108
|
+
"*.{js,jsx,ts,tsx}": [
|
|
109
|
+
"eslint --fix",
|
|
110
|
+
"prettier --write"
|
|
111
|
+
],
|
|
112
|
+
"*.{css,scss}": [
|
|
113
|
+
"stylelint --fix",
|
|
114
|
+
"prettier --write"
|
|
115
|
+
],
|
|
116
|
+
"*.{json,md,mdx,html,yml,yaml}": [
|
|
117
|
+
"prettier --write"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
import { RefAttributes } from 'react';
|
|
5
|
-
|
|
6
|
-
export declare const Boton: ForwardRefExoticComponent< {
|
|
7
|
-
variant?: Variant;
|
|
8
|
-
color?: Color;
|
|
9
|
-
size?: Size;
|
|
10
|
-
radius?: Radius;
|
|
11
|
-
fullWidth?: boolean;
|
|
12
|
-
isLoading?: boolean;
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
isIconOnly?: boolean;
|
|
15
|
-
startContent?: ReactNode;
|
|
16
|
-
endContent?: ReactNode;
|
|
17
|
-
spinner?: ReactNode;
|
|
18
|
-
spinnerPlacement?: SpinnerPlacement;
|
|
19
|
-
disableRipple?: boolean;
|
|
20
|
-
disableAnimation?: boolean;
|
|
21
|
-
} & ButtonHTMLAttributes<HTMLButtonElement> & RefAttributes<HTMLButtonElement>>;
|
|
22
|
-
|
|
23
|
-
declare type Color = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
24
|
-
|
|
25
|
-
declare type Color_2 = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* FirmaManual - Componente para capturar una firma a mano o subir una imagen
|
|
29
|
-
*
|
|
30
|
-
* Props principales:
|
|
31
|
-
* - `isOpen`: control booleano para abrir/ cerrar
|
|
32
|
-
* - `onClose`: callback cuando el modal se cierra
|
|
33
|
-
* - `onConfirm`: callback con data URL PNG al guardar
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export declare const FirmaManual: ForwardRefExoticComponent<Props & RefAttributes<FirmaManualRef>>;
|
|
37
|
-
|
|
38
|
-
declare type FirmaManualRef = {
|
|
39
|
-
/** Limpia el canvas (borrar todo) */
|
|
40
|
-
limpiar: () => void;
|
|
41
|
-
/** Obtiene la firma como data URL (PNG), o null si no hay firma */
|
|
42
|
-
obtenerDatosFirma: () => string | null;
|
|
43
|
-
/** Devuelve si el canvas está vacío */
|
|
44
|
-
estaVacio: () => boolean;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
declare type Props = {
|
|
48
|
-
isOpen?: boolean;
|
|
49
|
-
onClose?: () => void;
|
|
50
|
-
onConfirm?: (signatureData: string) => void;
|
|
51
|
-
titulo?: string;
|
|
52
|
-
textoGuardar?: string;
|
|
53
|
-
textoModificar?: string;
|
|
54
|
-
textoDeshacer?: string;
|
|
55
|
-
textoLimpiar?: string;
|
|
56
|
-
textoAdjuntar?: string;
|
|
57
|
-
ancho?: number;
|
|
58
|
-
alto?: number;
|
|
59
|
-
className?: string;
|
|
60
|
-
textoConsentimiento?: string;
|
|
61
|
-
mostrarBotonSubir?: boolean;
|
|
62
|
-
cerrarAlGuardar?: boolean;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
declare type Radius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
66
|
-
|
|
67
|
-
declare type ResultadoValidacion = {
|
|
68
|
-
invalido: boolean;
|
|
69
|
-
mensaje?: string | null;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
declare type Size = 'sm' | 'md' | 'lg';
|
|
73
|
-
|
|
74
|
-
declare type SpinnerPlacement = 'start' | 'end';
|
|
75
|
-
|
|
76
|
-
export declare const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
77
|
-
|
|
78
|
-
declare type TextAreaProps = {
|
|
79
|
-
children?: ReactNode;
|
|
80
|
-
variant?: Variante;
|
|
81
|
-
color?: Color_2;
|
|
82
|
-
size?: 'sm' | 'md' | 'lg';
|
|
83
|
-
radius?: 'none' | 'sm' | 'md' | 'lg';
|
|
84
|
-
label?: ReactNode;
|
|
85
|
-
labelPlacement?: 'inside' | 'outside';
|
|
86
|
-
fullWidth?: boolean;
|
|
87
|
-
value?: string;
|
|
88
|
-
defaultValue?: string;
|
|
89
|
-
placeholder?: string;
|
|
90
|
-
startContent?: ReactNode;
|
|
91
|
-
endContent?: ReactNode;
|
|
92
|
-
isRequired?: boolean;
|
|
93
|
-
isReadOnly?: boolean;
|
|
94
|
-
isDisabled?: boolean;
|
|
95
|
-
isClearable?: boolean;
|
|
96
|
-
isInvalid?: boolean;
|
|
97
|
-
validationState?: 'valid' | 'invalid';
|
|
98
|
-
description?: ReactNode;
|
|
99
|
-
errorMessage?: ReactNode | ((v: ResultadoValidacion) => ReactNode);
|
|
100
|
-
validate?: (value: string) => string | {
|
|
101
|
-
message?: string;
|
|
102
|
-
} | true | null | undefined;
|
|
103
|
-
minRows?: number;
|
|
104
|
-
maxRows?: number;
|
|
105
|
-
disableAutosize?: boolean;
|
|
106
|
-
disableAnimation?: boolean;
|
|
107
|
-
classNames?: Partial<Record<'base' | 'label' | 'inputWrapper' | 'headerWrapper' | 'innerWrapper' | 'input' | 'description' | 'errorMessage', string>>;
|
|
108
|
-
id?: string;
|
|
109
|
-
name?: string;
|
|
110
|
-
rows?: number;
|
|
111
|
-
onChange?: (value: string) => void;
|
|
112
|
-
onClear?: () => void;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
declare type Variant = 'solid' | 'bordered' | 'light' | 'faded' | 'ghost' | 'shadow';
|
|
116
|
-
|
|
117
|
-
declare type Variante = 'flat' | 'bordered' | 'faded' | 'underlined' | 'light' | 'normal';
|
|
118
|
-
|
|
119
|
-
export { }
|