@proef/common-ui 2.6.19 → 2.6.21
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/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v1/capabilities/onepoint-rn/bridge.js +3 -1
- package/dist/esm/v1/capabilities/onepoint-rn/bridge.js.map +1 -1
- package/dist/esm/v1/capabilities/onepoint-rn/useBarraEstadoNaApp.js +11 -0
- package/dist/esm/v1/capabilities/onepoint-rn/useBarraEstadoNaApp.js.map +1 -0
- package/dist/esm/v1/components/layout/AppShell/AppShell.js +8 -5
- package/dist/esm/v1/components/layout/AppShell/AppShell.js.map +1 -1
- package/dist/esm/v1/components/layout/SideNav/SideNav.js +251 -215
- package/dist/esm/v1/components/layout/SideNav/SideNav.js.map +1 -1
- package/dist/style.components.css +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/types/v1/capabilities/onepoint-rn/bridge.d.ts +4 -1
- package/dist/types/v1/capabilities/onepoint-rn/useBarraEstadoNaApp.d.ts +2 -0
- package/dist/types/v1/components/layout/SideNav/SideNav.d.ts +1 -0
- package/dist/types/v1/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect, useRef } from "react";
|
|
3
3
|
import { useLocation, NavLink } from "react-router-dom";
|
|
4
4
|
import { dentroDaApp } from "../../../capabilities/onepoint-rn/dentroDaApp.js";
|
|
5
5
|
import { useMenuLateralNaApp } from "../../../capabilities/onepoint-rn/useMenuLateralNaApp.js";
|
|
6
|
+
import { useBarraEstadoNaApp } from "../../../capabilities/onepoint-rn/useBarraEstadoNaApp.js";
|
|
7
|
+
import { useIsDark } from "../../../capabilities/theme/useIsDark.js";
|
|
8
|
+
import { nativo } from "../../../capabilities/onepoint-rn/bridge.js";
|
|
6
9
|
import { SunIcon, MoonIcon, MonitorIcon, CloseIcon, ChevronLeftIcon, ChevronRightIcon, PanelOpenIcon, ChevronDownIcon, GlobeIcon, LogOutIcon, ExternalLinkIcon } from "../../../foundations/icons/icons.js";
|
|
7
10
|
const SIDENAV_LABELS = {
|
|
8
11
|
openMenu: "Abrir menu",
|
|
@@ -17,6 +20,7 @@ const SIDENAV_LABELS = {
|
|
|
17
20
|
system: "Sistema",
|
|
18
21
|
language: "Idioma",
|
|
19
22
|
logout: "Terminar sessão",
|
|
23
|
+
backToApp: "Sair",
|
|
20
24
|
deployedAt: "Último deploy"
|
|
21
25
|
};
|
|
22
26
|
const DRAWER_MAX = 1024;
|
|
@@ -56,6 +60,9 @@ function SideNav({
|
|
|
56
60
|
[menuProp, naApp, naAppPorOmissao]
|
|
57
61
|
);
|
|
58
62
|
const mostrarLogout = onLogout && !naApp;
|
|
63
|
+
const voltarAOnePoint = () => {
|
|
64
|
+
nativo.sairDoPortal().catch(() => void 0);
|
|
65
|
+
};
|
|
59
66
|
const labels = { ...SIDENAV_LABELS, ...labelsProp };
|
|
60
67
|
const location = useLocation();
|
|
61
68
|
const [hovered, setHovered] = useState(false);
|
|
@@ -70,6 +77,8 @@ function SideNav({
|
|
|
70
77
|
return () => mq.removeEventListener("change", onChange);
|
|
71
78
|
}, []);
|
|
72
79
|
useMenuLateralNaApp(gaveta);
|
|
80
|
+
const escuro = useIsDark();
|
|
81
|
+
useBarraEstadoNaApp(gaveta ? open || escuro ? "claros" : "escuros" : null);
|
|
73
82
|
const expanded = open || hovered || gaveta;
|
|
74
83
|
const [animar, setAnimar] = useState(false);
|
|
75
84
|
const estadoVisto = useRef(`${open}|${expanded}`);
|
|
@@ -130,7 +139,7 @@ function SideNav({
|
|
|
130
139
|
if (!a.moveu && Math.abs(d) < 6) return;
|
|
131
140
|
a.moveu = true;
|
|
132
141
|
a.desvio = open ? Math.max(-a.tamanho, Math.min(0, d)) : Math.max(0, Math.min(a.tamanho, d));
|
|
133
|
-
setDesvio({ px: a.desvio, deitado: a.deitado });
|
|
142
|
+
setDesvio({ px: a.desvio, deitado: a.deitado, tamanho: a.tamanho });
|
|
134
143
|
};
|
|
135
144
|
const onTabUp = (e) => {
|
|
136
145
|
const a = arrasto.current;
|
|
@@ -208,240 +217,267 @@ function SideNav({
|
|
|
208
217
|
item.to
|
|
209
218
|
);
|
|
210
219
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
220
|
+
const fundo = desvio ? Math.abs((open ? desvio.tamanho : 0) + desvio.px) / Math.max(1, desvio.tamanho) : open ? 1 : 0;
|
|
221
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
"aria-hidden": true,
|
|
226
|
+
onClick: () => onOpenChange(false),
|
|
227
|
+
style: {
|
|
228
|
+
opacity: fundo,
|
|
229
|
+
visibility: fundo > 0 ? "visible" : "hidden",
|
|
230
|
+
pointerEvents: open && !desvio ? "auto" : "none",
|
|
231
|
+
transition: desvio ? "none" : "opacity 300ms, visibility 300ms"
|
|
232
|
+
},
|
|
233
|
+
className: "fixed inset-0 z-30 bg-slate-900/50 backdrop-blur-sm lg:hidden"
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ jsxs(
|
|
237
|
+
"aside",
|
|
238
|
+
{
|
|
239
|
+
onPointerEnter: (e) => {
|
|
240
|
+
if (e.pointerType === "mouse" && !open) setHovered(true);
|
|
241
|
+
},
|
|
242
|
+
onPointerLeave: () => setHovered(false),
|
|
243
|
+
ref: asideRef,
|
|
244
|
+
style: {
|
|
245
|
+
top: "var(--app-shell-top, 0px)",
|
|
246
|
+
height: "calc(100dvh - var(--app-shell-top, 0px))",
|
|
247
|
+
paddingTop: "var(--sidenav-topo, 0px)",
|
|
248
|
+
// A espreitar (toque com a gaveta fechada): com a transição de sempre, para ir e voltar suave.
|
|
249
|
+
...espreita !== null && !open && !desvio && { translate: espreita ? "0 calc(-100% + 20px)" : "calc(-100% + 20px) 0" },
|
|
250
|
+
...desvio && {
|
|
251
|
+
translate: desvio.deitado ? `0 calc(${open ? "0%" : "-100%"} + ${desvio.px}px)` : `calc(${open ? "0%" : "-100%"} + ${desvio.px}px) 0`,
|
|
252
|
+
transition: "none"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
className: (
|
|
256
|
+
// max-lg:overflow-visible: o separador vive fora da gaveta (a lista e o rodapé tratam do seu próprio scroll).
|
|
257
|
+
// Gaveta (max-lg) sem o risco da borda: o separador sai dessa borda e o risco cortava-o da gaveta.
|
|
258
|
+
// Deitado, o canto de baixo à esquerda é reto — é dali que o separador se pendura.
|
|
259
|
+
`fixed left-0 z-40 flex w-64 flex-col overflow-hidden max-lg:overflow-visible border-r border-white/10 max-lg:border-r-0 bg-proef-navy text-white duration-300 ${animar ? "transition-[translate,width,box-shadow]" : ""} max-lg:[@media(max-height:500px)]:right-0 max-lg:[@media(max-height:500px)]:w-auto max-lg:[@media(max-height:500px)]:h-auto! max-lg:[@media(max-height:500px)]:max-h-[85dvh] max-lg:[@media(max-height:500px)]:rounded-br-2xl max-lg:[@media(max-height:500px)]:pl-[env(safe-area-inset-left)] max-lg:[@media(max-height:500px)]:pr-[env(safe-area-inset-right)] max-lg:[@media(max-height:500px)]:translate-x-0 ${open ? "translate-x-0 max-lg:[@media(max-height:500px)]:translate-y-0 max-lg:[@media(max-height:500px)]:shadow-2xl" : "-translate-x-full max-lg:[@media(max-height:500px)]:-translate-y-full"} lg:translate-x-0 ${expanded ? "lg:w-64" : "lg:w-20"}`
|
|
260
|
+
),
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ jsxs("div", { className: `flex h-16 max-lg:[@media(max-height:500px)]:h-14 flex-none items-center px-4 ${expanded ? "justify-between" : "justify-center"}`, children: [
|
|
263
|
+
expanded && /* @__PURE__ */ jsxs("div", { className: "flex flex-col pl-2", children: [
|
|
264
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
265
|
+
/* @__PURE__ */ jsx("span", { className: "text-3xl font-black tracking-tighter text-white", children: "proef" }),
|
|
266
|
+
/* @__PURE__ */ jsx("span", { className: "mt-3 h-2 w-2 rounded-full bg-proef-turquoise motion-safe:animate-pulse" })
|
|
267
|
+
] }),
|
|
268
|
+
appTitle && /* @__PURE__ */ jsx("span", { className: "mt-1 pl-1 text-[10px] font-black tracking-[0.3em] text-white/50 uppercase", children: appTitle })
|
|
241
269
|
] }),
|
|
242
|
-
|
|
270
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
271
|
+
avatar && /* @__PURE__ */ jsx("div", { className: "flex-none", children: avatar }),
|
|
272
|
+
open && expanded && !gaveta && /* @__PURE__ */ jsxs(
|
|
273
|
+
"button",
|
|
274
|
+
{
|
|
275
|
+
type: "button",
|
|
276
|
+
onClick: () => onOpenChange(false),
|
|
277
|
+
"aria-label": isDrawer() ? labels.closeMenu : labels.collapseMenu,
|
|
278
|
+
className: "flex cursor-pointer items-center justify-center rounded-lg border-0 bg-white/5 p-2.5 text-white/40 transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none max-lg:hidden lg:p-1.5",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx(CloseIcon, { size: 18, className: "lg:hidden" }),
|
|
281
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16, className: "hidden lg:block" })
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
!open && expanded && /* @__PURE__ */ jsx(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
type: "button",
|
|
289
|
+
onClick: () => onOpenChange(true),
|
|
290
|
+
"aria-label": labels.expandMenu,
|
|
291
|
+
className: "hidden cursor-pointer items-center justify-center rounded-lg border-0 bg-white/5 p-1.5 text-white/40 transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none lg:flex",
|
|
292
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: 16 })
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] })
|
|
243
296
|
] }),
|
|
244
|
-
/* @__PURE__ */ jsxs("
|
|
245
|
-
|
|
246
|
-
open && expanded && !gaveta && /* @__PURE__ */ jsxs(
|
|
247
|
-
"button",
|
|
248
|
-
{
|
|
249
|
-
type: "button",
|
|
250
|
-
onClick: () => onOpenChange(false),
|
|
251
|
-
"aria-label": isDrawer() ? labels.closeMenu : labels.collapseMenu,
|
|
252
|
-
className: "flex cursor-pointer items-center justify-center rounded-lg border-0 bg-white/5 p-2.5 text-white/40 transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none max-lg:hidden lg:p-1.5",
|
|
253
|
-
children: [
|
|
254
|
-
/* @__PURE__ */ jsx(CloseIcon, { size: 18, className: "lg:hidden" }),
|
|
255
|
-
/* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16, className: "hidden lg:block" })
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
),
|
|
259
|
-
!open && expanded && /* @__PURE__ */ jsx(
|
|
297
|
+
/* @__PURE__ */ jsxs("nav", { className: "flex-1 overflow-x-hidden overflow-y-auto pt-2 max-lg:[@media(max-height:500px)]:flex max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:items-stretch max-lg:[@media(max-height:500px)]:overflow-y-hidden max-lg:[@media(max-height:500px)]:gap-1 max-lg:[@media(max-height:500px)]:px-2 max-lg:[@media(max-height:500px)]:pt-0 max-lg:[@media(max-height:500px)]:pb-2", children: [
|
|
298
|
+
!expanded && /* @__PURE__ */ jsx(
|
|
260
299
|
"button",
|
|
261
300
|
{
|
|
262
301
|
type: "button",
|
|
263
302
|
onClick: () => onOpenChange(true),
|
|
303
|
+
"data-tip": labels.expandMenu,
|
|
264
304
|
"aria-label": labels.expandMenu,
|
|
265
|
-
className: "
|
|
266
|
-
children: /* @__PURE__ */ jsx(
|
|
305
|
+
className: "mb-1 flex w-full cursor-pointer items-center justify-center border-0 bg-transparent py-3 text-white/40 transition-colors hover:bg-white/5 hover:text-white focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none",
|
|
306
|
+
children: /* @__PURE__ */ jsx(PanelOpenIcon, { size: 20 })
|
|
267
307
|
}
|
|
268
|
-
)
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
308
|
+
),
|
|
309
|
+
ungrouped.length > 0 && /* @__PURE__ */ jsx("div", { className: "max-lg:[@media(max-height:500px)]:min-w-40 max-lg:[@media(max-height:500px)]:flex-1 max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:overflow-y-auto max-lg:[@media(max-height:500px)]:mt-[1.875rem]", children: ungrouped.map(renderItem) }),
|
|
310
|
+
groups.map((g) => {
|
|
311
|
+
const isOpen = expanded ? !collapsed[g] : g === activeGroup;
|
|
312
|
+
const name = groupLabels[g] ?? g;
|
|
313
|
+
return /* @__PURE__ */ jsxs(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
className: "max-lg:[@media(max-height:500px)]:flex max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:min-w-40 max-lg:[@media(max-height:500px)]:flex-1 max-lg:[@media(max-height:500px)]:flex-col",
|
|
317
|
+
children: [
|
|
318
|
+
expanded ? /* @__PURE__ */ jsxs(
|
|
319
|
+
"button",
|
|
320
|
+
{
|
|
321
|
+
type: "button",
|
|
322
|
+
onClick: () => setCollapsed((prev) => ({ ...prev, [g]: !prev[g] })),
|
|
323
|
+
"aria-expanded": isOpen,
|
|
324
|
+
"aria-label": `${isOpen ? labels.closeGroup : labels.openGroup} ${name}`,
|
|
325
|
+
className: "group/grp w-full cursor-pointer border-0 bg-transparent px-6 pt-5 pb-3 text-left focus-visible:outline-none lg:pb-1.5 max-lg:[@media(max-height:500px)]:flex-none max-lg:[@media(max-height:500px)]:px-3 max-lg:[@media(max-height:500px)]:pt-2 max-lg:[@media(max-height:500px)]:pb-1.5",
|
|
326
|
+
children: [
|
|
327
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center justify-between", children: [
|
|
328
|
+
/* @__PURE__ */ jsx("span", { className: "text-[9px] font-black tracking-[0.25em] text-white/30 uppercase transition-colors group-hover/grp:text-white/50 group-focus-visible/grp:text-white", children: name }),
|
|
329
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 10, className: `text-white/30 transition-transform group-hover/grp:text-white/50 ${isOpen ? "" : "-rotate-90"}` })
|
|
330
|
+
] }),
|
|
331
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block h-px bg-white/10" })
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
) : isOpen && /* @__PURE__ */ jsx("div", { className: "mx-auto my-3 h-px w-8 bg-white/15" }),
|
|
335
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: "max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:flex-1 max-lg:[@media(max-height:500px)]:overflow-y-auto max-lg:[@media(max-height:500px)]:[scrollbar-width:thin] max-lg:[@media(max-height:500px)]:[scrollbar-color:rgba(255,255,255,0.15)_transparent]", children: menu.filter((item) => item.group === g).map(renderItem) })
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
g
|
|
339
|
+
);
|
|
340
|
+
})
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ jsxs(
|
|
343
|
+
"div",
|
|
274
344
|
{
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
ungrouped.length > 0 && /* @__PURE__ */ jsx("div", { className: "max-lg:[@media(max-height:500px)]:min-w-40 max-lg:[@media(max-height:500px)]:flex-1 max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:overflow-y-auto max-lg:[@media(max-height:500px)]:mt-[1.875rem]", children: ungrouped.map(renderItem) }),
|
|
284
|
-
groups.map((g) => {
|
|
285
|
-
const isOpen = expanded ? !collapsed[g] : g === activeGroup;
|
|
286
|
-
const name = groupLabels[g] ?? g;
|
|
287
|
-
return /* @__PURE__ */ jsxs(
|
|
288
|
-
"div",
|
|
289
|
-
{
|
|
290
|
-
className: "max-lg:[@media(max-height:500px)]:flex max-lg:[@media(max-height:500px)]:min-h-0 max-lg:[@media(max-height:500px)]:min-w-40 max-lg:[@media(max-height:500px)]:flex-1 max-lg:[@media(max-height:500px)]:flex-col",
|
|
291
|
-
children: [
|
|
292
|
-
expanded ? /* @__PURE__ */ jsxs(
|
|
345
|
+
className: `mt-auto flex flex-none flex-col border-t border-white/10 px-2 py-3 max-lg:[@media(max-height:500px)]:mt-0 max-lg:[@media(max-height:500px)]:flex-row max-lg:[@media(max-height:500px)]:items-center max-lg:[@media(max-height:500px)]:px-3 max-lg:[@media(max-height:500px)]:py-2 ${expanded ? "gap-2" : "items-center gap-3"}`,
|
|
346
|
+
children: [
|
|
347
|
+
footer && /* @__PURE__ */ jsx("div", { className: expanded ? "max-lg:[@media(max-height:500px)]:min-w-0 max-lg:[@media(max-height:500px)]:flex-1" : "flex w-full justify-center", children: footer(expanded) }),
|
|
348
|
+
onThemeChange && (expanded ? /* @__PURE__ */ jsxs("div", { children: [
|
|
349
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 px-1 pb-1 text-[8px] font-black tracking-[0.25em] text-white/30 uppercase", children: labels.theme }),
|
|
350
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": labels.theme, className: "grid grid-cols-3 gap-1 rounded-lg border border-white/5 bg-white/5 p-1", children: themeOptions.map(({ value, Icon, label }) => /* @__PURE__ */ jsxs(
|
|
293
351
|
"button",
|
|
294
352
|
{
|
|
295
353
|
type: "button",
|
|
296
|
-
onClick: () =>
|
|
297
|
-
"aria-
|
|
298
|
-
|
|
299
|
-
className: "group/grp w-full cursor-pointer border-0 bg-transparent px-6 pt-5 pb-3 text-left focus-visible:outline-none lg:pb-1.5 max-lg:[@media(max-height:500px)]:flex-none max-lg:[@media(max-height:500px)]:px-3 max-lg:[@media(max-height:500px)]:pt-2 max-lg:[@media(max-height:500px)]:pb-1.5",
|
|
354
|
+
onClick: () => onThemeChange(value),
|
|
355
|
+
"aria-pressed": currentTheme.value === value,
|
|
356
|
+
className: `flex cursor-pointer flex-col items-center gap-1 rounded-md border-0 py-1.5 text-[8px] font-black tracking-wider uppercase transition-colors focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none ${currentTheme.value === value ? "bg-proef-turquoise/15 text-proef-turquoise" : "bg-transparent text-white/40 hover:bg-white/5 hover:text-white/70"}`,
|
|
300
357
|
children: [
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
|
|
303
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 10, className: `text-white/30 transition-transform group-hover/grp:text-white/50 ${isOpen ? "" : "-rotate-90"}` })
|
|
304
|
-
] }),
|
|
305
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block h-px bg-white/10" })
|
|
358
|
+
/* @__PURE__ */ jsx(Icon, { size: 14 }),
|
|
359
|
+
label
|
|
306
360
|
]
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
]
|
|
311
|
-
},
|
|
312
|
-
g
|
|
313
|
-
);
|
|
314
|
-
})
|
|
315
|
-
] }),
|
|
316
|
-
/* @__PURE__ */ jsxs(
|
|
317
|
-
"div",
|
|
318
|
-
{
|
|
319
|
-
className: `mt-auto flex flex-none flex-col border-t border-white/10 px-2 py-3 max-lg:[@media(max-height:500px)]:mt-0 max-lg:[@media(max-height:500px)]:flex-row max-lg:[@media(max-height:500px)]:items-center max-lg:[@media(max-height:500px)]:px-3 max-lg:[@media(max-height:500px)]:py-2 ${expanded ? "gap-2" : "items-center gap-3"}`,
|
|
320
|
-
children: [
|
|
321
|
-
footer && /* @__PURE__ */ jsx("div", { className: expanded ? "max-lg:[@media(max-height:500px)]:min-w-0 max-lg:[@media(max-height:500px)]:flex-1" : "flex w-full justify-center", children: footer(expanded) }),
|
|
322
|
-
onThemeChange && (expanded ? /* @__PURE__ */ jsxs("div", { children: [
|
|
323
|
-
/* @__PURE__ */ jsx("p", { className: "m-0 px-1 pb-1 text-[8px] font-black tracking-[0.25em] text-white/30 uppercase", children: labels.theme }),
|
|
324
|
-
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": labels.theme, className: "grid grid-cols-3 gap-1 rounded-lg border border-white/5 bg-white/5 p-1", children: themeOptions.map(({ value, Icon, label }) => /* @__PURE__ */ jsxs(
|
|
361
|
+
},
|
|
362
|
+
value
|
|
363
|
+
)) })
|
|
364
|
+
] }) : /* @__PURE__ */ jsx(
|
|
325
365
|
"button",
|
|
326
366
|
{
|
|
327
367
|
type: "button",
|
|
328
|
-
onClick: () => onThemeChange(value),
|
|
329
|
-
"aria-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
"aria-label": `${labels.theme}: ${currentTheme.label}`,
|
|
344
|
-
"data-tip": `${labels.theme}: ${currentTheme.label}`,
|
|
345
|
-
className: footerIconButton,
|
|
346
|
-
children: /* @__PURE__ */ jsx(currentTheme.Icon, { size: 18 })
|
|
347
|
-
}
|
|
348
|
-
)),
|
|
349
|
-
languages && languages.length > 0 && onLanguageChange && (expanded ? /* @__PURE__ */ jsx("div", { role: "group", "aria-label": labels.language, className: "flex gap-1 max-lg:[@media(max-height:500px)]:w-28 max-lg:[@media(max-height:500px)]:flex-none", children: languages.map((l) => /* @__PURE__ */ jsx(
|
|
350
|
-
"button",
|
|
351
|
-
{
|
|
352
|
-
type: "button",
|
|
353
|
-
onClick: () => onLanguageChange(l.code),
|
|
354
|
-
"aria-pressed": currentLanguage === l.code,
|
|
355
|
-
className: `flex-1 cursor-pointer rounded-md border bg-transparent py-1.5 text-[10px] font-black tracking-widest uppercase transition-colors focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none ${currentLanguage === l.code ? "border-proef-turquoise/40 text-proef-turquoise" : "border-white/5 text-white/40 hover:border-white/20 hover:text-white"}`,
|
|
356
|
-
children: l.label
|
|
357
|
-
},
|
|
358
|
-
l.code
|
|
359
|
-
)) }) : /* @__PURE__ */ jsx(
|
|
360
|
-
"button",
|
|
361
|
-
{
|
|
362
|
-
type: "button",
|
|
363
|
-
onClick: () => {
|
|
364
|
-
const codes = languages.map((l) => l.code);
|
|
365
|
-
onLanguageChange(cycle(codes, currentLanguage ?? codes[0]));
|
|
368
|
+
onClick: () => onThemeChange(cycle(themeOptions, currentTheme).value),
|
|
369
|
+
"aria-label": `${labels.theme}: ${currentTheme.label}`,
|
|
370
|
+
"data-tip": `${labels.theme}: ${currentTheme.label}`,
|
|
371
|
+
className: footerIconButton,
|
|
372
|
+
children: /* @__PURE__ */ jsx(currentTheme.Icon, { size: 18 })
|
|
373
|
+
}
|
|
374
|
+
)),
|
|
375
|
+
languages && languages.length > 0 && onLanguageChange && (expanded ? /* @__PURE__ */ jsx("div", { role: "group", "aria-label": labels.language, className: "flex gap-1 max-lg:[@media(max-height:500px)]:w-28 max-lg:[@media(max-height:500px)]:flex-none", children: languages.map((l) => /* @__PURE__ */ jsx(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
onClick: () => onLanguageChange(l.code),
|
|
380
|
+
"aria-pressed": currentLanguage === l.code,
|
|
381
|
+
className: `flex-1 cursor-pointer rounded-md border bg-transparent py-1.5 text-[10px] font-black tracking-widest uppercase transition-colors focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none ${currentLanguage === l.code ? "border-proef-turquoise/40 text-proef-turquoise" : "border-white/5 text-white/40 hover:border-white/20 hover:text-white"}`,
|
|
382
|
+
children: l.label
|
|
366
383
|
},
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
children: [
|
|
413
|
-
/* @__PURE__ */ jsx(
|
|
414
|
-
"svg",
|
|
415
|
-
{
|
|
416
|
-
"aria-hidden": true,
|
|
417
|
-
viewBox: "0 0 22 72",
|
|
418
|
-
className: "pointer-events-none absolute -top-2 -left-0.5 h-[72px] w-[22px] fill-proef-navy max-lg:[@media(max-height:500px)]:hidden",
|
|
419
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0 0H2A8 8 0 0 0 10 8H14A8 8 0 0 1 22 16V56A8 8 0 0 1 14 64H10A8 8 0 0 0 2 72H0Z" })
|
|
384
|
+
l.code
|
|
385
|
+
)) }) : /* @__PURE__ */ jsx(
|
|
386
|
+
"button",
|
|
387
|
+
{
|
|
388
|
+
type: "button",
|
|
389
|
+
onClick: () => {
|
|
390
|
+
const codes = languages.map((l) => l.code);
|
|
391
|
+
onLanguageChange(cycle(codes, currentLanguage ?? codes[0]));
|
|
392
|
+
},
|
|
393
|
+
"aria-label": `${labels.language}: ${currentLanguage?.toUpperCase() ?? ""}`,
|
|
394
|
+
"data-tip": `${labels.language}: ${currentLanguage?.toUpperCase() ?? ""}`,
|
|
395
|
+
className: footerIconButton,
|
|
396
|
+
children: /* @__PURE__ */ jsx(GlobeIcon, { size: 18 })
|
|
397
|
+
}
|
|
398
|
+
)),
|
|
399
|
+
mostrarLogout && (expanded ? /* @__PURE__ */ jsx(
|
|
400
|
+
"button",
|
|
401
|
+
{
|
|
402
|
+
type: "button",
|
|
403
|
+
onClick: onLogout,
|
|
404
|
+
className: "w-full max-lg:[@media(max-height:500px)]:w-auto max-lg:[@media(max-height:500px)]:flex-none max-lg:[@media(max-height:500px)]:px-4 max-lg:[@media(max-height:500px)]:py-2 cursor-pointer rounded-lg border border-white/5 bg-transparent py-2.5 text-center text-[10px] font-black tracking-widest text-white/40 uppercase transition-colors hover:border-proef-turquoise/30 hover:text-proef-turquoise focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none",
|
|
405
|
+
children: labels.logout
|
|
406
|
+
}
|
|
407
|
+
) : /* @__PURE__ */ jsx("button", { type: "button", onClick: onLogout, "aria-label": labels.logout, "data-tip": labels.logout, className: footerIconButton, children: /* @__PURE__ */ jsx(LogOutIcon, { size: 18 }) })),
|
|
408
|
+
naApp && (expanded ? /* @__PURE__ */ jsx(
|
|
409
|
+
"button",
|
|
410
|
+
{
|
|
411
|
+
type: "button",
|
|
412
|
+
onClick: voltarAOnePoint,
|
|
413
|
+
className: "w-full max-lg:[@media(max-height:500px)]:w-auto max-lg:[@media(max-height:500px)]:flex-none max-lg:[@media(max-height:500px)]:px-4 max-lg:[@media(max-height:500px)]:py-2 cursor-pointer rounded-lg border border-white/5 bg-transparent py-2.5 text-center text-[10px] font-black tracking-widest text-white/40 uppercase transition-colors hover:border-proef-turquoise/30 hover:text-proef-turquoise focus-visible:ring-2 focus-visible:ring-proef-turquoise/50 focus-visible:outline-none",
|
|
414
|
+
children: labels.backToApp
|
|
415
|
+
}
|
|
416
|
+
) : /* @__PURE__ */ jsx("button", { type: "button", onClick: voltarAOnePoint, "aria-label": labels.backToApp, "data-tip": labels.backToApp, className: footerIconButton, children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 18 }) })),
|
|
417
|
+
deployedAt != null && expanded && /* @__PURE__ */ jsx("p", { "data-tip": labels.deployedAt, className: "m-0 text-center text-[9px] tracking-wider text-white/25 tabular-nums select-text max-lg:[@media(max-height:500px)]:flex-none max-lg:[@media(max-height:500px)]:whitespace-nowrap", children: formatDeploy(deployedAt) })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
gaveta && /* @__PURE__ */ jsxs(
|
|
422
|
+
"button",
|
|
423
|
+
{
|
|
424
|
+
type: "button",
|
|
425
|
+
onClick: (e) => {
|
|
426
|
+
if (ignorarClique.current) {
|
|
427
|
+
ignorarClique.current = false;
|
|
428
|
+
return;
|
|
420
429
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
"aria-hidden": true,
|
|
426
|
-
viewBox: "0 0 56 22",
|
|
427
|
-
className: "pointer-events-none absolute -top-0.5 -left-2 hidden h-[22px] w-14 fill-proef-navy max-lg:[@media(max-height:500px)]:block",
|
|
428
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0 0H56V2A8 8 0 0 0 48 10V14A8 8 0 0 1 40 22H16A8 8 0 0 1 8 14V10A8 8 0 0 0 0 2Z" })
|
|
430
|
+
if (!open && e.detail !== 0) {
|
|
431
|
+
setAnimar(true);
|
|
432
|
+
setEspreita(isTopDrawer());
|
|
433
|
+
return;
|
|
429
434
|
}
|
|
435
|
+
onOpenChange(!open);
|
|
436
|
+
},
|
|
437
|
+
onPointerDown: onTabDown,
|
|
438
|
+
onPointerMove: onTabMove,
|
|
439
|
+
onPointerUp: onTabUp,
|
|
440
|
+
onPointerCancel: onTabCancel,
|
|
441
|
+
"aria-expanded": open,
|
|
442
|
+
"aria-label": open ? labels.closeMenu : labels.openMenu,
|
|
443
|
+
className: (
|
|
444
|
+
// touch-none: o arrasto é nosso — sem ele o browser rolava a página com o mesmo dedo.
|
|
445
|
+
`group/tab absolute top-[calc(0.75rem+var(--sidenav-topo,0px))] left-full flex h-14 w-5 touch-none select-none items-center justify-center gap-[3px] border-0 bg-transparent p-0 outline-none [-webkit-tap-highlight-color:transparent] lg:hidden ${desvio ? "cursor-grabbing" : "cursor-grab"} after:absolute after:-top-1 after:-bottom-1 after:left-0 after:-right-5 after:content-[''] max-lg:[@media(max-height:500px)]:top-full max-lg:[@media(max-height:500px)]:left-[calc(env(safe-area-inset-left,0px)+0.5rem)] max-lg:[@media(max-height:500px)]:h-5 max-lg:[@media(max-height:500px)]:w-10 max-lg:[@media(max-height:500px)]:flex-col max-lg:[@media(max-height:500px)]:after:right-0 max-lg:[@media(max-height:500px)]:after:-bottom-5`
|
|
430
446
|
),
|
|
431
|
-
[
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
"svg",
|
|
450
|
+
{
|
|
451
|
+
"aria-hidden": true,
|
|
452
|
+
viewBox: "0 0 22 72",
|
|
453
|
+
className: "pointer-events-none absolute -top-2 -left-0.5 h-[72px] w-[22px] fill-proef-navy max-lg:[@media(max-height:500px)]:hidden",
|
|
454
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0H2A8 8 0 0 0 10 8H14A8 8 0 0 1 22 16V56A8 8 0 0 1 14 64H10A8 8 0 0 0 2 72H0Z" })
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
/* @__PURE__ */ jsx(
|
|
458
|
+
"svg",
|
|
459
|
+
{
|
|
460
|
+
"aria-hidden": true,
|
|
461
|
+
viewBox: "0 0 56 22",
|
|
462
|
+
className: "pointer-events-none absolute -top-0.5 -left-2 hidden h-[22px] w-14 fill-proef-navy max-lg:[@media(max-height:500px)]:block",
|
|
463
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0H56V2A8 8 0 0 0 48 10V14A8 8 0 0 1 40 22H16A8 8 0 0 1 8 14V10A8 8 0 0 0 0 2Z" })
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
[0, 1].map((i) => /* @__PURE__ */ jsx(
|
|
467
|
+
"span",
|
|
468
|
+
{
|
|
469
|
+
"aria-hidden": true,
|
|
470
|
+
className: `pointer-events-none relative h-3.5 w-0.5 rounded-full transition-colors duration-150 max-lg:[@media(max-height:500px)]:h-0.5 max-lg:[@media(max-height:500px)]:w-3.5 group-active/tab:bg-proef-turquoise group-focus-visible/tab:bg-proef-turquoise ${desvio ? "bg-proef-turquoise" : "bg-white/35"}`
|
|
471
|
+
},
|
|
472
|
+
i
|
|
473
|
+
))
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
)
|
|
480
|
+
] });
|
|
445
481
|
}
|
|
446
482
|
export {
|
|
447
483
|
DRAWER_MAX,
|