@fayz-ai/ui 0.12.0 → 0.15.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 (105) hide show
  1. package/dist/{ChartWidgetInner-GDE5PBTR.js → ChartWidgetInner-IOLIUYTB.js} +21 -8
  2. package/dist/ChartWidgetInner-IOLIUYTB.js.map +1 -0
  3. package/dist/analytics/AnalyticsCard.d.ts.map +1 -1
  4. package/dist/analytics/AnalyticsControls.d.ts +5 -1
  5. package/dist/analytics/AnalyticsControls.d.ts.map +1 -1
  6. package/dist/chunk-3OVZ5JJQ.js +540 -0
  7. package/dist/chunk-3OVZ5JJQ.js.map +1 -0
  8. package/dist/{chunk-22EVFMS3.js → chunk-4GK6IHOI.js} +17 -3
  9. package/dist/chunk-4GK6IHOI.js.map +1 -0
  10. package/dist/{chunk-7BMXN7MP.js → chunk-5KMAEQA3.js} +25 -24
  11. package/dist/chunk-5KMAEQA3.js.map +1 -0
  12. package/dist/chunk-AASANYXN.js +601 -0
  13. package/dist/chunk-AASANYXN.js.map +1 -0
  14. package/dist/chunk-FFJ2C5YH.js +92 -0
  15. package/dist/chunk-FFJ2C5YH.js.map +1 -0
  16. package/dist/chunk-J7F3Z52K.js +152 -0
  17. package/dist/chunk-J7F3Z52K.js.map +1 -0
  18. package/dist/{chunk-JGJNRNQW.js → chunk-KD2V3TAX.js} +290 -67
  19. package/dist/chunk-KD2V3TAX.js.map +1 -0
  20. package/dist/{chunk-ZDRHCKRK.js → chunk-NA3GE4H3.js} +746 -533
  21. package/dist/chunk-NA3GE4H3.js.map +1 -0
  22. package/dist/{chunk-7BHG3XGJ.js → chunk-SLWTKHNY.js} +296 -269
  23. package/dist/chunk-SLWTKHNY.js.map +1 -0
  24. package/dist/dashboard/ChartWidgetInner.d.ts.map +1 -1
  25. package/dist/dashboard/DashboardCanvas.d.ts.map +1 -1
  26. package/dist/dashboard/DashboardCustomizeMenu.d.ts.map +1 -1
  27. package/dist/dashboard/DashboardRange.d.ts +8 -2
  28. package/dist/dashboard/DashboardRange.d.ts.map +1 -1
  29. package/dist/dashboard/index.js +4 -4
  30. package/dist/icons.d.ts.map +1 -1
  31. package/dist/icons.js +1 -1
  32. package/dist/index.d.ts +4 -3
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +86 -99
  35. package/dist/index.js.map +1 -1
  36. package/dist/layout/AppShell.d.ts +8 -2
  37. package/dist/layout/AppShell.d.ts.map +1 -1
  38. package/dist/layout/ModulePage.d.ts +24 -1
  39. package/dist/layout/ModulePage.d.ts.map +1 -1
  40. package/dist/layout/Sidebar.d.ts +27 -4
  41. package/dist/layout/Sidebar.d.ts.map +1 -1
  42. package/dist/layout/Topbar.d.ts +10 -3
  43. package/dist/layout/Topbar.d.ts.map +1 -1
  44. package/dist/layout/index.d.ts +2 -1
  45. package/dist/layout/index.d.ts.map +1 -1
  46. package/dist/layout/index.js +4 -4
  47. package/dist/layout/rail-flyout.d.ts +10 -0
  48. package/dist/layout/rail-flyout.d.ts.map +1 -1
  49. package/dist/primitives/SearchCombobox.d.ts +9 -1
  50. package/dist/primitives/SearchCombobox.d.ts.map +1 -1
  51. package/dist/primitives/bulk-action-bar.d.ts +3 -1
  52. package/dist/primitives/bulk-action-bar.d.ts.map +1 -1
  53. package/dist/primitives/color-palette.d.ts +24 -0
  54. package/dist/primitives/color-palette.d.ts.map +1 -0
  55. package/dist/primitives/header-tabs.d.ts +47 -7
  56. package/dist/primitives/header-tabs.d.ts.map +1 -1
  57. package/dist/primitives/image-drop.d.ts +28 -0
  58. package/dist/primitives/image-drop.d.ts.map +1 -0
  59. package/dist/primitives/index.d.ts +9 -3
  60. package/dist/primitives/index.d.ts.map +1 -1
  61. package/dist/primitives/index.js +6 -3
  62. package/dist/primitives/list-view.d.ts +9 -1
  63. package/dist/primitives/list-view.d.ts.map +1 -1
  64. package/dist/primitives/option-select.d.ts +46 -0
  65. package/dist/primitives/option-select.d.ts.map +1 -0
  66. package/dist/primitives/page-toolbar.d.ts +80 -0
  67. package/dist/primitives/page-toolbar.d.ts.map +1 -0
  68. package/dist/primitives/search-select.d.ts +3 -1
  69. package/dist/primitives/search-select.d.ts.map +1 -1
  70. package/dist/primitives/sheet.d.ts.map +1 -1
  71. package/dist/primitives/step-progress.d.ts +20 -0
  72. package/dist/primitives/step-progress.d.ts.map +1 -0
  73. package/dist/primitives/tabs.d.ts.map +1 -1
  74. package/dist/primitives/use-row-selection.d.ts +50 -0
  75. package/dist/primitives/use-row-selection.d.ts.map +1 -0
  76. package/dist/stores/index.d.ts +1 -1
  77. package/dist/stores/index.d.ts.map +1 -1
  78. package/dist/stores/page-header.store.d.ts +26 -2
  79. package/dist/stores/page-header.store.d.ts.map +1 -1
  80. package/dist/styles.css +74 -17
  81. package/dist/wizard/Wizard.d.ts +38 -0
  82. package/dist/wizard/Wizard.d.ts.map +1 -0
  83. package/dist/wizard/WizardField.d.ts +22 -0
  84. package/dist/wizard/WizardField.d.ts.map +1 -0
  85. package/dist/wizard/index.d.ts +6 -0
  86. package/dist/wizard/index.d.ts.map +1 -0
  87. package/dist/wizard/index.js +5 -0
  88. package/dist/wizard/index.js.map +1 -0
  89. package/dist/wizard/logic.d.ts +39 -0
  90. package/dist/wizard/logic.d.ts.map +1 -0
  91. package/dist/wizard/types.d.ts +95 -0
  92. package/dist/wizard/types.d.ts.map +1 -0
  93. package/dist/wizard/useWizard.d.ts +47 -0
  94. package/dist/wizard/useWizard.d.ts.map +1 -0
  95. package/package.json +14 -8
  96. package/dist/ChartWidgetInner-GDE5PBTR.js.map +0 -1
  97. package/dist/chunk-22EVFMS3.js.map +0 -1
  98. package/dist/chunk-7BHG3XGJ.js.map +0 -1
  99. package/dist/chunk-7BMXN7MP.js.map +0 -1
  100. package/dist/chunk-JGJNRNQW.js.map +0 -1
  101. package/dist/chunk-VAKWUUVC.js +0 -425
  102. package/dist/chunk-VAKWUUVC.js.map +0 -1
  103. package/dist/chunk-ZBQ772DU.js +0 -17
  104. package/dist/chunk-ZBQ772DU.js.map +0 -1
  105. package/dist/chunk-ZDRHCKRK.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { cn } from './chunk-OKZ6WQB3.js';
