cool-ai-chatbot 0.1.3

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.
@@ -0,0 +1,2 @@
1
+ import { BotPersonality } from '../types/chat';
2
+ export declare const aslTutorPersonality: BotPersonality;
@@ -0,0 +1,3 @@
1
+ export { purpleWizPersonality } from './purpleWiz';
2
+ export { aslTutorPersonality } from './aslTutor';
3
+ export { museumGuidePersonality } from './museumGuide';
@@ -0,0 +1,2 @@
1
+ import { BotPersonality } from '../types/chat';
2
+ export declare const museumGuidePersonality: BotPersonality;
@@ -0,0 +1,2 @@
1
+ import { BotPersonality } from '../types/chat';
2
+ export declare const purpleWizPersonality: BotPersonality;
package/dist/style.css ADDED
@@ -0,0 +1,2 @@
1
+ .message-row{margin-bottom:.85rem;animation:.22s both message-fade-up;display:flex}.user-row{justify-content:flex-end}.bot-row{justify-content:flex-start}.message-bubble{overflow-wrap:anywhere;word-break:break-word;border-radius:1rem;max-width:86%;padding:.75rem .9rem;font-size:.95rem;line-height:1.5}.user-bubble{color:#fff;background:#4a266a;border-bottom-right-radius:.25rem}.bot-bubble{color:#2b2233;background:#fff;border-bottom-left-radius:.25rem;box-shadow:0 .25rem .75rem #4a266a1f}.message-label{opacity:.7;margin-bottom:.35rem;font-size:.72rem;font-weight:700;display:block}.message-content p{margin:0 0 .7rem}.message-content p:last-child{margin-bottom:0}.message-content ul,.message-content ol{margin:.5rem 0 .75rem;padding-left:1.25rem}.message-content li{margin-bottom:.35rem}.message-content code{background:#4a266a14;border-radius:.3rem;padding:.1rem .25rem;font-family:Consolas,Monaco,Courier New,monospace;font-size:.88em}.message-content pre{color:#f8edff;background:#24172f;border-radius:.85rem;max-width:100%;margin:.75rem 0;padding:.85rem;overflow-x:auto}.message-content pre code{color:inherit;background:0 0;padding:0}@keyframes message-fade-up{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.background-relax{background:var(--chat-page-background,inherit)}:root{--chat-message-font-size:.95rem;--chat-ui-font-size:.9rem}:root[data-chat-font-size=small]{--chat-message-font-size:.85rem;--chat-ui-font-size:.82rem}:root[data-chat-font-size=regular]{--chat-message-font-size:.95rem;--chat-ui-font-size:.9rem}:root[data-chat-font-size=large]{--chat-message-font-size:1.08rem;--chat-ui-font-size:1rem}:root[data-chat-motion=reduced] *,:root[data-chat-motion=off] *{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}:root[data-chat-motion=off] *{scroll-behavior:auto!important}.message,.message-bubble{font-size:var(--chat-message-font-size,.95rem);line-height:1.45}.chatbot-settings-panel,.chatbot-input input,.chatbot-input button,.personality-option span,.chatbot-header p{font-size:var(--chat-ui-font-size,.9rem)}.chatbot-header p,.personality-option span,.chatbot-input input,.chatbot-input button,.chatbot-settings-panel{font-size:var(--chat-ui-font-size)}.chatbot-widget{z-index:9999;position:fixed}.chatbot-bottom-right{bottom:1.5rem;right:1.5rem}.chatbot-bottom-left{bottom:1.5rem;left:1.5rem}.chatbot-toggle{background:linear-gradient(135deg, var(--chat-secondary), var(--chat-primary));width:4rem;height:4rem;color:var(--chat-text);cursor:pointer;box-shadow:0 0 24px var(--chat-glow), 0 .75rem 1.75rem #00000059;border:none;border-radius:50%;font-size:1.7rem;transition:transform .25s,box-shadow .25s}.chatbot-toggle:hover{transform:translateY(-3px)scale(1.04)}.chatbot-panel{background:var(--chat-background);border:1px solid color-mix(in srgb, var(--chat-border) 55%, transparent);width:min(24rem,100vw - 2rem);height:min(34rem,100vh - 2rem);box-shadow:0 0 28px var(--chat-glow), 0 1.25rem 3rem #00000073;transform-origin:100% 100%;border-radius:1.25rem;flex-direction:column;animation:.28s both chatbot-pop-in;display:flex;position:relative;overflow:hidden}@keyframes chatbot-pop-in{0%{opacity:0;transform:translateY(18px)scale(.94)}to{opacity:1;transform:translateY(0)scale(1)}}.chatbot-header{background:radial-gradient(circle at top right, color-mix(in srgb, var(--chat-accent) 25%, transparent), transparent 45%), linear-gradient(135deg, var(--chat-secondary), var(--chat-primary));color:var(--chat-text);justify-content:space-between;gap:1rem;padding:1rem;display:flex}.chatbot-header h2{margin:0;font-size:1.1rem}.chatbot-header p{color:var(--chat-textSoft);margin:.25rem 0 0;font-size:.8rem}.chatbot-header-actions{align-items:center;gap:.4rem;display:flex}.chatbot-settings,.chatbot-close{border:1px solid color-mix(in srgb, var(--chat-border) 40%, transparent);background:color-mix(in srgb, var(--chat-surface) 65%, transparent);width:2rem;height:2rem;color:var(--chat-text);cursor:pointer;border-radius:999px;place-items:center;font-size:1.1rem;transition:transform .18s,background .18s,box-shadow .18s;display:grid}.chatbot-close{font-size:1.4rem}.chatbot-settings:hover,.chatbot-close:hover{background:color-mix(in srgb, var(--chat-primary) 40%, var(--chat-surface));box-shadow:0 0 14px var(--chat-glow);transform:translateY(-1px)rotate(4deg)}.chatbot-settings-panel{z-index:20;border:1px solid color-mix(in srgb, var(--chat-border) 55%, transparent);background:radial-gradient(circle at top left, color-mix(in srgb, var(--chat-primary) 26%, transparent), transparent 42%), linear-gradient(145deg, color-mix(in srgb, var(--chat-elevated) 88%, black), color-mix(in srgb, var(--chat-surface) 92%, black));width:min(320px,100% - 2rem);max-height:calc(100% - 6rem);box-shadow:0 0 24px var(--chat-glow), 0 18px 48px #00000073;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-radius:1.25rem;padding:1rem;animation:.22s ease-out settings-reveal;position:absolute;top:4.75rem;right:1rem;overflow-y:auto}@keyframes settings-reveal{0%{opacity:0;transform:translateY(-8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.chatbot-settings-panel h3{color:var(--chat-text);letter-spacing:.02em;margin:0 0 .75rem;font-size:.95rem}.personality-list,.chat-theme-options{gap:.6rem;margin-bottom:1rem;display:grid}.personality-option,.chat-theme-options button{text-align:left;border:1px solid color-mix(in srgb, var(--chat-border) 42%, transparent);background:color-mix(in srgb, var(--chat-surface) 82%, transparent);width:100%;color:var(--chat-text);cursor:pointer;border-radius:1rem;padding:.75rem .85rem;transition:transform .18s,border-color .18s,background .18s,box-shadow .18s}.personality-option:hover,.chat-theme-options button:hover{border-color:var(--chat-accent);background:color-mix(in srgb, var(--chat-primary) 24%, var(--chat-surface));box-shadow:0 0 16px var(--chat-glow);transform:translateY(-1px)}.personality-option.active{border-color:var(--chat-accent);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--chat-accent) 55%, transparent), 0 0 18px var(--chat-glow)}.personality-option strong{color:var(--chat-text);font-size:.9rem;display:block}.personality-option span{color:var(--chat-textSoft);margin-top:.25rem;font-size:.78rem;line-height:1.35;display:block}.chatbot-settings-panel select{border:1px solid color-mix(in srgb, var(--chat-border) 55%, transparent);background:var(--chat-surface);width:100%;color:var(--chat-text);border-radius:.9rem;outline:none;margin:.4rem 0 1rem;padding:.7rem .85rem}.chatbot-settings-panel select:focus{border-color:var(--chat-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--chat-accent) 25%, transparent)}.setting-divider{background-color:var(--chat-accent);border-radius:50px;height:.15rem;margin-bottom:10px}.chatbot-messages{background:radial-gradient(circle at top left, color-mix(in srgb, var(--chat-primary) 16%, transparent), transparent 35%), var(--chat-background);flex:1;padding:1rem;overflow-y:auto}.message{max-width:80%;line-height:1.45;font-size:var(--chat-message-font-size,.95rem);border-radius:1rem;margin-bottom:.75rem;padding:.7rem .9rem}.message.bot{background:var(--chat-surface);color:var(--chat-text);border-bottom-left-radius:.25rem;margin-right:auto;box-shadow:0 .25rem .75rem #0000002e}.message.user{background:linear-gradient(135deg, var(--chat-secondary), var(--chat-primary));color:var(--chat-text);border-bottom-right-radius:.25rem;margin-left:auto}.chatbot-input{border-top:1px solid color-mix(in srgb, var(--chat-border) 35%, transparent);background:var(--chat-surface);gap:.5rem;padding:.75rem;display:flex}.chatbot-input input{border:1px solid color-mix(in srgb, var(--chat-border) 45%, transparent);background:var(--chat-background);min-width:0;color:var(--chat-text);border-radius:999px;outline:none;flex:1;padding:.7rem .9rem;font-size:.95rem}.chatbot-input input::placeholder{color:var(--chat-textSoft)}.chatbot-input input:focus{border-color:var(--chat-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--chat-accent) 22%, transparent)}.chatbot-input button{background:linear-gradient(135deg, var(--chat-secondary), var(--chat-primary));color:var(--chat-text);cursor:pointer;border:none;border-radius:999px;padding:.7rem 1rem;font-weight:600}.chatbot-input button:disabled{opacity:.55;cursor:not-allowed}.typing-indicator{align-items:center;gap:.35rem;width:fit-content;padding:.9rem 1rem;display:flex}.typing-indicator span{background:var(--chat-accent);border-radius:50%;width:.45rem;height:.45rem;animation:1s ease-in-out infinite typing-bounce}.typing-indicator span:nth-child(2){animation-delay:.15s}.typing-indicator span:nth-child(3){animation-delay:.3s}@keyframes typing-bounce{0%,80%,to{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}@media (width<=480px){.chatbot-widget{bottom:1rem;right:1rem}.chatbot-panel{width:calc(100vw - 2rem);height:calc(100vh - 6rem)}.chatbot-settings-panel{width:auto;left:1rem;right:1rem}}.chatbot-settings-panel{max-height:calc(100% - 6rem);overflow-y:auto}.settings-group{margin-bottom:1rem}.font-size-bar{background:color-mix(in srgb, var(--chat-background) 75%, transparent);border:1px solid color-mix(in srgb, var(--chat-border) 35%, transparent);border-radius:1rem;grid-template-columns:repeat(3,1fr);gap:.45rem;padding:.35rem;display:grid}.font-size-bar button{min-height:3.35rem;color:var(--chat-textSoft);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:.8rem;place-items:center;gap:.15rem;padding:.45rem .35rem;transition:transform .18s,background .18s,color .18s,box-shadow .18s;display:grid}.font-size-bar button:hover{color:var(--chat-text);background:color-mix(in srgb, var(--chat-primary) 18%, transparent);transform:translateY(-1px)}.font-size-bar button.active{color:var(--chat-text);background:linear-gradient(135deg, var(--chat-secondary), var(--chat-primary));border-color:color-mix(in srgb, var(--chat-accent) 55%, transparent);box-shadow:0 0 14px var(--chat-glow)}.font-a{font-weight:800;line-height:1}.small-a{font-size:.85rem}.regular-a{font-size:1.05rem}.large-a{font-size:1.3rem}.font-size-bar button span:last-child{font-size:.68rem}
2
+ /*$vite$:1*/
@@ -0,0 +1,23 @@
1
+ export declare function createAdaptiveTheme(): {
2
+ adaptive: {
3
+ radius: string;
4
+ spacing: string;
5
+ transition: string;
6
+ fontFamily: string;
7
+ };
8
+ palette: {
9
+ primary: string;
10
+ background: string;
11
+ surface: string;
12
+ elevated: string;
13
+ text: string;
14
+ textSoft: string;
15
+ border: string;
16
+ secondary: string;
17
+ accent: string;
18
+ glow: string;
19
+ };
20
+ id: string;
21
+ name: string;
22
+ description: string;
23
+ };
@@ -0,0 +1,7 @@
1
+ export type ColorAnalysis = {
2
+ backgroundColor: string;
3
+ textColor: string;
4
+ accentColor: string | null;
5
+ isDark: boolean;
6
+ };
7
+ export declare function analyzeColors(): ColorAnalysis;
@@ -0,0 +1,6 @@
1
+ export type DensityStyle = "compact" | "balanced" | "spacious";
2
+ export type DensityAnalysis = {
3
+ averagePadding: number;
4
+ densityStyle: DensityStyle;
5
+ };
6
+ export declare function analyzeDensity(): DensityAnalysis;
@@ -0,0 +1,4 @@
1
+ export type FontAnalysis = {
2
+ primaryFont: string;
3
+ };
4
+ export declare function analyzeFonts(): FontAnalysis;
@@ -0,0 +1,6 @@
1
+ export type MotionStyle = "minimal" | "snappy" | "gentle";
2
+ export type MotionAnalysis = {
3
+ averageTransitionDuration: number;
4
+ motionStyle: MotionStyle;
5
+ };
6
+ export declare function analyzeMotion(): MotionAnalysis;
@@ -0,0 +1,6 @@
1
+ export type ShapeStyle = "sharp" | "slightly-rounded" | "rounded" | "pill";
2
+ export type ShapeAnalysis = {
3
+ averageRadius: number;
4
+ shapeStyle: ShapeStyle;
5
+ };
6
+ export declare function analyzeShapes(): ShapeAnalysis;
@@ -0,0 +1,13 @@
1
+ import { ColorAnalysis } from './colorAnalyzer';
2
+ import { ShapeAnalysis } from './shapeAnalyzer';
3
+ import { DensityAnalysis } from './densityAnalyzer';
4
+ import { MotionAnalysis } from './motionAnalyzer';
5
+ import { FontAnalysis } from './fontAnalyzer';
6
+ export type WebsiteStyleAnalysis = {
7
+ colors: ColorAnalysis;
8
+ shapes: ShapeAnalysis;
9
+ density: DensityAnalysis;
10
+ motion: MotionAnalysis;
11
+ fonts: FontAnalysis;
12
+ };
13
+ export declare function analyzeWebsiteStyle(): WebsiteStyleAnalysis;
@@ -0,0 +1,2 @@
1
+ import { ChatTheme } from './themeTypes';
2
+ export declare const CHAT_THEMES: ChatTheme[];
@@ -0,0 +1,2 @@
1
+ import { ChatPalette } from './themeTypes';
2
+ export declare function getAdaptivePalette(): ChatPalette;
@@ -0,0 +1,19 @@
1
+ export type ThemeSource = "adaptive" | "manual" | "personality";
2
+ export type ChatPalette = {
3
+ background: string;
4
+ surface: string;
5
+ elevated: string;
6
+ primary: string;
7
+ secondary: string;
8
+ accent: string;
9
+ text: string;
10
+ textSoft: string;
11
+ border: string;
12
+ glow: string;
13
+ };
14
+ export type ChatTheme = {
15
+ id: string;
16
+ name: string;
17
+ description: string;
18
+ palette: ChatPalette;
19
+ };
@@ -0,0 +1,10 @@
1
+ import { ChatPalette, ThemeSource } from './themeTypes';
2
+ type UseChatThemeEngineProps = {
3
+ source: ThemeSource;
4
+ manualThemeId: string;
5
+ personalityThemeId?: string;
6
+ };
7
+ export declare function useChatThemeEngine({ source, manualThemeId, personalityThemeId, }: UseChatThemeEngineProps): {
8
+ palette: ChatPalette;
9
+ };
10
+ export {};
@@ -0,0 +1,25 @@
1
+ export type ChatRole = "user" | "bot";
2
+ export type ChatMessage = {
3
+ id: string;
4
+ role: ChatRole;
5
+ text: string;
6
+ };
7
+ export type PersonalityTraits = {
8
+ warmth: number;
9
+ humor: number;
10
+ curiosity: number;
11
+ clarity: number;
12
+ energy: number;
13
+ };
14
+ export type BotPersonality = {
15
+ id: string;
16
+ name: string;
17
+ greeting: string;
18
+ tone: string;
19
+ values: string[];
20
+ boundaries: string[];
21
+ styleTags: string[];
22
+ avatar?: string;
23
+ themeId?: string;
24
+ traits: PersonalityTraits;
25
+ };
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "cool-ai-chatbot",
3
+ "version": "0.1.3",
4
+ "description": "A reusable React + TypeScript AI chatbot widget with personalities and adaptive themes.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./style.css": "./dist/index.css"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "CHANGELOG.md"
20
+ ],
21
+ "keywords": [
22
+ "react",
23
+ "typescript",
24
+ "chatbot",
25
+ "ai",
26
+ "chat-widget",
27
+ "openai",
28
+ "assistant",
29
+ "adaptive-theme",
30
+ "accessibility"
31
+ ],
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/A-Purple-Wiz/cool-ai-chatbot.git"
35
+ },
36
+ "homepage": "https://github.com/A-Purple-Wiz/cool-ai-chatbot#readme",
37
+ "bugs": {
38
+ "url": "https://github.com/A-Purple-Wiz/cool-ai-chatbot/issues"
39
+ },
40
+ "scripts": {
41
+ "dev": "vite",
42
+ "build": "tsc -b && vite build",
43
+ "lint": "eslint .",
44
+ "preview": "vite preview",
45
+ "server": "tsx server/index.ts"
46
+ },
47
+ "peerDependencies": {
48
+ "react": "^18.0.0 || ^19.0.0",
49
+ "react-dom": "^18.0.0 || ^19.0.0"
50
+ },
51
+ "dependencies": {
52
+ "react-markdown": "^10.1.0"
53
+ },
54
+ "devDependencies": {
55
+ "@eslint/js": "^10.0.1",
56
+ "@types/cors": "^2.8.19",
57
+ "@types/express": "^5.0.6",
58
+ "@types/node": "^24.13.2",
59
+ "@types/react": "^19.2.14",
60
+ "@types/react-dom": "^19.2.3",
61
+ "@vitejs/plugin-react": "^6.0.1",
62
+ "cors": "^2.8.6",
63
+ "dotenv": "^17.4.2",
64
+ "eslint": "^10.3.0",
65
+ "eslint-plugin-react-hooks": "^7.1.1",
66
+ "eslint-plugin-react-refresh": "^0.5.2",
67
+ "express": "^5.2.1",
68
+ "globals": "^17.6.0",
69
+ "openai": "^6.42.0",
70
+ "tsx": "^4.22.4",
71
+ "typescript": "~6.0.2",
72
+ "typescript-eslint": "^8.59.2",
73
+ "vite": "^8.0.12",
74
+ "vite-plugin-dts": "^5.0.2"
75
+ }
76
+ }