@fayz-ai/ui 0.24.1 → 0.26.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/primitives/card.tsx","../src/primitives/dropdown.tsx","../src/primitives/checkbox.tsx","../src/primitives/data-table.tsx","../src/primitives/tooltip.tsx","../src/hooks/useIsWide.ts","../src/primitives/hint.tsx","../src/primitives/page-actions.tsx","../src/primitives/skeleton.tsx","../src/primitives/popover.tsx","../src/primitives/page-toolbar.tsx"],"names":["React","React2","jsx","React3","Check","React4","jsxs","_","React5","React6","React7","Hint","TooltipPrimitive2","React8","React9","ToolbarButton","ChevronDown","ToolbarAction","Fragment","createPortal"],"mappings":";;;;;;;;;;;;AAIA,IAAM,IAAA,GAAaA,mBAGjB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,+EAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAA,CAAK,WAAA,GAAc,MAAA;AAEnB,IAAM,UAAA,GAAmBA,mBAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,SAAA,GAAkBA,mBAGtB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,IAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,oDAAA;AAAA,MACA;AAAA,KACF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AAA,oBACA,WAAW,iCAAA,GAAoC;AAAA,mBACjD;AAAA,kBAEA,QAAA,kBAAAA,GAAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAU,aAAA,EAAc;AAAA;AAAA,eACxC,GACE,IAAA;AAAA,cACH,WAAA,CAAY,EAAE,SAAA,EAAW,IAAA,EAAM;AAAA;AAAA;AAAA;AAClC;AAAA;AACF;AAEJ","file":"chunk-HO2P2XB4.js","sourcesContent":["import * as React from 'react'\n\nimport { cn } from '../lib/cn'\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'fayz-glass-surface rounded-card border bg-card text-card-foreground shadow-sm',\n className\n )}\n {...props}\n />\n))\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col space-y-1 p-4', className)}\n {...props}\n />\n))\nCardHeader.displayName = 'CardHeader'\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n 'text-sm font-semibold leading-tight tracking-tight',\n className\n )}\n {...props}\n />\n))\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-xs text-muted-foreground', className)}\n {...props}\n />\n))\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('p-4 pt-0', className)} {...props} />\n))\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex items-center p-4 pt-0', className)}\n {...props}\n />\n))\nCardFooter.displayName = 'CardFooter'\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n","import * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-react'\n\nimport { cn } from '../lib/cn'\n\nconst Dropdown = DropdownMenuPrimitive.Root\n\nconst DropdownTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownGroup = DropdownMenuPrimitive.Group\n\nconst DropdownPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownSub = DropdownMenuPrimitive.Sub\n\nconst DropdownRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-button px-2 py-1.5 text-sm outline-none focus:bg-muted data-[state=open]:bg-muted',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n // Portaled, like DropdownContent. Without it the submenu renders inside the\n // parent panel's DOM — and that panel is `overflow-hidden`, so the submenu\n // was clipped to its box: a flyout you could open and never reach.\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'fayz-glass-surface z-[110] 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',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[110] 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',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button px-2 py-1.5 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n))\nDropdownSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n )\n}\nDropdownShortcut.displayName = 'DropdownShortcut'\n\nexport {\n Dropdown,\n DropdownTrigger,\n DropdownContent,\n DropdownItem,\n DropdownCheckboxItem,\n DropdownRadioItem,\n DropdownLabel,\n DropdownSeparator,\n DropdownShortcut,\n DropdownGroup,\n DropdownPortal,\n DropdownSub,\n DropdownSubContent,\n DropdownSubTrigger,\n DropdownRadioGroup,\n}\n","import * as React from 'react'\nimport { Check, Minus } from 'lucide-react'\nimport { cn } from '../lib/cn'\n\ntype CheckboxColor = 'primary' | 'success' | 'warning' | 'destructive'\n\ninterface CheckboxProps {\n checked?: boolean\n onChange?: (checked: boolean) => void\n disabled?: boolean\n className?: string\n color?: CheckboxColor\n id?: string\n /** Some but not all of what this box stands for is checked (a table header\n * over a partly selected page). Painted filled with a dash, and announced as\n * \"mixed\" — an empty box would claim nothing is selected. */\n indeterminate?: boolean\n /** -1 keeps it out of the tab order, for a box that only PAINTS the state of\n * a row that is itself the control. */\n tabIndex?: number\n 'aria-label'?: string\n 'data-testid'?: string\n}\n\nconst COLOR_CLASSES: Record<CheckboxColor, string> = {\n primary: 'border-primary bg-primary text-primary-foreground',\n success: 'border-success bg-success text-white dark:border-success dark:bg-success',\n warning: 'border-warning bg-warning text-white',\n destructive: 'border-destructive bg-destructive text-destructive-foreground',\n}\n\nconst Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n ({ checked = false, onChange, disabled, className, color = 'primary', id, indeterminate = false, ...props }, ref) => {\n const filled = checked || indeterminate\n return (\n <button\n ref={ref}\n id={id}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : checked}\n disabled={disabled}\n onClick={() => onChange?.(!checked)}\n className={cn(\n 'peer inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border-2 transition-all duration-150',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n filled\n ? `${COLOR_CLASSES[color]} shadow-sm`\n : 'border-muted-foreground/40 bg-background hover:border-muted-foreground/60',\n className,\n )}\n {...props}\n >\n {indeterminate\n ? <Minus className=\"h-3.5 w-3.5\" strokeWidth={3} />\n : checked && <Check className=\"h-3.5 w-3.5\" strokeWidth={3} />}\n </button>\n )\n },\n)\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxColor, CheckboxProps }\n","import * as React from 'react'\nimport {\n type ColumnDef,\n type SortingState,\n flexRender,\n getCoreRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table'\nimport { ArrowUpDown, ArrowUp, ArrowDown } from 'lucide-react'\nimport { useTranslation } from '@fayz-ai/core'\n\nimport { cn } from '../lib/cn'\nimport { Checkbox } from './checkbox'\n\ninterface DataTableProps<TData, TValue> {\n columns: ColumnDef<TData, TValue>[]\n data: TData[]\n loading?: boolean\n skeletonRows?: number\n emptyMessage?: React.ReactNode\n onRowClick?: (row: TData) => void\n /** Visual variant: 'card' (white bg, card wrapper — default), 'flat'\n * (transparent bg, still bordered), or 'bare' — no wrapper chrome at all,\n * for a table already inside a card that owns the border and radius. */\n variant?: 'card' | 'flat' | 'bare'\n /** Compact mode: smaller padding and font size */\n compact?: boolean\n /**\n * Qual coluna está ordenada e para que lado, quando quem ordena é OUTRO\n * controle (o menu \"Ordenar\" da barra de ferramentas).\n *\n * Marca o cabeçalho sem torná-lo clicável: com a ordenação fora da tabela,\n * a seta é INFORMAÇÃO (\"está ordenado por isto, assim\"), não um botão. Sem\n * ela, mudar a ordem por um menu que fecha em seguida não deixava rastro\n * nenhum na tela.\n */\n sortIndicator?: { columnId: string; dir: 'asc' | 'desc' }\n /**\n * Turns on the checkbox column on the left. Selection is CONTROLLED by ids:\n * what a bulk action needs is \"which records\", and the table's own row indexes\n * stop meaning that the moment the list refetches, sorts or pages.\n */\n selectable?: boolean\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Row identity for selection. Defaults to `row.id`. */\n getRowId?: (row: TData) => string\n}\n\nfunction DataTable<TData, TValue>({\n columns,\n data,\n loading = false,\n skeletonRows = 3,\n emptyMessage = 'No results.',\n onRowClick,\n variant = 'card',\n compact = false,\n sortIndicator,\n selectable = false,\n selectedIds,\n onSelectedIdsChange,\n getRowId,\n}: DataTableProps<TData, TValue>) {\n const t = useTranslation()\n const isCard = variant === 'card'\n // Rounded box and scroll container must be SEPARATE elements: a scroll\n // container paints its content over its own border-radius, which squared\n // the corners the moment a row background met them.\n const wrapperCls = isCard\n ? 'overflow-hidden rounded-card border bg-card shadow-sm'\n : variant === 'bare'\n ? ''\n : 'overflow-hidden rounded-lg border'\n // 'bare' sits below something else inside its parent card (a search/tools\n // toolbar), so its header is a mid-card band: no rounding, and it keeps the\n // card's own surface rather than starting a new tinted block.\n const headerCls = isCard\n ? 'border-b bg-muted/50'\n : variant === 'bare'\n ? 'border-b bg-muted/30 rounded-none'\n : 'border-b bg-muted/30'\n 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'\n const tdCls = compact ? 'px-3 py-1.5 align-middle text-xs' : 'px-4 py-3 align-middle'\n const tableCls = compact ? 'w-full text-xs min-w-max' : 'w-full text-sm min-w-max'\n const rowHoverCls = isCard ? 'hover:bg-muted/30' : 'hover:bg-muted/20'\n const [sorting, setSorting] = React.useState<SortingState>([])\n\n const rowId = React.useCallback(\n (row: TData) => (getRowId ? getRowId(row) : String((row as { id?: unknown }).id ?? '')),\n [getRowId],\n )\n const selected = React.useMemo(() => new Set(selectedIds ?? []), [selectedIds])\n const pageIds = React.useMemo(() => data.map(rowId), [data, rowId])\n const selectedOnPage = pageIds.filter((id) => selected.has(id)).length\n const allOnPageSelected = pageIds.length > 0 && selectedOnPage === pageIds.length\n\n const toggleRow = React.useCallback((id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }, [selected, onSelectedIdsChange])\n // The header box acts on THIS page only — it must not silently drop a\n // selection made on another page, nor claim to have selected rows that were\n // never loaded.\n const toggleAllOnPage = React.useCallback(() => {\n const next = new Set(selected)\n if (allOnPageSelected) pageIds.forEach((id) => next.delete(id))\n else pageIds.forEach((id) => next.add(id))\n onSelectedIdsChange?.([...next])\n }, [selected, allOnPageSelected, pageIds, onSelectedIdsChange])\n\n // Built here rather than asked of every caller: the column is pure chrome, and\n // a hand-rolled copy per list is where the checkbox column drifts.\n const selectionColumn = React.useMemo<ColumnDef<TData, TValue>>(() => ({\n id: '__select__',\n enableSorting: false,\n header: () => (\n <Checkbox\n checked={allOnPageSelected}\n indeterminate={selectedOnPage > 0 && !allOnPageSelected}\n onChange={toggleAllOnPage}\n aria-label={t('crud.list.selectAllRows')}\n />\n ),\n cell: ({ row }) => {\n const id = rowId(row.original)\n return (\n <Checkbox\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n aria-label={t('crud.list.selectRow')}\n />\n )\n },\n // `toggleAllOnPage` is in the deps because it closes over the CURRENT page's\n // ids: turning the page with nothing selected changes no other dep, and the\n // memo would hand the header a button that ticks the previous page's rows.\n }), [allOnPageSelected, selectedOnPage, selected, rowId, toggleRow, toggleAllOnPage, t])\n\n const allColumns = React.useMemo(\n () => (selectable ? [selectionColumn, ...columns] : columns),\n [selectable, selectionColumn, columns],\n )\n\n const table = useReactTable({\n data,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n onSortingChange: setSorting,\n state: { sorting },\n })\n\n if (loading) {\n return (\n <div className={wrapperCls}>\n <div className=\"overflow-x-auto\">\n <table className={tableCls}>\n <thead>\n <tr className={headerCls}>\n {allColumns.map((_, i) => (\n <th key={i} className={thCls}>\n <div className=\"h-3.5 w-20 animate-pulse rounded bg-muted\" />\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: skeletonRows }).map((_, i) => (\n <tr key={i} className=\"border-b last:border-0\">\n {allColumns.map((_, j) => (\n <td key={j} className={tdCls}>\n <div className=\"h-3.5 w-full animate-pulse rounded bg-muted\" />\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n )\n }\n\n // Uma tabela VAZIA não tem colunas para percorrer, e mantê-la só para\n // hospedar o aviso punha o aviso dentro de um scroller mais largo que a tela:\n // `colSpan` centraliza no meio da TABELA, não no meio do celular, e o \"Crie\n // sua primeira fatura\" nascia cortado, alcançável só arrastando de lado.\n // Sem linhas, o cabeçalho também não informa nada acionável — ele descreve\n // colunas que não existem ainda. Some a tabela, some o scroll, e o aviso\n // ocupa a largura visível, que é onde ele deveria estar desde o começo.\n const showEmptyBlock = !loading && table.getRowModel().rows.length === 0\n if (showEmptyBlock) {\n return (\n <div className={wrapperCls}>\n <div className=\"flex min-h-64 w-full items-center justify-center px-4 py-10 text-center text-muted-foreground\">\n {emptyMessage}\n </div>\n </div>\n )\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"overflow-x-auto\">\n <table className={tableCls}>\n <thead>\n {table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id} className={headerCls}>\n {headerGroup.headers.map((header) => {\n const sorted = header.column.getIsSorted()\n return (\n <th\n key={header.id}\n className={cn(thCls, header.column.id === '__select__' && 'w-10 pr-0')}\n >\n {header.isPlaceholder ? null : sortIndicator?.columnId === header.column.id ? (\n <span className=\"inline-flex items-center gap-1 text-foreground\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n {sortIndicator.dir === 'desc'\n ? <ArrowDown className=\"h-3 w-3\" />\n : <ArrowUp className=\"h-3 w-3\" />}\n </span>\n ) : header.column.getCanSort() ? (\n <button\n className=\"flex items-center gap-1 hover:text-foreground transition-colors\"\n onClick={header.column.getToggleSortingHandler()}\n >\n {flexRender(header.column.columnDef.header, header.getContext())}\n {sorted === 'asc' ? (\n <ArrowUp className=\"h-3 w-3\" />\n ) : sorted === 'desc' ? (\n <ArrowDown className=\"h-3 w-3\" />\n ) : (\n <ArrowUpDown className=\"h-3 w-3 opacity-40\" />\n )}\n </button>\n ) : (\n flexRender(header.column.columnDef.header, header.getContext())\n )}\n </th>\n )\n })}\n </tr>\n ))}\n </thead>\n <tbody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => {\n const isSelected = selectable && selected.has(rowId(row.original))\n return (\n <tr\n key={row.id}\n className={cn(\n `border-b last:border-0 transition-colors ${rowHoverCls}`,\n onRowClick && 'cursor-pointer',\n isSelected && 'bg-muted/40',\n )}\n onClick={() => onRowClick?.(row.original)}\n data-selected={isSelected || undefined}\n >\n {row.getVisibleCells().map((cell) => {\n const isSelectCell = cell.column.id === '__select__'\n return (\n <td\n key={cell.id}\n className={cn(tdCls, isSelectCell && 'w-10 pr-0')}\n // Ticking a box is not opening the record: without this\n // the row's own click handler fired underneath and the\n // list navigated away from the selection just made.\n onClick={isSelectCell ? (e) => e.stopPropagation() : undefined}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </td>\n )\n })}\n </tr>\n )\n })\n ) : (\n <tr>\n {/* Height, not just padding: an empty table that collapses to one\n thin row reads as a rendering glitch rather than \"nothing\n here yet\". `emptyMessage` takes a node so callers can hand in\n a full empty state (icon, headline, create action). */}\n <td colSpan={allColumns.length} className=\"h-64 px-6 text-center align-middle text-muted-foreground\">\n {emptyMessage}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n </div>\n )\n}\n\nexport { DataTable, type DataTableProps }\n","import * as React from 'react'\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\n\nimport { cn } from '../lib/cn'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[120] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from 'react'\n\n/** The one breakpoint the shell actually branches on. */\nexport const WIDE_QUERY = '(min-width: 768px)'\n\n/**\n * Real width, not CSS.\n *\n * Some decisions cannot be made with a `md:hidden`: hiding is not unmounting,\n * and no portal respects `display: none` — two mounted copies of a page send\n * TWO sets of buttons to the shell's header bar, and the action appears twice.\n * `matchMedia` already answers correctly on the first render, so choosing here\n * does not flash.\n *\n * Prefer a CSS breakpoint when the choice is only about what is visible. Reach\n * for this when the choice changes what exists, or what a component decides.\n */\nexport function useIsWide(query: string = WIDE_QUERY): boolean {\n const [wide, setWide] = React.useState(\n () => (typeof window === 'undefined' ? true : window.matchMedia(query).matches),\n )\n React.useEffect(() => {\n const mq = window.matchMedia(query)\n const onChange = () => setWide(mq.matches)\n mq.addEventListener('change', onChange)\n return () => mq.removeEventListener('change', onChange)\n }, [query])\n return wide\n}\n","import * as React from 'react'\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'\n\nexport interface HintProps extends React.HTMLAttributes<HTMLElement> {\n /** The tip. Nothing renders when this is empty. */\n label?: React.ReactNode\n children: React.ReactElement\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Milliseconds before it opens. 0 — an icon button gives no other clue what\n * it does, so waiting 700ms to find out is the wrong trade. */\n delayDuration?: number\n}\n\n/**\n * A styled tooltip for any control that would otherwise rely on the browser's\n * native `title` attribute.\n *\n * `title=` looks like a tooltip until you use one: it appears after a ~1s\n * delay you cannot change, in the OS's own styling, never on touch, and it is\n * skipped by several screen readers. This renders the design-system tooltip\n * instead, and — because the trigger keeps its own `aria-describedby` — the\n * text is announced rather than merely drawn.\n *\n * Self-contained on purpose: it mounts its own Provider so a caller can drop a\n * Hint anywhere without first knowing whether some ancestor set one up.\n */\nexport const Hint = React.forwardRef<HTMLElement, HintProps>(function Hint(\n { label, children, side = 'top', delayDuration = 0, ...rest },\n ref,\n) {\n // `rest` + ref repassados ao filho porque um Hint costuma envolver o gatilho\n // de OUTRA coisa — `<DropdownTrigger asChild><Hint><button/></Hint>`. Sem\n // isso o Hint engolia os handlers do dropdown e o botão virava enfeite: o\n // menu de ordenar simplesmente não abria.\n if (!label) return React.cloneElement(children, { ...rest, ref } as never)\n return (\n <TooltipPrimitive.Provider delayDuration={delayDuration}>\n <Tooltip>\n <TooltipTrigger asChild {...rest} ref={ref as never}>{children}</TooltipTrigger>\n <TooltipContent side={side} className=\"px-2 py-1 text-xs font-medium\">\n {label}\n </TooltipContent>\n </Tooltip>\n </TooltipPrimitive.Provider>\n )\n})\n","import * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { ChevronDown, MoreHorizontal, MoreVertical, Plus } from 'lucide-react'\n\nimport { cn } from '../lib/cn'\nimport { useIsWide } from '../hooks/useIsWide'\nimport { Button } from './button'\nimport { Dropdown, DropdownContent, DropdownItem, DropdownSeparator, DropdownTrigger } from './dropdown'\nimport { Hint } from './hint'\n\n// ---------------------------------------------------------------------------\n// What a screen can DO, declared rather than drawn.\n//\n// The header slot was only ever a portal: it imposed no button, variant, size,\n// order or collapse rule, so every screen invented its own and the same control\n// ended up with five treatments — solid, outline, ghost, icon-sized, and three\n// raw <button>s with the primary classes copied by hand.\n//\n// A screen now says what its actions ARE and this decides how they look. It is\n// the same trade the bottom nav makes: declare intent, let one renderer own\n// presentation, and a second presentation (a phone) costs nothing extra.\n//\n// The complement is PageToolbar, and the line between them holds: this carries\n// what you DO on a screen, that carries what the screen SHOWS. A period picker\n// is not an action.\n// ---------------------------------------------------------------------------\n\nexport type PageActionIntent = 'primary' | 'secondary' | 'utility' | 'danger'\n\nexport interface PageActionItem {\n id: string\n /** Already translated. The point of the type is that nothing hardcodes here. */\n label: string\n icon?: React.ComponentType<{ className?: string }>\n /**\n * - `primary` the one thing the screen is for. At most one; extras demote.\n * - `secondary` other ways to do it (import, from AI) — folded under primary.\n * - `utility` settings, export, refresh. Icon-only beside the primary.\n * - `danger` destructive. Never inline; always behind the overflow.\n */\n intent?: PageActionIntent\n onSelect: () => void | Promise<void>\n disabled?: boolean\n /** Set by whoever resolves permissions — this renderer has no access engine. */\n hidden?: boolean\n /** Long-form line under the label when the action opens in a menu. */\n description?: string\n /** Kept so converting a hand-written button does not silently drop its hook. */\n testId?: string\n /**\n * This action makes a NEW record. It decides the FAB's face: \"+\" on a screen\n * you add to, \"⋮\" on a record you act upon. Not derivable from the icon —\n * \"Novo produto\" carries a Package, not a plus — and not from the screen\n * either, since a settings tab has a back crumb and still adds. Defaults to\n * the icon being a plus, which covers the plainly-named cases.\n */\n creates?: boolean\n /**\n * Offered on a pointer device only. Some actions cannot be FINISHED on a\n * phone — picking a CSV off a filesystem and mapping its columns is the\n * clearest case — and a menu entry that leads nowhere is worse than one that\n * is absent. Not about screen width: about whether the job can be done.\n */\n desktopOnly?: boolean\n}\n\nfunction iconOf(action: PageActionItem, className: string) {\n const Icon = action.icon\n return Icon ? <Icon className={className} /> : null\n}\n\n/**\n * Renders a declared action set.\n *\n * One primary survives: a screen with three equal buttons is a screen with no\n * obvious next step, and on a phone it simply overflows the header. Anything\n * after the first primary is treated as secondary.\n */\nexport function PageActionBar({ actions, className }: { actions: PageActionItem[]; className?: string }) {\n const wide = useIsWide()\n const visible = actions.filter((a) => !a.hidden)\n if (visible.length === 0) return null\n\n // A phone header has room for a title and not much else, and its top-right is\n // the furthest point from a thumb. The actions move to the corner the thumb\n // owns instead — the same set, a different place to reach it.\n if (!wide) {\n const usable = visible.filter((a) => !a.desktopOnly)\n return usable.length > 0 ? <PageActionFab actions={usable} /> : null\n }\n\n let seenPrimary = false\n const primary: PageActionItem[] = []\n const secondary: PageActionItem[] = []\n const utility: PageActionItem[] = []\n const danger: PageActionItem[] = []\n\n for (const a of visible) {\n const intent = a.intent ?? 'secondary'\n if (intent === 'primary' && !seenPrimary) { seenPrimary = true; primary.push(a); continue }\n if (intent === 'danger') { danger.push(a); continue }\n if (intent === 'utility') { utility.push(a); continue }\n secondary.push(a)\n }\n\n const head = primary[0]\n const menu = [...secondary, ...danger]\n\n return (\n <div className={cn('flex shrink-0 items-center gap-2', className)}>\n {/* Utilities read as chrome, so they sit before the thing you came to do. */}\n {utility.map((a) => (\n // Um botão só de ícone não diz o que faz. `title=` parecia resolver e\n // não resolve: espera ~1s que ninguém controla, sai na pintura do\n // sistema operacional, nunca aparece no toque e vários leitores de tela\n // pulam. Hint é o tooltip do design system, e o texto é ANUNCIADO.\n <Hint key={a.id} label={a.label}>\n <Button\n // `ghost`, não `outline`: um utilitário é cromo, e uma caixa em\n // volta dele pede a mesma atenção que a ação pela qual a tela\n // existe — duas molduras lado a lado e nenhuma hierarquia. Sem\n // contorno em repouso, o ícone só ganha superfície no hover, que é\n // quando alguém já está mirando nele.\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => void a.onSelect()}\n disabled={a.disabled}\n aria-label={a.label}\n data-testid={a.testId}\n data-tour={`action.${a.id}`}\n >\n {iconOf(a, 'h-4 w-4')}\n </Button>\n </Hint>\n ))}\n\n {head && menu.length === 0 && (\n <Button onClick={() => void head.onSelect()} disabled={head.disabled} data-testid={head.testId} data-tour={`action.${head.id}`}>\n {iconOf(head, 'mr-1.5 h-4 w-4')}\n {head.label}\n </Button>\n )}\n\n {/* Primary plus alternatives: one button, one caret. Two buttons of equal\n weight is the thing that made these headers unreadable. */}\n {head && menu.length > 0 && (\n <div className=\"flex items-center\">\n <Button className=\"rounded-r-none\" onClick={() => void head.onSelect()} disabled={head.disabled} data-testid={head.testId} data-tour={`action.${head.id}`}>\n {iconOf(head, 'mr-1.5 h-4 w-4')}\n {head.label}\n </Button>\n <Dropdown>\n <DropdownTrigger asChild>\n <Hint label={`${head.label}…`}>\n <Button\n className=\"-ml-px rounded-l-none px-2\"\n aria-label={`${head.label}…`}\n // Anchors for the actions FOLDED behind this caret resolve to\n // the caret itself: pointing at a menu item nobody has opened\n // would spotlight an element that is not on screen.\n data-tour={menu.map((a) => `action.${a.id}`).join(' ')}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </Button>\n </Hint>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n <ActionItems actions={menu} />\n </DropdownContent>\n </Dropdown>\n </div>\n )}\n\n {/* No primary, but things to offer: a plain overflow rather than promoting\n something the screen did not call primary. */}\n {!head && menu.length > 0 && (\n <Dropdown>\n <DropdownTrigger asChild>\n <Hint label=\"Ações\">\n <Button variant=\"outline\" size=\"icon\" aria-label=\"Ações\">\n <MoreHorizontal className=\"h-4 w-4\" />\n </Button>\n </Hint>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n <ActionItems actions={menu} />\n </DropdownContent>\n </Dropdown>\n )}\n </div>\n )\n}\n\nfunction ActionItems({ actions, stagger }: { actions: PageActionItem[]; stagger?: boolean }) {\n const out: React.ReactNode[] = []\n actions.forEach((a, i) => {\n const isDanger = a.intent === 'danger'\n const prevSafe = i > 0 && actions[i - 1].intent !== 'danger'\n if (isDanger && prevSafe) out.push(<DropdownSeparator key={`${a.id}-sep`} />)\n out.push(\n <DropdownItem\n key={a.id}\n disabled={a.disabled}\n onSelect={() => void a.onSelect()}\n data-testid={a.testId}\n style={stagger ? ({ ['--i' as string]: i } as React.CSSProperties) : undefined}\n className={cn('gap-2', stagger && 'fz-fab-item', isDanger && 'text-destructive focus:text-destructive')}\n >\n {iconOf(a, 'h-4 w-4 shrink-0')}\n <span className=\"min-w-0\">\n <span className=\"block truncate\">{a.label}</span>\n {a.description && (\n <span className=\"block truncate text-xs text-muted-foreground\">{a.description}</span>\n )}\n </span>\n </DropdownItem>,\n )\n })\n return <>{out}</>\n}\n\n/**\n * The phone presentation: one button in the thumb's corner.\n *\n * It rides on `--fz-bottom-bar`, so it sits above the tab bar where there is\n * one and drops to the screen edge on the screens where the bar retracts —\n * without knowing anything about either.\n *\n * A single action is performed by the tap. Opening a menu to offer one choice\n * is a question with one answer.\n */\nfunction PageActionFab({ actions }: { actions: PageActionItem[] }) {\n const byIntent = (i: PageActionIntent) => actions.filter((a) => (a.intent ?? 'secondary') === i)\n\n // Utilities are not the thing you came to do. Folded into the \"+\" they made\n // a create menu whose first entry was \"Configurações\"; they get their own,\n // smaller, neutral circle above it instead — near the thumb, clearly not the\n // primary. Alone on a screen they simply ARE the button.\n const utility = byIntent('utility')\n const main = [...byIntent('primary'), ...byIntent('secondary'), ...byIntent('danger')]\n\n if (main.length === 0) return <FabButton actions={utility} tone=\"neutral\" />\n\n // Its face follows what the whole set is FOR, not what its first entry looks\n // like. A screen whose every action inserts something is a screen you add on\n // — the circle is a \"+\", even when the menu offers three ways in and none of\n // their icons is a plus. One non-inserting action and it is not that screen\n // any more: a record's own actions get the neutral \"⋮\", because painting\n // those brand made every record page look like an invitation to create.\n const isCreate = main.every((a) => a.creates ?? a.icon === Plus)\n return (\n <>\n {utility.length > 0 && <FabButton actions={utility} tone=\"neutral\" mini />}\n <FabButton actions={main} tone={isCreate ? 'primary' : 'neutral'} />\n </>\n )\n}\n\n/**\n * Keeps the scrim mounted through its fade-OUT.\n *\n * Radix animates its own content out with `data-state=closed`; a plain element\n * of ours has no such state, so unmounting on close would cut the dim instantly\n * while the menu was still leaving. Mounted first, painted transparent, then\n * faded in on the next frame — a transition needs two values to run between.\n */\nexport function useScrim(open: boolean): { mounted: boolean; visible: boolean } {\n const [mounted, setMounted] = React.useState(open)\n const [visible, setVisible] = React.useState(open)\n\n React.useEffect(() => {\n if (open) {\n setMounted(true)\n const frame = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(frame)\n }\n setVisible(false)\n const timer = window.setTimeout(() => setMounted(false), SCRIM_MS)\n return () => window.clearTimeout(timer)\n }, [open])\n\n return { mounted, visible }\n}\n\n/** Matches `duration-200` on the scrim. */\nexport const SCRIM_MS = 200\n\n/** One circle: it performs a lone action, or opens the rest upward. */\nfunction FabButton({ actions, tone, mini }: {\n actions: PageActionItem[]\n tone: 'primary' | 'neutral'\n /** Stacked above the main circle, one size down. */\n mini?: boolean\n}) {\n const [open, setOpen] = React.useState(false)\n const scrim = useScrim(open)\n if (actions.length === 0) return null\n\n const isCreate = tone === 'primary'\n const FabIcon = isCreate ? Plus : MoreVertical\n // The mini sits one main circle (3.5rem) plus a gap above the main one, so\n // both move together when the tab bar retracts.\n const style = {\n bottom: mini ? 'calc(var(--fz-bottom-bar, 0px) + 4.75rem)' : 'calc(var(--fz-bottom-bar, 0px) + 1rem)',\n } as React.CSSProperties\n\n const shell = cn(\n 'fz-tap fixed z-40 flex items-center justify-center rounded-full',\n 'transition-transform active:scale-95 md:hidden',\n // Centred on the main circle's column, so the two read as one stack.\n mini ? 'right-5 h-12 w-12' : 'right-4 h-14 w-14',\n isCreate\n // The wide ring is what holds a saturated disc off the content it covers.\n ? 'bg-primary text-primary-foreground shadow-lg shadow-primary/30 ring-4 ring-background'\n // Neutral on purpose: \"⋮\" is not the thing you came to do, and painting\n // it brand made every record page look like it was inviting a create.\n //\n // A hairline, not that wide ring: white circle + 4px of page colour +\n // shadow drew a second disc behind the first, and the pair read as two\n // buttons stacked. And a hairline, not a `border` — a theme may turn any\n // bordered card surface into glass (`.bg-card.border` →\n // fayz-glass-surface), and beauty does; the circle came out see-through\n // with the board scrolling underneath it.\n : 'bg-card text-foreground shadow-lg ring-1 ring-border',\n )\n\n if (actions.length === 1) {\n const only = actions[0]\n const Icon = only.icon ?? FabIcon\n return (\n <button\n type=\"button\"\n style={style}\n className={shell}\n onClick={() => void only.onSelect()}\n disabled={only.disabled}\n aria-label={only.label}\n data-testid={only.testId}\n >\n <Icon className={mini ? 'h-5 w-5' : 'h-6 w-6'} />\n </button>\n )\n }\n\n return (\n <Dropdown open={open} onOpenChange={setOpen}>\n {/* The page dims behind the menu, the way a sheet dims behind itself: on a\n phone the menu is the only thing to answer, and the list of records\n under it kept reading as a place you could still tap. Portalled to the\n body so no ancestor's stacking context can trap it below the menu. */}\n {scrim.mounted && typeof document !== 'undefined' && createPortal(\n <div\n aria-hidden\n onClick={() => setOpen(false)}\n className={cn(\n 'fixed inset-0 z-[100] bg-foreground/40 transition-opacity duration-200 md:hidden',\n 'motion-reduce:transition-none',\n scrim.visible ? 'opacity-100' : 'opacity-0',\n )}\n />,\n document.body,\n )}\n <DropdownTrigger asChild>\n <button\n type=\"button\"\n style={style}\n // Only the \"+\" rotates into an \"×\": a vertical ellipsis spun 135°\n // reads as a glitch, not as \"tap again to close\".\n //\n // Above the scrim while open: the circle is what closes the menu, and\n // dimming the way out is the one thing the dim must not do.\n className={cn(shell, open && 'z-[105]', isCreate && 'fz-fab-trigger')}\n aria-label={actionsMenuLabel}\n >\n <FabIcon className={mini ? 'h-5 w-5' : 'h-6 w-6'} />\n </button>\n </DropdownTrigger>\n {/* Upward, from the button: a menu that opened downward would run straight\n off the bottom of the screen. */}\n <DropdownContent side=\"top\" align=\"end\" sideOffset={12} className=\"fz-fab-menu w-60 md:hidden\">\n <ActionItems actions={actions} stagger />\n </DropdownContent>\n </Dropdown>\n )\n}\n\n/** The FAB's accessible name when it opens a menu. Overridable for locale. */\nexport let actionsMenuLabel = 'Ações'\nexport function setActionsMenuLabel(label: string) { actionsMenuLabel = label }\n","import { cn } from '../lib/cn'\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('animate-pulse rounded-md bg-muted', className)}\n {...props}\n />\n )\n}\n\n/**\n * Skeleton loader that mimics a table with rows and columns.\n * Drop-in replacement for \"Loading...\" text in list views.\n */\nfunction TableSkeleton({ columns = 4, rows = 2 }: { columns?: number; rows?: number }) {\n return (\n <div className=\"rounded-lg border overflow-hidden\">\n <div className=\"border-b bg-muted/30 flex gap-4 px-4 py-2.5\">\n {Array.from({ length: columns }).map((_, i) => (\n <Skeleton key={i} className=\"h-3 flex-1 rounded bg-muted-foreground/10\" />\n ))}\n </div>\n <div className=\"divide-y\">\n {Array.from({ length: rows }).map((_, r) => (\n <div key={r} className=\"flex items-center gap-4 px-4 py-3.5\">\n {Array.from({ length: columns }).map((_, c) => (\n <Skeleton\n key={c}\n className={cn(\n 'h-3 rounded',\n c === 0 ? 'flex-[2]' : 'flex-1',\n )}\n />\n ))}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport { Skeleton, TableSkeleton }\n","import * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../lib/cn'\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'start', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[110] w-72 rounded-xl border bg-popover p-0 text-popover-foreground shadow-lg outline-none',\n 'data-[state=open]:animate-zoom-in data-[state=closed]:animate-zoom-out',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverAnchor, PopoverContent }\n","import * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Calendar, Check, ChevronDown, GripVertical, RefreshCw, SlidersHorizontal, X } from 'lucide-react'\nimport { cn } from '../lib/cn'\nimport { Button } from './button'\nimport { Dropdown, DropdownTrigger, DropdownContent, DropdownItem } from './dropdown'\nimport { useIsWide } from '../hooks/useIsWide'\nimport { useModuleHeaderActionsSlot, useModuleHeaderSlot } from '../layout/AppShell'\nimport { Popover, PopoverTrigger, PopoverContent } from './popover'\nimport { useScrim } from './page-actions'\n\n// ---------------------------------------------------------------------------\n// PageToolbar — a barra flutuante do que a tela está MOSTRANDO.\n//\n// A barra da shell carrega o que se FAZ numa tela (Novo, Importar, Salvar).\n// Esta carrega a pergunta que a tela responde: qual período, quais filtros,\n// quais cartões. Eram duas respostas diferentes para as mesmas três coisas — a\n// faixa de Análises, larga e com cromo próprio, e o \"Customize\" solto do\n// dashboard —, então o mesmo trabalho parecia recurso de produto diferente\n// dependendo da página aberta.\n//\n// Flutuante e à direita de propósito: ela governa a grade ABAIXO dela e fica\n// parada enquanto essa grade rola por baixo (sticky, com borda e sombra, para\n// ler como algo POR CIMA dos cartões e não como uma emenda no layout).\n// ---------------------------------------------------------------------------\n\n/**\n * O gatilho padrão da barra: sem contorno, com o rótulo sublinhado tracejado.\n *\n * Contornados, os três viravam três caixas arredondadas dentro de outra caixa\n * arredondada — a borda do vidro e a dos botões disputavam a mesma leitura, e a\n * barra parecia um grupo de botões e não um controle. O tracejado é o traço\n * clássico de \"este valor se troca\": diz que clica sem desenhar mais um limite.\n */\nexport type ToolbarSurface = 'bar' | 'panel'\n\ninterface ToolbarSurfaceValue {\n surface: ToolbarSurface\n /**\n * Fecha o painel que hospeda este controle.\n *\n * Um controle que TERMINA (\"Aplicar\") não tem como se despedir sozinho: ele\n * só conhece o próprio popover, que no painel nem chega a existir. Sem isto,\n * aplicar deixava o painel aberto por cima do resultado que a pessoa acabou\n * de pedir para ver. No-op na faixa larga, onde cada controle fecha o seu.\n */\n close: () => void\n}\n\nconst ToolbarSurfaceContext = React.createContext<ToolbarSurfaceValue>({\n surface: 'bar',\n close: () => {},\n})\n\nexport function useToolbarSurface(): ToolbarSurface {\n return React.useContext(ToolbarSurfaceContext).surface\n}\n\n/** Fecha o painel do celular. No-op quando o controle está na faixa larga. */\nexport function useToolbarPanelClose(): () => void {\n return React.useContext(ToolbarSurfaceContext).close\n}\n\nexport const ToolbarButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button> & { icon?: React.ElementType; caret?: boolean }\n>(function ToolbarButton({ icon: Icon, caret = true, children, className, ...props }, ref) {\n const panel = useToolbarSurface() === 'panel'\n // No painel cada controle é uma LINHA de ponta a ponta, com contorno, como\n // os campos de data logo acima. Solto e fantasma no meio da coluna ele não\n // tinha limite visível nem largura previsível: três deles centralizados em\n // larguras diferentes leem como três textos, não como três campos. O\n // sublinhado tracejado sai junto — ele diz \"este valor se troca\" numa faixa\n // onde não há caixa; dentro de uma caixa, é um segundo contorno.\n if (panel) {\n return (\n <Button\n ref={ref}\n variant=\"outline\"\n className={cn('h-10 w-full justify-between gap-2 px-3 font-normal', className)}\n {...props}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n <span className=\"truncate\">{children}</span>\n </span>\n {caret ? <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n </Button>\n )\n }\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n // Sem fundo no hover: um retângulo arredondado aparecendo atrás do\n // rótulo desenha, no hover, exatamente o botão que o repouso não tem.\n // O que muda é o texto e o traço — mais firmes, e o tracejado vira\n // contínuo, que é o mesmo \"agora sim, clique\" sem inventar caixa.\n 'group gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none',\n 'hover:bg-transparent hover:text-foreground',\n className,\n )}\n {...props}\n >\n {Icon ? <Icon className=\"h-3 w-3 shrink-0 opacity-70\" /> : null}\n <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\">\n {children}\n </span>\n {caret ? <ChevronDown className=\"h-3 w-3 shrink-0 opacity-60\" /> : null}\n </Button>\n )\n})\n\n/**\n * O gatilho de COMANDO da barra — Exportar, Imprimir, Novo.\n *\n * Mesma matéria do ToolbarButton acima (sem contorno, sem fundo, fantasma) e\n * sem o sublinhado tracejado: o tracejado promete \"este valor se troca\", e\n * imprimir não é um valor. Eram botões contornados no meio de uma barra sem\n * contorno nenhum — duas caixas arredondadas ao lado de três rótulos soltos,\n * que é o desenho que faz a barra parecer duas barras.\n */\nexport const ToolbarAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button> & { icon?: React.ElementType; caret?: boolean }\n>(function ToolbarAction({ icon: Icon, caret = false, children, className, ...props }, ref) {\n const panel = useToolbarSurface() === 'panel'\n // Mesma linha de ponta a ponta, sem seta e com o rótulo CENTRADO: um comando\n // não é um valor em aberto — a seta prometeria outra coisa a escolher, e o\n // alinhamento à esquerda o faria ler como mais um campo da lista acima, que\n // é justamente o que ele não é.\n if (panel) {\n return (\n <Button\n ref={ref}\n variant=\"outline\"\n className={cn('h-10 w-full justify-center gap-2 px-3 font-normal', className)}\n {...props}\n >\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n <span className=\"truncate\">{children}</span>\n </Button>\n )\n }\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n 'gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none',\n 'hover:bg-transparent hover:text-foreground',\n className,\n )}\n {...props}\n >\n {Icon ? <Icon className=\"h-3 w-3 shrink-0 opacity-70\" /> : null}\n {children}\n {caret ? <ChevronDown className=\"h-3 w-3 shrink-0 opacity-60\" /> : null}\n </Button>\n )\n})\n\nexport interface RangeOption {\n value: string\n label: string\n}\n\nexport interface RangeControlProps {\n options: RangeOption[]\n value: string\n onChange: (value: string) => void\n /** Rótulo do gatilho quando não é nenhum dos presets (ex.: \"Personalizado\"). */\n label?: string\n /** \"21 jul – 19 ago\" — a janela que os números realmente cobrem. Um nome de\n * preset sozinho deixa a dúvida se \"este mês\" já inclui hoje. */\n span?: string\n /** Itens extras no fim do menu (ex.: abrir uma janela personalizada). */\n extra?: React.ReactNode\n /** Desenhado ao lado do gatilho (ex.: os dois seletores de data). */\n children?: React.ReactNode\n icon?: React.ElementType\n className?: string\n}\n\n/**\n * O controle de período — um só, para o dashboard e para as análises.\n *\n * Puramente apresentacional: quem tem o estado (o contexto de analytics, o de\n * dashboard) passa opções e valor. Eram dois desenhos para a mesma escolha, um\n * segmentado de 7d/30d/90d e um menu de presets, e trocar de tela trocava a\n * gramática do controle sem trocar o que ele faz.\n */\nexport function RangeControl({\n options, value, onChange, label, span, extra, children, icon = Calendar, className,\n}: RangeControlProps) {\n const current = options.find((o) => o.value === value)\n return (\n <div className={cn('flex items-center gap-1.5', className)}>\n <Dropdown>\n <DropdownTrigger asChild>\n <ToolbarButton icon={icon}>\n {label ?? current?.label ?? value}\n {span ? <span className=\"font-normal text-muted-foreground\">{span}</span> : null}\n </ToolbarButton>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n {options.map((o) => (\n <DropdownItem key={o.value} onSelect={() => onChange(o.value)}>\n {o.label}\n {o.value === value ? <Check className=\"ml-auto h-3.5 w-3.5 shrink-0 pl-1\" /> : null}\n </DropdownItem>\n ))}\n {extra}\n </DropdownContent>\n </Dropdown>\n {children}\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Onde a barra mora.\n//\n// Ela flutua sobre a grade, e \"sobre a grade\" às vezes quer dizer \"em cima do\n// título do terceiro cartão\". Em vez de escolher por todo mundo um canto que\n// nunca atrapalhe — não existe —, a barra ganha uma alça e o usuário resolve.\n//\n// UMA posição para todas as telas, por omissão: \"onde fica a barra flutuante\" é\n// uma preferência, não sete. Uma superfície que precise da sua passa `storageKey`.\n// ---------------------------------------------------------------------------\n\ninterface ToolbarOffset { x: number; y: number }\n\nconst OFFSET_KEY = (scope: string) => `fayz.toolbar.offset.${scope}`\nconst EDGE = 8\n\nfunction readOffset(key: string): ToolbarOffset {\n if (typeof window === 'undefined') return { x: 0, y: 0 }\n try {\n const raw = window.localStorage.getItem(key)\n if (!raw) return { x: 0, y: 0 }\n const parsed = JSON.parse(raw) as Partial<ToolbarOffset>\n return {\n x: Number.isFinite(parsed.x) ? Number(parsed.x) : 0,\n y: Number.isFinite(parsed.y) ? Number(parsed.y) : 0,\n }\n } catch {\n return { x: 0, y: 0 }\n }\n}\n\nfunction writeOffset(key: string, offset: ToolbarOffset): void {\n if (typeof window === 'undefined') return\n try {\n if (offset.x === 0 && offset.y === 0) window.localStorage.removeItem(key)\n else window.localStorage.setItem(key, JSON.stringify(offset))\n } catch {\n /* quota / private mode — perder isto custa uma posição, não um dado */\n }\n}\n\n/**\n * Deslocamento arrastável, preso à viewport.\n *\n * O clamp mede o elemento JÁ transladado e desconta o deslocamento atual para\n * achar a âncora — é o que mantém a barra inteira na tela depois de um resize,\n * de um rail que abre, ou de uma posição guardada numa janela maior.\n */\nfunction useToolbarOffset(storageKey: string, enabled: boolean) {\n const key = OFFSET_KEY(storageKey)\n const barRef = React.useRef<HTMLDivElement>(null)\n const [offset, setOffset] = React.useState<ToolbarOffset>(() => (enabled ? readOffset(key) : { x: 0, y: 0 }))\n const [dragging, setDragging] = React.useState(false)\n const latest = React.useRef(offset)\n latest.current = offset\n const origin = React.useRef<{ px: number; py: number; ox: number; oy: number } | null>(null)\n\n const clamp = React.useCallback((next: ToolbarOffset): ToolbarOffset => {\n const el = barRef.current\n if (!el || typeof window === 'undefined') return next\n const rect = el.getBoundingClientRect()\n const anchorLeft = rect.left - latest.current.x\n const anchorTop = rect.top - latest.current.y\n return {\n x: Math.min(\n Math.max(next.x, EDGE - anchorLeft),\n Math.max(EDGE - anchorLeft, window.innerWidth - EDGE - rect.width - anchorLeft),\n ),\n y: Math.min(\n Math.max(next.y, EDGE - anchorTop),\n Math.max(EDGE - anchorTop, window.innerHeight - EDGE - rect.height - anchorTop),\n ),\n }\n }, [])\n\n const move = React.useCallback((next: ToolbarOffset, persist: boolean) => {\n const clamped = clamp(next)\n setOffset(clamped)\n if (persist) writeOffset(key, clamped)\n }, [clamp, key])\n\n const onPointerDown = (event: React.PointerEvent<HTMLElement>) => {\n if (!enabled || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.setPointerCapture(event.pointerId)\n origin.current = { px: event.clientX, py: event.clientY, ox: latest.current.x, oy: latest.current.y }\n setDragging(true)\n }\n\n const onPointerMove = (event: React.PointerEvent<HTMLElement>) => {\n const from = origin.current\n if (!from) return\n move({ x: from.ox + (event.clientX - from.px), y: from.oy + (event.clientY - from.py) }, false)\n }\n\n const endDrag = (event: React.PointerEvent<HTMLElement>) => {\n if (!origin.current) return\n origin.current = null\n setDragging(false)\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId)\n }\n writeOffset(key, latest.current)\n }\n\n // Teclado: a alça é um botão, e um controle que só responde ao arrasto não\n // existe para quem não usa mouse.\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!enabled) return\n const step = event.shiftKey ? 24 : 8\n const delta: Record<string, ToolbarOffset> = {\n ArrowLeft: { x: -step, y: 0 },\n ArrowRight: { x: step, y: 0 },\n ArrowUp: { x: 0, y: -step },\n ArrowDown: { x: 0, y: step },\n }\n if (event.key === 'Escape' || event.key === 'Home') {\n event.preventDefault()\n move({ x: 0, y: 0 }, true)\n return\n }\n const d = delta[event.key]\n if (!d) return\n event.preventDefault()\n move({ x: latest.current.x + d.x, y: latest.current.y + d.y }, true)\n }\n\n const reset = React.useCallback(() => move({ x: 0, y: 0 }, true), [move])\n\n // Uma posição guardada numa janela larga não pode esconder a barra numa\n // estreita — reancora sem gravar, para não sobrescrever a escolha do usuário.\n React.useEffect(() => {\n if (!enabled) return\n const onResize = () => move(latest.current, false)\n window.addEventListener('resize', onResize)\n return () => window.removeEventListener('resize', onResize)\n }, [enabled, move])\n\n return { barRef, offset, dragging, reset, handlers: { onPointerDown, onPointerMove, onPointerUp: endDrag, onPointerCancel: endDrag, onKeyDown } }\n}\n\n/**\n * Onde os controles da barra estão sendo desenhados.\n *\n * `bar` é a faixa estreita: cada controle é um gatilho que abre o seu próprio\n * popover. `panel` é o painel do celular, ancorado no header e sobre o escurecer — ali um\n * popover dentro de outro é uma camada a mais para atravessar, e o que o\n * controle tem a oferecer cabe ABERTO. Os slots são ReactNode opacos para a\n * barra, então quem precisa saber lê daqui em vez de receber por prop.\n */\nexport interface PageToolbarProps {\n /** O período. */\n range?: React.ReactNode\n /** Filtros gerais e comparação — o que estreita a pergunta. */\n filters?: React.ReactNode\n /** Filtros aplicados, como pastilhas removíveis. */\n chips?: React.ReactNode\n /** Quais componentes aparecem. */\n customize?: React.ReactNode\n /** Extras da tela (exportar, um relatório novo). */\n actions?: React.ReactNode\n onRefresh?: () => void\n refreshLabel?: string\n /** Solta a barra do topo (dentro de um modal, ou ao imprimir). */\n sticky?: boolean\n /** Alça de arrastar à esquerda. Desligue onde a barra não flutua sobre nada. */\n movable?: boolean\n /** Separa a posição desta barra da compartilhada. Ver useToolbarOffset. */\n storageKey?: string\n /** Rótulo acessível da alça. */\n moveLabel?: string\n /** Título da folha que abre no celular. Padrão: \"Filtros\". */\n filtersTitle?: string\n className?: string\n}\n\nexport function PageToolbar({\n range, filters, chips, customize, actions, onRefresh, refreshLabel,\n sticky = true, movable = true, storageKey = 'shared', moveLabel, filtersTitle, className,\n}: PageToolbarProps) {\n // A phone does not float this bar. Floating buys back a row of vertical space\n // on a wide screen; on a 393px one it lands ON the cards instead of beside\n // them, and the thing that would move it out of the way is a drag handle —\n // an interaction a finger cannot perform on a surface that scrolls. So below\n // md it is what it looks like: a row, full width, in the flow.\n const floating = useIsWide()\n const { barRef, offset, dragging, reset, handlers } = useToolbarOffset(storageKey, movable && floating)\n // No celular a barra sobe para a faixa da página, ao lado do nome da tela.\n // Como faixa própria ela gastava uma linha inteira ENTRE o título e o\n // primeiro cartão — a tela dizia \"Relatórios\", e o dado pelo qual alguém\n // abriu a tela começava depois de duas réguas de cromo. O slot já existe (é\n // por onde as abas de módulo entram) e no celular está vazio, porque a busca\n // do meio não é desenhada nesse tamanho.\n // O slot das AÇÕES (grupo da direita da faixa), não o do módulo: aquele\n // divide a barra pela metade com o grupo da direita, então encostar à sua\n // direita punha o controle no meio da tela, colado no título. O da direita\n // é o que tem a borda da tela como referência.\n const actionsSlot = useModuleHeaderActionsSlot()\n const moduleSlot = useModuleHeaderSlot()\n const headerSlot = actionsSlot ?? moduleSlot\n const [openOnPhone, setOpenOnPhone] = React.useState(false)\n const scrim = useScrim(openOnPhone)\n const panelSurface = React.useMemo<ToolbarSurfaceValue>(\n () => ({ surface: 'panel', close: () => setOpenOnPhone(false) }),\n [],\n )\n if (!range && !filters && !chips && !customize && !actions && !onRefresh) return null\n\n // `withChips` porque no celular as pastilhas sobem para o header (é o estado\n // aplicado, tem de ficar à vista) e repeti-las dentro do painel seria a mesma\n // informação duas vezes na mesma tela.\n const controlsFor = ({ withChips, withRefresh = true }: { withChips: boolean; withRefresh?: boolean }) => (\n <>\n {range}\n {filters}\n {withChips ? chips : null}\n {customize}\n {actions}\n {withRefresh && onRefresh ? (\n <Button\n variant=\"ghost\" size=\"sm\" onClick={onRefresh}\n aria-label={refreshLabel}\n className=\"w-[26px] shrink-0 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-transparent hover:text-foreground\"\n >\n <RefreshCw className=\"h-3 w-3\" />\n </Button>\n ) : null}\n </>\n )\n\n // Um GATILHO no header, não os controles inteiros. Num telefone de 375px o\n // nome da tela e quatro controles não dividem a mesma linha de 56px: tentar\n // cortava o período no meio (\"Últimos 30…\") e empurrava filtros e recarregar\n // para fora da tela, onde deixam de existir. Rolagem horizontal não salva —\n // esconde num gesto que ninguém adivinha que existe.\n //\n // Fechado, a faixa não gasta linha nenhuma, que era o ponto. Aberto, ela\n // aparece onde sempre esteve, inteira e legível.\n if (!floating && headerSlot) {\n return (\n <>\n {scrim.mounted && typeof document !== 'undefined' && createPortal(\n // O MESMO escurecer do FAB (ver useScrim em page-actions): enquanto o\n // painel está aberto ele é a única coisa a responder, e a página atrás\n // continuava lendo como um lugar onde ainda dava para tocar.\n <div\n aria-hidden\n onClick={() => setOpenOnPhone(false)}\n className={cn(\n 'fixed inset-0 z-[100] bg-foreground/40 transition-opacity duration-200 md:hidden',\n 'motion-reduce:transition-none',\n scrim.visible ? 'opacity-100' : 'opacity-0',\n )}\n />,\n document.body,\n )}\n {createPortal(\n // `w-full justify-end`: o slot do header é um flex de largura livre,\n // então `ml-auto` sozinho encostava o botão no TÍTULO, não na borda\n // da tela. Esticar o contêiner é o que dá uma direita para encostar.\n <div className=\"flex w-full min-w-0 items-center justify-end gap-1\">\n {/* O que está aplicado AGORA, visível sem abrir nada — é a razão de\n a tela mostrar estes números e não outros. */}\n {chips ? (\n <div className=\"scrollbar-none flex min-w-0 items-center gap-1 overflow-x-auto\">\n {chips}\n </div>\n ) : null}\n <Popover open={openOnPhone} onOpenChange={setOpenOnPhone}>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-label={openOnPhone ? 'Fechar filtros' : (filtersTitle ?? 'Filtros')}\n // Acima do escurecer: o próprio gatilho é o que fecha, e\n // apagar a saída é a única coisa que o escurecer não pode fazer.\n className={cn(\n 'h-8 w-8 shrink-0 p-0 text-muted-foreground hover:text-foreground',\n openOnPhone && 'z-[105]',\n )}\n >\n {openOnPhone ? <X className=\"h-4 w-4\" /> : <SlidersHorizontal className=\"h-4 w-4\" />}\n </Button>\n </PopoverTrigger>\n {/* Popover e não DropdownMenu: o painel tem um campo de busca, e\n o typeahead do menu do Radix engole o que se digita nele.\n Ancorado no gatilho como o menu do FAB, e largo o bastante\n para os filtros virem ABERTOS em vez de atrás de outra camada. */}\n <PopoverContent\n align=\"end\"\n sideOffset={8}\n className=\"z-[101] flex max-h-[70vh] w-[min(22rem,calc(100vw-1.5rem))] flex-col gap-3 overflow-y-auto p-3 md:hidden\"\n >\n <ToolbarSurfaceContext.Provider value={panelSurface}>\n {controlsFor({ withChips: false, withRefresh: false })}\n </ToolbarSurfaceContext.Provider>\n </PopoverContent>\n </Popover>\n </div>,\n headerSlot,\n )}\n </>\n )\n }\n\n return (\n // Caixa de altura ZERO: a barra flutua sobre os cartões em vez de abrir uma\n // linha só para ela. Ocupando espaço, ela empurrava a grade inteira para\n // baixo para hospedar controles que a maioria das visitas nem toca — e\n // \"flutuante\" que reserva o próprio lugar não está flutuando.\n //\n // Zero + sticky, não `absolute`: absoluto não gruda, e a pergunta que a\n // página responde tem de continuar à mão depois de vinte cartões de rolagem.\n // `pointer-events-none` na caixa para que a faixa vazia dos lados não coma o\n // clique do cartão embaixo.\n <div\n // Uma barra de controle não vai para o papel, e `no-print` vindo por\n // `className` não chega até aqui. `data-print=\"hide\"` é incondicional de\n // propósito: não existe impressão em que o seletor de período impresso\n // ajude quem segura a folha.\n data-print=\"hide\"\n className={cn(\n 'z-20 flex',\n // `items-start` não é enfeite: num flex de altura 0, o alinhamento\n // padrão (stretch) achata o filho para 0px — a barra some e só os\n // botões transbordam, sem vidro nenhum atrás.\n floating ? 'pointer-events-none h-0 items-start justify-end' : 'w-full',\n sticky && 'sticky top-0',\n )}\n >\n <div\n ref={barRef}\n // Transform, não `top/left`: um deslocamento composto não tira a barra\n // do fluxo nem briga com o `sticky` do pai — ele desloca o que o sticky\n // já posicionou.\n style={floating && (offset.x || offset.y) ? { transform: `translate3d(${offset.x}px, ${offset.y}px, 0)` } : undefined}\n className={cn(\n 'flex max-w-full flex-wrap items-center gap-2',\n floating\n // O mesmo vidro do assistente (fayz-floating-surface, em styles.css):\n // é a outra coisa que flutua sobre a página, e as duas se diziam\n // flutuantes em materiais diferentes. Fill fino + blur pesado, para a\n // grade passar por baixo sem competir.\n ? 'fayz-floating-surface pointer-events-auto justify-end rounded-2xl px-2 py-1.5'\n // No celular é uma faixa da página: opaca, porque agora ela ROLA com\n // o conteúdo em vez de flutuar sobre ele, e uma faixa translúcida\n // grudada no topo deixa o texto passar por baixo dela.\n : 'w-full justify-start border-b border-border bg-background px-3 py-2',\n dragging && 'select-none',\n className,\n )}\n >\n {movable && floating ? (\n <button\n type=\"button\"\n aria-label={moveLabel ?? 'Mover a barra'}\n title={moveLabel ?? 'Mover a barra'}\n // `touch-none` para o arrasto não virar rolagem no celular; o\n // duplo clique devolve a barra ao canto de origem, que é a saída\n // para quem a largou num lugar ruim.\n onDoubleClick={reset}\n {...handlers}\n className={cn(\n 'flex h-[26px] w-4 shrink-0 touch-none items-center justify-center rounded-md text-muted-foreground/50',\n 'transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n dragging ? 'cursor-grabbing text-foreground' : 'cursor-grab',\n )}\n >\n <GripVertical className=\"h-3.5 w-3.5\" />\n </button>\n ) : null}\n {controlsFor({ withChips: true })}\n </div>\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/primitives/card.tsx","../src/primitives/dropdown.tsx","../src/primitives/checkbox.tsx","../src/primitives/data-table.tsx","../src/primitives/tooltip.tsx","../src/hooks/useIsWide.ts","../src/primitives/hint.tsx","../src/primitives/page-actions.tsx","../src/primitives/skeleton.tsx","../src/primitives/popover.tsx","../src/primitives/page-toolbar.tsx"],"names":["React","React2","jsx","React3","Check","React4","jsxs","_","React5","React6","React7","Hint","TooltipPrimitive2","React8","React9","ToolbarButton","ChevronDown","ToolbarAction","Fragment","createPortal"],"mappings":";;;;;;;;;;;;AAIA,IAAM,IAAA,GAAaA,mBAGjB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,+EAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAA,CAAK,WAAA,GAAc,MAAA;AAEnB,IAAM,UAAA,GAAmBA,mBAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,SAAA,GAAkBA,mBAGtB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,IAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,oDAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,SAAA,CAAU,WAAA,GAAc,WAAA;AAExB,IAAM,eAAA,GAAwBA,mBAG5B,C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AAA,EAAU,aAAA,EAAc;AAAA;AAAA,eACxC,GACE,IAAA;AAAA,cACH,WAAA,CAAY,EAAE,SAAA,EAAW,IAAA,EAAM;AAAA;AAAA;AAAA;AAClC;AAAA;AACF;AAEJ","file":"chunk-STWAQCYV.js","sourcesContent":["import * as React from 'react'\n\nimport { cn } from '../lib/cn'\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'fayz-glass-surface rounded-card border bg-card text-card-foreground shadow-sm',\n className\n )}\n {...props}\n />\n))\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col space-y-1 p-4', className)}\n {...props}\n />\n))\nCardHeader.displayName = 'CardHeader'\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n 'text-sm font-semibold leading-tight tracking-tight',\n className\n )}\n {...props}\n />\n))\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-xs text-muted-foreground', className)}\n {...props}\n />\n))\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('p-4 pt-0', className)} {...props} />\n))\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex items-center p-4 pt-0', className)}\n {...props}\n />\n))\nCardFooter.displayName = 'CardFooter'\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n","import * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-react'\n\nimport { cn } from '../lib/cn'\n\nconst Dropdown = DropdownMenuPrimitive.Root\n\nconst DropdownTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownGroup = DropdownMenuPrimitive.Group\n\nconst DropdownPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownSub = DropdownMenuPrimitive.Sub\n\nconst DropdownRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-button px-2 py-1.5 text-sm outline-none focus:bg-muted data-[state=open]:bg-muted',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n // Portaled, like DropdownContent. Without it the submenu renders inside the\n // parent panel's DOM — and that panel is `overflow-hidden`, so the submenu\n // was clipped to its box: a flyout you could open and never reach.\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'fayz-glass-surface z-[110] 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',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[110] 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',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button px-2 py-1.5 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-button py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n))\nDropdownSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n )\n}\nDropdownShortcut.displayName = 'DropdownShortcut'\n\nexport {\n Dropdown,\n DropdownTrigger,\n DropdownContent,\n DropdownItem,\n DropdownCheckboxItem,\n DropdownRadioItem,\n DropdownLabel,\n DropdownSeparator,\n DropdownShortcut,\n DropdownGroup,\n DropdownPortal,\n DropdownSub,\n DropdownSubContent,\n DropdownSubTrigger,\n DropdownRadioGroup,\n}\n","import * as React from 'react'\nimport { Check, Minus } from 'lucide-react'\nimport { cn } from '../lib/cn'\n\ntype CheckboxColor = 'primary' | 'success' | 'warning' | 'destructive'\n\ninterface CheckboxProps {\n checked?: boolean\n onChange?: (checked: boolean) => void\n disabled?: boolean\n className?: string\n color?: CheckboxColor\n id?: string\n /** Some but not all of what this box stands for is checked (a table header\n * over a partly selected page). Painted filled with a dash, and announced as\n * \"mixed\" — an empty box would claim nothing is selected. */\n indeterminate?: boolean\n /** -1 keeps it out of the tab order, for a box that only PAINTS the state of\n * a row that is itself the control. */\n tabIndex?: number\n 'aria-label'?: string\n 'data-testid'?: string\n}\n\nconst COLOR_CLASSES: Record<CheckboxColor, string> = {\n primary: 'border-primary bg-primary text-primary-foreground',\n success: 'border-success bg-success text-white dark:border-success dark:bg-success',\n warning: 'border-warning bg-warning text-white',\n destructive: 'border-destructive bg-destructive text-destructive-foreground',\n}\n\nconst Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n ({ checked = false, onChange, disabled, className, color = 'primary', id, indeterminate = false, ...props }, ref) => {\n const filled = checked || indeterminate\n return (\n <button\n ref={ref}\n id={id}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : checked}\n disabled={disabled}\n onClick={() => onChange?.(!checked)}\n className={cn(\n 'peer inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border-2 transition-all duration-150',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n filled\n ? `${COLOR_CLASSES[color]} shadow-sm`\n : 'border-muted-foreground/40 bg-background hover:border-muted-foreground/60',\n className,\n )}\n {...props}\n >\n {indeterminate\n ? <Minus className=\"h-3.5 w-3.5\" strokeWidth={3} />\n : checked && <Check className=\"h-3.5 w-3.5\" strokeWidth={3} />}\n </button>\n )\n },\n)\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxColor, CheckboxProps }\n","import * as React from 'react'\nimport {\n type ColumnDef,\n type SortingState,\n flexRender,\n getCoreRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table'\nimport { ArrowUpDown, ArrowUp, ArrowDown } from 'lucide-react'\nimport { useTranslation } from '@fayz-ai/core'\n\nimport { cn } from '../lib/cn'\nimport { Checkbox } from './checkbox'\n\ninterface DataTableProps<TData, TValue> {\n columns: ColumnDef<TData, TValue>[]\n data: TData[]\n loading?: boolean\n skeletonRows?: number\n emptyMessage?: React.ReactNode\n onRowClick?: (row: TData) => void\n /** Visual variant: 'card' (white bg, card wrapper — default), 'flat'\n * (transparent bg, still bordered), or 'bare' — no wrapper chrome at all,\n * for a table already inside a card that owns the border and radius. */\n variant?: 'card' | 'flat' | 'bare'\n /** Compact mode: smaller padding and font size */\n compact?: boolean\n /**\n * Qual coluna está ordenada e para que lado, quando quem ordena é OUTRO\n * controle (o menu \"Ordenar\" da barra de ferramentas).\n *\n * Marca o cabeçalho sem torná-lo clicável: com a ordenação fora da tabela,\n * a seta é INFORMAÇÃO (\"está ordenado por isto, assim\"), não um botão. Sem\n * ela, mudar a ordem por um menu que fecha em seguida não deixava rastro\n * nenhum na tela.\n */\n sortIndicator?: { columnId: string; dir: 'asc' | 'desc' }\n /**\n * Turns on the checkbox column on the left. Selection is CONTROLLED by ids:\n * what a bulk action needs is \"which records\", and the table's own row indexes\n * stop meaning that the moment the list refetches, sorts or pages.\n */\n selectable?: boolean\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Row identity for selection. Defaults to `row.id`. */\n getRowId?: (row: TData) => string\n}\n\nfunction DataTable<TData, TValue>({\n columns,\n data,\n loading = false,\n skeletonRows = 3,\n emptyMessage = 'No results.',\n onRowClick,\n variant = 'card',\n compact = false,\n sortIndicator,\n selectable = false,\n selectedIds,\n onSelectedIdsChange,\n getRowId,\n}: DataTableProps<TData, TValue>) {\n const t = useTranslation()\n const isCard = variant === 'card'\n // Rounded box and scroll container must be SEPARATE elements: a scroll\n // container paints its content over its own border-radius, which squared\n // the corners the moment a row background met them.\n const wrapperCls = isCard\n ? 'overflow-hidden rounded-card border bg-card shadow-sm'\n : variant === 'bare'\n ? ''\n : 'overflow-hidden rounded-lg border'\n // 'bare' sits below something else inside its parent card (a search/tools\n // toolbar), so its header is a mid-card band: no rounding, and it keeps the\n // card's own surface rather than starting a new tinted block.\n const headerCls = isCard\n ? 'border-b bg-muted/50'\n : variant === 'bare'\n ? 'border-b bg-muted/30 rounded-none'\n : 'border-b bg-muted/30'\n 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'\n const tdCls = compact ? 'px-3 py-1.5 align-middle text-xs' : 'px-4 py-3 align-middle'\n const tableCls = compact ? 'w-full text-xs min-w-max' : 'w-full text-sm min-w-max'\n const rowHoverCls = isCard ? 'hover:bg-muted/30' : 'hover:bg-muted/20'\n const [sorting, setSorting] = React.useState<SortingState>([])\n\n const rowId = React.useCallback(\n (row: TData) => (getRowId ? getRowId(row) : String((row as { id?: unknown }).id ?? '')),\n [getRowId],\n )\n const selected = React.useMemo(() => new Set(selectedIds ?? []), [selectedIds])\n const pageIds = React.useMemo(() => data.map(rowId), [data, rowId])\n const selectedOnPage = pageIds.filter((id) => selected.has(id)).length\n const allOnPageSelected = pageIds.length > 0 && selectedOnPage === pageIds.length\n\n const toggleRow = React.useCallback((id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }, [selected, onSelectedIdsChange])\n // The header box acts on THIS page only — it must not silently drop a\n // selection made on another page, nor claim to have selected rows that were\n // never loaded.\n const toggleAllOnPage = React.useCallback(() => {\n const next = new Set(selected)\n if (allOnPageSelected) pageIds.forEach((id) => next.delete(id))\n else pageIds.forEach((id) => next.add(id))\n onSelectedIdsChange?.([...next])\n }, [selected, allOnPageSelected, pageIds, onSelectedIdsChange])\n\n // Built here rather than asked of every caller: the column is pure chrome, and\n // a hand-rolled copy per list is where the checkbox column drifts.\n const selectionColumn = React.useMemo<ColumnDef<TData, TValue>>(() => ({\n id: '__select__',\n enableSorting: false,\n header: () => (\n <Checkbox\n checked={allOnPageSelected}\n indeterminate={selectedOnPage > 0 && !allOnPageSelected}\n onChange={toggleAllOnPage}\n aria-label={t('crud.list.selectAllRows')}\n />\n ),\n cell: ({ row }) => {\n const id = rowId(row.original)\n return (\n <Checkbox\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n aria-label={t('crud.list.selectRow')}\n />\n )\n },\n // `toggleAllOnPage` is in the deps because it closes over the CURRENT page's\n // ids: turning the page with nothing selected changes no other dep, and the\n // memo would hand the header a button that ticks the previous page's rows.\n }), [allOnPageSelected, selectedOnPage, selected, rowId, toggleRow, toggleAllOnPage, t])\n\n const allColumns = React.useMemo(\n () => (selectable ? [selectionColumn, ...columns] : columns),\n [selectable, selectionColumn, columns],\n )\n\n const table = useReactTable({\n data,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n onSortingChange: setSorting,\n state: { sorting },\n })\n\n if (loading) {\n return (\n <div className={wrapperCls}>\n <div className=\"overflow-x-auto\">\n <table className={tableCls}>\n <thead>\n <tr className={headerCls}>\n {allColumns.map((_, i) => (\n <th key={i} className={thCls}>\n <div className=\"h-3.5 w-20 animate-pulse rounded bg-muted\" />\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: skeletonRows }).map((_, i) => (\n <tr key={i} className=\"border-b last:border-0\">\n {allColumns.map((_, j) => (\n <td key={j} className={tdCls}>\n <div className=\"h-3.5 w-full animate-pulse rounded bg-muted\" />\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n )\n }\n\n // Uma tabela VAZIA não tem colunas para percorrer, e mantê-la só para\n // hospedar o aviso punha o aviso dentro de um scroller mais largo que a tela:\n // `colSpan` centraliza no meio da TABELA, não no meio do celular, e o \"Crie\n // sua primeira fatura\" nascia cortado, alcançável só arrastando de lado.\n // Sem linhas, o cabeçalho também não informa nada acionável — ele descreve\n // colunas que não existem ainda. Some a tabela, some o scroll, e o aviso\n // ocupa a largura visível, que é onde ele deveria estar desde o começo.\n const showEmptyBlock = !loading && table.getRowModel().rows.length === 0\n if (showEmptyBlock) {\n return (\n <div className={wrapperCls}>\n <div className=\"flex min-h-64 w-full items-center justify-center px-4 py-10 text-center text-muted-foreground\">\n {emptyMessage}\n </div>\n </div>\n )\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"overflow-x-auto\">\n <table className={tableCls}>\n <thead>\n {table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id} className={headerCls}>\n {headerGroup.headers.map((header) => {\n const sorted = header.column.getIsSorted()\n return (\n <th\n key={header.id}\n className={cn(thCls, header.column.id === '__select__' && 'w-10 pr-0')}\n >\n {header.isPlaceholder ? null : sortIndicator?.columnId === header.column.id ? (\n <span className=\"inline-flex items-center gap-1 text-foreground\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n {sortIndicator.dir === 'desc'\n ? <ArrowDown className=\"h-3 w-3\" />\n : <ArrowUp className=\"h-3 w-3\" />}\n </span>\n ) : header.column.getCanSort() ? (\n <button\n className=\"flex items-center gap-1 hover:text-foreground transition-colors\"\n onClick={header.column.getToggleSortingHandler()}\n >\n {flexRender(header.column.columnDef.header, header.getContext())}\n {sorted === 'asc' ? (\n <ArrowUp className=\"h-3 w-3\" />\n ) : sorted === 'desc' ? (\n <ArrowDown className=\"h-3 w-3\" />\n ) : (\n <ArrowUpDown className=\"h-3 w-3 opacity-40\" />\n )}\n </button>\n ) : (\n flexRender(header.column.columnDef.header, header.getContext())\n )}\n </th>\n )\n })}\n </tr>\n ))}\n </thead>\n <tbody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => {\n const isSelected = selectable && selected.has(rowId(row.original))\n return (\n <tr\n key={row.id}\n className={cn(\n `border-b last:border-0 transition-colors ${rowHoverCls}`,\n onRowClick && 'cursor-pointer',\n isSelected && 'bg-muted/40',\n )}\n onClick={() => onRowClick?.(row.original)}\n data-selected={isSelected || undefined}\n >\n {row.getVisibleCells().map((cell) => {\n const isSelectCell = cell.column.id === '__select__'\n return (\n <td\n key={cell.id}\n className={cn(tdCls, isSelectCell && 'w-10 pr-0')}\n // Ticking a box is not opening the record: without this\n // the row's own click handler fired underneath and the\n // list navigated away from the selection just made.\n onClick={isSelectCell ? (e) => e.stopPropagation() : undefined}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </td>\n )\n })}\n </tr>\n )\n })\n ) : (\n <tr>\n {/* Height, not just padding: an empty table that collapses to one\n thin row reads as a rendering glitch rather than \"nothing\n here yet\". `emptyMessage` takes a node so callers can hand in\n a full empty state (icon, headline, create action). */}\n <td colSpan={allColumns.length} className=\"h-64 px-6 text-center align-middle text-muted-foreground\">\n {emptyMessage}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n </div>\n )\n}\n\nexport { DataTable, type DataTableProps }\n","import * as React from 'react'\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\n\nimport { cn } from '../lib/cn'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[120] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from 'react'\n\n/** The one breakpoint the shell actually branches on. */\nexport const WIDE_QUERY = '(min-width: 768px)'\n\n/**\n * Real width, not CSS.\n *\n * Some decisions cannot be made with a `md:hidden`: hiding is not unmounting,\n * and no portal respects `display: none` — two mounted copies of a page send\n * TWO sets of buttons to the shell's header bar, and the action appears twice.\n * `matchMedia` already answers correctly on the first render, so choosing here\n * does not flash.\n *\n * Prefer a CSS breakpoint when the choice is only about what is visible. Reach\n * for this when the choice changes what exists, or what a component decides.\n */\nexport function useIsWide(query: string = WIDE_QUERY): boolean {\n const [wide, setWide] = React.useState(\n () => (typeof window === 'undefined' ? true : window.matchMedia(query).matches),\n )\n React.useEffect(() => {\n const mq = window.matchMedia(query)\n const onChange = () => setWide(mq.matches)\n mq.addEventListener('change', onChange)\n return () => mq.removeEventListener('change', onChange)\n }, [query])\n return wide\n}\n","import * as React from 'react'\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'\n\nexport interface HintProps extends React.HTMLAttributes<HTMLElement> {\n /** The tip. Nothing renders when this is empty. */\n label?: React.ReactNode\n children: React.ReactElement\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Milliseconds before it opens. 0 — an icon button gives no other clue what\n * it does, so waiting 700ms to find out is the wrong trade. */\n delayDuration?: number\n}\n\n/**\n * A styled tooltip for any control that would otherwise rely on the browser's\n * native `title` attribute.\n *\n * `title=` looks like a tooltip until you use one: it appears after a ~1s\n * delay you cannot change, in the OS's own styling, never on touch, and it is\n * skipped by several screen readers. This renders the design-system tooltip\n * instead, and — because the trigger keeps its own `aria-describedby` — the\n * text is announced rather than merely drawn.\n *\n * Self-contained on purpose: it mounts its own Provider so a caller can drop a\n * Hint anywhere without first knowing whether some ancestor set one up.\n */\nexport const Hint = React.forwardRef<HTMLElement, HintProps>(function Hint(\n { label, children, side = 'top', delayDuration = 0, ...rest },\n ref,\n) {\n // `rest` + ref repassados ao filho porque um Hint costuma envolver o gatilho\n // de OUTRA coisa — `<DropdownTrigger asChild><Hint><button/></Hint>`. Sem\n // isso o Hint engolia os handlers do dropdown e o botão virava enfeite: o\n // menu de ordenar simplesmente não abria.\n if (!label) return React.cloneElement(children, { ...rest, ref } as never)\n return (\n <TooltipPrimitive.Provider delayDuration={delayDuration}>\n <Tooltip>\n <TooltipTrigger asChild {...rest} ref={ref as never}>{children}</TooltipTrigger>\n <TooltipContent side={side} className=\"px-2 py-1 text-xs font-medium\">\n {label}\n </TooltipContent>\n </Tooltip>\n </TooltipPrimitive.Provider>\n )\n})\n","import * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { ChevronDown, MoreHorizontal, MoreVertical, Plus } from 'lucide-react'\n\nimport { cn } from '../lib/cn'\nimport { useIsWide } from '../hooks/useIsWide'\nimport { Button } from './button'\nimport { Dropdown, DropdownContent, DropdownItem, DropdownSeparator, DropdownTrigger } from './dropdown'\nimport { Hint } from './hint'\n\n// ---------------------------------------------------------------------------\n// What a screen can DO, declared rather than drawn.\n//\n// The header slot was only ever a portal: it imposed no button, variant, size,\n// order or collapse rule, so every screen invented its own and the same control\n// ended up with five treatments — solid, outline, ghost, icon-sized, and three\n// raw <button>s with the primary classes copied by hand.\n//\n// A screen now says what its actions ARE and this decides how they look. It is\n// the same trade the bottom nav makes: declare intent, let one renderer own\n// presentation, and a second presentation (a phone) costs nothing extra.\n//\n// The complement is PageToolbar, and the line between them holds: this carries\n// what you DO on a screen, that carries what the screen SHOWS. A period picker\n// is not an action.\n// ---------------------------------------------------------------------------\n\nexport type PageActionIntent = 'primary' | 'secondary' | 'utility' | 'danger'\n\nexport interface PageActionItem {\n id: string\n /** Already translated. The point of the type is that nothing hardcodes here. */\n label: string\n icon?: React.ComponentType<{ className?: string }>\n /**\n * - `primary` the one thing the screen is for. At most one; extras demote.\n * - `secondary` other ways to do it (import, from AI) — folded under primary.\n * - `utility` settings, export, refresh. Icon-only beside the primary.\n * - `danger` destructive. Never inline; always behind the overflow.\n */\n intent?: PageActionIntent\n onSelect: () => void | Promise<void>\n disabled?: boolean\n /** Set by whoever resolves permissions — this renderer has no access engine. */\n hidden?: boolean\n /** Long-form line under the label when the action opens in a menu. */\n description?: string\n /** Kept so converting a hand-written button does not silently drop its hook. */\n testId?: string\n /**\n * This action makes a NEW record. It decides the FAB's face: \"+\" on a screen\n * you add to, \"⋮\" on a record you act upon. Not derivable from the icon —\n * \"Novo produto\" carries a Package, not a plus — and not from the screen\n * either, since a settings tab has a back crumb and still adds. Defaults to\n * the icon being a plus, which covers the plainly-named cases.\n */\n creates?: boolean\n /**\n * Offered on a pointer device only. Some actions cannot be FINISHED on a\n * phone — picking a CSV off a filesystem and mapping its columns is the\n * clearest case — and a menu entry that leads nowhere is worse than one that\n * is absent. Not about screen width: about whether the job can be done.\n */\n desktopOnly?: boolean\n}\n\nfunction iconOf(action: PageActionItem, className: string) {\n const Icon = action.icon\n return Icon ? <Icon className={className} /> : null\n}\n\n/**\n * Renders a declared action set.\n *\n * One primary survives: a screen with three equal buttons is a screen with no\n * obvious next step, and on a phone it simply overflows the header. Anything\n * after the first primary is treated as secondary.\n */\nexport function PageActionBar({ actions, className }: { actions: PageActionItem[]; className?: string }) {\n const wide = useIsWide()\n const visible = actions.filter((a) => !a.hidden)\n if (visible.length === 0) return null\n\n // A phone header has room for a title and not much else, and its top-right is\n // the furthest point from a thumb. The actions move to the corner the thumb\n // owns instead — the same set, a different place to reach it.\n if (!wide) {\n const usable = visible.filter((a) => !a.desktopOnly)\n return usable.length > 0 ? <PageActionFab actions={usable} /> : null\n }\n\n let seenPrimary = false\n const primary: PageActionItem[] = []\n const secondary: PageActionItem[] = []\n const utility: PageActionItem[] = []\n const danger: PageActionItem[] = []\n\n for (const a of visible) {\n const intent = a.intent ?? 'secondary'\n if (intent === 'primary' && !seenPrimary) { seenPrimary = true; primary.push(a); continue }\n if (intent === 'danger') { danger.push(a); continue }\n if (intent === 'utility') { utility.push(a); continue }\n secondary.push(a)\n }\n\n const head = primary[0]\n const menu = [...secondary, ...danger]\n\n return (\n <div className={cn('flex shrink-0 items-center gap-2', className)}>\n {/* Utilities read as chrome, so they sit before the thing you came to do. */}\n {utility.map((a) => (\n // Um botão só de ícone não diz o que faz. `title=` parecia resolver e\n // não resolve: espera ~1s que ninguém controla, sai na pintura do\n // sistema operacional, nunca aparece no toque e vários leitores de tela\n // pulam. Hint é o tooltip do design system, e o texto é ANUNCIADO.\n <Hint key={a.id} label={a.label}>\n <Button\n // `ghost`, não `outline`: um utilitário é cromo, e uma caixa em\n // volta dele pede a mesma atenção que a ação pela qual a tela\n // existe — duas molduras lado a lado e nenhuma hierarquia. Sem\n // contorno em repouso, o ícone só ganha superfície no hover, que é\n // quando alguém já está mirando nele.\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => void a.onSelect()}\n disabled={a.disabled}\n aria-label={a.label}\n data-testid={a.testId}\n data-tour={`action.${a.id}`}\n >\n {iconOf(a, 'h-4 w-4')}\n </Button>\n </Hint>\n ))}\n\n {head && menu.length === 0 && (\n <Button onClick={() => void head.onSelect()} disabled={head.disabled} data-testid={head.testId} data-tour={`action.${head.id}`}>\n {iconOf(head, 'mr-1.5 h-4 w-4')}\n {head.label}\n </Button>\n )}\n\n {/* Primary plus alternatives: one button, one caret. Two buttons of equal\n weight is the thing that made these headers unreadable. */}\n {head && menu.length > 0 && (\n <div className=\"flex items-center\">\n <Button className=\"rounded-r-none\" onClick={() => void head.onSelect()} disabled={head.disabled} data-testid={head.testId} data-tour={`action.${head.id}`}>\n {iconOf(head, 'mr-1.5 h-4 w-4')}\n {head.label}\n </Button>\n <Dropdown>\n <DropdownTrigger asChild>\n <Hint label={`${head.label}…`}>\n <Button\n className=\"-ml-px rounded-l-none px-2\"\n aria-label={`${head.label}…`}\n // Anchors for the actions FOLDED behind this caret resolve to\n // the caret itself: pointing at a menu item nobody has opened\n // would spotlight an element that is not on screen.\n data-tour={menu.map((a) => `action.${a.id}`).join(' ')}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </Button>\n </Hint>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n <ActionItems actions={menu} />\n </DropdownContent>\n </Dropdown>\n </div>\n )}\n\n {/* No primary, but things to offer: a plain overflow rather than promoting\n something the screen did not call primary. */}\n {!head && menu.length > 0 && (\n <Dropdown>\n <DropdownTrigger asChild>\n <Hint label=\"Ações\">\n <Button variant=\"outline\" size=\"icon\" aria-label=\"Ações\">\n <MoreHorizontal className=\"h-4 w-4\" />\n </Button>\n </Hint>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n <ActionItems actions={menu} />\n </DropdownContent>\n </Dropdown>\n )}\n </div>\n )\n}\n\nfunction ActionItems({ actions, stagger }: { actions: PageActionItem[]; stagger?: boolean }) {\n const out: React.ReactNode[] = []\n actions.forEach((a, i) => {\n const isDanger = a.intent === 'danger'\n const prevSafe = i > 0 && actions[i - 1].intent !== 'danger'\n if (isDanger && prevSafe) out.push(<DropdownSeparator key={`${a.id}-sep`} />)\n out.push(\n <DropdownItem\n key={a.id}\n disabled={a.disabled}\n onSelect={() => void a.onSelect()}\n data-testid={a.testId}\n style={stagger ? ({ ['--i' as string]: i } as React.CSSProperties) : undefined}\n className={cn('gap-2', stagger && 'fz-fab-item', isDanger && 'text-destructive focus:text-destructive')}\n >\n {iconOf(a, 'h-4 w-4 shrink-0')}\n <span className=\"min-w-0\">\n <span className=\"block truncate\">{a.label}</span>\n {a.description && (\n <span className=\"block truncate text-xs text-muted-foreground\">{a.description}</span>\n )}\n </span>\n </DropdownItem>,\n )\n })\n return <>{out}</>\n}\n\n/**\n * The phone presentation: one button in the thumb's corner.\n *\n * It rides on `--fz-bottom-bar`, so it sits above the tab bar where there is\n * one and drops to the screen edge on the screens where the bar retracts —\n * without knowing anything about either.\n *\n * A single action is performed by the tap. Opening a menu to offer one choice\n * is a question with one answer.\n */\nfunction PageActionFab({ actions }: { actions: PageActionItem[] }) {\n const byIntent = (i: PageActionIntent) => actions.filter((a) => (a.intent ?? 'secondary') === i)\n\n // Utilities are not the thing you came to do. Folded into the \"+\" they made\n // a create menu whose first entry was \"Configurações\"; they get their own,\n // smaller, neutral circle above it instead — near the thumb, clearly not the\n // primary. Alone on a screen they simply ARE the button.\n const utility = byIntent('utility')\n const main = [...byIntent('primary'), ...byIntent('secondary'), ...byIntent('danger')]\n\n if (main.length === 0) return <FabButton actions={utility} tone=\"neutral\" />\n\n // Its face follows what the whole set is FOR, not what its first entry looks\n // like. A screen whose every action inserts something is a screen you add on\n // — the circle is a \"+\", even when the menu offers three ways in and none of\n // their icons is a plus. One non-inserting action and it is not that screen\n // any more: a record's own actions get the neutral \"⋮\", because painting\n // those brand made every record page look like an invitation to create.\n const isCreate = main.every((a) => a.creates ?? a.icon === Plus)\n return (\n <>\n {utility.length > 0 && <FabButton actions={utility} tone=\"neutral\" mini />}\n <FabButton actions={main} tone={isCreate ? 'primary' : 'neutral'} />\n </>\n )\n}\n\n/**\n * Keeps the scrim mounted through its fade-OUT.\n *\n * Radix animates its own content out with `data-state=closed`; a plain element\n * of ours has no such state, so unmounting on close would cut the dim instantly\n * while the menu was still leaving. Mounted first, painted transparent, then\n * faded in on the next frame — a transition needs two values to run between.\n */\nexport function useScrim(open: boolean): { mounted: boolean; visible: boolean } {\n const [mounted, setMounted] = React.useState(open)\n const [visible, setVisible] = React.useState(open)\n\n React.useEffect(() => {\n if (open) {\n setMounted(true)\n const frame = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(frame)\n }\n setVisible(false)\n const timer = window.setTimeout(() => setMounted(false), SCRIM_MS)\n return () => window.clearTimeout(timer)\n }, [open])\n\n return { mounted, visible }\n}\n\n/** Matches `duration-200` on the scrim. */\nexport const SCRIM_MS = 200\n\n/** One circle: it performs a lone action, or opens the rest upward. */\nfunction FabButton({ actions, tone, mini }: {\n actions: PageActionItem[]\n tone: 'primary' | 'neutral'\n /** Stacked above the main circle, one size down. */\n mini?: boolean\n}) {\n const [open, setOpen] = React.useState(false)\n const scrim = useScrim(open)\n if (actions.length === 0) return null\n\n const isCreate = tone === 'primary'\n const FabIcon = isCreate ? Plus : MoreVertical\n // The mini sits one main circle (3.5rem) plus a gap above the main one, so\n // both move together when the tab bar retracts.\n const style = {\n bottom: mini ? 'calc(var(--fz-bottom-bar, 0px) + 4.75rem)' : 'calc(var(--fz-bottom-bar, 0px) + 1rem)',\n } as React.CSSProperties\n\n const shell = cn(\n 'fz-tap fixed z-40 flex items-center justify-center rounded-full',\n 'transition-transform active:scale-95 md:hidden',\n // Centred on the main circle's column, so the two read as one stack.\n mini ? 'right-5 h-12 w-12' : 'right-4 h-14 w-14',\n isCreate\n // The wide ring is what holds a saturated disc off the content it covers.\n ? 'bg-primary text-primary-foreground shadow-lg shadow-primary/30 ring-4 ring-background'\n // Neutral on purpose: \"⋮\" is not the thing you came to do, and painting\n // it brand made every record page look like it was inviting a create.\n //\n // A hairline, not that wide ring: white circle + 4px of page colour +\n // shadow drew a second disc behind the first, and the pair read as two\n // buttons stacked. And a hairline, not a `border` — a theme may turn any\n // bordered card surface into glass (`.bg-card.border` →\n // fayz-glass-surface), and beauty does; the circle came out see-through\n // with the board scrolling underneath it.\n : 'bg-card text-foreground shadow-lg ring-1 ring-border',\n )\n\n if (actions.length === 1) {\n const only = actions[0]\n const Icon = only.icon ?? FabIcon\n return (\n <button\n type=\"button\"\n style={style}\n className={shell}\n onClick={() => void only.onSelect()}\n disabled={only.disabled}\n aria-label={only.label}\n data-testid={only.testId}\n >\n <Icon className={mini ? 'h-5 w-5' : 'h-6 w-6'} />\n </button>\n )\n }\n\n return (\n <Dropdown open={open} onOpenChange={setOpen}>\n {/* The page dims behind the menu, the way a sheet dims behind itself: on a\n phone the menu is the only thing to answer, and the list of records\n under it kept reading as a place you could still tap. Portalled to the\n body so no ancestor's stacking context can trap it below the menu. */}\n {scrim.mounted && typeof document !== 'undefined' && createPortal(\n <div\n aria-hidden\n onClick={() => setOpen(false)}\n className={cn(\n 'fixed inset-0 z-[100] bg-foreground/40 transition-opacity duration-200 md:hidden',\n 'motion-reduce:transition-none',\n scrim.visible ? 'opacity-100' : 'opacity-0',\n )}\n />,\n document.body,\n )}\n <DropdownTrigger asChild>\n <button\n type=\"button\"\n style={style}\n // Only the \"+\" rotates into an \"×\": a vertical ellipsis spun 135°\n // reads as a glitch, not as \"tap again to close\".\n //\n // Above the scrim while open: the circle is what closes the menu, and\n // dimming the way out is the one thing the dim must not do.\n className={cn(shell, open && 'z-[105]', isCreate && 'fz-fab-trigger')}\n aria-label={actionsMenuLabel}\n >\n <FabIcon className={mini ? 'h-5 w-5' : 'h-6 w-6'} />\n </button>\n </DropdownTrigger>\n {/* Upward, from the button: a menu that opened downward would run straight\n off the bottom of the screen. */}\n <DropdownContent side=\"top\" align=\"end\" sideOffset={12} className=\"fz-fab-menu w-60 md:hidden\">\n <ActionItems actions={actions} stagger />\n </DropdownContent>\n </Dropdown>\n )\n}\n\n/** The FAB's accessible name when it opens a menu. Overridable for locale. */\nexport let actionsMenuLabel = 'Ações'\nexport function setActionsMenuLabel(label: string) { actionsMenuLabel = label }\n","import { cn } from '../lib/cn'\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('animate-pulse rounded-md bg-muted', className)}\n {...props}\n />\n )\n}\n\n/**\n * Skeleton loader that mimics a table with rows and columns.\n * Drop-in replacement for \"Loading...\" text in list views.\n */\nfunction TableSkeleton({ columns = 4, rows = 2 }: { columns?: number; rows?: number }) {\n return (\n <div className=\"rounded-lg border overflow-hidden\">\n <div className=\"border-b bg-muted/30 flex gap-4 px-4 py-2.5\">\n {Array.from({ length: columns }).map((_, i) => (\n <Skeleton key={i} className=\"h-3 flex-1 rounded bg-muted-foreground/10\" />\n ))}\n </div>\n <div className=\"divide-y\">\n {Array.from({ length: rows }).map((_, r) => (\n <div key={r} className=\"flex items-center gap-4 px-4 py-3.5\">\n {Array.from({ length: columns }).map((_, c) => (\n <Skeleton\n key={c}\n className={cn(\n 'h-3 rounded',\n c === 0 ? 'flex-[2]' : 'flex-1',\n )}\n />\n ))}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport { Skeleton, TableSkeleton }\n","import * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../lib/cn'\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'start', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'fayz-glass-surface z-[110] w-72 rounded-xl border bg-popover p-0 text-popover-foreground shadow-lg outline-none',\n 'data-[state=open]:animate-zoom-in data-[state=closed]:animate-zoom-out',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverAnchor, PopoverContent }\n","import * as React from 'react'\nimport { createPortal } from 'react-dom'\nimport { Calendar, Check, ChevronDown, GripVertical, RefreshCw, SlidersHorizontal, X } from 'lucide-react'\nimport { cn } from '../lib/cn'\nimport { Button } from './button'\nimport { Dropdown, DropdownTrigger, DropdownContent, DropdownItem } from './dropdown'\nimport { useIsWide } from '../hooks/useIsWide'\nimport { useModuleHeaderActionsSlot, useModuleHeaderSlot } from '../layout/AppShell'\nimport { Popover, PopoverTrigger, PopoverContent } from './popover'\nimport { useScrim } from './page-actions'\n\n// ---------------------------------------------------------------------------\n// PageToolbar — a barra flutuante do que a tela está MOSTRANDO.\n//\n// A barra da shell carrega o que se FAZ numa tela (Novo, Importar, Salvar).\n// Esta carrega a pergunta que a tela responde: qual período, quais filtros,\n// quais cartões. Eram duas respostas diferentes para as mesmas três coisas — a\n// faixa de Análises, larga e com cromo próprio, e o \"Customize\" solto do\n// dashboard —, então o mesmo trabalho parecia recurso de produto diferente\n// dependendo da página aberta.\n//\n// Flutuante e à direita de propósito: ela governa a grade ABAIXO dela e fica\n// parada enquanto essa grade rola por baixo (sticky, com borda e sombra, para\n// ler como algo POR CIMA dos cartões e não como uma emenda no layout).\n// ---------------------------------------------------------------------------\n\n/**\n * O gatilho padrão da barra: sem contorno, com o rótulo sublinhado tracejado.\n *\n * Contornados, os três viravam três caixas arredondadas dentro de outra caixa\n * arredondada — a borda do vidro e a dos botões disputavam a mesma leitura, e a\n * barra parecia um grupo de botões e não um controle. O tracejado é o traço\n * clássico de \"este valor se troca\": diz que clica sem desenhar mais um limite.\n */\nexport type ToolbarSurface = 'bar' | 'panel'\n\ninterface ToolbarSurfaceValue {\n surface: ToolbarSurface\n /**\n * Fecha o painel que hospeda este controle.\n *\n * Um controle que TERMINA (\"Aplicar\") não tem como se despedir sozinho: ele\n * só conhece o próprio popover, que no painel nem chega a existir. Sem isto,\n * aplicar deixava o painel aberto por cima do resultado que a pessoa acabou\n * de pedir para ver. No-op na faixa larga, onde cada controle fecha o seu.\n */\n close: () => void\n}\n\nconst ToolbarSurfaceContext = React.createContext<ToolbarSurfaceValue>({\n surface: 'bar',\n close: () => {},\n})\n\nexport function useToolbarSurface(): ToolbarSurface {\n return React.useContext(ToolbarSurfaceContext).surface\n}\n\n/** Fecha o painel do celular. No-op quando o controle está na faixa larga. */\nexport function useToolbarPanelClose(): () => void {\n return React.useContext(ToolbarSurfaceContext).close\n}\n\nexport const ToolbarButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button> & { icon?: React.ElementType; caret?: boolean }\n>(function ToolbarButton({ icon: Icon, caret = true, children, className, ...props }, ref) {\n const panel = useToolbarSurface() === 'panel'\n // No painel cada controle é uma LINHA de ponta a ponta, com contorno, como\n // os campos de data logo acima. Solto e fantasma no meio da coluna ele não\n // tinha limite visível nem largura previsível: três deles centralizados em\n // larguras diferentes leem como três textos, não como três campos. O\n // sublinhado tracejado sai junto — ele diz \"este valor se troca\" numa faixa\n // onde não há caixa; dentro de uma caixa, é um segundo contorno.\n if (panel) {\n return (\n <Button\n ref={ref}\n variant=\"outline\"\n className={cn('h-10 w-full justify-between gap-2 px-3 font-normal', className)}\n {...props}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n <span className=\"truncate\">{children}</span>\n </span>\n {caret ? <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n </Button>\n )\n }\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n // Sem fundo no hover: um retângulo arredondado aparecendo atrás do\n // rótulo desenha, no hover, exatamente o botão que o repouso não tem.\n // O que muda é o texto e o traço — mais firmes, e o tracejado vira\n // contínuo, que é o mesmo \"agora sim, clique\" sem inventar caixa.\n 'group gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none',\n 'hover:bg-transparent hover:text-foreground',\n className,\n )}\n {...props}\n >\n {Icon ? <Icon className=\"h-3 w-3 shrink-0 opacity-70\" /> : null}\n <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\">\n {children}\n </span>\n {caret ? <ChevronDown className=\"h-3 w-3 shrink-0 opacity-60\" /> : null}\n </Button>\n )\n})\n\n/**\n * O gatilho de COMANDO da barra — Exportar, Imprimir, Novo.\n *\n * Mesma matéria do ToolbarButton acima (sem contorno, sem fundo, fantasma) e\n * sem o sublinhado tracejado: o tracejado promete \"este valor se troca\", e\n * imprimir não é um valor. Eram botões contornados no meio de uma barra sem\n * contorno nenhum — duas caixas arredondadas ao lado de três rótulos soltos,\n * que é o desenho que faz a barra parecer duas barras.\n */\nexport const ToolbarAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button> & { icon?: React.ElementType; caret?: boolean }\n>(function ToolbarAction({ icon: Icon, caret = false, children, className, ...props }, ref) {\n const panel = useToolbarSurface() === 'panel'\n // Mesma linha de ponta a ponta, sem seta e com o rótulo CENTRADO: um comando\n // não é um valor em aberto — a seta prometeria outra coisa a escolher, e o\n // alinhamento à esquerda o faria ler como mais um campo da lista acima, que\n // é justamente o que ele não é.\n if (panel) {\n return (\n <Button\n ref={ref}\n variant=\"outline\"\n className={cn('h-10 w-full justify-center gap-2 px-3 font-normal', className)}\n {...props}\n >\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" /> : null}\n <span className=\"truncate\">{children}</span>\n </Button>\n )\n }\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n 'gap-1.5 border-0 bg-transparent px-2 font-medium text-muted-foreground shadow-none',\n 'hover:bg-transparent hover:text-foreground',\n className,\n )}\n {...props}\n >\n {Icon ? <Icon className=\"h-3 w-3 shrink-0 opacity-70\" /> : null}\n {children}\n {caret ? <ChevronDown className=\"h-3 w-3 shrink-0 opacity-60\" /> : null}\n </Button>\n )\n})\n\nexport interface RangeOption {\n value: string\n label: string\n}\n\nexport interface RangeControlProps {\n options: RangeOption[]\n value: string\n onChange: (value: string) => void\n /** Rótulo do gatilho quando não é nenhum dos presets (ex.: \"Personalizado\"). */\n label?: string\n /** \"21 jul – 19 ago\" — a janela que os números realmente cobrem. Um nome de\n * preset sozinho deixa a dúvida se \"este mês\" já inclui hoje. */\n span?: string\n /** Itens extras no fim do menu (ex.: abrir uma janela personalizada). */\n extra?: React.ReactNode\n /** Desenhado ao lado do gatilho (ex.: os dois seletores de data). */\n children?: React.ReactNode\n icon?: React.ElementType\n className?: string\n}\n\n/**\n * O controle de período — um só, para o dashboard e para as análises.\n *\n * Puramente apresentacional: quem tem o estado (o contexto de analytics, o de\n * dashboard) passa opções e valor. Eram dois desenhos para a mesma escolha, um\n * segmentado de 7d/30d/90d e um menu de presets, e trocar de tela trocava a\n * gramática do controle sem trocar o que ele faz.\n */\nexport function RangeControl({\n options, value, onChange, label, span, extra, children, icon = Calendar, className,\n}: RangeControlProps) {\n const current = options.find((o) => o.value === value)\n return (\n <div className={cn('flex items-center gap-1.5', className)}>\n <Dropdown>\n <DropdownTrigger asChild>\n <ToolbarButton icon={icon}>\n {label ?? current?.label ?? value}\n {span ? <span className=\"font-normal text-muted-foreground\">{span}</span> : null}\n </ToolbarButton>\n </DropdownTrigger>\n <DropdownContent align=\"end\" className=\"w-56\">\n {options.map((o) => (\n <DropdownItem key={o.value} onSelect={() => onChange(o.value)}>\n {o.label}\n {o.value === value ? <Check className=\"ml-auto h-3.5 w-3.5 shrink-0 pl-1\" /> : null}\n </DropdownItem>\n ))}\n {extra}\n </DropdownContent>\n </Dropdown>\n {children}\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Onde a barra mora.\n//\n// Ela flutua sobre a grade, e \"sobre a grade\" às vezes quer dizer \"em cima do\n// título do terceiro cartão\". Em vez de escolher por todo mundo um canto que\n// nunca atrapalhe — não existe —, a barra ganha uma alça e o usuário resolve.\n//\n// UMA posição para todas as telas, por omissão: \"onde fica a barra flutuante\" é\n// uma preferência, não sete. Uma superfície que precise da sua passa `storageKey`.\n// ---------------------------------------------------------------------------\n\ninterface ToolbarOffset { x: number; y: number }\n\nconst OFFSET_KEY = (scope: string) => `fayz.toolbar.offset.${scope}`\nconst EDGE = 8\n\nfunction readOffset(key: string): ToolbarOffset {\n if (typeof window === 'undefined') return { x: 0, y: 0 }\n try {\n const raw = window.localStorage.getItem(key)\n if (!raw) return { x: 0, y: 0 }\n const parsed = JSON.parse(raw) as Partial<ToolbarOffset>\n return {\n x: Number.isFinite(parsed.x) ? Number(parsed.x) : 0,\n y: Number.isFinite(parsed.y) ? Number(parsed.y) : 0,\n }\n } catch {\n return { x: 0, y: 0 }\n }\n}\n\nfunction writeOffset(key: string, offset: ToolbarOffset): void {\n if (typeof window === 'undefined') return\n try {\n if (offset.x === 0 && offset.y === 0) window.localStorage.removeItem(key)\n else window.localStorage.setItem(key, JSON.stringify(offset))\n } catch {\n /* quota / private mode — perder isto custa uma posição, não um dado */\n }\n}\n\n/**\n * Deslocamento arrastável, preso à viewport.\n *\n * O clamp mede o elemento JÁ transladado e desconta o deslocamento atual para\n * achar a âncora — é o que mantém a barra inteira na tela depois de um resize,\n * de um rail que abre, ou de uma posição guardada numa janela maior.\n */\nfunction useToolbarOffset(storageKey: string, enabled: boolean) {\n const key = OFFSET_KEY(storageKey)\n const barRef = React.useRef<HTMLDivElement>(null)\n const [offset, setOffset] = React.useState<ToolbarOffset>(() => (enabled ? readOffset(key) : { x: 0, y: 0 }))\n const [dragging, setDragging] = React.useState(false)\n const latest = React.useRef(offset)\n latest.current = offset\n const origin = React.useRef<{ px: number; py: number; ox: number; oy: number } | null>(null)\n\n const clamp = React.useCallback((next: ToolbarOffset): ToolbarOffset => {\n const el = barRef.current\n if (!el || typeof window === 'undefined') return next\n const rect = el.getBoundingClientRect()\n const anchorLeft = rect.left - latest.current.x\n const anchorTop = rect.top - latest.current.y\n return {\n x: Math.min(\n Math.max(next.x, EDGE - anchorLeft),\n Math.max(EDGE - anchorLeft, window.innerWidth - EDGE - rect.width - anchorLeft),\n ),\n y: Math.min(\n Math.max(next.y, EDGE - anchorTop),\n Math.max(EDGE - anchorTop, window.innerHeight - EDGE - rect.height - anchorTop),\n ),\n }\n }, [])\n\n const move = React.useCallback((next: ToolbarOffset, persist: boolean) => {\n const clamped = clamp(next)\n setOffset(clamped)\n if (persist) writeOffset(key, clamped)\n }, [clamp, key])\n\n const onPointerDown = (event: React.PointerEvent<HTMLElement>) => {\n if (!enabled || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.setPointerCapture(event.pointerId)\n origin.current = { px: event.clientX, py: event.clientY, ox: latest.current.x, oy: latest.current.y }\n setDragging(true)\n }\n\n const onPointerMove = (event: React.PointerEvent<HTMLElement>) => {\n const from = origin.current\n if (!from) return\n move({ x: from.ox + (event.clientX - from.px), y: from.oy + (event.clientY - from.py) }, false)\n }\n\n const endDrag = (event: React.PointerEvent<HTMLElement>) => {\n if (!origin.current) return\n origin.current = null\n setDragging(false)\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId)\n }\n writeOffset(key, latest.current)\n }\n\n // Teclado: a alça é um botão, e um controle que só responde ao arrasto não\n // existe para quem não usa mouse.\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!enabled) return\n const step = event.shiftKey ? 24 : 8\n const delta: Record<string, ToolbarOffset> = {\n ArrowLeft: { x: -step, y: 0 },\n ArrowRight: { x: step, y: 0 },\n ArrowUp: { x: 0, y: -step },\n ArrowDown: { x: 0, y: step },\n }\n if (event.key === 'Escape' || event.key === 'Home') {\n event.preventDefault()\n move({ x: 0, y: 0 }, true)\n return\n }\n const d = delta[event.key]\n if (!d) return\n event.preventDefault()\n move({ x: latest.current.x + d.x, y: latest.current.y + d.y }, true)\n }\n\n const reset = React.useCallback(() => move({ x: 0, y: 0 }, true), [move])\n\n // Uma posição guardada numa janela larga não pode esconder a barra numa\n // estreita — reancora sem gravar, para não sobrescrever a escolha do usuário.\n React.useEffect(() => {\n if (!enabled) return\n const onResize = () => move(latest.current, false)\n window.addEventListener('resize', onResize)\n return () => window.removeEventListener('resize', onResize)\n }, [enabled, move])\n\n return { barRef, offset, dragging, reset, handlers: { onPointerDown, onPointerMove, onPointerUp: endDrag, onPointerCancel: endDrag, onKeyDown } }\n}\n\n/**\n * Onde os controles da barra estão sendo desenhados.\n *\n * `bar` é a faixa estreita: cada controle é um gatilho que abre o seu próprio\n * popover. `panel` é o painel do celular, ancorado no header e sobre o escurecer — ali um\n * popover dentro de outro é uma camada a mais para atravessar, e o que o\n * controle tem a oferecer cabe ABERTO. Os slots são ReactNode opacos para a\n * barra, então quem precisa saber lê daqui em vez de receber por prop.\n */\nexport interface PageToolbarProps {\n /** O período. */\n range?: React.ReactNode\n /** Filtros gerais e comparação — o que estreita a pergunta. */\n filters?: React.ReactNode\n /** Filtros aplicados, como pastilhas removíveis. */\n chips?: React.ReactNode\n /** Quais componentes aparecem. */\n customize?: React.ReactNode\n /** Extras da tela (exportar, um relatório novo). */\n actions?: React.ReactNode\n onRefresh?: () => void\n refreshLabel?: string\n /** Solta a barra do topo (dentro de um modal, ou ao imprimir). */\n sticky?: boolean\n /** Alça de arrastar à esquerda. Desligue onde a barra não flutua sobre nada. */\n movable?: boolean\n /** Separa a posição desta barra da compartilhada. Ver useToolbarOffset. */\n storageKey?: string\n /** Rótulo acessível da alça. */\n moveLabel?: string\n /** Título da folha que abre no celular. Padrão: \"Filtros\". */\n filtersTitle?: string\n className?: string\n}\n\nexport function PageToolbar({\n range, filters, chips, customize, actions, onRefresh, refreshLabel,\n sticky = true, movable = true, storageKey = 'shared', moveLabel, filtersTitle, className,\n}: PageToolbarProps) {\n // A phone does not float this bar. Floating buys back a row of vertical space\n // on a wide screen; on a 393px one it lands ON the cards instead of beside\n // them, and the thing that would move it out of the way is a drag handle —\n // an interaction a finger cannot perform on a surface that scrolls. So below\n // md it is what it looks like: a row, full width, in the flow.\n const floating = useIsWide()\n const { barRef, offset, dragging, reset, handlers } = useToolbarOffset(storageKey, movable && floating)\n // No celular a barra sobe para a faixa da página, ao lado do nome da tela.\n // Como faixa própria ela gastava uma linha inteira ENTRE o título e o\n // primeiro cartão — a tela dizia \"Relatórios\", e o dado pelo qual alguém\n // abriu a tela começava depois de duas réguas de cromo. O slot já existe (é\n // por onde as abas de módulo entram) e no celular está vazio, porque a busca\n // do meio não é desenhada nesse tamanho.\n // O slot das AÇÕES (grupo da direita da faixa), não o do módulo: aquele\n // divide a barra pela metade com o grupo da direita, então encostar à sua\n // direita punha o controle no meio da tela, colado no título. O da direita\n // é o que tem a borda da tela como referência.\n const actionsSlot = useModuleHeaderActionsSlot()\n const moduleSlot = useModuleHeaderSlot()\n const headerSlot = actionsSlot ?? moduleSlot\n const [openOnPhone, setOpenOnPhone] = React.useState(false)\n const scrim = useScrim(openOnPhone)\n const panelSurface = React.useMemo<ToolbarSurfaceValue>(\n () => ({ surface: 'panel', close: () => setOpenOnPhone(false) }),\n [],\n )\n if (!range && !filters && !chips && !customize && !actions && !onRefresh) return null\n\n // `withChips` porque no celular as pastilhas sobem para o header (é o estado\n // aplicado, tem de ficar à vista) e repeti-las dentro do painel seria a mesma\n // informação duas vezes na mesma tela.\n const controlsFor = ({ withChips, withRefresh = true }: { withChips: boolean; withRefresh?: boolean }) => (\n <>\n {range}\n {filters}\n {withChips ? chips : null}\n {customize}\n {actions}\n {withRefresh && onRefresh ? (\n <Button\n variant=\"ghost\" size=\"sm\" onClick={onRefresh}\n aria-label={refreshLabel}\n className=\"w-[26px] shrink-0 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-transparent hover:text-foreground\"\n >\n <RefreshCw className=\"h-3 w-3\" />\n </Button>\n ) : null}\n </>\n )\n\n // Um GATILHO no header, não os controles inteiros. Num telefone de 375px o\n // nome da tela e quatro controles não dividem a mesma linha de 56px: tentar\n // cortava o período no meio (\"Últimos 30…\") e empurrava filtros e recarregar\n // para fora da tela, onde deixam de existir. Rolagem horizontal não salva —\n // esconde num gesto que ninguém adivinha que existe.\n //\n // Fechado, a faixa não gasta linha nenhuma, que era o ponto. Aberto, ela\n // aparece onde sempre esteve, inteira e legível.\n if (!floating && headerSlot) {\n return (\n <>\n {scrim.mounted && typeof document !== 'undefined' && createPortal(\n // O MESMO escurecer do FAB (ver useScrim em page-actions): enquanto o\n // painel está aberto ele é a única coisa a responder, e a página atrás\n // continuava lendo como um lugar onde ainda dava para tocar.\n <div\n aria-hidden\n onClick={() => setOpenOnPhone(false)}\n className={cn(\n 'fixed inset-0 z-[100] bg-foreground/40 transition-opacity duration-200 md:hidden',\n 'motion-reduce:transition-none',\n scrim.visible ? 'opacity-100' : 'opacity-0',\n )}\n />,\n document.body,\n )}\n {createPortal(\n // `w-full justify-end`: o slot do header é um flex de largura livre,\n // então `ml-auto` sozinho encostava o botão no TÍTULO, não na borda\n // da tela. Esticar o contêiner é o que dá uma direita para encostar.\n <div className=\"flex w-full min-w-0 items-center justify-end gap-1\">\n {/* O que está aplicado AGORA, visível sem abrir nada — é a razão de\n a tela mostrar estes números e não outros. */}\n {chips ? (\n <div className=\"scrollbar-none flex min-w-0 items-center gap-1 overflow-x-auto\">\n {chips}\n </div>\n ) : null}\n <Popover open={openOnPhone} onOpenChange={setOpenOnPhone}>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-label={openOnPhone ? 'Fechar filtros' : (filtersTitle ?? 'Filtros')}\n // Acima do escurecer: o próprio gatilho é o que fecha, e\n // apagar a saída é a única coisa que o escurecer não pode fazer.\n className={cn(\n 'h-8 w-8 shrink-0 p-0 text-muted-foreground hover:text-foreground',\n openOnPhone && 'z-[105]',\n )}\n >\n {openOnPhone ? <X className=\"h-4 w-4\" /> : <SlidersHorizontal className=\"h-4 w-4\" />}\n </Button>\n </PopoverTrigger>\n {/* Popover e não DropdownMenu: o painel tem um campo de busca, e\n o typeahead do menu do Radix engole o que se digita nele.\n Ancorado no gatilho como o menu do FAB, e largo o bastante\n para os filtros virem ABERTOS em vez de atrás de outra camada. */}\n <PopoverContent\n align=\"end\"\n sideOffset={8}\n className=\"z-[101] flex max-h-[70vh] w-[min(22rem,calc(100vw-1.5rem))] flex-col gap-3 overflow-y-auto p-3 md:hidden\"\n >\n <ToolbarSurfaceContext.Provider value={panelSurface}>\n {controlsFor({ withChips: false, withRefresh: false })}\n </ToolbarSurfaceContext.Provider>\n </PopoverContent>\n </Popover>\n </div>,\n headerSlot,\n )}\n </>\n )\n }\n\n return (\n // Caixa de altura ZERO: a barra flutua sobre os cartões em vez de abrir uma\n // linha só para ela. Ocupando espaço, ela empurrava a grade inteira para\n // baixo para hospedar controles que a maioria das visitas nem toca — e\n // \"flutuante\" que reserva o próprio lugar não está flutuando.\n //\n // Zero + sticky, não `absolute`: absoluto não gruda, e a pergunta que a\n // página responde tem de continuar à mão depois de vinte cartões de rolagem.\n // `pointer-events-none` na caixa para que a faixa vazia dos lados não coma o\n // clique do cartão embaixo.\n <div\n // Uma barra de controle não vai para o papel, e `no-print` vindo por\n // `className` não chega até aqui. `data-print=\"hide\"` é incondicional de\n // propósito: não existe impressão em que o seletor de período impresso\n // ajude quem segura a folha.\n data-print=\"hide\"\n className={cn(\n 'z-20 flex',\n // `items-start` não é enfeite: num flex de altura 0, o alinhamento\n // padrão (stretch) achata o filho para 0px — a barra some e só os\n // botões transbordam, sem vidro nenhum atrás.\n floating ? 'pointer-events-none h-0 items-start justify-end' : 'w-full',\n sticky && 'sticky top-0',\n )}\n >\n <div\n ref={barRef}\n // Transform, não `top/left`: um deslocamento composto não tira a barra\n // do fluxo nem briga com o `sticky` do pai — ele desloca o que o sticky\n // já posicionou.\n style={floating && (offset.x || offset.y) ? { transform: `translate3d(${offset.x}px, ${offset.y}px, 0)` } : undefined}\n className={cn(\n 'flex max-w-full flex-wrap items-center gap-2',\n floating\n // O mesmo vidro do assistente (fayz-floating-surface, em styles.css):\n // é a outra coisa que flutua sobre a página, e as duas se diziam\n // flutuantes em materiais diferentes. Fill fino + blur pesado, para a\n // grade passar por baixo sem competir.\n ? 'fayz-floating-surface pointer-events-auto justify-end rounded-2xl px-2 py-1.5'\n // No celular é uma faixa da página: opaca, porque agora ela ROLA com\n // o conteúdo em vez de flutuar sobre ele, e uma faixa translúcida\n // grudada no topo deixa o texto passar por baixo dela.\n : 'w-full justify-start border-b border-border bg-background px-3 py-2',\n dragging && 'select-none',\n className,\n )}\n >\n {movable && floating ? (\n <button\n type=\"button\"\n aria-label={moveLabel ?? 'Mover a barra'}\n title={moveLabel ?? 'Mover a barra'}\n // `touch-none` para o arrasto não virar rolagem no celular; o\n // duplo clique devolve a barra ao canto de origem, que é a saída\n // para quem a largou num lugar ruim.\n onDoubleClick={reset}\n {...handlers}\n className={cn(\n 'flex h-[26px] w-4 shrink-0 touch-none items-center justify-center rounded-md text-muted-foreground/50',\n 'transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n dragging ? 'cursor-grabbing text-foreground' : 'cursor-grab',\n )}\n >\n <GripVertical className=\"h-3.5 w-3.5\" />\n </button>\n ) : null}\n {controlsFor({ withChips: true })}\n </div>\n </div>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetBody } from './chunk-UP7WVKSU.js';
1
+ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetBody } from './chunk-SGK3K3AQ.js';
2
2
  import { cn, Button } from './chunk-OKZ6WQB3.js';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import * as React2 from 'react';
@@ -272,5 +272,5 @@ function ContentSplitTrigger({ label, iconOnly, className }) {
272
272
  }
273
273
 
274
274
  export { AppShellSkeleton, ContentSplit, ContentSplitTrigger, PageTrail, Takeover, navigateToCrumb, usePageTrail, usePageTrailParent, useTakeoverClose };
275
- //# sourceMappingURL=chunk-L4TXDKMN.js.map
276
- //# sourceMappingURL=chunk-L4TXDKMN.js.map
275
+ //# sourceMappingURL=chunk-Z32UKXDM.js.map
276
+ //# sourceMappingURL=chunk-Z32UKXDM.js.map