@cnc-ti/layout-basic 8.6.0 → 8.8.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.d.mts CHANGED
@@ -1157,6 +1157,7 @@ declare class ErroNotificacoes extends Error {
1157
1157
  readonly status?: number;
1158
1158
  constructor(mensagem: string, status?: number);
1159
1159
  }
1160
+ declare function normalizarBaseUrl(baseUrl: string): string;
1160
1161
 
1161
1162
  /**
1162
1163
  * Sino de notificações do cabeçalho: badge de não lidas, painel com a lista,
@@ -1191,4 +1192,155 @@ declare class ErroNotificacoes extends Error {
1191
1192
  */
1192
1193
  declare function HeaderNotifications(props: HeaderNotificationsProps): react_jsx_runtime.JSX.Element;
1193
1194
 
1194
- export { AplicationsHeader, type AppInput, type AppItem, AppsMenu, type AppsMenuProps, 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, 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, ErroNotificacoes, FileList, type FileListItem, type FileListProps, type FileRejection, type FileRejectionReason, FileUpload, type FileUploadProps, Filter, type FilterField, type FilterFieldType, type FilterProps, type FilterValues, 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, PageHeader, PageHeaderActionsContainer, PageHeaderTitle, PageHeaderTitleContent, type PeriodRange, type PeriodRangeInputType, PeriodRangeList, type PeriodRangeListLabels, type PeriodRangeListProps, type PeriodRangeListValidateOptions, Popover, PopoverContent, PopoverTrigger, ResultMetadata, type ResultMetadataGender, type ResultMetadataProps, 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 StatusLeitura, type StatusNotificacao, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Title, Tooltip, type TooltipProps, URL_PADRAO_NOTIFICACOES, type ValidateFilesOptions, availableApps, buildMonthDays, buttonVariants, formatDayAriaLabel, formatFileSize, formatMonthYear, isSameDay, isToday, toDateKey, toLocalNoon, useDrawer, validateFiles };
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
+ /** Atalho pra `filtros: { eventoId }` — mantido pro gestao-eventos. */
1266
+ eventoId?: number | string;
1267
+ /**
1268
+ * Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Use quando a
1269
+ * entidade que vincula o alerta não se chama "evento" — a chave precisa
1270
+ * bater com o que foi salvo em `metadados` na criação do alerta.
1271
+ */
1272
+ filtros?: Record<string, string | number>;
1273
+ /** Falha ao buscar a lista (GET) ou ao salvar/concluir/excluir (erro relançado por onCriar/onAtualizar/onConcluir/onExcluir). */
1274
+ onErro?: (erro: Error) => void;
1275
+ }
1276
+ declare function Alertas({ alertas: alertasProps, isLoading, isSaving, isRemovendo, podeCriar, onCriar, onAtualizar, onConcluir, onExcluir, baseUrl, sistema, email, fetchFn, eventoId, filtros, onErro, }: AlertasProps): react_jsx_runtime.JSX.Element;
1277
+
1278
+ interface FormularioAlertaProps {
1279
+ alertaEmEdicao?: Alerta | null;
1280
+ isSaving?: boolean;
1281
+ onSalvar: (payload: CriarAlertaInput | AtualizarAlertaInput) => void;
1282
+ onCancelar: () => void;
1283
+ }
1284
+ declare function FormularioAlerta({ alertaEmEdicao, isSaving, onSalvar, onCancelar, }: FormularioAlertaProps): react_jsx_runtime.JSX.Element;
1285
+
1286
+ interface AlertaItemProps {
1287
+ alerta: Alerta;
1288
+ disabled?: boolean;
1289
+ selecionado?: boolean;
1290
+ onEditar: () => void;
1291
+ onConcluir: () => void;
1292
+ onExcluir: () => void;
1293
+ }
1294
+ declare function AlertaItem({ alerta, disabled, selecionado, onEditar, onConcluir, onExcluir, }: AlertaItemProps): react_jsx_runtime.JSX.Element;
1295
+
1296
+ /**
1297
+ * Só a leitura (listagem) fala com a API de notificações direto do browser.
1298
+ * Criar, editar, concluir e excluir são sempre responsabilidade do backend do
1299
+ * projeto que usa a lib — não existe função de mutação aqui de propósito.
1300
+ */
1301
+ declare class ErroAlertas extends Error {
1302
+ readonly status?: number;
1303
+ constructor(mensagem: string, status?: number);
1304
+ }
1305
+ interface ParametrosBuscaAlertas {
1306
+ baseUrl: string;
1307
+ sistema: string;
1308
+ email: string;
1309
+ /** Atalho pra `filtros: { eventoId }` — existe pelo nome, mantido pro gestao-eventos. */
1310
+ eventoId?: number | string;
1311
+ /**
1312
+ * Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Vira query string
1313
+ * direto (a API trata qualquer chave solta fora de sistema/email/status/
1314
+ * statusLeitura como filtro de `metadados`). Use quando a entidade que
1315
+ * vincula o alerta não se chama "evento".
1316
+ */
1317
+ filtros?: Record<string, string | number>;
1318
+ fetchFn?: typeof fetch;
1319
+ signal?: AbortSignal;
1320
+ }
1321
+ declare function buscarAlertas({ baseUrl, sistema, email, fetchFn, signal, eventoId, filtros, }: ParametrosBuscaAlertas): Promise<Alerta[]>;
1322
+
1323
+ /**
1324
+ * Só busca a lista de alertas (GET), direto na API de notificações. Criar,
1325
+ * editar, concluir e excluir são sempre responsabilidade do projeto que usa a
1326
+ * lib — ver `onCriar`/`onAtualizar`/`onConcluir`/`onExcluir` em `Alertas`.
1327
+ */
1328
+ interface OpcoesUsarAlertas {
1329
+ baseUrl?: string;
1330
+ sistema?: string;
1331
+ email?: string;
1332
+ fetchFn?: typeof fetch;
1333
+ eventoId?: number | string;
1334
+ /** Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Ver `buscarAlertas`. */
1335
+ filtros?: Record<string, string | number>;
1336
+ habilitado?: boolean;
1337
+ onErro?: (erro: Error) => void;
1338
+ }
1339
+ interface RetornoUsarAlertas {
1340
+ alertas: Alerta[];
1341
+ carregando: boolean;
1342
+ atualizar: () => void;
1343
+ }
1344
+ declare function usarAlertas({ baseUrl, sistema, email, fetchFn, eventoId, filtros, habilitado, onErro, }: OpcoesUsarAlertas): RetornoUsarAlertas;
1345
+
1346
+ 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 };
package/dist/index.d.ts CHANGED
@@ -1157,6 +1157,7 @@ declare class ErroNotificacoes extends Error {
1157
1157
  readonly status?: number;
1158
1158
  constructor(mensagem: string, status?: number);
1159
1159
  }
