@fayz-ai/ui 0.33.0 → 0.33.1

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 (48) hide show
  1. package/dist/{chunk-PL5CUWNE.js → chunk-33A7SN2N.js} +583 -119
  2. package/dist/chunk-33A7SN2N.js.map +1 -0
  3. package/dist/{chunk-UFT3MA5H.js → chunk-6GWXDVCO.js} +203 -15
  4. package/dist/chunk-6GWXDVCO.js.map +1 -0
  5. package/dist/{chunk-NXSDQ7HO.js → chunk-Q2B5RPH5.js} +13 -16
  6. package/dist/chunk-Q2B5RPH5.js.map +1 -0
  7. package/dist/{chunk-3XKDGBP4.js → chunk-UNEEY5XG.js} +3 -3
  8. package/dist/{chunk-3XKDGBP4.js.map → chunk-UNEEY5XG.js.map} +1 -1
  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/Sidebar.d.ts.map +1 -1
  20. package/dist/layout/index.d.ts +1 -1
  21. package/dist/layout/index.d.ts.map +1 -1
  22. package/dist/layout/index.js +1 -1
  23. package/dist/layout/rail-flyout.d.ts.map +1 -1
  24. package/dist/primitives/collapsible-column.d.ts +38 -0
  25. package/dist/primitives/collapsible-column.d.ts.map +1 -0
  26. package/dist/primitives/coming-soon.d.ts +31 -0
  27. package/dist/primitives/coming-soon.d.ts.map +1 -0
  28. package/dist/primitives/filter-panel.d.ts +85 -0
  29. package/dist/primitives/filter-panel.d.ts.map +1 -0
  30. package/dist/primitives/filter-rail.d.ts +10 -7
  31. package/dist/primitives/filter-rail.d.ts.map +1 -1
  32. package/dist/primitives/header-tabs.d.ts +9 -35
  33. package/dist/primitives/header-tabs.d.ts.map +1 -1
  34. package/dist/primitives/index.d.ts +2 -0
  35. package/dist/primitives/index.d.ts.map +1 -1
  36. package/dist/primitives/index.js +3 -3
  37. package/dist/primitives/nav-connector.d.ts +23 -0
  38. package/dist/primitives/nav-connector.d.ts.map +1 -0
  39. package/dist/primitives/search-select.d.ts.map +1 -1
  40. package/dist/stores/index.d.ts +1 -1
  41. package/dist/stores/index.d.ts.map +1 -1
  42. package/dist/stores/page-header.store.d.ts +17 -0
  43. package/dist/stores/page-header.store.d.ts.map +1 -1
  44. package/dist/styles.css +58 -0
  45. package/package.json +1 -1
  46. package/dist/chunk-NXSDQ7HO.js.map +0 -1
  47. package/dist/chunk-PL5CUWNE.js.map +0 -1
  48. package/dist/chunk-UFT3MA5H.js.map +0 -1
@@ -1,12 +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-UNEEY5XG.js';
2
+ import { COLUMN_WIDTH, useSaveBarVisible, useCrossModuleBack, useBackHandler, Hint, PageHeaderActions, SubpageHeader, PageRail, CollapsibleColumn } from './chunk-33A7SN2N.js';
3
3
  import { cn, Button } from './chunk-OKZ6WQB3.js';
4
4
  import * as React18 from 'react';
5
5
  import React18__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
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';
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, ArrowRight } from 'lucide-react';
10
10
  import * as SelectPrimitive from '@radix-ui/react-select';
11
11
  import { Toaster } from 'sonner';
12
12
  export { toast } from 'sonner';
