@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
@@ -1,2 +0,0 @@
1
- export declare function addComponent(componentName: string): Promise<void>;
2
- //# sourceMappingURL=add.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Crea archivos de barril (barrel exports) para simplificar las importaciones
3
- * Solo crea las carpetas y archivos que realmente existen
4
- */
5
- export declare function createBarrelFiles(): Promise<void>;
6
- /**
7
- * Crea archivos de barril solo para una carpeta específica
8
- */
9
- export declare function createBarrelForFolder(folderPath: string): Promise<void>;
10
- //# sourceMappingURL=createBarrelFiles.d.ts.map
@@ -1,8 +0,0 @@
1
- export interface BrowserIncompatibleProps {
2
- isOpen: boolean;
3
- onClose: () => void;
4
- className?: string;
5
- }
6
- export declare const BrowserIncompatible: ({ isOpen, onClose, className }: BrowserIncompatibleProps) => import("react/jsx-runtime").JSX.Element;
7
- export default BrowserIncompatible;
8
- //# sourceMappingURL=BrowserIncompatible.d.ts.map
@@ -1,3 +0,0 @@
1
- export { BrowserIncompatible } from "./BrowserIncompatible";
2
- export type { BrowserIncompatibleProps } from "./BrowserIncompatible";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
1
- export { useLocalStorage } from "./useLocalStorage";
2
- export { useDebounce } from "./useDebounce";
3
- export { useToggle } from "./useToggle";
4
- export { useOnpeClasses } from "./useOnpeClasses";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Hook para debounce de valores
3
- * @param value - Valor a debounce
4
- * @param delay - Delay en milisegundos
5
- * @returns Valor debounced
6
- */
7
- export declare function useDebounce<T>(value: T, delay: number): T;
8
- //# sourceMappingURL=useDebounce.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Hook personalizado para manejar localStorage
3
- * @param key - Clave del localStorage
4
- * @param initialValue - Valor inicial
5
- * @returns [value, setValue] - Valor actual y función para actualizarlo
6
- */
7
- export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
8
- //# sourceMappingURL=useLocalStorage.d.ts.map
@@ -1,156 +0,0 @@
1
- /**
2
- * Hook para generar clases de Tailwind con prefijo 'onpe-' de manera consistente
3
- * Esto evita conflictos con otros frameworks CSS como Material UI o Shadcn
4
- */
5
- export declare const useOnpeClasses: () => {
6
- onpe: {
7
- container: string;
8
- flex: string;
9
- "flex-col": string;
10
- "flex-row": string;
11
- "justify-center": string;
12
- "justify-start": string;
13
- "justify-end": string;
14
- "justify-between": string;
15
- "items-center": string;
16
- "items-start": string;
17
- "items-end": string;
18
- "items-stretch": string;
19
- "p-0": string;
20
- "p-1": string;
21
- "p-2": string;
22
- "p-3": string;
23
- "p-4": string;
24
- "p-5": string;
25
- "p-6": string;
26
- "px-2": string;
27
- "px-3": string;
28
- "px-4": string;
29
- "px-5": string;
30
- "px-6": string;
31
- "py-2": string;
32
- "py-3": string;
33
- "py-4": string;
34
- "py-5": string;
35
- "py-6": string;
36
- "m-0": string;
37
- "m-1": string;
38
- "m-2": string;
39
- "m-3": string;
40
- "m-4": string;
41
- "m-5": string;
42
- "m-6": string;
43
- "mx-auto": string;
44
- "my-auto": string;
45
- "w-full": string;
46
- "w-auto": string;
47
- "w-fit": string;
48
- "h-full": string;
49
- "h-auto": string;
50
- "h-fit": string;
51
- "h-10": string;
52
- "h-12": string;
53
- "h-14": string;
54
- "min-w-[200px]": string;
55
- "max-w-full": string;
56
- "max-w-sm": string;
57
- "max-w-md": string;
58
- "max-w-lg": string;
59
- "max-w-xl": string;
60
- "max-w-2xl": string;
61
- "text-xs": string;
62
- "text-sm": string;
63
- "text-base": string;
64
- "text-lg": string;
65
- "text-xl": string;
66
- "text-2xl": string;
67
- "text-3xl": string;
68
- "font-normal": string;
69
- "font-medium": string;
70
- "font-semibold": string;
71
- "font-bold": string;
72
- "text-center": string;
73
- "text-left": string;
74
- "text-right": string;
75
- "text-white": string;
76
- "text-black": string;
77
- "bg-onpe-ui-blue": string;
78
- "bg-onpe-ui-skyblue": string;
79
- "bg-onpe-ui-skyblue-light": string;
80
- "bg-onpe-ui-yellow": string;
81
- "bg-onpe-ui-light-skyblue": string;
82
- "bg-onpe-ui-gray": string;
83
- "bg-onpe-ui-gray-light": string;
84
- "bg-onpe-ui-gray-extra-light": string;
85
- "bg-onpe-ui-red": string;
86
- "bg-onpe-ui-dark-gray": string;
87
- "bg-onpe-ui-green": string;
88
- "bg-onpe-ui-yellow-light": string;
89
- "text-onpe-ui-blue": string;
90
- "text-onpe-ui-skyblue": string;
91
- "text-onpe-ui-skyblue-light": string;
92
- "text-onpe-ui-yellow": string;
93
- "text-onpe-ui-light-skyblue": string;
94
- "text-onpe-ui-gray": string;
95
- "text-onpe-ui-gray-light": string;
96
- "text-onpe-ui-gray-extra-light": string;
97
- "text-onpe-ui-red": string;
98
- "text-onpe-ui-dark-gray": string;
99
- "text-onpe-ui-green": string;
100
- "text-onpe-ui-yellow-light": string;
101
- "hover:bg-onpe-ui-blue/30": string;
102
- "hover:bg-onpe-ui-skyblue/30": string;
103
- "hover:bg-onpe-ui-skyblue-light/30": string;
104
- "hover:bg-onpe-ui-yellow/30": string;
105
- "hover:bg-onpe-ui-light-skyblue/30": string;
106
- "hover:bg-onpe-ui-gray/30": string;
107
- "hover:bg-onpe-ui-gray-light/30": string;
108
- "hover:bg-onpe-ui-gray-extra-light/30": string;
109
- "hover:bg-onpe-ui-red/30": string;
110
- "hover:bg-onpe-ui-dark-gray/30": string;
111
- "hover:bg-onpe-ui-green/30": string;
112
- "hover:bg-onpe-ui-yellow-light/30": string;
113
- "disabled:bg-onpe-ui-gray": string;
114
- "disabled:hover:bg-onpe-ui-gray": string;
115
- "disabled:cursor-not-allowed": string;
116
- "cursor-pointer": string;
117
- "cursor-not-allowed": string;
118
- "transition-all": string;
119
- "duration-300": string;
120
- "ease-in-out": string;
121
- "fast-blink": string;
122
- border: string;
123
- "border-0": string;
124
- "border-2": string;
125
- "border-solid": string;
126
- "border-dashed": string;
127
- "border-dotted": string;
128
- rounded: string;
129
- "rounded-sm": string;
130
- "rounded-md": string;
131
- "rounded-lg": string;
132
- "rounded-xl": string;
133
- "rounded-full": string;
134
- shadow: string;
135
- "shadow-sm": string;
136
- "shadow-md": string;
137
- "shadow-lg": string;
138
- "shadow-xl": string;
139
- "shadow-2xl": string;
140
- relative: string;
141
- absolute: string;
142
- fixed: string;
143
- sticky: string;
144
- static: string;
145
- block: string;
146
- "inline-block": string;
147
- inline: string;
148
- hidden: string;
149
- "overflow-hidden": string;
150
- "overflow-auto": string;
151
- "overflow-scroll": string;
152
- "overflow-visible": string;
153
- };
154
- cn: (...classes: (string | undefined | null | false)[]) => string;
155
- };
156
- //# sourceMappingURL=useOnpeClasses.d.ts.map
@@ -1,2 +0,0 @@
1
- export { useToggle } from "./useToggle";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const useToggle: (initialValue?: boolean) => readonly [boolean, () => void, () => void, () => void];
2
- //# sourceMappingURL=useToggle.d.ts.map
package/dist/hooks.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Hook para debounce de valores
3
- * @param value - Valor a debounce
4
- * @param delay - Delay en milisegundos
5
- * @returns Valor debounced
6
- */
7
- declare function useDebounce<T>(value: T, delay: number): T;
8
-
9
- /**
10
- * Hook personalizado para manejar localStorage
11
- * @param key - Clave del localStorage
12
- * @param initialValue - Valor inicial
13
- * @returns [value, setValue] - Valor actual y función para actualizarlo
14
- */
15
- declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
16
-
17
- export { useDebounce, useLocalStorage };
package/dist/hooks.esm.js DELETED
@@ -1,55 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
-
3
- /**
4
- * Hook para debounce de valores
5
- * @param value - Valor a debounce
6
- * @param delay - Delay en milisegundos
7
- * @returns Valor debounced
8
- */
9
- function useDebounce(value, delay) {
10
- var _a = useState(value), debouncedValue = _a[0], setDebouncedValue = _a[1];
11
- useEffect(function () {
12
- var handler = setTimeout(function () {
13
- setDebouncedValue(value);
14
- }, delay);
15
- return function () {
16
- clearTimeout(handler);
17
- };
18
- }, [value, delay]);
19
- return debouncedValue;
20
- }
21
-
22
- /**
23
- * Hook personalizado para manejar localStorage
24
- * @param key - Clave del localStorage
25
- * @param initialValue - Valor inicial
26
- * @returns [value, setValue] - Valor actual y función para actualizarlo
27
- */
28
- function useLocalStorage(key, initialValue) {
29
- // Estado para almacenar nuestro valor
30
- var _a = useState(function () {
31
- try {
32
- var item = window.localStorage.getItem(key);
33
- return item ? JSON.parse(item) : initialValue;
34
- }
35
- catch (error) {
36
- console.error("Error reading localStorage key \"".concat(key, "\":"), error);
37
- return initialValue;
38
- }
39
- }), storedValue = _a[0], setStoredValue = _a[1];
40
- // Función para actualizar el valor
41
- var setValue = function (value) {
42
- try {
43
- var valueToStore = value instanceof Function ? value(storedValue) : value;
44
- setStoredValue(valueToStore);
45
- window.localStorage.setItem(key, JSON.stringify(valueToStore));
46
- }
47
- catch (error) {
48
- console.error("Error setting localStorage key \"".concat(key, "\":"), error);
49
- }
50
- };
51
- return [storedValue, setValue];
52
- }
53
-
54
- export { useDebounce, useLocalStorage };
55
- //# sourceMappingURL=hooks.esm.js.map
package/dist/hooks.js DELETED
@@ -1,55 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
-
3
- /**
4
- * Hook para debounce de valores
5
- * @param value - Valor a debounce
6
- * @param delay - Delay en milisegundos
7
- * @returns Valor debounced
8
- */
9
- function useDebounce(value, delay) {
10
- var _a = useState(value), debouncedValue = _a[0], setDebouncedValue = _a[1];
11
- useEffect(function () {
12
- var handler = setTimeout(function () {
13
- setDebouncedValue(value);
14
- }, delay);
15
- return function () {
16
- clearTimeout(handler);
17
- };
18
- }, [value, delay]);
19
- return debouncedValue;
20
- }
21
-
22
- /**
23
- * Hook personalizado para manejar localStorage
24
- * @param key - Clave del localStorage
25
- * @param initialValue - Valor inicial
26
- * @returns [value, setValue] - Valor actual y función para actualizarlo
27
- */
28
- function useLocalStorage(key, initialValue) {
29
- // Estado para almacenar nuestro valor
30
- var _a = useState(function () {
31
- try {
32
- var item = window.localStorage.getItem(key);
33
- return item ? JSON.parse(item) : initialValue;
34
- }
35
- catch (error) {
36
- console.error("Error reading localStorage key \"".concat(key, "\":"), error);
37
- return initialValue;
38
- }
39
- }), storedValue = _a[0], setStoredValue = _a[1];
40
- // Función para actualizar el valor
41
- var setValue = function (value) {
42
- try {
43
- var valueToStore = value instanceof Function ? value(storedValue) : value;
44
- setStoredValue(valueToStore);
45
- window.localStorage.setItem(key, JSON.stringify(valueToStore));
46
- }
47
- catch (error) {
48
- console.error("Error setting localStorage key \"".concat(key, "\":"), error);
49
- }
50
- };
51
- return [storedValue, setValue];
52
- }
53
-
54
- export { useDebounce, useLocalStorage };
55
- //# sourceMappingURL=hooks.js.map
@@ -1,3 +0,0 @@
1
- import { SVGProps } from "react";
2
- export declare const ElectionsIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=ElectionsIcon.d.ts.map
@@ -1,2 +0,0 @@
1
- export { ElectionsIcon } from "./ElectionsIcon";
2
- //# sourceMappingURL=index.d.ts.map
package/dist/lib/api.d.ts DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Cliente API simple para ONPE
3
- */
4
- export 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
- export declare const apiClient: APIClient;
20
- //# sourceMappingURL=api.d.ts.map
@@ -1,3 +0,0 @@
1
- export { APIClient, apiClient } from "./api";
2
- export { StorageManager } from "./storage";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,22 +0,0 @@
1
- /**
2
- * Utilidades para manejo de almacenamiento
3
- */
4
- export declare class StorageManager {
5
- /**
6
- * Guarda un valor en localStorage
7
- */
8
- static setItem(key: string, value: any): void;
9
- /**
10
- * Obtiene un valor de localStorage
11
- */
12
- static getItem<T>(key: string, defaultValue?: T): T | null;
13
- /**
14
- * Elimina un valor de localStorage
15
- */
16
- static removeItem(key: string): void;
17
- /**
18
- * Limpia todo el localStorage
19
- */
20
- static clear(): void;
21
- }
22
- //# sourceMappingURL=storage.d.ts.map
package/dist/lib.d.ts DELETED
@@ -1,43 +0,0 @@
1
- /**
2
- * Cliente API simple para ONPE
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 };
package/dist/lib.esm.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.esm.js.map