@proef/common-ui 2.6.20 → 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 +2 -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 +246 -224
- 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 +3 -1
- package/dist/types/v1/capabilities/onepoint-rn/useBarraEstadoNaApp.d.ts +2 -0
- package/dist/types/v1/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
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";
|
|
6
8
|
import { nativo } from "../../../capabilities/onepoint-rn/bridge.js";
|
|
7
9
|
import { SunIcon, MoonIcon, MonitorIcon, CloseIcon, ChevronLeftIcon, ChevronRightIcon, PanelOpenIcon, ChevronDownIcon, GlobeIcon, LogOutIcon, ExternalLinkIcon } from "../../../foundations/icons/icons.js";
|
|
8
10
|
const SIDENAV_LABELS = {
|
|
@@ -75,6 +77,8 @@ function SideNav({
|
|
|
75
77
|
return () => mq.removeEventListener("change", onChange);
|
|
76
78
|
}, []);
|
|
77
79
|
useMenuLateralNaApp(gaveta);
|
|
80
|
+
const escuro = useIsDark();
|
|
81
|
+
useBarraEstadoNaApp(gaveta ? open || escuro ? "claros" : "escuros" : null);
|
|
78
82
|
const expanded = open || hovered || gaveta;
|
|
79
83
|
const [animar, setAnimar] = useState(false);
|
|
80
84
|
const estadoVisto = useRef(`${open}|${expanded}`);
|
|
@@ -135,7 +139,7 @@ function SideNav({
|
|
|
135
139
|
if (!a.moveu && Math.abs(d) < 6) return;
|
|
136
140
|
a.moveu = true;
|
|
137
141
|
a.desvio = open ? Math.max(-a.tamanho, Math.min(0, d)) : Math.max(0, Math.min(a.tamanho, d));
|
|
138
|
-
setDesvio({ px: a.desvio, deitado: a.deitado });
|
|
142
|
+
setDesvio({ px: a.desvio, deitado: a.deitado, tamanho: a.tamanho });
|
|
139
143
|
};
|
|
140
144
|
const onTabUp = (e) => {
|
|
141
145
|
const a = arrasto.current;
|
|
@@ -213,249 +217,267 @@ function SideNav({
|
|
|
213
217
|
item.to
|
|
214
218
|
);
|
|
215
219
|
};
|
|
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
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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 })
|
|
246
269
|
] }),
|
|
247
|
-
|
|
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
|
+
] })
|
|
248
296
|
] }),
|
|
249
|
-
/* @__PURE__ */ jsxs("
|
|
250
|
-
|
|
251
|
-
open && expanded && !gaveta && /* @__PURE__ */ jsxs(
|
|
252
|
-
"button",
|
|
253
|
-
{
|
|
254
|
-
type: "button",
|
|
255
|
-
onClick: () => onOpenChange(false),
|
|
256
|
-
"aria-label": isDrawer() ? labels.closeMenu : labels.collapseMenu,
|
|
257
|
-
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",
|
|
258
|
-
children: [
|
|
259
|
-
/* @__PURE__ */ jsx(CloseIcon, { size: 18, className: "lg:hidden" }),
|
|
260
|
-
/* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16, className: "hidden lg:block" })
|
|
261
|
-
]
|
|
262
|
-
}
|
|
263
|
-
),
|
|
264
|
-
!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(
|
|
265
299
|
"button",
|
|
266
300
|
{
|
|
267
301
|
type: "button",
|
|
268
302
|
onClick: () => onOpenChange(true),
|
|
303
|
+
"data-tip": labels.expandMenu,
|
|
269
304
|
"aria-label": labels.expandMenu,
|
|
270
|
-
className: "
|
|
271
|
-
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 })
|
|
272
307
|
}
|
|
273
|
-
)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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",
|
|
279
344
|
{
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
),
|
|
288
|
-
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) }),
|
|
289
|
-
groups.map((g) => {
|
|
290
|
-
const isOpen = expanded ? !collapsed[g] : g === activeGroup;
|
|
291
|
-
const name = groupLabels[g] ?? g;
|
|
292
|
-
return /* @__PURE__ */ jsxs(
|
|
293
|
-
"div",
|
|
294
|
-
{
|
|
295
|
-
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",
|
|
296
|
-
children: [
|
|
297
|
-
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(
|
|
298
351
|
"button",
|
|
299
352
|
{
|
|
300
353
|
type: "button",
|
|
301
|
-
onClick: () =>
|
|
302
|
-
"aria-
|
|
303
|
-
|
|
304
|
-
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"}`,
|
|
305
357
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
|
|
308
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 10, className: `text-white/30 transition-transform group-hover/grp:text-white/50 ${isOpen ? "" : "-rotate-90"}` })
|
|
309
|
-
] }),
|
|
310
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block h-px bg-white/10" })
|
|
358
|
+
/* @__PURE__ */ jsx(Icon, { size: 14 }),
|
|
359
|
+
label
|
|
311
360
|
]
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
]
|
|
316
|
-
},
|
|
317
|
-
g
|
|
318
|
-
);
|
|
319
|
-
})
|
|
320
|
-
] }),
|
|
321
|
-
/* @__PURE__ */ jsxs(
|
|
322
|
-
"div",
|
|
323
|
-
{
|
|
324
|
-
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"}`,
|
|
325
|
-
children: [
|
|
326
|
-
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) }),
|
|
327
|
-
onThemeChange && (expanded ? /* @__PURE__ */ jsxs("div", { children: [
|
|
328
|
-
/* @__PURE__ */ jsx("p", { className: "m-0 px-1 pb-1 text-[8px] font-black tracking-[0.25em] text-white/30 uppercase", children: labels.theme }),
|
|
329
|
-
/* @__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(
|
|
330
365
|
"button",
|
|
331
366
|
{
|
|
332
367
|
type: "button",
|
|
333
|
-
onClick: () => onThemeChange(value),
|
|
334
|
-
"aria-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
"aria-label": `${labels.theme}: ${currentTheme.label}`,
|
|
349
|
-
"data-tip": `${labels.theme}: ${currentTheme.label}`,
|
|
350
|
-
className: footerIconButton,
|
|
351
|
-
children: /* @__PURE__ */ jsx(currentTheme.Icon, { size: 18 })
|
|
352
|
-
}
|
|
353
|
-
)),
|
|
354
|
-
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(
|
|
355
|
-
"button",
|
|
356
|
-
{
|
|
357
|
-
type: "button",
|
|
358
|
-
onClick: () => onLanguageChange(l.code),
|
|
359
|
-
"aria-pressed": currentLanguage === l.code,
|
|
360
|
-
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"}`,
|
|
361
|
-
children: l.label
|
|
362
|
-
},
|
|
363
|
-
l.code
|
|
364
|
-
)) }) : /* @__PURE__ */ jsx(
|
|
365
|
-
"button",
|
|
366
|
-
{
|
|
367
|
-
type: "button",
|
|
368
|
-
onClick: () => {
|
|
369
|
-
const codes = languages.map((l) => l.code);
|
|
370
|
-
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
|
|
371
383
|
},
|
|
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
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
onPointerMove: onTabMove,
|
|
418
|
-
onPointerUp: onTabUp,
|
|
419
|
-
onPointerCancel: onTabCancel,
|
|
420
|
-
"aria-expanded": open,
|
|
421
|
-
"aria-label": open ? labels.closeMenu : labels.openMenu,
|
|
422
|
-
className: (
|
|
423
|
-
// touch-none: o arrasto é nosso — sem ele o browser rolava a página com o mesmo dedo.
|
|
424
|
-
`group/tab absolute top-3 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`
|
|
425
|
-
),
|
|
426
|
-
children: [
|
|
427
|
-
/* @__PURE__ */ jsx(
|
|
428
|
-
"svg",
|
|
429
|
-
{
|
|
430
|
-
"aria-hidden": true,
|
|
431
|
-
viewBox: "0 0 22 72",
|
|
432
|
-
className: "pointer-events-none absolute -top-2 -left-0.5 h-[72px] w-[22px] fill-proef-navy max-lg:[@media(max-height:500px)]:hidden",
|
|
433
|
-
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;
|
|
434
429
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
"aria-hidden": true,
|
|
440
|
-
viewBox: "0 0 56 22",
|
|
441
|
-
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",
|
|
442
|
-
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;
|
|
443
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`
|
|
444
446
|
),
|
|
445
|
-
[
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
+
] });
|
|
459
481
|
}
|
|
460
482
|
export {
|
|
461
483
|
DRAWER_MAX,
|