@onpe/ui 1.2.47 → 1.2.48

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.
Files changed (40) hide show
  1. package/dist/icons/ONPE/IconPersonOnpe/IconPersonOnpe.d.ts +3 -0
  2. package/dist/icons/ONPE/IconPersonOnpe/index.d.ts +2 -0
  3. package/dist/icons/ONPE/index.d.ts +1 -0
  4. package/dist/icons.d.ts +3 -1
  5. package/dist/icons.esm.js +23 -1
  6. package/dist/icons.js +23 -1
  7. package/dist/index.d.ts +3 -74
  8. package/dist/index.esm.js +23 -209
  9. package/dist/index.js +23 -209
  10. package/package.json +3 -20
  11. package/dist/cli.d.ts +0 -3
  12. package/dist/cli.esm.js +0 -6560
  13. package/dist/cli.js +0 -6560
  14. package/dist/commands/add.d.ts +0 -2
  15. package/dist/commands/createBarrelFiles.d.ts +0 -10
  16. package/dist/components/ErrorHandling/BrowserIncompatible/BrowserIncompatible.d.ts +0 -8
  17. package/dist/components/ErrorHandling/BrowserIncompatible/index.d.ts +0 -3
  18. package/dist/hooks/index.d.ts +0 -5
  19. package/dist/hooks/useDebounce.d.ts +0 -8
  20. package/dist/hooks/useLocalStorage.d.ts +0 -8
  21. package/dist/hooks/useOnpeClasses.d.ts +0 -156
  22. package/dist/hooks/useToggle/index.d.ts +0 -2
  23. package/dist/hooks/useToggle/useToggle.d.ts +0 -2
  24. package/dist/hooks.d.ts +0 -17
  25. package/dist/hooks.esm.js +0 -55
  26. package/dist/hooks.js +0 -55
  27. package/dist/icons/ONPE/ElectionsIcon/ElectionsIcon.d.ts +0 -3
  28. package/dist/icons/ONPE/ElectionsIcon/index.d.ts +0 -2
  29. package/dist/lib/api.d.ts +0 -20
  30. package/dist/lib/index.d.ts +0 -3
  31. package/dist/lib/storage.d.ts +0 -22
  32. package/dist/lib.d.ts +0 -43
  33. package/dist/lib.esm.js +0 -176
  34. package/dist/lib.js +0 -176
  35. package/dist/utils/formatDate.d.ts +0 -8
  36. package/dist/utils/index.d.ts +0 -3
  37. package/dist/utils/validateEmail.d.ts +0 -13
  38. package/dist/utils.d.ts +0 -16
  39. package/dist/utils.esm.js +0 -45
  40. package/dist/utils.js +0 -45
