@fayz-ai/ui 0.33.0 → 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.
Files changed (54) hide show
  1. package/dist/{chunk-NXSDQ7HO.js → chunk-2CRN3BOD.js} +13 -16
  2. package/dist/chunk-2CRN3BOD.js.map +1 -0
  3. package/dist/{chunk-PL5CUWNE.js → chunk-63BB2CNP.js} +883 -309
  4. package/dist/chunk-63BB2CNP.js.map +1 -0
  5. package/dist/{chunk-3XKDGBP4.js → chunk-FNGCA3XR.js} +3 -3
  6. package/dist/{chunk-3XKDGBP4.js.map → chunk-FNGCA3XR.js.map} +1 -1
  7. package/dist/{chunk-UFT3MA5H.js → chunk-OBWOHU5E.js} +324 -223
  8. package/dist/chunk-OBWOHU5E.js.map +1 -0
  9. package/dist/dashboard/DashboardGrid.d.ts +8 -1
  10. package/dist/dashboard/DashboardGrid.d.ts.map +1 -1
  11. package/dist/dashboard/KpiCard.d.ts.map +1 -1
  12. package/dist/dashboard/index.js +3 -3
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +8 -8
  16. package/dist/layout/AppShell.d.ts.map +1 -1
  17. package/dist/layout/ModulePage.d.ts +47 -1
  18. package/dist/layout/ModulePage.d.ts.map +1 -1
  19. package/dist/layout/SaveBar.d.ts.map +1 -1
  20. package/dist/layout/Sidebar.d.ts.map +1 -1
  21. package/dist/layout/index.d.ts +1 -1
  22. package/dist/layout/index.d.ts.map +1 -1
  23. package/dist/layout/index.js +1 -1
  24. package/dist/layout/rail-flyout.d.ts.map +1 -1
  25. package/dist/primitives/collapsible-column.d.ts +38 -0
  26. package/dist/primitives/collapsible-column.d.ts.map +1 -0
  27. package/dist/primitives/coming-soon.d.ts +31 -0
  28. package/dist/primitives/coming-soon.d.ts.map +1 -0
  29. package/dist/primitives/filter-panel.d.ts +85 -0
  30. package/dist/primitives/filter-panel.d.ts.map +1 -0
  31. package/dist/primitives/filter-rail.d.ts +10 -7
  32. package/dist/primitives/filter-rail.d.ts.map +1 -1
  33. package/dist/primitives/header-tabs.d.ts +9 -35
  34. package/dist/primitives/header-tabs.d.ts.map +1 -1
  35. package/dist/primitives/index.d.ts +3 -1
  36. package/dist/primitives/index.d.ts.map +1 -1
  37. package/dist/primitives/index.js +3 -3
  38. package/dist/primitives/modal.d.ts +2 -0
  39. package/dist/primitives/modal.d.ts.map +1 -1
  40. package/dist/primitives/nav-connector.d.ts +23 -0
  41. package/dist/primitives/nav-connector.d.ts.map +1 -0
  42. package/dist/primitives/page-actions.d.ts.map +1 -1
  43. package/dist/primitives/person-picker.d.ts +1 -1
  44. package/dist/primitives/person-picker.d.ts.map +1 -1
  45. package/dist/primitives/search-select.d.ts.map +1 -1
  46. package/dist/stores/index.d.ts +1 -1
  47. package/dist/stores/index.d.ts.map +1 -1
  48. package/dist/stores/page-header.store.d.ts +17 -0
  49. package/dist/stores/page-header.store.d.ts.map +1 -1
  50. package/dist/styles.css +84 -0
  51. package/package.json +2 -2
  52. package/dist/chunk-NXSDQ7HO.js.map +0 -1
  53. package/dist/chunk-PL5CUWNE.js.map +0 -1
  54. package/dist/chunk-UFT3MA5H.js.map +0 -1
@@ -1,13 +1,12 @@
1
- import { useIsWide, Dropdown, DropdownTrigger, DropdownContent, DropdownSeparator, DropdownItem, Card, FilterMenuRow, FilterMenu, DataTable, Popover, PopoverTrigger, PopoverContent, Checkbox } from './chunk-3XKDGBP4.js';
2
- import { useSaveBarVisible, useCrossModuleBack, useBackHandler, Hint, PageHeaderActions } from './chunk-PL5CUWNE.js';
1
+ import { useIsWide, Dropdown, DropdownTrigger, DropdownContent, DropdownSeparator, DropdownItem, Card, FilterMenuRow, FilterMenu, DataTable, Popover, PopoverTrigger, PopoverContent, Checkbox } from './chunk-FNGCA3XR.js';
2
+ import { COLUMN_WIDTH, useSaveBarVisible, useCrossModuleBack, useBackHandler, Hint, PageHeaderActions, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, ModalDescription, ModalFooter, SubpageHeader, PageRail, CollapsibleColumn } from './chunk-63BB2CNP.js';
3
3
  import { cn, Button } from './chunk-OKZ6WQB3.js';
4
- import * as React18 from 'react';
5
- import React18__default, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
4
+ import * as React17 from 'react';
5
+ import React17__default, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
6
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
  import { cva } from 'class-variance-authority';
8
- import * as DialogPrimitive from '@radix-ui/react-dialog';
9
- import { X, ChevronDown, ChevronUp, Check, ArrowLeft, MoreHorizontal, Plus, MoreVertical, Search, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, ImageIcon, RefreshCw, Clock, Download, Calendar, Loader2, Pencil, CalendarDays, MicOff, Mic } from 'lucide-react';
10
8
  import * as SelectPrimitive from '@radix-ui/react-select';
9
+ import { ChevronDown, ChevronUp, Check, ArrowLeft, MoreHorizontal, Search, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, ImageIcon, RefreshCw, Clock, X, Plus, Download, Calendar, Loader2, Pencil, CalendarDays, MicOff, Mic, ArrowRight, MoreVertical } from 'lucide-react';
11
10
  import { Toaster } from 'sonner';
12
11
  export { toast } from 'sonner';
13
12
  import * as TabsPrimitive from '@radix-ui/react-tabs';
@@ -15,9 +14,9 @@ import * as SeparatorPrimitive from '@radix-ui/react-separator';
15
14
  import { createPortal } from 'react-dom';
16
15
  import { useTranslation, getCountry, unmaskPhone, maskPhone, getCurrentLocale } from '@fayz-ai/core';
17
16
 
18
- var Input = React18.forwardRef(
17
+ var Input = React17.forwardRef(
19
18
  ({ className, type, error, description, id, ...props }, ref) => {
20
- const inputId = id ?? React18.useId();
19
+ const inputId = id ?? React17.useId();
21
20
  const descriptionId = description ? `${inputId}-description` : void 0;
22
21
  const errorId = error ? `${inputId}-error` : void 0;
23
22
  return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
@@ -92,100 +91,10 @@ function Badge({ className, variant, dot, children, ...props }) {
92
91
  children
93
92
  ] });
94
93
  }