2
- import * as React2 from 'react';
1
+ import { cn, Button } from './chunk-OKZ6WQB3.js';
2
+ import * as React5 from 'react';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
- import { ChevronRight, Check, Circle, Minus, ArrowDown, ArrowUp, ArrowUpDown } from 'lucide-react';
5
+ import { ChevronRight, Check, Circle, Minus, ChevronDown, ArrowDown, ArrowUp, ArrowUpDown, Calendar, GripVertical, RefreshCw } from 'lucide-react';
6
6
  import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
7
7
  import { useTranslation } from '@fayz-ai/core';
8
8
 
9
- var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
9
+ var Card = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
10
10
  "div",
11
11
  {
12
12
  ref,
@@ -18,7 +18,7 @@ var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
18
18
  }
19
19
  ));
20
20
  Card.displayName = "Card";
21
- var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
21
+ var CardHeader = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
22
22
  "div",
23
23
  {
24
24
  ref,
@@ -27,7 +27,7 @@ var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
27
27
  }
28
28
  ));
29
29
  CardHeader.displayName = "CardHeader";
30
- var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
30
+ var CardTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
31
31
  "h3",
32
32
  {
33
33
  ref,
@@ -39,7 +39,7 @@ var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
39
39
  }
40
40
  ));
41
41
  CardTitle.displayName = "CardTitle";
