@iclips/ui 0.0.16 → 0.0.18

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default from 'react';
3
+ import React__default, { RefObject } from 'react';
4
4
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
5
5
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -129,6 +129,136 @@ declare const Button: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttrib
129
129
  asChild?: boolean;
130
130
  }, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
131
131
 
132
+ interface DadosContrato {
133
+ numeroContrato: string;
134
+ dataEmissao: string;
135
+ dataInicio: string;
136
+ dataTermino: string;
137
+ cliente: {
138
+ nome: string;
139
+ cnpj?: string;
140
+ endereco?: string;
141
+ representante?: string;
142
+ email?: string;
143
+ telefone?: string;
144
+ };
145
+ agencia: {
146
+ nome: string;
147
+ cnpj?: string;
148
+ endereco?: string;
149
+ representante?: string;
150
+ email?: string;
151
+ telefone?: string;
152
+ };
153
+ valorFee: number;
154
+ totalHoras: number;
155
+ valorHora?: number;
156
+ condicoesPagamento: string;
157
+ formaPagamento?: string;
158
+ servicos?: Array<{
159
+ nome: string;
160
+ descricao?: string;
161
+ horasEstimadas?: number;
162
+ }>;
163
+ clausulas?: Array<{
164
+ titulo: string;
165
+ conteudo: string;
166
+ }>;
167
+ observacoes?: string;
168
+ }
169
+ interface ContractTemplateProps {
170
+ data: DadosContrato;
171
+ showPreview?: boolean;
172
+ logo?: string;
173
+ showServices?: boolean;
174
+ }
175
+ declare function ContractTemplate({ data, showPreview, logo, showServices, }: ContractTemplateProps): react_jsx_runtime.JSX.Element;
176
+ /**
177
+ * Dados de exemplo para o contrato
178
+ * Use este objeto para testar o componente ContractTemplate
179
+ */
180
+ declare const dadosContratoExemplo: DadosContrato;
181
+
182
+ interface ContractPrintProps {
183
+ /** Dados do contrato */
184
+ data: DadosContrato;
185
+ /** URL ou caminho do logo da empresa */
186
+ logo?: string;
187
+ /** Mostrar barra de ações (imprimir/download) */
188
+ showActions?: boolean;
189
+ /** Mostrar informações resumidas do contrato */
190
+ showSummary?: boolean;
191
+ /** Mostrar seção de serviços */
192
+ showServices?: boolean;
193
+ /** Mostrar informações sobre o template */
194
+ showInfo?: boolean;
195
+ /** Classe CSS adicional */
196
+ className?: string;
197
+ /** Callbacks de impressão */
198
+ onPrintStart?: () => void;
199
+ onPrintSuccess?: () => void;
200
+ onPrintError?: (error: Error) => void;
201
+ /** Callbacks de download */
202
+ onDownloadStart?: () => void;
203
+ onDownloadSuccess?: () => void;
204
+ onDownloadError?: (error: Error) => void;
205
+ }
206
+ /**
207
+ * Componente wrapper completo para exibir e imprimir contratos
208
+ *
209
+ * Inclui:
210
+ * - Preview do contrato
211
+ * - Botões de ação (Imprimir/Download PDF)
212
+ * - Informações resumidas
213
+ * - Todas as funcionalidades prontas
214
+ *
215
+ * @example
216
+ * ```tsx
217
+ * import { ContractPrint, dadosContratoExemplo } from '@iclips/design-system';
218
+ *
219
+ * function MinhaPage() {
220
+ * return (
221
+ * <ContractPrint
222
+ * data={dadosContratoExemplo}
223
+ * logo="/logo.png"
224
+ * showActions
225
+ * showSummary
226
+ * />
227
+ * );
228
+ * }
229
+ * ```
230
+ */
231
+ declare function ContractPrint({ data, logo, showActions, showSummary, showServices, showInfo, className, onPrintStart, onPrintSuccess, onPrintError, onDownloadStart, onDownloadSuccess, onDownloadError, }: ContractPrintProps): react_jsx_runtime.JSX.Element;
232
+ /**
233
+ * Componente simplificado apenas com o preview do contrato
234
+ * Útil quando você quer construir sua própria UI de ações
235
+ *
236
+ * @example
237
+ * ```tsx
238
+ * import { ContractPrintPreview, dadosContratoExemplo } from '@iclips/design-system';
239
+ *
240
+ * function MinhaPage() {
241
+ * const printRef = useRef<HTMLDivElement>(null);
242
+ *
243
+ * return (
244
+ * <div>
245
+ * <MeusPropriosBotoes printRef={printRef} />
246
+ * <ContractPrintPreview
247
+ * ref={printRef}
248
+ * data={dadosContratoExemplo}
249
+ * />
250
+ * </div>
251
+ * );
252
+ * }
253
+ * ```
254
+ */
255
+ declare const ContractPrintPreview: React$1.ForwardRefExoticComponent<{
256
+ data: DadosContrato;
257
+ logo?: string;
258
+ showServices?: boolean;
259
+ className?: string;
260
+ } & React$1.RefAttributes<HTMLDivElement>>;
261
+
132
262
  declare function Calendar({ className, classNames, showOutsideDays, ...props }: React$1.ComponentProps<typeof DayPicker>): react_jsx_runtime.JSX.Element;