@@ -2280,9 +2280,17 @@ function SearchSelect({
2280
2280
  position: "fixed",
2281
2281
  left: rect.left,
2282
2282
  width: rect.width,
2283
+ // O DIALOGO POE `pointer-events: none` NO BODY.
2284
+ //
2285
+ // Esta lista vai pelo portal, para o `body` — fora do conteudo do
2286
+ // dialogo, que e o unico ramo que o Radix reabilita. Sem esta
2287
+ // linha ela aparece por cima e NAO RECEBE CLIQUE: a busca roda, o
2288
+ // resultado desenha, e escolher nao faz nada. Mesma armadilha que
2289
+ // o PaymentModal ja documentava ("aparece por cima porem surdo").
2290
+ pointerEvents: "auto",
2283
2291
  ...rect.above ? { bottom: window.innerHeight - rect.top + 4 } : { top: rect.top + 4 }
2284
2292
  },
2285
- className: "fayz-glass-surface z-[60] overflow-hidden rounded-lg border bg-popover shadow-lg",
2293
+ className: "fayz-glass-surface z-[110] overflow-hidden rounded-lg border bg-popover shadow-lg",
2286
2294
  children: [
2287
2295
  isRequiredFilter && /* @__PURE__ */ jsx("div", { className: "border-b p-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2288
2296
  /* @__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" }),
@@ -2534,6 +2542,126 @@ function RequiredFilter({
2534
2542
  /* @__PURE__ */ jsx(PopoverContent, { align, className: cn("w-72 p-1.5", contentClassName), children: typeof children === "function" ? children(close) : children })
2535
2543
  ] });
2536
2544
  }
