@votodigital-onpeui/react 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/dist/chunk-4CXYX4SI.mjs +410 -0
- package/dist/chunk-4CXYX4SI.mjs.map +1 -0
- package/dist/chunk-VPOCM2HP.mjs +1038 -0
- package/dist/chunk-VPOCM2HP.mjs.map +1 -0
- package/dist/chunk-WZWNCN4H.mjs +878 -0
- package/dist/chunk-WZWNCN4H.mjs.map +1 -0
- package/dist/components.d.mts +135 -0
- package/dist/components.d.ts +135 -0
- package/dist/components.js +1456 -0
- package/dist/components.js.map +1 -0
- package/dist/components.mjs +4 -0
- package/dist/components.mjs.map +1 -0
- package/dist/icons.d.mts +68 -0
- package/dist/icons.d.ts +68 -0
- package/dist/icons.js +1314 -0
- package/dist/icons.js.map +1 -0
- package/dist/icons.mjs +4 -0
- package/dist/icons.mjs.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2359 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
import { IconChrome, IconSafari, IconEdge, FaceBookIcon, XIcon, TikTokIcon, InstagramIcon, YoutubeIcon, IconCloseRadius, IconWarning, IconChromeColor, IconSafariColor, IconEdgeColor, IconWindow, IconAndroid, IconApple, IconWarningNotRecommended, IconCheck, IconSpinnerDesktop, IconSpinnerMobile } from './chunk-4CXYX4SI.mjs';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect, useRef } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
|
|
6
|
+
var colorClasses = {
|
|
7
|
+
blue: "bg-onpe-blue",
|
|
8
|
+
skyblue: "bg-onpe-skyblue",
|
|
9
|
+
"skyblue-light": "bg-onpe-skyblue-light",
|
|
10
|
+
yellow: "bg-onpe-yellow",
|
|
11
|
+
"light-skyblue": "bg-onpe-light-skyblue",
|
|
12
|
+
gray: "bg-onpe-gray",
|
|
13
|
+
"gray-light": "bg-onpe-gray-light",
|
|
14
|
+
"gray-extra-light": "bg-onpe-gray-extra-light",
|
|
15
|
+
red: "bg-onpe-red",
|
|
16
|
+
"dark-gray": "bg-onpe-dark-gray",
|
|
17
|
+
green: "bg-onpe-green",
|
|
18
|
+
"yellow-light": "bg-onpe-yellow-light",
|
|
19
|
+
primary: "bg-onpe-blue"
|
|
20
|
+
};
|
|
21
|
+
var sizeClasses = {
|
|
22
|
+
small: "h-10 text-sm",
|
|
23
|
+
normal: "h-12 text-base",
|
|
24
|
+
large: "h-14 text-lg"
|
|
25
|
+
};
|
|
26
|
+
function Button({
|
|
27
|
+
color,
|
|
28
|
+
title,
|
|
29
|
+
size = "normal",
|
|
30
|
+
className = "",
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
className: [
|
|
37
|
+
"inline-flex items-center justify-center",
|
|
38
|
+
"min-w-[200px] border-none",
|
|
39
|
+
"text-white font-semibold cursor-pointer",
|
|
40
|
+
"transition-all duration-300 ease-in-out",
|
|
41
|
+
"disabled:cursor-default disabled:!bg-onpe-gray",
|
|
42
|
+
colorClasses[color],
|
|
43
|
+
sizeClasses[size],
|
|
44
|
+
className
|
|
45
|
+
].filter(Boolean).join(" "),
|
|
46
|
+
...props,
|
|
47
|
+
children: title
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
var BrowserRecommended = () => {
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row lg:py-2 items-center justify-center gap-6 py-3 pb-6 text-xs text-center text-onpe-blue bg-onpe-skyblue-light/15", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("p", { children: "Navegadores recomendados:" }),
|
|
54
|
+
/* @__PURE__ */ jsxs("ul", { className: "flex gap-6 lg:gap-8", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
56
|
+
/* @__PURE__ */ jsx(IconChrome, { "aria-hidden": "true" }),
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Google Chrome" }),
|
|
58
|
+
/* @__PURE__ */ jsx("p", { className: "hidden md:block text-left", "aria-hidden": "true", children: "Google Chrome" })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(IconSafari, { "aria-hidden": "true" }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Safari" }),
|
|
63
|
+
/* @__PURE__ */ jsx("p", { className: "hidden md:block text-left", "aria-hidden": "true", children: "Safari" })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(IconEdge, { "aria-hidden": "true" }),
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Microsoft Edge" }),
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "hidden md:block text-left", "aria-hidden": "true", children: "Microsoft Edge" })
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
var Footer = ({
|
|
74
|
+
showBrowserInfo = true,
|
|
75
|
+
showContactInfo = true,
|
|
76
|
+
children,
|
|
77
|
+
showFooterContent = true,
|
|
78
|
+
isDevelopment = true,
|
|
79
|
+
...props
|
|
80
|
+
}) => {
|
|
81
|
+
return /* @__PURE__ */ jsxs("footer", { ...props, tabIndex: 0, "aria-label": "", children: [
|
|
82
|
+
showFooterContent && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
+
children && children,
|
|
84
|
+
showBrowserInfo && /* @__PURE__ */ jsx(BrowserRecommended, {}),
|
|
85
|
+
showContactInfo && /* @__PURE__ */ jsx("div", { className: "relative z-10 flex w-full min-h-[100px] bg-onpe-blue", children: /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start w-full flex-col gap-6 mx-auto py-14 px-4 max-w-[1460px] md:py-5 md:px-4 lg:flex-row lg:items-center", children: [
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { tabIndex: 0, children: [
|
|
87
|
+
/* @__PURE__ */ jsxs("p", { className: "font-semibold text-onpe-yellow mb-1", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Oficina central" }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Oficina central:" })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsxs("p", { className: "flex text-sm font-medium text-white", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", lang: "es-PE", children: "Direcci\xF3n: jiroon Washington 1894, Cercado de Lima" }),
|
|
93
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Jr. Washington 1894, Cercado de Lima" })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxs("p", { className: "flex text-sm font-medium text-white", children: [
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Horario de atenci\xF3n: Lunes a viernes de 8:30 a. m. a 5:00 p. m." }),
|
|
97
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Lunes a viernes de 8:30 a. m. a 5:00 p. m." })
|
|
98
|
+
] })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { tabIndex: 0, children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("p", { className: "font-semibold text-onpe-yellow mb-1", children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Cont\xE1ctanos" }),
|
|
103
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Cont\xE1ctanos:" })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsxs("p", { className: "flex text-sm font-medium text-white", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Correo electr\xF3nico, informes@onpe punto goob punto pe," }),
|
|
107
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "informes@onpe.gob.pe" })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsxs("p", { className: "flex text-sm font-medium text-white", children: [
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "N\xFAmero telef\xF3nico, (01)4170630," }),
|
|
111
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "(01)4170630" })
|
|
112
|
+
] })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { tabIndex: 0, children: [
|
|
115
|
+
/* @__PURE__ */ jsxs("p", { className: "font-semibold text-onpe-yellow mb-1", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "S\xEDguenos en nuestras redes sociales" }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "S\xEDguenos:" })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsxs("p", { className: "flex text-sm font-medium text-white gap-4", children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"a",
|
|
122
|
+
{
|
|
123
|
+
href: "https://www.facebook.com/ONPEoficial",
|
|
124
|
+
target: "_blank",
|
|
125
|
+
rel: "noopener noreferrer",
|
|
126
|
+
"aria-label": "Facebook de ONPE,",
|
|
127
|
+
className: "text-onpe-blue-dark",
|
|
128
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(FaceBookIcon, {}) })
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
"a",
|
|
133
|
+
{
|
|
134
|
+
href: "https://x.com/ONPE_oficial",
|
|
135
|
+
target: "_blank",
|
|
136
|
+
rel: "noopener noreferrer",
|
|
137
|
+
"aria-label": "X de ONPE (antes Twitter),",
|
|
138
|
+
className: "text-onpe-blue-dark",
|
|
139
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(XIcon, {}) })
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
"a",
|
|
144
|
+
{
|
|
145
|
+
href: "https://www.tiktok.com/@onpe_oficial",
|
|
146
|
+
target: "_blank",
|
|
147
|
+
rel: "noopener noreferrer",
|
|
148
|
+
"aria-label": "TikTok de ONPE,",
|
|
149
|
+
className: "text-onpe-blue-dark",
|
|
150
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(TikTokIcon, {}) })
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
"a",
|
|
155
|
+
{
|
|
156
|
+
href: "https://www.instagram.com/ONPE_oficial/",
|
|
157
|
+
target: "_blank",
|
|
158
|
+
rel: "noopener noreferrer",
|
|
159
|
+
"aria-label": "Instagram de ONPE,",
|
|
160
|
+
className: "text-onpe-blue-dark",
|
|
161
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(InstagramIcon, {}) })
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
"a",
|
|
166
|
+
{
|
|
167
|
+
href: "https://www.youtube.com/@onpeprensa",
|
|
168
|
+
target: "_blank",
|
|
169
|
+
rel: "noopener noreferrer",
|
|
170
|
+
"aria-label": "YouTube de ONPE,",
|
|
171
|
+
className: "text-onpe-blue-dark",
|
|
172
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(YoutubeIcon, {}) })
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] })
|
|
176
|
+
] })
|
|
177
|
+
] }) })
|
|
178
|
+
] }),
|
|
179
|
+
isDevelopment && /* @__PURE__ */ jsx("div", { className: "h-[93px] w-full text-center flex items-center justify-center bg-onpe-yellow-light/75 fixed z-10 right-0 bottom-0 lg:h-[46px]", children: /* @__PURE__ */ jsx("p", { className: "py-2 px-2 text-2xl text-onpe-blue font-[Consolas,monospace] font-black", children: "Versi\xF3n en Desarrollo - No Oficial" }) })
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
var Portal = ({ children, container }) => {
|
|
183
|
+
const [mounted, setMounted] = useState(false);
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
setMounted(true);
|
|
186
|
+
return () => setMounted(false);
|
|
187
|
+
}, []);
|
|
188
|
+
if (!mounted) return null;
|
|
189
|
+
let portalElement = container || document.querySelector("#portal");
|
|
190
|
+
if (!portalElement) {
|
|
191
|
+
portalElement = document.body;
|
|
192
|
+
}
|
|
193
|
+
return createPortal(children, portalElement);
|
|
194
|
+
};
|
|
195
|
+
var colorClasses2 = {
|
|
196
|
+
blue: "bg-onpe-blue/80",
|
|
197
|
+
skyblue: "bg-onpe-skyblue/80",
|
|
198
|
+
"skyblue-light": "bg-onpe-skyblue-light/80",
|
|
199
|
+
yellow: "bg-onpe-yellow/80",
|
|
200
|
+
"light-skyblue": "bg-onpe-light-skyblue/80",
|
|
201
|
+
gray: "bg-onpe-gray/80",
|
|
202
|
+
"gray-light": "bg-onpe-gray-light/80",
|
|
203
|
+
"gray-extra-light": "bg-onpe-gray-extra-light/80",
|
|
204
|
+
red: "bg-onpe-red/80",
|
|
205
|
+
"dark-gray": "bg-onpe-dark-gray/80",
|
|
206
|
+
green: "bg-onpe-green/80",
|
|
207
|
+
"yellow-light": "bg-onpe-yellow-light/80",
|
|
208
|
+
primary: "bg-onpe-blue/80"
|
|
209
|
+
};
|
|
210
|
+
var Overlay = ({ show, onClick, color = "blue" }) => {
|
|
211
|
+
return /* @__PURE__ */ jsx(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
onClick,
|
|
215
|
+
className: [
|
|
216
|
+
"absolute inset-0 w-full h-screen z-10 transition-all duration-500",
|
|
217
|
+
show ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
|
|
218
|
+
colorClasses2[color]
|
|
219
|
+
].join(" ")
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
var Show = ({ condition, loadingComponent, children }) => {
|
|
224
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
225
|
+
condition && loadingComponent,
|
|
226
|
+
!condition && children
|
|
227
|
+
] });
|
|
228
|
+
};
|
|
229
|
+
var Modal = ({
|
|
230
|
+
isOpen,
|
|
231
|
+
onClose,
|
|
232
|
+
children,
|
|
233
|
+
whitoutBackground = false,
|
|
234
|
+
closeButton = false,
|
|
235
|
+
closeDisabled = false,
|
|
236
|
+
escapeToClose = true,
|
|
237
|
+
disableFocus = false,
|
|
238
|
+
disableFocusRestore = false,
|
|
239
|
+
existTabIndex = true,
|
|
240
|
+
zIndexLevel = 100,
|
|
241
|
+
onCloseComplete,
|
|
242
|
+
overlayColor: _overlayColor = "blue",
|
|
243
|
+
...props
|
|
244
|
+
}) => {
|
|
245
|
+
const modalRef = useRef(null);
|
|
246
|
+
const contentRef = useRef(null);
|
|
247
|
+
const previousActiveElement = useRef(null);
|
|
248
|
+
const [mounted, setMounted] = useState(false);
|
|
249
|
+
const [visible, setVisible] = useState(false);
|
|
250
|
+
const [cachedChildren, setCachedChildren] = useState(children);
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (isOpen) {
|
|
253
|
+
setCachedChildren(children);
|
|
254
|
+
}
|
|
255
|
+
}, [isOpen, children]);
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
if (isOpen) {
|
|
258
|
+
setMounted(true);
|
|
259
|
+
const raf = requestAnimationFrame(() => {
|
|
260
|
+
requestAnimationFrame(() => setVisible(true));
|
|
261
|
+
});
|
|
262
|
+
return () => cancelAnimationFrame(raf);
|
|
263
|
+
} else {
|
|
264
|
+
setVisible(false);
|
|
265
|
+
const timer = setTimeout(() => {
|
|
266
|
+
setMounted(false);
|
|
267
|
+
onCloseComplete?.();
|
|
268
|
+
}, 200);
|
|
269
|
+
return () => clearTimeout(timer);
|
|
270
|
+
}
|
|
271
|
+
}, [isOpen, onCloseComplete]);
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
if (isOpen) {
|
|
274
|
+
document.body.style.overflow = "hidden";
|
|
275
|
+
} else {
|
|
276
|
+
document.body.style.overflow = "";
|
|
277
|
+
}
|
|
278
|
+
return () => {
|
|
279
|
+
document.body.style.overflow = "";
|
|
280
|
+
};
|
|
281
|
+
}, [isOpen]);
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
if (!isOpen) return;
|
|
284
|
+
const resetScroll = () => {
|
|
285
|
+
const el = contentRef.current;
|
|
286
|
+
if (!el) return;
|
|
287
|
+
el.style.scrollBehavior = "auto";
|
|
288
|
+
el.scrollTop = 0;
|
|
289
|
+
requestAnimationFrame(() => {
|
|
290
|
+
el.scrollTop = 0;
|
|
291
|
+
setTimeout(() => {
|
|
292
|
+
el.style.scrollBehavior = "smooth";
|
|
293
|
+
}, 10);
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
resetScroll();
|
|
297
|
+
[10, 50, 100, 200].forEach((d) => setTimeout(resetScroll, d));
|
|
298
|
+
}, [isOpen]);
|
|
299
|
+
useEffect(() => {
|
|
300
|
+
const isElementVisible = (element) => {
|
|
301
|
+
const style = window.getComputedStyle(element);
|
|
302
|
+
return style.visibility !== "hidden" && style.display !== "none" && element.offsetParent !== null;
|
|
303
|
+
};
|
|
304
|
+
const getFocusableElements = (wrapper) => {
|
|
305
|
+
const selector = [
|
|
306
|
+
"a[href]",
|
|
307
|
+
"area[href]",
|
|
308
|
+
"button:not([disabled])",
|
|
309
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
310
|
+
"select:not([disabled])",
|
|
311
|
+
"textarea:not([disabled])",
|
|
312
|
+
"iframe",
|
|
313
|
+
"object",
|
|
314
|
+
"embed",
|
|
315
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
316
|
+
'[contenteditable="true"]'
|
|
317
|
+
].join(",");
|
|
318
|
+
let focusable = Array.from(
|
|
319
|
+
wrapper.querySelectorAll(selector)
|
|
320
|
+
).filter((el) => isElementVisible(el) && el.tabIndex !== -1);
|
|
321
|
+
if (wrapper.tabIndex >= 0) {
|
|
322
|
+
focusable = [wrapper, ...focusable];
|
|
323
|
+
}
|
|
324
|
+
return focusable;
|
|
325
|
+
};
|
|
326
|
+
const handleFocusOut = (e) => {
|
|
327
|
+
if (!isOpen || disableFocus) return;
|
|
328
|
+
const wrapper = modalRef.current;
|
|
329
|
+
if (!wrapper) return;
|
|
330
|
+
const relatedTarget = e.relatedTarget;
|
|
331
|
+
if (relatedTarget && !wrapper.contains(relatedTarget)) {
|
|
332
|
+
setTimeout(() => {
|
|
333
|
+
const currentActive = document.activeElement;
|
|
334
|
+
if (!currentActive || !wrapper.contains(currentActive)) {
|
|
335
|
+
const focusable = getFocusableElements(wrapper);
|
|
336
|
+
if (focusable.length > 0) {
|
|
337
|
+
focusable[focusable.length - 1].focus();
|
|
338
|
+
} else {
|
|
339
|
+
wrapper.focus();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}, 0);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
const handleKeyDown = (e) => {
|
|
346
|
+
if (e.key === "Escape" && escapeToClose && !closeDisabled) {
|
|
347
|
+
onClose();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (!isOpen || disableFocus) return;
|
|
351
|
+
const wrapper = modalRef.current;
|
|
352
|
+
if (!wrapper) return;
|
|
353
|
+
const focusable = getFocusableElements(wrapper);
|
|
354
|
+
const active = document.activeElement || null;
|
|
355
|
+
const arrowKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
356
|
+
if (arrowKeys.includes(e.key)) {
|
|
357
|
+
if (active && wrapper.contains(active)) {
|
|
358
|
+
const activeIndex2 = focusable.indexOf(active);
|
|
359
|
+
if ((e.key === "ArrowUp" || e.key === "ArrowLeft") && activeIndex2 === 0) {
|
|
360
|
+
e.preventDefault();
|
|
361
|
+
e.stopPropagation();
|
|
362
|
+
if (focusable.length > 1) focusable[focusable.length - 1].focus();
|
|
363
|
+
else active.focus();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
if ((e.key === "ArrowDown" || e.key === "ArrowRight") && activeIndex2 === focusable.length - 1) {
|
|
367
|
+
e.preventDefault();
|
|
368
|
+
e.stopPropagation();
|
|
369
|
+
if (focusable.length > 1) focusable[0].focus();
|
|
370
|
+
else active.focus();
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
requestAnimationFrame(() => {
|
|
374
|
+
const currentActive = document.activeElement;
|
|
375
|
+
if (!currentActive || !wrapper.contains(currentActive)) {
|
|
376
|
+
if (activeIndex2 !== -1 && focusable[activeIndex2])
|
|
377
|
+
focusable[activeIndex2].focus();
|
|
378
|
+
else if (focusable.length > 0) focusable[0].focus();
|
|
379
|
+
else wrapper.focus();
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
} else {
|
|
383
|
+
e.preventDefault();
|
|
384
|
+
if (focusable.length > 0) {
|
|
385
|
+
if (e.key === "ArrowUp" || e.key === "ArrowLeft")
|
|
386
|
+
focusable[focusable.length - 1].focus();
|
|
387
|
+
else focusable[0].focus();
|
|
388
|
+
} else {
|
|
389
|
+
wrapper.focus();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (e.key !== "Tab") return;
|
|
395
|
+
if (focusable.length === 0) {
|
|
396
|
+
e.preventDefault();
|
|
397
|
+
wrapper.focus();
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const first = focusable[0];
|
|
401
|
+
const last = focusable[focusable.length - 1];
|
|
402
|
+
const isShift = e.shiftKey;
|
|
403
|
+
if (!active || !wrapper.contains(active)) {
|
|
404
|
+
e.preventDefault();
|
|
405
|
+
(isShift ? last : first).focus();
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const activeIndex = focusable.indexOf(active);
|
|
409
|
+
if (!isShift && (active === last || activeIndex === focusable.length - 1)) {
|
|
410
|
+
e.preventDefault();
|
|
411
|
+
first.focus();
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (isShift) {
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
if (active === first || active === wrapper || activeIndex === 0)
|
|
417
|
+
last.focus();
|
|
418
|
+
else if (activeIndex > 0) focusable[activeIndex - 1].focus();
|
|
419
|
+
else last.focus();
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
if (isOpen && !disableFocus) {
|
|
423
|
+
previousActiveElement.current = document.activeElement;
|
|
424
|
+
modalRef.current?.focus();
|
|
425
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
426
|
+
const wrapper = modalRef.current;
|
|
427
|
+
if (wrapper) wrapper.addEventListener("focusout", handleFocusOut);
|
|
428
|
+
} else if (isOpen && disableFocus) {
|
|
429
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
430
|
+
}
|
|
431
|
+
return () => {
|
|
432
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
433
|
+
const wrapper = modalRef.current;
|
|
434
|
+
if (wrapper) wrapper.removeEventListener("focusout", handleFocusOut);
|
|
435
|
+
if (!disableFocus && !disableFocusRestore && previousActiveElement.current) {
|
|
436
|
+
previousActiveElement.current.focus();
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}, [isOpen, onClose, closeDisabled, escapeToClose, disableFocus, disableFocusRestore]);
|
|
440
|
+
if (!mounted) return null;
|
|
441
|
+
const contentClass = [
|
|
442
|
+
"relative flex flex-col items-center justify-start",
|
|
443
|
+
whitoutBackground ? "bg-transparent" : [
|
|
444
|
+
"bg-white",
|
|
445
|
+
"pt-[25px] px-4 pb-[50px]",
|
|
446
|
+
"min-w-[320px] w-[95vw] max-w-[95vw] max-h-[90vh]",
|
|
447
|
+
"overflow-y-auto scroll-smooth",
|
|
448
|
+
"md:pt-[35px] md:px-8 md:pb-[54px] md:max-w-[1000px]"
|
|
449
|
+
].join(" "),
|
|
450
|
+
props.className || ""
|
|
451
|
+
].filter(Boolean).join(" ");
|
|
452
|
+
return /* @__PURE__ */ jsxs(Portal, { children: [
|
|
453
|
+
/* @__PURE__ */ jsx(
|
|
454
|
+
"div",
|
|
455
|
+
{
|
|
456
|
+
style: { zIndex: zIndexLevel },
|
|
457
|
+
className: [
|
|
458
|
+
"fixed inset-0 bg-onpe-blue transition-opacity duration-200",
|
|
459
|
+
visible ? "opacity-80" : "opacity-0"
|
|
460
|
+
].join(" "),
|
|
461
|
+
onClick: onClose
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ jsx(
|
|
465
|
+
"div",
|
|
466
|
+
{
|
|
467
|
+
style: { zIndex: zIndexLevel + 10 },
|
|
468
|
+
className: [
|
|
469
|
+
"fixed top-0 w-full h-screen grid place-items-center",
|
|
470
|
+
"transition-all duration-200",
|
|
471
|
+
visible ? "opacity-100 scale-100 translate-y-0" : "opacity-[0.2] scale-95 -translate-y-5"
|
|
472
|
+
].join(" "),
|
|
473
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative grid place-items-center", children: /* @__PURE__ */ jsxs(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
ref: modalRef,
|
|
477
|
+
onClick: (e) => e.stopPropagation(),
|
|
478
|
+
...existTabIndex && { tabIndex: disableFocus ? -1 : 0 },
|
|
479
|
+
role: "dialog",
|
|
480
|
+
"aria-modal": "true",
|
|
481
|
+
"aria-labelledby": props["aria-labelledby"],
|
|
482
|
+
"aria-describedby": props["aria-describedby"],
|
|
483
|
+
"aria-label": props["aria-label"],
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ jsx("div", { ref: contentRef, className: contentClass, children: cachedChildren }),
|
|
486
|
+
closeButton && /* @__PURE__ */ jsx(
|
|
487
|
+
"button",
|
|
488
|
+
{
|
|
489
|
+
onClick: onClose,
|
|
490
|
+
className: "absolute top-2.5 right-2.5 text-onpe-red cursor-pointer w-4 h-4 border-none bg-transparent p-0 md:w-8 md:h-8",
|
|
491
|
+
"aria-label": "Cerrar",
|
|
492
|
+
type: "button",
|
|
493
|
+
children: /* @__PURE__ */ jsx(IconCloseRadius, { "aria-hidden": "true", className: "w-full h-full" })
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
) })
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
] });
|
|
502
|
+
};
|
|
503
|
+
var ModalBrowserIncompatible = ({
|
|
504
|
+
isOpen = false,
|
|
505
|
+
onClose = () => {
|
|
506
|
+
},
|
|
507
|
+
className = "",
|
|
508
|
+
zIndexLevel = 100
|
|
509
|
+
}) => {
|
|
510
|
+
return /* @__PURE__ */ jsxs(
|
|
511
|
+
Modal,
|
|
512
|
+
{
|
|
513
|
+
zIndexLevel,
|
|
514
|
+
isOpen,
|
|
515
|
+
onClose,
|
|
516
|
+
className: `!max-w-[680px] ${className}`,
|
|
517
|
+
closeButton: true,
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
520
|
+
IconWarning,
|
|
521
|
+
{
|
|
522
|
+
className: "w-16 h-16 sm:w-[84px] sm:h-[84px] text-onpe-skyblue",
|
|
523
|
+
role: "presentation"
|
|
524
|
+
}
|
|
525
|
+
) }),
|
|
526
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-base sm:text-2xl font-semibold text-center text-onpe-skyblue", children: "Est\xE1s usando un navegador no recomendado" }),
|
|
527
|
+
/* @__PURE__ */ jsx("p", { className: "mt-6 text-base sm:text-lg text-center sm:px-2", children: "Para una mejor experiencia y mayor seguridad, debes ingresar con los siguientes navegadores:" }),
|
|
528
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-8 mt-[47px] sm:gap-12", children: [
|
|
529
|
+
/* @__PURE__ */ jsx(
|
|
530
|
+
IconChromeColor,
|
|
531
|
+
{
|
|
532
|
+
role: "img",
|
|
533
|
+
"aria-label": "Google Chrome",
|
|
534
|
+
className: "w-7 h-7 sm:w-12 sm:h-12"
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
/* @__PURE__ */ jsx(
|
|
538
|
+
IconSafariColor,
|
|
539
|
+
{
|
|
540
|
+
role: "img",
|
|
541
|
+
"aria-label": "Safari",
|
|
542
|
+
className: "w-7 h-7 sm:w-12 sm:h-12"
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
/* @__PURE__ */ jsx(
|
|
546
|
+
IconEdgeColor,
|
|
547
|
+
{
|
|
548
|
+
role: "img",
|
|
549
|
+
"aria-label": "Microsoft Edge",
|
|
550
|
+
className: "w-7 h-7 sm:w-12 sm:h-12"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] })
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
var ModalSystemIncompatible = ({
|
|
559
|
+
isOpen = false,
|
|
560
|
+
onClose = () => {
|
|
561
|
+
},
|
|
562
|
+
className = "",
|
|
563
|
+
zIndexLevel = 1e3
|
|
564
|
+
}) => {
|
|
565
|
+
return /* @__PURE__ */ jsxs(
|
|
566
|
+
Modal,
|
|
567
|
+
{
|
|
568
|
+
zIndexLevel,
|
|
569
|
+
isOpen,
|
|
570
|
+
onClose,
|
|
571
|
+
className: `!max-w-[680px] ${className}`,
|
|
572
|
+
closeButton: true,
|
|
573
|
+
closeDisabled: true,
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
576
|
+
IconWarning,
|
|
577
|
+
{
|
|
578
|
+
className: "w-16 h-16 sm:w-[84px] sm:h-[84px] text-onpe-skyblue",
|
|
579
|
+
role: "presentation"
|
|
580
|
+
}
|
|
581
|
+
) }),
|
|
582
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-base sm:text-2xl font-semibold text-center text-onpe-skyblue", children: "Sistema Operativo no recomendado" }),
|
|
583
|
+
/* @__PURE__ */ jsx("p", { className: "mt-6 text-base sm:text-lg text-center sm:px-2", children: "Para descargar e instalar el ONPEID utiliza un dispositivo con sistema operativo Windows, macOS, Android o iOS." }),
|
|
584
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-8 mt-[47px] sm:gap-12", children: [
|
|
585
|
+
/* @__PURE__ */ jsx(
|
|
586
|
+
IconWindow,
|
|
587
|
+
{
|
|
588
|
+
role: "img",
|
|
589
|
+
"aria-label": "Windows 10 o superior",
|
|
590
|
+
className: "w-7 h-7 sm:w-12 sm:h-12 text-onpe-skyblue"
|
|
591
|
+
}
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ jsx(
|
|
594
|
+
IconAndroid,
|
|
595
|
+
{
|
|
596
|
+
role: "img",
|
|
597
|
+
"aria-label": "Android 7.0 o superior",
|
|
598
|
+
className: "w-7 h-7 sm:w-12 sm:h-12 text-onpe-skyblue"
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
/* @__PURE__ */ jsx(
|
|
602
|
+
IconApple,
|
|
603
|
+
{
|
|
604
|
+
role: "img",
|
|
605
|
+
"aria-label": "macOS 10.12 o superior / iOS 11.0 o superior",
|
|
606
|
+
className: "w-7 h-7 sm:w-12 sm:h-12 text-onpe-skyblue"
|
|
607
|
+
}
|
|
608
|
+
)
|
|
609
|
+
] })
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
};
|
|
614
|
+
var NotRecommended = ({
|
|
615
|
+
isOpenBrowserError = false,
|
|
616
|
+
isOpenDeviceError = false,
|
|
617
|
+
bottom = 40,
|
|
618
|
+
right = 20
|
|
619
|
+
}) => {
|
|
620
|
+
const [isWarningClosed, setIsWarningClosed] = useState(false);
|
|
621
|
+
const handleOpenWarning = () => setIsWarningClosed(false);
|
|
622
|
+
const handleCloseWarning = () => setIsWarningClosed(true);
|
|
623
|
+
const getContainerWidth = () => {
|
|
624
|
+
if (isWarningClosed) return "60px";
|
|
625
|
+
if (isOpenDeviceError) return "365px";
|
|
626
|
+
return "315px";
|
|
627
|
+
};
|
|
628
|
+
const getMessageWidth = () => {
|
|
629
|
+
if (isWarningClosed) return "0";
|
|
630
|
+
if (isOpenDeviceError) return "335px";
|
|
631
|
+
return "285px";
|
|
632
|
+
};
|
|
633
|
+
const getBottomValue = () => typeof bottom === "string" ? bottom : `${bottom}px`;
|
|
634
|
+
const getRightValue = () => typeof right === "string" ? right : `${right}px`;
|
|
635
|
+
return /* @__PURE__ */ jsx(
|
|
636
|
+
"div",
|
|
637
|
+
{
|
|
638
|
+
className: "fixed z-[99]",
|
|
639
|
+
style: { bottom: getBottomValue(), right: getRightValue() },
|
|
640
|
+
children: /* @__PURE__ */ jsxs(
|
|
641
|
+
"div",
|
|
642
|
+
{
|
|
643
|
+
className: "relative h-[75px] transition-all duration-300",
|
|
644
|
+
style: { width: getContainerWidth() },
|
|
645
|
+
children: [
|
|
646
|
+
isWarningClosed ? /* @__PURE__ */ jsx(
|
|
647
|
+
"button",
|
|
648
|
+
{
|
|
649
|
+
onClick: handleOpenWarning,
|
|
650
|
+
className: "absolute left-0 top-0 pb-2 h-[60px] w-[60px] flex items-center justify-center bg-onpe-yellow rounded-full z-10 cursor-pointer border-none transition-transform duration-200 hover:scale-110",
|
|
651
|
+
"aria-label": "Abrir advertencia",
|
|
652
|
+
type: "button",
|
|
653
|
+
children: /* @__PURE__ */ jsx(IconWarningNotRecommended, { className: "w-10 h-[35px] text-black" })
|
|
654
|
+
}
|
|
655
|
+
) : /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 pb-2 h-[60px] w-[60px] flex items-center justify-center bg-onpe-yellow rounded-full z-10", children: /* @__PURE__ */ jsx(IconWarningNotRecommended, { className: "w-10 h-[35px] text-black" }) }),
|
|
656
|
+
/* @__PURE__ */ jsx(
|
|
657
|
+
"div",
|
|
658
|
+
{
|
|
659
|
+
className: [
|
|
660
|
+
"absolute bg-white left-[30px] top-0 flex flex-col justify-center items-center gap-2",
|
|
661
|
+
"border-2 border-onpe-yellow rounded-[10px] h-[60px] text-sm",
|
|
662
|
+
"transition-all duration-300 overflow-hidden",
|
|
663
|
+
isWarningClosed ? "opacity-0 border-0 pointer-events-none" : "opacity-100"
|
|
664
|
+
].join(" "),
|
|
665
|
+
style: { width: getMessageWidth() },
|
|
666
|
+
children: /* @__PURE__ */ jsxs("div", { className: "whitespace-nowrap pl-6", children: [
|
|
667
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-onpe-yellow m-0", children: "Est\xE1s usando un" }),
|
|
668
|
+
isOpenDeviceError && /* @__PURE__ */ jsx("p", { className: "m-0 text-onpe-dark-gray", children: "sistema operativo no recomendado" }),
|
|
669
|
+
isOpenBrowserError && !isOpenDeviceError && /* @__PURE__ */ jsx("p", { className: "m-0 text-onpe-dark-gray", children: "navegador no recomendado" })
|
|
670
|
+
] })
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
!isWarningClosed && /* @__PURE__ */ jsx(
|
|
674
|
+
"button",
|
|
675
|
+
{
|
|
676
|
+
onClick: handleCloseWarning,
|
|
677
|
+
className: "absolute -top-2 -right-2 z-20 rounded-full cursor-pointer border-none bg-transparent p-0 transition-opacity duration-200 hover:opacity-80",
|
|
678
|
+
"aria-label": "Cerrar advertencia",
|
|
679
|
+
type: "button",
|
|
680
|
+
children: /* @__PURE__ */ jsx(IconCloseRadius, { className: "w-[23px] h-[23px] text-onpe-yellow bg-white rounded-full" })
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
};
|
|
689
|
+
var ModalConfirm = ({
|
|
690
|
+
isOpen = false,
|
|
691
|
+
onClose = () => {
|
|
692
|
+
},
|
|
693
|
+
withoutAutoClose = false,
|
|
694
|
+
title,
|
|
695
|
+
message,
|
|
696
|
+
icon = "warning",
|
|
697
|
+
color = "blue",
|
|
698
|
+
onConfirm = () => {
|
|
699
|
+
},
|
|
700
|
+
onCancel = () => {
|
|
701
|
+
},
|
|
702
|
+
textButtonConfirm = "Confirmar",
|
|
703
|
+
textButtonCancel = "Cancelar",
|
|
704
|
+
twoButtons = true,
|
|
705
|
+
className = "",
|
|
706
|
+
zIndexLevel = 100
|
|
707
|
+
}) => {
|
|
708
|
+
const titleId = "modal-confirm-title";
|
|
709
|
+
const messageId = "modal-confirm-message";
|
|
710
|
+
const handleConfirm = async () => {
|
|
711
|
+
try {
|
|
712
|
+
onConfirm();
|
|
713
|
+
if (!withoutAutoClose) onClose();
|
|
714
|
+
} catch (error) {
|
|
715
|
+
console.error("Error en handleConfirm:", error);
|
|
716
|
+
if (!withoutAutoClose) onClose();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const handleCancel = () => {
|
|
720
|
+
onCancel();
|
|
721
|
+
if (!withoutAutoClose) onClose();
|
|
722
|
+
};
|
|
723
|
+
const iconColorClass = color === "red" ? "text-onpe-red" : "text-onpe-skyblue";
|
|
724
|
+
const titleColorClass = color === "red" ? "text-onpe-red" : "text-onpe-skyblue";
|
|
725
|
+
return /* @__PURE__ */ jsxs(
|
|
726
|
+
Modal,
|
|
727
|
+
{
|
|
728
|
+
isOpen,
|
|
729
|
+
onClose,
|
|
730
|
+
className: `!max-w-[719px] !pt-[30px] !pb-[30px] !px-[30px] ${className}`,
|
|
731
|
+
closeButton: false,
|
|
732
|
+
closeDisabled: true,
|
|
733
|
+
zIndexLevel,
|
|
734
|
+
"aria-labelledby": titleId,
|
|
735
|
+
"aria-describedby": messageId,
|
|
736
|
+
children: [
|
|
737
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center", children: [
|
|
738
|
+
icon === "warning" && /* @__PURE__ */ jsx(
|
|
739
|
+
IconWarning,
|
|
740
|
+
{
|
|
741
|
+
role: "presentation",
|
|
742
|
+
className: `w-16 h-16 ${iconColorClass}`
|
|
743
|
+
}
|
|
744
|
+
),
|
|
745
|
+
icon === "success" && /* @__PURE__ */ jsx(
|
|
746
|
+
IconCheck,
|
|
747
|
+
{
|
|
748
|
+
role: "presentation",
|
|
749
|
+
className: `w-16 h-16 ${iconColorClass}`
|
|
750
|
+
}
|
|
751
|
+
)
|
|
752
|
+
] }),
|
|
753
|
+
/* @__PURE__ */ jsx(
|
|
754
|
+
"p",
|
|
755
|
+
{
|
|
756
|
+
id: titleId,
|
|
757
|
+
className: [
|
|
758
|
+
message ? "mt-0 md:mt-4" : "mt-0",
|
|
759
|
+
"text-lg md:text-2xl font-semibold text-center",
|
|
760
|
+
titleColorClass
|
|
761
|
+
].join(" "),
|
|
762
|
+
children: title
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
message && /* @__PURE__ */ jsx(
|
|
766
|
+
"div",
|
|
767
|
+
{
|
|
768
|
+
id: messageId,
|
|
769
|
+
className: "mt-7 text-sm md:text-lg text-center max-w-full text-onpe-dark-gray",
|
|
770
|
+
children: message
|
|
771
|
+
}
|
|
772
|
+
),
|
|
773
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center w-full gap-5 mt-11 md:hidden", children: [
|
|
774
|
+
/* @__PURE__ */ jsx(
|
|
775
|
+
Button,
|
|
776
|
+
{
|
|
777
|
+
className: "w-full max-w-[200px]",
|
|
778
|
+
color: "red",
|
|
779
|
+
title: textButtonConfirm,
|
|
780
|
+
onClick: handleConfirm
|
|
781
|
+
}
|
|
782
|
+
),
|
|
783
|
+
twoButtons && /* @__PURE__ */ jsx(
|
|
784
|
+
Button,
|
|
785
|
+
{
|
|
786
|
+
className: "w-full max-w-[200px]",
|
|
787
|
+
color: "skyblue",
|
|
788
|
+
title: textButtonCancel,
|
|
789
|
+
onClick: handleCancel
|
|
790
|
+
}
|
|
791
|
+
)
|
|
792
|
+
] }),
|
|
793
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden md:flex md:flex-row items-center justify-center w-full gap-5 mt-11", children: [
|
|
794
|
+
twoButtons && /* @__PURE__ */ jsx(
|
|
795
|
+
Button,
|
|
796
|
+
{
|
|
797
|
+
className: "w-[200px]",
|
|
798
|
+
color: "skyblue",
|
|
799
|
+
title: textButtonCancel,
|
|
800
|
+
onClick: handleCancel
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
/* @__PURE__ */ jsx(
|
|
804
|
+
Button,
|
|
805
|
+
{
|
|
806
|
+
className: "w-[200px]",
|
|
807
|
+
color: "red",
|
|
808
|
+
title: textButtonConfirm,
|
|
809
|
+
onClick: handleConfirm
|
|
810
|
+
}
|
|
811
|
+
)
|
|
812
|
+
] })
|
|
813
|
+
]
|
|
814
|
+
}
|
|
815
|
+
);
|
|
816
|
+
};
|
|
817
|
+
var ModalLoading = ({
|
|
818
|
+
isOpen = false,
|
|
819
|
+
onClose = () => {
|
|
820
|
+
},
|
|
821
|
+
message = "Cargando...",
|
|
822
|
+
className = "",
|
|
823
|
+
zIndexLevel = 100
|
|
824
|
+
}) => {
|
|
825
|
+
const [announceMessage, setAnnounceMessage] = useState("");
|
|
826
|
+
useEffect(() => {
|
|
827
|
+
if (!isOpen) {
|
|
828
|
+
setAnnounceMessage("");
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
setAnnounceMessage("");
|
|
832
|
+
const t = globalThis.setTimeout(() => {
|
|
833
|
+
setAnnounceMessage(message);
|
|
834
|
+
}, 150);
|
|
835
|
+
return () => {
|
|
836
|
+
globalThis.clearTimeout(t);
|
|
837
|
+
};
|
|
838
|
+
}, [isOpen, message]);
|
|
839
|
+
return /* @__PURE__ */ jsxs(
|
|
840
|
+
Modal,
|
|
841
|
+
{
|
|
842
|
+
disableFocus: true,
|
|
843
|
+
zIndexLevel,
|
|
844
|
+
isOpen,
|
|
845
|
+
onClose,
|
|
846
|
+
className,
|
|
847
|
+
closeDisabled: true,
|
|
848
|
+
whitoutBackground: true,
|
|
849
|
+
children: [
|
|
850
|
+
/* @__PURE__ */ jsx("div", { className: "sr-only", "aria-live": "assertive", "aria-atomic": "true", children: announceMessage }),
|
|
851
|
+
/* @__PURE__ */ jsx(
|
|
852
|
+
IconSpinnerDesktop,
|
|
853
|
+
{
|
|
854
|
+
className: "hidden md:block text-white animate-spin",
|
|
855
|
+
"aria-hidden": "true"
|
|
856
|
+
}
|
|
857
|
+
),
|
|
858
|
+
/* @__PURE__ */ jsx(
|
|
859
|
+
IconSpinnerMobile,
|
|
860
|
+
{
|
|
861
|
+
className: "block md:hidden text-white animate-spin",
|
|
862
|
+
"aria-hidden": "true"
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
/* @__PURE__ */ jsx("p", { className: "text-white leading-normal text-2xl md:text-[64px] text-center mt-10 md:mt-20", children: message })
|
|
866
|
+
]
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
};
|
|
870
|
+
var ModalDnieVersions = ({
|
|
871
|
+
isOpen = false,
|
|
872
|
+
onClose = () => {
|
|
873
|
+
},
|
|
874
|
+
className = "",
|
|
875
|
+
iconDnie1,
|
|
876
|
+
iconDnie2,
|
|
877
|
+
iconDnie3,
|
|
878
|
+
zIndexLevel = 100
|
|
879
|
+
}) => {
|
|
880
|
+
return /* @__PURE__ */ jsxs(
|
|
881
|
+
Modal,
|
|
882
|
+
{
|
|
883
|
+
zIndexLevel,
|
|
884
|
+
isOpen,
|
|
885
|
+
onClose,
|
|
886
|
+
className: `!max-w-[590px] !pt-[30px] !pb-[38px] ${className}`,
|
|
887
|
+
closeButton: true,
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ jsxs(
|
|
890
|
+
"h2",
|
|
891
|
+
{
|
|
892
|
+
className: "text-center text-onpe-blue font-bold mb-2 text-lg sm:text-xl",
|
|
893
|
+
tabIndex: 0,
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Versiones del DNI electr\xF3nico" }),
|
|
896
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Versiones del DNIe" })
|
|
897
|
+
]
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-5 sm:gap-8 items-center mt-[18px] sm:mt-6 text-sm", children: [
|
|
901
|
+
/* @__PURE__ */ jsxs("article", { className: "flex flex-col sm:flex-row items-center sm:items-start gap-10 w-full", children: [
|
|
902
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 w-full", children: [
|
|
903
|
+
/* @__PURE__ */ jsx("p", { className: "flex-1 mb-4", tabIndex: 0, children: /* @__PURE__ */ jsxs("span", { className: "font-bold", children: [
|
|
904
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "DNI electr\xF3nico versi\xF3n 1" }),
|
|
905
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "DNIe versi\xF3n 1" })
|
|
906
|
+
] }) }),
|
|
907
|
+
/* @__PURE__ */ jsxs("ul", { role: "none", className: "text-sm list-disc text-justify self-start pl-5", children: [
|
|
908
|
+
/* @__PURE__ */ jsx("li", { role: "none", className: "mb-2", children: /* @__PURE__ */ jsxs("p", { tabIndex: 0, children: [
|
|
909
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Chip en la parte delantera del DNI electr\xF3nico." }),
|
|
910
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Chip en la parte delantera del DNIe." })
|
|
911
|
+
] }) }),
|
|
912
|
+
/* @__PURE__ */ jsx("li", { role: "none", className: "mb-2", children: /* @__PURE__ */ jsxs("p", { tabIndex: 0, children: [
|
|
913
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Compatible solo con el lector del DNI electr\xF3nico en PC, Mac o laptop." }),
|
|
914
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Compatible solo con el lector del DNIe en PC, Mac o laptop." })
|
|
915
|
+
] }) })
|
|
916
|
+
] })
|
|
917
|
+
] }),
|
|
918
|
+
/* @__PURE__ */ jsx("div", { className: "w-[240px] sm:w-[200px] relative", children: iconDnie1 })
|
|
919
|
+
] }),
|
|
920
|
+
/* @__PURE__ */ jsxs("article", { className: "flex flex-col sm:flex-row items-center sm:items-start gap-10 sm:gap-[52px] w-full", children: [
|
|
921
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 w-full", children: [
|
|
922
|
+
/* @__PURE__ */ jsx("p", { className: "flex-1 mb-4", tabIndex: 0, children: /* @__PURE__ */ jsxs("span", { className: "font-bold", children: [
|
|
923
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "DNI electr\xF3nico versi\xF3n 2 y 3" }),
|
|
924
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "DNIe versi\xF3n 2 y 3" })
|
|
925
|
+
] }) }),
|
|
926
|
+
/* @__PURE__ */ jsxs("ul", { role: "none", className: "text-sm list-disc text-justify self-start pl-5", children: [
|
|
927
|
+
/* @__PURE__ */ jsx("li", { role: "none", className: "mb-2", children: /* @__PURE__ */ jsxs("p", { tabIndex: 0, children: [
|
|
928
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Chip en la parte posterior del DNI electr\xF3nico." }),
|
|
929
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Chip en la parte posterior del DNIe." })
|
|
930
|
+
] }) }),
|
|
931
|
+
/* @__PURE__ */ jsx("li", { role: "none", className: "mb-2", children: /* @__PURE__ */ jsxs("p", { tabIndex: 0, children: [
|
|
932
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Compatibles con el lector del DNI electr\xF3nico en PC, Mac o laptop y tecnolog\xEDa NFC (ISO 14443-B) en m\xF3viles." }),
|
|
933
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Compatibles con el lector del DNIe en PC, Mac o laptop y tecnolog\xEDa NFC (ISO 14443-B) en m\xF3viles." })
|
|
934
|
+
] }) })
|
|
935
|
+
] })
|
|
936
|
+
] }),
|
|
937
|
+
/* @__PURE__ */ jsxs("div", { className: "w-[240px] sm:w-[200px] h-[181px] relative", children: [
|
|
938
|
+
iconDnie2,
|
|
939
|
+
iconDnie3
|
|
940
|
+
] })
|
|
941
|
+
] })
|
|
942
|
+
] })
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
};
|
|
947
|
+
var ModalNfc = ({
|
|
948
|
+
isOpen = false,
|
|
949
|
+
onClose = () => {
|
|
950
|
+
},
|
|
951
|
+
className = "",
|
|
952
|
+
iconNfc1,
|
|
953
|
+
iconNfc2: _iconNfc2,
|
|
954
|
+
zIndexLevel = 100
|
|
955
|
+
}) => {
|
|
956
|
+
const ANDROID_VIDEO_URL = "https://www.youtube.com/watch?v=qlVVC9JHSro";
|
|
957
|
+
const IPHONE_VIDEO_URL = "https://www.youtube.com/watch?v=wjzh_FUVXRE";
|
|
958
|
+
return /* @__PURE__ */ jsxs(
|
|
959
|
+
Modal,
|
|
960
|
+
{
|
|
961
|
+
zIndexLevel,
|
|
962
|
+
isOpen,
|
|
963
|
+
onClose,
|
|
964
|
+
className: `!max-w-[600px] !pt-[46px] !pb-[46px] !px-[30px] md:!px-[50px] ${className}`,
|
|
965
|
+
closeButton: true,
|
|
966
|
+
children: [
|
|
967
|
+
/* @__PURE__ */ jsx("h2", { className: "text-center text-onpe-blue font-bold text-base", tabIndex: 0, children: "\xBFC\xF3mo saber si tu dispositivo m\xF3vil tiene NFC?" }),
|
|
968
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-6 items-center mt-8 text-sm w-full", children: [
|
|
969
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
970
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-justify mb-3", tabIndex: 0, children: [
|
|
971
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1", children: "1." }),
|
|
972
|
+
"Celular / Tablet Android"
|
|
973
|
+
] }),
|
|
974
|
+
/* @__PURE__ */ jsxs("ul", { role: "presentation", className: "list-disc pl-[26px] mt-2", children: [
|
|
975
|
+
/* @__PURE__ */ jsx("li", { role: "presentation", className: "text-sm text-left mb-2 tracking-[0.15px]", children: "Desde la barra de notificaciones, simplemente deslizando hacia abajo desde tu pantalla y buscando el \xEDcono del NFC." }),
|
|
976
|
+
/* @__PURE__ */ jsxs("li", { role: "presentation", className: "text-sm text-left mb-2 tracking-[0.15px]", children: [
|
|
977
|
+
"Otra forma es ir hacia Ajustes",
|
|
978
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " > " }),
|
|
979
|
+
"Conexiones o Redes Inal\xE1mbricas",
|
|
980
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " > " }),
|
|
981
|
+
'Buscar "NFC".'
|
|
982
|
+
] })
|
|
983
|
+
] })
|
|
984
|
+
] }),
|
|
985
|
+
iconNfc1,
|
|
986
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
987
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-justify mb-3", tabIndex: 0, children: [
|
|
988
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1", children: "2." }),
|
|
989
|
+
"Celular iPhone"
|
|
990
|
+
] }),
|
|
991
|
+
/* @__PURE__ */ jsx("ul", { role: "presentation", className: "list-disc pl-[26px] mt-2", children: /* @__PURE__ */ jsx("li", { role: "presentation", className: "text-sm text-left mb-2 tracking-[0.15px]", children: "Todos los modelos iPhone 7 en adelante ya cuentan con tecnolog\xEDa NFC activa." }) })
|
|
992
|
+
] }),
|
|
993
|
+
/* @__PURE__ */ jsx("h2", { className: "text-center text-onpe-blue font-bold my-5 text-base", tabIndex: 0, children: "\xBFC\xF3mo usar el NFC correctamente?" }),
|
|
994
|
+
/* @__PURE__ */ jsx("div", { className: "pl-3 w-full", children: /* @__PURE__ */ jsxs("ol", { role: "presentation", className: "text-sm text-justify list-decimal list-outside", children: [
|
|
995
|
+
/* @__PURE__ */ jsx("li", { role: "presentation", className: "mb-2", children: "Activa el NFC en tu celular." }),
|
|
996
|
+
/* @__PURE__ */ jsx("li", { role: "presentation", className: "mb-2", children: "Busca en internet d\xF3nde est\xE1 el lector NFC seg\xFAn tu modelo." }),
|
|
997
|
+
/* @__PURE__ */ jsx("li", { role: "presentation", className: "mb-2", children: "Coloca tu DNIe sobre esa zona hasta que recibas una confirmaci\xF3n del sistema." }),
|
|
998
|
+
/* @__PURE__ */ jsx("li", { role: "presentation", className: "mb-2", children: 'Puedes consultar los videos "Aprende como leer tu DNIe con NFC":' })
|
|
999
|
+
] }) }),
|
|
1000
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-5 justify-center items-center", children: [
|
|
1001
|
+
/* @__PURE__ */ jsxs(
|
|
1002
|
+
"a",
|
|
1003
|
+
{
|
|
1004
|
+
className: "text-onpe-skyblue flex flex-row gap-2.5 justify-center items-center no-underline cursor-pointer rounded-lg px-2.5 py-1.5 transition-colors duration-[120ms] focus-visible:outline-2 focus-visible:outline-onpe-blue focus-visible:outline-offset-2",
|
|
1005
|
+
href: ANDROID_VIDEO_URL,
|
|
1006
|
+
target: "_blank",
|
|
1007
|
+
rel: "noopener noreferrer",
|
|
1008
|
+
"aria-label": "Ver video para Android en YouTube",
|
|
1009
|
+
children: [
|
|
1010
|
+
/* @__PURE__ */ jsx(IconAndroid, {}),
|
|
1011
|
+
"Android"
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
),
|
|
1015
|
+
/* @__PURE__ */ jsxs(
|
|
1016
|
+
"a",
|
|
1017
|
+
{
|
|
1018
|
+
className: "text-onpe-skyblue flex flex-row gap-2.5 justify-center items-center no-underline cursor-pointer rounded-lg px-2.5 py-1.5 transition-colors duration-[120ms] focus-visible:outline-2 focus-visible:outline-onpe-blue focus-visible:outline-offset-2",
|
|
1019
|
+
href: IPHONE_VIDEO_URL,
|
|
1020
|
+
target: "_blank",
|
|
1021
|
+
rel: "noopener noreferrer",
|
|
1022
|
+
"aria-label": "Ver video para iPhone en YouTube",
|
|
1023
|
+
children: [
|
|
1024
|
+
/* @__PURE__ */ jsx(IconApple, {}),
|
|
1025
|
+
"iPhone"
|
|
1026
|
+
]
|
|
1027
|
+
}
|
|
1028
|
+
)
|
|
1029
|
+
] })
|
|
1030
|
+
] })
|
|
1031
|
+
]
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
export { BrowserRecommended, Button, Footer, Modal, ModalBrowserIncompatible, ModalConfirm, ModalDnieVersions, ModalLoading, ModalNfc, ModalSystemIncompatible, NotRecommended, Overlay, Portal, Show };
|
|
1037
|
+
//# sourceMappingURL=chunk-VPOCM2HP.mjs.map
|
|
1038
|
+
//# sourceMappingURL=chunk-VPOCM2HP.mjs.map
|