95
- var SIZE_MAP = {
96
- sm: "sm:max-w-sm",
97
- md: "sm:max-w-md",
98
- lg: "sm:max-w-lg",
99
- xl: "sm:max-w-xl",
100
- "2xl": "sm:max-w-2xl",
101
- "3xl": "sm:max-w-3xl",
102
- // Duas colunas de trabalho lado a lado (ficha + linha do tempo) não cabem em
103
- // 3xl: a coluna da direita fica com 20rem e o texto de cada anotação quebra
104
- // a cada quatro palavras.
105
- "4xl": "sm:max-w-4xl",
106
- "5xl": "sm:max-w-5xl",
107
- full: "sm:max-w-[calc(100vw-4rem)]"
108
- };
109
- var Modal = DialogPrimitive.Root;
110
- var ModalTrigger = DialogPrimitive.Trigger;
111
- var ModalClose = DialogPrimitive.Close;
112
- var ModalPortal = DialogPrimitive.Portal;
113
- var ModalOverlay = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
114
- DialogPrimitive.Overlay,
115
- {
116
- ref,
117
- className: cn(
118
- "fayz-modal-overlay saas-mdl-ov fixed inset-0 z-[100]",
119
- "flex items-center justify-center p-0 sm:p-6",
120
- className
121
- ),
122
- ...props
123
- }
124
- ));
125
- ModalOverlay.displayName = "ModalOverlay";
126
- var ModalContent = React18.forwardRef(({ className, children, size = "lg", hideClose, noPadding, onPointerDownOutside, onInteractOutside, onCloseAutoFocus, ...props }, ref) => /* @__PURE__ */ jsx(ModalPortal, { children: /* @__PURE__ */ jsx(ModalOverlay, { children: /* @__PURE__ */ jsxs(
127
- DialogPrimitive.Content,
128
- {
129
- ref,
130
- onCloseAutoFocus: (e) => {
131
- e.preventDefault();
132
- onCloseAutoFocus?.(e);
133
- },
134
- onPointerDownOutside: (e) => {
135
- const target = e.target;
136
- if (target.closest("[data-modal-passthrough]") || target.closest("[data-radix-popper-content-wrapper]")) {
137
- e.preventDefault();
138
- }
139
- onPointerDownOutside?.(e);
140
- },
141
- onInteractOutside: (e) => {
142
- const target = e.target;
143
- if (target.closest("[data-modal-passthrough]") || target.closest("[data-radix-popper-content-wrapper]")) {
144
- e.preventDefault();
145
- }
146
- onInteractOutside?.(e);
147
- },
148
- className: cn(
149
- // fz-container: a form inside a dialog measures the DIALOG. Without
150
- // it a two-column field grid in an `sm` modal read the window's width
151
- // and kept both columns in 380px.
152
- "fayz-glass-surface fayz-modal-content saas-mdl-ct fz-container relative z-[100] flex flex-col w-full outline-none",
153
- // Mobile fullscreen
154
- "h-full rounded-none border-0",
155
- // Desktop centered card
156
- "sm:h-auto sm:max-h-[85vh] sm:rounded-2xl sm:border",
157
- SIZE_MAP[size],
158
- noPadding ? "" : "p-6 gap-4",
159
- className
160
- ),
161
- ...props,
162
- children: [
163
- children,
164
- !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: [
165
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
166
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
167
- ] })
168
- ]
169
- }
170
- ) }) }));
171
- ModalContent.displayName = "ModalContent";
172
- function ModalHeader({ className, ...props }) {
173
- return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left shrink-0", className), ...props });
174
- }
175
- function ModalBody({ className, ...props }) {
176
- return /* @__PURE__ */ jsx("div", { className: cn("flex flex-1 flex-col overflow-y-auto min-h-0", className), ...props });
177
- }
178
- function ModalFooter({ className, ...props }) {
179
- 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 });
180
- }
181
- var ModalTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
182
- ModalTitle.displayName = "ModalTitle";
183
- var ModalDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
184
- ModalDescription.displayName = "ModalDescription";
185
94
  var Select = SelectPrimitive.Root;
186
95
  var SelectGroup = SelectPrimitive.Group;
187
96
  var SelectValue = SelectPrimitive.Value;
188
- var SelectTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
97
+ var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
189
98
  SelectPrimitive.Trigger,
190
99
  {
191
100
  ref,
@@ -201,7 +110,7 @@ var SelectTrigger = React18.forwardRef(({ className, children, ...props }, ref)
201
110
  }
202
111
  ));
203
112
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
204
- var SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
113
+ var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
205
114
  SelectPrimitive.ScrollUpButton,
206
115
  {
207
116
  ref,
@@ -214,7 +123,7 @@ var SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) =>
214
123
  }
215
124
  ));
216
125
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
217
- var SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
126
+ var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
218
127
  SelectPrimitive.ScrollDownButton,
219
128
  {
220
129
  ref,
@@ -227,7 +136,7 @@ var SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) =
227
136
  }
228
137
  ));
229
138
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
230
- var SelectContent = React18.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
139
+ var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
231
140
  SelectPrimitive.Content,
232
141
  {
233
142
  ref,
@@ -255,7 +164,7 @@ var SelectContent = React18.forwardRef(({ className, children, position = "poppe
255
164
  }
256
165
  ) }));
257
166
  SelectContent.displayName = SelectPrimitive.Content.displayName;
258
- var SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
167
+ var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
259
168
  SelectPrimitive.Label,
260
169
  {
261
170
  ref,
@@ -267,7 +176,7 @@ var SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
267
176
  }
268
177
  ));
269
178
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
270
- var SelectItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
179
+ var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
271
180
  SelectPrimitive.Item,
272
181
  {
273
182
  ref,
@@ -283,7 +192,7 @@ var SelectItem = React18.forwardRef(({ className, children, ...props }, ref) =>
283
192
  }
284
193
  ));
285
194
  SelectItem.displayName = SelectPrimitive.Item.displayName;
286
- var SelectSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
195
+ var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
287
196
  SelectPrimitive.Separator,
288
197
  {
289
198
  ref,
@@ -321,7 +230,7 @@ function ToastProvider({
321
230
  );
322
231
  }
323
232
  var Tabs = TabsPrimitive.Root;
324
- var TabsList = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
233
+ var TabsList = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
325
234
  TabsPrimitive.List,
326
235
  {
327
236
  ref,
@@ -335,7 +244,7 @@ var TabsList = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__
335
244
  }
336
245
  ));
337
246
  TabsList.displayName = TabsPrimitive.List.displayName;
338
- var TabsTrigger = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
247
+ var TabsTrigger = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
339
248
  TabsPrimitive.Trigger,
340
249
  {
341
250
  ref,
@@ -347,7 +256,7 @@ var TabsTrigger = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
347
256
  }
348
257
  ));
349
258
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
350
- var TabsContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
259
+ var TabsContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
351
260
  TabsPrimitive.Content,
352
261
  {
353
262
  ref,
@@ -359,7 +268,7 @@ var TabsContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
359
268
  }
360
269
  ));
361
270
  TabsContent.displayName = TabsPrimitive.Content.displayName;
