@wakastellar/ui 1.0.10 → 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.
@@ -108,3 +108,5 @@ export declare const defaultChatUser: ChatUser;
108
108
  export declare const defaultChatConversations: ChatConversation[];
109
109
  export declare const defaultChatMessages: ChatMessage[];
110
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;