@cnc-ti/layout-basic 8.5.0 → 8.7.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/dist/index.css +756 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +539 -37
- package/dist/index.d.ts +539 -37
- package/dist/index.js +2655 -329
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2617 -338
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -306,6 +306,11 @@ interface InputProps extends React$1.ComponentProps<"input"> {
|
|
|
306
306
|
}
|
|
307
307
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
308
308
|
|
|
309
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
310
|
+
label?: string;
|
|
311
|
+
}
|
|
312
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
313
|
+
|
|
309
314
|
interface CheckboxProps extends React$1.ComponentProps<"input"> {
|
|
310
315
|
label?: string;
|
|
311
316
|
}
|
|
@@ -347,6 +352,20 @@ interface BadgeProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
|
347
352
|
*/
|
|
348
353
|
declare const Badge: ({ variant, rounded, size, className, ...rest }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
349
354
|
|
|
355
|
+
interface AvatarProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
356
|
+
/** URL da imagem do usuário. Se ausente ou falhar, exibe o fallback. */
|
|
357
|
+
src?: string | null;
|
|
358
|
+
/** Texto alternativo da imagem. */
|
|
359
|
+
alt?: string;
|
|
360
|
+
/** Conteúdo de fallback quando não há imagem (ex.: iniciais do nome). */
|
|
361
|
+
fallback?: React$1.ReactNode;
|
|
362
|
+
/** Tamanho do avatar. Padrão: "md". */
|
|
363
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
364
|
+
/** Indica carregamento (esqueleto pulsante). */
|
|
365
|
+
isLoading?: boolean;
|
|
366
|
+
}
|
|
367
|
+
declare function Avatar({ src, alt, fallback, size, isLoading, className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
368
|
+
|
|
350
369
|
/**
|
|
351
370
|
* Componente principal do Card.
|
|
352
371
|
* Utilizado para agrupar visualmente conteúdos relacionados.
|
|
@@ -457,27 +476,75 @@ interface TitleProps {
|
|
|
457
476
|
*/
|
|
458
477
|
declare function Title({ title, as: Component }: TitleProps): react_jsx_runtime.JSX.Element;
|
|
459
478
|
|
|
479
|
+
interface EmptyStateProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
480
|
+
icon?: React$1.ReactNode;
|
|
481
|
+
title: string;
|
|
482
|
+
description?: React$1.ReactNode;
|
|
483
|
+
action?: React$1.ReactNode;
|
|
484
|
+
minHeight?: string;
|
|
485
|
+
}
|
|
486
|
+
declare function EmptyState({ icon, title, description, action, minHeight, className, ...props }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Regra de gênero para o sufixo "encontrad(o|a)s".
|
|
490
|
+
* Se omitido, usa heurística: última letra do `resourceName` é "a" → feminina.
|
|
491
|
+
*/
|
|
492
|
+
type ResultMetadataGender = "masc" | "fem";
|
|
493
|
+
interface ResultMetadataProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
494
|
+
/** Nome do recurso a ser exibido (ex: "Negociações", "Subgrupos"). */
|
|
495
|
+
resourceName: string;
|
|
496
|
+
/** Total de registros retornados pela API. */
|
|
497
|
+
total: number;
|
|
498
|
+
/** Quantidade de registros exibidos na tela. */
|
|
499
|
+
displayed: number;
|
|
500
|
+
/** Indica se os dados ainda estão sendo carregados (opcional). */
|
|
501
|
+
isLoading?: boolean;
|
|
502
|
+
/**
|
|
503
|
+
* Gênero forçado para "encontrado(s)" / "encontrada(s)".
|
|
504
|
+
* Use quando a heurística da última letra falha (ex.: "Sistema").
|
|
505
|
+
*/
|
|
506
|
+
forceWordGender?: ResultMetadataGender;
|
|
507
|
+
/**
|
|
508
|
+
* A partir de quantos registros exibidos o aviso
|
|
509
|
+
* "Exibindo os X primeiros registros..." aparece. Padrão: 30.
|
|
510
|
+
*/
|
|
511
|
+
truncationThreshold?: number;
|
|
512
|
+
}
|
|
513
|
+
declare function ResultMetadata({ resourceName, total, displayed, isLoading, forceWordGender, truncationThreshold, className, ...props }: ResultMetadataProps): react_jsx_runtime.JSX.Element;
|
|
514
|
+
|
|
515
|
+
interface LabelValueProps {
|
|
516
|
+
/** Rótulo exibido em destaque acima do valor. */
|
|
517
|
+
label: string;
|
|
518
|
+
/** Valor exibido. Vazio ou ausente mostra "-". */
|
|
519
|
+
value?: React$1.ReactNode;
|
|
520
|
+
/** Link externo opcional exibido ao lado do valor. */
|
|
521
|
+
href?: string;
|
|
522
|
+
className?: string;
|
|
523
|
+
valueClassName?: string;
|
|
524
|
+
}
|
|
525
|
+
declare function LabelValue({ label, value, href, className, valueClassName, }: LabelValueProps): react_jsx_runtime.JSX.Element;
|
|
526
|
+
|
|
527
|
+
interface ComboboxFooterAction {
|
|
528
|
+
/** Texto do botão (ex.: "Cadastrar Nova Temática") */
|
|
529
|
+
label: React$1.ReactNode;
|
|
530
|
+
/** App abre modal, chama API, atualiza options */
|
|
531
|
+
onClick: (event: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
532
|
+
/** Variante visual (default: create) */
|
|
533
|
+
variant?: "create" | "confirm" | "outline";
|
|
534
|
+
disabled?: boolean;
|
|
535
|
+
}
|
|
536
|
+
interface ComboboxFooterRenderContext {
|
|
537
|
+
close: () => void;
|
|
538
|
+
}
|
|
539
|
+
|
|
460
540
|
/**
|
|
461
541
|
* Representa uma opção que pode ser selecionada no combobox.
|
|
462
|
-
* @typedef {Object} ItemOption
|
|
463
|
-
* @property {*} value - O valor associado à opção.
|
|
464
|
-
* @property {string} label - O rótulo que será exibido para o usuário.
|
|
465
542
|
*/
|
|
466
543
|
interface ItemOption {
|
|
467
544
|
value: any;
|
|
468
545
|
label: string;
|
|
469
546
|
disabled?: boolean;
|
|
470
547
|
}
|
|
471
|
-
/**
|
|
472
|
-
* Propriedades para o componente Combobox.
|
|
473
|
-
*
|
|
474
|
-
* @typedef {Object} ComboboxProps
|
|
475
|
-
* @property {ItemOption[]} [options] - Lista de opções disponíveis para seleção.
|
|
476
|
-
* @property {string} [placeholder] - Placeholder exibido quando nenhuma opção estiver selecionada.
|
|
477
|
-
* @property {{ placeholder?: string, emptyMessage?: string }} [command] - Configurações do campo de busca da lista de opções.
|
|
478
|
-
* @property {(value: string) => void} [onChange] - Função chamada quando uma opção for selecionada.
|
|
479
|
-
* @property {string} [value] - Valor atualmente selecionado.
|
|
480
|
-
*/
|
|
481
548
|
interface ComboboxProps {
|
|
482
549
|
options?: ItemOption[];
|
|
483
550
|
placeholder?: string;
|
|
@@ -488,36 +555,44 @@ interface ComboboxProps {
|
|
|
488
555
|
onChange?: (value: string) => void;
|
|
489
556
|
value?: string;
|
|
490
557
|
onInput?: (value: string) => void;
|
|
491
|
-
/** Se o popover deve ter comportamento modal (padrão: false para compatibilidade com Drawers) */
|
|
492
558
|
modal?: boolean;
|
|
493
|
-
/** Classes CSS adicionais para o PopoverContent */
|
|
494
559
|
popoverClassName?: string;
|
|
495
|
-
/** Classes CSS adicionais para o botão trigger */
|
|
496
560
|
buttonClassName?: string;
|
|
497
|
-
/** Desabilita o combobox */
|
|
498
561
|
disabled?: boolean;
|
|
562
|
+
/** Botão fixo no rodapé do dropdown (ex.: "Cadastrar novo") */
|
|
563
|
+
footerAction?: ComboboxFooterAction;
|
|
564
|
+
/** Slot customizado no rodapé; tem precedência sobre footerAction */
|
|
565
|
+
renderFooter?: (ctx: ComboboxFooterRenderContext) => React$1.ReactNode;
|
|
499
566
|
}
|
|
567
|
+
declare function Combobox({ options, placeholder, command, onChange, value, onInput, modal, popoverClassName, buttonClassName, disabled, footerAction, renderFooter, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
568
|
+
|
|
500
569
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* @param {ComboboxProps} props - Propriedades do componente.
|
|
504
|
-
* @returns {JSX.Element} O componente renderizado.
|
|
505
|
-
*
|
|
506
|
-
* @example
|
|
507
|
-
* ```tsx
|
|
508
|
-
* <Combobox
|
|
509
|
-
* options={[
|
|
510
|
-
* { value: 'apple', label: 'Apple' },
|
|
511
|
-
* { value: 'banana', label: 'Banana' },
|
|
512
|
-
* ]}
|
|
513
|
-
* placeholder="Selecione uma fruta"
|
|
514
|
-
* command={{ placeholder: 'Buscar...', emptyMessage: 'Nenhum resultado' }}
|
|
515
|
-
* value={selected}
|
|
516
|
-
* onChange={(newValue) => setSelected(newValue)}
|
|
517
|
-
* />
|
|
518
|
-
* ```
|
|
570
|
+
* Representa uma opção selecionável no MultiSelect.
|
|
519
571
|
*/
|
|
520
|
-
|
|
572
|
+
interface MultiSelectOption<TValue extends string = string> {
|
|
573
|
+
value: TValue;
|
|
574
|
+
label: string;
|
|
575
|
+
disabled?: boolean;
|
|
576
|
+
}
|
|
577
|
+
interface MultiSelectProps<TValue extends string = string> {
|
|
578
|
+
options?: MultiSelectOption<TValue>[];
|
|
579
|
+
value?: TValue[];
|
|
580
|
+
onChange?: (value: TValue[]) => void;
|
|
581
|
+
placeholder?: string;
|
|
582
|
+
disabled?: boolean;
|
|
583
|
+
modal?: boolean;
|
|
584
|
+
className?: string;
|
|
585
|
+
buttonClassName?: string;
|
|
586
|
+
popoverClassName?: string;
|
|
587
|
+
command?: {
|
|
588
|
+
placeholder?: string;
|
|
589
|
+
emptyMessage?: React$1.ReactNode;
|
|
590
|
+
};
|
|
591
|
+
selectedCountText?: (count: number) => string;
|
|
592
|
+
footerAction?: ComboboxFooterAction;
|
|
593
|
+
renderFooter?: (ctx: ComboboxFooterRenderContext) => React$1.ReactNode;
|
|
594
|
+
}
|
|
595
|
+
declare function MultiSelect<TValue extends string = string>({ options, value, onChange, placeholder, disabled, modal, className, buttonClassName, popoverClassName, command, selectedCountText, footerAction, renderFooter, }: MultiSelectProps<TValue>): react_jsx_runtime.JSX.Element;
|
|
521
596
|
|
|
522
597
|
declare const Command: React$1.ForwardRefExoticComponent<Omit<{
|
|
523
598
|
children?: React$1.ReactNode;
|
|
@@ -597,6 +672,49 @@ declare const CommandShortcut: {
|
|
|
597
672
|
displayName: string;
|
|
598
673
|
};
|
|
599
674
|
|
|
675
|
+
interface ConfirmDialogProps {
|
|
676
|
+
/** Controla a abertura/fechamento do diálogo. */
|
|
677
|
+
open: boolean;
|
|
678
|
+
onOpenChange: (open: boolean) => void;
|
|
679
|
+
/** Título do diálogo (ex.: "Excluir demanda"). */
|
|
680
|
+
title: string;
|
|
681
|
+
/** Descrição/confirmação da ação (pode conter elementos em destaque). */
|
|
682
|
+
description?: React$1.ReactNode;
|
|
683
|
+
/** Rótulo da ação de confirmação. Padrão: "Confirmar". */
|
|
684
|
+
confirmLabel?: string;
|
|
685
|
+
/** Rótulo da ação de cancelamento. Padrão: "Cancelar". */
|
|
686
|
+
cancelLabel?: string;
|
|
687
|
+
/** Rótulo exibido no botão de confirmação durante o carregamento. */
|
|
688
|
+
loadingLabel?: string;
|
|
689
|
+
/**
|
|
690
|
+
* Chamado ao confirmar. Se retornar uma Promise, o botão entra em estado
|
|
691
|
+
* de carregamento até ela resolver. O fechamento fica a cargo do consumidor.
|
|
692
|
+
*/
|
|
693
|
+
onConfirm?: () => void | Promise<void>;
|
|
694
|
+
/** Ícone exibido no círculo do cabeçalho. Padrão: ícone de lixeira. */
|
|
695
|
+
icon?: React$1.ReactNode;
|
|
696
|
+
/** Exibe o círculo colorido atrás do ícone. Padrão: `true`. */
|
|
697
|
+
showIconBackground?: boolean;
|
|
698
|
+
/** Alinhamento dos botões no rodapé. Padrão: `"center"`. */
|
|
699
|
+
footerAlign?: "center" | "end";
|
|
700
|
+
/** Variante do botão de confirmação. Padrão: "danger". */
|
|
701
|
+
confirmVariant?: "danger" | "confirm";
|
|
702
|
+
/** Conteúdo extra entre a descrição e o rodapé (ex.: Checkbox de confirmação). */
|
|
703
|
+
children?: React$1.ReactNode;
|
|
704
|
+
/** Controla o estado de carregamento externamente, sobrescrevendo o interno. */
|
|
705
|
+
isLoading?: boolean;
|
|
706
|
+
className?: string;
|
|
707
|
+
}
|
|
708
|
+
declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, loadingLabel, onConfirm, icon, showIconBackground, footerAlign, confirmVariant, children, isLoading, className, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
709
|
+
|
|
710
|
+
interface TooltipProps {
|
|
711
|
+
text: React$1.ReactNode;
|
|
712
|
+
children: React$1.ReactNode;
|
|
713
|
+
className?: string;
|
|
714
|
+
contentClassName?: string;
|
|
715
|
+
}
|
|
716
|
+
declare function Tooltip({ text, children, className, contentClassName, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
717
|
+
|
|
600
718
|
type FilterFieldType = "text" | "combobox" | "switch" | "date";
|
|
601
719
|
type FilterValues = Record<string, string | boolean>;
|
|
602
720
|
interface FilterField {
|
|
@@ -637,6 +755,255 @@ interface CardListProps<T> {
|
|
|
637
755
|
}
|
|
638
756
|
declare function CardList<T>({ items, renderCard, emptyMessage, minItemWidth, className, gap, getKey, isLoading, skeletonCount, }: CardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
639
757
|
|
|
758
|
+
declare const Drawer: React$1.FC<DialogPrimitive.DialogProps>;
|
|
759
|
+
declare const DrawerTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
760
|
+
declare const DrawerPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
761
|
+
declare const DrawerClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
762
|
+
declare const DrawerOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
763
|
+
interface DrawerContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
764
|
+
/** Lado da tela em que o painel desliza. Padrão: "right". */
|
|
765
|
+
side?: "left" | "right";
|
|
766
|
+
/** Largura pré-definida do painel em telas >= sm. Padrão: "md". */
|
|
767
|
+
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
768
|
+
/** Largura customizada (sobrescreve `size`). */
|
|
769
|
+
width?: string;
|
|
770
|
+
/** Exibe o botão de fechar padrão no canto superior. Padrão: true. */
|
|
771
|
+
closeButton?: boolean;
|
|
772
|
+
}
|
|
773
|
+
declare const DrawerContent: React$1.ForwardRefExoticComponent<DrawerContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
774
|
+
declare const DrawerHeader: {
|
|
775
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
776
|
+
displayName: string;
|
|
777
|
+
};
|
|
778
|
+
declare const DrawerBody: {
|
|
779
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
780
|
+
displayName: string;
|
|
781
|
+
};
|
|
782
|
+
declare const DrawerFooter: {
|
|
783
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
784
|
+
displayName: string;
|
|
785
|
+
};
|
|
786
|
+
declare const DrawerTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
787
|
+
declare const DrawerDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Contexto opcional para orquestrar múltiplos `Drawer`s por id, no padrão
|
|
791
|
+
* `activeDrawer`/`openDrawer(id)` já usado nos projetos consumidores.
|
|
792
|
+
*
|
|
793
|
+
* Uso típico:
|
|
794
|
+
* ```tsx
|
|
795
|
+
* <DrawerProvider>
|
|
796
|
+
* <MinhaPagina />
|
|
797
|
+
* </DrawerProvider>
|
|
798
|
+
*
|
|
799
|
+
* const { isOpen, openDrawer, closeDrawer } = useDrawer();
|
|
800
|
+
* <Drawer open={isOpen("detalhes")} onOpenChange={(open) => !open && closeDrawer()}>
|
|
801
|
+
* ...
|
|
802
|
+
* </Drawer>
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
805
|
+
interface DrawerContextValue {
|
|
806
|
+
activeDrawer: string | null;
|
|
807
|
+
openDrawer: (drawerId: string) => void;
|
|
808
|
+
closeDrawer: () => void;
|
|
809
|
+
isOpen: (drawerId: string) => boolean;
|
|
810
|
+
}
|
|
811
|
+
interface DrawerProviderProps {
|
|
812
|
+
children: React$1.ReactNode;
|
|
813
|
+
}
|
|
814
|
+
declare const DrawerContext: React$1.Context<DrawerContextValue | undefined>;
|
|
815
|
+
declare function DrawerProvider({ children }: DrawerProviderProps): react_jsx_runtime.JSX.Element;
|
|
816
|
+
|
|
817
|
+
declare function useDrawer(): DrawerContextValue;
|
|
818
|
+
|
|
819
|
+
type FileRejectionReason = "type" | "size" | "duplicate";
|
|
820
|
+
interface FileRejection {
|
|
821
|
+
file: File;
|
|
822
|
+
reason: FileRejectionReason;
|
|
823
|
+
/** Mensagem pronta para ser exibida pelo consumidor. */
|
|
824
|
+
message: string;
|
|
825
|
+
}
|
|
826
|
+
interface ValidateFilesOptions {
|
|
827
|
+
currentFiles?: File[];
|
|
828
|
+
incomingFiles: File[];
|
|
829
|
+
allowedTypes?: string[];
|
|
830
|
+
maxSize?: number;
|
|
831
|
+
multiple?: boolean;
|
|
832
|
+
}
|
|
833
|
+
/** Formata bytes em KB ou MB usando localidade pt-BR. */
|
|
834
|
+
declare function formatFileSize(bytes: number): string;
|
|
835
|
+
/**
|
|
836
|
+
* Valida um lote de arquivos e separa itens aceitos de itens recusados.
|
|
837
|
+
*/
|
|
838
|
+
declare function validateFiles({ currentFiles, incomingFiles, allowedTypes, maxSize, multiple, }: ValidateFilesOptions): {
|
|
839
|
+
acceptedFiles: File[];
|
|
840
|
+
rejectedFiles: FileRejection[];
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
interface FileUploadProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
844
|
+
/** Arquivos atualmente selecionados. */
|
|
845
|
+
value?: File[];
|
|
846
|
+
onChange?: (files: File[]) => void;
|
|
847
|
+
/** Permite selecionar mais de um arquivo. Padrão: true. */
|
|
848
|
+
multiple?: boolean;
|
|
849
|
+
/** Valor repassado ao input nativo. */
|
|
850
|
+
accept?: string;
|
|
851
|
+
/** Lista de MIME types aceitos para validação em JavaScript. */
|
|
852
|
+
allowedTypes?: string[];
|
|
853
|
+
/** Tamanho máximo por arquivo, em bytes. */
|
|
854
|
+
maxSize?: number;
|
|
855
|
+
disabled?: boolean;
|
|
856
|
+
/** Indica que uma operação externa está em andamento. */
|
|
857
|
+
isLoading?: boolean;
|
|
858
|
+
/** Rótulo exibido no botão de seleção. */
|
|
859
|
+
buttonLabel?: string;
|
|
860
|
+
/** Texto de apoio abaixo do botão. */
|
|
861
|
+
hint?: React$1.ReactNode;
|
|
862
|
+
/** Ícone exibido no botão. */
|
|
863
|
+
icon?: React$1.ReactNode;
|
|
864
|
+
/** Chamado quando um ou mais arquivos são rejeitados. */
|
|
865
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
866
|
+
/** Exibe a lista de arquivos selecionados abaixo do botão. */
|
|
867
|
+
showList?: boolean;
|
|
868
|
+
/** Personaliza o título da lista de pendentes. */
|
|
869
|
+
listTitle?: (count: number) => React$1.ReactNode;
|
|
870
|
+
buttonClassName?: string;
|
|
871
|
+
listClassName?: string;
|
|
872
|
+
}
|
|
873
|
+
declare const FileUpload: React$1.ForwardRefExoticComponent<FileUploadProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
874
|
+
|
|
875
|
+
interface FileListItem {
|
|
876
|
+
/** Chave estável do item. */
|
|
877
|
+
id: string;
|
|
878
|
+
/** Nome do arquivo exibido para o usuário. */
|
|
879
|
+
name: string;
|
|
880
|
+
/** Tamanho em bytes, quando disponível. */
|
|
881
|
+
size?: number;
|
|
882
|
+
/** Linha secundária de metadados. */
|
|
883
|
+
meta?: React$1.ReactNode;
|
|
884
|
+
/** Descrição opcional exibida abaixo dos metadados. */
|
|
885
|
+
description?: React$1.ReactNode;
|
|
886
|
+
/** Indica que o item representa um arquivo ainda não persistido. */
|
|
887
|
+
status?: "pending" | "persisted";
|
|
888
|
+
disabled?: boolean;
|
|
889
|
+
}
|
|
890
|
+
interface FileListProps extends React$1.HTMLAttributes<HTMLUListElement> {
|
|
891
|
+
items: FileListItem[];
|
|
892
|
+
onRemove?: (item: FileListItem, index: number) => void;
|
|
893
|
+
onDownload?: (item: FileListItem, index: number) => void;
|
|
894
|
+
disabled?: boolean;
|
|
895
|
+
variant?: "bordered" | "plain";
|
|
896
|
+
emptyState?: React$1.ReactNode;
|
|
897
|
+
removeLabel?: string;
|
|
898
|
+
}
|
|
899
|
+
declare function FileList({ items, onRemove, onDownload, disabled, variant, emptyState, removeLabel, className, ...props }: FileListProps): react_jsx_runtime.JSX.Element | null;
|
|
900
|
+
|
|
901
|
+
declare const MESES_PT_BR: readonly ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
|
902
|
+
declare const MESES_PT_BR_ABREV: readonly ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
|
|
903
|
+
declare const DIAS_SEMANA_PT_BR: readonly ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SÁB"];
|
|
904
|
+
/** Formata uma Date como `yyyy-MM-dd` no horário local. */
|
|
905
|
+
declare function toDateKey(date: Date): string;
|
|
906
|
+
/** Normaliza uma Date para o meio-dia do dia local (evita deslocamento de fuso). */
|
|
907
|
+
declare function toLocalNoon(date: Date): Date;
|
|
908
|
+
declare function isSameDay(a: Date, b: Date): boolean;
|
|
909
|
+
declare function isToday(date: Date): boolean;
|
|
910
|
+
interface MonthDay {
|
|
911
|
+
/** Dia ao meio-dia local. */
|
|
912
|
+
date: Date;
|
|
913
|
+
number: number;
|
|
914
|
+
/** Chave `yyyy-MM-dd` do dia. */
|
|
915
|
+
dateKey: string;
|
|
916
|
+
isToday: boolean;
|
|
917
|
+
isSelected: boolean;
|
|
918
|
+
hasItems: boolean;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Monta a grade de dias de um mês a partir de domingo.
|
|
922
|
+
* Células `null` no início representam o deslocamento do primeiro dia da semana.
|
|
923
|
+
*/
|
|
924
|
+
declare function buildMonthDays(month: Date, selectedDate?: Date | null, hasItems?: (date: Date) => boolean): (MonthDay | null)[];
|
|
925
|
+
/** Formata um mês como "Setembro 2026". */
|
|
926
|
+
declare function formatMonthYear(date: Date): string;
|
|
927
|
+
/** Rótulo completo de um dia para leitores de tela, ex.: "quinta-feira, 27 de agosto de 2026". */
|
|
928
|
+
declare function formatDayAriaLabel(date: Date): string;
|
|
929
|
+
|
|
930
|
+
interface MiniMonthCalendarDay extends MonthDay {
|
|
931
|
+
}
|
|
932
|
+
interface MiniMonthCalendarProps {
|
|
933
|
+
/** Mês exibido (controlado). Ausente ou vazio usa o mês atual. */
|
|
934
|
+
month?: Date;
|
|
935
|
+
/** Chamado ao navegar para outro mês. */
|
|
936
|
+
onMonthChange?: (month: Date) => void;
|
|
937
|
+
/** Data selecionada (controlada). */
|
|
938
|
+
selectedDate?: Date | null;
|
|
939
|
+
/** Chamado ao clicar em um dia. */
|
|
940
|
+
onSelectDate?: (date: Date) => void;
|
|
941
|
+
/** Indica se o dia tem itens — mostra um ponto indicador abaixo do número. */
|
|
942
|
+
hasItems?: (date: Date) => boolean;
|
|
943
|
+
/** Substitui o conteúdo interno de cada célula de dia. */
|
|
944
|
+
renderDay?: (day: MiniMonthCalendarDay) => React$1.ReactNode;
|
|
945
|
+
/** Cabeçalho dos dias da semana. Padrão: DOM..SÁB. */
|
|
946
|
+
weekDays?: readonly string[];
|
|
947
|
+
/** Texto do título do mês. Padrão: formatMonthYear. */
|
|
948
|
+
monthLabel?: (month: Date) => string;
|
|
949
|
+
previousLabel?: string;
|
|
950
|
+
nextLabel?: string;
|
|
951
|
+
className?: string;
|
|
952
|
+
}
|
|
953
|
+
declare function MiniMonthCalendar({ month: monthProp, onMonthChange, selectedDate, onSelectDate, hasItems, renderDay, weekDays, monthLabel, previousLabel, nextLabel, className, }: MiniMonthCalendarProps): react_jsx_runtime.JSX.Element;
|
|
954
|
+
|
|
955
|
+
interface MonthYearPickerProps {
|
|
956
|
+
/** Mês/ano atual (controlado). */
|
|
957
|
+
value: Date;
|
|
958
|
+
onChange: (date: Date) => void;
|
|
959
|
+
disabled?: boolean;
|
|
960
|
+
/** Texto do trigger. Padrão: formatMonthYear. */
|
|
961
|
+
triggerLabel?: (value: Date) => string;
|
|
962
|
+
previousYearLabel?: string;
|
|
963
|
+
nextYearLabel?: string;
|
|
964
|
+
className?: string;
|
|
965
|
+
triggerClassName?: string;
|
|
966
|
+
contentClassName?: string;
|
|
967
|
+
}
|
|
968
|
+
declare function MonthYearPicker({ value, onChange, disabled, triggerLabel, previousYearLabel, nextYearLabel, className, triggerClassName, contentClassName, }: MonthYearPickerProps): react_jsx_runtime.JSX.Element;
|
|
969
|
+
|
|
970
|
+
interface PeriodRange {
|
|
971
|
+
/** Identificador estável para React (gerado se ausente) */
|
|
972
|
+
id?: string;
|
|
973
|
+
start: string;
|
|
974
|
+
end: string;
|
|
975
|
+
}
|
|
976
|
+
type PeriodRangeInputType = "datetime-local" | "date";
|
|
977
|
+
interface PeriodRangeListLabels {
|
|
978
|
+
start?: string;
|
|
979
|
+
end?: string;
|
|
980
|
+
add?: string;
|
|
981
|
+
empty?: string;
|
|
982
|
+
startColumn?: string;
|
|
983
|
+
endColumn?: string;
|
|
984
|
+
actionsColumn?: string;
|
|
985
|
+
}
|
|
986
|
+
interface PeriodRangeListValidateOptions {
|
|
987
|
+
endAfterStart?: boolean;
|
|
988
|
+
noDuplicates?: boolean;
|
|
989
|
+
minItems?: number;
|
|
990
|
+
}
|
|
991
|
+
interface PeriodRangeListProps {
|
|
992
|
+
value?: PeriodRange[];
|
|
993
|
+
onChange?: (periods: PeriodRange[]) => void;
|
|
994
|
+
inputType?: PeriodRangeInputType;
|
|
995
|
+
labels?: PeriodRangeListLabels;
|
|
996
|
+
readOnly?: boolean;
|
|
997
|
+
disabled?: boolean;
|
|
998
|
+
required?: boolean;
|
|
999
|
+
error?: string;
|
|
1000
|
+
validate?: PeriodRangeListValidateOptions;
|
|
1001
|
+
className?: string;
|
|
1002
|
+
}
|
|
1003
|
+
declare function PeriodRangeList({ value, onChange, inputType, labels: labelsProp, readOnly, disabled, required, error, validate, className, }: PeriodRangeListProps): react_jsx_runtime.JSX.Element;
|
|
1004
|
+
/** Alias explícito para formulários só com data */
|
|
1005
|
+
declare const DateTimeRangeList: typeof PeriodRangeList;
|
|
1006
|
+
|
|
640
1007
|
type StatusNotificacao = "PENDENTE" | "AGENDADO" | "ENVIADO" | "PROCESSADO" | "FALHOU" | "CANCELADO" | "CONCLUIDO";
|
|
641
1008
|
type StatusLeitura = "NAO_LIDO" | "ENTREGUE" | "LIDO";
|
|
642
1009
|
/** Registro devolvido por `GET {baseUrl}/notificacoes`. */
|
|
@@ -790,6 +1157,7 @@ declare class ErroNotificacoes extends Error {
|
|
|
790
1157
|
readonly status?: number;
|
|
791
1158
|
constructor(mensagem: string, status?: number);
|
|
792
1159
|
}
|
|
1160
|
+
declare function normalizarBaseUrl(baseUrl: string): string;
|
|
793
1161
|
|
|
794
1162
|
/**
|
|
795
1163
|
* Sino de notificações do cabeçalho: badge de não lidas, painel com a lista,
|
|
@@ -824,4 +1192,138 @@ declare class ErroNotificacoes extends Error {
|
|
|
824
1192
|
*/
|
|
825
1193
|
declare function HeaderNotifications(props: HeaderNotificationsProps): react_jsx_runtime.JSX.Element;
|
|
826
1194
|
|
|
827
|
-
|
|
1195
|
+
type StatusAlerta = 'PENDENTE' | 'CONCLUIDO' | 'CANCELADO';
|
|
1196
|
+
interface Alerta {
|
|
1197
|
+
id: string;
|
|
1198
|
+
titulo: string;
|
|
1199
|
+
dataReferencia: string;
|
|
1200
|
+
lembrarNoDia?: boolean;
|
|
1201
|
+
diasAntes: number;
|
|
1202
|
+
alertasDiasAntes?: number[];
|
|
1203
|
+
dataAlerta: string;
|
|
1204
|
+
mensagem?: string;
|
|
1205
|
+
status: StatusAlerta;
|
|
1206
|
+
enviarEmail?: boolean;
|
|
1207
|
+
criadoEm: string;
|
|
1208
|
+
criadoPor?: {
|
|
1209
|
+
nome: string;
|
|
1210
|
+
email: string;
|
|
1211
|
+
};
|
|
1212
|
+
concluidoEm?: string;
|
|
1213
|
+
canceladoEm?: string;
|
|
1214
|
+
motivoCancelamento?: string;
|
|
1215
|
+
}
|
|
1216
|
+
interface CriarAlertaInput {
|
|
1217
|
+
titulo: string;
|
|
1218
|
+
dataReferencia: string;
|
|
1219
|
+
lembrarNoDia?: boolean;
|
|
1220
|
+
diasAntes?: number;
|
|
1221
|
+
alertasDiasAntes?: number[];
|
|
1222
|
+
mensagem?: string;
|
|
1223
|
+
enviarEmail?: boolean;
|
|
1224
|
+
}
|
|
1225
|
+
type AtualizarAlertaInput = CriarAlertaInput;
|
|
1226
|
+
interface AlertaFormValues {
|
|
1227
|
+
titulo: string;
|
|
1228
|
+
dataReferencia: string;
|
|
1229
|
+
lembrarNoDia: boolean;
|
|
1230
|
+
diasAntes: string;
|
|
1231
|
+
alertasDiasAntes: string[];
|
|
1232
|
+
novoAlertaDiasAntes: string;
|
|
1233
|
+
mensagem: string;
|
|
1234
|
+
enviarEmail: boolean;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
interface AlertasProps {
|
|
1238
|
+
alertas?: Alerta[];
|
|
1239
|
+
isLoading?: boolean;
|
|
1240
|
+
isSaving?: boolean;
|
|
1241
|
+
isRemovendo?: boolean;
|
|
1242
|
+
podeCriar?: boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Criar/editar/concluir/excluir são sempre responsabilidade do projeto que usa
|
|
1245
|
+
* a lib — ela nunca faz essas requisições sozinha. Implemente aqui a chamada
|
|
1246
|
+
* ao backend do próprio projeto (que por sua vez fala com a API de
|
|
1247
|
+
* notificações). Pode ser assíncrono: a lib aguarda antes de fechar o
|
|
1248
|
+
* formulário e atualizar a lista.
|
|
1249
|
+
*/
|
|
1250
|
+
onCriar?: (payload: CriarAlertaInput) => void | Promise<void>;
|
|
1251
|
+
onAtualizar?: (alertaId: string, payload: AtualizarAlertaInput) => void | Promise<void>;
|
|
1252
|
+
onConcluir?: (alertaId: string) => void | Promise<void>;
|
|
1253
|
+
onExcluir?: (alerta: Alerta) => void | Promise<void>;
|
|
1254
|
+
/** E-mail do destinatário. Vira `?email=` no GET da lista de alertas. */
|
|
1255
|
+
email?: string;
|
|
1256
|
+
/** Identificador do sistema chamador, ex.: "gestao-eventos". */
|
|
1257
|
+
sistema?: string;
|
|
1258
|
+
/**
|
|
1259
|
+
* Raiz da API já versionada, ex.: `https://.../v1`. Quando omitida, usa
|
|
1260
|
+
* `URL_PADRAO_NOTIFICACOES`, que aponta para o **ambiente de
|
|
1261
|
+
* desenvolvimento** — em produção passe explicitamente.
|
|
1262
|
+
*/
|
|
1263
|
+
baseUrl?: string;
|
|
1264
|
+
fetchFn?: typeof fetch;
|
|
1265
|
+
eventoId?: number | string;
|
|
1266
|
+
/** Falha ao buscar a lista (GET) ou ao salvar/concluir/excluir (erro relançado por onCriar/onAtualizar/onConcluir/onExcluir). */
|
|
1267
|
+
onErro?: (erro: Error) => void;
|
|
1268
|
+
}
|
|
1269
|
+
declare function Alertas({ alertas: alertasProps, isLoading, isSaving, isRemovendo, podeCriar, onCriar, onAtualizar, onConcluir, onExcluir, baseUrl, sistema, email, fetchFn, eventoId, onErro, }: AlertasProps): react_jsx_runtime.JSX.Element;
|
|
1270
|
+
|
|
1271
|
+
interface FormularioAlertaProps {
|
|
1272
|
+
alertaEmEdicao?: Alerta | null;
|
|
1273
|
+
isSaving?: boolean;
|
|
1274
|
+
onSalvar: (payload: CriarAlertaInput | AtualizarAlertaInput) => void;
|
|
1275
|
+
onCancelar: () => void;
|
|
1276
|
+
}
|
|
1277
|
+
declare function FormularioAlerta({ alertaEmEdicao, isSaving, onSalvar, onCancelar, }: FormularioAlertaProps): react_jsx_runtime.JSX.Element;
|
|
1278
|
+
|
|
1279
|
+
interface AlertaItemProps {
|
|
1280
|
+
alerta: Alerta;
|
|
1281
|
+
disabled?: boolean;
|
|
1282
|
+
selecionado?: boolean;
|
|
1283
|
+
onEditar: () => void;
|
|
1284
|
+
onConcluir: () => void;
|
|
1285
|
+
onExcluir: () => void;
|
|
1286
|
+
}
|
|
1287
|
+
declare function AlertaItem({ alerta, disabled, selecionado, onEditar, onConcluir, onExcluir, }: AlertaItemProps): react_jsx_runtime.JSX.Element;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Só a leitura (listagem) fala com a API de notificações direto do browser.
|
|
1291
|
+
* Criar, editar, concluir e excluir são sempre responsabilidade do backend do
|
|
1292
|
+
* projeto que usa a lib — não existe função de mutação aqui de propósito.
|
|
1293
|
+
*/
|
|
1294
|
+
declare class ErroAlertas extends Error {
|
|
1295
|
+
readonly status?: number;
|
|
1296
|
+
constructor(mensagem: string, status?: number);
|
|
1297
|
+
}
|
|
1298
|
+
interface ParametrosBuscaAlertas {
|
|
1299
|
+
baseUrl: string;
|
|
1300
|
+
sistema: string;
|
|
1301
|
+
email: string;
|
|
1302
|
+
eventoId?: number | string;
|
|
1303
|
+
fetchFn?: typeof fetch;
|
|
1304
|
+
signal?: AbortSignal;
|
|
1305
|
+
}
|
|
1306
|
+
declare function buscarAlertas({ baseUrl, sistema, email, fetchFn, signal, eventoId, }: ParametrosBuscaAlertas): Promise<Alerta[]>;
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Só busca a lista de alertas (GET), direto na API de notificações. Criar,
|
|
1310
|
+
* editar, concluir e excluir são sempre responsabilidade do projeto que usa a
|
|
1311
|
+
* lib — ver `onCriar`/`onAtualizar`/`onConcluir`/`onExcluir` em `Alertas`.
|
|
1312
|
+
*/
|
|
1313
|
+
interface OpcoesUsarAlertas {
|
|
1314
|
+
baseUrl?: string;
|
|
1315
|
+
sistema?: string;
|
|
1316
|
+
email?: string;
|
|
1317
|
+
fetchFn?: typeof fetch;
|
|
1318
|
+
eventoId?: number | string;
|
|
1319
|
+
habilitado?: boolean;
|
|
1320
|
+
onErro?: (erro: Error) => void;
|
|
1321
|
+
}
|
|
1322
|
+
interface RetornoUsarAlertas {
|
|
1323
|
+
alertas: Alerta[];
|
|
1324
|
+
carregando: boolean;
|
|
1325
|
+
atualizar: () => void;
|
|
1326
|
+
}
|
|
1327
|
+
declare function usarAlertas({ baseUrl, sistema, email, fetchFn, eventoId, habilitado, onErro, }: OpcoesUsarAlertas): RetornoUsarAlertas;
|
|
1328
|
+
|
|
1329
|
+
export { type Alerta, type AlertaFormValues, AlertaItem, type AlertaItemProps, Alertas, type AlertasProps, AplicationsHeader, type AppInput, type AppItem, AppsMenu, type AppsMenuProps, type AtualizarAlertaInput, Avatar, type AvatarProps, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, Card, CardContent, CardFooter, CardFooterItem, CardHeader, CardList, type CardListProps, Checkbox, type CheckboxProps, Collapsible, AnimatedCollapsibleContent as CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxFooterAction, type ComboboxFooterRenderContext, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, type CriarAlertaInput, DIAS_SEMANA_PT_BR, DateTimeRangeList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, type DrawerContentProps, DrawerContext, type DrawerContextValue, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerProvider, type DrawerProviderProps, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErroAlertas, ErroNotificacoes, FileList, type FileListItem, type FileListProps, type FileRejection, type FileRejectionReason, FileUpload, type FileUploadProps, Filter, type FilterField, type FilterFieldType, type FilterProps, type FilterValues, FormularioAlerta, type FormularioAlertaProps, Header, HeaderContainer, type HeaderNotificationItem, HeaderNotifications, type HeaderNotificationsBaseProps, type HeaderNotificationsConectadoProps, type HeaderNotificationsControladoProps, type HeaderNotificationsProps, HeaderProfileHeader, HeaderProfileItem, type HeaderProps, Input, type InputProps, type ItemOption, LabelValue, type LabelValueProps, MESES_PT_BR, MESES_PT_BR_ABREV, MiniMonthCalendar, type MiniMonthCalendarDay, type MiniMonthCalendarProps, Modal, ModalEntidade, ModalMudancaEntidade, type ModalProps, type MonthDay, MonthYearPicker, type MonthYearPickerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, type Notificacao, type OpcoesUsarAlertas, PageHeader, PageHeaderActionsContainer, PageHeaderTitle, PageHeaderTitleContent, type ParametrosBuscaAlertas, type PeriodRange, type PeriodRangeInputType, PeriodRangeList, type PeriodRangeListLabels, type PeriodRangeListProps, type PeriodRangeListValidateOptions, Popover, PopoverContent, PopoverTrigger, ResultMetadata, type ResultMetadataGender, type ResultMetadataProps, type RetornoUsarAlertas, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectPortal, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectViewport, Sidebar, SidebarContainer, type SidebarContainerProps, SidebarImageBrand, type SidebarImageBrandProps, SidebarNavCollapse, type SidebarNavCollapseProps, SidebarNavLink, type SidebarNavLinkProps, type SidebarProps, type StatusAlerta, type StatusLeitura, type StatusNotificacao, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Title, Tooltip, type TooltipProps, URL_PADRAO_NOTIFICACOES, type ValidateFilesOptions, availableApps, buildMonthDays, buscarAlertas, buttonVariants, formatDayAriaLabel, formatFileSize, formatMonthYear, isSameDay, isToday, normalizarBaseUrl, toDateKey, toLocalNoon, usarAlertas, useDrawer, validateFiles };
|