362
- var Separator2 = React18.forwardRef(
271
+ var Separator2 = React17.forwardRef(
363
272
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
364
273
  SeparatorPrimitive.Root,
365
274
  {
@@ -410,7 +319,7 @@ function formatPhone(digits, fallback, countryCode) {
410
319
  const tail = rest.length === 9 ? rest.slice(5) : rest.slice(4);
411
320
  return `+55 (${ddd}) ${head}-${tail}`;
412
321
  }
413
- var PhoneLink = React18.forwardRef(
322
+ var PhoneLink = React17.forwardRef(
414
323
  ({ phone, message, countryCode, raw, className, children, ...props }, ref) => {
415
324
  const { e164, display } = normalizePhone(phone, countryCode);
416
325
  const label = children ?? (raw ? phone ?? "" : display);
@@ -480,7 +389,10 @@ function PageActionBar({ actions, className }) {
480
389
  if (visible.length === 0) return null;
481
390
  if (!wide) {
482
391
  const usable = visible.filter((a) => !a.desktopOnly);
483
- return usable.length > 0 ? /* @__PURE__ */ jsx(PageActionFab, { actions: usable }) : null;
392
+ if (usable.length === 0) return null;
393
+ const fab = /* @__PURE__ */ jsx(PageActionFab, { actions: usable });
394
+ const fabHost = typeof document !== "undefined" ? document.querySelector(".shell-enter") ?? document.body : null;
395
+ return fabHost ? createPortal(fab, fabHost) : fab;
484
396
  }
485
397
  let seenPrimary = false;
486
398
  const primary = [];
@@ -595,9 +507,9 @@ function PageActionFab({ actions }) {
595
507
  ] });
596
508
  }
597
509
  function useScrim(open) {
598
- const [mounted, setMounted] = React18.useState(open);
599
- const [visible, setVisible] = React18.useState(open);
600
- React18.useEffect(() => {
510
+ const [mounted, setMounted] = React17.useState(open);
511
+ const [visible, setVisible] = React17.useState(open);
512
+ React17.useEffect(() => {
601
513
  if (open) {
602
514
  setMounted(true);
603
515
  const frame = requestAnimationFrame(() => setVisible(true));
@@ -611,7 +523,7 @@ function useScrim(open) {
611
523
  }
612
524
  var SCRIM_MS = 200;
613
525
  function FabButton({ actions, tone, mini }) {
614
- const [open, setOpen] = React18.useState(false);
526
+ const [open, setOpen] = React17.useState(false);
615
527
  const scrim = useScrim(open);
616
528
  if (actions.length === 0) return null;
617
529
  const isCreate = tone === "primary";
@@ -724,7 +636,7 @@ function RowActions({
724
636
  const Icon2 = a.icon;
725
637
  const isDanger = a.intent === "danger";
726
638
  const prevSafe = i > 0 && overflow[i - 1].intent !== "danger";
727
- return /* @__PURE__ */ jsxs(React18.Fragment, { children: [
639
+ return /* @__PURE__ */ jsxs(React17.Fragment, { children: [
728
640
  isDanger && prevSafe && /* @__PURE__ */ jsx(DropdownSeparator, {}),
729
641
  /* @__PURE__ */ jsxs(
730
642
  DropdownItem,
@@ -975,8 +887,8 @@ var ICON_CLASSES = {
975
887
  lg: "h-5 w-5"
976
888
  };
977
889
  function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, className }) {
978
- const [failed, setFailed] = React18.useState(false);
979
- React18.useEffect(() => {
890
+ const [failed, setFailed] = React17.useState(false);
891
+ React17.useEffect(() => {
980
892
  setFailed(false);
981
893
  }, [src]);
982
894
  const base = cn("shrink-0 overflow-hidden", SIZE_CLASSES[size], className);
@@ -1003,9 +915,9 @@ function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, classN
1003
915
  }
1004
916
  Thumbnail.displayName = "Thumbnail";
1005
917
  function RefreshButton({ onRefresh, fromCache, label, labelCached, className, ...rest }) {
1006
- const [phase, setPhase] = React18.useState("idle");
1007
- const alive = React18.useRef(true);
1008
- React18.useEffect(() => () => {
918
+ const [phase, setPhase] = React17.useState("idle");
919
+ const alive = React17.useRef(true);
920
+ React17.useEffect(() => () => {
1009
921
  alive.current = false;
1010
922
  }, []);
1011
923
  const title = fromCache ? labelCached ?? label : label;
@@ -1227,27 +1139,27 @@ function useRowSelection({
1227
1139
  getRowId,
1228
1140
  enabled = true
1229
1141
  }) {
1230
- const identify = React18.useCallback(
1142
+ const identify = React17.useCallback(
1231
1143
  (row) => getRowId ? getRowId(row) : String(row?.id ?? ""),
1232
1144
  [getRowId]
1233
1145
  );
1234
- const visible = React18.useMemo(() => rows ?? [], [rows]);
1235
- const [rawSelection, setRawSelection] = React18.useState([]);
1236
- const visibleIds = React18.useMemo(() => new Set(visible.map(identify)), [visible, identify]);
1237
- const selectedIds = React18.useMemo(
1146
+ const visible = React17.useMemo(() => rows ?? [], [rows]);
1147
+ const [rawSelection, setRawSelection] = React17.useState([]);
1148
+ const visibleIds = React17.useMemo(() => new Set(visible.map(identify)), [visible, identify]);
1149
+ const selectedIds = React17.useMemo(
1238
1150
  () => rawSelection.filter((id) => visibleIds.has(id)),
1239
1151
  [rawSelection, visibleIds]
1240
1152
  );
1241
- const selectedRows = React18.useMemo(() => {
1153
+ const selectedRows = React17.useMemo(() => {
1242
1154
  const picked = new Set(selectedIds);
1243
1155
  return visible.filter((row) => picked.has(identify(row)));
1244
1156
  }, [visible, selectedIds, identify]);
1245
- const clear = React18.useCallback(() => setRawSelection([]), []);
1246
- const selectAll = React18.useCallback(
1157
+ const clear = React17.useCallback(() => setRawSelection([]), []);
1158
+ const selectAll = React17.useCallback(
1247
1159
  () => setRawSelection(visible.map(identify)),
1248
1160
  [visible, identify]
1249
1161
  );
1250
- const barActions = React18.useMemo(
1162
+ const barActions = React17.useMemo(
1251
1163
  () => (actions ?? []).map((action) => ({
1252
1164
  id: action.id,
1253
1165
  label: action.label,
@@ -1319,10 +1231,10 @@ function ListFilterBar({
1319
1231
  className
1320
1232
  }) {
1321
1233
  const wide = useIsWide();
1322
- const usable = React18.useMemo(() => (filters ?? []).filter((f) => f.options.length > 0), [filters]);
1234
+ const usable = React17.useMemo(() => (filters ?? []).filter((f) => f.options.length > 0), [filters]);
1323
1235
  const active = usable.filter((f) => f.value != null && f.value !== "");
1324
1236
  const total = activeCount ?? active.length;
1325
- const fields = React18.useMemo(() => [
1237
+ const fields = React17.useMemo(() => [
1326
1238
  ...usable.map((f) => ({
1327
1239
  id: f.id,
1328
1240
  label: f.label,
@@ -1476,7 +1388,7 @@ function ListView({
1476
1388
  const showSearch = !!onSearchChange;
1477
1389
  const showTags = tags && tags.length > 0 && onTagChange;
1478
1390
  const selection = useRowSelection({ rows: loading ? [] : data, actions: bulkActions, getRowId });
1479
- const allFilters = React18.useMemo(() => [
1391
+ const allFilters = React17.useMemo(() => [
1480
1392
  ...showTags ? [{
1481
1393
  id: "__tag",
1482
1394
  label: tagsLabel ?? allTagLabel,
@@ -1867,7 +1779,7 @@ function toLocalISODate(d) {
1867
1779
  }
1868
1780
  function MiniCalendar({ selectedDate, onDateSelect, onMonthChange, markers }) {
1869
1781
  const locale = getCurrentLocale();
1870
- const [viewMonth, setViewMonth] = React18__default.useState(() => new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1));
1782
+ const [viewMonth, setViewMonth] = React17__default.useState(() => new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1));
1871
1783
  const monthLabel = viewMonth.toLocaleDateString(toDateLocale2(locale), { month: "long", year: "numeric" });
1872
1784
  const dayLabels = DAY_LABELS2[locale] ?? DAY_LABELS2.en;
1873
1785
  const weeks = useMemo(() => {
@@ -1947,7 +1859,7 @@ function FilterSection({
1947
1859
  count,
1948
1860
  children
1949
1861
  }) {
1950
- const [open, setOpen] = React18__default.useState(defaultOpen);
1862
+ const [open, setOpen] = React17__default.useState(defaultOpen);
1951
1863
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1952
1864
  /* @__PURE__ */ jsxs(
1953
1865
  "button",
@@ -2023,7 +1935,7 @@ function FilterCheckList({
2023
1935
  }
2024
1936
  return /* @__PURE__ */ jsx("div", { className: className ? `${className} space-y-0.5` : "space-y-0.5", children: rows });
2025
1937
  }
2026
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React18.useLayoutEffect : React18.useEffect;
1938
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React17.useLayoutEffect : React17.useEffect;
2027
1939
  function SearchSelect({
2028
1940
  value,
2029
1941
  displayValue,
@@ -2055,19 +1967,19 @@ function SearchSelect({
2055
1967
  }) {
2056
1968
  const isRequiredFilter = variant === "required-filter";
2057
1969
  const canCreate = !!onCreate && allowCreate !== false;
2058
- const [open, setOpen] = React18.useState(false);
2059
- const [query, setQuery] = React18.useState("");
2060
- const [results, setResults] = React18.useState([]);
2061
- const [loading, setLoading] = React18.useState(false);
2062
- const [creating, setCreating] = React18.useState(false);
2063
- const [selectedLabel, setSelectedLabel] = React18.useState(displayValue ?? "");
2064
- const containerRef = React18.useRef(null);
2065
- const inputRef = React18.useRef(null);
2066
- const timerRef = React18.useRef();
2067
- const [rect, setRect] = React18.useState(null);
2068
- const dropdownRef = React18.useRef(null);
2069
- const requestRef = React18.useRef(0);
2070
- React18.useEffect(() => {
1970
+ const [open, setOpen] = React17.useState(false);
1971
+ const [query, setQuery] = React17.useState("");
1972
+ const [results, setResults] = React17.useState([]);
1973
+ const [loading, setLoading] = React17.useState(false);
1974
+ const [creating, setCreating] = React17.useState(false);
1975
+ const [selectedLabel, setSelectedLabel] = React17.useState(displayValue ?? "");
1976
+ const containerRef = React17.useRef(null);
1977
+ const inputRef = React17.useRef(null);
1978
+ const timerRef = React17.useRef();
1979
+ const [rect, setRect] = React17.useState(null);
1980
+ const dropdownRef = React17.useRef(null);
1981
+ const requestRef = React17.useRef(0);
1982
+ React17.useEffect(() => {
2071
1983
  function handler(e) {
2072
1984
  const target = e.target;
2073
1985
  if (containerRef.current?.contains(target)) return;
@@ -2077,10 +1989,10 @@ function SearchSelect({
2077
1989
  document.addEventListener("mousedown", handler);
2078
1990
  return () => document.removeEventListener("mousedown", handler);
2079
1991
  }, []);
2080
- React18.useEffect(() => {
1992
+ React17.useEffect(() => {
2081
1993
  if (displayValue !== void 0) setSelectedLabel(displayValue);
2082
1994
  }, [displayValue]);
2083
- React18.useEffect(() => {
1995
+ React17.useEffect(() => {
2084
1996
  if (open && loadOnOpen && query.length === 0 && results.length === 0 && !loading) {
2085
1997
  const request = ++requestRef.current;
2086
1998
  setLoading(true);
@@ -2148,7 +2060,7 @@ function SearchSelect({
2148
2060
  setResults([]);
2149
2061
  setTimeout(() => inputRef.current?.focus(), 0);
2150
2062
  }
2151
- const groups = React18.useMemo(() => {
2063
+ const groups = React17.useMemo(() => {
2152
2064
  const map = /* @__PURE__ */ new Map();
2153
2065
  for (const opt of results) {
2154
2066
  const group = opt.group ?? "";
@@ -2280,9 +2192,17 @@ function SearchSelect({
2280
2192
  position: "fixed",
2281
2193
  left: rect.left,
2282
2194
  width: rect.width,
2195
+ // O DIALOGO POE `pointer-events: none` NO BODY.
2196
+ //
2197
+ // Esta lista vai pelo portal, para o `body` — fora do conteudo do
2198
+ // dialogo, que e o unico ramo que o Radix reabilita. Sem esta
2199
+ // linha ela aparece por cima e NAO RECEBE CLIQUE: a busca roda, o
2200
+ // resultado desenha, e escolher nao faz nada. Mesma armadilha que
2201
+ // o PaymentModal ja documentava ("aparece por cima porem surdo").
2202
+ pointerEvents: "auto",
2283
2203
  ...rect.above ? { bottom: window.innerHeight - rect.top + 4 } : { top: rect.top + 4 }
2284
2204
  },
2285
- className: "fayz-glass-surface z-[60] overflow-hidden rounded-lg border bg-popover shadow-lg",
2205
+ className: "fayz-glass-surface z-[110] overflow-hidden rounded-lg border bg-popover shadow-lg",
2286
2206
  children: [
2287
2207
  isRequiredFilter && /* @__PURE__ */ jsx("div", { className: "border-b p-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2288
2208
  /* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
@@ -2334,7 +2254,7 @@ function SearchSelect({
2334
2254
  ]
2335
2255
  },
2336
2256
  group
2337
- )) }) }) : /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-auto py-1", children: [...groups.entries()].map(([group, options]) => /* @__PURE__ */ jsxs(React18.Fragment, { children: [
2257
+ )) }) }) : /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-auto py-1", children: [...groups.entries()].map(([group, options]) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
2338
2258
  group && /* @__PURE__ */ jsx("div", { className: "sticky top-0 bg-muted/50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: group }),
2339
2259
  options.map(optionButton)
2340
2260
  ] }, group)) }),
@@ -2377,9 +2297,9 @@ function CurrencyInput({
2377
2297
  className,
2378
2298
  disabled
2379
2299
  }) {
2380
- const inputRef = React18.useRef(null);
2381
- const [focused, setFocused] = React18.useState(false);
2382
- const format = React18.useCallback((v) => {
2300
+ const inputRef = React17.useRef(null);
2301
+ const [focused, setFocused] = React17.useState(false);
2302
+ const format = React17.useCallback((v) => {
2383
2303
  return new Intl.NumberFormat(locale, {
2384
2304
  minimumFractionDigits: 2,
2385
2305
  maximumFractionDigits: 2
@@ -2506,9 +2426,9 @@ function RequiredFilter({
2506
2426
  className,
2507
2427
  contentClassName
2508
2428
  }) {
2509
- const [open, setOpen] = React18.useState(false);
2429
+ const [open, setOpen] = React17.useState(false);
2510
2430
  const missing = !value;
2511
- const close = React18.useCallback(() => setOpen(false), []);
2431
+ const close = React17.useCallback(() => setOpen(false), []);
2512
2432
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
2513
2433
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
2514
2434
  "button",
@@ -2534,6 +2454,126 @@ function RequiredFilter({
2534
2454
  /* @__PURE__ */ jsx(PopoverContent, { align, className: cn("w-72 p-1.5", contentClassName), children: typeof children === "function" ? children(close) : children })
2535
2455
  ] });
2536
2456
  }
2457
+ function FilterPanel({
2458
+ title,
2459
+ dirty,
2460
+ onApply,
2461
+ applyLabel,
2462
+ pendingTitle,
2463
+ pendingHint,
2464
+ onClear,
2465
+ clearLabel,
2466
+ busy,
2467
+ applyDisabledReason,
2468
+ children,
2469
+ advanced,
2470
+ advancedCount,
2471
+ moreLabel,
2472
+ lessLabel,
2473
+ footer,
2474
+ className
2475
+ }) {
2476
+ const blocked = Boolean(applyDisabledReason);
2477
+ const [aberto, setAberto] = React17.useState(Boolean(advancedCount));
2478
+ const jaAbriu = React17.useRef(Boolean(advancedCount));
2479
+ React17.useEffect(() => {
2480
+ if (advancedCount && !jaAbriu.current) {
2481
+ jaAbriu.current = true;
2482
+ setAberto(true);
2483
+ }
2484
+ }, [advancedCount]);
2485
+ return /* @__PURE__ */ jsxs(Card, { className: cn("p-3", className), children: [
2486
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
2487
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-muted-foreground", children: title }),
2488
+ /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-1", children: [
2489
+ onClear && clearLabel && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "h-7 px-2 text-xs", onClick: onClear, disabled: busy, children: clearLabel }),
2490
+ /* @__PURE__ */ jsx(
2491
+ Button,
2492
+ {
2493
+ size: "icon",
2494
+ "aria-label": applyLabel,
2495
+ title: applyDisabledReason || applyLabel,
2496
+ onClick: onApply,
2497
+ disabled: busy || blocked,
2498
+ className: cn(
2499
+ "h-8 w-8 rounded-full",
2500
+ dirty && !blocked && "ring-2 ring-primary/30 ring-offset-1 ring-offset-card"
2501
+ ),
2502
+ children: /* @__PURE__ */ jsx(Search, { className: "h-4 w-4" })
2503
+ }
2504
+ )
2505
+ ] })
2506
+ ] }),
2507
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children }),
2508
+ advanced && /* @__PURE__ */ jsxs(Fragment, { children: [
2509
+ /* @__PURE__ */ jsxs(
2510
+ "button",
2511
+ {
2512
+ type: "button",
2513
+ onClick: () => setAberto((v) => !v),
2514
+ "aria-expanded": aberto,
2515
+ className: "mt-2 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",
2516
+ children: [
2517
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn("h-3.5 w-3.5 transition-transform", aberto && "rotate-180") }),
2518
+ aberto ? lessLabel ?? moreLabel : moreLabel,
2519
+ !aberto && Boolean(advancedCount) && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-primary/10 px-1.5 text-[10px] font-semibold text-primary", children: advancedCount })
2520
+ ]
2521
+ }
2522
+ ),
2523
+ aberto && /* @__PURE__ */ jsx("div", { className: "mt-2 grid gap-3 border-t pt-3 sm:grid-cols-2 lg:grid-cols-4", children: advanced })
2524
+ ] }),
2525
+ footer && /* @__PURE__ */ jsx("div", { className: "mt-3", children: footer }),
2526
+ /* @__PURE__ */ jsx(
2527
+ DraftCommitBar,
2528
+ {
2529
+ open: dirty,
2530
+ title: pendingTitle,
2531
+ hint: pendingHint,
2532
+ icon: Search,
2533
+ commitLabel: applyLabel,
2534
+ onCommit: onApply,
2535
+ busy,
2536
+ commitDisabledReason: applyDisabledReason,
2537
+ className: "static mt-3 shadow-sm"
2538
+ }
2539
+ )
2540
+ ] });
2541
+ }
2542
+ FilterPanel.displayName = "FilterPanel";
2543
+ function FilterPanelField({ label, compact, required, className, children }) {
2544
+ return /* @__PURE__ */ jsxs("div", { className: cn("min-w-0", className), children: [
2545
+ /* @__PURE__ */ jsxs("p", { className: cn("text-[10px] font-medium uppercase tracking-wide text-muted-foreground", !compact && "mb-1"), children: [
2546
+ label,
2547
+ required ? " *" : ""
2548
+ ] }),
2549
+ children
2550
+ ] });
2551
+ }
2552
+ FilterPanelField.displayName = "FilterPanelField";
2553
+ function useFilterDraft(initial) {
2554
+ const inicial = React17.useRef(initial);
2555
+ const [draft, setDraft] = React17.useState(initial);
2556
+ const [applied, setApplied] = React17.useState(initial);
2557
+ const dirty = React17.useMemo(
2558
+ () => JSON.stringify(draft) !== JSON.stringify(applied),
2559
+ [draft, applied]
2560
+ );
2561
+ const patch = React17.useCallback((changes) => {
2562
+ setDraft((atual) => ({ ...atual, ...changes }));
2563
+ }, []);
2564
+ const apply = React17.useCallback(() => {
2565
+ setDraft((atual) => {
2566
+ setApplied(atual);
2567
+ return atual;
2568
+ });
2569
+ }, []);
2570
+ const reset = React17.useCallback((value) => {
2571
+ const alvo = value ?? inicial.current;
2572
+ setDraft(alvo);
2573
+ setApplied(alvo);
2574
+ }, []);
2575
+ return { draft, applied, patch, setDraft, dirty, apply, reset };
2576
+ }
2537
2577
  function formatRange(from, to, locale) {
2538
2578
  const parse = (s) => {
2539
2579
  const [y, m, d] = s.split("-").map(Number);
@@ -2563,7 +2603,7 @@ function DateRangeChip({
2563
2603
  label,
2564
2604
  className
2565
2605
  }) {
2566
- const [open, setOpen] = React18.useState(false);
2606
+ const [open, setOpen] = React17.useState(false);
2567
2607
  const active = !!(from || to);
2568
2608
  const locale = typeof navigator !== "undefined" ? navigator.language : "en";
2569
2609
  const presetLabel = presets.find((p) => p.value === preset)?.label;
@@ -2668,9 +2708,9 @@ function MultiSelect({
2668
2708
  variant = "field",
2669
2709
  icon: Icon2
2670
2710
  }) {
2671
- const [query, setQuery] = React18.useState("");
2672
- const selected = React18.useMemo(() => new Set(value), [value]);
2673
- const filtered = React18.useMemo(() => {
2711
+ const [query, setQuery] = React17.useState("");
2712
+ const selected = React17.useMemo(() => new Set(value), [value]);
2713
+ const filtered = React17.useMemo(() => {
2674
2714
  const q = query.trim().toLowerCase();
2675
2715
  if (!q) return options;
2676
2716
  return options.filter((o) => o.label.toLowerCase().includes(q));
@@ -2789,7 +2829,8 @@ function MultiSelect({
2789
2829
  var AVATAR_SIZE = {
2790
2830
  xs: "h-5 w-5 text-[9px]",
2791
2831
  sm: "h-6 w-6 text-[10px]",
2792
- md: "h-8 w-8 text-xs"
2832
+ md: "h-8 w-8 text-xs",
2833
+ lg: "h-10 w-10 text-sm"
2793
2834
  };
2794
2835
  function personInitials(name) {
2795
2836
  const parts = name.trim().split(/\s+/).map((w) => w.replace(/[^\p{L}\p{N}]/gu, "")).filter(Boolean);
@@ -2807,8 +2848,8 @@ function hueFor(name) {
2807
2848
  return AVATAR_HUES[h % AVATAR_HUES.length];
2808
2849
  }
2809
2850
  function PersonAvatar({ name, src, size = "sm", className }) {
2810
- const [failed, setFailed] = React18.useState(false);
2811
- React18.useEffect(() => {
2851
+ const [failed, setFailed] = React17.useState(false);
2852
+ React17.useEffect(() => {
2812
2853
  setFailed(false);
2813
2854
  }, [src]);
2814
2855
  const base = cn("shrink-0 overflow-hidden rounded-full", AVATAR_SIZE[size], className);
@@ -2848,7 +2889,7 @@ function ListShell({
2848
2889
  footer,
2849
2890
  children
2850
2891
  }) {
2851
- const filtered = React18.useMemo(() => {
2892
+ const filtered = React17.useMemo(() => {
2852
2893
  const q = query.trim().toLowerCase();
2853
2894
  if (!q) return options;
2854
2895
  return options.filter((o) => o.name.toLowerCase().includes(q));
@@ -2871,7 +2912,7 @@ function ListShell({
2871
2912
  )
2872
2913
  ] }),
2873
2914
  /* @__PURE__ */ jsxs("div", { className: "max-h-72 overflow-y-auto py-1", children: [
2874
- filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-5 text-center text-xs text-muted-foreground", children: emptyLabel }) : filtered.map((o) => /* @__PURE__ */ jsx(React18.Fragment, { children: children(o) }, o.id)),
2915
+ filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-5 text-center text-xs text-muted-foreground", children: emptyLabel }) : filtered.map((o) => /* @__PURE__ */ jsx(React17.Fragment, { children: children(o) }, o.id)),
2875
2916
  footer
2876
2917
  ] })
2877
2918
  ] });
@@ -2906,8 +2947,8 @@ function PersonPicker({
2906
2947
  onClear,
2907
2948
  variant = "input"
2908
2949
  }) {
2909
- const [query, setQuery] = React18.useState("");
2910
- const [open, setOpen] = React18.useState(false);
2950
+ const [query, setQuery] = React17.useState("");
2951
+ const [open, setOpen] = React17.useState(false);
2911
2952
  const current = options.find((o) => o.id === value);
2912
2953
  return /* @__PURE__ */ jsxs(Dropdown, { open, onOpenChange: setOpen, children: [
2913
2954
  /* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs("button", { type: "button", disabled, className: cn(TRIGGER_CLASSES[variant], className), children: [
@@ -2985,8 +3026,8 @@ function PersonMultiPicker({
2985
3026
  max,
2986
3027
  variant = "input"
2987
3028
  }) {
2988
- const [query, setQuery] = React18.useState("");
2989
- const selected = React18.useMemo(() => new Set(value), [value]);
3029
+ const [query, setQuery] = React17.useState("");
3030
+ const selected = React17.useMemo(() => new Set(value), [value]);
2990
3031
  const atCeiling = max != null && value.length >= max;
2991
3032
  function toggle(id) {
2992
3033
  if (selected.has(id)) onChange(value.filter((x) => x !== id));
@@ -3085,17 +3126,17 @@ function DictateButton({
3085
3126
  className,
3086
3127
  disabled
3087
3128
  }) {
3088
- const [ouvindo, setOuvindo] = React18.useState(false);
3089
- const [erro, setErro] = React18.useState(null);
3090
- const ref = React18.useRef(null);
3091
- const [suportado, setSuportado] = React18.useState(false);
3092
- React18.useEffect(() => {
3129
+ const [ouvindo, setOuvindo] = React17.useState(false);
3130
+ const [erro, setErro] = React17.useState(null);
3131
+ const ref = React17.useRef(null);
3132
+ const [suportado, setSuportado] = React17.useState(false);
3133
+ React17.useEffect(() => {
3093
3134
  setSuportado(recognitionCtor() !== null);
3094
3135
  }, []);
3095
- React18.useEffect(() => () => {
3136
+ React17.useEffect(() => () => {
3096
3137
  ref.current?.stop();
3097
3138
  }, []);
3098
- const alternar = React18.useCallback(() => {
3139
+ const alternar = React17.useCallback(() => {
3099
3140
  if (ouvindo) {
3100
3141
  ref.current?.stop();
3101
3142
  return;
@@ -3158,7 +3199,7 @@ function renderInline(text, keyPrefix) {
3158
3199
  if (part.startsWith("`") && part.endsWith("`") && part.length > 2) {
3159
3200
  return /* @__PURE__ */ jsx("code", { className: "rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]", children: part.slice(1, -1) }, key);
3160
3201
  }
3161
- return part === "" ? null : /* @__PURE__ */ jsx(React18.Fragment, { children: part }, key);
3202
+ return part === "" ? null : /* @__PURE__ */ jsx(React17.Fragment, { children: part }, key);
3162
3203
  });
3163
3204
  }
3164
3205
  function parseBlocks(source) {
@@ -3242,7 +3283,7 @@ function renderMarkdown(source) {
3242
3283
  case "ol":
3243
3284
  return /* @__PURE__ */ jsx("ol", { className: "list-decimal space-y-1 pl-5", children: block.items.map((item, li) => /* @__PURE__ */ jsx("li", { children: renderInline(item, `${key}-${li}`) }, `${key}-${li}`)) }, key);
3244
3285
  case "p":
3245
- return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(React18.Fragment, { children: [
3286
+ return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
3246
3287
  li > 0 && /* @__PURE__ */ jsx("br", {}),
3247
3288
  renderInline(l, `${key}-${li}`)
3248
3289
  ] }, `${key}-${li}`)) }, key);
@@ -3263,7 +3304,7 @@ function MarkdownEditor({
3263
3304
  renderPreview,
3264
3305
  className
3265
3306
  }) {
3266
- const [mode, setMode] = React18.useState(
3307
+ const [mode, setMode] = React17.useState(
3267
3308
  defaultMode === "preview" && value.trim() === "" ? "edit" : defaultMode
3268
3309
  );
3269
3310
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
@@ -3548,29 +3589,29 @@ function PickerList({
3548
3589
  listClassName,
3549
3590
  autoFocus = true
3550
3591
  }) {
3551
- const [query, setQuery] = React18.useState("");
3592
+ const [query, setQuery] = React17.useState("");
3552
3593
  const term = normalize(query.trim());
3553
- const sections = React18.useMemo(
3594
+ const sections = React17.useMemo(
3554
3595
  () => groups ?? [{ id: "_", options: options ?? [] }],
3555
3596
  [groups, options]
3556
3597
  );
3557
- const total = React18.useMemo(
3598
+ const total = React17.useMemo(
3558
3599
  () => sections.reduce((n, g) => n + g.options.length, 0),
3559
3600
  [sections]
3560
3601
  );
3561
- const visible = React18.useMemo(() => {
3602
+ const visible = React17.useMemo(() => {
3562
3603
  if (!term) return sections;
3563
3604
  const hits = sections.flatMap((g) => g.options.filter((o) => optionMatches(o, term)));
3564
3605
  return [{ id: "_results", options: hits }];
3565
3606
  }, [sections, term]);
3566
- const flat = React18.useMemo(() => visible.flatMap((g) => g.options), [visible]);
3567
- const [active, setActive] = React18.useState(0);
3568
- const listRef = React18.useRef(null);
3569
- React18.useEffect(() => {
3607
+ const flat = React17.useMemo(() => visible.flatMap((g) => g.options), [visible]);
3608
+ const [active, setActive] = React17.useState(0);
3609
+ const listRef = React17.useRef(null);
3610
+ React17.useEffect(() => {
3570
3611
  const i = flat.findIndex((o) => o.id === value);
3571
3612
  setActive(i >= 0 ? i : 0);
3572
3613
  }, [term]);
3573
- React18.useEffect(() => {
3614
+ React17.useEffect(() => {
3574
3615
  listRef.current?.querySelector(`[data-picker-index="${active}"]`)?.scrollIntoView({ block: "nearest" });
3575
3616
  }, [active]);
3576
3617
  function step(delta) {
@@ -3632,7 +3673,7 @@ function PickerList({
3632
3673
  className: cn("min-h-0 flex-1 overflow-y-auto py-1", listClassName),
3633
3674
  children: [
3634
3675
  flat.length === 0 && /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: emptyLabel }),
3635
- visible.map((group) => /* @__PURE__ */ jsxs(React18.Fragment, { children: [
3676
+ visible.map((group) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
3636
3677
  group.label && group.options.length > 0 && /* @__PURE__ */ jsx("p", { className: "px-3 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: group.label }),
3637
3678
  group.options.map((o) => {
3638
3679
  index += 1;
@@ -3853,7 +3894,7 @@ function NestedPane({ title, hint, onBack, children, className }) {
3853
3894
  children
3854
3895
  ] });
3855
3896
  }
3856
- var ModalTaskContext = React18.createContext(null);
3897
+ var ModalTaskContext = React17.createContext(null);
3857
3898
  function ModalTaskHeader({ title, hint, stack, onClose }) {
3858
3899
  const popTo = (index) => {
3859
3900
  for (let i = stack.length - 1; i > index; i--) stack[i].onBack();
@@ -3886,7 +3927,7 @@ function ModalTaskHeader({ title, hint, stack, onClose }) {
3886
3927
  children: title
3887
3928
  }
3888
3929
  ),
3889
- stack.map((c, i) => /* @__PURE__ */ jsxs(React18.Fragment, { children: [
3930
+ stack.map((c, i) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
3890
3931
  /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground/50", "aria-hidden": true }),
3891
3932
  i < stack.length - 1 ? /* @__PURE__ */ jsx(
3892
3933
  "button",
@@ -3912,10 +3953,10 @@ function ModalTaskHeader({ title, hint, stack, onClose }) {
3912
3953
  ] });
3913
3954
  }
3914
3955
  function ModalTaskHost({ children, className, header }) {
3915
- const [stack, setStack] = React18.useState([]);
3916
- const [slot, setSlot] = React18.useState(null);
3917
- const idRef = React18.useRef(0);
3918
- const api = React18.useMemo(() => ({
3956
+ const [stack, setStack] = React17.useState([]);
3957
+ const [slot, setSlot] = React17.useState(null);
3958
+ const idRef = React17.useRef(0);
3959
+ const api = React17.useMemo(() => ({
3919
3960
  open: (meta) => {
3920
3961
  const id = ++idRef.current;
3921
3962
  setStack((s) => [...s, { id, meta }]);
@@ -3924,7 +3965,7 @@ function ModalTaskHost({ children, className, header }) {
3924
3965
  close: (id) => setStack((s) => s.filter((e) => e.id !== id))
3925
3966
  }), []);
3926
3967
  const top = stack.length ? stack[stack.length - 1] : null;
3927
- const value = React18.useMemo(
3968
+ const value = React17.useMemo(
3928
3969
  () => ({ ...api, topId: top?.id ?? null, slot }),
3929
3970
  [api, top?.id, slot]
3930
3971
  );
@@ -3935,14 +3976,14 @@ function ModalTaskHost({ children, className, header }) {
3935
3976
  ] });
3936
3977
  }
3937
3978
  function useInModalTaskHost() {
3938
- return React18.useContext(ModalTaskContext) !== null;
3979
+ return React17.useContext(ModalTaskContext) !== null;
3939
3980
  }
3940
3981
  function ModalTask({ open, title, hint, onClose, width, children }) {
3941
- const host = React18.useContext(ModalTaskContext);
3942
- const onCloseRef = React18.useRef(onClose);
3982
+ const host = React17.useContext(ModalTaskContext);
3983
+ const onCloseRef = React17.useRef(onClose);
3943
3984
  onCloseRef.current = onClose;
3944
- const [myId, setMyId] = React18.useState(null);
3945
- React18.useEffect(() => {
3985
+ const [myId, setMyId] = React17.useState(null);
3986
+ React17.useEffect(() => {
3946
3987
  if (!host || !open) return;
3947
3988
  const id = host.open({ title, hint, onBack: () => onCloseRef.current() });
3948
3989
  setMyId(id);
@@ -4008,13 +4049,13 @@ function StockEntryForm({
4008
4049
  labels: overrides
4009
4050
  }) {
4010
4051
  const labels = { ...DEFAULT_LABELS, ...overrides };
4011
- const [quantity, setQuantity] = React18.useState("");
4012
- const [reasonCode, setReasonCode] = React18.useState("");
4013
- const [occurredOn, setOccurredOn] = React18.useState(todayISO());
4014
- const [note, setNote] = React18.useState("");
4015
- const [noteOpen, setNoteOpen] = React18.useState(false);
4016
- const quantityRef = React18.useRef(null);
4017
- React18.useEffect(() => {
4052
+ const [quantity, setQuantity] = React17.useState("");
4053
+ const [reasonCode, setReasonCode] = React17.useState("");
4054
+ const [occurredOn, setOccurredOn] = React17.useState(todayISO());
4055
+ const [note, setNote] = React17.useState("");
4056
+ const [noteOpen, setNoteOpen] = React17.useState(false);
4057
+ const quantityRef = React17.useRef(null);
4058
+ React17.useEffect(() => {
4018
4059
  if (verb === null) return;
4019
4060
  setQuantity("");
4020
4061
  setReasonCode("");
@@ -4139,6 +4180,61 @@ function StockEntryForm({
4139
4180
  ] })
4140
4181
  ] }) });
4141
4182
  }
4183
+ function EmBreve({ label, o_que, quantas }) {
4184
+ return /* @__PURE__ */ jsxs(
4185
+ "button",
4186
+ {
4187
+ type: "button",
4188
+ disabled: true,
4189
+ title: `${o_que}${quantas ? ` \u2014 ${quantas}` : ""}`,
4190
+ className: "inline-flex cursor-not-allowed items-center gap-1.5 rounded-md border border-dashed border-input px-2.5 py-1 text-[11px] text-muted-foreground opacity-80",
4191
+ children: [
4192
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3", "aria-hidden": true }),
4193
+ label,
4194
+ /* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[10px]", children: "Em breve" })
4195
+ ]
4196
+ }
4197
+ );
4198
+ }
4199
+ function ComingSoon({
4200
+ title,
4201
+ summary,
4202
+ v1Path,
4203
+ missing,
4204
+ v1AlsoMissing,
4205
+ measured,
4206
+ onBack,
4207
+ backTo
4208
+ }) {
4209
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4210
+ onBack && /* @__PURE__ */ jsx(SubpageHeader, { title, onBack, parentLabel: backTo ?? "Voltar" }),
4211
+ /* @__PURE__ */ jsx(Card, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
4212
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 text-muted-foreground", "aria-hidden": true }) }),
4213
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4214
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: title }),
4215
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: summary }),
4216
+ v1Path && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-xs text-muted-foreground", children: [
4217
+ "No sistema antigo: ",
4218
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: v1Path })
4219
+ ] }),
4220
+ measured && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: measured }),
4221
+ v1AlsoMissing && // Honestidade que economiza uma reunião: ninguém vai procurar no V1
4222
+ // o que o V1 nunca teve.
4223
+ /* @__PURE__ */ jsx("div", { className: "mt-3 rounded-md border border-warning bg-warning-soft px-3 py-2", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-warning-soft-foreground", children: [
4224
+ /* @__PURE__ */ jsx("strong", { children: "O sistema antigo tamb\xE9m n\xE3o faz isto." }),
4225
+ " A tela existe l\xE1 e anuncia \xABem desenvolvimento\xBB. N\xE3o h\xE1 nada para trazer \u2014 \xE9 funcionalidade nova, n\xE3o porte."
4226
+ ] }) }),
4227
+ /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
4228
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Em breve \u2014 o que falta" }),
4229
+ /* @__PURE__ */ jsx("ul", { className: "mt-2 space-y-1.5", children: missing.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
4230
+ /* @__PURE__ */ jsx(ArrowRight, { className: "mt-1 h-3 w-3 shrink-0 text-muted-foreground", "aria-hidden": true }),
4231
+ /* @__PURE__ */ jsx("span", { children: item })
4232
+ ] }, item)) })
4233
+ ] })
4234
+ ] })
4235
+ ] }) })
4236
+ ] });
4237
+ }
4142
4238
 
4143
4239
  // src/primitives/person-name.ts
4144
4240
  var PARTICLES = /* @__PURE__ */ new Set([
@@ -4173,7 +4269,7 @@ function abbreviatePersonName(full) {
4173
4269
  function comparePersonNames(a, b) {
4174
4270
  return a.localeCompare(b, void 0, { sensitivity: "base" });
4175
4271
  }
4176
- var FILTER_RAIL_WIDTH = 220;
4272
+ var FILTER_RAIL_WIDTH = COLUMN_WIDTH;
4177
4273
  function FilterRail({
4178
4274
  actions,
4179
4275
  before,
@@ -4198,7 +4294,7 @@ function FilterRail({
4198
4294
  )
4199
4295
  ] }),
4200
4296
  before,
4201
- visible.map((section, index) => /* @__PURE__ */ jsxs(React18__default.Fragment, { children: [
4297
+ visible.map((section, index) => /* @__PURE__ */ jsxs(React17__default.Fragment, { children: [
4202
4298
  (index > 0 || !!before || !!actions || !!search) && /* @__PURE__ */ jsx("div", { className: "my-4 h-px bg-border" }),
4203
4299
  /* @__PURE__ */ jsx(
4204
4300
  FilterSection,
@@ -4214,13 +4310,18 @@ function FilterRail({
4214
4310
  ] });
4215
4311
  }
4216
4312
  function FilterRailColumn({ children, collapsed = false }) {
4217
- return /* @__PURE__ */ jsx(
4218
- "div",
4219
- {
4220
- className: `hidden shrink-0 flex-col overflow-hidden transition-[width] duration-200 md:flex ${collapsed ? "" : "mr-4"}`,
4221
- style: { width: collapsed ? 0 : FILTER_RAIL_WIDTH },
4222
- children: !collapsed && /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 py-4", children })
4223
- }
4313
+ return (
4314
+ // ENTREGUE À SHELL, como a coluna de um módulo: ali ela encosta no topo do
4315
+ // quadro e a régua do cabeçalho se emenda nela pela mesma curva. Desenhada
4316
+ // dentro da página, começava depois do respiro do módulo — e a costura, que
4317
+ // só existe quando a coluna encosta na faixa, não acontecia: a régua passava
4318
+ // reta por cima dela e a quina ficava quadrada, diferente de todo o resto.
4319
+ /* @__PURE__ */ jsx(PageRail, { children: /* @__PURE__ */ jsx(CollapsibleColumn, { storageKey: "fayz.filterrail", squeezed: collapsed, children: ({ collapsed: tight }) => (
4320
+ // Na tira, 224px de filtros dobrando linhas dentro de 64 é ruído
4321
+ // animado: o conteúdo espera o ponteiro (ou o botão) em vez de
4322
+ // espremer.
4323
+ tight ? null : /* @__PURE__ */ jsx("div", { className: "py-1", children })
4324
+ ) }) })
4224
4325
  );
4225
4326
  }
4226
4327
  function RailWorkspace({
@@ -4279,6 +4380,6 @@ function AdaptiveFilter({
4279
4380
  );
4280
4381
  }
4281
4382
 
4282
- export { AdaptiveFilter, Badge, Breadcrumb, BulkActionBar, ChevronPager, CurrencyInput, DatePicker, DateRangeChip, DictateButton, DotBadge, DraftCommitBar, FILTER_RAIL_WIDTH, FilterCheckBox, FilterCheckList, FilterCheckRow, FilterChip, FilterRail, FilterRailColumn, FilterSection, INLINE_FILTER_MAX, Input, ListFilterBar, ListView, Markdown, MarkdownEditor, MiniCalendar, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFlow, ModalFlowEntry, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTask, ModalTaskHeader, ModalTaskHost, ModalTitle, ModalTrigger, MultiSelect, NestedPane, PageActionBar, PersonAvatar, PersonMultiPicker, PersonPicker, PhoneField, PhoneLink, PickerDialog, PickerList, RailWorkspace, RefreshButton, RequiredFilter, RowActions, SearchCombobox, SearchField, SearchSelect, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, StockEntryForm, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, WHATSAPP_BRAND_COLOR, WhatsAppIcon, WizardSteps, abbreviatePersonName, badgeVariants, comparePersonNames, formatPhone2 as formatPhone, normalizePhone, personInitials, renderMarkdown, setActionsMenuLabel, setRowActionsLabel, toLocalISODate, useInModalTaskHost, useRowSelection };
4283
- //# sourceMappingURL=chunk-UFT3MA5H.js.map
4284
- //# sourceMappingURL=chunk-UFT3MA5H.js.map
4383
+ export { AdaptiveFilter, Badge, Breadcrumb, BulkActionBar, ChevronPager, ComingSoon, CurrencyInput, DatePicker, DateRangeChip, DictateButton, DotBadge, DraftCommitBar, EmBreve, FILTER_RAIL_WIDTH, FilterCheckBox, FilterCheckList, FilterCheckRow, FilterChip, FilterPanel, FilterPanelField, FilterRail, FilterRailColumn, FilterSection, INLINE_FILTER_MAX, Input, ListFilterBar, ListView, Markdown, MarkdownEditor, MiniCalendar, ModalFlow, ModalFlowEntry, ModalTask, ModalTaskHeader, ModalTaskHost, MultiSelect, NestedPane, PageActionBar, PersonAvatar, PersonMultiPicker, PersonPicker, PhoneField, PhoneLink, PickerDialog, PickerList, RailWorkspace, RefreshButton, RequiredFilter, RowActions, SearchCombobox, SearchField, SearchSelect, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, StockEntryForm, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, WHATSAPP_BRAND_COLOR, WhatsAppIcon, WizardSteps, abbreviatePersonName, badgeVariants, comparePersonNames, formatPhone2 as formatPhone, normalizePhone, personInitials, renderMarkdown, setActionsMenuLabel, setRowActionsLabel, toLocalISODate, useFilterDraft, useInModalTaskHost, useRowSelection };
4384
+ //# sourceMappingURL=chunk-OBWOHU5E.js.map
4385
+ //# sourceMappingURL=chunk-OBWOHU5E.js.map