@eshal-bot/chat-widget 0.1.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/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # Eshal Chat Widget
2
+
3
+ A beautiful, production-ready chat widget with dark mode support, quick questions, and smooth animations.
4
+
5
+ ## Features
6
+
7
+ - 🎨 **Beautiful Design** - Modern, professional UI inspired by Intercom
8
+ - 🌓 **Dark Mode** - Full dark mode support with smooth transitions
9
+ - âš¡ **Quick Questions** - Pre-defined clickable questions for users
10
+ - 🤖 **Bot Avatar** - Customizable bot avatar for assistant messages
11
+ - 📱 **Responsive** - Works perfectly on all devices
12
+ - 🚀 **Lightweight** - Optimized bundle size and performance
13
+
14
+ ## Quick Start
15
+
16
+ ### Installation
17
+
18
+ ```bash
19
+ npm install
20
+ npm run build
21
+ ```
22
+
23
+ ### Usage
24
+
25
+ ```html
26
+ <!-- Include the widget -->
27
+ <link rel="stylesheet" href="dist/index.css">
28
+ <script src="dist/chat-widget.min.js"></script>
29
+
30
+ <script>
31
+ ChatWidget.init({
32
+ companyName: "Your Company",
33
+ companyLogo: "https://example.com/logo.png",
34
+ primaryColor: "#2563eb",
35
+ quickQuestions: [
36
+ "What are your business hours?",
37
+ "How can I contact support?",
38
+ "What services do you offer?"
39
+ ],
40
+ apiBaseUrl: "https://your-api.com",
41
+ organizationId: "your-org-id"
42
+ });
43
+ </script>
44
+ ```
45
+
46
+ ## Configuration
47
+
48
+ | Option | Type | Default | Description |
49
+ |--------|------|---------|-------------|
50
+ | `companyName` | string | "Support Team" | Company/team name |
51
+ | `companyLogo` | string | null | Company logo URL |
52
+ | `primaryColor` | string | "#2563eb" | Primary brand color |
53
+ | `quickQuestions` | string[] | [] | Array of quick questions |
54
+ | `darkMode` | boolean | false | Enable dark mode |
55
+ | `position` | string | "bottom-right" | Widget position |
56
+ | `apiBaseUrl` | string | null | API endpoint URL |
57
+ | `organizationId` | string | null | Organization ID |
58
+
59
+ ## API Methods
60
+
61
+ ```javascript
62
+ // Open the widget
63
+ ChatWidget.open();
64
+
65
+ // Close the widget
66
+ ChatWidget.close();
67
+
68
+ // Toggle theme
69
+ ChatWidget.toggleTheme();
70
+
71
+ // Update configuration
72
+ ChatWidget.updateConfig({ primaryColor: "#ff0000" });
73
+
74
+ // Send message programmatically
75
+ ChatWidget.sendMessage("Hello!");
76
+
77
+ // Destroy the widget
78
+ ChatWidget.destroy();
79
+ ```
80
+
81
+ ## Development
82
+
83
+ ```bash
84
+ # Install dependencies
85
+ npm install
86
+
87
+ # Start development server
88
+ npm run dev
89
+
90
+ # Build for production
91
+ npm run build
92
+
93
+ # Generate TypeScript definitions
94
+ npm run generate-types
95
+ ```
96
+
97
+ ## License
98
+
99
+ MIT