@onpe/ui 1.2.11 → 1.2.13
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/dist/cli.d.ts +2 -0
- package/dist/components.d.ts +19 -3
- package/dist/components.js +98 -270
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useOnpeClasses.d.ts +156 -0
- package/dist/hooks.d.ts +3 -17
- package/dist/icons/Actions/IconClose/IconClose.d.ts +1 -0
- package/dist/index.css +338 -1
- package/dist/index.d.ts +7 -195
- package/dist/lib.d.ts +3 -43
- package/dist/utils.d.ts +3 -16
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,195 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
size?: "small" | "normal" | "large";
|
|
9
|
-
}
|
|
10
|
-
declare const Button: ({ color, title, size, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
interface PortalProps {
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
container?: Element | DocumentFragment | null;
|
|
15
|
-
}
|
|
16
|
-
declare const Portal: ({ children, container }: PortalProps) => react.ReactPortal | null;
|
|
17
|
-
|
|
18
|
-
interface ShowProps {
|
|
19
|
-
condition: boolean;
|
|
20
|
-
loadingComponent: ReactNode;
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}
|
|
23
|
-
declare const Show: ({ condition, loadingComponent, children }: ShowProps) => react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
interface OverlayProps {
|
|
26
|
-
show?: boolean;
|
|
27
|
-
onClick?: () => void;
|
|
28
|
-
color?: "blue" | "skyblue" | "skyblue-light" | "yellow" | "light-skyblue" | "gray" | "gray-light" | "gray-extra-light" | "red" | "dark-gray" | "green" | "yellow-light" | "primary";
|
|
29
|
-
}
|
|
30
|
-
declare const Overlay: ({ show, onClick, color }: OverlayProps) => react_jsx_runtime.JSX.Element;
|
|
31
|
-
|
|
32
|
-
interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
-
isOpen: boolean;
|
|
34
|
-
onClose: () => void;
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
whitoutBackground?: boolean;
|
|
37
|
-
topAbsolute?: boolean;
|
|
38
|
-
closeButton?: boolean;
|
|
39
|
-
closeDisabled?: boolean;
|
|
40
|
-
overlayColor?: "blue" | "skyblue" | "skyblue-light" | "yellow" | "light-skyblue" | "gray" | "gray-light" | "gray-extra-light" | "red" | "dark-gray" | "green" | "yellow-light" | "primary";
|
|
41
|
-
}
|
|
42
|
-
declare const Modal: ({ isOpen, onClose, children, whitoutBackground, topAbsolute, closeButton, closeDisabled, overlayColor, ...props }: ModalProps) => react_jsx_runtime.JSX.Element;
|
|
43
|
-
|
|
44
|
-
interface ModalBrowserIncompatibleProps {
|
|
45
|
-
isOpen: boolean;
|
|
46
|
-
onClose: () => void;
|
|
47
|
-
className?: string;
|
|
48
|
-
}
|
|
49
|
-
declare const ModalBrowserIncompatible: ({ isOpen, onClose, className }: ModalBrowserIncompatibleProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
-
|
|
51
|
-
interface ModalConfirmProps {
|
|
52
|
-
isOpen: boolean;
|
|
53
|
-
onClose: () => void;
|
|
54
|
-
title: string;
|
|
55
|
-
message: string;
|
|
56
|
-
icon?: "warning" | "success";
|
|
57
|
-
onConfirm?: () => void;
|
|
58
|
-
onCancel?: () => void;
|
|
59
|
-
textButtonConfirm?: string;
|
|
60
|
-
textButtonCancel?: string;
|
|
61
|
-
twoButtons?: boolean;
|
|
62
|
-
className?: string;
|
|
63
|
-
}
|
|
64
|
-
declare const ModalConfirm: ({ isOpen, onClose, title, message, icon, onConfirm, onCancel, textButtonConfirm, textButtonCancel, twoButtons, className, }: ModalConfirmProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
-
|
|
66
|
-
interface ModalLoadingProps {
|
|
67
|
-
isOpen: boolean;
|
|
68
|
-
onClose?: () => void;
|
|
69
|
-
message?: string;
|
|
70
|
-
className?: string;
|
|
71
|
-
}
|
|
72
|
-
declare const ModalLoading: ({ isOpen, onClose, message, className }: ModalLoadingProps) => react_jsx_runtime.JSX.Element;
|
|
73
|
-
|
|
74
|
-
interface ModalSystemIncompatibleProps {
|
|
75
|
-
isOpen: boolean;
|
|
76
|
-
onClose: () => void;
|
|
77
|
-
className?: string;
|
|
78
|
-
}
|
|
79
|
-
declare const ModalSystemIncompatible: ({ isOpen, onClose, className }: ModalSystemIncompatibleProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Hook para debounce de valores
|
|
83
|
-
* @param value - Valor a debounce
|
|
84
|
-
* @param delay - Delay en milisegundos
|
|
85
|
-
* @returns Valor debounced
|
|
86
|
-
*/
|
|
87
|
-
declare function useDebounce<T>(value: T, delay: number): T;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Hook personalizado para manejar localStorage
|
|
91
|
-
* @param key - Clave del localStorage
|
|
92
|
-
* @param initialValue - Valor inicial
|
|
93
|
-
* @returns [value, setValue] - Valor actual y función para actualizarlo
|
|
94
|
-
*/
|
|
95
|
-
declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Formatea una fecha según el formato especificado
|
|
99
|
-
* @param date - Fecha a formatear
|
|
100
|
-
* @param format - Formato deseado ('short', 'long', 'time')
|
|
101
|
-
* @returns Fecha formateada
|
|
102
|
-
*/
|
|
103
|
-
declare function formatDate(date: Date | string, format?: "short" | "long" | "time"): string;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Valida si un email tiene formato válido
|
|
107
|
-
* @param email - Email a validar
|
|
108
|
-
* @returns true si es válido, false si no
|
|
109
|
-
*/
|
|
110
|
-
declare function validateEmail(email: string): boolean;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Cliente API simple para ONPE
|
|
114
|
-
*/
|
|
115
|
-
declare class APIClient {
|
|
116
|
-
private baseURL;
|
|
117
|
-
constructor(baseURL?: string);
|
|
118
|
-
/**
|
|
119
|
-
* Realiza una petición GET
|
|
120
|
-
*/
|
|
121
|
-
get<T>(endpoint: string): Promise<T>;
|
|
122
|
-
/**
|
|
123
|
-
* Realiza una petición POST
|
|
124
|
-
*/
|
|
125
|
-
post<T>(endpoint: string, data: any): Promise<T>;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Instancia por defecto del cliente API
|
|
129
|
-
*/
|
|
130
|
-
declare const apiClient: APIClient;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Utilidades para manejo de almacenamiento
|
|
134
|
-
*/
|
|
135
|
-
declare class StorageManager {
|
|
136
|
-
/**
|
|
137
|
-
* Guarda un valor en localStorage
|
|
138
|
-
*/
|
|
139
|
-
static setItem(key: string, value: any): void;
|
|
140
|
-
/**
|
|
141
|
-
* Obtiene un valor de localStorage
|
|
142
|
-
*/
|
|
143
|
-
static getItem<T>(key: string, defaultValue?: T): T | null;
|
|
144
|
-
/**
|
|
145
|
-
* Elimina un valor de localStorage
|
|
146
|
-
*/
|
|
147
|
-
static removeItem(key: string): void;
|
|
148
|
-
/**
|
|
149
|
-
* Limpia todo el localStorage
|
|
150
|
-
*/
|
|
151
|
-
static clear(): void;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
declare const IconClose: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
155
|
-
|
|
156
|
-
declare const IconWarning: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
157
|
-
|
|
158
|
-
declare const IconCheck: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
159
|
-
|
|
160
|
-
declare const IconSpinnerDesktop: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
161
|
-
|
|
162
|
-
declare const IconSpinnerMobile: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
163
|
-
|
|
164
|
-
declare const IconInfo: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
165
|
-
|
|
166
|
-
declare const IconChromeColor: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
167
|
-
|
|
168
|
-
declare const IconChrome: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
169
|
-
|
|
170
|
-
declare const IconSafariColor: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
171
|
-
|
|
172
|
-
declare const IconSafari: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
173
|
-
|
|
174
|
-
declare const IconMozillaColor: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
175
|
-
|
|
176
|
-
declare const IconMozilla: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
177
|
-
|
|
178
|
-
declare const IconEdgeColor: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
179
|
-
|
|
180
|
-
declare const IconEdge: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
181
|
-
|
|
182
|
-
declare const IconWindow: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
183
|
-
|
|
184
|
-
declare const IconAndroid: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
185
|
-
|
|
186
|
-
declare const IconApple: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
187
|
-
|
|
188
|
-
declare const IconVotoDigital: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
189
|
-
|
|
190
|
-
declare const IconElectionsGeneral: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
191
|
-
|
|
192
|
-
declare const ElectionsIcon: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
193
|
-
|
|
194
|
-
export { APIClient, Button, ElectionsIcon, IconAndroid, IconApple, IconCheck, IconChrome, IconChromeColor, IconClose, IconEdge, IconEdgeColor, IconElectionsGeneral, IconInfo, IconMozilla, IconMozillaColor, IconSafari, IconSafariColor, IconSpinnerDesktop, IconSpinnerMobile, IconVotoDigital, IconWarning, IconWindow, Modal, ModalBrowserIncompatible, ModalConfirm, ModalLoading, ModalSystemIncompatible, Overlay, Portal, Show, StorageManager, apiClient, formatDate, useDebounce, useLocalStorage, validateEmail };
|
|
195
|
-
export type { ButtonProps, ModalBrowserIncompatibleProps, ModalConfirmProps, ModalLoadingProps, ModalProps, ModalSystemIncompatibleProps, OverlayProps, PortalProps, ShowProps };
|
|
1
|
+
export * from "./components";
|
|
2
|
+
export * from "./hooks";
|
|
3
|
+
export * from "./utils";
|
|
4
|
+
export * from "./lib";
|
|
5
|
+
export * from "./icons";
|
|
6
|
+
import "./styles.css";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
declare class APIClient {
|
|
5
|
-
private baseURL;
|
|
6
|
-
constructor(baseURL?: string);
|
|
7
|
-
/**
|
|
8
|
-
* Realiza una petición GET
|
|
9
|
-
*/
|
|
10
|
-
get<T>(endpoint: string): Promise<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Realiza una petición POST
|
|
13
|
-
*/
|
|
14
|
-
post<T>(endpoint: string, data: any): Promise<T>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Instancia por defecto del cliente API
|
|
18
|
-
*/
|
|
19
|
-
declare const apiClient: APIClient;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Utilidades para manejo de almacenamiento
|
|
23
|
-
*/
|
|
24
|
-
declare class StorageManager {
|
|
25
|
-
/**
|
|
26
|
-
* Guarda un valor en localStorage
|
|
27
|
-
*/
|
|
28
|
-
static setItem(key: string, value: any): void;
|
|
29
|
-
/**
|
|
30
|
-
* Obtiene un valor de localStorage
|
|
31
|
-
*/
|
|
32
|
-
static getItem<T>(key: string, defaultValue?: T): T | null;
|
|
33
|
-
/**
|
|
34
|
-
* Elimina un valor de localStorage
|
|
35
|
-
*/
|
|
36
|
-
static removeItem(key: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Limpia todo el localStorage
|
|
39
|
-
*/
|
|
40
|
-
static clear(): void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { APIClient, StorageManager, apiClient };
|
|
1
|
+
export * from "./lib/api";
|
|
2
|
+
export * from "./lib/storage";
|
|
3
|
+
//# sourceMappingURL=lib.d.ts.map
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @param format - Formato deseado ('short', 'long', 'time')
|
|
5
|
-
* @returns Fecha formateada
|
|
6
|
-
*/
|
|
7
|
-
declare function formatDate(date: Date | string, format?: "short" | "long" | "time"): string;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Valida si un email tiene formato válido
|
|
11
|
-
* @param email - Email a validar
|
|
12
|
-
* @returns true si es válido, false si no
|
|
13
|
-
*/
|
|
14
|
-
declare function validateEmail(email: string): boolean;
|
|
15
|
-
|
|
16
|
-
export { formatDate, validateEmail };
|
|
1
|
+
export { formatDate } from "./utils/formatDate";
|
|
2
|
+
export { validateEmail } from "./utils/validateEmail";
|
|
3
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onpe/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Librería completa de UI para ONPE - Componentes, Hooks, Utils y Librerías",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dev": "storybook dev -p 6006",
|
|
51
51
|
"build": "npm run build:css:prod && rollup -c",
|
|
52
52
|
"build:css": "node scripts/build-css.js",
|
|
53
|
-
"build:css:prod": "node scripts/build-css-
|
|
53
|
+
"build:css:prod": "node scripts/build-css-clean.js",
|
|
54
54
|
"publish": "npm publish",
|
|
55
55
|
"test": "jest",
|
|
56
56
|
"lint": "eslint src --ext .ts,.tsx",
|