42
- var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
42
+ var CardDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
43
43
  "p",
44
44
  {
45
45
  ref,
@@ -48,9 +48,9 @@ var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__
48
48
  }
49
49
  ));
50
50
  CardDescription.displayName = "CardDescription";
51
- var CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4 pt-0", className), ...props }));
51
+ var CardContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4 pt-0", className), ...props }));
52
52
  CardContent.displayName = "CardContent";
53
- var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
53
+ var CardFooter = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
54
54
  "div",
55
55
  {
56
56
  ref,
@@ -65,7 +65,7 @@ var DropdownGroup = DropdownMenuPrimitive.Group;
65
65
  var DropdownPortal = DropdownMenuPrimitive.Portal;
66
66
  var DropdownSub = DropdownMenuPrimitive.Sub;
67
67
  var DropdownRadioGroup = DropdownMenuPrimitive.RadioGroup;
68
- var DropdownSubTrigger = React2.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
68
+ var DropdownSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
69
69
  DropdownMenuPrimitive.SubTrigger,
70
70
  {
71
71
  ref,
@@ -82,7 +82,7 @@ var DropdownSubTrigger = React2.forwardRef(({ className, inset, children, ...pro
82
82
  }
83
83
  ));
84
84
  DropdownSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
85
- var DropdownSubContent = React2.forwardRef(({ className, ...props }, ref) => (
85
+ var DropdownSubContent = React5.forwardRef(({ className, ...props }, ref) => (
86
86
  // Portaled, like DropdownContent. Without it the submenu renders inside the
87
87
  // parent panel's DOM — and that panel is `overflow-hidden`, so the submenu
88
88
  // was clipped to its box: a flyout you could open and never reach.
@@ -91,7 +91,7 @@ var DropdownSubContent = React2.forwardRef(({ className, ...props }, ref) => (
91
91
  {
92
92
  ref,
93
93
  className: cn(
94
- "fayz-glass-surface z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
94
+ "fayz-glass-surface z-50 min-w-[8rem] overflow-hidden rounded-card border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
95
95
  className
96
96
  ),
97
97
  ...props
@@ -99,20 +99,20 @@ var DropdownSubContent = React2.forwardRef(({ className, ...props }, ref) => (
99
99
  ) })
100
100
  ));
101
101
  DropdownSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
102
- var DropdownContent = React2.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
102
+ var DropdownContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
103
103
  DropdownMenuPrimitive.Content,
104
104
  {
105
105
  ref,
106
106
  sideOffset,
107
107
  className: cn(
108
- "fayz-glass-surface z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
108
+ "fayz-glass-surface z-50 min-w-[8rem] overflow-hidden rounded-card border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
109
109
  className
110
110
  ),
111
111
  ...props
112
112
  }
113
113
  ) }));
114
114
  DropdownContent.displayName = DropdownMenuPrimitive.Content.displayName;
115
- var DropdownItem = React2.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
115
+ var DropdownItem = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
116
116
  DropdownMenuPrimitive.Item,
117
117
  {
118
118
  ref,
@@ -125,7 +125,7 @@ var DropdownItem = React2.forwardRef(({ className, inset, ...props }, ref) => /*
125
125
  }
126
126
  ));
127
127
  DropdownItem.displayName = DropdownMenuPrimitive.Item.displayName;
128
- var DropdownCheckboxItem = React2.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
128
+ var DropdownCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
129
129
  DropdownMenuPrimitive.CheckboxItem,
130
130
  {
131
131
  ref,
@@ -142,7 +142,7 @@ var DropdownCheckboxItem = React2.forwardRef(({ className, children, checked, ..
142
142
  }
143
143
  ));
144
144
  DropdownCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
145
- var DropdownRadioItem = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
145
+ var DropdownRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
146
146
  DropdownMenuPrimitive.RadioItem,
147
147
  {
148
148
  ref,
@@ -158,7 +158,7 @@ var DropdownRadioItem = React2.forwardRef(({ className, children, ...props }, re
158
158
  }
159
159
  ));
160
160
  DropdownRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
161
- var DropdownLabel = React2.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
161
+ var DropdownLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
162
162
  DropdownMenuPrimitive.Label,
163
163
  {
164
164
  ref,
@@ -171,7 +171,7 @@ var DropdownLabel = React2.forwardRef(({ className, inset, ...props }, ref) => /
171
171
  }
172
172
  ));
173
173
  DropdownLabel.displayName = DropdownMenuPrimitive.Label.displayName;
174
- var DropdownSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
174
+ var DropdownSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
175
175
  DropdownMenuPrimitive.Separator,
176
176
  {
177
177
  ref,
@@ -199,7 +199,7 @@ var COLOR_CLASSES = {
199
199
  warning: "border-warning bg-warning text-white",
200
200
  destructive: "border-destructive bg-destructive text-destructive-foreground"
201
201
  };
202
- var Checkbox = React2.forwardRef(
202
+ var Checkbox = React5.forwardRef(
203
203
  ({ checked = false, onChange, disabled, className, color = "primary", id, indeterminate = false, ...props }, ref) => {
204
204
  const filled = checked || indeterminate;
205
205
  return /* @__PURE__ */ jsx(
@@ -243,34 +243,34 @@ function DataTable({
243
243
  }) {
244
244
  const t = useTranslation();
245
245
  const isCard = variant === "card";
246
- const wrapperCls = isCard ? "overflow-hidden rounded-lg border bg-card shadow-sm" : variant === "bare" ? "" : "overflow-hidden rounded-lg border";
246
+ const wrapperCls = isCard ? "overflow-hidden rounded-card border bg-card shadow-sm" : variant === "bare" ? "" : "overflow-hidden rounded-lg border";
247
247
  const headerCls = isCard ? "border-b bg-muted/50" : variant === "bare" ? "border-b bg-muted/30 rounded-none" : "border-b bg-muted/30";
248
248
  const thCls = compact ? "px-3 py-1.5 text-left text-[11px] font-medium text-muted-foreground" : "px-4 py-2.5 text-left font-medium text-muted-foreground";
249
249
  const tdCls = compact ? "px-3 py-1.5 align-middle text-xs" : "px-4 py-3 align-middle";
250
250
  const tableCls = compact ? "w-full text-xs min-w-max" : "w-full text-sm min-w-max";
251
251
  const rowHoverCls = isCard ? "hover:bg-muted/30" : "hover:bg-muted/20";
252
- const [sorting, setSorting] = React2.useState([]);
253
- const rowId = React2.useCallback(
252
+ const [sorting, setSorting] = React5.useState([]);
253
+ const rowId = React5.useCallback(
254
254
  (row) => getRowId ? getRowId(row) : String(row.id ?? ""),
255
255
  [getRowId]
256
256
  );
257
- const selected = React2.useMemo(() => new Set(selectedIds ?? []), [selectedIds]);
258
- const pageIds = React2.useMemo(() => data.map(rowId), [data, rowId]);
257
+ const selected = React5.useMemo(() => new Set(selectedIds ?? []), [selectedIds]);
258
+ const pageIds = React5.useMemo(() => data.map(rowId), [data, rowId]);
259
259
  const selectedOnPage = pageIds.filter((id) => selected.has(id)).length;
260
260
  const allOnPageSelected = pageIds.length > 0 && selectedOnPage === pageIds.length;
261
- const toggleRow = React2.useCallback((id) => {
261
+ const toggleRow = React5.useCallback((id) => {
262
262
  const next = new Set(selected);
263
263
  if (next.has(id)) next.delete(id);
264
264
  else next.add(id);
265
265
  onSelectedIdsChange?.([...next]);
266
266
  }, [selected, onSelectedIdsChange]);
267
- const toggleAllOnPage = React2.useCallback(() => {
267
+ const toggleAllOnPage = React5.useCallback(() => {
268
268
  const next = new Set(selected);
269
269
  if (allOnPageSelected) pageIds.forEach((id) => next.delete(id));
270
270
  else pageIds.forEach((id) => next.add(id));
271
271
  onSelectedIdsChange?.([...next]);
272
272
  }, [selected, allOnPageSelected, pageIds, onSelectedIdsChange]);
273
- const selectionColumn = React2.useMemo(() => ({
273
+ const selectionColumn = React5.useMemo(() => ({
274
274
  id: "__select__",
275
275
  enableSorting: false,
276
276
  header: () => /* @__PURE__ */ jsx(
@@ -297,7 +297,7 @@ function DataTable({
297
297
  // ids: turning the page with nothing selected changes no other dep, and the
298
298
  // memo would hand the header a button that ticks the previous page's rows.
299
299
  }), [allOnPageSelected, selectedOnPage, selected, rowId, toggleRow, toggleAllOnPage, t]);
300
- const allColumns = React2.useMemo(
300
+ const allColumns = React5.useMemo(
301
301
  () => selectable ? [selectionColumn, ...columns] : columns,
302
302
  [selectable, selectionColumn, columns]
303
303
  );
@@ -397,52 +397,275 @@ function TableSkeleton({ columns = 4, rows = 2 }) {
397
397
  )) }, r)) })
398
398
  ] });
399
399
  }
400
- var SIZE = {
401
- sm: { container: "h-[26px]", segment: "px-2.5 text-xs" },
402
- md: { container: "h-[30px]", segment: "px-3 text-sm" }
403
- };
404
- function SegmentedControl({
400
+ var ToolbarButton = React5.forwardRef(function ToolbarButton2({ icon: Icon, caret = true, children, className, ...props }, ref) {
401
+ return /* @__PURE__ */ jsxs(
402
+ Button,
403
+ {
404
+ ref,
405
+ variant: "ghost",
406
+ size: "sm",
407
+ className: cn(
408
+ // Sem fundo no hover: um retângulo arredondado aparecendo atrás do
409
+ // rótulo desenha, no hover, exatamente o botão que o repouso não tem.
410
+ // O que muda é o texto e o traço — mais firmes, e o tracejado vira
411
+ // contínuo, que é o mesmo "agora sim, clique" sem inventar caixa.
412
+ "group gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none",
413
+ "hover:bg-transparent hover:text-foreground",
414
+ className
415
+ ),
416
+ ...props,
417
+ children: [
418
+ Icon ? /* @__PURE__ */ jsx(Icon, { className: "h-3 w-3 shrink-0 opacity-70" }) : null,
419
+ /* @__PURE__ */ jsx("span", { className: "inline-flex items-center gap-1.5 border-b border-dashed border-muted-foreground/40 pb-px transition-colors group-hover:border-solid group-hover:border-foreground", children }),
420
+ caret ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 opacity-60" }) : null
421
+ ]
422
+ }
423
+ );
424
+ });
425
+ var ToolbarAction = React5.forwardRef(function ToolbarAction2({ icon: Icon, caret = false, children, className, ...props }, ref) {
426
+ return /* @__PURE__ */ jsxs(
427
+ Button,
428
+ {
429
+ ref,
430
+ variant: "ghost",
431
+ size: "sm",
432
+ className: cn(
433
+ "gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none",
434
+ "hover:bg-transparent hover:text-foreground",
435
+ className
436
+ ),
437
+ ...props,
438
+ children: [
439
+ Icon ? /* @__PURE__ */ jsx(Icon, { className: "h-3 w-3 shrink-0 opacity-70" }) : null,
440
+ children,
441
+ caret ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 opacity-60" }) : null
442
+ ]
443
+ }
444
+ );
445
+ });
446
+ function RangeControl({
405
447
  options,
406
448
  value,
407
449
  onChange,
408
- size = "sm",
409
- className,
410
- ...rest
450
+ label,
451
+ span,
452
+ extra,
453
+ children,
454
+ icon = Calendar,
455
+ className
411
456
  }) {
412
- const items = options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
413
- return /* @__PURE__ */ jsx(
414
- "div",
415
- {
416
- role: "tablist",
417
- "aria-label": rest["aria-label"],
418
- className: cn(
419
- "inline-flex items-center rounded-button border border-border bg-card p-0.5 shadow-button",
420
- SIZE[size].container,
421
- className
457
+ const current = options.find((o) => o.value === value);
458
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1.5", className), children: [
459
+ /* @__PURE__ */ jsxs(Dropdown, { children: [
460
+ /* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(ToolbarButton, { icon, children: [
461
+ label ?? current?.label ?? value,
462
+ span ? /* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: span }) : null
463
+ ] }) }),
464
+ /* @__PURE__ */ jsxs(DropdownContent, { align: "end", className: "w-56", children: [
465
+ options.map((o) => /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => onChange(o.value), children: [
466
+ o.label,
467
+ o.value === value ? /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" }) : null
468
+ ] }, o.value)),
469
+ extra
470
+ ] })
471
+ ] }),
472
+ children
473
+ ] });
474
+ }
475
+ var OFFSET_KEY = (scope) => `fayz.toolbar.offset.${scope}`;
476
+ var EDGE = 8;
477
+ function readOffset(key) {
478
+ if (typeof window === "undefined") return { x: 0, y: 0 };
479
+ try {
480
+ const raw = window.localStorage.getItem(key);
481
+ if (!raw) return { x: 0, y: 0 };
482
+ const parsed = JSON.parse(raw);
483
+ return {
484
+ x: Number.isFinite(parsed.x) ? Number(parsed.x) : 0,
485
+ y: Number.isFinite(parsed.y) ? Number(parsed.y) : 0
486
+ };
487
+ } catch {
488
+ return { x: 0, y: 0 };
489
+ }
490
+ }
491
+ function writeOffset(key, offset) {
492
+ if (typeof window === "undefined") return;
493
+ try {
494
+ if (offset.x === 0 && offset.y === 0) window.localStorage.removeItem(key);
495
+ else window.localStorage.setItem(key, JSON.stringify(offset));
496
+ } catch {
497
+ }
498
+ }
499
+ function useToolbarOffset(storageKey, enabled) {
500
+ const key = OFFSET_KEY(storageKey);
501
+ const barRef = React5.useRef(null);
502
+ const [offset, setOffset] = React5.useState(() => enabled ? readOffset(key) : { x: 0, y: 0 });
503
+ const [dragging, setDragging] = React5.useState(false);
504
+ const latest = React5.useRef(offset);
505
+ latest.current = offset;
506
+ const origin = React5.useRef(null);
507
+ const clamp = React5.useCallback((next) => {
508
+ const el = barRef.current;
509
+ if (!el || typeof window === "undefined") return next;
510
+ const rect = el.getBoundingClientRect();
511
+ const anchorLeft = rect.left - latest.current.x;
512
+ const anchorTop = rect.top - latest.current.y;
513
+ return {
514
+ x: Math.min(
515
+ Math.max(next.x, EDGE - anchorLeft),
516
+ Math.max(EDGE - anchorLeft, window.innerWidth - EDGE - rect.width - anchorLeft)
422
517
  ),
423
- children: items.map((item) => {
424
- const active = item.value === value;
425
- return /* @__PURE__ */ jsx(
426
- "button",
518
+ y: Math.min(
519
+ Math.max(next.y, EDGE - anchorTop),
520
+ Math.max(EDGE - anchorTop, window.innerHeight - EDGE - rect.height - anchorTop)
521
+ )
522
+ };
523
+ }, []);
524
+ const move = React5.useCallback((next, persist) => {
525
+ const clamped = clamp(next);
526
+ setOffset(clamped);
527
+ if (persist) writeOffset(key, clamped);
528
+ }, [clamp, key]);
529
+ const onPointerDown = (event) => {
530
+ if (!enabled || event.button !== 0) return;
531
+ event.preventDefault();
532
+ event.currentTarget.setPointerCapture(event.pointerId);
533
+ origin.current = { px: event.clientX, py: event.clientY, ox: latest.current.x, oy: latest.current.y };
534
+ setDragging(true);
535
+ };
536
+ const onPointerMove = (event) => {
537
+ const from = origin.current;
538
+ if (!from) return;
539
+ move({ x: from.ox + (event.clientX - from.px), y: from.oy + (event.clientY - from.py) }, false);
540
+ };
541
+ const endDrag = (event) => {
542
+ if (!origin.current) return;
543
+ origin.current = null;
544
+ setDragging(false);
545
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
546
+ event.currentTarget.releasePointerCapture(event.pointerId);
547
+ }
548
+ writeOffset(key, latest.current);
549
+ };
550
+ const onKeyDown = (event) => {
551
+ if (!enabled) return;
552
+ const step = event.shiftKey ? 24 : 8;
553
+ const delta = {
554
+ ArrowLeft: { x: -step, y: 0 },
555
+ ArrowRight: { x: step, y: 0 },
556
+ ArrowUp: { x: 0, y: -step },
557
+ ArrowDown: { x: 0, y: step }
558
+ };
559
+ if (event.key === "Escape" || event.key === "Home") {
560
+ event.preventDefault();
561
+ move({ x: 0, y: 0 }, true);
562
+ return;
563
+ }
564
+ const d = delta[event.key];
565
+ if (!d) return;
566
+ event.preventDefault();
567
+ move({ x: latest.current.x + d.x, y: latest.current.y + d.y }, true);
568
+ };
569
+ const reset = React5.useCallback(() => move({ x: 0, y: 0 }, true), [move]);
570
+ React5.useEffect(() => {
571
+ if (!enabled) return;
572
+ const onResize = () => move(latest.current, false);
573
+ window.addEventListener("resize", onResize);
574
+ return () => window.removeEventListener("resize", onResize);
575
+ }, [enabled, move]);
576
+ return { barRef, offset, dragging, reset, handlers: { onPointerDown, onPointerMove, onPointerUp: endDrag, onPointerCancel: endDrag, onKeyDown } };
577
+ }
578
+ function PageToolbar({
579
+ range,
580
+ filters,
581
+ chips,
582
+ customize,
583
+ actions,
584
+ onRefresh,
585
+ refreshLabel,
586
+ sticky = true,
587
+ movable = true,
588
+ storageKey = "shared",
589
+ moveLabel,
590
+ className
591
+ }) {
592
+ const { barRef, offset, dragging, reset, handlers } = useToolbarOffset(storageKey, movable);
593
+ if (!range && !filters && !chips && !customize && !actions && !onRefresh) return null;
594
+ return (
595
+ // Caixa de altura ZERO: a barra flutua sobre os cartões em vez de abrir uma
596
+ // linha só para ela. Ocupando espaço, ela empurrava a grade inteira para
597
+ // baixo para hospedar controles que a maioria das visitas nem toca — e
598
+ // "flutuante" que reserva o próprio lugar não está flutuando.
599
+ //
600
+ // Zero + sticky, não `absolute`: absoluto não gruda, e a pergunta que a
601
+ // página responde tem de continuar à mão depois de vinte cartões de rolagem.
602
+ // `pointer-events-none` na caixa para que a faixa vazia dos lados não coma o
603
+ // clique do cartão embaixo.
604
+ /* @__PURE__ */ jsx(
605
+ "div",
606
+ {
607
+ className: cn(
608
+ // `items-start` não é enfeite: num flex de altura 0, o alinhamento
609
+ // padrão (stretch) achata o filho para 0px — a barra some e só os
610
+ // botões transbordam, sem vidro nenhum atrás.
611
+ "pointer-events-none z-20 flex h-0 items-start justify-end",
612
+ sticky && "sticky top-0"
613
+ ),
614
+ children: /* @__PURE__ */ jsxs(
615
+ "div",
427
616
  {
428
- type: "button",
429
- role: "tab",
430
- "aria-selected": active,
431
- onClick: () => onChange(item.value),
617
+ ref: barRef,
618
+ style: offset.x || offset.y ? { transform: `translate3d(${offset.x}px, ${offset.y}px, 0)` } : void 0,
432
619
  className: cn(
433
- "flex h-full items-center rounded-button font-semibold transition-colors",
434
- SIZE[size].segment,
435
- active ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted/60"
620
+ // O mesmo vidro do assistente (fayz-floating-surface, em styles.css):
621
+ // é a outra coisa que flutua sobre a página, e as duas se diziam
622
+ // flutuantes em materiais diferentes. Fill fino + blur pesado, para a
623
+ // grade passar por baixo sem competir.
624
+ "fayz-floating-surface pointer-events-auto flex max-w-full flex-wrap items-center justify-end gap-2 rounded-2xl px-2 py-1.5",
625
+ dragging && "select-none",
626
+ className
436
627
  ),
437
- children: item.label
438
- },
439
- item.value
440
- );
441
- })
442
- }
628
+ children: [
629
+ movable ? /* @__PURE__ */ jsx(
630
+ "button",
631
+ {
632
+ type: "button",
633
+ "aria-label": moveLabel ?? "Mover a barra",
634
+ title: moveLabel ?? "Mover a barra",
635
+ onDoubleClick: reset,
636
+ ...handlers,
637
+ className: cn(
638
+ "flex h-[26px] w-4 shrink-0 touch-none items-center justify-center rounded-md text-muted-foreground/50",
639
+ "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
640
+ dragging ? "cursor-grabbing text-foreground" : "cursor-grab"
641
+ ),
642
+ children: /* @__PURE__ */ jsx(GripVertical, { className: "h-3.5 w-3.5" })
643
+ }
644
+ ) : null,
645
+ range,
646
+ filters,
647
+ chips,
648
+ customize,
649
+ actions,
650
+ onRefresh ? /* @__PURE__ */ jsx(
651
+ Button,
652
+ {
653
+ variant: "ghost",
654
+ size: "sm",
655
+ onClick: onRefresh,
656
+ "aria-label": refreshLabel,
657
+ className: "w-[26px] border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-transparent hover:text-foreground",
658
+ children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" })
659
+ }
660
+ ) : null
661
+ ]
662
+ }
663
+ )
664
+ }
665
+ )
443
666
  );
444
667
  }
445
668
 
446
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DataTable, Dropdown, DropdownCheckboxItem, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownPortal, DropdownRadioGroup, DropdownRadioItem, DropdownSeparator, DropdownShortcut, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownTrigger, SegmentedControl, Skeleton, TableSkeleton };
447
- //# sourceMappingURL=chunk-JGJNRNQW.js.map
448
- //# sourceMappingURL=chunk-JGJNRNQW.js.map
669
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DataTable, Dropdown, DropdownCheckboxItem, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownPortal, DropdownRadioGroup, DropdownRadioItem, DropdownSeparator, DropdownShortcut, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownTrigger, PageToolbar, RangeControl, Skeleton, TableSkeleton, ToolbarAction, ToolbarButton };
670
+ //# sourceMappingURL=chunk-KD2V3TAX.js.map
671
+ //# sourceMappingURL=chunk-KD2V3TAX.js.map