@eduzz-automacoes/webchat-widget 0.0.1

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,139 @@
1
+ import type { CSSProperties, ReactElement } from 'react'
2
+
3
+ export type StorageLocation = 'localStorage' | 'sessionStorage'
4
+ export type WebchatPosition = 'bottom-right' | 'bottom-left' | 'top-left'
5
+ export type WebchatThemeMode = 'light' | 'dark'
6
+ export type WebchatThemeVariant = 'solid' | 'soft'
7
+ export type WebchatHeaderVariant = 'solid' | 'glass'
8
+ export type WebchatSessionMode = 'botpress' | 'service-hub'
9
+
10
+ export interface WebchatUserCredentials {
11
+ userId: string
12
+ userToken: string
13
+ }
14
+
15
+ export interface WebchatUserApi {
16
+ updateUserData?: (data: Record<string, unknown>) => Promise<unknown>
17
+ }
18
+
19
+ export interface EduzzWebchatCdnApi {
20
+ ready: Promise<EduzzWebchatCdnApi>
21
+ on(event: 'ready', callback: (api: EduzzWebchatCdnApi) => void): () => void
22
+ init(options?: Record<string, unknown>): void
23
+ update(options?: Record<string, unknown>): void
24
+ destroy(): void
25
+ updateUserData(data?: Record<string, unknown>): Promise<unknown>
26
+ }
27
+
28
+ declare global {
29
+ interface Window {
30
+ EduzzWebchat?: EduzzWebchatCdnApi
31
+ }
32
+ }
33
+
34
+ export interface WebchatBootstrapPayload {
35
+ clientId: string
36
+ slug: string | null
37
+ webchatProxyUrl: string
38
+ storageKey: string
39
+ defaultOpen: boolean
40
+ sessionMode: WebchatSessionMode
41
+ config: Record<string, unknown>
42
+ defaultUserData?: Record<string, unknown> | null
43
+ }
44
+
45
+ export interface WebchatConfig {
46
+ botName?: string
47
+ subtitle?: string
48
+ botAvatar?: string
49
+ color?: string
50
+ themeMode?: WebchatThemeMode
51
+ variant?: WebchatThemeVariant
52
+ headerVariant?: WebchatHeaderVariant
53
+ radius?: number
54
+ fontFamily?: string
55
+ additionalStylesheet?: string
56
+ additionalStylesheetUrl?: string
57
+ accentColor?: string
58
+ brandColor?: string
59
+ brandTextColor?: string
60
+ placeholder?: string
61
+ fabBackgroundColor?: string
62
+ fabIconColor?: string
63
+ openFabBackgroundColor?: string
64
+ openFabIconColor?: string
65
+ fabChatIconVariant?: string
66
+ primaryButtonBackgroundColor?: string
67
+ primaryButtonTextColor?: string
68
+ primaryButtonHoverBackgroundColor?: string
69
+ panelBackgroundColor?: string
70
+ panelElevatedBackgroundColor?: string
71
+ panelSubtleBackgroundColor?: string
72
+ panelMutedBackgroundColor?: string
73
+ panelHoverBackgroundColor?: string
74
+ panelSelectedBackgroundColor?: string
75
+ panelBorderColor?: string
76
+ panelStrongBorderColor?: string
77
+ panelTextColor?: string
78
+ panelMutedTextColor?: string
79
+ panelHeaderBackgroundColor?: string
80
+ welcomeBackground?: string
81
+ welcomeHeroBackground?: string
82
+ welcomeOnlineStatusColor?: string
83
+ secondaryButtonBackgroundColor?: string
84
+ secondaryButtonTextColor?: string
85
+ secondaryButtonBorderColor?: string
86
+ secondaryButtonHoverBackgroundColor?: string
87
+ iconButtonBackgroundColor?: string
88
+ iconButtonIconColor?: string
89
+ iconButtonBorderColor?: string
90
+ iconButtonHoverBackgroundColor?: string
91
+ outgoingMessageBackgroundColor?: string
92
+ outgoingMessageTextColor?: string
93
+ incomingMessageBackgroundColor?: string
94
+ incomingMessageTextColor?: string
95
+ position?: WebchatPosition
96
+ initiallyOpen?: boolean
97
+ showWelcomeScreen?: boolean
98
+ width?: string
99
+ height?: string
100
+ welcomeCoverImage?: string
101
+ welcomeCardImage?: string
102
+ welcomeCardTitle?: string
103
+ welcomeCardStatus?: string
104
+ welcomeCardDescription?: string
105
+ welcomeCtaLabel?: string
106
+ welcomeButtonDescription?: string
107
+ welcomeCloseLabel?: string
108
+ }
109
+
110
+ export interface WebchatProps {
111
+ clientId: string
112
+ webchatProxyUrl?: string
113
+ userCredentials?: WebchatUserCredentials
114
+ conversationId?: string
115
+ config?: WebchatConfig
116
+ defaultUserData?: Record<string, unknown>
117
+ presetSlug?: string
118
+ storageKey?: string
119
+ storageLocation?: StorageLocation
120
+ defaultOpen?: boolean
121
+ onUserApiChange?: (api: WebchatUserApi | null) => void
122
+ }
123
+
124
+ export declare function Webchat(props: WebchatProps): ReactElement
125
+
126
+ export declare const defaultConfig: Required<WebchatConfig>
127
+ export declare function normalizeConfig(config?: WebchatConfig): Required<WebchatConfig>
128
+ export declare function getShellStyle(config: Required<WebchatConfig>): CSSProperties
129
+ export declare function getBotpressTheme(config: Required<WebchatConfig>): {
130
+ color: string
131
+ fontFamily: string
132
+ radius: number
133
+ themeMode: WebchatThemeMode
134
+ variant: WebchatThemeVariant
135
+ headerVariant: WebchatHeaderVariant
136
+ additionalStylesheet: string
137
+ additionalStylesheetUrl: string
138
+ }
139
+ export declare function getContrastingTextColor(value: string): string
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ :host{all:initial}.bp-webchat-shell *,.bp-webchat-shell *:before,.bp-webchat-shell *:after{box-sizing:border-box}.bp-webchat-shell{position:fixed;z-index:2147483000;display:flex;flex-direction:column;align-items:var(--widget-align, flex-end);gap:16px;width:min(var(--widget-width),calc(100vw - 24px));font-family:Inter,Segoe UI,sans-serif;--ui-bg: var(--panel-background-color, #ffffff);--ui-bg-elevated: var(--panel-elevated-background-color, #ffffff);--ui-bg-subtle: var(--panel-subtle-background-color, #fafafa);--ui-bg-muted: var(--panel-muted-background-color, #f4f4f5);--ui-bg-hover: var(--panel-hover-background-color, #f4f4f5);--ui-bg-selected: var(--panel-selected-background-color, #f5f5f5);--ui-border: var(--panel-border-color, #e4e4e7);--ui-border-strong: var(--panel-strong-border-color, #d4d4d8);--ui-text: var(--panel-text-color, #18181b);--ui-text-muted: var(--panel-muted-text-color, #71717a);--ui-primary: var(--primary-button-background-color, #18181b);--ui-primary-hover: var(--primary-button-hover-background-color, #27272a);--ui-primary-text: var(--primary-button-text-color, #fafafa);--ui-secondary: var(--secondary-button-background-color, #ffffff);--ui-secondary-hover: var(--secondary-button-hover-background-color, #f4f4f5);--ui-secondary-text: var(--secondary-button-text-color, #18181b);--ui-secondary-border: var(--secondary-button-border-color, #e4e4e7);--ui-icon-button-bg: var(--icon-button-background-color, #ffffff);--ui-icon-button-hover: var(--icon-button-hover-background-color, #f4f4f5);--ui-icon-button-color: var(--icon-button-icon-color, #71717a);--ui-icon-button-border: var(--icon-button-border-color, #e4e4e7);--ui-ring: 0 0 0 3px rgba(24, 24, 27, .08);--ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);--ui-shadow-md: 0 12px 32px rgba(15, 23, 42, .1);--ui-radius-sm: 10px;--ui-radius-md: 12px;--ui-radius-lg: 16px}.bp-webchat-panel{position:relative;overflow:hidden;width:100%;height:var(--widget-height);border:1px solid var(--ui-border);border-radius:24px;background:var(--ui-bg);box-shadow:0 18px 50px #0f172a1f;opacity:0;transform:translateY(12px) scale(.98);transform-origin:var(--panel-transform-origin, right bottom);transition:opacity .22s cubic-bezier(.22,1,.36,1),transform .22s cubic-bezier(.22,1,.36,1);will-change:opacity,transform}.bp-webchat-panel[data-state=open]{opacity:1;transform:translateY(0) scale(1)}.bp-webchat-panel[data-state=closed]{pointer-events:none}.bp-webchat-error{padding:18px;border-radius:20px;background:#fff7ed;color:#9a3412;line-height:1.6;font-size:.95rem;box-shadow:0 20px 40px #0f172a1f}.bp-webchat-layout{position:relative;display:flex;flex-direction:column;width:100%;height:100%;background:var(--ui-bg)}.bp-webchat-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 16px 14px;border-bottom:1px solid var(--ui-border);background:var(--panel-header-background-color, rgba(255, 255, 255, .96))}.bp-webchat-header-meta{display:flex;align-items:center;min-width:0;gap:12px}.bp-webchat-header-actions{display:inline-flex;align-items:center;gap:6px}.bp-webchat-avatar{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex:0 0 auto;border-radius:999px;background:var(--header-avatar-bg, var(--accent-color));color:var(--header-avatar-text, #ffffff);font-size:1rem;font-weight:700;text-transform:uppercase;overflow:hidden}.bp-webchat-avatar img{width:100%;height:100%;object-fit:cover}.bp-webchat-header-text{min-width:0}.bp-webchat-header-title{margin:0;color:var(--ui-text);font-size:.96rem;line-height:1.2;font-weight:600}.bp-webchat-header-subtitle{margin:4px 0 0;color:var(--ui-text-muted);font-size:.84rem;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bp-webchat-welcome{position:relative;display:flex;flex-direction:column;height:100%;overflow:hidden;background:var( --welcome-background, linear-gradient(180deg, #f4f4f5 0%, #fafafa 34%, #ffffff 34%, #ffffff 100%) )}.bp-webchat-welcome-hero{position:relative;min-height:184px;background:var( --welcome-hero-background, linear-gradient(180deg, #f5f5f5 0%, #efeff1 100%) );overflow:hidden}.bp-webchat-welcome-hero:after{content:"";position:absolute;inset:0;background:#0000002e;pointer-events:none}.bp-webchat-welcome-close{position:absolute;top:14px;right:14px;z-index:3}.bp-webchat-welcome-cover{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center top}.bp-webchat-welcome-card-wrap{position:relative;margin-top:-24px;padding:0 16px;z-index:2}.bp-webchat-welcome-card{position:relative;border-radius:22px;background:var(--ui-bg-elevated);box-shadow:var(--ui-shadow-md);border:1px solid var(--ui-border);padding:68px 22px 18px}.bp-webchat-welcome-card-badge{position:absolute;top:-34px;left:50%;transform:translate(-50%);display:grid;place-items:center;width:84px;height:84px;border-radius:999px;background:var(--header-avatar-bg, var(--accent-color));box-shadow:var(--ui-shadow-sm);overflow:hidden;border:1px solid color-mix(in srgb,var(--header-avatar-bg, var(--accent-color)) 78%,var(--ui-bg-elevated))}.bp-webchat-welcome-card-badge img{width:100%;height:100%;object-fit:cover}.bp-webchat-welcome-card-badge span{color:var(--header-avatar-text, #ffffff);font-size:2rem;font-weight:700}.bp-webchat-welcome-card-title{margin:0;color:var(--ui-text);font-size:1rem;line-height:1.15;font-weight:700;text-wrap:balance}.bp-webchat-welcome-card-status{margin:10px 0 0;color:var(--ui-text-muted);font-size:.88rem;line-height:1.4}.bp-webchat-welcome-card-status strong{color:var(--welcome-online-status-color, #16a34a);font-weight:700}.bp-webchat-welcome-card-description{margin:14px 0 0;color:var(--ui-text-muted);font-size:.94rem;line-height:1.62;max-width:30ch}.bp-webchat-welcome-cta{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin-top:22px;padding:14px 16px;border:1px solid var(--ui-primary);border-radius:var(--ui-radius-lg);box-shadow:var(--ui-shadow-sm);color:var(--ui-primary-text);font:inherit;font-size:.98rem;font-weight:600;cursor:pointer;background:var(--ui-primary);text-align:left;transition:transform .14s ease,box-shadow .14s ease,background .14s ease,border-color .14s ease}.bp-webchat-welcome-cta:hover{transform:translateY(-1px);border-color:var(--ui-primary-hover);background:var(--ui-primary-hover);box-shadow:0 10px 20px #0f172a1f}.bp-webchat-welcome-cta-left{display:inline-flex;align-items:center;gap:12px}.bp-webchat-welcome-cta-copy{display:grid;gap:2px}.bp-webchat-welcome-cta-title{color:inherit;font-size:.98rem;font-weight:600;line-height:1.2}.bp-webchat-welcome-cta-description{color:color-mix(in srgb,var(--ui-primary-text) 74%,transparent);font-size:.82rem;line-height:1.35;font-weight:500}.bp-webchat-welcome-cta-right{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 auto;color:inherit;border-radius:999px;background:color-mix(in srgb,var(--ui-primary-text) 10%,transparent)}.bp-webchat-welcome-cta-right svg{width:18px;height:18px}.bp-webchat-tabs,.bp-webchat-welcome-bottom{margin-top:auto;border-top:1px solid var(--ui-border);display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:6px;background:var(--ui-bg)}.bp-webchat-tab,.bp-webchat-welcome-tab{border:0;background:transparent;display:grid;justify-items:center;gap:4px;padding:9px 8px;color:var(--ui-text-muted);font-size:.84rem;font-family:inherit;font-weight:500;cursor:pointer;border-radius:var(--ui-radius-md);transition:color .14s ease,background .14s ease,box-shadow .14s ease}.bp-webchat-tab:hover,.bp-webchat-welcome-tab:hover{background:var(--ui-bg-hover)}.bp-webchat-tab[data-active=true],.bp-webchat-welcome-tab[data-active=true]{color:var(--ui-text);background:transparent;box-shadow:none}.bp-webchat-tab-icon,.bp-webchat-welcome-tab-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:999px;color:inherit;background:transparent;transition:background .14s ease,transform .14s ease}.bp-webchat-tab:hover .bp-webchat-tab-icon,.bp-webchat-welcome-tab:hover .bp-webchat-welcome-tab-icon{transform:translateY(-1px)}.bp-webchat-tab[data-active=true] .bp-webchat-tab-icon,.bp-webchat-welcome-tab[data-active=true] .bp-webchat-welcome-tab-icon{background:transparent}.bp-webchat-tab-icon svg,.bp-webchat-welcome-tab-icon svg{width:15px;height:15px}.bp-webchat-icon-button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex:0 0 auto;border:1px solid var(--ui-icon-button-border);border-radius:999px;background:var(--ui-icon-button-bg);color:var(--ui-icon-button-color);cursor:pointer;box-shadow:var(--ui-shadow-sm);transition:background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease}.bp-webchat-icon-button:hover{background:var(--ui-icon-button-hover);border-color:var(--ui-icon-button-border);color:var(--ui-text)}.bp-webchat-icon-button:focus-visible,.bp-webchat-tab:focus-visible,.bp-webchat-welcome-tab:focus-visible,.bp-webchat-welcome-cta:focus-visible,.bp-webchat-history-item:focus-visible,.bp-webchat-history-new:focus-visible,.bp-webchat-modal-button:focus-visible{outline:0;box-shadow:var(--ui-ring)}.bp-webchat-icon-button svg{width:20px;height:20px}.bp-webchat-mobile-close{display:none}.bp-webchat-container.bpContainer{height:100%;max-height:none;border-radius:0;border-color:var(--ui-border);background:var(--ui-bg);color:var(--ui-text);box-shadow:none}.bp-webchat-container .bpHeader{display:none}.bp-webchat-container .bpMessageListContainer,.bp-webchat-container .bpMessageListViewport,.bp-webchat-container .bpMessageListMarqueeContainer{background:var(--ui-bg);color:var(--ui-text)}.bp-webchat-container .bpMessageListContainer{padding-top:0;background:var(--ui-bg);--bpPrimary-600: var(--header-avatar-bg, var(--accent-color));--bpPrimary-50: var(--header-avatar-text, #ffffff);--message-bg: var(--outgoing-message-background-color, #ebf1fd);--message-text: var(--outgoing-message-text-color, #0f2346)}.bp-webchat-container .bpMessageListMarqueeContainer:only-child{margin-block:auto;padding-block:0}.bp-webchat-container .bpMessageListMarqueeTitle{color:var(--ui-text)}.bp-webchat-container .bpMessageListMarqueeDescription,.bp-webchat-container .bpMessageListHeaderMessage{color:var(--ui-text-muted)}.bp-webchat-container .bpMessageListScrollDownButton{z-index:1}.bp-webchat-container .bpMessageBlocksBubble[data-direction=incoming]{background-color:var(--incoming-message-background-color, #f0f0f3);color:var(--incoming-message-text-color, #202127)}.bp-webchat-container .bpMessageBlocksBubble[data-direction=outgoing]{background-color:var(--outgoing-message-background-color, #ebf1fd);color:var(--outgoing-message-text-color, #0f2346)}.bp-webchat-container .bpComposer{border-top:1px solid var(--ui-border);background:var(--ui-bg);padding:12px 14px 14px}.bp-webchat-container .bpComposerWrapper,.bp-webchat-container .bpComposerContainer{border:0;background:transparent;box-shadow:none}.bp-webchat-container .bpComposerContainer{gap:10px;padding:0;outline:none}.bp-webchat-container .bpComposerContainer:focus-within,.bp-webchat-container .bpComposerContainer[data-waiting=true]{outline:none;box-shadow:none}.bp-webchat-container .bpComposerInputContainer{border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-bg-elevated);box-shadow:var(--ui-shadow-sm);overflow:hidden;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.bp-webchat-container .bpComposerInputContainer:focus-within{border-color:var(--ui-border-strong);box-shadow:var(--ui-ring)}.bp-webchat-container .bpComposerInput{color:var(--ui-text);font-size:.95rem}.bp-webchat-container .bpComposerInput::placeholder{color:var(--ui-text-muted)}.bp-webchat-container .bpComposerSendButton{border-radius:12px;background:var(--ui-primary);color:var(--ui-primary-text);box-shadow:var(--ui-shadow-sm)}.bp-webchat-container .bpComposerSendButton:hover{background:var(--ui-primary-hover)}.bp-webchat-container .bpComposerUploadButton,.bp-webchat-container .bpComposerVoiceButton{border:1px solid var(--ui-icon-button-border);border-radius:12px;background:var(--ui-icon-button-bg);color:var(--ui-icon-button-color);box-shadow:var(--ui-shadow-sm)}.bp-webchat-container .bpComposerUploadButton:hover,.bp-webchat-container .bpComposerVoiceButton:hover{background:var(--ui-icon-button-hover);border-color:var(--ui-icon-button-border);color:var(--ui-text)}.bp-webchat-container .bpComposerFileAttachement{border-color:var(--ui-border);border-radius:12px;background:var(--ui-bg-elevated);box-shadow:none}.bp-webchat-container .bpComposerFileAttachement:hover{border-color:var(--ui-border-strong)}.bp-webchat-container .bpComposerFileIconWrapper{border-color:var(--ui-border);background:var(--ui-bg-subtle)}.bp-webchat-container .bpComposerFileName{color:var(--ui-text)}.bp-webchat-container .bpComposerFileExtension,.bp-webchat-container .bpComposerFooter{color:var(--ui-text-muted)}.bp-webchat-container .bpMessageListMarqueeAvatarFallback,.bp-webchat-container .bpMessageAvatarFallback,.bp-webchat-container .bpHeaderContentAvatarFallback,.bp-webchat-container .bpMessagePreviewAvatarFallback,.bp-webchat-container .bpConversationHistoryConversationAvatarFallback{background-color:var(--header-avatar-bg, var(--accent-color))!important;color:var(--header-avatar-text, #ffffff)!important}.bp-webchat-history{display:flex;flex-direction:column;height:100%;background:var(--ui-bg)}.bp-webchat-history-header{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--ui-border)}.bp-webchat-history-title{margin:0;color:var(--ui-text);font-size:1rem;font-weight:600}.bp-webchat-history-list{flex:1;overflow:auto;padding:8px}.bp-webchat-history-empty,.bp-webchat-history-loading{display:grid;place-items:center;min-height:220px;padding:24px;color:var(--ui-text-muted);text-align:center;line-height:1.6}.bp-webchat-history-item{width:100%;display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:14px;border:1px solid transparent;border-radius:14px;background:var(--ui-bg);color:inherit;text-align:left;cursor:pointer;font:inherit;transition:background .14s ease,border-color .14s ease,box-shadow .14s ease}.bp-webchat-history-item+.bp-webchat-history-item{margin-top:8px}.bp-webchat-history-item:hover{background:var(--ui-bg-subtle);border-color:var(--ui-border)}.bp-webchat-history-avatar{display:grid;place-items:center;width:48px;height:48px;border-radius:999px;overflow:hidden;background:var(--ui-bg-muted);color:var(--ui-text-muted);font-size:1rem;font-weight:700;flex:0 0 auto;border:1px solid var(--ui-border)}.bp-webchat-history-avatar[data-kind=bot]{background:var(--header-avatar-bg, var(--accent-color));color:var(--header-avatar-text, #ffffff);border-color:color-mix(in srgb,var(--header-avatar-bg, var(--accent-color)) 76%,var(--ui-bg-elevated))}.bp-webchat-history-avatar img{width:100%;height:100%;object-fit:cover}.bp-webchat-history-avatar svg{width:20px;height:20px}.bp-webchat-history-content{min-width:0;display:grid;gap:4px}.bp-webchat-history-name{color:var(--ui-text);font-size:.93rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bp-webchat-history-time{color:var(--ui-text-muted);font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bp-webchat-history-chevron{color:var(--ui-text-muted)}.bp-webchat-history-chevron svg{width:20px;height:20px}.bp-webchat-history-footer{padding:12px 16px 16px;border-top:1px solid var(--ui-border);background:var(--ui-bg)}.bp-webchat-history-new{width:100%;display:inline-flex;align-items:center;justify-content:center;gap:10px;border:1px solid var(--ui-primary);border-radius:14px;padding:13px 16px;background:var(--ui-primary);color:var(--ui-primary-text);font:inherit;font-size:.94rem;font-weight:600;cursor:pointer;box-shadow:var(--ui-shadow-sm);transition:background .14s ease,border-color .14s ease,transform .14s ease}.bp-webchat-history-new:hover{background:var(--ui-primary-hover);border-color:var(--ui-primary-hover);transform:translateY(-1px)}.bp-webchat-history-new svg{width:20px;height:20px}.bp-webchat-loading{display:flex;flex-direction:column;gap:18px;padding:22px 18px 18px;height:100%;background:var(--ui-bg)}.bp-webchat-loading-hero{display:grid;place-items:center;gap:14px;padding:12px 0 18px}.bp-webchat-loading-circle{width:86px;height:86px;border-radius:999px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent-color) 16%,transparent),color-mix(in srgb,var(--accent-color) 32%,transparent))}.bp-webchat-loading-line{border-radius:999px;background:linear-gradient(90deg,var(--ui-bg-muted) 0%,var(--ui-bg-subtle) 50%,var(--ui-bg-muted) 100%);background-size:200% 100%;animation:bp-webchat-shimmer 1.5s linear infinite}.bp-webchat-loading-line--title{width:120px;height:16px}.bp-webchat-loading-line--subtitle{width:170px;height:12px}.bp-webchat-loading-bubble{max-width:82%;padding:16px;border-radius:18px 18px 18px 6px;background:var(--ui-bg-muted)}.bp-webchat-loading-bubble--right{margin-left:auto;border-radius:18px 18px 6px;background:var(--ui-bg-subtle)}.bp-webchat-loading-bubble .bp-webchat-loading-line+.bp-webchat-loading-line{margin-top:10px}.bp-webchat-loading-composer{margin-top:auto;display:flex;align-items:center;gap:12px;padding-top:8px}.bp-webchat-loading-input{flex:1;height:50px;border-radius:14px;background:var(--ui-bg);border:1px solid var(--ui-border)}.bp-webchat-loading-mic{width:42px;height:42px;border-radius:999px;background:var(--ui-bg);border:1px solid var(--ui-border)}@keyframes bp-webchat-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.bp-webchat-fab{position:relative;width:64px;height:64px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:999px;cursor:pointer;color:var(--fab-icon-color, #ffffff);box-shadow:0 14px 28px #0f172a1f;transition:transform .18s ease,box-shadow .18s ease,background .18s ease;background:var(--fab-background-color, var(--accent-color));overflow:hidden}.bp-webchat-fab:hover{transform:translateY(-2px);box-shadow:0 18px 32px #0f172a29}.bp-webchat-fab:focus-visible{outline:0;box-shadow:0 0 0 4px #ffffffe0,0 0 0 7px #2563eb2e,0 18px 36px #0f172a2e}.bp-webchat-fab:before{content:"";position:absolute;inset:1px;border-radius:999px;background:linear-gradient(180deg,#ffffff2e,#fff0);pointer-events:none}.bp-webchat-fab-icon{position:absolute;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .18s ease,transform .18s ease;will-change:opacity,transform}.bp-webchat-fab-icon svg{position:relative;z-index:1;width:24px;height:24px}.bp-webchat-fab-icon--chat{opacity:1;transform:scale(1) rotate(0)}.bp-webchat-fab-icon--chat svg{width:30px;height:30px}.bp-webchat-fab-icon--close{opacity:0;transform:scale(.72) rotate(-90deg)}.bp-webchat-fab[data-open=true] .bp-webchat-fab-icon--chat{opacity:0;transform:scale(.72) rotate(90deg)}.bp-webchat-fab[data-open=true] .bp-webchat-fab-icon--close{opacity:1;transform:scale(1) rotate(0)}.bpMessageBlocksBubbleFeedbackIcon svg{width:14px;height:14px}.bp-webchat-modal-backdrop{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;padding:18px;overflow:hidden;border-radius:inherit;background:linear-gradient(180deg,color-mix(in srgb,var(--ui-bg-elevated) 24%,transparent),color-mix(in srgb,var(--ui-text) 16%,transparent));backdrop-filter:blur(10px) saturate(1.04);-webkit-backdrop-filter:blur(10px) saturate(1.04);z-index:20}.bp-webchat-modal{width:100%;max-width:360px;border:1px solid var(--ui-border);border-radius:18px;background:var(--ui-bg-elevated);box-shadow:var(--ui-shadow-md);overflow:hidden}.bp-webchat-modal-title{margin:0;padding:20px 20px 8px;text-align:left;color:var(--ui-text);font-size:1rem;line-height:1.3;font-weight:600}.bp-webchat-modal-description{margin:0;padding:0 20px 16px;text-align:left;color:var(--ui-text-muted);font-size:.9rem;line-height:1.55}.bp-webchat-modal-field-wrap{padding:0 20px 16px}.bp-webchat-modal-textarea{width:100%;min-height:96px;resize:vertical;border-radius:var(--ui-radius-md);border:1px solid var(--ui-border);background:var(--ui-bg-subtle);padding:12px 14px;font:inherit;color:var(--ui-text);outline:0;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.bp-webchat-modal-textarea::placeholder{color:var(--ui-text-muted)}.bp-webchat-modal-textarea:focus{border-color:var(--ui-border-strong);box-shadow:var(--ui-ring);background:var(--ui-bg)}.bp-webchat-modal-actions{display:grid;gap:12px;padding:0 20px 20px}.bp-webchat-modal-button{width:100%;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius-md);padding:12px 16px;font:inherit;font-size:.94rem;font-weight:600;cursor:pointer;color:var(--ui-secondary-text);background:var(--ui-secondary);box-shadow:var(--ui-shadow-sm);transition:transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease,color .14s ease}.bp-webchat-modal-button:hover{transform:translateY(-1px);border-color:var(--ui-secondary-border);background:var(--ui-secondary-hover)}.bp-webchat-modal-button--primary{border-color:var(--ui-primary);color:var(--ui-primary-text);background:var(--ui-primary)}.bp-webchat-modal-button--primary:hover{border-color:var(--ui-primary-hover);background:var(--ui-primary-hover)}@media(max-width:640px){.bp-webchat-shell{width:calc(100vw - 24px)}.bp-webchat-panel{height:min(var(--widget-height),calc(100vh - 120px))}.bp-webchat-welcome-card{padding-left:20px;padding-right:20px}.bp-webchat-welcome-card-description{max-width:none}.bp-webchat-shell[data-panel-mounted=true]{inset:0!important;width:100vw!important;max-width:100vw!important;height:100vh;height:100dvh;gap:0}.bp-webchat-shell[data-panel-mounted=true] .bp-webchat-panel{width:100%;height:100%;border:0;border-radius:0;box-shadow:none;transform:none}.bp-webchat-shell[data-panel-mounted=true] .bp-webchat-fab{display:none}.bp-webchat-mobile-close{display:inline-flex}}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@eduzz-automacoes/webchat-widget",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Eduzz Webchat library for React/npm and CDN integration",
7
+ "main": "./dist/eduzz-webchat.cjs",
8
+ "module": "./dist/eduzz-webchat.js",
9
+ "types": "./dist/index.d.ts",
10
+ "style": "./dist/style.css",
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/eduzz-webchat.js",
19
+ "require": "./dist/eduzz-webchat.cjs"
20
+ },
21
+ "./style.css": "./dist/style.css"
22
+ },
23
+ "scripts": {
24
+ "build": "vite build && cp src/index.d.ts dist/index.d.ts",
25
+ "prepack": "pnpm build"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "peerDependencies": {
31
+ "react": ">=18",
32
+ "react-dom": ">=18"
33
+ },
34
+ "dependencies": {
35
+ "@botpress/webchat": "^4.4.9",
36
+ "lucide-react": "^0.558.0"
37
+ },
38
+ "devDependencies": {
39
+ "@vitejs/plugin-react": "^5.1.1",
40
+ "react": "^19.2.0",
41
+ "react-dom": "^19.2.0",
42
+ "vite": "^7.2.4"
43
+ }
44
+ }