133
263
 
134
264
  declare function Card({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
@@ -608,6 +738,245 @@ declare function cn(...inputs: ClassValue[]): string;
608
738
 
609
739
  declare function useIsMobile(): boolean;
610
740
 
741
+ /**
742
+ * Opções para o hook de impressão de contratos
743
+ */
744
+ interface UsePrintContractOptions {
745
+ /** Callback chamado antes de iniciar a impressão */
746
+ onPrintStart?: () => void;
747
+ /** Callback chamado após impressão bem-sucedida */
748
+ onPrintSuccess?: () => void;
749
+ /** Callback chamado em caso de erro */
750
+ onPrintError?: (error: Error) => void;
751
+ /** Callback chamado antes de iniciar download do PDF */
752
+ onDownloadStart?: () => void;
753
+ /** Callback chamado após download bem-sucedido */
754
+ onDownloadSuccess?: () => void;
755
+ /** Callback chamado em caso de erro no download */
756
+ onDownloadError?: (error: Error) => void;
757
+ }
758
+ /**
759
+ * Hook para gerenciar impressão e download de contratos
760
+ *
761
+ * @example
762
+ * ```tsx
763
+ * const printRef = useRef<HTMLDivElement>(null);
764
+ * const { printContract, downloadPDF } = usePrintContract(printRef, 'FEE-2024-001', {
765
+ * onPrintSuccess: () => toast.success('Impresso!'),
766
+ * onDownloadSuccess: () => toast.success('PDF gerado!'),
767
+ * });
768
+ * ```
769
+ */
770
+ declare function usePrintContract(contentRef: RefObject<HTMLElement | null>, contractNumber?: string, options?: UsePrintContractOptions): {
771
+ /** Imprime o contrato em nova janela */
772
+ printContract: () => void;
773
+ /** Gera e baixa PDF do contrato (implementação simulada) */
774
+ downloadPDF: () => void;
775
+ };
776
+
611
777
  declare function ImageWithFallback(props: React__default.ImgHTMLAttributes<HTMLImageElement>): react_jsx_runtime.JSX.Element;
612
778
 
613
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppLayout, type AppLayoutProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DateRangePicker, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, ImageWithFallback, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, KanbanCard, type KanbanCardAssignee, type KanbanCardProps, type KanbanCardTag, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, type PrimaryNavItem, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, type SecondaryNavItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Toaster as Sonner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TimePicker, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnderlineTabs, UnderlineTabsContent, UnderlineTabsList, UnderlineTabsTrigger, badgeVariants, buttonVariants, cn, navigationMenuTriggerStyle, toggleVariants, useFormField, useIsMobile, useSidebar };
779
+ interface ProposalData {
780
+ proposalNumber: string;
781
+ issueDate: string;
782
+ validUntil: string;
783
+ client: {
784
+ name: string;
785
+ contact?: string;
786
+ email?: string;
787
+ phone?: string;
788
+ };
789
+ agency: {
790
+ name: string;
791
+ representative?: string;
792
+ email?: string;
793
+ phone?: string;
794
+ };
795
+ projectTitle: string;
796
+ projectDescription?: string;
797
+ objectives?: string[];
798
+ items: Array<{
799
+ name: string;
800
+ description?: string;
801
+ quantity?: number;
802
+ unitPrice?: number;
803
+ totalPrice: number;
804
+ }>;
805
+ subtotal: number;
806
+ discount?: number;
807
+ total: number;
808
+ paymentConditions?: string;
809
+ deliveryTime?: string;
810
+ notes?: string;
811
+ }
812
+ interface ProposalTemplateProps {
813
+ data: ProposalData;
814
+ showPreview?: boolean;
815
+ logo?: string;
816
+ }
817
+ declare function ProposalTemplate({ data, showPreview, logo, }: ProposalTemplateProps): react_jsx_runtime.JSX.Element;
818
+
819
+ interface PrintHeaderProps {
820
+ /**
821
+ * URL ou path do logo da empresa
822
+ */
823
+ logo?: string;
824
+ /**
825
+ * Nome da empresa
826
+ */
827
+ companyName?: string;
828
+ /**
829
+ * Informações de contato
830
+ */
831
+ contactInfo?: {
832
+ address?: string;
833
+ phone?: string;
834
+ email?: string;
835
+ website?: string;
836
+ };
837
+ /**
838
+ * Tipo de documento (aparece no canto direito)
839
+ */
840
+ documentType?: string;
841
+ /**
842
+ * Número do documento
843
+ */
844
+ documentNumber?: string;
845
+ /**
846
+ * Data de emissão
847
+ */
848
+ issueDate?: string;
849
+ }
850
+ declare function PrintHeader({ logo, companyName, contactInfo, documentType, documentNumber, issueDate, }: PrintHeaderProps): react_jsx_runtime.JSX.Element;
851
+
852
+ interface PrintFooterProps {
853
+ /**
854
+ * Número da página atual
855
+ */
856
+ pageNumber?: number;
857
+ /**
858
+ * Total de páginas
859
+ */
860
+ totalPages?: number;
861
+ /**
862
+ * Texto de rodapé customizado
863
+ */
864
+ footerText?: string;
865
+ /**
866
+ * Mostrar data de geração
867
+ */
868
+ showGeneratedDate?: boolean;
869
+ }
870
+ declare function PrintFooter({ pageNumber, totalPages, footerText, showGeneratedDate, }: PrintFooterProps): react_jsx_runtime.JSX.Element;
871
+
872
+ interface PrintSectionProps {
873
+ /**
874
+ * Título da seção
875
+ */
876
+ title?: string;
877
+ /**
878
+ * Subtítulo da seção
879
+ */
880
+ subtitle?: string;
881
+ /**
882
+ * Conteúdo da seção
883
+ */
884
+ children: React.ReactNode;
885
+ /**
886
+ * Classe CSS adicional
887
+ */
888
+ className?: string;
889
+ /**
890
+ * Evitar quebra de página
891
+ */
892
+ avoidBreak?: boolean;
893
+ /**
894
+ * Forçar quebra de página antes
895
+ */
896
+ pageBreak?: boolean;
897
+ }
898
+ declare function PrintSection({ title, subtitle, children, className, avoidBreak, pageBreak, }: PrintSectionProps): react_jsx_runtime.JSX.Element;
899
+
900
+ interface Column {
901
+ header: string;
902
+ key: string;
903
+ align?: "left" | "center" | "right";
904
+ width?: string;
905
+ render?: (value: any, row: any) => React.ReactNode;
906
+ }
907
+ interface PrintTableProps {
908
+ /**
909
+ * Colunas da tabela
910
+ */
911
+ columns: Column[];
912
+ /**
913
+ * Dados da tabela
914
+ */
915
+ data: any[];
916
+ /**
917
+ * Título da tabela (opcional)
918
+ */
919
+ title?: string;
920
+ /**
921
+ * Mostrar zebra (linhas alternadas)
922
+ */
923
+ striped?: boolean;
924
+ /**
925
+ * Mostrar borda
926
+ */
927
+ bordered?: boolean;
928
+ /**
929
+ * Densidade (espaçamento)
930
+ */
931
+ density?: "compact" | "normal" | "comfortable";
932
+ }
933
+ declare function PrintTable({ columns, data, title, striped, bordered, density, }: PrintTableProps): react_jsx_runtime.JSX.Element;
934
+
935
+ interface SignatureField {
936
+ label: string;
937
+ name?: string;
938
+ role?: string;
939
+ date?: string;
940
+ }
941
+ interface PrintSignatureProps {
942
+ /**
943
+ * Lista de assinaturas necessárias
944
+ */
945
+ signatures: SignatureField[];
946
+ /**
947
+ * Layout das assinaturas
948
+ */
949
+ layout?: "horizontal" | "vertical";
950
+ /**
951
+ * Mostrar linha de assinatura
952
+ */
953
+ showLine?: boolean;
954
+ /**
955
+ * Texto de instrução
956
+ */
957
+ instructionText?: string;
958
+ }
959
+ declare function PrintSignature({ signatures, layout, showLine, instructionText, }: PrintSignatureProps): react_jsx_runtime.JSX.Element;
960
+
961
+ interface InfoItem {
962
+ label: string;
963
+ value: string | React.ReactNode;
964
+ highlight?: boolean;
965
+ }
966
+ interface PrintInfoGridProps {
967
+ /**
968
+ * Lista de informações a serem exibidas
969
+ */
970
+ items: InfoItem[];
971
+ /**
972
+ * Número de colunas
973
+ */
974
+ columns?: 1 | 2 | 3 | 4;
975
+ /**
976
+ * Classe CSS adicional
977
+ */
978
+ className?: string;
979
+ }
980
+ declare function PrintInfoGrid({ items, columns, className, }: PrintInfoGridProps): react_jsx_runtime.JSX.Element;
981
+
982
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppLayout, type AppLayoutProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContractPrint, ContractPrintPreview, type ContractPrintProps, ContractTemplate, type DadosContrato, DateRangePicker, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, ImageWithFallback, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, KanbanCard, type KanbanCardAssignee, type KanbanCardProps, type KanbanCardTag, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, type PrimaryNavItem, PrintFooter, PrintHeader, PrintInfoGrid, PrintSection, PrintSignature, PrintTable, Progress, type ProposalData, ProposalTemplate, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, type SecondaryNavItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Toaster as Sonner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TimePicker, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnderlineTabs, UnderlineTabsContent, UnderlineTabsList, UnderlineTabsTrigger, type UsePrintContractOptions, badgeVariants, buttonVariants, cn, dadosContratoExemplo, navigationMenuTriggerStyle, toggleVariants, useFormField, useIsMobile, usePrintContract, useSidebar };