@fayz-ai/ui 0.33.1 → 0.35.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-Q2B5RPH5.js → chunk-2CRN3BOD.js} +4 -4
- package/dist/{chunk-Q2B5RPH5.js.map → chunk-2CRN3BOD.js.map} +1 -1
- package/dist/{chunk-33A7SN2N.js → chunk-63BB2CNP.js} +342 -232
- package/dist/chunk-63BB2CNP.js.map +1 -0
- package/dist/{chunk-UNEEY5XG.js → chunk-FNGCA3XR.js} +3 -3
- package/dist/{chunk-UNEEY5XG.js.map → chunk-FNGCA3XR.js.map} +1 -1
- package/dist/{chunk-6GWXDVCO.js → chunk-OBWOHU5E.js} +137 -224
- package/dist/chunk-OBWOHU5E.js.map +1 -0
- package/dist/dashboard/index.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/SaveBar.d.ts.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +3 -3
- package/dist/primitives/modal.d.ts +2 -0
- package/dist/primitives/modal.d.ts.map +1 -1
- package/dist/primitives/page-actions.d.ts.map +1 -1
- package/dist/primitives/person-picker.d.ts +1 -1
- package/dist/primitives/person-picker.d.ts.map +1 -1
- package/dist/styles.css +26 -0
- package/package.json +2 -2
- package/dist/chunk-33A7SN2N.js.map +0 -1
- package/dist/chunk-6GWXDVCO.js.map +0 -1
|
@@ -1,17 +1,120 @@
|
|
|
1
1
|
import { cn } from './chunk-OKZ6WQB3.js';
|
|
2
2
|
import { ICON_MAP } from './chunk-ATDIWKBD.js';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import * as React12 from 'react';
|
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import { X, Loader2, ChevronLeft, ArrowLeft, Bell, PanelLeft, PanelLeftClose, Search, CornerDownLeft, Menu, Crown, ChevronsRight, ChevronsLeft, ChevronDown, ChevronRight, Info, ExternalLink, CreditCard, Sparkles, Home, ChevronUp, Plus, Settings, UserCog, LogOut } from 'lucide-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
8
7
|
import { createPortal } from 'react-dom';
|
|
8
|
+
import { useTranslation, useNavReferrer, routeModule, navHistoryBack, recordNavigation } from '@fayz-ai/core';
|
|
9
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
9
10
|
import { create } from 'zustand';
|
|
10
11
|
import * as Popover from '@radix-ui/react-popover';
|
|
11
12
|
|
|
13
|
+
var SIZE_MAP = {
|
|
14
|
+
sm: "sm:max-w-sm",
|
|
15
|
+
md: "sm:max-w-md",
|
|
16
|
+
lg: "sm:max-w-lg",
|
|
17
|
+
xl: "sm:max-w-xl",
|
|
18
|
+
"2xl": "sm:max-w-2xl",
|
|
19
|
+
"3xl": "sm:max-w-3xl",
|
|
20
|
+
// Duas colunas de trabalho lado a lado (ficha + linha do tempo) não cabem em
|
|
21
|
+
// 3xl: a coluna da direita fica com 20rem e o texto de cada anotação quebra
|
|
22
|
+
// a cada quatro palavras.
|
|
23
|
+
"4xl": "sm:max-w-4xl",
|
|
24
|
+
"5xl": "sm:max-w-5xl",
|
|
25
|
+
full: "sm:max-w-[calc(100vw-4rem)]"
|
|
26
|
+
};
|
|
27
|
+
var Modal = DialogPrimitive.Root;
|
|
28
|
+
var ModalTrigger = DialogPrimitive.Trigger;
|
|
29
|
+
var ModalClose = DialogPrimitive.Close;
|
|
30
|
+
var ModalPortal = DialogPrimitive.Portal;
|
|
31
|
+
var ModalHostContext = React12.createContext(null);
|
|
32
|
+
function useModalHost() {
|
|
33
|
+
return React12.useContext(ModalHostContext);
|
|
34
|
+
}
|
|
35
|
+
var ModalOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
36
|
+
DialogPrimitive.Overlay,
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
className: cn(
|
|
40
|
+
"fayz-modal-overlay saas-mdl-ov fixed inset-0 z-[100]",
|
|
41
|
+
"flex items-center justify-center p-0 sm:p-6",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
));
|
|
47
|
+
ModalOverlay.displayName = "ModalOverlay";
|
|
48
|
+
var ModalContent = React12.forwardRef(({ className, children, size = "lg", hideClose, noPadding, onPointerDownOutside, onInteractOutside, onCloseAutoFocus, ...props }, ref) => {
|
|
49
|
+
const [host, setHost] = React12.useState(null);
|
|
50
|
+
const attach = React12.useCallback((node) => {
|
|
51
|
+
setHost(node);
|
|
52
|
+
if (typeof ref === "function") ref(node);
|
|
53
|
+
else if (ref) ref.current = node;
|
|
54
|
+
}, [ref]);
|
|
55
|
+
return /* @__PURE__ */ jsx(ModalPortal, { children: /* @__PURE__ */ jsx(ModalOverlay, { children: /* @__PURE__ */ jsxs(
|
|
56
|
+
DialogPrimitive.Content,
|
|
57
|
+
{
|
|
58
|
+
ref: attach,
|
|
59
|
+
onCloseAutoFocus: (e) => {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
onCloseAutoFocus?.(e);
|
|
62
|
+
},
|
|
63
|
+
onPointerDownOutside: (e) => {
|
|
64
|
+
const target = e.target;
|
|
65
|
+
if (target.closest("[data-modal-passthrough]") || target.closest("[data-radix-popper-content-wrapper]")) {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
onPointerDownOutside?.(e);
|
|
69
|
+
},
|
|
70
|
+
onInteractOutside: (e) => {
|
|
71
|
+
const target = e.target;
|
|
72
|
+
if (target.closest("[data-modal-passthrough]") || target.closest("[data-radix-popper-content-wrapper]")) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
onInteractOutside?.(e);
|
|
76
|
+
},
|
|
77
|
+
className: cn(
|
|
78
|
+
// fz-container: a form inside a dialog measures the DIALOG. Without
|
|
79
|
+
// it a two-column field grid in an `sm` modal read the window's width
|
|
80
|
+
// and kept both columns in 380px.
|
|
81
|
+
"fayz-glass-surface fayz-modal-content saas-mdl-ct fz-container relative z-[100] flex flex-col w-full outline-none",
|
|
82
|
+
// Mobile fullscreen
|
|
83
|
+
"h-full rounded-none border-0",
|
|
84
|
+
// Desktop centered card
|
|
85
|
+
"sm:h-auto sm:max-h-[85vh] sm:rounded-2xl sm:border",
|
|
86
|
+
SIZE_MAP[size],
|
|
87
|
+
noPadding ? "" : "p-6 gap-4",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
...props,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(ModalHostContext.Provider, { value: host, children }),
|
|
93
|
+
!hideClose && /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 z-10 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring", children: [
|
|
94
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
95
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
96
|
+
] })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) }) });
|
|
100
|
+
});
|
|
101
|
+
ModalContent.displayName = "ModalContent";
|
|
102
|
+
function ModalHeader({ className, ...props }) {
|
|
103
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left shrink-0", className), ...props });
|
|
104
|
+
}
|
|
105
|
+
function ModalBody({ className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-1 flex-col overflow-y-auto min-h-0", className), ...props });
|
|
107
|
+
}
|
|
108
|
+
function ModalFooter({ className, ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col-reverse gap-2 pb-[env(safe-area-inset-bottom)] sm:mt-0 sm:flex-row sm:justify-end sm:gap-0 sm:space-x-2 sm:pb-0 shrink-0", className), ...props });
|
|
110
|
+
}
|
|
111
|
+
var ModalTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
|
|
112
|
+
ModalTitle.displayName = "ModalTitle";
|
|
113
|
+
var ModalDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
114
|
+
ModalDescription.displayName = "ModalDescription";
|
|
12
115
|
var HIDDEN = { visible: false, saving: false };
|
|
13
|
-
var SaveBarApiContext =
|
|
14
|
-
var SaveBarStateContext =
|
|
116
|
+
var SaveBarApiContext = React12.createContext(null);
|
|
117
|
+
var SaveBarStateContext = React12.createContext({ visible: false, saving: false });
|
|
15
118
|
var _saveBarVisible = false;
|
|
16
119
|
var _saveBarSubs = /* @__PURE__ */ new Set();
|
|
17
120
|
function setSaveBarVisibleSignal(v) {
|
|
@@ -20,7 +123,7 @@ function setSaveBarVisibleSignal(v) {
|
|
|
20
123
|
_saveBarSubs.forEach((fn) => fn());
|
|
21
124
|
}
|
|
22
125
|
function useSaveBarVisible() {
|
|
23
|
-
return
|
|
126
|
+
return React12.useSyncExternalStore(
|
|
24
127
|
(cb) => {
|
|
25
128
|
_saveBarSubs.add(cb);
|
|
26
129
|
return () => {
|
|
@@ -32,10 +135,10 @@ function useSaveBarVisible() {
|
|
|
32
135
|
);
|
|
33
136
|
}
|
|
34
137
|
function SaveBarProvider({ children }) {
|
|
35
|
-
const [state, setState] =
|
|
36
|
-
const handlers =
|
|
37
|
-
const entries =
|
|
38
|
-
const api =
|
|
138
|
+
const [state, setState] = React12.useState({ visible: false, saving: false });
|
|
139
|
+
const handlers = React12.useRef({});
|
|
140
|
+
const entries = React12.useRef([]);
|
|
141
|
+
const api = React12.useMemo(() => ({
|
|
39
142
|
setState,
|
|
40
143
|
handlers,
|
|
41
144
|
entries,
|
|
@@ -45,12 +148,12 @@ function SaveBarProvider({ children }) {
|
|
|
45
148
|
setState(top ? top.state : HIDDEN);
|
|
46
149
|
}
|
|
47
150
|
}), []);
|
|
48
|
-
const backStack =
|
|
49
|
-
const backApi =
|
|
50
|
-
|
|
151
|
+
const backStack = React12.useRef([]);
|
|
152
|
+
const backApi = React12.useMemo(() => ({ stack: backStack }), []);
|
|
153
|
+
React12.useEffect(() => {
|
|
51
154
|
setSaveBarVisibleSignal(state.visible);
|
|
52
155
|
}, [state.visible]);
|
|
53
|
-
|
|
156
|
+
React12.useEffect(() => {
|
|
54
157
|
function onKey(e) {
|
|
55
158
|
if (state.visible && !state.saving) {
|
|
56
159
|
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
@@ -78,7 +181,7 @@ function SaveBarProvider({ children }) {
|
|
|
78
181
|
}, [state.visible, state.saving]);
|
|
79
182
|
return /* @__PURE__ */ jsx(SaveBarApiContext.Provider, { value: api, children: /* @__PURE__ */ jsx(BackNavApiContext.Provider, { value: backApi, children: /* @__PURE__ */ jsx(SaveBarStateContext.Provider, { value: state, children }) }) });
|
|
80
183
|
}
|
|
81
|
-
var BackNavApiContext =
|
|
184
|
+
var BackNavApiContext = React12.createContext(null);
|
|
82
185
|
function isEditableTarget(target) {
|
|
83
186
|
const el = target;
|
|
84
187
|
if (!el || !el.tagName) return false;
|
|
@@ -86,12 +189,12 @@ function isEditableTarget(target) {
|
|
|
86
189
|
return tag === "input" || tag === "textarea" || tag === "select" || el.isContentEditable;
|
|
87
190
|
}
|
|
88
191
|
function useBackHandler(onBack) {
|
|
89
|
-
const api =
|
|
90
|
-
const ref =
|
|
91
|
-
|
|
192
|
+
const api = React12.useContext(BackNavApiContext);
|
|
193
|
+
const ref = React12.useRef(onBack);
|
|
194
|
+
React12.useEffect(() => {
|
|
92
195
|
ref.current = onBack;
|
|
93
196
|
});
|
|
94
|
-
|
|
197
|
+
React12.useEffect(() => {
|
|
95
198
|
if (!api) return;
|
|
96
199
|
const stack = api.stack.current;
|
|
97
200
|
stack.push(ref);
|
|
@@ -102,15 +205,16 @@ function useBackHandler(onBack) {
|
|
|
102
205
|
}, [api]);
|
|
103
206
|
}
|
|
104
207
|
function useSaveBar({ dirty, alwaysVisible, saving = false, onSave, onDiscard, message, saveLabel, discardLabel }) {
|
|
105
|
-
const api =
|
|
106
|
-
const
|
|
107
|
-
|
|
208
|
+
const api = React12.useContext(SaveBarApiContext);
|
|
209
|
+
const host = useModalHost();
|
|
210
|
+
const entry = React12.useRef({ state: HIDDEN, handlers: {} });
|
|
211
|
+
React12.useEffect(() => {
|
|
108
212
|
entry.current.handlers = { onSave, onDiscard };
|
|
109
213
|
if (api && api.entries.current[api.entries.current.length - 1] === entry.current) {
|
|
110
214
|
api.handlers.current = entry.current.handlers;
|
|
111
215
|
}
|
|
112
216
|
});
|
|
113
|
-
|
|
217
|
+
React12.useEffect(() => {
|
|
114
218
|
if (!api) return;
|
|
115
219
|
const list = api.entries.current;
|
|
116
220
|
list.push(entry.current);
|
|
@@ -121,19 +225,19 @@ function useSaveBar({ dirty, alwaysVisible, saving = false, onSave, onDiscard, m
|
|
|
121
225
|
api.sync();
|
|
122
226
|
};
|
|
123
227
|
}, [api]);
|
|
124
|
-
|
|
228
|
+
React12.useEffect(() => {
|
|
125
229
|
if (!api) return;
|
|
126
|
-
entry.current.state = { visible: dirty || !!alwaysVisible, dirty, saving, message, saveLabel, discardLabel };
|
|
230
|
+
entry.current.state = { visible: dirty || !!alwaysVisible, dirty, saving, message, saveLabel, discardLabel, host };
|
|
127
231
|
if (api.entries.current[api.entries.current.length - 1] === entry.current) api.sync();
|
|
128
|
-
}, [api, dirty, alwaysVisible, saving, message, saveLabel, discardLabel]);
|
|
232
|
+
}, [api, dirty, alwaysVisible, saving, message, saveLabel, discardLabel, host]);
|
|
129
233
|
}
|
|
130
234
|
function SaveBar({ className }) {
|
|
131
|
-
const state =
|
|
132
|
-
const api =
|
|
235
|
+
const state = React12.useContext(SaveBarStateContext);
|
|
236
|
+
const api = React12.useContext(SaveBarApiContext);
|
|
133
237
|
const t = useTranslation();
|
|
134
|
-
const [rendered, setRendered] =
|
|
135
|
-
const [closing, setClosing] =
|
|
136
|
-
|
|
238
|
+
const [rendered, setRendered] = React12.useState(state.visible);
|
|
239
|
+
const [closing, setClosing] = React12.useState(false);
|
|
240
|
+
React12.useEffect(() => {
|
|
137
241
|
if (state.visible) {
|
|
138
242
|
setRendered(true);
|
|
139
243
|
setClosing(false);
|
|
@@ -148,15 +252,12 @@ function SaveBar({ className }) {
|
|
|
148
252
|
return () => clearTimeout(id);
|
|
149
253
|
}, [state.visible, rendered]);
|
|
150
254
|
if (!api || !rendered) return null;
|
|
151
|
-
const { saving, message, saveLabel, discardLabel } = state;
|
|
152
|
-
|
|
255
|
+
const { saving, message, saveLabel, discardLabel, host } = state;
|
|
256
|
+
const island = /* @__PURE__ */ jsx(
|
|
153
257
|
"div",
|
|
154
258
|
{
|
|
155
259
|
className: cn(
|
|
156
|
-
|
|
157
|
-
// clear of the bar's height so its actions are not sitting under it.
|
|
158
|
-
"pointer-events-none fixed inset-x-0 z-[55] flex justify-center px-4",
|
|
159
|
-
"bottom-[calc(var(--fz-bottom-bar,0px)+1.25rem)]",
|
|
260
|
+
host ? "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4" : "pointer-events-none fixed inset-x-0 z-[55] flex justify-center px-4 bottom-[calc(var(--fz-bottom-bar,0px)+1.25rem)]",
|
|
160
261
|
className
|
|
161
262
|
),
|
|
162
263
|
children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
@@ -197,11 +298,12 @@ function SaveBar({ className }) {
|
|
|
197
298
|
] })
|
|
198
299
|
}
|
|
199
300
|
);
|
|
301
|
+
return host ? createPortal(island, host) : island;
|
|
200
302
|
}
|
|
201
303
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
202
304
|
var Tooltip = TooltipPrimitive.Root;
|
|
203
305
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
204
|
-
var TooltipContent =
|
|
306
|
+
var TooltipContent = React12.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
205
307
|
TooltipPrimitive.Content,
|
|
206
308
|
{
|
|
207
309
|
ref,
|
|
@@ -243,7 +345,7 @@ var usePageHeaderStore = create((set, get) => ({
|
|
|
243
345
|
function useRegisterPageActions() {
|
|
244
346
|
const add = usePageHeaderStore((s) => s.addActions);
|
|
245
347
|
const remove = usePageHeaderStore((s) => s.removeActions);
|
|
246
|
-
|
|
348
|
+
React12.useEffect(() => {
|
|
247
349
|
add();
|
|
248
350
|
return remove;
|
|
249
351
|
}, [add, remove]);
|
|
@@ -266,7 +368,7 @@ function usePageTitleSlotHost() {
|
|
|
266
368
|
function usePageHeaderHost() {
|
|
267
369
|
const addHost = usePageHeaderStore((s) => s.addHost);
|
|
268
370
|
const removeHost = usePageHeaderStore((s) => s.removeHost);
|
|
269
|
-
|
|
371
|
+
React12.useEffect(() => {
|
|
270
372
|
addHost();
|
|
271
373
|
return removeHost;
|
|
272
374
|
}, [addHost, removeHost]);
|
|
@@ -284,30 +386,30 @@ function PageHeaderOutlet({ className, active = true }) {
|
|
|
284
386
|
const hasActions = usePageHeaderStore((s) => s.actions > 0);
|
|
285
387
|
const addOutlet = usePageHeaderStore((s) => s.addOutlet);
|
|
286
388
|
const removeOutlet = usePageHeaderStore((s) => s.removeOutlet);
|
|
287
|
-
|
|
389
|
+
React12.useEffect(() => {
|
|
288
390
|
if (!active) return;
|
|
289
391
|
addOutlet();
|
|
290
392
|
return removeOutlet;
|
|
291
393
|
}, [active, addOutlet, removeOutlet]);
|
|
292
|
-
|
|
394
|
+
React12.useEffect(() => {
|
|
293
395
|
if (active) return;
|
|
294
396
|
setOutletSlot(null);
|
|
295
397
|
setOutletActionsSlot(null);
|
|
296
398
|
}, [active, setOutletSlot, setOutletActionsSlot]);
|
|
297
399
|
if (!active) return null;
|
|
298
|
-
return
|
|
400
|
+
return React12.createElement(
|
|
299
401
|
"div",
|
|
300
402
|
{ className: `flex min-h-9 items-center justify-between gap-3${claimed || hasActions ? "" : " hidden"} ${className ?? "mb-3"}` },
|
|
301
|
-
|
|
302
|
-
|
|
403
|
+
React12.createElement("div", { ref: setOutletSlot, className: "flex min-w-0 flex-1 items-center" }),
|
|
404
|
+
React12.createElement("div", { ref: setOutletActionsSlot, className: "flex shrink-0 items-center gap-2" })
|
|
303
405
|
);
|
|
304
406
|
}
|
|
305
407
|
function usePageHeader(active, options) {
|
|
306
|
-
const id =
|
|
408
|
+
const id = React12.useId();
|
|
307
409
|
const claim = usePageHeaderStore((s) => s.claim);
|
|
308
410
|
const release = usePageHeaderStore((s) => s.release);
|
|
309
411
|
const back = options?.back ?? false;
|
|
310
|
-
|
|
412
|
+
React12.useEffect(() => {
|
|
311
413
|
if (!active) {
|
|
312
414
|
release(id);
|
|
313
415
|
return;
|
|
@@ -324,18 +426,18 @@ function useModuleViewLabel() {
|
|
|
324
426
|
}
|
|
325
427
|
function usePublishModuleViewLabel(label) {
|
|
326
428
|
const setLabel = usePageHeaderStore((s) => s.setModuleViewLabel);
|
|
327
|
-
|
|
429
|
+
React12.useEffect(() => {
|
|
328
430
|
setLabel(label ?? null);
|
|
329
431
|
return () => setLabel(null);
|
|
330
432
|
}, [label, setLabel]);
|
|
331
433
|
}
|
|
332
434
|
function PageTitlePortal({ children }) {
|
|
333
435
|
const slot = usePageTitleSlot();
|
|
334
|
-
if (!slot) return
|
|
436
|
+
if (!slot) return React12.createElement(React12.Fragment, null, children);
|
|
335
437
|
return createPortal(children, slot);
|
|
336
438
|
}
|
|
337
|
-
var Hint =
|
|
338
|
-
if (!label) return
|
|
439
|
+
var Hint = React12.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
440
|
+
if (!label) return React12.cloneElement(children, { ...rest, ref });
|
|
339
441
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
340
442
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, ...rest, ref, children }),
|
|
341
443
|
/* @__PURE__ */ jsx(TooltipContent, { side, className: "px-2 py-1 text-xs font-medium", children: label })
|
|
@@ -424,7 +526,7 @@ function PageHeader({ title, onBack, parentLabel, backLabel }) {
|
|
|
424
526
|
const hasHost = useHasPageHeaderHost();
|
|
425
527
|
const { onBack: effectiveOnBack, parentLabel: effectiveParent } = useCrossModuleBack(onBack, parentLabel);
|
|
426
528
|
useBackHandler(effectiveOnBack);
|
|
427
|
-
const node =
|
|
529
|
+
const node = React12.useMemo(() => /* @__PURE__ */ jsx(
|
|
428
530
|
PageHeaderCrumb,
|
|
429
531
|
{
|
|
430
532
|
title,
|
|
@@ -438,15 +540,15 @@ function PageHeader({ title, onBack, parentLabel, backLabel }) {
|
|
|
438
540
|
}
|
|
439
541
|
var GUTTER_PX = 8;
|
|
440
542
|
var CLOSE_DELAY_MS = 140;
|
|
441
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
543
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React12.useLayoutEffect : React12.useEffect;
|
|
442
544
|
function iconOf(name) {
|
|
443
545
|
if (!name) return null;
|
|
444
546
|
return ICON_MAP[name] ?? null;
|
|
445
547
|
}
|
|
446
|
-
var RailFlyoutContext =
|
|
548
|
+
var RailFlyoutContext = React12.createContext(null);
|
|
447
549
|
var RailFlyoutProvider = RailFlyoutContext.Provider;
|
|
448
550
|
function useRailRow(content) {
|
|
449
|
-
const flyout =
|
|
551
|
+
const flyout = React12.useContext(RailFlyoutContext);
|
|
450
552
|
if (!flyout || !content) return {};
|
|
451
553
|
return flyout.rowProps(content);
|
|
452
554
|
}
|
|
@@ -456,19 +558,19 @@ function useRailFlyout({
|
|
|
456
558
|
activeRoute,
|
|
457
559
|
onNavigate
|
|
458
560
|
}) {
|
|
459
|
-
const [state, setState] =
|
|
460
|
-
const [pos, setPos] =
|
|
461
|
-
const [animate, setAnimate] =
|
|
462
|
-
const panelRef =
|
|
463
|
-
const closeTimer =
|
|
464
|
-
const lastContent =
|
|
465
|
-
const cancelClose =
|
|
561
|
+
const [state, setState] = React12.useState(null);
|
|
562
|
+
const [pos, setPos] = React12.useState({ top: 0, arrow: 20 });
|
|
563
|
+
const [animate, setAnimate] = React12.useState(false);
|
|
564
|
+
const panelRef = React12.useRef(null);
|
|
565
|
+
const closeTimer = React12.useRef(null);
|
|
566
|
+
const lastContent = React12.useRef(null);
|
|
567
|
+
const cancelClose = React12.useCallback(() => {
|
|
466
568
|
if (closeTimer.current) {
|
|
467
569
|
clearTimeout(closeTimer.current);
|
|
468
570
|
closeTimer.current = null;
|
|
469
571
|
}
|
|
470
572
|
}, []);
|
|
471
|
-
const show =
|
|
573
|
+
const show = React12.useCallback(
|
|
472
574
|
(anchor, content2) => {
|
|
473
575
|
if (!enabled) return;
|
|
474
576
|
cancelClose();
|
|
@@ -476,19 +578,19 @@ function useRailFlyout({
|
|
|
476
578
|
},
|
|
477
579
|
[enabled, cancelClose]
|
|
478
580
|
);
|
|
479
|
-
const hide =
|
|
581
|
+
const hide = React12.useCallback(() => {
|
|
480
582
|
cancelClose();
|
|
481
583
|
closeTimer.current = setTimeout(() => setState(null), CLOSE_DELAY_MS);
|
|
482
584
|
}, [cancelClose]);
|
|
483
|
-
const dismiss =
|
|
585
|
+
const dismiss = React12.useCallback(() => {
|
|
484
586
|
cancelClose();
|
|
485
587
|
setState(null);
|
|
486
588
|
}, [cancelClose]);
|
|
487
|
-
|
|
488
|
-
|
|
589
|
+
React12.useEffect(() => () => cancelClose(), [cancelClose]);
|
|
590
|
+
React12.useEffect(() => {
|
|
489
591
|
if (!enabled) dismiss();
|
|
490
592
|
}, [enabled, dismiss]);
|
|
491
|
-
const reposition =
|
|
593
|
+
const reposition = React12.useCallback(() => {
|
|
492
594
|
const rail = railRef.current;
|
|
493
595
|
const anchor = state?.anchor;
|
|
494
596
|
if (!rail || !anchor) return;
|
|
@@ -503,7 +605,7 @@ function useRailFlyout({
|
|
|
503
605
|
setPos({ top, arrow });
|
|
504
606
|
}, [railRef, state]);
|
|
505
607
|
useIsomorphicLayoutEffect(reposition, [reposition, state?.content.key]);
|
|
506
|
-
|
|
608
|
+
React12.useEffect(() => {
|
|
507
609
|
if (!state) return;
|
|
508
610
|
const rail = railRef.current;
|
|
509
611
|
const onScroll = () => reposition();
|
|
@@ -515,7 +617,7 @@ function useRailFlyout({
|
|
|
515
617
|
};
|
|
516
618
|
}, [state, railRef, reposition]);
|
|
517
619
|
const visible = !!state;
|
|
518
|
-
|
|
620
|
+
React12.useEffect(() => {
|
|
519
621
|
if (!visible) {
|
|
520
622
|
setAnimate(false);
|
|
521
623
|
return;
|
|
@@ -523,7 +625,7 @@ function useRailFlyout({
|
|
|
523
625
|
const id = requestAnimationFrame(() => setAnimate(true));
|
|
524
626
|
return () => cancelAnimationFrame(id);
|
|
525
627
|
}, [visible]);
|
|
526
|
-
|
|
628
|
+
React12.useEffect(() => {
|
|
527
629
|
if (!visible) return;
|
|
528
630
|
const onKey = (event) => {
|
|
529
631
|
if (event.key === "Escape") dismiss();
|
|
@@ -531,7 +633,7 @@ function useRailFlyout({
|
|
|
531
633
|
window.addEventListener("keydown", onKey);
|
|
532
634
|
return () => window.removeEventListener("keydown", onKey);
|
|
533
635
|
}, [visible, dismiss]);
|
|
534
|
-
const rowProps =
|
|
636
|
+
const rowProps = React12.useCallback(
|
|
535
637
|
(content2) => ({
|
|
536
638
|
onMouseEnter: (event) => show(event.currentTarget, content2),
|
|
537
639
|
onFocus: (event) => show(event.currentTarget, content2),
|
|
@@ -694,7 +796,7 @@ function NavChildConnector({ onPath, active }) {
|
|
|
694
796
|
] });
|
|
695
797
|
}
|
|
696
798
|
var RAIL_PUSH_MS = 260;
|
|
697
|
-
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ?
|
|
799
|
+
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? React12.useLayoutEffect : React12.useEffect;
|
|
698
800
|
function getIcon(name) {
|
|
699
801
|
return ICON_MAP[name] ?? Home;
|
|
700
802
|
}
|
|
@@ -905,7 +1007,7 @@ function NavGroup({
|
|
|
905
1007
|
// case in an app that groups its rail).
|
|
906
1008
|
/* @__PURE__ */ jsx("button", { "data-tour": `nav.${child.route}`, onClick: () => onNavigate(child.route), className: childClass, children: childInner })
|
|
907
1009
|
);
|
|
908
|
-
if (!childConnector) return /* @__PURE__ */ jsx(
|
|
1010
|
+
if (!childConnector) return /* @__PURE__ */ jsx(React12.Fragment, { children: row }, child.id);
|
|
909
1011
|
const activeIndex = item.children.findIndex((c) => c.route === activeRoute);
|
|
910
1012
|
const onPath = activeIndex >= 0 && childIndex < activeIndex;
|
|
911
1013
|
return (
|
|
@@ -927,9 +1029,9 @@ function NavGroup({
|
|
|
927
1029
|
] });
|
|
928
1030
|
}
|
|
929
1031
|
function withCollapsed(slot, collapsed) {
|
|
930
|
-
if (!
|
|
1032
|
+
if (!React12.isValidElement(slot)) return slot;
|
|
931
1033
|
if (typeof slot.type === "string") return slot;
|
|
932
|
-
return
|
|
1034
|
+
return React12.cloneElement(slot, { collapsed });
|
|
933
1035
|
}
|
|
934
1036
|
var SKELETON_ROWS = [
|
|
935
1037
|
{ width: 56, group: false },
|
|
@@ -971,7 +1073,7 @@ function Sidebar({
|
|
|
971
1073
|
}) {
|
|
972
1074
|
const currentPath = currentPathProp;
|
|
973
1075
|
const activeRoute = resolveActiveRoute(navigation, currentPath);
|
|
974
|
-
const railRef =
|
|
1076
|
+
const railRef = React12.useRef(null);
|
|
975
1077
|
const flyout = useRailFlyout({
|
|
976
1078
|
enabled: collapsed,
|
|
977
1079
|
railRef,
|
|
@@ -984,14 +1086,14 @@ function Sidebar({
|
|
|
984
1086
|
const handleNavigate = (route) => {
|
|
985
1087
|
onNavigate?.(route);
|
|
986
1088
|
};
|
|
987
|
-
const groupWithActiveRoute =
|
|
1089
|
+
const groupWithActiveRoute = React12.useMemo(() => {
|
|
988
1090
|
const groups = navigation.filter((item) => item.children && item.children.length > 0);
|
|
989
1091
|
return groups.find(
|
|
990
1092
|
(item) => item.route === activeRoute || item.children.some((child) => child.route === activeRoute)
|
|
991
1093
|
)?.id ?? null;
|
|
992
1094
|
}, [navigation, activeRoute]);
|
|
993
|
-
const [openGroup, setOpenGroup] =
|
|
994
|
-
|
|
1095
|
+
const [openGroup, setOpenGroup] = React12.useState(groupWithActiveRoute);
|
|
1096
|
+
React12.useEffect(() => {
|
|
995
1097
|
if (groupWithActiveRoute) setOpenGroup(groupWithActiveRoute);
|
|
996
1098
|
}, [groupWithActiveRoute]);
|
|
997
1099
|
const sectionHeading = (label) => label && !collapsed ? /* @__PURE__ */ jsx("p", { className: "px-2.5 pb-0.5 pt-1 text-[10px] font-semibold uppercase tracking-wider text-sidebar-muted", children: label }) : null;
|
|
@@ -1043,10 +1145,10 @@ function Sidebar({
|
|
|
1043
1145
|
mainItems.length > 0 && renderSection(mainItems, sectionLabels?.main),
|
|
1044
1146
|
secondaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-6", children: renderSection(secondaryItems, sectionLabels?.secondary) })
|
|
1045
1147
|
] });
|
|
1046
|
-
const [outgoing, setOutgoing] =
|
|
1047
|
-
const lastBodyRef =
|
|
1048
|
-
const lastKeyRef =
|
|
1049
|
-
const timerRef =
|
|
1148
|
+
const [outgoing, setOutgoing] = React12.useState(null);
|
|
1149
|
+
const lastBodyRef = React12.useRef(null);
|
|
1150
|
+
const lastKeyRef = React12.useRef(navKey);
|
|
1151
|
+
const timerRef = React12.useRef(null);
|
|
1050
1152
|
useIsomorphicLayoutEffect2(() => {
|
|
1051
1153
|
if (lastKeyRef.current !== navKey) {
|
|
1052
1154
|
const previousBody = lastBodyRef.current;
|
|
@@ -1059,7 +1161,7 @@ function Sidebar({
|
|
|
1059
1161
|
}
|
|
1060
1162
|
lastBodyRef.current = navBody;
|
|
1061
1163
|
});
|
|
1062
|
-
|
|
1164
|
+
React12.useEffect(() => () => {
|
|
1063
1165
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1064
1166
|
}, []);
|
|
1065
1167
|
return (
|
|
@@ -1303,7 +1405,7 @@ function ShellSearch({
|
|
|
1303
1405
|
const rail = tone === "rail";
|
|
1304
1406
|
const contextual = !!onValueChange && !collapsed;
|
|
1305
1407
|
const query = value ?? "";
|
|
1306
|
-
const inputRef =
|
|
1408
|
+
const inputRef = React12.useRef(null);
|
|
1307
1409
|
const escalate = () => setCommandPaletteOpen(true, query);
|
|
1308
1410
|
const surface = rail ? "bg-sidebar-accent/40 text-sidebar-muted hover:bg-sidebar-accent/70 hover:text-sidebar-foreground" : "bg-accent/40 text-muted-foreground hover:bg-accent/70 hover:text-foreground";
|
|
1309
1411
|
const ring = rail ? "focus-within:bg-sidebar-accent/70 focus-within:ring-1 focus-within:ring-sidebar-accent-foreground/25" : "focus-within:bg-accent/70 focus-within:ring-1 focus-within:ring-ring/40";
|
|
@@ -1414,7 +1516,7 @@ function TopbarUserMenu({
|
|
|
1414
1516
|
onBilling,
|
|
1415
1517
|
userMenuExtras
|
|
1416
1518
|
}) {
|
|
1417
|
-
const [open, setOpen] =
|
|
1519
|
+
const [open, setOpen] = React12.useState(false);
|
|
1418
1520
|
if (!user) return null;
|
|
1419
1521
|
const initial = (user.fullName?.trim()?.[0] ?? user.email?.[0] ?? "?").toUpperCase();
|
|
1420
1522
|
const item = (label, onClick, Icon) => onClick ? /* @__PURE__ */ jsxs(
|
|
@@ -1498,7 +1600,7 @@ function getIcon2(name) {
|
|
|
1498
1600
|
return ICON_MAP[name] ?? Home;
|
|
1499
1601
|
}
|
|
1500
1602
|
function NavDropdown({ item, currentPath, onNavigate }) {
|
|
1501
|
-
const [open, setOpen] =
|
|
1603
|
+
const [open, setOpen] = React12.useState(false);
|
|
1502
1604
|
const Icon = getIcon2(item.icon);
|
|
1503
1605
|
const isChildActive = item.children?.some(
|
|
1504
1606
|
(child) => currentPath === child.route || currentPath.startsWith(child.route + "/")
|
|
@@ -1666,9 +1768,9 @@ function Topbar({
|
|
|
1666
1768
|
] });
|
|
1667
1769
|
}
|
|
1668
1770
|
function useSheetDrag({ onDismiss, canDrag }) {
|
|
1669
|
-
const [offset, setOffset] =
|
|
1670
|
-
const [dragging, setDragging] =
|
|
1671
|
-
const start =
|
|
1771
|
+
const [offset, setOffset] = React12.useState(0);
|
|
1772
|
+
const [dragging, setDragging] = React12.useState(false);
|
|
1773
|
+
const start = React12.useRef(null);
|
|
1672
1774
|
const onPointerDown = (e) => {
|
|
1673
1775
|
if (e.pointerType === "mouse") return;
|
|
1674
1776
|
if (canDrag && !canDrag()) return;
|
|
@@ -1702,9 +1804,9 @@ function useSheetDrag({ onDismiss, canDrag }) {
|
|
|
1702
1804
|
handlers: { onPointerDown, onPointerMove, onPointerUp: end, onPointerCancel: end }
|
|
1703
1805
|
};
|
|
1704
1806
|
}
|
|
1705
|
-
var SheetCloseContext =
|
|
1807
|
+
var SheetCloseContext = React12.createContext(null);
|
|
1706
1808
|
function useSheetClose() {
|
|
1707
|
-
const close =
|
|
1809
|
+
const close = React12.useContext(SheetCloseContext);
|
|
1708
1810
|
return close ?? (() => {
|
|
1709
1811
|
});
|
|
1710
1812
|
}
|
|
@@ -1718,9 +1820,9 @@ function BottomSheet({
|
|
|
1718
1820
|
className,
|
|
1719
1821
|
label
|
|
1720
1822
|
}) {
|
|
1721
|
-
const [leaving, setLeaving] =
|
|
1722
|
-
const scroller =
|
|
1723
|
-
const close =
|
|
1823
|
+
const [leaving, setLeaving] = React12.useState(false);
|
|
1824
|
+
const scroller = React12.useRef(null);
|
|
1825
|
+
const close = React12.useCallback(() => {
|
|
1724
1826
|
setLeaving(true);
|
|
1725
1827
|
window.setTimeout(onClose, 200);
|
|
1726
1828
|
}, [onClose]);
|
|
@@ -1728,7 +1830,7 @@ function BottomSheet({
|
|
|
1728
1830
|
onDismiss: close,
|
|
1729
1831
|
canDrag: () => (scroller.current?.scrollTop ?? 0) <= 0
|
|
1730
1832
|
});
|
|
1731
|
-
|
|
1833
|
+
React12.useEffect(() => {
|
|
1732
1834
|
const onKey = (e) => {
|
|
1733
1835
|
if (e.key !== "Escape") return;
|
|
1734
1836
|
if (onBack) onBack();
|
|
@@ -1737,15 +1839,15 @@ function BottomSheet({
|
|
|
1737
1839
|
window.addEventListener("keydown", onKey);
|
|
1738
1840
|
return () => window.removeEventListener("keydown", onKey);
|
|
1739
1841
|
}, [close, onBack]);
|
|
1740
|
-
|
|
1842
|
+
React12.useEffect(() => {
|
|
1741
1843
|
const previous = document.body.style.overflow;
|
|
1742
1844
|
document.body.style.overflow = "hidden";
|
|
1743
1845
|
return () => {
|
|
1744
1846
|
document.body.style.overflow = previous;
|
|
1745
1847
|
};
|
|
1746
1848
|
}, []);
|
|
1747
|
-
const [host, setHost] =
|
|
1748
|
-
|
|
1849
|
+
const [host, setHost] = React12.useState(null);
|
|
1850
|
+
React12.useEffect(() => {
|
|
1749
1851
|
setHost(document.body);
|
|
1750
1852
|
}, []);
|
|
1751
1853
|
if (!host) return null;
|
|
@@ -1860,17 +1962,17 @@ function SheetRow({
|
|
|
1860
1962
|
}
|
|
1861
1963
|
);
|
|
1862
1964
|
}
|
|
1863
|
-
var ModuleHeaderSlotContext =
|
|
1965
|
+
var ModuleHeaderSlotContext = React12.createContext(null);
|
|
1864
1966
|
function useModuleHeaderSlot() {
|
|
1865
|
-
return
|
|
1967
|
+
return React12.useContext(ModuleHeaderSlotContext);
|
|
1866
1968
|
}
|
|
1867
|
-
var ModuleHeaderActionsSlotContext =
|
|
1969
|
+
var ModuleHeaderActionsSlotContext = React12.createContext(null);
|
|
1868
1970
|
function useModuleHeaderActionsSlot() {
|
|
1869
|
-
return
|
|
1971
|
+
return React12.useContext(ModuleHeaderActionsSlotContext);
|
|
1870
1972
|
}
|
|
1871
|
-
var PageRailSlotContext =
|
|
1973
|
+
var PageRailSlotContext = React12.createContext(null);
|
|
1872
1974
|
function usePageRailSlot() {
|
|
1873
|
-
return
|
|
1975
|
+
return React12.useContext(PageRailSlotContext);
|
|
1874
1976
|
}
|
|
1875
1977
|
function isCreateRoute(route) {
|
|
1876
1978
|
return !!route && /\/(new|create)$/.test(route);
|
|
@@ -1957,9 +2059,9 @@ function SidebarLayout({
|
|
|
1957
2059
|
const setSidebarCollapsed = useLayoutStore((s) => s.setSidebarCollapsed);
|
|
1958
2060
|
const mobileMenuOpen = useLayoutStore((st) => st.mobileDrawerOpen);
|
|
1959
2061
|
const setMobileMenuOpen = useLayoutStore((st) => st.setMobileDrawerOpen);
|
|
1960
|
-
const [headerSlot, setHeaderSlot] =
|
|
1961
|
-
const [actionsSlot, setActionsSlot] =
|
|
1962
|
-
const [pageRailSlot, setPageRailSlot] =
|
|
2062
|
+
const [headerSlot, setHeaderSlot] = React12.useState(null);
|
|
2063
|
+
const [actionsSlot, setActionsSlot] = React12.useState(null);
|
|
2064
|
+
const [pageRailSlot, setPageRailSlot] = React12.useState(null);
|
|
1963
2065
|
const hasPageActions = useHasPageActions();
|
|
1964
2066
|
return /* @__PURE__ */ jsx(SaveBarProvider, { children: /* @__PURE__ */ jsx(ModuleHeaderSlotContext.Provider, { value: headerSlot, children: /* @__PURE__ */ jsx(ModuleHeaderActionsSlotContext.Provider, { value: actionsSlot, children: /* @__PURE__ */ jsx(PageRailSlotContext.Provider, { value: pageRailSlot, children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
1965
2067
|
"shell-enter fz-viewport-h flex overflow-hidden bg-background",
|
|
@@ -2032,6 +2134,10 @@ function SidebarLayout({
|
|
|
2032
2134
|
// Com `min-h` bastava um controle mais alto de um lado para o cartão
|
|
2033
2135
|
// daquele lado descer sozinho.
|
|
2034
2136
|
frame && "fz-on-band md:h-14 md:border-b-0 md:text-sidebar-foreground md:[--accent-foreground:var(--sidebar-accent-foreground)] md:[--accent:var(--sidebar-accent)] md:[--background:var(--sidebar)] md:[--border:var(--sidebar-border)] md:[--card:var(--sidebar)] md:[--foreground:var(--sidebar-foreground)] md:[--muted-foreground:var(--sidebar-muted)] md:[--muted:var(--sidebar-accent)]",
|
|
2137
|
+
// A destination keeps the app controls; a deeper screen keeps its
|
|
2138
|
+
// own title/back row. On phones with complete bottom navigation,
|
|
2139
|
+
// showing both was a two-storey header with no extra way out.
|
|
2140
|
+
barOwnsNav && !pagePrimary && "hidden md:flex",
|
|
2035
2141
|
// …unless the page put its actions in it. Hiding the bar on mobile
|
|
2036
2142
|
// used to hide the only "Novo" the screen had.
|
|
2037
2143
|
mobileHeader !== "minimal" && !hasPageActions && "hidden md:flex",
|
|
@@ -2120,10 +2226,19 @@ function SidebarLayout({
|
|
|
2120
2226
|
// senão as duas superfícies encostadas saem em tons diferentes e
|
|
2121
2227
|
// a emenda que acabamos de apagar volta como degrau de cor.
|
|
2122
2228
|
"fz-liquid-glass relative z-20 flex min-h-12 shrink-0 items-center justify-between gap-3 px-3 md:px-6",
|
|
2123
|
-
menuOpen && "invisible md:visible"
|
|
2229
|
+
menuOpen && "invisible md:visible",
|
|
2230
|
+
// On a primary phone destination the selected bottom-nav item
|
|
2231
|
+
// already names the page. Declared actions render as a body-level
|
|
2232
|
+
// FAB, so this entire duplicate band can disappear.
|
|
2233
|
+
barOwnsNav && pagePrimary && "hidden md:flex"
|
|
2124
2234
|
),
|
|
2125
2235
|
children: [
|
|
2126
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
2236
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
2237
|
+
"flex min-w-0 flex-1 items-center gap-3",
|
|
2238
|
+
// Primary destinations are already named by the selected mobile
|
|
2239
|
+
// navigation item. Keep this side only for deeper breadcrumbs.
|
|
2240
|
+
pagePrimary && "hidden md:flex"
|
|
2241
|
+
), children: [
|
|
2127
2242
|
!pageHeaderClaimed && /* @__PURE__ */ jsx(ShellPageTitle, { title: pageTitle, back: pageBack, primary: pagePrimary }),
|
|
2128
2243
|
/* @__PURE__ */ jsx("div", { ref: setTitleSlot, className: "flex min-w-0 items-center empty:hidden" })
|
|
2129
2244
|
] }),
|
|
@@ -2227,9 +2342,9 @@ function TopbarLayout({
|
|
|
2227
2342
|
}) {
|
|
2228
2343
|
const mobileMenuOpen = useLayoutStore((st) => st.mobileDrawerOpen);
|
|
2229
2344
|
const setMobileMenuOpen = useLayoutStore((st) => st.setMobileDrawerOpen);
|
|
2230
|
-
const [headerSlot, setHeaderSlot] =
|
|
2231
|
-
const [actionsSlot, setActionsSlot] =
|
|
2232
|
-
const [pageRailSlot, setPageRailSlot] =
|
|
2345
|
+
const [headerSlot, setHeaderSlot] = React12.useState(null);
|
|
2346
|
+
const [actionsSlot, setActionsSlot] = React12.useState(null);
|
|
2347
|
+
const [pageRailSlot, setPageRailSlot] = React12.useState(null);
|
|
2233
2348
|
const rawClaimed = usePageHeaderClaimed();
|
|
2234
2349
|
const setTitleSlot = usePageTitleSlotHost();
|
|
2235
2350
|
const hasOutlet = useHasPageHeaderOutlet();
|
|
@@ -2362,17 +2477,16 @@ function MobileMoreScreen({
|
|
|
2362
2477
|
orgSwitcher,
|
|
2363
2478
|
mobileIdentity,
|
|
2364
2479
|
identity,
|
|
2365
|
-
notificationSlot,
|
|
2366
2480
|
searchLabel,
|
|
2367
2481
|
sectionLabels,
|
|
2368
2482
|
leaving = false,
|
|
2369
2483
|
onDismiss,
|
|
2370
2484
|
onClose
|
|
2371
2485
|
}) {
|
|
2372
|
-
const [pushed, setPushed] =
|
|
2373
|
-
const [query, setQuery] =
|
|
2374
|
-
const scroller =
|
|
2375
|
-
const close =
|
|
2486
|
+
const [pushed, setPushed] = React12.useState(null);
|
|
2487
|
+
const [query, setQuery] = React12.useState("");
|
|
2488
|
+
const scroller = React12.useRef(null);
|
|
2489
|
+
const close = React12.useCallback(() => {
|
|
2376
2490
|
onClose();
|
|
2377
2491
|
}, [onClose]);
|
|
2378
2492
|
const drag = useSheetDrag({
|
|
@@ -2381,7 +2495,7 @@ function MobileMoreScreen({
|
|
|
2381
2495
|
// a pushed section would dismiss the screen the back button is for.
|
|
2382
2496
|
canDrag: () => !pushed && (scroller.current?.scrollTop ?? 0) <= 0
|
|
2383
2497
|
});
|
|
2384
|
-
|
|
2498
|
+
React12.useEffect(() => {
|
|
2385
2499
|
const onKey = (e) => {
|
|
2386
2500
|
if (e.key !== "Escape") return;
|
|
2387
2501
|
if (pushed) setPushed(null);
|
|
@@ -2390,7 +2504,7 @@ function MobileMoreScreen({
|
|
|
2390
2504
|
window.addEventListener("keydown", onKey);
|
|
2391
2505
|
return () => window.removeEventListener("keydown", onKey);
|
|
2392
2506
|
}, [close, pushed]);
|
|
2393
|
-
|
|
2507
|
+
React12.useEffect(() => {
|
|
2394
2508
|
const previous = document.body.style.overflow;
|
|
2395
2509
|
document.body.style.overflow = "hidden";
|
|
2396
2510
|
return () => {
|
|
@@ -2410,13 +2524,13 @@ function MobileMoreScreen({
|
|
|
2410
2524
|
else onNavigate?.(route);
|
|
2411
2525
|
};
|
|
2412
2526
|
const q = query.trim().toLowerCase();
|
|
2413
|
-
const flat =
|
|
2527
|
+
const flat = React12.useMemo(
|
|
2414
2528
|
() => navigation.flatMap((n) => n.children?.length ? n.children : [n]),
|
|
2415
2529
|
[navigation]
|
|
2416
2530
|
);
|
|
2417
2531
|
const searching = q.length > 0;
|
|
2418
2532
|
const hits = searching ? flat.filter((n) => n.label.toLowerCase().includes(q)) : [];
|
|
2419
|
-
const sections =
|
|
2533
|
+
const sections = React12.useMemo(() => {
|
|
2420
2534
|
const out = [];
|
|
2421
2535
|
for (const key of ["main", "secondary", "settings"]) {
|
|
2422
2536
|
const items = navigation.filter((n) => n.section === key);
|
|
@@ -2437,7 +2551,10 @@ function MobileMoreScreen({
|
|
|
2437
2551
|
"div",
|
|
2438
2552
|
{
|
|
2439
2553
|
className: cn(
|
|
2440
|
-
|
|
2554
|
+
// Isolate the full-screen menu into its own backdrop root. Without it,
|
|
2555
|
+
// the glass header samples the app header underneath and both sets of
|
|
2556
|
+
// controls become visible in the same 44px strip.
|
|
2557
|
+
"fixed inset-0 z-[65] isolate flex flex-col bg-background text-foreground will-change-transform md:hidden",
|
|
2441
2558
|
leaving ? "fz-sheet-out" : "fz-sheet-in",
|
|
2442
2559
|
drag.dragging && "transition-none",
|
|
2443
2560
|
!drag.dragging && !leaving && "transition-transform duration-200 ease-out"
|
|
@@ -2461,18 +2578,15 @@ function MobileMoreScreen({
|
|
|
2461
2578
|
}
|
|
2462
2579
|
) }),
|
|
2463
2580
|
/* @__PURE__ */ jsx("h1", { className: "truncate px-1 text-[15px] font-semibold", children: pushed?.label ?? "Mais" }),
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
"button",
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
}
|
|
2474
|
-
)
|
|
2475
|
-
] })
|
|
2581
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center justify-end gap-1", children: /* @__PURE__ */ jsx(
|
|
2582
|
+
"button",
|
|
2583
|
+
{
|
|
2584
|
+
type: "button",
|
|
2585
|
+
onClick: close,
|
|
2586
|
+
className: "fz-ios-tint fz-tap rounded-button px-2 py-1 text-[15px] font-semibold",
|
|
2587
|
+
children: "Conclu\xEDdo"
|
|
2588
|
+
}
|
|
2589
|
+
) })
|
|
2476
2590
|
] }) }),
|
|
2477
2591
|
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsxs(
|
|
2478
2592
|
"div",
|
|
@@ -2685,23 +2799,23 @@ function MinimalLayout({
|
|
|
2685
2799
|
] });
|
|
2686
2800
|
}
|
|
2687
2801
|
function MobileOverlay({ onClose, onNavigate, ...sidebarProps }) {
|
|
2688
|
-
const [visible, setVisible] =
|
|
2689
|
-
|
|
2802
|
+
const [visible, setVisible] = React12.useState(false);
|
|
2803
|
+
React12.useEffect(() => {
|
|
2690
2804
|
const id = requestAnimationFrame(() => setVisible(true));
|
|
2691
2805
|
return () => cancelAnimationFrame(id);
|
|
2692
2806
|
}, []);
|
|
2693
|
-
const close =
|
|
2807
|
+
const close = React12.useCallback(() => {
|
|
2694
2808
|
setVisible(false);
|
|
2695
2809
|
window.setTimeout(onClose, 250);
|
|
2696
2810
|
}, [onClose]);
|
|
2697
|
-
|
|
2811
|
+
React12.useEffect(() => {
|
|
2698
2812
|
const previous = document.body.style.overflow;
|
|
2699
2813
|
document.body.style.overflow = "hidden";
|
|
2700
2814
|
return () => {
|
|
2701
2815
|
document.body.style.overflow = previous;
|
|
2702
2816
|
};
|
|
2703
2817
|
}, []);
|
|
2704
|
-
|
|
2818
|
+
React12.useEffect(() => {
|
|
2705
2819
|
const onKey = (e) => {
|
|
2706
2820
|
if (e.key === "Escape") close();
|
|
2707
2821
|
};
|
|
@@ -2804,11 +2918,11 @@ function MobileBottomNav({
|
|
|
2804
2918
|
retracted
|
|
2805
2919
|
}) {
|
|
2806
2920
|
const path = currentPath ?? "";
|
|
2807
|
-
const [openSheet, setOpenSheet] =
|
|
2808
|
-
|
|
2921
|
+
const [openSheet, setOpenSheet] = React12.useState(null);
|
|
2922
|
+
React12.useEffect(() => {
|
|
2809
2923
|
setOpenSheet(null);
|
|
2810
2924
|
}, [currentPath]);
|
|
2811
|
-
|
|
2925
|
+
React12.useEffect(() => {
|
|
2812
2926
|
if (retracted) setOpenSheet(null);
|
|
2813
2927
|
}, [retracted]);
|
|
2814
2928
|
const sheetItem = openSheet != null ? items[openSheet] : void 0;
|
|
@@ -2819,12 +2933,8 @@ function MobileBottomNav({
|
|
|
2819
2933
|
"aria-label": "Navega\xE7\xE3o principal",
|
|
2820
2934
|
"aria-hidden": retracted || void 0,
|
|
2821
2935
|
className: cn(
|
|
2822
|
-
// Liquid glass, not a painted strip: the bar sits ON the content, so
|
|
2823
|
-
// the content keeps showing through it as a wash. An opaque bar in the
|
|
2824
|
-
// page's own colour just cut the screen short; an opaque bar in the
|
|
2825
|
-
// RAIL's dark colour made a phone look like it had a second theme.
|
|
2826
2936
|
"fz-safe-b fixed inset-x-0 bottom-0 z-50 flex min-h-16 items-stretch justify-around md:hidden",
|
|
2827
|
-
"
|
|
2937
|
+
"border-t border-sidebar-border bg-sidebar text-sidebar-foreground shadow-[0_-8px_24px_hsl(var(--sidebar)/0.18)]",
|
|
2828
2938
|
"motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-out",
|
|
2829
2939
|
retracted && "pointer-events-none translate-y-full"
|
|
2830
2940
|
),
|
|
@@ -2877,7 +2987,7 @@ function MobileBottomNav({
|
|
|
2877
2987
|
// min-h-[44px] is the floor a finger needs; the bar was letting
|
|
2878
2988
|
// content decide and landing around 40.
|
|
2879
2989
|
"relative flex min-h-[44px] flex-1 flex-col items-center justify-center gap-0.5 px-1 py-2 transition-colors",
|
|
2880
|
-
isActive ? "text-
|
|
2990
|
+
isActive ? "text-sidebar-accent-foreground" : "text-sidebar-muted"
|
|
2881
2991
|
),
|
|
2882
2992
|
children: [
|
|
2883
2993
|
/* @__PURE__ */ jsx(
|
|
@@ -2886,7 +2996,7 @@ function MobileBottomNav({
|
|
|
2886
2996
|
"aria-hidden": true,
|
|
2887
2997
|
className: cn(
|
|
2888
2998
|
"absolute inset-x-3 top-0 h-0.5 rounded-full transition-opacity",
|
|
2889
|
-
isActive ? "bg-
|
|
2999
|
+
isActive ? "bg-sidebar-accent-foreground opacity-100" : "opacity-0"
|
|
2890
3000
|
)
|
|
2891
3001
|
}
|
|
2892
3002
|
),
|
|
@@ -2984,7 +3094,7 @@ function AppShell({
|
|
|
2984
3094
|
const hasBottomNav = !!bottomNav?.length;
|
|
2985
3095
|
const barOwnsNav = bottomNavReachesAll(bottomNav);
|
|
2986
3096
|
const menuNavigation = appNavigation ?? navigation;
|
|
2987
|
-
const routeLabel =
|
|
3097
|
+
const routeLabel = React12.useCallback((path) => {
|
|
2988
3098
|
let best;
|
|
2989
3099
|
const consider = (route, label) => {
|
|
2990
3100
|
if (!route || !label) return;
|
|
@@ -2999,14 +3109,14 @@ function AppShell({
|
|
|
2999
3109
|
}
|
|
3000
3110
|
return best?.label ?? pageTitle ?? "";
|
|
3001
3111
|
}, [menuNavigation, pageTitle]);
|
|
3002
|
-
|
|
3112
|
+
React12.useEffect(() => {
|
|
3003
3113
|
if (!currentPath) return;
|
|
3004
3114
|
if (currentPath === MENU_ROUTE) return;
|
|
3005
3115
|
const label = routeLabel(currentPath);
|
|
3006
3116
|
if (!label) return;
|
|
3007
3117
|
recordNavigation(currentPath, label);
|
|
3008
3118
|
}, [currentPath, routeLabel]);
|
|
3009
|
-
const destinationRoutes =
|
|
3119
|
+
const destinationRoutes = React12.useMemo(() => {
|
|
3010
3120
|
const routes = [];
|
|
3011
3121
|
for (const item of menuNavigation) {
|
|
3012
3122
|
if (item.route) routes.push(item.route);
|
|
@@ -3015,7 +3125,7 @@ function AppShell({
|
|
|
3015
3125
|
return routes;
|
|
3016
3126
|
}, [menuNavigation]);
|
|
3017
3127
|
const isDestination = !!currentPath && destinationRoutes.includes(currentPath);
|
|
3018
|
-
|
|
3128
|
+
React12.useEffect(() => {
|
|
3019
3129
|
setDestinationRoutes(destinationRoutes);
|
|
3020
3130
|
}, [destinationRoutes]);
|
|
3021
3131
|
const pageClaimedBack = useHasPageHeaderBack();
|
|
@@ -3023,7 +3133,7 @@ function AppShell({
|
|
|
3023
3133
|
const barRetracted = !!pageBack || pageClaimedBack || inSettings;
|
|
3024
3134
|
const mobileDrawerOpen = useLayoutStore((st) => st.mobileDrawerOpen);
|
|
3025
3135
|
const setMobileDrawerOpen = useLayoutStore((st) => st.setMobileDrawerOpen);
|
|
3026
|
-
|
|
3136
|
+
React12.useEffect(() => {
|
|
3027
3137
|
if (useLayoutStore.getState().drawerKeepOpenOnce) {
|
|
3028
3138
|
useLayoutStore.setState({ drawerKeepOpenOnce: false });
|
|
3029
3139
|
return;
|
|
@@ -3031,12 +3141,12 @@ function AppShell({
|
|
|
3031
3141
|
setMobileDrawerOpen(false);
|
|
3032
3142
|
}, [currentPath]);
|
|
3033
3143
|
const menuRouteOpen = barOwnsNav && currentPath === MENU_ROUTE;
|
|
3034
|
-
const firstDestination =
|
|
3144
|
+
const firstDestination = React12.useMemo(() => {
|
|
3035
3145
|
const first = bottomNav?.find((i) => !("kind" in i) || i.kind === "route");
|
|
3036
3146
|
return first?.route ?? "/";
|
|
3037
3147
|
}, [bottomNav]);
|
|
3038
|
-
const menuOrigin =
|
|
3039
|
-
const openMenu =
|
|
3148
|
+
const menuOrigin = React12.useRef(void 0);
|
|
3149
|
+
const openMenu = React12.useCallback(() => {
|
|
3040
3150
|
if (!barOwnsNav) {
|
|
3041
3151
|
setMobileDrawerOpen(true);
|
|
3042
3152
|
return;
|
|
@@ -3047,10 +3157,10 @@ function AppShell({
|
|
|
3047
3157
|
menuOrigin.current = currentPath;
|
|
3048
3158
|
onNavigate?.(MENU_ROUTE);
|
|
3049
3159
|
}, [barOwnsNav, currentPath, onNavigate, setMobileDrawerOpen]);
|
|
3050
|
-
const [menuLeaving, setMenuLeaving] =
|
|
3051
|
-
const [menuLingering, setMenuLingering] =
|
|
3052
|
-
const menuTimer =
|
|
3053
|
-
const dismissMenu =
|
|
3160
|
+
const [menuLeaving, setMenuLeaving] = React12.useState(false);
|
|
3161
|
+
const [menuLingering, setMenuLingering] = React12.useState(false);
|
|
3162
|
+
const menuTimer = React12.useRef(void 0);
|
|
3163
|
+
const dismissMenu = React12.useCallback((navigate) => {
|
|
3054
3164
|
window.clearTimeout(menuTimer.current);
|
|
3055
3165
|
setMenuLingering(true);
|
|
3056
3166
|
setMenuLeaving(true);
|
|
@@ -3060,8 +3170,8 @@ function AppShell({
|
|
|
3060
3170
|
setMenuLingering(false);
|
|
3061
3171
|
}, 240);
|
|
3062
3172
|
}, []);
|
|
3063
|
-
|
|
3064
|
-
const closeMenu =
|
|
3173
|
+
React12.useEffect(() => () => window.clearTimeout(menuTimer.current), []);
|
|
3174
|
+
const closeMenu = React12.useCallback(() => {
|
|
3065
3175
|
if (!barOwnsNav) {
|
|
3066
3176
|
setMobileDrawerOpen(false);
|
|
3067
3177
|
return;
|
|
@@ -3074,7 +3184,7 @@ function AppShell({
|
|
|
3074
3184
|
onNavigate?.(back);
|
|
3075
3185
|
});
|
|
3076
3186
|
}, [barOwnsNav, setMobileDrawerOpen, onNavigate, firstDestination, dismissMenu]);
|
|
3077
|
-
|
|
3187
|
+
React12.useEffect(() => {
|
|
3078
3188
|
if (!menuRouteOpen || typeof window === "undefined") return;
|
|
3079
3189
|
const wide = window.matchMedia("(min-width: 768px)");
|
|
3080
3190
|
const settle = () => {
|
|
@@ -3235,13 +3345,13 @@ function SplitWithRightRail({
|
|
|
3235
3345
|
maxWidth = 720,
|
|
3236
3346
|
resizeLabel = "Resize panel"
|
|
3237
3347
|
}) {
|
|
3238
|
-
const [width, setWidth] =
|
|
3239
|
-
const [dragging, setDragging] =
|
|
3240
|
-
const clamp =
|
|
3348
|
+
const [width, setWidth] = React12.useState(defaultWidth);
|
|
3349
|
+
const [dragging, setDragging] = React12.useState(false);
|
|
3350
|
+
const clamp = React12.useCallback(
|
|
3241
3351
|
(value) => Math.min(maxWidth, Math.max(minWidth, value)),
|
|
3242
3352
|
[minWidth, maxWidth]
|
|
3243
3353
|
);
|
|
3244
|
-
|
|
3354
|
+
React12.useEffect(() => {
|
|
3245
3355
|
if (!dragging) return;
|
|
3246
3356
|
const onMove = (event) => {
|
|
3247
3357
|
event.preventDefault();
|
|
@@ -3263,7 +3373,7 @@ function SplitWithRightRail({
|
|
|
3263
3373
|
document.body.style.cursor = previousCursor;
|
|
3264
3374
|
};
|
|
3265
3375
|
}, [dragging, clamp]);
|
|
3266
|
-
|
|
3376
|
+
React12.useEffect(() => {
|
|
3267
3377
|
if (dragging) return;
|
|
3268
3378
|
onWidthChange?.(width);
|
|
3269
3379
|
}, [dragging]);
|
|
@@ -3478,12 +3588,12 @@ function ViewTabs({ value, onChange, options, "aria-label": ariaLabel, className
|
|
|
3478
3588
|
);
|
|
3479
3589
|
}) });
|
|
3480
3590
|
}
|
|
3481
|
-
var NavTransitionContext =
|
|
3591
|
+
var NavTransitionContext = React12.createContext("slide");
|
|
3482
3592
|
function NavTransitionProvider({ value, children }) {
|
|
3483
3593
|
return /* @__PURE__ */ jsx(NavTransitionContext.Provider, { value, children });
|
|
3484
3594
|
}
|
|
3485
3595
|
function useNavTransition() {
|
|
3486
|
-
return
|
|
3596
|
+
return React12.useContext(NavTransitionContext);
|
|
3487
3597
|
}
|
|
3488
3598
|
function resolveTransitionClass(transition, direction) {
|
|
3489
3599
|
if (transition === "none") return "";
|
|
@@ -3503,26 +3613,26 @@ function PageTransition({
|
|
|
3503
3613
|
return /* @__PURE__ */ jsx("div", { className: cn(animClass, className), children }, transitionKey);
|
|
3504
3614
|
}
|
|
3505
3615
|
var EMPTY = [];
|
|
3506
|
-
var PageTrailContext =
|
|
3616
|
+
var PageTrailContext = React12.createContext(EMPTY);
|
|
3507
3617
|
function PageTrail({
|
|
3508
3618
|
label,
|
|
3509
3619
|
href,
|
|
3510
3620
|
onNavigate,
|
|
3511
3621
|
children
|
|
3512
3622
|
}) {
|
|
3513
|
-
const parent =
|
|
3514
|
-
const trail =
|
|
3623
|
+
const parent = React12.useContext(PageTrailContext);
|
|
3624
|
+
const trail = React12.useMemo(
|
|
3515
3625
|
() => [...parent, { label, href, onNavigate }],
|
|
3516
3626
|
[parent, label, href, onNavigate]
|
|
3517
3627
|
);
|
|
3518
3628
|
return /* @__PURE__ */ jsx(PageTrailContext.Provider, { value: trail, children });
|
|
3519
3629
|
}
|
|
3520
3630
|
function usePageTrail() {
|
|
3521
|
-
return
|
|
3631
|
+
return React12.useContext(PageTrailContext);
|
|
3522
3632
|
}
|
|
3523
3633
|
function usePageTrailParent(href) {
|
|
3524
|
-
const trail =
|
|
3525
|
-
return
|
|
3634
|
+
const trail = React12.useContext(PageTrailContext);
|
|
3635
|
+
return React12.useMemo(() => {
|
|
3526
3636
|
const above = href ? trail.filter((c) => c.href !== href) : trail;
|
|
3527
3637
|
return above[above.length - 1];
|
|
3528
3638
|
}, [trail, href]);
|
|
@@ -3538,8 +3648,8 @@ function useCurrentRouteHref() {
|
|
|
3538
3648
|
const clean = hash.split("?")[0];
|
|
3539
3649
|
return clean.startsWith("/") ? clean : `/${clean}`;
|
|
3540
3650
|
};
|
|
3541
|
-
const [href, setHref] =
|
|
3542
|
-
|
|
3651
|
+
const [href, setHref] = React12.useState(read2);
|
|
3652
|
+
React12.useEffect(() => {
|
|
3543
3653
|
const handler = () => setHref(read2());
|
|
3544
3654
|
window.addEventListener("hashchange", handler);
|
|
3545
3655
|
handler();
|
|
@@ -3550,7 +3660,7 @@ function useCurrentRouteHref() {
|
|
|
3550
3660
|
function useTrailBack(href) {
|
|
3551
3661
|
const current = useCurrentRouteHref();
|
|
3552
3662
|
const parent = usePageTrailParent(href ?? current);
|
|
3553
|
-
return
|
|
3663
|
+
return React12.useMemo(
|
|
3554
3664
|
() => parent ? { onBack: () => navigateToCrumb(parent), parentLabel: parent.label } : {},
|
|
3555
3665
|
[parent]
|
|
3556
3666
|
);
|
|
@@ -3577,23 +3687,23 @@ function CollapsibleColumn({
|
|
|
3577
3687
|
"aria-label": ariaLabel
|
|
3578
3688
|
}) {
|
|
3579
3689
|
const pinnedKey = `${storageKey}.pinned`;
|
|
3580
|
-
const [collapsed, setCollapsed] =
|
|
3581
|
-
const [pinned, setPinned] =
|
|
3582
|
-
const [hovering, setHovering] =
|
|
3583
|
-
const hoveringRef =
|
|
3584
|
-
const collapsedRef =
|
|
3690
|
+
const [collapsed, setCollapsed] = React12.useState(() => read(storageKey));
|
|
3691
|
+
const [pinned, setPinned] = React12.useState(() => read(pinnedKey));
|
|
3692
|
+
const [hovering, setHovering] = React12.useState(false);
|
|
3693
|
+
const hoveringRef = React12.useRef(false);
|
|
3694
|
+
const collapsedRef = React12.useRef(collapsed);
|
|
3585
3695
|
collapsedRef.current = collapsed;
|
|
3586
|
-
const autoRef =
|
|
3696
|
+
const autoRef = React12.useRef(false);
|
|
3587
3697
|
const open = !collapsed || hovering;
|
|
3588
3698
|
const width = open ? COLUMN_WIDTH : COLUMN_COLLAPSED_WIDTH;
|
|
3589
3699
|
const setHover = (on) => {
|
|
3590
3700
|
hoveringRef.current = on;
|
|
3591
3701
|
setHovering(on);
|
|
3592
3702
|
};
|
|
3593
|
-
|
|
3703
|
+
React12.useEffect(() => {
|
|
3594
3704
|
onWidth?.(width);
|
|
3595
3705
|
}, [width, onWidth]);
|
|
3596
|
-
const setOpenState =
|
|
3706
|
+
const setOpenState = React12.useCallback((nextCollapsed) => {
|
|
3597
3707
|
setCollapsed(nextCollapsed);
|
|
3598
3708
|
setPinned(!nextCollapsed);
|
|
3599
3709
|
autoRef.current = false;
|
|
@@ -3604,7 +3714,7 @@ function CollapsibleColumn({
|
|
|
3604
3714
|
}
|
|
3605
3715
|
if (nextCollapsed) setHover(false);
|
|
3606
3716
|
}, [storageKey, pinnedKey]);
|
|
3607
|
-
|
|
3717
|
+
React12.useEffect(() => {
|
|
3608
3718
|
if (squeezed === void 0) return;
|
|
3609
3719
|
if (squeezed) {
|
|
3610
3720
|
if (!collapsedRef.current) {
|
|
@@ -3616,8 +3726,8 @@ function CollapsibleColumn({
|
|
|
3616
3726
|
setCollapsed(false);
|
|
3617
3727
|
}
|
|
3618
3728
|
}, [squeezed]);
|
|
3619
|
-
const seen =
|
|
3620
|
-
|
|
3729
|
+
const seen = React12.useRef(null);
|
|
3730
|
+
React12.useEffect(() => {
|
|
3621
3731
|
if (autoCollapseKey === void 0) return;
|
|
3622
3732
|
if (seen.current === null) {
|
|
3623
3733
|
seen.current = autoCollapseKey;
|
|
@@ -3631,14 +3741,14 @@ function CollapsibleColumn({
|
|
|
3631
3741
|
}, autoCollapseMs);
|
|
3632
3742
|
return () => clearTimeout(t);
|
|
3633
3743
|
}, [autoCollapseKey, collapsed, pinned, autoCollapseMs]);
|
|
3634
|
-
const scrollRef =
|
|
3635
|
-
const [hasMore, setHasMore] =
|
|
3636
|
-
const onScroll =
|
|
3744
|
+
const scrollRef = React12.useRef(null);
|
|
3745
|
+
const [hasMore, setHasMore] = React12.useState(false);
|
|
3746
|
+
const onScroll = React12.useCallback(() => {
|
|
3637
3747
|
const el = scrollRef.current;
|
|
3638
3748
|
if (!el) return;
|
|
3639
3749
|
setHasMore(el.scrollHeight - el.scrollTop - el.clientHeight > 4);
|
|
3640
3750
|
}, []);
|
|
3641
|
-
|
|
3751
|
+
React12.useEffect(() => {
|
|
3642
3752
|
onScroll();
|
|
3643
3753
|
const el = scrollRef.current;
|
|
3644
3754
|
if (!el) return;
|
|
@@ -3648,11 +3758,11 @@ function CollapsibleColumn({
|
|
|
3648
3758
|
ro.disconnect();
|
|
3649
3759
|
};
|
|
3650
3760
|
}, [onScroll, open, children]);
|
|
3651
|
-
const boxRef =
|
|
3652
|
-
const panelRef =
|
|
3653
|
-
const [seamed, setSeamed] =
|
|
3654
|
-
const armedRef =
|
|
3655
|
-
const publish =
|
|
3761
|
+
const boxRef = React12.useRef(null);
|
|
3762
|
+
const panelRef = React12.useRef(null);
|
|
3763
|
+
const [seamed, setSeamed] = React12.useState(false);
|
|
3764
|
+
const armedRef = React12.useRef(false);
|
|
3765
|
+
const publish = React12.useCallback(() => {
|
|
3656
3766
|
if (!seamTop) return;
|
|
3657
3767
|
const el = panelRef.current;
|
|
3658
3768
|
const card = el?.closest(".fz-page-surface");
|
|
@@ -3675,10 +3785,10 @@ function CollapsibleColumn({
|
|
|
3675
3785
|
});
|
|
3676
3786
|
}
|
|
3677
3787
|
}, [seamTop]);
|
|
3678
|
-
|
|
3788
|
+
React12.useEffect(() => {
|
|
3679
3789
|
publish();
|
|
3680
3790
|
}, [publish, width]);
|
|
3681
|
-
|
|
3791
|
+
React12.useEffect(() => {
|
|
3682
3792
|
if (!seamTop) return;
|
|
3683
3793
|
const el = panelRef.current;
|
|
3684
3794
|
const card = el?.closest(".fz-page-surface");
|
|
@@ -3808,7 +3918,7 @@ function viewBarSubscribe(l) {
|
|
|
3808
3918
|
};
|
|
3809
3919
|
}
|
|
3810
3920
|
function ViewBarHost() {
|
|
3811
|
-
const active =
|
|
3921
|
+
const active = React12.useSyncExternalStore(viewBarSubscribe, () => viewBarCount > 0);
|
|
3812
3922
|
return /* @__PURE__ */ jsx(
|
|
3813
3923
|
"div",
|
|
3814
3924
|
{
|
|
@@ -3821,8 +3931,8 @@ function ViewBarHost() {
|
|
|
3821
3931
|
);
|
|
3822
3932
|
}
|
|
3823
3933
|
function PageViewBar({ children }) {
|
|
3824
|
-
const slot =
|
|
3825
|
-
|
|
3934
|
+
const slot = React12.useSyncExternalStore(viewBarSubscribe, () => viewBarSlot);
|
|
3935
|
+
React12.useEffect(() => {
|
|
3826
3936
|
viewBarCount++;
|
|
3827
3937
|
viewBarNotify();
|
|
3828
3938
|
return () => {
|
|
@@ -3858,9 +3968,9 @@ function RailSections({ sections, search, collapsed }) {
|
|
|
3858
3968
|
}
|
|
3859
3969
|
var RAIL_COLLAPSED_KEY = "fayz.subnav.collapsed";
|
|
3860
3970
|
function RailColumn({ className, "aria-label": ariaLabel, sections, search, footer }) {
|
|
3861
|
-
const boxRef =
|
|
3862
|
-
const [squeezed, setSqueezed] =
|
|
3863
|
-
|
|
3971
|
+
const boxRef = React12.useRef(null);
|
|
3972
|
+
const [squeezed, setSqueezed] = React12.useState(void 0);
|
|
3973
|
+
React12.useEffect(() => {
|
|
3864
3974
|
if (typeof window === "undefined") return;
|
|
3865
3975
|
const row = boxRef.current?.parentElement?.parentElement;
|
|
3866
3976
|
if (!row) return;
|
|
@@ -3920,10 +4030,10 @@ function unpublishSubNav(id) {
|
|
|
3920
4030
|
subNavNotify();
|
|
3921
4031
|
}
|
|
3922
4032
|
function useSubNavPublished() {
|
|
3923
|
-
return
|
|
4033
|
+
return React12.useSyncExternalStore(subNavSubscribe, () => published, () => published);
|
|
3924
4034
|
}
|
|
3925
4035
|
function useSubNavHost() {
|
|
3926
|
-
|
|
4036
|
+
React12.useEffect(() => {
|
|
3927
4037
|
subNavHosts++;
|
|
3928
4038
|
subNavNotify();
|
|
3929
4039
|
return () => {
|
|
@@ -3933,7 +4043,7 @@ function useSubNavHost() {
|
|
|
3933
4043
|
}, []);
|
|
3934
4044
|
}
|
|
3935
4045
|
function useHasSubNavHost() {
|
|
3936
|
-
return
|
|
4046
|
+
return React12.useSyncExternalStore(subNavSubscribe, () => subNavHosts > 0, () => false);
|
|
3937
4047
|
}
|
|
3938
4048
|
function SubNavBand({ sections, "aria-label": ariaLabel, className }) {
|
|
3939
4049
|
const items = sections.flatMap((s) => s.items);
|
|
@@ -3965,13 +4075,13 @@ function SubNavBandHost({ leading, label }) {
|
|
|
3965
4075
|
);
|
|
3966
4076
|
}
|
|
3967
4077
|
function PageSubNav({ items, sections, search, footer, style, "aria-label": ariaLabel }) {
|
|
3968
|
-
const id =
|
|
4078
|
+
const id = React12.useId();
|
|
3969
4079
|
const hasHost = useHasSubNavHost();
|
|
3970
4080
|
const resolved = sections ?? (items ? [{ items }] : []);
|
|
3971
|
-
const ref =
|
|
4081
|
+
const ref = React12.useRef(resolved);
|
|
3972
4082
|
ref.current = resolved;
|
|
3973
4083
|
const signature = JSON.stringify(resolved.map((s) => [s.key, s.heading, s.items.map((i) => [i.id, i.label, i.icon, !!i.active, !!i.premium])]));
|
|
3974
|
-
|
|
4084
|
+
React12.useEffect(() => {
|
|
3975
4085
|
publishSubNav({ id, label: ariaLabel, sections: ref.current });
|
|
3976
4086
|
return () => unpublishSubNav(id);
|
|
3977
4087
|
}, [id, ariaLabel, signature]);
|
|
@@ -3999,16 +4109,16 @@ function PremiumBadge({ className }) {
|
|
|
3999
4109
|
const tip = t("upgrade.badgeTooltip");
|
|
4000
4110
|
return /* @__PURE__ */ jsx("span", { title: tip, "aria-label": tip, className: cn("inline-flex shrink-0", className), children: /* @__PURE__ */ jsx(Crown, { className: "h-3.5 w-3.5 text-amber-500", "aria-hidden": true }) });
|
|
4001
4111
|
}
|
|
4002
|
-
var ModuleLayoutContext =
|
|
4112
|
+
var ModuleLayoutContext = React12.createContext("rail");
|
|
4003
4113
|
function ModuleLayoutProvider({ variant, children }) {
|
|
4004
4114
|
return /* @__PURE__ */ jsx(ModuleLayoutContext.Provider, { value: variant, children });
|
|
4005
4115
|
}
|
|
4006
4116
|
function useModuleLayout() {
|
|
4007
|
-
return
|
|
4117
|
+
return React12.useContext(ModuleLayoutContext);
|
|
4008
4118
|
}
|
|
4009
4119
|
function RailNavItem({ item, collapsed }) {
|
|
4010
|
-
const [expanded, setExpanded] =
|
|
4011
|
-
|
|
4120
|
+
const [expanded, setExpanded] = React12.useState(false);
|
|
4121
|
+
React12.useEffect(() => {
|
|
4012
4122
|
if (collapsed) setExpanded(false);
|
|
4013
4123
|
}, [collapsed]);
|
|
4014
4124
|
const Icon = item.icon ? ICON_MAP[item.icon] ?? null : null;
|
|
@@ -4075,9 +4185,9 @@ function defaultChildOf(item) {
|
|
|
4075
4185
|
return kids.find((c) => c.defaultChild) ?? kids.find((c) => /(^|-)list$/i.test(c.id)) ?? kids.find((c) => !/(^|-)(new|novo|nova|create)$/i.test(c.id)) ?? kids[0];
|
|
4076
4186
|
}
|
|
4077
4187
|
function MobileTabs({ nav }) {
|
|
4078
|
-
const scrollRef =
|
|
4079
|
-
const [expandedId, setExpandedId] =
|
|
4080
|
-
|
|
4188
|
+
const scrollRef = React12.useRef(null);
|
|
4189
|
+
const [expandedId, setExpandedId] = React12.useState(null);
|
|
4190
|
+
React12.useEffect(() => {
|
|
4081
4191
|
const container = scrollRef.current;
|
|
4082
4192
|
if (!container) return;
|
|
4083
4193
|
const activeEl = container.querySelector('[data-active="true"]');
|
|
@@ -4150,12 +4260,12 @@ function MobileTabs({ nav }) {
|
|
|
4150
4260
|
})()
|
|
4151
4261
|
] });
|
|
4152
4262
|
}
|
|
4153
|
-
var BackStyleContext =
|
|
4263
|
+
var BackStyleContext = React12.createContext("link");
|
|
4154
4264
|
function BackStyleProvider({ style, children }) {
|
|
4155
4265
|
return /* @__PURE__ */ jsx(BackStyleContext.Provider, { value: style, children });
|
|
4156
4266
|
}
|
|
4157
4267
|
function useBackStyle() {
|
|
4158
|
-
return
|
|
4268
|
+
return React12.useContext(BackStyleContext);
|
|
4159
4269
|
}
|
|
4160
4270
|
function SubpageHeader({ title, subtitle, description, icon, onBack, parentLabel, actions, backStyle, inline }) {
|
|
4161
4271
|
const t = useTranslation();
|
|
@@ -4311,8 +4421,8 @@ function ModuleHeader({ nav }) {
|
|
|
4311
4421
|
function ModulePage({ title: _title, subtitle, nav, children, className, headerAction, showHeader = true, sidebarFooter, navVariant, viewKey, direction, navFilterPlaceholder }) {
|
|
4312
4422
|
const ctxVariant = useModuleLayout();
|
|
4313
4423
|
const variant = navVariant ?? ctxVariant;
|
|
4314
|
-
const [navQuery, setNavQuery] =
|
|
4315
|
-
const filteredNav =
|
|
4424
|
+
const [navQuery, setNavQuery] = React12.useState("");
|
|
4425
|
+
const filteredNav = React12.useMemo(() => {
|
|
4316
4426
|
const q = navQuery.trim().toLowerCase();
|
|
4317
4427
|
if (!q) return nav;
|
|
4318
4428
|
const hit = (label) => label.toLowerCase().includes(q);
|
|
@@ -4324,7 +4434,7 @@ function ModulePage({ title: _title, subtitle, nav, children, className, headerA
|
|
|
4324
4434
|
}, [nav, navQuery]);
|
|
4325
4435
|
const transitionKey = viewKey ?? "view";
|
|
4326
4436
|
const onSubpage = useHasPageHeaderBack();
|
|
4327
|
-
const activeLabel =
|
|
4437
|
+
const activeLabel = React12.useMemo(() => {
|
|
4328
4438
|
if (onSubpage) return null;
|
|
4329
4439
|
for (const item of nav) {
|
|
4330
4440
|
const kid = item.children?.find((c) => c.active);
|
|
@@ -4365,6 +4475,6 @@ function ModulePage({ title: _title, subtitle, nav, children, className, headerA
|
|
|
4365
4475
|
] });
|
|
4366
4476
|
}
|
|
4367
4477
|
|
|
4368
|
-
export { AppShell, BackStyleProvider, BottomSheet, COLUMN_WIDTH, CollapsibleColumn, HeaderTabs, Hint, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeader, PageHeaderActions, PageHeaderCrumb, PageHeaderOutlet, PageRail, PageSubNav, PageTabs, PageTitlePortal, PageTrail, PageTransition, PageViewBar, RailColumn, RailNavItem, SUB_NAV_STYLE, SaveBar, SaveBarProvider, SheetCard, SheetRow, ShellSearch, Sidebar, SubpageHeader, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Topbar, ViewTabs, bottomNavReachesAll, isCreateRoute, navigateToCrumb, useBackHandler, useBackStyle, useCrossModuleBack, useCurrentRouteHref, useHasPageActions, useHasPageHeaderBack, useHasPageHeaderHost, useHasPageHeaderOutlet, useLayoutStore, useModuleHeaderActionsSlot, useModuleHeaderSlot, useModuleLayout, useModuleViewLabel, useNavTransition, usePageHeader, usePageHeaderClaimed, usePageHeaderHost, usePageTrail, usePageTrailParent, usePublishModuleViewLabel, useRailRow, useRegisterPageActions, useSaveBar, useSaveBarVisible, useSheetClose, useSheetDrag, useTrailBack };
|
|
4369
|
-
//# sourceMappingURL=chunk-
|
|
4370
|
-
//# sourceMappingURL=chunk-
|
|
4478
|
+
export { AppShell, BackStyleProvider, BottomSheet, COLUMN_WIDTH, CollapsibleColumn, HeaderTabs, Hint, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeader, PageHeaderActions, PageHeaderCrumb, PageHeaderOutlet, PageRail, PageSubNav, PageTabs, PageTitlePortal, PageTrail, PageTransition, PageViewBar, RailColumn, RailNavItem, SUB_NAV_STYLE, SaveBar, SaveBarProvider, SheetCard, SheetRow, ShellSearch, Sidebar, SubpageHeader, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Topbar, ViewTabs, bottomNavReachesAll, isCreateRoute, navigateToCrumb, useBackHandler, useBackStyle, useCrossModuleBack, useCurrentRouteHref, useHasPageActions, useHasPageHeaderBack, useHasPageHeaderHost, useHasPageHeaderOutlet, useLayoutStore, useModalHost, useModuleHeaderActionsSlot, useModuleHeaderSlot, useModuleLayout, useModuleViewLabel, useNavTransition, usePageHeader, usePageHeaderClaimed, usePageHeaderHost, usePageTrail, usePageTrailParent, usePublishModuleViewLabel, useRailRow, useRegisterPageActions, useSaveBar, useSaveBarVisible, useSheetClose, useSheetDrag, useTrailBack };
|
|
4479
|
+
//# sourceMappingURL=chunk-63BB2CNP.js.map
|
|
4480
|
+
//# sourceMappingURL=chunk-63BB2CNP.js.map
|