helppeople-ui 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,84 +1,46 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface NotificationAction {
|
|
3
|
-
/** Texto del botón */
|
|
4
3
|
label: string;
|
|
5
|
-
/** Callback cuando se hace click en el botón */
|
|
6
4
|
onClick: (notification: NotificationItem) => void;
|
|
7
|
-
/** Tipo de botón */
|
|
8
5
|
type?: "primary" | "default" | "dashed" | "link" | "text";
|
|
9
|
-
/** Ícono del botón */
|
|
10
6
|
icon?: React.ReactNode;
|
|
11
|
-
/** Si el botón está deshabilitado */
|
|
12
7
|
disabled?: boolean;
|
|
13
|
-
/** Tamaño del botón */
|
|
14
8
|
size?: "small" | "middle" | "large";
|
|
15
|
-
/** Variante danger */
|
|
16
9
|
danger?: boolean;
|
|
17
10
|
}
|
|
18
11
|
export interface NotificationItem {
|
|
19
|
-
/** ID único de la notificación */
|
|
20
12
|
id: string | number;
|
|
21
|
-
/** Título de la notificación */
|
|
22
13
|
title: string;
|
|
23
|
-
/** Descripción o mensaje de la notificación */
|
|
24
14
|
description?: string;
|
|
25
|
-
/** Fecha/hora de la notificación */
|
|
26
15
|
timestamp?: string;
|
|
27
|
-
/** Si la notificación ha sido leída */
|
|
28
16
|
read?: boolean;
|
|
29
|
-
/** Tipo de notificación para estilos personalizados */
|
|
30
17
|
type?: "info" | "warning" | "error" | "success";
|
|
31
|
-
/** Botones de acción para la notificación */
|
|
32
18
|
actions?: NotificationAction[];
|
|
33
|
-
/** Datos adicionales personalizados */
|
|
34
19
|
[key: string]: any;
|
|
35
20
|
}
|
|
36
21
|
export interface CustomNotificationDropdownProps {
|
|
37
|
-
/** Número de notificaciones a mostrar en el badge */
|
|
38
22
|
count?: number;
|
|
39
|
-
/** Array de notificaciones a mostrar */
|
|
40
23
|
notifications: NotificationItem[];
|
|
41
|
-
/** Ícono del badge */
|
|
42
24
|
icon?: React.ReactNode;
|
|
43
|
-
/** Tamaño del ícono */
|
|
44
25
|
size?: "small" | "default" | "large";
|
|
45
|
-
/** Si usar botón como contenedor del badge */
|
|
46
26
|
useButton?: boolean;
|
|
47
|
-
/** Tipo de botón */
|
|
48
27
|
buttonType?: "text" | "link" | "default" | "primary" | "dashed";
|
|
49
|
-
/** Callback cuando se hace click en una notificación */
|
|
50
28
|
onNotificationClick?: (notification: NotificationItem) => void;
|
|
51
|
-
/** Callback para cargar más notificaciones */
|
|
52
29
|
onLoadMore?: () => void;
|
|
53
|
-
/** Si hay más notificaciones para cargar */
|
|
54
30
|
hasMore?: boolean;
|
|
55
|
-
/** Si está cargando más notificaciones */
|
|
56
31
|
loading?: boolean;
|
|
57
|
-
/** Función personalizada para renderizar cada notificación */
|
|
58
32
|
renderNotification?: (notification: NotificationItem) => React.ReactNode;
|
|
59
|
-
/** Texto del botón "Ver más" */
|
|
60
33
|
loadMoreText?: string;
|
|
61
|
-
/** Texto cuando no hay notificaciones */
|
|
62
34
|
emptyText?: string;
|
|
63
|
-
/** Ancho del popover */
|
|
64
35
|
popoverWidth?: number;
|
|
65
|
-
/** Máximo número a mostrar en el badge antes de mostrar "+" */
|
|
66
36
|
overflowCount?: number;
|
|
67
|
-
/** Color del badge */
|
|
68
37
|
badgeColor?: string;
|
|
69
|
-
/** Mostrar badge cuando count es 0 */
|
|
70
38
|
showZero?: boolean;
|
|
71
|
-
/** Estilos del contenedor del badge */
|
|
72
39
|
containerStyle?: React.CSSProperties;
|
|
73
|
-
/** Título del popover */
|
|
74
40
|
popoverTitle?: string;
|
|
75
|
-
/** Callback cuando se abre/cierra el popover */
|
|
76
41
|
onOpenChange?: (open: boolean) => void;
|
|
77
|
-
/** Acción personalizada en el header (ej: "Marcar todas como leídas") */
|
|
78
42
|
headerAction?: React.ReactNode;
|
|
79
|
-
/** Altura máxima del listado */
|
|
80
43
|
maxHeight?: number;
|
|
81
|
-
/** Posición del popover */
|
|
82
44
|
placement?: "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
83
45
|
}
|
|
84
46
|
declare const CustomNotificationDropdown: React.FC<CustomNotificationDropdownProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RecentlyViewedItem<Id extends React.Key = React.Key> {
|
|
3
|
+
id: Id;
|
|
4
|
+
code: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
type RemoveCapability<T> = {
|
|
8
|
+
onRemove: (item: T) => void;
|
|
9
|
+
getRemoveLabel: (item: T) => string;
|
|
10
|
+
getFallbackFocus: () => HTMLElement;
|
|
11
|
+
getRemoveAnnouncement?: (item: T) => string;
|
|
12
|
+
} | {
|
|
13
|
+
onRemove?: undefined;
|
|
14
|
+
getRemoveLabel?: undefined;
|
|
15
|
+
getFallbackFocus?: undefined;
|
|
16
|
+
getRemoveAnnouncement?: undefined;
|
|
17
|
+
};
|
|
18
|
+
export type RecentlyViewedListProps<T extends RecentlyViewedItem = RecentlyViewedItem> = {
|
|
19
|
+
items: readonly T[];
|
|
20
|
+
currentItemId?: T["id"];
|
|
21
|
+
navigationLabel: string;
|
|
22
|
+
onNavigate: (item: T) => void;
|
|
23
|
+
onOverflow: (items: readonly T[]) => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
} & RemoveCapability<T>;
|
|
26
|
+
declare const RecentlyViewedList: <T extends RecentlyViewedItem>({ items, currentItemId, navigationLabel, onNavigate, onOverflow, className, onRemove, getRemoveLabel, getFallbackFocus, getRemoveAnnouncement, }: RecentlyViewedListProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export default RecentlyViewedList;
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export type { CustomNotificationDropdownProps, NotificationItem, NotificationAct
|
|
|
66
66
|
export type { CustomTimelineProps, TimelineItemData, TimelineItem, TimelineItemDataProps, } from './components/CustomTimeline/CustomTimeline';
|
|
67
67
|
export { default as Empty } from './components/CustomEmpty/CustomEmpty';
|
|
68
68
|
export { default as List } from './components/CustomList/CustomList';
|
|
69
|
+
export { default as RecentlyViewedList } from './components/RecentlyViewedList/RecentlyViewedList';
|
|
70
|
+
export type { RecentlyViewedItem, RecentlyViewedListProps, } from './components/RecentlyViewedList/RecentlyViewedList';
|
|
69
71
|
export { default as LibraryThemeProvider } from './theme/LibraryThemeProvider';
|
|
70
72
|
export type { CustomButtonConfig, CustomToolbarProps, PageHeaderConfig, } from './components/CustomToolbar/CustomToolbar';
|
|
71
73
|
export type { CustomSubToolbarProps } from './components/CustomSubToolbar/CustomSubToolbar';
|