@motor-hero/ui-kit 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/dist/components/app-shell.d.ts +22 -0
- package/dist/components/app-shell.d.ts.map +1 -0
- package/dist/components/sidebar-nav.d.ts +19 -0
- package/dist/components/sidebar-nav.d.ts.map +1 -0
- package/dist/components/types.d.ts +12 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/components/user-menu.d.ts +23 -0
- package/dist/components/user-menu.d.ts.map +1 -0
- package/dist/index.cjs +236 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +227 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/app-shell.tsx +127 -0
- package/src/components/sidebar-nav.tsx +66 -0
- package/src/components/types.tsx +16 -0
- package/src/components/user-menu.tsx +116 -0
- package/src/index.ts +10 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/theme-provider.tsx","../src/components/mode-toggle.tsx","../src/components/empty-state.tsx","../src/components/confirm-dialog.tsx","../src/components/page-header.tsx","../src/components/status-dot.tsx","../src/components/form-field.tsx","../src/components/form-dialog.tsx","../src/components/auth-card.tsx","../src/components/pagination.tsx","../src/components/table-skeleton.tsx","../src/components/search-input.tsx","../src/components/stat-card.tsx","../src/components/data-table-wrapper.tsx","../src/components/mobile-card-list.tsx","../src/components/responsive-data-view.tsx","../src/components/toaster.tsx","../src/lib/utils.ts","../src/lib/api-error.ts","../src/hooks/use-disclosure.ts","../src/hooks/use-toast.ts"],"sourcesContent":["import { createContext, useContext, useEffect, useState } from \"react\"\n\ntype Theme = \"dark\" | \"light\" | \"system\"\n\ntype ThemeProviderProps = {\n children: React.ReactNode\n defaultTheme?: Theme\n storageKey?: string\n}\n\ntype ThemeProviderState = {\n theme: Theme\n setTheme: (theme: Theme) => void\n}\n\nconst initialState: ThemeProviderState = {\n theme: \"system\",\n setTheme: () => null,\n}\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState)\n\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"ui-theme\",\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(\n () => (localStorage.getItem(storageKey) as Theme) || defaultTheme\n )\n\n useEffect(() => {\n const root = window.document.documentElement\n root.classList.remove(\"light\", \"dark\")\n if (theme === \"system\") {\n const systemTheme = window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\"\n root.classList.add(systemTheme)\n return\n }\n root.classList.add(theme)\n }, [theme])\n\n const value = {\n theme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme)\n setTheme(theme)\n },\n }\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n )\n}\n\nexport function useTheme() {\n const context = useContext(ThemeProviderContext)\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\")\n }\n return context\n}\n\nexport type { Theme, ThemeProviderProps, ThemeProviderState }\n","import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\"\nimport { Moon, Sun, Monitor } from \"lucide-react\"\nimport { useTheme } from \"./theme-provider\"\n\nexport function ModeToggle() {\n const { setTheme } = useTheme()\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n aria-label=\"Alternar tema\"\n >\n <Sun className=\"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <Moon className=\"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align=\"end\"\n className=\"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95\"\n >\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"light\")}\n >\n <Sun className=\"h-4 w-4\" /> Claro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"dark\")}\n >\n <Moon className=\"h-4 w-4\" /> Escuro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"system\")}\n >\n <Monitor className=\"h-4 w-4\" /> Sistema\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface EmptyStateProps {\n icon?: ReactNode\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function EmptyState({ icon, title, description, action, className }: EmptyStateProps) {\n return (\n <div className={`flex flex-col items-center justify-center py-16 text-center ${className ?? \"\"}`}>\n {icon && <div className=\"mb-4 text-muted-foreground\">{icon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{title}</h3>\n {description && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{description}</p>\n )}\n {action && <div className=\"mt-4\">{action}</div>}\n </div>\n )\n}\n","import * as AlertDialog from \"@radix-ui/react-alert-dialog\"\nimport type { ReactNode } from \"react\"\n\ninterface ConfirmDialogProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n onConfirm: () => void\n title: string\n description: ReactNode\n confirmLabel?: string\n cancelLabel?: string\n loading?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n onConfirm,\n title,\n description,\n confirmLabel = \"Confirmar\",\n cancelLabel = \"Cancelar\",\n loading = false,\n variant = \"default\",\n}: ConfirmDialogProps) {\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n <AlertDialog.Portal>\n <AlertDialog.Overlay className=\"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\" />\n <AlertDialog.Content className=\"fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\">\n <div className=\"flex flex-col space-y-2 text-center sm:text-left\">\n <AlertDialog.Title className=\"text-lg font-semibold\">{title}</AlertDialog.Title>\n <AlertDialog.Description className=\"text-sm text-muted-foreground\">\n {description}\n </AlertDialog.Description>\n </div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <AlertDialog.Cancel className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer\">\n {cancelLabel}\n </AlertDialog.Cancel>\n <AlertDialog.Action\n onClick={onConfirm}\n disabled={loading}\n className={`inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n }`}\n >\n {loading ? \"Aguarde...\" : confirmLabel}\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n </AlertDialog.Portal>\n </AlertDialog.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface PageHeaderProps {\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function PageHeader({ title, description, action, className }: PageHeaderProps) {\n return (\n <div className={`flex items-center justify-between ${className ?? \"\"}`}>\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n {action && <div>{action}</div>}\n </div>\n )\n}\n","interface StatusDotProps {\n active: boolean\n label?: string\n className?: string\n}\n\nexport function StatusDot({ active, label, className }: StatusDotProps) {\n return (\n <span className={`inline-flex items-center gap-2 ${className ?? \"\"}`}>\n <span\n className={`h-2 w-2 rounded-full ${active ? \"bg-green-500\" : \"bg-red-500\"}`}\n />\n {label && <span>{label}</span>}\n </span>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormFieldProps {\n label: string\n htmlFor?: string\n error?: string\n required?: boolean\n children: ReactNode\n className?: string\n}\n\nexport function FormField({ label, htmlFor, error, required, children, className }: FormFieldProps) {\n return (\n <div className={`space-y-2 ${className ?? \"\"}`}>\n <label\n htmlFor={htmlFor}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"ml-1 text-destructive\">*</span>}\n </label>\n {children}\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormDialogLayoutProps {\n title: string\n children: ReactNode\n onSubmit: (e: React.FormEvent) => void\n submitLabel?: string\n cancelLabel?: string\n onCancel: () => void\n isSubmitting?: boolean\n isDisabled?: boolean\n}\n\nexport function FormDialogLayout({\n title,\n children,\n onSubmit,\n submitLabel = \"Salvar\",\n cancelLabel = \"Cancelar\",\n onCancel,\n isSubmitting = false,\n isDisabled = false,\n}: FormDialogLayoutProps) {\n return (\n <form onSubmit={onSubmit}>\n <div className=\"flex flex-col space-y-1.5 text-center sm:text-left\">\n <h2 className=\"text-lg font-semibold leading-none tracking-tight\">{title}</h2>\n </div>\n <div className=\"space-y-4 py-4\">{children}</div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {cancelLabel}\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting || isDisabled}\n className=\"inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {isSubmitting ? \"Salvando...\" : submitLabel}\n </button>\n </div>\n </form>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface AuthCardProps {\n title: string\n description?: string\n children: ReactNode\n footer?: ReactNode\n}\n\nexport function AuthCard({ title, description, children, footer }: AuthCardProps) {\n return (\n <div className=\"flex min-h-screen items-center justify-center px-4\">\n <div className=\"w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"mb-6 text-center\">\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"mt-1 text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n <div className=\"space-y-4\">{children}</div>\n {footer && <div className=\"mt-4\">{footer}</div>}\n </div>\n </div>\n )\n}\n","interface PaginationProps {\n page: number\n onPageChange: (page: number) => void\n hasNextPage: boolean\n hasPreviousPage: boolean\n className?: string\n}\n\nexport function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }: PaginationProps) {\n return (\n <div className={`flex items-center justify-end gap-4 ${className ?? \"\"}`}>\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )\n}\n","interface TableSkeletonProps {\n rows?: number\n columns?: number\n}\n\nexport function TableSkeleton({ rows = 5, columns = 4 }: TableSkeletonProps) {\n return (\n <>\n {Array.from({ length: rows }).map((_, i) => (\n <tr key={i} className=\"border-b transition-colors\">\n {Array.from({ length: columns }).map((_, j) => (\n <td key={j} className=\"p-4 align-middle\">\n <div className=\"h-5 w-full animate-pulse rounded bg-muted\" />\n </td>\n ))}\n </tr>\n ))}\n </>\n )\n}\n","import * as React from \"react\"\n\ninterface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n containerClassName?: string\n}\n\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n ({ containerClassName, className, ...props }, ref) => {\n return (\n <div className={`relative flex-1 ${containerClassName ?? \"\"}`}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <input\n ref={ref}\n type=\"text\"\n className={`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 pl-10 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 ${className ?? \"\"}`}\n {...props}\n />\n </div>\n )\n }\n)\nSearchInput.displayName = \"SearchInput\"\n","import type { ReactNode } from \"react\"\n\ninterface StatCardProps {\n label: string\n value: ReactNode\n detail?: string\n icon?: ReactNode\n isLoading?: boolean\n}\n\nexport function StatCard({ label, value, detail, icon, isLoading }: StatCardProps) {\n if (isLoading) {\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-4 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"mt-2 h-7 w-16 animate-pulse rounded bg-muted\" />\n <div className=\"mt-1 h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n )\n }\n\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <span className=\"text-sm font-medium text-muted-foreground\">{label}</span>\n {icon && <span className=\"text-muted-foreground\">{icon}</span>}\n </div>\n <div className=\"text-2xl font-bold\">{value}</div>\n {detail && <p className=\"text-xs text-muted-foreground\">{detail}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface DataTableWrapperProps {\n children: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n page?: number\n onPageChange?: (page: number) => void\n hasNextPage?: boolean\n hasPreviousPage?: boolean\n}\n\nexport function DataTableWrapper({\n children,\n isEmpty,\n isLoading,\n emptyIcon,\n emptyTitle = \"Nenhum registro encontrado\",\n emptyDescription,\n page,\n onPageChange,\n hasNextPage = false,\n hasPreviousPage = false,\n}: DataTableWrapperProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"overflow-x-auto rounded-md border\">{children}</div>\n\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>\n )}\n </div>\n )}\n\n {page !== undefined && onPageChange && (\n <div className=\"flex items-center justify-end gap-4\">\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface MobileCardListProps<T> {\n data: T[]\n renderCard: (item: T, index: number) => ReactNode\n keyExtractor: (item: T) => string\n isLoading?: boolean\n loadingCount?: number\n className?: string\n}\n\nexport function MobileCardList<T>({\n data,\n renderCard,\n keyExtractor,\n isLoading = false,\n loadingCount = 5,\n className,\n}: MobileCardListProps<T>) {\n if (isLoading) {\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {Array.from({ length: loadingCount }).map((_, i) => (\n <div key={i} className=\"rounded-xl border p-4\">\n <div className=\"space-y-3\">\n <div className=\"flex justify-between\">\n <div className=\"h-5 w-32 animate-pulse rounded bg-muted\" />\n <div className=\"h-5 w-16 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"h-4 w-48 animate-pulse rounded bg-muted\" />\n <div className=\"flex justify-between\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )\n }\n\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {data.map((item, index) => (\n <div\n key={keyExtractor(item)}\n className=\"rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]\"\n >\n {renderCard(item, index)}\n </div>\n ))}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface ResponsiveDataViewProps {\n table: ReactNode\n cards: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n pagination?: ReactNode\n}\n\nexport function ResponsiveDataView({\n table, cards, isEmpty, isLoading, emptyIcon, emptyTitle = \"Nenhum registro encontrado\", emptyDescription, pagination,\n}: ResponsiveDataViewProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"hidden overflow-x-auto rounded-md border md:block\">{table}</div>\n <div className=\"md:hidden\">{cards}</div>\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>}\n </div>\n )}\n {pagination}\n </div>\n )\n}\n","import { useTheme } from \"./theme-provider\"\nimport { Toaster as Sonner } from \"sonner\"\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>\n\nexport function Toaster(props: ToasterProps) {\n const { theme = \"system\" } = useTheme()\n\n return (\n <Sonner\n theme={theme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-md\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n success:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-success/40\",\n error:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-destructive/40\",\n },\n }}\n {...props}\n />\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","export function extractApiError(err: any, fallbackMessage = \"Ocorreu um erro inesperado.\"): string {\n const detail = err?.body?.detail || err?.message\n if (Array.isArray(detail) && detail.length > 0) {\n return detail[0].msg\n }\n return detail || fallbackMessage\n}\n","import { useCallback, useState } from \"react\"\n\nexport function useDisclosure(initial = false) {\n const [open, setOpen] = useState(initial)\n const onOpen = useCallback(() => setOpen(true), [])\n const onClose = useCallback(() => setOpen(false), [])\n const onToggle = useCallback(() => setOpen((v) => !v), [])\n return { open, onOpen, onClose, onToggle, setOpen }\n}\n","import { toast } from \"sonner\"\nimport { useCallback } from \"react\"\n\ntype ToastStatus = \"success\" | \"error\" | \"info\" | \"warning\"\n\nexport function useCustomToast() {\n const showToast = useCallback(\n (title: string, description?: string, status: ToastStatus = \"success\") => {\n switch (status) {\n case \"success\":\n toast.success(title, { description })\n break\n case \"error\":\n toast.error(title, { description })\n break\n case \"info\":\n toast.info(title, { description })\n break\n case \"warning\":\n toast.warning(title, { description })\n break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names":["theme","jsx","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","_","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","useState","useCallback"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/theme-provider.tsx","../src/components/mode-toggle.tsx","../src/components/empty-state.tsx","../src/components/confirm-dialog.tsx","../src/components/page-header.tsx","../src/components/status-dot.tsx","../src/components/form-field.tsx","../src/components/form-dialog.tsx","../src/components/auth-card.tsx","../src/components/pagination.tsx","../src/components/table-skeleton.tsx","../src/components/search-input.tsx","../src/components/stat-card.tsx","../src/components/data-table-wrapper.tsx","../src/components/mobile-card-list.tsx","../src/components/responsive-data-view.tsx","../src/components/toaster.tsx","../src/components/app-shell.tsx","../src/lib/utils.ts","../src/components/sidebar-nav.tsx","../src/components/types.tsx","../src/components/user-menu.tsx","../src/lib/api-error.ts","../src/hooks/use-disclosure.ts","../src/hooks/use-toast.ts"],"sourcesContent":["import { createContext, useContext, useEffect, useState } from \"react\"\n\ntype Theme = \"dark\" | \"light\" | \"system\"\n\ntype ThemeProviderProps = {\n children: React.ReactNode\n defaultTheme?: Theme\n storageKey?: string\n}\n\ntype ThemeProviderState = {\n theme: Theme\n setTheme: (theme: Theme) => void\n}\n\nconst initialState: ThemeProviderState = {\n theme: \"system\",\n setTheme: () => null,\n}\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState)\n\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"ui-theme\",\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(\n () => (localStorage.getItem(storageKey) as Theme) || defaultTheme\n )\n\n useEffect(() => {\n const root = window.document.documentElement\n root.classList.remove(\"light\", \"dark\")\n if (theme === \"system\") {\n const systemTheme = window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\"\n root.classList.add(systemTheme)\n return\n }\n root.classList.add(theme)\n }, [theme])\n\n const value = {\n theme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme)\n setTheme(theme)\n },\n }\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n )\n}\n\nexport function useTheme() {\n const context = useContext(ThemeProviderContext)\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\")\n }\n return context\n}\n\nexport type { Theme, ThemeProviderProps, ThemeProviderState }\n","import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\"\nimport { Moon, Sun, Monitor } from \"lucide-react\"\nimport { useTheme } from \"./theme-provider\"\n\nexport function ModeToggle() {\n const { setTheme } = useTheme()\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n aria-label=\"Alternar tema\"\n >\n <Sun className=\"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <Moon className=\"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align=\"end\"\n className=\"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95\"\n >\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"light\")}\n >\n <Sun className=\"h-4 w-4\" /> Claro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"dark\")}\n >\n <Moon className=\"h-4 w-4\" /> Escuro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"system\")}\n >\n <Monitor className=\"h-4 w-4\" /> Sistema\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface EmptyStateProps {\n icon?: ReactNode\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function EmptyState({ icon, title, description, action, className }: EmptyStateProps) {\n return (\n <div className={`flex flex-col items-center justify-center py-16 text-center ${className ?? \"\"}`}>\n {icon && <div className=\"mb-4 text-muted-foreground\">{icon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{title}</h3>\n {description && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{description}</p>\n )}\n {action && <div className=\"mt-4\">{action}</div>}\n </div>\n )\n}\n","import * as AlertDialog from \"@radix-ui/react-alert-dialog\"\nimport type { ReactNode } from \"react\"\n\ninterface ConfirmDialogProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n onConfirm: () => void\n title: string\n description: ReactNode\n confirmLabel?: string\n cancelLabel?: string\n loading?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n onConfirm,\n title,\n description,\n confirmLabel = \"Confirmar\",\n cancelLabel = \"Cancelar\",\n loading = false,\n variant = \"default\",\n}: ConfirmDialogProps) {\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n <AlertDialog.Portal>\n <AlertDialog.Overlay className=\"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\" />\n <AlertDialog.Content className=\"fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\">\n <div className=\"flex flex-col space-y-2 text-center sm:text-left\">\n <AlertDialog.Title className=\"text-lg font-semibold\">{title}</AlertDialog.Title>\n <AlertDialog.Description className=\"text-sm text-muted-foreground\">\n {description}\n </AlertDialog.Description>\n </div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <AlertDialog.Cancel className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer\">\n {cancelLabel}\n </AlertDialog.Cancel>\n <AlertDialog.Action\n onClick={onConfirm}\n disabled={loading}\n className={`inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n }`}\n >\n {loading ? \"Aguarde...\" : confirmLabel}\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n </AlertDialog.Portal>\n </AlertDialog.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface PageHeaderProps {\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function PageHeader({ title, description, action, className }: PageHeaderProps) {\n return (\n <div className={`flex items-center justify-between ${className ?? \"\"}`}>\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n {action && <div>{action}</div>}\n </div>\n )\n}\n","interface StatusDotProps {\n active: boolean\n label?: string\n className?: string\n}\n\nexport function StatusDot({ active, label, className }: StatusDotProps) {\n return (\n <span className={`inline-flex items-center gap-2 ${className ?? \"\"}`}>\n <span\n className={`h-2 w-2 rounded-full ${active ? \"bg-green-500\" : \"bg-red-500\"}`}\n />\n {label && <span>{label}</span>}\n </span>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormFieldProps {\n label: string\n htmlFor?: string\n error?: string\n required?: boolean\n children: ReactNode\n className?: string\n}\n\nexport function FormField({ label, htmlFor, error, required, children, className }: FormFieldProps) {\n return (\n <div className={`space-y-2 ${className ?? \"\"}`}>\n <label\n htmlFor={htmlFor}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"ml-1 text-destructive\">*</span>}\n </label>\n {children}\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormDialogLayoutProps {\n title: string\n children: ReactNode\n onSubmit: (e: React.FormEvent) => void\n submitLabel?: string\n cancelLabel?: string\n onCancel: () => void\n isSubmitting?: boolean\n isDisabled?: boolean\n}\n\nexport function FormDialogLayout({\n title,\n children,\n onSubmit,\n submitLabel = \"Salvar\",\n cancelLabel = \"Cancelar\",\n onCancel,\n isSubmitting = false,\n isDisabled = false,\n}: FormDialogLayoutProps) {\n return (\n <form onSubmit={onSubmit}>\n <div className=\"flex flex-col space-y-1.5 text-center sm:text-left\">\n <h2 className=\"text-lg font-semibold leading-none tracking-tight\">{title}</h2>\n </div>\n <div className=\"space-y-4 py-4\">{children}</div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {cancelLabel}\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting || isDisabled}\n className=\"inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {isSubmitting ? \"Salvando...\" : submitLabel}\n </button>\n </div>\n </form>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface AuthCardProps {\n title: string\n description?: string\n children: ReactNode\n footer?: ReactNode\n}\n\nexport function AuthCard({ title, description, children, footer }: AuthCardProps) {\n return (\n <div className=\"flex min-h-screen items-center justify-center px-4\">\n <div className=\"w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"mb-6 text-center\">\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"mt-1 text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n <div className=\"space-y-4\">{children}</div>\n {footer && <div className=\"mt-4\">{footer}</div>}\n </div>\n </div>\n )\n}\n","interface PaginationProps {\n page: number\n onPageChange: (page: number) => void\n hasNextPage: boolean\n hasPreviousPage: boolean\n className?: string\n}\n\nexport function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }: PaginationProps) {\n return (\n <div className={`flex items-center justify-end gap-4 ${className ?? \"\"}`}>\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )\n}\n","interface TableSkeletonProps {\n rows?: number\n columns?: number\n}\n\nexport function TableSkeleton({ rows = 5, columns = 4 }: TableSkeletonProps) {\n return (\n <>\n {Array.from({ length: rows }).map((_, i) => (\n <tr key={i} className=\"border-b transition-colors\">\n {Array.from({ length: columns }).map((_, j) => (\n <td key={j} className=\"p-4 align-middle\">\n <div className=\"h-5 w-full animate-pulse rounded bg-muted\" />\n </td>\n ))}\n </tr>\n ))}\n </>\n )\n}\n","import * as React from \"react\"\n\ninterface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n containerClassName?: string\n}\n\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n ({ containerClassName, className, ...props }, ref) => {\n return (\n <div className={`relative flex-1 ${containerClassName ?? \"\"}`}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <input\n ref={ref}\n type=\"text\"\n className={`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 pl-10 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 ${className ?? \"\"}`}\n {...props}\n />\n </div>\n )\n }\n)\nSearchInput.displayName = \"SearchInput\"\n","import type { ReactNode } from \"react\"\n\ninterface StatCardProps {\n label: string\n value: ReactNode\n detail?: string\n icon?: ReactNode\n isLoading?: boolean\n}\n\nexport function StatCard({ label, value, detail, icon, isLoading }: StatCardProps) {\n if (isLoading) {\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-4 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"mt-2 h-7 w-16 animate-pulse rounded bg-muted\" />\n <div className=\"mt-1 h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n )\n }\n\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <span className=\"text-sm font-medium text-muted-foreground\">{label}</span>\n {icon && <span className=\"text-muted-foreground\">{icon}</span>}\n </div>\n <div className=\"text-2xl font-bold\">{value}</div>\n {detail && <p className=\"text-xs text-muted-foreground\">{detail}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface DataTableWrapperProps {\n children: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n page?: number\n onPageChange?: (page: number) => void\n hasNextPage?: boolean\n hasPreviousPage?: boolean\n}\n\nexport function DataTableWrapper({\n children,\n isEmpty,\n isLoading,\n emptyIcon,\n emptyTitle = \"Nenhum registro encontrado\",\n emptyDescription,\n page,\n onPageChange,\n hasNextPage = false,\n hasPreviousPage = false,\n}: DataTableWrapperProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"overflow-x-auto rounded-md border\">{children}</div>\n\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>\n )}\n </div>\n )}\n\n {page !== undefined && onPageChange && (\n <div className=\"flex items-center justify-end gap-4\">\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface MobileCardListProps<T> {\n data: T[]\n renderCard: (item: T, index: number) => ReactNode\n keyExtractor: (item: T) => string\n isLoading?: boolean\n loadingCount?: number\n className?: string\n}\n\nexport function MobileCardList<T>({\n data,\n renderCard,\n keyExtractor,\n isLoading = false,\n loadingCount = 5,\n className,\n}: MobileCardListProps<T>) {\n if (isLoading) {\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {Array.from({ length: loadingCount }).map((_, i) => (\n <div key={i} className=\"rounded-xl border p-4\">\n <div className=\"space-y-3\">\n <div className=\"flex justify-between\">\n <div className=\"h-5 w-32 animate-pulse rounded bg-muted\" />\n <div className=\"h-5 w-16 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"h-4 w-48 animate-pulse rounded bg-muted\" />\n <div className=\"flex justify-between\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )\n }\n\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {data.map((item, index) => (\n <div\n key={keyExtractor(item)}\n className=\"rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]\"\n >\n {renderCard(item, index)}\n </div>\n ))}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface ResponsiveDataViewProps {\n table: ReactNode\n cards: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n pagination?: ReactNode\n}\n\nexport function ResponsiveDataView({\n table, cards, isEmpty, isLoading, emptyIcon, emptyTitle = \"Nenhum registro encontrado\", emptyDescription, pagination,\n}: ResponsiveDataViewProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"hidden overflow-x-auto rounded-md border md:block\">{table}</div>\n <div className=\"md:hidden\">{cards}</div>\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>}\n </div>\n )}\n {pagination}\n </div>\n )\n}\n","import { useTheme } from \"./theme-provider\"\nimport { Toaster as Sonner } from \"sonner\"\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>\n\nexport function Toaster(props: ToasterProps) {\n const { theme = \"system\" } = useTheme()\n\n return (\n <Sonner\n theme={theme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-md\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n success:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-success/40\",\n error:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-destructive/40\",\n },\n }}\n {...props}\n />\n )\n}\n","import { ChevronLeft, ChevronRight, Menu } from \"lucide-react\"\nimport { type ReactNode, useState } from \"react\"\nimport { cn } from \"../lib/utils\"\nimport { SidebarNav, type NavItem } from \"./sidebar-nav\"\nimport type { RenderLink } from \"./types\"\nimport { defaultRenderLink } from \"./types\"\nimport { UserMenu, type AppUser, type UserMenuItem } from \"./user-menu\"\n\nexport interface AppShellProps {\n brand: ReactNode\n brandCollapsed?: ReactNode\n navItems: NavItem[]\n activePath: string\n isActive?: (item: NavItem, activePath: string) => boolean\n isAdmin?: boolean\n user?: AppUser\n userMenuItems?: UserMenuItem[]\n onLogout?: () => void\n renderLink?: RenderLink\n headerActions?: ReactNode\n collapsible?: boolean\n defaultCollapsed?: boolean\n children: ReactNode\n}\n\nexport function AppShell({\n brand,\n brandCollapsed,\n navItems,\n activePath,\n isActive,\n isAdmin = false,\n user,\n userMenuItems,\n onLogout,\n renderLink = defaultRenderLink,\n headerActions,\n collapsible = true,\n defaultCollapsed = false,\n children,\n}: AppShellProps) {\n const [collapsed, setCollapsed] = useState(defaultCollapsed)\n const [mobileOpen, setMobileOpen] = useState(false)\n\n const nav = (isCollapsed: boolean, onNavigate?: () => void) => (\n <SidebarNav\n items={navItems}\n activePath={activePath}\n isActive={isActive}\n isAdmin={isAdmin}\n isCollapsed={isCollapsed}\n renderLink={renderLink}\n onNavigate={onNavigate}\n />\n )\n\n return (\n <div className=\"flex h-screen overflow-hidden bg-background\">\n {/* Desktop sidebar */}\n <aside\n className={cn(\n \"hidden shrink-0 flex-col border-r bg-card transition-all duration-300 md:flex\",\n collapsed ? \"w-16\" : \"w-60\",\n )}\n >\n <div className=\"flex h-14 shrink-0 items-center border-b px-4\">\n {collapsed ? (brandCollapsed ?? brand) : brand}\n </div>\n <div className=\"flex-1 overflow-y-auto px-2 py-4\">{nav(collapsed)}</div>\n {collapsible && (\n <div className=\"border-t p-2\">\n <button\n type=\"button\"\n onClick={() => setCollapsed((v) => !v)}\n className=\"flex w-full items-center justify-center rounded-md px-2 py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"\n aria-label={collapsed ? \"Expandir menu\" : \"Recolher menu\"}\n >\n {collapsed ? <ChevronRight className=\"h-4 w-4\" /> : <ChevronLeft className=\"h-4 w-4\" />}\n </button>\n </div>\n )}\n </aside>\n\n {/* Mobile drawer */}\n <div\n className={cn(\n \"fixed inset-0 z-50 transition-opacity duration-300 md:hidden\",\n mobileOpen ? \"pointer-events-auto opacity-100\" : \"pointer-events-none opacity-0\",\n )}\n onClick={() => setMobileOpen(false)}\n >\n <div className=\"absolute inset-0 bg-black/50\" />\n <div\n className={cn(\n \"absolute left-0 top-0 flex h-full w-64 flex-col border-r bg-card transition-transform duration-300\",\n mobileOpen ? \"translate-x-0\" : \"-translate-x-full\",\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex h-14 shrink-0 items-center border-b px-4\">{brand}</div>\n <div className=\"flex-1 overflow-y-auto px-2 py-4\">{nav(false, () => setMobileOpen(false))}</div>\n </div>\n </div>\n\n {/* Main column */}\n <div className=\"flex flex-1 flex-col overflow-hidden\">\n <header className=\"flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4\">\n <button\n type=\"button\"\n onClick={() => setMobileOpen(true)}\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden\"\n aria-label=\"Abrir menu\"\n >\n <Menu className=\"h-4 w-4\" />\n </button>\n <div className=\"ml-auto flex items-center gap-2\">\n {headerActions}\n {(user || onLogout) && (\n <UserMenu user={user} items={userMenuItems} onLogout={onLogout} renderLink={renderLink} />\n )}\n </div>\n </header>\n <main className=\"flex-1 overflow-y-auto\">{children}</main>\n </div>\n </div>\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { Fragment, type ReactNode } from \"react\"\nimport { cn } from \"../lib/utils\"\nimport type { RenderLink } from \"./types\"\nimport { defaultRenderLink } from \"./types\"\n\nexport interface NavItem {\n label: string\n href: string\n icon?: ReactNode\n adminOnly?: boolean\n}\n\nexport interface SidebarNavProps {\n items: NavItem[]\n activePath: string\n isActive?: (item: NavItem, activePath: string) => boolean\n isAdmin?: boolean\n isCollapsed?: boolean\n renderLink?: RenderLink\n onNavigate?: () => void\n}\n\nfunction defaultIsActive(item: NavItem, activePath: string): boolean {\n if (item.href === \"/\") return activePath === \"/\"\n return activePath === item.href || activePath.startsWith(item.href + \"/\")\n}\n\nexport function SidebarNav({\n items,\n activePath,\n isActive = defaultIsActive,\n isAdmin = false,\n isCollapsed = false,\n renderLink = defaultRenderLink,\n onNavigate,\n}: SidebarNavProps) {\n const visible = items.filter((item) => !item.adminOnly || isAdmin)\n\n return (\n <nav className=\"flex flex-col gap-1\">\n {visible.map((item) => {\n const active = isActive(item, activePath)\n const link = renderLink({\n href: item.href,\n onClick: onNavigate,\n title: isCollapsed ? item.label : undefined,\n \"aria-current\": active ? \"page\" : undefined,\n className: cn(\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors\",\n active\n ? \"bg-accent text-accent-foreground font-semibold\"\n : \"text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n isCollapsed && \"justify-center px-2\",\n ),\n children: (\n <>\n {item.icon && <span className=\"shrink-0\">{item.icon}</span>}\n {!isCollapsed && <span className=\"truncate\">{item.label}</span>}\n </>\n ),\n })\n return <Fragment key={item.href}>{link}</Fragment>\n })}\n </nav>\n )\n}\n","import type { ReactNode } from \"react\"\n\nexport interface RenderLinkProps {\n href: string\n className?: string\n children: ReactNode\n onClick?: () => void\n title?: string\n \"aria-current\"?: \"page\"\n}\n\nexport type RenderLink = (props: RenderLinkProps) => ReactNode\n\nexport const defaultRenderLink: RenderLink = ({ children, ...props }) => (\n <a {...props}>{children}</a>\n)\n","import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\"\nimport { LogOut, User } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { cn } from \"../lib/utils\"\nimport type { RenderLink } from \"./types\"\nimport { defaultRenderLink } from \"./types\"\n\nexport interface AppUser {\n name?: string\n email?: string\n avatarUrl?: string\n}\n\nexport interface UserMenuItem {\n label: string\n icon?: ReactNode\n href?: string\n onClick?: () => void\n}\n\nexport interface UserMenuProps {\n user?: AppUser\n items?: UserMenuItem[]\n onLogout?: () => void\n logoutLabel?: string\n renderLink?: RenderLink\n align?: \"start\" | \"center\" | \"end\"\n}\n\nfunction initials(user?: AppUser): string {\n const source = user?.name?.trim() || user?.email?.trim()\n if (!source) return \"\"\n const parts = source.split(/\\s+/)\n if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase()\n return source.slice(0, 2).toUpperCase()\n}\n\nconst itemClass =\n \"flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n\nexport function UserMenu({\n user,\n items = [],\n onLogout,\n logoutLabel = \"Sair\",\n renderLink = defaultRenderLink,\n align = \"end\",\n}: UserMenuProps) {\n const label = initials(user)\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n aria-label=\"Menu do usuário\"\n data-testid=\"user-menu\"\n >\n {user?.avatarUrl ? (\n <img src={user.avatarUrl} alt={user.name ?? user.email ?? \"Avatar\"} className=\"h-full w-full object-cover\" />\n ) : label ? (\n <span>{label}</span>\n ) : (\n <User className=\"h-4 w-4\" />\n )}\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align={align}\n sideOffset={6}\n className=\"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95\"\n >\n {(user?.name || user?.email) && (\n <>\n <div className=\"px-2 py-1.5\">\n {user.name && <p className=\"truncate text-sm font-medium\">{user.name}</p>}\n {user.email && <p className=\"truncate text-xs text-muted-foreground\">{user.email}</p>}\n </div>\n <DropdownMenu.Separator className=\"-mx-1 my-1 h-px bg-border\" />\n </>\n )}\n\n {items.map((item) =>\n item.href ? (\n <DropdownMenu.Item key={item.label} asChild>\n {renderLink({ href: item.href, className: itemClass, children: (\n <>\n {item.icon}\n {item.label}\n </>\n ) })}\n </DropdownMenu.Item>\n ) : (\n <DropdownMenu.Item key={item.label} className={itemClass} onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenu.Item>\n ),\n )}\n\n {onLogout && (\n <>\n {items.length > 0 && <DropdownMenu.Separator className=\"-mx-1 my-1 h-px bg-border\" />}\n <DropdownMenu.Item className={cn(itemClass, \"text-destructive focus:bg-destructive/10\")} onClick={onLogout}>\n <LogOut className=\"h-4 w-4\" />\n {logoutLabel}\n </DropdownMenu.Item>\n </>\n )}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n )\n}\n","export function extractApiError(err: any, fallbackMessage = \"Ocorreu um erro inesperado.\"): string {\n const detail = err?.body?.detail || err?.message\n if (Array.isArray(detail) && detail.length > 0) {\n return detail[0].msg\n }\n return detail || fallbackMessage\n}\n","import { useCallback, useState } from \"react\"\n\nexport function useDisclosure(initial = false) {\n const [open, setOpen] = useState(initial)\n const onOpen = useCallback(() => setOpen(true), [])\n const onClose = useCallback(() => setOpen(false), [])\n const onToggle = useCallback(() => setOpen((v) => !v), [])\n return { open, onOpen, onClose, onToggle, setOpen }\n}\n","import { toast } from \"sonner\"\nimport { useCallback } from \"react\"\n\ntype ToastStatus = \"success\" | \"error\" | \"info\" | \"warning\"\n\nexport function useCustomToast() {\n const showToast = useCallback(\n (title: string, description?: string, status: ToastStatus = \"success\") => {\n switch (status) {\n case \"success\":\n toast.success(title, { description })\n break\n case \"error\":\n toast.error(title, { description })\n break\n case \"info\":\n toast.info(title, { description })\n break\n case \"warning\":\n toast.warning(title, { description })\n break\n }\n },\n [],\n )\n\n return showToast\n}\n\nexport { toast }\n"],"mappings":";AAAA,SAAS,eAAe,YAAY,WAAW,gBAAgB;AAsD3D;AAvCJ,IAAM,eAAmC;AAAA,EACvC,OAAO;AAAA,EACP,UAAU,MAAM;AAClB;AAEA,IAAM,uBAAuB,cAAkC,YAAY;AAEpE,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,eAAe;AAAA,EACf,aAAa;AAAA,EACb,GAAG;AACL,GAAuB;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAI;AAAA,IACxB,MAAO,aAAa,QAAQ,UAAU,KAAe;AAAA,EACvD;AAEA,YAAU,MAAM;AACd,UAAM,OAAO,OAAO,SAAS;AAC7B,SAAK,UAAU,OAAO,SAAS,MAAM;AACrC,QAAI,UAAU,UAAU;AACtB,YAAM,cAAc,OAAO,WAAW,8BAA8B,EAAE,UAClE,SACA;AACJ,WAAK,UAAU,IAAI,WAAW;AAC9B;AAAA,IACF;AACA,SAAK,UAAU,IAAI,KAAK;AAAA,EAC1B,GAAG,CAAC,KAAK,CAAC;AAEV,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,UAAU,CAACA,WAAiB;AAC1B,mBAAa,QAAQ,YAAYA,MAAK;AACtC,eAASA,MAAK;AAAA,IAChB;AAAA,EACF;AAEA,SACE,oBAAC,qBAAqB,UAArB,EAA+B,GAAG,OAAO,OACvC,UACH;AAEJ;AAEO,SAAS,WAAW;AACzB,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,8CAA8C;AAAA,EAChE;AACA,SAAO;AACT;;;AClEA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S,cAAc,UAAU,OAAO;AAC7C,QAAM,CAAC,MAAM,OAAO,IAAIA,UAAS,OAAO;AACxC,QAAM,SAAS,YAAY,MAAM,QAAQ,IAAI,GAAG,CAAC,CAAC;AAClD,QAAM,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,CAAC,CAAC;AACpD,QAAM,WAAW,YAAY,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AACzD,SAAO,EAAE,MAAM,QAAQ,SAAS,UAAU,QAAQ;AACpD;;;ACRA,SAAS,aAAa;AACtB,SAAS,eAAAC,oBAAmB;AAIrB,SAAS,iBAAiB;AAC/B,QAAM,YAAYA;AAAA,IAChB,CAAC,OAAe,aAAsB,SAAsB,cAAc;AACxE,cAAQ,QAAQ;AAAA,QACd,KAAK;AACH,gBAAM,QAAQ,OAAO,EAAE,YAAY,CAAC;AACpC;AAAA,QACF,KAAK;AACH,gBAAM,MAAM,OAAO,EAAE,YAAY,CAAC;AAClC;AAAA,QACF,KAAK;AACH,gBAAM,KAAK,OAAO,EAAE,YAAY,CAAC;AACjC;AAAA,QACF,KAAK;AACH,gBAAM,QAAQ,OAAO,EAAE,YAAY,CAAC;AACpC;AAAA,MACJ;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AACT;","names":["theme","jsx","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","_","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","useState","Fragment","jsx","Fragment","jsx","jsxs","DropdownMenu","Fragment","jsx","jsxs","jsx","jsxs","useState","useState","useCallback"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ChevronLeft, ChevronRight, Menu } from "lucide-react"
|
|
2
|
+
import { type ReactNode, useState } from "react"
|
|
3
|
+
import { cn } from "../lib/utils"
|
|
4
|
+
import { SidebarNav, type NavItem } from "./sidebar-nav"
|
|
5
|
+
import type { RenderLink } from "./types"
|
|
6
|
+
import { defaultRenderLink } from "./types"
|
|
7
|
+
import { UserMenu, type AppUser, type UserMenuItem } from "./user-menu"
|
|
8
|
+
|
|
9
|
+
export interface AppShellProps {
|
|
10
|
+
brand: ReactNode
|
|
11
|
+
brandCollapsed?: ReactNode
|
|
12
|
+
navItems: NavItem[]
|
|
13
|
+
activePath: string
|
|
14
|
+
isActive?: (item: NavItem, activePath: string) => boolean
|
|
15
|
+
isAdmin?: boolean
|
|
16
|
+
user?: AppUser
|
|
17
|
+
userMenuItems?: UserMenuItem[]
|
|
18
|
+
onLogout?: () => void
|
|
19
|
+
renderLink?: RenderLink
|
|
20
|
+
headerActions?: ReactNode
|
|
21
|
+
collapsible?: boolean
|
|
22
|
+
defaultCollapsed?: boolean
|
|
23
|
+
children: ReactNode
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function AppShell({
|
|
27
|
+
brand,
|
|
28
|
+
brandCollapsed,
|
|
29
|
+
navItems,
|
|
30
|
+
activePath,
|
|
31
|
+
isActive,
|
|
32
|
+
isAdmin = false,
|
|
33
|
+
user,
|
|
34
|
+
userMenuItems,
|
|
35
|
+
onLogout,
|
|
36
|
+
renderLink = defaultRenderLink,
|
|
37
|
+
headerActions,
|
|
38
|
+
collapsible = true,
|
|
39
|
+
defaultCollapsed = false,
|
|
40
|
+
children,
|
|
41
|
+
}: AppShellProps) {
|
|
42
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed)
|
|
43
|
+
const [mobileOpen, setMobileOpen] = useState(false)
|
|
44
|
+
|
|
45
|
+
const nav = (isCollapsed: boolean, onNavigate?: () => void) => (
|
|
46
|
+
<SidebarNav
|
|
47
|
+
items={navItems}
|
|
48
|
+
activePath={activePath}
|
|
49
|
+
isActive={isActive}
|
|
50
|
+
isAdmin={isAdmin}
|
|
51
|
+
isCollapsed={isCollapsed}
|
|
52
|
+
renderLink={renderLink}
|
|
53
|
+
onNavigate={onNavigate}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className="flex h-screen overflow-hidden bg-background">
|
|
59
|
+
{/* Desktop sidebar */}
|
|
60
|
+
<aside
|
|
61
|
+
className={cn(
|
|
62
|
+
"hidden shrink-0 flex-col border-r bg-card transition-all duration-300 md:flex",
|
|
63
|
+
collapsed ? "w-16" : "w-60",
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
<div className="flex h-14 shrink-0 items-center border-b px-4">
|
|
67
|
+
{collapsed ? (brandCollapsed ?? brand) : brand}
|
|
68
|
+
</div>
|
|
69
|
+
<div className="flex-1 overflow-y-auto px-2 py-4">{nav(collapsed)}</div>
|
|
70
|
+
{collapsible && (
|
|
71
|
+
<div className="border-t p-2">
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
onClick={() => setCollapsed((v) => !v)}
|
|
75
|
+
className="flex w-full items-center justify-center rounded-md px-2 py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
76
|
+
aria-label={collapsed ? "Expandir menu" : "Recolher menu"}
|
|
77
|
+
>
|
|
78
|
+
{collapsed ? <ChevronRight className="h-4 w-4" /> : <ChevronLeft className="h-4 w-4" />}
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
)}
|
|
82
|
+
</aside>
|
|
83
|
+
|
|
84
|
+
{/* Mobile drawer */}
|
|
85
|
+
<div
|
|
86
|
+
className={cn(
|
|
87
|
+
"fixed inset-0 z-50 transition-opacity duration-300 md:hidden",
|
|
88
|
+
mobileOpen ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
|
|
89
|
+
)}
|
|
90
|
+
onClick={() => setMobileOpen(false)}
|
|
91
|
+
>
|
|
92
|
+
<div className="absolute inset-0 bg-black/50" />
|
|
93
|
+
<div
|
|
94
|
+
className={cn(
|
|
95
|
+
"absolute left-0 top-0 flex h-full w-64 flex-col border-r bg-card transition-transform duration-300",
|
|
96
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full",
|
|
97
|
+
)}
|
|
98
|
+
onClick={(e) => e.stopPropagation()}
|
|
99
|
+
>
|
|
100
|
+
<div className="flex h-14 shrink-0 items-center border-b px-4">{brand}</div>
|
|
101
|
+
<div className="flex-1 overflow-y-auto px-2 py-4">{nav(false, () => setMobileOpen(false))}</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
{/* Main column */}
|
|
106
|
+
<div className="flex flex-1 flex-col overflow-hidden">
|
|
107
|
+
<header className="flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4">
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
onClick={() => setMobileOpen(true)}
|
|
111
|
+
className="inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden"
|
|
112
|
+
aria-label="Abrir menu"
|
|
113
|
+
>
|
|
114
|
+
<Menu className="h-4 w-4" />
|
|
115
|
+
</button>
|
|
116
|
+
<div className="ml-auto flex items-center gap-2">
|
|
117
|
+
{headerActions}
|
|
118
|
+
{(user || onLogout) && (
|
|
119
|
+
<UserMenu user={user} items={userMenuItems} onLogout={onLogout} renderLink={renderLink} />
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
</header>
|
|
123
|
+
<main className="flex-1 overflow-y-auto">{children}</main>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Fragment, type ReactNode } from "react"
|
|
2
|
+
import { cn } from "../lib/utils"
|
|
3
|
+
import type { RenderLink } from "./types"
|
|
4
|
+
import { defaultRenderLink } from "./types"
|
|
5
|
+
|
|
6
|
+
export interface NavItem {
|
|
7
|
+
label: string
|
|
8
|
+
href: string
|
|
9
|
+
icon?: ReactNode
|
|
10
|
+
adminOnly?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SidebarNavProps {
|
|
14
|
+
items: NavItem[]
|
|
15
|
+
activePath: string
|
|
16
|
+
isActive?: (item: NavItem, activePath: string) => boolean
|
|
17
|
+
isAdmin?: boolean
|
|
18
|
+
isCollapsed?: boolean
|
|
19
|
+
renderLink?: RenderLink
|
|
20
|
+
onNavigate?: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function defaultIsActive(item: NavItem, activePath: string): boolean {
|
|
24
|
+
if (item.href === "/") return activePath === "/"
|
|
25
|
+
return activePath === item.href || activePath.startsWith(item.href + "/")
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function SidebarNav({
|
|
29
|
+
items,
|
|
30
|
+
activePath,
|
|
31
|
+
isActive = defaultIsActive,
|
|
32
|
+
isAdmin = false,
|
|
33
|
+
isCollapsed = false,
|
|
34
|
+
renderLink = defaultRenderLink,
|
|
35
|
+
onNavigate,
|
|
36
|
+
}: SidebarNavProps) {
|
|
37
|
+
const visible = items.filter((item) => !item.adminOnly || isAdmin)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<nav className="flex flex-col gap-1">
|
|
41
|
+
{visible.map((item) => {
|
|
42
|
+
const active = isActive(item, activePath)
|
|
43
|
+
const link = renderLink({
|
|
44
|
+
href: item.href,
|
|
45
|
+
onClick: onNavigate,
|
|
46
|
+
title: isCollapsed ? item.label : undefined,
|
|
47
|
+
"aria-current": active ? "page" : undefined,
|
|
48
|
+
className: cn(
|
|
49
|
+
"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
|
50
|
+
active
|
|
51
|
+
? "bg-accent text-accent-foreground font-semibold"
|
|
52
|
+
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
53
|
+
isCollapsed && "justify-center px-2",
|
|
54
|
+
),
|
|
55
|
+
children: (
|
|
56
|
+
<>
|
|
57
|
+
{item.icon && <span className="shrink-0">{item.icon}</span>}
|
|
58
|
+
{!isCollapsed && <span className="truncate">{item.label}</span>}
|
|
59
|
+
</>
|
|
60
|
+
),
|
|
61
|
+
})
|
|
62
|
+
return <Fragment key={item.href}>{link}</Fragment>
|
|
63
|
+
})}
|
|
64
|
+
</nav>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
|
+
|
|
3
|
+
export interface RenderLinkProps {
|
|
4
|
+
href: string
|
|
5
|
+
className?: string
|
|
6
|
+
children: ReactNode
|
|
7
|
+
onClick?: () => void
|
|
8
|
+
title?: string
|
|
9
|
+
"aria-current"?: "page"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type RenderLink = (props: RenderLinkProps) => ReactNode
|
|
13
|
+
|
|
14
|
+
export const defaultRenderLink: RenderLink = ({ children, ...props }) => (
|
|
15
|
+
<a {...props}>{children}</a>
|
|
16
|
+
)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as DropdownMenu from "@radix-ui/react-dropdown-menu"
|
|
2
|
+
import { LogOut, User } from "lucide-react"
|
|
3
|
+
import type { ReactNode } from "react"
|
|
4
|
+
import { cn } from "../lib/utils"
|
|
5
|
+
import type { RenderLink } from "./types"
|
|
6
|
+
import { defaultRenderLink } from "./types"
|
|
7
|
+
|
|
8
|
+
export interface AppUser {
|
|
9
|
+
name?: string
|
|
10
|
+
email?: string
|
|
11
|
+
avatarUrl?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface UserMenuItem {
|
|
15
|
+
label: string
|
|
16
|
+
icon?: ReactNode
|
|
17
|
+
href?: string
|
|
18
|
+
onClick?: () => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface UserMenuProps {
|
|
22
|
+
user?: AppUser
|
|
23
|
+
items?: UserMenuItem[]
|
|
24
|
+
onLogout?: () => void
|
|
25
|
+
logoutLabel?: string
|
|
26
|
+
renderLink?: RenderLink
|
|
27
|
+
align?: "start" | "center" | "end"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function initials(user?: AppUser): string {
|
|
31
|
+
const source = user?.name?.trim() || user?.email?.trim()
|
|
32
|
+
if (!source) return ""
|
|
33
|
+
const parts = source.split(/\s+/)
|
|
34
|
+
if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase()
|
|
35
|
+
return source.slice(0, 2).toUpperCase()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const itemClass =
|
|
39
|
+
"flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent"
|
|
40
|
+
|
|
41
|
+
export function UserMenu({
|
|
42
|
+
user,
|
|
43
|
+
items = [],
|
|
44
|
+
onLogout,
|
|
45
|
+
logoutLabel = "Sair",
|
|
46
|
+
renderLink = defaultRenderLink,
|
|
47
|
+
align = "end",
|
|
48
|
+
}: UserMenuProps) {
|
|
49
|
+
const label = initials(user)
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<DropdownMenu.Root>
|
|
53
|
+
<DropdownMenu.Trigger asChild>
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
className="inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
57
|
+
aria-label="Menu do usuário"
|
|
58
|
+
data-testid="user-menu"
|
|
59
|
+
>
|
|
60
|
+
{user?.avatarUrl ? (
|
|
61
|
+
<img src={user.avatarUrl} alt={user.name ?? user.email ?? "Avatar"} className="h-full w-full object-cover" />
|
|
62
|
+
) : label ? (
|
|
63
|
+
<span>{label}</span>
|
|
64
|
+
) : (
|
|
65
|
+
<User className="h-4 w-4" />
|
|
66
|
+
)}
|
|
67
|
+
</button>
|
|
68
|
+
</DropdownMenu.Trigger>
|
|
69
|
+
<DropdownMenu.Portal>
|
|
70
|
+
<DropdownMenu.Content
|
|
71
|
+
align={align}
|
|
72
|
+
sideOffset={6}
|
|
73
|
+
className="z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95"
|
|
74
|
+
>
|
|
75
|
+
{(user?.name || user?.email) && (
|
|
76
|
+
<>
|
|
77
|
+
<div className="px-2 py-1.5">
|
|
78
|
+
{user.name && <p className="truncate text-sm font-medium">{user.name}</p>}
|
|
79
|
+
{user.email && <p className="truncate text-xs text-muted-foreground">{user.email}</p>}
|
|
80
|
+
</div>
|
|
81
|
+
<DropdownMenu.Separator className="-mx-1 my-1 h-px bg-border" />
|
|
82
|
+
</>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
{items.map((item) =>
|
|
86
|
+
item.href ? (
|
|
87
|
+
<DropdownMenu.Item key={item.label} asChild>
|
|
88
|
+
{renderLink({ href: item.href, className: itemClass, children: (
|
|
89
|
+
<>
|
|
90
|
+
{item.icon}
|
|
91
|
+
{item.label}
|
|
92
|
+
</>
|
|
93
|
+
) })}
|
|
94
|
+
</DropdownMenu.Item>
|
|
95
|
+
) : (
|
|
96
|
+
<DropdownMenu.Item key={item.label} className={itemClass} onClick={item.onClick}>
|
|
97
|
+
{item.icon}
|
|
98
|
+
{item.label}
|
|
99
|
+
</DropdownMenu.Item>
|
|
100
|
+
),
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{onLogout && (
|
|
104
|
+
<>
|
|
105
|
+
{items.length > 0 && <DropdownMenu.Separator className="-mx-1 my-1 h-px bg-border" />}
|
|
106
|
+
<DropdownMenu.Item className={cn(itemClass, "text-destructive focus:bg-destructive/10")} onClick={onLogout}>
|
|
107
|
+
<LogOut className="h-4 w-4" />
|
|
108
|
+
{logoutLabel}
|
|
109
|
+
</DropdownMenu.Item>
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
112
|
+
</DropdownMenu.Content>
|
|
113
|
+
</DropdownMenu.Portal>
|
|
114
|
+
</DropdownMenu.Root>
|
|
115
|
+
)
|
|
116
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,16 @@ export { MobileCardList } from "./components/mobile-card-list"
|
|
|
20
20
|
export { ResponsiveDataView } from "./components/responsive-data-view"
|
|
21
21
|
export { Toaster } from "./components/toaster"
|
|
22
22
|
|
|
23
|
+
// App shell
|
|
24
|
+
export { AppShell } from "./components/app-shell"
|
|
25
|
+
export type { AppShellProps } from "./components/app-shell"
|
|
26
|
+
export { SidebarNav } from "./components/sidebar-nav"
|
|
27
|
+
export type { NavItem, SidebarNavProps } from "./components/sidebar-nav"
|
|
28
|
+
export { UserMenu } from "./components/user-menu"
|
|
29
|
+
export type { AppUser, UserMenuItem, UserMenuProps } from "./components/user-menu"
|
|
30
|
+
export { defaultRenderLink } from "./components/types"
|
|
31
|
+
export type { RenderLink, RenderLinkProps } from "./components/types"
|
|
32
|
+
|
|
23
33
|
// Utilities
|
|
24
34
|
export { cn } from "./lib/utils"
|
|
25
35
|
export { extractApiError } from "./lib/api-error"
|