@wakastellar/ui 1.0.9 → 1.0.12

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.
@@ -3,6 +3,7 @@ export interface ChatUser {
3
3
  id: string;
4
4
  name: string;
5
5
  avatar?: string;
6
+ initials?: string;
6
7
  status?: "online" | "offline" | "away" | "busy";
7
8
  lastSeen?: Date | string;
8
9
  }
@@ -57,6 +58,12 @@ export interface WakaChatProps {
57
58
  onAudioCall?: () => void;
58
59
  /** Callback appel vidéo */
59
60
  onVideoCall?: () => void;
61
+ /** Callback fermeture (mode floating/widget) */
62
+ onClose?: () => void;
63
+ /** Callback clôturer conversation */
64
+ onCloseConversation?: () => void;
65
+ /** Callback minimiser (mode floating) */
66
+ onMinimize?: () => void;
60
67
  /** Afficher la liste des conversations */
61
68
  showConversationList?: boolean;
62
69
  /** Afficher le header */
@@ -69,19 +76,37 @@ export interface WakaChatProps {
69
76
  showAttachments?: boolean;
70
77
  /** Afficher le bouton emoji */
71
78
  showEmoji?: boolean;
72
- /** Placeholder de l'input */
79
+ /** Afficher les séparateurs de date */
80
+ showDateSeparators?: boolean;
81
+ /** Afficher l'indication clavier sous l'input */
82
+ showInputHint?: boolean;
83
+ /** Afficher le bouton clôturer */
84
+ showCloseButton?: boolean;
85
+ /** Placeholder de l'input (si non défini, utilise le nom du destinataire) */
73
86
  inputPlaceholder?: string;
87
+ /** Texte du hint clavier */
88
+ inputHintText?: string;
74
89
  /** En cours d'envoi */
75
90
  sending?: boolean;
76
91
  /** En cours de chargement */
77
92
  loading?: boolean;
78
93
  /** Layout */
79
- layout?: "full" | "embedded" | "floating";
94
+ layout?: "full" | "embedded" | "floating" | "widget";
95
+ /** Titre personnalisé du header */
96
+ headerTitle?: string;
97
+ /** Afficher le statut dans le header */
98
+ showHeaderStatus?: boolean;
99
+ /** Texte personnalisé pour le statut */
100
+ statusText?: string;
101
+ /** Mode minimisé (pour widget) */
102
+ minimized?: boolean;
80
103
  /** Classes CSS additionnelles */
81
104
  className?: string;
82
105
  }
83
- export declare function WakaChat({ conversations, activeConversation, messages, currentUser, onSendMessage, onConversationSelect, onMessageDelete, onMessageReply, onSearch, onAudioCall, onVideoCall, showConversationList, showHeader, showMessageStatus, showTimestamps, showAttachments, showEmoji, inputPlaceholder, sending, loading, layout, className, }: WakaChatProps): import("react/jsx-runtime").JSX.Element;
106
+ export declare function WakaChat({ conversations, activeConversation, messages, currentUser, onSendMessage, onConversationSelect, onMessageDelete, onMessageReply, onSearch, onAudioCall, onVideoCall, onClose, onCloseConversation, onMinimize, showConversationList, showHeader, showMessageStatus, showTimestamps, showAttachments, showEmoji, showDateSeparators, showInputHint, showCloseButton, inputPlaceholder, inputHintText, sending, loading, layout, headerTitle, showHeaderStatus, statusText, minimized, className, }: WakaChatProps): import("react/jsx-runtime").JSX.Element;
84
107
  export declare const defaultChatUser: ChatUser;
85
108
  export declare const defaultChatConversations: ChatConversation[];
86
109
  export declare const defaultChatMessages: ChatMessage[];
87
110
  export default WakaChat;
111
+ export { WakaChatWidget, useChatWidget } from './widget';
112
+ export type { WakaChatWidgetProps, UseChatWidgetOptions } from './widget';
@@ -0,0 +1,100 @@
1
+ import { WakaChatProps } from './index';
2
+ import * as React from "react";
3
+ export interface WakaChatWidgetProps extends Omit<WakaChatProps, "layout" | "minimized" | "onMinimize" | "onClose"> {
4
+ /** Position initiale de la bulle */
5
+ defaultPosition?: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ /** Position de la bulle (contrôlée) */
10
+ position?: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ /** Callback changement de position */
15
+ onPositionChange?: (position: {
16
+ x: number;
17
+ y: number;
18
+ }) => void;
19
+ /** Persister la position dans localStorage */
20
+ persistPosition?: boolean;
21
+ /** Clé localStorage pour la position */
22
+ positionStorageKey?: string;
23
+ /** Ouvert par défaut */
24
+ defaultOpen?: boolean;
25
+ /** Ouvert (contrôlé) */
26
+ open?: boolean;
27
+ /** Callback ouverture/fermeture */
28
+ onOpenChange?: (open: boolean) => void;
29
+ /** Taille de la bulle */
30
+ bubbleSize?: "sm" | "md" | "lg";
31
+ /** Couleur de la bulle */
32
+ bubbleColor?: "primary" | "secondary" | "success" | "warning" | "destructive";
33
+ /** Icône personnalisée pour la bulle */
34
+ bubbleIcon?: React.ReactNode;
35
+ /** Texte de la bulle (affiché à côté de l'icône) */
36
+ bubbleText?: string;
37
+ /** Afficher le compteur de messages non lus sur la bulle */
38
+ showUnreadBadge?: boolean;
39
+ /** Animation de la bulle */
40
+ bubbleAnimation?: "none" | "pulse" | "bounce";
41
+ /** Position du widget par rapport à la bulle */
42
+ widgetPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
43
+ /** Taille du widget */
44
+ widgetSize?: "sm" | "md" | "lg";
45
+ /** Classes CSS pour la bulle */
46
+ bubbleClassName?: string;
47
+ /** Classes CSS pour le widget */
48
+ widgetClassName?: string;
49
+ /** Permettre le drag de la bulle */
50
+ draggable?: boolean;
51
+ /** Contraindre la bulle dans le viewport */
52
+ constrainToViewport?: boolean;
53
+ /** Offset depuis les bords */
54
+ edgeOffset?: number;
55
+ /** Callback quand le widget est fermé */
56
+ onWidgetClose?: () => void;
57
+ /** Callback quand le widget est minimisé */
58
+ onWidgetMinimize?: () => void;
59
+ /** Z-index du widget */
60
+ zIndex?: number;
61
+ }
62
+ export declare function WakaChatWidget({ defaultPosition, position: controlledPosition, onPositionChange, persistPosition, positionStorageKey, defaultOpen, open: controlledOpen, onOpenChange, bubbleSize, bubbleColor, bubbleIcon, bubbleText, showUnreadBadge, bubbleAnimation, widgetPosition, widgetSize, bubbleClassName, widgetClassName, draggable, constrainToViewport, edgeOffset, onWidgetClose, onWidgetMinimize, zIndex, conversations, ...chatProps }: WakaChatWidgetProps): import("react/jsx-runtime").JSX.Element;
63
+ export interface UseChatWidgetOptions {
64
+ defaultOpen?: boolean;
65
+ defaultPosition?: {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ persistPosition?: boolean;
70
+ positionStorageKey?: string;
71
+ }
72
+ export declare function useChatWidget(options?: UseChatWidgetOptions): {
73
+ isOpen: boolean;
74
+ position: {
75
+ x: number;
76
+ y: number;
77
+ };
78
+ open: () => void;
79
+ close: () => void;
80
+ toggle: () => void;
81
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
82
+ updatePosition: (newPosition: {
83
+ x: number;
84
+ y: number;
85
+ }) => void;
86
+ resetPosition: () => void;
87
+ widgetProps: {
88
+ open: boolean;
89
+ onOpenChange: React.Dispatch<React.SetStateAction<boolean>>;
90
+ position: {
91
+ x: number;
92
+ y: number;
93
+ };
94
+ onPositionChange: (newPosition: {
95
+ x: number;
96
+ y: number;
97
+ }) => void;
98
+ };
99
+ };
100
+ export default WakaChatWidget;