2545
+ function FilterPanel({
2546
+ title,
2547
+ dirty,
2548
+ onApply,
2549
+ applyLabel,
2550
+ pendingTitle,
2551
+ pendingHint,
2552
+ onClear,
2553
+ clearLabel,
2554
+ busy,
2555
+ applyDisabledReason,
2556
+ children,
2557
+ advanced,
2558
+ advancedCount,
2559
+ moreLabel,
2560
+ lessLabel,
2561
+ footer,
2562
+ className
2563
+ }) {
2564
+ const blocked = Boolean(applyDisabledReason);
2565
+ const [aberto, setAberto] = React18.useState(Boolean(advancedCount));
2566
+ const jaAbriu = React18.useRef(Boolean(advancedCount));
2567
+ React18.useEffect(() => {
2568
+ if (advancedCount && !jaAbriu.current) {
2569
+ jaAbriu.current = true;
2570
+ setAberto(true);
2571
+ }
2572
+ }, [advancedCount]);
2573
+ return /* @__PURE__ */ jsxs(Card, { className: cn("p-3", className), children: [
2574
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
2575
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-muted-foreground", children: title }),
2576
+ /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-1", children: [
2577
+ onClear && clearLabel && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "h-7 px-2 text-xs", onClick: onClear, disabled: busy, children: clearLabel }),
2578
+ /* @__PURE__ */ jsx(
2579
+ Button,
2580
+ {
2581
+ size: "icon",
2582
+ "aria-label": applyLabel,
2583
+ title: applyDisabledReason || applyLabel,
2584
+ onClick: onApply,
2585
+ disabled: busy || blocked,
2586
+ className: cn(
2587
+ "h-8 w-8 rounded-full",
2588
+ dirty && !blocked && "ring-2 ring-primary/30 ring-offset-1 ring-offset-card"
2589
+ ),
2590
+ children: /* @__PURE__ */ jsx(Search, { className: "h-4 w-4" })
2591
+ }
2592
+ )
2593
+ ] })
2594
+ ] }),
2595
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children }),
2596
+ advanced && /* @__PURE__ */ jsxs(Fragment, { children: [
2597
+ /* @__PURE__ */ jsxs(
2598
+ "button",
2599
+ {
2600
+ type: "button",
2601
+ onClick: () => setAberto((v) => !v),
2602
+ "aria-expanded": aberto,
2603
+ className: "mt-2 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",
2604
+ children: [
2605
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn("h-3.5 w-3.5 transition-transform", aberto && "rotate-180") }),
2606
+ aberto ? lessLabel ?? moreLabel : moreLabel,
2607
+ !aberto && Boolean(advancedCount) && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-primary/10 px-1.5 text-[10px] font-semibold text-primary", children: advancedCount })
2608
+ ]
2609
+ }
2610
+ ),
2611
+ aberto && /* @__PURE__ */ jsx("div", { className: "mt-2 grid gap-3 border-t pt-3 sm:grid-cols-2 lg:grid-cols-4", children: advanced })
2612
+ ] }),
2613
+ footer && /* @__PURE__ */ jsx("div", { className: "mt-3", children: footer }),
2614
+ /* @__PURE__ */ jsx(
2615
+ DraftCommitBar,
2616
+ {
2617
+ open: dirty,
2618
+ title: pendingTitle,
2619
+ hint: pendingHint,
2620
+ icon: Search,
2621
+ commitLabel: applyLabel,
2622
+ onCommit: onApply,
2623
+ busy,
2624
+ commitDisabledReason: applyDisabledReason,
2625
+ className: "static mt-3 shadow-sm"
2626
+ }
2627
+ )
2628
+ ] });
2629
+ }
2630
+ FilterPanel.displayName = "FilterPanel";
2631
+ function FilterPanelField({ label, compact, required, className, children }) {
2632
+ return /* @__PURE__ */ jsxs("div", { className: cn("min-w-0", className), children: [
2633
+ /* @__PURE__ */ jsxs("p", { className: cn("text-[10px] font-medium uppercase tracking-wide text-muted-foreground", !compact && "mb-1"), children: [
2634
+ label,
2635
+ required ? " *" : ""
2636
+ ] }),
2637
+ children
2638
+ ] });
2639
+ }
2640
+ FilterPanelField.displayName = "FilterPanelField";
2641
+ function useFilterDraft(initial) {
2642
+ const inicial = React18.useRef(initial);
2643
+ const [draft, setDraft] = React18.useState(initial);
2644
+ const [applied, setApplied] = React18.useState(initial);
2645
+ const dirty = React18.useMemo(
2646
+ () => JSON.stringify(draft) !== JSON.stringify(applied),
2647
+ [draft, applied]
2648
+ );
2649
+ const patch = React18.useCallback((changes) => {
2650
+ setDraft((atual) => ({ ...atual, ...changes }));
2651
+ }, []);
2652
+ const apply = React18.useCallback(() => {
2653
+ setDraft((atual) => {
2654
+ setApplied(atual);
2655
+ return atual;
2656
+ });
2657
+ }, []);
2658
+ const reset = React18.useCallback((value) => {
2659
+ const alvo = value ?? inicial.current;
2660
+ setDraft(alvo);
2661
+ setApplied(alvo);
2662
+ }, []);
2663
+ return { draft, applied, patch, setDraft, dirty, apply, reset };
2664
+ }
2537
2665
  function formatRange(from, to, locale) {
2538
2666
  const parse = (s) => {
2539
2667
  const [y, m, d] = s.split("-").map(Number);
@@ -4139,6 +4267,61 @@ function StockEntryForm({
4139
4267
  ] })
4140
4268
  ] }) });
4141
4269
  }