package/dist/lib.js DELETED
@@ -1,176 +0,0 @@
1
- /******************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16
-
17
-
18
- function __awaiter(thisArg, _arguments, P, generator) {
19
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20
- return new (P || (P = Promise))(function (resolve, reject) {
21
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
22
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
23
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
24
- step((generator = generator.apply(thisArg, _arguments || [])).next());
25
- });
26
- }
27
-
28
- function __generator(thisArg, body) {
29
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
30
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
31
- function verb(n) { return function (v) { return step([n, v]); }; }
32
- function step(op) {
33
- if (f) throw new TypeError("Generator is already executing.");
34
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
35
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
36
- if (y = 0, t) op = [op[0] & 2, t.value];
37
- switch (op[0]) {
38
- case 0: case 1: t = op; break;
39
- case 4: _.label++; return { value: op[1], done: false };
40
- case 5: _.label++; y = op[1]; op = [0]; continue;
41
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
42
- default:
43
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
44
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
45
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
46
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
47
- if (t[2]) _.ops.pop();
48
- _.trys.pop(); continue;
49
- }
50
- op = body.call(thisArg, _);
51
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
52
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
53
- }
54
- }
55
-
56
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
57
- var e = new Error(message);
58
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
59
- };
60
-
61
- /**
62
- * Cliente API simple para ONPE
63
- */
64
- var APIClient = /** @class */ (function () {
65
- function APIClient(baseURL) {
66
- if (baseURL === void 0) { baseURL = ""; }
67
- this.baseURL = baseURL;
68
- }
69
- /**
70
- * Realiza una petición GET
71
- */
72
- APIClient.prototype.get = function (endpoint) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var response;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4 /*yield*/, fetch("".concat(this.baseURL).concat(endpoint))];
78
- case 1:
79
- response = _a.sent();
80
- if (!response.ok) {
81
- throw new Error("HTTP error! status: ".concat(response.status));
82
- }
83
- return [2 /*return*/, response.json()];
84
- }
85
- });
86
- });
87
- };
88
- /**
89
- * Realiza una petición POST
90
- */
91
- APIClient.prototype.post = function (endpoint, data) {
92
- return __awaiter(this, void 0, void 0, function () {
93
- var response;
94
- return __generator(this, function (_a) {
95
- switch (_a.label) {
96
- case 0: return [4 /*yield*/, fetch("".concat(this.baseURL).concat(endpoint), {
97
- method: "POST",
98
- headers: {
99
- "Content-Type": "application/json",
100
- },
101
- body: JSON.stringify(data),
102
- })];
103
- case 1:
104
- response = _a.sent();
105
- if (!response.ok) {
106
- throw new Error("HTTP error! status: ".concat(response.status));
107
- }
108
- return [2 /*return*/, response.json()];
109
- }
110
- });
111
- });
112
- };
113
- return APIClient;
114
- }());
115
- /**
116
- * Instancia por defecto del cliente API
117
- */
118
- var apiClient = new APIClient();
119
-
120
- /**
121
- * Utilidades para manejo de almacenamiento
122
- */
123
- var StorageManager = /** @class */ (function () {
124
- function StorageManager() {
125
- }
126
- /**
127
- * Guarda un valor en localStorage
128
- */
129
- StorageManager.setItem = function (key, value) {
130
- try {
131
- localStorage.setItem(key, JSON.stringify(value));
132
- }
133
- catch (error) {
134
- console.error("Error saving to localStorage:", error);
135
- }
136
- };
137
- /**
138
- * Obtiene un valor de localStorage
139
- */
140
- StorageManager.getItem = function (key, defaultValue) {
141
- try {
142
- var item = localStorage.getItem(key);
143
- return item ? JSON.parse(item) : defaultValue || null;
144
- }
145
- catch (error) {
146
- console.error("Error reading from localStorage:", error);
147
- return defaultValue || null;
148
- }
149
- };
150
- /**
151
- * Elimina un valor de localStorage
152
- */
153
- StorageManager.removeItem = function (key) {
154
- try {
155
- localStorage.removeItem(key);
156
- }
157
- catch (error) {
158
- console.error("Error removing from localStorage:", error);
159
- }
160
- };
161
- /**
162
- * Limpia todo el localStorage
163
- */
164
- StorageManager.clear = function () {
165
- try {
166
- localStorage.clear();
167
- }
168
- catch (error) {
169
- console.error("Error clearing localStorage:", error);
170
- }
171
- };
172
- return StorageManager;
173
- }());
174
-
175
- export { APIClient, StorageManager, apiClient };
176
- //# sourceMappingURL=lib.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Formatea una fecha según el formato especificado
3
- * @param date - Fecha a formatear
4
- * @param format - Formato deseado ('short', 'long', 'time')
5
- * @returns Fecha formateada
6
- */
7
- export declare function formatDate(date: Date | string, format?: "short" | "long" | "time"): string;
8
- //# sourceMappingURL=formatDate.d.ts.map
@@ -1,3 +0,0 @@
1
- export { formatDate } from "./formatDate";
2
- export { validateEmail, validateDNI } from "./validateEmail";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,13 +0,0 @@
1
- /**
2
- * Valida si un email tiene formato válido
3
- * @param email - Email a validar
4
- * @returns true si es válido, false si no
5
- */
6
- export declare function validateEmail(email: string): boolean;
7
- /**
8
- * Valida si un DNI peruano es válido
9
- * @param dni - DNI a validar
10
- * @returns true si es válido, false si no
11
- */
12
- export declare function validateDNI(dni: string): boolean;
13
- //# sourceMappingURL=validateEmail.d.ts.map
package/dist/utils.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Formatea una fecha según el formato especificado
3
- * @param date - Fecha a formatear
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 };
package/dist/utils.esm.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Formatea una fecha según el formato especificado
3
- * @param date - Fecha a formatear
4
- * @param format - Formato deseado ('short', 'long', 'time')
5
- * @returns Fecha formateada
6
- */
7
- function formatDate(date, format) {
8
- if (format === void 0) { format = "short"; }
9
- var dateObj = typeof date === "string" ? new Date(date) : date;
10
- if (isNaN(dateObj.getTime())) {
11
- return "Fecha inválida";
12
- }
13
- var options = {
14
- short: {
15
- year: "numeric",
16
- month: "2-digit",
17
- day: "2-digit",
18
- },
19
- long: {
20
- year: "numeric",
21
- month: "long",
22
- day: "numeric",
23
- weekday: "long",
24
- },
25
- time: {
26
- hour: "2-digit",
27
- minute: "2-digit",
28
- second: "2-digit",
29
- },
30
- }[format];
31
- return new Intl.DateTimeFormat("es-PE", options).format(dateObj);
32
- }
33
-
34
- /**
35
- * Valida si un email tiene formato válido
36
- * @param email - Email a validar
37
- * @returns true si es válido, false si no
38
- */
39
- function validateEmail(email) {
40
- var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
41
- return emailRegex.test(email);
42
- }
43
-
44
- export { formatDate, validateEmail };
45
- //# sourceMappingURL=utils.esm.js.map
package/dist/utils.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Formatea una fecha según el formato especificado
3
- * @param date - Fecha a formatear
4
- * @param format - Formato deseado ('short', 'long', 'time')
5
- * @returns Fecha formateada
6
- */
7
- function formatDate(date, format) {
8
- if (format === void 0) { format = "short"; }
9
- var dateObj = typeof date === "string" ? new Date(date) : date;
10
- if (isNaN(dateObj.getTime())) {
11
- return "Fecha inválida";
12
- }
13
- var options = {
14
- short: {
15
- year: "numeric",
16
- month: "2-digit",
17
- day: "2-digit",
18
- },
19
- long: {
20
- year: "numeric",
21
- month: "long",
22
- day: "numeric",
23
- weekday: "long",
24
- },
25
- time: {
26
- hour: "2-digit",
27
- minute: "2-digit",
28
- second: "2-digit",
29
- },
30
- }[format];
31
- return new Intl.DateTimeFormat("es-PE", options).format(dateObj);
32
- }
33
-
34
- /**
35
- * Valida si un email tiene formato válido
36
- * @param email - Email a validar
37
- * @returns true si es válido, false si no
38
- */
39
- function validateEmail(email) {
40
- var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
41
- return emailRegex.test(email);
42
- }
43
-
44
- export { formatDate, validateEmail };
45
- //# sourceMappingURL=utils.js.map