1160
+ declare function normalizarBaseUrl(baseUrl: string): string;
1160
1161
 
1161
1162
  /**
1162
1163
  * Sino de notificações do cabeçalho: badge de não lidas, painel com a lista,
@@ -1191,4 +1192,155 @@ declare class ErroNotificacoes extends Error {
1191
1192
  */
1192
1193
  declare function HeaderNotifications(props: HeaderNotificationsProps): react_jsx_runtime.JSX.Element;
1193
1194
 
1194
- export { AplicationsHeader, type AppInput, type AppItem, AppsMenu, type AppsMenuProps, 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, 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, ErroNotificacoes, FileList, type FileListItem, type FileListProps, type FileRejection, type FileRejectionReason, FileUpload, type FileUploadProps, Filter, type FilterField, type FilterFieldType, type FilterProps, type FilterValues, 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, PageHeader, PageHeaderActionsContainer, PageHeaderTitle, PageHeaderTitleContent, type PeriodRange, type PeriodRangeInputType, PeriodRangeList, type PeriodRangeListLabels, type PeriodRangeListProps, type PeriodRangeListValidateOptions, Popover, PopoverContent, PopoverTrigger, ResultMetadata, type ResultMetadataGender, type ResultMetadataProps, 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 StatusLeitura, type StatusNotificacao, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Title, Tooltip, type TooltipProps, URL_PADRAO_NOTIFICACOES, type ValidateFilesOptions, availableApps, buildMonthDays, buttonVariants, formatDayAriaLabel, formatFileSize, formatMonthYear, isSameDay, isToday, toDateKey, toLocalNoon, useDrawer, validateFiles };
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
+ /** Atalho pra `filtros: { eventoId }` — mantido pro gestao-eventos. */
1266
+ eventoId?: number | string;
1267
+ /**
1268
+ * Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Use quando a
1269
+ * entidade que vincula o alerta não se chama "evento" — a chave precisa
1270
+ * bater com o que foi salvo em `metadados` na criação do alerta.
1271
+ */
1272
+ filtros?: Record<string, string | number>;
1273
+ /** Falha ao buscar a lista (GET) ou ao salvar/concluir/excluir (erro relançado por onCriar/onAtualizar/onConcluir/onExcluir). */
1274
+ onErro?: (erro: Error) => void;
1275
+ }
1276
+ declare function Alertas({ alertas: alertasProps, isLoading, isSaving, isRemovendo, podeCriar, onCriar, onAtualizar, onConcluir, onExcluir, baseUrl, sistema, email, fetchFn, eventoId, filtros, onErro, }: AlertasProps): react_jsx_runtime.JSX.Element;
1277
+
1278
+ interface FormularioAlertaProps {
1279
+ alertaEmEdicao?: Alerta | null;
1280
+ isSaving?: boolean;
1281
+ onSalvar: (payload: CriarAlertaInput | AtualizarAlertaInput) => void;
1282
+ onCancelar: () => void;
1283
+ }
1284
+ declare function FormularioAlerta({ alertaEmEdicao, isSaving, onSalvar, onCancelar, }: FormularioAlertaProps): react_jsx_runtime.JSX.Element;
1285
+
1286
+ interface AlertaItemProps {
1287
+ alerta: Alerta;
1288
+ disabled?: boolean;
1289
+ selecionado?: boolean;
1290
+ onEditar: () => void;
1291
+ onConcluir: () => void;
1292
+ onExcluir: () => void;
1293
+ }
1294
+ declare function AlertaItem({ alerta, disabled, selecionado, onEditar, onConcluir, onExcluir, }: AlertaItemProps): react_jsx_runtime.JSX.Element;
1295
+
1296
+ /**
1297
+ * Só a leitura (listagem) fala com a API de notificações direto do browser.
1298
+ * Criar, editar, concluir e excluir são sempre responsabilidade do backend do
1299
+ * projeto que usa a lib — não existe função de mutação aqui de propósito.
1300
+ */
1301
+ declare class ErroAlertas extends Error {
1302
+ readonly status?: number;
1303
+ constructor(mensagem: string, status?: number);
1304
+ }
1305
+ interface ParametrosBuscaAlertas {
1306
+ baseUrl: string;
1307
+ sistema: string;
1308
+ email: string;
1309
+ /** Atalho pra `filtros: { eventoId }` — existe pelo nome, mantido pro gestao-eventos. */
1310
+ eventoId?: number | string;
1311
+ /**
1312
+ * Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Vira query string
1313
+ * direto (a API trata qualquer chave solta fora de sistema/email/status/
1314
+ * statusLeitura como filtro de `metadados`). Use quando a entidade que
1315
+ * vincula o alerta não se chama "evento".
1316
+ */
1317
+ filtros?: Record<string, string | number>;
1318
+ fetchFn?: typeof fetch;
1319
+ signal?: AbortSignal;
1320
+ }
1321
+ declare function buscarAlertas({ baseUrl, sistema, email, fetchFn, signal, eventoId, filtros, }: ParametrosBuscaAlertas): Promise<Alerta[]>;
1322
+
1323
+ /**
1324
+ * Só busca a lista de alertas (GET), direto na API de notificações. Criar,
1325
+ * editar, concluir e excluir são sempre responsabilidade do projeto que usa a
1326
+ * lib — ver `onCriar`/`onAtualizar`/`onConcluir`/`onExcluir` em `Alertas`.
1327
+ */
1328
+ interface OpcoesUsarAlertas {
1329
+ baseUrl?: string;
1330
+ sistema?: string;
1331
+ email?: string;
1332
+ fetchFn?: typeof fetch;
1333
+ eventoId?: number | string;
1334
+ /** Filtro livre por metadado, ex.: `{ demandaId: "123" }`. Ver `buscarAlertas`. */
1335
+ filtros?: Record<string, string | number>;
1336
+ habilitado?: boolean;
1337
+ onErro?: (erro: Error) => void;
1338
+ }
1339
+ interface RetornoUsarAlertas {
1340
+ alertas: Alerta[];
1341
+ carregando: boolean;
1342
+ atualizar: () => void;
1343
+ }
1344
+ declare function usarAlertas({ baseUrl, sistema, email, fetchFn, eventoId, filtros, habilitado, onErro, }: OpcoesUsarAlertas): RetornoUsarAlertas;
1345
+
1346
+ 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 };