4270
+ function EmBreve({ label, o_que, quantas }) {
4271
+ return /* @__PURE__ */ jsxs(
4272
+ "button",
4273
+ {
4274
+ type: "button",
4275
+ disabled: true,
4276
+ title: `${o_que}${quantas ? ` \u2014 ${quantas}` : ""}`,
4277
+ 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",
4278
+ children: [
4279
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3", "aria-hidden": true }),
4280
+ label,
4281
+ /* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[10px]", children: "Em breve" })
4282
+ ]
4283
+ }
4284
+ );
4285
+ }
4286
+ function ComingSoon({
4287
+ title,
4288
+ summary,
4289
+ v1Path,
4290
+ missing,
4291
+ v1AlsoMissing,
4292
+ measured,
4293
+ onBack,
4294
+ backTo
4295
+ }) {
4296
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4297
+ onBack && /* @__PURE__ */ jsx(SubpageHeader, { title, onBack, parentLabel: backTo ?? "Voltar" }),
4298
+ /* @__PURE__ */ jsx(Card, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
4299
+ /* @__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 }) }),
4300
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4301
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: title }),
4302
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: summary }),
4303
+ v1Path && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-xs text-muted-foreground", children: [
4304
+ "No sistema antigo: ",
4305
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: v1Path })
4306
+ ] }),
4307
+ measured && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: measured }),
4308
+ v1AlsoMissing && // Honestidade que economiza uma reunião: ninguém vai procurar no V1
4309
+ // o que o V1 nunca teve.
4310
+ /* @__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: [
4311
+ /* @__PURE__ */ jsx("strong", { children: "O sistema antigo tamb\xE9m n\xE3o faz isto." }),
4312
+ " A tela existe l\xE1 e anuncia \xABem desenvolvimento\xBB. N\xE3o h\xE1 nada para trazer \u2014 \xE9 funcionalidade nova, n\xE3o porte."
4313
+ ] }) }),
4314
+ /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
4315
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Em breve \u2014 o que falta" }),
4316
+ /* @__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: [
4317
+ /* @__PURE__ */ jsx(ArrowRight, { className: "mt-1 h-3 w-3 shrink-0 text-muted-foreground", "aria-hidden": true }),
4318
+ /* @__PURE__ */ jsx("span", { children: item })
4319
+ ] }, item)) })
4320
+ ] })
4321
+ ] })
4322
+ ] }) })
4323
+ ] });
4324
+ }
4142
4325
 
4143
4326
  // src/primitives/person-name.ts
4144
4327
  var PARTICLES = /* @__PURE__ */ new Set([
@@ -4173,7 +4356,7 @@ function abbreviatePersonName(full) {
4173
4356
  function comparePersonNames(a, b) {
4174
4357
  return a.localeCompare(b, void 0, { sensitivity: "base" });
4175
4358
  }
4176
- var FILTER_RAIL_WIDTH = 220;
4359
+ var FILTER_RAIL_WIDTH = COLUMN_WIDTH;
4177
4360
  function FilterRail({
4178
4361
  actions,
4179
4362
  before,
@@ -4214,13 +4397,18 @@ function FilterRail({
4214
4397
  ] });
4215
4398
  }
4216
4399
  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
- }
4400
+ return (
4401
+ // ENTREGUE À SHELL, como a coluna de um módulo: ali ela encosta no topo do
4402
+ // quadro e a régua do cabeçalho se emenda nela pela mesma curva. Desenhada
4403
+ // dentro da página, começava depois do respiro do módulo — e a costura, que
4404
+ // só existe quando a coluna encosta na faixa, não acontecia: a régua passava
4405
+ // reta por cima dela e a quina ficava quadrada, diferente de todo o resto.
4406
+ /* @__PURE__ */ jsx(PageRail, { children: /* @__PURE__ */ jsx(CollapsibleColumn, { storageKey: "fayz.filterrail", squeezed: collapsed, children: ({ collapsed: tight }) => (
4407
+ // Na tira, 224px de filtros dobrando linhas dentro de 64 é ruído
4408
+ // animado: o conteúdo espera o ponteiro (ou o botão) em vez de
4409
+ // espremer.
4410
+ tight ? null : /* @__PURE__ */ jsx("div", { className: "py-1", children })
4411
+ ) }) })
4224
4412
  );
4225
4413
  }
4226
4414
  function RailWorkspace({
@@ -4279,6 +4467,6 @@ function AdaptiveFilter({
4279
4467
  );
4280
4468
  }
4281
4469
 
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
4470
+ 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, 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, useFilterDraft, useInModalTaskHost, useRowSelection };
4471
+ //# sourceMappingURL=chunk-6GWXDVCO.js.map
4472
+ //# sourceMappingURL=chunk-6GWXDVCO.js.map